Skip to content

Commit

Permalink
platform/x86/amd/pmf: Fix a missing cleanup path
Browse files Browse the repository at this point in the history
[ Upstream commit 4dbd6e6 ]

On systems that support slider notifications but don't otherwise support
granular slider the SPS cleanup path doesn't run.

This means that loading/unloading/loading leads to failures because
the sysfs files don't get setup properly when reloaded.

Add the missing cleanup path.

Fixes: 33c9ab5 ("platform/x86/amd/pmf: Notify OS power slider update")
Signed-off-by: Mario Limonciello <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
superm1 authored and gregkh committed Sep 13, 2023
1 parent 2763732 commit 69b8d7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/platform/x86/amd/pmf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)

static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
{
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) {
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) ||
is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) {
power_supply_unreg_notifier(&dev->pwr_src_notifier);
amd_pmf_deinit_sps(dev);
}
Expand Down

0 comments on commit 69b8d7b

Please sign in to comment.