All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	 David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Maxime Ripard <mripard@kernel.org>,
	 dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] drm: renesas: shmobile: Call drm_helper_force_disable_all() at shutdown time
Date: Tue, 5 Dec 2023 09:35:12 -0800	[thread overview]
Message-ID: <CAD=FV=WFykYh2PAw5G3uL-64LG45O3cPRiwN1HOfMAoeLK5KMg@mail.gmail.com> (raw)
In-Reply-To: <20231205134050.GG17394@pendragon.ideasonboard.com>

Hi,

On Tue, Dec 5, 2023 at 5:40 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> On Tue, Dec 05, 2023 at 02:31:24PM +0100, Geert Uytterhoeven wrote:
> > On Tue, Dec 5, 2023 at 1:16 PM Laurent Pinchart wrote:
> > > On Tue, Dec 05, 2023 at 12:30:02PM +0100, Geert Uytterhoeven wrote:
> > > > From: Douglas Anderson <dianders@chromium.org>
> > > >
> > > > Based on grepping through the source code, this driver appears to be
> > > > missing a call to drm_atomic_helper_shutdown() at system shutdown time.
> > > > This is important because drm_helper_force_disable_all() will cause
> > > > panels to get disabled cleanly which may be important for their power
> > > > sequencing.  Future changes will remove any custom powering off in
> > > > individual panel drivers so the DRM drivers need to start getting this
> > > > right.
> > > >
> > > > The fact that we should call drm_atomic_helper_shutdown() in the case of
> > > > OS shutdown comes straight out of the kernel doc "driver instance
> > > > overview" in drm_drv.c.
> > > >
> > > > Suggested-by: Maxime Ripard <mripard@kernel.org>
> > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > > > Link: https://lore.kernel.org/r/20230901164111.RFT.15.Iaf638a1d4c8b3c307a6192efabb4cbb06b195f15@changeid
> > > > [geert: s/drm_helper_force_disable_all/drm_atomic_helper_shutdown/]
> > > > [geert: shmob_drm_remove() already calls drm_atomic_helper_shutdown]
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Thanks!
> >
> > > > Panel-simple does print two new warnings:
> > > >
> > > >     +panel-simple panel: Skipping disable of already disabled panel
> > > >     +panel-simple panel: Skipping unprepare of already unprepared panel
> > >
> > > Have you investigated where this comes from ?
> >
> > Meh, I knew I forgot something ;-)
> >
> > The panel is unprepared and disabled a first time from shmob_drm's
> > .shutdown() callback:
> >
> >   shmob_drm_shutdown
> >     drm_atomic_helper_shutdown
> >       drm_atomic_helper_disable_all
> >         drm_atomic_commit
> >           drm_atomic_helper_commit
> >             commit_tail
> >               drm_atomic_helper_commit_tail
> >                 drm_atomic_helper_commit_modeset_disables
> >                   disable_outputs
> >                     drm_atomic_bridge_chain_disable
> >                         drm_panel_disable
> >                     drm_atomic_bridge_chain_post_disable
> >                         drm_panel_unprepare
> >
> > And a second time from simple_panel's .shutdown() callback():
> >
> >   panel_simple_platform_shutdown
> >     panel_simple_shutdown
> >       drm_panel_disable
> >       drm_panel_unprepare
>
> That looks like what Doug mentioned should be removed in the commit
> message of this patch (a confirmation would be nice). It should be fine
> for now.

Yup, this is completely expected right now and is actually a _good_
sign that your patch is doing what it should be. We unfortunately
can't remove the panel_simple_shutdown() until all DRM modeset drivers
(or at least all the ones that could be used w/ panel_simple) are
properly calling drm_helper_force_disable_all(), though.

-Doug

WARNING: multiple messages have this Message-ID (diff)
From: Doug Anderson <dianders@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Maxime Ripard <mripard@kernel.org>,
	linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: renesas: shmobile: Call drm_helper_force_disable_all() at shutdown time
Date: Tue, 5 Dec 2023 09:35:12 -0800	[thread overview]
Message-ID: <CAD=FV=WFykYh2PAw5G3uL-64LG45O3cPRiwN1HOfMAoeLK5KMg@mail.gmail.com> (raw)
In-Reply-To: <20231205134050.GG17394@pendragon.ideasonboard.com>

