Skip to content

Commit abbb127

Browse files
author
CKI KWF Bot
committed
Merge: RHEL 9.8: DRM Main Backport (6.16)
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7322 ## Overview The DRM backport's goal is to backport all the changes in the DRM subsystem to the kernel target version, with the biggest value being that we get the upstream hardware enablement (and bug fixes) into RHEL. The first step of the DRM backport is identifying dependencies of the DRM backport outside of `drivers/gpu`. Done in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7321 for kernel 6.16. This MR is the second step: Backporting the changes in the DRM subsystem. ## Omitted fixes: #### Non applicable changes: amdxdna driver is not supported: \ Omitted-fix: a600794 Panfrost driver is not supported: \ Omitted-fix: e48ade5 \ Omitted-fix: 54d4f44 etnaviv driver is not supported: \ Omitted-fix: bb7f497 Documentation files not present in this tree: \ Omitted-fix: f9e4d8b \ Omitted-fix: 553ab30 drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c is not present in this tree: \ Omitted-fix: d13e959 drivers/gpu/drm/tiny/st7571-i2c.c is not present in this tree: \ Omitted-fix: b389df0 the affected commit is not backported: \ Omitted-fix: 44b6535 Change already included: \ Omitted-fix: 36b0bc1 #### Backported by 6.17 These fixes will be backported by the 6.17 backport (https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7329): Omitted-fix: ee38ea0 \ Omitted-fix: 9a9e87d \ Omitted-fix: db2e7bc \ Omitted-fix: 1b556bc \ Omitted-fix: 9af8f2b \ Omitted-fix: 942ac8d \ Omitted-fix: 5fb9042 \ Omitted-fix: a73345b \ Omitted-fix: a886d26 \ Omitted-fix: fd56b9c \ Omitted-fix: a3f7d26 \ Omitted-fix: 658a1c8 \ Omitted-fix: 8a30114 \ Omitted-fix: 3271faf \ Omitted-fix: 2cb66ae \ Omitted-fix: 9c28830 \ Omitted-fix: 7a5b69d \ Omitted-fix: 8e6a18c \ Omitted-fix: 8bed4ec \ Omitted-fix: 7551865 \ Omitted-fix: fe69a39 \ Omitted-fix: 8e6a18c \ Omitted-fix: 9d7a1cb \ Omitted-fix: 4126cb3 \ Omitted-fix: 145832f \ Omitted-fix: d115a63 \ Omitted-fix: 989fe67 \ Omitted-fix: 7a2ca2e \ Omitted-fix: 0b93b7d \ Omitted-fix: 3eb61d7 \ Omitted-fix: 16fdb3c \ Omitted-fix: 3eb61d7 \ Omitted-fix: 16fdb3c \ Omitted-fix: d848203 \ Omitted-fix: eb5723a \ Omitted-fix: 7934fdc \ Omitted-fix: a600794 \ Omitted-fix: e48ade5 \ Omitted-fix: 54d4f44 \ Omitted-fix: bb7f497 \ Omitted-fix: 553ab30 \ Omitted-fix: d13e959 \ Omitted-fix: b389df0 \ Omitted-fix: 44b6535 \ Omitted-fix: 36b0bc1 \ Omitted-fix: f9e4d8b \ Omitted-fix: 77c8ede \ Omitted-fix: ff89a4d \ Omitted-fix: 500dad4 \ Omitted-fix: fef8b64 \ Omitted-fix: b67e742 \ Omitted-fix: b67e742 #### Backported by 6.18 These fixes will be included in the 6.18 backport: Omitted-fix: 38b34e9 \ Omitted-fix: 9b7ca35 \ Omitted-fix: d3d73bd \ Omitted-fix: 9337166 \ Omitted-fix: bf4e4b9 \ Omitted-fix: 77a62e5 \ Omitted-fix: 04864af \ Omitted-fix: 5993345 \ Omitted-fix: d9b2623 \ Omitted-fix: 58364f0 \ Omitted-fix: 58e6fc2 \ Omitted-fix: ef38b4e \ Omitted-fix: 2343750 \ Omitted-fix: 6a91af2 \ Omitted-fix: 225bc03 \ Omitted-fix: 9e05c8d \ Omitted-fix: 382bd6a \ Omitted-fix: 382bd6a \ Omitted-fix: 382bd6a ## Other: Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7321 JIRA: https://issues.redhat.com/browse/RHEL-110619 Signed-off-by: José Expósito <jexposit@redhat.com> Approved-by: Enric Balletbo i Serra <eballetbo@redhat.com> Approved-by: Jan Stancek <jstancek@redhat.com> Approved-by: Anusha Srivatsa <asrivats@redhat.com> Approved-by: David Airlie <airlied@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 7576bc3 + fe5fd9e commit abbb127

