From: Sasha Levin Date: Mon, 20 Jun 2022 07:16:34 +0000 (-0400) Subject: Fixes for 4.9 X-Git-Tag: v5.4.200~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e659d26c41e5d072377ece771025649f5c9d5cf;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch b/queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch new file mode 100644 index 00000000000..a0f4edfc57e --- /dev/null +++ b/queue-4.9/irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch @@ -0,0 +1,37 @@ +From e23f120ef9efd7ca43b32e3e723d04c7a6ca7490 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 1 Jun 2022 12:09:25 +0400 +Subject: irqchip/gic/realview: Fix refcount leak in realview_gic_of_init + +From: Miaoqian Lin + +[ Upstream commit f4b98e314888cc51486421bcf6d52852452ea48b ] + +of_find_matching_node_and_match() returns a node pointer with refcount +incremented, we should use of_node_put() on it when not need anymore. +Add missing of_node_put() to avoid refcount leak. + +Fixes: 82b0a434b436 ("irqchip/gic/realview: Support more RealView DCC variants") +Signed-off-by: Miaoqian Lin +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20220601080930.31005-2-linmq006@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-gic-realview.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/irqchip/irq-gic-realview.c b/drivers/irqchip/irq-gic-realview.c +index 54c296401525..61024882c685 100644 +--- a/drivers/irqchip/irq-gic-realview.c ++++ b/drivers/irqchip/irq-gic-realview.c +@@ -56,6 +56,7 @@ realview_gic_of_init(struct device_node *node, struct device_node *parent) + + /* The PB11MPCore GIC needs to be configured in the syscon */ + map = syscon_node_to_regmap(np); ++ of_node_put(np); + if (!IS_ERR(map)) { + /* new irq mode with no DCC */ + regmap_write(map, REALVIEW_SYS_LOCK_OFFSET, +-- +2.35.1 + diff --git a/queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch b/queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch new file mode 100644 index 00000000000..125a8257074 --- /dev/null +++ b/queue-4.9/irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch @@ -0,0 +1,52 @@ +From b52e9f3d1230f4e59f0863d1d21ef6652fba62da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 16 Sep 2017 01:59:41 +0800 +Subject: irqchip/gic-v3: Iterate over possible CPUs by for_each_possible_cpu() + +From: zijun_hu + +[ Upstream commit 3fad4cdac235c5b13227d0c09854c689ae62c70b ] + +get_cpu_number() doesn't use existing helper to iterate over possible +CPUs, It will cause an error in case of discontinuous @cpu_possible_mask +such as 0b11110001, which can result from a core having failed to come +up on a SMP machine. + +Fixed by using existing helper for_each_possible_cpu(). + +Signed-off-by: zijun_hu +Signed-off-by: Marc Zyngier +Signed-off-by: Sasha Levin +--- + drivers/irqchip/irq-gic-v3.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c +index 2ab6060031a4..9ae24ffb9b09 100644 +--- a/drivers/irqchip/irq-gic-v3.c ++++ b/drivers/irqchip/irq-gic-v3.c +@@ -982,7 +982,7 @@ static int get_cpu_number(struct device_node *dn) + { + const __be32 *cell; + u64 hwid; +- int i; ++ int cpu; + + cell = of_get_property(dn, "reg", NULL); + if (!cell) +@@ -996,9 +996,9 @@ static int get_cpu_number(struct device_node *dn) + if (hwid & ~MPIDR_HWID_BITMASK) + return -1; + +- for (i = 0; i < num_possible_cpus(); i++) +- if (cpu_logical_map(i) == hwid) +- return i; ++ for_each_possible_cpu(cpu) ++ if (cpu_logical_map(cpu) == hwid) ++ return cpu; + + return -1; + } +-- +2.35.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 12f78febc00..67b7b73ca60 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -237,3 +237,5 @@ net-ethernet-mtk_eth_soc-fix-misuse-of-mem-alloc-int.patch random-credit-cpu-and-bootloader-seeds-by-default.patch pnfs-don-t-keep-retrying-if-the-server-replied-nfs4e.patch misc-atmel-ssc-fix-irq-check-in-ssc_probe.patch +irqchip-gic-realview-fix-refcount-leak-in-realview_g.patch +irqchip-gic-v3-iterate-over-possible-cpus-by-for_eac.patch