Hi,

On Tue, Dec 5, 2023 at 5:40 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> On Tue, Dec 05, 2023 at 02:31:24PM +0100, Geert Uytterhoeven wrote:
> > On Tue, Dec 5, 2023 at 1:16 PM Laurent Pinchart wrote:
> > > On Tue, Dec 05, 2023 at 12:30:02PM +0100, Geert Uytterhoeven wrote:
> > > > From: Douglas Anderson <dianders@chromium.org>
> > > >
> > > > Based on grepping through the source code, this driver appears to be
> > > > missing a call to drm_atomic_helper_shutdown() at system shutdown time.
> > > > This is important because drm_helper_force_disable_all() will cause
> > > > panels to get disabled cleanly which may be important for their power
> > > > sequencing.  Future changes will remove any custom powering off in
> > > > individual panel drivers so the DRM drivers need to start getting this
> > > > right.
> > > >
> > > > The fact that we should call drm_atomic_helper_shutdown() in the case of
> > > > OS shutdown comes straight out of the kernel doc "driver instance
> > > > overview" in drm_drv.c.
> > > >
> > > > Suggested-by: Maxime Ripard <mripard@kernel.org>
> > > > Signed-off-by: Douglas Anderson <dianders@chromium.org>
> > > > Link: https://lore.kernel.org/r/20230901164111.RFT.15.Iaf638a1d4c8b3c307a6192efabb4cbb06b195f15@changeid
> > > > [geert: s/drm_helper_force_disable_all/drm_atomic_helper_shutdown/]
> > > > [geert: shmob_drm_remove() already calls drm_atomic_helper_shutdown]
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Thanks!
> >
> > > > Panel-simple does print two new warnings:
> > > >
> > > >     +panel-simple panel: Skipping disable of already disabled panel
> > > >     +panel-simple panel: Skipping unprepare of already unprepared panel
> > >
> > > Have you investigated where this comes from ?
> >
> > Meh, I knew I forgot something ;-)
> >
> > The panel is unprepared and disabled a first time from shmob_drm's
> > .shutdown() callback:
> >
> >   shmob_drm_shutdown
> >     drm_atomic_helper_shutdown
> >       drm_atomic_helper_disable_all
> >         drm_atomic_commit
> >           drm_atomic_helper_commit
> >             commit_tail
> >               drm_atomic_helper_commit_tail
> >                 drm_atomic_helper_commit_modeset_disables
> >                   disable_outputs
> >                     drm_atomic_bridge_chain_disable
> >                         drm_panel_disable
> >                     drm_atomic_bridge_chain_post_disable
> >                         drm_panel_unprepare
> >
> > And a second time from simple_panel's .shutdown() callback():
> >
> >   panel_simple_platform_shutdown
> >     panel_simple_shutdown
> >       drm_panel_disable
> >       drm_panel_unprepare
>
> That looks like what Doug mentioned should be removed in the commit
> message of this patch (a confirmation would be nice). It should be fine
> for now.

Yup, this is completely expected right now and is actually a _good_
sign that your patch is doing what it should be. We unfortunately
can't remove the panel_simple_shutdown() until all DRM modeset drivers
(or at least all the ones that could be used w/ panel_simple) are
properly calling drm_helper_force_disable_all(), though.

-Doug

  reply	other threads:[~2023-12-05 17:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 11:30 [PATCH] drm: renesas: shmobile: Call drm_helper_force_disable_all() at shutdown time Geert Uytterhoeven
2023-12-05 11:30 ` Geert Uytterhoeven
2023-12-05 12:16 ` Laurent Pinchart
2023-12-05 12:16   ` Laurent Pinchart
2023-12-05 13:31   ` Geert Uytterhoeven
2023-12-05 13:31     ` Geert Uytterhoeven
2023-12-05 13:40     ` Laurent Pinchart
2023-12-05 13:40       ` Laurent Pinchart
2023-12-05 17:35       ` Doug Anderson [this message]
2023-12-05 17:35         ` Doug Anderson
2024-05-03 23:11         ` 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='CAD=FV=WFykYh2PAw5G3uL-64LG45O3cPRiwN1HOfMAoeLK5KMg@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.