From nobody Sat Apr 4 01:51:12 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 7FF7C3806D1 for ; Sun, 22 Mar 2026 12:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182272; cv=none; b=jKHsP2Ax/Dv2reLm6sy+L1EJCefeB2zl8lrhGbgWOlxdqcOsdJ5uOjeZiuDY9wqMFTvg9t6Y+Fu1bwCEERN7XP82KkGwy6lmVR9R1owiYsBO4R16f48iOxZBZp9oadX4qYQvf32NTWmC9aULLUEdW8eSWktMGvDLE9MwSMNK4MU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182272; c=relaxed/simple; bh=Q7ZMTU8tA4AeV4I3v7W7pGxsb09bhPm9Dym0oBZQwGw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JRhYftmrm4VbgRvPFx+Gh8K8ycgFtV708nl7Yi3xEt/U9RcgasIjPESrgVWwDRIrkgvvFO5uhz3tMOw8TELfhJ2yvvwEPD5n55cSJsiGIQchaR3r7QJjwf4M/ugsHQifVFyBDvITIS1z3oyl4KZPqiWHjsSwtqlySZUpzv9KHXM= 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=avx3ZMWR; arc=none smtp.client-ip=209.85.128.44 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="avx3ZMWR" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-486fe2024a9so13211415e9.0 for ; Sun, 22 Mar 2026 05:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182269; x=1774787069; 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=vjfkIF3HASnSI8uhb4eTEC1yI6mapcnT2E5vNZU/SGc=; b=avx3ZMWRvqGotZYODG/OyyguoJz4a6fEP7jxoCGChR1OBYu02+AwVG8SCH4wjTGIhy 6GOf3tS0kUlBikvWNO0F/FnVLY/FltH04qQivVott93iur4zkxcW0LlRtu8hnwxqsSfN yXjdyVi5/4npcgm5NVsxy6/g+m1zFXQB02/mx9VAb30LY0eaqUMJx4k6RuOsy+lxm9Z2 7FKlYrFt0Pl9myZEtkakVk/beTHiiYjAp5XOY7vwLyPPVTvxLYF2boiYPC8eOCciEZ2U zAJbJw6CJi/6GriJfMiDKxCKAAldGKrkA9Qwn7GVolKIfIL+kto+J1N0kXfqNlT2kJtn jk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182269; x=1774787069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vjfkIF3HASnSI8uhb4eTEC1yI6mapcnT2E5vNZU/SGc=; b=VMdPf3Y/HudLLLuBokg9R5AFkpsKj4aXFN8o6YKLIpieIi90kFBj3vQv8oHK/XH0wp 8oMA87oMmMOv3CPkG+LcSR4FwrAeJAXPbMKNMxS0v9VbgM4GhrjWYmTcXXzLJjQlgO1A y6uI3Tfhy4xxgIwnqc64g6ZqiOiZQOIYQrOsgEwlyqnD6GwYh6xIzk/H1X7kt0hpu+of dSbd/kNA4b51Iv+R0K7pLYy+o+XfVKhr+d9Hh8IVAxpdYTVGFwFqR8tal8URKHqizS6g DAh7D88FtQefGixriRbHsZ1sMTVBYDoUb+R8Q75nZfpW8Zzj6hPEUFf+vRzADZmu0Sk2 9tdA== X-Forwarded-Encrypted: i=1; AJvYcCVOLklwGFX5l1Na1VoWUCv5KV+4Q+2S5NjOeIl9vk6Ni7lC9MKQDrT4FMcU95vwGjfRnG2f4QrP37nq4E4=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6prYl07h9V2dXN7E1Hh7MT8Tz8r+nbnkG8OVmfMOdbGNLfEQr Ot8GylkfcCP9VW+GdszQq9Qv22xVYYAldVqsazx6+1KeocMV4HWJBqEyAUTiIQ== X-Gm-Gg: ATEYQzyjHSDjZ+/QugRfe+ktgcE/VzAOXllNBEsO0bRzC7xlOnIyt5G7W68aufTTRrL Ny1sxkliBqkSyxijtjFL1XKnniZX5520XpRbgiQQp7jNVBqlACrhXms6nWdypyOWi30Is83MACZ yB6OEjRPwhGIFdKW82X2SC9+bbFNgEGW1GyBRl6CL3xxLemWMpr6idfNA0UoHpCDYYUhryWYgUx gywnvaq9HDcxORlyZpqmNBf2rkkl55oUhSkB6FTwK4F8lpi6tZSSncdJVrtVDVXZ2AL2J9+DFQi +8cZw8GLYEVd7h/29gTb2m2B6tSy497tW7KOaUV3fDSdgWzd5RPKsVUS/AF0k0VaGBZVnepckgc vDaWp1zR0k77PfchjLNYMFGd6zx9FvXQFd6+vN3Y1owA9QbqOhNLVCOqTNfWlVEJlpJ3M+l1/Qf HujLqBkr4qjuQNF5eZqHNQayiGyFIT2vt0x955n02QYg9gBB6t X-Received: by 2002:a05:600c:1f86:b0:483:1403:c47f with SMTP id 5b1f17b1804b1-486febbc653mr130128755e9.6.1774182268916; Sun, 22 Mar 2026 05:24:28 -0700 (PDT) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:1bdc:7f84:18bc:1e56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b64703343sm21072695f8f.19.2026.03.22.05.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:28 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v6 05/15] irqchip/renesas-rzg2l: Split EOI handler into separate IRQ and TINT functions Date: Sun, 22 Mar 2026 12:23:48 +0000 Message-ID: <20260322122421.132474-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260322122421.132474-1-biju.das.jz@bp.renesas.com> References: <20260322122421.132474-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das The single rzg2l_irqc_eoi() handler used a conditional to determine whether to clear an IRQ or TINT interrupt. Split this into two dedicated handlers, rzg2l_irqc_irq_eoi() and rzg2l_irqc_tint_eoi(), each handling only their respective interrupt type without the need for range checks. While at it, simplify rzg2l_irqc_{irq,tint}_eoi() by replacing raw_spin_lock locking/unlocking with scoped_guard(). Signed-off-by: Biju Das --- v5->v6: * Simplified rzg2l_irqc_{irq,tint}_eoi() by replacing raw_spin_lock locking/unlocking with scoped_guard(). * Updated commit description. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index a0f03f81d5ef..0683559c31bf 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -130,17 +130,25 @@ static void rzg2l_clear_tint_int(struct rzg2l_irqc_pr= iv *priv, unsigned int hwir } } =20 -static void rzg2l_irqc_eoi(struct irq_data *d) +static void rzg2l_irqc_irq_eoi(struct irq_data *d) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); =20 - raw_spin_lock(&priv->lock); - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) + scoped_guard(raw_spinlock, &priv->lock) rzg2l_clear_irq_int(priv, hw_irq); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) + + irq_chip_eoi_parent(d); +} + +static void rzg2l_irqc_tint_eoi(struct irq_data *d) +{ + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + unsigned int hw_irq =3D irqd_to_hwirq(d); + + scoped_guard(raw_spinlock, &priv->lock) rzg2l_clear_tint_int(priv, hw_irq); - raw_spin_unlock(&priv->lock); + irq_chip_eoi_parent(d); } =20 @@ -438,7 +446,7 @@ static struct syscore rzg2l_irqc_syscore =3D { =20 static const struct irq_chip rzg2l_irqc_irq_chip =3D { .name =3D "rzg2l-irqc", - .irq_eoi =3D rzg2l_irqc_eoi, + .irq_eoi =3D rzg2l_irqc_irq_eoi, .irq_mask =3D irq_chip_mask_parent, .irq_unmask =3D irq_chip_unmask_parent, .irq_disable =3D rzg2l_irqc_irq_disable, @@ -455,7 +463,7 @@ static const struct irq_chip rzg2l_irqc_irq_chip =3D { =20 static const struct irq_chip rzg2l_irqc_tint_chip =3D { .name =3D "rzg2l-irqc", - .irq_eoi =3D rzg2l_irqc_eoi, + .irq_eoi =3D rzg2l_irqc_tint_eoi, .irq_mask =3D irq_chip_mask_parent, .irq_unmask =3D irq_chip_unmask_parent, .irq_disable =3D rzg2l_irqc_irq_disable, @@ -472,7 +480,7 @@ static const struct irq_chip rzg2l_irqc_tint_chip =3D { =20 static const struct irq_chip rzfive_irqc_irq_chip =3D { .name =3D "rzfive-irqc", - .irq_eoi =3D rzg2l_irqc_eoi, + .irq_eoi =3D rzg2l_irqc_irq_eoi, .irq_mask =3D rzfive_irqc_mask, .irq_unmask =3D rzfive_irqc_unmask, .irq_disable =3D rzfive_irqc_irq_disable, @@ -489,7 +497,7 @@ static const struct irq_chip rzfive_irqc_irq_chip =3D { =20 static const struct irq_chip rzfive_irqc_tint_chip =3D { .name =3D "rzfive-irqc", - .irq_eoi =3D rzg2l_irqc_eoi, + .irq_eoi =3D rzg2l_irqc_tint_eoi, .irq_mask =3D rzfive_irqc_mask, .irq_unmask =3D rzfive_irqc_unmask, .irq_disable =3D rzfive_irqc_irq_disable, --=20 2.43.0