Re: confuse about qh_link_async

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

 



On Fri, 29 Oct 2010, Gavin Guo wrote:

> Hi all,
>         The following code in qh_link_async:
> 
>         if (!head->qh_next.qh) {
>                 u32     cmd = ehci_readl(ehci, &ehci->regs->command);
> 
>                 if (!(cmd & CMD_ASE)) {
>                         /* in case a clear of CMD_ASE didn't take yet */
>                         (void)handshake(ehci, &ehci->regs->status,
>                                         STS_ASS, 0, 150);
>                         cmd |= CMD_ASE | CMD_RUN;
>                         ehci_writel(ehci, cmd, &ehci->regs->command);
>                         ehci_to_hcd(ehci)->state = HC_STATE_RUNNING;
>                         /* posted write need not be known to HC yet ... */
>                 }
>         }
>         Why only the null queue head is checked? I think it is
> possible that non-empty queue head link list also have asynchronous
> list disabled

No, it is not possible.

>         (hc encounter queue head of which H=1 and scan_async havent's
> unlink the queue head).

Only one QH, ehci->async, ever has H set to 1.  It is never removed 
from the async schedule.

>         If the non-empty queue head list condition is met, and
> qh_link_async add new queue head directly without enable CMD_ASE &
> CMD_RUN.
>         The host controller will not go ahead to process the new queue
> head?? or if it's possible that hc could enable CMD_ASE & CMD_RUN in
> other place ??
>         Could someone please tell me how this work ??

The async schedule is turned off in only one place: when 
ehci_watchdog() calls start_unlink_async(ehci, ehci->async).  That 
happens only when the timer_action(ehci, TIMER_ASYNC_OFF) is called, 
and that happens only in end_unlink_async() when the async list is 
empty.

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