Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp167977ybk; Thu, 14 May 2020 19:59:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFN06uhdyAZb9At4p+9VrKm7cfRGTqnkvFa05NOWsKiyYiGTduPaKQ2KgxiAJ+7PvDwlXV X-Received: by 2002:aa7:d0d9:: with SMTP id u25mr855512edo.377.1589511589364; Thu, 14 May 2020 19:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589511589; cv=none; d=google.com; s=arc-20160816; b=PUlNWZbvGkZecuDfRXuEUZPZZs2Y0xyCAASwmkRxVApyIcm4PIbZfsLRT7uSrPW4Rt hG84df888qulWxWqkQhvFsmXN0TNpyr5pw/tkhjMY5BAe9IdzkzRwJRKGubkGsdaQKRo BV0MTnhkeiD0AzW4w/5RGpSjFc98LJwToks6H8kro4l5f1mjq3CM+HTyK0uT7ECmR+NB LHyZszH80jyYpBdY5ZJawGRIdAoff5eD8dWaKnZez5z7YXBWq9tqc5Bg0aEElqAO5R6n Z3awgMzy2Bx8ZQZaCSKzToO33BS9EDzTi66Klj5mMsrZvNgsF8a5EWnSyVCUSJGWySC7 7TOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=lyyq+NGScUdE8E33TPezq+Ky7WIMQa84HmoNAQoGMGM=; b=xMyE6WHpcZiqO1z2urRhumIaGIpjQIsAkCi5HPogfbAe0dDDtQGJL2p36xy+iCgAYE SQqa6rP3j2jC7C8Q8KlKUj5MQFN+tZqe0hQLEU+xU/6yBycypw5AWq+iEMhaAEE5cE20 sWSI2Cp0JMp/f7pJhTvnE5WV5W8onqtOh95KLaPjNAQd/U2rnOHJYMH1/ljXdv5QD2Y4 sXMyI+irHDt8qZLa6tsfi9efbZfwJ15htJLv+lfxwRrD/jsAOgj6xkykTKgEGYjL/QWQ tNnqBCA/fwYLnLHjzKo7q1VmmOje05yMVD71zlt6w2cRhjQk7zMv7wPe/UPpnn7iEtLv hPZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si467689ejr.100.2020.05.14.19.59.23; Thu, 14 May 2020 19:59:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbgEOB2g (ORCPT + 99 others); Thu, 14 May 2020 21:28:36 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4842 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726112AbgEOB2g (ORCPT ); Thu, 14 May 2020 21:28:36 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0515F29578E8C6EBAE43; Fri, 15 May 2020 09:28:33 +0800 (CST) Received: from [127.0.0.1] (10.166.215.101) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 15 May 2020 09:28:23 +0800 Subject: Re: [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()' To: "Rafael J. Wysocki" CC: , , , , , , , , References: <1588929064-30270-1-git-send-email-wangxiongfeng2@huawei.com> <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com> <28914151.3vfbF0e6KZ@kreacher> From: Xiongfeng Wang Message-ID: <881629ba-17fb-114c-858f-43b62e32b421@huawei.com> Date: Fri, 15 May 2020 09:28:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <28914151.3vfbF0e6KZ@kreacher> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.166.215.101] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, Thanks for your reply ! On 2020/5/14 21:54, Rafael J. Wysocki wrote: > On Friday, May 8, 2020 11:11:02 AM CEST Xiongfeng Wang wrote: >> When I try to add SW BOOST support for CPPC, I got the following error: >> cpufreq: cpufreq_boost_trigger_state: Cannot enable BOOST >> cpufreq: store_boost: Cannot enable BOOST! >> >> It is because return value 1 of 'freq_qos_update_request()' means the >> effective constraint value has changed, not a error code on failures. >> But for 'cpufreq_driver.set_boost()', a nonzero return value means >> failure. So change 'ret' to zero when 'freq_qos_update_request()' >> returns a positive value. >> >> Signed-off-by: Xiongfeng Wang >> --- >> drivers/cpufreq/cpufreq.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c >> index 4adac3a..475fb1b 100644 >> --- a/drivers/cpufreq/cpufreq.c >> +++ b/drivers/cpufreq/cpufreq.c >> @@ -2522,6 +2522,8 @@ static int cpufreq_boost_set_sw(int state) >> ret = freq_qos_update_request(policy->max_freq_req, policy->max); >> if (ret < 0) >> break; >> + else >> + ret = 0; >> } >> >> return ret; >> > > I would change cpufreq_boost_trigger_state() to take the 1 into account properly > instead. Thanks for your suggestion. I will change it in the next version. Thanks, Xiongfeng > > Thanks! > > > > > . >