* [PATCH v1] drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen
@ 2022-01-23 9:05 Tong Zhang
0 siblings, 0 replies; only message in thread
From: Tong Zhang @ 2022-01-23 9:05 UTC (permalink / raw)
To: Hans de Goede, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, dri-devel,
linux-kernel
Cc: Tong Zhang
when acpi=off is provided in bootarg, kernel crash with
[ 1.252739] BUG: kernel NULL pointer dereference, address: 0000000000000018
[ 1.258308] Call Trace:
[ 1.258490] ? acpi_walk_namespace+0x147/0x147
[ 1.258770] acpi_get_devices+0xe4/0x137
[ 1.258921] ? drm_core_init+0xc0/0xc0 [drm]
[ 1.259108] detect_thinkpad_privacy_screen+0x5e/0xa8 [drm]
[ 1.259337] drm_privacy_screen_lookup_init+0xe/0xe85 [drm]
The reason is that acpi_walk_namespace expects acpi related stuff
initialized but in fact it wouldn't when acpi is set to off. In this case
we sould honor acpi=off in detect_thinkpad_privacy_screen().
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
---
drivers/gpu/drm/drm_privacy_screen_x86.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
index a2cafb294ca6..e7aa74ad0b24 100644
--- a/drivers/gpu/drm/drm_privacy_screen_x86.c
+++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
@@ -33,6 +33,9 @@ static bool __init detect_thinkpad_privacy_screen(void)
unsigned long long output;
acpi_status status;
+ if (acpi_disabled)
+ return false;
+
/* Get embedded-controller handle */
status = acpi_get_devices("PNP0C09", acpi_set_handle, NULL, &ec_handle);
if (ACPI_FAILURE(status) || !ec_handle)
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-23 9:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 9:05 [PATCH v1] drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen Tong Zhang
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®