Re: [PATCH 12/25] USB: EHCI: use hrtimer for async schedule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 16 Jul 2012, Ming Lei wrote:

> On Wed, Jul 11, 2012 at 11:22 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > This patch (as1576) adds hrtimer support for managing ehci-hcd's
> > async schedule.  Just as with the earlier change to the periodic
> > schedule management, two new hrtimer events take care of everything.
> >
> > One event polls at 1-ms intervals to see when the Asynchronous
> > Schedule Status (ASS) flag matches the Asynchronous Schedule Enable
> > (ASE) value; the schedule's state must not be changed until it does.
> > The other event delays for 15 ms after the async schedule becomes
> > empty before turning it off.
> >
> > The new events replace a busy-wait poll and a kernel timer usage.
> > They also replace the rather illogical method currently used for
> > indicating the async schedule should be turned off: attempting to
> > unlink the dedicated QH at the head of the async list.


> > --- usb-3.4.orig/drivers/usb/host/ehci-timer.c
> > +++ usb-3.4/drivers/usb/host/ehci-timer.c
> > @@ -67,8 +67,10 @@ static void ehci_clear_command_bit(struc
> >   * the event types indexed by enum ehci_hrtimer_event in ehci.h.
> >   */
> >  static unsigned event_delays_ns[] = {
> > +       1 * NSEC_PER_MSEC,      /* EHCI_HRTIMER_POLL_ASS */
> >         1 * NSEC_PER_MSEC,      /* EHCI_HRTIMER_POLL_PSS */
> >         10 * NSEC_PER_MSEC,     /* EHCI_HRTIMER_DISABLE_PERIODIC */
> > +       15 * NSEC_PER_MSEC,     /* EHCI_HRTIMER_DISABLE_ASYNC */
> 
> The previous EHCI_ASYNC_JIFFIES is defined as 50ms, so looks
> EHCI_HRTIMER_DISABLE_ASYNC is much aggressive than before.

Yeah, I forgot to mention that change in the patch description.  It 
didn't seem to be terribly important.

The most prevalent use case for removing and adding QHs from/to the
async schedule is probably the bulk endpoints used by mass-storage
devices.  15 ms should be long enough to keep the QHs on the schedule
if they are in active use.  At high speed, the largest transfer
usb-storage normally uses (120 KB) requires only 3 or 4 ms.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux