public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Tegra USB probe order issue fix
@ 2014-07-01 21:08 Tuomas Tynkkynen
  2014-07-01 21:08 ` [PATCH 1/3] reset: Re-export of_reset_control_get Tuomas Tynkkynen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Tuomas Tynkkynen @ 2014-07-01 21:08 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, Stephen Warren, Felipe Balbi, Philipp Zabel,
	linux-usb, linux-tegra, linux-kernel, tuomas.tynkkynen,
	Tuomas Tynkkynen

Hi all,

This series fixes a probe order issue with the Tegra EHCI driver.
Basically, the register area of the 1st USB controller contains some
registers that are global to all of the controllers, but that are also
cleared when reset is asserted to the 1st controller. So if (say) the
3rd controller would be the first one to finish probing successfully,
then the reset that happens during the 1st controller's probe would
result in broken USB. So the before doing anything with the USB HW,
we should reset the 1st controller once, and then never ever reset
it again.

However, fixing this without breaking existing device trees is very
complicated, as the 2nd and 3rd Tegra EHCI controllers don't have a
phandle to the 1st controller's reset handle, so we have to find it
the hard way. This is done in patch 2.

Patch 1 is a prerequisite change to the reset control API, so that we
can get a reset controller reference without a struct device *.

While testing that the 1st USB controller still works without a reset
when the driver is unbound and bound again, I discovered an unbalanced
regulator_disable + clk_disable_unprepare in the PHY code if the EHCI
driver is unbound and rebound. This is fixed in patch 3.

Tested on the Jetson TK1 that the 3rd USB port still works when the
1st controller is enabled and moved so that it's the last USB
node in the DT. Also tested that the 1st controller still works
after an unbind + rebind, even though it's not getting resetted
during the probe.

Thanks,
Tuomas

Tuomas Tynkkynen (3):
  reset: Re-export of_reset_control_get
  USB: EHCI: tegra: Fix probe order issue leading to broken USB
  USB: PHY: tegra: Call tegra_usb_phy_close only on device removal

 drivers/usb/host/ehci-tegra.c   | 111 ++++++++++++++++++++++++++++++++++++++--
 drivers/usb/phy/phy-tegra-usb.c |   8 ++-
 include/linux/reset.h           |   8 +++
 3 files changed, 119 insertions(+), 8 deletions(-)

-- 
1.8.1.5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-02 17:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 21:08 [PATCH 0/3] Tegra USB probe order issue fix Tuomas Tynkkynen
2014-07-01 21:08 ` [PATCH 1/3] reset: Re-export of_reset_control_get Tuomas Tynkkynen
2014-07-01 21:08 ` [PATCH 2/3] USB: EHCI: tegra: Fix probe order issue leading to broken USB Tuomas Tynkkynen
2014-07-01 21:08 ` [PATCH 3/3] USB: PHY: tegra: Call tegra_usb_phy_close only on device removal Tuomas Tynkkynen
2014-07-01 22:21   ` Stephen Warren
2014-07-02 14:02 ` [PATCH 0/3] Tegra USB probe order issue fix Alan Stern
2014-07-02 15:45   ` Stephen Warren
2014-07-02 16:09     ` Alan Stern
2014-07-02 16:18       ` Stephen Warren
2014-07-02 17:45         ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox