From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933406AbcETJhZ (ORCPT ); Fri, 20 May 2016 05:37:25 -0400 Received: from mail-db3on0076.outbound.protection.outlook.com ([157.55.234.76]:23520 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932838AbcETJhV (ORCPT ); Fri, 20 May 2016 05:37:21 -0400 From: Yangbo Lu To: Scott Wood , Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" CC: "linuxppc-dev@lists.ozlabs.org" , "Mark Rutland" , "devicetree@vger.kernel.org" , "ulf.hansson@linaro.org" , Russell King , "Bhupesh Sharma" , "netdev@vger.kernel.org" , Joerg Roedel , Kumar Gala , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Yang-Leo Li , "iommu@lists.linux-foundation.org" , "Rob Herring" , "linux-i2c@vger.kernel.org" , Claudiu Manoil , Santosh Shilimkar , Xiaobo Xie , "linux-clk@vger.kernel.org" , Qiang Zhao Subject: RE: [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Thread-Topic: [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Thread-Index: AQHRpn1xst3R2ru500e0TMx/vS9S3Z+qBBcAgAAR9cCAABpygIAI7FMAgA5K9sA= Date: Fri, 20 May 2016 06:05:45 +0000 Message-ID: References: <1462417950-46796-1-git-send-email-yangbo.lu@nxp.com> <4448030.Zs8fVnr3nm@wuerfel> <5159406.HOFrj7pRfW@wuerfel> <1462937186.16584.77.camel@buserror.net> In-Reply-To: <1462937186.16584.77.camel@buserror.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: buserror.net; dkim=none (message not signed) header.d=none;buserror.net; dmarc=none action=none header.from=nxp.com; x-originating-ip: [199.59.226.141] x-ms-office365-filtering-correlation-id: 7ad9598d-f85e-410e-f014-08d38074c8d3 x-microsoft-exchange-diagnostics: 1;AM3PR04MB0774;5:Y5IwI9MkfYbzxmm3A4NxaBZ66cdsLf63hpLn3Ovr7bqlpl509feCtzPs659isov8UVFXN5PNm+XrUTBg5qRq9Oq1v7xGH+PtC0Z7Fi05n2hR3otgxsUsqUP3lb0uM9oucmab5pFl3NOc7+keinBSrA==;24:hgJoUKSOS6xerSx8cB5lxDA2j8oduQ4Dgyd8SVbaxIe39d3Kg2hTqsyPNooU6j4bj+EyVX/fz4uS9VM0qE912ocVqD5cw7ooRATA581M7oA=;7:0VBSsgqVcas7uPvXzBPiV9Ya2RTouAuIUWI2Ys/BYBv6YW2vsPZvRCQzMH0ZvXpmzDeb5mTCa6qFFPaNnFNmvgsBjQ3hRDrP9PlUXk1MiNWSqfIKKRzPyPAhUX+A9GzQEgTcV0+2Fg5KRU9lTDpJirCtHvMGkvk2RtNNjVOtuncRg0W+BZ1IkSKLO5Jerb8P x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM3PR04MB0774; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:AM3PR04MB0774;BCL:0;PCL:0;RULEID:;SRVR:AM3PR04MB0774; x-forefront-prvs: 09480768F8 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(43544003)(24454002)(54014002)(13464003)(377424004)(377454003)(5002640100001)(33656002)(122556002)(5001770100001)(5004730100002)(11100500001)(86362001)(5890100001)(81166006)(77096005)(3660700001)(2950100001)(87936001)(5003600100002)(189998001)(8666003)(2900100001)(92566002)(10400500002)(3280700002)(586003)(2906002)(106116001)(3846002)(102836003)(6116002)(19580405001)(19580395003)(50986999)(54356999)(93886004)(76176999)(76576001)(74316001)(230783001)(9686002)(66066001)(5008740100001)(8936002)(8676002)(1220700001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR04MB0774;H:HE1PR04MB0889.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2016 06:05:46.0453 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB0774 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 base64 to 8bit by mail.home.local id u4K9bYrB007515 Hi Arnd, Any comments? Please reply when you see the email since we want this eSDHC issue to be fixed soon. All the patches are Freescale-specific and is to fix the eSDHC driver. Could we let them merged first if you were talking about a new way of abstracting getting SoC version. Thanks :) Best regards, Yangbo Lu > -----Original Message----- > From: Scott Wood [mailto:oss@buserror.net] > Sent: Wednesday, May 11, 2016 11:26 AM > To: Arnd Bergmann; linux-arm-kernel@lists.infradead.org > Cc: Yangbo Lu; linuxppc-dev@lists.ozlabs.org; Mark Rutland; > devicetree@vger.kernel.org; ulf.hansson@linaro.org; Russell King; Bhupesh > Sharma; netdev@vger.kernel.org; Joerg Roedel; Kumar Gala; linux- > mmc@vger.kernel.org; linux-kernel@vger.kernel.org; Yang-Leo Li; > iommu@lists.linux-foundation.org; Rob Herring; linux-i2c@vger.kernel.org; > Claudiu Manoil; Santosh Shilimkar; Xiaobo Xie; linux-clk@vger.kernel.org; > Qiang Zhao > Subject: Re: [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for T4240- > R1.0-R2.0 > > On Thu, 2016-05-05 at 13:10 +0200, Arnd Bergmann wrote: > > On Thursday 05 May 2016 09:41:32 Yangbo Lu wrote: > > > > -----Original Message----- > > > > From: Arnd Bergmann [mailto:arnd@arndb.de] > > > > Sent: Thursday, May 05, 2016 4:32 PM > > > > To: linuxppc-dev@lists.ozlabs.org > > > > Cc: Yangbo Lu; linux-mmc@vger.kernel.org; > > > > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > > > > linux-kernel@vger.kernel.org; linux-clk@vger.kernel.org; > > > > linux-i2c@vger.kernel.org; iommu@lists.linux- foundation.org; > > > > netdev@vger.kernel.org; Mark Rutland; ulf.hansson@linaro.org; > > > > Russell King; Bhupesh Sharma; Joerg Roedel; Santosh Shilimkar; > > > > Yang-Leo Li; Scott Wood; Rob Herring; Claudiu Manoil; Kumar Gala; > > > > Xiaobo Xie; Qiang Zhao > > > > Subject: Re: [v10, 7/7] mmc: sdhci-of-esdhc: fix host version for > > > > T4240- > > > > R1.0-R2.0 > > > > > > > > On Thursday 05 May 2016 11:12:30 Yangbo Lu wrote: > > > > > IIRC, it is the same IP block as i.MX and Arnd's point is this > > > > > won't even compile on !PPC. It is things like this that prevent > > > > > sharing the driver. > > > > > > The whole point of using the MMIO SVR instead of the PPC SPR is so > > > that it will work on ARM... The guts driver should build on any > > > platform as long as OF is enabled, and if it doesn't find a node to > > > bind to it will return 0 for SVR, and the eSDHC driver will continue > > > (after printing an error that should be removed) without the ability > > > to test for errata based on SVR. > > > > It feels like a bad design to have to come up with a different method > > for each SoC type here when they all do the same thing and want to > > identify some variant of the chip to do device specific quirks. > > > > As far as I'm concerned, every driver in drivers/soc that needs to > > export a symbol to be used by a device driver is an indication that we > > don't have the right set of abstractions yet. There are cases that are > > not worth abstracting because the functionality is rather obscure and > > only a couple of drivers for one particular chip ever need it. > > > > Finding out the version of the SoC does not look like this case. > > I'm open to new ways of abstracting this, but can that please be > discussed after these patches are merged? This patchset is fixing a > problem, the existing abstraction is unappealing and not widely adopted, > a new abstraction is not ready, and we're only touching code for our > hardware. > > Oh, and the existing abstraction isn't even "existing". I don't see any > examples where soc_device is being used like this -- or even any way for > a driver (the one consuming the information, not the soc "driver") to get > a reference to the soc_device that's been registered short of searching > for the device object by name -- and you're asking for new functionality > in drivers/base/soc.c. > > > > > I think the first four patches take care of building for ARM, but > > > > the problem remains if you want to enable COMPILE_TEST as we need > > > > for certain automated checking. > > > > > > What specific problem is there with COMPILE_TEST? > > > > COMPILE_TEST is solvable here and the way it is implemented in this > > case (selecting FSL_GUTS from the driver) indeed looks like it works > > correctly, but it's still awkward that this means building the SoC > > specific ID stuff into the vmlinux binary for any driver that uses > > something like that for a particular SoC. > > Please keep in mind that this is a Freescale-specific driver... it's not > as if we're attaching this dependency to common SDHCI code. > > > > > > > > Dealing with Si revs is a common problem. We should have a > > > > > common solution. There is soc_device for this purpose. > > > > > > > > Exactly. The last time this came up, I think we agreed to > > > > implement a helper using glob_match() on the soc_device strings. > > > > Unfortunately this hasn't happened then, but I'd still prefer that > > > > over yet another vendor-specific way of dealing with the generic > issue. > > > > > > soc_device would require encoding the SVR as a string and then > > > decoding the string, which is more complicated and error prone than > > > having platform-specific code test a platform-specific number. > > > > You already need to encode it as a string to register the soc_device, > > No we don't, because we don't already register a soc_device on arm64 or > ppc (and it looks like whatever does get registered on at least some > relevant > arm32 chips is not particularly useful). > > > and the driver just needs to pass a glob string, so the only part that > > is missing is the generic function that takes the string from the > > driver and passes that to glob_match for the soc_device. > > "just" > > And what would the glob look like? > > I'd rather not write kernel code as if it were a shell/Perl script. > > > > And when would it get registered on arm64, which doesn't have > > > platform code? > > > > Whenever the soc driver is loaded, as is the case now. The match > > function can return -EPROBE_DEFER if no SoC device is registered yet. > > That's too late for some places where we need access to SVR, e.g. clock > drivers (which use CLK_OF_DECLARE and are initialized very early, not as > part of the driver model and thus can't defer). Currently we have an > #ifdef CONFIG_PPC for this in drivers/clk/clk-qoriq.c... Maybe we should > have done that here as well, and saved some grief. :-) At least until an > erratum pops up on an ARM-based chip. > > And what happens if we're running on arm32, and thus the arch code > already registered an soc_device with a different (and less useful) > encoding? > > -Scott