From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: gregkh@linuxfoundation.org, heiko@sntech.de,
Heiko Stuebner <heiko@sntech.de>
Cc: rafael@kernel.org, dakr@kernel.org, hjc@rock-chips.com,
andy.yan@rock-chips.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, tzimmermann@suse.de,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, quentin.schulz@cherry.de
Subject: Re: [PATCH 2/2] drm/rockchip: Fix shutdown when no drm-device is set up
Date: Wed, 26 Feb 2025 21:28:42 +0100 [thread overview]
Message-ID: <5271432.LvFx2qVVIh@workhorse> (raw)
In-Reply-To: <20250220234141.2788785-3-heiko@sntech.de>
On Friday, 21 February 2025 00:41:41 Central European Standard Time Heiko
Stuebner wrote:
> When the drm-driver probes, it mainly creates the component device, where
> all the sub-drivers (vops, hdmi, etc) hook into.
>
> This will cause the shutdown handler to get called on shutdown, even
> though the drm-device might not have been set up, or the component bind
> might have failed.
>
> So use the new component helper to check whether the drm-device is up
> and only then call the drm-atomic helper to release all the drm magic.
>
> This prevents failures when the drm-device is never set, or has been
> freed up already for example by a probe-defer during the component bind.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Tested-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Tested on a RK3588 ROCK5B by adding a `return -EPROBE_DEFER` into the middle
of `rockchip_drm_bind` after `component_bind_all` already ran. Without the
patch, I get a stacktrace in `drm_atomic_helper_shutdown`. With the patch, I
don't get one.
next prev parent reply other threads:[~2025-02-26 20:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 23:41 [PATCH 0/2] Fix the shutdown callback of a drm component device Heiko Stuebner
2025-02-20 23:41 ` [PATCH 1/2] drivers: base: component: add function to query the bound status Heiko Stuebner
2025-02-21 6:14 ` Greg KH
2025-02-27 8:44 ` Heiko Stübner
2025-02-27 11:20 ` Greg KH
2025-02-20 23:41 ` [PATCH 2/2] drm/rockchip: Fix shutdown when no drm-device is set up Heiko Stuebner
2025-02-26 20:28 ` Nicolas Frattaroli [this message]
2025-02-27 14:02 ` [PATCH 0/2] Fix the shutdown callback of a drm component device Heiko Stuebner
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=5271432.LvFx2qVVIh@workhorse \
--to=nicolas.frattaroli@collabora.com \
--cc=andy.yan@rock-chips.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=quentin.schulz@cherry.de \
--cc=rafael@kernel.org \
--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