On Thu, 30 Sep 2010, Alan Cox wrote: > From: Philippe Skowronski <philippe.skowronski@xxxxxxxxx> > > It is safer to cancel pending requests before free dTD and dQH when > controller enters suspend state. > > Signed-off-by: Philippe Skowronski <philippe.skowronski@xxxxxxxxx> > Signed-off-by: Hao Wu <hao.wu@xxxxxxxxx> > Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx> > --- > > drivers/usb/gadget/langwell_udc.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > > diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c > index 0643060..2e82093 100644 > --- a/drivers/usb/gadget/langwell_udc.c > +++ b/drivers/usb/gadget/langwell_udc.c > @@ -3377,6 +3377,7 @@ error: > static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) > { > struct langwell_udc *dev = the_controller; > + unsigned long flags; > > dev_dbg(&dev->pdev->dev, "---> %s()\n", __func__); > > @@ -3391,6 +3392,11 @@ static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state) > /* save PCI state */ > pci_save_state(pdev); > > + spin_lock_irqsave(&dev->lock, flags); > + /* stop all usb activities */ > + stop_activity(dev, dev->driver); > + spin_unlock_irqrestore(&dev->lock, flags); > + This can use spin_lock_irq and spin_unlock_irq. You know that interrupts are enabled when the suspend routine runs. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html