Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2287566lqo; Mon, 20 May 2024 00:25:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV176fYNZdB/J7iESXJVzZo9oLzoLqzkD7m8xUvNr3VuzCYJv3TW/V6AAbiSYs8+CjGi3lHsm3hmawKA12SKYTiqNfjCr/0v4jlfMvttQ== X-Google-Smtp-Source: AGHT+IGGGNkMQEEU0Xn4uoPII5Kw7HwHFICzNbaI8gdLt6oKBUWQKQFVa/B9lT1dBtio3Zrk9esa X-Received: by 2002:a05:6a20:431a:b0:1a7:7505:ac97 with SMTP id adf61e73a8af0-1afde0a98a3mr35656236637.11.1716189932374; Mon, 20 May 2024 00:25:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716189932; cv=pass; d=google.com; s=arc-20160816; b=gHQDkfaKUyHhpXrkN/+33It4GAp49FaXPYzH5q8zkB62mBONpC33tBG+6qkNMZj6Dm RNTbS4Tct/OUgPpwgl5OvSncX2XZUq/4D644wBMgd7QCeymjd1IIN1+cx/F/oumYT3F8 +8XP4P1JNl0MUOFlalEFix1ADbZqdMsd+MfDOQz/StNrt1eNj2d1MPRjB+ma8JaOhxXg Xwg14a4KKdTreILh1mXm1ycpZhhsnpbcDnJJ12MstaH59pWH6gVBMZdR6ciErRrGJbUb G9/rzmt4tQO1bHwoXns3HhWwvep41mnjUkK8jJzZlwU0mGfnLVyUmv6NxyRlc+Bq/Dqs feVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SFdmcNpzRo2oo+yppr3+cUzOw6aLmc7VZ0+XNX0Zb1s=; fh=jZlzLc2Gw3r7e59eKPQNz0iYFKF/1RLVo55e+UGpQTA=; b=Cg40PytfufwoWdW/fb9bkjLr77dGjiwHwj0xHK5yglF88np5v83ldcv3r56V34KEWV /tghwVlrbyT+e6PwdnVgHrzmCmZubWYS6u22m8o2ealRalIPfKX2pFpyJApe84PNWbHZ M0JmAwNSnvgrPxeP4Usg5XO5/Y9Ukn3PGZV+bMw719QM8vfhDfT2nzq6d+UzVQ60yARE Ur5uFRiyYRl9tMb3QpwNKUNk1+N3YmeY+SQyqNPLGr5wHhKxnZPTJ9n/TWwvxtw7HVPR hNA+2Tz/boz/GrMEssanVbFge8xWQKBwCA+17u3j70wsS7rioRgAtbxmyEb83wYFV7a0 HmhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="r/ihDRJb"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183454-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2ba141eab71si3389379a91.61.2024.05.20.00.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="r/ihDRJb"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183454-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183454-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B76C0B215F1 for ; Mon, 20 May 2024 07:25:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 923BA1B7E9; Mon, 20 May 2024 07:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r/ihDRJb" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 6A3E41862F for ; Mon, 20 May 2024 07:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716189918; cv=none; b=NQWh0b9kWIqneS6mj9/grg9GSBNmwwMjsviHl5MIfG++rzHRN8tImhQLU6mooRlT9AaJIY2TPc1tmfNYqNZDLnwXOsUiH9GXIECXMaYjCYe7czRTXv4YtJRq9XBiO2gFRj8e7kbiZjMjvXVaYOv9YqEkqW+AtfJ+KBQsfoTUG2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716189918; c=relaxed/simple; bh=+fObv7pYjpDl9fdzZP147nI7QMSBzyYiYdYAVlbJC1E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kQDchYvRBl6htyKk6X31/atEqo+TN82heNGcyLSkms+UVCSIqzkQsjvYFkMsr60dkgFdI/UVglgkwUNbzz6Qf7baZ/8gPAXEBDzw6PX/oBejVHx53eh4omITLeEh4XnNTrfkH+1+b0j6kDcSbCjuFFgznKUN7SWK10CGJAa5UnE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=r/ihDRJb; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1ed0abbf706so62998835ad.2 for ; Mon, 20 May 2024 00:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716189916; x=1716794716; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SFdmcNpzRo2oo+yppr3+cUzOw6aLmc7VZ0+XNX0Zb1s=; b=r/ihDRJb0Z/gUar1t1tPHTiw949RFqYvJzblzQYOmyylS8U7OEAqeE30oIX7Ndg5oa ONWauew3GMAoeHKak8/xOvzaFRhjOD/MgGd/4RZT/X/JKKOuqhkX10Wzb1dBovFYDyMZ JRNt2PSpI3smbheIKWqCg6PIHEbMtM2t+HBPE2NyOp88JW6h552pMBawdggbo2U88Dv7 8nx+iEbAUyNHpX5VJ7b1NKqcyl5uwupsidBJhSUeTO5KO4G0/fvTXsNN3mXJ9ogyGzLQ q1JzNTHDrhsV1w5vanWh2MMlNQoxVe2TRWu+FXcfUIgVdfH8Cp9MdMfYCMBhNWv5+hKb 27PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716189916; x=1716794716; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SFdmcNpzRo2oo+yppr3+cUzOw6aLmc7VZ0+XNX0Zb1s=; b=MiB+tCrsxGS7CD5uo1reNhEYkqxfetNXiJ9IPARJDwr7CnI+PI9w7b78qV7CUozW+r fs9+lBmUjImjJkubVXSve7L3MTrpWXdfQ7V5SMgNOzTPowDdECgmQCpfDYRlgZblqV9g S2kyN8xg4unrY67pIvcnHCvuYkB+0Qu8HzWVCJz6kLoFN29TvhcgLYCL5ZOGKxS869GV rK1yKfcv7tVbcQt5tGBP1BAsYNEWOiGMEDo4DtLILGnm6gELpyso5xnCABtYZPqC8VuF GcDjqRisgvBL4luOyIdB/XdzcStMDa9eKUcicK1sThMMz+hFvmvHNdzx13JMW8Cxe9DQ iR/w== X-Forwarded-Encrypted: i=1; AJvYcCWN7X4P19ZL8UHrN9F3I8LTHydsysoPZ98h+0qC3HYzIQKLqvpfXdvLcj+kDsuJyy8qvdXRw5SnV8pz/RH25YekhmbGYiTo4tJ4Ppkx X-Gm-Message-State: AOJu0YzrPYrr2L17jzJUIa+tLpqLjeaXbgnVFYJJfao17fjJSWSS7jmN GX5HOizmJ98IYdjG+atgBtVaFX/90thFO4o72s74+tR4A9JGHPqnr/OB42ozjLQ= X-Received: by 2002:a17:902:c942:b0:1f2:f3dc:43ee with SMTP id d9443c01a7336-1f2f3dc4ddbmr56186065ad.3.1716189916472; Mon, 20 May 2024 00:25:16 -0700 (PDT) Received: from localhost ([122.172.82.13]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0b9d385esm201022905ad.38.2024.05.20.00.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:25:15 -0700 (PDT) Date: Mon, 20 May 2024 12:55:13 +0530 From: Viresh Kumar To: liwei Cc: rafael@kernel.org, lenb@kernel.org, Pierre.Gondois@arm.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, liwei391@huawei.com Subject: Re: [PATCH v2] cpufreq/cppc: fix perf_to_khz/khz_to_perf conversion exception Message-ID: <20240520072513.vtlqwjbmxugvuppj@vireshk-i7> References: <20240506075816.1325303-1-liwei728@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240506075816.1325303-1-liwei728@huawei.com> On 06-05-24, 15:58, liwei wrote: > When the nominal_freq recorded by the kernel is equal to the lowest_freq, > and the frequency adjustment operation is triggered externally, there is > a logic error in cppc_perf_to_khz()/cppc_khz_to_perf(), resulting in perf > and khz conversion errors. > > Fix this by adding the branch processing logic when nominal_freq is equal > to lowest_freq. > > Fixes: ec1c7ad47664 ("cpufreq: CPPC: Fix performance/frequency conversion") > Signed-off-by: liwei > --- > v2: > - Fix similar issue in cppc_khz_to_perf() > > drivers/acpi/cppc_acpi.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) Acked-by: Viresh Kumar -- viresh