Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752988AbbHCF7t (ORCPT ); Mon, 3 Aug 2015 01:59:49 -0400 Received: from mail-bl2on0133.outbound.protection.outlook.com ([65.55.169.133]:6368 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751998AbbHCF7r convert rfc822-to-8bit (ORCPT ); Mon, 3 Aug 2015 01:59:47 -0400 From: Badola Nikhil To: Alan Stern CC: "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "gregkh@linuxfoundation.org" , Ramneek Mehresh Subject: RE: [PATCH] drivers: usb: fsl: Workaround for USB erratum-A005275 Thread-Topic: [PATCH] drivers: usb: fsl: Workaround for USB erratum-A005275 Thread-Index: AQHQy1ehSDVK5Il3qUOQn7Fr+2EBoZ31xrCAgAPuWgA= Date: Mon, 3 Aug 2015 05:59:44 +0000 Message-ID: References: <1438324580-25308-1-git-send-email-nikhil.badola@freescale.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: rowland.harvard.edu; dkim=none (message not signed) header.d=none; x-originating-ip: [192.88.169.1] x-microsoft-exchange-diagnostics: 1;SN1PR0301MB1581;5:rKnNzO/q2wFLXD2qqlLxUrV2bUzwKXBuf21BqX7Mz3zBhpKCV/gkvSjdwcyJHUy268uKdt84hnHOctDLesCz/BcjSJep8Moq9GSKwFsjdXNM1LsUf+yL2vpeOU7kZpZxjDxSkV+nUJtzHS6a9W8n/w==;24:gN53LY+7AFu7H7rA34ioxwMNerOC/RYf1IONSPBIrJ/HamIsgZqhB8w+X6jvjCIn0JrynnK3S7VkXU6VSkIgJwrkqhtmzNgdyk873Wv1N5s=;20:+Kb5SRLY5I7hw5DsHgzWemvfHruV83n0tArspRX+kAugmCygA2L1chkoTxN582KaDsKVukf0qe0PGt5PLxxaYQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1581; sn1pr0301mb1581: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:SN1PR0301MB1581;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1581; x-forefront-prvs: 0657D528EC x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(13464003)(377454003)(110136002)(66066001)(19580405001)(106116001)(2656002)(5003600100002)(122556002)(54356999)(46102003)(92566002)(5001960100002)(102836002)(189998001)(76576001)(2950100001)(76176999)(77156002)(107886002)(2900100001)(86362001)(19580395003)(40100003)(99286002)(74316001)(87936001)(50986999)(77096005)(33656002)(2171001)(62966003)(5002640100001)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1581;H:SN1PR0301MB1629.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2015 05:59:44.5918 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1581 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3466 Lines: 93 > -----Original Message----- > From: Alan Stern [mailto:stern@rowland.harvard.edu] > Sent: Friday, July 31, 2015 10:04 PM > To: Badola Nikhil-B46172 > Cc: linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; > gregkh@linuxfoundation.org; Mehresh Ramneek-B31383 > Subject: Re: [PATCH] drivers: usb: fsl: Workaround for USB erratum-A005275 > > On Fri, 31 Jul 2015, Nikhil Badola wrote: > > > Incoming packets in high speed are randomly corrupted by h/w resulting > > in multiple errors. This workaround makes FS as default mode in all > > affected socs by disabling HS chirp signalling.This errata does not > > affect FS and LS mode. > > > > Forces all HS devices to connect in FS mode for all socs affected by > > this erratum: > > P3041 and P2041 rev 1.0 and 1.1 > > P5020 and P5010 rev 1.0 and 2.0 > > P5040, P1010 and T4240 rev 1.0 > > Ooh, that's a really bad bug. People will be pretty annoyed that they can't > use high speed connections. > > > --- a/drivers/usb/host/ehci-hub.c > > +++ b/drivers/usb/host/ehci-hub.c > > @@ -1222,6 +1222,13 @@ int ehci_hub_control( > > ehci->reset_done [wIndex] = jiffies > > + msecs_to_jiffies (50); > > } > > + > > + /* Force full-speed connect for FSL high-speed > erratum; > > + * disable HS Chirp by setting PFSC bit > > + */ > > + if (ehci_has_fsl_hs_errata(ehci)) > > + temp |= (1 << PORTSC_FSL_PFSC); > > + > > This hunk was added in the wrong place. It should come before the closing '}' > above, not after. That's because you don't want to force a full-speed > connection if the device is already using low speed. I agree that the hunk must be added before '}' i.e. in else block but reason being our controllers have tt . Please correct me if I am wrong. However the code executes "else" block in case of high speed as well as low speed device, and low speed device is working fine in that case (I checked a Dell USB Keyboard). > > > --- a/drivers/usb/host/ehci.h > > +++ b/drivers/usb/host/ehci.h > > @@ -215,6 +215,7 @@ struct ehci_hcd { /* one per > controller */ > > /* SILICON QUIRKS */ > > unsigned no_selective_suspend:1; > > unsigned has_fsl_port_bug:1; /* FreeScale */ > > + unsigned has_fsl_hs_errata:1; /* Freescale HS quirk > */ > > unsigned big_endian_mmio:1; > > unsigned big_endian_desc:1; > > unsigned big_endian_capbase:1; > > @@ -675,6 +676,17 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned > int portsc) > > #define ehci_port_speed(ehci, portsc) > USB_PORT_STAT_HIGH_SPEED > > #endif > > > > +#define PORTSC_FSL_PFSC 24 /* Port Force Full-Speed Connect */ > > + > > +#if defined(CONFIG_PPC_85xx) > > +/* Some Freescale processors have an erratum (USB A-005275) in which > > + * incoming packets get corrupted in HS mode */ > > +#define ehci_has_fsl_hs_errata(e) ((e)->has_fsl_hs_errata) > > +#else > > +#define ehci_has_fsl_hs_errata(e) (0) > > +#endif > > + > > > > /*-------------------------------------------------------------------- > > -----*/ > > I would prefer it if you add your new hunk after this /*-----...---*/ dividing > line (that is, next to the ehci_has_fsl_portno_bug() code) instead of before > the dividing line. Agreed. Will make changes in next version. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/