[Cbe-oss-dev] [PATCH 5/5] usb: PS3 EHCI HC reset work-around

Alan Stern stern at rowland.harvard.edu
Sat Nov 19 02:41:21 EST 2011


On Thu, 17 Nov 2011, Geoff Levand wrote:

> Hi,
> 
> On Tue, 2011-11-15 at 12:12 -0500, Alan Stern wrote:
> > The HC gets reset during initialization, and you can reload the 
> > registers then.  It also gets reset when the driver unbinds or the HC 
> > dies; it doesn't matter what happens to the registers at those times.
> > 
> > The only other place where ehci_reset() gets called is at the start of
> > ehci_run() -- not where your 4/5 patch added a hook.  As far as I can
> > tell, that call isn't necessary at all.  We just have to audit the
> > various platform drivers to make sure they all call ehci_reset() at
> > some appropriate point during their probe routine.
> > 
> > Therefore the 4/5 patch should merely remove the ehci_reset() call near
> > the start of ehci_run(), and this patch should merge the
> > ps3_ehci_post_reset code at the end of ps3_ehci_hc_reset() instead of
> > installing a hook.
> 
> I've made the two preliminary (untested on non-ps3) patches following
> that I think do what you suggest.  
> 
> As I'm not familiar with it, I'm not sure what to about devices with TDI
> (Transaction Translator) support.  Will they just work like this, or do
> we need to add a conditional on the ehci_reset()?

I think that part of your patch was correct; just remove that section
of code from ehci-hcd.c entirely.  In fact, the comment there will now
apply to non-TDI controllers as well -- they will all do the ehci_reset
either in their probe or their reset routine.  Therefore ehci_run 
doesn't need to call ehci_reset at all.

As for whether the return value from ehci_reset needs to be checked...  
Practically nobody seems to do so now.  I guess we don't need to worry 
about it.

Alan Stern



More information about the cbe-oss-dev mailing list