Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753444AbbFRHd4 (ORCPT ); Thu, 18 Jun 2015 03:33:56 -0400 Received: from mail-by2on0124.outbound.protection.outlook.com ([207.46.100.124]:21259 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753310AbbFRHde (ORCPT ); Thu, 18 Jun 2015 03:33:34 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; apm.com; dkim=none (message not signed) header.d=none; Date: Thu, 18 Jun 2015 15:29:41 +0800 From: Dong Aisheng To: Suneel Garapati CC: , , Ulf Hansson , , , "Adrian Hunter" , Haibo Chen , Tim Kryger , Shawn Guo , Yi Sun , "Rafael J. Wysocki" , Subject: Re: [PATCH] drivers: mmc: sdhci: update max frequency only if undefined Message-ID: <20150618072939.GA31104@shlinux1.ap.freescale.net> References: <1434612427-1758-1-git-send-email-suneel.garapati@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1434612427-1758-1-git-send-email-suneel.garapati@xilinx.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD030;1:zojm+ub+1Rn3ZNgasw81FZLQv6tm+SZaSimeLII8ys22Z40ZtkW/r4DItyvJbCLcmvjq806c8krp2Tj0epNEIAp6b0fKyeMDH755NRMcPnlgSOEzq+Ho+tkbbNeyFCKDrrUQttxNIBqZfV8KoNR6qgCpiGPDi3o11hIx8G2ZNvVv2u6V8KjEYsEvkxxqcRgHUCdmD25EkE8/75knF9240eRCA8BTk5Nemzm46roLfgoK4pfSkaDxK0rPymRPGM/hQ4iTqKYTuzg3h7+z+S2aO6Wz88ts03wvwu00vlKl5t7+fvI0eRoysxYYFsvpQWx4EXyTc39/ew5Q0Cpy0+xfZemfA7VDBYvLZZwO3C02S9o= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(51704005)(24454002)(189002)(199003)(6806004)(19580395003)(87936001)(19580405001)(97756001)(50466002)(4001350100001)(46102003)(105606002)(189998001)(92566002)(7110500001)(5001960100002)(110136002)(77156002)(5003600100002)(33656002)(50986999)(54356999)(76176999)(47776003)(15975445007)(2950100001)(2420400003)(77096005)(46406003)(62966003)(106466001)(85426001)(23726002)(104016003)(83506001)(7059030)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1386;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1386;2:VQLq+otKn2q7fDFPN67QLGNSnfseh82fbPRsshHSFqTE7G/zSEBYXRvFRY2EL4sZ;2:4KJe37xng/QgnZTOQYKQpOxXOnWK5blhYeZyhQC+48kFf8pLf9lb2A9upastX/+blf8SOgVq/mlftiLZddSU05/34irPDrqFmc2N9uZWK7WaGVE48TEBCi8PNVQaTCvZjEzsA7DcOeZ5nx0roEZAnaCP8RNPOshCTWL+XNVv4ygYbJH5yCCdAVlY1g6+GEL7lxrGIqtCdXwh52FCL+Inz9NEkR8DullitHp455hHdZU=;6:FZLTf6eqD6xPsjIM9NgCPw3C8DPODRAJpaq8L330fmPK7tbsoQIJyG6uc6+adBBIhKcbl+ZwLREii1y9Vc2/vS5ABZT6YXB/wyK4KKvN3aEsoiE6LLRzsDc5cGOgwqtp6xaf7kZRkvBoLSSEP2epGjhxcTDd1By27fGBNkONfaMvwbriX4MRXdST0doLuIeHZCDViqXJjfhFmUPj/+LcxnSsssGlkq5Y2AJzhOhDcWA13gziq/Rr2vhYZ8ivxEJcmVRRwzJlciWfQRcptyH9MWS9XKwJoMXfCYamcqSD9YkCHdQu/SrghcfMim71eyYYGoLSvmRF3M+2REHpIsKyhg==;3:mLx2rHK/Y513SdXNcPI+HtYEFeRQGKTRU1yo2Vf/SZAqJNqeg1lFL4d6Hz9fNqv2UYSnIuNdpTXzC7CgTcIy6kQKs9Yxete90IUm8r1BDU46mDCiJfWIcUAcmyf/b8vZUlx75x3g2I0GnsJN5o1+F64KDTW4twRxKk/EB6//wSIcbJNrYD+6qey1cNE0jaT/IS/OossYQl7+FWcGIGweNpZ6wRBiGgJXwBUtNMGOEzav/iVdekaq/f/0NuRhflefMCjzqL4GSH91whFOOptI+/jqRUzR93DphPbIRfWPzpH3S0WNVH/BHvWAWyTdDUMD X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1386; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BY1PR03MB1386;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1386; X-Forefront-PRVS: 0611A21987 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR03MB1386;9:slY2/ywGkYZjQSYnZBlrTIXQymiGb3QLrj15SQ45Oz?= =?us-ascii?Q?DFmNJcD+fkHcNv9K9+WIKej1AP30Drcg0Sn5aC1KcX/xJV0dvNHsy/quzASS?= =?us-ascii?Q?pITWtdNzDr+/m6jYFYGw+rpAVjqCytn8IkNpHci+FDCD7KnOdFdGdCo9hCe6?= =?us-ascii?Q?2lSqjAE9ZcVXIWtw6VijwsRyHDmpDZ8YNoXaW5iAMSHrm787zE5smabRKMOc?= =?us-ascii?Q?nWbCMjABnl2r6M1hszX4sgECdNcv567RPQcEi6BuShJGEg8aoNLVuCFPK54K?= =?us-ascii?Q?IE16qLeiDVotyVt4uk0bzFIeD4hFGZcTIE7fuGQpKTD9cTsGxlEanYCSM/vy?= =?us-ascii?Q?8zeWulzOcOS9AYujrhsc6oEMMUL3+sbPvs2hAEAj0kmvHid8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uZshOkQ3qbKjObEXPP5n4ddP7UqHV5V44FEqkUKTDIZ+fCjuoNjlCjOpnH84iz8nEvPhXlm0Mdv6wEFL/XQSl2SD8RcV028=;6:KhBBRcOL+66TUy25LCsQbOBY8GU46rrERhgAdDePYrCLTSnspNNLPB6JUTdQxWIR X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2015 07:33:30.8395 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1386 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1476 Lines: 45 On Thu, Jun 18, 2015 at 12:57:07PM +0530, Suneel Garapati wrote: > f_max parameter of mmc structure is updated unconditionally. > If dt property max-frequency is assigned, this update is > overwriting the dt property value which is undesired. > > Signed-off-by: Suneel Garapati > --- > drivers/mmc/host/sdhci.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index bc14452..c2917d5 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3047,7 +3047,10 @@ int sdhci_add_host(struct sdhci_host *host) > * Set host parameters. > */ > mmc->ops = &sdhci_ops; > - mmc->f_max = host->max_clk; > + > + if(!mmc->f_max) > + mmc->f_max = host->max_clk; > + This is probably not going to work properly. mmc->f_max will be overwritten again if host->clk_mul enabled. And you did not do sanity check if f_max from device tree is valid. Please see: http://www.spinics.net/lists/arm-kernel/msg426167.html I already sent a proper fix. Regards Dong Aisheng > if (host->ops->get_min_clock) > mmc->f_min = host->ops->get_min_clock(host); > else if (host->version >= SDHCI_SPEC_300) { > -- > 2.1.2 -- 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/