From patchwork Wed Aug 9 16:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13348229 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 D6E7FC0015E for ; Wed, 9 Aug 2023 17:02:49 +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=JxB5zsr5pLesOy wKnQaGwa/GTiyp+CuIkLzfxSAxF5m0NLovQgBn68HA1nbNvy9PbSwbpL8jG3ysEwoH2vNmx7BOJLN /iKz18ySAMVyyBJ3oSLaF6tQLsuvkNZv63mifxD3Q111nokflgdUvg9aIOVnirluJ9B1HAS/fyw/P dHkjzQh0xNERY71Amn8XvejqWsTTj6SMYnSdo+D81Tz67sTbM+xUqjO3QU6AHYduKXBpF6JJDtC9M s846fcT4oT8manOMP0gO6MpsITRAsGnUZC28jIViw0zHUOrqAkvpqlTuYw8cB7j6o5narkC2XXs03 x65+vlPznk+yzCZAT37w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTmZf-005TMI-14; Wed, 09 Aug 2023 17:02:19 +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 1qTmZa-005TI9-0g for linux-arm-kernel@lists.infradead.org; Wed, 09 Aug 2023 17:02:15 +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 A29A56415A; Wed, 9 Aug 2023 17:02:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E6C6C433CC; Wed, 9 Aug 2023 17:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691600533; bh=2GxVXefyNbdQErExbmg0/pws/HcbyG4JyeKhzXvRnBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4FQ928xApvJhFE7Tj8KKEoOwWeAcsCs7IVHfjo54UzZhuYT+1/itilrbXbRAkTot aygKFrqatHRVmboBFOzHoObEJlmsElo6lDTz74RBj6An9R/fnCu2HlOwl2+RB6C1Tf +FLLxeQp+C5lGV8MtsdKsRV5EoxRSLGnzH8SGey+kA1k2KlB2z5OZRmvJg1260d3hR KJAWgfmAq2wIgT0c47FDz0u20m2QnpPLoqsa9KeRBLAyemWGdPr+b+RSi3plJ6z+Ke j1BtCa/bbeGCxRgRp0pyJZunGA1HUrosCZQPLTZJzOg/Hid0gOD1reZKA8wQ3ZDcNS 0Y4oJ9Gsm6AXQ== 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 v3 08/10] net: stmmac: platform: support parsing safety irqs from DT Date: Thu, 10 Aug 2023 00:50:05 +0800 Message-Id: <20230809165007.1439-9-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230809165007.1439-1-jszhang@kernel.org> References: <20230809165007.1439-1-jszhang@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230809_100214_292503_C6FC3C16 X-CRM114-Status: GOOD ( 11.11 ) 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 Acked-by: Alexandre TORGUE --- .../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);