[PATCH v2 2/2] mmc: sdhci_am654: Add prints to tuning algorithm

From: Judith Mendez
Date: Wed Aug 21 2024 - 15:24:57 EST


Add debug prints to tuning algorithm for debugging.
Also add error print if we fail tuning.

Signed-off-by: Judith Mendez <jm@xxxxxx>
---
Changes since v1:
- Change prints to dev_dbg
- Add print for failing itaps
---
drivers/mmc/host/sdhci_am654.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
index 612f29fd7dfef..9cac520d5c15c 100644
--- a/drivers/mmc/host/sdhci_am654.c
+++ b/drivers/mmc/host/sdhci_am654.c
@@ -457,11 +457,13 @@ static u32 sdhci_am654_calculate_itap(struct sdhci_host *host, struct window

if (!num_fails) {
/* Retry tuning */
+ dev_dbg(dev, "No failing region found, retry tuning\n");
return -1;
}

if (fail_window->length == ITAPDLY_LENGTH) {
/* Retry tuning */
+ dev_dbg(dev, "No passing itapdly, retry tuning\n");
return -1;
}

@@ -527,6 +529,7 @@ static int sdhci_am654_do_tuning(struct sdhci_host *host,
if (!curr_pass) {
fail_window[fail_index].end = itap;
fail_window[fail_index].length++;
+ dev_dbg(dev, "Failed itapdly=%d\n", itap);
}

if (curr_pass && !prev_pass)
@@ -562,10 +565,12 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host,
}

if (itapdly >= 0) {
+ dev_dbg(dev, "Passed tuning, final itapdly=%d\n", itapdly);
sdhci_am654_write_itapdly(sdhci_am654, itapdly, sdhci_am654->itap_del_ena[timing]);
/* Save ITAPDLY */
sdhci_am654->itap_del_sel[timing] = itapdly;
} else {
+ dev_err(dev, "Failed to find itapdly, fail tuning\n");
ret = -1;
}

--
2.46.0