Patch "perf/arm-smmuv3: Fix lockdep assert in ->event_init()" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf/arm-smmuv3: Fix lockdep assert in ->event_init()

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-arm-smmuv3-fix-lockdep-assert-in-event_init.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6ad46c5dc10e23903f03dd90091ee31a5d92d52d
Author: Chun-Tse Shao <ctshao@xxxxxxxxxx>
Date:   Fri Nov 8 05:08:05 2024 +0000

    perf/arm-smmuv3: Fix lockdep assert in ->event_init()
    
    [ Upstream commit 02a55f2743012a8089f09f6867220c3d57f16564 ]
    
    Same as
    https://lore.kernel.org/all/20240514180050.182454-1-namhyung@xxxxxxxxxx/,
    we should skip `for_each_sibling_event()` for group leader since it
    doesn't have the ctx yet.
    
    Fixes: f3c0eba28704 ("perf: Add a few assertions")
    Reported-by: Greg Thelen <gthelen@xxxxxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Robin Murphy <robin.murphy@xxxxxxx>
    Cc: Tuan Phan <tuanphan@xxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Chun-Tse Shao <ctshao@xxxxxxxxxx>
    Acked-by: Will Deacon <will@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20241108050806.3730811-1-ctshao@xxxxxxxxxx
    Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c
index d5fa92ba83739..dabdb9f7bb82c 100644
--- a/drivers/perf/arm_smmuv3_pmu.c
+++ b/drivers/perf/arm_smmuv3_pmu.c
@@ -431,6 +431,17 @@ static int smmu_pmu_event_init(struct perf_event *event)
 			return -EINVAL;
 	}
 
+	/*
+	 * Ensure all events are on the same cpu so all events are in the
+	 * same cpu context, to avoid races on pmu_enable etc.
+	 */
+	event->cpu = smmu_pmu->on_cpu;
+
+	hwc->idx = -1;
+
+	if (event->group_leader == event)
+		return 0;
+
 	for_each_sibling_event(sibling, event->group_leader) {
 		if (is_software_event(sibling))
 			continue;
@@ -442,14 +453,6 @@ static int smmu_pmu_event_init(struct perf_event *event)
 			return -EINVAL;
 	}
 
-	hwc->idx = -1;
-
-	/*
-	 * Ensure all events are on the same cpu so all events are in the
-	 * same cpu context, to avoid races on pmu_enable etc.
-	 */
-	event->cpu = smmu_pmu->on_cpu;
-
 	return 0;
 }
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux