Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp27860ybj; Wed, 6 May 2020 10:47:01 -0700 (PDT) X-Google-Smtp-Source: APiQypIS+u8DRU8I+hM+0145gdwNrznmW6nrD7Ss9+g8k9/KLngkzLsNf3pvIZYcgnULS3dMHyyw X-Received: by 2002:aa7:d514:: with SMTP id y20mr8280819edq.28.1588787220842; Wed, 06 May 2020 10:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588787220; cv=none; d=google.com; s=arc-20160816; b=Q8vihjgC5LjXmmTY4GB/7/H7V3gLWuu9NiNsUtsaDPP1xz6kwv+kIn9REnrT1ydwgp 1xmW6nERmhDrrw9RwnnbExUCPBmuAVBckR9SHg6QqQuL+l7T6G4YDj2XjCARE10AqDNI Mn0cdoqDJ0uTvE55sNgLmxciLDsfzvUSZFQ2DUbP39Z9DUrBP8AOTOToMcKS6lUDQtDd Un8iWfqdY/2erzJoIU0RApntgvexFDuA226vMORT+baPlZ0j52tB9FHz7mFQkV49FFIt 1B6AG/GF0qsDNJh+E7tBgJ8BGSCmlpwo8FsW9hgn4ikAQAsDGHsHRDgOC5gHc1Hfz7DP 68Ag== 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=tghyR3IfvtP/So44b3x8zBeHl8PqC40iea7v9NfQbko=; b=YQHs0Bx+ADyNBgPxoIMzV+aIHKfqMGdJCNjL6evb6NK+ykj4qhVBzUZuv34ilqfM7i q/8WO5gHtN7QxZ7yGvykBqUzylx/7o6pTpTA2MJ5+K26JQ1HR9P3aRQkVTWeg9fVS3+u bnJdUR2ddvWdJ5ntOsykIEwnAp0ksclfe8s4JAOQkqwyH4Dhjf8g/6/30JdcmKbIyRPP Q1P17VnUB8wFcnxzMrFs2AtueUSzQGYDVU+c7zSzmKzoSQmhK7AGJuATTHksUnZhnqsz UXl7kUEzUeIjXxQPhO2ltIEBIjG9+RF4ptQIbk26vD+rWKf9Yjv9B+emZ6kct2Sc8229 rqiw== 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 lc1si1577507ejb.198.2020.05.06.10.46.37; Wed, 06 May 2020 10:47:00 -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 S1730450AbgEFRoh (ORCPT + 99 others); Wed, 6 May 2020 13:44:37 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:32938 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730377AbgEFRod (ORCPT ); Wed, 6 May 2020 13:44:33 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id D1D928000CF8; Wed, 6 May 2020 17:44:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dpFA3fEHy6Gk; Wed, 6 May 2020 20:44:29 +0300 (MSK) From: To: Thomas Bogendoerfer , "Rafael J. Wysocki" , Viresh Kumar , Ulf Hansson , Matthias Kaehlcke CC: Serge Semin , Serge Semin , Alexey Malahov , Paul Burton , Ralf Baechle , Arnd Bergmann , Rob Herring , , , , "Rafael J. Wysocki" , Frederic Weisbecker , Ingo Molnar , Yue Hu , , Subject: [PATCH v2 20/20] cpufreq: Return zero on success in boost sw setting Date: Wed, 6 May 2020 20:42:38 +0300 Message-ID: <20200506174238.15385-21-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Serge Semin Recent commit e61a41256edf ("cpufreq: dev_pm_qos_update_request() can return 1 on success") fixed a problem when active policies traverse was falsely stopped due to invalidly treating the non-zero return value from freq_qos_update_request() method as an error. Yes, that function can return positive values if the requested update actually took place. The current problem is that the returned value is then passed to the return cell of the cpufreq_boost_set_sw() (set_boost callback) method. This value is then also analyzed for being non-zero, which is also treated as having an error. As a result during the boost activation we'll get an error returned while having the QOS frequency update successfully performed. Fix this by returning a negative value from the cpufreq_boost_set_sw() if actual error was encountered and zero otherwise treating any positive values as the successful operations completion. Fixes: 18c49926c4bf ("cpufreq: Add QoS requests for userspace constraints") Signed-off-by: Serge Semin Acked-by: Viresh Kumar Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: stable@vger.kernel.org --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 045f9fe157ce..5870cdca88cf 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2554,7 +2554,7 @@ static int cpufreq_boost_set_sw(int state) break; } - return ret; + return ret < 0 ? ret : 0; } int cpufreq_boost_trigger_state(int state) -- 2.25.1