On Thu, 31 Mar 2005, David Brownell wrote:

> It worked in both "legacy" mode and with setting the new/temporary flag,
> but neither of those seems to be the target mode...
> 
> I put together a simple OHCI patch to use INTR_RHSC to drive this code,
> and observed that it's not quite so simple ... this patch assumes that
> the interrupts will be edge triggered, which they aren't.

Yes, that was the assumption.  With UHCI it's true.  But if OHCI is level 
triggered then it will be troublesome.

> Basically, INTR_RHSC is signaled until the relevant hub status change
> bits are cleared.  Which means that usb_hcd_poll_rh_status() needs
> to actually handle the event right away ... but instead, it's now
> telling khubd to get to it whenever it can.  IRQ handler returns,
> controller is still issuing the IRQ, non-SMP systems get nowhere.
> On SMP, one CPU will be tied up re-handling the IRQ, until another
> gets around to running khubd.
> 
> I suppose I could look at disabling that IRQ source until khubd
> gets around to handling the change, but that would defeat the goal
> of simplifying HCDs.  And the OHCI logic there wouldn't be sharable
> with EHCI, or other IRQ-drivable controllers...

Won't EHCI end up looking more like UHCI?  In any case, I wouldn't expect 
the logic to be sharable.

How easy is it to disable the INTR_RHSC signal in the IRQ handler and to 
re-enable it later?  Would it help to add a callback for enabling?

Also, remember: The goal wasn't so much to simplify HCDs as to eliminate
polling.  It would be surprising if adding root-hub interrupt support
could reduce the complexity of an HCD, considering that it's still
necessary to support some form of polling.

> Seems like doing this properly will mean splitting some code out of
> khubd so it can run in IRQ context.

While technically possible, I think it would be better to avoid this.

What do you think of accepting the patch as it stands, with the idea of 
adding or changing things later to accomodate level-triggered controllers?

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to