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

Add some verbose debug output when crc16 check fails.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

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

diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index 50fcd32674..87d7edffd5 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -181,8 +181,11 @@ 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;
+			crc_ok = be16_to_cpu(crc16_ccitt(0, buf, bsize));
+			if (crc_ok != crc) {
+				debug("%s: data crc error, expect %04x get %04x\n",
+				      __func__, crc_ok, crc);
 				r1 = R1_SPI_COM_CRC;
 				break;
 			}
-- 
2.25.1

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

* [PATCH] mmc: mmc_spi: Print verbose debug output when crc16 check fails
  2021-01-06 12:47 ` [PATCH] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
@ 2021-01-06 23:36   ` Jaehoon Chung
  0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2021-01-06 23:36 UTC (permalink / raw)
  To: u-boot

Hi Bin,

On 1/6/21 9:47 PM, Bin Meng wrote:
> Add some verbose debug output when crc16 check fails.
> 
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
> 
>  drivers/mmc/mmc_spi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
> index 50fcd32674..87d7edffd5 100644
> --- a/drivers/mmc/mmc_spi.c
> +++ b/drivers/mmc/mmc_spi.c
> @@ -181,8 +181,11 @@ 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;
> +			crc_ok = be16_to_cpu(crc16_ccitt(0, buf, bsize));

How about "u16 crc_ok = be16_to_cpu();" ?

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> +			if (crc_ok != crc) {
> +				debug("%s: data crc error, expect %04x get %04x\n",
> +				      __func__, crc_ok, crc);
>  				r1 = R1_SPI_COM_CRC;
>  				break;
>  			}
> 

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

end of thread, other threads:[~2021-01-06 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210106124830epcas1p3027406410ea76aa43e3a895a22742c9f@epcas1p3.samsung.com>
2021-01-06 12:47 ` [PATCH] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
2021-01-06 23:36   ` Jaehoon Chung

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.