File tree

1,505 files changed

+63225
-33689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,505 files changed

+63225
-33689
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NAME = Opossums on Parade
88
# DRM backport version
99
#
1010
RHEL_DRM_VERSION = 6
11-
RHEL_DRM_PATCHLEVEL = 15
11+
RHEL_DRM_PATCHLEVEL = 16
1212
RHEL_DRM_SUBLEVEL =
1313

1414
# *DOCUMENTATION*

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ int ivpu_boot(struct ivpu_device *vdev)
374374
{
375375
int ret;
376376

377+
drm_WARN_ON(&vdev->drm, atomic_read(&vdev->job_timeout_counter));
378+
drm_WARN_ON(&vdev->drm, !xa_empty(&vdev->submitted_jobs_xa));
379+
377380
/* Update boot params located at first 4KB of FW memory */
378381
ivpu_fw_boot_params_setup(vdev, ivpu_bo_vaddr(vdev->fw->mem));
379382

@@ -573,6 +576,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
573576
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
574577
vdev->context_xa_limit.max = IVPU_USER_CONTEXT_MAX_SSID;
575578
atomic64_set(&vdev->unique_id_counter, 0);
579+
atomic_set(&vdev->job_timeout_counter, 0);
576580
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC | XA_FLAGS_LOCK_IRQ);
577581
xa_init_flags(&vdev->submitted_jobs_xa, XA_FLAGS_ALLOC1);
578582
xa_init_flags(&vdev->db_xa, XA_FLAGS_ALLOC1);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct ivpu_device {
154154
struct mutex submitted_jobs_lock; /* Protects submitted_jobs */
155155
struct xarray submitted_jobs_xa;
156156
struct ivpu_ipc_consumer job_done_consumer;
157+
atomic_t job_timeout_counter;
157158

158159
atomic64_t unique_id_counter;
159160

drivers/accel/ivpu/ivpu_fw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct ivpu_fw_info {
3939
u64 read_only_addr;
4040
u32 read_only_size;
4141
u32 sched_mode;
42+
u64 last_heartbeat;
4243
};
4344

4445
int ivpu_fw_init(struct ivpu_device *vdev);

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo, con
3030
"%6s: bo %8p vpu_addr %9llx size %8zu ctx %d has_pages %d dma_mapped %d mmu_mapped %d wc %d imported %d\n",
3131
action, bo, bo->vpu_addr, ivpu_bo_size(bo), bo->ctx_id,
3232
(bool)bo->base.pages, (bool)bo->base.sgt, bo->mmu_mapped, bo->base.map_wc,
33-
(bool)bo->base.base.import_attach);
33+
(bool)drm_gem_is_imported(&bo->base.base));
3434
}
3535

3636
static inline int ivpu_bo_lock(struct ivpu_bo *bo)
@@ -130,7 +130,7 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo)
130130
bo->ctx = NULL;
131131
}
132132

133-
if (bo->base.base.import_attach)
133+
if (drm_gem_is_imported(&bo->base.base))
134134
return;
135135

136136
if (bo->base.sgt) {
@@ -294,7 +294,7 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj)
294294
drm_WARN_ON(&vdev->drm, bo->mmu_mapped);
295295
drm_WARN_ON(&vdev->drm, bo->ctx);
296296

