From: Liviu Dudau <Liviu.Dudau@arm.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Marc Zyngier <Marc.Zyngier@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <Mark.Rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
Date: Mon, 1 Dec 2014 12:36:56 +0000 [thread overview]
Message-ID: <20141201123656.GQ828@e106497-lin.cambridge.arm.com> (raw)
In-Reply-To: <20141201115400.GD3836@n2100.arm.linux.org.uk>
On Mon, Dec 01, 2014 at 11:54:00AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:31:05AM +0000, Marc Zyngier wrote:
> > On 01/12/14 11:23, Russell King - ARM Linux wrote:
> > > On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > >> Hi Russell,
> > >>
> > >> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > >>> If all you want to do is to bypass the following check, what's wrong
> > >>> with actually doing that:
> > >>>
> > >>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > >>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > >>> + type != IRQ_TYPE_EDGE_RISING)
> > >>> return -EINVAL;
> > >>>
> > >>
> > >> I think that will require some additional changes to gic_configure_irq
> > >> (in irq-gic-common.c).
> > >
> > > I don't think so - gic_configure_irq() will treat it as a no-op as far
> > > as trying to configure the IRQ settings.
> >
> > I agree. But that's following ARM's tradition of making PPIs
> > non-configurable. I seem to remember that there is at least one
> > occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
> >
> > With this use case in mind, Liviu's patch allows an active-low interrupt
> > to be correctly configured as level, for example.
>
> Liviu's patch is nothing more than a hack. It changes (eg) the active
> low level to be an active high level with the explicitly stated reason to
> bypass a test, and then hopes that the remaining functions do the right
> thing.
I was trying to make the smallest amount of changes possible. Given that
ARM's GICs don't distinguish between high/low or raising/falling all I wanted
was to get the level vs edge type being sticky.
>
> It would be better to explicitly bypass the test, and then explicitly
> handle other cases in gic_configure_irq().
>
> It would be even better to make the code reflect reality right the way
> through. If PPIs are non-configurable, then we should return -EINVAL if
> trying to set them to a setting which is not supported. For example,
> pass through all states to gic_configure_irq(), and have gic_configure_irq()
> return whether the state is valid.
>
> Then, gic_configure_irq() can read back the register after trying to set
> the appropriate value, and see whether it was taken. If the bits remain
> unchanged, then it can decide that the requested mode is not supported,
> and return -EINVAL.
>
> In any case, let's not hack the code in the way that Liviu is trying to
> do.
OK, I will send a v2 patch, doing the right thing.
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2014-12-01 12:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-28 17:55 Liviu Dudau
2014-12-01 10:41 ` Russell King - ARM Linux
2014-12-01 10:46 ` Liviu Dudau
2014-12-01 11:03 ` Russell King - ARM Linux
2014-12-01 11:19 ` Marc Zyngier
2014-12-01 11:23 ` Russell King - ARM Linux
2014-12-01 11:31 ` Marc Zyngier
2014-12-01 11:54 ` Russell King - ARM Linux
2014-12-01 12:36 ` Liviu Dudau [this message]
2014-12-01 11:44 ` Liviu Dudau
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=20141201123656.GQ828@e106497-lin.cambridge.arm.com \
--to=liviu.dudau@arm.com \
--cc=Marc.Zyngier@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=haojian.zhuang@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®