From nobody Sun Feb 8 09:33:07 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ADD0A29AB14; Fri, 11 Apr 2025 12:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744373376; cv=none; b=jFkDqKMqmVw7PV+bsSovaMepN4bY7TdqpbEJddtOo1OHKWPaLyI/Z2yOIJ/EVLddeDJWZjXnXzo1JUU3Je9GPxsHZF6Hx8YKluKgkx+0vq0hRT+Cxs9sQuO6D+8wWhPjzLRlha896MctAc0KrHnvJf/Y5V4ExcpMYLM6z6c0PAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744373376; c=relaxed/simple; bh=dAYppr2WyAl9VFdAU0iu6wgFo0sivnbiYlB0AfqCqr0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Dcv6UDZ7ZDDblQ1hYOZL0rlZq3MEBzIVJ11yJ2B3YdgLcPqq29ESpYnmGu2su+VNfZoKlHNgxf9/5P4uhAlXvABRr7TJ0r8BlAPYiAQIy1E+WHD3iVF/y6Z6dwtEmKiwGD3iYnPs5JPoYU56aKJtwoqKLPNZtdmaGxRKly2DSYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nFJZLBhq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nFJZLBhq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 461B0C4CEE7; Fri, 11 Apr 2025 12:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744373376; bh=dAYppr2WyAl9VFdAU0iu6wgFo0sivnbiYlB0AfqCqr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nFJZLBhqTXYILA6dC+EaCwwEHzoAjnYsQdQh5v6sldETkPCBDx18gx2G3dwrYxDaG 9p3Z9J4sSTC1EtgTKGuehuYu0USYvFPBafgelt4NeVGEK6qw+jr3AGKaNd3W9kLiv1 xTLbfjwPdlUajVU0QNs1OX4W4nS4k5MePKc6ziQfstU4QQR5UKjjSlgxlhB3YZNc6q bEszjrKYtdirGAT9uXvODBN9lptyZB+kl/lY8QLtoYQOB2lrDe4bUSvOaIkq00pj7Z kNie9qqwsILEUN/6ki8FjbZ/Q68xgpyQCmYpM/n3Ajl16/40Api+9jCXkopEC0MX5C yPMox4Bqr2WJA== From: Michael Walle To: Saravana Kannan , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next 1/2] net: ethernet: ti: am65-cpsw: set fwnode for ports Date: Fri, 11 Apr 2025 14:09:14 +0200 Message-Id: <20250411120915.3864437-2-mwalle@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250411120915.3864437-1-mwalle@kernel.org> References: <20250411120915.3864437-1-mwalle@kernel.org> 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 Content-Type: text/plain; charset="utf-8" fwnode needs to be set for a device for fw_devlink to be able to track/enforce its dependencies correctly. Without this, you'll see error messages like this when the supplier has probed and tries to make sure all its fwnode consumers are linked to it using device links: am65-cpsw-nuss 8000000.ethernet: Failed to create device link (0x180) with = supplier .. Signed-off-by: Michael Walle Reviewed-by: Saravana Kannan --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/etherne= t/ti/am65-cpsw-nuss.c index c9fd34787c99..af7d0f761597 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2749,7 +2749,8 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common= *common, u32 port_idx) mutex_init(&ndev_priv->mm_lock); port->qos.link_speed =3D SPEED_UNKNOWN; SET_NETDEV_DEV(port->ndev, dev); - port->ndev->dev.of_node =3D port->slave.port_np; + device_set_node(&port->ndev->dev, + of_fwnode_handle(of_node_get(port->slave.port_np))); =20 eth_hw_addr_set(port->ndev, port->slave.mac_addr); =20 --=20 2.39.5 From nobody Sun Feb 8 09:33:07 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4E93629B23F; Fri, 11 Apr 2025 12:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744373379; cv=none; b=B9DrU0X3KWDt6Tl5kzWM7CAmR80XiSw0YxEtIFWUqVS7IJTpnDgadNfKhHFuh0Wr8VNxV4/cnkojWou/iaNBN2NRHaROcIsKpLyUlqsiVTvWRnyl9dX5fS3K9MWOM20tCFfE6M7PmRWaju7iS6PA1tZnjOGbcMJcfHdxkqT0kD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744373379; c=relaxed/simple; bh=jeRL00Mqbx5WUbMpBpZN8+Z+cX2QUo+j5ig7bppnlKE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c7bPHiX4UuaouYfff3q1G7JkUsqrYdiA+sbNWPgQCYeKvCpn0gYj2tkioQ2M+A8hNd7FeZGrhb5B6n/wz8FnWz/Fb41q7lDdX8hHDmdQV8mCcd/1Z5RgCpv8DtjN1fEISeTUU5tatFOFWM3CEnPcZrZVBMoVdyrmbm+G32mBTO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gm/yQARb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gm/yQARb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 880A6C4CEE2; Fri, 11 Apr 2025 12:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744373378; bh=jeRL00Mqbx5WUbMpBpZN8+Z+cX2QUo+j5ig7bppnlKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gm/yQARb0pPip08Q2lPuH5Sf0+9ACYeb0ee66Z7fWHExKsQrwZ3VK7VBEfXybJYGX JD8gJhEOfyrm08tpQ29h273MsUaH9sHvPtBu0fDgxxhE+e+H8RIQn3cnmpgKy5ORnQ LYvx7fMBHBr+cBAffVfNDPM7Ic3rviWfTkbC6cU8IkAeNeM13bvpPAhdbO1VmIxblv 4bjDUxy2FHsprEgvaIbasvwmH6MEcJQOuXofvBxqO+u9bOhAPS+cfRtV4PdS6wPQ18 IoVxNHo/rfGBe37ZFMP5BampC5KIOElWcjNFUkGiF3Gl/0hN2HGcONVgfBM5zhCzlQ zDDkIUb/PsIjQ== From: Michael Walle To: Saravana Kannan , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next 2/2] net: ethernet: ti: am65-cpsw: handle -EPROBE_DEFER Date: Fri, 11 Apr 2025 14:09:15 +0200 Message-Id: <20250411120915.3864437-3-mwalle@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250411120915.3864437-1-mwalle@kernel.org> References: <20250411120915.3864437-1-mwalle@kernel.org> 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 Content-Type: text/plain; charset="utf-8" of_get_mac_address() might fetch the MAC address from NVMEM and that driver might not have been loaded. In that case, -EPROBE_DEFER is returned. Right now, this will trigger an immediate fallback to am65_cpsw_am654_get_efuse_macid() possibly resulting in a random MAC address although the MAC address is stored in the referenced NVMEM. Fix it by handling the -EPROBE_DEFER return code correctly. This also means that the creation of the MDIO device has to be moved to a later stage as -EPROBE_DEFER must not be returned after child devices are created. Signed-off-by: Michael Walle --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/etherne= t/ti/am65-cpsw-nuss.c index af7d0f761597..0bf877e180bd 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2679,7 +2679,9 @@ static int am65_cpsw_nuss_init_slave_ports(struct am6= 5_cpsw_common *common) goto of_node_put; =20 ret =3D of_get_mac_address(port_np, port->slave.mac_addr); - if (ret) { + if (ret =3D=3D -EPROBE_DEFER) { + goto of_node_put; + } else if (ret) { am65_cpsw_am654_get_efuse_macid(port_np, port->port_id, port->slave.mac_addr); @@ -3551,6 +3553,16 @@ static int am65_cpsw_nuss_probe(struct platform_devi= ce *pdev) return ret; } =20 + am65_cpsw_nuss_get_ver(common); + + ret =3D am65_cpsw_nuss_init_host_p(common); + if (ret) + goto err_pm_clear; + + ret =3D am65_cpsw_nuss_init_slave_ports(common); + if (ret) + goto err_pm_clear; + node =3D of_get_child_by_name(dev->of_node, "mdio"); if (!node) { dev_warn(dev, "MDIO node not found\n"); @@ -3567,16 +3579,6 @@ static int am65_cpsw_nuss_probe(struct platform_devi= ce *pdev) } of_node_put(node); =20 - am65_cpsw_nuss_get_ver(common); - - ret =3D am65_cpsw_nuss_init_host_p(common); - if (ret) - goto err_of_clear; - - ret =3D am65_cpsw_nuss_init_slave_ports(common); - if (ret) - goto err_of_clear; - /* init common data */ ale_params.dev =3D dev; ale_params.ale_ageout =3D AM65_CPSW_ALE_AGEOUT_DEFAULT; --=20 2.39.5