Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2291926rwo; Sun, 23 Jul 2023 11:45:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEBehFuhMeyUI1KEknCrZ7OlX285hpxlLGnYrlKQdlTI/45mK3vsjC1jK67Kupdq3/92JFT X-Received: by 2002:aa7:db58:0:b0:522:2c9d:ef7a with SMTP id n24-20020aa7db58000000b005222c9def7amr547358edt.8.1690137924846; Sun, 23 Jul 2023 11:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690137924; cv=none; d=google.com; s=arc-20160816; b=ZuVAzeaFRmPwPYO5H+4tce+rgSP9Cx6geq83N81O5tK+ON/UjGy2nM6Ajzun7Ko6yo 7IH+rsYRq4IdUOenbnMEUToZW4ZWQph4nx+FkSMyb9SuxLnehMO6QWWPetgGU8MW7khc k2FFsk8pU1msGPbNy1BygJ7kV671gVJXXC05OwsF+yi1P8E7mcv2hVHHboEw9gAxIjAU K9Mw+9ycSBmYVISC1ZIL8ZbHRdpo4RQXnArme6NuOQNcApgXfjWM/0PxSHaJU2i2OL03 nu3TMwj9YovrczflZFf/uFzPQskAjgKuxRi9bEFcd4LBI4xWSKf/NjFWV5Pn1eTgN2by 12pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dOuZeRT5bAp0MH4mYogsEq4eOY3hFjMuVR2X/BItVfA=; fh=UEVvRAFK6gmZxZNnJDUC7AmNk/iU78fiWA23OmiDi44=; b=Nu7seUjGrh+eG9j4OALYFcUCs2OWLF1OASazteEamoX6TvIta/jYutvEGsNUyrnNYD JDoEy32dbyuOUExNsw2Poi9eIfzAAXhlhc+0NTYqp1fHc77GOm01KsxXjGOWV0Lv5MR0 BPMMsovpoXRHBgwo8jAdjpxGOp1+YBPGtIaLIefvrD9UrOnwhVGpQFYPIFbQqEAPTd6u ixlElE70ZdoH2Day3OAUsK7ErjdMiLYrrW4hiJ3gOdnseJTB2th1o5s8BU2YhiJiqQ+b IRgxRjFaZP7UII6m7eHVP/dXYK0CZ9Zvh15bc+7fPmf5O2sEO5J1yk42xjtUPtYOTyei /AOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tFSME35a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020aa7df0c000000b005222a620750si748958edy.326.2023.07.23.11.44.58; Sun, 23 Jul 2023 11:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tFSME35a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbjGWQXj (ORCPT + 99 others); Sun, 23 Jul 2023 12:23:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjGWQXh (ORCPT ); Sun, 23 Jul 2023 12:23:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 064D91BCE; Sun, 23 Jul 2023 09:23:08 -0700 (PDT) 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 8F1E460DE1; Sun, 23 Jul 2023 16:22:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B70DC433C7; Sun, 23 Jul 2023 16:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690129359; bh=MaxTaoMyyDWzQBV6I+FK3rgck7sS3ApGLGnjzW2cn+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tFSME35aBjT6vZDW9QtPvsJj3vL8Jw7DHgV+gZyPMXkzG4NSP4D+lrFRLSXwXtbL9 zdLu1VVnA4MommD+Zf4IYG8ybqdroqfL0UEeXaChihhkq5IOJrqF+dV09mhxRIkvIQ KADe5leCtMBc9JMgAoL/RJp4DMANuD+9UPpQsNRAhLwrFAak9Q9DbTi727MJs+zqu9 Agb90tdhpyPnoWI98JCyWYupXpOv3/Uht+kStuVUUCMOt0MOGDhpZsZoE8F0Yj9Fc7 fVJhKx/xsOhbU6PGnMwLcyIC11xZf7rILVaOT2WasdCXAMEMquADxvCRHhWlzSQOVP h8x5Nmhhp50hw== 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 08/10] net: stmmac: platform: support parsing safety irqs from DT Date: Mon, 24 Jul 2023 00:10:27 +0800 Message-Id: <20230723161029.1345-9-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230723161029.1345-1-jszhang@kernel.org> References: <20230723161029.1345-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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..e1b7a3fefd1a 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_irq"); + 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_irq"); + 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); -- 2.40.1