From: Danilo Krummrich <dakr@redhat.com>
To: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de,
mripard@kernel.org
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Danilo Krummrich <dakr@redhat.com>
Subject: [PATCH drm-misc-next v3 4/4] drm/vc4: hvs: protect drm_print_regset32()
Date: Wed, 24 Aug 2022 18:13:27 +0200 [thread overview]
Message-ID: <20220824161327.330627-5-dakr@redhat.com> (raw)
In-Reply-To: <20220824161327.330627-1-dakr@redhat.com>
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: 969cfae1f01d ("drm/vc4: hvs: Protect device resources after removal")
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
---
drivers/gpu/drm/vc4/vc4_hvs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c
index 9e823e0de197..4ac9f5a2d5f9 100644
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
@@ -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",
--
2.37.2
next prev parent reply other threads:[~2022-08-24 16:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-24 16:13 [PATCH drm-misc-next v3 0/4] Fixes for vc4 hotplug rework Danilo Krummrich
2022-08-24 16:13 ` [PATCH drm-misc-next v3 1/4] drm/vc4: hdmi: unlock mutex when device is unplugged Danilo Krummrich
2022-08-24 16:13 ` [PATCH drm-misc-next v3 2/4] drm/vc4: plane: protect device resources after removal Danilo Krummrich
2022-08-24 16:13 ` [PATCH drm-misc-next v3 3/4] drm/vc4: crtc: " Danilo Krummrich
2022-08-24 16:13 ` Danilo Krummrich [this message]
2022-08-25 7:47 ` [PATCH drm-misc-next v3 0/4] Fixes for vc4 hotplug rework Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220824161327.330627-5-dakr@redhat.com \
--to=dakr@redhat.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox