From: Danilo Krummrich <dakr@redhat.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH drm-misc-next 2/3] drm/vc4: plane: protect device resources after removal
Date: Fri, 19 Aug 2022 13:11:43 +0200 [thread overview]
Message-ID: <01bc2efd-7a3f-3c46-a163-5b19adc72f6e@redhat.com> (raw)
In-Reply-To: <20220819072614.dthfuugbkk65o3ps@houat>
Hi Maxime,
On 8/19/22 09:26, Maxime Ripard wrote:
> Hi,
>
> On Fri, Aug 19, 2022 at 02:29:04AM +0200, Danilo Krummrich wrote:
>> (Hardware) resources which are bound to the driver and device lifecycle
>> must not be accessed after the device and driver are unbound.
>>
>> However, the DRM device isn't freed as long as the last user closed it,
>> hence userspace can still call into the driver.
>>
>> Therefore protect the critical sections which are accessing those
>> resources with drm_dev_enter() and drm_dev_exit().
>
> Ah good catch, thanks
>
>> Fixes: 9872c7a31921 ("drm/vc4: plane: Switch to drmm_universal_plane_alloc()")
>> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
>> ---
>> drivers/gpu/drm/vc4/vc4_drv.h | 1 +
>> drivers/gpu/drm/vc4/vc4_plane.c | 25 +++++++++++++++++++++++++
>> 2 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
>> index 418a8242691f..80da9a9337cc 100644
>> --- a/drivers/gpu/drm/vc4/vc4_drv.h
>> +++ b/drivers/gpu/drm/vc4/vc4_drv.h
>> @@ -341,6 +341,7 @@ struct vc4_hvs {
>>
>> struct vc4_plane {
>> struct drm_plane base;
>> + struct drm_device *dev;
>
> That pointer already exists in struct drm_plane
Oops, I've sent a v2. Also addressing your comment from the other patch.
- Danilo
>
> Looks good otherwise
>
> Maxime
next prev parent reply other threads:[~2022-08-19 11:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 0:29 [PATCH drm-misc-next 0/3] Fixes for vc4 hotplug rework Danilo Krummrich
2022-08-19 0:29 ` [PATCH drm-misc-next 1/3] drm/vc4: hdmi: unlock mutex when device is unplugged Danilo Krummrich
2022-08-19 0:29 ` [PATCH drm-misc-next 2/3] drm/vc4: plane: protect device resources after removal Danilo Krummrich
2022-08-19 7:26 ` Maxime Ripard
2022-08-19 11:11 ` Danilo Krummrich [this message]
2022-08-19 0:29 ` [PATCH drm-misc-next 3/3] drm/vc4: crtc: " Danilo Krummrich
2022-08-19 7:29 ` 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=01bc2efd-7a3f-3c46-a163-5b19adc72f6e@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=maxime@cerno.tech \
--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
all inboxes | Powered by JetHome®