diff mbox

pinctrl: qcom: fix masking of pinmux functions

Message ID 1473673015-33124-1-git-send-email-john@phrozen.org
State New
Headers show

Commit Message

John Crispin Sept. 12, 2016, 9:36 a.m. UTC
The following commit introduced a regression by not properly masking the
calculated value.

commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Sept. 26, 2016, 6:36 a.m. UTC | #1
On Mon, Sep 12, 2016 at 2:36 AM, John Crispin <john@phrozen.org> wrote:
> The following commit introduced a regression by not properly masking the
> calculated value.
>
> commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")
>
> Signed-off-by: John Crispin <john@phrozen.org>

Now I'm confused how it ever worked.... but agreed, the code looks wrong.

Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>

> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 51c42d7..775c883 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
>         spin_lock_irqsave(&pctrl->lock, flags);
>
>         val = readl(pctrl->regs + g->ctl_reg);
> -       val &= mask;
> +       val &= ~mask;
>         val |= i << g->mux_bit;
>         writel(val, pctrl->regs + g->ctl_reg);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Andersson Sept. 26, 2016, 3:52 p.m. UTC | #2
On Sun 25 Sep 23:36 PDT 2016, Stephen Boyd wrote:

> On Mon, Sep 12, 2016 at 2:36 AM, John Crispin <john@phrozen.org> wrote:
> > The following commit introduced a regression by not properly masking the
> > calculated value.
> >
> > commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")

Please use the format: Fixes: %h (\"%s\")

> >
> > Signed-off-by: John Crispin <john@phrozen.org>
> 
> Now I'm confused how it ever worked.... but agreed, the code looks wrong.

I agree, we should have seen some issues based on this, I presume we
where "lucky".

> 
> Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

@Linus, the corrected patch appeared in v4.8-rc1, would you mind
including this in a pull for v4.8?

Regards,
Bjorn

> > ---
> >  drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> > index 51c42d7..775c883 100644
> > --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> > +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> > @@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
> >         spin_lock_irqsave(&pctrl->lock, flags);
> >
> >         val = readl(pctrl->regs + g->ctl_reg);
> > -       val &= mask;
> > +       val &= ~mask;
> >         val |= i << g->mux_bit;
> >         writel(val, pctrl->regs + g->ctl_reg);
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 3, 2016, 1:31 p.m. UTC | #3
On Mon, Sep 26, 2016 at 5:52 PM, Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
> On Sun 25 Sep 23:36 PDT 2016, Stephen Boyd wrote:
>
>> On Mon, Sep 12, 2016 at 2:36 AM, John Crispin <john@phrozen.org> wrote:
>> > The following commit introduced a regression by not properly masking the
>> > calculated value.
>> >
>> > commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")
>
> Please use the format: Fixes: %h (\"%s\")
>
>> >
>> > Signed-off-by: John Crispin <john@phrozen.org>
>>
>> Now I'm confused how it ever worked.... but agreed, the code looks wrong.
>
> I agree, we should have seen some issues based on this, I presume we
> where "lucky".
>
>>
>> Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>
>>
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>
> @Linus, the corrected patch appeared in v4.8-rc1, would you mind
> including this in a pull for v4.8?

I would have, had I been more attentive. And you even told me in person to
look at this :/ sorry.

Now I have the problem that I don't have the original patch in my inbox
at all: it might have been sent to some qcom-specific mailing list?

John: can you include the ACKs and resend with me on the To: line?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
John Crispin Oct. 3, 2016, 2:24 p.m. UTC | #4
On 03/10/2016 15:31, Linus Walleij wrote:
> On Mon, Sep 26, 2016 at 5:52 PM, Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
>> On Sun 25 Sep 23:36 PDT 2016, Stephen Boyd wrote:
>>
>>> On Mon, Sep 12, 2016 at 2:36 AM, John Crispin <john@phrozen.org> wrote:
>>>> The following commit introduced a regression by not properly masking the
>>>> calculated value.
>>>>
>>>> commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")
>>
>> Please use the format: Fixes: %h (\"%s\")
>>
>>>>
>>>> Signed-off-by: John Crispin <john@phrozen.org>
>>>
>>> Now I'm confused how it ever worked.... but agreed, the code looks wrong.
>>
>> I agree, we should have seen some issues based on this, I presume we
>> where "lucky".
>>
>>>
>>> Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>
>>>
>>
>> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>>
>> @Linus, the corrected patch appeared in v4.8-rc1, would you mind
>> including this in a pull for v4.8?
> 
> I would have, had I been more attentive. And you even told me in person to
> look at this :/ sorry.
> 
> Now I have the problem that I don't have the original patch in my inbox
> at all: it might have been sent to some qcom-specific mailing list?
> 
> John: can you include the ACKs and resend with me on the To: line?
> 
> Yours,
> Linus Walleij
> 

Sure, is there a patchwork where i can export it with all the Acks ?

	John
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Boyd Oct. 3, 2016, 8:53 p.m. UTC | #5
On Mon, Oct 3, 2016 at 6:31 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Sep 26, 2016 at 5:52 PM, Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
>> On Sun 25 Sep 23:36 PDT 2016, Stephen Boyd wrote:
>>
>>> On Mon, Sep 12, 2016 at 2:36 AM, John Crispin <john@phrozen.org> wrote:
>>> > The following commit introduced a regression by not properly masking the
>>> > calculated value.
>>> >
>>> > commit 47a01ee9a6c39fe1 ("pinctrl: qcom: Clear all function selection bits")
>>
>> Please use the format: Fixes: %h (\"%s\")
>>
>>> >
>>> > Signed-off-by: John Crispin <john@phrozen.org>
>>>
>>> Now I'm confused how it ever worked.... but agreed, the code looks wrong.
>>
>> I agree, we should have seen some issues based on this, I presume we
>> where "lucky".
>>
>>>
>>> Reviewed-by: Stephen Boyd <stephen.boyd@linaro.org>
>>>
>>
>> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>>
>> @Linus, the corrected patch appeared in v4.8-rc1, would you mind
>> including this in a pull for v4.8?
>
> I would have, had I been more attentive. And you even told me in person to
> look at this :/ sorry.
>
> Now I have the problem that I don't have the original patch in my inbox
> at all: it might have been sent to some qcom-specific mailing list?

It hit my (linaro) spam for some reason. Must be a problem between the
sending side and how google mail classifies spam.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 3, 2016, 10:38 p.m. UTC | #6
On Mon, Oct 3, 2016 at 4:24 PM, John Crispin <john@phrozen.org> wrote:
> On 03/10/2016 15:31, Linus Walleij wrote:

>> Now I have the problem that I don't have the original patch in my inbox
>> at all: it might have been sent to some qcom-specific mailing list?
>>
>> John: can you include the ACKs and resend with me on the To: line?
>>
>> Yours,
>> Linus Walleij
>>
>
> Sure, is there a patchwork where i can export it with all the Acks ?

Nevermind, I found the patch in my spam folder and applied it!

Thanks!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 51c42d7..775c883 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -156,7 +156,7 @@  static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
 	spin_lock_irqsave(&pctrl->lock, flags);
 
 	val = readl(pctrl->regs + g->ctl_reg);
-	val &= mask;
+	val &= ~mask;
 	val |= i << g->mux_bit;
 	writel(val, pctrl->regs + g->ctl_reg);