[PATCH] ACPI: CPPC: Fix cpc register setting issue.

Lifeng Zheng posted 1 patch 1 year, 2 months ago
drivers/acpi/cppc_acpi.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] ACPI: CPPC: Fix cpc register setting issue.
Posted by Lifeng Zheng 1 year, 2 months ago
Since commit 60949b7b8054 ("ACPI: CPPC: Fix MASK_VAL() usage"), CPC
registers cannot be changed from 1 to 0. It turns out that there is an
extra OR after MASK_VAL_WRITE(), which has already ORed prev_val with the
register mask. Remove the extra OR to fix the problem.

Fixes: 60949b7b8054 ("ACPI: CPPC: Fix MASK_VAL() usage")
Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
---
 drivers/acpi/cppc_acpi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 1a40f0514eaa..c1f3568d0c50 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1146,7 +1146,6 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
 			return -EFAULT;
 		}
 		val = MASK_VAL_WRITE(reg, prev_val, val);
-		val |= prev_val;
 	}
 
 	switch (size) {
-- 
2.33.0
Re: [PATCH] ACPI: CPPC: Fix cpc register setting issue.
Posted by Rafael J. Wysocki 1 year, 2 months ago
On Wed, Nov 13, 2024 at 11:33 AM Lifeng Zheng <zhenglifeng1@huawei.com> wrote:
>
> Since commit 60949b7b8054 ("ACPI: CPPC: Fix MASK_VAL() usage"), CPC
> registers cannot be changed from 1 to 0. It turns out that there is an
> extra OR after MASK_VAL_WRITE(), which has already ORed prev_val with the
> register mask. Remove the extra OR to fix the problem.
>
> Fixes: 60949b7b8054 ("ACPI: CPPC: Fix MASK_VAL() usage")
> Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
> ---
>  drivers/acpi/cppc_acpi.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 1a40f0514eaa..c1f3568d0c50 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -1146,7 +1146,6 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
>                         return -EFAULT;
>                 }
>                 val = MASK_VAL_WRITE(reg, prev_val, val);
> -               val |= prev_val;
>         }
>
>         switch (size) {
> --

Applied as 6.13 material, thanks!