From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9AA6C2BA1E for ; Mon, 6 Apr 2020 13:35:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A775A20BED for ; Mon, 6 Apr 2020 13:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbgDFNfT (ORCPT ); Mon, 6 Apr 2020 09:35:19 -0400 Received: from foss.arm.com ([217.140.110.172]:45810 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728451AbgDFNfS (ORCPT ); Mon, 6 Apr 2020 09:35:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BEA2F7FA; Mon, 6 Apr 2020 06:35:17 -0700 (PDT) Received: from [10.37.12.4] (unknown [10.37.12.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8230E3F52E; Mon, 6 Apr 2020 06:35:07 -0700 (PDT) Subject: Re: [PATCH v5 4/5] thermal: devfreq_cooling: Refactor code and switch to use Energy Model To: Daniel Lezcano , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-imx@nxp.com Cc: Morten.Rasmussen@arm.com, Dietmar.Eggemann@arm.com, javi.merino@arm.com, cw00.choi@samsung.com, b.zolnierkie@samsung.com, rjw@rjwysocki.net, sudeep.holla@arm.com, viresh.kumar@linaro.org, nm@ti.com, sboyd@kernel.org, rui.zhang@intel.com, amit.kucheria@verdurent.com, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, rostedt@goodmis.org, qperret@google.com, bsegall@google.com, mgorman@suse.de, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, kernel@pengutronix.de, khilman@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, robh@kernel.org, matthias.bgg@gmail.com, steven.price@arm.com, tomeu.vizoso@collabora.com, alyssa.rosenzweig@collabora.com, airlied@linux.ie, daniel@ffwll.ch, liviu.dudau@arm.com, lorenzo.pieralisi@arm.com, patrick.bellasi@matbug.net, orjan.eide@arm.com, rdunlap@infradead.org, mka@chromium.org References: <20200318114548.19916-1-lukasz.luba@arm.com> <20200318114548.19916-5-lukasz.luba@arm.com> From: Lukasz Luba Message-ID: <4bf6cc66-8df4-3224-418d-0549026a3672@arm.com> Date: Mon, 6 Apr 2020 14:35:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/3/20 6:44 PM, Daniel Lezcano wrote: > On 18/03/2020 12:45, Lukasz Luba wrote: >> The overhauled Energy Model (EM) framework support also devfreq devices. >> The unified API interface of the EM can be used in the thermal subsystem to >> not duplicate code. The power table now is taken from EM structure and >> there is no need to maintain calculation for it locally. In case when the >> EM is not provided by the device a simple interface for cooling device is >> used. >> >> There is also an improvement in code related to enabling/disabling OPPs, >> which prevents from race condition with devfreq governors. >> >> [lkp: Reported the build warning] >> Reported-by: kbuild test robot >> Reviewed-by: Steven Rostedt (VMware) # for tracing code >> Signed-off-by: Lukasz Luba > > The changes are too big, please split this patch into smaller chunks. OK, I will split it and re-base on top of thermal testing. > >> --- >> drivers/thermal/devfreq_cooling.c | 474 ++++++++++++++++-------------- >> include/linux/devfreq_cooling.h | 39 +-- >> include/trace/events/thermal.h | 19 +- >> 3 files changed, 277 insertions(+), 255 deletions(-) >> >> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c > > [ ... ] > >> struct devfreq_cooling_device { >> int id; >> struct thermal_cooling_device *cdev; >> struct devfreq *devfreq; >> unsigned long cooling_state; >> - u32 *power_table; >> u32 *freq_table; >> - size_t freq_table_size; >> + size_t max_level; > > Could you rename it to 'max_state' ? Yes. Thank you for your comments. Regards, Lukasz