Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4137664imu; Mon, 14 Jan 2019 15:59:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gcISYJr8cmNBN7mQTbnLBJB8MnKMag2dEDg8KkMXdTqNNfVdQ7DsL2z7XWbd4ov+37RXW X-Received: by 2002:a17:902:4624:: with SMTP id o33mr1044673pld.289.1547510360866; Mon, 14 Jan 2019 15:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547510360; cv=none; d=google.com; s=arc-20160816; b=lLkzsFOPW+bZymr3rtqNNjnDn83x+OW5jbGrzvlm/sdzNHPUsinER9hblvE6UPl+6D GmAZxaM9DpGvWj3ZPWqK9w7s+kV33YRmRqVVtFoKzK00VGU6g8T+6sWQRdOclX06nDZK aePHaa5PF1DIbI7yHcXlz96ZYG6Jovj9NspFcnBa0/qKgO4tXmtncbpReMhLkiiq0RCL xIEdlmu0S+kn61BFOkVbkv3uZ/0wHTAL9eoRHtHfBhMeusgmlt3pRFFadwf6wI77SLHd Ekk38sQJblzMZev+yIr5oBUKF4ZNDozvP2ul5mExLm4La3uash/+PWh8HjsmAVf4TROK bIwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:from:message-id:to:cc:references :in-reply-to:user-agent:subject:content-transfer-encoding :mime-version:dkim-signature; bh=9rTKQ3Op5x/Q6XuwXQNV5aTmauYT7L1RdJdlRcyl7jY=; b=PO7at4rzwv3v0yWot94yR8W94RVnL4s7Sp/pRNgTTBr0jRx5BDR3RoO0WRPZ8mSf8U lqN6n/vxoPCYXhTSwX7wJuqyqfQVigUg/UoN05ENjEsfW/QCRcz3vI0flYKqvW5oJnlE xNuSt0eQXRIUqvULdWoa280unSI4AljXFoqbxDzLQfuxHY91ZBFdzcziKw/DJJnn3wOv HN23Ueai8tZ0blrMgAvJ+yjCKBcoZNHpicY4oImawFimdXD3Xxh5joHDCtLNipBwwiRp KlC5TCApK7liEi7fIPpF4MLYx/PQ9LkZNoG4MWKsFMPkvz5ObnVcRE1cBAyxcjL+Buxe jn9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eFhbXTxt; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si1674619pgn.145.2019.01.14.15.59.05; Mon, 14 Jan 2019 15:59:20 -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=@chromium.org header.s=google header.b=eFhbXTxt; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbfANX5y (ORCPT + 99 others); Mon, 14 Jan 2019 18:57:54 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38268 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbfANX5y (ORCPT ); Mon, 14 Jan 2019 18:57:54 -0500 Received: by mail-pl1-f193.google.com with SMTP id e5so381785plb.5 for ; Mon, 14 Jan 2019 15:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:subject:user-agent :in-reply-to:references:cc:to:message-id:from:date; bh=9rTKQ3Op5x/Q6XuwXQNV5aTmauYT7L1RdJdlRcyl7jY=; b=eFhbXTxt3zA2Yzrh4bVbfcCcpNrXYDVB1Qv5BQkJjd9xKS5soCIZg4A/Egcg6fbcq7 svYYo7YjcO5QXiIqPXQOU2cf2FTzJiGJ+r2HqrIKZcGzN8/k6PmHBS7lv8OLbJep+xxA hKRW9P41pd8s8jSDfcGid8a6iubdb0xRPVIY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:subject :user-agent:in-reply-to:references:cc:to:message-id:from:date; bh=9rTKQ3Op5x/Q6XuwXQNV5aTmauYT7L1RdJdlRcyl7jY=; b=orGaMHXK/P4WSoCWllbkFZCWjv4QY/3/HvdRlVwjE6D57uTZCjFMI2EbJJwkD28wgt yRphtfNrP2SzDKXzvzIx2UpysUOq8BgYF5LwwjvQKWsNmopsFyv0ry5Mw/g7PowbtD5O 7mlbs2Yma73lT32tdidEoXdX+Ny5TztJy/XZiLmemQBG15kjezMKhOQeMd48WPXZfTx3 1F7V+Clyy0rs8kcitF2pa9fgFzaUpJzB8xiGQJc8Uc7U/RQWClT8FBmL6nW7nMgFH5N8 G4tgu4FKRn4I8U9oksi1JfTGeMmGAfJARLGxtm4+t7CXsrUaiJljr2uNL+4hvRxFFmY1 KmTQ== X-Gm-Message-State: AJcUukd/msLdMiO7pQgHRj/U9TNdddkHhedEMd0fDFW/Ifpy1z/N/gXK 3k24z7dykorRY87LkwjEbIFZxA== X-Received: by 2002:a17:902:346:: with SMTP id 64mr1075005pld.337.1547510273652; Mon, 14 Jan 2019 15:57:53 -0800 (PST) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id n7sm2369306pff.36.2019.01.14.15.57.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 15:57:52 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v2 4/9] cpufreq: Add a flag to auto-register a cooling device User-Agent: alot/0.8 In-Reply-To: References: Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, viresh.kumar@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, tdas@codeaurora.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org To: Amit Kucheria , linux-kernel@vger.kernel.org Message-ID: <154751027198.169631.16299398103212295726@swboyd.mtv.corp.google.com> From: Stephen Boyd Date: Mon, 14 Jan 2019 15:57:51 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Amit Kucheria (2019-01-14 02:21:06) > 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. >=20 > Suggested-by: Stephen Boyd > Suggested-by: Viresh Kumar > Signed-off-by: Amit Kucheria > --- > drivers/cpufreq/cpufreq.c | 13 +++++++++++++ > include/linux/cpufreq.h | 6 ++++++ > 2 files changed, 19 insertions(+) >=20 > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 6f23ebb395f1..7faebfc61e60 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include Maybe this is supposed to be ordered alphabetically? If so, this should be much higher. > =20 > static LIST_HEAD(cpufreq_policy_list); > =20 > @@ -1318,6 +1319,12 @@ static int cpufreq_online(unsigned int cpu) > if (cpufreq_driver->ready) > cpufreq_driver->ready(policy); > =20 > + if (cpufreq_driver->flags & CPUFREQ_AUTO_REGISTER_COOLING_DEV) { > + struct thermal_cooling_device **cdev =3D &policy->cooldev; > + > + *cdev =3D of_cpufreq_cooling_register(policy); > + } This seems to be some complicated way of writing: policy->cooldev =3D of_cpufreq_cooling_register(policy); ? > + > pr_debug("initialization complete\n"); > =20 > return 0; > @@ -1411,6 +1418,12 @@ static int cpufreq_offline(unsigned int cpu) > if (has_target()) > cpufreq_exit_governor(policy); > =20 > + if (cpufreq_driver->flags & CPUFREQ_AUTO_REGISTER_COOLING_DEV) { > + struct thermal_cooling_device **cdev =3D &policy->cooldev; > + > + cpufreq_cooling_unregister(*cdev); Similar? I'm confused!