Skip to content

Commit

Permalink
usb: langwell_udc: cancel pending requests when controller is suspended.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Philippe Skowronski authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent c8458d5 commit cf7d3c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/usb/gadget/langwell_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf7d3c8

Please sign in to comment.