Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933191AbcJUQo3 (ORCPT ); Fri, 21 Oct 2016 12:44:29 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:35484 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754148AbcJUQo1 (ORCPT ); Fri, 21 Oct 2016 12:44:27 -0400 Date: Fri, 21 Oct 2016 12:44:26 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Sriram Dash cc: linux-kernel@vger.kernel.org, , , , , , Rajat Srivastava , Rajesh Bhagat Subject: Re: [PATCH] usb: xhci: Workaround for erratum-A010129 In-Reply-To: <1477059109-3938-1-git-send-email-sriram.dash@nxp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2014 Lines: 51 On Fri, 21 Oct 2016, Sriram Dash wrote: > For the USB3.0 controller, USB 2.0 reset not driven while > port is in Resume state. So, do not program the USB 2.0 reset > (PORTSC[PR]=1) while in Resume state. > > Signed-off-by: Rajat Srivastava > Signed-off-by: Sriram Dash > Signed-off-by: Rajesh Bhagat > --- > drivers/usb/host/xhci-hub.c | 28 +++++++++++++++++++++++++++- > drivers/usb/host/xhci.h | 1 + > 2 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c > index 730b9fd..3def0dd 100644 > --- a/drivers/usb/host/xhci-hub.c > +++ b/drivers/usb/host/xhci-hub.c > @@ -878,7 +878,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, > struct xhci_hcd *xhci = hcd_to_xhci(hcd); > int max_ports; > unsigned long flags; > - u32 temp, status; > + u32 temp, status, tmp_status = 0; > int retval = 0; > __le32 __iomem **port_array; > int slot_id; > @@ -1098,6 +1098,32 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, > spin_lock_irqsave(&xhci->lock, flags); > break; > case USB_PORT_FEAT_RESET: > + /* > + * Erratum : A010129 > + * Synopsys STAR 9000962562. > + * USB 2.0 Reset Not Driven While Port in Resume > + * While in USB 2.0 resume state (the PORTSC.PLS > + * register bit is set to 4'd15), if the xHCI driver > + * programs the PORTSC.PR register bit to 1, the > + * controller does not drive a USB 2.0 reset > + * and it does not generate a PORTSC.PRC=1 interrupt. > + * So, The xHCI driver should not program a USB > + * 2.0 reset (PORTSC.PR=1) while in resume > + * (PORTSC.PLS=4'd15). > + */ > + if (xhci->quirks & XHCI_PORT_RST_ON_RESUME) { It's always a bad idea to drive a reset signal while a port is resuming. We don't need a quirk flag for this. The HCD should never do it, and the USB core should never tell the HCD to do it. Alan Stern