]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: mmc_spi: Print verbose debug output when crc16 check fails
authorBin Meng <bmeng.cn@gmail.com>
Tue, 2 Feb 2021 02:32:48 +0000 (10:32 +0800)
committerPeng Fan <peng.fan@nxp.com>
Fri, 19 Feb 2021 07:06:53 +0000 (15:06 +0800)
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>
drivers/mmc/mmc_spi.c

index 46800bbed287fbf2716dd505eea4b8b09ef43fd4..23b907328c18e16004ead807f12c42420edfd714 100644 (file)
@@ -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;
                        }