From: Xulin Sun <xulin.sun@windriver.com>
To: jyri.sarha@iki.fi, tomi.valkeinen@ideasonboard.com
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
xulin.sun@windriver.com
Subject: [PATCH] drm/tilcdc: conditionally calling drm_atomic_helper_shutdown()
Date: Wed, 16 Oct 2024 16:27:02 +0800 [thread overview]
Message-ID: <20241016082702.2981970-1-xulin.sun@windriver.com> (raw)
The `drm_atomic_helper_shutdown(dev)` is called only if
`priv->is_registered` is true, ensuring that it runs only when the device
has been properly registered. Otherwise, if it encounters a defer probe,
the following call trace will appear.
WARNING: CPU: 0 PID: 13 at drivers/gpu/drm/drm_atomic_state_helper.c:174 drm_atomic_helper_crtc_duplicate_state+0x68/0x70
Modules linked in:
CPU: 0 PID: 13 Comm: kworker/u2:1
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
unwind_backtrace from show_stack+0x18/0x1c
show_stack from dump_stack_lvl+0x24/0x2c
dump_stack_lvl from __warn+0x80/0x134
__warn from warn_slowpath_fmt+0x19c/0x1a4
warn_slowpath_fmt from drm_atomic_helper_crtc_duplicate_state+0x68/0x70
drm_atomic_helper_crtc_duplicate_state from drm_atomic_get_crtc_state+0x70/0x110
drm_atomic_get_crtc_state from drm_atomic_helper_disable_all+0x98/0x1c8
drm_atomic_helper_disable_all from drm_atomic_helper_shutdown+0x90/0x144
drm_atomic_helper_shutdown from tilcdc_fini+0x58/0xe0
tilcdc_fini from tilcdc_init.constprop.0+0x23c/0x620
tilcdc_init.constprop.0 from tilcdc_pdev_probe+0x58/0xac
tilcdc_pdev_probe from platform_probe+0x64/0xb8
platform_probe from really_probe+0xd0/0x2e0
really_probe from __driver_probe_device+0x90/0x1a8
__driver_probe_device from driver_probe_device+0x38/0x10c
driver_probe_device from __device_attach_driver+0x9c/0x110
__device_attach_driver from bus_for_each_drv+0x98/0xec
bus_for_each_drv from __device_attach+0xb0/0x1ac
__device_attach from bus_probe_device+0x90/0x94
bus_probe_device from deferred_probe_work_func+0x80/0xac
deferred_probe_work_func from process_one_work+0x198/0x3f8
process_one_work from worker_thread+0x35c/0x550
worker_thread from kthread+0x108/0x124
kthread from ret_from_fork+0x14/0x28
Exception stack(0xe0039fb0 to 0xe0039ff8)
9fa0: 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace 0000000000000000 ]---
tilcdc 4830e000.lcdc: [drm] *ERROR* Disabling all crtc's during unload failed with -12
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index cd5eefa06060..9c11ea126b46 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -171,11 +171,12 @@ static void tilcdc_fini(struct drm_device *dev)
if (priv->crtc)
tilcdc_crtc_shutdown(priv->crtc);
- if (priv->is_registered)
+ if (priv->is_registered) {
drm_dev_unregister(dev);
+ drm_atomic_helper_shutdown(dev);
+ }
drm_kms_helper_poll_fini(dev);
- drm_atomic_helper_shutdown(dev);
tilcdc_irq_uninstall(dev);
drm_mode_config_cleanup(dev);
--
2.34.1
reply other threads:[~2024-10-16 8:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241016082702.2981970-1-xulin.sun@windriver.com \
--to=xulin.sun@windriver.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jyri.sarha@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tomi.valkeinen@ideasonboard.com \
--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
all inboxes | Powered by JetHome®