* [PATCH] pinctrl: qcom: Clear status bit on irq_unmask
@ 2019-05-31 6:51 Tengfei Fan
2019-06-07 21:08 ` Linus Walleij
0 siblings, 1 reply; 8+ messages in thread
From: Tengfei Fan @ 2019-05-31 6:51 UTC (permalink / raw)
To: bjorn.andersson, andy.gross, david.brown, linus.walleij
Cc: linux-arm-msm, linux-gpio, linux-kernel, Tengfei Fan
The gpio interrupt status bit is getting set after the
irq is disabled and causing an immediate interrupt after
enablling the irq, so clear status bit on irq_unmask.
Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index ee81198..7283c50 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -740,6 +740,7 @@ static void msm_gpio_irq_mask(struct irq_data *d)
static void msm_gpio_irq_unmask(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+ uint32_t irqtype = irqd_get_trigger_type(d);
struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
const struct msm_pingroup *g;
unsigned long flags;
@@ -749,6 +750,12 @@ static void msm_gpio_irq_unmask(struct irq_data *d)
raw_spin_lock_irqsave(&pctrl->lock, flags);
+ if (irqtype & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
+ val = readl_relaxed(pctrl->regs + g->intr_status_reg);
+ val &= ~BIT(g->intr_status_bit);
+ writel_relaxed(val, pctrl->regs + g->intr_status_reg);
+ }
+
val = msm_readl_intr_cfg(pctrl, g);
val |= BIT(g->intr_raw_status_bit);
val |= BIT(g->intr_enable_bit);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] pinctrl: qcom: Clear status bit on irq_unmask
2019-05-31 6:51 [PATCH] pinctrl: qcom: Clear status bit on irq_unmask Tengfei Fan
@ 2019-06-07 21:08 ` Linus Walleij
2019-06-10 14:51 ` Stephen Boyd
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2019-06-07 21:08 UTC (permalink / raw)
To: Tengfei Fan, Bjorn Andersson, Stephen Boyd, Niklas Cassel
Cc: Andy Gross, David Brown, MSM, open list:GPIO SUBSYSTEM,
linux-kernel@vger.kernel.org
On Fri, May 31, 2019 at 8:52 AM Tengfei Fan <tengfeif@codeaurora.org> wrote:
> The gpio interrupt status bit is getting set after the
> irq is disabled and causing an immediate interrupt after
> enablling the irq, so clear status bit on irq_unmask.
>
> Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
This looks pretty serious, can one of the Qcom maintainers ACK
this?
Should it be sent to fixes and even stable?
Fixes: tag?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] pinctrl: qcom: Clear status bit on irq_unmask
2019-06-07 21:08 ` Linus Walleij
@ 2019-06-10 14:51 ` Stephen Boyd
2019-06-11 10:41 ` tengfeif
0 siblings, 1 reply; 8+ messages in thread
From: Stephen Boyd @ 2019-06-10 14:51 UTC (permalink / raw)
To: Bjorn Andersson, Linus Walleij, Niklas Cassel, Tengfei Fan
Cc: Andy Gross, David Brown, MSM, open list:GPIO SUBSYSTEM,
linux-kernel@vger.kernel.org
Quoting Linus Walleij (2019-06-07 14:08:10)
> On Fri, May 31, 2019 at 8:52 AM Tengfei Fan <tengfeif@codeaurora.org> wrote:
>
> > The gpio interrupt status bit is getting set after the
> > irq is disabled and causing an immediate interrupt after
> > enablling the irq, so clear status bit on irq_unmask.
> >
> > Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
>
> This looks pretty serious, can one of the Qcom maintainers ACK
> this?
>
> Should it be sent to fixes and even stable?
>
> Fixes: tag?
>
How is the interrupt status bit getting set after the irq is disabled?
It looks like this is a level type interrupt? I thought that after
commit b55326dc969e ("pinctrl: msm: Really mask level interrupts to
prevent latching") this wouldn't be a problem. Am I wrong, or is qcom
just clearing out patches on drivers and this is the last one that needs
to be upstreamed?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] pinctrl: qcom: Clear status bit on irq_unmask
2019-06-10 14:51 ` Stephen Boyd
@ 2019-06-11 10:41 ` tengfeif
2019-06-11 18:51 ` Stephen Boyd
0 siblings, 1 reply; 8+ messages in thread
From: tengfeif @ 2019-06-11 10:41 UTC (permalink / raw)
To: Stephen Boyd
Cc: Bjorn Andersson, Linus Walleij, Niklas Cassel, Andy Gross,
David Brown, MSM, open list:GPIO SUBSYSTEM, linux-kernel
On 2019-06-10 22:51, Stephen Boyd wrote:
> Quoting Linus Walleij (2019-06-07 14:08:10)
>> On Fri, May 31, 2019 at 8:52 AM Tengfei Fan <tengfeif@codeaurora.org>
>> wrote:
>>
>> > The gpio interrupt status bit is getting set after the
>> > irq is disabled and causing an immediate interrupt after
>> > enablling the irq, so clear status bit on irq_unmask.
>> >
>> > Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
>>
>> This looks pretty serious, can one of the Qcom maintainers ACK
>> this?
>>
>> Should it be sent to fixes and even stable?
>>
>> Fixes: tag?
>>
>
> How is the interrupt status bit getting set after the irq is disabled?
> It looks like this is a level type interrupt? I thought that after
> commit b55326dc969e ("pinctrl: msm: Really mask level interrupts to
> prevent latching") this wouldn't be a problem. Am I wrong, or is qcom
> just clearing out patches on drivers and this is the last one that
> needs
> to be upstreamed?
Your patch(commit b55326dc969e) can cover our issue, and my patch is no
longer needed.
Your patch isn't included in our code, so I submitted this patch.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] pinctrl: qcom: Clear status bit on irq_unmask
2019-06-11 10:41 ` tengfeif
@ 2019-06-11 18:51 ` Stephen Boyd
[not found] ` <671f87d6-f4a4-6d2c-967b-e1aa0677d83e@codeaurora.org>
0 siblings, 1 reply; 8+ messages in thread
From: Stephen Boyd @ 2019-06-11 18:51 UTC (permalink / raw)
To: tengfeif
Cc: Bjorn Andersson, Linus Walleij, Niklas Cassel, Andy Gross,
David Brown, MSM, open list:GPIO SUBSYSTEM, linux-kernel
Quoting tengfeif@codeaurora.org (2019-06-11 03:41:26)
> On 2019-06-10 22:51, Stephen Boyd wrote:
> > Quoting Linus Walleij (2019-06-07 14:08:10)
> >> On Fri, May 31, 2019 at 8:52 AM Tengfei Fan <tengfeif@codeaurora.org>
> >> wrote:
> >>
> >> > The gpio interrupt status bit is getting set after the
> >> > irq is disabled and causing an immediate interrupt after
> >> > enablling the irq, so clear status bit on irq_unmask.
> >> >
> >> > Signed-off-by: Tengfei Fan <tengfeif@codeaurora.org>
> >>
> >> This looks pretty serious, can one of the Qcom maintainers ACK
> >> this?
> >>
> >> Should it be sent to fixes and even stable?
> >>
> >> Fixes: tag?
> >>
> >
> > How is the interrupt status bit getting set after the irq is disabled?
> > It looks like this is a level type interrupt? I thought that after
> > commit b55326dc969e ("pinctrl: msm: Really mask level interrupts to
> > prevent latching") this wouldn't be a problem. Am I wrong, or is qcom
> > just clearing out patches on drivers and this is the last one that
> > needs
> > to be upstreamed?
>
> Your patch(commit b55326dc969e) can cover our issue, and my patch is no
> longer needed.
> Your patch isn't included in our code, so I submitted this patch.
Alright cool. Sounds like this patch can be dropped then and you can
pick up the patch from upstream into your vendor kernel.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-06-17 13:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-31 6:51 [PATCH] pinctrl: qcom: Clear status bit on irq_unmask Tengfei Fan
2019-06-07 21:08 ` Linus Walleij
2019-06-10 14:51 ` Stephen Boyd
2019-06-11 10:41 ` tengfeif
2019-06-11 18:51 ` Stephen Boyd
[not found] ` <671f87d6-f4a4-6d2c-967b-e1aa0677d83e@codeaurora.org>
2019-06-17 10:35 ` Fwd: " Neeraj Upadhyay
2019-06-17 11:50 ` Linus Walleij
2019-06-17 13:22 ` Neeraj Upadhyay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).