Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1360852imu; Wed, 9 Jan 2019 17:05:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN68hr0DTorZHUVm32Ub3tO3KyruG/DJefYE6PGyvNPOXkivqWEqljNvZMLLTyqpEy4gbcGV X-Received: by 2002:a63:9712:: with SMTP id n18mr7360763pge.295.1547082317177; Wed, 09 Jan 2019 17:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547082317; cv=none; d=google.com; s=arc-20160816; b=EiQWOM/6YujuwJAGg5MYUqSQ0nA05cFZSGBlacx9fvtc/EdF7Hy9OqnyTqUHjuSBxI mtiogwktiNnRsfSMFq2IFfoJgcrh9IIgqWPha+uHdRbnPnrsK4Jza1HRM/Fvh1OquU+y e/hzVUWHA5/0fsi42X0JX5jIhJ9mxXQ7WmCvK6wPPvs9CWQ7iCpA+NsZr9Em4BAnB2+w ofYwIOMsfq4FqJTBE7TAaF05hf7r63Jfs1VSlSTSaGSq4kW7WtTmvssHooTGN2W4aj/L gOm8ZpPcInMjn+01DP25WTY97Qh7TCmGvULfgjxZe8T+SKPXaF4Pehkx4ddKIMm1OjtF znhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=48k2tfaVkuCjX7VKHs5SKEon79tbbADS21HoSx9XbYs=; b=egcVHcvDzT/st0wfZd0+yEOWJg4o02CSb0l3j91ZUqYP+//DhtkJBh+goXeo97vzff +aaeWkVDyFvO7rcwbai26jR6UxmmO7ph5u3cef/RPbTJ6a1uoYlKFSwQhs6uiwqFxMIw 4OyIayi36Q9zcGxgp5oJt9zm4ZXAJ9dJHTjxaSIrfOWzgWFljg7Q2XGzdf1H0dvRnz1y 1TtIugZoaXFQgr96B9/7L9V6Omq3ubuvlo2Jn/73iALJ2SnHKG/D820A20Yae5yoXoqX o92H0HCgEC5/Lbm9GuwKGkeBeiErFfI0+rYAXMz5Rac7ofZm2950pLzwNeFIs+K0/i96 /ZuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Zm7h3nM7; 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 a16si16542640pls.146.2019.01.09.17.04.58; Wed, 09 Jan 2019 17:05:17 -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=Zm7h3nM7; 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 S1726881AbfAJBCA (ORCPT + 99 others); Wed, 9 Jan 2019 20:02:00 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45836 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726822AbfAJBB7 (ORCPT ); Wed, 9 Jan 2019 20:01:59 -0500 Received: by mail-pf1-f196.google.com with SMTP id g62so4466392pfd.12 for ; Wed, 09 Jan 2019 17:01:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=48k2tfaVkuCjX7VKHs5SKEon79tbbADS21HoSx9XbYs=; b=Zm7h3nM7Oxsfn63RSiUAUSVpIoBUwNghwQVWiNL4Zje04a4iv0ybhz7LbZZdnK/bJz kXNahSp93yqYLyt6rjU/1yVl3oBZ9UScOCFQB/YM+zNZIk8P7KlTiMoiANTadEMH61r4 tCZeK0ZwVQ3o3HVQ9kPo5l7Wl6k8mPfliSCR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=48k2tfaVkuCjX7VKHs5SKEon79tbbADS21HoSx9XbYs=; b=fCTY6hD7THOPVaRrkaE7ZsspbXDzVQmjvL8AiMqaWR7dk1SeOylvY1GA+bMPybMBN0 9adJybYM71cgoSWGwepna62DgAzBU16BpdKvDOjNoW5ewxThPbzcq1M7rlvX6qtTV5mC x8XcTTcRyYL9o5UqTYuM7SXNkpY7N30sRDM+eDd274R6opf59KGZNy/PqR9hLTtsw7Tw byaANaCYoAsAm1U14sQmr5hQ07ykJtiAeD5GVGDCUEUAOUcHtsvyrwpHeILzPhKNyX7o dWLb6Y+sBhXn0L227P1y906sQ07L77Mr6/FV2DhePtthGjaerrq6vzHqb67J5Ce767Rr 95cw== X-Gm-Message-State: AJcUukcNIFZqf1dxlkGO8uocSZrmpZD8G4A7/PskBB+7eOfJU3MrVFVZ 8U1LLPv3jrmFOHC9PXc7M7d9MA== X-Received: by 2002:a62:d448:: with SMTP id u8mr8128840pfl.105.1547082118779; Wed, 09 Jan 2019 17:01:58 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id t24sm97327224pfh.21.2019.01.09.17.01.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Jan 2019 17:01:58 -0800 (PST) Date: Wed, 9 Jan 2019 17:01:57 -0800 From: Matthias Kaehlcke To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, viresh.kumar@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, tdas@codeaurora.org, swboyd@chromium.org, dianders@chromium.org, "Rafael J. Wysocki" , "open list:CPU FREQUENCY DRIVERS" Subject: Re: [PATCH v1 2/7] drivers: cpufreq: Add thermal_cooling_device pointer to struct cpufreq_policy Message-ID: <20190110010157.GU261387@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 05:30:51AM +0530, Amit Kucheria wrote: > Several cpufreq drivers register themselves as thermal cooling devices. > Adding a pointer to struct cpufreq_policy removes the need for them to > store this pointer in a private data structure. > > Signed-off-by: Amit Kucheria > --- > include/linux/cpufreq.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h > index c86d6d8bdfed..2496549d7573 100644 > --- a/include/linux/cpufreq.h > +++ b/include/linux/cpufreq.h > @@ -95,6 +95,8 @@ struct cpufreq_policy { > struct cpufreq_frequency_table *freq_table; > enum cpufreq_table_sorting freq_table_sorted; > > + struct thermal_cooling_device *cooldev; /* Pointer to the cooling > + * device if used for thermal mitigation */ > struct list_head policy_list; > struct kobject kobj; > struct completion kobj_unregister; I've mixed feelings about this. It's definitely desirable to avoid code duplication and tying the cooling device to the cpufreq_policy is a convenient way to achieve that. However semantically it seems a bit odd that a CPU cooling device is part of the cpufreq policy. Anyway, unless there are better ideas we probably want to be pragmatic here, so if Viresh is fine with it who am I to complain ;-) Cheers Matthias