From stern@rowland.harvard.edu Fri May 5 13:23:47 2006 Date: Fri, 5 May 2006 16:23:42 -0400 (EDT) From: Alan Stern To: Greg KH cc: David Brownell Subject: USB: net2280: add a shutdown routine Message-ID: The net2280 board has an annoying habit of surviving soft reboots with interrupts enabled. This patch (as674) adds a shutdown routine to the driver so that the board can be put in a quiescent state. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/net2280.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- gregkh-2.6.orig/drivers/usb/gadget/net2280.c +++ gregkh-2.6/drivers/usb/gadget/net2280.c @@ -2972,6 +2972,22 @@ done: return retval; } +/* make sure the board is quiescent; otherwise it will continue + * generating IRQs across the upcoming reboot. + */ + +static void net2280_shutdown (struct pci_dev *pdev) +{ + struct net2280 *dev = pci_get_drvdata (pdev); + + /* disable IRQs */ + writel (0, &dev->regs->pciirqenb0); + writel (0, &dev->regs->pciirqenb1); + + /* disable the pullup so the host will think we're gone */ + writel (0, &dev->usb->usbctl); +} + /*-------------------------------------------------------------------------*/ @@ -3001,6 +3017,7 @@ static struct pci_driver net2280_pci_dri .probe = net2280_probe, .remove = net2280_remove, + .shutdown = net2280_shutdown, /* FIXME add power management support */ };