From: Ayush Yaduvanshi <ayush37735@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@kernel.org>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
"H . Peter Anvin" <hpa@zytor.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Ayush Yaduvanshi <ayush37735@gmail.com>
Subject: [PATCH 1/2] perf/x86/amd/power: Fix missing CPU hotplug setup check and cleanup
Date: Fri, 13 Nov 2026 05:20:02 +0530 [thread overview]
Message-ID: <20261112235003.18608-2-ayush37735@gmail.com> (raw)
In-Reply-To: <20261112235003.18608-1-ayush37735@gmail.com>
Check the return value of cpuhp_setup_state() and remove the hotplug
state if perf_pmu_register() fails.
Signed-off-by: Ayush Yaduvanshi <ayush37735@gmail.com>
---
arch/x86/events/amd/power.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/x86/events/amd/power.c b/arch/x86/events/amd/power.c
index 66197214b010..2627d5269b52 100644
--- a/arch/x86/events/amd/power.c
+++ b/arch/x86/events/amd/power.c
@@ -282,13 +282,16 @@ static int __init amd_power_pmu_init(void)
}
- cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_POWER_ONLINE,
- "perf/x86/amd/power:online",
- power_cpu_init, power_cpu_exit);
+ ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_POWER_ONLINE,
+ "perf/x86/amd/power:online",
+ power_cpu_init, power_cpu_exit);
+ if (ret)
+ return ret;
ret = perf_pmu_register(&pmu_class, "power", -1);
if (WARN_ON(ret)) {
pr_warn("AMD Power PMU registration failed\n");
+ cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_POWER_ONLINE);
return ret;
}
--
2.53.0
next prev parent reply other threads:[~2026-11-12 23:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 23:50 [PATCH 0/2] perf/x86/amd: Check CPU hotplug setup and unwind failures Ayush Yaduvanshi
2026-11-12 23:50 ` Ayush Yaduvanshi [this message]
2026-11-13 0:04 ` [PATCH 1/2] perf/x86/amd/power: Fix missing CPU hotplug setup check and cleanup sashiko-bot
2026-11-12 23:50 ` [PATCH 2/2] perf/x86/amd/ibs: Fix missing CPU hotplug cleanup and unchecked init return Ayush Yaduvanshi
2026-11-13 0:01 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261112235003.18608-2-ayush37735@gmail.com \
--to=ayush37735@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.