]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Apr 2022 08:26:44 +0000 (10:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Apr 2022 08:26:44 +0000 (10:26 +0200)
added patches:
irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch
perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch

queue-4.14/irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch [new file with mode: 0644]
queue-4.14/perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch b/queue-4.14/irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch
new file mode 100644 (file)
index 0000000..ba6b9b9
--- /dev/null
@@ -0,0 +1,61 @@
+From 0df6664531a12cdd8fc873f0cac0dcb40243d3e9 Mon Sep 17 00:00:00 2001
+From: Marc Zyngier <maz@kernel.org>
+Date: Tue, 15 Mar 2022 16:50:32 +0000
+Subject: irqchip/gic-v3: Fix GICR_CTLR.RWP polling
+
+From: Marc Zyngier <maz@kernel.org>
+
+commit 0df6664531a12cdd8fc873f0cac0dcb40243d3e9 upstream.
+
+It turns out that our polling of RWP is totally wrong when checking
+for it in the redistributors, as we test the *distributor* bit index,
+whereas it is a different bit number in the RDs... Oopsie boo.
+
+This is embarassing. Not only because it is wrong, but also because
+it took *8 years* to notice the blunder...
+
+Just fix the damn thing.
+
+Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3")
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Cc: stable@vger.kernel.org
+Reviewed-by: Andre Przywara <andre.przywara@arm.com>
+Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Link: https://lore.kernel.org/r/20220315165034.794482-2-maz@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/irqchip/irq-gic-v3.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/irqchip/irq-gic-v3.c
++++ b/drivers/irqchip/irq-gic-v3.c
+@@ -92,11 +92,11 @@ static inline void __iomem *gic_dist_bas
+       return NULL;
+ }
+-static void gic_do_wait_for_rwp(void __iomem *base)
++static void gic_do_wait_for_rwp(void __iomem *base, u32 bit)
+ {
+       u32 count = 1000000;    /* 1s! */
+-      while (readl_relaxed(base + GICD_CTLR) & GICD_CTLR_RWP) {
++      while (readl_relaxed(base + GICD_CTLR) & bit) {
+               count--;
+               if (!count) {
+                       pr_err_ratelimited("RWP timeout, gone fishing\n");
+@@ -110,13 +110,13 @@ static void gic_do_wait_for_rwp(void __i
+ /* Wait for completion of a distributor change */
+ static void gic_dist_wait_for_rwp(void)
+ {
+-      gic_do_wait_for_rwp(gic_data.dist_base);
++      gic_do_wait_for_rwp(gic_data.dist_base, GICD_CTLR_RWP);
+ }
+ /* Wait for completion of a redistributor change */
+ static void gic_redist_wait_for_rwp(void)
+ {
+-      gic_do_wait_for_rwp(gic_data_rdist_rd_base());
++      gic_do_wait_for_rwp(gic_data_rdist_rd_base(), GICR_CTLR_RWP);
+ }
+ #ifdef CONFIG_ARM64
diff --git a/queue-4.14/perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch b/queue-4.14/perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch
new file mode 100644 (file)
index 0000000..7b1e2f9
--- /dev/null
@@ -0,0 +1,53 @@
+From 2012a9e279013933885983cbe0a5fe828052563b Mon Sep 17 00:00:00 2001
+From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+Date: Sun, 27 Mar 2022 13:57:33 +0800
+Subject: perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
+
+From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+
+commit 2012a9e279013933885983cbe0a5fe828052563b upstream.
+
+The bug is here:
+       return cluster;
+
+The list iterator value 'cluster' will *always* be set and non-NULL
+by list_for_each_entry(), so it is incorrect to assume that the
+iterator value will be NULL if the list is empty or no element
+is found.
+
+To fix the bug, return 'cluster' when found, otherwise return NULL.
+
+Cc: stable@vger.kernel.org
+Fixes: 21bdbb7102ed ("perf: add qcom l2 cache perf events driver")
+Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
+Link: https://lore.kernel.org/r/20220327055733.4070-1-xiam0nd.tong@gmail.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/perf/qcom_l2_pmu.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/perf/qcom_l2_pmu.c
++++ b/drivers/perf/qcom_l2_pmu.c
+@@ -744,7 +744,7 @@ static struct cluster_pmu *l2_cache_asso
+ {
+       u64 mpidr;
+       int cpu_cluster_id;
+-      struct cluster_pmu *cluster = NULL;
++      struct cluster_pmu *cluster;
+       /*
+        * This assumes that the cluster_id is in MPIDR[aff1] for
+@@ -766,10 +766,10 @@ static struct cluster_pmu *l2_cache_asso
+                        cluster->cluster_id);
+               cpumask_set_cpu(cpu, &cluster->cluster_cpus);
+               *per_cpu_ptr(l2cache_pmu->pmu_cluster, cpu) = cluster;
+-              break;
++              return cluster;
+       }
+-      return cluster;
++      return NULL;
+ }
+ static int l2cache_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
index 7b44f4794e7e4bdedfcc016361cc0300c0ec12bf..539007523b2ee12bd3ed569ba8491f5c2cce1161 100644 (file)
@@ -252,3 +252,5 @@ x86-pm-save-the-msr-validity-status-at-context-setup.patch
 x86-speculation-restore-speculation-related-msrs-during-s3-resume.patch
 btrfs-fix-qgroup-reserve-overflow-the-qgroup-limit.patch
 arm64-patch_text-fixup-last-cpu-should-be-master.patch
+perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch
+irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch