All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] mmc: mmc_spi: Print verbose debug output when crc16 check fails
@ 2021-02-02  2:32 Bin Meng
  2021-02-06 13:16 ` Bin Meng
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Meng @ 2021-02-02  2:32 UTC (permalink / raw)
  To: u-boot

Add some verbose debug output when crc16 check fails.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

---

Changes in v3:
- use expected/got instead of expect/get

Changes in v2:
- do the crc_ok assignment at the the same line where it's defined

 drivers/mmc/mmc_spi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index 46800bb..23b9073 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -181,8 +181,10 @@ static int mmc_spi_readdata(struct udevice *dev,
 			if (ret)
 				return ret;
 #ifdef CONFIG_MMC_SPI_CRC_ON
-			if (be16_to_cpu(crc16_ccitt(0, buf, bsize)) != crc) {
-				debug("%s: data crc error\n", __func__);
+			u16 crc_ok = be16_to_cpu(crc16_ccitt(0, buf, bsize));
+			if (crc_ok != crc) {
+				debug("%s: data crc error, expected %04x got %04x\n",
+				      __func__, crc_ok, crc);
 				r1 = R1_SPI_COM_CRC;
 				break;
 			}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-16 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02  2:32 [PATCH v3] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
2021-02-06 13:16 ` Bin Meng
2021-02-07 11:50   ` Peng Fan
2021-02-16 12:22     ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.