linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: ulf.hansson@linaro.org, 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 v2] mmc: renesas_sdhi: Set the SDBUF after reset
Date: Tue, 30 Apr 2024 11:10:33 +0200	[thread overview]
Message-ID: <h2fhduxr5bv3m7vkxl2ga6pqkkv5mlzpwgk2q6lfsnz3l63ckk@pyzj2vt4jkfw> (raw)
In-Reply-To: <20240410135416.2139173-1-claudiu.beznea.uj@bp.renesas.com>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

Hi Claudiu,

On Wed, Apr 10, 2024 at 04:54:16PM +0300, Claudiu Beznea wrote:
> 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 reset in
> 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
> renesas_sdhi_reset(). The call of renesas_sdhi_sdbuf_width() was not
> removed from renesas_sdhi_clk_enable() as the host->reset() is optional.

So, I tried to find a place where we would need only one call to
renesas_sdhi_sdbuf_width() but I also couldn't find a sweet spot. So,
this approach seems also best to me.

> +
> +			/*
> +			 * In case the controller works in PIO mode the SDBUF
> +			 * needs to be set as its reset value is zero.
> +			 */

But I think we can shorten the above comment to something like:

			/* Ensure default value for this driver */
> +			renesas_sdhi_sdbuf_width(host, 16);

D'accord?

Happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2024-04-30  9:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 13:54 [PATCH v2] mmc: renesas_sdhi: Set the SDBUF after reset Claudiu Beznea
2024-04-26  5:08 ` Ulf Hansson
2024-04-26  6:19   ` Wolfram Sang
2024-04-30  9:10 ` Wolfram Sang [this message]
2024-04-30  9:27   ` claudiu beznea

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=h2fhduxr5bv3m7vkxl2ga6pqkkv5mlzpwgk2q6lfsnz3l63ckk@pyzj2vt4jkfw \
    --to=wsa+renesas@sang-engineering.com \
    --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 \
    /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 NNTP newsgroup(s).