From 64a21d025d3a979a8715f2ec7acabca7b5406c8a Mon Sep 17 00:00:00 2001 From: Aleksey Gorelov Date: Tue, 8 Aug 2006 17:24:08 -0700 Subject: USB: Properly unregister reboot notifier in case of failure in ehci hcd If some problem occurs during ehci startup, for instance, request_irq fails, echi hcd driver tries it best to cleanup, but fails to unregister reboot notifier, which in turn leads to crash on reboot/poweroff. The following patch resolves this problem by not using reboot notifiers anymore, but instead making ehci/ohci driver get its own shutdown method. For PCI, it is done through pci glue, for everything else through platform driver glue. One downside: sa1111 does not use platform driver stuff, and does not have its own shutdown hook, so no 'shutdown' is called for it now. I'm not sure if it is really necessary on that platform, though. Signed-off-by: Aleks Gorelov Cc: Alan Stern Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hcd.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/usb/core/hcd.h') diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 7022aafb2ae8..58c7767bc904 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h @@ -192,6 +192,9 @@ struct hc_driver { /* cleanly make HCD stop writing memory and doing I/O */ void (*stop) (struct usb_hcd *hcd); + /* shutdown HCD */ + void (*shutdown) (struct usb_hcd *hcd); + /* return current frame number */ int (*get_frame_number) (struct usb_hcd *hcd); @@ -227,6 +230,9 @@ extern int usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqflags); extern void usb_remove_hcd(struct usb_hcd *hcd); +struct platform_device; +extern void usb_hcd_platform_shutdown(struct platform_device* dev); + #ifdef CONFIG_PCI struct pci_dev; struct pci_device_id; @@ -239,6 +245,8 @@ extern int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t state); extern int usb_hcd_pci_resume (struct pci_dev *dev); #endif /* CONFIG_PM */ +extern void usb_hcd_pci_shutdown (struct pci_dev *dev); + #endif /* CONFIG_PCI */ /* pci-ish (pdev null is ok) buffer alloc/mapping support */ -- cgit v1.2.3