perf/cxl: Don't log through pmu.dev in the overflow interrupt handler

perf_pmu_unregister() frees pmu->dev without clearing the pointer, and
cxl_pmu_probe() orders its devm actions so that teardown runs it before
free_irq(). Nothing in between masks the interrupt, and
cxl_pmu_event_stop() leaves the overflow status bit set, so an overflow
taken just before teardown is still delivered and still reaches the
dev_dbg() in the !event branch - by which point info->pmu.dev is freed.

Log through info->pmu.parent instead, which is devm-managed and outlives
every teardown action.

Fixes: 5d7107c727 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Acked-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Dave Jiang 2026-08-05 08:59:10 -07:00 committed by Will Deacon
parent 1c5499e673
commit 984920c893

View File

@ -918,7 +918,7 @@ static irqreturn_t cxl_pmu_irq(int irq, void *data)
struct perf_event *event = info->hw_events[i];
if (!event) {
dev_dbg(info->pmu.dev,
dev_dbg(info->pmu.parent,
"overflow but on non enabled counter %d\n", i);
continue;
}