]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
perf/imx_ddr: Fix cpu hotplug state cleanup
authorLeonard Crestez <leonard.crestez@nxp.com>
Tue, 14 Jan 2020 20:25:46 +0000 (22:25 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 24 Feb 2020 15:19:57 +0000 (16:19 +0100)
commitf358ad4e4aef2d96e384d9df98014f3a8aa16803
tree3c36d963b4dbb169be2b6cfc3dd81a31826927a8
parent21893b5ca00885f2fc8c1e2f2c9a4e02aa320cd5
perf/imx_ddr: Fix cpu hotplug state cleanup

BugLink: https://bugs.launchpad.net/bugs/1864488
[ Upstream commit 9ee68b314e9aa63ed11b98beb8a68810b8234dcf ]

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")
Acked-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/perf/fsl_imx8_ddr_perf.c