Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1483418ybj; Fri, 8 May 2020 02:20:19 -0700 (PDT) X-Google-Smtp-Source: APiQypIVGz31rVxDoHtoWpWNCPrExYcemsjo3rvfCeTN+KodhJgp7a3OJAOjP2snJ6Sf+byBfU3A X-Received: by 2002:a17:906:c06:: with SMTP id s6mr1048710ejf.198.1588929619710; Fri, 08 May 2020 02:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588929619; cv=none; d=google.com; s=arc-20160816; b=Wwe2Gn86+W1iZDcOMjtxna0JhXijF/6XCpJInae4YMkU13knR6K9ydULvgn8qyckN6 pi3hNtma2zyXr3OpXrk40wuEzopkF+15RkzBQpp9FkAtPft1B9eHMqI3D7ZMFqmk6MS3 SaH1Vz3DqyStgwAkL79OptpOEvSwEaLM222nIM29/1WDh7KLTwJCrxEHyb8SMjDOnJFA FkT1d/uS4e7d2pL+V2lkSFPhICU1pkFw5nP1PiNZobDxUWpBrzES8aVmzuaKI1rZgPDr s3eH/A9dZW0blfUVUFl0Nvxw0ZxsFAZ+/T9/DHRo6UWcykbwyOQUezHbjusV/GUPOAZL Y7ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=yX/QmSO3nR56n0bcjrsnIXwVXvX64fw1DCFRN5NQ9l4=; b=xwEJOCZY56+o97D5cOcTV1Hr7EOgi+Cv6ndDPmT7gEWE0Ytq3UZNKv1NBulBsUEotz 1PYW2+xScRnbMLOB9HW/qSH4EBtqfYNBLsuLSHkBeKPR2AvU0zDgtSmhwjtGtWpPH3Ef kMhL9LxlpRTtEhbxOEPBy0ySAYR8YKPROI4rDZCj8ear0sWQmUGI6rfF8YA6YejygT4d SRONOqb3LUNWypM/gOvw2VNf8eu2FZ3gmvitDnU7r4zemULhNsW9vSAB+t9AtBlO6K5M UgR6ph6ySSaD/1owCWDp2K2gfTK6bo/Fi3Twz2yD39fkVVjmC9n6g0ui1RWoe1pojbi7 nlHg== 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 ss10si630109ejb.103.2020.05.08.02.19.52; Fri, 08 May 2020 02:20:19 -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 S1726712AbgEHJR3 (ORCPT + 99 others); Fri, 8 May 2020 05:17:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4298 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725710AbgEHJR3 (ORCPT ); Fri, 8 May 2020 05:17:29 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B24ECF3F380C0B35799A; Fri, 8 May 2020 17:17:26 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 8 May 2020 17:17:18 +0800 From: Xiongfeng Wang To: , , , CC: , , , , , , Subject: [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()' Date: Fri, 8 May 2020 17:11:02 +0800 Message-ID: <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1588929064-30270-1-git-send-email-wangxiongfeng2@huawei.com> References: <1588929064-30270-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.7.12.4