From patchwork Mon Aug 7 16:41:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13344602 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18412C001DB for ; Mon, 7 Aug 2023 16:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XYpYrgnMgKRbxsCGFouKKIz5zJXC1fDvHtPE/Gvlvhc=; b=31OVMAmIAu61OV JTt67MHZf7CTJdVnHwfvGCpAdrvLOsPviV976cTuz/9pp7pbivfJ3hYTxRCm02ZZfkCrDnNrlCfPc DyuJbX5AchR/Ksq0Yr6qRjS49w9kOwYGFjKf9gUiES/9fK3/Lxo0E4xZz4Rrk08S25N6uBVUlkVzK 3hnyXriBYLUJoN9+pBEwlZowO0kXdnOJ3sncjuEcDxR461BsRdbX7/6FYEGxClhhTAJEnkd3TNtGC OVIe1PFop7vyPVraRazqHgoipTEmEMMC2ys+16ctdAt+zaZL4GY2HumNwM12k2nmripv7g5ztJUaV 1VXYMj7WguihKSiaqIWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT3Uh-000Esz-1b; Mon, 07 Aug 2023 16:54:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qT3Ua-000En2-0j for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 16:54:07 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BE4A861FA0; Mon, 7 Aug 2023 16:54:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60A18C433C8; Mon, 7 Aug 2023 16:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691427243; bh=2GxVXefyNbdQErExbmg0/pws/HcbyG4JyeKhzXvRnBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=isNPA8VjsZLDLmk3teiuHGbXo4lE9uRIceVNL+NUBpMZljoqr0M2pYuIKf4nMpvxE VAqO3uRfxyTjsDvb6kDq+ERekznq4fiUU6yDdP6is/OzJE/OWat0MKryk0g/rzMh6T mZCDRUCKZ/vf62PQu9T+uUEgR7Cq5z2Pbk6quX9fgRzdRYiuTzfugYpM+GW3tL/vQF fkjcTJSK/Ar/a/ogARUGLBJUof6J33LRFi8ThH4WTvjnR9/A0rdCD9jxsCqaBF8YGd lFfx0H971y3hIDT46KdB/veZgNv4n5M9euSfpeH7a4KC1HpLyJ1+zc3Bw8Ri3Nrl3x 9XHLXYDZIL/Ig== From: Jisheng Zhang To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v2 08/10] net: stmmac: platform: support parsing safety irqs from DT Date: Tue, 8 Aug 2023 00:41:49 +0800 Message-Id: <20230807164151.1130-9-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230807164151.1130-1-jszhang@kernel.org> References: <20230807164151.1130-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_095404_309481_8F6B2679 X-CRM114-Status: GOOD ( 10.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The snps dwmac IP may support safety features, and those Safety Feature Correctible Error and Uncorrectible Error irqs may be separate irqs. Add support to parse the safety irqs from DT. Signed-off-by: Jisheng Zhang --- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..29145682b57b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -738,6 +738,18 @@ int stmmac_get_platform_resources(struct platform_device *pdev, dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); } + stmmac_res->sfty_ce_irq = platform_get_irq_byname_optional(pdev, "sfty_ce"); + if (stmmac_res->sfty_ce_irq < 0) { + if (stmmac_res->sfty_ce_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + + stmmac_res->sfty_ue_irq = platform_get_irq_byname_optional(pdev, "sfty_ue"); + if (stmmac_res->sfty_ue_irq < 0) { + if (stmmac_res->sfty_ue_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0); return PTR_ERR_OR_ZERO(stmmac_res->addr);