Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964879AbcCNKDd (ORCPT ); Mon, 14 Mar 2016 06:03:33 -0400 Received: from mail-db3on0098.outbound.protection.outlook.com ([157.55.234.98]:1672 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754961AbcCNKDU convert rfc822-to-8bit (ORCPT ); Mon, 14 Mar 2016 06:03:20 -0400 X-Greylist: delayed 8302 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Mar 2016 06:03:19 EDT From: Yangbo Lu To: Arnd Bergmann , "linuxppc-dev@lists.ozlabs.org" CC: "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" , "linux-mmc@vger.kernel.org" , "ulf.hansson@linaro.org" , Zhao Qiang , Russell King , Bhupesh Sharma , Joerg Roedel , Santosh Shilimkar , Scott Wood , Rob Herring , "Claudiu Manoil" , Kumar Gala , Yang-Leo Li , Xiaobo Xie Subject: RE: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Thread-Topic: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0 Thread-Index: AQHRee0YUaXz2V4NZkKHmxv7UGM63p9X+usAgACP31A= Date: Mon, 14 Mar 2016 07:29:26 +0000 Message-ID: References: <1457518131-11339-1-git-send-email-yangbo.lu@nxp.com> <1457518131-11339-6-git-send-email-yangbo.lu@nxp.com> <4947024.WeMycs2fID@wuerfel> In-Reply-To: <4947024.WeMycs2fID@wuerfel> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=nxp.com; x-originating-ip: [123.151.195.52] x-ms-office365-filtering-correlation-id: 1c1e2a14-af88-454f-f557-08d34bda5fb4 x-microsoft-exchange-diagnostics: 1;VI1PR0401MB1934;5:5bIm6iUO/Sd/GZX0bxg/G6/0jnliY8gsoU9TXEuNp3BNNrEu+KbqCsryEKcFBcDD/7DlYfrkPLQb7X6bU6Jg8cKU7oza55Cu16mTfWI8Ac8PXLHbUCtADoKmKbKrg+URhM8Ei/HtYwBDAvsVJpc2vQ==;24:HAKoWdMA5FKj7DMrXLkg0ZCaiC3KFNnebxasCbB2I1s1C2AsCDuBx4u2/6sgy/O3VtZlbdWmBe4eEAO1bzepgG20a5Wj4K/rqU5hdQJ9BQw= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1934; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:VI1PR0401MB1934;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB1934; x-forefront-prvs: 0881A7A935 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(377454003)(74316001)(102836003)(77096005)(15975445007)(2501003)(5001770100001)(586003)(86362001)(3846002)(92566002)(230783001)(6116002)(5008740100001)(2900100001)(5003600100002)(189998001)(66066001)(10400500002)(3660700001)(5002640100001)(2906002)(4326007)(3280700002)(2950100001)(122556002)(76576001)(81166005)(87936001)(33656002)(1096002)(106116001)(19580395003)(5004730100002)(54356999)(50986999)(76176999)(1220700001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB1934;H:HE1PR04MB0889.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2016 07:29:26.7051 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB1934 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2061 Lines: 53 > -----Original Message----- > From: Arnd Bergmann [mailto:arnd@arndb.de] > Sent: Monday, March 14, 2016 6:26 AM > To: linuxppc-dev@lists.ozlabs.org > Cc: Yangbo Lu; 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; linux-mmc@vger.kernel.org; > ulf.hansson@linaro.org; Zhao Qiang; Russell King; Bhupesh Sharma; Joerg > Roedel; Santosh Shilimkar; Scott Wood; Rob Herring; Claudiu Manoil; Kumar > Gala; Yang-Leo Li; Xiaobo Xie > Subject: Re: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240- > R1.0-R2.0 > > On Wednesday 09 March 2016 18:08:51 Yangbo Lu wrote: > > @@ -567,10 +580,20 @@ static void esdhc_init(struct platform_device > *pdev, struct sdhci_host *host) > > struct sdhci_pltfm_host *pltfm_host; > > struct sdhci_esdhc *esdhc; > > u16 host_ver; > > + u32 svr; > > > > pltfm_host = sdhci_priv(host); > > esdhc = sdhci_pltfm_priv(pltfm_host); > > > > + fsl_guts_init(); > > + svr = fsl_guts_get_svr(); > > + if (svr) { > > + esdhc->soc_ver = SVR_SOC_VER(svr); > > + esdhc->soc_rev = SVR_REV(svr); > > + } else { > > + dev_err(&pdev->dev, "Failed to get SVR value!\n"); > > + } > > + > > This makes the driver non-portable. Better identify the specific > workarounds based on the compatible string for this device, or add a > boolean DT property for the quirk. > > Arnd [Lu Yangbo-B47093] Hi Arnd, we did have a discussion about using DTS in v1 before. https://patchwork.kernel.org/patch/6834221/ We don't have a separate DTS file for each revision of an SOC and if we did, we'd constantly have people using the wrong one. In addition, the device tree is stable ABI and errata are often discovered after device tree are deployed. See the link for details. So we decide to read SVR from the device-config/guts MMIO block other than using DTS. Thanks.