From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77F4C22066 for ; Wed, 13 Nov 2024 07:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731481521; cv=none; b=BLIysBfS7lCP+I3bvDPOj5cOUopS721CiRHzGZ1dRkn6esRL/xJSqciL0kSIrqnFVioToJ3p3mB0xYuucVJL3kTtersV1IbSX2tajwapemOTGu3e9R4yGes38dOhXW0EeNiq78Y/JBD/ji5zzWfT7SdV4UqgTESP67RP+1I48rs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731481521; c=relaxed/simple; bh=XzNpsyTqxzDr0Q1/DeMDEhXObeXQxZI8NonLpXgpY54=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wk/pp2nfObQqNuASTimdpmL5pyA74upQsKaA0yWN1vxMwyYz6ZTroMWZKwJeN17hJIrt/swuruF3JnurbQQYGGd/CXuP9t0CItTr8IZz5nd6cotEybLax5TScCFgF15rL3W9VAfk2kfx9VTuEGhnuIRCUVktqkfU82XghxTBuYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=Tz15j7pZ; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="Tz15j7pZ" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3e5f6e44727so4156051b6e.0 for ; Tue, 12 Nov 2024 23:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1731481518; x=1732086318; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RV5mKd+SWUX0HV1zXunMJLm1pgRUmXppt4+8Yzk2GwY=; b=Tz15j7pZEj53QiXotR45LetjBIAQUrXYx9JLcSdgMpLHTl8IPQyJ5ehI0p3TS274OD yDRrqG2IMVUgBMSPGhGxZfAPb9ymi5nxRV+LhGoNt6irUXwKX6vJicAkVpSHb1wJqYfE x79FeBhbQmhYJLOgKkhXsKqzQ2Ds1/PgewlXMP1ijqXqj83jSEYcvmsI9QeD9ATdFAc1 USwXt1hxYFEpuvDQmlQoI30t2h7DI/+l4dnwagp4+zrxcVh5WYMHOXUcrZHpBRJu6z9h XDEAiaHcnJj/Nz9bacnrT1yGnzfxLlSs5jpsOXqK4vCzwKLh04gG2/z5A073Lhg5EaAh 3EJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731481518; x=1732086318; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RV5mKd+SWUX0HV1zXunMJLm1pgRUmXppt4+8Yzk2GwY=; b=mV3tnfAOKdAFQkwz269NEr+pW95TmWR3oiR0y05HhDDd5jcIpRcLRCsFfeW4mjb2rl lcl1Lu05SWXlidUNUP+5Q6JuMZpye0KuJimEYZkfOpApdP87dPIkQXCASBczQperK4Wa I1hKa3ZWaS/+TzgSzhDjj9Z3vKlx8pnDkYxZmPyDZBCUhgTGpJxAc3xqpkztbphGDjsV Vh3cUZzFS/epB6JPKt50b2vdQrKUU+ZlqN4FLhW2eh4culOWn/YVydABscD4i7+E8nEJ 1YOAoy8sqTg1wf73N6Z/aLmmB0DFpXnwUrevrecbY0v6ncRwJVSNLnX6nXKhaMIP4uWy JEqg== X-Forwarded-Encrypted: i=1; AJvYcCW+acgq/chaefanYi2vu7czLu3g7xCfK0gEPvmDHwKYijXEcfJmlLzyHIOxuZKmi28CSqWjHl1xBTOKu7c=@vger.kernel.org X-Gm-Message-State: AOJu0YwppDHChAZlsXQ5LV0jrym+YKxym9T22WMFBXAS6QVMj4719rjF O0pTm0tEclZFfpMAwEEQzjBYpZxfVMJXLyAzFCgUhi+A3Txz2SygbRJNhPJ2e9dkyIilPYmxHdd n X-Google-Smtp-Source: AGHT+IGFw7DzRMngPvx+mv65K5j0/xVV3hwA8bu8072Y2SlIKW69JCxYqNFCGgCUgZj//dtqG2WJQA== X-Received: by 2002:a05:6808:3194:b0:3e7:5ab1:35b4 with SMTP id 5614622812f47-3e794706397mr18599233b6e.30.1731481517358; Tue, 12 Nov 2024 23:05:17 -0800 (PST) Received: from ?IPV6:2a01:e0a:e17:9700:16d2:7456:6634:9626? ([2a01:e0a:e17:9700:16d2:7456:6634:9626]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f714e8ae59sm788632a12.28.2024.11.12.23.05.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Nov 2024 23:05:16 -0800 (PST) Message-ID: Date: Wed, 13 Nov 2024 08:05:02 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ACPI: CPPC: fix bug that causes the value written in cpc register to be wrong. To: Lifeng Zheng , 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 References: <20241113024933.2100519-1-zhenglifeng1@huawei.com> Content-Language: en-US From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: <20241113024933.2100519-1-zhenglifeng1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 > --- > 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) {