alistair23-linux/drivers/usb/dwc3
Roger Quadros 98112041bc usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume
In order for ULPI PHYs to work, dwc3_phy_setup() and dwc3_ulpi_init()
must be doene before dwc3_core_get_phy().

commit 541768b08a ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys")
broke this.

The other issue is that dwc3_core_get_phy() and dwc3_ulpi_init() should
be called only once during the life cycle of the driver. However,
as dwc3_core_init() is called during system suspend/resume it will
result in multiple calls to dwc3_core_get_phy() and dwc3_ulpi_init()
which is wrong.

Fix this by moving dwc3_ulpi_init() out of dwc3_phy_setup()
into dwc3_core_ulpi_init(). Use a flag 'ulpi_ready' to ensure that
dwc3_core_ulpi_init() is called only once from dwc3_core_init().

Use another flag 'phys_ready' to call dwc3_core_get_phy() only once from
dwc3_core_init().

Fixes: 541768b08a ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys")
Fixes: f54edb539c ("usb: dwc3: core: initialize ULPI before trying to get the PHY")
Cc: linux-stable <stable@vger.kernel.org> # >= v4.13
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2018-02-15 15:28:35 +02:00
..
core.c usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume 2018-02-15 15:28:35 +02:00
core.h usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume 2018-02-15 15:28:35 +02:00
debug.h usb: dwc3: debug: decode a few more features 2017-12-11 12:36:48 +02:00
debugfs.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
drd.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-exynos.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-keystone.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-of-simple.c usb: dwc3: of-simple: fix oops by unbalanced clk disable call 2018-02-12 10:41:45 +02:00
dwc3-omap.c usb: dwc3: omap: don't miss events during suspend/resume 2018-02-12 10:53:18 +02:00
dwc3-pci.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-st.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
ep0.c usb: dwc3: ep0: Reset TRB counter for ep0 IN 2018-02-12 10:48:39 +02:00
gadget.c usb: dwc3: gadget: Set maxpacket size for ep0 IN 2018-02-12 10:48:36 +02:00
gadget.h USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
host.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
io.h USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
Kconfig usb: changes for v4.12 2017-04-11 16:47:26 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
trace.h usb: dwc3: Make sparse a bit happier 2017-12-11 12:36:49 +02:00
ulpi.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00