* [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms
@ 2026-07-11 6:22 Vishnu Sankar
2026-07-12 3:50 ` Oliver Lin
0 siblings, 1 reply; 5+ messages in thread
From: Vishnu Sankar @ 2026-07-11 6:22 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@email.com>
Closes: https://lore.kernel.org/platform-driver-x86/239c8162-e1e6-4b49-8292-35547c5a525c@liuxiaozhen.dev/
Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
---
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] 5+ messages in thread* Re: [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms 2026-07-11 6:22 [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms Vishnu Sankar @ 2026-07-12 3:50 ` Oliver Lin 2026-07-13 9:48 ` Oliver Lin 2026-07-13 11:17 ` Ilpo Järvinen 0 siblings, 2 replies; 5+ messages in thread From: Oliver Lin @ 2026-07-12 3:50 UTC (permalink / raw) To: Vishnu Sankar Cc: platform-driver-x86, linux-acpi, ibm-acpi-devel, mpearson-lenovo, vsankar, hansg, ilpo.jarvinen, oliver Hello Vishnu, It looks like my email address was recorded incorrectly. My address is: oliver@liuxiaozhen.dev I'm currently testing this patch and will report back once the testing is complete. Thanks, Oliver Lin ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms 2026-07-12 3:50 ` Oliver Lin @ 2026-07-13 9:48 ` Oliver Lin 2026-07-13 11:17 ` Ilpo Järvinen 1 sibling, 0 replies; 5+ messages in thread From: Oliver Lin @ 2026-07-13 9:48 UTC (permalink / raw) To: Vishnu Sankar Cc: platform-driver-x86, linux-acpi, ibm-acpi-devel, mpearson-lenovo, vsankar, hansg, ilpo.jarvinen, oliver Hi Vishnu, I tested the following two commits: platform/x86: thinkpad_acpi: Add USB-C Security (USCS) support platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms The tests were performed with Linux 7.2.0-rc2 on: Lenovo ThinkPad P15 Gen 1 BIOS N30ET47W 1.30, EC N30HT33W Lenovo ThinkPad P50s Machine type 20FLCTO1WW On the ThinkPad P15 Gen 1, the firmware WMI query still produces an AE_AML_PACKAGE_LIMIT error while evaluating _SB.WMI1.WQA0: ACPI BIOS Error (bug): AE_AML_PACKAGE_LIMIT, Index (0x2) is beyond end of object (length 0x2) ACPI Error: Aborting method _SB.WMI1.WQA0 due to previous error However, with the probe-failure fix applied, thinkpad_acpi continues initializing successfully. The battery extension, secondary fan control, rfkill switch and ThinkPad extra buttons were all registered normally. I also tested the USB-C data path with a Xiaomi Redmi Note 13 5G: Initial device detection: PASS Repeated unplug/replug: PASS S3 deep suspend/resume: PASS USB-C device detection after resume: PASS The device was successfully enumerated again after resume. The thinkpad_acpi module remained loaded and the kernel taint value was 0. On the ThinkPad P50s, which does not expose the new USB-C Security interface, thinkpad_acpi also initialized successfully. Existing thinkpad_acpi functionality, including battery registration, rfkill, hotkeys and suspend/resume, continued to work normally. This confirms that an unsupported platform no longer causes the complete thinkpad_acpi probe to fail. I did observe existing errors on the P15 Gen 1 from the NVIDIA UCSI and xHCI paths: ucsi_ccg 2-0008: probe with driver ucsi_ccg failed with error -110 xhci_hcd 0000:01:00.2: xHC error in resume, USBSTS 0x401, Reinit The test kernel was built without the NVIDIA display driver. These messages did not prevent the ACPI UCSI Type-C ports from being created, and did not prevent the tested USB-C device from working before or after suspend. Therefore, for this series: Tested-by: Oliver Lin oliver@liuxiaozhen.dev Thanks, Oliver ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms 2026-07-12 3:50 ` Oliver Lin 2026-07-13 9:48 ` Oliver Lin @ 2026-07-13 11:17 ` Ilpo Järvinen 2026-07-14 3:44 ` Vishnu Sankar 1 sibling, 1 reply; 5+ messages in thread From: Ilpo Järvinen @ 2026-07-13 11:17 UTC (permalink / raw) To: Oliver Lin Cc: Vishnu Sankar, platform-driver-x86, linux-acpi, ibm-acpi-devel, Mark Pearson, vsankar, Hans de Goede [-- Attachment #1: Type: text/plain, Size: 459 bytes --] On Sun, 12 Jul 2026, Oliver Lin wrote: > Hello Vishnu, > > It looks like my email address was recorded incorrectly. My address is: > > oliver@liuxiaozhen.dev > > I'm currently testing this patch and will report back once the testing > is complete. Hi Vishnu, To make things easier for me (and me less likely to forget while applying), could you please send v2 with corrected email + the tested by from the other email. -- i. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms 2026-07-13 11:17 ` Ilpo Järvinen @ 2026-07-14 3:44 ` Vishnu Sankar 0 siblings, 0 replies; 5+ messages in thread From: Vishnu Sankar @ 2026-07-14 3:44 UTC (permalink / raw) To: Ilpo Järvinen Cc: Oliver Lin, platform-driver-x86, linux-acpi, ibm-acpi-devel, Mark Pearson, vsankar, Hans de Goede Hi Oliver, Thanks for the quick follow‑up. Sorry for the wrong email address. Thanks a lot for the testing. The other errors you encounter seem to be coming from the think-lmi driver. I will note this down and discuss it with Mark internally. Ilpo, Thanks for the quick follow up. Sure, I’ll send a v2 of the patch with Oliver’s corrected email address and include his Tested-by tag from the follow-up message. I’ll get that out shortly. Thank you. Vishnu On Mon, Jul 13, 2026 at 8:17 PM Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> wrote: > > On Sun, 12 Jul 2026, Oliver Lin wrote: > > > Hello Vishnu, > > > > It looks like my email address was recorded incorrectly. My address is: > > > > oliver@liuxiaozhen.dev > > > > I'm currently testing this patch and will report back once the testing > > is complete. > > Hi Vishnu, > > To make things easier for me (and me less likely to forget while > applying), could you please send v2 with corrected email + the tested by > from the other email. > > -- > i. -- Regards, Vishnu Sankar ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-14 3:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-11 6:22 [PATCH] platform/x86: thinkpad_acpi: Fix USB-C Security probe failure on unsupported platforms Vishnu Sankar 2026-07-12 3:50 ` Oliver Lin 2026-07-13 9:48 ` Oliver Lin 2026-07-13 11:17 ` Ilpo Järvinen 2026-07-14 3:44 ` Vishnu Sankar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox