Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3277808ybb; Sun, 22 Mar 2020 20:18:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsBwWg9XSfITG0/0IdB1IhKM1C5Surtf1au8oxj1RyJCrDoiIPTMb1vR9xw/RGw5T2jSlbL X-Received: by 2002:a05:6830:12d0:: with SMTP id a16mr16567893otq.218.1584933511580; Sun, 22 Mar 2020 20:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584933511; cv=none; d=google.com; s=arc-20160816; b=HyeB00SyKzUgAYIpmkq3XwNEKZTAVB/tQ6a6iRpT7elo8BDOyjbehNKSV3H2+cRmmC HgDag1Dwh8bMv6UVq9XPkJiv7ihLc+1yu15vFaT8qYY++F3prfl3kaDHQ8tOnflUTrXQ ymewqmw+hU69NNXATlcZ4BBjv6r76OjPwnIryTwuEvzzh0hgXAghNZgRF9rBYNXoBr/q rlZd8qcPXY/Q/YvhapGhNTWJFu461jF1SirngZ3osPmPOQQnLNSQybNp4dvCSlFFPHVi Bd/UCO3fpozbY0EKiu4apMFtOgg7JHHLxwln+nfZApeH6YX2ji7PS1d00UOL7AmrBLVQ VjDA== 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=S4TZKS6d2y1eHYS1jppzyvKAfOVpYJMMu/Ehs0CdOMQ=; b=Lp676Vu3IyPV6VVFc9SwejIsI2r2+6D3wU+Mn/azD2lwu0Cb1vCBKHqqdcCLzCroT/ yFr+Knwfxv+6SkVTzF/aGoMRkHljsOEg5yOpQizXyVPCG5sw79lLjfifm2Rq4VeEN37I fzxbkBGPgwzDRvzmAuJGKX71fITwRNod3WhMeFMjpLTtE6YXIUoX1iOszbvlJ9USVxgk LHtuyClYrO50jSMHehwXOSqyBy1BHisQC9eRm1lgnY9165Fhk40UDlubMc3+IuoZL6+L 2xAJWV3N/Uh3z+kg4aFJY8hyWtc6JTIq58LR6KPkJEM2DaiAeBTtm63D0EM4tzzCtLQq ZycA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oy7AW0C4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id w21si7025794oia.257.2020.03.22.20.18.18; Sun, 22 Mar 2020 20:18:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oy7AW0C4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727158AbgCWDRi (ORCPT + 99 others); Sun, 22 Mar 2020 23:17:38 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41660 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbgCWDRh (ORCPT ); Sun, 22 Mar 2020 23:17:37 -0400 Received: by mail-pg1-f195.google.com with SMTP id b1so6462259pgm.8 for ; Sun, 22 Mar 2020 20:17:36 -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=S4TZKS6d2y1eHYS1jppzyvKAfOVpYJMMu/Ehs0CdOMQ=; b=oy7AW0C4+1A9gMD6L/aMJGFCcFb+ub8nHaXwstcdSZj5UK6Y9WQ+dSQInkxvWPGAPd atYUGcC2fqdoRJ5YsVK179OZ8nyM4/echB2BWEutHssW5MMyq+XlnYsUpmOhpLTqfDe0 nZdhu3YAprzsDcw9cwUm4ew/BH48l3O8LeP5Z98f/MBoKh9wzaJAVlX81QDORw+nHcly oD8AtOmIWuqEKOsIQjTVUuvkn8DmmB9MmBjHGq26desmsW8C2XiUVKTM9o8W2INzwbNI 9ywlGUZukQU4tME2lDsrM9IwxRuRXqyaj/L/y08Dom3IA9VSqBYnFVfekVnEPpbR4srm wnuA== 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=S4TZKS6d2y1eHYS1jppzyvKAfOVpYJMMu/Ehs0CdOMQ=; b=IYn2WEjJG4SfC7+CF7I+kFkLLqZR1ILyC5YWa+z7mKEUpSEnWeVt2qxDYttk9WT2dS kqFJMDSyAplrJnluIQXu06VDOvxvRJjEm8br3B5k6YlZZIWwNLaGGuPtqDSmwYfmgB+S DB3xoCHSeK2+asvbHSPpFc8jc7cq9yP6sFGTiyiWsatzW1VfMX8sVVv5Zu+whCGBJRPm 8w/DP6vv73W/b2/r3EKv3en7FHH+W6uhJDUHrR/0aJitLPBOr0xCidEZk6k/nEY9+ME4 OKU09YrWuAjak63e/w/SlEZsJSIukh6Xrrq2aZRK4yHO4LjgmS6m7/a+Rnyope74bnKv ifsw== X-Gm-Message-State: ANhLgQ0vO5/VM5pafkDUhoHSgdp8VxdCEFyF4DrETYzgY92BoXISRd8I s2ax5AJ+Z+7I4iTnoH/I2Gvwqw== X-Received: by 2002:aa7:988f:: with SMTP id r15mr22672571pfl.252.1584933455399; Sun, 22 Mar 2020 20:17:35 -0700 (PDT) Received: from localhost ([122.171.118.46]) by smtp.gmail.com with ESMTPSA id i4sm2741719pjg.4.2020.03.22.20.17.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2020 20:17:34 -0700 (PDT) Date: Mon, 23 Mar 2020 08:47:24 +0530 From: Viresh Kumar To: Willy Wolff Cc: Amit Daniel Kachhap , Javi Merino , Zhang Rui , Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J.Wysocki" Subject: Re: [PATCH] thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state Message-ID: <20200323031724.xnbr6wmbzwpwutn4@vireshk-i7> References: <20200321092740.7vvwfxsebcrznydh@macmini.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200321092740.7vvwfxsebcrznydh@macmini.local> 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 21-03-20, 09:27, Willy Wolff wrote: > The function freq_qos_update_request returns 0 or 1 describing update > effectiveness, and a negative error code on failure. However, > cpufreq_set_cur_state returns 0 on success or an error code otherwise. > > Signed-off-by: Willy Wolff > --- > drivers/thermal/cpufreq_cooling.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c > index fe83d7a210d4..af55ac08e1bd 100644 > --- a/drivers/thermal/cpufreq_cooling.c > +++ b/drivers/thermal/cpufreq_cooling.c > @@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, > unsigned long state) > { > struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; > + int ret; > > /* Request state should be less than max_level */ > if (WARN_ON(state > cpufreq_cdev->max_level)) > @@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, > > cpufreq_cdev->cpufreq_state = state; > > - return freq_qos_update_request(&cpufreq_cdev->qos_req, > - get_state_freq(cpufreq_cdev, state)); > + ret = freq_qos_update_request(&cpufreq_cdev->qos_req, > + get_state_freq(cpufreq_cdev, state)); > + return ret < 0 ? ret : 0; > } > > /* Bind cpufreq callbacks to thermal cooling device ops */ Acked-by: Viresh Kumar -- viresh