public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: dri-devel@lists.freedesktop.org,
	Maxime Ripard <mripard@kernel.org>,
	Douglas Anderson <dianders@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>,
	airlied@gmail.com, airlied@redhat.com, alain.volmat@foss.st.com,
	alexander.deucher@amd.com, alexandre.belloni@bootlin.com,
	alison.wang@nxp.com, bbrezillon@kernel.org,
	christian.koenig@amd.com, claudiu.beznea@microchip.com,
	daniel@ffwll.ch, drawat.floss@gmail.com, javierm@redhat.com,
	jfalempe@redhat.com, jstultz@google.com,
	kong.kongxinwei@hisilicon.com, kraxel@redhat.com,
	linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sunxi@lists.linux.dev, liviu.dudau@arm.com,
	nicolas.ferre@microchip.com, paul.kocialkowski@bootlin.com,
	sam@ravnborg.org, samuel@sholland.org,
	spice-devel@lists.freedesktop.org, stefan@agner.ch,
	suijingfeng@loongson.cn, sumit.semwal@linaro.org,
	tiantao6@hisilicon.com, tomi.valkeinen@ideasonboard.com,
	tzimmermann@suse.de, virtualization@lists.linux-foundation.org,
	wens@csie.org, xinliang.liu@linaro.org, yongqin.liu@linaro.org,
	zackr@vmware.com
Subject: Re: [RFT PATCH 2/6] drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers
Date: Tue, 05 Sep 2023 23:06:00 +0200	[thread overview]
Message-ID: <5970528.lOV4Wx5bFT@jernej-laptop> (raw)
In-Reply-To: <20230901163944.RFT.2.I9115e5d094a43e687978b0699cc1fe9f2a3452ea@changeid>

Dne sobota, 02. september 2023 ob 01:39:53 CEST je Douglas Anderson 
napisal(a):
> Based on grepping through the source code these drivers appear to be
> missing a call to drm_atomic_helper_shutdown() at system shutdown
> time. Among other things, this means that if a panel is in use that it
> won't be cleanly powered off at system shutdown time.
> 
> The fact that we should call drm_atomic_helper_shutdown() in the case
> of OS shutdown/restart comes straight out of the kernel doc "driver
> instance overview" in drm_drv.c.
> 
> All of the drivers in this patch were fairly straightforward to fix
> since they already had a call to drm_atomic_helper_shutdown() at
> remove/unbind time but were just lacking one at system shutdown. The
> only hitch is that some of these drivers use the component model to
> register/unregister their DRM devices. The shutdown callback is part
> of the original device. The typical solution here, based on how other
> DRM drivers do this, is to keep track of whether the device is bound
> based on drvdata. In most cases the drvdata is the drm_device, so we
> can just make sure it is NULL when the device is not bound. In some
> drivers, this required minor code changes. To make things simpler,
> drm_atomic_helper_shutdown() has been modified to consider a NULL
> drm_device as a noop in the patch ("drm/atomic-helper:
> drm_atomic_helper_shutdown(NULL) should be a noop").
> 
> Suggested-by: Maxime Ripard <mripard@kernel.org>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> This commit is only compile-time tested.
> 
> Note that checkpatch yells that "drivers/gpu/drm/tiny/cirrus.c" is
> marked as 'obsolete', but it seems silly not to include the fix if
> it's already been written. If someone wants me to take that out,
> though, I can.
> 
>  drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 9 +++++++++
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 7 +++++++
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.h | 1 +
>  drivers/gpu/drm/arm/hdlcd_drv.c                 | 6 ++++++
>  drivers/gpu/drm/arm/malidp_drv.c                | 6 ++++++
>  drivers/gpu/drm/ast/ast_drv.c                   | 6 ++++++
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 6 ++++++
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 8 ++++++++
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 ++++++
>  drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 6 ++++++
>  drivers/gpu/drm/logicvc/logicvc_drm.c           | 9 +++++++++
>  drivers/gpu/drm/loongson/lsdc_drv.c             | 6 ++++++
>  drivers/gpu/drm/mcde/mcde_drv.c                 | 9 +++++++++
>  drivers/gpu/drm/omapdrm/omap_drv.c              | 8 ++++++++
>  drivers/gpu/drm/qxl/qxl_drv.c                   | 7 +++++++
>  drivers/gpu/drm/sti/sti_drv.c                   | 7 +++++++
>  drivers/gpu/drm/sun4i/sun4i_drv.c               | 6 ++++++

For sun4i:
Tested-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

>  drivers/gpu/drm/tiny/bochs.c                    | 6 ++++++
>  drivers/gpu/drm/tiny/cirrus.c                   | 6 ++++++
>  19 files changed, 125 insertions(+)




  parent reply	other threads:[~2023-09-05 21:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 23:39 [RFT PATCH 0/6] drm: drm-misc drivers call drm_atomic_helper_shutdown() at the right times Douglas Anderson
2023-09-01 23:39 ` [RFT PATCH 1/6] drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop Douglas Anderson
2023-09-04  7:55   ` Maxime Ripard
2023-09-05 21:14     ` Doug Anderson
2023-09-13 18:19       ` Doug Anderson
2023-09-01 23:39 ` [RFT PATCH 2/6] drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers Douglas Anderson
2023-09-04  7:58   ` Maxime Ripard
2023-09-05 21:06   ` Jernej Škrabec [this message]
2023-09-15  9:11   ` suijingfeng
2023-09-15 13:44     ` Doug Anderson
2023-09-15 14:02       ` suijingfeng
2023-09-19  7:31   ` Tomi Valkeinen
2023-09-21 18:46   ` Doug Anderson
2023-09-01 23:39 ` [RFT PATCH 3/6] drm/vc4: Call drm_atomic_helper_shutdown() at shutdown time Douglas Anderson
2023-09-04  7:58   ` Maxime Ripard
2023-09-21 18:46   ` Doug Anderson
2023-09-01 23:39 ` [RFT PATCH 4/6] drm/ssd130x: Call drm_atomic_helper_shutdown() at remove time Douglas Anderson
2023-09-04  7:59   ` Maxime Ripard
2023-09-21 18:47   ` Doug Anderson
2023-09-01 23:39 ` [RFT PATCH 5/6] drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers Douglas Anderson
2023-09-04  8:00   ` Maxime Ripard
2023-09-19  7:09   ` Tomi Valkeinen
2023-09-21 18:48   ` Doug Anderson
2023-09-01 23:39 ` [RFT PATCH 6/6] drm/hisilicon/kirin: Call drm_atomic_helper_shutdown() at shutdown/unbind time Douglas Anderson
2023-09-04  8:00   ` Maxime Ripard
2023-09-21 18:48   ` Doug Anderson
2023-09-13 18:31 ` [RFT PATCH 0/6] drm: drm-misc drivers call drm_atomic_helper_shutdown() at the right times Doug Anderson

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=5970528.lOV4Wx5bFT@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alison.wang@nxp.com \
    --cc=bbrezillon@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=drawat.floss@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=jstultz@google.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=liviu.dudau@arm.com \
    --cc=mripard@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sam@ravnborg.org \
    --cc=samuel@sholland.org \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=stefan@agner.ch \
    --cc=suijingfeng@loongson.cn \
    --cc=sumit.semwal@linaro.org \
    --cc=tiantao6@hisilicon.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wens@csie.org \
    --cc=xinliang.liu@linaro.org \
    --cc=yongqin.liu@linaro.org \
    --cc=zackr@vmware.com \
    /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