Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5181736imu; Tue, 29 Jan 2019 14:22:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vxKeRUYG4iWj1mryO0V8XtegoaSbg1MLj4+gEp/eCA0Z4spbqD1GH8C6HF28u6Q5Yfl2n X-Received: by 2002:a62:3141:: with SMTP id x62mr27697640pfx.12.1548800564134; Tue, 29 Jan 2019 14:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548800564; cv=none; d=google.com; s=arc-20160816; b=mpJp91YSRZ8eOxPd9RnMXJ4YTateMZMfn3zCQge3NBA6YROEgKGL8xUfcYaFOHo1Yy CCtfOWvwhJt2dPAqrTfO24BqIjbVgBA2r00MH3m/k+CIG4/hMYwme0v7q3Lb4zFaQfSU w3pyqHkY3wCdMHffQO5Ag+XLxdWYxrsNez4j/+s7euTXXT3TWI6J/DX5HrE4w3uZ4pK4 pBqFZv8wBG7z9kQCp2FddIJTws7TWFoRkdyIBSj2BvEs4G/vSWcp3cbHM23oOE+SLMDl zWM88Gq6tMvwY9wm5188IVHqi5Ow9OkGaA5WKEekTg+bIm5DclV6kEBcHIFXVI5CPvDo S+mA== 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; bh=Ro/e6q+5fmr4HNR3iePe/0fUq89Iub3wrVXm/j6/h6Q=; b=0SClwuINNQFaKJ3ZJeEirwi5J9YhJ1/6icr4MJukLTuhkyP4nnUXpOOeIHTdW2WuTi ZshtMFzftoKj2ud02cy94JrfJTJn9aceSfKAZFrRyYOxiusEG5F0jN1z9W8dhxU09dZz bXck+xhUux+Ynqf0dGuPIGwkEfz/rkiVaQOrQz7dq5Ro0WRlhk4Ct4xaIh8/bhGBJ3OT jpsiVn4olNsVxBNxnrS+Jnsa7AzeTZLFFUe1QJmxnGG7KnbEclx1oGNn0OA0JEJtT60x b8IJ3VI3B+4KH0dh76qk7kbqPTxyeBFOeYEiXMc1G/fTmLRjsUjZxzygctsNGN5je3fQ /ozQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si11572958pgk.27.2019.01.29.14.22.28; Tue, 29 Jan 2019 14:22:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbfA2WWX (ORCPT + 99 others); Tue, 29 Jan 2019 17:22:23 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39486 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727332AbfA2WWX (ORCPT ); Tue, 29 Jan 2019 17:22:23 -0500 Received: by mail-ot1-f65.google.com with SMTP id n8so19397582otl.6; Tue, 29 Jan 2019 14:22:22 -0800 (PST) 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=Ro/e6q+5fmr4HNR3iePe/0fUq89Iub3wrVXm/j6/h6Q=; b=JZERG/NfAsybeV1jP0+ZVU7x6zFGLXhFFH5fJrj602oTKMEqTCGc1gJUBG00PQEHrk qvcqbdOQ4GaOxm2mibQoX7CKO3xSL/AX6qcv95rxMZQRYj9OTrflH9vCYd5oAawa1jbh AS5C/RL7VT/09d6bHF3wuWL78WJxLH6ChK+q1jNF5C/JFbcbB9vTT5kWvSaZSIw4bEOA Zx5lD5s8cfGu6R9jcvmDJ9FJnIdPyM8j3a8PnRWTRYq65CvoS1WfgTml2MwOpVMvEXSj dZnjjpE1AfEZC9844ztAP3r+mXRO3yM2Fn4v6JqVoMov57zu2VatJTIKoKG43197Uty+ pKXw== X-Gm-Message-State: AJcUukdjpvwEqDYpmg+gVpJqxArYA3Wf2yPPOPWtW8K1zvodzWuu6RAl xmoVxSJalIwEckEMCrHdgWXKTOOu0Vn85MfebKE= X-Received: by 2002:a9d:2062:: with SMTP id n89mr19853990ota.244.1548800541861; Tue, 29 Jan 2019 14:22:21 -0800 (PST) MIME-Version: 1.0 References: <6077cb33d7e078bb0e85776bad99fdb476f16d0c.1548737236.git.amit.kucheria@linaro.org> <20190129053618.laa6nscfvlmhhkb5@vireshk-i7> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 29 Jan 2019 23:22:11 +0100 Message-ID: Subject: Re: [PATCH v5 2/9] cpufreq: Auto-register the driver as a thermal cooling device if asked To: Amit Kucheria Cc: "Rafael J. Wysocki" , Viresh Kumar , Linux Kernel Mailing List , "Rafael J. Wysocki" , 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 Tue, Jan 29, 2019 at 9:20 PM Amit Kucheria wrote: > > On Tue, Jan 29, 2019 at 2:43 PM Rafael J. Wysocki wrote: > > > > On Tue, Jan 29, 2019 at 6:46 AM Amit Kucheria wrote: > > > > > > On Tue, Jan 29, 2019 at 11:06 AM Viresh Kumar wrote: > > > > > > > > On 29-01-19, 10:25, 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 > > > > > Acked-by: Viresh Kumar > > > > > --- > > > > > drivers/cpufreq/cpufreq.c | 13 +++++++++++++ > > > > > include/linux/cpufreq.h | 9 +++++++++ > > > > > 2 files changed, 22 insertions(+) > > > > > > > > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > > > > > index e35a886e00bc..0f9b50d3ee91 100644 > > > > > --- a/drivers/cpufreq/cpufreq.c > > > > > +++ b/drivers/cpufreq/cpufreq.c > > > > > @@ -19,6 +19,7 @@ > > > > > > > > > > #include > > > > > #include > > > > > +#include > > > > > #include > > > > > #include > > > > > #include > > > > > @@ -1318,6 +1319,11 @@ static int cpufreq_online(unsigned int cpu) > > > > > if (cpufreq_driver->ready) > > > > > cpufreq_driver->ready(policy); > > > > > > > > > > +#if IS_ENABLED(CONFIG_CPU_THERMAL) > > > > > + if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) > > > > > + policy->cdev = of_cpufreq_cooling_register(policy); > > > > > +#endif > > > > > > > > I am not sure if Rafael wanted it this way but maybe something like this: > > > > > > > > if (IS_ENABLED(CONFIG_CPU_THERMAL) && > > > > cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV)) > > > > policy->cdev = of_cpufreq_cooling_register(policy); > > > > > > > > We never wanted ifdef hackery to be in there :) > > > > > > OK, that makes more sense. Should I just send out a fixup patch or the > > > entire series? > > > > Just a fixup patch, please. > > Please find attached a fixup patch suitable to add to the top of the > series and use git rebase --autosquash on. This isn't Patchwork-friendly, so can you send the complete patch instead, please?