Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2516393ybk; Mon, 18 May 2020 00:43:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypZGIsgCPXg5Hkv73COWGCOO8j3TmBLhY31X/gEgn/3mbQyINVHGF4h93jnz14qfBeyoNb X-Received: by 2002:a50:d553:: with SMTP id f19mr5492357edj.219.1589787814235; Mon, 18 May 2020 00:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589787814; cv=none; d=google.com; s=arc-20160816; b=b6MnG48mFWGkIVE+ehY3pF3hfdZbRADlcxoQhVybXGHJBYHzJxO8eXSmJq9zOROiJY yWIYwGKDIatJC0rUr1nJEqREX7VAdoeMzAtjgakpRzaCWNzEJMmPJAaCuO+Lxbum48n9 0MqF7Bu8AGIpAA9/WM7f3cAaz7Nx+4YgyzeMg3Q+mfIeBqKnsRu10KFpQfCEPhbSfSZ4 HFnOwmtVU147Bsey/7sDkYvPi0Gq4WfbBtI9PxzW4MIb5xIWeLLNBtkkgxVcpFNHkO5Q D3uJPHoUJqZxwOdf3ZiXqq13sNfriUTVUdv8v16ufRwz/uehmVXA/3Ap2y1R8U8zC7Zs nvzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vl/yNZjcMD1c/8w4IMtaECL/pvXnUWzfoZmc+ar026A=; b=zaRsHPRh3ph7FdCPnAdI5N/fdW2D7qRj0PD4BPU2W04mhcVDo0xk2dgSFbnvqJFLHP LJJEspVwVjgGNHe/c5fxl9WF4wsZuFWl/LHUPFPwUuxo1PyvnI5Nrc0n0l+asevrfYqu Yd5h0LGhPuXAG2slsz+bZ0kJYTtkKK+VdYy7cRZqoR024eFG8ERV73T+rDkYs7RP/E1h KfmA/LG5qV7PbIUV4+3peNQ/7kYjKc4tCZg3O/2KM6NckI/OFophMDfJ+yVuwUmUPljW 2PAceVpWqtWUWGAT/0N92vuPXzgYbzZZ3Z6VY2W1R3nW+af3ceNxhJ84kS2H6bi18Tv7 4+aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TmBG6giW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si6012158ejg.33.2020.05.18.00.43.10; Mon, 18 May 2020 00:43:34 -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; dkim=pass header.i=@linaro.org header.s=google header.b=TmBG6giW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbgERHlr (ORCPT + 99 others); Mon, 18 May 2020 03:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbgERHlr (ORCPT ); Mon, 18 May 2020 03:41:47 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE6A8C05BD0A for ; Mon, 18 May 2020 00:41:45 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id n15so1338576pfd.0 for ; Mon, 18 May 2020 00:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vl/yNZjcMD1c/8w4IMtaECL/pvXnUWzfoZmc+ar026A=; b=TmBG6giWbwVIC9tUDSKwKQOc4eTIGJj/0THBrYvUXtbMCfasbOJRefuXD05s/PdWbG vcdMKoExWaqNYfmgWV50I9uKpVjT42WbvR4GsvbfEZTXY5nklrevHHtWcgls9BoAbaj3 S2YXt5PljMFoycc63XMFNy1sYf4C4nNR1YYvllTLMQU8L5JMqUhApGllKocQU5ia74Ct fx5k+HIRPX5cvfeAQ0x2tnZhQF1Hyly1PCjR/CydVJMBKsKKWpMiIw9KaWzbNpXVzcAs 0bVI27oGcFakKTl26QXyJKfFsBy0yK8FwdKsrf0g3e4Dji9QGEQ/KGIKK7D+hFlBnubC 8aZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vl/yNZjcMD1c/8w4IMtaECL/pvXnUWzfoZmc+ar026A=; b=AVGFGMHKpVD8iM9XqZOcDlO7Wc8/T9uZhEwdwQW5py1u1hKwwjmRUVXrLH5IYHiJ0u qzS8zAVL3b+NzGeMujuCqOioRjHGcSEZV9IC62eSRpOnYiAmk2J5hpvk7E5/GQ8LZ3Gl RGVhSJ1G3PIfKS2Hu71zfBoXr+uorKu33DzGiF4++lMmOBsKgEkFvPmHc9VBxXW7TiMO qRQXaHCwT3oXZGXJJWyp5b7if7bcmqXvVbiV/Of1fh12oM1/xJsCn8k4ClxGOm/66mF9 Eb4OcQd9UU0DdBMs2+M3d83CSY+1PVAoNlNy5tZy/sr7fiNdPcxKpzR9wBjaVJVkVkJj EP4Q== X-Gm-Message-State: AOAM530CzUz+4rIkh8TKhuBazGJcPHhS2hYd6A2Toa8A9I4OXwfZYFJb zPhD7ufEHgMHsl81ZTpxp+j1iw== X-Received: by 2002:a63:de0c:: with SMTP id f12mr13551773pgg.172.1589787705397; Mon, 18 May 2020 00:41:45 -0700 (PDT) Received: from localhost ([122.167.130.103]) by smtp.gmail.com with ESMTPSA id p62sm7994891pfb.93.2020.05.18.00.41.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2020 00:41:44 -0700 (PDT) Date: Mon, 18 May 2020 13:11:42 +0530 From: Viresh Kumar To: Serge Semin Cc: "Rafael J. Wysocki" , Serge Semin , Thomas Bogendoerfer , "Rafael J. Wysocki" , Ulf Hansson , Matthias Kaehlcke , Alexey Malahov , Paul Burton , Ralf Baechle , Arnd Bergmann , Rob Herring , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, stable@vger.kernel.org, Frederic Weisbecker , Ingo Molnar , Yue Hu , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 20/20] cpufreq: Return zero on success in boost sw setting Message-ID: <20200518074142.c6kbofpdlxro2pjz@vireshk-i7> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> <20200506174238.15385-21-Sergey.Semin@baikalelectronics.ru> <20200516125203.et5gkv6ullkerjyd@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200516125203.et5gkv6ullkerjyd@mobilestation> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-05-20, 15:52, Serge Semin wrote: > On Fri, May 15, 2020 at 05:58:47PM +0200, Rafael J. Wysocki wrote: > > > @@ -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) > > > > IMO it is better to update the caller of this function to handle the > > positive value possibly returned by it correctly. > > Could you elaborate why? Viresh seems to be ok with this solution. And it is absolutely fine for Rafael to not agree with it :) > As I see it the caller doesn't expect the positive value returned by the > original freq_qos_update_request(). It just doesn't need to know whether the > effective policy has been updated or not, it only needs to make sure the > operations has been successful. Moreover the positive value is related only > to the !last! active policy, which doesn't give the caller a full picture > of the policy change anyway. So taking all of these into account I'd leave the > fix as is. Rafael: This function is called via a function pointer, which can call this or a platform dependent routine (like in acpi-cpufreq.c), and it would be reasonable IMO for the return of that callback to only look for 0 or negative values, as is generally done in the kernel. And so this solution looked okay to me as the positive return is coming from the implementation detail here. -- viresh