mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Eugen Hristev <eugen.hristev@microchip.com>, ulf.hansson@linaro.org
Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Karl Olsen <karl@micro-technic.com>
Subject: Re: [PATCH] mmc: sdhci-of-at91: fix set_uhs_signaling rewriting of MC1R
Date: Sat, 2 Jul 2022 19:51:25 +0300	[thread overview]
Message-ID: <e560121e-6f3b-9188-7ccb-97357881e390@intel.com> (raw)
In-Reply-To: <20220630090926.15061-1-eugen.hristev@microchip.com>

On 30/06/22 12:09, Eugen Hristev wrote:
> In set_uhs_signaling, the DDR bit is being set by fully writing the MC1R
> register.
> This can lead to accidental erase of certain bits in this register.
> Avoid this by doing a read-modify-write operation.
> 
> Fixes: d0918764c17b ("mmc: sdhci-of-at91: fix MMC_DDR_52 timing selection")
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
> Tested-by: Karl Olsen <karl@micro-technic.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-of-at91.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
> index 10fb4cb2c731..cd0134580a90 100644
> --- a/drivers/mmc/host/sdhci-of-at91.c
> +++ b/drivers/mmc/host/sdhci-of-at91.c
> @@ -100,8 +100,13 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock)
>  static void sdhci_at91_set_uhs_signaling(struct sdhci_host *host,
>  					 unsigned int timing)
>  {
> -	if (timing == MMC_TIMING_MMC_DDR52)
> -		sdhci_writeb(host, SDMMC_MC1R_DDR, SDMMC_MC1R);
> +	u8 mc1r;
> +
> +	if (timing == MMC_TIMING_MMC_DDR52) {
> +		mc1r = sdhci_readb(host, SDMMC_MC1R);
> +		mc1r |= SDMMC_MC1R_DDR;
> +		sdhci_writeb(host, mc1r, SDMMC_MC1R);
> +	}
>  	sdhci_set_uhs_signaling(host, timing);
>  }
>  


  reply	other threads:[~2022-07-02 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30  9:09 Eugen Hristev
2022-07-02 16:51 ` Adrian Hunter [this message]
2022-07-12 11:09 ` Ulf Hansson

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=e560121e-6f3b-9188-7ccb-97357881e390@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=eugen.hristev@microchip.com \
    --cc=karl@micro-technic.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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®