From nobody Sat Feb 7 23:33:55 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 328992F5A0A; Thu, 30 Oct 2025 10:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819870; cv=none; b=Yj1fhbca6QmgrO/EkE+I1iBAim/Phb4RXpXR8PzhzZIqQXWQB9lMnQQHgVOI7NOQ/t3CPgVnbAeD17s7PQAop0rpVh1+Lrh4oazp2G+p3J6uu6jD+U03zjD42ORShHgPgI2wyVFV+7ilghLU8r7ZZXktl/tbJ/VYbZCJQLRJsn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819870; c=relaxed/simple; bh=bjGY5hODqCejSH9ODN/FinKpeyl4BAwFHF0wER2tDu4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hM8HXY2yMXNvlKDPMQA5Hf0nfg1QI7WLdLzlf6AgrolpO5DSGWFPmdGNdKhK5b/auookRLVHErx1TXznCpBVBVJGUmQRKPUeLXd3eeMfZgORREytuD9RhiXYXyihKNA6ZPUH208fkX2XfU3IjVnSlBX9EKjvRmlHpNKiNffkzdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Owwl7WWy; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Owwl7WWy" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B0EB71A1778; Thu, 30 Oct 2025 10:24:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 86C9F6068C; Thu, 30 Oct 2025 10:24:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6F29C102F2500; Thu, 30 Oct 2025 11:24:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761819865; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=etITqC8jMduEZk9ztensAl81JNZKmJfNvh2+zyGxRok=; b=Owwl7WWybvrT1Z8Yo3fx2q4sNl0TlauRyJQiLrYVmeIGttEKzq33li3cuSW0SuI1hwWscT MIKA1eId/jlI1o4zrLrgRKBj3pO5ms9JRHFOmMvogAOlXZFw5r8LFhTL24ij6WIjZlv1Cw 7YPSUCIvfaYBJK/yWcR7zcLpKe0R6SJ+v597rH0IAr65DFD8DnTh2N5S8ZGR9kSDrrq1BV YHCJxP2q4NfzrQSJn5Q0cRBp/C853ssipiERIpAgz5S7RTDI6KEcPgmmBSeK2gt/sG7B2/ Fr0XeScLi2VeJzON8sd2OygTUrN2rNpbBKmo6XlzPPLDNAj65o0oDPcdyem5dQ== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: Maxime Chevallier , Simon Horman , Boon Khai Ng , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/4] net: altera-tse: Set platform drvdata before registering netdev Date: Thu, 30 Oct 2025 11:24:14 +0100 Message-ID: <20251030102418.114518-2-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251030102418.114518-1-maxime.chevallier@bootlin.com> References: <20251030102418.114518-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" We don't have to wait until netdev is registered before setting it as the pdev's drvdata. Move it at netdev alloc time. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- drivers/net/ethernet/altera/altera_tse_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/et= hernet/altera/altera_tse_main.c index 3f6204de9e6b..6ba1249f027d 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1150,6 +1150,7 @@ static int altera_tse_probe(struct platform_device *p= dev) } =20 SET_NETDEV_DEV(ndev, &pdev->dev); + platform_set_drvdata(pdev, ndev); =20 priv =3D netdev_priv(ndev); priv->device =3D &pdev->dev; @@ -1394,8 +1395,6 @@ static int altera_tse_probe(struct platform_device *p= dev) goto err_register_netdev; } =20 - platform_set_drvdata(pdev, ndev); - priv->revision =3D ioread32(&priv->mac_dev->megacore_revision); =20 if (netif_msg_probe(priv)) --=20 2.49.0 From nobody Sat Feb 7 23:33:55 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 58D14314D1B for ; Thu, 30 Oct 2025 10:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819871; cv=none; b=IO0ud7AmsYT2KqNpLr7DkgyoeH7VqZrD7oGtTr1G5D2ZB5o++L7jdneY/Q5419P+G5HxM+7yysulAcopSIXu9ftw1SmF4Yxp86hgc0HZ/JwvcBocdhO0SuwApvGseToMJfSy8H3IGFtFk7t570fUVt+uxb3Pvs7jFEy4T/0Qh4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819871; c=relaxed/simple; bh=NeJozDG6vfAMv5LoS86jW2wCvGloDnDz+QdanWS+ZoY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LxxWsq+1WDca/S6Bf9Z6yFl0l1I8cnZdsj7c3oHLLAdbFs/XhV6bKL/CGebiZqsXxXKAEx5NDN8TGHwqNoU8UpUIQzSkjljEjha2IKYibt2lfMxPRcjy/QVDkDGQB5Waw+jcdcM0/0DZIV2ocUNSUVSpWjryPA8p9uIFe8ZaYsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=vAn9a9rm; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="vAn9a9rm" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id CD9E94E413EF; Thu, 30 Oct 2025 10:24:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A43776068C; Thu, 30 Oct 2025 10:24:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E6E6411808822; Thu, 30 Oct 2025 11:24:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761819866; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=2s4YXZ006r6JZP+ciPRm1kPsUk3RftNVPiuxZBb+ZTw=; b=vAn9a9rmxnbtvZT/vKNskkN65m9GgP+3q8h+3M5x//R56m/gemmelQiAgN6FMK+iR3EDB3 btIbRjEhe40kR/XIjhowoBflZXk+RfqSvUrtcw+FQqthYO8xL2TqurCVq71N4Wf4AOyvCt eYbKAeN73cEKSTC4Da/4s0L72RibvqH1zz6jEWnVCEWhuKxyTvhBfrvrdcauaQeHUobGRe EbUwK9rs+70XURh9KN1stUkOr7wkfRiMbIp1bheey9U/ZLTXVhh2l0Lozy40njWDR11Skr VPw5JTiHMNTNpntmQk/035OzYvK4AP8+mUywR9mUAn3610M++Eju2SaUae5mrQ== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: Maxime Chevallier , Simon Horman , Boon Khai Ng , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/4] net: altera-tse: Read core revision before registering netdev Date: Thu, 30 Oct 2025 11:24:15 +0100 Message-ID: <20251030102418.114518-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251030102418.114518-1-maxime.chevallier@bootlin.com> References: <20251030102418.114518-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The core revision is used in .ndo_open(), so we have to populate it before regstering the netdev. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/altera/altera_tse_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/et= hernet/altera/altera_tse_main.c index 6ba1249f027d..c74b1c11d759 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1388,6 +1388,8 @@ static int altera_tse_probe(struct platform_device *p= dev) spin_lock_init(&priv->tx_lock); spin_lock_init(&priv->rxdma_irq_lock); =20 + priv->revision =3D ioread32(&priv->mac_dev->megacore_revision); + netif_carrier_off(ndev); ret =3D register_netdev(ndev); if (ret) { @@ -1395,8 +1397,6 @@ static int altera_tse_probe(struct platform_device *p= dev) goto err_register_netdev; } =20 - priv->revision =3D ioread32(&priv->mac_dev->megacore_revision); - if (netif_msg_probe(priv)) dev_info(&pdev->dev, "Altera TSE MAC version %d.%d at 0x%08lx irq %d/%d\= n", (priv->revision >> 8) & 0xff, --=20 2.49.0 From nobody Sat Feb 7 23:33:55 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 7474F351FC3 for ; Thu, 30 Oct 2025 10:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819872; cv=none; b=MSVYJbJ64HRgEqObJC/68/qO1hBBnGmTN7yv8wGI8MdtRkhmcjYf8/vPbbNcL6VFQlZYEjNB9fwvLF4xlRJyNf1bvsjgXiF2XjwhOBMiw8ZOsGJj9sATE5KwOTbNzyZq/ATE1MAFLp1fpyMvkhgm6Tbul/l9R8EU2L5nmRzr0jM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819872; c=relaxed/simple; bh=Ez7a+wreIh7UMIo9IVUU+O2bN8hhAvrjsWtYzNG/hJA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=igLWanG+zH+LkZ6DhffmkylW46l4gvpMGLoQx/Ay/z8RFamfFiE1D8KC8AWI/OqEKyIxTmssYxIN5Isitez11LUUABxplvqGu5iuEPuk/PQx0Yr4YMnde6Byd4ty7Nrbpq9F74Z7mQvGwV+tLd0dZbVjy7918kitFn7RoD5KZ+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=cuKxX9me; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="cuKxX9me" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B2546C0DAAB; Thu, 30 Oct 2025 10:24:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 284156068C; Thu, 30 Oct 2025 10:24:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3D81911808821; Thu, 30 Oct 2025 11:24:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761819868; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=RoyBPsQbxCeIyoPQ2zrzEdmuX54xkmjv6HtTh7tX2pE=; b=cuKxX9meA+bNJDneTgaqLKGwAeRY7C04U2PFcPPzTSTA9uWBDYQ0LRTaKNwIBFSD3I7Bzi ObVIj158RqAaCWrwRf9txLznrlOKryzaZB4nwF/0oqyKVx6pQk4raE090zw2mci+BK9iQT IibgK5D/5bmfhh3kOoQ/0WCrv+mWKZ6GYTSxggeieViKa0kDvlnHHMpZgXhRGX83uf6qMn LMz1d22VP5UDc72kb0mtMhlR5Nbd7K9ZX/GJJuets1I14b0pBELKf/wU/HCy6VqQjljV8h fEl0yPKiC2m8yS8kVIGzr9BoMaobqKdZWONokoR5helRQmT8GiWYVCRPXvtaUA== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: Maxime Chevallier , Simon Horman , Boon Khai Ng , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/4] net: altera-tse: Don't use netdev name for the PCS mdio bus Date: Thu, 30 Oct 2025 11:24:16 +0100 Message-ID: <20251030102418.114518-4-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251030102418.114518-1-maxime.chevallier@bootlin.com> References: <20251030102418.114518-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The PCS mdio bus must be created before registering the net_device. To do that, we musn't depend on the netdev name to create the mdio bus name. Let's use the device's name instead. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- drivers/net/ethernet/altera/altera_tse_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/et= hernet/altera/altera_tse_main.c index c74b1c11d759..a601ba57190e 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1404,7 +1404,7 @@ static int altera_tse_probe(struct platform_device *p= dev) (unsigned long) control_port->start, priv->rx_irq, priv->tx_irq); =20 - snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", ndev->name); + snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", dev_name(&pdev->dev)); pcs_bus =3D devm_mdio_regmap_register(&pdev->dev, &mrc); if (IS_ERR(pcs_bus)) { ret =3D PTR_ERR(pcs_bus); --=20 2.49.0 From nobody Sat Feb 7 23:33:55 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 A6A552D8DB9 for ; Thu, 30 Oct 2025 10:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819874; cv=none; b=K4gr+7wZk0p5WTAXyscx1fcK9hpOCWj5plgg5LbirOoJYs0GQxj2X1x1OWoQE6oL2Q53wANZ7mPzhWRT+SYyFnHi3/x5UqPWXWKsqFQttF18mlS8WMUH/fXDrltBxV+nb00yOyjTciOsqhPweSs8eBCx1r4ta4gHBL7mk54FIlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761819874; c=relaxed/simple; bh=/+Ud9HruVze393NyT1qzp2ulTBCT/YDFMljaKM2s+v8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MoRCG953Kxwep6Nj5hlCHaHaKW7qfTXEoItuAYra0bVNSNBaLZUtyWGrSqZAIbjRPyqoVZbnsrIbjcI9gu7HsBnYgFtWLesSMg/jQ8sJJd413lBrrGvXTjRohwE8ghX+nHsBkeZtuSUxSNuUx+TUzUMLsQZI7buwMktgN/Pm92Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gZxe+zAT; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gZxe+zAT" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id EF8BE4E413F2; Thu, 30 Oct 2025 10:24:30 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C66136068C; Thu, 30 Oct 2025 10:24:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A67E0102F2500; Thu, 30 Oct 2025 11:24:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761819870; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=pYQO/J8iwjLT+7v/VfTgDA/2MnHjgHlcPgf4jpQ3AXs=; b=gZxe+zATPo1ZUR444y2TlDGvsM9lETqMy7I/JWzjj9wQNzpOdcT1fm+2wN4cCzHxZBj6WP cVF0v/YOfw0Feab6GlIKGwKAdIw9yNFLaU29abStuieUIn/eHDigSsmZAhvD34iB7yrmWM /kIko9F7NQHox/3C8nu/WQsXfsIB7evmNNfK5Fuf7Brl/Upabt0QOBZhNWGCeViOifPb2Z belpWKJXlcvvksH/XuoZd5wuzVgF6OrnfBHHebYgjnQMxDSz2nKfin85LD4N7oblPEgmnf fpsHuxEYvNduINWzIRxEfUSZ1u+8HoFj+4QeL3/0IOK6kD8BTRI+BfpEuxw+oA== From: Maxime Chevallier To: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: Maxime Chevallier , Simon Horman , Boon Khai Ng , =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/4] net: altera-tse: Init PCS and phylink before registering netdev Date: Thu, 30 Oct 2025 11:24:17 +0100 Message-ID: <20251030102418.114518-5-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251030102418.114518-1-maxime.chevallier@bootlin.com> References: <20251030102418.114518-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" register_netdev() must be done only once all resources are ready, as they may be used in .ndo_open() immediately upon registration. Move the lynx PCS and phylink initialisation before registerng the netdevice. We also remove the call to netif_carrier_off(), as phylink takes care of that. Signed-off-by: Maxime Chevallier Reviewed-by: Andrew Lunn --- drivers/net/ethernet/altera/altera_tse_main.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/et= hernet/altera/altera_tse_main.c index a601ba57190e..4ffa3edf1d0c 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -1390,20 +1390,6 @@ static int altera_tse_probe(struct platform_device *= pdev) =20 priv->revision =3D ioread32(&priv->mac_dev->megacore_revision); =20 - netif_carrier_off(ndev); - ret =3D register_netdev(ndev); - if (ret) { - dev_err(&pdev->dev, "failed to register TSE net device\n"); - goto err_register_netdev; - } - - if (netif_msg_probe(priv)) - dev_info(&pdev->dev, "Altera TSE MAC version %d.%d at 0x%08lx irq %d/%d\= n", - (priv->revision >> 8) & 0xff, - priv->revision & 0xff, - (unsigned long) control_port->start, priv->rx_irq, - priv->tx_irq); - snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", dev_name(&pdev->dev)); pcs_bus =3D devm_mdio_regmap_register(&pdev->dev, &mrc); if (IS_ERR(pcs_bus)) { @@ -1441,12 +1427,26 @@ static int altera_tse_probe(struct platform_device = *pdev) goto err_init_phylink; } =20 + ret =3D register_netdev(ndev); + if (ret) { + dev_err(&pdev->dev, "failed to register TSE net device\n"); + goto err_register_netdev; + } + + if (netif_msg_probe(priv)) + dev_info(&pdev->dev, "Altera TSE MAC version %d.%d at 0x%08lx irq %d/%d\= n", + (priv->revision >> 8) & 0xff, + priv->revision & 0xff, + (unsigned long)control_port->start, priv->rx_irq, + priv->tx_irq); + return 0; + +err_register_netdev: + phylink_destroy(priv->phylink); err_init_phylink: lynx_pcs_destroy(priv->pcs); err_init_pcs: - unregister_netdev(ndev); -err_register_netdev: netif_napi_del(&priv->napi); altera_tse_mdio_destroy(ndev); err_free_netdev: --=20 2.49.0