mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sandipan Das <sandipan.das@amd.com>
To: Ingyu Jang <ingyujang25@korea.ac.kr>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	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>,
	Thomas Gleixner <tglx@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/x86/amd/core: Make amd_core_pmu_init() return void
Date: Mon, 2 Nov 2026 19:19:20 +0530	[thread overview]
Message-ID: <f2a99c63-bd1b-4851-8d40-aead20614951@amd.com> (raw)
In-Reply-To: <20261101040356.3204097-1-ingyujang25@korea.ac.kr>

On 01-11-2026 09:33, Ingyu Jang wrote:
> amd_core_pmu_init() has always returned 0 since commit 471af006a747
> ("perf/x86/amd: Constrain Large Increment per Cycle events") removed
> its -ENODEV path for unknown CPU families, so the error check in
> amd_pmu_init() never triggers.
> 
> Change the function's return type to void and remove the dead check.
> 
> Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
> ---
>  arch/x86/events/amd/core.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
> index 49b6b8fce5664..c72e745b2591d 100644
> --- a/arch/x86/events/amd/core.c
> +++ b/arch/x86/events/amd/core.c
> @@ -1412,7 +1412,7 @@ static const struct attribute_group *amd_attr_update[] = {
>  	NULL,
>  };
>  
> -static int __init amd_core_pmu_init(void)
> +static void __init amd_core_pmu_init(void)
>  {
>  	union cpuid_0x80000022_ebx ebx;
>  	u64 even_ctr_mask = 0ULL;
> @@ -1422,7 +1422,7 @@ static int __init amd_core_pmu_init(void)
>  	perf_nmi_window = msecs_to_jiffies(100);
>  
>  	if (!boot_cpu_has(X86_FEATURE_PERFCTR_CORE))
> -		return 0;
> +		return;
>  
>  	/*
>  	 * If core performance counter extensions exists, we must use
> @@ -1523,22 +1523,17 @@ static int __init amd_core_pmu_init(void)
>  	x86_pmu.attr_update = amd_attr_update;
>  
>  	pr_cont("core perfctr, ");
> -	return 0;
>  }
>  
>  __init int amd_pmu_init(void)
>  {
> -	int ret;
> -
>  	/* Performance-monitoring supported from K7 and later: */
>  	if (boot_cpu_data.x86 < 6)
>  		return -ENODEV;
>  
>  	x86_pmu = amd_pmu;
>  
> -	ret = amd_core_pmu_init();
> -	if (ret)
> -		return ret;
> +	amd_core_pmu_init();
>  
>  	if (num_possible_cpus() == 1) {
>  		/*

Reviewed-by: Sandipan Das <sandipan.das@amd.com>


      reply	other threads:[~2026-11-02 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01  4:03 Ingyu Jang
2026-11-02 13:49 ` Sandipan Das [this message]

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=f2a99c63-bd1b-4851-8d40-aead20614951@amd.com \
    --to=sandipan.das@amd.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=ingyujang25@korea.ac.kr \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®