public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Sinan Akman <sinan@writeme.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors
Date: Wed, 11 May 2022 20:28:28 +0200	[thread overview]
Message-ID: <20220511182828.26890-1-pali@kernel.org> (raw)

Commit 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy
support") changed number of sectors which are read but did not adjusted
error check.

Fix it and check for if correct number of sectors were read.

Fixes: 0980cbba7b3c ("mmc: fsl_esdhc_spl: pre-PBL: implement redundancy support")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/mmc/fsl_esdhc_spl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index ea8f4cd66964..760f13d24018 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -106,7 +106,7 @@ again:
 	blk_off = (sector * 512) % mmc->read_bl_len;
 	blk_cnt = DIV_ROUND_UP(512,  mmc->read_bl_len);
 	err = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt, tmp_buf);
-	if (err != 1) {
+	if (err != blk_cnt) {
 		puts("spl: mmc read failed!!\n");
 		hang();
 	}
-- 
2.20.1


             reply	other threads:[~2022-05-11 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220511182904epcas1p46476ec8dff08a0b9f5acc9ac46989c7c@epcas1p4.samsung.com>
2022-05-11 18:28 ` Pali Rohár [this message]
2022-05-16 23:41   ` [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors Jaehoon Chung
2022-05-23 17:57   ` Tom Rini

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=20220511182828.26890-1-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sinan@writeme.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