usb: ohci: Balance controller wakeup on cleanup
Subsystems (5)
cover usb: ohci: Balance controller wakeup on cleanup
These four independent fixes disable controller wakeup after HCD removal in the DA8xx, S3C2410, SPEAr and ST drivers. DA8xx also needs the same cleanup when notifier registration fails after the HCD is added.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Myeonghun Pak (4):
usb: ohci-da8xx: disable controller wakeup on cleanup
usb: ohci-s3c2410: disable controller wakeup on removal
usb: ohci-spear: disable controller wakeup on removal
usb: ohci-st: disable controller wakeup on removal
PATCH 1/4 usb: ohci-da8xx: disable controller wakeup on cleanup
The OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Probe enables wakeup, but neither removal nor a later notifier registration failure disables it, leaving the wakeup source attached.
Disable controller wakeup after removing the HCD on both paths.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-da8xx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/ohci-da8xx.c +2 -0
@@ -447,6 +447,7 @@ err_remove_hcd:usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller); err:usb_put_hcd (hcd);return error;
@@ -457,5 +458,6 @@struct usb_hcd *hcd =platform_get_drvdata (pdev);usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);usb_put_hcd (hcd); }
PATCH 2/4 usb: ohci-s3c2410: disable controller wakeup on removal
In reply to Myeonghun PakProbe enables controller wakeup after the OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Removal does not undo this, so the wakeup source can remain attached after driver unbind.
Disable controller wakeup after removing the HCD.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-s3c2410.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-s3c2410.c +1 -0
@@ -335,6 +335,7 @@struct usb_hcd *hcd =platform_get_drvdata (dev);usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);s3c2410_stop_hc (dev);usb_put_hcd (hcd); }
PATCH 3/4 usb: ohci-spear: disable controller wakeup on removal
In reply to Myeonghun PakProbe enables controller wakeup after the OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Removal does not undo this, so the wakeup source can remain attached after driver unbind.
Disable controller wakeup after removing the HCD.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-spear.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-spear.c +1 -0
@@ -103,6 +103,7 @@struct spear_ohci *sohci_p =to_spear_ohci (hcd);usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);clk_disable_unprepare (sohci_p->clk);usb_put_hcd (hcd);
PATCH 4/4 usb: ohci-st: disable controller wakeup on removal
In reply to Myeonghun PakProbe enables controller wakeup after the OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Removal does not undo this, so the wakeup source can remain attached after driver unbind.
Disable controller wakeup after removing the HCD.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/usb/host/ohci-st.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-st.c +1 -0
@@ -235,6 +235,7 @@int clk;usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);if (pdata->power_off) pdata->power_off (dev);
Patrice CHOTARD
maintainerRe: [PATCH 4/4] usb: ohci-st: disable controller wakeup on removal
Quoted 30 lines · Myeonghun Pak
Probe enables controller wakeup after the OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Removal does not undo this, so the wakeup source can remain attached after driver unbind.
Disable controller wakeup after removing the HCD.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Fixes d115837259ad ("usb: host: ohci-st: Add OHCI driver support for ST STB devices")Assisted-by LLMCo-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>--- drivers/usb/host/ohci-st.c | 1 + 1 file changed, 1 insertion(+)drivers/usb/host/ohci-st.c +1
-0@@ -235,6 +235,7 @@int clk;usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);if (pdata->power_off) pdata->power_off (dev);
Re: [PATCH 4/4] usb: ohci-st: disable controller wakeup on removal
In reply to Myeonghun PakQuoted 23 lines · Myeonghun Pak
Probe enables controller wakeup after the OHCI core marks controllers with RemoteWakeupConnected as wakeup-capable. Removal does not undo this, so the wakeup source can remain attached after driver unbind.
Disable controller wakeup after removing the HCD.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Fixes d115837259ad ("usb: host: ohci-st: Add OHCI driver support for ST STB devices")Assisted-by LLMCo-developed-by Ijae Kim <[email protected]>Signed-off-by Ijae Kim <[email protected]>Signed-off-by Myeonghun Pak <[email protected]>--- drivers/usb/host/ohci-st.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/ohci-st.c line 241
Quoted 7 lines
drivers/usb/host/ohci-st.c +1
-0@@ -235,6 +235,7 @@int clk;usb_remove_hcd (hcd); +device_wakeup_disable (hcd->self.controller);if (pdata->power_off) pdata->power_off (dev);
Hi Myeonghun
Thanks
Patrice
Quoted 7 lines · Myeonghun Pak
These four independent fixes disable controller wakeup after HCD removal in the DA8xx, S3C2410, SPEAr and ST drivers. DA8xx also needs the same cleanup when notifier registration fails after the HCD is added.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Quoted 7 lines
Assisted-by LLMMyeonghun Pak (4):
usb: ohci-da8xx: disable controller wakeup on cleanup
usb: ohci-s3c2410: disable controller wakeup on removal
usb: ohci-spear: disable controller wakeup on removal
usb: ohci-st: disable controller wakeup on removal
For all four patches: