From: Jon Hunter <jonathanh@nvidia.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Jason Cooper" <jason@lakedaemon.net>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Marc Zyngier" <marc.zyngier@arm.com>,
"Benoît Cousson" <bcousson@baylibre.com>,
"Tony Lindgren" <tony@atomide.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Pawel Moll" <pawel.moll@arm.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
"Kumar Gala" <galak@codeaurora.org>,
"Stephen Warren" <swarren@wwwdotorg.org>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Kevin Hilman" <khilman@kernel.org>,
"Grygorii Strashko" <grygorii.strashko@ti.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Linus Walleij" <linus.walleij@linaro.org>,
linux-tegra@vger.kernel.org,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 04/15] irqchip/gic: WARN if setting the interrupt type fails
Date: Fri, 18 Mar 2016 09:54:41 +0000 [thread overview]
Message-ID: <56EBD061.6030502@nvidia.com> (raw)
In-Reply-To: <CAMuHMdU8PDUVZ8=S04fkahez1dh7JHjpj2-3w+Vfz05X=ZFMUQ@mail.gmail.com>
On 18/03/16 09:20, Geert Uytterhoeven wrote:
> On Thu, Mar 17, 2016 at 5:20 PM, Jon Hunter <jonathanh@nvidia.com> wrote:
>> On 17/03/16 15:18, Jason Cooper wrote:
>>> On Thu, Mar 17, 2016 at 03:04:01PM +0000, Jon Hunter wrote:
>>>> On 17/03/16 14:51, Thomas Gleixner wrote:
>>>>> On Thu, 17 Mar 2016, Jon Hunter wrote:
>>>>>> Setting the interrupt type for private peripheral interrupts (PPIs) may
>>>>>> not be supported by a given GIC because it is IMPLEMENTATION DEFINED
>>>>>> whether this is allowed. There is no way to know if setting the type is
>>>>>> supported for a given GIC and so the value written is read back to
>>>>>> verify it matches the desired configuration. If it does not match then
>>>>>> an error is return.
>>>>>>
>>>>>> There are cases where the interrupt configuration read from firmware
>>>>>> (such as a device-tree blob), has been incorrect and hence
>>>>>> gic_configure_irq() has returned an error. This error has gone
>>>>>> undetected because the error code returned was ignored but the interrupt
>>>>>> still worked fine because the configuration for the interrupt could not
>>>>>> be overwritten.
>>>>>>
>>>>>> Given that this has done undetected and we should only fail to set the
>>>>>> type for PPIs whose configuration cannot be changed anyway, don't return
>>>>>> an error and simply WARN if this fails. This will allows us to fix up any
>>>>>> places in the kernel where we should be checking the return status and
>>>>>> maintain back compatibility with firmware images that may have incorrect
>>>>>> interrupt configurations.
>>>>>
>>>>> Though silently returning 0 is really the wrong thing to do. You can add the
>>>>> warn, but why do you want to return success?
>>>>
>>>> Yes that would be the correct thing to do I agree. However, the problem
>>>> is that if we do this, then after the patch "irqdomain: Don't set type
>>>> when mapping an IRQ" is applied, we may break interrupts for some
>>>> existing device-tree binaries that have bad configuration (such as omap4
>>>> and tegra20/30 ... see patches 1 and 2) that have gone unnoticed. So it
>>>> is a back compatibility issue.
>
> Indeed (also for sh73a0 and r8a7779).
Thanks. I was wondering if there are others. Do you know what the
correct setting should be? Ie. should it be IRQ_TYPE_EDGE_RISING as
well? I can then include this with OMAP and Tegra.
>>> This sounds like a textbook case for adding a boolean dt property. If
>>> "can-set-ppi-type" is absent (old DT blobs and new blobs without the
>>> ability), warn and return zero. If it's present, the driver can set the
>>> type, returning errors as encountered.
>>
>> True. However, if we did have this "can-set-ppi-type" property set for a
>> device, it really should never fail (unless someone specified it
>> incorrectly). So I am trying to understand the value in adding a new DT
>> property.
>
> Do we really want to add properties that basically indicate that a description
> in DT is correct?
>
> Alternatively, it can be fixed in the kernel in a DT quirk (if SoC == xxx then
> fix TWD).
I am not sure I fully understand your proposal, but please note that it
may not be just limited to the TWD (although this does appear to be the
one client that is wrong for a lot of SoCs). PPIs are also used for the
armv7/8 timers as well.
The problem is that we have a lot of SoCs with twd-timers and I have no
way to test all of these to know which could be a problem. So I thought
that warning would be a good first step to fixing them.
However, I am still trying to see the real value in returning an error
in this case. May be I am the only one with that perspective?
Cheers
Jon
next prev parent reply other threads:[~2016-03-18 9:54 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 14:19 [PATCH 00/15] Add support for Tegra210 AGIC Jon Hunter
2016-03-17 14:19 ` [PATCH 01/15] ARM: tegra: Correct interrupt type for ARM TWD Jon Hunter
2016-04-01 23:25 ` Kevin Hilman
2016-04-05 14:04 ` Thierry Reding
2016-03-17 14:19 ` [PATCH 02/15] ARM: OMAP: " Jon Hunter
2016-03-18 15:41 ` Grygorii Strashko
2016-03-29 14:02 ` Jon Hunter
2016-03-30 21:23 ` Tony Lindgren
2016-03-17 14:19 ` [PATCH 03/15] irqchip/gic: Don't unnecessarily write the IRQ configuration Jon Hunter
2016-04-09 10:50 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 04/15] irqchip/gic: WARN if setting the interrupt type fails Jon Hunter
2016-03-17 14:51 ` Thomas Gleixner
2016-03-17 15:04 ` Jon Hunter
2016-03-17 15:18 ` Jason Cooper
2016-03-17 16:20 ` Jon Hunter
2016-03-18 9:20 ` Geert Uytterhoeven
2016-03-18 9:54 ` Jon Hunter [this message]
2016-03-18 10:22 ` Geert Uytterhoeven
2016-04-09 10:58 ` Marc Zyngier
2016-04-11 15:31 ` Jon Hunter
2016-04-11 15:39 ` Marc Zyngier
2016-04-12 8:50 ` Jon Hunter
2016-04-12 10:14 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 05/15] irqchip: Mask the non-type/sense bits when translating an IRQ Jon Hunter
2016-04-09 11:03 ` Marc Zyngier
2016-04-19 14:14 ` Jon Hunter
2016-04-19 14:23 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 06/15] irqdomain: Ensure type settings match for an existing mapping Jon Hunter
2016-03-17 18:18 ` Jon Hunter
2016-03-18 10:03 ` Grygorii Strashko
2016-03-18 10:33 ` Jon Hunter
2016-03-17 14:19 ` [PATCH 07/15] irqdomain: Don't set type when mapping an IRQ Jon Hunter
2016-03-17 14:55 ` Thomas Gleixner
2016-03-17 15:06 ` Jon Hunter
2016-03-17 18:19 ` Jon Hunter
2016-03-17 14:19 ` [PATCH 08/15] genirq: Add runtime power management support for IRQ chips Jon Hunter
2016-03-17 15:02 ` Marc Zyngier
2016-03-17 15:13 ` Jon Hunter
2016-03-17 15:28 ` Marc Zyngier
2016-03-22 11:46 ` Linus Walleij
2016-03-17 15:02 ` Thomas Gleixner
2016-03-17 15:46 ` Jon Hunter
2016-03-18 11:11 ` Grygorii Strashko
2016-03-18 12:27 ` Jon Hunter
2016-03-18 14:23 ` Grygorii Strashko
2016-03-18 14:40 ` Jon Hunter
2016-03-18 14:56 ` Jon Hunter
2016-03-18 17:52 ` Grygorii Strashko
2016-03-21 10:09 ` Jon Hunter
2016-03-17 14:19 ` [PATCH 09/15] irqchip/gic: Don't initialise chip if mapping IO space fails Jon Hunter
2016-04-09 11:09 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 10/15] irqchip/gic: Remove static irq_chip definition for eoimode1 Jon Hunter
2016-03-22 11:49 ` Linus Walleij
2016-04-09 11:38 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 11/15] irqchip/gic: Return an error if GIC initialisation fails Jon Hunter
2016-04-09 11:43 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 12/15] irqchip/gic: Pass GIC pointer to save/restore functions Jon Hunter
2016-04-09 11:52 ` Marc Zyngier
2016-03-17 14:19 ` [PATCH 13/15] irqchip/gic: Prepare for adding platform driver Jon Hunter
2016-03-29 13:04 ` Geert Uytterhoeven
2016-03-29 13:59 ` Jon Hunter
2016-03-17 14:19 ` [PATCH 14/15] dt-bindings: arm-gic: Drop 'clock-names' from binding document Jon Hunter
2016-03-17 20:14 ` Rob Herring
2016-03-18 8:37 ` Jon Hunter
2016-04-12 8:54 ` Jon Hunter
2016-03-18 9:13 ` Geert Uytterhoeven
2016-03-18 10:13 ` Jon Hunter
2016-03-18 10:52 ` Geert Uytterhoeven
2016-03-18 10:56 ` Jon Hunter
2016-03-18 12:05 ` Geert Uytterhoeven
2016-03-18 12:42 ` Jon Hunter
2016-03-18 12:47 ` Grygorii Strashko
2016-03-18 13:02 ` Geert Uytterhoeven
2016-03-18 18:36 ` Grygorii Strashko
2016-03-17 14:19 ` [PATCH 15/15] irqchip/gic: Add support for tegra AGIC interrupt controller Jon Hunter
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=56EBD061.6030502@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=geert@linux-m68k.org \
--cc=grygorii.strashko@ti.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jason@lakedaemon.net \
--cc=khilman@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=tglx@linutronix.de \
--cc=thierry.reding@gmail.com \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome