linux/drivers/phy
NeilBrown 35242ba632 phy: twl4030-usb: make runtime pm more reliable.
[ Upstream commit 56301df6bc ]

A construct like:

        if (pm_runtime_suspended(twl->dev))
               pm_runtime_get_sync(twl->dev);

is against the spirit of the runtime_pm interface as it
makes the internal refcounting useless.

In this case it is also racy, particularly as 'put_autosuspend'
is used to drop a reference.
When that happens a timer is started and the device is
runtime-suspended after the timeout.
If the above code runs in this window, the device will not be
found to be suspended so no pm_runtime reference is taken.
When the timer expires the device will be suspended, which is
against the intention of the code.

So be more direct is taking and dropping references.
If twl->linkstat is VBUS_VALID or ID_GROUND, then hold a
pm_runtime reference, otherwise don't.
Define "cable_present()" to test for this condition.

Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2015-08-20 17:33:10 -04:00
..
Kconfig phy: phy-stih41x-usb: Add usb phy support for STiH41x SoCs. 2014-09-24 15:18:33 +05:30
Makefile phy: phy-stih41x-usb: Add usb phy support for STiH41x SoCs. 2014-09-24 15:18:33 +05:30
phy-bcm-kona-usb2.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-berlin-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-core.c phy: Find the right match in devm_phy_destroy() 2015-04-16 20:11:41 -04:00
phy-exynos-dp-video.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-exynos-mipi-video.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-exynos4x12-usb2.c drivers: phy: exynos-usb2: add support for Exynos 3250 2014-07-22 12:46:10 +05:30
phy-exynos5-usbdrd.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-exynos4210-usb2.c phy: Add new Exynos USB 2.0 PHY driver 2014-03-08 12:39:44 +05:30
phy-exynos5250-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-exynos5250-usb2.c phy: phy-samsung-usb2: Change phy power on/power off sequence 2014-07-22 12:46:10 +05:30
phy-hix5hd2-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-miphy365x.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-mvebu-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-omap-control.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-omap-usb2.c phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly 2014-11-05 14:34:06 -08:00
phy-qcom-apq8064-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-qcom-ipq806x-sata.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-rcar-gen2.c phy: Renesas R-Car Gen2 PHY driver 2014-09-24 15:18:31 +05:30
phy-s5pv210-usb2.c phy: Add support for S5PV210 to the Exynos USB 2.0 PHY driver 2014-07-19 04:25:09 +09:00
phy-samsung-usb2.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-samsung-usb2.h ARM: SoC platform changes for 3.17 2014-08-08 11:14:29 -07:00
phy-spear1310-miphy.c phy: phy-spear1310-miphy: Use module_platform_driver to register driver. 2014-09-24 15:18:32 +05:30
phy-spear1340-miphy.c phy: phy-spear1340-miphy: Use module_platform_driver to register driver. 2014-09-24 15:18:32 +05:30
phy-stih41x-usb.c phy: phy-stih41x-usb: Add usb phy support for STiH41x SoCs. 2014-09-24 15:18:33 +05:30
phy-stih407-usb.c phy: phy-stih407-usb: Add usb picoPHY driver found on stih407 SoC family 2014-09-24 15:18:33 +05:30
phy-sun4i-usb.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-ti-pipe3.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30
phy-twl4030-usb.c phy: twl4030-usb: make runtime pm more reliable. 2015-08-20 17:33:10 -04:00
phy-xgene.c phy: remove .owner field for drivers using module_platform_driver 2014-09-24 15:18:34 +05:30