* [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors
@ 2022-05-11 18:28 ` Pali Rohár
2022-05-16 23:41 ` Jaehoon Chung
2022-05-23 17:57 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2022-05-11 18:28 UTC (permalink / raw)
To: Peng Fan, Jaehoon Chung, Priyanka Jain, Sinan Akman; +Cc: u-boot
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors
2022-05-11 18:28 ` [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors Pali Rohár
@ 2022-05-16 23:41 ` Jaehoon Chung
2022-05-23 17:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2022-05-16 23:41 UTC (permalink / raw)
To: Pali Rohár, Peng Fan, Priyanka Jain, Sinan Akman; +Cc: u-boot
On 5/12/22 03:28, Pali Rohár wrote:
> 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>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
> ---
> 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();
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors
2022-05-11 18:28 ` [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors Pali Rohár
2022-05-16 23:41 ` Jaehoon Chung
@ 2022-05-23 17:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-05-23 17:57 UTC (permalink / raw)
To: Pali Rohár
Cc: Peng Fan, Jaehoon Chung, Priyanka Jain, Sinan Akman, u-boot
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
On Wed, May 11, 2022 at 08:28:28PM +0200, Pali Rohár wrote:
> 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>
> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-23 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20220511182904epcas1p46476ec8dff08a0b9f5acc9ac46989c7c@epcas1p4.samsung.com>
2022-05-11 18:28 ` [PATCH] mmc: fsl_esdhc_spl: Fix checking for number of read sectors Pali Rohár
2022-05-16 23:41 ` Jaehoon Chung
2022-05-23 17:57 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox