From nobody Thu Oct 2 19:28:02 2025 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 701CE340D9B; Fri, 12 Sep 2025 18:38:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757702326; cv=pass; b=KC2K3571X+ZrASRwCKZud3pknh1N5Q3ae5fL5TCr+KeqknpJgf6ttiPyiobCOAp4V8Jke9dtcq/ksTCLa1CnZxRE5e767lGGP/I23Gq3qWC3xlaaKMRmK1U+nN0vk4wK838rLrS3j1v04aIScFuUfEXWzxTVwUPtJ2AXsjQk910= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757702326; c=relaxed/simple; bh=V618wGRJg/grXU1p4MD/yIGNYrNlm6vOBXPJBBWzmBQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tq2EhyMZ/nUIutgyMsC9/Sfhla+cyQDW0/9Wghc+QsfxVT9In29bO4x/uo/Yba9Ea1Zp9c5jNadfyhnFRPZqoYrMsa0THngAqYCpGJzxn4SNLtvAVZGnyAb+DUO+EBA7NACp1cn3tUTEWn5te+11DdAXgcozqVXRX6iCLYu/5po= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b=e/+Mq0lr; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b="e/+Mq0lr" ARC-Seal: i=1; a=rsa-sha256; t=1757702297; cv=none; d=zohomail.com; s=zohoarc; b=jYhju4p2xqEoKJTllo2yZ8ezc39M9zpj2Xqu/SFzebFUFnh2hHQcDybEkwpmJFNmOw2lNARHLKbxr9pokaxeMf7+gvlI5sPweHT/VbTlo86CUR96QUzZp+BqL+9Wrrg8XsLDWRw92MeTdUGAQKgpZz42fky5S5fcxiwlEwj4Cv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757702297; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=esTzJAps+Q9ohTe0smajF9MVNFiYXLuAoXALxngs7YA=; b=WcooTMWQVaZyIQf92UQ+g4GRnK2nuXy2EVr9xOLco9ijmvKH00vLhi7NIRA7OUeG1hp0Sf3WccLxrQfjoTelrG5IYvfgFaIQajQiGHRjIAQPlmGzGctl7swiXwbkcJ5MuFo7xntBLNN6L0wVfktOucYFo0N6RflE6f5y/xPPnmg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1757702296; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=esTzJAps+Q9ohTe0smajF9MVNFiYXLuAoXALxngs7YA=; b=e/+Mq0lrdf4I9fFWBSoBwTEBFQvysct6QKYHYTBa8a/U9AUHkhm/+MHoFRiRehV2 9MuxLF5eKdBav3TV4+Nu6aXYJc07t6uB7JVt1WNhFa6jn5Xz4SQYkHPyX2kW0k2FK48 k5SB/WgzK+tTTRo6wiBRVyzQM41yaptoFWZAmJdU= Received: by mx.zohomail.com with SMTPS id 1757702295104374.16826602133335; Fri, 12 Sep 2025 11:38:15 -0700 (PDT) From: Nicolas Frattaroli Date: Fri, 12 Sep 2025 20:37:06 +0200 Subject: [PATCH v2 07/10] drm/panthor: move panthor_devfreq struct to header Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250912-mt8196-gpufreq-v2-7-779a8a3729d9@collabora.com> References: <20250912-mt8196-gpufreq-v2-0-779a8a3729d9@collabora.com> In-Reply-To: <20250912-mt8196-gpufreq-v2-0-779a8a3729d9@collabora.com> To: AngeloGioacchino Del Regno , Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Jassi Brar , Kees Cook , "Gustavo A. R. Silva" , Chia-I Wu , Chen-Yu Tsai Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, linux-hardening@vger.kernel.org, Nicolas Frattaroli X-Mailer: b4 0.14.2 In order to make files other than panthor_devfreq.c be able to touch the members of a panthor_devfreq instance, it needs to live somewhere other than the .c file. Move it into the panthor_devfreq.h header, so that the upcoming MediaTek MFG devfreq can use it as well. Reviewed-by: Steven Price Signed-off-by: Nicolas Frattaroli Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panthor/panthor_devfreq.c | 32 --------------------------- drivers/gpu/drm/panthor/panthor_devfreq.h | 36 +++++++++++++++++++++++++++= +++- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.c b/drivers/gpu/drm/pa= nthor/panthor_devfreq.c index 8903f60c0a3f06313ac2008791c210ff32b6bd52..02eb3ca15d1874e1cbafc6b614b= 196c5cc75b6a1 100644 --- a/drivers/gpu/drm/panthor/panthor_devfreq.c +++ b/drivers/gpu/drm/panthor/panthor_devfreq.c @@ -12,38 +12,6 @@ #include "panthor_devfreq.h" #include "panthor_device.h" =20 -/** - * struct panthor_devfreq - Device frequency management - */ -struct panthor_devfreq { - /** @devfreq: devfreq device. */ - struct devfreq *devfreq; - - /** @gov_data: Governor data. */ - struct devfreq_simple_ondemand_data gov_data; - - /** @busy_time: Busy time. */ - ktime_t busy_time; - - /** @idle_time: Idle time. */ - ktime_t idle_time; - - /** @time_last_update: Last update time. */ - ktime_t time_last_update; - - /** @last_busy_state: True if the GPU was busy last time we updated the s= tate. */ - bool last_busy_state; - - /** - * @lock: Lock used to protect busy_time, idle_time, time_last_update and - * last_busy_state. - * - * These fields can be accessed concurrently by panthor_devfreq_get_dev_s= tatus() - * and panthor_devfreq_record_{busy,idle}(). - */ - spinlock_t lock; -}; - static void panthor_devfreq_update_utilization(struct panthor_devfreq *pde= vfreq) { ktime_t now, last; diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.h b/drivers/gpu/drm/pa= nthor/panthor_devfreq.h index f8e29e02f66cb3281ed4bb4c75cda9bd4df82b92..e8b5ccddd45c52ee3215e9c84c6= ebd9109640282 100644 --- a/drivers/gpu/drm/panthor/panthor_devfreq.h +++ b/drivers/gpu/drm/panthor/panthor_devfreq.h @@ -4,11 +4,45 @@ #ifndef __PANTHOR_DEVFREQ_H__ #define __PANTHOR_DEVFREQ_H__ =20 +#include + struct devfreq; struct thermal_cooling_device; =20 struct panthor_device; -struct panthor_devfreq; + +/** + * struct panthor_devfreq - Device frequency management + */ +struct panthor_devfreq { + /** @devfreq: devfreq device. */ + struct devfreq *devfreq; + + /** @gov_data: Governor data. */ + struct devfreq_simple_ondemand_data gov_data; + + /** @busy_time: Busy time. */ + ktime_t busy_time; + + /** @idle_time: Idle time. */ + ktime_t idle_time; + + /** @time_last_update: Last update time. */ + ktime_t time_last_update; + + /** @last_busy_state: True if the GPU was busy last time we updated the s= tate. */ + bool last_busy_state; + + /** + * @lock: Lock used to protect busy_time, idle_time, time_last_update and + * last_busy_state. + * + * These fields can be accessed concurrently by panthor_devfreq_get_dev_s= tatus() + * and panthor_devfreq_record_{busy,idle}(). + */ + spinlock_t lock; +}; + =20 int panthor_devfreq_init(struct panthor_device *ptdev); =20 --=20 2.51.0