]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/powerpc-embedded6xx-hlwd-pic-prevent-interrupts-from-being-handled-by-starlet.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / powerpc-embedded6xx-hlwd-pic-prevent-interrupts-from-being-handled-by-starlet.patch
CommitLineData
a65d4bac 1From foo@baz Sat Jul 28 10:25:26 CEST 2018
4692c206 2From: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
a65d4bac
GKH
3Date: Thu, 10 May 2018 23:59:19 +0200
4Subject: powerpc/embedded6xx/hlwd-pic: Prevent interrupts from being handled by Starlet
5
4692c206 6From: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
a65d4bac
GKH
7
8[ Upstream commit 9dcb3df4281876731e4e8bff7940514d72375154 ]
9
10The interrupt controller inside the Wii's Hollywood chip is connected to
11two masters, the "Broadway" PowerPC and the "Starlet" ARM926, each with
12their own interrupt status and mask registers.
13
14When booting the Wii with mini[1], interrupts from the SD card
15controller (IRQ 7) are handled by the ARM, because mini provides SD
16access over IPC. Linux however can't currently use or disable this IPC
17service, so both sides try to handle IRQ 7 without coordination.
18
19Let's instead make sure that all interrupts that are unmasked on the PPC
20side are masked on the ARM side; this will also make sure that Linux can
21properly talk to the SD card controller (and potentially other devices).
22
23If access to a device through IPC is desired in the future, interrupts
24from that device should not be handled by Linux directly.
25
26[1]: https://github.com/lewurm/mini
27
28Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
29Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
30Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
31Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32---
33 arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 5 +++++
34 1 file changed, 5 insertions(+)
35
36--- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
37+++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
38@@ -35,6 +35,8 @@
39 */
40 #define HW_BROADWAY_ICR 0x00
41 #define HW_BROADWAY_IMR 0x04
42+#define HW_STARLET_ICR 0x08
43+#define HW_STARLET_IMR 0x0c
44
45
46 /*
47@@ -74,6 +76,9 @@ static void hlwd_pic_unmask(struct irq_d
48 void __iomem *io_base = irq_data_get_irq_chip_data(d);
49
50 setbits32(io_base + HW_BROADWAY_IMR, 1 << irq);
51+
52+ /* Make sure the ARM (aka. Starlet) doesn't handle this interrupt. */
53+ clrbits32(io_base + HW_STARLET_IMR, 1 << irq);
54 }
55
56