On Mon, Aug 01, 2016 at 06:07:17PM +0200, Alan Stern wrote:
> On Mon, 1 Aug 2016, Marc Ohlf wrote:
> 
> > In ehci_turn_off_all_ports() all EHCI port register bits
> > (except the PORT_RWC_BITS) are set to zero.
> 
> Even the PORT_WRC_BITS are set to 0.  Oddly enough, the way to set 
> those bits to 0 is to write a 1 to them (see Table 2-16 in the EHCI 
> spec).

Thanks for correction, i will improve that in an v2.

> 
> > On some hardware, this can lead to an system hang,
> > when ehci_port_power() accesses the already cleaned registers.
> > 
> > This patch changes the order of cleanup.
> > First call ehci_port_power() which respects the current bits in
> > port status registers
> > and afterwards cleanup the hard way by setting everything else to zero.
> > 
> > Signed-off-by: Marc Ohlf <o...@mkt-sys.de>
> > ---
> >  drivers/usb/host/ehci-hcd.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> > index a962b89..1e5f529 100644
> > --- a/drivers/usb/host/ehci-hcd.c
> > +++ b/drivers/usb/host/ehci-hcd.c
> > @@ -332,11 +332,11 @@ static void ehci_turn_off_all_ports(struct ehci_hcd 
> > *ehci)
> >     int     port = HCS_N_PORTS(ehci->hcs_params);
> >  
> >     while (port--) {
> > -           ehci_writel(ehci, PORT_RWC_BITS,
> > -                           &ehci->regs->port_status[port]);
> >             spin_unlock_irq(&ehci->lock);
> >             ehci_port_power(ehci, port, false);
> >             spin_lock_irq(&ehci->lock);
> > +           ehci_writel(ehci, PORT_RWC_BITS,
> > +                           &ehci->regs->port_status[port]);
> >     }
> >  }
> 

I'm new to the mailing lists, so I've some questions.

> Acked-by: Alan Stern <st...@rowland.harvard.edu>

I should include your Ack in my v2 patch signoff area, right?

> 
> This should be marked for the -stable kernels as well.

Marking this for -stable kernels means cc it to stable mailing list, right?

> 
> Alan Stern
> 
> 
> 

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

Reply via email to