Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753877AbbFRH7H (ORCPT ); Thu, 18 Jun 2015 03:59:07 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:36377 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753368AbbFRH66 (ORCPT ); Thu, 18 Jun 2015 03:58:58 -0400 MIME-Version: 1.0 In-Reply-To: <20150618072939.GA31104@shlinux1.ap.freescale.net> References: <1434612427-1758-1-git-send-email-suneel.garapati@xilinx.com> <20150618072939.GA31104@shlinux1.ap.freescale.net> From: Suneel G Date: Thu, 18 Jun 2015 13:28:17 +0530 Message-ID: Subject: Re: [PATCH] drivers: mmc: sdhci: update max frequency only if undefined To: Dong Aisheng Cc: Suneel Garapati , linux-mmc@vger.kernel.org, "linux-kernel@vger.kernel.org" , Ulf Hansson , michals@xilinx.com, sorenb@xilinx.com, Adrian Hunter , Haibo Chen , Tim Kryger , Shawn Guo , Yi Sun , "Rafael J. Wysocki" , Suman Tripathi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2005 Lines: 60 Hi, On Thu, Jun 18, 2015 at 12:59 PM, Dong Aisheng wrote: > 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. Ok, I missed your series. My platform doesn't have clk_mul enabled hence couldn't check on that. Agree on the sanity check. Regards, Suneel > > 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-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- 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/