RE: [PATCH v2] perf/imx_ddr: Fix cpu hotplug state cleanup

From: Joakim Zhang
Date: Tue Jan 14 2020 - 20:36:23 EST



> -----Original Message-----
> From: Leonard Crestez <leonard.crestez@xxxxxxx>
> Sent: 2020年1月15日 4:26
> To: Joakim Zhang <qiangqing.zhang@xxxxxxx>; Will Deacon <will@xxxxxxxxxx>
> Cc: Frank Li <frank.li@xxxxxxx>; Mark Rutland <mark.rutland@xxxxxxx>;
> Peter Zijlstra <peterz@xxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>;
> Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>; Alexander Shishkin
> <alexander.shishkin@xxxxxxxxxxxxxxx>; Jiri Olsa <jolsa@xxxxxxxxxx>;
> Namhyung Kim <namhyung@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Subject: [PATCH v2] perf/imx_ddr: Fix cpu hotplug state cleanup
>
> This driver allocates a dynamic cpu hotplug state but never releases it.
> If reloaded in a loop it will quickly trigger a WARN message:
>
> "No more dynamic states available for CPU hotplug"
>
> Fix by calling cpuhp_remove_multi_state on remove like several other perf pmu
> drivers.
>
> Also fix the cleanup logic on probe error paths: add the missing
> cpuhp_remove_multi_state call and properly check the return value from
> cpuhp_state_add_instant_nocalls.
>
> Fixes: 9a66d36cc7ac ("drivers/perf: imx_ddr: Add DDR performance counter
> support to perf")
> Signed-off-by: Leonard Crestez <leonard.crestez@xxxxxxx>
Acked-by: Joakim Zhang <qiangqing.zhang@xxxxxxx>

Best Regards,
Joakim Zhang