Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751063AbbG2LTK (ORCPT ); Wed, 29 Jul 2015 07:19:10 -0400 Received: from mail-bn1on0140.outbound.protection.outlook.com ([157.56.110.140]:25600 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750754AbbG2LTH convert rfc822-to-8bit (ORCPT ); Wed, 29 Jul 2015 07:19:07 -0400 From: Badola Nikhil To: "balbi@ti.com" CC: "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-omap@vger.kernel.org" , "gregkh@linuxfoundation.org" Subject: RE: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk Thread-Topic: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk Thread-Index: AQHQxSxnwOapUjjorke8aw7qVn5sN53pJOUAgAADsQCABaINMIAApy2AgADS68A= Date: Wed, 29 Jul 2015 11:19:01 +0000 Message-ID: References: <1437646295-1858-1-git-send-email-nikhil.badola@freescale.com> <20150723145532.GC21984@saruman.tx.rr.com> <20150723150844.GD21984@saruman.tx.rr.com> <20150727150823.GB10703@saruman.tx.rr.com> In-Reply-To: <20150727150823.GB10703@saruman.tx.rr.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: ti.com; dkim=none (message not signed) header.d=none; x-originating-ip: [192.88.169.1] x-microsoft-exchange-diagnostics: 1;SN1PR0301MB1630;5:EF/hQNwvXBIbXKkVczrOD3bgCXdhHd3wPF2W5Llpq9InsDfIm3lI7uSBQppxM1SnUV34/ExIXv/OnpYXo8KiKTgVhRo5Y10xWfRMnGdxxYqoRcwLg4wwRP2ZNridJY6hD8qAhXEcgaClfpa/0YKEzA==;24:mfgRp5ZssuDqjsTzf2YaUMODQ7hISnQFPARbKBLdPuse20BFmJ0ZqpbgP1AN8ti19NpBhQJnEtI+rxh8GWFk/lXX1QczgJ15wPMPqqlvvtM=;20:2flhVVmww9503oNNaVf0uDw+1KmcJUAt6lHzHTUnKxtVmePfjUzsNazwpXBjJIHkCW4DHK1zVzzcQp2JOkf29g== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1630; sn1pr0301mb1630: 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:SN1PR0301MB1630;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1630; x-forefront-prvs: 0652EA5565 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(6009001)(24454002)(13464003)(377454003)(43544003)(54356999)(33656002)(189998001)(50986999)(66066001)(19580405001)(2656002)(19580395003)(87936001)(110136002)(122556002)(77156002)(62966003)(2351001)(76176999)(74316001)(106116001)(46102003)(99286002)(77096005)(86362001)(575784001)(40100003)(2501003)(92566002)(5001960100002)(2950100001)(102836002)(2900100001)(5002640100001)(76576001)(5003600100002)(93886004)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1630;H:SN1PR0301MB1629.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;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: 29 Jul 2015 11:19:01.7646 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1630 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5487 Lines: 144 > -----Original Message----- > From: Felipe Balbi [mailto:balbi@ti.com] > Sent: Monday, July 27, 2015 8:38 PM > To: Badola Nikhil-B46172 > Cc: balbi@ti.com; linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; > linux-omap@vger.kernel.org; gregkh@linuxfoundation.org > Subject: Re: [PATCH 2/3] drivers: usb: dwc3: Add adjust_frame_length_quirk > > On Mon, Jul 27, 2015 at 06:56:48AM +0000, Badola Nikhil wrote: > > > -----Original Message----- > > > From: Felipe Balbi [mailto:balbi@ti.com] > > > Sent: Thursday, July 23, 2015 8:39 PM > > > To: Felipe Balbi > > > Cc: Badola Nikhil-B46172; linux-kernel@vger.kernel.org; linux- > > > usb@vger.kernel.org; linux-omap@vger.kernel.org; > > > gregkh@linuxfoundation.org > > > Subject: Re: [PATCH 2/3] drivers: usb: dwc3: Add > > > adjust_frame_length_quirk > > > > > > Hi again, > > > > > > On Thu, Jul 23, 2015 at 09:55:32AM -0500, Felipe Balbi wrote: > > > > > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h > > > > > index > > > > > 0447788..b7a5119 100644 > > > > > --- a/drivers/usb/dwc3/core.h > > > > > +++ b/drivers/usb/dwc3/core.h > > > > > @@ -124,6 +124,7 @@ > > > > > #define DWC3_GEVNTCOUNT(n) (0xc40c + (n * 0x10)) > > > > > > > > > > #define DWC3_GHWPARAMS8 0xc600 > > > > > +#define DWC3_GFLADJ 0xc630 > > > > > > > > > > /* Device Registers */ > > > > > #define DWC3_DCFG 0xc700 > > > > > @@ -234,6 +235,10 @@ > > > > > /* Global HWPARAMS6 Register */ > > > > > #define DWC3_GHWPARAMS6_EN_FPGA (1 << > 7) > > > > > > > > > > +/* Global Frame Length Adjustment Register */ > > > > > +#define GFLADJ_30MHZ_REG_SEL (1 << 7) > > > > > > > > always prepend with DWC3_ like *all* other macros in this file. > > > > > > > > Also, match docs to ease grepping. This should be called > > > > DWC3_GFLADJ_30MHZ_SDBND_SEL > > > > GFLADJ_30MHZ_REG_SEL is the field's name in LS1021A Reference Manual > > as well as dwc3 databook. Though DWC3_GFLADJ_30MHZ_SDBND_SEL > seems > > more relevant. > > databook calls it GFLADJ_30MHZ_SDBND_SEL, I checked before sending my > email. > > > > yet another problem is that this register doesn't exist in *all* > > > versions of DWC3. It was introduced in version 2.50a so the branch I > > > typed above needs one extra check, and since it's getting so large, > > > it deserves be factored out into its own function. > > > > > > static int dwc3_frame_length_adjustment(struct dwc3 *dwc, u32 fladj) { > > > u32 reg; > > > u32 dft; > > > > > > if (dwc->revision <= DWC3_REVISION_250A) > > > return 0; > > > > > > if (fladj == 0) > > > return 0; > > > > > > reg = dwc3_readl(dwc->regs, DWC3_GFLADJ); > > > dft = reg & 0x3f; /* needs a mask macro */ > > > > > > if (!dev_WARN_ONCE(dwc->dev, dft == fladj, > > > "requested value same as default, ignoring\n")) { > > > reg &= ~0x3f; /* needs a mask macro */ > > > reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL | > > > DWC3_GFLADJ_30MHZ(fladj_value); > > > > > > dwc3_writel(dwc->regs, DWC3_GFLADJ, reg); > > > } > > > } > > > > > > you really *MUST* check this sort of this out when writing patches. > > > It's not only about *your* SoC. You gotta remember we have a ton of > > > different users and those a prone to major grumpyness should a > > > completely unrelated patch break their use case. > > > > > > You have access to the IP's documentation, and that contains the > > > entire history of the IP itself, so it's easy to figure all of this > > > out with a simple search in the documentation. > > > > > > One extra detail is that you were very careless when writing to the > > > GFLADJ register too. You simply wrote your 30MHz sideband value, > > > potentially clearing other bits which shouldn't be touched. That > > > alone can add regressions. > > > > > > When resending, make sure all 3 patches reach linux-usb. I still > > > can't find patch 3/3. > > > > > > > Will take care of above scenarios and resend patches cc'ing linux-usb > > in each of them. > > > > Regarding acceptance of the patch only when it's used in glue layer, > > there is no freescale's glue layer present for dwc3 as of now. > > if there is no glue layer, how are you testing your patch ? We directly call dwc3_probe() . Please see usb node in file arch/arm/boot/dts/ls1021a.dtsi For your reference : usb3@3100000 { compatible = "snps,dwc3"; reg = <0x0 0x3100000 0x0 0x10000>; interrupts = ; dr_mode = "host"; }; > > > Furthermore, there is not any platform specific code required in glue > > layer apart from the ones present in dwc3/core.c. > > sorry ? core.c is generic for all users, the glue layer should somewhat hide > platform details such as clocks and PM. It's surprising if you don't need > anything on that side. We do not support power management for now. Also we are not sure If we need clocks and will look into it when we start working on power management. I would request you to accept this patch set (after modifications which you suggested) so that usb functionality doesn't break. I will send an incremental patch to use this frame length adjust patch via glue layer as soon as we introduce one. -- 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/