提交 02597d2d 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

[PATCH] USB UHCI: Add shutdown method

After all the discussion you might not be interested in this still, but
nevertheless here it is.  This patch adds a shutdown method to the
uhci-hcd driver.  Its prerequisite is the patch you wrote adding shutdown
support for PCI.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c074b416
...@@ -154,6 +154,7 @@ static void reset_hc(struct uhci_hcd *uhci) ...@@ -154,6 +154,7 @@ static void reset_hc(struct uhci_hcd *uhci)
/* /*
* Last rites for a defunct/nonfunctional controller * Last rites for a defunct/nonfunctional controller
* or one we don't want to use any more.
*/ */
static void hc_died(struct uhci_hcd *uhci) static void hc_died(struct uhci_hcd *uhci)
{ {
...@@ -525,6 +526,20 @@ static int uhci_reset(struct usb_hcd *hcd) ...@@ -525,6 +526,20 @@ static int uhci_reset(struct usb_hcd *hcd)
return 0; return 0;
} }
/* Make sure the controller is quiescent and that we're not using it
* any more. This is mainly for the benefit of programs which, like kexec,
* expect the hardware to be idle: not doing DMA or generating IRQs.
*
* This routine may be called in a damaged or failing kernel. Hence we
* do not acquire the spinlock before shutting down the controller.
*/
static void uhci_shutdown(struct pci_dev *pdev)
{
struct usb_hcd *hcd = (struct usb_hcd *) pci_get_drvdata(pdev);
hc_died(hcd_to_uhci(hcd));
}
/* /*
* Allocate a frame list, and then setup the skeleton * Allocate a frame list, and then setup the skeleton
* *
...@@ -939,6 +954,7 @@ static struct pci_driver uhci_pci_driver = { ...@@ -939,6 +954,7 @@ static struct pci_driver uhci_pci_driver = {
.probe = usb_hcd_pci_probe, .probe = usb_hcd_pci_probe,
.remove = usb_hcd_pci_remove, .remove = usb_hcd_pci_remove,
.shutdown = uhci_shutdown,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = usb_hcd_pci_suspend, .suspend = usb_hcd_pci_suspend,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册