From: Gregory Herrero <gregory.herr...@intel.com>

lx_state must be used to reflect controller power state only and not
bus state. Thus add a flag to track state during bus suspend.

Signed-off-by: Gregory Herrero <gregory.herr...@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kau...@intel.com>
---
 drivers/usb/dwc2/core.h | 1 +
 drivers/usb/dwc2/hcd.c  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 9655b1e..b1e3364 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -703,6 +703,7 @@ struct dwc2_hsotg {
 
        unsigned int queuing_high_bandwidth:1;
        unsigned int srp_success:1;
+       unsigned int bus_suspended:1;
 
        struct workqueue_struct *wq_otg;
        struct work_struct wf_otg;
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 623845f..997f15e 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -1425,6 +1425,7 @@ static void dwc2_wakeup_detected(unsigned long data)
        dev_dbg(hsotg->dev, "Clear Resume: HPRT0=%0x\n",
                readl(hsotg->regs + HPRT0));
 
+       hsotg->bus_suspended = 0;
        dwc2_hcd_rem_wakeup(hsotg);
 
        /* Change to L0 state */
@@ -1462,7 +1463,7 @@ static void dwc2_port_suspend(struct dwc2_hsotg *hsotg, 
u16 windex)
        writel(hprt0, hsotg->regs + HPRT0);
 
        /* Update lx_state */
-       hsotg->lx_state = DWC2_L2;
+       hsotg->bus_suspended = 1;
 
        /* Suspend the Phy Clock */
        pcgctl = readl(hsotg->regs + PCGCTL);
-- 
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to