mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Yann Sionneau <ysionneau@kalrayinc.com>, barebox@lists.infradead.org
Cc: Jonathan Borne <jborne@kalrayinc.com>,
	Julian Vetter <jvetter@kalrayinc.com>,
	Jules Maselbas <jmaselbas@zdiv.net>
Subject: Re: [PATCH 2/4] mci: dwcmshc-sdhci: Fix f_max computation
Date: Thu, 29 Feb 2024 17:19:49 +0100	[thread overview]
Message-ID: <c3ac5463-5582-4928-a87b-d9f0156e9133@pengutronix.de> (raw)
In-Reply-To: <20240229155700.17443-2-ysionneau@kalrayinc.com>

On 29.02.24 16:56, Yann Sionneau wrote:
> f_max was possibly set from max-frequency DT property
> by mci_of_parse() and then overwritten few lines later
> with the clock frequency, making it impossible to
> reduce the clock frequency from DT.
> 
> Move the call to mci_of_parse() after the first assignment
> to f_max.
> 
> Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> 
> ---
>  drivers/mci/dwcmshc-sdhci.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mci/dwcmshc-sdhci.c b/drivers/mci/dwcmshc-sdhci.c
> index 7cc6fe3f18..d9c51752db 100644
> --- a/drivers/mci/dwcmshc-sdhci.c
> +++ b/drivers/mci/dwcmshc-sdhci.c
> @@ -316,12 +316,17 @@ static int dwcmshc_probe(struct device *dev)
>  	mci->send_cmd = dwcmshc_mci_send_cmd;
>  	mci->card_present = dwcmshc_mci_card_present;
>  
> -	mci_of_parse(&host->mci);
> -
>  	sdhci_setup_host(&host->sdhci);
>  
>  	mci->max_req_size = 0x8000;
> +	/*
> +	 * Let's first initialize f_max to the DT clock freq
> +	 * Then mci_of_parse can override if with the content
> +	 * of the 'max-frequency' DT property if it is present.
> +	 * Then we can finish by computing the f_min.
> +	 */
>  	mci->f_max = clk_get_rate(clk);
> +	mci_of_parse(&host->mci);
>  	mci->f_min = mci->f_max / SDHCI_MAX_DIV_SPEC_300;
>  
>  	dev->priv = host;

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-02-29 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 15:56 [PATCH 1/4] mci: dwcmshc-sdhci: Remove superfluous call to sdhci_enable_v4_mode Yann Sionneau
2024-02-29 15:56 ` [PATCH 2/4] mci: dwcmshc-sdhci: Fix f_max computation Yann Sionneau
2024-02-29 16:19   ` Ahmad Fatoum [this message]
2024-02-29 15:56 ` [PATCH 3/4] mci: sdhci: add register define for P_VENDOR_SPECIFIC_AREA Yann Sionneau
2024-02-29 15:57 ` [PATCH 4/4] mci: dwcmshc-sdhci: add support for Kalray Coolidge v2 SoC eMMC controller Yann Sionneau
2024-02-29 16:19   ` Ahmad Fatoum
2024-02-29 16:31     ` Yann Sionneau
2024-03-01  7:49       ` Ahmad Fatoum
2024-03-04  9:18 ` (subset) [PATCH 1/4] mci: dwcmshc-sdhci: Remove superfluous call to sdhci_enable_v4_mode Sascha Hauer

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=c3ac5463-5582-4928-a87b-d9f0156e9133@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jborne@kalrayinc.com \
    --cc=jmaselbas@zdiv.net \
    --cc=jvetter@kalrayinc.com \
    --cc=ysionneau@kalrayinc.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