1 |
commit: 219bf376a6b2efde498b5ff0bc72f77c752f75aa |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 26 12:11:36 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 26 12:11:36 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=219bf376 |
7 |
|
8 |
gpio: Request interrupts after IRQ is initialized |
9 |
|
10 |
Bug: https://bugs.gentoo.org/840942 |
11 |
|
12 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
13 |
|
14 |
0000_README | 4 ++ |
15 |
...quest-interrupts-after-IRQ-is-initialized.patch | 75 ++++++++++++++++++++++ |
16 |
2 files changed, 79 insertions(+) |
17 |
|
18 |
diff --git a/0000_README b/0000_README |
19 |
index 8dd5a35c..d98d254b 100644 |
20 |
--- a/0000_README |
21 |
+++ b/0000_README |
22 |
@@ -195,6 +195,10 @@ Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch |
23 |
From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@××××××××.org/raw |
24 |
Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758 |
25 |
|
26 |
+Path: 2800_gpio-Request-interrupts-after-IRQ-is-initialized.patch |
27 |
+From: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/gpio?id=06fb4ecfeac7e00d6704fa5ed19299f2fefb3cc9 |
28 |
+Desc: gpio: Request interrupts after IRQ is initialized |
29 |
+ |
30 |
Patch: 2900_tmp513-Fix-build-issue-by-selecting-CONFIG_REG.patch |
31 |
From: https://bugs.gentoo.org/710790 |
32 |
Desc: tmp513 requies REGMAP_I2C to build. Select it by default in Kconfig. See bug #710790. Thanks to Phil Stracchino |
33 |
|
34 |
diff --git a/2800_gpio-Request-interrupts-after-IRQ-is-initialized.patch b/2800_gpio-Request-interrupts-after-IRQ-is-initialized.patch |
35 |
new file mode 100644 |
36 |
index 00000000..0a1d4624 |
37 |
--- /dev/null |
38 |
+++ b/2800_gpio-Request-interrupts-after-IRQ-is-initialized.patch |
39 |
@@ -0,0 +1,75 @@ |
40 |
+From 06fb4ecfeac7e00d6704fa5ed19299f2fefb3cc9 Mon Sep 17 00:00:00 2001 |
41 |
+From: Mario Limonciello <mario.limonciello@×××.com> |
42 |
+Date: Fri, 22 Apr 2022 08:14:52 -0500 |
43 |
+Subject: gpio: Request interrupts after IRQ is initialized |
44 |
+MIME-Version: 1.0 |
45 |
+Content-Type: text/plain; charset=UTF-8 |
46 |
+Content-Transfer-Encoding: 8bit |
47 |
+ |
48 |
+Commit 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members |
49 |
+before initialization") attempted to fix a race condition that lead to a |
50 |
+NULL pointer, but in the process caused a regression for _AEI/_EVT |
51 |
+declared GPIOs. |
52 |
+ |
53 |
+This manifests in messages showing deferred probing while trying to |
54 |
+allocate IRQs like so: |
55 |
+ |
56 |
+ amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517 |
57 |
+ amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x002C to IRQ, err -517 |
58 |
+ amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517 |
59 |
+ [ .. more of the same .. ] |
60 |
+ |
61 |
+The code for walking _AEI doesn't handle deferred probing and so this |
62 |
+leads to non-functional GPIO interrupts. |
63 |
+ |
64 |
+Fix this issue by moving the call to `acpi_gpiochip_request_interrupts` |
65 |
+to occur after gc->irc.initialized is set. |
66 |
+ |
67 |
+Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") |
68 |
+Link: https://lore.kernel.org/linux-gpio/BL1PR12MB51577A77F000A008AA694675E2EF9@×××××××××××××××××××××××××××××××××××.com/ |
69 |
+Link: https://bugzilla.suse.com/show_bug.cgi?id=1198697 |
70 |
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=215850 |
71 |
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1979 |
72 |
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1976 |
73 |
+Reported-by: Mario Limonciello <mario.limonciello@×××.com> |
74 |
+Signed-off-by: Mario Limonciello <mario.limonciello@×××.com> |
75 |
+Reviewed-by: Shreeya Patel <shreeya.patel@×××××××××.com> |
76 |
+Tested-By: Samuel Čavoj <samuel@×××××.net> |
77 |
+Tested-By: lukeluk498@×××××.com Link: |
78 |
+Reviewed-by: Andy Shevchenko <andy.shevchenko@×××××.com> |
79 |
+Acked-by: Linus Walleij <linus.walleij@××××××.org> |
80 |
+Reviewed-and-tested-by: Takashi Iwai <tiwai@××××.de> |
81 |
+Cc: Shreeya Patel <shreeya.patel@×××××××××.com> |
82 |
+Cc: stable@×××××××××××.org |
83 |
+Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org> |
84 |
+--- |
85 |
+ drivers/gpio/gpiolib.c | 4 ++-- |
86 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
87 |
+ |
88 |
+(limited to 'drivers/gpio') |
89 |
+ |
90 |
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
91 |
+index 085348e089860..b7694171655cf 100644 |
92 |
+--- a/drivers/gpio/gpiolib.c |
93 |
++++ b/drivers/gpio/gpiolib.c |
94 |
+@@ -1601,8 +1601,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, |
95 |
+ |
96 |
+ gpiochip_set_irq_hooks(gc); |
97 |
+ |
98 |
+- acpi_gpiochip_request_interrupts(gc); |
99 |
+- |
100 |
+ /* |
101 |
+ * Using barrier() here to prevent compiler from reordering |
102 |
+ * gc->irq.initialized before initialization of above |
103 |
+@@ -1612,6 +1610,8 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, |
104 |
+ |
105 |
+ gc->irq.initialized = true; |
106 |
+ |
107 |
++ acpi_gpiochip_request_interrupts(gc); |
108 |
++ |
109 |
+ return 0; |
110 |
+ } |
111 |
+ |
112 |
+-- |
113 |
+cgit 1.2.3-1.el7 |
114 |
+ |