Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756492AbcJWLTv (ORCPT ); Sun, 23 Oct 2016 07:19:51 -0400 Received: from mail-db5eur01on0059.outbound.protection.outlook.com ([104.47.2.59]:26624 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753743AbcJWLTs (ORCPT ); Sun, 23 Oct 2016 07:19:48 -0400 From: Sriram Dash To: Alan Stern CC: "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "mathias.nyman@intel.com" , "gregkh@linuxfoundation.org" , Suresh Gupta , "felipe.balbi@linux.intel.com" , Rajat Srivastava , Rajesh Bhagat Subject: RE: [PATCH] usb: xhci: Workaround for erratum-A010129 Thread-Topic: [PATCH] usb: xhci: Workaround for erratum-A010129 Thread-Index: AQHSK6UYpUemb/FvGE2V+bFF2XbHDaCzHXoAgAJ6VjA= Date: Sun, 23 Oct 2016 06:47:41 +0000 Message-ID: References: <1477059109-3938-1-git-send-email-sriram.dash@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sriram.dash@nxp.com; x-originating-ip: [116.75.223.217] x-ms-office365-filtering-correlation-id: e697878f-7c95-49d0-85ec-08d3fb107ce2 x-microsoft-exchange-diagnostics: 1;DB5PR04MB1352;7:QtQegNtTM2yLM3BHQzbFad4EXrjaTi6fvcmLxYDFxIw6mnRPAui5PcYWGE71a2hp5Ep7GHGfGH0vQpEw591rKfkdUhwbNOGv6JuUWyaEFfH61L5OlURx0oQdKqnoeD5ouVEDNpIVNrtYvcPFwtLDpEnnp45khUtvRz9ggwooIehX10w7tm/+qLS8DqkKYOCjp4AErKLkNU6fJEBwe546Hzys0m2YtuB1wo/hWs6dKYh6PJNNfb6OwgIscrVd7MVRfiZh2rJCKQlHD7k6Y5rKIN4FZKcfO/z4DayAFtR/E8t+gIf/3LyHbDb7m9PjNsgYvbAzIsPxVQwEvHN4yjlCINWrVl+G+oItWEsAW+18YuM= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1352; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(35762410373642); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026);SRVR:DB5PR04MB1352;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1352; x-forefront-prvs: 0104247462 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(24454002)(8936002)(5002640100001)(189998001)(122556002)(3280700002)(92566002)(110136003)(2950100002)(7696004)(2900100001)(102836003)(6116002)(3846002)(586003)(50986999)(9686002)(76176999)(11100500001)(54356999)(97736004)(3660700001)(6916009)(575784001)(86362001)(68736007)(19580405001)(19580395003)(66066001)(106356001)(105586002)(5660300001)(305945005)(101416001)(106116001)(10400500002)(4326007)(76576001)(7736002)(7846002)(2171001)(87936001)(2906002)(77096005)(8676002)(74316002)(81156014)(81166006)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB1352;H:DB5PR0401MB1925.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2016 06:47:41.9768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1352 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9NBKK6C009891 Content-Length: 2193 Lines: 61 >From: Alan Stern [mailto:stern@rowland.harvard.edu] >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. Hi Alan, Ok. Then I will make it generic for xhci in the next version. >The HCD should never do it, and the USB core should >never tell the HCD to do it. > >Alan Stern