Re: usb hcd questions

"jidong xiao" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On 10/25/07, Alan Stern <[email protected]> wrote:
> On Wed, 24 Oct 2007, jidong xiao wrote:
>
> > 1.I noticed there is a new root-hub polling mechanism,what is it?And
> > what is the old one?
>
> The old polling mechanism calls the HCD's hub_status_data routine only
> when a status URB is pending.  The new polling mechanism calls the
> HCD's hub_status_data routine whenever requested to do, regardless of
> whether or not a status URB is pending.
>
> > 2.struct usb_hcd has an element of unsigned poll_pending, what does
> > this variable mean?
>
> It means the HCD's hub_status_data routine has said a root-hub status
> change occurred, but no status URB was submitted so the status change
> couldn't be sent upward to the hub driver.  When the next status URB is
> submitted, it will complete almost immediately with the new status
> information.
>
> >  In particular, this method sets poll_pending:
> >
> > void usb_hcd_poll_rh_status(struct usb_hcd *hcd){
> > ...
> >               if (length > 0)
> >                       usb_hcd_giveback_urb (hcd, urb);
> >               else
> >                       hcd->poll_pending = 1;
> > }
> >
> > Why for length<=0, we need to set hcd->poll_pending to 1?
>
> The code above is old.  Still, the idea is what I wrote above.  If
> length <= 0 then there is no status URB currently queued.
> hcd->poll_pending has to be set so that when the next status URB is
> submitted it can get the status-change information quickly.  If we
> didn't do this then the URB might not complete for a long time, since
> root-hub status changes are often interrupt-driven and there might not
> be any status interrupts for a while.
>
Regarding "since root-hub status changes are often interrupt-driven"...

Not quite understand about this,actually I saw in several place of the
source code, we still set poll_rh to 1,as I understand,usbcore will
poll for events whenever poll_rh is set. So if HCD often uses
interrupt to get root hub events, then under what condition,we need to
use poll?

Take uhci-hcd for example, note that, poll_rh is set inside
start_rh/uhci_resume, why the root hub needs to be polled at these
circumstances?

Regards
Jason

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.