]> git.dujemihanovic.xyz Git - u-boot.git/commit
mmc: renesas-sdhi: Do not access SCC during tuning in send_cmd callback
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 24 Feb 2024 22:32:11 +0000 (23:32 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 15 Apr 2024 06:19:12 +0000 (15:19 +0900)
commitb78630630a9e419a50de986a3d268b428f5d0c28
tree2dbe17ad92b557b814fcaf0a32de60a71ecf15da
parent8c2208978877bf6533d97bde97ee763322d6308f
mmc: renesas-sdhi: Do not access SCC during tuning in send_cmd callback

Do not access SCC when sending commands during tuning operation as that
will disrupt the tuning operation. The tuning operation is adjusting the
SCC settings itself in execute_tuning callback.

When renesas_sdhi_execute_tuning() is called by the MMC core code, a loop
which consists of renesas_sdhi_prepare_tuning(), mmc_send_tuning() and
renesas_sdhi_compare_scc_data() iterates over each SCC tuning tap.

The renesas_sdhi_prepare_tuning() configures the SCC tuning tap number into
hardware, mmc_send_tuning() triggers transfer of tuning block which depends
on the bus mode for which the bus is currently being tuned, this information
is supplied by the MMC core code, and finally renesas_sdhi_compare_scc_data()
tests the received tuning block for validity.

Because renesas_sdhi_prepare_tuning() configures the SCC tuning tap into
the hardware to fit the tuning operation, mmc_send_tuning() which triggers
command transfer using renesas_sdhi_send_cmd() must not manipulate with
the SCC in any way. Currently renesas_sdhi_send_cmd() does unconditionally
call renesas_sdhi_check_scc_error(), which may adjust the SCC tuning tap
position by writing RENESAS_SDHI_SCC_TAPSET, which would overwrite the
required tuning configuration set by renesas_sdhi_prepare_tuning() and
disrupt the tuning operation.

Fix this by skipping the renesas_sdhi_check_scc_error() call in case the
MMC subsystem is in tuning state. This way, the SCC settings are left
unmodified by command transfer during tuning operation.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Tested-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/renesas-sdhi.c