Skip to contentSkip to conversation

usb: make module xhci_hcd removable

PATCH In review Arthur Demchenkov 4 participants 4 messages May 18, 2015 – May 19, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: make module xhci_hcd removable

Fixed regression. After commit 29e409f the module xhci_hcd became non-removable. That behaviour is not expected and there're no notes about it in commit message. The module should be removable as it blocks PM suspend/resume functions (Debian Bug#666406).

---
 drivers/usb/host/xhci.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/host/xhci.c +8 -0
index ec8ac16..4299cbf 100644
@@ -5011,4 +5011,12 @@ static int __init xhci_hcd_init(void)
 	BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
 	return 0;
 }
+
+/*
+ * If an init function is provided, an exit function must also be provided
+ * to allow module unload.
+ */
+static void __exit xhci_hcd_fini(void) { }
+
 module_init(xhci_hcd_init);
+module_exit(xhci_hcd_fini);
Signature · 1 line
2.3.6
Reviewed-by on v1 1/1
#1 lore raw

Hi Arthur,

Quoted 6 lines · Arthur Demchenkov

Fixed regression. After commit 29e409f the module xhci_hcd became non-removable. That behaviour is not expected and there're no notes about it in commit message. The module should be removable as it blocks PM suspend/resume functions (Debian Bug#666406).

Oops, sorry about that! Anyway,

I suppose this should be a considered a stable fix for v3.18 and later.

Thanks,
Andrew

maintainer
#2 lore raw
In reply to Arthur Demchenkov
Quoted 4 lines · Arthur Demchenkov

Fixed regression. After commit 29e409f the module xhci_hcd became non-removable. That behaviour is not expected and there're no notes about it in commit message. The module should be removable as it blocks PM suspend/resume functions (Debian Bug#666406).

I hate to ask why debian things that unloading all kernel modules is the correct thing to do for suspend...

But that's separate from this patch, this looks correct, thanks.

greg k-h

#3 lore raw
Quoted 8 lines · Greg KH
Quoted 4 lines · Arthur Demchenkov

Fixed regression. After commit 29e409f the module xhci_hcd became non-removable. That behaviour is not expected and there're no notes about it in commit message. The module should be removable as it blocks PM suspend/resume functions (Debian Bug#666406).

I hate to ask why debian things that unloading all kernel modules is the correct thing to do for suspend...

They don't. If you look closer, the bug report refers to unloading xhci_hcd as a *workaround* for the bug which casued xhci_hcd to immediately wake the system.

But I was under the impression that (other) bug was fixed long ago?

Bjørn