297-
drm_WARN_ON(obj->dev, bo->base.pages_use_count > 1);
297+
drm_WARN_ON(obj->dev, refcount_read(&bo->base.pages_use_count) > 1);
298298
drm_gem_shmem_free(&bo->base);
299299
}
300300

@@ -377,7 +377,7 @@ ivpu_bo_create(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
377377

378378
if (flags & DRM_IVPU_BO_MAPPABLE) {
379379
ivpu_bo_lock(bo);
380-
ret = drm_gem_shmem_vmap(&bo->base, &map);
380+
ret = drm_gem_shmem_vmap_locked(&bo->base, &map);
381381
ivpu_bo_unlock(bo);
382382

383383
if (ret)
@@ -402,7 +402,7 @@ void ivpu_bo_free(struct ivpu_bo *bo)
402402

403403
if (bo->flags & DRM_IVPU_BO_MAPPABLE) {
404404
ivpu_bo_lock(bo);
405-
drm_gem_shmem_vunmap(&bo->base, &map);
405+
drm_gem_shmem_vunmap_locked(&bo->base, &map);
406406
ivpu_bo_unlock(bo);
407407
}
408408

@@ -476,7 +476,7 @@ static void ivpu_bo_print_info(struct ivpu_bo *bo, struct drm_printer *p)
476476
if (bo->mmu_mapped)
477477
drm_printf(p, " mmu_mapped");
478478

479-
if (bo->base.base.import_attach)
479+
if (drm_gem_is_imported(&bo->base.base))
480480
drm_printf(p, " imported");
481481

482482
drm_printf(p, "\n");

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module_param_named(tdr_timeout_ms, ivpu_tdr_timeout_ms, ulong, 0644);
3434
MODULE_PARM_DESC(tdr_timeout_ms, "Timeout for device hang detection, in milliseconds, 0 - default");
3535

3636
#define PM_RESCHEDULE_LIMIT 5
37+
#define PM_TDR_HEARTBEAT_LIMIT 30
3738

3839
static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)
3940
{
@@ -44,6 +45,7 @@ static void ivpu_pm_prepare_cold_boot(struct ivpu_device *vdev)
4445
ivpu_fw_log_reset(vdev);
4546
ivpu_fw_load(vdev);
4647
fw->entry_point = fw->cold_boot_entry_point;
48+
fw->last_heartbeat = 0;
4749
}
4850

4951
static void ivpu_pm_prepare_warm_boot(struct ivpu_device *vdev)
@@ -189,7 +191,24 @@ static void ivpu_job_timeout_work(struct work_struct *work)
189191
{
190192
struct ivpu_pm_info *pm = container_of(work, struct ivpu_pm_info, job_timeout_work.work);
191193
struct ivpu_device *vdev = pm->vdev;
194+
u64 heartbeat;
192195

196+
if (ivpu_jsm_get_heartbeat(vdev, 0, &heartbeat) || heartbeat <= vdev->fw->last_heartbeat) {
197+
ivpu_err(vdev, "Job timeout detected, heartbeat not progressed\n");
198+
goto recovery;
199+
}
200+
201+
if (atomic_fetch_inc(&vdev->job_timeout_counter) > PM_TDR_HEARTBEAT_LIMIT) {
202+
ivpu_err(vdev, "Job timeout detected, heartbeat limit exceeded\n");
203+
goto recovery;
204+
}
205+
206+
vdev->fw->last_heartbeat = heartbeat;
207+
ivpu_start_job_timeout_detection(vdev);
208+
return;
209+
210+
recovery:
211+
atomic_set(&vdev->job_timeout_counter, 0);
193212
ivpu_pm_trigger_recovery(vdev, "TDR");
194213
}
195214

@@ -204,6 +223,7 @@ void ivpu_start_job_timeout_detection(struct ivpu_device *vdev)
204223
void ivpu_stop_job_timeout_detection(struct ivpu_device *vdev)
205224
{
206225
cancel_delayed_work_sync(&vdev->pm->job_timeout_work);
226+
atomic_set(&vdev->job_timeout_counter, 0);
207227
}
208228

209229
int ivpu_pm_suspend_cb(struct device *dev)

0 commit comments

Comments
 (0)