drm/vc4: hvs: protect drm_print_regset32()

In vc4_hvs_dump_state() potentially freed resources are protected from
being accessed with drm_dev_enter()/drm_dev_exit().

Also include drm_print_regset32() in the protected section, since
drm_print_regset32() does access memory that is typically mapped via
devm_* calls.

Fixes: 969cfae1f0 ("drm/vc4: hvs: Protect device resources after removal")
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220824161327.330627-5-dakr@redhat.com
This commit is contained in:
Danilo Krummrich 2022-08-24 18:13:27 +02:00 committed by Maxime Ripard
parent e0c953034a
commit b3be4520d8
No known key found for this signature in database
GPG Key ID: E3EF0D6F671851C5
1 changed files with 2 additions and 2 deletions

View File

@ -71,11 +71,11 @@ void vc4_hvs_dump_state(struct vc4_hvs *hvs)
struct drm_printer p = drm_info_printer(&hvs->pdev->dev);
int idx, i;
drm_print_regset32(&p, &hvs->regset);
if (!drm_dev_enter(drm, &idx))
return;
drm_print_regset32(&p, &hvs->regset);
DRM_INFO("HVS ctx:\n");
for (i = 0; i < 64; i += 4) {
DRM_INFO("0x%08x (%s): 0x%08x 0x%08x 0x%08x 0x%08x\n",