From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] arm: imx: Workaround i.MX6 PMU interrupts muxed to one SPI
Date: Fri, 21 Nov 2014 00:30:31 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1411210016360.6439@nanos> (raw)
In-Reply-To: <1416483757-24165-1-git-send-email-daniel.thompson@linaro.org>
On Thu, 20 Nov 2014, Daniel Thompson wrote:
> +/*
> + * The PMU IRQ lines of all cores are muxed onto a single interrupt.
> + * Rotate the interrupt around the cores if the current CPU cannot
> + * figure out why the interrupt has been triggered.
> + */
> +static irqreturn_t imx6q_pmu_handler(int irq, void *dev, irq_handler_t handler)
> +{
> + irqreturn_t ret = handler(irq, dev);
> + int next;
> +
> + if (ret == IRQ_NONE && num_online_cpus() > 1) {
What guarantees that ret == IRQ_HANDLED is a sign for 'this is only
for this particular core' interrupt ?
> + next = cpumask_next(smp_processor_id(), cpu_online_mask);
> + if (next > nr_cpu_ids)
> + next = cpumask_next(-1, cpu_online_mask);
> + irq_set_affinity(irq, cpumask_of(next));
> + }
Aside of the fact, that the hardware designers who came up with such a
brainfart should be put on sane drugs, this is just silly.
Rotating that thing around will introduce arbitrary latencies and
dependencies on other interrupts to be handled.
So if there is really no way to figure out which of the cores is the
actual target of the PMU interrupt then you should simply broadcast
that interrupt to a designated per cpu vector async from the one which
handles it in the first place and be done with it. That's the only
sane option you have.
Until now I assumed that on the core components side only timers and
interrupt controllers are supposed to be designed by janitors, but
there seems to be some more evil efforts underway.
Thanks,
tglx
next prev parent reply other threads:[~2014-11-20 23:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 11:42 [RFC PATCH] arm: imx: Workaround i.MX6 PMU interrupts muxed to one SPI Daniel Thompson
2014-11-20 11:48 ` Arnd Bergmann
2014-11-20 11:52 ` Lucas Stach
2014-11-20 14:24 ` Daniel Thompson
2014-11-20 16:48 ` Russell King - ARM Linux
2014-11-20 18:46 ` Daniel Thompson
2014-11-20 23:30 ` Thomas Gleixner [this message]
2014-11-21 9:50 ` Daniel Thompson
2014-11-21 10:41 ` Thomas Gleixner
2014-11-21 11:45 ` Daniel Thompson
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=alpine.DEB.2.11.1411210016360.6439@nanos \
--to=tglx@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox