* [PATCH] ARM: pmu: avoid setting IRQ affinity on UP systems
@ 2011-02-15 12:11 Will Deacon
2011-02-17 16:24 ` Jamie Iles
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2011-02-15 12:11 UTC (permalink / raw)
To: linux-arm-kernel
Now that we can execute a CONFIG_SMP kernel on a uniprocessor system,
extra care has to be taken in the PMU IRQ affinity setting code to
ensure that we don't always fail to initialise.
This patch changes the CPU PMU initialisation code so that when we
only have a single IRQ, whose affinity can not be changed at the
controller, we report success (0) rather than -EINVAL.
Cc: Jamie Iles <jamie@jamieiles.com>
Reported-by: Avik Sil <avik.sil@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/kernel/pmu.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
index b8af96e..2b65d10 100644
--- a/arch/arm/kernel/pmu.c
+++ b/arch/arm/kernel/pmu.c
@@ -97,22 +97,29 @@ set_irq_affinity(int irq,
irq, cpu);
return err;
#else
- return 0;
+ return -EINVAL;
#endif
}
static int
init_cpu_pmu(void)
{
- int i, err = 0;
+ int i, irqs, err = 0;
struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU];
- if (!pdev) {
- err = -ENODEV;
- goto out;
- }
+ if (!pdev)
+ return -ENODEV;
+
+ irqs = pdev->num_resources;
+
+ /*
+ * If we have a single PMU interrupt that we can't shift, assume that
+ * we're running on a uniprocessor machine and continue.
+ */
+ if (irqs == 1 && !irq_can_set_affinity(platform_get_irq(pdev, 0)))
+ return 0;
- for (i = 0; i < pdev->num_resources; ++i) {
+ for (i = 0; i < irqs; ++i) {
err = set_irq_affinity(platform_get_irq(pdev, i), i);
if (err)
break;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ARM: pmu: avoid setting IRQ affinity on UP systems
2011-02-15 12:11 [PATCH] ARM: pmu: avoid setting IRQ affinity on UP systems Will Deacon
@ 2011-02-17 16:24 ` Jamie Iles
2011-02-18 15:22 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Jamie Iles @ 2011-02-17 16:24 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Feb 15, 2011 at 12:11:39PM +0000, Will Deacon wrote:
> Now that we can execute a CONFIG_SMP kernel on a uniprocessor system,
> extra care has to be taken in the PMU IRQ affinity setting code to
> ensure that we don't always fail to initialise.
>
> This patch changes the CPU PMU initialisation code so that when we
> only have a single IRQ, whose affinity can not be changed at the
> controller, we report success (0) rather than -EINVAL.
>
> Cc: Jamie Iles <jamie@jamieiles.com>
> Reported-by: Avik Sil <avik.sil@linaro.org>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
Look good!
Acked-by: Jamie Iles <jamie@jamieiles.com>
Jamie
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: pmu: avoid setting IRQ affinity on UP systems
2011-02-17 16:24 ` Jamie Iles
@ 2011-02-18 15:22 ` Will Deacon
0 siblings, 0 replies; 3+ messages in thread
From: Will Deacon @ 2011-02-18 15:22 UTC (permalink / raw)
To: linux-arm-kernel
Hi Jamie,
> On Tue, Feb 15, 2011 at 12:11:39PM +0000, Will Deacon wrote:
> > Now that we can execute a CONFIG_SMP kernel on a uniprocessor system,
> > extra care has to be taken in the PMU IRQ affinity setting code to
> > ensure that we don't always fail to initialise.
> >
> > This patch changes the CPU PMU initialisation code so that when we
> > only have a single IRQ, whose affinity can not be changed at the
> > controller, we report success (0) rather than -EINVAL.
> >
> > Cc: Jamie Iles <jamie@jamieiles.com>
> > Reported-by: Avik Sil <avik.sil@linaro.org>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> Look good!
>
> Acked-by: Jamie Iles <jamie@jamieiles.com>
Cheers. I've submitted this as 6742/1 with a minor change (deleted the out:
label as it's no longer used).
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-18 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 12:11 [PATCH] ARM: pmu: avoid setting IRQ affinity on UP systems Will Deacon
2011-02-17 16:24 ` Jamie Iles
2011-02-18 15:22 ` Will Deacon
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).