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

From: Will Deacon
Date: Wed Jan 15 2020 - 07:49:59 EST


On Tue, Jan 14, 2020 at 10:25:46PM +0200, Leonard Crestez wrote:
> 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>
>
> ---
>
> Changes since v1:
> * Handle cpuhp_state_add_instant_nocalls error with additional error
> labels.
> Link to v1: https://patchwork.kernel.org/patch/11302423/
> ---
> drivers/perf/fsl_imx8_ddr_perf.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)

Thanks, I've queued this up with Joakim's ack.

Will