Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932614AbcCNSTX (ORCPT ); Mon, 14 Mar 2016 14:19:23 -0400 Received: from mail-am1on0080.outbound.protection.outlook.com ([157.56.112.80]:58318 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753010AbcCNSTS convert rfc822-to-8bit (ORCPT ); Mon, 14 Mar 2016 14:19:18 -0400 X-Greylist: delayed 1115 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Mar 2016 14:19:17 EDT From: Scott Wood To: Yangbo Lu , 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 , "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: AQHRee0YIn8/QV1m10iEkCQyCHYnAg== Date: Mon, 14 Mar 2016 17:45:43 +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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [2601:448:8100:702f:12bf:48ff:fe84:c9a0] x-ms-office365-filtering-correlation-id: b73f4f9a-0c9a-4619-a44e-08d34c30779d x-microsoft-exchange-diagnostics: 1;DB5PR04MB0888;5:saqiVvh81fHiXjISE7qPSiGX1ODlSkuAglSTKrdhIRKOqUKhdT/Z2cBc8XJRKECuK68rlxrOgkxzZPB4U7/6SJwhUmhMU7EfAi+1GopeSXdRnUUFwkGTx/DIwUKZtRTZk6JZ4OC22If6P0VQdWNKpw==;24:/Z78NVPoCWHUAPcvUdkkJmDSDtPy9tN5pp/Nr1voPBKOAMakR9dsqLHwfRh5WFuEXeQuFjl0bmviGRcsLAyAhJhQyiPWLPrOGSKNXQnkQhw= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB0888; 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);SRVR:DB5PR04MB0888;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB0888; x-forefront-prvs: 0881A7A935 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(479174004)(377454003)(13464003)(24454002)(93886004)(77096005)(122556002)(5003600100002)(10400500002)(2501003)(33656002)(19580405001)(2900100001)(230783001)(19580395003)(15975445007)(5002640100001)(50986999)(586003)(1096002)(3280700002)(102836003)(1220700001)(3660700001)(2906002)(4326007)(81166005)(92566002)(5008740100001)(189998001)(6116002)(5004730100002)(5001770100001)(86362001)(76576001)(74316001)(54356999)(106116001)(87936001)(76176999)(7059030)(3826002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB0888;H:DB5PR0401MB1928.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2016 17:45:43.6614 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB0888 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2362 Lines: 57 On 03/14/2016 02:29 AM, Yangbo Lu wrote: >> -----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. Also note that this driver is already only for fsl-specific hardware, and it will still work even if fsl_guts doesn't find anything to bind to -- it just wouldn't be able to detect errata based on SVR in that case. -Scott