Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377AbbGaQdz (ORCPT ); Fri, 31 Jul 2015 12:33:55 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:55034 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752128AbbGaQdy (ORCPT ); Fri, 31 Jul 2015 12:33:54 -0400 Date: Fri, 31 Jul 2015 12:33:53 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Nikhil Badola cc: linux-kernel@vger.kernel.org, , , Ramneek Mehresh Subject: Re: [PATCH] drivers: usb: fsl: Workaround for USB erratum-A005275 In-Reply-To: <1438324580-25308-1-git-send-email-nikhil.badola@freescale.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: 2665 Lines: 74 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. > --- 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. Otherwise this looks okay. Alan Stern -- 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/