[PATCH] usb: langwell_udc: cancel pending requests when controller is suspended.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
[Switch to spin_lock_irq as suggested by Alan Stern]
Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
---

 drivers/usb/gadget/langwell_udc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index 0643060..b8ec954 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);

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux