[U-Boot] Possible bug in s5p_sdhci.c

Pantelis Antoniou panto at antoniou-consulting.com
Mon Feb 23 18:56:45 CET 2015


Hi Matt,

> On Feb 19, 2015, at 20:31 , Matt Reimer <mreimer at sdgsystems.com> wrote:
> 
> The use of SDHCI_CTRL2_SELBASECLK_SHIFT in s5p_sdhci_set_control_reg() seems wrong, because a shifting offset is being used as a mask, not to generate a mask.
> 
> It's unclear what the original intent was. Below is my suggested fix.
> 
> What think ye?
> 
> Matt
> 
> 
> diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
> index 3899372..0eec731 100644
> --- a/drivers/mmc/s5p_sdhci.c
> +++ b/drivers/mmc/s5p_sdhci.c
> @@ -30,7 +30,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
>        sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4);
> 
>        val = sdhci_readl(host, SDHCI_CONTROL2);
> -       val &= SDHCI_CTRL2_SELBASECLK_SHIFT;
> +       val &= SDHCI_CTRL2_SELBASECLK_MASK(3);
> 
>        val |=  SDHCI_CTRL2_ENSTAASYNCCLR |
>                SDHCI_CTRL2_ENCMDCNFMSK |
> 
> 
> 

At first glance it seems you’re right. Please prepare a proper patch.
CCing Jaehoon…

Regards

— Pantelis



More information about the U-Boot mailing list