From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2] mmc: mmc_spi: Print verbose debug output when crc16 check fails
Date: Sun, 31 Jan 2021 23:57:38 -0500 [thread overview]
Message-ID: <44c1aacd-3405-b59e-eaaf-a67194e94dd6@gmail.com> (raw)
In-Reply-To: <20210117122724.5321-1-bmeng.cn@gmail.com>
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;
> }
>
prev parent reply other threads:[~2021-02-01 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44c1aacd-3405-b59e-eaaf-a67194e94dd6@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox