* [PATCH] platform/x86/amd/pmf: Fix a missing cleanup path
@ 2023-08-23 18:54 Mario Limonciello
2023-08-26 10:26 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Mario Limonciello @ 2023-08-23 18:54 UTC (permalink / raw)
To: Shyam-sundar.S-k, hdegoede
Cc: markgross, Patil.Reddy, platform-driver-x86, linux-kernel,
Mario Limonciello
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: 33c9ab5b493a ("platform/x86/amd/pmf: Notify OS power slider update")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/platform/x86/amd/pmf/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
index 7780705917b76..8f93681c5c9c5 100644
--- a/drivers/platform/x86/amd/pmf/core.c
+++ b/drivers/platform/x86/amd/pmf/core.c
@@ -317,7 +317,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);
}
base-commit: 65c6ea33e7f63799090158866cdcfdfe8d63ce16
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/x86/amd/pmf: Fix a missing cleanup path
2023-08-23 18:54 [PATCH] platform/x86/amd/pmf: Fix a missing cleanup path Mario Limonciello
@ 2023-08-26 10:26 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2023-08-26 10:26 UTC (permalink / raw)
To: Mario Limonciello, Shyam-sundar.S-k
Cc: markgross, Patil.Reddy, platform-driver-x86, linux-kernel
Hi,
On 8/23/23 20:54, Mario Limonciello wrote:
> 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.Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> Fixes: 33c9ab5b493a ("platform/x86/amd/pmf: Notify OS power slider update")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/platform/x86/amd/pmf/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
> index 7780705917b76..8f93681c5c9c5 100644
> --- a/drivers/platform/x86/amd/pmf/core.c
> +++ b/drivers/platform/x86/amd/pmf/core.c
> @@ -317,7 +317,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);
> }
>
> base-commit: 65c6ea33e7f63799090158866cdcfdfe8d63ce16
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-26 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23 18:54 [PATCH] platform/x86/amd/pmf: Fix a missing cleanup path Mario Limonciello
2023-08-26 10:26 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).