Skip to contentSkip to conversation

spl: spl_mmc: fix mmc Falcon mode regression

PATCH New Tim Harvey 3 participants 3 messages May 21, 2015 – May 26, 2015

lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 spl: spl_mmc: fix mmc Falcon mode regression

91199f4a5a21a7cf9dd9e7c05e295a042f8c2b7e broke mmc based Falcon mode.

The block_read function returns the number of blocks read thus the error check needs to look for a return of 0 blocks read.

Cc Paul Kocialkowski <[email protected]>
---
 common/spl/spl_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_mmc.c +1 -1
index 5d688d6..c96345e 100644
@@ -76,7 +76,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
 					(void *)CONFIG_SYS_SPL_ARGS_ADDR);
-	if (err) {
+	if (err == 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: mmc block read error\n");
 #endif
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 spl: spl_mmc: fix mmc Falcon mode regression

Le jeudi 21 mai 2015 ? 15:57 -0700, Tim Harvey a ?crit :

Quoted 4 lines

91199f4a5a21a7cf9dd9e7c05e295a042f8c2b7e broke mmc based Falcon mode.

The block_read function returns the number of blocks read thus the error check needs to look for a return of 0 blocks read.

Damn, it seems that I messed up return code checks. My sincerest apologies for that.

I will check for other potential mistakes introduced by that commit.

Quoted 2 lines
Cc Paul Kocialkowski <[email protected]>
Quoted 9 lines
---
 common/spl/spl_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_mmc.c +0 -0
index 5d688d6..c96345e 100644

common/spl/spl_mmc.c static int mmc_load_image_raw_os(struct mmc *mmc) · line 82

Quoted 8 lines
common/spl/spl_mmc.c +1 -1
@@ -76,7 +76,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
 					(void *)CONFIG_SYS_SPL_ARGS_ADDR);
-	if (err) {
+	if (err == 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: mmc block read error\n");
 #endif

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150522/a1d5b8f4/attachment.sig>

#2 lore raw

PATCH 1/1 spl: spl_mmc: fix mmc Falcon mode regression

In reply to Tim Harvey
Quoted 17 lines · Tim Harvey

91199f4a5a21a7cf9dd9e7c05e295a042f8c2b7e broke mmc based Falcon mode.

The block_read function returns the number of blocks read thus the error check needs to look for a return of 0 blocks read.

Cc Paul Kocialkowski <[email protected]>
---
 common/spl/spl_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/spl_mmc.c +0 -0
index 5d688d6..c96345e 100644

common/spl/spl_mmc.c static int mmc_load_image_raw_os(struct mmc *mmc) · line 82

Quoted 8 lines
common/spl/spl_mmc.c +1 -1
@@ -76,7 +76,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
 					CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
 					(void *)CONFIG_SYS_SPL_ARGS_ADDR);
-	if (err) {
+	if (err == 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: mmc block read error\n");
 #endif

Applied to u-boot-imx, thanks!

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================