mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Clément Léger" <cleger@rivosinc.com>
To: Lifeng Zheng <zhenglifeng1@huawei.com>,
	rafael@kernel.org, lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhanjie9@hisilicon.com, lihuisong@huawei.com,
	fanghao11@huawei.com
Subject: Re: [PATCH] ACPI: CPPC: fix bug that causes the value written in cpc register to be wrong.
Date: Wed, 13 Nov 2024 08:05:02 +0100	[thread overview]
Message-ID: <dfe6ca13-7c4b-4204-b3fb-7390eca3b18b@rivosinc.com> (raw)
In-Reply-To: <20241113024933.2100519-1-zhenglifeng1@huawei.com>



On 13/11/2024 03:49, Lifeng Zheng wrote:
> With these codes, the value written in cpc register will be the result of
> the OR operatiion on input value and prev_val. This will causes the value
> to be wrong.
> 
> 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 01192fd047a6..f69ef7cc0caf 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;

Hi Lifeng,

Indeed, MASK_VAL_WRITE() already takes care of ORing prev_val with the
register mask. You can also add a Fixes:

Fixes: 60949b7b8054 ("ACPI: CPPC: Fix MASK_VAL() usage")

Thanks,

Clément

>  	}
>  
>  	switch (size) {


  reply	other threads:[~2024-11-13  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13  2:49 Lifeng Zheng
2024-11-13  7:05 ` Clément Léger [this message]
2024-11-13  7:23   ` zhenglifeng (A)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfe6ca13-7c4b-4204-b3fb-7390eca3b18b@rivosinc.com \
    --to=cleger@rivosinc.com \
    --cc=fanghao11@huawei.com \
    --cc=lenb@kernel.org \
    --cc=lihuisong@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®