[PATCH] usb: dwc2: Reset device address on EnumDone

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

 



Initially resetting device address was done in USB RESET interrupt
handler. In case, when power saving mode enabled (hibernation) USB
RESET interrupt handled in dwc2_handle_gpwrdn_intr() and then it
not seen in dwc2_hsotg_irq() handler. This is why reset device
address to zero moved from USB RESET handler to EnumDone handler.

Signed-off-by: Minas Harutyunyan <hminas@xxxxxxxxxxxx>
---
 drivers/usb/dwc2/gadget.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 68ad75a7460d..7f922f19f8e1 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3072,6 +3072,9 @@ static void dwc2_hsotg_irq_enumdone(struct dwc2_hsotg *hsotg)
 
 	dev_dbg(hsotg->dev, "EnumDone (DSTS=0x%08x)\n", dsts);
 
+	/* Reset device address to zero */
+	dwc2_clear_bit(hsotg, DCFG, DCFG_DEVADDR_MASK);
+
 	/*
 	 * note, since we're limited by the size of transfer on EP0, and
 	 * it seems IN transfers must be a even number of packets we do
@@ -3614,9 +3617,6 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
 		/* Report disconnection if it is not already done. */
 		dwc2_hsotg_disconnect(hsotg);
 
-		/* Reset device address to zero */
-		dwc2_clear_bit(hsotg, DCFG, DCFG_DEVADDR_MASK);
-
 		if (usb_status & GOTGCTL_BSESVLD && connected)
 			dwc2_hsotg_core_init_disconnected(hsotg, true);
 	}
-- 
2.11.0




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

  Powered by Linux