From patchwork Wed Dec 18 14:20:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13913765 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1549970819; Wed, 18 Dec 2024 14:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531655; cv=none; b=Unn/X1GEzYbN1VZautTi4ouGWM2B+dXLxT3cr2IDfvFJ9J7qRfeFdogYJVjLl11Sx3tieYENdU6InbaA1DhIFcHx5YjVCTIZ3ddFE5sBhxtolXCRZa515j+8DtVHGghmrGND3D0EqCWr04/larzZmtbvKnSHhtMpwMtGIYruLq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531655; c=relaxed/simple; bh=w3gF/r4BB1ATsGbLCnA93cumxvQTXrlpcz/mT/97FSw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XbUK4XnsycnFDGYnCpHx9CUphd6j1ea/IofhTSw8/h1SHwh52EYbP58pYHhovcb+iQgbRX4mhdwbAXT99fp6euFA0ZDej3GWC6nE9Q/3y5dcTwB0mycnaFhkwbrwRfSYT5UMGCm8ETsTfv+NLYNhnRiSGdNYSR+RY/uqoWDfm84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LqvzIN7w; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LqvzIN7w" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-385df53e559so5293983f8f.3; Wed, 18 Dec 2024 06:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734531652; x=1735136452; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s/+y/YSUxPtfDmBJdtycZ9jo8pi4P6L+XpuOz8AqooA=; b=LqvzIN7wqhuzzCzKFNIBEhM1RZcWi+W24tx6OftV+0R5/+jsgj9lmgVbEzgVcL2xN4 bC8kQ1OdXoOT39h/mjAZ1Znm+hw3kB2QFYvHejJlz8ytuL4fFDqh3YRtzYDU6QGRfOYJ 8Z2PylBY7kHhe0yueCxjN/NnOl3l4Ll3CSm1FOeTEE5aCfS92PrnDi05a604jqBZTvdO RHweV8MQHOQeNenF/AOSBlvGfap04/Xq6UzGceSPehDKQ/1hmUDAbBIxlNwkZCxcutN/ kPUh9LXOnRfzOP53MrjN0iO4DfygcXogkDidb79CO7qz66XRgBR6woKXxvp35EitY/8J CaTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531652; x=1735136452; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s/+y/YSUxPtfDmBJdtycZ9jo8pi4P6L+XpuOz8AqooA=; b=s62eac0qXd/8v1yTSl0XVL8DC9E+xmdDfQiJCc1vHgOGKifPMHWKt7fxO8zZ+bz8ZA 5vL/spNMYT34DNZe+rmn7Ps9FPg32UfmkFtz9NnxZ5nQHyApwiRwHh/AMRBEK2eRkBpt Saio1BgLMhfyQDp/f1QgpwRgtEH+Z1etKdfbuXSml08JjihAyt6pdw+k9+gL/uW504Fl q8qsBp/ev80g02dJKjAccZM9dJUbYk1odIMBEzyxX+j68F3EWzY8AlMJUKwE51AwgPyv ABhr9AGqtVjhqp7OtJaOIX3E6KLY+qFfe0QiNWirjGrFeYx8BoMCv+w6Tw0t/KdbPYhu KEsg== X-Forwarded-Encrypted: i=1; AJvYcCUXohMUj9ZbVGhWW82Swr5jcNzb7T9e2W5e6K/Kk3Z1atdP9KE5H7pUJyzbvNPAvzN/sKVUjV5RV/KK00jv@vger.kernel.org, AJvYcCXji+BS3jaH4lzqJsifDj7Vke+KEIMK64FUvDMABg2NSfbxDwPzxTNp4ZOo70qPRZbe7YpxEHLX3CA=@vger.kernel.org X-Gm-Message-State: AOJu0YwFh1BTTRqmXiNKd55L4u7JUhWxNlijRK4bz/h0K/DrEarhncig IZPnaoavigbJx4zXDSxmwb8np8oIpi/JbOmi3mlAwBZ1ynQxVYTm X-Gm-Gg: ASbGncss35sRKKmhwSVennAKpGh+Mvh6Rq911RZh7DmjIGsRxEf8VGdqxy30GlBW0xv /xjSrx93cKpYBVyomUh3/pJeydwFV/fAnBJMhnJlt3uDugX5MD0HsZ1XibPN2epTSLNaNsHF1U9 X8OF13nhjT34HjZfCI0z1b4c0gm4XKArUSJeoxEZ7Hm2o1zwRAF58E7FwkyLFNRXfls6hkzP9BJ FDJGNPbxibFBTh9WJj/mVXBLcaqTVF9peCqg7kxHWWdRYDVFrnKHr8jIEIuR4oTr/ANjj9h33u8 lxPi69qAmw== X-Google-Smtp-Source: AGHT+IEG3STtRHw+ncLc1DbtulvKP7OjyY10VgRPs0+i1Bs5Rmn0XyXuwSpqZlcaS/5mLuwJ5uqslA== X-Received: by 2002:a05:6000:4916:b0:386:37f5:99e7 with SMTP id ffacd0b85a97d-388e4d64938mr3055400f8f.33.1734531651992; Wed, 18 Dec 2024 06:20:51 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:9516:68be:c7cd:69f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801ac68sm14107033f8f.51.2024.12.18.06.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:20:50 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 1/5] clk: renesas: rzv2h: Fix use-after-free in MSTOP refcount handling Date: Wed, 18 Dec 2024 14:20:41 +0000 Message-ID: <20241218142045.77269-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Avoid triggering a `refcount_t: addition on 0; use-after-free.` warning when registering a module clock with the same MSTOP configuration. The issue arises when a module clock is registered but not enabled, resulting in a `ref_cnt` of 0. Subsequent calls to `refcount_inc()` on such clocks cause the kernel to warn about use-after-free. [    0.113529] ------------[ cut here ]------------ [    0.113537] refcount_t: addition on 0; use-after-free. [    0.113576] WARNING: CPU: 2 PID: 1 at lib/refcount.c:25 refcount_warn_saturate+0x120/0x144 [    0.113602] Modules linked in: [    0.113616] CPU: 2 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.13.0-rc3+ #446 [    0.113629] Hardware name: Renesas RZ/V2H EVK Board based on r9a09g057h44 (DT) [    0.113641] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [    0.113652] pc : refcount_warn_saturate+0x120/0x144 [    0.113664] lr : refcount_warn_saturate+0x120/0x144 [    0.113675] sp : ffff8000818aba90 [    0.113682] x29: ffff8000818aba90 x28: ffff0000c0d96450 x27: ffff0000c0d96440 [    0.113699] x26: 0000000000000014 x25: 0000000000051000 x24: ffff0000c0ad6480 [    0.113714] x23: ffff0000c0d96200 x22: ffff800080fae558 x21: 00000000000001e0 [    0.113730] x20: ffff0000c0b11c10 x19: ffff8000815ae6f0 x18: 0000000000000006 [    0.113745] x17: ffff800081765368 x16: 0000000000000000 x15: 0765076507720766 [    0.113760] x14: ffff8000816a3ea0 x13: 0765076507720766 x12: 072d077207650774 [    0.113776] x11: ffff8000816a3ea0 x10: 00000000000000ce x9 : ffff8000816fbea0 [    0.113791] x8 : 0000000000017fe8 x7 : 00000000fffff000 x6 : ffff8000816fbea0 [    0.113806] x5 : 80000000fffff000 x4 : 0000000000000000 x3 : 0000000000000000 [    0.113821] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c0158000 [    0.113837] Call trace: [    0.113845]  refcount_warn_saturate+0x120/0x144 (P) [    0.113859]  rzv2h_cpg_probe+0x7f8/0xa38 [    0.113874]  platform_probe+0x68/0xdc [    0.113890]  really_probe+0xbc/0x2c0 [    0.113901]  __driver_probe_device+0x78/0x120 [    0.113912]  driver_probe_device+0x3c/0x154 [    0.113923]  __driver_attach+0x90/0x1a0 [    0.113933]  bus_for_each_dev+0x7c/0xe0 [    0.113944]  driver_attach+0x24/0x30 [    0.113954]  bus_add_driver+0xe4/0x208 [    0.113965]  driver_register+0x68/0x124 [    0.113975]  __platform_driver_probe+0x54/0xd4 [    0.113987]  rzv2h_cpg_init+0x24/0x30 [    0.113998]  do_one_initcall+0x60/0x1d4 [    0.114013]  kernel_init_freeable+0x214/0x278 [    0.114028]  kernel_init+0x20/0x140 [    0.114041]  ret_from_fork+0x10/0x20 [    0.114052] ---[ end trace 0000000000000000 ]--- Resolve this by checking the `ref_cnt` value before calling `refcount_inc()`. If `ref_cnt` is 0, reset it to 1 using `refcount_set()`. Fixes: 7bd4cb3d6b7c ("clk: renesas: rzv2h: Relocate MSTOP-related macros to the family driver") Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/rzv2h-cpg.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c index 668a2880b2d3..23c89b0de38a 100644 --- a/drivers/clk/renesas/rzv2h-cpg.c +++ b/drivers/clk/renesas/rzv2h-cpg.c @@ -565,8 +565,12 @@ static struct rzv2h_mstop continue; if (BUS_MSTOP(clk->mstop->idx, clk->mstop->mask) == mstop_data) { - if (rzv2h_mod_clock_is_enabled(&clock->hw)) - refcount_inc(&clk->mstop->ref_cnt); + if (rzv2h_mod_clock_is_enabled(&clock->hw)) { + if (refcount_read(&clk->mstop->ref_cnt)) + refcount_inc(&clk->mstop->ref_cnt); + else + refcount_set(&clk->mstop->ref_cnt, 1); + } return clk->mstop; } } From patchwork Wed Dec 18 14:20:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13913766 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 749F01B0417; Wed, 18 Dec 2024 14:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531657; cv=none; b=oWLEBhNC0I5QZ+BO6hDjrT6lZGkC0X7lBIhPAsM/i0sFa9hV7hYvqaltq2N9cJtRHDH6Vy8W8Ty5aI2bIkIQDTIoGIs0JHEWspP2Upk3ioqDEQ6nwg6jdNVhozAzqrd5wRqlfcz4y7LWkIOvlLbVcGPXC7CVphk0XFcnw7qhhbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531657; c=relaxed/simple; bh=9tmBVqrl3cCt1vbcckJCfwPjMaR/yc9CnZVg0J72dCk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fM1z2DvvLb21262/X5PQXAD6bmqd2b84hpboCc1vQY6EE79rRYue6xHA+CLy6SK+RUBQByF3rTWa+4PRa/yEhr/QWvLA1vRdgpD0B+ecyV7qfHrF69GqYl/NsV7fcBOIsAN749LI6N1oz1r3EDZoHUXEnmSw0/KcoYREjC2mOfQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z3y5I2zd; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z3y5I2zd" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-382610c7116so3542382f8f.0; Wed, 18 Dec 2024 06:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734531654; x=1735136454; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g17UO33YdBwmO7DGR3pIPrhlIJblMqxcqNmPlgeEQYo=; b=Z3y5I2zdR5xfVfDOYM/Wc3oV25J/qjYHMfgYP0BJi31x4aTttaYG9t3ZhSESWAI4CN UPLETMITef0jJZKrj/n7TBBUlfr+fJN/pDhcoUuKJW0aioRXSI8L8BNC9+I4Bvfrj/+0 y46GgBRyiq2RZbZoz0W7JoMj/NeWihQlQ5JEiXCBqzvWeoCs2PfhU4dzqTOdAUZ5cWiM /9R6Vcb5wIrypg+izPV4Zq6Ic4YND6hZN+AAobZNeKurajyOXoKtLAIcwCg+PBUcTR34 MroM/zhMVl8QqoYa+OjDU7Ct+/NL3I+Oniy5M46MxE4KJ/4PMADGWhLbqWuM0lAtqH5K 4HnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531654; x=1735136454; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g17UO33YdBwmO7DGR3pIPrhlIJblMqxcqNmPlgeEQYo=; b=OCB5zrFkMr08CP191WVg6L5U+xdmWUrPI5l5qW3LgYuX6b7KP74QBHrrocKy0dRdxz 7QW2TvpsxHWJrHSXKqaq82BFq0JfbX54Ri2vfWU+J6SEyqHKGncH4A0kMUfKLE2FUBeW 0j4dbwWaix8P6YSiO6n9Bs3FUuK37FVvMS+6TpUSXPrb7dEYcaLwq5lUYhbw1MVXrcLu reFQKoCSLvlZiUjF+8Hi8B9u50hgGR6hHBv2ReIKDqg3WEEpDgYda62VjyeAEZ4Nbj/z UNXN4DURHsnatVYb49Tz1tx3Og1quugJqg2ORf+/KxhcC8TrvoPkrBIkpWwudhA/K5hB ljbg== X-Forwarded-Encrypted: i=1; AJvYcCUZVTfdKIauZLECTJmGtfGCmsYxxi/BMt/pRSkjWQSsMImTk+dgakMTtLX/Ze0kHAIL5bIpXiQbcXY+E+T+@vger.kernel.org, AJvYcCVDYg26Gd1BazzuJXQXfVDLIYfz3xvVtS1SbYSYIVOS1ZWX4r9WfKcymbzILFTn29/DeP1X4i4AQlw=@vger.kernel.org X-Gm-Message-State: AOJu0YxjANhyqLtk1H8oXoz14DpJB1Bfn8vNQ9PeuX8nGuk48qHdGx74 3p1INSehtqlQwyRjUseI+08FElsGLb04ZX/nwyn1YDc9cq0CIUvw X-Gm-Gg: ASbGncuG188g1hGJpR9nlyN3LAauGGhCzybvZfgIjdW5BPVyr2SSXv7cS6DbfYCzmiW oDFKnnI2q3SVxH2rMEQYEQmzFHX8ZzuZw2VgTG6kyGPGAgivnWPRh3/PZVrqNrS2jMOInXPiBWN RPVC8ZEAlgrWyjC04zHFaf7ohgGGV6RlVnvC8tWAGpl+pMmHC4AwLkKZqCOSohw0g87XFE1qSuj Ilc4v1F1ZATGYVC6LM60UbvqIax//iFnmFTTOoy7Ql3bzPH3R4NNxH5MZt3zSF4BSobSjVyobMv ZwPk3QdA4A== X-Google-Smtp-Source: AGHT+IEJUQOo3uYoWkP6M4yW2w+umZSx5Uf/nQl/QX8/jpX4Zo5fL/mVEUOSEej8ij836pYJ4hqSdg== X-Received: by 2002:a5d:64e9:0:b0:385:e3d3:be1b with SMTP id ffacd0b85a97d-388e4d574f5mr2745400f8f.28.1734531653533; Wed, 18 Dec 2024 06:20:53 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:9516:68be:c7cd:69f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801ac68sm14107033f8f.51.2024.12.18.06.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:20:52 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 2/5] clk: renesas: rzv2h: Relocate MSTOP-related macros to the family driver Date: Wed, 18 Dec 2024 14:20:42 +0000 Message-ID: <20241218142045.77269-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar The `CPG_BUS_1_MSTOP` and `CPG_BUS_MSTOP` macros are exclusively used by the RZ/V2H(P) CPG family driver and are not required in the SoC-specific clock driver. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/rzv2h-cpg.c | 3 +++ drivers/clk/renesas/rzv2h-cpg.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c index 23c89b0de38a..38edddfc42d9 100644 --- a/drivers/clk/renesas/rzv2h-cpg.c +++ b/drivers/clk/renesas/rzv2h-cpg.c @@ -41,6 +41,9 @@ #define GET_RST_OFFSET(x) (0x900 + ((x) * 4)) #define GET_RST_MON_OFFSET(x) (0xA00 + ((x) * 4)) +#define CPG_BUS_1_MSTOP (0xd00) +#define CPG_BUS_MSTOP(m) (CPG_BUS_1_MSTOP + ((m) - 1) * 4) + #define KDIV(val) ((s16)FIELD_GET(GENMASK(31, 16), (val))) #define MDIV(val) FIELD_GET(GENMASK(15, 6), (val)) #define PDIV(val) FIELD_GET(GENMASK(5, 0), (val)) diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h index 9be5a312fa96..810275eba473 100644 --- a/drivers/clk/renesas/rzv2h-cpg.h +++ b/drivers/clk/renesas/rzv2h-cpg.h @@ -35,7 +35,6 @@ struct ddiv { #define CPG_CDDIV1 (0x404) #define CPG_CDDIV3 (0x40C) #define CPG_CDDIV4 (0x410) -#define CPG_BUS_1_MSTOP (0xd00) #define CDDIV0_DIVCTL2 DDIV_PACK(CPG_CDDIV0, 8, 3, 2) #define CDDIV1_DIVCTL0 DDIV_PACK(CPG_CDDIV1, 0, 2, 4) @@ -47,8 +46,6 @@ struct ddiv { #define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17) #define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18) -#define CPG_BUS_MSTOP(m) (CPG_BUS_1_MSTOP + ((m) - 1) * 4) - #define BUS_MSTOP(idx, mask) (((idx) & 0xffff) << 16 | (mask)) #define BUS_MSTOP_NONE GENMASK(31, 0) From patchwork Wed Dec 18 14:20:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13913767 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFB801BEF7A; Wed, 18 Dec 2024 14:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531658; cv=none; b=gXTT2Z0S6+VM/4GhqYM1vbs/wazr58upN7qCow82UorOiZ2oS4DmnIafMvyXUUpT0dZwS5O9lBXw6W6fQ8Zq3urMyDFLAAWy9ukiNuJRHw5XnUjbIy5ALjhMLUgII4vsA/W2NKNKQ7bzvSAUYGw+56Yf1sa7gmVEDiRxHhw4Ux4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531658; c=relaxed/simple; bh=SrBM4xqAfZOzEOBXFD+pJDwrNKD6dUCsFCv8SJQ/TQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YhdC55pnVQnXb+ETA7TAqPgqpx22llDCUUwNsJU3NozGcm7Cl4YhwtVb2l4KLZh5Vwbw03sx5WrEo5u8u+r+GTeBsJZaomb2aAX15ooAGS/gNbrtxCjPZz/FphLVUQ2jL6gb+n4QSZiuo7ifbqNHlIR5xQFPABkGMIcvPzJYo8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bxbQ/Wx5; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bxbQ/Wx5" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-385e06af753so3393759f8f.2; Wed, 18 Dec 2024 06:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734531655; x=1735136455; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2JLKkZD/mqACjYyo1Roz1R7qdTK6jveAjWy7QXVt610=; b=bxbQ/Wx5Cqwdj78TubQp+gi0qxX7cfZSCvgZFMHwrVfFNZvy9rCIroDpwS+N25yZgE FlMyEoiifAgrJMho7VaXvDJ7YK7gx6ya7tuppVjXkftPzco6sWcoxt0+kY83/Kr+JUjg AA5qqfvYFlGZxg6NGxN1xHmTTwH/Hffk9VZe5zelbYtzklxBi7HYICZW48uqgoIojYS9 /mXrmfea+4mNovboAtNztNQbOYM7qUuW59OJaqqTcE4cuoKcONPsWPITDlRf8d9rTuup ZcJfhpgXXn+6tSwZC/8d+oCvLOViRL78kLb3O/J1uceC5tW2+hvucyLXsyuxXK0aPA0H tytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531655; x=1735136455; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2JLKkZD/mqACjYyo1Roz1R7qdTK6jveAjWy7QXVt610=; b=KWxsPm5jXl0Ctd5KqJkVijMuu1QVCYiTelReF7XbKbCEL+IEsa98kY2ieLL+IP3oG8 AKfzd8z2QebCIZUFWMX2s2WbwdJPmME7qtaW/Ml4CvcPEd/iRojrQ1EVvebRpvDV3zaT mH/6kjC7skpW3vgU6KuOlmwh2YtZAVYyG0MA5wITJMgAhdpDO9ltipjyVg9re1a9ImIP UIVZ2E9nmniVH2VXLLEU7pQJYW3KXLmss+/7ytN14UWit1lD89xgjSqP/JJXXliH6Gn0 SeyjZXTphPPyuGimPoiqev1BjhYifeLqbvoE7/4vH8mbpJw5Rj4AFfO3cG/hTFXX2CTN k2zQ== X-Forwarded-Encrypted: i=1; AJvYcCWEnjPJowEJctqSGNtdqeD5411IZctgo2PruEN17OyyjEPmClk/VQ63DZKCHU0xEeHWvhvfgTIJJz8=@vger.kernel.org, AJvYcCXwpKfXTtkdJuSeaS9d48Yy82kNkzUaRYxYO7RTw6KTJN+YEPx/W6u+5NNw+YUAIz+7ApcG8LzCVCs7yFcl@vger.kernel.org X-Gm-Message-State: AOJu0YyBqQTwm5oRmehIJYW3tmVWf7F6dOb7UyDcb/LwRh6zrjrlLoj/ iIpwEkF5jB4Hw08nW+9/iU+wWVKek996d7Dk10YuTOGOs4tDAY6KCz1XOQ== X-Gm-Gg: ASbGncuLuJmt53+bN7udsCwaMn5bqe5OiUSGRFqJThmkx8mJJ7J9I5U1y4UfOwHNgMt HJc7jM+6m4E1804teL9IloRMxFrwE/Uu4AF0/2Tp3Yl9fnRARJ8GZGyeHlGZDUF6sy3dk5fc0b5 09l44zrZB6qqzn7AvIDRozGT5Vv+pc9av1eUdFN6PSMqxOXk0FEye5D0/idSMfesUlCoeAcoata MAek1NBq4WNkdsGgk2PxxAS8reSk5priL4Kg16Rn296ClH2S1AbZU70+1qCw31C/vwfcvc/BLZx JpbiiQwhlA== X-Google-Smtp-Source: AGHT+IGbYC5OOnjUzvLlXIbCkpWMp6vz2WcxhoipNrfrLtop3QJ+w8l2tV/ljUnvlf8Hn5zk89l4ng== X-Received: by 2002:adf:e190:0:b0:386:3e3c:ef1 with SMTP id ffacd0b85a97d-388e4d9201cmr2867632f8f.35.1734531654923; Wed, 18 Dec 2024 06:20:54 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:9516:68be:c7cd:69f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801ac68sm14107033f8f.51.2024.12.18.06.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:20:53 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 3/5] clk: renesas: rzv2h: Simplify BUS_MSTOP macros and field extraction Date: Wed, 18 Dec 2024 14:20:43 +0000 Message-ID: <20241218142045.77269-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Replace manual bit manipulation in `BUS_MSTOP` with `FIELD_PREP_CONST` and `FIELD_GET` macros for better clarity and maintainability. Introduce explicit masks (`BUS_MSTOP_IDX_MASK`, `BUS_MSTOP_BITS_MASK`) to improve readability. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/rzv2h-cpg.c | 4 ++-- drivers/clk/renesas/rzv2h-cpg.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c index 38edddfc42d9..29b1ce003370 100644 --- a/drivers/clk/renesas/rzv2h-cpg.c +++ b/drivers/clk/renesas/rzv2h-cpg.c @@ -582,8 +582,8 @@ static struct rzv2h_mstop if (!mstop) return NULL; - mstop->idx = (mstop_data >> 16) & 0xffff; - mstop->mask = mstop_data & 0xffff; + mstop->idx = FIELD_GET(BUS_MSTOP_IDX_MASK, (mstop_data)); + mstop->mask = FIELD_GET(BUS_MSTOP_BITS_MASK, (mstop_data)); if (rzv2h_mod_clock_is_enabled(&clock->hw)) refcount_set(&mstop->ref_cnt, 1); else diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h index 810275eba473..f918620c4650 100644 --- a/drivers/clk/renesas/rzv2h-cpg.h +++ b/drivers/clk/renesas/rzv2h-cpg.h @@ -46,7 +46,10 @@ struct ddiv { #define CDDIV4_DIVCTL1 DDIV_PACK(CPG_CDDIV4, 4, 1, 17) #define CDDIV4_DIVCTL2 DDIV_PACK(CPG_CDDIV4, 8, 1, 18) -#define BUS_MSTOP(idx, mask) (((idx) & 0xffff) << 16 | (mask)) +#define BUS_MSTOP_IDX_MASK GENMASK(31, 16) +#define BUS_MSTOP_BITS_MASK GENMASK(15, 0) +#define BUS_MSTOP(idx, mask) (FIELD_PREP_CONST(BUS_MSTOP_IDX_MASK, (idx)) | \ + FIELD_PREP_CONST(BUS_MSTOP_BITS_MASK, (mask))) #define BUS_MSTOP_NONE GENMASK(31, 0) /** From patchwork Wed Dec 18 14:20:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13913768 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DD6D1C548A; Wed, 18 Dec 2024 14:20:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531659; cv=none; b=HT3XdlWExQAnXDr9h9gYj/zs8vzXJnhliMsSiGp0EkKZQuqWDHMhDz7o5xGZG16cpOGEhm8NbuQwm2ftWhyihDe4Wiv+/Y0WCevvx6ux+qNAMtLym/r5ruzhGp9iIwlZXk+6bIQal1Lz7LaHQfLMOzQVhtKcGaEgebxZzJHKNtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531659; c=relaxed/simple; bh=G0VcbygjrcIvSCsXXo7R+ukCzSn8AMxD8kp172+o8eY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l1Zfrp3Qn9r13UciCQkDVgc/8RFvhiMJjYqGHWS0FOdOFhFHWPyUvcCoKD46FoC//ix1JruZRoUz13y9NDnmW52EzFpHMh00p5OVUu7rMOzu0IrqnGCH53uY44LdFr2NlQMO2468sP5DLxObT7L5OTcMe15DIPqnlJM3NRIvBh0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dUNkSP40; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dUNkSP40" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso47412415e9.2; Wed, 18 Dec 2024 06:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734531656; x=1735136456; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9IQX8JtRRxJc8M4IW22Ze/9Y9MdVzCSkoKVYjbAlY6o=; b=dUNkSP404cI/fP0nE4bStF9l3zrqDJWs5FK4g6kaiyyaQI388JZnlsHIG/MidShWpv qGD6KSmvVY44PzhgRKmaBKSkOkYEQPU6VvJ8N84N8JbfCugRO715sjbbt7ZYTC/MFkpH owhEYRKvbUZjwB3M5OfhgV1fcMkHMuDJJGLM6fGTBWB6Ui4kNcRQBzKGaFjpOJZ3T/1y RLDvaDQv5C0xRu3m6ngFZ3OX+a2xld5YEmEWWxNTbmIHKI4pLP0vnUYwlhdOTxXk0xZO TIbM2o+J9gsFGizHdlRqAjWyQK3erjLmv/hQJ+htfK5fOux18V8bPhSGn7ZyJydfkzje zX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531656; x=1735136456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9IQX8JtRRxJc8M4IW22Ze/9Y9MdVzCSkoKVYjbAlY6o=; b=PzU7p7X8jF32GshoZaC8Ukv0CednIVpIyl0tdWdgmnB9UhdHTKjgBA7qnex+GBuapz +ScqgEvjDn4BTjhNbuYZUntpIEVfz1g60Ek3vlZQwpqtz3UF9jzx7ZcfhKM7pG9W6M65 faeQMTSTzJNQels4o4XnRchur1W4nJaddB9wMEFk9lZfFVUlbukWz06jsnay1Hp1pB5p AMY/skDNM+xyoUsqiQtX+ea5N4fkzH9oe6VNFXwSIkfVam3oFBI2Pw4PWSTd/UErOS1H FCAQ/DqFzAaXSoqPr0onchWxqLQmN6ZrvHN9HbSoqVNblxbWeArJWkXk/21w2HK8scPa cNJg== X-Forwarded-Encrypted: i=1; AJvYcCUpeSBT0JNKU2FwrZgVIdAFqvsgszBt4bYlO9W0KQB6AVPTsVZCBNVKE19jIRvKowHUnwlbGiPeJg4=@vger.kernel.org, AJvYcCVWwL996bCum9OcuuxNIy45NSpbCC6j2ZZ0svbp8bAPG1iC3V+UArTHrJCfIY1cOv4aOp2fplPwyf4ge8ik@vger.kernel.org X-Gm-Message-State: AOJu0YwKRv4sG1mJ5gKV8fd8LwPxWIIaWGzIPMIHJWwUeTyY+2P2rhGV rEy2Lque3QZO7gHvk3PwMwRWQSz0qMCzcrhzsUVMXJAshYr4vdlr X-Gm-Gg: ASbGncs7KZnRTthcaxywQ3FUv3Cwnh4VMZM3tLnQPouX1B5YUUfIzVfqHlAc4BZqVUg vNnewFxHC6YToiob/tlFx+QrFc5ygLpZUoZMNcDwEdReI2lcIyf9DoeMlQlCzaKn0VXJFPOLGOP NusD0eTQfy4I+/S4nMnOy6jzVUtT7wYbe0fTnvG/bh+ZUYrfAXvCRuy630U6sOsdGR1XWcvHbES IRqY1mn8OiPYmQKSEVnyLmsCrIQ6/w0AGYTvhUyvH3CUK6/2sPOVOg+9ogGIi0Rs3uOaDfhgDEp saKNliLRjQ== X-Google-Smtp-Source: AGHT+IEQgaEiwxhKe/AuG12I/7pbppaenI9ZtWHivFdKeBv4lMOeYTSeg46XFOWVw8KMhDHxgagGLA== X-Received: by 2002:a5d:64a9:0:b0:385:ef8e:a641 with SMTP id ffacd0b85a97d-388e4d5864fmr2884139f8f.28.1734531656388; Wed, 18 Dec 2024 06:20:56 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:9516:68be:c7cd:69f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801ac68sm14107033f8f.51.2024.12.18.06.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:20:55 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 4/5] clk: renesas: r9a09g057: Add reset entry for SYS Date: Wed, 18 Dec 2024 14:20:44 +0000 Message-ID: <20241218142045.77269-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Add the missing reset entry for the `SYS` module in the clock driver. The corresponding core clock entry for `SYS` is already present. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g057-cpg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a09g057-cpg.c index 59dadedb2217..856a02ac7ac5 100644 --- a/drivers/clk/renesas/r9a09g057-cpg.c +++ b/drivers/clk/renesas/r9a09g057-cpg.c @@ -220,6 +220,7 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { }; static const struct rzv2h_reset r9a09g057_resets[] __initconst = { + DEF_RST(3, 0, 1, 1), /* SYS_0_PRESETN */ DEF_RST(3, 6, 1, 7), /* ICU_0_PRESETN_I */ DEF_RST(6, 13, 2, 30), /* GTM_0_PRESETZ */ DEF_RST(6, 14, 2, 31), /* GTM_1_PRESETZ */ From patchwork Wed Dec 18 14:20:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13913769 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8534E1C5CDA; Wed, 18 Dec 2024 14:20:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531661; cv=none; b=HhKo+gSlQGxqyQVx4I57oCdWvMt8dEyffxib5bPL8FrtuEQXmh38UofZNq8yrnI8hGvO4XbI5G0Kmz57XxYsu2HUK6KDl1xr4fOhpy29Nhe2moIMeHPNjhQ8NnLbOMoClvGVNm0sXX/d4okKSZnG4Ep5+KSU17qybFxojPE5MDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734531661; c=relaxed/simple; bh=ZdUn1eZ8PxzARU+wmajVvceff/9hM5OkdTDmgJirXes=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fUAAJ0NatfrcIAX8mXtG/aGkn2PKGuyycvSceQLx5w2vC2YMSAikSLh/5mbViUkqSq7zOyd3fmQHJH6+L2PDSRmX/ENms6DL4SVMwSGEz+dO/rUM+4U4fG6tehvlj7vC2EOgr0sjTyzzitIeKDqB7GErEumNusvaGGPRJoeqpyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nFdW+Qkn; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nFdW+Qkn" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3863c36a731so4732634f8f.1; Wed, 18 Dec 2024 06:20:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734531658; x=1735136458; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/wPRBxwXQr6qi1bj2F1wQGHx6oV7CcRt3Wr/kJbxfbI=; b=nFdW+QknA72GgBVNptx+QKtPHtqKvSTgKmQqfciLcZh+RVMLiw58EPNDsK4s0OZrc9 LVRm9y4eSoyKOix+O3t1X1OeIHZK0YQW7BKsDxzef6BJqjU96YzE5EL+2rfB6DxqRpKK AVLHubuMaHBSbwlmwzm2NQ0iYqneW2htO/yEQVawka5TRj/Ed//RKaEQ5X0uz016yd2e 4jSXQMXbeHhdVUBYDkx1gkH65fVHc13DlNtuQrINtBcZpX6CTb+9Q4f0lXfBfzPz0jpe hTZTzcFAx/IJF4Day9/Mgl6pXYPmu2qVsrBRMPgHb4JC9fu17mnWGaZiORR1/O1rP9Ip FwYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734531658; x=1735136458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/wPRBxwXQr6qi1bj2F1wQGHx6oV7CcRt3Wr/kJbxfbI=; b=OsQOWVoCe0WWg8kPv0CXz90zGXoKA59xjrbxAc62UTBijldogauDkhLvspk9g5pBST X6XfPulo/3eySWIyKX1FnZIWD71l+Rs24u9QeuEIPs9pt8DYSsJiipcKgbAwkIJU9zEk nRzZjgHTvFhH8TQDAd0lXmlvLNl0Aep0/dMdndDDn/Xhsyc3HEaOk7aPL8s6h8P6ET2a n8V8xs6d/ZDIhHR3MDbDJj0iTtKQuNXL7aqKVwKtW6Q/n6LEJtHmvrZsztofw/Xk6smZ alSnx7RiYrUh9xqQnZpJm0tn2HZ1Z9X/U+zmWm1p0/4Wq9mTB0C7TN4FlPwqRNVFILYU YiPQ== X-Forwarded-Encrypted: i=1; AJvYcCUMBWIZf4xFCbgCoahW5U4O/rtuhCJkF3JMfZVhtdMalN2YwewV0Qm2veCz/1MvEM8MN7xOQYVHnhM=@vger.kernel.org, AJvYcCUzu+YzqjJNbUdFMMrI4jiqLyeO22KL6Qfz2T4MxoXtBchW1wrzMfSclku2x22CiXA/qCJvISJkRp2Yp1Kq@vger.kernel.org X-Gm-Message-State: AOJu0YxRMaZ+swP4uCb0jHW4lQACkeoayr4N5XLIXdvcmrF6LwT1R1Uv OJd9qcw1FZqDRobw5iKsrVvYUSKnz3GN7zyfJu+D1nFMV3wNAbYh X-Gm-Gg: ASbGncsUFCIGLsRhgOwzXTUDJ6oLX1yvp1kbd/GDoMTiIlCXFpi3RhXAqb3nE8E0L4S fIITC4frP52I4hP7oZbyjONH+ivsN6odaITZht1IHlbT+OjNkFFk+Cu1xd2uLBscbpASC17nixY UWsm+w1dApI6uVYnYAMsmfuJqz1spA+Xy+uAV+L02pY0I591ZHtX0MhBdWPThN4t5BvNfPCcOs6 4roM46r63Lt06m8VILo2aAh1VPAmBkVL0HuF9TgNKzpNtqfuPqcloplzqsTKQuvhDFe2C/xkYC3 LFb/ykMspg== X-Google-Smtp-Source: AGHT+IFy23ae27JfhnUcgRwv/BCbx2Dk5qDQAWbELnkQVOZQ2tGejMuCe/hbp0wK4ILT/cYrsSOuvA== X-Received: by 2002:adf:b182:0:b0:388:cacf:24c6 with SMTP id ffacd0b85a97d-388e4d4afa9mr2051380f8f.22.1734531657667; Wed, 18 Dec 2024 06:20:57 -0800 (PST) Received: from prasmi.Home ([2a06:5906:61b:2d00:9516:68be:c7cd:69f2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c801ac68sm14107033f8f.51.2024.12.18.06.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:20:56 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 5/5] clk: renesas: r9a09g057: Add clock and reset entries for GIC Date: Wed, 18 Dec 2024 14:20:45 +0000 Message-ID: <20241218142045.77269-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20241218142045.77269-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Add clock and reset entries for GIC. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g057-cpg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a09g057-cpg.c index 856a02ac7ac5..947efb1a5914 100644 --- a/drivers/clk/renesas/r9a09g057-cpg.c +++ b/drivers/clk/renesas/r9a09g057-cpg.c @@ -117,6 +117,8 @@ static const struct cpg_core_clk r9a09g057_core_clks[] __initconst = { static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { DEF_MOD_CRITICAL("icu_0_pclk_i", CLK_PLLCM33_DIV16, 0, 5, 0, 5, BUS_MSTOP_NONE), + DEF_MOD_CRITICAL("gic_0_gicclk", CLK_PLLDTY_ACPU_DIV4, 1, 3, 0, 19, + BUS_MSTOP(3, BIT(5))), DEF_MOD("gtm_0_pclk", CLK_PLLCM33_DIV16, 4, 3, 2, 3, BUS_MSTOP(5, BIT(10))), DEF_MOD("gtm_1_pclk", CLK_PLLCM33_DIV16, 4, 4, 2, 4, @@ -222,6 +224,8 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst = { static const struct rzv2h_reset r9a09g057_resets[] __initconst = { DEF_RST(3, 0, 1, 1), /* SYS_0_PRESETN */ DEF_RST(3, 6, 1, 7), /* ICU_0_PRESETN_I */ + DEF_RST(3, 8, 1, 9), /* GIC_0_GICRESET_N */ + DEF_RST(3, 9, 1, 10), /* GIC_0_DBG_GICRESET_N */ DEF_RST(6, 13, 2, 30), /* GTM_0_PRESETZ */ DEF_RST(6, 14, 2, 31), /* GTM_1_PRESETZ */ DEF_RST(6, 15, 3, 0), /* GTM_2_PRESETZ */