From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 204793BE17E for ; Thu, 20 Aug 2026 10:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787220231; cv=none; b=T7abEMOnQfrvVOXI6hCMFM9E4KCINksCNH5BMgr0M+qzgK22JRSX00e2Vhw+liqDjJmXnKDy42i5NhQ/eyizhDNRjcqHNb+1mClMiqNkrV5j13W79wOwclSVpCXT5+LeXpcN357bzooC3AmjCLoxTEmU77+/9QiS2AoDI5BZJh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787220231; c=relaxed/simple; bh=eXffEAGKjk5hZBWJl6zMi/+attHYcgNZsIbemDFtAZA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Bq34Ctpo1NpyP43oZoo35cg1i+DSIiA/Hbh/Q4A0I8tOXHVZNytbnWT8MlkrXrq8QhRSK8iB01XIJia7KihsvUZTs4Vs1qHsM+8G0MC4QckxanMbs3uO0B86S8bLZrlSKZJalQGDPYOVJSMo7YA8zcAhxQptWQbeyuPeUpdBnK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GrUWv8E1; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VMb62xFU; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GrUWv8E1"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VMb62xFU" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67K6EPil491129 for ; Thu, 20 Aug 2026 10:03:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iPSkuOEchbemDS4U9crqf2tId0yJsRdyzuUVxXq7JPk=; b=GrUWv8E1JzQPRNt2 g+UHy/wFYB6/Emh1fS4On/siAWE2XU8nd8XmNCtn4F3S3G7N+Vj7e8uaiqiQzumf Uw48HTxrOFwMdzq9UmulYBxsNgHga1Z1NvveN2GmDqO1Q2ySo9XlD9lPV1HNoKGW rricXfDqlvNeXCJr9qeYJKOrjN50RBiSN6NzRzMQOcSV59z/Q353HeJspIA82D9D kvtUZvk2YScboJZk20pXxMMu6LaswLpvxJtrWPvpbJu0rzhZ+hTTvezMqKdGYXjR nQTjUdVEj4K5SrFWEo+DtsN1G6hzuaCF+8Xe17pzLn2QZIN7HkelcmZtacFb1y1R wZj4xw== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5ervmca9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 20 Aug 2026 10:03:48 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-84e13b57b2cso2279828b3a.1 for ; Thu, 20 Aug 2026 03:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787220228; x=1787825028; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=iPSkuOEchbemDS4U9crqf2tId0yJsRdyzuUVxXq7JPk=; b=VMb62xFUcVrgewbRSXphIjDpyyau6Tk0j4gPcrx2EhobMoEa251AtqlY/y9wkrC978 4e0PMN7GiDdo/1YV4SWBzpuCjJutZdfJJjNCLVdZs6WtJFA3PAYXcSj/GIHlbxzKNjkY Av19n6vLItXw6qxPUUMG0k8cdWW88Npdt/Nhu4gJ8QuWQfsLP8ArbzYnZPKkuCeYhQuz 9NL289uOPbGtb/d8pePgot8eINsSkvi4aw3J0YqXAa/MD80f0Ch53HU2HJbPSRbT46Ji 0e217MaJIIg1S25Ol7n21Fqup/axqC7FTMqFn6h+HfT0L+Fr32H/dtkwIr3d4D7brVPb KvPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787220228; x=1787825028; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iPSkuOEchbemDS4U9crqf2tId0yJsRdyzuUVxXq7JPk=; b=Slly+gr/U1feTpVaJnInBKe6EYO71FCDBRUDeYkXgmY/PGkWH7TI+TjBBn913Z8vsB Q22UsCs9TX3l/LQSXhGVnO61FgftiDoFF2oT8NA1y2/Puhc2QO2Tc9pFHKg4pYvG23i7 oUh7KHSb1YV96VnzkvTPsvB5evfx+7Wk8Yo6IFMbAjugjUWWyVIIYjtL3iN4MreCkTPm Jjm26EK8fCh0EYGjmTZD2urePlegMjJQqOUkBpU9OxW9rgjrxL7+2onGADjIwJsX77Mg fvQP5VnYhxOKrgXzZgonN4WYSSAmQQuVpWk6NowqBsB3teGdCQ9nygZHOMogF/G2EHgo 3nmA== X-Forwarded-Encrypted: i=1; AHgh+RpUPBFDoBzqI0X3aIVd7PXZPatsY3V+D52SeKphZ0pmovhO6EmCatKqyKqxanGzD2oRFqbgbUktEhf7MEU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8qA4NAFnRoMTFGPjEOu1CNu/Md6HKtM2MvZ//SWgd+K9Ue2DI LRjPv6HR22i0R8y4LwU/9+Pv5iDxUyZ1DbOWqTZZm5XUJ1c1PuUCnqY9MrPGuvtZ3p75EZuaJ9p ajHgl/mf6ruKwNPht9Zm6hHIYYel0Rbt6HF/RHzrzXbrA9Us4wkG5tEZmPUCzfz9zLCE= X-Gm-Gg: AR+sD13qW49cbSQJgGGHICD0pwAqSNoP96kknBhv9AmSJwOulzBS1ie52Ik8xHa5+xQ IG/SjGL1lJAdGsAXtxrhkop+uXTkqSBUSV0VW/h/0rt/6E3lrffq4ujws81OTNT5QejmzgrW6hZ +0PrqFUwpKCBExz8Vi04TPQSuod4dV5f7zZlokU0iINs9ylEwvsHcZ0M1XShvmvXrZJxiPL2JPK PvlkRMqhCxcXi2minbO75UHjKTT2p2a++9h0hSeOyVppS1swj8XvT2pGg335oDVFo0DZVNjXDpa id7F87VdMq4ccxjAKhxjZvE1/lMgftcTXVBt9h6xlKGsFQx2n8gJNN7l5Ovc/7sNJEP+DZmQLPB c16iUHWBHsMEfFJ/IQPADtoqUgLUultkqJ+nuO3IKEyeLoD0K5uD08/5WoxtP6lHxgdgM3Dyg X-Received: by 2002:aa7:88c8:0:b0:847:9015:e68c with SMTP id d2e1a72fcca58-851d3953ac9mr17929936b3a.17.1787220227629; Thu, 20 Aug 2026 03:03:47 -0700 (PDT) X-Received: by 2002:aa7:88c8:0:b0:847:9015:e68c with SMTP id d2e1a72fcca58-851d3953ac9mr17929843b3a.17.1787220227125; Thu, 20 Aug 2026 03:03:47 -0700 (PDT) Received: from [10.133.33.222] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-851d33627ddsm1488181b3a.10.2026.08.20.03.03.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Aug 2026 03:03:46 -0700 (PDT) Message-ID: Date: Thu, 20 Aug 2026 18:03:41 +0800 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 2/5] cpufreq: loongson3: Adjust the width of id and val in smc_message To: Huacai Chen , "Rafael J . Wysocki" , Viresh Kumar , Huacai Chen Cc: loongarch@lists.linux.dev, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Xuerui Wang , Jiaxun Yang , stable@vger.kernel.org, Hongliang Wang , zhongqiu.han@oss.qualcomm.com References: <20260818123921.3600606-1-chenhuacai@loongson.cn> <20260818123921.3600606-3-chenhuacai@loongson.cn> Content-Language: en-US From: Zhongqiu Han In-Reply-To: <20260818123921.3600606-3-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: dxfdLRO-qWGMfSOYj2-YpIBT31qZCCNM X-Authority-Analysis: v=2.4 cv=VZ3H+lp9 c=1 sm=1 tr=0 ts=6a86d104 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=2sVyCrUYgtLBleu_eicA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIwMDA3NCBTYWx0ZWRfX/sSOoxrje+kk BcjZbeIIvpvKwLv3CP9JJ1gbQxUyRCtpYDKexKus77entX/O+jMFHQLphDraA4yucRgAwPRawny b5jRugUe/Nnx5UVbJqF4nti40FXhOAK0S27sbTU5Ipv8H99Z0XCJVaQYbxDaI3aVk8HQmxgz63E x+C1PyEDrrOHAJWmgm6yyznu1oVOH7V8BrRZo+a8zM/dR/5qYvGRK6v+q9v5CpqgUvYuxYmU6sH +3wMkY0J+b8lHUSEcpHj+AeOJgzPKtulievWtM+MhApMTCJryla3bIpVqVzXWOJlUhlNmb1Awh2 43XeMQrJwDHZYm4nD/VVQ8WyrAQrqYp+ck7SlLzI/DTcRiHkt/uf4IRf1jrpY89/MW/bzuoJ632 ZBto/L7Te61yaiKCQqJeHB3QSMeXR8Dc1L2Ws+0JxaePwJCx0AJDYL1kM11NUlM6jo5cl9IoEHM R7p3sRn6SoOuqPIGJDg== X-Proofpoint-ORIG-GUID: dxfdLRO-qWGMfSOYj2-YpIBT31qZCCNM X-Proofpoint-Spam-Info: AW1haW4tMjYwODIwMDA3NCBTYWx0ZWRfXy1Hf1YIXbfoN etJa7Sk+YZ2bDVJMhfhnVoJNPiE1Mutr60h3iKDKl7NU8t7uol3YyJFYnslrw2ciR9I8SLFWE8/ OQMur+7/39ZZZW3KprlNoFkgfdp2wV4= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_06,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608200074 Hi Huacai, Please feel free to comment on the question below, or simply ignore it if you do not think it is worth addressing from an architectural perspective. On 8/18/2026 8:39 PM, Huacai Chen wrote: > The id field of smc_message is usually stand for the CPU ID. In the past > this driver was only tested for desktop and laptop productions so 4-bits > are enough. But now we have servers that can have as many as 256 cores, > so we need 8-bits CPU ID. > > On the other hand, the val field is usually stand for CPU frequency so > 12-bits are enough to represent 4GHz, and for higher frequencies there > is an extra bit to extend (enough for 8GHz). The extra bit appears to be unused in the current implementation. Perhaps it would be better to enforce the limit explicitly for id and val bits, for example by using FIELD_MAX(). > > In theory, this is a incompatible change, but fortunately the old SMC > firmwares are not widely shipped and can be updated on the air, thus we > can safely adjust the widths. Not sure if using CMD_GET_VERSION check can avoid such incompatible issue? > > Cc: stable@vger.kernel.org > Signed-off-by: Hongliang Wang > Signed-off-by: Huacai Chen > --- > drivers/cpufreq/loongson3_cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/loongson3_cpufreq.c b/drivers/cpufreq/loongson3_cpufreq.c > index 1e8715ea1b77..630f679aa739 100644 > --- a/drivers/cpufreq/loongson3_cpufreq.c > +++ b/drivers/cpufreq/loongson3_cpufreq.c > @@ -21,9 +21,9 @@ > union smc_message { > u32 value; > struct { > - u32 id : 4; > + u32 id : 8; > u32 info : 4; > - u32 val : 16; > + u32 val : 12; > u32 cmd : 6; > u32 extra : 1; > u32 complete : 1; -- Thx and BRs, Zhongqiu Han