Skip to content

Commit 69b8d7b

Browse files
superm1gregkh
authored andcommitted
platform/x86/amd/pmf: Fix a missing cleanup path
[ 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]>
1 parent 2763732 commit 69b8d7b

File tree

1 file changed

+2
-1
lines changed
  • drivers/platform/x86/amd/pmf

1 file changed

+2
-1
lines changed

drivers/platform/x86/amd/pmf/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ static void amd_pmf_init_features(struct amd_pmf_dev *dev)
322322

323323
static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
324324
{
325-
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR)) {
325+
if (is_apmf_func_supported(dev, APMF_FUNC_STATIC_SLIDER_GRANULAR) ||
326+
is_apmf_func_supported(dev, APMF_FUNC_OS_POWER_SLIDER_UPDATE)) {
326327
power_supply_unreg_notifier(&dev->pwr_src_notifier);
327328
amd_pmf_deinit_sps(dev);
328329
}

0 commit comments

Comments
 (0)