* [PATCH v2] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms
@ 2026-07-15 1:02 Vishnu Sankar
0 siblings, 0 replies; only message in thread
From: Vishnu Sankar @ 2026-07-15 1:02 UTC (permalink / raw)
To: ilpo.jarvinen, hansg, oliver
Cc: platform-driver-x86, linux-acpi, ibm-acpi-devel, mpearson-lenovo,
vsankar, Vishnu Sankar
On systems where the USCS ACPI method is absent, acpi_evalf() returns
AE_NOT_FOUND which maps to -EIO. This caused tpacpi_usbc_security_init()
to propagate the error and thinkpad_acpi failed to probe entirely on
unsupported platforms.
Fix this by checking for USCS method presence with acpi_has_method() before
attempting to call it, returning -ENODEV immediately if absent.
This follows the same pattern used by other subdrivers in thinkpad_acpi.c.
Fixes: 67e8d1e9cacd ("platform/x86: thinkpad_acpi: Add USB-C Security (USCS) support")
Reported-by: Oliver Lin <oliver@liuxiaozhen.dev>
Closes: https://lore.kernel.org/platform-driver-x86/239c8162-e1e6-4b49-8292-35547c5a525c@liuxiaozhen.dev/
Tested-by: Oliver Lin <oliver@liuxiaozhen.dev>
Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
---
Changes since v1:
- Fix incorrect email address for Oliver Lin
- Add Tested-by from Oliver Lin confirming fix works on ThinkPad P15 Gen 1
and ThinkPad P50s
---
drivers/platform/x86/lenovo/thinkpad_acpi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index 91db4c8eeac2..85ed506516f0 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -11368,6 +11368,9 @@ static int tpacpi_usbc_security_init(struct ibm_init_struct *iibm)
{
int err;
+ if (!acpi_has_method(hkey_handle, "USCS"))
+ return -ENODEV;
+
err = usbc_security_query(&tp_features.usbc_security_enabled);
if (err == -ENODEV)
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-15 1:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 1:02 [PATCH v2] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms Vishnu Sankar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox