usb: host: Disable controller wakeup on removal
Subsystems (4)
cover usb: host: Disable controller wakeup on removal
These three independent patches balance the controller wakeup enable in the generic EHCI, generic OHCI and Exynos OHCI drivers. Each disables controller wakeup after usb_remove_hcd(), before releasing the remaining driver-owned resources. No shared USB core behavior is changed.
For generic EHCI, a wakeup-capable ACPI companion provides the capability setting through acpi_bind_one(). For the two OHCI drivers, ohci_run() sets controller capability when OHCI_CTRL_RWC is present. If probe successfully enables wakeup, the attached source otherwise survives ordinary driver unbind because the controller device itself remains registered.
This issue was identified during our ongoing static-analysis research while reviewing kernel code. The patches and explanations were prepared with LLM assistance.
Compile-tested only; no hardware runtime testing was performed.
Myeonghun Pak (3):
usb: ehci-platform: Disable controller wakeup on removal
usb: ohci-platform: Disable controller wakeup on removal
usb: ohci-exynos: Disable controller wakeup on removal
drivers/usb/host/ehci-platform.c | 1 + drivers/usb/host/ohci-exynos.c | 1 + drivers/usb/host/ohci-platform.c | 1 + 3 files changed, 3 insertions(+)
base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
PATCH 1/3 usb: ehci-platform: Disable controller wakeup on removal
On wakeup-capable ACPI controllers, a successful probe-time wakeup enable leaves a source attached after driver unbind: usb_remove_hcd() does not disable controller wakeup.
Disable it after usb_remove_hcd() to balance the enable.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ehci-platform.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ehci-platform.c +1 -0
@@ -420,6 +420,7 @@ static void ehci_platform_remove(struct platform_device *dev)quirk_poll_end (priv);usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);if (pdata->power_off) pdata->power_off (dev);
PATCH 2/3 usb: ohci-platform: Disable controller wakeup on removal
In reply to Myeonghun PakWhen OHCI reports remote-wakeup capability, a successful wakeup enable leaves a source attached after driver unbind: usb_remove_hcd() does not disable controller wakeup.
Disable it after usb_remove_hcd() to balance the enable.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-platform.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-platform.c +1 -0
@@ -246,6 +246,7 @@ static void ohci_platform_remove(struct platform_device *dev)pm_runtime_get_sync (&dev->dev);usb_remove_hcd (hcd); +device_wakeup_disable (&dev->dev);if (pdata->power_off) pdata->power_off (dev);
PATCH 3/3 usb: ohci-exynos: Disable controller wakeup on removal
In reply to Myeonghun PakWhen OHCI reports remote-wakeup capability, a successful wakeup enable leaves a source attached after driver unbind: usb_remove_hcd() does not disable controller wakeup.
Disable it after usb_remove_hcd() to balance the enable.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-exynos.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-exynos.c +1 -0
@@ -194,6 +194,7 @@ static void exynos_ohci_remove(struct platform_device *pdev) pdev->dev.of_node = exynos_ohci->of_node;usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);exynos_ohci_phy_disable (&pdev->dev);
Re: [PATCH 1/3] usb: ehci-platform: Disable controller wakeup on removal
In reply to Myeonghun PakQuoted 9 lines · Myeonghun Pak
On wakeup-capable ACPI controllers, a successful probe-time wakeup enable leaves a source attached after driver unbind:
usb_remove_hcd()does not disable controller wakeup.Disable it after
usb_remove_hcd()to balance the enable.This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Quoted 6 lines
Fixes 776c15d0ad0c ("USB: ehci-platform: Add ACPI bindings for the EHCI platform driver.")Assisted-by OpenAI:GPT-5.6Co-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>---
For all three patches: