public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails
@ 2021-01-17 12:27 Bin Meng
  2021-01-28 15:14 ` Bin Meng
  2021-02-01  4:57 ` Sean Anderson
  0 siblings, 2 replies; 4+ messages in thread
From: Bin Meng @ 2021-01-17 12:27 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 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 46800bbed2..b1edb6ad7c 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, expect %04x get %04x\n",
+				      __func__, crc_ok, crc);
 				r1 = R1_SPI_COM_CRC;
 				break;
 			}
-- 
2.25.1

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

* [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails
  2021-01-17 12:27 [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
@ 2021-01-28 15:14 ` Bin Meng
  2021-02-01  3:20   ` Bin Meng
  2021-02-01  4:57 ` Sean Anderson
  1 sibling, 1 reply; 4+ messages in thread
From: Bin Meng @ 2021-01-28 15:14 UTC (permalink / raw)
  To: u-boot

On Sun, Jan 17, 2021 at 8:27 PM 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 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(-)
>

Ping?

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

* [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails
  2021-01-28 15:14 ` Bin Meng
@ 2021-02-01  3:20   ` Bin Meng
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2021-02-01  3:20 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 28, 2021 at 11:14 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Sun, Jan 17, 2021 at 8:27 PM 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 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(-)
> >
>
> Ping?

Peng, will you take this, or if this should go via another tree?

Regards,
Bin

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

* [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails
  2021-01-17 12:27 [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
  2021-01-28 15:14 ` Bin Meng
@ 2021-02-01  4:57 ` Sean Anderson
  1 sibling, 0 replies; 4+ messages in thread
From: Sean Anderson @ 2021-02-01  4:57 UTC (permalink / raw)
  To: u-boot

On 1/17/21 7:27 AM, Bin Meng 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 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 46800bbed2..b1edb6ad7c 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, expect %04x get %04x\n",

Nit: Perhaps use expected/got?

Otherwise looks good to me; I ended up creating a similar patch
previously, but never got around to upstreaming it.

--Sean

> +				      __func__, crc_ok, crc);
>   				r1 = R1_SPI_COM_CRC;
>   				break;
>   			}
> 

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

end of thread, other threads:[~2021-02-01  4:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-17 12:27 [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails Bin Meng
2021-01-28 15:14 ` Bin Meng
2021-02-01  3:20   ` Bin Meng
2021-02-01  4:57 ` Sean Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox