Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4220272imu; Mon, 28 Jan 2019 20:22:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7H48JTSOQjvGjYpnv6Ac4PjgbM/RSySfGA9knW29hb0zZKbdLdxd4aJQIdeQ0YoKp20obs X-Received: by 2002:a62:7a8b:: with SMTP id v133mr25050532pfc.159.1548735728704; Mon, 28 Jan 2019 20:22:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548735728; cv=none; d=google.com; s=arc-20160816; b=nB8ysIhZTMr8s8G/WTc3dXbREo7DuG33qQKcHXSeVN9cgJKkHTlXeC+cL1dPyq2uJM VrnN2D/YZ1HwDHPJrwZehNnCeT6am/A14AyoJsfg2xCE0VFaA+1Eu060b5j1xWsqkAjg mYv6hauMcHndPnS9e2EvdgQvYceUewxxTEmxOdhQosVKxNDXpS7VpoYUJ40ONNkHQuhj hgQ2uPULiy9oyzIunGIEJOoCsA5yTC3EKSi7Zd9RMa8AtZBNn0yxRpLnDPln5pAwd93a f9py0yj/jnENlxcNVShomos/YOuRM4R8sb14GHOTHdp9kp9+vJt6PQI7a9wXnnM5NhpF s+uw== 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=QZUGePzewCDuBQaqaR//yZGnCYqK5GX39SVrw/5G1MA=; b=0FA4H3RpsqQw26fHTphKCliQFLYaxO/u1uukZ3tbHil4AbonHUlELp9V8hAVI5gQ/J xWZ5DnS/9dSHXY4N4yN9hjXqOyUSHKvn2oXrw0dHSBzhtRg6XEAKG8/1NAsc4dQlzYvM 08UBkD+b4H7dIn58HQpS0mlM7vUXVv/0iCzOLVzBSET47SA2LGJ/4nEIxPUcr3qqVRAS vDvlo6xMIDjL8MrVMIlHLp5HTfs7ljS78dl7VAIsd20w+ZRLJDkUJU8d/3dboXb9r4LX 2ialHvMQMw2b/3f7LPZ0PXbM4dA2YBzKW4uHVGmQfTHDYlr7VxTNMmN3a16Y79WjSbix 2a6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NV7bqcDK; 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 s17si4983816pgi.513.2019.01.28.20.21.39; Mon, 28 Jan 2019 20:22:08 -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=NV7bqcDK; 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 S1727120AbfA2EVg (ORCPT + 99 others); Mon, 28 Jan 2019 23:21:36 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39770 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfA2EVf (ORCPT ); Mon, 28 Jan 2019 23:21:35 -0500 Received: by mail-qt1-f196.google.com with SMTP id u47so20896352qtj.6 for ; Mon, 28 Jan 2019 20:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QZUGePzewCDuBQaqaR//yZGnCYqK5GX39SVrw/5G1MA=; b=NV7bqcDKTpjDZoepx1hw05JWtXOTanvrEruIQbTfLne+jjvNT0LzQQI6DD9I00lxw4 8qPaanfSsbUsiVjUfgZqoV7laDqG0K0s0H8UDA7+O0KKMLLlDzw84l7FaBW9o8y24dIj XBFa6pfpL3Qn7MYOl98TLN8KQTum2ElKB/7M8= 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=QZUGePzewCDuBQaqaR//yZGnCYqK5GX39SVrw/5G1MA=; b=SayJKFA01pBw1ADgCIW3vDx1eIS62I6fHE5U6+mGt+E8N4py7D48vV1ugROCbPiLn5 pKwwE+gNDGWARGNrdRykk4A/uwd4Z73rHKWWl23kUTqf6xXKsXd1/kH4Eht+3xR6kecT MkOnSkeUGrmoHVPDomOdqfTtrzsJ3AjvIssSyI+rFMR5bZxQpLheH7R14PpTWPX5SIPk 6LStQRot/6qG0cmsdprw72s1ltnqwQHmB7kGjDZPou/x03chdvPRVH3ttqPVkLUrqMsK aNu2N2UVYfSScQ7GX0p7S6O7OwohEfVJw0u361dg+dW4S2xCQPnQifVueN8ccLDt4eKx Fmyg== X-Gm-Message-State: AJcUukdrGSJVANwrfFFlEYzJDQYv+2yNcrcn6RByJOUN6Ru2ZquYegBB XSfp/5XyVkyle0zjHmC1DJGbeC4CSMn6wjwLVA/UwQ== X-Received: by 2002:aed:3bd7:: with SMTP id s23mr23919693qte.207.1548735693893; Mon, 28 Jan 2019 20:21:33 -0800 (PST) MIME-Version: 1.0 References: <3afd5b04-5caf-053d-48c9-f719eec58da0@linaro.org> <12294707.IXbBkGfcfl@aspire.rjw.lan> In-Reply-To: <12294707.IXbBkGfcfl@aspire.rjw.lan> From: Amit Kucheria Date: Tue, 29 Jan 2019 09:51:21 +0530 Message-ID: Subject: Re: [PATCH v4 2/9] cpufreq: Auto-register the driver as a thermal cooling device if asked To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Linux Kernel Mailing List , linux-arm-msm , Viresh Kumar , Eduardo Valentin , Stephen Boyd , Doug Anderson , Matthias Kaehlcke , "Peter Zijlstra (Intel)" , Tao Wang , Sudeep Holla , Linux PM list 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 On Mon, Jan 28, 2019 at 5:34 PM Rafael J. Wysocki wrote: > > On Monday, January 28, 2019 9:32:44 AM CET Daniel Lezcano wrote: > > 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? > > Yes. OK, will send out another series with this change and the IS_ENABLED guards. Thank you everyone for the review.