dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Douglas Anderson <dianders@chromium.org>,
	dri-devel@lists.freedesktop.org,
	Maxime Ripard <mripard@kernel.org>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	"Yuran Pereira" <yuran.pereira@hotmail.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Quentin Schulz" <quentin.schulz@theobroma-systems.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@gmail.com>,
	"Jessica Zhang" <quic_jesszhan@quicinc.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFT PATCH v2 15/48] drm/panel: ltk050h3146w: Don't call unprepare+disable at shutdown/remove
Date: Mon, 6 May 2024 16:04:30 +0200	[thread overview]
Message-ID: <dfc4699e-214b-4821-bdfc-7306eef80d30@cherry.de> (raw)
In-Reply-To: <20240503143327.RFT.v2.15.Ibeb2e5692e34b136afe4cf55532f0696ab3f5eed@changeid>

Hi Douglas,

On 5/3/24 11:32 PM, Douglas Anderson wrote:
> [You don't often get email from dianders@chromium.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> It's the responsibility of a correctly written DRM modeset driver to
> call drm_atomic_helper_shutdown() at shutdown time and that should be
> disabling / unpreparing the panel if needed. Panel drivers shouldn't
> be calling these functions themselves.
> 
> A recent effort was made to fix as many DRM modeset drivers as
> possible [1] [2] [3] and most drivers are fixed now.
> 
> Unfortunately, grepping mainline for this panel's compatible string
> shows no hits, so we can't be 100% sure if the DRM modeset driver used
> with this panel has been fixed. If it is found that the DRM modeset
> driver hasn't been fixed then this patch could be temporarily reverted
> until it is.
> 
> [1] https://lore.kernel.org/r/20230901234015.566018-1-dianders@chromium.org
> [2] https://lore.kernel.org/r/20230901234202.566951-1-dianders@chromium.org
> [3] https://lore.kernel.org/r/20230921192749.1542462-1-dianders@chromium.org
> 
> Cc: "Heiko Stübner" <heiko@sntech.de>
> Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

I get:

"""
[   27.239362] ------------[ cut here ]------------
[   27.244549] refcount_t: addition on 0; use-after-free.
[   27.250308] WARNING: CPU: 4 PID: 1 at lib/refcount.c:25 
refcount_warn_saturate+0x120/0x144
[   27.259556] Modules linked in: snd_soc_simple_card crct10dif_ce 
snd_soc_simple_card_utils fuse [last unloaded: panel_leadtek_ltk050h3146w]
[   27.273470] CPU: 4 PID: 1 Comm: systemd-shutdow Not tainted 
6.9.0-rc7-00002-g4a8eaebfcfde-dirty #63
[   27.283584] Hardware name: Theobroma Systems RK3399-Q7 SoM on Haikou 
devkit with Video Demo adapter (DT)
[   27.294180] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS 
BTYPE=--)
[   27.301962] pc : refcount_warn_saturate+0x120/0x144
[   27.307411] lr : refcount_warn_saturate+0x120/0x144
[   27.312860] sp : ffff800081babb10
[   27.316559] x29: ffff800081babb10 x28: ffff000000640000 x27: 
0000000000000000
[   27.324539] x26: ffff8000814847f8 x25: 0000000000000001 x24: 
ffff800081adb028
[   27.332519] x23: ffff000000e13090 x22: ffff800081b3c280 x21: 
ffff0000006c8680
[   27.340489] x20: ffff0000006c8680 x19: ffff00000a6f8000 x18: 
0000000000000006
[   27.348468] x17: 000000040044ffff x16: 00500074b5503510 x15: 
ffff800081bab580
[   27.356447] x14: 0000000000000000 x13: ffff8000819944d0 x12: 
0000000000000a2f
[   27.364426] x11: 0000000000000365 x10: ffff8000819ec4d0 x9 : 
ffff8000819944d0
[   27.372396] x8 : 00000000ffffefff x7 : ffff8000819ec4d0 x6 : 
80000000fffff000
[   27.380375] x5 : 0000000000000366 x4 : 0000000000000000 x3 : 
0000000000000000
[   27.388353] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 
ffff000000640000
[   27.396332] Call trace:
[   27.399061]  refcount_warn_saturate+0x120/0x144
[   27.404122]  drm_dev_get+0x78/0x7c
[   27.407924]  drm_atomic_state_init+0x78/0xd0
[   27.412695]  drm_atomic_state_alloc+0x6c/0x9c
[   27.417563]  drm_atomic_helper_disable_all+0x20/0x214
[   27.423208]  drm_atomic_helper_shutdown+0xa4/0x148
[   27.428560]  rockchip_drm_platform_shutdown+0x18/0x28
[   27.434207]  platform_shutdown+0x24/0x34
[   27.438589]  device_shutdown+0x150/0x258
[   27.442973]  kernel_power_off+0x38/0x7c
[   27.447260]  __do_sys_reboot+0x204/0x24c
[   27.451643]  __arm64_sys_reboot+0x24/0x30
[   27.456122]  invoke_syscall+0x48/0x114
[   27.460311]  el0_svc_common.constprop.0+0x40/0xe0
[   27.465567]  do_el0_svc+0x1c/0x28
[   27.469269]  el0_svc+0x34/0xd8
[   27.472681]  el0t_64_sync_handler+0x120/0x12c
[   27.477548]  el0t_64_sync+0x190/0x194
[   27.481639] ---[ end trace 0000000000000000 ]---
[   27.486831] ------------[ cut here ]------------
[   27.491995] refcount_t: underflow; use-after-free.
[   27.497414] WARNING: CPU: 4 PID: 1 at lib/refcount.c:28 
refcount_warn_saturate+0xf4/0x144
[   27.506558] Modules linked in: snd_soc_simple_card crct10dif_ce 
snd_soc_simple_card_utils fuse [last unloaded: panel_leadtek_ltk050h3146w]
[   27.520468] CPU: 4 PID: 1 Comm: systemd-shutdow Tainted: G        W 
        6.9.0-rc7-00002-g4a8eaebfcfde-dirty #63
[   27.532230] Hardware name: Theobroma Systems RK3399-Q7 SoM on Haikou 
devkit with Video Demo adapter (DT)
[   27.542826] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS 
BTYPE=--)
[   27.550607] pc : refcount_warn_saturate+0xf4/0x144
[   27.555958] lr : refcount_warn_saturate+0xf4/0x144
[   27.561309] sp : ffff800081babb10
[   27.565008] x29: ffff800081babb10 x28: ffff000000640000 x27: 
0000000000000000
[   27.572988] x26: ffff8000814847f8 x25: 0000000000000001 x24: 
ffff800081adb028
[   27.580958] x23: ffff000000e13090 x22: ffff00000a6f82e0 x21: 
ffff00000a6f8170
[   27.588928] x20: ffff00000a6f8000 x19: ffff00000a6f8000 x18: 
0000000000000006
[   27.596907] x17: 000000040044ffff x16: 00500074b5503510 x15: 
072007200720072e
[   27.604877] x14: 0000000000000000 x13: 0000000000000046 x12: 
0000000000000000
[   27.612847] x11: 0000000000000000 x10: 0000000000000a20 x9 : 
ffff800081bab980
[   27.620826] x8 : ffff000000640a80 x7 : ffff0000054e1000 x6 : 
00000000ffffffff
[   27.628796] x5 : 00000000410fd080 x4 : 0000000000000002 x3 : 
0000000000000000
[   27.636775] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 
ffff000000640000
[   27.644754] Call trace:
[   27.647482]  refcount_warn_saturate+0xf4/0x144
[   27.652445]  drm_dev_put.part.0+0xb0/0xc0
[   27.656925]  drm_dev_put+0x14/0x24
[   27.660722]  __drm_atomic_state_free+0xbc/0xd0
[   27.665687]  drm_atomic_helper_disable_all+0x108/0x214
[   27.671429]  drm_atomic_helper_shutdown+0xa4/0x148
[   27.676781]  rockchip_drm_platform_shutdown+0x18/0x28
[   27.682425]  platform_shutdown+0x24/0x34
[   27.686807]  device_shutdown+0x150/0x258
[   27.691190]  kernel_power_off+0x38/0x7c
[   27.695475]  __do_sys_reboot+0x204/0x24c
[   27.699858]  __arm64_sys_reboot+0x24/0x30
[   27.704337]  invoke_syscall+0x48/0x114
[   27.708525]  el0_svc_common.constprop.0+0x40/0xe0
[   27.713782]  do_el0_svc+0x1c/0x28
[   27.717484]  el0_svc+0x34/0xd8
[   27.720894]  el0t_64_sync_handler+0x120/0x12c
[   27.725762]  el0t_64_sync+0x190/0x194
[   27.729851] ---[ end trace 0000000000000000 ]---
"""

when running "poweroff" after doing a modprobe -r of the driver on 
RK3399 Puma and PX30 Ringneck (the trace comes from RK3399 Puma). It is 
fine if I still have the device probed, no trace when powering off.

BUT, I have the same trace in the 6.9-rc7 already, so I guess:

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de> # RK3399 Puma with 
Haikou Video Demo
Tested-by: Quentin Schulz <quentin.schulz@cherry.de> # PX30 Ringneck 
with Haikou Video Demo

I'll let Heiko test this on RK3588 Tiger with Haikou Video Demo to check 
the whole stack is ready there as well.

Thanks!
Quentin

  reply	other threads:[~2024-05-07  7:31 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 21:32 [RFT PATCH v2 00/48] drm/panel: Remove most store/double-check of prepared/enabled state Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 01/48] drm/panel: raydium-rm692e5: Stop tracking prepared Douglas Anderson
2024-05-10  6:39   ` Luca Weiss
2024-05-03 21:32 ` [RFT PATCH v2 02/48] drm/panel: boe-himax8279d: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 03/48] drm/panel: boe-himax8279d: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 04/48] drm/panel: boe-tv101wum-nl6: Stop tracking prepared Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 05/48] drm/panel: boe-tv101wum-nl6: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 06/48] drm/panel: edp: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 07/48] drm/panel: edp: Add a comment about unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 08/48] drm/panel: innolux-p079zca: Stop tracking prepared/enabled Douglas Anderson
2024-05-06 16:28   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 09/48] drm/panel: innolux-p079zca: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-06 16:29   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 10/48] drm/panel: khadas-ts050: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 11/48] drm/panel: khadas-ts050: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:32 ` [RFT PATCH v2 12/48] drm/panel: kingdisplay-kd097d04: Stop tracking prepared/enabled Douglas Anderson
2024-05-06 16:29   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 13/48] drm/panel: kingdisplay-kd097d04: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-06 16:29   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 14/48] drm/panel: ltk050h3146w: Stop tracking prepared Douglas Anderson
2024-05-06 11:17   ` Quentin Schulz
2024-05-06 16:26   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 15/48] drm/panel: ltk050h3146w: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-06 14:04   ` Quentin Schulz [this message]
2024-05-06 15:17     ` Doug Anderson
2024-05-06 16:21   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 16/48] drm/panel: ltk500hd1829: Stop tracking prepared Douglas Anderson
2024-05-06 16:30   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 17/48] drm/panel: ltk500hd1829: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-06 16:30   ` Heiko Stübner
2024-05-03 21:32 ` [RFT PATCH v2 18/48] drm/panel: novatek-nt36672a: Stop tracking prepared Douglas Anderson
2024-05-04 23:58   ` Joel Selvaraj
2024-05-03 21:33 ` [RFT PATCH v2 19/48] drm/panel: novatek-nt36672a: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-04 23:58   ` Joel Selvaraj
2024-05-05  0:10     ` Joel Selvaraj
2024-05-03 21:33 ` [RFT PATCH v2 20/48] drm/panel: olimex-lcd-olinuxino: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 21/48] drm/panel: olimex-lcd-olinuxino: Don't call unprepare+disable at remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 22/48] drm/panel: osd-osd101t2587-53ts: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 23/48] drm/panel: osd-osd101t2587-53ts: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 24/48] drm/panel: samsung-atna33xc20: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 25/48] drm/panel: samsung-atna33xc20: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 26/48] drm/panel: simple: Stop tracking prepared/enabled Douglas Anderson
2024-05-18 13:20   ` [RFT,v2,26/48] " Sui Jingfeng
2024-05-03 21:33 ` [RFT PATCH v2 27/48] drm/panel: simple: Add a comment about unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 28/48] drm/panel: tdo-tl070wsh30: Stop tracking prepared Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 29/48] drm/panel: tdo-tl070wsh30: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 30/48] drm/panel: xinpeng-xpp055c272: Stop tracking prepared Douglas Anderson
2024-05-06 16:30   ` Heiko Stübner
2024-05-03 21:33 ` [RFT PATCH v2 31/48] drm/panel: xinpeng-xpp055c272: Don't call unprepare+disable at shutdown/remove Douglas Anderson
2024-05-06 16:31   ` Heiko Stübner
2024-05-03 21:33 ` [RFT PATCH v2 32/48] drm/panel: jdi-lt070me05000: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 33/48] drm/panel: jdi-lt070me05000: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 34/48] drm/panel: panasonic-vvx10f034n00: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 35/48] drm/panel: panasonic-vvx10f034n00: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 36/48] drm/panel: seiko-43wvf1g: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 37/48] drm/panel: seiko-43wvf1g: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 38/48] drm/panel: sharp-lq101r1sx01: Stop tracking prepared/enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 39/48] drm/panel: sharp-lq101r1sx01: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 40/48] drm/panel: sharp-ls043t1le01: Stop tracking prepared Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 41/48] drm/panel: sharp-ls043t1le01: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 42/48] drm/panel: sitronix-st7703: Stop tracking prepared Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 43/48] drm/panel: sitronix-st7703: Don't call disable at shutdown/remove Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 44/48] drm/panel: raydium-rm67191: Stop tracking enabled Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 45/48] drm/panel: raydium-rm67191: Don't call unprepare+disable at shutdown Douglas Anderson
2024-05-03 21:33 ` [RFT PATCH v2 46/48] drm/panel: sony-acx565akm: Don't double-check enabled state in disable Douglas Anderson
2024-05-06  6:49   ` Linus Walleij
2024-05-03 21:33 ` [RFT PATCH v2 47/48] drm/panel: sony-acx565akm: Don't call disable at remove Douglas Anderson
2024-05-06  6:49   ` Linus Walleij
2024-05-06  6:49   ` Linus Walleij
2024-05-03 21:33 ` [RFT PATCH v2 48/48] drm/panel: Update TODO list item for cleaning up prepared/enabled tracking Douglas Anderson
2024-05-06  6:52 ` [RFT PATCH v2 00/48] drm/panel: Remove most store/double-check of prepared/enabled state Linus Walleij
2024-05-06  7:17   ` Ondřej Jirman
2024-05-08 21:14   ` Doug Anderson
2024-05-28 20:14     ` Doug Anderson
2024-05-06  7:27 ` Maxime Ripard

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=dfc4699e-214b-4821-bdfc-7306eef80d30@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=macromorgan@hotmail.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    --cc=yuran.pereira@hotmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).