diff mbox

[U-Boot] spl: spl_mmc: fix mmc Falcon mode regression

Message ID 1432249036-2785-1-git-send-email-tharvey@gateworks.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Tim Harvey May 21, 2015, 10:57 p.m. UTC
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 <contact@paulk.fr>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 common/spl/spl_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Kocialkowski May 22, 2015, 10:13 a.m. UTC | #1
Le jeudi 21 mai 2015 à 15:57 -0700, Tim Harvey a écrit :
> 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.

> Cc: Paul Kocialkowski <contact@paulk.fr>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Acked-by: Paul Kocialkowski <contact@paulk.fr>

> ---
>  common/spl/spl_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 5d688d6..c96345e 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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
Stefano Babic May 26, 2015, 12:27 p.m. UTC | #2
On 22/05/2015 00:57, Tim Harvey wrote:
> 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 <contact@paulk.fr>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>  common/spl/spl_mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 5d688d6..c96345e 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -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
diff mbox

Patch

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 5d688d6..c96345e 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -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