Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3314790ybb; Mon, 6 Apr 2020 06:35:55 -0700 (PDT) X-Google-Smtp-Source: APiQypLDe3zhOKCUOIFFYIbC6bGhuh0AuUWVpIixktzwU0kJvMr7ZnpKkn5v+rzOroH3ldll1eeG X-Received: by 2002:a9d:69d5:: with SMTP id v21mr17957908oto.197.1586180154940; Mon, 06 Apr 2020 06:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586180154; cv=none; d=google.com; s=arc-20160816; b=wQB5bhUaX0u1ZduyGqnuo15MOR2SkWwKeZQRQpodss+mMC1SpBQhCaiTJpZ8m/a/bX DbVAuqpfptKnd5twaFYGp0eIr0sM+uOhLQDLrEUUaq7JOOxB25U+4IpgA5ALPk7v1ceo o/e1WDUPvR7pkKC5Dez2FXZ6gFvDMSpI65obwflY/yhSBkmaLDJ+jKcQVObRgvbkWBb3 3GoFds5+NC51qobQdMZiKiqxOHR3AxZwoPK7jUH2KbwLsde1xrnbPcJgEZtmQ1retsCm t4vwMdD53jko2duT1pCjwxD6wLCScf41+SI0zt10AYEI2BjWvyZL2rQS7nDOldQ38YPj Bgvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=vsOMNyRXOgj1tl6wXGe0CSKYCHTO10R5Qg/TXrh1DUA=; b=S50dvlPMqMBsKE64nm+HczOh2StNtujrwBRlalky5cZjqJKL3t1YqvOZeuAXLfGVxR gDBfe7H9wZTRQmSpKtIXsgzXz0Y3L1oKHYlC+iMs1Xydcc2YDmgGdrazPQMqvinXaesx 4kRpoI+RMh5URHR6hXvhDrps23GHBPkuqPMxY1Y++73M+kh4l8NjRDim/WZ27bnNrB2k y1GU0LupZP2bJnynDegPYYp0a23cPfNTEU+AME0nLII/35M5OXbp6wtE2+bU5w9ahWDa Oe7MRHYJqrKq6E7Y98ks96ExG4YThD27J0GCkKpNS5sqB6Zrm/wjor1sdWuw3hiNHfFk G1mg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 192si7506427oii.36.2020.04.06.06.35.42; Mon, 06 Apr 2020 06:35:54 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728489AbgDFNfT (ORCPT + 99 others); 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