[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <urpxto3fgvwoe4hob2aukggeop4bcsyb7m5wflgru4c3otd6rq@aktopqufgxom>
Date: Sat, 10 May 2025 11:59:17 +0200
From: Maxime Ripard <mripard@...nel.org>
To: Gerd Hoffmann <kraxel@...hat.com>
Cc: dri-devel@...ts.freedesktop.org, "Michael S. Tsirkin" <mst@...hat.com>,
Eric Auger <eric.auger@...hat.com>, David Airlie <airlied@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu <olvaffe@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann <tzimmermann@...e.de>,
Simona Vetter <simona@...ll.ch>, "open list:VIRTIO GPU DRIVER" <virtualization@...ts.linux.dev>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/virtio: implement virtio_gpu_shutdown
Hi,
On Wed, May 07, 2025 at 10:28:21AM +0200, Gerd Hoffmann wrote:
> Calling drm_dev_unplug() is the drm way to say the device
> is gone and can not be accessed any more.
>
> Cc: Michael S. Tsirkin <mst@...hat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> Reviewed-by: Eric Auger <eric.auger@...hat.com>
> Tested-by: Eric Auger <eric.auger@...hat.com>
> ---
> drivers/gpu/drm/virtio/virtgpu_drv.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
> index e32e680c7197..71c6ccad4b99 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
> @@ -130,10 +130,10 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
>
> static void virtio_gpu_shutdown(struct virtio_device *vdev)
> {
> - /*
> - * drm does its own synchronization on shutdown.
> - * Do nothing here, opt out of device reset.
> - */
> + struct drm_device *dev = vdev->priv;
> +
> + /* stop talking to the device */
> + drm_dev_unplug(dev);
I'm not necessarily opposed to using drm_dev_unplug() here, but it's
still pretty surprising to me. It's typically used in remove, not
shutdown. The typical helper to use at shutdown is
drm_atomic_helper_shutdown.
So if the latter isn't enough or wrong, we should at least document why.
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (274 bytes)
Powered by blists - more mailing lists