From nobody Fri Apr 17 00:20:36 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 6C9BC1CBEB9 for ; Tue, 24 Feb 2026 18:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956018; cv=none; b=VRucwiMIAo0d+xFGZuLMI9CaqrmVp+Uka65rXICmHsYGwgY3DlFl8Xuez2UDvc2CIzRao0vtpmU+Gy424uhxuppqx7n0hC2Opwb6nyrrcLUKz3xG/EVPM8ZWblGI92zMWr/Kbk50ZcssCHfFYnJk0cGnbWdan8JBKaNXErFCO4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956018; c=relaxed/simple; bh=X8hkRaeVzP67rTNbQ9JivrPs8yIc9gUhUejj4fUO9VM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=akDE8zd2alr3+oTsEGsu41JBnVwSBnBVMPD2Y/Ur/tQCg+Rhxcwk80QZxrDXYfy3lqh7LGOVsv0sUZABnXUbCADdeAxf8vBhCqMG6Is5Hzu11IKwS3Q1v/2NStMyfULtiX1XnNLW9cFId3TxFPfCMZMOOFJ/sQnQ+dfL7nBSMh8= 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=CTC5yVQP; arc=none smtp.client-ip=209.85.128.52 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="CTC5yVQP" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-48334ee0aeaso44092195e9.1 for ; Tue, 24 Feb 2026 10:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956016; x=1772560816; 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=kBRMewBpkSMo+0SexkQMILcLg2uMAhumMyjYMYu2NZg=; b=CTC5yVQPK+nPBN3pXTeZSfqYHAqho+MwDNBgQhtl0la+BisXMzkuQOvkzHzpr4mLvp r08oViX5oW+zKKq2jl04V/oByl3QZUpTvLsZwde37eAfMMvw6jsfq6H3vk673TNOhAqd sh+tWAmIGiAlwLOzTd1LJovr5Ty3afZC1UWTj2vv+kX9j2b7iVGSS7ARtc3ROkDEUJY5 vHod98+1Y5+a+qXZbQSYYHVDlx0Q/mM6GHIrzkHvxyCTUbo6Co2EIisn1GEMRkW+cDqv TBOz1rI5lrbt4CzUGUnK9nqJM+ia54P/Kz2/ctnEjJ78D+WMG5vTogjoW+RJCA3cGCyp /sLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956016; x=1772560816; 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=kBRMewBpkSMo+0SexkQMILcLg2uMAhumMyjYMYu2NZg=; b=HG3m1sVjUiiD4tr5v95ejuOZl0B66E5XAYyW/fqyIGz69zuXRCLOgvG5a0+qhONnqE wzKJ1hFYfaUmesTdtKdTvTcsLaiyKJGBb6wz4xRc34sNm8ifWF+5FvA/3+RcYjHAsJqO T/U8BtKC558CP7/PFY8txsg1n+0JKwyiRIO5XUeSHJy9aL30iHkEVMsKNaue6xHdcVi6 NkwLp8cJH7vQFpQ57by62YB1jW32v5QK9ZDfeQcnPlKcUN2mu4V1atMlNqv0JwEz4bog 4HoGDyfpIwqBW6mvNJOzSyau7os6dRYLc9VD5h5jrM3TwuINU3hjRCGmp/S25OXrhOrQ LuWw== X-Gm-Message-State: AOJu0Yy15fc6DZvglolg7hJajpM8ctoTzi+5gn59XBQJryuIkG74FiK4 Tpk+zXnMzGFSPOSN53MoNcYLSz+ObHzXjXaNQFrrJbJ5pE4jUI5wiKzHf/6Epd3qx+E= X-Gm-Gg: AZuq6aIfis6awHgErU4USj5eA8GbcKjaCBgLGpDm1891Hh/vWZseAZnH3rlB5eInrIh QXNCGC5zQ2CEc4z6LU/GXQT3JKRxj8tPiwQYwU+ntwJBluc8BXEwOGxutOzNcYwzEkI0PLse0I2 U1eVgbJaxOExEjPQ5M/x9Y4p5cm1z66ZYTaYOsogVfYyJ4OsZyxRMAMG8wSXLfxyhqd4cL6URQ+ IwwvuPnnVBxkUa6gIAzwpgAxfyQHPcUfGy1mBiWE388CDn+nRCGcaYTw2WjjF6dsYi+1UCSKmW1 cICeGWEZNHSGlI6yPKpG+PBcg40ayCzGKABnSyHQZCRUZXGbtI/rXib3xeBSYVRu1GrnZDi6OZ9 9m9kXN0oQ9smTTZUI4yFtQsWby1k3AkhK8vqHJV+LlX3gj4g9CEl/3AUwhd1/Xm3+QU5yu65c9i sfCMAEV2NU/4dSnad1EwAkKHtXz4nuDV0MBjBs3xF6fbZm1UbYsIB0z0uohVxdO3QD1Z6Acb2HY GoSHBUoRuX8PaIe+Tw/yYKxC17wnqIGjjvTIV3+LnU6hXY= X-Received: by 2002:a05:600c:4589:b0:480:1e9e:f9b with SMTP id 5b1f17b1804b1-483a95dea3emr276584975e9.16.1771956015675; Tue, 24 Feb 2026 10:00:15 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:15 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 1/7] irqchip/renesas-rzv2h: Use local node pointer Date: Tue, 24 Feb 2026 17:56:12 +0000 Message-ID: <20260224175618.3160270-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Avoid dereferencing pdev->dev.of_node again in rzv2h_icu_probe_common(). Reuse the already available local node pointer when mapping the ICU register space. Signed-off-by: Lad Prabhakar --- v3->v4: - No change. v2->v3: - No change. v1->v2: - No change. --- drivers/irqchip/irq-renesas-rzv2h.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index da2bc43a0e12..20c0cd11ef25 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -570,7 +570,7 @@ static int rzv2h_icu_probe_common(struct platform_devic= e *pdev, struct device_no =20 platform_set_drvdata(pdev, rzv2h_icu_data); =20 - rzv2h_icu_data->base =3D devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, = NULL); + rzv2h_icu_data->base =3D devm_of_iomap(&pdev->dev, node, 0, NULL); if (IS_ERR(rzv2h_icu_data->base)) return PTR_ERR(rzv2h_icu_data->base); =20 --=20 2.53.0 From nobody Fri Apr 17 00:20:36 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 340F14C81 for ; Tue, 24 Feb 2026 18:00:18 +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=1771956019; cv=none; b=mFYuWUbC78pig36iik0T4JyvZE5LUDsdup3l9ICd7txU45RQH/gqe3JKmAHoLX1AJOt1KqQoIfZ5HSRquseaPiCiYgWEp5lVHOlAoNTg47mR0F7r3ST1rSUGGxkStXH0E4EXba8YVZod/zep5PusaKPD9ipow92a1nTxSY3ZafM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956019; c=relaxed/simple; bh=nB6yMNuWdXjsroqhR6blVvypcH+3e9NyyYxrYb3pi/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EN3uspMgctJDiwm/3P1e2A2LBFb8cNyihm2aIPiYLjjYIZ2Ovu8PJ2UxXIyU83xdb+ZeAGG3gyrI8bafQTzWJEk2mHjvhi37BjRiyhM6jtFUEabKTRofHQeI37QcQueLsp22RPgnZDnZXoySAbb5DsKukyBu6K2kyKLtwO7xnqw= 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=K7+MHZ0X; 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="K7+MHZ0X" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48374014a77so60663585e9.3 for ; Tue, 24 Feb 2026 10:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956016; x=1772560816; 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=zQj4h6bePVftt7yiE6gKHCYyxJvA1sNzyBCL9r4r0qU=; b=K7+MHZ0XaV/6Is/Qq2k13lgie0lXfs24GMjF+DMYqFlpUHIvMp8QG7bMe1861JxN3/ YT+uLrsUVyURsbtK3W48ixnjrIt+SVrScgEefcRLnJJXJk1lQYKoecGLun8ef3W5afeS /P5pHCRdSNcgt+RX/OL7lTCqK2Cnp6L0fSVkqicvTSUy7NnJR7CQu+b/NmKtxatBCcmo KOSipPXtRMcTeShXdSaJwwZqxUNEWpLgKlC/nLXI2QL1rN7hi3DioJY9WZxWBx9P0EM8 3px5/OnuK2ccFslf2X5nZW7F4rwZp1Fl2u52R2ShrhDJNJTlwyLYI633MQLQ9OZ43k9W xNKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956016; x=1772560816; 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=zQj4h6bePVftt7yiE6gKHCYyxJvA1sNzyBCL9r4r0qU=; b=vg09RNHcMOOMPCDkP4QEk/bpW48lJ6dLkvUm8Kd1maURsEDlxbVz8NxytStdNem7Z+ vmrbGe+U67my3GrHnAMCF2npZ7vbpubRvBK/07vEJ5OoMdNxyqDERT6Eqy2uEDwweVYG Nz2Dz+TZrjXVA+w81S8/CHBmNNmmnzfLl5AcJIhKl0P9fPfKxZ2/BmGKzihhbPvehYcH xMfGLow3aENHQfYwfGxS9IwIYEm7ikLE5RWIFQSljIkwwr/YKTVb1WVqDHGdrxe05EQy xA+nLYKj7I2optxc2ZUT58sB1nnemmmXG7eTQtQEPXym8dnK/Vk4XsA5nk6Z6TqWc814 Vo6w== X-Gm-Message-State: AOJu0YxTYw4NSVOEXeJU2TVXqdg62RXLChP18UDg9HmlNtdN5uoX/af7 yhNic8Ts9hl0RiduFFnDeB7jGllmxiP8yNCENoN/p+Gww6TZEGX7KyVC X-Gm-Gg: AZuq6aJ0jW81pBFr7FKrrwo3LOSOjelASaz/ffHWlZ70cGI7wBx9kPvha4xuGB0u8HW ICOfkbeJZJqrzOZye7jjkAjGqn0DaQgHrS9+SeC0+JO/yxELjTww6+LNJ23BPSF4CoeP6djXJvT cXROS0Lq12q/Rt4QqThId4NzaqmkiLoVIt+6uG9xorRXh5AFJIeFf682PxrQb56hBZUkh/vHCQh LJlJGD9oNgafYPr+bzVM8zqMQgdP0N+/cpmn3BXZNaycgda5SXL+MNr+TSlu2uoYLYQt3ouTY0e 4v9axjrQNXGc0I1Wi6mazPtIoDkar5yyoXLTWb/pgC0DF0aCzzHnS197DFDET+V1/fqRbiDupme Eh7jw+RiNiSWSvga7axoT+m7rLrvVhPwmbfFKORepoauL0v96aFXCILgBimiEmctgztfLmy3ygk d78OUHOxG9NgSzFcFXT/k9BHnNVXJjOZyNRzORptYyUpp7xQOnVb151j7esOB9zm0DtCHlZH2XV POpM/je2apEt3rmscxp5oWgyMzc+6z8ABOYRqX3OTXQXaQ= X-Received: by 2002:a05:600c:3f14:b0:483:6fe1:c057 with SMTP id 5b1f17b1804b1-483a95e1f15mr207937465e9.21.1771956016491; Tue, 24 Feb 2026 10:00:16 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:16 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 2/7] irqchip/renesas-rzv2h: Use local device pointer in ICU probe Date: Tue, 24 Feb 2026 17:56:13 +0000 Message-ID: <20260224175618.3160270-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Use a local struct device pointer in rzv2h_icu_probe_common() to avoid repeated dereferencing of pdev->dev. Signed-off-by: Lad Prabhakar --- v3->v4: - No change. v2->v3: - No change. v1->v2: - No change. --- drivers/irqchip/irq-renesas-rzv2h.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index 20c0cd11ef25..766b981cf3d8 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -555,57 +555,58 @@ static int rzv2h_icu_probe_common(struct platform_dev= ice *pdev, struct device_no { struct irq_domain *irq_domain, *parent_domain; struct device_node *node =3D pdev->dev.of_node; + struct device *dev =3D &pdev->dev; struct reset_control *resetn; int ret; =20 parent_domain =3D irq_find_host(parent); if (!parent_domain) { - dev_err(&pdev->dev, "cannot find parent domain\n"); + dev_err(dev, "cannot find parent domain\n"); return -ENODEV; } =20 - rzv2h_icu_data =3D devm_kzalloc(&pdev->dev, sizeof(*rzv2h_icu_data), GFP_= KERNEL); + rzv2h_icu_data =3D devm_kzalloc(dev, sizeof(*rzv2h_icu_data), GFP_KERNEL); if (!rzv2h_icu_data) return -ENOMEM; =20 platform_set_drvdata(pdev, rzv2h_icu_data); =20 - rzv2h_icu_data->base =3D devm_of_iomap(&pdev->dev, node, 0, NULL); + rzv2h_icu_data->base =3D devm_of_iomap(dev, node, 0, NULL); if (IS_ERR(rzv2h_icu_data->base)) return PTR_ERR(rzv2h_icu_data->base); =20 ret =3D rzv2h_icu_parse_interrupts(rzv2h_icu_data, node); if (ret) { - dev_err(&pdev->dev, "cannot parse interrupts: %d\n", ret); + dev_err(dev, "cannot parse interrupts: %d\n", ret); return ret; } =20 - resetn =3D devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL); + resetn =3D devm_reset_control_get_exclusive_deasserted(dev, NULL); if (IS_ERR(resetn)) { ret =3D PTR_ERR(resetn); - dev_err(&pdev->dev, "failed to acquire deasserted reset: %d\n", ret); + dev_err(dev, "failed to acquire deasserted reset: %d\n", ret); return ret; } =20 - ret =3D devm_pm_runtime_enable(&pdev->dev); + ret =3D devm_pm_runtime_enable(dev); if (ret < 0) { - dev_err(&pdev->dev, "devm_pm_runtime_enable failed, %d\n", ret); + dev_err(dev, "devm_pm_runtime_enable failed, %d\n", ret); return ret; } =20 - ret =3D pm_runtime_resume_and_get(&pdev->dev); + ret =3D pm_runtime_resume_and_get(dev); if (ret < 0) { - dev_err(&pdev->dev, "pm_runtime_resume_and_get failed: %d\n", ret); + dev_err(dev, "pm_runtime_resume_and_get failed: %d\n", ret); return ret; } =20 raw_spin_lock_init(&rzv2h_icu_data->lock); =20 irq_domain =3D irq_domain_create_hierarchy(parent_domain, 0, ICU_NUM_IRQ, - dev_fwnode(&pdev->dev), &rzv2h_icu_domain_ops, + dev_fwnode(dev), &rzv2h_icu_domain_ops, rzv2h_icu_data); if (!irq_domain) { - dev_err(&pdev->dev, "failed to add irq domain\n"); + dev_err(dev, "failed to add irq domain\n"); ret =3D -ENOMEM; goto pm_put; } @@ -616,12 +617,12 @@ static int rzv2h_icu_probe_common(struct platform_dev= ice *pdev, struct device_no =20 /* * coccicheck complains about a missing put_device call before returning,= but it's a false - * positive. We still need &pdev->dev after successfully returning from t= his function. + * positive. We still need dev after successfully returning from this fun= ction. */ return 0; =20 pm_put: - pm_runtime_put(&pdev->dev); + pm_runtime_put(dev); =20 return ret; } --=20 2.53.0 From nobody Fri Apr 17 00:20:36 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 459C92BE65B for ; Tue, 24 Feb 2026 18:00:19 +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=1771956020; cv=none; b=NAxV6bypK26mOWeXGPfiXy7f39amqavOrtA+LvglZ/KsnEZCl68IZUUyu/c3Fm3esA7e3P8rDvJ4JRa1E3SuBRG3N8OjBj5qMZkvMUYIKfXoW0VBgFSz4uQRgx70Mneua+bYRQY+my3kCY2X1OCq4opQKnktqhp37ixodRqfkcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956020; c=relaxed/simple; bh=gzJbMWt2aZUOKuOZXLsCDZ4eaAvkAgOvQMED0lBhUhk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b7DdRVu1VXpsuOb1ynTb4dkPyO2cOzs/3gjF57qZbQxHcdhXtshVf1HOUT7Uyc3YjC5vC8CDP7Qwkgo3qesX/4QBSoEAHmDSK0xo1REGbeEU47J/Lvg4gPhO51GCjdp80BCqNnmcxjUP47lKTTlon6wdITiSImXzIpqqBSaqt5E= 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=Yko5vxFU; 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="Yko5vxFU" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-48373a4bca3so35585695e9.0 for ; Tue, 24 Feb 2026 10:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956018; x=1772560818; 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=6IVcOex3QhSRm1Q2lJzK4niVjsXwmc26ElUqg8fVxd4=; b=Yko5vxFUt4nA1CyVctnTnEu9ohhMOiPezt6Tj60wornY6g4C2G2lEgX38DZO5ine76 bIkdEtGT7XaBfJQAMKy6bpvVpo5RISToelBQeHKFeunEfiODG8LpTU1rTuduFKdsHxzl gH7/47Pq4+PNKS3uqDR9dQcS6Tyu/c4z0mvR4BJYOqPculKpsXnF7XWNCXPEZIVhn1fq DRRrtAJyPkTszTOnn9GrANwd/EKAzS9RN60oB9psXiyd0LuSiAPq8jMkZtVxw4wDmZtk VJOls+riUHSXDLOohYDCoOpWvkR1Qjp1yUtD4CSurvHDHcNEUDm0siRxTrkTNWoF9adq vMlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956018; x=1772560818; 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=6IVcOex3QhSRm1Q2lJzK4niVjsXwmc26ElUqg8fVxd4=; b=T/ucGfZz1JTd3V/QIluNQoMGXdH53j3xJsiZWZN1SqC5qO8G8nNnRLpI7lsXTeIgoH fKn33yv0Klb4yiXbVmVpFOK88SZsfc4OsGDpOzW+F0EjnUtvxOOkvl6ut6kVP/1lx7+Y LS4VofDIw4JGVGH0RRB2zHdmzOsP2kaezbB5NHnPgbHVADt2JjtebqXNs95bB30qQtM5 xpDPJ6B5M7AKouYptaXMhk6A19vCVAHI9YZPm7J5C/k9WBqwcqOj086w3rt/WkSp8hli dxaWpijOHxq3w8vELfoKVBHRRC1x5gmtK4v0KaI6p4OC00OJzyXaIj2tQlH4Xv6Dxki1 azDw== X-Gm-Message-State: AOJu0YzTrbA6JZAnV44ESL6qeaJYvaSu7RlyfkUf6URIBSqDsp+/XNu3 PbR8BPZND/3l5Xbf/rsDTCNzpO2QoqqqUnp4VuyRy6NhbaCIGckINTszg/jFty367pk= X-Gm-Gg: AZuq6aKD6aVKu80vlaDfLDfyc+qP4Ih18eWlbVvsmCpVvmFnJzZ+d6QGBdy2dfuK/Wj oBwY2fnkdwuEvkMkZDT7NYzCa+p0Fpw8kSNCQxurApvltYdqzezAUBhJNp/j/BMoc3yTFeQCW7/ b59XLMyyTBaTU86Jgqu/lnsINUj2QY2kzDjb+6/zrrS94ZclRhuY7bZxd6SA4O9SYO2UpCfwClt c0awtwY26ICH0egi5Wmn/3z9gJ1zdhnFECkuGRSW1vx9dHJ8ePPhFKNruzzd8S7fwPSZP+ecG8c mQ5Pu7E9ks2KnjYxQHxQyh5k6pFQxsheXzmb6VV0XvKzgCmER/OXOWoCXkk1D9Rpcseft1Peowr AJZ1ZWo2q2MC8etTTQTUzXSKEqhwNVAEdDz/HZ/wnLLaAOmwoseivsBEVPT7O+HIvHGVSvS4n9n len/QZlgfKalOQs8nheoRh2yAhU1CR8lc41d9dloqSysz2te+2EWjbxAR2NA6vzjnBYZ3WAeDwz LDzsPg/XiOB+VcX9R1g9bZ2rzQT8ViOx1aT4tnptxdd/Ak= X-Received: by 2002:a05:600c:8b27:b0:480:69ae:f0e9 with SMTP id 5b1f17b1804b1-483a95eb3bamr263521525e9.16.1771956017521; Tue, 24 Feb 2026 10:00:17 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:16 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 3/7] irqchip/renesas-rzv2h: Switch to using dev_err_probe() Date: Tue, 24 Feb 2026 17:56:14 +0000 Message-ID: <20260224175618.3160270-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Make use of dev_err_probe() to simplify rzv2h_icu_probe_common(). Keep dev_err() for -ENOMEM paths, as dev_err_probe() does not print for allocation failures, ensuring they remain visible in logs. Signed-off-by: Lad Prabhakar --- v3->v4: - No change. v2->v3: - No change. v1->v2: - No change. --- drivers/irqchip/irq-renesas-rzv2h.c | 31 ++++++++++------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index 766b981cf3d8..444da7804f15 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -560,10 +560,8 @@ static int rzv2h_icu_probe_common(struct platform_devi= ce *pdev, struct device_no int ret; =20 parent_domain =3D irq_find_host(parent); - if (!parent_domain) { - dev_err(dev, "cannot find parent domain\n"); - return -ENODEV; - } + if (!parent_domain) + return dev_err_probe(dev, -ENODEV, "cannot find parent domain\n"); =20 rzv2h_icu_data =3D devm_kzalloc(dev, sizeof(*rzv2h_icu_data), GFP_KERNEL); if (!rzv2h_icu_data) @@ -576,29 +574,20 @@ static int rzv2h_icu_probe_common(struct platform_dev= ice *pdev, struct device_no return PTR_ERR(rzv2h_icu_data->base); =20 ret =3D rzv2h_icu_parse_interrupts(rzv2h_icu_data, node); - if (ret) { - dev_err(dev, "cannot parse interrupts: %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "cannot parse interrupts\n"); =20 resetn =3D devm_reset_control_get_exclusive_deasserted(dev, NULL); - if (IS_ERR(resetn)) { - ret =3D PTR_ERR(resetn); - dev_err(dev, "failed to acquire deasserted reset: %d\n", ret); - return ret; - } + if (IS_ERR(resetn)) + return dev_err_probe(dev, PTR_ERR(resetn), "failed to acquire deasserted= reset\n"); =20 ret =3D devm_pm_runtime_enable(dev); - if (ret < 0) { - dev_err(dev, "devm_pm_runtime_enable failed, %d\n", ret); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "devm_pm_runtime_enable failed\n"); =20 ret =3D pm_runtime_resume_and_get(dev); - if (ret < 0) { - dev_err(dev, "pm_runtime_resume_and_get failed: %d\n", ret); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "pm_runtime_resume_and_get failed\n"); =20 raw_spin_lock_init(&rzv2h_icu_data->lock); =20 --=20 2.53.0 From nobody Fri Apr 17 00:20:36 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 D8FDA2C027C for ; Tue, 24 Feb 2026 18:00:19 +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=1771956021; cv=none; b=Yi33hni1Wwu6SfYd+p/pMkZZCM/2KcRrFB7gTQwIlKotSbVOIEddnEdUXQ6UgkcsbJBPcWGRuntxcGoba4Asi+eQ0QFu27ySCtUM2N7rkpqNRGP9pUORr1DbruAQjRmiuwhk97SRWTsnACi4IO7LWFs5TVNCfoiALoB+luk6Gbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956021; c=relaxed/simple; bh=KjNIxZDfk29h3mR+MAD58T5ut2z+8tDAomJXGU4ZnZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MB9/66E4893GNEuA6X+58sUlhaLDqp4x3N+Tu507gjIS1yAnWs+7cQPkpoasnR5IYy29hhW2CMjwoGetrINXHnF2CsiXq4AvpgecCLBStvBM9z/9R1LvKWb5m1EvB2VKbHaryeH9Nsz9BreLWgCcexPBwM8Mvs7ubbvppZrVkf0= 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=JvYwf+kx; 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="JvYwf+kx" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4834826e5a0so72193895e9.2 for ; Tue, 24 Feb 2026 10:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956018; x=1772560818; 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=L3LGfWf9S1gCHsjzZpQUDOMcNhfS87CIOBQtN1E+3ZA=; b=JvYwf+kxZHX65gPDk5p16O1vjIZlKezFADSREK4291uREHfKVwOa+ODX3tSfslUbSZ FBxw2CBiSBK8Nh9EX5zGMx/ohK1j58uM065zlY72lyDjEwwUJfA1LkoeH1eexG/Agexp 8gC1VsNpfBxvYdNN+FnHFHal3iK6QTGvoj+M9t1jVDCo+5hYzjEm+PF7dKH43ThHb35Y OtHl83YrGalmL4H9H5D4gFcc8ppueeG3Q2f3I1jij0OLkSJXJUjWMDLAa47c1HkDnrDJ 4hpa2bP3TGdyyBvF1JEKZTUL1hGXt13kcjB+izSyD1hDRhq8n4Pw6pPqgxJsQiJy1uFK tFMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956018; x=1772560818; 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=L3LGfWf9S1gCHsjzZpQUDOMcNhfS87CIOBQtN1E+3ZA=; b=cxQXTUE3L5OHmr5jFpjNqF4cKMuT8YfNBcxBcOFAthXZupHcoPMnp+CW8yJwHhr71r VnhHO/zUvPTKKMJ+LmWmZgCrpTbrJAJTqW5XUnRpmKAsAQGv5fz1XslGmd/3GoCehrPA WCo58QrQg21xQ4iWLY3R7Tso7aAZ76/Em2zVIN/kRiuJDG5Ji451utfx9s10fMje8t6t CGYvneCr/PbrHKewXgQMDnPUUkRhdI3jgwjQlOAfoI4RVEvC1kC0j61W0upM8tXOx7V/ 8+gr/ddPSFhyM8H3WLctTKmj/WKRhnqp6+WZ1UmH3HvzJ+pEo1ocH3XuIW7zk0xtUsdt YVnw== X-Gm-Message-State: AOJu0YxcS8L4r0vyITmiE6NcmP+HFKGilhC/ug/IJN387qk8NT7nQ8/h 1TuFSjyEx1AHfugJLdsEuwCIiy9kJ+zME4poAFeEfW7NdqKdcvBNXC9G X-Gm-Gg: AZuq6aLTLZgE+aifGVaLN6BpSeZ8hYlMWZK2vlL8jSIZPIx/sC0YW5I6ZjNcGdFvW9N cjjBphz6SxuR45WGJfnVsSLM87R7/LDugt7+twbR380FFCL1vx8V+ZGHFK/PchFGtynyzmboI6L phXQju1RhAC69EpZQCAe8P4iQ+7AGdn1FUo/RfnGv3GRnQwMrxzogmDjnFE29i/99LeQ4Tf2gNM dMUlAZRo9iwcxwfWstH4l9JvVCh+B82aFqx9asM6jrvw9Xu8Lr0v5csHk6+zqyKlUVD7/GJZ4rl D/8+wBNL4P+0Yrm05Ce8eZeGlMkCkn86xrVlf50vRYXAUEkpxK8U5FU3EcuqxSTSRYV3sHeYky0 vwSjuavY9wyd69fMkuGx4QlXLEhJkfIefH3bhKsEpP2CfO3xICWBO1bFUAr+jax4kYmbWQRxxlA ZK8ZyHDacgbfEYQ4LGvhUuGF4D6YDJzzgZ7RQBP6mgNZcl6DDebzGjSxkFGdv6rOTguQGPYTyVj tjIL5YHDdydmuCPfGBSYRx2U1vy68bA8ejIUH6pAP8AdYyiuaoVj+LTcg== X-Received: by 2002:a05:600c:c167:b0:480:3a72:524a with SMTP id 5b1f17b1804b1-483a95e9643mr184763575e9.19.1771956018252; Tue, 24 Feb 2026 10:00:18 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:17 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 4/7] irqchip/renesas-rzv2h: Clarify IRQ range definitions and tighten TINT validation Date: Tue, 24 Feb 2026 17:56:15 +0000 Message-ID: <20260224175618.3160270-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Introduce ICU_IRQ_LAST and ICU_TINT_LAST macros to make range boundaries explicit and reduce the chance of off-by-one errors. Extract the TINT information up front in rzv2h_icu_alloc() and validate the resulting hardware IRQ against the full TINT range [ICU_TINT_START, ICU_TINT_LAST]. Signed-off-by: Lad Prabhakar --- v3->v4: - New patch. --- drivers/irqchip/irq-renesas-rzv2h.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index 444da7804f15..ce7d61b14ab6 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -25,9 +25,11 @@ /* DT "interrupts" indexes */ #define ICU_IRQ_START 1 #define ICU_IRQ_COUNT 16 -#define ICU_TINT_START (ICU_IRQ_START + ICU_IRQ_COUNT) +#define ICU_IRQ_LAST (ICU_IRQ_START + ICU_IRQ_COUNT - 1) +#define ICU_TINT_START (ICU_IRQ_LAST + 1) #define ICU_TINT_COUNT 32 -#define ICU_NUM_IRQ (ICU_TINT_START + ICU_TINT_COUNT) +#define ICU_TINT_LAST (ICU_TINT_START + ICU_TINT_COUNT - 1) +#define ICU_NUM_IRQ (ICU_TINT_LAST + 1) =20 /* Registers */ #define ICU_NSCNT 0x00 @@ -508,11 +510,11 @@ static int rzv2h_icu_alloc(struct irq_domain *domain,= unsigned int virq, unsigne * hwirq is embedded in bits 0-15. * TINT is embedded in bits 16-31. */ - if (hwirq >=3D ICU_TINT_START) { - tint =3D ICU_TINT_EXTRACT_GPIOINT(hwirq); + tint =3D ICU_TINT_EXTRACT_GPIOINT(hwirq); + if (tint || (hwirq >=3D ICU_TINT_START && hwirq <=3D ICU_TINT_LAST)) { hwirq =3D ICU_TINT_EXTRACT_HWIRQ(hwirq); =20 - if (hwirq < ICU_TINT_START) + if (hwirq < ICU_TINT_START || hwirq > ICU_TINT_LAST) return -EINVAL; } =20 --=20 2.53.0 From nobody Fri Apr 17 00:20:36 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 D81E52C235E for ; Tue, 24 Feb 2026 18:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956022; cv=none; b=OVj9d1l8JUxy1lvqLCVwcY44HFtR/jqEKJcthP1tAhy/6FalmFa8mEiA3+b2pSi1uy7lz+htjud99QIrT2kYp2NxaDuVbn75xPvVH+gF/Yt8OPCkqrb0y4NsQjKOggyL9Skgq2fPqkxUD6XAru15Yj7sX3H0dkri1KEzra8NbFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956022; c=relaxed/simple; bh=Ycj4Bv75R404C5Ebq6OitXTo/ox0p3S65haUncTPY2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TRUtk7AbymAOrwnxFcsgNh0ZXlCJy5bu/kF7yVsDsDipwMWM03QkDeciMUwCM90NvxKMZQrmOCBiPbSj+vCY2Gh8Nd3WKq4G94Hsohp7plK4oHMjG7XUYnUTq94B4HeSPRe87pYRUf6xLCWbiuPKKEY5ENv992qJx1fxsGnHPq8= 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=Uugp33sG; arc=none smtp.client-ip=209.85.128.49 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="Uugp33sG" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-480706554beso70140625e9.1 for ; Tue, 24 Feb 2026 10:00:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956019; x=1772560819; 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=0cSCy8kAAxQYaP9uk2AAb1MuyYSkdFQ+iYuql26f6dE=; b=Uugp33sG46f/kOxiBO5Koyiu3vdGlvzfW6WNJzpBvUNFv6mhamOF6MoSnVZnvKMLeI BJ0jp8bGu08vPKZdKqeq23xJUTSg1B4+NyiPeCvMo/F1REeIFXxNdYFMMlKX+RoZ1LNi ly25evZdsy8fjeYapgMfONaPGFIUjIdAr+HMx80K1SPXD7MJqZET4DOoREv5La8z/GXy GYqNM5D6D9HpEvN6w0+Xb1/hTAoIHDW/V4mXKUzNndH0d7iU62vug836Y1iRo+u+VdYd U/nX7iNtC0lV5hWm65VGm0QpBf46503Xx6lkvPHkSKtm1GWp0N7oeGIBuwZXiFZx7AKQ vXsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956019; x=1772560819; 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=0cSCy8kAAxQYaP9uk2AAb1MuyYSkdFQ+iYuql26f6dE=; b=dzXvqHkKWrkreaHGnfAVF9X3MbvbqF6rbRcGRcpo4SLZLJRxHN58yLNDhAha6stOia KPgqc2gxnTNK6qeRg0QE7f//royjV6CRavYa/q2zIJ4sF24oEftkmDVeklGcjmpjBxMS fCtJRJzgDi9cScS92jkGjqSRBfo6XE+U6qyS7FmlCs4blibCoFfrwB8L24dbRvI/y2AX ZiUFrgytbLyIMQe1SiFRkxNt3I74nkL/DcytcJBMfwRXcEKUIWliQE03+DEY2/btd+J5 Gm3r7RDeqkNThwrS8jzRbCPyDx87WBOZ4X7iyedBEliAMTPxb70eb/vMH9g7mKOkw/9R RBrQ== X-Gm-Message-State: AOJu0Yw7sfdjjq7SO3OK2yYPG+vDi/snj2npqlRorPj03o2nUJFLZai8 WBCJnpo7qP4LMxXmDlLgGmx/b+tZcq1BkS5W0NEv636bwnVYEOGtz3qS X-Gm-Gg: AZuq6aI+BzHPYCARWLl0yy2Cxp+tCCR1dUBAjH4a8kjx8vKyBUa2F4eltitpQn9hs0m Knb3N+1mBzTk2HUXUagWldu6EbcBMEaC8Yh3mypXu1IydpaH4+KmJH1/fgBWafu/dGfsuJc0Q8n iLnIT2roMLIv4yPOlgHAra3gftau3BOC6gUKtXUr4yBljcIj4GfX1dZ8xq7aKMiYNsSkzS0i6uU J9LFtJFpGRdzLpt/CsseonlinsDWms4oKqygKQFcl9XWiDH+BUXgGT9rU+a0LM5BlD9vDZVHDMe hKTRLsBxDKlhX2ZIGNf3nJOb1AbRNsWTRqIXO+Rg0jEBvQfsViDhi4emtb5Pd/+8N0SZrklid1V skL+F3MXotaDyZS6e6fJHsYWBskA8lQyMLrDie/JWZFxxwb0fIOtgELN9xb6sUbY3JyudqK82t2 WJi2M6lL1pdpvUBGMyioVFQJ18OSqoqMVpbcyhrlgyHW1sAjxFXKy97WkoubeAD1R5De3GptVK1 VELixsYIqAiFrMIu+LeaTdR6r37j2jOmF383jWdLuR2YCo= X-Received: by 2002:a05:600c:530f:b0:483:bcff:7948 with SMTP id 5b1f17b1804b1-483bcff7bd8mr26242735e9.10.1771956018945; Tue, 24 Feb 2026 10:00:18 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:18 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 5/7] irqchip/renesas-rzv2h: Replace single irq_chip with per-region irq_chip instances Date: Tue, 24 Feb 2026 17:56:16 +0000 Message-ID: <20260224175618.3160270-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Replace the single rzv2h_icu_chip and its dispatcher callbacks with dedicated irq_chip instances for each interrupt region: NMI, IRQ, and TINT. Move the irqd_is_level_type() check ahead of the scoped_guard in rzv2h_icu_tint_eoi() and rzv2h_icu_irq_eoi() to avoid acquiring the spinlock unnecessarily for level-type interrupts. Drop the ICU_TINT_START guard from rzv2h_tint_irq_endisable() since it is now only reachable via the TINT chip path. Signed-off-by: Lad Prabhakar --- v3->v4: - New patch. --- drivers/irqchip/irq-renesas-rzv2h.c | 133 ++++++++++++++++++---------- 1 file changed, 85 insertions(+), 48 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index ce7d61b14ab6..d72400bb62b1 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -169,32 +169,50 @@ static inline struct rzv2h_icu_priv *irq_data_to_priv= (struct irq_data *data) return data->domain->host_data; } =20 -static void rzv2h_icu_eoi(struct irq_data *d) +static void rzv2h_icu_tint_eoi(struct irq_data *d) { struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d); unsigned int hw_irq =3D irqd_to_hwirq(d); unsigned int tintirq_nr; u32 bit; =20 - scoped_guard(raw_spinlock, &priv->lock) { - if (hw_irq >=3D ICU_TINT_START) { - tintirq_nr =3D hw_irq - ICU_TINT_START; - bit =3D BIT(tintirq_nr); - if (!irqd_is_level_type(d)) - writel_relaxed(bit, priv->base + priv->info->t_offs + ICU_TSCLR); - } else if (hw_irq >=3D ICU_IRQ_START) { - tintirq_nr =3D hw_irq - ICU_IRQ_START; - bit =3D BIT(tintirq_nr); - if (!irqd_is_level_type(d)) - writel_relaxed(bit, priv->base + ICU_ISCLR); - } else { - writel_relaxed(ICU_NSCLR_NCLR, priv->base + ICU_NSCLR); - } + if (!irqd_is_level_type(d)) { + tintirq_nr =3D hw_irq - ICU_TINT_START; + bit =3D BIT(tintirq_nr); + scoped_guard(raw_spinlock, &priv->lock) + writel_relaxed(bit, priv->base + priv->info->t_offs + ICU_TSCLR); } =20 irq_chip_eoi_parent(d); } =20 +static void rzv2h_icu_irq_eoi(struct irq_data *d) +{ + struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d); + unsigned int hw_irq =3D irqd_to_hwirq(d); + unsigned int tintirq_nr; + u32 bit; + + if (!irqd_is_level_type(d)) { + tintirq_nr =3D hw_irq - ICU_IRQ_START; + bit =3D BIT(tintirq_nr); + scoped_guard(raw_spinlock, &priv->lock) + writel_relaxed(bit, priv->base + ICU_ISCLR); + } + + irq_chip_eoi_parent(d); +} + +static void rzv2h_icu_nmi_eoi(struct irq_data *d) +{ + struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d); + + scoped_guard(raw_spinlock, &priv->lock) + writel_relaxed(ICU_NSCLR_NCLR, priv->base + ICU_NSCLR); + + irq_chip_eoi_parent(d); +} + static void rzv2h_tint_irq_endisable(struct irq_data *d, bool enable) { struct rzv2h_icu_priv *priv =3D irq_data_to_priv(d); @@ -202,9 +220,6 @@ static void rzv2h_tint_irq_endisable(struct irq_data *d= , bool enable) u32 tint_nr, tssel_n, k, tssr; u8 nr_tint; =20 - if (hw_irq < ICU_TINT_START) - return; - tint_nr =3D hw_irq - ICU_TINT_START; nr_tint =3D 32 / priv->info->field_width; k =3D tint_nr / nr_tint; @@ -227,13 +242,13 @@ static void rzv2h_tint_irq_endisable(struct irq_data = *d, bool enable) writel_relaxed(BIT(tint_nr), priv->base + priv->info->t_offs + ICU_TSCLR); } =20 -static void rzv2h_icu_irq_disable(struct irq_data *d) +static void rzv2h_icu_tint_disable(struct irq_data *d) { irq_chip_disable_parent(d); rzv2h_tint_irq_endisable(d, false); } =20 -static void rzv2h_icu_irq_enable(struct irq_data *d) +static void rzv2h_icu_tint_enable(struct irq_data *d) { rzv2h_tint_irq_endisable(d, true); irq_chip_enable_parent(d); @@ -259,7 +274,7 @@ static int rzv2h_nmi_set_type(struct irq_data *d, unsig= ned int type) =20 writel_relaxed(sense, priv->base + ICU_NITSR); =20 - return 0; + return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); } =20 static void rzv2h_clear_irq_int(struct rzv2h_icu_priv *priv, unsigned int = hwirq) @@ -316,7 +331,7 @@ static int rzv2h_irq_set_type(struct irq_data *d, unsig= ned int type) rzv2h_clear_irq_int(priv, hwirq); writel_relaxed(iitsr, priv->base + ICU_IITSR); =20 - return 0; + return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); } =20 static void rzv2h_clear_tint_int(struct rzv2h_icu_priv *priv, unsigned int= hwirq) @@ -399,7 +414,7 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsi= gned int type) tssr_cur =3D field_get(ICU_TSSR_TSSEL_MASK(tssel_n, priv->info->field_wid= th), tssr); titsr_cur =3D field_get(ICU_TITSR_TITSEL_MASK(titsel_n), titsr); if (tssr_cur =3D=3D tint && titsr_cur =3D=3D sense) - return 0; + goto set_parent_type; =20 tssr &=3D ~(ICU_TSSR_TSSEL_MASK(tssel_n, priv->info->field_width) | tien); tssr |=3D ICU_TSSR_TSSEL_PREP(tint, tssel_n, priv->info->field_width); @@ -415,24 +430,7 @@ static int rzv2h_tint_set_type(struct irq_data *d, uns= igned int type) =20 writel_relaxed(tssr | tien, priv->base + priv->info->t_offs + ICU_TSSR(ts= sr_k)); =20 - return 0; -} - -static int rzv2h_icu_set_type(struct irq_data *d, unsigned int type) -{ - unsigned int hw_irq =3D irqd_to_hwirq(d); - int ret; - - if (hw_irq >=3D ICU_TINT_START) - ret =3D rzv2h_tint_set_type(d, type); - else if (hw_irq >=3D ICU_IRQ_START) - ret =3D rzv2h_irq_set_type(d, type); - else - ret =3D rzv2h_nmi_set_type(d, type); - - if (ret) - return ret; - +set_parent_type: return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); } =20 @@ -474,17 +472,51 @@ static struct syscore rzv2h_irqc_syscore =3D { .ops =3D &rzv2h_irqc_syscore_ops, }; =20 -static const struct irq_chip rzv2h_icu_chip =3D { +static const struct irq_chip rzv2h_icu_tint_chip =3D { + .name =3D "rzv2h-icu", + .irq_eoi =3D rzv2h_icu_tint_eoi, + .irq_mask =3D irq_chip_mask_parent, + .irq_unmask =3D irq_chip_unmask_parent, + .irq_disable =3D rzv2h_icu_tint_disable, + .irq_enable =3D rzv2h_icu_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, + .irq_set_type =3D rzv2h_tint_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 rzv2h_icu_irq_chip =3D { + .name =3D "rzv2h-icu", + .irq_eoi =3D rzv2h_icu_irq_eoi, + .irq_mask =3D irq_chip_mask_parent, + .irq_unmask =3D irq_chip_unmask_parent, + .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, + .irq_set_type =3D rzv2h_irq_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 rzv2h_icu_nmi_chip =3D { .name =3D "rzv2h-icu", - .irq_eoi =3D rzv2h_icu_eoi, + .irq_eoi =3D rzv2h_icu_nmi_eoi, .irq_mask =3D irq_chip_mask_parent, .irq_unmask =3D irq_chip_unmask_parent, - .irq_disable =3D rzv2h_icu_irq_disable, - .irq_enable =3D rzv2h_icu_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, - .irq_set_type =3D rzv2h_icu_set_type, + .irq_set_type =3D rzv2h_nmi_set_type, .irq_set_affinity =3D irq_chip_set_affinity_parent, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SET_TYPE_MASKED | @@ -495,6 +527,7 @@ static int rzv2h_icu_alloc(struct irq_domain *domain, u= nsigned int virq, unsigne void *arg) { struct rzv2h_icu_priv *priv =3D domain->host_data; + const struct irq_chip *chip; unsigned long tint =3D 0; irq_hw_number_t hwirq; unsigned int type; @@ -516,13 +549,17 @@ static int rzv2h_icu_alloc(struct irq_domain *domain,= unsigned int virq, unsigne =20 if (hwirq < ICU_TINT_START || hwirq > ICU_TINT_LAST) return -EINVAL; + chip =3D &rzv2h_icu_tint_chip; + } else if (hwirq >=3D ICU_IRQ_START && hwirq <=3D ICU_IRQ_LAST) { + chip =3D &rzv2h_icu_irq_chip; + } else { + chip =3D &rzv2h_icu_nmi_chip; } =20 if (hwirq > (ICU_NUM_IRQ - 1)) return -EINVAL; =20 - ret =3D irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &rzv2h_icu_chi= p, - (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 --=20 2.53.0 From nobody Fri Apr 17 00:20:36 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 91F4F3ACF15 for ; Tue, 24 Feb 2026 18:00:21 +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=1771956023; cv=none; b=agXbRROr9RIo8HaXjsAl0GSvTprSrw3VbZF/Ep7e8lKzkCT23dKhXcqWC7gVK4kETkpn2KzZvus2ND/MsZl9ITDIMRmvqGmeRNcW6JQWHOzhuIAaESWekZmSjmq+RBJUx8Xaowk2abxEUjDG0wsiLw2pygT/EgAwHCdytndp0Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956023; c=relaxed/simple; bh=GnluRpgFCcayajp9z60GgQmarw9dgWAtGZG9rbKVeNk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nFGzG7oSXkY8/xkYR7fzfG22OKjx6snsMdiqwCrerJZiBPBdwhGdBYbtk+pn6E2Me+ZV14XgyXy5yYvDBCYfevLrpaAdIhVmTm3kyiUouc5TFzoLYWoneI3YWNq1FBXEWjkv2IMR2N+Yieztu3eyDm/AILBIkmUU4D7RxV/WFDo= 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=H6hXQwPn; 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="H6hXQwPn" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4833115090dso56541405e9.3 for ; Tue, 24 Feb 2026 10:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956020; x=1772560820; 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=G3thGyjue57rl8vh/ZrwvpRe4jkqPWJRDLcTE+hgIQo=; b=H6hXQwPnKnqfWgEQNzLW9ovrgFplBviqqPYI7P7/8GLRNMIDaRQNPEgcSgHRVzV8no mt/5oQfsquoCcd3+j9/eCkCSjGoMXnl+Doh6ZGHDcmTuukYRMEyxupCL/EJjgRZFljgp FTfMdxqA+8tMIBW8iOsFPSROM9TwJJAiRXL2gTBv24XmGZbBPl2b4I2SomUkhK4VzRQ0 NmgGJXtX6UHtjAaWPlknXMVah5pMhRKoBm43dty474z9oGntDWcEM+/Y0px3jQWX+6Tm 6fsEHrvoPIDyzaL+tmY99EM/WgR6R1SDktitSca/E2punaJeY1hLtvKya+4ziu9fh0dW IIAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956020; x=1772560820; 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=G3thGyjue57rl8vh/ZrwvpRe4jkqPWJRDLcTE+hgIQo=; b=X42C11oFu5LLKwH9S6ElGRiZ03b3S6uvEOaSOzhBIWslk5Pg8VBgmxN3NgJLhbxC6W 6tnBR91S0044FJR889w1UwfWrErFOSYcKXcrT5fwjK8FNpgGJ29dtzzhHQ++eO+EQVka auVmJB1t6U+LuXYs1swqAggCCD+1bw4GT5cj1oW5KLgkci74+BbTIoRjxB4XFZ8veyaR BNt6TZacXDSh6l6r/pFvTqfFE0J4EqAKAZSisxXdJe+kZQXi2i3bRlniTCvGluMC6k0F /QzSt2xsyJQAs8Rb7xFD1DqgX0U2t5CyMpKYEgYgT5zIEa2tFT6wOZmHmNpsLJMmMG2T scVA== X-Gm-Message-State: AOJu0Yzgu01WDBto2SE6ql8bRwsKq/DL5lU2WUT6JWdPfP1JP07YWIqN QCfDfTCeOFo+MfJV8bfD2Qj4xU/9Vyz0Z90zuzeJJECugeNVBRNbhOL2 X-Gm-Gg: AZuq6aJO0XPvgWykCn8sD1mxbDBMYCa704JC3+7P586M8YASPToavJHgG496uwoB/No FBoNDJM25q615lov4JsNPttKd40aZaAlvePYNcSGc7YMDCKcgBw18VMPdCOEcmxEWbxJ0fRnxPj XmyuwK0LTAecmyxabV/mzhAt3rJPFkBAOb2riJy11J6lrTl+c98sbMkK1NmFfhp4AqjIlbBdsDR ugBGSU1lYlBmQNAR8pJszeqNwBvfgEGiRyXNCUpfb8NUKkw0ISUQl7mbAQB4L1GMXGeehp7IZ1/ ZOIFiEmdxlFPEl5tWXD8QcUo6yuwJ/jpXBV9/3B70lKBXZTcGg5AZe+T34/NJ9MJbWsKYZgNpTX 3k0tA7nGlKvo+HjmpjTOQk+xPeYlow3CrUExpQDYXJiGtkK4GCOzO/89UAmjszc5k+g+OD1eXzA Ic09lWvY3kYmlXf1RqlUQkTjJqntzWFfrNKJjVrHoi4+ZtMHxlO0cnUT0tg/8Rc+M3SMSf0XO7A ENyz5z/C2mg7MWPUSZS3dMsBrlJvMpYSSJ3n0wIw0x6JnA= X-Received: by 2002:a05:600c:c8a:b0:480:4a90:1b06 with SMTP id 5b1f17b1804b1-483a9603d42mr202137535e9.34.1771956019749; Tue, 24 Feb 2026 10:00:19 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:19 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 6/7] irqchip/renesas-rzv2h: Add CA55 software interrupt support Date: Tue, 24 Feb 2026 17:56:17 +0000 Message-ID: <20260224175618.3160270-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar The RZ/V2H ICU exposes four software-triggerable interrupts targeting the CA55 cores (int-ca55-0 to int-ca55-3). Add support for these interrupts to enable IRQ injection via the generic IRQ injection framework. Add a dedicated rzv2h_icu_swint_chip irq_chip for the CA55 region and implement rzv2h_icu_irq_set_irqchip_state() to handle software interrupt injection. Signed-off-by: Lad Prabhakar --- v3->v4: - Made a seprate irq chip for SWINT v2->v3: - Replaced pr_debug with pr_info in the SWINT handler to ensure visibility of the message. v1->v2: - Made CA55 SW interrupt as part of ICU IRQ domain. - Implemented rzv2h_icu_irq_set_irqchip_state() to trigger SWINT. - Updated commit message accordingly. --- drivers/irqchip/irq-renesas-rzv2h.c | 96 ++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index d72400bb62b1..235eb9dc6126 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,10 @@ #define ICU_TINT_START (ICU_IRQ_LAST + 1) #define ICU_TINT_COUNT 32 #define ICU_TINT_LAST (ICU_TINT_START + ICU_TINT_COUNT - 1) -#define ICU_NUM_IRQ (ICU_TINT_LAST + 1) +#define ICU_CA55_INT_START (ICU_TINT_LAST + 1) +#define ICU_CA55_INT_COUNT 4 +#define ICU_CA55_INT_LAST (ICU_CA55_INT_START + ICU_CA55_INT_COUNT - 1) +#define ICU_NUM_IRQ (ICU_CA55_INT_LAST + 1) =20 /* Registers */ #define ICU_NSCNT 0x00 @@ -42,6 +46,7 @@ #define ICU_TSCLR 0x24 #define ICU_TITSR(k) (0x28 + (k) * 4) #define ICU_TSSR(k) (0x30 + (k) * 4) +#define ICU_SWINT 0x130 #define ICU_DMkSELy(k, y) (0x420 + (k) * 0x20 + (y) * 4) #define ICU_DMACKSELk(k) (0x500 + (k) * 4) =20 @@ -434,6 +439,28 @@ static int rzv2h_tint_set_type(struct irq_data *d, uns= igned int type) return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH); } =20 +static int rzv2h_icu_swint_set_irqchip_state(struct irq_data *d, enum irqc= hip_irq_state which, + bool state) +{ + unsigned int hwirq =3D irqd_to_hwirq(d); + struct rzv2h_icu_priv *priv; + unsigned int bit; + + if (which !=3D IRQCHIP_STATE_PENDING) + return irq_chip_set_parent_state(d, which, state); + + if (!state) + return 0; + + priv =3D irq_data_to_priv(d); + bit =3D BIT(hwirq - ICU_CA55_INT_START); + + guard(raw_spinlock)(&priv->lock); + /* Trigger the software interrupt */ + writel_relaxed(bit, priv->base + ICU_SWINT); + return 0; +} + static int rzv2h_irqc_irq_suspend(void *data) { struct rzv2h_irqc_reg_cache *cache =3D &rzv2h_icu_data->cache; @@ -523,6 +550,23 @@ static const struct irq_chip rzv2h_icu_nmi_chip =3D { IRQCHIP_SKIP_SET_WAKE, }; =20 +static const struct irq_chip rzv2h_icu_swint_chip =3D { + .name =3D "rzv2h-icu", + .irq_eoi =3D irq_chip_eoi_parent, + .irq_mask =3D irq_chip_mask_parent, + .irq_unmask =3D irq_chip_unmask_parent, + .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 rzv2h_icu_swint_set_irqchip_state, + .irq_retrigger =3D irq_chip_retrigger_hierarchy, + .irq_set_type =3D irq_chip_set_type_parent, + .irq_set_affinity =3D irq_chip_set_affinity_parent, + .flags =3D IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SET_TYPE_MASKED | + IRQCHIP_SKIP_SET_WAKE, +}; + static int rzv2h_icu_alloc(struct irq_domain *domain, unsigned int virq, u= nsigned int nr_irqs, void *arg) { @@ -552,6 +596,8 @@ static int rzv2h_icu_alloc(struct irq_domain *domain, u= nsigned int virq, unsigne chip =3D &rzv2h_icu_tint_chip; } else if (hwirq >=3D ICU_IRQ_START && hwirq <=3D ICU_IRQ_LAST) { chip =3D &rzv2h_icu_irq_chip; + } else if (hwirq >=3D ICU_CA55_INT_START && hwirq <=3D ICU_CA55_INT_LAST)= { + chip =3D &rzv2h_icu_swint_chip; } else { chip =3D &rzv2h_icu_nmi_chip; } @@ -589,6 +635,50 @@ static int rzv2h_icu_parse_interrupts(struct rzv2h_icu= _priv *priv, struct device return 0; } =20 +static irqreturn_t rzv2h_icu_swint_irq(int irq, void *data) +{ + u8 cpu =3D *(u8 *)data; + + pr_info("SWINT interrupt for CA55 core %u\n", cpu); + return IRQ_HANDLED; +} + +static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_d= omain *irq_domain) +{ + bool irq_inject =3D IS_ENABLED(CONFIG_GENERIC_IRQ_INJECTION); + static const char * const rzv2h_swint_names[] =3D { + "int-ca55-0", "int-ca55-1", + "int-ca55-2", "int-ca55-3", + }; + static const u8 swint_idx[] =3D { 0, 1, 2, 3 }; + struct device *dev =3D &pdev->dev; + struct irq_fwspec fwspec; + unsigned int i, virq; + int ret; + + for (i =3D 0; i < ICU_CA55_INT_COUNT && irq_inject; i++) { + fwspec.fwnode =3D irq_domain->fwnode; + fwspec.param_count =3D 2; + fwspec.param[0] =3D ICU_CA55_INT_START + i; + fwspec.param[1] =3D IRQ_TYPE_EDGE_RISING; + + virq =3D irq_create_fwspec_mapping(&fwspec); + if (!virq) { + return dev_err_probe(dev, -EINVAL, "failed to create IRQ mapping for %s= \n", + rzv2h_swint_names[i]); + } + + ret =3D devm_request_irq(dev, virq, rzv2h_icu_swint_irq, 0, dev_name(dev= ), + (void *)&swint_idx[i]); + if (ret) { + return dev_err_probe(dev, ret, "Failed to request %s IRQ\n", + rzv2h_swint_names[i]); + } + } + + return 0; +} + static int rzv2h_icu_probe_common(struct platform_device *pdev, struct dev= ice_node *parent, const struct rzv2h_hw_info *hw_info) { @@ -643,6 +733,10 @@ static int rzv2h_icu_probe_common(struct platform_devi= ce *pdev, struct device_no =20 register_syscore(&rzv2h_irqc_syscore); =20 + ret =3D rzv2h_icu_setup_irqs(pdev, irq_domain); + if (ret) + goto pm_put; + /* * coccicheck complains about a missing put_device call before returning,= but it's a false * positive. We still need dev after successfully returning from this fun= ction. --=20 2.53.0 From nobody Fri Apr 17 00:20:36 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 773D53B8D6E for ; Tue, 24 Feb 2026 18:00:22 +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=1771956024; cv=none; b=tUYBKCP6EBQ77gzjKUi/xzvH57j9SErL3wmVwLVuLrSbtemfEjTrJ0pG5ipSmTIPqmQrQ0ovIpqWORfAmS1sE89C7kedahyaQ3+0hO1P7yqG58WvD/9saiRdl3aX34iX1ftntor776yVmbR/3Mekj19BlY/3vPY+AbsPe59PeB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771956024; c=relaxed/simple; bh=nVaHVEZYyKcskZpgE7CVGuB1f3aog8ZC/SoE0H7ZI4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DkYNXLXbWryHmUvTs9L+Lyes7A65RycWmRSL+8satVirh1/udTMt5ScCH4eNrlLoKGW7Dd9nxy7QeM1fB3Lt7cdgAg+y0xvtAV4VGNVIP486PYrjAmMYu7iKJiNTYvW6cxg4LWZCp73m7pWWt1h7Ggu1KQvJUuJmErBt5Ra6Ui8= 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=aEhGFpS1; 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="aEhGFpS1" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4806cc07ce7so55935435e9.1 for ; Tue, 24 Feb 2026 10:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771956021; x=1772560821; 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=zvSseRSGBJdm9csJK8PAxwMGfjNVGX90ac0haKfWANg=; b=aEhGFpS1k+ENEGvfXfoYeIy5WF8yGCFvfPnh2SdNtxBPUKntNZETuPDF6I3SoapXSE UHSkl+ovlpcmRIu3/MNs4/f8sz3JARxxWX3P573u0EZ2OMUCqzNTHFSY6pdy/HeppAdG /FXOEIspJWjQCicZTwe87Y0MisdUcXerAu7wRs3TM1ffMQidDDBgcR/dOmhhNE/GHSla OaKgqLr/VbEX92qdbNSoq4llLJ43q+k9yeiQ/4WVro6BqYWRLLSdBpFNDb56bPIcIwxt 9FbBzsjVck/wP33RG01bSL/uanl0EyRz74FcIh75QJN+PbXxcHMk3oLsFZlZmW3CdTru uUxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771956021; x=1772560821; 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=zvSseRSGBJdm9csJK8PAxwMGfjNVGX90ac0haKfWANg=; b=venwKT8k/sBvme6yg45bvkQNJvOZxwVwwmvpK1TFHMmoqAXFoTXjSlJEpGB/1YvkuJ XIKfITEIaY9PC6q62YrWK2ypqNUFOXhz4BB2jT8wwZIwvosm0KIJMWWFC0dE9t+8RlL4 51THJo8g8OI1HRDa8Dvyz27ijzetErL+vdIKTb3t3rj9pIQtZYyeMQht45f79BrCwXB0 yjjEE6ngGPVjADG9L2VyN5EvsGeyR7zeowDZ2nkIPohhZm7ihxZBnNo+YhlegiIeHT/t s8wLNSqI8MXoomFaMjB357Ty/HqLrxcjmzpcmjb60iZMiU8znFZVKUsEZ106Ah0HukqN CZIQ== X-Gm-Message-State: AOJu0YyaT/x1magrgbjy1nfwLz/gtkN8UXjda6FE5bZHNxsDmd41bbPP +kHj+/ys9ttEgaPcEDH1Qtk7BVf5LPmbMEeItAN54wbsI1ULFqonK4Gl X-Gm-Gg: AZuq6aKUgXyCeD/MV/BPf/E6IRAbQSIMMHPdnJ9qvG7Rm9s6sJZKg1nUhVRT1FK7He6 uM36aqxeE+W0uUCpV2hZmlqCY0e1yUDSVNqHGvygShjeFTjEnmd/vscmxzFQgvT9WlKGt7X09fc BVG8aQHT9GbrutzWp7WqAFyjYwyJhtiP27Jlb3vndi2Q7y/wDV/b7+HZ2ERNy7Rwi5B1NhoqPml RsRUtstmnltRdpJu6TYFlRwUfZ09b4I1jIhNjxzLJ1Ts+l5AAxC+GlJZZ0tnExz+nLQl5SDIyK8 4U799Z/HaEJVZRtV6RWP7ErttwYvj3FNFZ4puL8tsf7QJCutG18igWyQYNU12Z1qfwEt01XYDPg 8MGvGWtGniuH5eFNDWxuHu9ATezr+xYsJiP1lvopycsFB67zKuWoveT1HJPNBuFmXKS1Uu4uFLi AkfV08IFoxaPXY0zn42EDn6YxfUsWcgJyK/xnnD3M6e07CbH/ciOQUgw6vKbbkjVSTTN+k9KoeU SthnVjc3/TyVxcGOqEbRNqfnzfrG6loBCsLdL/vVF9Mh7k= X-Received: by 2002:a05:600c:6206:b0:465:a51d:d4 with SMTP id 5b1f17b1804b1-483a95b6debmr207076615e9.6.1771956020578; Tue, 24 Feb 2026 10:00:20 -0800 (PST) Received: from iku.example.org ([2a06:5906:61b:2d00:87da:e3e9:a9bf:6f1d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd72bd66sm13064095e9.11.2026.02.24.10.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 10:00:20 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: Thomas Gleixner , Philipp Zabel , Geert Uytterhoeven , Magnus Damm Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v4 7/7] irqchip/renesas-rzv2h: Handle ICU error IRQ and add SWPE trigger Date: Tue, 24 Feb 2026 17:56:18 +0000 Message-ID: <20260224175618.3160270-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20260224175618.3160270-1-prabhakar.mahadev-lad.rj@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: Lad Prabhakar Handle the RZ/V2H ICU error interrupt to help diagnose latched bus, ECC RAM, and CA55/IP error conditions. Support error injection via ICU_SWPE to allow testing the pseudo error error interrupts. Account for SoC differences in ECC RAM error register coverage so the handler only iterates over valid ECC status/clear banks, and route the RZ/V2N compatible to a probe path with the correct ECC range while keeping the existing RZ/V2H and RZ/G3E handling. Signed-off-by: Lad Prabhakar --- v3->v4: - Made a seprate irq chip for SWPE v2->v3: - Updated pr_debug to pr_info in the error IRQ handler to ensure visibility of the messages. v1->v2: - Made Error interrupt as part of ICU IRQ domain. - Updated rzv2h_icu_irq_set_irqchip_state() to trigger pseudo interrupt. - Updated commit message accordingly. --- drivers/irqchip/irq-renesas-rzv2h.c | 164 +++++++++++++++++++++++++++- 1 file changed, 162 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-rene= sas-rzv2h.c index 235eb9dc6126..b7074982e572 100644 --- a/drivers/irqchip/irq-renesas-rzv2h.c +++ b/drivers/irqchip/irq-renesas-rzv2h.c @@ -33,7 +33,10 @@ #define ICU_CA55_INT_START (ICU_TINT_LAST + 1) #define ICU_CA55_INT_COUNT 4 #define ICU_CA55_INT_LAST (ICU_CA55_INT_START + ICU_CA55_INT_COUNT - 1) -#define ICU_NUM_IRQ (ICU_CA55_INT_LAST + 1) +#define ICU_ERR_INT_START (ICU_CA55_INT_LAST + 1) +#define ICU_ERR_INT_COUNT 1 +#define ICU_ERR_INT_LAST (ICU_ERR_INT_START + ICU_ERR_INT_COUNT - 1) +#define ICU_NUM_IRQ (ICU_ERR_INT_LAST + 1) =20 /* Registers */ #define ICU_NSCNT 0x00 @@ -46,7 +49,15 @@ #define ICU_TSCLR 0x24 #define ICU_TITSR(k) (0x28 + (k) * 4) #define ICU_TSSR(k) (0x30 + (k) * 4) +#define ICU_BEISR(k) (0x70 + (k) * 4) +#define ICU_BECLR(k) (0x80 + (k) * 4) +#define ICU_EREISR(k) (0x90 + (k) * 4) +#define ICU_ERCLR(k) (0xE0 + (k) * 4) #define ICU_SWINT 0x130 +#define ICU_ERINTA55CTL(k) (0x338 + (k) * 4) +#define ICU_ERINTA55CRL(k) (0x348 + (k) * 4) +#define ICU_ERINTA55MSK(k) (0x358 + (k) * 4) +#define ICU_SWPE 0x370 #define ICU_DMkSELy(k, y) (0x420 + (k) * 0x20 + (y) * 4) #define ICU_DMACKSELk(k) (0x500 + (k) * 4) =20 @@ -97,6 +108,10 @@ #define ICU_RZG3E_TSSEL_MAX_VAL 0x8c #define ICU_RZV2H_TSSEL_MAX_VAL 0x55 =20 +#define ICU_SWPE_NUM 16 +#define ICU_NUM_BE 4 +#define ICU_NUM_A55ERR 4 + /** * struct rzv2h_irqc_reg_cache - registers cache (necessary for suspend/re= sume) * @nitsr: ICU_NITSR register @@ -115,12 +130,16 @@ struct rzv2h_irqc_reg_cache { * @t_offs: TINT offset * @max_tssel: TSSEL max value * @field_width: TSSR field width + * @ecc_start: Start index of ECC RAM interrupts + * @ecc_end: End index of ECC RAM interrupts */ struct rzv2h_hw_info { const u8 *tssel_lut; u16 t_offs; u8 max_tssel; u8 field_width; + u8 ecc_start; + u8 ecc_end; }; =20 /* DMAC */ @@ -458,6 +477,37 @@ static int rzv2h_icu_swint_set_irqchip_state(struct ir= q_data *d, enum irqchip_ir guard(raw_spinlock)(&priv->lock); /* Trigger the software interrupt */ writel_relaxed(bit, priv->base + ICU_SWINT); + + return 0; +} + +static int rzv2h_icu_swpe_set_irqchip_state(struct irq_data *d, enum irqch= ip_irq_state which, + bool state) +{ + struct rzv2h_icu_priv *priv; + unsigned int bit; + static u8 swpe; + + if (which !=3D IRQCHIP_STATE_PENDING) + return irq_chip_set_parent_state(d, which, state); + + if (!state) + return 0; + + priv =3D irq_data_to_priv(d); + + bit =3D BIT(swpe); + /* + * SWPE has 16 bits; the bit position is rotated on each trigger + * and wraps around once all bits have been used. + */ + if (++swpe >=3D ICU_SWPE_NUM) + swpe =3D 0; + + guard(raw_spinlock)(&priv->lock); + /* Trigger the pseudo error interrupt */ + writel_relaxed(bit, priv->base + ICU_SWPE); + return 0; } =20 @@ -567,6 +617,23 @@ static const struct irq_chip rzv2h_icu_swint_chip =3D { IRQCHIP_SKIP_SET_WAKE, }; =20 +static const struct irq_chip rzv2h_icu_swpe_err_chip =3D { + .name =3D "rzv2h-icu", + .irq_eoi =3D irq_chip_eoi_parent, + .irq_mask =3D irq_chip_mask_parent, + .irq_unmask =3D irq_chip_unmask_parent, + .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 rzv2h_icu_swpe_set_irqchip_state, + .irq_retrigger =3D irq_chip_retrigger_hierarchy, + .irq_set_type =3D irq_chip_set_type_parent, + .irq_set_affinity =3D irq_chip_set_affinity_parent, + .flags =3D IRQCHIP_MASK_ON_SUSPEND | + IRQCHIP_SET_TYPE_MASKED | + IRQCHIP_SKIP_SET_WAKE, +}; + static int rzv2h_icu_alloc(struct irq_domain *domain, unsigned int virq, u= nsigned int nr_irqs, void *arg) { @@ -598,6 +665,8 @@ static int rzv2h_icu_alloc(struct irq_domain *domain, u= nsigned int virq, unsigne chip =3D &rzv2h_icu_irq_chip; } else if (hwirq >=3D ICU_CA55_INT_START && hwirq <=3D ICU_CA55_INT_LAST)= { chip =3D &rzv2h_icu_swint_chip; + } else if (hwirq >=3D ICU_ERR_INT_START && hwirq <=3D ICU_ERR_INT_LAST) { + chip =3D &rzv2h_icu_swpe_err_chip; } else { chip =3D &rzv2h_icu_nmi_chip; } @@ -635,6 +704,48 @@ static int rzv2h_icu_parse_interrupts(struct rzv2h_icu= _priv *priv, struct device return 0; } =20 +static irqreturn_t rzv2h_icu_error_irq(int irq, void *data) +{ + struct rzv2h_icu_priv *priv =3D data; + const struct rzv2h_hw_info *hw_info =3D priv->info; + void __iomem *base =3D priv->base; + unsigned int k; + u32 st; + + /* 1) Bus errors (BEISR0..3) */ + for (k =3D 0; k < ICU_NUM_BE; k++) { + st =3D readl(base + ICU_BEISR(k)); + if (!st) + continue; + + writel_relaxed(st, base + ICU_BECLR(k)); + pr_info("rzv2h-icu: BUS error k=3D%u status=3D0x%08x\n", k, st); + } + + /* 2) ECC RAM errors (EREISR0..X) */ + for (k =3D hw_info->ecc_start; k <=3D hw_info->ecc_end; k++) { + st =3D readl(base + ICU_EREISR(k)); + if (!st) + continue; + + writel_relaxed(st, base + ICU_ERCLR(k)); + pr_info("rzv2h-icu: ECC error k=3D%u status=3D0x%08x\n", k, st); + } + + /* 3) IP/CA55 error interrupt status (ERINTA55CTL0..3) */ + for (k =3D 0; k < ICU_NUM_A55ERR; k++) { + st =3D readl(base + ICU_ERINTA55CTL(k)); + if (!st) + continue; + + /* there is no relation with status bits so clear all the interrupts */ + writel_relaxed(0xffffffff, base + ICU_ERINTA55CRL(k)); + pr_info("rzv2h-icu: IP/CA55 error k=3D%u status=3D0x%08x\n", k, st); + } + + return IRQ_HANDLED; +} + static irqreturn_t rzv2h_icu_swint_irq(int irq, void *data) { u8 cpu =3D *(u8 *)data; @@ -645,12 +756,15 @@ static irqreturn_t rzv2h_icu_swint_irq(int irq, void = *data) =20 static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_d= omain *irq_domain) { + const struct rzv2h_hw_info *hw_info =3D rzv2h_icu_data->info; bool irq_inject =3D IS_ENABLED(CONFIG_GENERIC_IRQ_INJECTION); static const char * const rzv2h_swint_names[] =3D { "int-ca55-0", "int-ca55-1", "int-ca55-2", "int-ca55-3", }; + static const char *icu_err =3D "icu-error-ca55"; static const u8 swint_idx[] =3D { 0, 1, 2, 3 }; + void __iomem *base =3D rzv2h_icu_data->base; struct device *dev =3D &pdev->dev; struct irq_fwspec fwspec; unsigned int i, virq; @@ -676,6 +790,35 @@ static int rzv2h_icu_setup_irqs(struct platform_device= *pdev, struct irq_domain } } =20 + /* Unmask and clear all IP/CA55 error interrupts */ + for (i =3D 0; i < ICU_NUM_A55ERR; i++) { + writel_relaxed(0xffffff, base + ICU_ERINTA55CRL(i)); + writel_relaxed(0x0, base + ICU_ERINTA55MSK(i)); + } + + /* Clear all Bus errors */ + for (i =3D 0; i < ICU_NUM_BE; i++) + writel_relaxed(0xffffffff, base + ICU_BECLR(i)); + + /* Clear all ECCRAM errors */ + for (i =3D hw_info->ecc_start; i <=3D hw_info->ecc_end; i++) + writel_relaxed(0xffffffff, base + ICU_ERCLR(i)); + + fwspec.fwnode =3D irq_domain->fwnode; + fwspec.param_count =3D 2; + fwspec.param[0] =3D ICU_ERR_INT_START; + fwspec.param[1] =3D IRQ_TYPE_LEVEL_HIGH; + + virq =3D irq_create_fwspec_mapping(&fwspec); + if (!virq) { + return dev_err_probe(dev, -EINVAL, "failed to create IRQ mapping for %s\= n", + icu_err); + } + + ret =3D devm_request_irq(dev, virq, rzv2h_icu_error_irq, 0, dev_name(dev)= , rzv2h_icu_data); + if (ret) + return dev_err_probe(dev, ret, "Failed to request %s IRQ\n", icu_err); + return 0; } =20 @@ -780,12 +923,24 @@ static const struct rzv2h_hw_info rzg3e_hw_params =3D= { .t_offs =3D ICU_RZG3E_TINT_OFFSET, .max_tssel =3D ICU_RZG3E_TSSEL_MAX_VAL, .field_width =3D 16, + .ecc_start =3D 1, + .ecc_end =3D 4, +}; + +static const struct rzv2h_hw_info rzv2n_hw_params =3D { + .t_offs =3D 0, + .max_tssel =3D ICU_RZV2H_TSSEL_MAX_VAL, + .field_width =3D 8, + .ecc_start =3D 0, + .ecc_end =3D 2, }; =20 static const struct rzv2h_hw_info rzv2h_hw_params =3D { .t_offs =3D 0, .max_tssel =3D ICU_RZV2H_TSSEL_MAX_VAL, .field_width =3D 8, + .ecc_start =3D 0, + .ecc_end =3D 11, }; =20 static int rzg3e_icu_probe(struct platform_device *pdev, struct device_nod= e *parent) @@ -793,6 +948,11 @@ static int rzg3e_icu_probe(struct platform_device *pde= v, struct device_node *par return rzv2h_icu_probe_common(pdev, parent, &rzg3e_hw_params); } =20 +static int rzv2n_icu_probe(struct platform_device *pdev, struct device_nod= e *parent) +{ + return rzv2h_icu_probe_common(pdev, parent, &rzv2n_hw_params); +} + static int rzv2h_icu_probe(struct platform_device *pdev, struct device_nod= e *parent) { return rzv2h_icu_probe_common(pdev, parent, &rzv2h_hw_params); @@ -800,7 +960,7 @@ static int rzv2h_icu_probe(struct platform_device *pdev= , struct device_node *par =20 IRQCHIP_PLATFORM_DRIVER_BEGIN(rzv2h_icu) IRQCHIP_MATCH("renesas,r9a09g047-icu", rzg3e_icu_probe) -IRQCHIP_MATCH("renesas,r9a09g056-icu", rzv2h_icu_probe) +IRQCHIP_MATCH("renesas,r9a09g056-icu", rzv2n_icu_probe) IRQCHIP_MATCH("renesas,r9a09g057-icu", rzv2h_icu_probe) IRQCHIP_PLATFORM_DRIVER_END(rzv2h_icu) MODULE_AUTHOR("Fabrizio Castro "); --=20 2.53.0