Linux-mmc Archive mirror
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Claudiu <claudiu.beznea@tuxon.dev>,
	<wsa+renesas@sang-engineering.com>, <ulf.hansson@linaro.org>
Cc: <linux-mmc@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
	Hien Huynh <hien.huynh.px@renesas.com>
Subject: Re: [PATCH] mmc: renesas_sdhi: Set the SDBUF after reset
Date: Wed, 13 Mar 2024 15:23:54 +0300	[thread overview]
Message-ID: <53b9d9f7-921d-3a0a-5a1c-e18e6fd1dcf6@omp.ru> (raw)
In-Reply-To: <20240313093031.3507979-1-claudiu.beznea.uj@bp.renesas.com>

On 3/13/24 12:30 PM, Claudiu wrote:

> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> For development purpose, renesas_sdhi_probe() could be called w/
> dma_ops = NULL to force the usage of PIO mode. In this case the
> renesas_sdhi_enable_dma() will not be called before transferring data.
> 
> If renesas_sdhi_enable_dma() is not called, renesas_sdhi_clk_enable()
> call from renesas_sdhi_probe() will configure SDBUF by calling the
> renesas_sdhi_sdbuf_width() function, but then SDBUF will be reseted in

   s/reseted/reset/.

> tmio_mmc_host_probe() when calling tmio_mmc_reset() though host->reset().
> If SDBUF is zero the data transfer will not work in PIO mode for RZ/G3S.
> 
> To fix this call again the renesas_sdhi_sdbuf_width(host, 16); in

   Semicolon clearly doesn't fit here...

> renesas_sdhi_reset(). The call of renesas_sdhi_sdbuf_width() was not
> removed from renesas_sdhi_clk_enable() as the host->reset() is optional.
> 
> Co-developed-by: Hien Huynh <hien.huynh.px@renesas.com>
> Signed-off-by: Hien Huynh <hien.huynh.px@renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
[...]

> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index c675dec587ef..b51e04fa5445 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -589,6 +589,12 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host, bool preserve)
>  			sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
>  			priv->needs_adjust_hs400 = false;
>  			renesas_sdhi_set_clock(host, host->clk_cache);
> +
> +			/*
> +			 * In case the controller works in PIO mode the SDBUF needs to be set as its

   Well, it won't hurt wrapping the comment at 80 columns here...

> +			 * reset value is zero.
> +			 */
> +			renesas_sdhi_sdbuf_width(host, 16);
>  		} else if (priv->scc_ctl) {
>  			renesas_sdhi_scc_reset(host, priv);
>  		}

MBR, Sergey

      reply	other threads:[~2024-03-13 12:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13  9:30 [PATCH] mmc: renesas_sdhi: Set the SDBUF after reset Claudiu
2024-03-13 12:23 ` Sergey Shtylyov [this message]

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=53b9d9f7-921d-3a0a-5a1c-e18e6fd1dcf6@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=hien.huynh.px@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).