Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/v3d: Get rid of pm code

Runtime PM doesn't seem to work correctly on this driver. On top of
that, commit 8b6864e3e138 ("drm/v3d/v3d_drv: Remove unused static
variable 'v3d_v3d_pm_ops'") hints that it most likely never did as the
driver's PM ops were not hooked-up.

So, in order to support regular operation with V3D on BCM2711 (Raspberry
Pi 4), get rid of the PM code. PM will be reinstated once we figure out
the underlying issues.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220603092610.1909675-3-pbrobinson@gmail.com

authored by

Peter Robinson and committed by
Melissa Wen
90a64adb 9c63e253

+2 -39
+1 -17
drivers/gpu/drm/v3d/v3d_debugfs.c
··· 4 4 #include <linux/circ_buf.h> 5 5 #include <linux/ctype.h> 6 6 #include <linux/debugfs.h> 7 - #include <linux/pm_runtime.h> 8 7 #include <linux/seq_file.h> 9 8 #include <linux/string_helpers.h> 10 9 ··· 130 131 struct drm_device *dev = node->minor->dev; 131 132 struct v3d_dev *v3d = to_v3d_dev(dev); 132 133 u32 ident0, ident1, ident2, ident3, cores; 133 - int ret, core; 134 - 135 - ret = pm_runtime_get_sync(v3d->drm.dev); 136 - if (ret < 0) 137 - return ret; 134 + int core; 138 135 139 136 ident0 = V3D_READ(V3D_HUB_IDENT0); 140 137 ident1 = V3D_READ(V3D_HUB_IDENT1); ··· 183 188 (misccfg & V3D_MISCCFG_OVRTMUOUT) != 0); 184 189 } 185 190 186 - pm_runtime_mark_last_busy(v3d->drm.dev); 187 - pm_runtime_put_autosuspend(v3d->drm.dev); 188 - 189 191 return 0; 190 192 } 191 193 ··· 210 218 uint32_t cycles; 211 219 int core = 0; 212 220 int measure_ms = 1000; 213 - int ret; 214 - 215 - ret = pm_runtime_get_sync(v3d->drm.dev); 216 - if (ret < 0) 217 - return ret; 218 221 219 222 if (v3d->ver >= 40) { 220 223 V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3, ··· 232 245 cycles, 233 246 cycles / (measure_ms * 1000), 234 247 (cycles / (measure_ms * 100)) % 10); 235 - 236 - pm_runtime_mark_last_busy(v3d->drm.dev); 237 - pm_runtime_put_autosuspend(v3d->drm.dev); 238 248 239 249 return 0; 240 250 }
-11
drivers/gpu/drm/v3d/v3d_drv.c
··· 19 19 #include <linux/module.h> 20 20 #include <linux/of_platform.h> 21 21 #include <linux/platform_device.h> 22 - #include <linux/pm_runtime.h> 23 22 #include <linux/reset.h> 24 23 25 24 #include <drm/drm_drv.h> ··· 42 43 { 43 44 struct v3d_dev *v3d = to_v3d_dev(dev); 44 45 struct drm_v3d_get_param *args = data; 45 - int ret; 46 46 static const u32 reg_map[] = { 47 47 [DRM_V3D_PARAM_V3D_UIFCFG] = V3D_HUB_UIFCFG, 48 48 [DRM_V3D_PARAM_V3D_HUB_IDENT1] = V3D_HUB_IDENT1, ··· 67 69 if (args->value != 0) 68 70 return -EINVAL; 69 71 70 - ret = pm_runtime_get_sync(v3d->drm.dev); 71 - if (ret < 0) 72 - return ret; 73 72 if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 && 74 73 args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) { 75 74 args->value = V3D_CORE_READ(0, offset); 76 75 } else { 77 76 args->value = V3D_READ(offset); 78 77 } 79 - pm_runtime_mark_last_busy(v3d->drm.dev); 80 - pm_runtime_put_autosuspend(v3d->drm.dev); 81 78 return 0; 82 79 } 83 80 ··· 272 279 dev_err(dev, "Failed to allocate MMU scratch page\n"); 273 280 return -ENOMEM; 274 281 } 275 - 276 - pm_runtime_use_autosuspend(dev); 277 - pm_runtime_set_autosuspend_delay(dev, 50); 278 - pm_runtime_enable(dev); 279 282 280 283 ret = v3d_gem_init(drm); 281 284 if (ret)
+1 -11
drivers/gpu/drm/v3d/v3d_gem.c
··· 6 6 #include <linux/io.h> 7 7 #include <linux/module.h> 8 8 #include <linux/platform_device.h> 9 - #include <linux/pm_runtime.h> 10 9 #include <linux/reset.h> 11 10 #include <linux/sched/signal.h> 12 11 #include <linux/uaccess.h> ··· 371 372 dma_fence_put(job->irq_fence); 372 373 dma_fence_put(job->done_fence); 373 374 374 - pm_runtime_mark_last_busy(job->v3d->drm.dev); 375 - pm_runtime_put_autosuspend(job->v3d->drm.dev); 376 - 377 375 if (job->perfmon) 378 376 v3d_perfmon_put(job->perfmon); 379 377 ··· 472 476 job->v3d = v3d; 473 477 job->free = free; 474 478 475 - ret = pm_runtime_get_sync(v3d->drm.dev); 476 - if (ret < 0) 477 - goto fail; 478 - 479 479 ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue], 480 480 v3d_priv); 481 481 if (ret) 482 - goto fail_job; 482 + goto fail; 483 483 484 484 if (has_multisync) { 485 485 if (se->in_sync_count && se->wait_stage == queue) { ··· 506 514 507 515 fail_deps: 508 516 drm_sched_job_cleanup(&job->base); 509 - fail_job: 510 - pm_runtime_put_autosuspend(v3d->drm.dev); 511 517 fail: 512 518 kfree(*container); 513 519 *container = NULL;