Re: [PATCH] EHCI: expedite unlinks when the root hub is suspended

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

 



On Monday 16 March 2009, Alan Stern wrote:
> This patch (as1225) fixes a bug in ehci-hcd.  The condition for
> whether unlinked QHs can become IDLE should not be that the controller
> is halted, but rather that the controller isn't running.  In other
> words when the root hub is suspended, the hardware doesn't own any
> QHs.
> 
> This fixes a problem that can show up during hibernation: If a QH is
> only partially unlinked when the root hub is frozen, then when the
> root hub is thawed the QH won't be in the IDLE state.  As a result it
> can't be used properly for new URB submissions.
> 
> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Reported-and-tested-by: Brandon Philips <brandon@xxxxxxxx>
> CC: David Brownell <david-b@xxxxxxxxxxx>

Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

.... for 2.6.29-final too, yes?

> 
> ---
> 
> Index: usb-2.6/drivers/usb/host/ehci-q.c
> ===================================================================
> --- usb-2.6.orig/drivers/usb/host/ehci-q.c
> +++ usb-2.6/drivers/usb/host/ehci-q.c
> @@ -1127,7 +1127,8 @@ static void start_unlink_async (struct e
>  	prev->qh_next = qh->qh_next;
>  	wmb ();
>  
> -	if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) {
> +	/* If the controller isn't running, we don't have to wait for it */
> +	if (unlikely(!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))) {
>  		/* if (unlikely (qh->reclaim != 0))
>  		 *	this will recurse, probably not much
>  		 */
> 
> 



--
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