Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1350409ybk; Thu, 14 May 2020 06:57:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwHX3NYpzNoQ62hgpNyNf4eI4QuY4Y59UsqK2mBgl1gieGUbo7Pa6LFHI2Ct+/dEApRawE X-Received: by 2002:a17:906:f108:: with SMTP id gv8mr2582062ejb.91.1589464623093; Thu, 14 May 2020 06:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589464623; cv=none; d=google.com; s=arc-20160816; b=CHCmI5lWGeRYvBVKyl8wh/Ob6Gvxnc3nXn6nzAwYK7olZmz3JU0vuDnSmumTFGAX5h CgTBBONCsowkxN9Gnl2WMCBejUsGoJCXU6HFS8eNdjPM7CrvuA+SPuUy1/+Y6OrLO20f lHHljaPjD1W7BaqnjWrb/EdBsguNIu1eZjuBwcJnNmM2VIHrLCvLhKo2zRYjnTh4Afno uNhu6PJOLzuFDVVXMb88QTfR/a85YHEqTx+JN+yRRzB9hIkmDxj5AnmgJ8zvVsczQu79 50VxvK7PFVEkUKZBJM6iunsNUs1puRX8JR6oB9+IV8AgOZyupBYgYI2Ua1ndak1ykrVV vCYQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=w+t1u2jTQw/BayLUjaQkQX1UKQHr9qeO4w6XEFNrVSQ=; b=fsncOE3YkMGfyNlxq4lVwIUAoIKl6yearMKWLGbnevZ+X2bB5w6am+0gpzbmTufBFJ xRo+xkeqBhpqUvxGuh6wZjlSMAx4QagxLhsfQtnGEjwiAa9C/FYW23K8btIu1eC+c7B5 IlVBZimt4SOVp1pNPj2FCLrTioCfIayvqIBG6Zuf6iHlsMnDP19GiD6csPSx1Tl5ZqTL CJ2Cs/lx63RB6DkBfAC+wgiLUSCjaBJYvEVXGCeWdwajBKQOC5mBzjKV6DtP3iEPTpio NqeaxSXDY53+AnlgaKsuVRxyCVUWXkDLVMZLl6RFWm4kcFqEvITay0ZqFkKChi7tjSFE kzgA== 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 q3si1846963ejc.214.2020.05.14.06.56.39; Thu, 14 May 2020 06:57:03 -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 S1726667AbgENNyv (ORCPT + 99 others); Thu, 14 May 2020 09:54:51 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:56442 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgENNyv (ORCPT ); Thu, 14 May 2020 09:54:51 -0400 Received: from 89-64-84-17.dynamic.chello.pl (89.64.84.17) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id d4c883bd97bc7369; Thu, 14 May 2020 15:54:48 +0200 From: "Rafael J. Wysocki" To: Xiongfeng Wang Cc: viresh.kumar@linaro.org, Souvik.Chakravarty@arm.com, Thanu.Rangarajan@arm.com, Sudeep.Holla@arm.com, guohanjun@huawei.com, john.garry@huawei.com, jonathan.cameron@huawei.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()' Date: Thu, 14 May 2020 15:54:47 +0200 Message-ID: <28914151.3vfbF0e6KZ@kreacher> In-Reply-To: <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com> References: <1588929064-30270-1-git-send-email-wangxiongfeng2@huawei.com> <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!