Re: hub.c port power handling on over-current

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Tuesday 29 May 2007, Engelmayer Christian wrote:
> To answer Your questions:
> 
> *) the affected hub does report per port power switching correctly
> *) whether it is an erratum or design I can tell You in case I get
>    a clear answer on that point.
> 
> The following patch works well for my problem and might be useful
> (at least not harmful) in the common code path:

Looks fair to me ... it won't trigger on any of my hardware, none
of it reports per-port power switching.

Got a signed-off-by update?  And and update so the lines stay
under 80 characters?

- Dave


> --- linux-2.6.21.3/drivers/usb/host/ehci-hub.c.orig	Tue May 29 17:12:50
> 2007
> +++ linux-2.6.21.3/drivers/usb/host/ehci-hub.c	Tue May 29 12:19:47 2007
> @@ -389,6 +389,18 @@ ehci_hub_status_data (struct usb_hcd *hc
>  			    buf [1] |= 1 << (i - 7);
>  			status = STS_PCD;
>  		}
> +
> +		/* The hub was supposed to disable port power autonomously on
> over-current.
> +		 * However, not all hubs can be trusted to do this although
> they need port
> +		 * power disabled in order to recover properly.
> +		 */
> +		if (temp & PORT_OCC) {
> +			if (HCS_PPC(ehci->hcs_params)){
> +				temp &= ~(PORT_RWC_BITS | PORT_POWER);
> +				writel (temp, &ehci->regs->port_status [i]);
> +			}
> +		}
> +
>  	}
>  	/* FIXME autosuspend idle root hubs */
>  	spin_unlock_irqrestore (&ehci->lock, flags);
> 
> 
> - Christian
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[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.