aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPhilippe Skowronski <philippe.skowronski@intel.com>2010-10-01 14:59:16 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:22:00 -0700
commitcf7d3c8e579a643ff81ff95d51babdaf4c55f5f4 (patch)
treec2890018e142e6f2f2da0dd73b6d21661b36ef1d /drivers
parentc8458d59d424fcba2456d6cba5811ce01c3aedb9 (diff)
usb: langwell_udc: cancel pending requests when controller is suspended.
It is safer to cancel pending requests before free dTD and dQH when controller enters suspend state. Signed-off-by: Philippe Skowronski <philippe.skowronski@intel.com> Signed-off-by: Hao Wu <hao.wu@intel.com> [Switch to spin_lock_irq as suggested by Alan Stern] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/langwell_udc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 06430604670..b8ec954c069 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -3391,6 +3391,11 @@ static int langwell_udc_suspend(struct pci_dev *pdev, pm_message_t state)
/* save PCI state */
pci_save_state(pdev);
+ spin_lock_irq(&dev->lock);
+ /* stop all usb activities */
+ stop_activity(dev, dev->driver);
+ spin_unlock_irq(&dev->lock);
+
/* free dTD dma_pool and dQH */
if (dev->dtd_pool)
dma_pool_destroy(dev->dtd_pool);