Re: [PATCH v2] mmc: renesas_sdhi: Set the SDBUF after reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux