From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 09ACE33ADBF for ; Sun, 22 Mar 2026 12:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182268; cv=none; b=kwWSSCEIH0Ou4gwaPBsO6TB6Ogb2ANDMXTPGuj2M1Gk2Uou256gfGM7WMWUgLBBgKLNfsAOEF70jv13wbuRhjxQPRBI40FLwFh5tXdT602zihbUDu5wjhn6XaRrvQUol5CoYsYzfKxqBaJMv3XBQ0e2w/LmEO/WpRN3ieSwLgig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182268; c=relaxed/simple; bh=lxacpAYgrpBPEvUlWUsxBUzA3CNWIf4N6V0WaXElW3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lqr3JRE9StiUGr3bnGJWVFZ+88J62b6KyHAVhwkfnU9jXR0WTxpLCXQwmG3MfvnIuhmyWF7/cMGYwRcsP1BUTG6e/mPWLeNMBb2uHbyN+PkNJZfaCU60BqnG5HMewuuGxGQIiW8Vb8eFSO4e1B+9cdlnT+4NkPuOs614Rs9r2lo= 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=gyqiZZrN; arc=none smtp.client-ip=209.85.128.47 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="gyqiZZrN" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48558d6ef83so18228795e9.3 for ; Sun, 22 Mar 2026 05:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182265; x=1774787065; 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=YREtjqFTpGoqOZEEhucQYxmXOC7F6oMHgtKmEcTK5j8=; b=gyqiZZrNhBkYPDeOm3Ed6B+33Uw3/FdOErVKE9okHM18ECEneYxclVN1iooJDhNu9Q Gi3Js7XwwFwz/+gAEmZ+wqkUmKWUSSqDjg+8NASrkg9wv9NI1nvPyHLklBkkm1DM+V6E 3W+3BZwbkLYsAt+8AaURdBlqJDQ8sMYXp7r07xPVRw8DlP6KwBbEy+KDbJjRNfNT88xW 6ndAEoB3Nfd2yfaEx3iq3no1ssjxppbMW6w7Lj3zvYdFauG8JupK6irHH7TF5t2Zoyxr 5kygZqkAYyv6JBKRSY7cqZkxmQs2OB5hM3xEl3f/67bYlG0+cPK83p7qhGGdRiZvCtO6 VZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182265; x=1774787065; 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=YREtjqFTpGoqOZEEhucQYxmXOC7F6oMHgtKmEcTK5j8=; b=LdDvyvdyWrvtgKr+Kbp9A8YTPccC3Z3S5gycmdJsH9KnljOr9FwtaHUaeIok+XsAMI Sj26r+Uu8VBHM4UNPASMmF246M58wpx4LU+5Zg/mkEM4BYssyK/FFl3UyzWEOStObQrF Wql7enDL9/df25/bh3TlkaAKCf554cq/3SAKcIlwzK31URCnJ7OOpE1eep+G+rjjZ59n hmsXgAEMJZIluAwmQ+ei3ZayWACxt7yYs+JQP5d61WYQnrS0Wjs0mohvNvlk+xATDZgX A8W4O9HUrORNXoFhzQaF5w+fY2HfwGtg20iFaAt3/BeQGO9gxvwMy2+3UOlf/vM/J5LF h2YQ== X-Forwarded-Encrypted: i=1; AJvYcCXm8FhVJzrkPTR58/wsvudbExaluXooIQcf23QIrgHuzIbFHI5VSKVL7HmbseQpR/OnzqPMX/q3NFvAcvg=@vger.kernel.org X-Gm-Message-State: AOJu0YwiXap37DcekegKKf07HhvzhSBSqLBZQv4OFWaEkQGS42UxQXPc AGlUuagm1FWKzvIAxPObiWCpPH/prnJQMrv1Y5klH3O8mQyJZFMPu3Si X-Gm-Gg: ATEYQzzhbkJq6p1bpI/R4z90uz/JWoVFImkld4Uif8mSQCnQZR6tgAsPUK5GKv4hcch gV9rlIvBUIcwxeo+ErPiHbzjh91vUWUGB27JGWVFRkZolwTITX6Uv3YARVAYAPNAjmqV918m8Nt vzxnsM9YSzozpE/W5U5mR7p22aN1mHBjPCbhv1evF/hLw/Kzj1m5f3kUqeIeMCAweSAGDBs4wB1 9on4iUxL6BoOaD71k+jN8WeSh9UTlpyxdTzpaYaEpY6O1IoDb1dITQO2EjUNOba+hTeAqI0bzmM 555E8XJTtjY86M+ZiyAn2YDDJVp+wsVs3/U533ECwdPQomyTJPREsomupSiuv6fLQGib1VU9HGM B59+EmZq5GUX1S1uKdqQBFo/4I5X8Ifa8vwMaZdKauYdG1juEXi/dkcIj6KRp9OA2u1KFS4BGDi 9pN+oULJYBnYzkfK0i5p0JHgMbG5uDoo+DdVh2IDPY7VHienqWv8L/hqwPwb4= X-Received: by 2002:a05:600c:c84:b0:485:39d1:b500 with SMTP id 5b1f17b1804b1-486fee0d859mr127791845e9.16.1774182265147; Sun, 22 Mar 2026 05:24:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:24 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , Lad Prabhakar , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das Subject: [PATCH v6 01/15] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Use pattern for interrupt-names Date: Sun, 22 Mar 2026 12:23:44 +0000 Message-ID: <20260322122421.132474-2-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 Simplify the bindings by using pattern property for interrupt-names. It also allows to change the ordering of interrupts. Reviewed-by: Rob Herring (Arm) Signed-off-by: Biju Das --- v5->v6: * No change. v4->v5: * No change. v3->v4: * Updated commit description. v2->v3: [3] * Dropped items and instead used enum for single compatible values * Add minItems for interrupts and interrupt-names properties of=20 the RZ/{G2L,G2UL,Five,V2L} SoCs * Replaced maxItems->minItems for interrupts and interrupt-names properties of the RZ/G3L SoC. v1->v2: [2] * Simplified the binding using pattern [3] https://lore.kernel.org/all/20260204180632.249139-3-biju.das.jz@bp.rene= sas.com/ [2] https://lore.kernel.org/all/20260206111658.231934-3-biju.das.jz@bp.rene= sas.com/ [1]https://lore.kernel.org/all/20260204142320.103184-2-biju.das.jz@bp.renes= as.com/ --- v3->v4: * Collected tag from Rob [1] * Updated commit description and kept the tag as it is trivial change. v2->v3: [2] * No change v1->v2: * New patch [1]. [1] https://lore.kernel.org/all/20260204180632.249139-2-biju.das.jz@bp.rene= sas.com/ [2] https://lore.kernel.org/all/20260206111658.231934-2-biju.das.jz@bp.rene= sas.com/ --- .../renesas,rzg2l-irqc.yaml | 120 ++++-------------- 1 file changed, 23 insertions(+), 97 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas= ,rzg2l-irqc.yaml b/Documentation/devicetree/bindings/interrupt-controller/r= enesas,rzg2l-irqc.yaml index 44b6ae5fc802..a0b57d808639 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml @@ -48,107 +48,33 @@ properties: =20 interrupts: minItems: 45 - items: - - description: NMI interrupt - - description: IRQ0 interrupt - - description: IRQ1 interrupt - - description: IRQ2 interrupt - - description: IRQ3 interrupt - - description: IRQ4 interrupt - - description: IRQ5 interrupt - - description: IRQ6 interrupt - - description: IRQ7 interrupt - - description: GPIO interrupt, TINT0 - - description: GPIO interrupt, TINT1 - - description: GPIO interrupt, TINT2 - - description: GPIO interrupt, TINT3 - - description: GPIO interrupt, TINT4 - - description: GPIO interrupt, TINT5 - - description: GPIO interrupt, TINT6 - - description: GPIO interrupt, TINT7 - - description: GPIO interrupt, TINT8 - - description: GPIO interrupt, TINT9 - - description: GPIO interrupt, TINT10 - - description: GPIO interrupt, TINT11 - - description: GPIO interrupt, TINT12 - - description: GPIO interrupt, TINT13 - - description: GPIO interrupt, TINT14 - - description: GPIO interrupt, TINT15 - - description: GPIO interrupt, TINT16 - - description: GPIO interrupt, TINT17 - - description: GPIO interrupt, TINT18 - - description: GPIO interrupt, TINT19 - - description: GPIO interrupt, TINT20 - - description: GPIO interrupt, TINT21 - - description: GPIO interrupt, TINT22 - - description: GPIO interrupt, TINT23 - - description: GPIO interrupt, TINT24 - - description: GPIO interrupt, TINT25 - - description: GPIO interrupt, TINT26 - - description: GPIO interrupt, TINT27 - - description: GPIO interrupt, TINT28 - - description: GPIO interrupt, TINT29 - - description: GPIO interrupt, TINT30 - - description: GPIO interrupt, TINT31 - - description: Bus error interrupt - - description: ECCRAM0 or combined ECCRAM0/1 1bit error interrupt - - description: ECCRAM0 or combined ECCRAM0/1 2bit error interrupt - - description: ECCRAM0 or combined ECCRAM0/1 error overflow interrupt - - description: ECCRAM1 1bit error interrupt - - description: ECCRAM1 2bit error interrupt - - description: ECCRAM1 error overflow interrupt + maxItems: 48 =20 interrupt-names: minItems: 45 + maxItems: 48 items: - - const: nmi - - const: irq0 - - const: irq1 - - const: irq2 - - const: irq3 - - const: irq4 - - const: irq5 - - const: irq6 - - const: irq7 - - const: tint0 - - const: tint1 - - const: tint2 - - const: tint3 - - const: tint4 - - const: tint5 - - const: tint6 - - const: tint7 - - const: tint8 - - const: tint9 - - const: tint10 - - const: tint11 - - const: tint12 - - const: tint13 - - const: tint14 - - const: tint15 - - const: tint16 - - const: tint17 - - const: tint18 - - const: tint19 - - const: tint20 - - const: tint21 - - const: tint22 - - const: tint23 - - const: tint24 - - const: tint25 - - const: tint26 - - const: tint27 - - const: tint28 - - const: tint29 - - const: tint30 - - const: tint31 - - const: bus-err - - const: ec7tie1-0 - - const: ec7tie2-0 - - const: ec7tiovf-0 - - const: ec7tie1-1 - - const: ec7tie2-1 - - const: ec7tiovf-1 + oneOf: + - description: NMI interrupt + const: nmi + - description: External IRQ interrupt + pattern: '^irq([0-7])$' + - description: GPIO interrupt + pattern: '^tint([0-9]|1[0-9]|2[0-9]|3[0-1])$' + - description: Bus error interrupt + const: bus-err + - description: ECCRAM0 or combined ECCRAM0/1 1bit error interrupt + const: ec7tie1-0 + - description: ECCRAM0 or combined ECCRAM0/1 2bit error interrupt + const: ec7tie2-0 + - description: ECCRAM0 or combined ECCRAM0/1 error overflow interr= upt + const: ec7tiovf-0 + - description: ECCRAM1 1bit error interrupt + const: ec7tie1-1 + - description: ECCRAM1 2bit error interrupt + const: ec7tie2-1 + - description: ECCRAM1 error overflow interrupt + const: ec7tiovf-1 =20 clocks: maxItems: 2 --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 3471E36C59E for ; Sun, 22 Mar 2026 12:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182269; cv=none; b=ned8FTI0rKCo4v59VItUwfOUn94mu8LNtqzSNstm1cFIhCwX/lAT4kMwYy49PGuVtUgN8HdKPRo467gg1gLvHcXCjkAtxNAW/I6oyOSuCmxSn/rRvi6ZT7hsXlmMKr9zt2xnlcBr4Vr4o1y576TfEoHVUoAw5Ui+byeBb7nrQ3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182269; c=relaxed/simple; bh=NqL++QS6pCKA8dKHUyiOCiT56oWQTwHXVPj7oO5XapU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M1i4MQWFJ2x4h0PhRzwzI2lQQoFwLZe3oCVH9HW7hW9eCh8fRl7gdd7S8V6ifw2nKKVwFEsAF5eP6m0M6Yn1Vf8G/QbjmEwOr4fQ8ArNis7EKy5FkUj/0yra5UGTVoi1JTY8KFEvRBAhn1+aO6E+Pm3n5Q3QBjZJWhZ3B1N4TUY= 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=h4ERTGXE; arc=none smtp.client-ip=209.85.221.48 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="h4ERTGXE" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-439d8dc4ae4so2892346f8f.2 for ; Sun, 22 Mar 2026 05:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182266; x=1774787066; 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=gap/Q33IiQRtCOD/Ll2fknn9+W00XJGVBJHUg+QgTgw=; b=h4ERTGXEIZPYXgyqjMFNER4XF8Keqj/N/KzJDNLUta5zQK0Q4qWTXLyd24hbeILYLJ 4MTQp1YLkMtPp+hua0Uh5LiCroI5ghfCGoxVUUMhBJFJWVOLehsYHy9a5316qL2S6F5Z JnwwffMfSDMUHhfwdlupCXZM+VJ/xdIV28ha479sSwVUqerC2y3axiIMHtbiIKUm99ol wq+6LK6ctPQh2cE0HZzPC17wc5nZ4547ppAeANL0p9reqMbgyWUjwPKQjVQg+5Njy7oY Q04XO2aJdDJ3OUls25iltby6Oumi1GFUC5kL8Qj/dgQCTLOLvWI4n2Z69iWxPD4/bGl6 qxww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182266; x=1774787066; 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=gap/Q33IiQRtCOD/Ll2fknn9+W00XJGVBJHUg+QgTgw=; b=j7Vt98d2tHfcw9CngEdGIxCt63E0Gg5XDj6J0eU8Y0Qp17h2K35yY+zOtwkdMvdwY0 v6FHHn0HSrbAfXkRwoiClzVDelC5zYoVS9ul1tB8B6SDjn9wJ0udbfP8td2fcxPb0bXw 7w96Psn1xSeYsOGWAaNk8ECmPu1U8zqZEMfzoPHOE2LXPgridNRvK0d95KbP7S2WCCFe TIJ/Eu55ue5Dn6J7Ebttd5TYvtzBNN090l+hbwr45/hmUJKmZSYN4w4HrvIbU/xcaF/B NEorcG22+iriBMQJOfIHGpCsLImC9O2N7C2OgRq9lUP6/xA+R86dM06kuKTmdu19jvRx 7QyA== X-Forwarded-Encrypted: i=1; AJvYcCVeP+nwwKml8sn9avd4NbzR1HiCrFXVr75/iWN1FQ0eQlB1GOeEsCMc11PvOSYIVtC9Xo46C/8YB40onmU=@vger.kernel.org X-Gm-Message-State: AOJu0YxoeJ3evfmtHUU47vSc5i92ahaSTVfhA5vFU7k/o63B/itxZRap b2wIV5/uecLTYr83vIF4AObCGFXYebHqoPnDejiYndRTIHUSRizA0ke/ X-Gm-Gg: ATEYQzzCss1VLgH8oBf7d3ujG4ht3rC/sxGHmdMfa2sWmDss8Yq+0F6m52KMiCHyFjz MfKbb3ejFbdaqkVt1s+oVkkmqmmmbkQZMnHMMkzHTXlvssFQgLKNry7CmWw+eR7KKNrNnaAFLZf PTJcWfq08a9lbgWY4W14MjYtMT2HgjWXi0dmxcOqiC1DxpZQ/FoyueN3m/rb1GhEYnRKhudgeVd PwAq454QlrD6KtU3IHdhrVxRX6pWuy/T82Lsu+kbxk7pRETSHkw8PMTjes3PkUCGgPEfI0TNXy6 vg3eEKkSnTyIN9AjvJJTm6QFOvdYLNYBOen36AKixwYdINu17ykhR1ut1lE962rvxZR4XSUTaD+ zr6u4o3zg8eyAKDoK3U5E+4v8SL7a9ioQyvrloo/55FqANzq0siUs9d+zr2rxarR6GtBtAo4BE2 1ECOILYm+DITpOiAHASN7tUWYsaalaiZ9lN+QmjJQlZyRETWiT X-Received: by 2002:a05:6000:24ca:b0:43b:45da:f296 with SMTP id ffacd0b85a97d-43b6423286fmr13975167f8f.11.1774182266443; Sun, 22 Mar 2026 05:24:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:25 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , Lad Prabhakar , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das Subject: [PATCH v6 02/15] dt-bindings: interrupt-controller: renesas,rzg2l-irqc: Document RZ/G3L SoC Date: Sun, 22 Mar 2026 12:23:45 +0000 Message-ID: <20260322122421.132474-3-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 Document RZ/G3L (R9A08G046) IRQC. The IRQC block on the RZ/G3L SoC is nearly identical to that found on the RZ/G3S SoC, with the following differences: it supports more external interrupts and GPT error interrupts, and adds registers for GPT/MTU interrupt selection and shared interrupt selection between external interrupt and TINT. A new compatible string "renesas,r9a08g046-irqc" is therefore introduced for the RZ/G3L SoC. Reviewed-by: Rob Herring (Arm) Signed-off-by: Biju Das --- v5->v6: * Collected tag. v4->v5: * No change. v3->v4: [4] * Updated commit description. v2->v3: [3] * Dropped items and instead used enum for single compatible values * Add minItems for interrupts and interrupt-names properties of=20 the RZ/{G2L,G2UL,Five,V2L} SoCs * Replaced maxItems->minItems for interrupts and interrupt-names properties of the RZ/G3L SoC. v1->v2: [2] * Simplified the binding using pattern [4] https://lore.kernel.org/all/20260227140316.308106-3-biju.das.jz@bp.rene= sas.com/ [3] https://lore.kernel.org/all/20260204180632.249139-3-biju.das.jz@bp.rene= sas.com/ [2] https://lore.kernel.org/all/20260206111658.231934-3-biju.das.jz@bp.rene= sas.com/ [1]https://lore.kernel.org/all/20260204142320.103184-2-biju.das.jz@bp.renes= as.com/ --- .../renesas,rzg2l-irqc.yaml | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas= ,rzg2l-irqc.yaml b/Documentation/devicetree/bindings/interrupt-controller/r= enesas,rzg2l-irqc.yaml index a0b57d808639..3a221e1800a0 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-= irqc.yaml @@ -30,7 +30,9 @@ properties: - renesas,r9a08g045-irqc # RZ/G3S - const: renesas,rzg2l-irqc =20 - - const: renesas,r9a07g043f-irqc # RZ/Five + - enum: + - renesas,r9a07g043f-irqc # RZ/Five + - renesas,r9a08g046-irqc # RZ/G3L =20 '#interrupt-cells': description: The first cell should contain a macro RZG2L_{NMI,IRQX} in= cluded in the @@ -48,17 +50,17 @@ properties: =20 interrupts: minItems: 45 - maxItems: 48 + maxItems: 61 =20 interrupt-names: minItems: 45 - maxItems: 48 + maxItems: 61 items: oneOf: - description: NMI interrupt const: nmi - description: External IRQ interrupt - pattern: '^irq([0-7])$' + pattern: '^irq([0-9]|1[0-5])$' - description: GPIO interrupt pattern: '^tint([0-9]|1[0-9]|2[0-9]|3[0-1])$' - description: Bus error interrupt @@ -75,6 +77,8 @@ properties: const: ec7tie2-1 - description: ECCRAM1 error overflow interrupt const: ec7tiovf-1 + - description: Integrated GPT Error interrupt + pattern: '^ovfunf([0-7])$' =20 clocks: maxItems: 2 @@ -106,6 +110,24 @@ required: allOf: - $ref: /schemas/interrupt-controller.yaml# =20 + - if: + properties: + compatible: + contains: + enum: + - renesas,r9a07g043f-irqc + - renesas,r9a07g043u-irqc + - renesas,r9a07g044-irqc + - renesas,r9a07g054-irqc + then: + properties: + interrupts: + minItems: 48 + maxItems: 48 + interrupt-names: + minItems: 48 + maxItems: 48 + - if: properties: compatible: @@ -118,12 +140,19 @@ allOf: maxItems: 45 interrupt-names: maxItems: 45 - else: + + - if: + properties: + compatible: + contains: + enum: + - renesas,r9a08g046-irqc + then: properties: interrupts: - minItems: 48 + minItems: 61 interrupt-names: - minItems: 48 + minItems: 61 =20 unevaluatedProperties: false =20 --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 CDC7D37FF58 for ; Sun, 22 Mar 2026 12:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182270; cv=none; b=gzTXIPLz9HaXq4fnDPr2plXs22MF9QaPfHQRJRB1ISyWWtWf3+2/plnvyRPr1yVLCQCVBJ15NTHpRyAzUGaYCAooYCoxPwgRJ+3PYFfNFgPdBDwY1zIblggSyXFUhGTDo9/KGzs8U2oSZZA1UCuG7pbiYn6G+AEkgfdOu18eieM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182270; c=relaxed/simple; bh=UpRxGcWa3iAIEJufXLdXzxJHuZ+CAyQYllpOl9CaWjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jBCr/OZqgWqlHnmbOt6qzucbZdJn+ysTc6L1XCEmJEtBZBl2uoMr8NneP5JHOQEpRU1hRBS4mwqH8sgrVkZmWfsL9Bu6gdgTp3/GVp+/ONBe53JH3EWr3N7CpnRedZl51QOs/cLhdc+fZzdfPHZsohfzWeFLuvcVeYaBc5kaIN8= 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=It35YV74; arc=none smtp.client-ip=209.85.221.48 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="It35YV74" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-43b40fb7f95so3261730f8f.3 for ; Sun, 22 Mar 2026 05:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182267; x=1774787067; 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=xtD9Mcdy4IAm2SWHw0ZQYZjstkdltAVZToJLw8rGIV4=; b=It35YV74yHXHik0umay6p6qi5XR7VjeeJt+Q4ffgh9Kw5Ja8ywu0klGfugxclget2F rlA9vJSGc0gG8nKYbQceUiQipjPFlBMRqyZAi1YX5zZsVEp/CJjVJzhBk8UgYlRs/I09 LzWtUwG/h+pJNxGL/P1ty2ufKSLlsx6pyWQR6vMFv1uyoQXISi49BcRPdZVOW+uHACo6 MSONaGgSTz8wzlPnuflHpQ/3C4cmZpacNUKIhUDnQGNe/OojlbbmjnEfNUoeCAeDxObf 8xTn2q6WTxEhjnE74Jes966oAhjbORsVLPitV0NCLRdzSslQbNk3D49gp4LpgCr87C4V M0EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182267; x=1774787067; 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=xtD9Mcdy4IAm2SWHw0ZQYZjstkdltAVZToJLw8rGIV4=; b=RtfkygKIX6RKQ5pfEJ2EyLwxXwSDCTVc9KKMtpJA5BsOwqtN5PaJ4wU0bFUxJlDPn8 6PMKyz1sIKlAbxHHaMAaLQwVUkhtRR65NFl2Uky6/Jj6fa0jEsKdW/O38Ico6tr/XQox 0HfSMPKPVhnjLmGREKQg3AV9kpigQWPPukTxvJCQkI5mkLTU2sgL6qTZwv/uUERuCwvX BgMUQ9jGBRUBOsN34sRZiKVaIWbkyGil9kcSg1zdzUE4AoYsQQzVMN9SqKIMWeTe988Q vrARapiZUAxo4+hLIkK/9IhV0F9BJ0fO7noLsuEZxCH0a1RXDzxb2jKZuupSx+umUofE 9d2Q== X-Forwarded-Encrypted: i=1; AJvYcCXw+2sDYk2S0tEksqH4+wn+tTTvr49rhwljP7545bztYmFInGnvkViUfFKJYHujYc47A2yVWwEGLTBPjyo=@vger.kernel.org X-Gm-Message-State: AOJu0YzH/TVOsxnDilp+hwq845hK2pxwYaICZGB6yD6FvFo9dH33zsqD wE804NvtutwN+ZdjUvqj++2hpqHe/cOD2hVMnptsZ44+EhxsNvOKvWKu X-Gm-Gg: ATEYQzzPmKfI8R684FIu4srvCiybwqaqn84z4EOrdZIGqEeP+5U5LQEppcpmQjkbRgJ VepXu06Elw5W0a/hBTy1OCntrqOY2fscOqNXXtXbZRV/47RClB2rfsr+zMNYQVjnvyUPQJCYMTk hTG7M1IDa8foiH6fpihsferjQY646AVgGeSPNvG828jjMqY1+6Hw42IzD7wvV7If3aLN/GGPsZW roOwj72H5uUtDua33tCxS5frP5rpUuSU6xX3sOYwF9QvsSnc6YuAoeZ/Rw9VjMAMwOI23IUREKp XboQDk7nJ+QcGDK2vj1I05yASl/A7+V+eMsJWu1HJTxA2SMchCkmVci17c9UEcY4W/mbcJZAwIl yWSCNDANIpyUtxE4Qs5glKiIq7e8Sbvmb1mVNJfeg2Pu3zJkngd+aUA02SGA4ofLxoBhO283m7B yJSdGmQMHXb9+zN/xynLZxKE8YuTo1Vhx+g5ADYTtx/z1C7c/g X-Received: by 2002:a05:6000:2890:b0:439:cc06:e134 with SMTP id ffacd0b85a97d-43b64242520mr14855907f8f.24.1774182267272; Sun, 22 Mar 2026 05:24:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:26 -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 03/15] irqchip/renesas-rzg2l: Drop redundant IRQC_TINT_START check in rzg2l_irqc_alloc() Date: Sun, 22 Mar 2026 12:23:46 +0000 Message-ID: <20260322122421.132474-4-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 check `hwirq < IRQC_TINT_START` in rzg2l_irqc_alloc() is unnecessary as the condition is already guaranteed to be false at that point in the code. The outer `if (hwirq > IRQC_IRQ_COUNT)` block ensures that hwirq is always above IRQC_IRQ_COUNT before reaching this check, and since IRQC_TINT_START <=3D IRQC_IRQ_COUNT, the guard can never trigger. Remove the dead code to simplify the allocation path. Signed-off-by: Biju Das --- v5->v6: * No change. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index e73d426cea6d..ed8044b0a339 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -491,9 +491,6 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, if (hwirq > IRQC_IRQ_COUNT) { tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); - - if (hwirq < IRQC_TINT_START) - return -EINVAL; } =20 if (hwirq > (IRQC_NUM_IRQ - 1)) --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 B54543803FA for ; Sun, 22 Mar 2026 12:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182271; cv=none; b=Wiy827bdGmPOH+7mVVaPzSY1EAS+IDlc0FM8W7PpahdN/pmueuQT4/+VekUq3ZRYGMf4Teg8k/9cATsJK6rzcF0BOVKUrpjfTq91SSrIsmb1ygJrxD577xPeCF5mgt6HXVQodiWejWCljtfUuhNJM94GhmMCiYndL6//Fv6+mgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182271; c=relaxed/simple; bh=V3170Kcxf+SwGKUeN/ScFDYmS/C0wM7P/06+kYpoLP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qird9UnziTxUuzmKv7GNs36eyfN8mQiDaSbc3gbKJ2sl1A8Jqn3xAWEqvqXQrE/hZY+rHvyT4p8kzlDdR4Ze6vDBc7Vj3UxBFYliyNjGFscM/CqGWnaDK73E/gw+2DH8SVQiq/aY/J6I48rgrM014TE1CSE2fMM/wm3VsRzW/hQ= 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=WOvc/7LN; arc=none smtp.client-ip=209.85.221.48 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="WOvc/7LN" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-439b9cf8cb5so4584550f8f.0 for ; Sun, 22 Mar 2026 05:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182268; x=1774787068; 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=9Bx5j4FaZKX5iw5JrPcGDY49H4qgRYZDbXdV3Cc+dJs=; b=WOvc/7LN3B8g71UjAFWiSHaOcwx5kxIbOonChX/xa1Rtlz6rH5InT++8uOtZN6YGtj KOW1w56U52xM3tHljwecBhlmVyzHhgxgwXVi8hokXEOxJttmFR6CZK12flvHfWQR6iez ySxp4WhB5k6+F/BWHAvn4+PYExBOKLqxo51VIxnNyV1bUa5QPFGMYZVC8BIcfwltbdV9 O5yo+ONts6n7uiH9C1YafSMQ2zBov/i5/qhhPNrZJb8zl2/VRNbjOsWUWdMMZwoARdNv o26ATgoJJgBnzAtHJEly8+8uS3x971+8P070HuLd0Mn/rPR90ijGued1vjI1ulTyE8m6 y5Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182268; x=1774787068; 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=9Bx5j4FaZKX5iw5JrPcGDY49H4qgRYZDbXdV3Cc+dJs=; b=kpHdH4kNG16IGFdNjx1ylL5eY1t0yHqojNciKRjm5HO5qUuJv1AAXrugcoiu+GKSbD poCGb0Lwgpq3EYcZz/LFryFq8KsyZz5sJnLbDHA7srpRzC5A2nTKBlPAiT+14u8tJRlD VqX9KtniyOaGUT2NcMf8VVnBhBP5v1dirPlAIRhyIMGItE3q1ruWzWQ8zZqQaf5Bmspv fytrJlYsbDrA49LqcbG9xBSGW5v81fQQ95+r4OAu4PyJOfceWWv8/zJLoyzj03wJTRtT YtO+Pwl31EIPUANShAj/IpTJ0tjSFJZXOT0gx1akioDw+5MpTRTcYPPzv9DKoHomIB1M hYzA== X-Forwarded-Encrypted: i=1; AJvYcCV6qyU1jDrms/diEBwRaLlN5f49bzMA3YDJH6jc93LpODM07mX9+uW9JdNugvRcSdVjLxja7mS6PHbbop8=@vger.kernel.org X-Gm-Message-State: AOJu0YwuQFna2j0V3Fo71f3bLAhB0651paxQr6hy7+L2RvL5qzTMUVq9 BhRq4XmMRGPnsG+8O3q0kDtMOvn4xx0gsyxvZoBCK+4AkOkzkM1+C1LR X-Gm-Gg: ATEYQzzPwSNXLh238oBUG9PqcRuUVadg65lxs9Sc41PTgGHE2To/DeY0ZKtcHQ2gas8 /Qnt5/n9Vxj/HLn05eYaPFbLTbo3rtGfxRBnoQKzv8wwSfv0DGdeJLqF9YlL8uZo6FbP5QZAjSD dfHSFjPfVULYlmbpsgB3gPYog1Nn4IAEeUaY6ce3fo3cPLsHzL5G4g/lOizacs9kiv4+pmn7bOH ADkdpCdWjJboZLbQ6CAP3IfQ01OpYrN4wIDa1PDXvY4WKCOmDEelJtxmP2yA8AMJ4M1HPFprJu+ 6JfbLV7N6KuJy6932fG7ej3jcGyEjogwenXqbWvnEVJXRTD2e7RE2i0LxndICrK3ipUL7ygkev7 x/jZx4CLHYAsGV6Ucsl6bil5+dppxQ4GWvy98VQMIQcAwfR1DuNLI77UBuD/Dn4dHDZUsjdseNb pVCeXvaRzPj4Wrgc4wTO8mmafPSBTNbNLiRu7GBHv5xjDF8tAs X-Received: by 2002:a05:6000:250e:b0:43b:4dd4:6856 with SMTP id ffacd0b85a97d-43b64238854mr15485470f8f.8.1774182268067; 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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:27 -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 04/15] irqchip/renesas-rzg2l: Replace single irq_chip with per-region irq_chip instances Date: Sun, 22 Mar 2026 12:23:47 +0000 Message-ID: <20260322122421.132474-5-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 driver previously used a single irq_chip instance shared across all interrupt types, relying on dispatcher callbacks to differentiate between IRQ and TINT regions at runtime. Replace the per-SoC irq_chip and its dispatcher callbacks with dedicated irq_chip instances for each interrupt region: IRQ and TINT. Subsequent patches will add per-region callbacks for IRQ and TINT from the common code. Signed-off-by: Biju Das --- v5->v6: * No change. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 61 ++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index ed8044b0a339..a0f03f81d5ef 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -71,14 +71,16 @@ struct rzg2l_irqc_reg_cache { /** * struct rzg2l_irqc_priv - IRQ controller private data structure * @base: Controller's base address - * @irqchip: Pointer to struct irq_chip + * @irq_chip: Pointer to struct irq_chip for irq + * @tint_chip: Pointer to struct irq_chip for tint * @fwspec: IRQ firmware specific data * @lock: Lock to serialize access to hardware registers * @cache: Registers cache for suspend/resume */ static struct rzg2l_irqc_priv { void __iomem *base; - const struct irq_chip *irqchip; + const struct irq_chip *irq_chip; + const struct irq_chip *tint_chip; struct irq_fwspec fwspec[IRQC_NUM_IRQ]; raw_spinlock_t lock; struct rzg2l_irqc_reg_cache cache; @@ -434,7 +436,7 @@ static struct syscore rzg2l_irqc_syscore =3D { .ops =3D &rzg2l_irqc_syscore_ops, }; =20 -static const struct irq_chip rzg2l_irqc_chip =3D { +static const struct irq_chip rzg2l_irqc_irq_chip =3D { .name =3D "rzg2l-irqc", .irq_eoi =3D rzg2l_irqc_eoi, .irq_mask =3D irq_chip_mask_parent, @@ -451,7 +453,41 @@ static const struct irq_chip rzg2l_irqc_chip =3D { IRQCHIP_SKIP_SET_WAKE, }; =20 -static const struct irq_chip rzfive_irqc_chip =3D { +static const struct irq_chip rzg2l_irqc_tint_chip =3D { + .name =3D "rzg2l-irqc", + .irq_eoi =3D rzg2l_irqc_eoi, + .irq_mask =3D irq_chip_mask_parent, + .irq_unmask =3D irq_chip_unmask_parent, + .irq_disable =3D rzg2l_irqc_irq_disable, + .irq_enable =3D rzg2l_irqc_irq_enable, + .irq_get_irqchip_state =3D irq_chip_get_parent_state, + .irq_set_irqchip_state =3D irq_chip_set_parent_state, + .irq_retrigger =3D irq_chip_retrigger_hierarchy, + .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_affinity =3D irq_chip_set_affinity_parent, + .flags =3D IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SET_TYPE_MASKED | + IRQCHIP_SKIP_SET_WAKE, +}; + +static const struct irq_chip rzfive_irqc_irq_chip =3D { + .name =3D "rzfive-irqc", + .irq_eoi =3D rzg2l_irqc_eoi, + .irq_mask =3D rzfive_irqc_mask, + .irq_unmask =3D rzfive_irqc_unmask, + .irq_disable =3D rzfive_irqc_irq_disable, + .irq_enable =3D rzfive_irqc_irq_enable, + .irq_get_irqchip_state =3D irq_chip_get_parent_state, + .irq_set_irqchip_state =3D irq_chip_set_parent_state, + .irq_retrigger =3D irq_chip_retrigger_hierarchy, + .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_affinity =3D irq_chip_set_affinity_parent, + .flags =3D IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SET_TYPE_MASKED | + IRQCHIP_SKIP_SET_WAKE, +}; + +static const struct irq_chip rzfive_irqc_tint_chip =3D { .name =3D "rzfive-irqc", .irq_eoi =3D rzg2l_irqc_eoi, .irq_mask =3D rzfive_irqc_mask, @@ -472,6 +508,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, unsigned int nr_irqs, void *arg) { struct rzg2l_irqc_priv *priv =3D domain->host_data; + const struct irq_chip *chip; unsigned long tint =3D 0; irq_hw_number_t hwirq; unsigned int type; @@ -491,13 +528,15 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain= , unsigned int virq, if (hwirq > IRQC_IRQ_COUNT) { tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); + chip =3D priv->tint_chip; + } else { + chip =3D priv->irq_chip; } =20 if (hwirq > (IRQC_NUM_IRQ - 1)) return -EINVAL; =20 - ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, priv->irqchip, - (void *)(uintptr_t)tint); + ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, chip, (void *)= (uintptr_t)tint); if (ret) return ret; =20 @@ -529,7 +568,8 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irq= c_priv *priv, } =20 static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct de= vice_node *parent, - const struct irq_chip *irq_chip) + const struct irq_chip *irq_chip, + const struct irq_chip *tint_chip) { struct irq_domain *irq_domain, *parent_domain; struct device_node *node =3D pdev->dev.of_node; @@ -545,7 +585,8 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n if (!rzg2l_irqc_data) return -ENOMEM; =20 - rzg2l_irqc_data->irqchip =3D irq_chip; + rzg2l_irqc_data->irq_chip =3D irq_chip; + rzg2l_irqc_data->tint_chip =3D tint_chip; =20 rzg2l_irqc_data->base =3D devm_of_iomap(dev, dev->of_node, 0, NULL); if (IS_ERR(rzg2l_irqc_data->base)) @@ -585,12 +626,12 @@ static int rzg2l_irqc_common_probe(struct platform_de= vice *pdev, struct device_n =20 static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_irq_chip, &rzg2l= _irqc_tint_chip); } =20 static int rzfive_irqc_probe(struct platform_device *pdev, struct device_n= ode *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_irq_chip, &rzfi= ve_irqc_tint_chip); } =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) --=20 2.43.0 From nobody Sat Apr 4 00:09:20 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 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 3852E3246FE for ; Sun, 22 Mar 2026 12:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182272; cv=none; b=jtsoEo0TV7aV3fl3C0yEC1PIbySH2wqJ26ZFn/F8WCZvV/IzL0NjshPRlBSZahOTwpPAv6tTiaLpRkvpPvC32w9XgvKqEpe3DKcnStt/EFLLMk9T62AkTgN/J0DHkFQf05PUl7sCa7ZjlickhvjY+UOWnnHU98alGYktZdhyu+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182272; c=relaxed/simple; bh=U1adm3g3B9v7a5MeskhnTiomMzDoVQVY57YQV/+SBsY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cJK+PrNRsSO2zJ2y4POKkmny26Nmbq9oGseJvODrehzA9r+PKRCA7MUFzDOWeAjD4vn/ln6owB/kgLJs4NC2Grsp+/ha3mooMbxOAWt9JykfB8n+g6Qsmg3kCVidjDZqz06DI35kDejmsB+FF7MlsGD7ASG3S9kQ8UtNBSOhxnM= 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=Wd7WUdPA; arc=none smtp.client-ip=209.85.128.53 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="Wd7WUdPA" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-486b96760easo36409755e9.2 for ; Sun, 22 Mar 2026 05:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182270; x=1774787070; 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=/2ypyUw2VRpKAfR8FIRxqzsDwKCOO3CZ741DYEI3teg=; b=Wd7WUdPAi8ItlOJOL8ifyKtHijG/PRSH6Dnj33QZZU/ecFyzC0sj26m27KNQrol6av PSpvGyxmqs+MeelDt4wnAek08Lf/b8vqkW0euvbu1qTkL/kH9IWe0U232sjYiAIxLusY Effoq1p6+Q5Mr0ashEOIBogWTAlc3lx+xgfvPUlBeOiewHau+o9/SW++r9jDwROYtE+9 XW27j/XLf0o3x3igMZ2bEaYotldRPgAw/DT3aupZXh4ughQXVeDqdRQ/P5zk3ph/CJjy kEZNYGzQ6Z24I+2T5YZDoas0i2Wx9hQUcoMZearhQ/JQWUDpxKMg8JKJ+Oe4F69nsZdz o9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182270; x=1774787070; 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=/2ypyUw2VRpKAfR8FIRxqzsDwKCOO3CZ741DYEI3teg=; b=X/bN/Clb2j5oQRTemYEyb6XpLzlJSIhhDel5vp4m6vQoC6hiwshKKp6MNacCrVhQb7 QGDDTHZuuQyazzydbYcK51svM2Yezk8W54+Fc+qkD0nzybqonDj3WWAsZUwKJ+neoThJ 51qinxRdZ1UYK7TUcG3DHE8A+Jt04kBqXoGqBlObY+vTFkrTUnwRRBPkiEoUrFhzjBWD PGaKnyhhbatm7OIP6C9UkCYBsqEImK3kAh9xOp9OWE60hFAr4mFYuIOj+1QYfIMI2RSR Yp9TDJqVPRNz7WVrxI+K8Ydobe36NO8PDR1u8Tg4NfgdNn+EpgJWitExjxJX81QFzFVM fqIA== X-Forwarded-Encrypted: i=1; AJvYcCVwB7LRcXZzJvxGCdCoSbwyO5wS9k1Y6uEm625nVUo2FKflbIShnvuRDfB8TmufabAIk6EQ8QAzc3XdhvE=@vger.kernel.org X-Gm-Message-State: AOJu0YzX2TAFly1jyp+r1rmOB2ksYGOHR/QfVcysbZswUfwDcF/0dnqE W39eskSnmDvdib32jRBIbzEWOMbGA983ftqIgp1VJIL4K8ogJ6n+NlTMGzf/rQ== X-Gm-Gg: ATEYQzy85PwrtkDrccFqGyMAAWDlym/VkCpcLATgUu492su2poESawj1xq3vt51sVND FeKfS5jgMw0gSzGDmDFer836fkcT6FRjNQ7qyJb5Spvi6qwxC70rYu3VYQjQaKxQTyLGHeDekUJ 5LEmhzMpIs5bC+Jg6K/NVzfDyTTCLwJsb/NOyzUqCen1pT19ObVk5tiSwtdsQa5V1T/7V322Ten t/BdIMxfi+CvUqt+hWgHBoW10oL2gY0fTjMkI7fzRk59bj9fQ/oByUGNUBboDzrPeXRCynw4M+I QrRjDCxWhjQIrFm4bqeOLzSR4CiOcIORJQ5zzWDEfEYhUCeJK1y9R4vpEfHD76hIUy/6Az/XQEh 9Xgj6iuMAS7PfBSJpFoobRGJ2Uk8DpV4a4+4Gd/WoXdSVbFXRVnuQsqHIM4FWPDr/8LwuXtmuJi zJsBUwRBwyQB4G+EYKMRmKMCUQmO1dXr2FNO3BjxCs6bk7pGgg X-Received: by 2002:a05:600c:474f:b0:477:7bca:8b34 with SMTP id 5b1f17b1804b1-486fedab2edmr126544385e9.6.1774182269673; Sun, 22 Mar 2026 05:24:29 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:29 -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 06/15] irqchip/renesas-rzg2l: Split set_type handler into separate IRQ and TINT functions Date: Sun, 22 Mar 2026 12:23:49 +0000 Message-ID: <20260322122421.132474-7-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_set_type() handler used hw_irq range checks to dispatch to either rzg2l_irq_set_type() or rzg2l_tint_set_edge(). Split this into two dedicated handlers, rzg2l_irqc_irq_set_type() and rzg2l_irqc_tint_set_type(), each calling only their respective type configuration function without runtime conditionals. Signed-off-by: Biju Das --- v5->v6: * No change. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 0683559c31bf..84dded4beae6 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -393,15 +393,22 @@ static int rzg2l_tint_set_edge(struct irq_data *d, un= signed int type) return 0; } =20 -static int rzg2l_irqc_set_type(struct irq_data *d, unsigned int type) +static int rzg2l_irqc_irq_set_type(struct irq_data *d, unsigned int type) { - unsigned int hw_irq =3D irqd_to_hwirq(d); - int ret =3D -EINVAL; + int ret; + + ret =3D rzg2l_irq_set_type(d, type); + if (ret) + return ret; + + return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); +} + +static int rzg2l_irqc_tint_set_type(struct irq_data *d, unsigned int type) +{ + int ret; =20 - if (hw_irq >=3D IRQC_IRQ_START && hw_irq <=3D IRQC_IRQ_COUNT) - ret =3D rzg2l_irq_set_type(d, type); - else if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) - ret =3D rzg2l_tint_set_edge(d, type); + ret =3D rzg2l_tint_set_edge(d, type); if (ret) return ret; =20 @@ -454,7 +461,7 @@ static const struct irq_chip rzg2l_irqc_irq_chip =3D { .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, - .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_type =3D rzg2l_irqc_irq_set_type, .irq_set_affinity =3D irq_chip_set_affinity_parent, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SET_TYPE_MASKED | @@ -471,7 +478,7 @@ static const struct irq_chip rzg2l_irqc_tint_chip =3D { .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, - .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_type =3D rzg2l_irqc_tint_set_type, .irq_set_affinity =3D irq_chip_set_affinity_parent, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SET_TYPE_MASKED | @@ -488,7 +495,7 @@ static const struct irq_chip rzfive_irqc_irq_chip =3D { .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, - .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_type =3D rzg2l_irqc_irq_set_type, .irq_set_affinity =3D irq_chip_set_affinity_parent, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SET_TYPE_MASKED | @@ -505,7 +512,7 @@ static const struct irq_chip rzfive_irqc_tint_chip =3D { .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, - .irq_set_type =3D rzg2l_irqc_set_type, + .irq_set_type =3D rzg2l_irqc_tint_set_type, .irq_set_affinity =3D irq_chip_set_affinity_parent, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SET_TYPE_MASKED | --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 838FA381AE6 for ; Sun, 22 Mar 2026 12:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182274; cv=none; b=rLzH+2K+n8KN8Dg9RXYU6EiWZmzGDo8T8Prz4LL6l6nIjImsRlhBh/Dw1HV4Fdq3O8/+b8nJcGsvjV0bSDYy3ms61MLew6UD4ylU0L/qLMEx7C/kDufV27fzKqsdbQ70ye0lKjlxlACN2MhRSGHBiU+QzPZcUHGHmO3B/oBtFVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182274; c=relaxed/simple; bh=4Bp9lpvpFJLHE6GKmGDfWerhcPBCMqideHGuARLZtts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qMiM5o6gMxDnIljPAUyQJDhEDA2Tc6aOWlK63x/pP3ZbIVbW089I/tKDh0D+AqbBQJqxxXyiYYFSIXpORYxexNnYZh0QqPFoYCumzWKDqfKjyybYF1jM5InYv/r4Oa8AO+rLain/W52JXt4FgczF3x9RzX4vZz4M7cAN2OLID0s= 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=BBFPFZnX; arc=none smtp.client-ip=209.85.221.50 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="BBFPFZnX" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so3038213f8f.0 for ; Sun, 22 Mar 2026 05:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182271; x=1774787071; 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=GNAwTwMGjBXpze3/2lHvMgp/fmlNJqZmlodbykzkXLg=; b=BBFPFZnXNvWbm/NyrI6Dc4QGAZK6l3ZN2shCtDLVwwb6aeICrcTeQIgCUExqGAfwn4 HarLsujfebjDr61n/oMoDFgdlLjBDOTrKeRQSkcIukphP/tKf2YeXoScT4dVaoK2B+NA MiH2pj87cMm/D5a4b48YvGvWy2ihEDGc3axmHGX5Cl1iJyhWG8Zz4c58DfTTHTN0Tt9d HwYKDdyMWgzsqxOX7w1vLic0qslIFLHBdV9YDnlha8kfGSGp/xgX94NJLjnoCPjjsqzn XRR1VO27xu8IvKjzFNMwL68GzApXVQHxAHxEY2hfBcmPRCKBacXjiot4CHhVO88ZuBfc wkMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182271; x=1774787071; 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=GNAwTwMGjBXpze3/2lHvMgp/fmlNJqZmlodbykzkXLg=; b=dkRDXH0DPgAuUnvPeHx1i/YwGfWEt8+ETnTBADb7sVW71aATvNeeSFNqY2CLNCn4hn m/a+YIikAt4Y/BmilTFo/7RbbVvHoNmvworl8N0NaZfS0nhQCOy0/gxzo/lfx1fHfM7D H7zzBe8rLgTUkJrkrg+RDBHCnBXv+2vfx90f+/Yvgwq4i+sVcpoqOcvjuUUkqAOb9h7Z TK05Nn7ITm0ASi5s2UbW9o/ijjNfEGhSdcZT0CJP6R0pyJ9t+OZ0zfU7E50Tp2oPWFBN Lk0HuO8tEVVnnS7phpQWkjvE7a8dl/d7epEAHW88aq/r6AXvlVdQtg6UY8HcagqnOtQj SM9g== X-Forwarded-Encrypted: i=1; AJvYcCVqa5TWe7VjTzGXQg2gtxj74RA+iJzsERUoHPpOfSxm+yesmRoheCripTPs33nTqKUI4TDgcKsq1yWwWYo=@vger.kernel.org X-Gm-Message-State: AOJu0YxLCmenvSHaiqtKMqnJUk/bzYLUSYku2ucdgRZtOjto8JnuxWW2 56P30WXbxzpo6wws9gbfjQWIPemVQAgRkINSFpf1EJ7otSudOZN5EkuNOUVzIg== X-Gm-Gg: ATEYQzxCRbi6fYPI8oIcGpnIvBBRDDcOPPj/Ch9iSCibkoUElFyX2AFSYGOu5WFPIN0 nZW8Q65lSb53Os7VrIL/B9z7X6fiUj+FUcAdFuqcXFaWasuRiyerSz7ZdbhkFCnMYVuxbSXxAmu hoNy18SoNOH8L+wy07nJjgVA/JoRLxgAQsGr2ntFNwQE+ARuUO/WgG1dsW3nNSktczAQBNSbIIL x7VRs5Me/YKDRqHwrNTNf5Xy1qTpSZvwqNFGkWVKWdD0nJAtaH3lwMd0KPwEd52lghh6LJA2Zvk 0OnmQcyHX9ByxY/DaKDKPBsoKPr7Ee/wOUeJEJHZl6N+e/dVBX0YMPEGoLXVUuI0F50OPLUN2dg PUOSWiKe+Pc8cX3QnSTrythy5GTH9tLlrlqwAdboOqmLLn3SrTPEh89geAr4Pnd8Ge7fgBhX8n5 Kv451KImdpOwDWvgT3JI4g7EiCf7uvnUMf2iiZVzNZsKJ2zrxZ X-Received: by 2002:a05:6000:270e:b0:43b:3c32:d901 with SMTP id ffacd0b85a97d-43b576fc6bfmr14749267f8f.11.1774182270851; Sun, 22 Mar 2026 05:24:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:30 -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 07/15] irqchip/renesas-rzg2l: Replace rzg2l_irqc_irq_{enable,disable} with TINT-specific handlers Date: Sun, 22 Mar 2026 12:23:50 +0000 Message-ID: <20260322122421.132474-8-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 rzg2l_irqc_irq_disable() and rzg2l_irqc_irq_enable() were used by both the IRQ and TINT chips, but only performed TINT-specific work via rzg2l_tint_irq_endisable(), guarded by a hw_irq range check. Since the IRQ chip does not require this extra enable/disable handling, replace its callbacks with the generic irq_chip_disable_parent() and irq_chip_enable_parent() directly. While at it, simplify rzfive_irqc_irq_enable() by replacing raw_spin_lock locking/unlocking with guard() and update the variable type of offset, tssr_offset, and tssr_index to unsigned int, as these variables are used only for calculation. Signed-off-by: Biju Das --- v5->v6: * Updated the variable type of offset, tssr_offset, and tssr_index to unsigned int, in rzfive_irqc_irq_enable() as these variables are used only for calculation. * Simplified rzfive_irqc_irq_enable() by replacing raw_spin_lock locking/unlocking with guard(). * Updated commit description. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 40 +++++++++++++---------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 84dded4beae6..78cf451c8798 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -259,33 +259,29 @@ static void rzfive_irqc_irq_enable(struct irq_data *d) =20 static void rzg2l_tint_irq_endisable(struct irq_data *d, bool enable) { + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); + unsigned int offset =3D hw_irq - IRQC_TINT_START; + unsigned int tssr_offset =3D TSSR_OFFSET(offset); + unsigned int tssr_index =3D TSSR_INDEX(offset); + u32 reg; =20 - if (hw_irq >=3D IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) { - struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); - u32 offset =3D hw_irq - IRQC_TINT_START; - u32 tssr_offset =3D TSSR_OFFSET(offset); - u8 tssr_index =3D TSSR_INDEX(offset); - u32 reg; - - raw_spin_lock(&priv->lock); - reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); - if (enable) - reg |=3D TIEN << TSSEL_SHIFT(tssr_offset); - else - reg &=3D ~(TIEN << TSSEL_SHIFT(tssr_offset)); - writel_relaxed(reg, priv->base + TSSR(tssr_index)); - raw_spin_unlock(&priv->lock); - } + guard(raw_spinlock)(&priv->lock); + reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); + if (enable) + reg |=3D TIEN << TSSEL_SHIFT(tssr_offset); + else + reg &=3D ~(TIEN << TSSEL_SHIFT(tssr_offset)); + writel_relaxed(reg, priv->base + TSSR(tssr_index)); } =20 -static void rzg2l_irqc_irq_disable(struct irq_data *d) +static void rzg2l_irqc_tint_disable(struct irq_data *d) { irq_chip_disable_parent(d); rzg2l_tint_irq_endisable(d, false); } =20 -static void rzg2l_irqc_irq_enable(struct irq_data *d) +static void rzg2l_irqc_tint_enable(struct irq_data *d) { rzg2l_tint_irq_endisable(d, true); irq_chip_enable_parent(d); @@ -456,8 +452,8 @@ static const struct irq_chip rzg2l_irqc_irq_chip =3D { .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, - .irq_enable =3D rzg2l_irqc_irq_enable, + .irq_disable =3D irq_chip_disable_parent, + .irq_enable =3D irq_chip_enable_parent, .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, @@ -473,8 +469,8 @@ static const struct irq_chip rzg2l_irqc_tint_chip =3D { .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, - .irq_enable =3D rzg2l_irqc_irq_enable, + .irq_disable =3D rzg2l_irqc_tint_disable, + .irq_enable =3D rzg2l_irqc_tint_enable, .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 C8866381B08 for ; Sun, 22 Mar 2026 12:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182275; cv=none; b=Vtqef1Xiv15MAHO2edHWIS7Oyh84x53jDsfKAca4JL6VaGWWbr+SDPpxyQtuK0uc2swFHG3F9v11XhMBMG9aZChZAKep22IB4GYfLQSXk4HIidNSLHMEUhjGVGZBvHwnXtakOlTQ7HLi2fuXZ+LSHav+sjqdq9lo1F80odCs2bA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182275; c=relaxed/simple; bh=vImPVu8izjNjWfSz3Eb23R6Sm8FThD2KV1KdyOIKvFE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X27s8CRhGnklK8Cji5LAjaGcUW50VjRXfwX6cG+hHTz6D1KtuHC5ReoDya/BjKZ3GPBwdyKupHvdyXZkaMaD+a6aXLODsdACcNG8qqA0bEC3dOAJtfB+IUWzUXrwL5wSeHVCf/MouPQy8bu29rHdBcWRH8mcjZPAbDAv4uKsFGw= 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=Qpnz0nWa; arc=none smtp.client-ip=209.85.128.48 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="Qpnz0nWa" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-483487335c2so25287185e9.2 for ; Sun, 22 Mar 2026 05:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182272; x=1774787072; 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=g78JyQIQc2fWjXTf3WwNwwJAwJHHc4x9tnvt/78e98A=; b=Qpnz0nWaJuI9E0XSLazzTyHZHJkGTDgnHkFpBNVeSNIxjuRdFfH8bMj5L7F64TFQLl QA6hiOaDXbggOuQP/dAqHk6VShT636yPSXwqmgycPsW7GQqvcrYdiBtP97AedpfJ8qA9 P/rcu8SxHqmXysxx6PVW6ww91n1/AdzinqtbXj1XvkAHJ7yQUv8vgByvXMoLPE1mliV/ W8ELx8P4d7RDCqwt7i3iLJ5NFqoVE9VcU68KqPVU8jCHx829o58IwmSCDOArUzDAWnKE fuhQMNE05vTTaQiIv2xUsyMnN07dBsPY9WzvJlXpOy9aeNwDgIHbExLezz2mQYZMlhqx 4LVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182272; x=1774787072; 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=g78JyQIQc2fWjXTf3WwNwwJAwJHHc4x9tnvt/78e98A=; b=TEC8FcHTX4Pam7fg6dEcp7662STFRbWy8vRdXqf2ecdbg3dMKeSFY0pMbUf//Gxod5 Qt5rdH5UZWy9vZMVxHNTQNVVpYg5feUuPktMnJmmH7Z1lqC6OOOr+iGs7OQd/eGFLAyf IDFCkGoADT4DBVPdI/p+1ov6OOxZzW8MeUUhDL6nq+EtURlzKTE/PoVnQ5mDEdRS9l23 uX2B7oAkIpaAL+lXAdRM8BuEA5REJUu0rBzklSxz/gH2VKpDjzce4JegFL2QgJda+HJW 7eo0InBVLNgeq6ekTVwPrOgDUbWQePBLxJZI0cKm/e3mf2QlL9J38LcEukwTvFtazElC 25mw== X-Forwarded-Encrypted: i=1; AJvYcCUF7DnFDUtHtQL6sy8qjCEF7splXT3ASDX6zzQBoo2QD85zbU5ZdaO6dzkoUx6MCgCT2wcLq1SqKCHkR0Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyS/6/ZOLZNavCXQSTNHjojFsvebR1nWEAs6rez9QaTAp83DkMf 5twGLq5JC7itNk5IGIvSRxde8Amc1OMMRHjSes7sXpdS079JhHH1GZY9 X-Gm-Gg: ATEYQzyyiQ4rsHBaYQDuN3scsXEdPum5rgHPZ+pUiB4NYE+3zSAz/L4p9NuCpMk8LaK RKo7zZNK4b059FGec9nn1VpMm4m2U2trgzHxLDREi5bTUpRaIh8UWSEloj57jlT9oczEv+KRHMS Es3c3EUZMklCledc3LCHNDvr++lERuMSpCBrH3Y8HrqofgfI7pF4bjwCMsoDeayuNM2QenLKsb1 mgagS4J5B8adoq41oGuj8ALQ49biDEo7oTwj09UbUouBUzeG/nQbgaHzT+9qAwL6LUQ1DCaFhuw x/neAPFRg3KmCF4hT6VR0TUBlvyxDoSMihC4SiUc6zhPaIyZucrK+hBTpAdQABdmEOmoMnLAlD5 EnhUAfj6q78R0ItRlLSCWrJ/TRbxUCKNOEGH01g88llfF1ZqhyCozGP77ctc+L7ml6vSWnPD74Z 5AdkDhjZXt7sPCuBr24FcAcBUJgAbyyzuRRraX2HZ6C+LPBbcJ X-Received: by 2002:a05:600c:820d:b0:487:467:42a2 with SMTP id 5b1f17b1804b1-487046744a1mr50811405e9.18.1774182272017; Sun, 22 Mar 2026 05:24:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:31 -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 08/15] irqchip/renesas-rzg2l: Split rzfive_tint_irq_endisable() into separate IRQ and TINT helpers Date: Sun, 22 Mar 2026 12:23:51 +0000 Message-ID: <20260322122421.132474-9-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 rzfive_tint_irq_endisable() handled both IRQ and TINT enable/disable paths via a hw_irq range check. Split this into two dedicated helpers, rzfive_irq_endisable() for IRQ interrupts and rzfive_tint_endisable() for TINT interrupts, each operating unconditionally on their respective interrupt type. While at it, simplify rzfive_{irq,tint}_endisable by replacing raw_spin_lock locking/unlocking with guard() and update the variable type of offset, tssr_offset, and tssr_index to unsigned int, as these variables are used only for calculation. Signed-off-by: Biju Das --- v5->v6: * Simplified rzfive_{irq,tint}_endisable by replacing raw_spin_lock locking/unlocking with guard(). * Updated the variable type of offset, tssr_offset, and tssr_index to unsigned int, in rzfive_tint_endisable() as these variables are used only for calculation. * Dropped stray newline in rzfive_tint_endisable(). * Updated commit description. v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 75 +++++++++++++++++------------ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 78cf451c8798..71bde07675d9 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -212,48 +212,61 @@ static void rzfive_irqc_unmask(struct irq_data *d) irq_chip_unmask_parent(d); } =20 -static void rzfive_tint_irq_endisable(struct irq_data *d, bool enable) +static void rzfive_irq_endisable(struct irq_data *d, bool enable) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); =20 - if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) { - u32 offset =3D hwirq - IRQC_TINT_START; - u32 tssr_offset =3D TSSR_OFFSET(offset); - u8 tssr_index =3D TSSR_INDEX(offset); - u32 reg; - - raw_spin_lock(&priv->lock); - if (enable) - rzfive_irqc_unmask_tint_interrupt(priv, hwirq); - else - rzfive_irqc_mask_tint_interrupt(priv, hwirq); - reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); - if (enable) - reg |=3D TIEN << TSSEL_SHIFT(tssr_offset); - else - reg &=3D ~(TIEN << TSSEL_SHIFT(tssr_offset)); - writel_relaxed(reg, priv->base + TSSR(tssr_index)); - raw_spin_unlock(&priv->lock); - } else { - raw_spin_lock(&priv->lock); - if (enable) - rzfive_irqc_unmask_irq_interrupt(priv, hwirq); - else - rzfive_irqc_mask_irq_interrupt(priv, hwirq); - raw_spin_unlock(&priv->lock); - } + guard(raw_spinlock)(&priv->lock); + if (enable) + rzfive_irqc_unmask_irq_interrupt(priv, hwirq); + else + rzfive_irqc_mask_irq_interrupt(priv, hwirq); +} + +static void rzfive_tint_endisable(struct irq_data *d, bool enable) +{ + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + unsigned int hwirq =3D irqd_to_hwirq(d); + unsigned int offset =3D hwirq - IRQC_TINT_START; + unsigned int tssr_offset =3D TSSR_OFFSET(offset); + unsigned int tssr_index =3D TSSR_INDEX(offset); + u32 reg; + + guard(raw_spinlock)(&priv->lock); + if (enable) + rzfive_irqc_unmask_tint_interrupt(priv, hwirq); + else + rzfive_irqc_mask_tint_interrupt(priv, hwirq); + reg =3D readl_relaxed(priv->base + TSSR(tssr_index)); + if (enable) + reg |=3D TIEN << TSSEL_SHIFT(tssr_offset); + else + reg &=3D ~(TIEN << TSSEL_SHIFT(tssr_offset)); + writel_relaxed(reg, priv->base + TSSR(tssr_index)); } =20 static void rzfive_irqc_irq_disable(struct irq_data *d) { irq_chip_disable_parent(d); - rzfive_tint_irq_endisable(d, false); + rzfive_irq_endisable(d, false); } =20 static void rzfive_irqc_irq_enable(struct irq_data *d) { - rzfive_tint_irq_endisable(d, true); + rzfive_irq_endisable(d, true); + irq_chip_enable_parent(d); +} + +static void rzfive_irqc_tint_disable(struct irq_data *d) +{ + irq_chip_disable_parent(d); + rzfive_tint_endisable(d, false); +} + +static void rzfive_irqc_tint_enable(struct irq_data *d) +{ + rzfive_tint_endisable(d, true); irq_chip_enable_parent(d); } =20 @@ -503,8 +516,8 @@ static const struct irq_chip rzfive_irqc_tint_chip =3D { .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, - .irq_enable =3D rzfive_irqc_irq_enable, + .irq_disable =3D rzfive_irqc_tint_disable, + .irq_enable =3D rzfive_irqc_tint_enable, .irq_get_irqchip_state =3D irq_chip_get_parent_state, .irq_set_irqchip_state =3D irq_chip_set_parent_state, .irq_retrigger =3D irq_chip_retrigger_hierarchy, --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 68F1C381B17 for ; Sun, 22 Mar 2026 12:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182277; cv=none; b=lXiKyNM9kak5dn74LR726GwhXPhw8llxNA06LaAl96wg8ihjG+HmEOoHSdaWGOMdb1t3G7/2M2aDr/N4/dUPnqMgkGOqlhzEZINki1k5D4piwX0JxkVguCAppnr5Ngv9cTeejnOdxp+BUnk4UsTWx2bje1ucigSC8+a/AlGD/Z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182277; c=relaxed/simple; bh=WufSUGU/OKKQ/6W4TtvXGJAWO601k8aNbxjJOWYroy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MpHFGTjiSSnk8WVGE0QZStXLTpUlz4KKyrjlMMOD9348+IiXIGcUplOvyaUBMiosoy/tAsLCmWy0wFbranARmixpV7t4lEANIh/mpAs24EGZM0kxkLP60EHK1pKetkf4eLQUsq4HAqqKMQBKCtUm6HZVvDbYXUq3BAWNTsvULmM= 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=GXWaSg7f; arc=none smtp.client-ip=209.85.221.45 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="GXWaSg7f" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-43b4121c40aso2361605f8f.0 for ; Sun, 22 Mar 2026 05:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182273; x=1774787073; 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=zSrz7nV+L27WDUhgHlWWOwEYkqqCerWHNMbGLrfjsNY=; b=GXWaSg7fGAaGRD34/jg6mBHRZrcejMXZyQVxmE1OrlLlyGo4yQwvFSl5qTb15i34I3 9Lf7xDUI4p4Hfxfab9HbQmjv6ZYHWa5pK67rKynljXRaQk/2oy/XIZ8QLyfhDMY3rNWL MmNihxTuWedyB+9J0YUpRnX32P+iit49C4JRw8cG6vbfvVG0F9tX82Cfc73U3mb4EMmB IlcRW8+srun8nJT78pZ61XCZnae5YsX1EdBoIug8TB9cZe4vFj3lWLLglqHbFKmoKRqv iDzrrJVrgX6mtkOwUQv40Sf/gl6ugouDSjtTcspbT/P99bg7y9VPRsm3SK0VEVaYm2vx Bb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182273; x=1774787073; 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=zSrz7nV+L27WDUhgHlWWOwEYkqqCerWHNMbGLrfjsNY=; b=geVbvDf9xQkN/fcyeNzIj4277Q8gxIbMi91hXV1acAwumr8yk7DiKl6RmnY6QvAIYg dr82hoqc2D7N12QUVR6vBazfGbzTrZE8AfR3D2LrIAxmiECWZa+o3h9qynAwJLdjGvFR iO9/RsowfchR38OLaGqKaal47OS0hRhAGOTcAcy/UVH8EwC0W5xN88Pe08eQkkkzlAqt KfbXT/GhW7/9rhqf4kcbUZmejmw6jCFQm2xYnIQvV3SZI4S5qkkP/nuGf4FaTbD3LIEt dzFZVro6iFhEGE3hI+78rKRo7bc5K4UaX9U4yTmo0xlIywsNpxvCiSxADDXqOMsOwaoW Z09g== X-Forwarded-Encrypted: i=1; AJvYcCUwy3h41qXI7zFbYyV2Z/LPrxl+TZUQhOxPWkHztTQIwyv+uey+BfN3vzjtcYESqcBHqYPekU6zM5Ipv4Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yy36xvumWX071uTDcBUQt93Y0+RONfzKeUkdAnEB0LIxAYtQvzb adgcFxCFOkpggpo1iO3/tBu6CGLdgvF3kTENUoVuaKD7A2XORQeqWatm X-Gm-Gg: ATEYQzw07un3ukk+b83NFnnD2nCAL3oOBwbc1cb5D6Qqx2D2GFiCQMxgxgN7RdRgLYa 2pKuMEJ8yMF3vCjtfBfIBhDblAInwxbYI3IuaUr6lzzVDZZTVI+3txkizBlH8MAOJVraQ4hDzPN TLklrTo1ouJCrkHYQPudq7vqviU7/BqQ+VnODTFltuKoSDKp2RBmYt5dO1HzN+wd5trr5AfeKDo +FXIpSppBQfCrfK36S/bs4GUdu/atJiaod1EJz4KtVE6AjOxTm+dStxRzQZLQJIMOym6Lx7r/kQ t/wZL/QHK+RBsewUpDI11j8W/QSmJSxjY2YRHpgg1rrZ46FyOe+FoSwamv7i0jOkJkv1OP42dns g+3XxpTQHyeFJv5g6r/vGM0xK9nbA91jRGaqssIxk5fN/wcGNso87OuR1RPs4LtuOoc2Y0qiO4x INkvxAq1z10ZOhXLGmKObG9w8S7vVMnSXpB6+qFnPitoSNyH8y X-Received: by 2002:a05:6000:2f84:b0:43b:4312:2ca9 with SMTP id ffacd0b85a97d-43b642402c0mr12873174f8f.6.1774182272726; Sun, 22 Mar 2026 05:24:32 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:32 -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 09/15] irqchip/renesas-rzg2l: Split rzfive_irqc_{mask,unmask} into separate IRQ and TINT handlers Date: Sun, 22 Mar 2026 12:23:52 +0000 Message-ID: <20260322122421.132474-10-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Biju Das rzfive_irqc_mask() and rzfive_irqc_unmask() used hw_irq range checks to dispatch between IRQ and TINT masking operations. Split each into two dedicated handlers =E2=80=94 rzfive_irqc_irq_mask(), rzfive_irqc_tint_mask(= ), rzfive_irqc_irq_unmask(), and rzfive_irqc_tint_unmask() =E2=80=94 each operating unconditionally on its respective interrupt type, removing the runtime conditionals. Assign the IRQ-specific handlers to rzfive_irqc_irq_chip and the TINT-specific handlers to rzfive_irqc_tint_chip, consistent with the separation applied to the EOI, set_type, and enable/disable callbacks in previous patches. While at it, simplify rzfive_irqc_{irq,tint}_{mask,unmask}() by replacing raw_spin_lock locking/unlocking with scoped_guard(). Signed-off-by: Biju Das --- v5->v6: * Updated commit description. * Simplified rzfive_irqc_{irq,tint}_{mask,unmask}() by replacing raw_spin_lock locking/unlocking with scoped_guard(). v5: * New patch. --- drivers/irqchip/irq-renesas-rzg2l.c | 44 ++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 71bde07675d9..0b1bad002653 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -184,31 +184,47 @@ static void rzfive_irqc_unmask_tint_interrupt(struct = rzg2l_irqc_priv *priv, writel_relaxed(readl_relaxed(priv->base + TMSK) & ~bit, priv->base + TMSK= ); } =20 -static void rzfive_irqc_mask(struct irq_data *d) +static void rzfive_irqc_irq_mask(struct irq_data *d) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); =20 - raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + scoped_guard(raw_spinlock, &priv->lock) rzfive_irqc_mask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) + + irq_chip_mask_parent(d); +} + +static void rzfive_irqc_tint_mask(struct irq_data *d) +{ + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + unsigned int hwirq =3D irqd_to_hwirq(d); + + scoped_guard(raw_spinlock, &priv->lock) rzfive_irqc_mask_tint_interrupt(priv, hwirq); - raw_spin_unlock(&priv->lock); + irq_chip_mask_parent(d); } =20 -static void rzfive_irqc_unmask(struct irq_data *d) +static void rzfive_irqc_irq_unmask(struct irq_data *d) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); =20 - raw_spin_lock(&priv->lock); - if (hwirq >=3D IRQC_IRQ_START && hwirq <=3D IRQC_IRQ_COUNT) + scoped_guard(raw_spinlock, &priv->lock) rzfive_irqc_unmask_irq_interrupt(priv, hwirq); - else if (hwirq >=3D IRQC_TINT_START && hwirq < IRQC_NUM_IRQ) + + irq_chip_unmask_parent(d); +} + +static void rzfive_irqc_tint_unmask(struct irq_data *d) +{ + struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); + unsigned int hwirq =3D irqd_to_hwirq(d); + + scoped_guard(raw_spinlock, &priv->lock) rzfive_irqc_unmask_tint_interrupt(priv, hwirq); - raw_spin_unlock(&priv->lock); + irq_chip_unmask_parent(d); } =20 @@ -497,8 +513,8 @@ static const struct irq_chip rzg2l_irqc_tint_chip =3D { static const struct irq_chip rzfive_irqc_irq_chip =3D { .name =3D "rzfive-irqc", .irq_eoi =3D rzg2l_irqc_irq_eoi, - .irq_mask =3D rzfive_irqc_mask, - .irq_unmask =3D rzfive_irqc_unmask, + .irq_mask =3D rzfive_irqc_irq_mask, + .irq_unmask =3D rzfive_irqc_irq_unmask, .irq_disable =3D rzfive_irqc_irq_disable, .irq_enable =3D rzfive_irqc_irq_enable, .irq_get_irqchip_state =3D irq_chip_get_parent_state, @@ -514,8 +530,8 @@ static const struct irq_chip rzfive_irqc_irq_chip =3D { static const struct irq_chip rzfive_irqc_tint_chip =3D { .name =3D "rzfive-irqc", .irq_eoi =3D rzg2l_irqc_tint_eoi, - .irq_mask =3D rzfive_irqc_mask, - .irq_unmask =3D rzfive_irqc_unmask, + .irq_mask =3D rzfive_irqc_tint_mask, + .irq_unmask =3D rzfive_irqc_tint_unmask, .irq_disable =3D rzfive_irqc_tint_disable, .irq_enable =3D rzfive_irqc_tint_enable, .irq_get_irqchip_state =3D irq_chip_get_parent_state, --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 2234F3815CE for ; Sun, 22 Mar 2026 12:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182276; cv=none; b=BVjfEY5FIswugv4Qj+vB8MP5MfzA+39MLbkKjHpXfb02IaHXyEu4Vp/9dc9UZ8D98CMD40GHzNSgQbQlRuDuiGEf3OjvIy1CZiXq5+olKVL8nEQDPWMbaMH69Sqdv12Mp+OSoUjawf3cT/lkjA79ZtVT8rhRKVMZHEnrw9zzeko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182276; c=relaxed/simple; bh=0XWo6QwMNSzFLNGlc54LjYgpN9pg0m7+EFFpEd5JzT4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=spm2595gAeq6QhpvrYjxSrc6me+HT+Q6fvtsLpDcWa2IRDVeZU4XgzfRM06c9BlLrdOIufd7uSbuIL5iRUAHS02/Yncvayukq7MFgXksEGwQuVt+JRrQflLKDrsoPoXm9dAvGMItpbVKIj31pf6Jzmfgkq0r0iZIiQ/24/wr/NQ= 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=Wn0FaM/Q; arc=none smtp.client-ip=209.85.128.48 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="Wn0FaM/Q" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-48540d21f7dso23146585e9.0 for ; Sun, 22 Mar 2026 05:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182274; x=1774787074; 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=8NdU9IK1zXt2LOJRqNLkN6I6YWTD/eeOJBLTngDVgk4=; b=Wn0FaM/QYvwwJT9L8uJNVsKoTSK0UVGlQYwXu5rxgU0zWUm+XbGKS4Oj7YgLSYob3v n3Qp4z4D1ePnfQ4CU6WC9207g/x1yFw99tXcaHTzg7ZNYm8I1cDPRnVjM+IeMc1kt3vE uyMJv50cdJEB2EZtCNr/oxwWFuI9PTKRZ7YkgnQ+pJ8yCpspF/loca+E4PUJYgSIzkI/ fgMVSYRqsTRRuwOTPl07x93okr27VwcriDUGsUBiQD8fDDwQTBSrVzXYj1cvNdYUrJvZ YBX5VTe2cr7hR3zbRypT3JWW+OTMJjZYZ01Cb4luiHkM32Nefz6Rwl8slYSsMtCJfX6C p9ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182274; x=1774787074; 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=8NdU9IK1zXt2LOJRqNLkN6I6YWTD/eeOJBLTngDVgk4=; b=PvCL7S5xrwP3BFJldvAaTRZ5Ur2fhYgIItpFuAuiuRGQnRojni5FWiwj6Lk4ZJ5gFO Bdi5AD1VfvxYNSH0XWxy2PbhmmAnM9l/L+StumUmtjp7VIWg8gugM/dlL5bZX5SjX5U3 +2pE3zmd3T1fv9DsM+zMyY7wpm7oCcDN/WA9n4bhe4ahl03Mp1Uy8tL2IHQRETzu87lo RMUPCdsHMnpIJPSV/Eh4CeRM5QQ7G1IBFcmYx1KdFhoubiRe8Rr6X39qKP+EWVlIRGI+ mSpSsH/mxrT94gC/d/o+XS/hzMrp6UyGCWPfhZW2Q8WkQdjXnVVjmNVSEnocfCC6Qgh6 rbQg== X-Forwarded-Encrypted: i=1; AJvYcCXM1UcoChNIF56VI2V2GKx8rgA3s5VZeo7aw71zPH+4QSiY7mFEzq1QPmJ1TdMP7+d1VojkYJivWxyzUxM=@vger.kernel.org X-Gm-Message-State: AOJu0YyKXxNuYodxXT/dq1sNiIDNjfKH5P1Ec54iKYMiUINx8qTRyOec jd6cElEyWRdcZHN2I/FpLbKG0kTZbh3u/Af7oG/END8P/l9jyTusij2N X-Gm-Gg: ATEYQzwEZrFxtmUNIXiHL/ivdSHRTMYNf7u5rw4CPc0JuCNMRlMbnC0R6hMoDtsq9tn NpcSjnnP5NEovWL8YjJpZLYCvJdzKjlPo6h9gnlcNHGxEe9v6GjQfXIHTTuZ+FbpUaDCfHzcYiD FCO7VFsIZtV1gO+73FVC3bxZrJ8HUeIErxdGdhVKlfNS78qnNSX2m8LAl0nS9pybTCKR6wCfmeB dVh/ptjBbre00HIy8cxrAh1HLDQexchZNcG+B9enLi6JU1Lie7mS60F4Z0iiyjdRGuDW0U+uKeO KU9SNLUHl7BJHpRriIbFUDMQNDYKj0+hM6PTFMLJXCNK5xoQ05TixBpyu6yJqaGHs8RoemATyIM Tbh83iFsSLz+ko8hl41FGiPJYVLZ9Wum6ChC7vW/Dds0d9g5JNDcDy70Iy4thCVHVM/ca6WabPm CWyOWyD07dq2IC4KppXMgXXOomvdIF0YTxBW80ZPK5BvevEonv X-Received: by 2002:a05:600c:5291:b0:485:34b3:8589 with SMTP id 5b1f17b1804b1-486ff04d42fmr130918315e9.31.1774182273540; Sun, 22 Mar 2026 05:24:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:33 -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 10/15] irqchip/renesas-rzg2l: Dynamically allocate fwspec array Date: Sun, 22 Mar 2026 12:23:53 +0000 Message-ID: <20260322122421.132474-11-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 total number of interrupts in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external interrupts whereas RZ/G2L has only 8 external interrupts. Dynamically allocate fwspec memory instead of static allocation to support both SoCs. Signed-off-by: Biju Das --- v5->v6: * No change. v4->v5: * No change. v3->v4: * Updated commit header * Replaced IRQs->interrupts in commit description * Fixed the typo Dynamicaly->Dynamically v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 0b1bad002653..cf0d45c40083 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -81,7 +81,7 @@ static struct rzg2l_irqc_priv { void __iomem *base; const struct irq_chip *irq_chip; const struct irq_chip *tint_chip; - struct irq_fwspec fwspec[IRQC_NUM_IRQ]; + struct irq_fwspec *fwspec; raw_spinlock_t lock; struct rzg2l_irqc_reg_cache cache; } *rzg2l_irqc_data; @@ -632,6 +632,11 @@ static int rzg2l_irqc_common_probe(struct platform_dev= ice *pdev, struct device_n if (IS_ERR(rzg2l_irqc_data->base)) return PTR_ERR(rzg2l_irqc_data->base); =20 + rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, IRQC_NUM_IRQ, + sizeof(*rzg2l_irqc_data->fwspec), GFP_KERNEL); + if (!rzg2l_irqc_data->fwspec) + return -ENOMEM; + ret =3D rzg2l_irqc_parse_interrupts(rzg2l_irqc_data, node); if (ret) return dev_err_probe(dev, ret, "cannot parse interrupts: %d\n", ret); --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 95C8E3803C5 for ; Sun, 22 Mar 2026 12:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182278; cv=none; b=IwFTzf/pBco9HN4W5LY0TCYEP0sdwBtaXXTRTyAmVK6Q/3i/Z8V/7R7IL/+59ABXY9sFBIjC+NUUGAhCu4vFplZWnha17L6sPPglnVcnwO/foZ1OUt7h/vSHfRAO0MHNw2glL0M9eWX60zOHWxQNcj4clYef4gMuLZ0RCG6ppag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182278; c=relaxed/simple; bh=jASfw8kdvkhMmRdlkZJdcEhZhf/cDrLIXPMn03ZcID4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AGiwe1nyP5QTNAGdaDfu9c+F1DRkyrB3tvK9TnJ3EXfAZdW1chxj6cas6cVdr4bcytx+Wq4yyd8TUUnKkJMb73y83eVnDZDlEK+a4FOloicxOL2EtutPfulqm1/daqawzAin75nLOrfulJCpB77+tb+k8kgnj+dgVAiy47/Vov8= 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=d3RaAfoF; arc=none smtp.client-ip=209.85.221.48 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="d3RaAfoF" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-43b41b545d9so4068001f8f.2 for ; Sun, 22 Mar 2026 05:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182274; x=1774787074; 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=WTOjP4wKgm+X9lCwgxDRiFdjvNAMY5QZsLvZtT22qWI=; b=d3RaAfoF6GJXhcObUNafeCIFzycM061/BVKzL2g5gZaWIzFzcKX8GedjECsgkvFzZI jCFzIWf7CxcbLlJFasTCo2ldTOMLBMR9fboSzc9aIS+0aVzM23pv1DNDECoPXs658AV5 maLZqXGyy5Vsm1PwpXU+ReB/th13L2ksLFjfpdxh7HXwYPcvGJx32tYkxIRSZB9XPEpR dwkEQ0J9tE0ISJl/c+Zw8u7aEKXk1UcbBWe9+1ExPQavBoj8fEwJL1YC/GLDIzwpioVO C3dU8y2qZJktxrP8fLIbto49mGGRkrXQwottGTa1/HYr4jEkdaOp4od3Gk2Ke3QBe3H5 iJWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182274; x=1774787074; 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=WTOjP4wKgm+X9lCwgxDRiFdjvNAMY5QZsLvZtT22qWI=; b=e0c/rptMndc0udUA4Inu1pP5zKbcQQS3WIiB9Ajn0AxaKPuLyhteXIQUQOwCJ5Mf/V LwIKG5527ZG4cLA4fubyvRquiizD6oN2lUhJaREJtnTkiyPZbPK83rT2xVVeI8VrVMdx o7qQXrFIewys2/t4vvdglz4tzyZd+bbKVX2jX8umNxmM/4wekIzqCtQXeyv7TMrM9sy3 lL8NilBbv/FcifogThYD4W2rwDZYIe/o33eeyie28CCEhn3Ndjhm01AiNHCRGK4NVjwS 02ZyIrp5sJwGG1AbQXkCD90ruQpnC9MaEvl2oUus0wJiaZZ/z7hwT5s3nr51zIqAaL/F F3Eg== X-Forwarded-Encrypted: i=1; AJvYcCWGwq9JSMe1qnbQu0s2WTPuNUOrakhpFY/C5tu0+nzq6jPSuJlxciwJKevhsL40KxSkA/y6U9rKgIKl82s=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7NKFQIGUdJgUCwfu4SkmesfUG/XJubnDd2jq+wolL6vhB944x MxTtFihpi4GEFhfFPRM/9OQWcGC6KcfcW+ZiXswpcAZ+BHQBd67UJoB2 X-Gm-Gg: ATEYQzz5uydT8FSwDpo3N5cnEbZpYc6vTn0eZIt9TLH3sDjb/22w3XjaI9pDARhUb6n 8bJVMsoH0A1LpTzderu6dAmWbiS2yQfo2Wv4M0q1qYzoFPsdPJ3CucsCs1MZdi9ilESdxDasYpe tfRwqkdcjbJsoSb4fYWogNwvaeKIH2ithPao+KsYZljiNZTqimNf/8ld1DLsw2EE4dy7kANdmbM TlGRDfFdcQ+vqVpRkaWtqE9G7Pu+s8DyOfL+R+pdV4NQ5AgGzawNw6wao2SvGwj41kloIscS7KY uy2f13kqBy3Xzc/J9lUn6aROHxc6Mc+yPTUNJ5o0BFxnYmECaxhST2zxVwzz7WVOb/AF+WMY/Sn LTH8GuQoK2B06x1ofBeMsvN+yrmKoxIZZUqhARu4onZ3/d7ST57piWr8YYIHpCyHnY7c20J3co6 X4RqLTz4LKGCAOk6wSuAWZp4/HS7VHIRa0wZlaz98/x3z2dd5srz/he0oSAPQ= X-Received: by 2002:a05:6000:4287:b0:439:b1d8:6091 with SMTP id ffacd0b85a97d-43b64234854mr14039364f8f.1.1774182274324; Sun, 22 Mar 2026 05:24:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:33 -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 11/15] irqchip/renesas-rzg2l: Drop IRQC_NUM_IRQ macro Date: Sun, 22 Mar 2026 12:23:54 +0000 Message-ID: <20260322122421.132474-12-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 total number of interrupts in RZ/G2L and RZ/G3L SoC are different. Introduce struct rzg2l_hw_info to handle the hardware differences and replace the macro IRQC_NUM_IRQ with num_irq variable in struct rzg2l_hw_info. Signed-off-by: Biju Das --- v5->v6: * No change. v4->v5: * Dropped the hw_irq range check involving info.num_irq v3->v4: * Updated commit description IRQs->interrupts * Replaced the variable type for num_irq in struct rzg2l_hw_info from u8->unsigned int * Replaced the pointer variable info from irqc_priv and instead embed a struct hwinfo into irqc_priv and copy the data into it at probe time. * Replaced the check 'hwirq > (priv->info->num_irq - 1)' with hwirq >=3D priv->info.num_irq v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 34 ++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index cf0d45c40083..5a21bca91e4e 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -24,7 +24,6 @@ #define IRQC_IRQ_COUNT 8 #define IRQC_TINT_START (IRQC_IRQ_START + IRQC_IRQ_COUNT) #define IRQC_TINT_COUNT 32 -#define IRQC_NUM_IRQ (IRQC_TINT_START + IRQC_TINT_COUNT) =20 #define ISCR 0x10 #define IITSR 0x14 @@ -68,6 +67,14 @@ struct rzg2l_irqc_reg_cache { u32 titsr[2]; }; =20 +/** + * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @num_irq: Total Number of interrupts + */ +struct rzg2l_hw_info { + unsigned int num_irq; +}; + /** * struct rzg2l_irqc_priv - IRQ controller private data structure * @base: Controller's base address @@ -75,6 +82,7 @@ struct rzg2l_irqc_reg_cache { * @tint_chip: Pointer to struct irq_chip for tint * @fwspec: IRQ firmware specific data * @lock: Lock to serialize access to hardware registers + * @info: Hardware specific data * @cache: Registers cache for suspend/resume */ static struct rzg2l_irqc_priv { @@ -83,6 +91,7 @@ static struct rzg2l_irqc_priv { const struct irq_chip *tint_chip; struct irq_fwspec *fwspec; raw_spinlock_t lock; + struct rzg2l_hw_info info; struct rzg2l_irqc_reg_cache cache; } *rzg2l_irqc_data; =20 @@ -573,7 +582,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, chip =3D priv->irq_chip; } =20 - if (hwirq > (IRQC_NUM_IRQ - 1)) + if (hwirq >=3D priv->info.num_irq) return -EINVAL; =20 ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, chip, (void *)= (uintptr_t)tint); @@ -596,7 +605,7 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irq= c_priv *priv, unsigned int i; int ret; =20 - for (i =3D 0; i < IRQC_NUM_IRQ; i++) { + for (i =3D 0; i < priv->info.num_irq; i++) { ret =3D of_irq_parse_one(np, i, &map); if (ret) return ret; @@ -609,7 +618,8 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irq= c_priv *priv, =20 static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct de= vice_node *parent, const struct irq_chip *irq_chip, - const struct irq_chip *tint_chip) + const struct irq_chip *tint_chip, + const struct rzg2l_hw_info info) { struct irq_domain *irq_domain, *parent_domain; struct device_node *node =3D pdev->dev.of_node; @@ -632,7 +642,9 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n if (IS_ERR(rzg2l_irqc_data->base)) return PTR_ERR(rzg2l_irqc_data->base); =20 - rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, IRQC_NUM_IRQ, + rzg2l_irqc_data->info =3D info; + + rzg2l_irqc_data->fwspec =3D devm_kcalloc(&pdev->dev, info.num_irq, sizeof(*rzg2l_irqc_data->fwspec), GFP_KERNEL); if (!rzg2l_irqc_data->fwspec) return -ENOMEM; @@ -657,7 +669,7 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n =20 raw_spin_lock_init(&rzg2l_irqc_data->lock); =20 - irq_domain =3D irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ= , dev_fwnode(dev), + irq_domain =3D irq_domain_create_hierarchy(parent_domain, 0, info.num_irq= , dev_fwnode(dev), &rzg2l_irqc_domain_ops, rzg2l_irqc_data); if (!irq_domain) { pm_runtime_put(dev); @@ -669,14 +681,20 @@ static int rzg2l_irqc_common_probe(struct platform_de= vice *pdev, struct device_n return 0; } =20 +static const struct rzg2l_hw_info rzg2l_hw_params =3D { + .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, +}; + static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_irq_chip, &rzg2l= _irqc_tint_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_irq_chip, &rzg2l= _irqc_tint_chip, + rzg2l_hw_params); } =20 static int rzfive_irqc_probe(struct platform_device *pdev, struct device_n= ode *parent) { - return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_irq_chip, &rzfi= ve_irqc_tint_chip); + return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_irq_chip, &rzfi= ve_irqc_tint_chip, + rzg2l_hw_params); } =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 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 8E88B3815ED for ; Sun, 22 Mar 2026 12:24:36 +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=1774182278; cv=none; b=HQcs5bXfNiQ/fXOewOz/Xm67wnuXTB7+5L4eshnJIZqX9+lGx91NLajFpl1Zznljq1ROWsft+5BmW+mo5nGgwc2+hInC1jTLEmhHZpNbq4qMPwCvsb/B5pKwSvrW52h8mptRVZK6m4xXyhOnx2azq/iDjTxAKrRhKq4KK0upQes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182278; c=relaxed/simple; bh=A6dcZYR8tOrf2hf1QYqYL8J0rqVv72XxMlr7n+txYo8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iYtR2fd6M93CtuW0TPsL5+Dc57a1rWPXeHr2E63p1LrG9/fhqVDcOPQgIChJsJqDFXe6WsSHJvOMTAXauJHjSvM7RVNp6FznvrJQ/1u02S3DdBdBahGUhMK85p5dBs/5d+Fis2NgB939O3Ks0EkOkvES/WDZqQcvQsJ/a6Po2Hs= 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=BtsPWxXi; 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="BtsPWxXi" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so3038264f8f.0 for ; Sun, 22 Mar 2026 05:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182275; x=1774787075; 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=zZxWtjoYjjjElcS1OQSWjkckUK+HZvQbITD74pYofro=; b=BtsPWxXi98uzMiKzJ9zt7FY9LDUvOgv0l26Y1CYTuZNCIJPsMLYHTi0fU2JcmiP0eu eLFObjtEsvXvMUl1AzafsASFS5V3IHjFGTuabvPfOHbRcMpofpo6tWjOFspGVwKm8IEb ybERBXSEtRQ37V7cYEZ7B5jrJiVJsqBlSJ6mhtz4/taFnmUqxhNX96Eclf5/qztBRQw/ d8Krc8mAAhyMGOLeO/0X/gQqtrQOvR0AlCzK6lemIlS+yq8K68sPUMEpFAIPJ8xY40bP yRphSruaX4A0w6KXEey/Czf2AMw/sOdfyLYHIdYSlvsm6yyCzyBgXRHiUfLRjLxaz+LF ESvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182275; x=1774787075; 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=zZxWtjoYjjjElcS1OQSWjkckUK+HZvQbITD74pYofro=; b=Rn2+Yca1zI0VWF+MKujR23lsj3R5p7+BO5MqM27oUP9kg6CkIYW9CrAubimswTnQpN SlUOtpg1jOJKiqv7vR2crLxEG4YjzTmLKmDA3rT0IlpFo6itB3HXtY8tL3Uxo64uXyk8 wW0V7hkKC+pXwoG7tJX/1UmAl5COfA61FBSpwqdMjhx0CkWHc8/Oj7tydZZnSY8T6Rf8 +SqlzGJ3BTB/Vv1ZjtGISrFiGK070SoiUtEANT6MdZRHgZo8bnbLg51r10lz3UbjU9nu u6zLQcDaqW0cMoH7XQIpCCqH/dPDcLP6u8bpF0VdfEWwwo8PljpyTwxJgZqKapuPTWWW DHiA== X-Forwarded-Encrypted: i=1; AJvYcCWHE394tBUuuxim9cQstPfcNoAgnBJWtvCjwe33s/MSYf12ewD9lzAo9W0mvlQBjCVnrqMj7V8gLZm/N1o=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/T/9Vk39LjgxJtgZSA/qP+bnOIMnV2ZDzbAxs00NH8j2VwPx7 DzTUEQ0+EyuKspJYxUcmqhJqeBIb2R8oCY9Y+FV2Brb0F4fmUxfswRyF X-Gm-Gg: ATEYQzxGQfGzupXRj8DlGrxhbiCNA6sBTdcbFWbJhC6UbQ1LEggsIwp4AN0hlAbJkxP C8lFp5fCJiKhM3ipYBMfZTmq9wZvUSTEvvABI1eXLvwhPueENqZuyMWOe9NZ6pL+vOmjYqCZLQf ET1UC8kCw2HMm9z5sBuDeJOn3EYb04+FK6dVoOcmF6yBTEsyMKt8f6rtt9ZA1SER2AKPvHi9Lm6 Vt+CPgnPDf9fNGkgByhwSyjc5Tv7b37T+6+oxkdnCO7M/cpeVQ4zXzpGzRHZU4GjJBZj/vO8X+E 1Vw/7Ejz3XJmb/xVZwt5cjb5OYpzDYSoJISvHdml/+DClffvj17g2wa2tN8qu5+7fNwiLXu7z/c dcfoRLxABixD/7+QM9w34WqY1ZnGAL4tsmAv9xkLP1De4Gq+YjqrjdhZj28KJxkUtoUi9ePlTrx 8/etlAYEmFnS2dYChRFVeG6sJl74JX68bAlg9XTGtgHl6nd2jN X-Received: by 2002:a05:6000:1861:b0:43b:4703:9dd5 with SMTP id ffacd0b85a97d-43b64272ae1mr14892339f8f.18.1774182274924; Sun, 22 Mar 2026 05:24:34 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:34 -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 12/15] irqchip/renesas-rzg2l: Drop IRQC_TINT_START macro Date: Sun, 22 Mar 2026 12:23:55 +0000 Message-ID: <20260322122421.132474-13-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 IRQC_TINT_START value is different for RZ/G3L and RZ/G2L SoC. Add tint_start variable in struct rzg2l_hw_info to handle this difference and drop the macro IRQC_TINT_START. While at it, update the variable type of titseln, tssr_offset, tssr_index, index, and sense to unsigned int, in rzg2l_tint_set_edge() as these variables are used only for calculation. Signed-off-by: Biju Das --- v5->v6 * Updated the variable type of titseln, tssr_offset, tssr_index, index, and sense to unsigned int, in rzg2l_tint_set_edge() as these variables are used only for calculation. * Updated commit description. v4->v5: * Dropped the hw_irq range check involving info.tint_start v3->v4: * Updated commit description 'this differences->this difference'. * Updated tint_start variable type from u8-> unsigned int. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 5a21bca91e4e..922d9dfeddcd 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -22,7 +22,6 @@ =20 #define IRQC_IRQ_START 1 #define IRQC_IRQ_COUNT 8 -#define IRQC_TINT_START (IRQC_IRQ_START + IRQC_IRQ_COUNT) #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -69,9 +68,11 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + unsigned int tint_start; unsigned int num_irq; }; =20 @@ -125,7 +126,7 @@ static void rzg2l_clear_irq_int(struct rzg2l_irqc_priv = *priv, unsigned int hwirq =20 static void rzg2l_clear_tint_int(struct rzg2l_irqc_priv *priv, unsigned in= t hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); u32 reg; =20 reg =3D readl_relaxed(priv->base + TSCR); @@ -180,7 +181,7 @@ static void rzfive_irqc_unmask_irq_interrupt(struct rzg= 2l_irqc_priv *priv, static void rzfive_irqc_mask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) | bit, priv->base + TMSK); } @@ -188,7 +189,7 @@ static void rzfive_irqc_mask_tint_interrupt(struct rzg2= l_irqc_priv *priv, static void rzfive_irqc_unmask_tint_interrupt(struct rzg2l_irqc_priv *priv, unsigned int hwirq) { - u32 bit =3D BIT(hwirq - IRQC_TINT_START); + u32 bit =3D BIT(hwirq - priv->info.tint_start); =20 writel_relaxed(readl_relaxed(priv->base + TMSK) & ~bit, priv->base + TMSK= ); } @@ -253,7 +254,7 @@ static void rzfive_tint_endisable(struct irq_data *d, b= ool enable) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); - unsigned int offset =3D hwirq - IRQC_TINT_START; + unsigned int offset =3D hwirq - priv->info.tint_start; unsigned int tssr_offset =3D TSSR_OFFSET(offset); unsigned int tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -299,7 +300,7 @@ static void rzg2l_tint_irq_endisable(struct irq_data *d= , bool enable) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); - unsigned int offset =3D hw_irq - IRQC_TINT_START; + unsigned int offset =3D hw_irq - priv->info.tint_start; unsigned int tssr_offset =3D TSSR_OFFSET(offset); unsigned int tssr_index =3D TSSR_INDEX(offset); u32 reg; @@ -388,10 +389,10 @@ static int rzg2l_tint_set_edge(struct irq_data *d, un= signed int type) { struct rzg2l_irqc_priv *priv =3D irq_data_to_priv(d); unsigned int hwirq =3D irqd_to_hwirq(d); - u32 titseln =3D hwirq - IRQC_TINT_START; - u32 tssr_offset =3D TSSR_OFFSET(titseln); - u8 tssr_index =3D TSSR_INDEX(titseln); - u8 index, sense; + unsigned int titseln =3D hwirq - priv->info.tint_start; + unsigned int tssr_offset =3D TSSR_OFFSET(titseln); + unsigned int tssr_index =3D TSSR_INDEX(titseln); + unsigned int index, sense; u32 reg, tssr; =20 switch (type & IRQ_TYPE_SENSE_MASK) { @@ -682,6 +683,7 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n } =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { + .tint_start =3D IRQC_IRQ_START + IRQC_IRQ_COUNT, .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, }; =20 --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 460863815FB for ; Sun, 22 Mar 2026 12:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182279; cv=none; b=Lto6zddTq6pKH1hsjyaaRFNvDSubHsohRLBvKZkhpaoosU3wBJKSw7oIQOe79l/A4lZ92HqHmIKTxXLLT2RqnMvFmGRmRYEU38uTSNbmRwzpdABEqwfkisASO3sdg5Jgmi2zKkg5mQXx/a8hCQOde4mBawaHj8fS4ZRE+cIWdMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182279; c=relaxed/simple; bh=S+4BPxJU5Kk+nIfPsnBIoHPjbABp6TSzLPC/76S+g9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hv5V6e1SQD/TAVPwCowgwOcRdUJ7YGc9MH5nej/VCp35w5hLKlJx70vWli8K+Lhw6mpmiiZmOg8cW/JH7VI7B6fX/9MKFGlIWYg+XBNxz1bJQwKmRRw3KEyk0N94fjjQQkRwg9bQJ+WaTagabX+Sdv0j2Q5bZjkJ9zo8PQkX1F0= 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=Y2gobF60; arc=none smtp.client-ip=209.85.221.47 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="Y2gobF60" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43b44c0bcdbso3417851f8f.1 for ; Sun, 22 Mar 2026 05:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182276; x=1774787076; 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=KrJ4mSuL5E0IZGdIKCuZQd5Am0OCty4uBI8sBwOehI8=; b=Y2gobF604o2iiceFqniMDK7OFA2dxzM792R6+tzDkpozQb+fBPJLiD1WT0ro8DC33h 4CY86R1bDSjvXyC9AbA8LnGMFBnXRNU7RTwveuUuRpreXe1ieITq+t2wuVCaPOao+KrW MXmefGK/w+RZ+LuaR1Jq//+KT12w1qLBHxttYyUN5EaHZMKJgKT1Zz5kxB5TeuyYiteu 5Vp4e1UgKD/Xr81pKIj65/4YCb3kUZtl5Q6erEBqJGs6xbXaWpVhyfh02HOmHf+K2FV8 HKfSKAqIpptG3AVB7jpak+Dgj1iDqm0JkFWX8MUGuufVuGq3G6JmEg0rWtc5xei36JQL AHdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182276; x=1774787076; 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=KrJ4mSuL5E0IZGdIKCuZQd5Am0OCty4uBI8sBwOehI8=; b=IL+C4LD+TQawpYeBuPwLoD0u5axqnMbTP1Gf3FZ2op6LkbFHC+Hd53gIIMwibBBDyv ls/w++C+yshS028u2lPikc9tn3zv8ya1ZO95/Ig5ZCQxD4nGBZIZEphaeaqKhwGOMwFZ Qg7c/JjZHX9ERn+Z0rYDwiERm5a2mdNaXk49hTtPXlzR8i9/hVkg6zk9cF0TCmFBUR2N 6D2oQtrPq/b2dBClIwW2HC9E59+x4Wm/V37LM7pv2QWsgdCmgdoSGlmC61VcaBzZu7XJ tVPCN7RmvsCRIuxXzUF7b/42tf7zIvmWcZWeuC/XD44xcClED24GCTukSkHT1neB2qpv oxwg== X-Forwarded-Encrypted: i=1; AJvYcCU/A5JRUrvli1oQg2jBCUYOWzQDRgMkh14/cpTJHvIMX3JlDtHLmhGwqyAnUE9n1MH4hgWfoRyGNtUt6SU=@vger.kernel.org X-Gm-Message-State: AOJu0YywJZyct7Thz+cQ/NRt+xHacj691E0FBRS+l+gw7IlFYM3M7W38 DIuHVrA4A4qrq8S5By0j4DUJDGvghg6JpeouKGsqeXfGbgrbeP1bgxnK X-Gm-Gg: ATEYQzwW5XA1KKrWVcbNOEBX1rsX4ovtdL/Liqt86JEcZ2YcvhFHR8/UMXrnJbOQwwx r0vb3h6rX/wxuvcSXvZVKH+Fjf81qJ6GQ++LWc94VUinVS3XKUBntyjizDHIqPOgSHdhUfXLjuJ SFheMhclwlIXytk4fOw4irklIaSeDD9COJ9cJLBBQv6NXKIrWbKNyPTeww/1kEmlu4dtmiUGPPp 8Bbe+AIz57tBDANTYpbqdzYORFWQw7C+pTHmYOcMytXHD+H7e9e/jU5ItMPb5fCZPS+m7FOMLWO V7G7oTu+V1ytHh/zeoOUYOh0d+LYVY5ek9UV4eVCsUC19qUxGvoOP8t7l7Jwb8Srf9871Z0w7T6 Vh72s+K0+qer1P9SsoPfGqsoe1RoCM5xv8BrmlFsP2wxiwM4mwpOqaNLhZebalsnb6gCB6XEJVr BIqi3W4H0a6ggt/60QSyl89KJ3YC8hI5/hpsnd2PGFEGaOXTsg X-Received: by 2002:a05:6000:2010:b0:43b:5022:804 with SMTP id ffacd0b85a97d-43b64262ff5mr13488541f8f.29.1774182275561; Sun, 22 Mar 2026 05:24:35 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:35 -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 13/15] irqchip/renesas-rzg2l: Drop IRQC_IRQ_COUNT macro Date: Sun, 22 Mar 2026 12:23:56 +0000 Message-ID: <20260322122421.132474-14-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 total number of external interrupts in RZ/G2L and RZ/G3L SoC are different. The RZ/G3L has 16 external interrupts whereas RZ/G2L has only 8 external interrupts. Add irq_count variable in struct rzg2l_hw_info to handle these differences and drop the macro IRQC_IRQ_COUNT. Signed-off-by: Biju Das --- v5->v6: * No change v4->v5: * Dropped hw_irq range check involving info.irq_count. v3->v4: * Updated commit description IRQs->interrupts. * Updated variable type of irq_count from u8->unsigned int. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 922d9dfeddcd..8aff8b9d49c9 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -21,7 +21,6 @@ #include =20 #define IRQC_IRQ_START 1 -#define IRQC_IRQ_COUNT 8 #define IRQC_TINT_COUNT 32 =20 #define ISCR 0x10 @@ -68,10 +67,12 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; }; @@ -575,7 +576,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, = unsigned int virq, * from 16-31 bits. TINT from the pinctrl driver needs to be programmed * in IRQC registers to enable a given gpio pin as interrupt. */ - if (hwirq > IRQC_IRQ_COUNT) { + if (hwirq > priv->info.irq_count) { tint =3D TINT_EXTRACT_GPIOINT(hwirq); hwirq =3D TINT_EXTRACT_HWIRQ(hwirq); chip =3D priv->tint_chip; @@ -683,8 +684,9 @@ static int rzg2l_irqc_common_probe(struct platform_devi= ce *pdev, struct device_n } =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { - .tint_start =3D IRQC_IRQ_START + IRQC_IRQ_COUNT, - .num_irq =3D IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, + .irq_count =3D 8, + .tint_start =3D IRQC_IRQ_START + 8, + .num_irq =3D IRQC_IRQ_START + 8 + IRQC_TINT_COUNT, }; =20 static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 669CB3815D6 for ; Sun, 22 Mar 2026 12:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182280; cv=none; b=pfVjKQYIrUkNgGl28Kr9BWTv6lfY7W7qPwSYe3o6TXM7ZQyxdQsjoeyDETirCqszaWoU52Oq+xfhoqRuz2wGfWE+FX3HC570HzXGfszqC9YvKyOBL53Bjuvq9gZrB41efLYthXU74wFx/9qWHfT4EaqLIaTyQmlTDf015KNPQj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182280; c=relaxed/simple; bh=c9l2i7HPT8iNPuwqrZJz+dMN2SoQtpIGWFRWvS6zBI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vo89C4CXIVxIiprRlXAxpJPBNIniLmKudc5VAjGAzHCwdmeu+YPL0BQvcDsrFUaM7pmp5RZY4IC5zzdRfzUfLvJ9bTURChXJZ0WhGDylx9aopNV7poqRj6AXl0PZZSaQ1aW4fD4RdOGAGoby1wj2FNFIRnH6UmjSnlOV9gHxa0Y= 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=GaTkhsbu; arc=none smtp.client-ip=209.85.221.47 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="GaTkhsbu" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43b3d9d0695so3038271f8f.0 for ; Sun, 22 Mar 2026 05:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182277; x=1774787077; 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=vZOo4IkXrKT3vNwdWHp9bFAGOnopScx0rwaRBrsQYIM=; b=GaTkhsbuiOfPXLtfwVLF1/SVHrAnjezP+1Vs9eEJrJep2hf3tzR2WLKCMnlaLW/lUw ybQzrp3ehA/p52egkcU7XJPknAY4ju/d4mnTMjewviBgRLfky/yiQTvLR/D4m5F5FJ1R YzIHm/u90n2yG8uIEDuAtQPlYZCfhefjbDFJW/0y/SgDdiM9I2/pZWqTUWwoehfzKJ5V 4pOCNkTH3NwB14IwL6d9MnMo2TopEg4UuhsilsZF+Of/BlI/izRPN6Ts/RkctMgWvEZg FPM3IVrQVSFJlHHK87IUD8gIFu0OFczw1oRUcnYnIbb4Bvz86wf+Tc8wSR7tID+rdNqX BIFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182277; x=1774787077; 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=vZOo4IkXrKT3vNwdWHp9bFAGOnopScx0rwaRBrsQYIM=; b=LA3F8BIqNqRDGEVlTio8z+ZWkOtHbWF/TX9sqKwCNSfu50LC5GFPpv5qOvbUEDsmSY Aib7AVWimjUYp8EHAqDpQpnqJl7H8OjDDX7FDG5hHL3/WsG4K9RkWLlVASiW/T6Evt9f pDJ1MGjOUrixAMrSPoIJeGHHdMWPfmLJdrPux9yFW3gqiJ7lK0tGTlA5kTkGMxsqJVp8 RxwSRhWk3bqWuGIJDTLY4cTMKegrs6WPoG4/PEasQYhFdR4WGY3T8V0wLC9OUP8kYaHW uSCWFeyf0PH+yVrEIcyaXF2M87leMdmRw955JHAAWYuptCsfUnm8xFY8pySDiYTy93mO I5FQ== X-Forwarded-Encrypted: i=1; AJvYcCUe63fFP91Il+jP6GQ6eTNYRnQcR98AY07F8EfaEsknp4DxWzGBS6Y1H77XEdbdiJXM0oXIh5MjFWylYxM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzac+8mEhAmTyWigsNBRs6drx++ldy6oxmY1+ykbEGJEoQwu/Ad pjTPYdmYf+JfTUsrOUMKpObmiiXkmKMIDtPCdG+sWb9OF+q7C+v8H0hz0kQwVg== X-Gm-Gg: ATEYQzztfCTuaWeG89AJEkokQ1aXlSmoU+kwu5zOkxPctn9BCm4nGQVMKVwEZGYBcA9 ieO0ZUEKUOCsxxs3qq2odmerJqDrHPdOZUkpDfvt6yU93XjllO8ud1NEawGZjL7CIX0e/Cjpp7m Kwb8bkU2EmEst2m04b0i5WVdb6aPRdFo0JT3qUujxQjagqcyRGJPWSXKzu4iHIUBpJ7VmpqQzyY rsIChP18VmQQYjYyzLmfGmJFuHeUlrPJdx1iXDpV3ZoAQ24jJkvbHjSPoBXs82RV8t2dMIgCL/z Em66g97Ge2uiQJgThJRHDB2/jJ4KS82c0RJrU22v6VtpYK0+XH+iiOBwnW3+zQLrfe59lQ7kXWD hfZIbX+2vPLfQlIUbt1qeKKFS+a5k+1TKKdW/0fJZctYiEXJRGUKLLiWPFT5bj3LwM/1XukNqeT nBKBsv+cQW+/6JezFUpIjzfU/0i9E2Kada0R3CmOuA1PrOc9S3 X-Received: by 2002:a05:6000:2501:b0:43b:4d2e:9ff8 with SMTP id ffacd0b85a97d-43b6423c4d6mr14984981f8f.6.1774182276669; Sun, 22 Mar 2026 05:24:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:35 -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 14/15] irqchip/renesas-rzg2l: Add RZ/G3L support Date: Sun, 22 Mar 2026 12:23:57 +0000 Message-ID: <20260322122421.132474-15-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 IRQC block on the RZ/G3L SoC is almost identical to the one found on the RZ/G2L SoC, with the following differences: - The number of GPIO interrupts for TINT selection is 113 instead of 123. - The pin index and TINT selection index are not in the 1:1 map. - The number of external interrupts are 16 instead of 8, out of these 8 external interrupts are shared with TINT. Add support for the RZ/G3L driver by filling the rzg2l_hw_info table and adding LUT for mapping between pin index and TINT selection index. Signed-off-by: Biju Das --- v5->v6: * No change. v4->v5: * Updated rzg3l_irqc_probe() for supporting separate interrupt chips. v3->v4: * Updated commit description IRQs->interrupts. * Updated rzg2l_disable_tint_and_set_tint_source() for making tint assignment very clear in the code. * Formatted rzg3l_tssel_lut as table format. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 8aff8b9d49c9..1ff1c0efed66 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -67,11 +67,13 @@ struct rzg2l_irqc_reg_cache { =20 /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info = structure. + * @tssel_lut: TINT lookup table * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + const u8 *tssel_lut; unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; @@ -377,6 +379,11 @@ static u32 rzg2l_disable_tint_and_set_tint_source(stru= ct irq_data *d, struct rzg u32 tint =3D (u32)(uintptr_t)irq_data_get_irq_chip_data(d); u32 tien =3D reg & (TIEN << TSSEL_SHIFT(tssr_offset)); =20 + if (priv->info.tssel_lut) + tint =3D priv->info.tssel_lut[tint]; + else + tint =3D (u32)(uintptr_t)irq_data_get_irq_chip_data(d); + /* Clear the relevant byte in reg */ reg &=3D ~(TSSEL_MASK << TSSEL_SHIFT(tssr_offset)); /* Set TINT and leave TIEN clear */ @@ -683,6 +690,36 @@ static int rzg2l_irqc_common_probe(struct platform_dev= ice *pdev, struct device_n return 0; } =20 +/* Mapping based on port index on Table 4.2-1 and GPIOINT on Table 4.6-7 */ +static const u8 rzg3l_tssel_lut[] =3D { + 83, 84, /* P20-P21 */ + 7, 8, 9, 10, 11, 12, 13, /* P30-P36 */ + 85, 86, 87, 88, 89, 90, 91, /* P50-P56 */ + 92, 93, 94, 95, 96, 97, 98, /* P60-P66 */ + 99, 100, 101, 102, 103, 104, 105, 106, /* P70-P77 */ + 107, 108, 109, 110, 111, 112, /* P80-P85 */ + 45, 46, 47, 48, 49, 50, 51, 52, /* PA0-PA7 */ + 53, 54, 55, 56, 57, 58, 59, 60, /* PB0-PB7 */ + 61, 62, 63, /* PC0-PC2 */ + 64, 65, 66, 67, 68, 69, 70, 71, /* PD0-PD7 */ + 72, 73, 74, 75, 76, 77, 78, 79, /* PE0-PE7 */ + 80, 81, 82, /* PF0-PF2 */ + 27, 28, 29, 30, 31, 32, 33, 34, /* PG0-PG7 */ + 35, 36, 37, 38, 39, 40, /* PH0-PH5 */ + 2, 3, 4, 5, 6, /* PJ0-PJ4 */ + 41, 42, 43, 44, /* PK0-PK3 */ + 14, 15, 16, 17, 26, /* PL0-PL4 */ + 18, 19, 20, 21, 22, 23, 24, 25, /* PM0-PM7 */ + 0, 1 /* PS0-PS1 */ +}; + +static const struct rzg2l_hw_info rzg3l_hw_params =3D { + .tssel_lut =3D rzg3l_tssel_lut, + .irq_count =3D 16, + .tint_start =3D IRQC_IRQ_START + 16, + .num_irq =3D IRQC_IRQ_START + 16 + IRQC_TINT_COUNT, +}; + static const struct rzg2l_hw_info rzg2l_hw_params =3D { .irq_count =3D 8, .tint_start =3D IRQC_IRQ_START + 8, @@ -695,6 +732,12 @@ static int rzg2l_irqc_probe(struct platform_device *pd= ev, struct device_node *pa rzg2l_hw_params); } =20 +static int rzg3l_irqc_probe(struct platform_device *pdev, struct device_no= de *parent) +{ + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_irq_chip, &rzg2l= _irqc_tint_chip, + rzg3l_hw_params); +} + static int rzfive_irqc_probe(struct platform_device *pdev, struct device_n= ode *parent) { return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_irq_chip, &rzfi= ve_irqc_tint_chip, @@ -703,6 +746,7 @@ static int rzfive_irqc_probe(struct platform_device *pd= ev, struct device_node *p =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) IRQCHIP_MATCH("renesas,rzg2l-irqc", rzg2l_irqc_probe) +IRQCHIP_MATCH("renesas,r9a08g046-irqc", rzg3l_irqc_probe) IRQCHIP_MATCH("renesas,r9a07g043f-irqc", rzfive_irqc_probe) IRQCHIP_PLATFORM_DRIVER_END(rzg2l_irqc) MODULE_AUTHOR("Lad Prabhakar "); --=20 2.43.0 From nobody Sat Apr 4 00:09:20 2026 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 B5620381AF6 for ; Sun, 22 Mar 2026 12:24:39 +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=1774182284; cv=none; b=omd0H28AysWmm7AdBg99N98nOoHFhVt6SdnmhtIrbXwxaNImDWFa448RsaBR5T4wMwpnByFsuECtmrb1bhcBZmaRztnIllDtX50MRzS+uUXjqoeFb09ot6NRAdw39r6SavLB077WQMbjxr76RAezaT4mVhGeOPxj0GRcdh2h8Uw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774182284; c=relaxed/simple; bh=DMtvpcEgaBXfJ2rMgy2gC2zoJNu6Ano6N3tBASL/0tQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s+OdZHm46Tt53hLcT2pJk1DN46B5pt9Eqf32ru/iPXzADrZLHUuXFME/fYrwgF3mDDWWnrnkywQ/spbg7Ps8MN7iJEQvxLX4Xr2i/geiTtwJfaqALc3w8gdidGLoMJAH/DJeEcGIIycQ/k0lBEcKpUhZs3A212p2bzZTPVhC8Bc= 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=Iyisa/k8; 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="Iyisa/k8" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-439b9cf8cb5so4584622f8f.0 for ; Sun, 22 Mar 2026 05:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774182278; x=1774787078; 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=jxpYf4rR4gelppN+mkmImDmznlIgWvfrJ1JaybzbEnU=; b=Iyisa/k8BxbAXfSU05wtGxCRMTyDVRZ3m3ZD7LDsj2u0P78F2PhpIB1ahmNueCE9jD ZPMoLg94yX5HPxKDKnYeLY1EQ1Eju20gBC8mAsqstpUJLCSd+T+wc7EgpXuJUu57qYWy H6tKhgxZ6vmEmYXZ3O0Dv1qPRt0eQDkdt/O7D6c9C89D39jJDB4BwhRJFXEo8B61//ru VWFIcJH9SZP6Sib2u16UuHSaErwRSnNTteCCv+hNy3lYmm4EPjtcEkc9wu3EpaxSFwvk 0vjf1WaNHDmI4tCFUvIoOWCG/6RS6haTXQIWndt8ySedyZIprrWCtNjtoA7aKrKPgDkY 49SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774182278; x=1774787078; 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=jxpYf4rR4gelppN+mkmImDmznlIgWvfrJ1JaybzbEnU=; b=aatzBAcj1M/cOVbhEmRbqMHLuJUK9HlGJ9+oqCSViJ5KNPd20ePOrfnla+T8cMGQOK JunktWBcKWVVEKR7pE0zlZnR/31LlAYtqW/4T6jBROveoJgVulbcRlV9kUrMXvELp3Q0 A95JxH4ABo/YxjH1HcWy+S+HuAd4Apkh7XoAAqmK8spz3l1aEB9hdS+gH9HXTdoZVpZQ vFsHsoKaoeNEJ3r7/0bT6TrpfQo2gmPl16tkyx6zRHKmkg+p0qbogY5jvYCpvBFfNPvf hx7h3JVfF/u9Mhwjhwz3olAR/LuU/XjpjLK+bHtibXX1JBruSdR/cGLLGY48ncCSWj+I zVnQ== X-Forwarded-Encrypted: i=1; AJvYcCU/cFsq13pq3e7xKImYlZlhwwm/bQAr3PrSw1bKsdeXXCmjqolGQZcWHuhrISK5nuSRTSulN/B7gBMM/yQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1wgNJm3Chnn83iEAiQLqKxnaoXCgMeuVWjEYt5s2rbfyJMq5i obSO/BKFUwNbyaW46jSmXcJJcdhjsYcSZNsHb1atDml0Sj/vAKX1zpxv X-Gm-Gg: ATEYQzy6T9Q5vbmpUWI++JGC6iXZj4Q6seDiYXamdzKJ/weDnG6q5rrMUzLD4XZh5/y JvDDrBCPwoOIpxY2yAu8gibvfRQy0WzSaFqKsVPTOg/g3kNcwChG7K/qvENc4HV8lU21vIyYXil FvvobwieRlDesONcsdooVX6Q1n4kSrY80e+r9k+QuzDhMVBPe/kY68TX8BumJ4Vfm+looCxiutQ WmPiStzDRdnTXT33rLqw5HHIYyK8dQnaB1VfcdYXaTYY3WugmkvBe7baDPP7uCjmyYA+1jeFbLg 81CLqjFTRWVMOOhCO2KG9i6LxI4g/Ciql6+m8nkI1XA4wRNSkKrKO4oarzlOVwEN70zRikOnreC V+l5LwF63lyo5eIK+ukGy/U3mrRVDOuIqr2LWSnvI1+y9k6fc+dKGtBjNPR24zBtTtRZwgdmb5N vRzTlSiiSXEVI4zI3wqxofwkBPLbwC38M7RCPw3H+KPUWs4iaX X-Received: by 2002:a5d:64e3:0:b0:43b:4720:10f2 with SMTP id ffacd0b85a97d-43b64279755mr14432571f8f.43.1774182277918; Sun, 22 Mar 2026 05:24:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Mar 2026 05:24:37 -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 15/15] irqchip/renesas-rzg2l: Add shared interrupt support Date: Sun, 22 Mar 2026 12:23:58 +0000 Message-ID: <20260322122421.132474-16-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 RZ/G3L SoC has 16 external interrupts, of which 8 are shared with TINT (GPIO interrupts), whereas RZ/G2L has only 8 external interrupts with no sharing. The shared interrupt line selection between external interrupt and GPIO interrupt is based on the INTTSEL register. Add shared_irq_cnt variable to struct rzg2l_hw_info handle these differences. Add used_irqs bitmap to struct rzg2l_irqc_priv to track allocation state. In the alloc callback, use test_and_set_bit() to enforce mutual exclusion and configure the INTTSEL register to route to either the external interrupt or TINT. In the free callback, use test_and_clear_bit() to release the shared interrupt line and reset the INTTSEL. Also add INTTSEL register save/restore support to the suspend/resume path. Signed-off-by: Biju Das --- v5->v6: * Updated commit description. * Switched to using irq_domain_ops::{alloc,free} callbacks for mutual exclusion between external interrupts and GPIO interrupts as using irq_{request,release}_resources() leading to irq storm() * Dropped irq_{request,release}_resources(). * Replaced the macro TINTSEL->INTTSEL_TINTSEL * Added macros INTTSEL_TINTSEL_START, IRQC_SHARED_IRQ_COUNT and IRQC_IRQ_SHARED_START. * Added used_irqs bitmap to struct rzg2l_irqc_priv to track allocation state of shared_interrupt * Added rzg2l_irqc_set_inttsel() for configuring INTTSEL register. * Replaced irq_domain_free_irqs_common()->rzg2l_irqc_free() as=20 rzg2l_irqc_domain_ops::free() callback. * Replaced the 8->IRQC_SHARED_IRQ_COUNT in shared_irq_cnt varaible as the same macro used in bitmap. v4->v5: * Added callback irq_{request,release}_resources() to both irq and tint interrupt chips. v3->v4: * Updated commit header irq->interrupt. * Updated commit description IRQs->interrupts. * Updated shared_irq_cnt variable type from u8->unsigned int. v2->v3: * No change v1->v2: * No change --- drivers/irqchip/irq-renesas-rzg2l.c | 104 +++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index 1ff1c0efed66..97bbaaaeedb0 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -22,6 +22,8 @@ =20 #define IRQC_IRQ_START 1 #define IRQC_TINT_COUNT 32 +#define IRQC_SHARED_IRQ_COUNT 8 +#define IRQC_IRQ_SHARED_START (IRQC_IRQ_START + IRQC_SHARED_IRQ_COUNT) =20 #define ISCR 0x10 #define IITSR 0x14 @@ -29,6 +31,7 @@ #define TITSR(n) (0x24 + (n) * 4) #define TITSR0_MAX_INT 16 #define TITSEL_WIDTH 0x2 +#define INTTSEL 0x2c #define TSSR(n) (0x30 + ((n) * 4)) #define TIEN BIT(7) #define TSSEL_SHIFT(n) (8 * (n)) @@ -52,16 +55,21 @@ #define IITSR_IITSEL_EDGE_BOTH 3 #define IITSR_IITSEL_MASK(n) IITSR_IITSEL((n), 3) =20 +#define INTTSEL_TINTSEL(n) BIT(n) +#define INTTSEL_TINTSEL_START 24 + #define TINT_EXTRACT_HWIRQ(x) FIELD_GET(GENMASK(15, 0), (x)) #define TINT_EXTRACT_GPIOINT(x) FIELD_GET(GENMASK(31, 16), (x)) =20 /** * struct rzg2l_irqc_reg_cache - registers cache (necessary for suspend/re= sume) * @iitsr: IITSR register + * @inttsel: INTTSEL register * @titsr: TITSR registers */ struct rzg2l_irqc_reg_cache { u32 iitsr; + u32 inttsel; u32 titsr[2]; }; =20 @@ -71,12 +79,14 @@ struct rzg2l_irqc_reg_cache { * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts + * @shared_irq_cnt: Number of shared interrupts */ struct rzg2l_hw_info { const u8 *tssel_lut; unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; + unsigned int shared_irq_cnt; }; =20 /** @@ -88,6 +98,7 @@ struct rzg2l_hw_info { * @lock: Lock to serialize access to hardware registers * @info: Hardware specific data * @cache: Registers cache for suspend/resume + * @used_irqs Bitmap to manage the shared interrupts */ static struct rzg2l_irqc_priv { void __iomem *base; @@ -97,6 +108,7 @@ static struct rzg2l_irqc_priv { raw_spinlock_t lock; struct rzg2l_hw_info info; struct rzg2l_irqc_reg_cache cache; + DECLARE_BITMAP(used_irqs, IRQC_SHARED_IRQ_COUNT); } *rzg2l_irqc_data; =20 static struct rzg2l_irqc_priv *irq_data_to_priv(struct irq_data *data) @@ -464,6 +476,8 @@ static int rzg2l_irqc_irq_suspend(void *data) void __iomem *base =3D rzg2l_irqc_data->base; =20 cache->iitsr =3D readl_relaxed(base + IITSR); + if (rzg2l_irqc_data->info.shared_irq_cnt) + cache->inttsel =3D readl_relaxed(base + INTTSEL); for (u8 i =3D 0; i < 2; i++) cache->titsr[i] =3D readl_relaxed(base + TITSR(i)); =20 @@ -482,6 +496,8 @@ static void rzg2l_irqc_irq_resume(void *data) */ for (u8 i =3D 0; i < 2; i++) writel_relaxed(cache->titsr[i], base + TITSR(i)); + if (rzg2l_irqc_data->info.shared_irq_cnt) + writel_relaxed(cache->inttsel, base + INTTSEL); writel_relaxed(cache->iitsr, base + IITSR); } =20 @@ -562,6 +578,72 @@ static const struct irq_chip rzfive_irqc_tint_chip =3D= { IRQCHIP_SKIP_SET_WAKE, }; =20 +static bool rzg2l_irqc_is_shared_irqc(const struct rzg2l_hw_info info, uns= igned int hw_irq) +{ + return ((hw_irq >=3D (info.tint_start - info.shared_irq_cnt)) && hw_irq <= info.tint_start); +} + +static bool rzg2l_irqc_is_shared_tint(const struct rzg2l_hw_info info, uns= igned int hw_irq) +{ + return ((hw_irq >=3D (info.num_irq - info.shared_irq_cnt)) && hw_irq < in= fo.num_irq); +} + +static bool rzg2l_irq_is_shared_and_get_irq_num(struct rzg2l_irqc_priv *pr= iv, + irq_hw_number_t hwirq, unsigned int *irq_num) +{ + bool is_shared =3D false; + + if (rzg2l_irqc_is_shared_irqc(priv->info, hwirq)) { + *irq_num =3D hwirq - IRQC_IRQ_SHARED_START; + is_shared =3D true; + } else if (rzg2l_irqc_is_shared_tint(priv->info, hwirq)) { + *irq_num =3D hwirq - IRQC_TINT_COUNT - IRQC_IRQ_SHARED_START; + is_shared =3D true; + } + + return is_shared; +} + +static void rzg2l_irqc_set_inttsel(struct rzg2l_irqc_priv *priv, unsigned = int offset, + unsigned int select_irq) +{ + u32 reg; + + guard(raw_spinlock)(&priv->lock); + reg =3D readl_relaxed(priv->base + INTTSEL); + if (select_irq) + reg |=3D INTTSEL_TINTSEL(offset); + else + reg &=3D ~INTTSEL_TINTSEL(offset); + writel_relaxed(reg, priv->base + INTTSEL); +} + +static int rzg2l_irqc_shared_irq_alloc(struct rzg2l_irqc_priv *priv, irq_h= w_number_t hwirq) +{ + unsigned int irq_num; + + if (rzg2l_irq_is_shared_and_get_irq_num(priv, hwirq, &irq_num)) { + if (test_and_set_bit(irq_num, priv->used_irqs)) + return -EBUSY; + + if (hwirq < priv->info.tint_start) + rzg2l_irqc_set_inttsel(priv, INTTSEL_TINTSEL_START + irq_num, 1); + else + rzg2l_irqc_set_inttsel(priv, INTTSEL_TINTSEL_START + irq_num, 0); + } + + return 0; +} + +static void rzg2l_irqc_shared_irq_free(struct rzg2l_irqc_priv *priv, irq_h= w_number_t hwirq) +{ + unsigned int irq_num; + + if (rzg2l_irq_is_shared_and_get_irq_num(priv, hwirq, &irq_num) && + test_and_clear_bit(irq_num, priv->used_irqs)) + rzg2l_irqc_set_inttsel(priv, INTTSEL_TINTSEL_START + irq_num, 0); +} + static int rzg2l_irqc_alloc(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs, void *arg) { @@ -594,6 +676,12 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain,= unsigned int virq, if (hwirq >=3D priv->info.num_irq) return -EINVAL; =20 + if (priv->info.shared_irq_cnt) { + ret =3D rzg2l_irqc_shared_irq_alloc(priv, hwirq); + if (ret) + return ret; + } + ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, chip, (void *)= (uintptr_t)tint); if (ret) return ret; @@ -601,9 +689,22 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain,= unsigned int virq, return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &priv->fwspec[= hwirq]); } =20 +static void rzg2l_irqc_free(struct irq_domain *domain, unsigned int virq, = unsigned int nr_irqs) +{ + struct rzg2l_irqc_priv *priv =3D domain->host_data; + + if (priv->info.shared_irq_cnt) { + struct irq_data *d =3D irq_domain_get_irq_data(domain, virq); + + rzg2l_irqc_shared_irq_free(priv, irqd_to_hwirq(d)); + } + + return irq_domain_free_irqs_common(domain, virq, nr_irqs); +} + static const struct irq_domain_ops rzg2l_irqc_domain_ops =3D { .alloc =3D rzg2l_irqc_alloc, - .free =3D irq_domain_free_irqs_common, + .free =3D rzg2l_irqc_free, .translate =3D irq_domain_translate_twocell, }; =20 @@ -718,6 +819,7 @@ static const struct rzg2l_hw_info rzg3l_hw_params =3D { .irq_count =3D 16, .tint_start =3D IRQC_IRQ_START + 16, .num_irq =3D IRQC_IRQ_START + 16 + IRQC_TINT_COUNT, + .shared_irq_cnt =3D IRQC_SHARED_IRQ_COUNT, }; =20 static const struct rzg2l_hw_info rzg2l_hw_params =3D { --=20 2.43.0