Re: [PATCH] USB: EHCI: don't reread PORTSC after disabling port power

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

 



Hello Alan,

On Fri, Oct 20, 2017 at 01:58:14PM -0400, Alan Stern wrote:
> On Fri, 20 Oct 2017, Uwe Kleine-König wrote:
> > diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> > index df169c8e7225..08f59654654b 100644
> > --- a/drivers/usb/host/ehci-hub.c
> > +++ b/drivers/usb/host/ehci-hub.c
> > @@ -1031,7 +1031,7 @@ int ehci_hub_control(
> >  				spin_unlock_irqrestore(&ehci->lock, flags);
> >  				ehci_port_power(ehci, wIndex, false);
> >  				spin_lock_irqsave(&ehci->lock, flags);
> > -				temp = ehci_readl(ehci, status_reg);
> > +				temp |= ~PORT_POWER;
> >  			}
> >  		}
> >  
> 
> Well, I don't know.  The USB spec says that if port power is off then a
> lot of other port status bits have to be off also.  But the code tries
> to have it both ways -- some of the status bits are recorded from
> before the port power is turned off and some of them from afterward.
> 
> Maybe my original suggestion wasn't so good, and it would be better
> simply to remove this line entirely.  Then the reported port status
> would just be the values before power was removed, with no 
> inconsistencies.  Can you try doing that instead and see if it works
> equally well?

It also works. However I wonder if it's right that I'm spammed by
over-current messages now (independent of which fix I choose) as long as
there is something connected to the port that draws too much power:

	[   53.406833] usb usb1-port1: over-current condition
	[   53.631749] usb usb1-port1: over-current condition
	[   53.856720] usb usb1-port1: over-current condition
	[   54.081732] usb usb1-port1: over-current condition
	[   54.306727] usb usb1-port1: over-current condition
	[   54.531722] usb usb1-port1: over-current condition
	[   54.756722] usb usb1-port1: over-current condition

It seems to be intended or am I missing something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
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