diff mbox series

[v3] mmc: mmc_spi: Print verbose debug output when crc16 check fails

Message ID 1612233168-35892-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 01962f8d7ced3d8b9748d3b902f7f9b68587c426
Delegated to: Peng Fan
Headers show
Series [v3] mmc: mmc_spi: Print verbose debug output when crc16 check fails | expand

Commit Message

Bin Meng Feb. 2, 2021, 2:32 a.m. UTC
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(-)

Comments

Bin Meng Feb. 6, 2021, 1:16 p.m. UTC | #1
On Tue, Feb 2, 2021 at 10:32 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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(-)
>

Peng, ping?
Peng Fan Feb. 7, 2021, 11:50 a.m. UTC | #2
> Subject: Re: [PATCH v3] mmc: mmc_spi: Print verbose debug output when
> crc16 check fails
> 
> On Tue, Feb 2, 2021 at 10:32 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > 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(-)
> >
> 
> Peng, ping?

Sorry for delay, I'll take it and PR in next week.

Regards,
Peng.
Bin Meng Feb. 16, 2021, 12:22 p.m. UTC | #3
On Sun, Feb 7, 2021 at 7:50 PM Peng Fan <peng.fan@nxp.com> wrote:
>
> > Subject: Re: [PATCH v3] mmc: mmc_spi: Print verbose debug output when
> > crc16 check fails
> >
> > On Tue, Feb 2, 2021 at 10:32 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > 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(-)
> > >
> >
> > Peng, ping?
>
> Sorry for delay, I'll take it and PR in next week.

Ping?
diff mbox series

Patch

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;
 			}