From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05463370F9; Fri, 16 Jan 2026 02:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529364; cv=none; b=Ros1lJ578qj7nAT2GHSQBcb315MA9WgCXWGJqT9A5u3hKZQDT2ps7ejeAI35LXIrohbw05Te+HpAB8R1RPJ3q1S4koGS23CbrG4U8dz4pPuUTzwee3PjPr0LOmvnGh0DBMcS4T1TTeA4G6yUGVooPDne7CKRQ+B3zAFrI65NjDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529364; c=relaxed/simple; bh=rPxIS+uhUzsKBY2yjgyhHwqeU3SRBIHj4tyBgoBhwGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=dhm3VuV0Newai4qF4NALzqCK3ph+frqsEwjSYS0frStRkrfENuU6kHr0O373VlwZQ4tENtRql8M8UUHzTKtZD4I80dBuY30VyDR0qP8njwgxJyM5ifgxC6xoBtVyhUA1oMfHcOVIZXqTAgZ8upawmw4txGN5/qDAiokiGYYlPyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:15 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:15 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:12 +0800 Subject: [PATCH net-next v2 01/15] net: ftgmac100: List all compatibles Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-1-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=912; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=VB5Hr6O+hVDiNqHf4IWzXWWPmq/hUMTRLmT1UTc/XL8=; b=DIsYhZC6fluAzuT+9OWl9PRKCBs1z1c832YUnagRjFo2fmLdCTCMwDbGv9qcJVNEEtZwFMEi+ E60TRM8mzSCA3nZNofLbnK6PNQlTlwZfjXupXSDJ1UY6sA2IgadHvz1 X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn As a step towards cleanup the probe function, list each compatible the driver supports. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index a863f7841210..bd768a93b9e6 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -2091,6 +2091,9 @@ static void ftgmac100_remove(struct platform_device *= pdev) } =20 static const struct of_device_id ftgmac100_of_match[] =3D { + { .compatible =3D "aspeed,ast2400-mac" }, + { .compatible =3D "aspeed,ast2500-mac" }, + { .compatible =3D "aspeed,ast2600-mac" }, { .compatible =3D "faraday,ftgmac100" }, { } }; --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C317B337117; Fri, 16 Jan 2026 02:09:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529371; cv=none; b=R5lwUrckO/StOEYYWBP0Ml7mzne0EnYX5ibMBKHBJIbPZgb3Ecno4NMny6oSqBYV5Ci0zTIKzZeyX+IPJQn439R7YcY+Uqy51OvqXHLIhkrGgplEPO2JL3FwzHJQUyQ1w9gVso+dznXv6oTYHxOyXR/93oSBvoJ6b1u/SLhW27Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529371; c=relaxed/simple; bh=TvPvwgbTpwSpyw/7g9BTYt5lpmiQYEi+FH4stMJoeMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=DVPhxuXFayzpvhOZlIgTtAfjo2j7EOjvSXpt3Zzqoa4qk/IB9SK7X8jlDVg6cvcGlQLZ+UtpJa8Zh2GaHMIyuatIe3B0SeEro0+PMSYCPnzPG3lnSr+yb56xrfFcxzDr88mS4UeZ0kw/MP1pguC7QoGrHYGZ5VYv2zo40rL4Eao= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:15 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:15 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:13 +0800 Subject: [PATCH net-next v2 02/15] net: ftgmac100: Add match data containing MAC ID Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-2-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=3993; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=NVi1QwkA7JxwSCPAVjGjUYu41AXXsXEhvfrBSk1vf/A=; b=e48iXDbbGCPW0jCYapnoGofVU2pnuUMOnVQ5fMRVimjk4qRKbKfX6O7TMohJ0wV9JtHYbThgA BTOGPSkYR2hCMiBUxo7rRnB9jWs297UlaK23GztfZ7uCdOE3YCqASVs X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn The driver supports 4 different versions of the FTGMAC core. Extend the compatible matching to include match data, which indicates the version of the MAC. Default to the initial Faraday device if DT is not being used. Lookup the match data early in probe to keep error handing simple. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 55 ++++++++++++++++++++++++++++= +--- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index bd768a93b9e6..104eb7b1f5bb 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -33,6 +33,17 @@ =20 #define DRV_NAME "ftgmac100" =20 +enum ftgmac100_mac_id { + FTGMAC100_FARADAY =3D 1, + FTGMAC100_AST2400, + FTGMAC100_AST2500, + FTGMAC100_AST2600 +}; + +struct ftgmac100_match_data { + enum ftgmac100_mac_id mac_id; +}; + /* Arbitrary values, I am not sure the HW has limits */ #define MAX_RX_QUEUE_ENTRIES 1024 #define MAX_TX_QUEUE_ENTRIES 1024 @@ -66,6 +77,8 @@ struct ftgmac100 { struct resource *res; void __iomem *base; =20 + enum ftgmac100_mac_id mac_id; + /* Rx ring */ unsigned int rx_q_entries; struct ftgmac100_rxdes *rxdes; @@ -1835,6 +1848,8 @@ static bool ftgmac100_has_child_node(struct device_no= de *np, const char *name) =20 static int ftgmac100_probe(struct platform_device *pdev) { + const struct ftgmac100_match_data *match_data; + enum ftgmac100_mac_id mac_id; struct resource *res; int irq; struct net_device *netdev; @@ -1843,6 +1858,16 @@ static int ftgmac100_probe(struct platform_device *p= dev) struct device_node *np; int err =3D 0; =20 + np =3D pdev->dev.of_node; + if (np) { + match_data =3D of_device_get_match_data(&pdev->dev); + if (!match_data) + return -EINVAL; + mac_id =3D match_data->mac_id; + } else { + mac_id =3D FTGMAC100_FARADAY; + } + res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENXIO; @@ -1870,6 +1895,7 @@ static int ftgmac100_probe(struct platform_device *pd= ev) priv =3D netdev_priv(netdev); priv->netdev =3D netdev; priv->dev =3D &pdev->dev; + priv->mac_id =3D mac_id; INIT_WORK(&priv->reset_task, ftgmac100_reset_task); =20 /* map io memory */ @@ -1900,7 +1926,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) if (err) goto err_phy_connect; =20 - np =3D pdev->dev.of_node; if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac") || of_device_is_compatible(np, "aspeed,ast2500-mac") || of_device_is_compatible(np, "aspeed,ast2600-mac"))) { @@ -2090,11 +2115,31 @@ static void ftgmac100_remove(struct platform_device= *pdev) free_netdev(netdev); } =20 +static const struct ftgmac100_match_data ftgmac100_match_data_ast2400 =3D { + .mac_id =3D FTGMAC100_AST2400 +}; + +static const struct ftgmac100_match_data ftgmac100_match_data_ast2500 =3D { + .mac_id =3D FTGMAC100_AST2500 +}; + +static const struct ftgmac100_match_data ftgmac100_match_data_ast2600 =3D { + .mac_id =3D FTGMAC100_AST2600 +}; + +static const struct ftgmac100_match_data ftgmac100_match_data_faraday =3D { + .mac_id =3D FTGMAC100_FARADAY +}; + static const struct of_device_id ftgmac100_of_match[] =3D { - { .compatible =3D "aspeed,ast2400-mac" }, - { .compatible =3D "aspeed,ast2500-mac" }, - { .compatible =3D "aspeed,ast2600-mac" }, - { .compatible =3D "faraday,ftgmac100" }, + { .compatible =3D "aspeed,ast2400-mac", + .data =3D &ftgmac100_match_data_ast2400}, + { .compatible =3D "aspeed,ast2500-mac", + .data =3D &ftgmac100_match_data_ast2500 }, + { .compatible =3D "aspeed,ast2600-mac", + .data =3D &ftgmac100_match_data_ast2600 }, + { .compatible =3D "faraday,ftgmac100", + .data =3D &ftgmac100_match_data_faraday }, { } }; MODULE_DEVICE_TABLE(of, ftgmac100_of_match); --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D9843375A0; Fri, 16 Jan 2026 02:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529373; cv=none; b=ZD3tuOlBV/woRJggBKa2Iosss5QRj59yHwaC/LfQQmSnKVyLiKGN2vdo61Ez6PdGev5UEF6fhiLXbuhURNLZJ0O2S53AxVVsG554VwpTgdj/eUDtDLxHnHi+ys3I3RQZh9bilSCB6kadNUV1A6UdqWM/i81m92tpxmFXwgPRXKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529373; c=relaxed/simple; bh=1bEa2Jv/bTv7bHrcPfXv9ul57tdtU4FVmXDJgJry74s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=V80j7JfxeCJJEda+Z/SKFuudU0LKu+1OrKN1brgfBg2rhxruLFesgrMll8MYwid5ujn7Kit5csIAs2dY6+h8vfJB9L/Ow0IFlvHVgzSNygqfvWVIrn5rcafQKou0Jeb2qBnTlgl9VEvAcDELvJSPgSkJn5GDmszDF4DLpMYM+DU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:15 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:15 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:14 +0800 Subject: [PATCH net-next v2 03/15] net: ftgmac100: Replace all of_device_is_compatible() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-3-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=3130; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=+aILZO8pus/3meVrNzurjk9uWwwKRISZWHJRBZ3qWxI=; b=kNuHqI1db8zTlIuaxe2mfcKEyi4Kk0RdJocFJz3O9oggj25IpW4jIjQrox/okmfwVGd2P4NRU 2MuE9izUYNcCJ3D4pBP7+57KVV7Q7xTZE8ieKa9jmdwmuMnz0pZgmuc X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Now that the priv structure includes the MAC ID, make use of it instead of the more expensive of_device_is_compatible(). Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 104eb7b1f5bb..f07167cabf39 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1720,8 +1720,8 @@ static int ftgmac100_setup_mdio(struct net_device *ne= tdev) if (!priv->mii_bus) return -EIO; =20 - if (of_device_is_compatible(np, "aspeed,ast2400-mac") || - of_device_is_compatible(np, "aspeed,ast2500-mac")) { + if (priv->mac_id =3D=3D FTGMAC100_AST2400 || + priv->mac_id =3D=3D FTGMAC100_AST2500) { /* The AST2600 has a separate MDIO controller */ =20 /* For the AST2400 and AST2500 this driver only supports the @@ -1926,9 +1926,9 @@ static int ftgmac100_probe(struct platform_device *pd= ev) if (err) goto err_phy_connect; =20 - if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac") || - of_device_is_compatible(np, "aspeed,ast2500-mac") || - of_device_is_compatible(np, "aspeed,ast2600-mac"))) { + if (priv->mac_id =3D=3D FTGMAC100_AST2400 || + priv->mac_id =3D=3D FTGMAC100_AST2500 || + priv->mac_id =3D=3D FTGMAC100_AST2600) { priv->rxdes0_edorr_mask =3D BIT(30); priv->txdes0_edotr_mask =3D BIT(30); priv->is_aspeed =3D true; @@ -1973,8 +1973,8 @@ static int ftgmac100_probe(struct platform_device *pd= ev) * available PHYs and register them. */ if (of_get_property(np, "phy-handle", NULL) && - (of_device_is_compatible(np, "aspeed,ast2400-mac") || - of_device_is_compatible(np, "aspeed,ast2500-mac"))) { + (priv->mac_id =3D=3D FTGMAC100_AST2400 || + priv->mac_id =3D=3D FTGMAC100_AST2500)) { err =3D ftgmac100_setup_mdio(netdev); if (err) goto err_setup_mdio; @@ -2026,7 +2026,7 @@ static int ftgmac100_probe(struct platform_device *pd= ev) goto err_phy_connect; =20 /* Disable ast2600 problematic HW arbitration */ - if (of_device_is_compatible(np, "aspeed,ast2600-mac")) + if (priv->mac_id =3D=3D FTGMAC100_AST2600) iowrite32(FTGMAC100_TM_DEFAULT, priv->base + FTGMAC100_OFFSET_TM); } @@ -2044,11 +2044,11 @@ static int ftgmac100_probe(struct platform_device *= pdev) netdev->hw_features |=3D NETIF_F_HW_VLAN_CTAG_FILTER; =20 /* AST2400 doesn't have working HW checksum generation */ - if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac"))) + if (priv->mac_id =3D=3D FTGMAC100_AST2400) netdev->hw_features &=3D ~NETIF_F_HW_CSUM; =20 /* AST2600 tx checksum with NCSI is broken */ - if (priv->use_ncsi && of_device_is_compatible(np, "aspeed,ast2600-mac")) + if (priv->use_ncsi && priv->mac_id =3D=3D FTGMAC100_AST2600) netdev->hw_features &=3D ~NETIF_F_HW_CSUM; =20 if (np && of_get_property(np, "no-hw-checksum", NULL)) --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5094433711D; Fri, 16 Jan 2026 02:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529385; cv=none; b=eqQK0i3JR9JLLAD2LR4H5kZxIDczAeC3qk1uij1jKNTmN91NCL44rG+WSBsKNX1rV5cI4Kf8DzBgEZsrJLZ16qK3ziwEF2zQ7HfQ2StAms7gYxl5YqXuw+mQFklunfJLMHlL0s5/VxV1mVji/RNk4vobM1Yfo5+rMzLUum0fnoQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529385; c=relaxed/simple; bh=onLWbZUbnTMgDK4y8kzfyvlIWWGQE8LKDFBj5Fq38Dw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=FpbV9/qXnzNg4ayyfsT8l3zXMPCPG3u60fN+iCr2C15bTwc7TZdbzUZhhkM/GnwpUJS0JVPVGn+UwZiav9DJHBfLTx2SWioEhoqzwqSAAZtuU7K/Po23foKss0QcnpTMA9Gbea4Di4ZdeSFRLzRwCYMBnYDx1B1LpeOg9AUoCSw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:15 +0800 Subject: [PATCH net-next v2 04/15] net: ftgmac100: Use devm_alloc_etherdev() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-4-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1418; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=o3nIYAscEW7qqYCVm0zoQKSDXM36iO60MZ4R096iN0U=; b=gic25JcS3eBRR4XpdIuoBtLiVRLFnVJIo6qqo6u3jTa7qYLyGni7IJCvlYmWQXwoFzavWVKUJ 1CEbj7ITmZzDgq1DBrXJ7VJQXExC+D3dBEcLZTfm3ucTPa/YQJ261Wn X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Make use of devm_alloc_etherdev() to simplify cleanup. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index f07167cabf39..397ada43c851 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1877,11 +1877,9 @@ static int ftgmac100_probe(struct platform_device *p= dev) return irq; =20 /* setup net_device */ - netdev =3D alloc_etherdev(sizeof(*priv)); - if (!netdev) { - err =3D -ENOMEM; - goto err_alloc_etherdev; - } + netdev =3D devm_alloc_etherdev(&pdev->dev, sizeof(*priv)); + if (!netdev) + return -ENOMEM; =20 SET_NETDEV_DEV(netdev, &pdev->dev); =20 @@ -2080,8 +2078,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) err_ioremap: release_resource(priv->res); err_req_mem: - free_netdev(netdev); -err_alloc_etherdev: return err; } =20 @@ -2112,7 +2108,6 @@ static void ftgmac100_remove(struct platform_device *= pdev) release_resource(priv->res); =20 netif_napi_del(&priv->napi); - free_netdev(netdev); } =20 static const struct ftgmac100_match_data ftgmac100_match_data_ast2400 =3D { --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2611A9B58; Fri, 16 Jan 2026 02:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529390; cv=none; b=IfPirTQO/g92EoTzhTQXV2o8I2wd4WOpQiUGnrXw6pFX8UaOuVdiTjpxZW8mG/kNT5PkYG5CTBGVs1sQfTmoUN/xweXtmq9CfoSGfocNQGtHjpopuWvroyeHhEo4U4IHQ2RmDerBLkv93VUqaHA2ACHw0pVSWDLtRgnyy9NCqok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529390; c=relaxed/simple; bh=ceYR9uOBjSpJRI2oiBkcEl1sbI98TqqWni7uo64dK5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=SBO+91oFyc76Uowlz2MjIx4/QE/SVUqhGbwMS7IPQZbRIBjlQz4lTliXzL6YQIyKkmMZazpBpHRj/8h8PANvjLBBaQPMCAbfB374NH9XLTeKZEw91bG+nuAe+MWKwj2X9fDVrAQFyL9vLzOjt1AkrhpfsLvYcJIn1GJ2y3s8TPs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:16 +0800 Subject: [PATCH net-next v2 05/15] net: ftgmac100: Use devm_request_memory_region/devm_ioremap Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-5-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1997; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=PabSzzWHuOc4GjJAVT/Ar4WEHvlB1Z2Il9a4L8Pq5xY=; b=e50iy8w0hUrONRONSFVlnTOtxD4+IvKD9Tv2k7mE3MSOt/y6nKuzH6zkdJtDM9m3VEm6y60jx CTaPi0Q1qLgDBJjH6czi6zANYVtVHD6sY1KDilJru2dc/Ul2LKBKFuK X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Make use of devm_ methods to request and remap the device memory to simplify cleanup. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 397ada43c851..ec2e7ec23ddf 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1897,19 +1897,18 @@ static int ftgmac100_probe(struct platform_device *= pdev) INIT_WORK(&priv->reset_task, ftgmac100_reset_task); =20 /* map io memory */ - priv->res =3D request_mem_region(res->start, resource_size(res), - dev_name(&pdev->dev)); + priv->res =3D devm_request_mem_region(&pdev->dev, + res->start, resource_size(res), + dev_name(&pdev->dev)); if (!priv->res) { dev_err(&pdev->dev, "Could not reserve memory region\n"); - err =3D -ENOMEM; - goto err_req_mem; + return -ENOMEM; } =20 - priv->base =3D ioremap(res->start, resource_size(res)); + priv->base =3D devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!priv->base) { dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); - err =3D -EIO; - goto err_ioremap; + return -EIO; } =20 netdev->irq =3D irq; @@ -2074,10 +2073,6 @@ static int ftgmac100_probe(struct platform_device *p= dev) ncsi_unregister_dev(priv->ndev); ftgmac100_destroy_mdio(netdev); err_setup_mdio: - iounmap(priv->base); -err_ioremap: - release_resource(priv->res); -err_req_mem: return err; } =20 @@ -2104,9 +2099,6 @@ static void ftgmac100_remove(struct platform_device *= pdev) ftgmac100_phy_disconnect(netdev); ftgmac100_destroy_mdio(netdev); =20 - iounmap(priv->base); - release_resource(priv->res); - netif_napi_del(&priv->napi); } =20 --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7213A3376AC; Fri, 16 Jan 2026 02:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529391; cv=none; b=nxR1H5MZcRfRjFn2XTxF/tWVPAgeUfY5bKSjDtsEvtF8PgO5TTqavpDFhkZDpxXJ7j1+zaXLGx83DbtvlutIQNJ9nPjnMncbG/q6h5R4C8psunAd2zLizGKe169G91yqnJTddlCunigxKmiAQQuu4jlv3NqVOwiWD+gyomwlets= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529391; c=relaxed/simple; bh=9iCpxK+Eb09lY6J+9aTSjzN4z/IKyGnhqL9GcVBL8lY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Usfry3W46ZU4w8lmdDUP3QHX+mKuAVkpl4u32g42bURJOv6s9vWoAUjjA+3QB1UTUO6J88XWabvdbINBUq03pa5aJ5dI4grbsXCBZuJvpdo4Fk1XflgjlMJJkBRouZD5f9JXFxvBNi5ACbFDLppp+YjE7u9u7kphBDjuZGvHN3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:17 +0800 Subject: [PATCH net-next v2 06/15] net: ftgmac100: Use devm_clk_get_enabled Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-6-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=2532; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=xlLWrYwSQCrHbDp7aRF7GiAbECblejQV2x9B48pYe9U=; b=geV3y6qS6gc1QJ/mZCLpLVfoOaQKBX1qKgMz6abSe+J+10jMYj7XoLDgy7ba6CxAJTm4ggIDw 4W6Got+vIq5Blk/VQChYVwrO5lzOUGwfvNjG/lpUcZoogkqAsR4pbMQ X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Make use of devm_ methods to request and enable clocks to simplify cleanup. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index ec2e7ec23ddf..ffd86655bcc8 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1801,13 +1801,10 @@ static int ftgmac100_setup_clk(struct ftgmac100 *pr= iv) struct clk *clk; int rc; =20 - clk =3D devm_clk_get(priv->dev, NULL /* MACCLK */); + clk =3D devm_clk_get_enabled(priv->dev, NULL /* MACCLK */); if (IS_ERR(clk)) return PTR_ERR(clk); priv->clk =3D clk; - rc =3D clk_prepare_enable(priv->clk); - if (rc) - return rc; =20 /* Aspeed specifies a 100MHz clock is required for up to * 1000Mbit link speeds. As NCSI is limited to 100Mbit, 25MHz @@ -1816,21 +1813,15 @@ static int ftgmac100_setup_clk(struct ftgmac100 *pr= iv) rc =3D clk_set_rate(priv->clk, priv->use_ncsi ? FTGMAC_25MHZ : FTGMAC_100MHZ); if (rc) - goto cleanup_clk; + return rc; =20 /* RCLK is for RMII, typically used for NCSI. Optional because it's not * necessary if it's the AST2400 MAC, or the MAC is configured for * RGMII, or the controller is not an ASPEED-based controller. */ - priv->rclk =3D devm_clk_get_optional(priv->dev, "RCLK"); - rc =3D clk_prepare_enable(priv->rclk); - if (!rc) - return 0; + priv->rclk =3D devm_clk_get_optional_enabled(priv->dev, "RCLK"); =20 -cleanup_clk: - clk_disable_unprepare(priv->clk); - - return rc; + return 0; } =20 static bool ftgmac100_has_child_node(struct device_node *np, const char *n= ame) @@ -2064,8 +2055,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) return 0; =20 err_register_netdev: - clk_disable_unprepare(priv->rclk); - clk_disable_unprepare(priv->clk); err_phy_connect: ftgmac100_phy_disconnect(netdev); err_ncsi_dev: @@ -2088,9 +2077,6 @@ static void ftgmac100_remove(struct platform_device *= pdev) ncsi_unregister_dev(priv->ndev); unregister_netdev(netdev); =20 - clk_disable_unprepare(priv->rclk); - clk_disable_unprepare(priv->clk); - /* There's a small chance the reset task will have been re-queued, * during stop, make sure it's gone before we free the structure. */ --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F2B91A9B58; Fri, 16 Jan 2026 02:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529393; cv=none; b=HCBqcqBaSH1y1fpc+0FwJqtCu2nsO9DwkRSTgNzc60tSScXtP7mJROsG/MjXlDTYmTVCzg9uejlXbMuotEtLXura/5iCSqx3Q47EnFbp4OsPEzsyuvZ7jxZv8zmh+54Nwmg6pB8gWo+WuArWcysEs4Ckoi0K5o+LijPFUvdXzzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529393; c=relaxed/simple; bh=xH6fYjFLYrj9T4Zssm8L2SOBS9UFZxiecwVla7SSNlQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=LLRM7D4Ez31SEODKWPOWIHnl5/I5tcJKDjvYZDq4NzMxe+PSsFGwXm4rmckCSqQauXl6spvFLB990g7Pi2jj/72BTMGgol7FvWgGdO8CTsOlWJhK2dC8je9wMfSlLl968ZA/K2axVzo34cssr0u0TQtygNyHdD/uIma65Qry3WY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:18 +0800 Subject: [PATCH net-next v2 07/15] net: ftgmac100: Simplify error handling for ftgmac100_initial_mac Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-7-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1005; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=Imv9CaCbsjW/yCYSl/UPIG/NQCG6R8NUnI71OzZI5CA=; b=aHWAWOh6nvZMpy8QlQFLIf2upSDN4Vy8kFQw/NlLpKcYEV52Csi48IEO8EhniOxg5GBYKLQ+R VZxf1/7RdvXDqy64qCNsVbRv+oxoHAXgm3dbEu/LJsSU6UxkIXqqhC1 X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn ftgmac100_initial_mac() does not allocate any resources. All resources by the probe function up until this call point use devm_ methods. So just return the error code rather than use a goto. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index ffd86655bcc8..3bccf34cc8a4 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1912,7 +1912,7 @@ static int ftgmac100_probe(struct platform_device *pd= ev) /* MAC address from chip or random one */ err =3D ftgmac100_initial_mac(priv); if (err) - goto err_phy_connect; + return err; =20 if (priv->mac_id =3D=3D FTGMAC100_AST2400 || priv->mac_id =3D=3D FTGMAC100_AST2500 || --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7C49338F20; Fri, 16 Jan 2026 02:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529405; cv=none; b=hL3jEh8Uy1XseU0ybsIMYxiE0oOaIHHpzXgXDLhJaiCpZFT+iKKIrkdNP/iIGpti2VWJul9q5ul3SiHBuSOzQ3fE0TOzLfIL7mqdPI0QG89zA5xo2nJ6K9VjXpQQfaNNxRpYcl+9xmr2ZRSKXwxghJ3Bl8bUSdYzi8rRkajqscI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529405; c=relaxed/simple; bh=d9aiaUKT+SF2C1xDFYAlMbp+rT/1oiUBLwArsg5vnEA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=fYixqVU/ljOUusWTN1n8u3YUkJOOWCDu3Reg0mjuQ6AUPjt6UeZ1Um8I2GUzEf7ewQoHyh/trULfhgHNJukDPbYtH9JImC7xQFA1VrRxBuEExTPq0p0SqY3XvBnR2cTT3pYYR6kmejfwLATPQD93AAKDnno4iT1S9AkiGwT3rGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:19 +0800 Subject: [PATCH net-next v2 08/15] net: ftgmac100: Move NCSI probe code into a helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-8-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=3233; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=PWRfmKe6YTLsSE6Y3HPpHPyzMAq4PFGJ6scrfjyi5Sc=; b=hk72WiTdc1NgqBiLPUvZmNOAJaejC5SHa2s8vlJ0GSVR0Y2ZM1scOWs8cHSLU77HzwIfNnVHt 3AvPQPe95lfBYqvBomv/dZClV8uJOTHiymZXJc2loLhMvxHCjB11dta X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn To help reduce the complexity of the probe function move the NCSI probe code into a helper. No functional change intended. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 63 ++++++++++++++++++----------= ---- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 3bccf34cc8a4..f1cb5dc37919 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1837,6 +1837,39 @@ static bool ftgmac100_has_child_node(struct device_n= ode *np, const char *name) return ret; } =20 +static int ftgmac100_probe_ncsi(struct net_device *netdev, + struct ftgmac100 *priv, + struct platform_device *pdev) +{ + struct device_node *np =3D pdev->dev.of_node; + struct phy_device *phydev; + int err; + + if (!IS_ENABLED(CONFIG_NET_NCSI)) { + dev_err(&pdev->dev, "NCSI stack not enabled\n"); + return -EINVAL; + } + + dev_info(&pdev->dev, "Using NCSI interface\n"); + priv->use_ncsi =3D true; + priv->ndev =3D ncsi_register_dev(netdev, ftgmac100_ncsi_handler); + if (!priv->ndev) + return -EINVAL; + + phydev =3D fixed_phy_register(&ncsi_phy_status, np); + if (IS_ERR(phydev)) { + dev_err(&pdev->dev, "failed to register fixed PHY device\n"); + return PTR_ERR(phydev); + } + err =3D phy_connect_direct(netdev, phydev, ftgmac100_adjust_link, + PHY_INTERFACE_MODE_RMII); + if (err) { + dev_err(&pdev->dev, "Connecting PHY failed\n"); + fixed_phy_unregister(phydev); + } + return err; +} + static int ftgmac100_probe(struct platform_device *pdev) { const struct ftgmac100_match_data *match_data; @@ -1844,7 +1877,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) struct resource *res; int irq; struct net_device *netdev; - struct phy_device *phydev; struct ftgmac100 *priv; struct device_node *np; int err =3D 0; @@ -1926,32 +1958,9 @@ static int ftgmac100_probe(struct platform_device *p= dev) } =20 if (np && of_get_property(np, "use-ncsi", NULL)) { - if (!IS_ENABLED(CONFIG_NET_NCSI)) { - dev_err(&pdev->dev, "NCSI stack not enabled\n"); - err =3D -EINVAL; - goto err_phy_connect; - } - - dev_info(&pdev->dev, "Using NCSI interface\n"); - priv->use_ncsi =3D true; - priv->ndev =3D ncsi_register_dev(netdev, ftgmac100_ncsi_handler); - if (!priv->ndev) { - err =3D -EINVAL; - goto err_phy_connect; - } - - phydev =3D fixed_phy_register(&ncsi_phy_status, np); - if (IS_ERR(phydev)) { - dev_err(&pdev->dev, "failed to register fixed PHY device\n"); - err =3D PTR_ERR(phydev); - goto err_phy_connect; - } - err =3D phy_connect_direct(netdev, phydev, ftgmac100_adjust_link, - PHY_INTERFACE_MODE_RMII); - if (err) { - dev_err(&pdev->dev, "Connecting PHY failed\n"); - goto err_phy_connect; - } + err =3D ftgmac100_probe_ncsi(netdev, priv, pdev); + if (err) + goto err_setup_mdio; } else if (np && (of_phy_is_fixed_link(np) || of_get_property(np, "phy-handle", NULL))) { struct phy_device *phy; --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4CA03376AC; Fri, 16 Jan 2026 02:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529407; cv=none; b=Crkb/pQ3LfTTJCr+4pv/gMpicNEUJyLQMXp/z0+gZoYm7+ZJC5R280SP4rHjmrAjGGFC4ctGLzEDgrKfRcvyEc42PgD/ozZAqzb7540yEMfkX+sjRi7/wHdFPcrV4h+Dgu0fyAEMF9PBQjUlfKRmcWK0yv/eBSnxMoRqryg1YY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529407; c=relaxed/simple; bh=8ZKQRYwxqb4uYhpPL+/18dXxqFZ15mvf3pgcRd+jy+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=GY3ZhCVdhnoOLxKz25WwryCk8/Wr98E0xSJ4VRk7nhb2oJE12Nx3RvWLN3w6gGb+hA7uQij6WjM0MOX1ClTvHbDxeCi1KH/h5EYevkkuRe0R9K1SyUjQARAit91cuMsDLuN2cz9uEopC1BhIiu6zUICMGGP/xYhZyCLLitMbhQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:20 +0800 Subject: [PATCH net-next v2 09/15] net: ftgmac100: Always register the MDIO bus when it exists Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-9-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=2265; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=3PMubt3+ZvyhKE+J/WvKsCqfbMgClicHATDmtsAfaJM=; b=Y38++rgU7d5R+MLPLp97cyO4maqXyZClX/c8MDB5KhX2H0ZbM99gc+9tHCWvz0o5F4zXMH/jS YW2buwKj4C9ADrkz6UAvoGkejzRktwArt5c9nn4orQFUk8sGK5/PMDv X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn Both the Aspeed 2400 and 2500 and the original faraday version of the MAC have MDIO bus controllers as part of the MAC. Since it exists, always registering it makes the code simpler, and causes no harm. If there is no mdio node in device tree, of_mdiobus_register() will fall back to mdiobus_register(), making it safe. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index f1cb5dc37919..931fdf3d07d1 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1957,6 +1957,14 @@ static int ftgmac100_probe(struct platform_device *p= dev) priv->txdes0_edotr_mask =3D BIT(15); } =20 + if (priv->mac_id =3D=3D FTGMAC100_FARADAY || + priv->mac_id =3D=3D FTGMAC100_AST2400 || + priv->mac_id =3D=3D FTGMAC100_AST2500) { + err =3D ftgmac100_setup_mdio(netdev); + if (err) + goto err_phy_connect; + } + if (np && of_get_property(np, "use-ncsi", NULL)) { err =3D ftgmac100_probe_ncsi(netdev, priv, pdev); if (err) @@ -1965,18 +1973,6 @@ static int ftgmac100_probe(struct platform_device *p= dev) of_get_property(np, "phy-handle", NULL))) { struct phy_device *phy; =20 - /* Support "mdio"/"phy" child nodes for ast2400/2500 with - * an embedded MDIO controller. Automatically scan the DTS for - * available PHYs and register them. - */ - if (of_get_property(np, "phy-handle", NULL) && - (priv->mac_id =3D=3D FTGMAC100_AST2400 || - priv->mac_id =3D=3D FTGMAC100_AST2500)) { - err =3D ftgmac100_setup_mdio(netdev); - if (err) - goto err_setup_mdio; - } - phy =3D of_phy_get_and_connect(priv->netdev, np, &ftgmac100_adjust_link); if (!phy) { @@ -1999,9 +1995,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) * PHYs. */ priv->use_ncsi =3D false; - err =3D ftgmac100_setup_mdio(netdev); - if (err) - goto err_setup_mdio; =20 err =3D ftgmac100_mii_probe(netdev); if (err) { --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B5F4338922; Fri, 16 Jan 2026 02:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529417; cv=none; b=HU+9ZoFt4I21MtV0chzA4+3TXyV+/5SyPk4MwENpQeqw2a0NwMr0TCHptkJQbO8Mmm22hCk5a8tmjNhF9nP7f5YCz4gg45CVftSzrT9qgTY/MUOdp4Hq1pgrRgQLdn3pSC1DknTQtx2XlD71GRc4bYHS3WSJFK3ZqoQI7clai6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529417; c=relaxed/simple; bh=cdP3hA++LbZWf4x/fXJUvF/jEOobiwzq8EDUx1tuY20=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=oxnSSMRWsrSo4zxjHUsAhOberitZC/uqWEZ0GZT/qc+ED1PQZb5qri/QqniOLhVR9PZL487Dre3KMc8JecU0bFmLIRJTRyfzuCo3eWVZSe3rPvUIx2nOBmlFfqhXidCMbDQ41yKoG/dY4uPr84wi9SyyoPrbabsEk9xtxkNVVWI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:21 +0800 Subject: [PATCH net-next v2 10/15] net: ftgmac100: Simplify legacy MDIO setup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-10-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1096; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=+AJyqE8pVKNsFnqolYpB1UqP9hmjiyBl6KYwvtG6CfU=; b=tOdvyra7sfmydiGOrFSY1CEpAuNsfc1isOENm0w7elxAjQ3nCZuYB9gmur1g1OQ2GDC62x5r5 t3Zvj7oOV33BxVrnWQFgBZzw5JOAFbjXIYXplNW1rX3o1JRtCZ/PWB8 X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn There are old device trees which place the PHY nodes directly in the MAC nodes, rather than within an MDIO container node. The probe logic indicates that the use of NCSI and the legacy placement of PHYs is mutually exclusive. Hence priv->use_ncsi cannot be true, so there is no reason to set it false. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 931fdf3d07d1..f5e69abb1fcf 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1994,8 +1994,6 @@ static int ftgmac100_probe(struct platform_device *pd= ev) * child node. Automatically scan the MDIO bus for available * PHYs. */ - priv->use_ncsi =3D false; - err =3D ftgmac100_mii_probe(netdev); if (err) { dev_err(priv->dev, "MII probe failed!\n"); --=20 2.34.1 From nobody Sat Feb 7 17:09:26 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87A21337BB0; Fri, 16 Jan 2026 02:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529419; cv=none; b=U/rD4ZV9mt+HieQ+1vkOsNMh0VUcxq4mn6+qQ0OeOhlYYg6xitKIjOrbYnqZR048rU9lWsB4XTZdJ0T6yHGPpctjE4Ov6dlXeC1myPMUoPiSxbKWCMMUf5WYvkVGBGW4u/rTp0LGZPYTRdntdDGdCjq4gWRCWQUo4O5pSqMp2Oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529419; c=relaxed/simple; bh=r+r3eupNaSJOZI65jGhNKLCMIGci+uvguSrj4QWnPgw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=irshk4mynjMWTo/x35xN4b+gaDmtx0FGgek3RW1UlQoMQCwCTai5H0teFjCc2jd+lpO3+hOMMYj7UTkqN/MtVP6Thhpzvo+Bbx+CMZ8GhL+/sIrO4SwS2dNiTawyHcysijkAsdq4/DyRUaJ28NgIG+Auz6Ed9mS0u64tkswHKxA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:22 +0800 Subject: [PATCH net-next v2 11/15] net: ftgmac100: Move DT probe into a helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-11-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=4071; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=tVopXV5DNmT07+98loUzJrFCfmalZhQi/WEZSI7l9e4=; b=XmRCAZoJiK/LDzVHb9aLf2e7q8ovTzBkXnNXJHHBzaFch3dSepUIFdCepKUxAtKccZ8TsKtnb 8wD+Yd7ON5wCg85VYxxIq+snHUGx0NPuxdUSdf+eshXIYM4gSmoP1NZ X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn By moving all the DT probe code into a helper, the complex if else if else structure can be simplified. No functional change intended. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 89 +++++++++++++++++++---------= ---- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index f5e69abb1fcf..71ea7062446e 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1870,6 +1870,58 @@ static int ftgmac100_probe_ncsi(struct net_device *n= etdev, return err; } =20 +static int ftgmac100_probe_dt(struct net_device *netdev, + struct platform_device *pdev, + struct ftgmac100 *priv, + struct device_node *np) +{ + struct phy_device *phy; + int err; + + if (of_get_property(np, "use-ncsi", NULL)) + return ftgmac100_probe_ncsi(netdev, priv, pdev); + + if (of_phy_is_fixed_link(np) || + of_get_property(np, "phy-handle", NULL)) { + /* Support "mdio"/"phy" child nodes for ast2400/2500 + * with an embedded MDIO controller. Automatically + * scan the DTS for available PHYs and register + * them. 2600 has an independent MDIO controller, not + * part of the MAC. + */ + phy =3D of_phy_get_and_connect(priv->netdev, np, + &ftgmac100_adjust_link); + if (!phy) { + dev_err(&pdev->dev, "Failed to connect to phy\n"); + return -EINVAL; + } + + /* Indicate that we support PAUSE frames (see comment in + * Documentation/networking/phy.rst) + */ + phy_support_asym_pause(phy); + + /* Display what we found */ + phy_attached_info(phy); + return 0; + } + + if (!ftgmac100_has_child_node(np, "mdio")) { + /* Support legacy ASPEED devicetree descriptions that + * decribe a MAC with an embedded MDIO controller but + * have no "mdio" child node. Automatically scan the + * MDIO bus for available PHYs. + */ + err =3D ftgmac100_mii_probe(netdev); + if (err) { + dev_err(priv->dev, "MII probe failed!\n"); + return err; + } + } + + return 0; +} + static int ftgmac100_probe(struct platform_device *pdev) { const struct ftgmac100_match_data *match_data; @@ -1965,41 +2017,10 @@ static int ftgmac100_probe(struct platform_device *= pdev) goto err_phy_connect; } =20 - if (np && of_get_property(np, "use-ncsi", NULL)) { - err =3D ftgmac100_probe_ncsi(netdev, priv, pdev); + if (np) { + err =3D ftgmac100_probe_dt(netdev, pdev, priv, np); if (err) - goto err_setup_mdio; - } else if (np && (of_phy_is_fixed_link(np) || - of_get_property(np, "phy-handle", NULL))) { - struct phy_device *phy; - - phy =3D of_phy_get_and_connect(priv->netdev, np, - &ftgmac100_adjust_link); - if (!phy) { - dev_err(&pdev->dev, "Failed to connect to phy\n"); - err =3D -EINVAL; goto err_phy_connect; - } - - /* Indicate that we support PAUSE frames (see comment in - * Documentation/networking/phy.rst) - */ - phy_support_asym_pause(phy); - - /* Display what we found */ - phy_attached_info(phy); - } else if (np && !ftgmac100_has_child_node(np, "mdio")) { - /* Support legacy ASPEED devicetree descriptions that decribe a - * MAC with an embedded MDIO controller but have no "mdio" - * child node. Automatically scan the MDIO bus for available - * PHYs. - */ - err =3D ftgmac100_mii_probe(netdev); - if (err) { - dev_err(priv->dev, "MII probe failed!\n"); - goto err_ncsi_dev; - } - } =20 priv->rst =3D devm_reset_control_get_optional_exclusive(priv->dev, NULL); @@ -2057,11 +2078,9 @@ static int ftgmac100_probe(struct platform_device *p= dev) err_register_netdev: err_phy_connect: ftgmac100_phy_disconnect(netdev); -err_ncsi_dev: if (priv->ndev) ncsi_unregister_dev(priv->ndev); ftgmac100_destroy_mdio(netdev); -err_setup_mdio: return err; } =20 --=20 2.34.1 From nobody Sat Feb 7 17:09:27 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE21F3385BE; Fri, 16 Jan 2026 02:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529421; cv=none; b=XVVHdkVZ+FDdJUDzefrQhDiHJMnEo3Azga44nULSPSsTji3EjsMtO1IhRoScprr3+1bIxYGIyMj46rRA/CSvArWgrDk0SCr4oRlTt2U3DbtW18tYJNN1vVH5qb+l4BdNeGY1SBXx0hBjnc9X/oWUBZvYlrVP+2Tp6WnEvShCMJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529421; c=relaxed/simple; bh=oJW/jqRlKmVdWXR4ln1BfDJKxvdZsnfUsbkfIw2yr5A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=udeJeW7Fv7Ta8alGWwO+AEDXQtRbZcJU3GfpWklLgLqTnNPx+En1Dq70tHFwInHclij3fU6NKkV/D5waXn8d2MqeyKqrH9I9o9rdqpoctnLBz26o2aqJ3Nhm5+/SidPIr+j2JIRFVh+b5Rc23ltv8dxyawDeQItQLgVGCicFVSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:16 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:16 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:23 +0800 Subject: [PATCH net-next v2 12/15] net: ftgmac100: Remove redundant PHY_POLL Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-12-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1321; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=o1kbgFmdMemKmk5PrV8wGbPTM2EI0nj1qFintcv6DQg=; b=1+2OjYAq+CkReN5YmkeyrkykNkUK8CLZEObqBZy4kPA2CXdU3VgK2JRQHlysNxf/Jpdg7DfY/ QEndvK1yZz7ChQewW3s2qf5Nz1K03yia4BCWkZNA66DqgTAXBoxvSU8 X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn When an MDIO bus is allocated, the irqs for each PHY are set to polling. Remove the redundant code in the MAC driver which does the same. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 71ea7062446e..1440a4b358e3 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1712,7 +1712,7 @@ static int ftgmac100_setup_mdio(struct net_device *ne= tdev) struct platform_device *pdev =3D to_platform_device(priv->dev); struct device_node *np =3D pdev->dev.of_node; struct device_node *mdio_np; - int i, err =3D 0; + int err =3D 0; u32 reg; =20 /* initialize mdio bus */ @@ -1740,9 +1740,6 @@ static int ftgmac100_setup_mdio(struct net_device *ne= tdev) priv->mii_bus->read =3D ftgmac100_mdiobus_read; priv->mii_bus->write =3D ftgmac100_mdiobus_write; =20 - for (i =3D 0; i < PHY_MAX_ADDR; i++) - priv->mii_bus->irq[i] =3D PHY_POLL; - mdio_np =3D of_get_child_by_name(np, "mdio"); =20 err =3D of_mdiobus_register(priv->mii_bus, mdio_np); --=20 2.34.1 From nobody Sat Feb 7 17:09:27 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5941F337BAA; Fri, 16 Jan 2026 02:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529422; cv=none; b=Vv5wM0nnza+9AAOb1M2mKlWCMNJyO5GIOjzSWF13a75rfGm+TXMT8mrggxHVYFNsL0Pzs3krB1XGjBNMzgDZUmTTj50jI4guYLNl8keq+SiLGyYlMIfAqbiVMaVQ5uaXpY3F+xRJJbGa1b3H8cT+AsQ3V7QcsLJQ6cz7Jh2RAv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529422; c=relaxed/simple; bh=yAKMV1n9zuBYT2/kXCPmeCZll/5cbjgYd7Go4UV8TNw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=MSsSlxge/oOmZi3l5tMro4dCW6KgmO0hdNDC3ll6fedRyS3nzFVFj0ulKLpRiuEhsfkuHQSIhYJaxJLkiSLfTX5iqP7zxdLiC2h9Hg1CtxZrZVfyGy+kt/CkKCrWmUTDP0ViQBtTRhHzfPwH5yrgqNscFS92IfeuArPc7eJ5jBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:17 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:17 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:24 +0800 Subject: [PATCH net-next v2 13/15] net: ftgmac100: Simplify error handling for ftgmac100_setup_mdio Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-13-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=956; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=rZOhdB2SxA3koqLMc5/XtHD8SIuEU9yPDhMG4DwBZuU=; b=7oo6XR4X15z32ht7I5VhcQdGhPk4yU/CoYss35gQHWx9hfx8PipzWc9jq+q5bVmHvEwgn9IGh 7F7K4PEWU2jBeNMNKfxIxZNaiJX9XI4J9a1/6gDuOHX3jU25XHD6FaV X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn ftgmac100_setup_mdio() cleans up any resources it gets on error. All resources obtained by the probe function up until this call point use devm_ methods. So just return the error code rather than use a goto. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 1440a4b358e3..93c1ef819abc 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -2011,7 +2011,7 @@ static int ftgmac100_probe(struct platform_device *pd= ev) priv->mac_id =3D=3D FTGMAC100_AST2500) { err =3D ftgmac100_setup_mdio(netdev); if (err) - goto err_phy_connect; + return err; } =20 if (np) { --=20 2.34.1 From nobody Sat Feb 7 17:09:27 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2305633987A; Fri, 16 Jan 2026 02:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529428; cv=none; b=dwKYaR+No/9aE20Cg3UzOKOv++RSMxbByTD/0ibUsB3ct2tTemnsf333ytr5A1+cCKlWcUiGAdKe7bshcCdZ0xt/igC3KYZgzsISWejIehxmlWTmIET48DrEk5uCKow97CquKqBsBHGerq/7qeHQby+0J9ZktalhHT3ZSR0Lti8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529428; c=relaxed/simple; bh=IJWGJK++gRrr1p8ncdINTIwxsbbOJ9lAnFrk7kpdz2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=DR5lE2TTALxmbOFcslUTA+ONhpv/alxMoh/Y/Yf3XQfWIEyPZXX643lyibXTDUnOZn18MlFZ8wmQLbBqqHUENKubNhAQzSI6bIXOuvMykm/0VT1IWavKJnNXsngw+BGpyWjT6GHiQ2IhPSeoW/ayX6/OpBWK/n4OSM5u80B+TM0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:17 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:17 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:25 +0800 Subject: [PATCH net-next v2 14/15] net: ftgmac100: Simplify condition on HW arbitration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-14-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=1262; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=FnxX00AXJj8bmjA76PpH8xwft0nOhpecwQN7ChV7jiI=; b=HXs0smQ8pWxoXwQpCKYZheJsdkXdZI9UGhwrr+8RM37/Ez6LQIfFGcCBwh6bq8ld/yML4/qGq bIsBfiCrdpBAjXkzplQm+EOd6fD/Fpk7VOSYiagGRRNuM5v2gghi6Tu X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn The MAC ID is sufficient to indicate this is a ast2600. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index 93c1ef819abc..d2ebb7360f4a 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -2030,13 +2030,13 @@ static int ftgmac100_probe(struct platform_device *= pdev) err =3D ftgmac100_setup_clk(priv); if (err) goto err_phy_connect; - - /* Disable ast2600 problematic HW arbitration */ - if (priv->mac_id =3D=3D FTGMAC100_AST2600) - iowrite32(FTGMAC100_TM_DEFAULT, - priv->base + FTGMAC100_OFFSET_TM); } =20 + /* Disable ast2600 problematic HW arbitration */ + if (priv->mac_id =3D=3D FTGMAC100_AST2600) + iowrite32(FTGMAC100_TM_DEFAULT, + priv->base + FTGMAC100_OFFSET_TM); + /* Default ring sizes */ priv->rx_q_entries =3D priv->new_rx_q_entries =3D DEF_RX_QUEUE_ENTRIES; priv->tx_q_entries =3D priv->new_tx_q_entries =3D DEF_TX_QUEUE_ENTRIES; --=20 2.34.1 From nobody Sat Feb 7 17:09:27 2026 Received: from TWMBX01.aspeed.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0597338593; Fri, 16 Jan 2026 02:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529432; cv=none; b=WKt/gnvZw2UfrbPMXY4UdLXXWzoswnUhFbnTkrkwQberyrBbOtm3TE3+UpxbrF4jX7IOxP6Th0f5k7zCo0TsMTZOACXrsoMUj/KXTTRvImfiLIzS9t2LXWDyCB+2zNm2CMzTWWaRT6ZTN2Lzrb0U0A9IKXdgkMEtkhjay+AFM2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768529432; c=relaxed/simple; bh=8o6T9okpNEnuKiyU1kOFn/V6H7ukGLF+AMY711YPQak=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=QzGsHdHVq+9nzZs+2FOQ8SAdEsb/8P0HbI02qkMp3po7X1KlpQ+gEgy6IxF6Ybg/vn01Ncm6pq/I9P6wgmoUA9mgH88qsLSrbWrhtHX2fJBENv6hul5uFEFLFcabcMb/goBlZqPTlWbn8LvpHntml8kFu3To8nH400BjesCq0AU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.client-ip=211.20.114.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 16 Jan 2026 10:09:17 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Fri, 16 Jan 2026 10:09:17 +0800 From: Jacky Chou Date: Fri, 16 Jan 2026 10:09:26 +0800 Subject: [PATCH net-next v2 15/15] net: ftgmac100: Fix wrong netif_napi_del in release Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20260116-ftgmac-cleanup-v2-15-81f41f01f2a8@aspeedtech.com> References: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> In-Reply-To: <20260116-ftgmac-cleanup-v2-0-81f41f01f2a8@aspeedtech.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: , , Andrew Lunn , Jacky Chou , Simon Horman X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768529355; l=910; i=jacky_chou@aspeedtech.com; s=20251031; h=from:subject:message-id; bh=5QfcHNpKWq89IVrLFmSFWv1d9ZWTuK9MUEiVXUcdVys=; b=vu5QmRWJZb47b6co5zy50rvfUDrRVEfQx5jmOvelvqTTxy0Tel7c5YBiVEG1IME2V3V6CL1bD yHd3bJ5NQteB3nwss8oP3hCwF041kZEENtGLK9lOKNGd+Rymi4uhWff X-Developer-Key: i=jacky_chou@aspeedtech.com; a=ed25519; pk=8XBx7KFM1drEsfCXTH9QC2lbMlGU4XwJTA6Jt9Mabdo= From: Andrew Lunn netif_napi_add() is called in open. There is a symmetric call to netif_napi_del() in stop. Remove to wrong call to netif_napi_del() in release. Signed-off-by: Andrew Lunn Reviewed-by: Simon Horman Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/etherne= t/faraday/ftgmac100.c index d2ebb7360f4a..fa33eeadb630 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -2100,8 +2100,6 @@ static void ftgmac100_remove(struct platform_device *= pdev) =20 ftgmac100_phy_disconnect(netdev); ftgmac100_destroy_mdio(netdev); - - netif_napi_del(&priv->napi); } =20 static const struct ftgmac100_match_data ftgmac100_match_data_ast2400 =3D { --=20 2.34.1