mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dong Aisheng <b29396@freescale.com>
To: Suneel Garapati <suneel.garapati@xilinx.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>, <michals@xilinx.com>,
	<sorenb@xilinx.com>, "Adrian Hunter" <adrian.hunter@intel.com>,
	Haibo Chen <haibo.chen@freescale.com>,
	Tim Kryger <tim.kryger@gmail.com>,
	Shawn Guo <shawn.guo@linaro.org>, Yi Sun <yi.y.sun@intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	<stripathi@apm.com>
Subject: Re: [PATCH] drivers: mmc: sdhci: update max frequency only if undefined
Date: Thu, 18 Jun 2015 15:29:41 +0800	[thread overview]
Message-ID: <20150618072939.GA31104@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <1434612427-1758-1-git-send-email-suneel.garapati@xilinx.com>

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 <suneel.garapati@xilinx.com>
> ---
>  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

  reply	other threads:[~2015-06-18  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18  7:27 Suneel Garapati
2015-06-18  7:29 ` Dong Aisheng [this message]
2015-06-18  7:58   ` Suneel G

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150618072939.GA31104@shlinux1.ap.freescale.net \
    --to=b29396@freescale.com \
    --cc=adrian.hunter@intel.com \
    --cc=haibo.chen@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=shawn.guo@linaro.org \
    --cc=sorenb@xilinx.com \
    --cc=stripathi@apm.com \
    --cc=suneel.garapati@xilinx.com \
    --cc=tim.kryger@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=yi.y.sun@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®