Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4127210ybb; Mon, 23 Mar 2020 14:06:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvgdSfFbuIOq4unV7nsjMJRPdfEC9O1FbtlUD93dDBBxlohKF2J/dreZaFnGJ+gBC5yP8Yi X-Received: by 2002:a9d:4c8f:: with SMTP id m15mr19937614otf.273.1584997566368; Mon, 23 Mar 2020 14:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584997566; cv=none; d=google.com; s=arc-20160816; b=t0kPlDx79So75N4/chMnk1L8mhQGZAPAVoPmf6KdgcdVrQ90lwnITU7aqYaw8aeYWK EwFsFoXgbYVAqU1MohuGf6xAT1PAMkOHLIO/xfv+ES43FosSeKpfpRRT7K5KqEUiyrhV cd/NMkJytL1uNhX/gCRhGMbNA6FBYcLsRa/E96zHRZLZcxrYgmAe5ZiACOpha7Z+ksE/ RFf7uKsnOboUJmXIYxj8MebSNRTR6sKaQAQjauo4pigsXbk5IH47mw6NnvI7eEWbX7Zo FWDYoQIGMS+4Vod+pQH1kn/xsD0QEbqwnLljq7harlvCluEHrQsCcyKd/2HFY0ZWakUj ERuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=afgnjkDJ/R+0EdXTGL+409eIfOJr3eWoeZR0O+51R6M=; b=zinbQivq72+0jmVi3WwqHag+2j502i9knyfgYJ16i1cEOkbC6hJNzpgO7k62XGBM3J shpvoJii3lSvHuMlPtuBJ5NnzKF4BdytjAYc+E8+OHAOq026bMMMQAx+Baz7OrgvKpjD GYM77/ZVu0PpSmEdwOVFNLqC1a37XMYO6Y9Vm9vy2YSF0lNM1AP/ft/Pw6VD8Nf/AZ13 MmWzW2NsZc5ElIl8OgGSWXGl7Qwd/r5yNNo4rHW8r8x7jQmM88DV99RgZxj6pIuegS0e yo+86BUnGK9bxbychz1AV/fQ/pxTz0xfgqFNz6aH41baOjLpTlopfnZ12CK4n803m4y4 Xqkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b="w0nVY/jG"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si8342211otn.296.2020.03.23.14.05.51; Mon, 23 Mar 2020 14:06:06 -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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b="w0nVY/jG"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbgCWVFY (ORCPT + 99 others); Mon, 23 Mar 2020 17:05:24 -0400 Received: from mail-vk1-f196.google.com ([209.85.221.196]:35155 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgCWVFY (ORCPT ); Mon, 23 Mar 2020 17:05:24 -0400 Received: by mail-vk1-f196.google.com with SMTP id n198so3040447vkc.2 for ; Mon, 23 Mar 2020 14:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=afgnjkDJ/R+0EdXTGL+409eIfOJr3eWoeZR0O+51R6M=; b=w0nVY/jGdqLmt49rqhh/Y6tL2SnwaSNPXgMzQsNqnAtNVahj3eUnRvPrdrsOAUkX/6 4/FNI/IQfzJr7WhfoOr/oNuKlXVM99+6nV6FU3Hn7CiuDmODZOtdfFSG3VZCtylp4yTu /THiOqbqRCbP+MMzNMZu8+GH/n9NX5N8zqweOA8MbT9bomaxtOge0ati1P21G2/dqpJo KYzMEbroCTHNHICjNpUjVZrxUOH+BXpsFaF6sN4xH6xGwMxn3b8u4u4309xCWOadrScU FI3v1Z7DWk6McdknmRIt/R1AfHFQa3DvhFGg9E8LILW6fxD1ypsBVv5ifbjp2JEH9iin yeag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=afgnjkDJ/R+0EdXTGL+409eIfOJr3eWoeZR0O+51R6M=; b=tKvoYOdVzylRk25l1/1ry5wMwBv+7RfWkuj321BEBXIPDoNmkf2cLRh/flP7dly/Co 5cJM3w62X6MlZzQLoB9L7IRCzHa+xcF5RiKGhijI0wHaKDgMTHqj/EujVUlbYbMm9Qpx VgtYdJstR+kffZa7OuGtJ9cD3+51Mrd8IxCsEXaFdGwPLyro/eub5AyPKEMABpYglUcQ sNioewRbsDe4/uAOKwgEpGo78hKTOkrl7NKXdrwHCUk/BFqcEuUJ7QEvV/9rTn8MZmo6 BeGtR6mgQpJfTFUKouMLibamfxH11jRSCZvyaN82gB2QyEcwzBWV+yJrTEGl35Vnk03B eDIQ== X-Gm-Message-State: ANhLgQ1YomH2kchCY82i39kVgsj94NBwzbm7eGUuFTwbSJaGTtX0g5Ka BvuKveFF6EQuTUvk4vuVfIVgPZS1q5KlTvu2PKOsRg== X-Received: by 2002:a1f:2882:: with SMTP id o124mr16886445vko.86.1584997520484; Mon, 23 Mar 2020 14:05:20 -0700 (PDT) MIME-Version: 1.0 References: <20200321092740.7vvwfxsebcrznydh@macmini.local> In-Reply-To: <20200321092740.7vvwfxsebcrznydh@macmini.local> From: Amit Kucheria Date: Tue, 24 Mar 2020 02:35:09 +0530 Message-ID: Subject: Re: [PATCH] thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state To: Willy Wolff Cc: Amit Daniel Kachhap , Viresh Kumar , Javi Merino , Zhang Rui , Daniel Lezcano , Linux PM list , LKML , "Rafael J.Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Willy, On Sat, Mar 21, 2020 at 2:57 PM 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. > Please improve the commit message with context from your earlier bug report thread and a summary of how the problem shows up. Thanks, Amit > 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 */ > -- > 2.20.1 >