[U-Boot] [PATCH v1 1/2] mmc: Fix bug in sd_set_card_speed()
Jaehoon Chung
jh80.chung at samsung.com
Mon Feb 19 11:23:30 UTC 2018
On 02/09/2018 08:09 PM, Jean-Jacques Hiblot wrote:
> After settings the speed of the sd with the switch command, a check is
> done to make sure that the new speed has been set. The current check has a
> masking error: speed are encoded on 4 bits only.
> Fix it by masking the upper bits.
>
> This fixes a problem seen with QEmu emulating a vexpress-a15.
>
> Reported-by: Jonathan Gray <jsg at jsg.id.au>
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
Applied to u-boot-mmc. Thanks!
Best Regards,
Jaehoon Chung
>
> ---
>
> drivers/mmc/mmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 255310a..31614dd 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1333,7 +1333,7 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
> if (err)
> return err;
>
> - if ((__be32_to_cpu(switch_status[4]) >> 24) != speed)
> + if (((__be32_to_cpu(switch_status[4]) >> 24) & 0xF) != speed)
> return -ENOTSUPP;
>
> return 0;
>
More information about the U-Boot
mailing list