Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp2519518rdb; Fri, 18 Aug 2023 02:57:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFkdIQUV/pts5gH3zTnrhAB5iD1blJlqR7nzQ23j2rJShf3S9SIu6Jj2Z9hvGlV2NgaB7i X-Received: by 2002:a17:907:2bca:b0:992:b9f4:85db with SMTP id gv10-20020a1709072bca00b00992b9f485dbmr1562730ejc.39.1692352678375; Fri, 18 Aug 2023 02:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692352678; cv=none; d=google.com; s=arc-20160816; b=klLf8gXtZ9btTAxyv3Wo7KmohoycD2Q1yBKYasNucbZsGTpMSvivXnRR+ylFs+zH6Y nYpxTCErJeiHr/oGi9UucCRZ8akkgyd0/640/hnmSyeO1tLj37MDfvfe8far2K3upGBc 3ev2rzfb0sU9Hwn+lpWNFupvhjhPLexdaUEMfi+EQ0Nv9PMA8I3ZHlqvhgu6WYyIW47B GyHe7xPZmy7mmvSAzaf+LtSG/DvSQ8Ktiz0tpIQyE0R3YlzU4TYURLNaTZk5LaVx6/Tw yuCqECThB/nDQR3Hb4GVmGwYyn+bkqXBpWaoi5yJVv8kT9fUD1BM/CNUcySc4Fif8hP1 eYGQ== 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=UKqID6rm8oCeIZir75saVvNtQQrbVyFJePhzr5Cquqk=; fh=UEVvRAFK6gmZxZNnJDUC7AmNk/iU78fiWA23OmiDi44=; b=Wmcj7pkQRvr/LhjbPnUILWkrMeNeXL7n1dJNzSlymNSZvwYLLOmbrGlINo3heCLj/L UJTmvUlja0M86Hsa+TuthA60L9OWJLtgDBedl6CL+GIv5pvpsK6gGwZgLyvBBGwDQnZo eznKjQ7qeUiu4j7zEEDumcJ+a4fJ6OWSJOndSucgl33lLiLfg5moEwjh68AoHaRLUzf9 9Hw04ye/pPRNsnHG13jW6iM4xSOknIgMb0uyIR/sL33VDWMf0x0ixEE14PG1/DpZvFwV ZVtOP2rFO0zmPq6mIcsxD2u8f4M6Oz3ORNwbZyoezXTu6OE4h1czH1GtZYMNmu+ReMvQ huLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V8sQgiso; 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 n18-20020a170906089200b0099bc98fa022si990906eje.974.2023.08.18.02.57.34; Fri, 18 Aug 2023 02:57:58 -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=V8sQgiso; 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 S1344289AbjHPPmO (ORCPT + 99 others); Wed, 16 Aug 2023 11:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344219AbjHPPln (ORCPT ); Wed, 16 Aug 2023 11:41:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC6C426A6; Wed, 16 Aug 2023 08:41:42 -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 8A1EB65150; Wed, 16 Aug 2023 15:41:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFA46C433C7; Wed, 16 Aug 2023 15:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692200502; bh=kv75d6y4CuM21MoxPELNwCryPzdrLaz2U6/TZ1c2g/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V8sQgisoo15AHP3j6yHL9E3pgXFlue0Sq+NgZp1L8JyIfxnDSEteT6T+ROFOvk367 W6XX6TcGdPRX3GSu0ZlqjSwl8IBhmyd5f8TqJrHx/r+WaWuUoQHTY1/8Ag6I2LdUvB 6oTGcLA8h6UbSwMQJ03n+Mxfr4yHUiLKPxwKvADu48ifLdYwBam5eJPgZ64KuqhbT9 5tgtmhn7bRElDi+VvdpdHNyAY7kaCP9gHDSM5SX/wrILVJ2lSklRMGIWu5VG0CIWND 15C/PXB8sbhNotlqujxMS/y/HYYbQdp/He0lXm/NzSS5aogoaJimyfONRYRXkvIRDT gKsMlJoD2pIaA== 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 v4 7/9] net: stmmac: platform: support parsing safety irqs from DT Date: Wed, 16 Aug 2023 23:29:24 +0800 Message-Id: <20230816152926.4093-8-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230816152926.4093-1-jszhang@kernel.org> References: <20230816152926.4093-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 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 be8e79c7aa34..4a2002eea870 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -737,6 +737,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); -- 2.40.1