linux-sg2042/drivers/usb/phy
Jon Hunter 203f44c475 usb: phy: tegra: Fix phy suspend for UDC
Commit dfebb5f43a ("usb: chipidea: Add support for Tegra20/30/114/124")
added UDC support for Tegra but with UDC support enabled, is was found
that Tegra30, Tegra114 and Tegra124 would hang on entry to suspend.

The hang occurred during the suspend of the USB PHY when the Tegra PHY
driver attempted to disable the PHY clock. The problem is that before
the Tegra PHY driver is suspended, the chipidea driver already disabled
the PHY clock and when the Tegra PHY driver suspended, it could not read
DEVLC register and caused the device to hang.

The Tegra USB PHY driver is used by both the Tegra EHCI driver and now
the chipidea UDC driver and so simply removing the disabling of the PHY
clock from the USB PHY driver would not work for the Tegra EHCI driver.
Fortunately, the status of the USB PHY clock can be read from the
USB_SUSP_CTRL register and therefore, to workaround this issue, simply
poll the register prior to disabling the clock in USB PHY driver to see
if clock gating has already been initiated. Please note that it can take
a few uS for the clock to disable and so simply reading this status
register once on entry is not sufficient.

Similarly when turning on the PHY clock, it is possible that the clock
is already enabled or in the process of being enabled, and so check for
this when enabling the PHY.

Please note that no issues are seen with Tegra20 because it has a slightly
different PHY to Tegra30/114/124.

Fixes: dfebb5f43a ("usb: chipidea: Add support for Tegra20/30/114/124")
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-10-11 13:13:07 +03:00
..
Kconfig usb: phy: Introduce one extcon device into usb phy 2017-05-17 14:15:28 +03:00
Makefile usb: phy: Remove unused config 2017-04-11 10:58:22 +03:00
of.c usb: phy: fixed comment typo 2015-03-11 10:19:36 -05:00
phy-ab8500-usb.c usb: phy: ab8500: remove unused ab8500_eyediagram_workaroud() 2017-01-26 10:51:27 +02:00
phy-am335x-control.c USB: phy: am335x-control: fix device and of_node leaks 2016-11-18 13:54:09 +02:00
phy-am335x-control.h usb: phy: phy-am335x: bypass first VBUS sensing for host-only mode 2015-12-16 10:07:25 -06:00
phy-am335x.c USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block 2016-06-21 10:52:39 +03:00
phy-fsl-usb.c usb: otg-fsm: Prevent build warning "VDBG" redefined 2017-04-11 10:58:23 +03:00
phy-fsl-usb.h usb: phy: fsl: Fix build errors 2014-11-12 08:37:37 -06:00
phy-generic.c usb: phy: phy-generic: add the implementation of .set_suspend 2016-11-18 13:54:42 +02:00
phy-generic.h usb: phy: generic: add vbus support 2015-01-12 12:13:29 -06:00
phy-gpio-vbus-usb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
phy-isp1301-omap.c mfd: tps65010: Move header file out of I2C realm 2017-08-15 08:27:22 +01:00
phy-isp1301.c usb: phy: isp1301: Fix build warning when CONFIG_OF is disabled 2017-03-29 12:13:50 +02:00
phy-keystone.c usb: phy: phy-keystone: Simplify return statement 2015-08-04 11:02:05 -05:00
phy-msm-usb.c usb: phy: phy-msm-usb: Fix usage of devm_regulator_bulk_get() 2017-08-03 12:32:13 +03:00
phy-mv-usb.c usb: phy-mv-usb: constify attribute_group structures. 2017-08-15 14:18:55 +03:00
phy-mv-usb.h usb: otg: mv_otg: remove unused clock 2013-04-02 11:42:45 +03:00
phy-mxs-usb.c usb: phy: mxs: Add DT bindings to configure TX settings 2016-08-25 12:13:18 +03:00
phy-omap-otg.c usb: phy: omap-otg: Replace the extcon API 2017-01-24 11:04:13 +02:00
phy-qcom-8x16-usb.c usb: phy: qcom: Use devm_ioremap_resource() 2017-08-15 12:46:02 +03:00
phy-tahvo.c usb: phy-tahvo: constify attribute_group structures. 2017-08-15 14:18:56 +03:00
phy-tegra-usb.c usb: phy: tegra: Fix phy suspend for UDC 2017-10-11 13:13:07 +03:00
phy-twl6030-usb.c mfd: twl: Move header file out of I2C realm 2017-09-04 14:41:02 +01:00
phy-ulpi-viewport.c usb: Remove unnecessary semicolons 2013-10-11 16:26:46 -07:00
phy-ulpi.c usb: rename phy to usb_phy in OTG 2014-11-03 10:01:25 -06:00
phy.c usb: changes for v4.14 merge window 2017-08-22 13:16:06 -07:00