linux/drivers/usb/phy
Stephen Warren 91a687d8fe USB: EHCI: tegra: fix circular module dependencies
The Tegra EHCI driver directly calls various functions in the Tegra USB
PHY driver. The reverse is also true; the PHY driver calls into the EHCI
driver. This is problematic when the two are built as modules.

The calls from the PHY to EHCI driver were originally added in commit
bbdabdb "usb: add APIs to access host registers from Tegra PHY", for the
following reasons:

1) The register being touched is an EHCI register, so logically only the
   EHCI driver should touch it.
2) (1) implies that some locking may be needed to correctly implement the
   r/m/w access to this shared register.
3) We were expecting to pass only the PHY register space to the Tegra PHY
   driver, and hence it would not have access to touch the shared
   registers.

To solve this, that commit added functions in the EHCI driver to touch the
shared register on behalf of the PHY driver.

In practice, we ended up not having any locking in the implementaiton of
those functions, and I've been led to believe this is safe. Equally, (3)
did not happen either. Hence, it is possible for the PHY driver to touch
the shared register directly.

Given that, this patch moves the code to touch the shared register back
into the PHY driver, to eliminate the module problems. If we actually
need locking or co-ordination in the future, I propose we put the lock
support into some pre-existing core module, or into a third separate
module, in order to avoid the circular dependencies.

I apologize for my contribution to code churn here.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 13:54:48 -07:00
..
Kconfig usb: phy: samsung: Select common driver part implicitly 2013-05-28 20:06:19 +03:00
Makefile usb: add devicetree helpers for determining dr_mode and phy_type 2013-06-17 13:47:09 -07:00
of.c usb: add devicetree helpers for determining dr_mode and phy_type 2013-06-17 13:47:09 -07:00
phy-ab8500-usb.c usb: phy: ab8500-usb: add ab9540 support 2013-05-28 20:03:55 +03:00
phy-fsl-usb.c usb: phy: Fix NULL pointer exception during usb_get_phy 2013-05-15 17:32:47 +03:00
phy-fsl-usb.h usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-fsm-usb.c usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-fsm-usb.h usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-gpio-vbus-usb.c usb: phy: Fix NULL pointer exception during usb_get_phy 2013-05-15 17:32:47 +03:00
phy-isp1301-omap.c usb: patches for v3.10 merge window 2013-04-05 15:18:00 -07:00
phy-isp1301.c usb: phy: Fix NULL pointer exception during usb_get_phy 2013-05-15 17:32:47 +03:00
phy-msm-usb.c usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-mv-u3d-usb.c usb: phy: don't check resource with devm_ioremap_resource 2013-05-15 17:32:17 +03:00
phy-mv-u3d-usb.h usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-mv-usb.c usb: phy: mv-usb: Remove redundant platform_set_drvdata() 2013-05-15 17:22:56 +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: otg: mxs-phy: add missing type to usb_phy 2013-05-15 17:34:01 +03:00
phy-nop.c usb: phy: phy-nop: Remove redundant use of of_match_ptr 2013-05-28 20:14:39 +03:00
phy-omap-control.c usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-omap-usb2.c usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy-omap-usb3.c usb: phy: omap-usb3: updated dpll M,N values to support DRA7xx devices 2013-06-01 00:22:49 +03:00
phy-rcar-usb.c usb: phy: rcar-usb: Fix comment w.r.t. devm_ioremap_resource 2013-06-17 13:37:07 -07:00
phy-samsung-usb2.c usb: phy: samsung: Add support HSIC on Exynos4X12 2013-05-28 20:16:37 +03:00
phy-samsung-usb3.c usb: phy: samsung: Pass enable/disable callbacks through driver data 2013-05-28 20:07:15 +03:00
phy-samsung-usb.c usb: phy: samsung: Add support HSIC on Exynos4X12 2013-05-28 20:16:37 +03:00
phy-samsung-usb.h usb: phy: samsung: Add support HSIC on Exynos4X12 2013-05-28 20:16:37 +03:00
phy-tegra-usb.c USB: EHCI: tegra: fix circular module dependencies 2013-06-17 13:54:48 -07:00
phy-twl4030-usb.c usb: patches for v3.10 merge window 2013-04-05 15:18:00 -07:00
phy-twl6030-usb.c usb: patches for v3.10 merge window 2013-04-05 15:18:00 -07:00
phy-ulpi-viewport.c usb: phy: export ulpi_viewport_access_ops 2013-06-17 13:54:47 -07:00
phy-ulpi.c usb: phy: rename all phy drivers to phy-$name-usb.c 2013-03-18 11:18:08 +02:00
phy.c usb: phy: remove exported function from __init section 2013-04-23 14:13:48 +03:00