]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2012 18:13:16 +0000 (10:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2012 18:13:16 +0000 (10:13 -0800)
added patches:
dove-attempt-to-fix-pmu-rtc-interrupts.patch
dove-fix-irq_to_pmu.patch

queue-3.0/dove-attempt-to-fix-pmu-rtc-interrupts.patch [new file with mode: 0644]
queue-3.0/dove-fix-irq_to_pmu.patch [new file with mode: 0644]
queue-3.0/series [new file with mode: 0644]

diff --git a/queue-3.0/dove-attempt-to-fix-pmu-rtc-interrupts.patch b/queue-3.0/dove-attempt-to-fix-pmu-rtc-interrupts.patch
new file mode 100644 (file)
index 0000000..60df3bf
--- /dev/null
@@ -0,0 +1,63 @@
+From 5d3df935426271016b895aecaa247101b4bfa35e Mon Sep 17 00:00:00 2001
+From: Russell King - ARM Linux <linux@arm.linux.org.uk>
+Date: Sun, 18 Nov 2012 16:29:44 +0000
+Subject: Dove: Attempt to fix PMU/RTC interrupts
+
+From: Russell King - ARM Linux <linux@arm.linux.org.uk>
+
+commit 5d3df935426271016b895aecaa247101b4bfa35e upstream.
+
+Fix the acknowledgement of PMU interrupts on Dove: some Dove hardware
+has not been sensibly designed so that interrupts can be handled in a
+race free manner.  The PMU is one such instance.
+
+The pending (aka 'cause') register is a bunch of RW bits, meaning that
+these bits can be both cleared and set by software (confirmed on the
+Armada-510 on the cubox.)
+
+Hardware sets the appropriate bit when an interrupt is asserted, and
+software is required to clear the bits which are to be processed.  If
+we write ~(1 << bit), then we end up asserting every other interrupt
+except the one we're processing.  So, we need to do a read-modify-write
+cycle to clear the asserted bit.
+
+However, any interrupts which occur in the middle of this cycle will
+also be written back as zero, which will also clear the new interrupts.
+
+The upshot of this is: there is _no_ way to safely clear down interrupts
+in this register (and other similarly behaving interrupt pending
+registers on this device.)  The patch below at least stops us creating
+new interrupts.
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-dove/irq.c |   14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/mach-dove/irq.c
++++ b/arch/arm/mach-dove/irq.c
+@@ -61,8 +61,20 @@ static void pmu_irq_ack(struct irq_data
+       int pin = irq_to_pmu(d->irq);
+       u32 u;
++      /*
++       * The PMU mask register is not RW0C: it is RW.  This means that
++       * the bits take whatever value is written to them; if you write
++       * a '1', you will set the interrupt.
++       *
++       * Unfortunately this means there is NO race free way to clear
++       * these interrupts.
++       *
++       * So, let's structure the code so that the window is as small as
++       * possible.
++       */
+       u = ~(1 << (pin & 31));
+-      writel(u, PMU_INTERRUPT_CAUSE);
++      u &= readl_relaxed(PMU_INTERRUPT_CAUSE);
++      writel_relaxed(u, PMU_INTERRUPT_CAUSE);
+ }
+ static struct irq_chip pmu_irq_chip = {
diff --git a/queue-3.0/dove-fix-irq_to_pmu.patch b/queue-3.0/dove-fix-irq_to_pmu.patch
new file mode 100644 (file)
index 0000000..04b5b3f
--- /dev/null
@@ -0,0 +1,34 @@
+From d356cf5a74afa32b40decca3c9dd88bc3cd63eb5 Mon Sep 17 00:00:00 2001
+From: Russell King - ARM Linux <linux@arm.linux.org.uk>
+Date: Sun, 18 Nov 2012 16:39:32 +0000
+Subject: Dove: Fix irq_to_pmu()
+
+From: Russell King - ARM Linux <linux@arm.linux.org.uk>
+
+commit d356cf5a74afa32b40decca3c9dd88bc3cd63eb5 upstream.
+
+PMU interrupts start at IRQ_DOVE_PMU_START, not IRQ_DOVE_PMU_START + 1.
+Fix the condition.  (It may have been less likely to occur had the code
+been written "if (irq >= IRQ_DOVE_PMU_START" which imho is the easier
+to understand notation, and matches the normal way of thinking about
+these things.)
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-dove/include/mach/pm.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/mach-dove/include/mach/pm.h
++++ b/arch/arm/mach-dove/include/mach/pm.h
+@@ -45,7 +45,7 @@ static inline int pmu_to_irq(int pin)
+ static inline int irq_to_pmu(int irq)
+ {
+-      if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS)
++      if (IRQ_DOVE_PMU_START <= irq && irq < NR_IRQS)
+               return irq - IRQ_DOVE_PMU_START;
+       return -EINVAL;
diff --git a/queue-3.0/series b/queue-3.0/series
new file mode 100644 (file)
index 0000000..c698120
--- /dev/null
@@ -0,0 +1,2 @@
+dove-attempt-to-fix-pmu-rtc-interrupts.patch
+dove-fix-irq_to_pmu.patch