All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	linux-soc@vger.kernel.org, Andy Gross <andy.gross@linaro.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	David Brown <david.brown@linaro.org>,
	stable <stable@vger.kernel.org>,
	"Ivan T . Ivanov" <ivan.ivanov@linaro.org>
Subject: Re: [PATCH 1/2] ARM: dts: MSM8064 remove flags from SPMI/MPP IRQs
Date: Fri, 5 Aug 2016 10:56:43 -0700	[thread overview]
Message-ID: <CALAqxLVY4DbfEnd3oJ1ZHeEjnTe=NN8R0YBFwpDP=8dGJQw2RQ@mail.gmail.com> (raw)
In-Reply-To: <1470386318-17694-2-git-send-email-linus.walleij@linaro.org>

On Fri, Aug 5, 2016 at 1:38 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> The Qualcomm PMIC GPIO and MPP lines are problematic: the
> are fetched from the main MFD driver with platform_get_irq()
> which means that at this point they will all be assigned the
> flags set up for the interrupts in the device tree.
>
> That is problematic since these are flagged as rising edge
> and an this point the interrupt descriptor is assigned a
> rising edge, while the only thing the GPIO/MPP drivers really
> do is issue irq_get_irqchip_state() on the line to read it
> out and to provide a .to_irq() helper for *other* IRQ
> consumers.
>
> If another device tree node tries to flag the same IRQ
> for use as something else than rising edge, the kernel
> irqdomain core will protest like this:
>
>   type mismatch, failed to map hwirq-NN for <FOO>!
>
> Which is what happens when the device tree defines two
> contradictory flags for the same interrupt line.
>
> To work around this and alleviate the problem, assign 0
> as flag for the interrupts taken by the PM GPIO and MPP
> drivers. This will lead to the flag being unset, and a
> second consumer requesting rising, falling, both or level
> interrupts will be respected. This is what the qcom-pm*.dtsi
> files already do.
>
> Switched to using the symbolic name IRQ_TYPE_NONE so that
> we get this more readable.
>
> Cc: stable@vger.kernel.org
> Fixes: bce360469676 ("ARM: dts: apq8064: add pm8921 mpp support")
> Fixes: 874443fe9e33 ("ARM: dts: apq8064: Add pm8921 mfd and its gpio node")
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Björn Andersson <bjorn.andersson@linaro.org>
> Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Andy Gross <andy.gross@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> I vaguely remember John having problems with interrupts
> on the Nexus 7 that could be related to this so involving
> him on these patches.

Yea. Thanks for including me. Unfortunately these patches don't
resolve the problem I'm seeing (I still don't get any interrupts from
the volume/power buttons), and I still have to revert "irqdomain:
Don't set type when mapping an IRQ" to get things working.

thanks
-john

WARNING: multiple messages have this Message-ID (diff)
From: john.stultz@linaro.org (John Stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: dts: MSM8064 remove flags from SPMI/MPP IRQs
Date: Fri, 5 Aug 2016 10:56:43 -0700	[thread overview]
Message-ID: <CALAqxLVY4DbfEnd3oJ1ZHeEjnTe=NN8R0YBFwpDP=8dGJQw2RQ@mail.gmail.com> (raw)
In-Reply-To: <1470386318-17694-2-git-send-email-linus.walleij@linaro.org>

On Fri, Aug 5, 2016 at 1:38 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> The Qualcomm PMIC GPIO and MPP lines are problematic: the
> are fetched from the main MFD driver with platform_get_irq()
> which means that at this point they will all be assigned the
> flags set up for the interrupts in the device tree.
>
> That is problematic since these are flagged as rising edge
> and an this point the interrupt descriptor is assigned a
> rising edge, while the only thing the GPIO/MPP drivers really
> do is issue irq_get_irqchip_state() on the line to read it
> out and to provide a .to_irq() helper for *other* IRQ
> consumers.
>
> If another device tree node tries to flag the same IRQ
> for use as something else than rising edge, the kernel
> irqdomain core will protest like this:
>
>   type mismatch, failed to map hwirq-NN for <FOO>!
>
> Which is what happens when the device tree defines two
> contradictory flags for the same interrupt line.
>
> To work around this and alleviate the problem, assign 0
> as flag for the interrupts taken by the PM GPIO and MPP
> drivers. This will lead to the flag being unset, and a
> second consumer requesting rising, falling, both or level
> interrupts will be respected. This is what the qcom-pm*.dtsi
> files already do.
>
> Switched to using the symbolic name IRQ_TYPE_NONE so that
> we get this more readable.
>
> Cc: stable at vger.kernel.org
> Fixes: bce360469676 ("ARM: dts: apq8064: add pm8921 mpp support")
> Fixes: 874443fe9e33 ("ARM: dts: apq8064: Add pm8921 mfd and its gpio node")
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Bj?rn Andersson <bjorn.andersson@linaro.org>
> Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> Cc: John Stultz <john.stultz@linaro.org>
> Cc: Andy Gross <andy.gross@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> I vaguely remember John having problems with interrupts
> on the Nexus 7 that could be related to this so involving
> him on these patches.

Yea. Thanks for including me. Unfortunately these patches don't
resolve the problem I'm seeing (I still don't get any interrupts from
the volume/power buttons), and I still have to revert "irqdomain:
Don't set type when mapping an IRQ" to get things working.

thanks
-john

  reply	other threads:[~2016-08-05 17:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05  8:38 [PATCH 0/2] Fix Qualcomm 8064/8660 interrupt flags Linus Walleij
2016-08-05  8:38 ` Linus Walleij
2016-08-05  8:38 ` [PATCH 1/2] ARM: dts: MSM8064 remove flags from SPMI/MPP IRQs Linus Walleij
2016-08-05  8:38   ` Linus Walleij
2016-08-05 17:56   ` John Stultz [this message]
2016-08-05 17:56     ` John Stultz
2016-08-05  8:38 ` [PATCH 2/2] ARM: dts: MSM8660 " Linus Walleij
2016-08-05  8:38   ` Linus Walleij
2016-08-17  8:56 ` [PATCH 0/2] Fix Qualcomm 8064/8660 interrupt flags Linus Walleij
2016-08-17  8:56   ` Linus Walleij
2016-08-17 19:43   ` Andy Gross
2016-08-17 19:43     ` Andy Gross
2016-08-17 20:47     ` Bjorn Andersson
2016-08-17 20:47       ` Bjorn Andersson
2016-08-17 21:12       ` Andy Gross
2016-08-17 21:12         ` Andy Gross
2016-08-18 13:12     ` Linus Walleij
2016-08-18 13:12       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALAqxLVY4DbfEnd3oJ1ZHeEjnTe=NN8R0YBFwpDP=8dGJQw2RQ@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=ivan.ivanov@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.