aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2022-09-20 12:01:48 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2022-10-01 02:47:57 +0200
commitf1f97db627b2f82989a0f97a74bc7a3debd67ecd (patch)
treef41fd7c116246a5d3df3f5aa2715b9e61b087278 /target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch
parentba6096d04b4f7a40aec339e7bf3f7b5842ae3cac (diff)
downloadupstream-f1f97db627b2f82989a0f97a74bc7a3debd67ecd.tar.gz
upstream-f1f97db627b2f82989a0f97a74bc7a3debd67ecd.tar.bz2
upstream-f1f97db627b2f82989a0f97a74bc7a3debd67ecd.zip
realtek: Convert incorrect v5.10 patches
OpenWRT's developer guide prefers having actual patches so they an be sent upstream more easily. However, in this case, Adding proper fields also allows for `git am` to properly function. Some of these patches are quite old, and lack much traceable history. This commit tries to rectify that, by digging in the history to find where and how it was first added. It is by no means perfect and also shows some patches that should have been long gone. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch')
-rw-r--r--target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch b/target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch
index a3241cadbd..3980875dd4 100644
--- a/target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch
+++ b/target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch
@@ -1,3 +1,25 @@
+From bde6311569ef25a00c3beaeabfd6b78b19651872 Mon Sep 17 00:00:00 2001
+From: Sander Vanheule <sander@svanheule.net>
+Date: Sun, 29 May 2022 19:38:09 +0200
+Subject: [PATCH] realtek: don't unmask non-maskable GPIO IRQs
+
+On uniprocessor builds, for_each_cpu(cpu, mask) will assume 'mask'
+always contains exactly one CPU, and ignore the actual mask contents.
+This causes the loop to run, even when it shouldn't on an empty mask,
+and tries to access an uninitialised pointer.
+
+Fix this by wrapping the loop in a cpumask_empty() check, to ensure it
+will not run on uniprocessor builds if the CPU mask is empty.
+
+Fixes: af6cd37f42f3 ("realtek: replace RTL93xx GPIO patches")
+Reported-by: INAGAKI Hiroshi <musashino.open@gmail.com>
+Reported-by: Robert Marko <robimarko@gmail.com>
+Tested-by: Robert Marko <robimarko@gmail.com>
+Submitted-by: Sander Vanheule <sander@svanheule.net>
+---
+ drivers/gpio/gpio-realtek-otto.c | 9 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
--- a/drivers/gpio/gpio-realtek-otto.c
+++ b/drivers/gpio/gpio-realtek-otto.c
@@ -304,6 +304,7 @@ static int realtek_gpio_irq_set_affinity