Commit 744940f1 authored by Sandipan Das's avatar Sandipan Das Committed by Ingo Molnar

perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV

Pass through the appropriate error code when the registration of hotplug
callbacks fail during initialization, instead of returning a blanket -ENODEV.

[ mingo: Updated the changelog. ]
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarSandipan Das <sandipan.das@amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20231016060743.332051-1-sandipan.das@amd.com
parent 75433657
...@@ -1040,20 +1040,25 @@ static int __init amd_uncore_init(void) ...@@ -1040,20 +1040,25 @@ static int __init amd_uncore_init(void)
/* /*
* Install callbacks. Core will call them for each online cpu. * Install callbacks. Core will call them for each online cpu.
*/ */
if (cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP, ret = cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP,
"perf/x86/amd/uncore:prepare", "perf/x86/amd/uncore:prepare",
NULL, amd_uncore_cpu_dead)) NULL, amd_uncore_cpu_dead);
if (ret)
goto fail; goto fail;
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING, ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
"perf/x86/amd/uncore:starting", "perf/x86/amd/uncore:starting",
amd_uncore_cpu_starting, NULL)) amd_uncore_cpu_starting, NULL);
if (ret)
goto fail_prep; goto fail_prep;
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
"perf/x86/amd/uncore:online", ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
amd_uncore_cpu_online, "perf/x86/amd/uncore:online",
amd_uncore_cpu_down_prepare)) amd_uncore_cpu_online,
amd_uncore_cpu_down_prepare);
if (ret)
goto fail_start; goto fail_start;
return 0; return 0;
fail_start: fail_start:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment