mmc: {tmio,renesas_sdhi}: retune if SCC error detected
Subsystems (2)
v4 cover mmc: {tmio,renesas_sdhi}: retune if SCC error detected
Hi,
These patches triggers a retune if a SCC error is detected. They where ported from the renesas BSP. Masaharu-san did all the real work I just ported them to upstream and did small fixups.
These patches where broken out of my retuning series as more work where needed to adapt them to the recent HS400 series picked-up. It's tested on M3-N using both HS200 and HS400 and on H3 ES2.0 using HS200.
Masaharu Hayakawa (2):
mmc: renesas_sdhi: skip SCC error check when retuning
mmc: tmio: Fix SCC error detection
Niklas Söderlund (1):
mmc: core: add helper to see if a host is doing a retune
drivers/mmc/host/renesas_sdhi_core.c | 13 +++++++++++++ drivers/mmc/host/tmio_mmc_core.c | 4 ++-- include/linux/mmc/host.h | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-)
Signature · 1 line
2.18.0
PATCH v4 1/3 mmc: core: add helper to see if a host is doing a retune
Add a helper to allow host drivers checking if a retune is in progress.
--- include/linux/mmc/host.h | 5 +++++ 1 file changed, 5 insertions(+)
include/linux/mmc/host.h +5 -0
@@ -569,6 +569,11 @@ static inline bool mmc_can_retune(struct mmc_host *host)return host->can_retune ==1 ; } +static inline bool mmc_doing_retune (struct mmc_host *host) +{ +return host->doing_retune ==1 ; +} +static inline enum dma_data_direction mmc_get_dma_dir (struct mmc_data *data) {return data->flags &MMC_DATA_WRITE ?DMA_TO_DEVICE :DMA_FROM_DEVICE ;
Signature · 1 line
2.18.0
Re: [PATCH v4 1/3] mmc: core: add helper to see if a host is doing a retune
Quoted 3 lines · Niklas Söderlund
Add a helper to allow host drivers checking if a retune is in progress.
Signed-off-by Niklas Söderlund <[email protected]>
PATCH v4 2/3 mmc: renesas_sdhi: skip SCC error check when retuning
In reply to Niklas SöderlundFrom: Masaharu Hayakawa <[email protected]>
Checking for SCC error during retuning is unnecessary.
---
* Changes since v3
- Use the newly introduce helper mmc_doing_retune() instead of checking host->mmc->doing_retune in the host driver.
* Changes since v2
- Add comment to describe why checking SCC errors when using 4 taps is not needed.
* Changes since v1
- Use intermediate variable use_4tap to simplify check.
--- drivers/mmc/host/renesas_sdhi_core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/mmc/host/renesas_sdhi_core.c +13 -0
@@ -500,6 +500,19 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)static bool renesas_sdhi_check_scc_error (struct tmio_mmc_host *host) {struct renesas_sdhi *priv =host_to_priv (host); +bool use_4tap = host->pdata->flags &TMIO_MMC_HAVE_4TAP_HS400 ; + +/* +* Skip checking SCC errors when running on 4 taps in HS400 mode as +* any retuning would still result in the same 4 taps being used. +*/ +if (!(host->mmc->ios.timing ==MMC_TIMING_UHS_SDR104 ) && + !(host->mmc->ios.timing ==MMC_TIMING_MMC_HS200 ) && + !(host->mmc->ios.timing ==MMC_TIMING_MMC_HS400 && !use_4tap)) +return false; + +if (mmc_doing_retune (host->mmc)) +return false;/* Check SCC error */ if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) &
Signature · 1 line
2.18.0
Re: [PATCH v4 2/3] mmc: renesas_sdhi: skip SCC error check when retuning
Quoted 7 lines · Niklas Söderlund
From: Masaharu Hayakawa <[email protected]>
Checking for SCC error during retuning is unnecessary.
Signed-off-by Masaharu Hayakawa <[email protected]>[Niklas: fix small style issue]Signed-off-by Niklas Söderlund <[email protected]>
PATCH v4 3/3 mmc: tmio: Fix SCC error detection
In reply to Niklas SöderlundFrom: Masaharu Hayakawa <[email protected]>
SDR104, HS200 and HS400 need to check for SCC error. If SCC error is detected, retuning is necessary.
---
* Changes since v3
- Updated commit message to mention also HS400.
--- drivers/mmc/host/tmio_mmc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/tmio_mmc_core.c +2 -2
@@ -839,8 +839,8 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)if (mrq->cmd->error || (mrq->data && mrq->data->error))tmio_mmc_abort_dma (host); -if (host->check_scc_error) - host->check_scc_error (host); +if (host->check_scc_error && host->check_scc_error (host)) + mrq->cmd->error = -EILSEQ ;/* If SET_BLOCK_COUNT, continue with main command */ if (host->mrq && !mrq->cmd->error) {
Signature · 1 line
2.18.0
Re: [PATCH v4 3/3] mmc: tmio: Fix SCC error detection
Quoted 8 lines · Niklas Söderlund
From: Masaharu Hayakawa <[email protected]>
SDR104, HS200 and HS400 need to check for SCC error. If SCC error is detected, retuning is necessary.
Signed-off-by Masaharu Hayakawa <[email protected]>[Niklas: update commit message]Signed-off-by Niklas Söderlund <[email protected]>
Quoted 17 lines · Niklas Söderlund
Hi,
These patches triggers a retune if a SCC error is detected. They where ported from the renesas BSP. Masaharu-san did all the real work I just ported them to upstream and did small fixups.
These patches where broken out of my retuning series as more work where needed to adapt them to the recent HS400 series picked-up. It's tested on M3-N using both HS200 and HS400 and on H3 ES2.0 using HS200.
Masaharu Hayakawa (2):
mmc:renesas_sdhi: skip SCC error check when retuning
mmc: tmio: Fix SCC error detectionNiklas Söderlund (1):
mmc: core: add helper to see if a host is doing a retune
Quoted 8 lines
drivers/mmc/host/renesas_sdhi_core.c | 13 +++++++++++++ drivers/mmc/host/tmio_mmc_core.c | 4 ++-- include/linux/mmc/host.h | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-)--
2.18.0
Applied for next, thanks!
Kind regards
Uffe