Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3218380imu; Mon, 28 Jan 2019 00:33:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN50ec/Mf0A5O6oRfIaAQH+dKa1ovl0EApEP+1UlraNPWJToHIG9I/hulnJ6HbuunVgCrRcA X-Received: by 2002:a65:40c5:: with SMTP id u5mr12102376pgp.46.1548664396156; Mon, 28 Jan 2019 00:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664396; cv=none; d=google.com; s=arc-20160816; b=jPV+OFgYQ+dGOvHN9YR8WcWztTRLax6mlsiqnQLpSKP5ULiH/cz3vjYYba9rq+fQEa BXACuB1VC8nJI/gJz8hk3n6PDDvStNr3g9T3/aX6QSLIGnT8eVkm8FtaAYEpEInxESRn 2FnKmD3qV23WGl++x9paVFzrUs/WeE1oRTg1oWIQ/jRIULIyYd6PnLcxK5A6jFWRypAZ lFWO1REj2dNDcd2vyu0QPPzJOVpHiHNTz2BKQXRp8UBpFlMVUxxjlet7Gj3cnRxbfrri HhYX4bLrhfFConqepKB64lxnWyXIU1qycjI9Cr2RUdFpvRlaj8w49tL418CpjYDGdzYZ ls1g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=IdLcjpt4fKK+CAzDfTMlv9oWr2wwLr24MdWR3nRxQgI=; b=PNPx7SQmDmAKbGvUsQRAm5dLhsAqPZAYtqNWisiptXwh8wBWypbfskKmii1Ha3+UY+ nV0Zheg0PufjpNpIDwnN+kiy+N0G5dgRxcvYiCAeEH6PE2GtJJTXsu86oV5oSWzWR1uP 00BbADyi2gS+EIGhpSA/RkIg28I1O/Oy3KKydbZGaso5Sicfa3lb7yZmMrWj/HJ39Djk 09AfBJQJkFJQOBzDavr+jQ4gF9RE+b6J98NdEkc3hEhvqizWM+mzF8sJZ2QqxxgU2JXU 2x9L+GG8MrzAYE0ocny8EUhGKDapEmLmUHWx0g6CWuoZhd9iiEt6mTdAYSSPezYFU3Io fMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PWey+YGJ; 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 u4si31895275pls.34.2019.01.28.00.33.00; Mon, 28 Jan 2019 00:33:16 -0800 (PST) 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=PWey+YGJ; 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 S1726851AbfA1Icv (ORCPT + 99 others); Mon, 28 Jan 2019 03:32:51 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41681 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfA1Ics (ORCPT ); Mon, 28 Jan 2019 03:32:48 -0500 Received: by mail-wr1-f67.google.com with SMTP id x10so16944320wrs.8 for ; Mon, 28 Jan 2019 00:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IdLcjpt4fKK+CAzDfTMlv9oWr2wwLr24MdWR3nRxQgI=; b=PWey+YGJyy1UIymK0hXujgAD1HxuLplRsJxe/HtmwI56/h33XwFrDvCs53pbek4OEO B6rmeWY2ftST9iX6IijYPce4jjQnGFW8DS/Ow/ogg3vGcF3GUgEc9mdJW/RwClrB1/Hk 5E7/l9DhBAEIXqk6SLPX7enbUCL2CJhrYGZH4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IdLcjpt4fKK+CAzDfTMlv9oWr2wwLr24MdWR3nRxQgI=; b=n0fi0fTJAB1uEBbGyfqFVXCGXhZkwUQXuRW5LQog9WX1L9tCflNP9pwGgj4h6VNpRz 50RSC8ZehFaxHp9vyXbvy5HBLvZzzWXj7JTJAxKzINX66a7TJ4sOhfCwqqkEMcqA31xL hXogWKTjQvSurQGDWXIupL6fIHqh+mpvzbo/Lyno6ecjjP8T8a4OpKx9mhicS4bU0QPk kvaSx/chEWyQ5bEs96qj0UhQK+FdSilAMD/zGo1H9CksP23sT+us6JQznTCYD6K+ufhF eSOrw28GgVWzTBtYMXudHYgzMVrd/h9ZzdC43g8kmRbZOFOdrKPSP7FBd9lf084zRtcY BmqQ== X-Gm-Message-State: AJcUukd9ARK/RfYwRxyfwVmKqw0zJmn3AoOwCOK/j2W93E4pvqgY75oT N1O3f5hxhhe3tAVls6czWP3XMg== X-Received: by 2002:adf:ecc8:: with SMTP id s8mr20126727wro.208.1548664366588; Mon, 28 Jan 2019 00:32:46 -0800 (PST) Received: from [192.168.0.41] (20.36.129.77.rev.sfr.net. [77.129.36.20]) by smtp.googlemail.com with ESMTPSA id o2sm7412317wmo.33.2019.01.28.00.32.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:32:45 -0800 (PST) Subject: Re: [PATCH v4 2/9] cpufreq: Auto-register the driver as a thermal cooling device if asked To: Amit Kucheria , linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, viresh.kumar@linaro.org, edubezval@gmail.com, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , "Peter Zijlstra (Intel)" , Tao Wang , Sudeep Holla , linux-pm@vger.kernel.org References: From: Daniel Lezcano Message-ID: <3afd5b04-5caf-053d-48c9-f719eec58da0@linaro.org> Date: Mon, 28 Jan 2019 09:32:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/01/2019 07:41, Amit Kucheria wrote: > All cpufreq drivers do similar things to register as a cooling device. > Provide a cpufreq driver flag so drivers can just ask the cpufreq core > to register the cooling device on their behalf. This allows us to get > rid of duplicated code in the drivers. > > In order to allow this, we add a struct thermal_cooling_device pointer > to struct cpufreq_policy so that drivers don't need to store it in a > private data structure. > > Suggested-by: Stephen Boyd > Suggested-by: Viresh Kumar > Signed-off-by: Amit Kucheria > Reviewed-by: Matthias Kaehlcke > Tested-by: Matthias Kaehlcke > --- [ ... ] > +/* > + * Set by drivers that want the core to automatically register the cpufreq > + * driver as a thermal cooling device. > + */ > +#define CPUFREQ_AUTO_REGISTER_COOLING_DEV BIT(7) > + Isn't the CPUFREQ_IS_COOLING_DEV more appropriate? We define a property of the cpufreq driver and the resulting action is to auto-register, no? -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog