Skip to content

Commit f126f41

Browse files
committed
Merge tag 'drm-misc-fixes-2023-04-20-2' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull: * nouveau: fix dma-resv timeout * rockchip: fix suspend/resume * sched: fix timeout handling Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20230420083114.GA17651@linux-uq9g
2 parents 6a8f57a + b63a553 commit f126f41

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

drivers/gpu/drm/nouveau/nouveau_gem.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,15 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
645645
struct drm_nouveau_gem_pushbuf_reloc *reloc,
646646
struct drm_nouveau_gem_pushbuf_bo *bo)
647647
{
648-
long ret = 0;
648+
int ret = 0;
649649
unsigned i;
650650

651651
for (i = 0; i < req->nr_relocs; i++) {
652652
struct drm_nouveau_gem_pushbuf_reloc *r = &reloc[i];
653653
struct drm_nouveau_gem_pushbuf_bo *b;
654654
struct nouveau_bo *nvbo;
655655
uint32_t data;
656+
long lret;
656657

657658
if (unlikely(r->bo_index >= req->nr_buffers)) {
658659
NV_PRINTK(err, cli, "reloc bo index invalid\n");
@@ -703,13 +704,18 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
703704
data |= r->vor;
704705
}
705706

706-
ret = dma_resv_wait_timeout(nvbo->bo.base.resv,
707-
DMA_RESV_USAGE_BOOKKEEP,
708-
false, 15 * HZ);
709-
if (ret == 0)
707+
lret = dma_resv_wait_timeout(nvbo->bo.base.resv,
708+
DMA_RESV_USAGE_BOOKKEEP,
709+
false, 15 * HZ);
710+
if (!lret)
710711
ret = -EBUSY;
712+
else if (lret > 0)
713+
ret = 0;
714+
else
715+
ret = lret;
716+
711717
if (ret) {
712-
NV_PRINTK(err, cli, "reloc wait_idle failed: %ld\n",
718+
NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n",
713719
ret);
714720
break;
715721
}

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ static void vop2_enable(struct vop2 *vop2)
839839
return;
840840
}
841841

842+
regcache_sync(vop2->map);
843+
842844
if (vop2->data->soc_id == 3566)
843845
vop2_writel(vop2, RK3568_OTP_WIN_EN, 1);
844846

@@ -867,6 +869,8 @@ static void vop2_disable(struct vop2 *vop2)
867869

868870
pm_runtime_put_sync(vop2->dev);
869871

872+
regcache_mark_dirty(vop2->map);
873+
870874
clk_disable_unprepare(vop2->aclk);
871875
clk_disable_unprepare(vop2->hclk);
872876
}

drivers/gpu/drm/scheduler/sched_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ static void drm_sched_start_timeout(struct drm_gpu_scheduler *sched)
308308
*/
309309
void drm_sched_fault(struct drm_gpu_scheduler *sched)
310310
{
311-
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);
311+
if (sched->ready)
312+
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);
312313
}
313314
EXPORT_SYMBOL(drm_sched_fault);
314315

0 commit comments

Comments
 (0)