From: Paul Cercueil <paul@crapouillou.net>
To: Doug Anderson <dianders@chromium.org>
Cc: dri-devel@lists.freedesktop.org,
Maxime Ripard <mripard@kernel.org>,
airlied@gmail.com, daniel@ffwll.ch, linux-kernel@vger.kernel.org,
linux-mips@vger.kernel.org
Subject: Re: [RFT PATCH 03/15] drm/ingenic: Call drm_atomic_helper_shutdown() at shutdown time
Date: Wed, 13 Sep 2023 20:00:39 +0200 [thread overview]
Message-ID: <ac04dbc27e4d5f0fd3ec458b1ad7d4d2f2b39092.camel@crapouillou.net> (raw)
In-Reply-To: <CAD=FV=UFkTHhsxFZGPqFVOX6ra+bx=1P-jAdh1wz-_Q=GBJc4Q@mail.gmail.com>
Hi Doug,
Le mercredi 13 septembre 2023 à 09:25 -0700, Doug Anderson a écrit :
> Hi,
>
> On Tue, Sep 5, 2023 at 1:16 PM Doug Anderson <dianders@chromium.org>
> wrote:
> >
> > Paul,
> >
> > On Mon, Sep 4, 2023 at 2:15 AM Paul Cercueil <paul@crapouillou.net>
> > wrote:
> > >
> > > Hi Douglas,
> > >
> > > Le vendredi 01 septembre 2023 à 16:41 -0700, Douglas Anderson a
> > > écrit :
> > > > Based on grepping through the source code this driver appears
> > > > 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.
> > > >
> > > > Since this driver uses the component model and shutdown happens
> > > > at
> > > > the
> > > > base driver, we communicate whether we have to call
> > > > drm_atomic_helper_shutdown() by seeing if drvdata is non-NULL.
> > > >
> > > > Suggested-by: Maxime Ripard <mripard@kernel.org>
> > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > >
> > > LGTM.
> > > Acked-by: Paul Cercueil <paul@crapouillou.net>
> >
> > Thanks for the Ack! Would you expect this patch to land through
> > "drm-misc", or do you expect it to go through some other tree?
> > Running:
> >
> > ./scripts/get_maintainer.pl --scm -f
> > drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> >
> > ...does not show that this driver normally goes through drm-misc,
> > but
> > it also doesn't show that it goes through any other tree so maybe
> > it's
> > just an artifact of the way it's tagged in the MAINTAINERS file? If
> > it's fine for this to go through drm-misc, I'll probably land it
> > (with
> > your Ack and Maxime's Review) sooner rather than later just to make
> > this patch series less unwieldy.
> >
> >
> > > > ---
> > > > This commit is only compile-time tested.
> > > >
> > > > NOTE: this patch touches a lot more than other similar patches
> > > > since
> > > > the bind() function is long and we want to make sure that we
> > > > unset
> > > > the
> > > > drvdata if bind() fails.
> > > >
> > > > While making this patch, I noticed that the bind() function of
> > > > this
> > > > driver is using "devm" and thus assumes it doesn't need to do
> > > > much
> > > > explicit error handling. That's actually a bug. As per kernel
> > > > docs
> > > > [1]
> > > > "the lifetime of the aggregate driver does not align with any
> > > > of the
> > > > underlying struct device instances. Therefore devm cannot be
> > > > used and
> > > > all resources acquired or allocated in this callback must be
> > > > explicitly released in the unbind callback". Fixing that is
> > > > outside
> > > > the scope of this commit.
> > > >
> > > > [1] https://docs.kernel.org/driver-api/component.html
> > > >
> > >
> > > Noted, thanks.
> >
> > FWIW, I think that at least a few other DRM drivers handle this by
> > doing some of their resource allocation / acquiring in the probe()
> > function and then only doing things in the bind() that absolutely
> > need
> > to be in the bind. ;-)
>
> I've been collecting patches that are ready to land in drm-misc but,
> right now, I'm not taking this patch since I didn't get any
> clarification of whether it should land through drm-misc or somewhere
> else.
Sorry, you can take it in drm-misc, yes.
Cheers,
-Paul
next prev parent reply other threads:[~2023-09-13 18:00 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 23:41 [RFT PATCH 00/15] drm: non-drm-misc drivers call drm_atomic_helper_shutdown() at the right times Douglas Anderson
2023-09-01 23:41 ` [RFT PATCH 01/15] drm/armada: Call drm_atomic_helper_shutdown() at shutdown time Douglas Anderson
2023-09-03 15:53 ` Russell King (Oracle)
2023-09-04 7:36 ` Maxime Ripard
2023-09-04 7:55 ` Russell King (Oracle)
2023-09-04 15:18 ` Maxime Ripard
2023-09-05 14:23 ` Doug Anderson
2023-09-13 15:34 ` Doug Anderson
2023-09-20 18:03 ` Doug Anderson
2023-09-20 18:58 ` Russell King (Oracle)
2023-09-21 18:46 ` Doug Anderson
2023-09-04 7:53 ` Maxime Ripard
2023-09-04 7:56 ` Russell King (Oracle)
2023-09-01 23:41 ` [RFT PATCH 02/15] drm/imx/dcss: " Douglas Anderson
2023-09-04 7:36 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 03/15] drm/ingenic: " Douglas Anderson
2023-09-04 7:36 ` Maxime Ripard
2023-09-04 9:15 ` Paul Cercueil
2023-09-05 20:16 ` Doug Anderson
2023-09-06 8:39 ` Maxime Ripard
2023-09-13 16:23 ` Doug Anderson
2023-09-14 8:14 ` Maxime Ripard
2023-09-14 22:29 ` Doug Anderson
2023-09-19 9:33 ` Maxime Ripard
2023-09-13 16:25 ` Doug Anderson
2023-09-13 18:00 ` Paul Cercueil [this message]
2023-09-13 18:21 ` Doug Anderson
2023-09-01 23:41 ` [RFT PATCH 04/15] drm/kmb: " Douglas Anderson
2023-09-04 7:26 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 05/15] drm/mediatek: " Douglas Anderson
2023-09-04 7:27 ` Maxime Ripard
2023-09-08 11:51 ` Fei Shao
2023-09-11 16:10 ` Doug Anderson
2023-09-12 6:28 ` Fei Shao
2023-09-01 23:41 ` [RFT PATCH 06/15] drm/nouveau: Call drm_atomic_helper_shutdown() or equiv " Douglas Anderson
2023-09-04 7:27 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 07/15] drm/tegra: Call drm_atomic_helper_shutdown() " Douglas Anderson
2023-09-04 7:28 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 08/15] drm/arcpgu: " Douglas Anderson
2023-09-04 7:28 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 09/15] drm/amdgpu: " Douglas Anderson
2023-09-01 23:41 ` [RFT PATCH 10/15] drm/sprd: Call drm_atomic_helper_shutdown() at remove time Douglas Anderson
2023-09-04 7:54 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 11/15] drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time Douglas Anderson
2023-09-04 7:54 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 12/15] drm/gma500: Call drm_helper_force_disable_all() at shutdown/remove time Douglas Anderson
2023-09-04 7:29 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 13/15] drm/imx/ipuv3: Call drm_atomic_helper_shutdown() at shutdown/unbind time Douglas Anderson
2023-09-04 7:55 ` Maxime Ripard
2023-09-04 8:30 ` Philipp Zabel
2023-09-05 20:29 ` Doug Anderson
2023-09-06 5:47 ` Philipp Zabel
2023-09-06 14:30 ` Doug Anderson
2023-09-13 18:21 ` Doug Anderson
2023-09-01 23:41 ` [RFT PATCH 14/15] drm/radeon: Call drm_helper_force_disable_all() at shutdown/remove time Douglas Anderson
2023-09-04 7:30 ` Maxime Ripard
2023-09-01 23:41 ` [RFT PATCH 15/15] drm/renesas/shmobile: " Douglas Anderson
2023-09-04 7:27 ` Geert Uytterhoeven
2023-09-05 21:10 ` 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=ac04dbc27e4d5f0fd3ec458b1ad7d4d2f2b39092.camel@crapouillou.net \
--to=paul@crapouillou.net \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mripard@kernel.org \
/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®