Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp128530lqo; Wed, 27 Mar 2024 08:39:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbxOiCd9aBtGGcDGe6cg3xlp2BWGHqiciddXYoknrZ3n5h0kYyOWDJS9UafnnSvgvGlhTSP0HQypBqIQbpAaB30EqcAt6qdgwyCMEspQ== X-Google-Smtp-Source: AGHT+IHZDLginITzzvaAcn8bxhjO78G0i5AYoECm4B1P8xe/OJfhrcvNlr8mSr/JpVoV10bs7mi+ X-Received: by 2002:a05:622a:1650:b0:431:9bea:82ab with SMTP id y16-20020a05622a165000b004319bea82abmr25957qtj.35.1711553966546; Wed, 27 Mar 2024 08:39:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711553966; cv=pass; d=google.com; s=arc-20160816; b=whj54la6834835ylNg1Ct1UN0wtISjgUuqJkyNUeca0GfATxz9p0j0hHzEWGF8E0JL +pZXtBqEkHhPE/zo4q50d7dv173K+oYGE8CKEfReWernwrGHr5vUNNLyTsE7YjtvVyhD X7sndUqljgQ74ssn+vQ5e81jyCfvbKPsUeVnMFLXtN3gKKM9hiIqZazcqIfdmEkrQdBK koD5UbWZbfAHKa7DUJk22DZi++kQDPDr6HC+WRz4laPCXm4+c2otdQ/gNYQxo5LbiVIH 35M5BdUDShyVxd8Vtdod7a0JCihzmC5x/5Xsk7o2iJdLwREgpafkQ7+Fml2JNrriud8y d9hA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LZk3N+J49NfQ5D2xahTu5V4obfusSdpr3N9X1nJ3ujg=; fh=o2A4Leov3uBg/nTGYPGk3lUgU+n8J8j1/v6qtdYdLcs=; b=FqmdW6yIeho0szTtD3p379rrfAifhnP2Q0EHWN1Q7s2+VxmJDWOX/JNebMxI5WVufQ O5xFUZMs5nLwU0W9XUFXvCjZ9W85D81+Z8er4BFwK48fLtEzUasmSbZRwg5khyg4ntlV sBTznVmXbFPC/VtfO7wa5LvFs5GwJdcEQW0wF+a09VdVeHpZLUG0+Y75u8xh0Pz46tUF 1pPPDNOOO97Hi6fOFFefmp9wzesQyBVWkAYxVQnAdWmkWTT6GD3UVlvnhO12XOkqhxem xcNQWuhlldPHst8yAdy9S1S4d/WwIouDfrlfdlQWh2OqrrztXXneffymPropJQiHnveb snbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nl/zDVix"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i17-20020ac85e51000000b0043183c053a0si551832qtx.322.2024.03.27.08.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nl/zDVix"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121536-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A3441C30C61 for ; Wed, 27 Mar 2024 15:39:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 625B31311B3; Wed, 27 Mar 2024 15:29:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nl/zDVix" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 888EF1311A4; Wed, 27 Mar 2024 15:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553363; cv=none; b=Mvt6oZCVn0RVYSPS6+H4sSNHej5Ow7QNKpRmB4DC0jEPlKXvqe0dwEezKAXOgSCy4LjKpQ0Wg4vJGLvw9agd1mgyq3L1vvS6mGFqsrjuqhdWgJRRQjawUMg3+HBaxg+ojmL69ibD5MuepPE2OvWzfH5S3G6EB7PVToLwhVvr06s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553363; c=relaxed/simple; bh=J0FtqkoqtSoPeUA98W8fjiXSUWfIrwK4RE1QO+34rPs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WE6dblQLRQZewlJAOulu1O7BvLcKrge2drzLrdJfeyuIJjyI3WA+RcxuPRi3Q/YjnNRCUnKjg48YxBJ4o5VQ6Wrq4876irovcx2b1fyzXAHPJRri+rS85FSx9a2h9UjItTDBLvplzPaZWB+B3IBDWIEFWB22ARM4Vl5Ul4BP9e0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nl/zDVix; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C417C43390; Wed, 27 Mar 2024 15:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711553363; bh=J0FtqkoqtSoPeUA98W8fjiXSUWfIrwK4RE1QO+34rPs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nl/zDVixGrTLeyXsUz126UKXQtIBJpjLSBMiXPt2B6wuqWjtineWSmEc+c8gI7SwW dDQ2toiEL3xzGoDbc1meDoU5Ii3vR5L9laK9tNQLl/7fiLjfUCNeYpxoUUSDyW4Sbf hMsMI8ih7So4x2i9bFEMv3Yi3JHwDl2Gf7Fg3btifFMr3m3s2CEBtlWpXnbQMOoVjy KvqhTUAyMvbdfozYJ75BF+KEtlkO8Z3+xjkNZCtCgFX6FBgY0i8seR15NhhXpET/cX cx1x1oAPhlcOUKPxjhoXCLGPQd7pDcUzsMrAs+8cN4bIRV/1MLXOQwNxA8FMOG/jZR lB5cvwCsBNAsQ== Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-22a10ce0e0bso48942fac.1; Wed, 27 Mar 2024 08:29:23 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCW/dpFMLGBtopZtPk5FtPQMWyXLk3bSV88B/84fLDJkQChxEpOJwX9ABPBVDhWq8qFrzzPx5oR7hm3PDq/edTq2SfiQA5JSvgvFrYW6p9WoVcYa1R0hrsc2wsOXZ6UxDVGAXB8+j5k= X-Gm-Message-State: AOJu0Yy5y0vlKpmEh7O29YYGqcV6S98js9Hx4LM7R3CumdE7FwrMrzO6 wErK3eiv64ASIxYyEgoP9z0PT5dUfJWpHBXUmvhYE62dBZphwvwYYCEsQafAFiW4T3W9XCPwNxR pwiv3XLjuS9hPVgy6asgwSbs0XAA= X-Received: by 2002:a05:6870:17a2:b0:22a:1e39:8be4 with SMTP id r34-20020a05687017a200b0022a1e398be4mr11684284oae.2.1711553362025; Wed, 27 Mar 2024 08:29:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240321102100.2401340-1-ye.zhang@rock-chips.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 27 Mar 2024 16:29:11 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] thermal: devfreq_cooling: Fix perf state when calculate dfc res_util To: Lukasz Luba , Ye Zhang Cc: tao.huang@rock-chips.com, heiko@sntech.de, daniel.lezcano@linaro.org, finley.xiao@rock-chips.com, linux-rockchip@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rui.zhang@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 22, 2024 at 9:50=E2=80=AFAM Lukasz Luba w= rote: > > > > On 3/21/24 10:21, Ye Zhang wrote: > > The issue occurs when the devfreq cooling device uses the EM power mode= l > > and the get_real_power() callback is provided by the driver. > > > > The EM power table is sorted ascending=EF=BC=8Ccan't index the table by= cooling > > device state=EF=BC=8Cso convert cooling state to performance state by > > dfc->max_state - dfc->capped_state. > > > > Fixes: 615510fe13bd ("thermal: devfreq_cooling: remove old power model = and use EM") > > Cc: 5.11+ # 5.11+ > > Signed-off-by: Ye Zhang > > --- > > v1 -> v2: > > - Update the commit message. > > > > drivers/thermal/devfreq_cooling.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfre= q_cooling.c > > index 50dec24e967a..8fd7cf1932cd 100644 > > --- a/drivers/thermal/devfreq_cooling.c > > +++ b/drivers/thermal/devfreq_cooling.c > > @@ -214,7 +214,7 @@ static int devfreq_cooling_get_requested_power(stru= ct thermal_cooling_device *cd > > > > res =3D dfc->power_ops->get_real_power(df, power, freq, v= oltage); > > if (!res) { > > - state =3D dfc->capped_state; > > + state =3D dfc->max_state - dfc->capped_state; > > > > /* Convert EM power into milli-Watts first */ > > rcu_read_lock(); > > Thanks, LGTM > > Reviewed-by: Lukasz Luba Applied as 6.9-rc material, thanks!