Skip to contentSkip to conversation

pinctrl: qcom: fix masking of pinmux functions

PATCH In review John Crispin 4 participants 7 messages Sep 12, 2016 – Oct 3, 2016

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: qcom: fix masking of pinmux functions

The following commit introduced a regression by not properly masking the calculated value.

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

---
 drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
index 51c42d7..775c883 100644
@@ -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);
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · John Crispin

The following commit introduced a regression by not properly masking the calculated value.

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

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

Quoted 17 lines
---
 drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
index 51c42d7..775c883 100644
@@ -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);
 
Reviewed-by
#2 lore raw
Quoted 5 lines · Stephen Boyd
Quoted 4 lines · John Crispin

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\")

Quoted 4 lines
Quoted 2 lines

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".

Quoted 3 lines

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

Regards,
Bjorn

Quoted 17 lines
Quoted 17 lines
---
 drivers/pinctrl/qcom/pinctrl-msm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -1
index 51c42d7..775c883 100644
@@ -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);
 
#3 lore raw
Quoted 19 lines · Bjorn Andersson
Quoted 5 lines · Stephen Boyd
Quoted 4 lines · John Crispin

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\")

Quoted 4 lines
Quoted 2 lines

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".

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

@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

#4 lore raw
Quoted 32 lines · Linus Walleij
Quoted 19 lines · Bjorn Andersson
Quoted 5 lines · Stephen Boyd
Quoted 4 lines · John Crispin

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\")

Quoted 4 lines
Quoted 2 lines

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".

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

@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.

Quoted 8 lines

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

#5 lore raw
Quoted 5 lines · John Crispin
Quoted 3 lines · Linus Walleij

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?

Quoted 7 lines
Quoted 5 lines

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

#6 lore raw
In reply to Linus Walleij
Quoted 26 lines · Linus Walleij
Quoted 24 lines · Bjorn Andersson
Quoted 5 lines · Stephen Boyd
Quoted 4 lines · John Crispin

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\")

Quoted 4 lines
Quoted 2 lines

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".

Quoted 3 lines
Quoted 8 lines
Quoted 2 lines

@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.