From nobody Fri Dec 19 20:13:10 2025 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 677F6269882; Mon, 14 Apr 2025 08:43:54 +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=1744620236; cv=none; b=bZXPt2tlHMXAy3o4qnkWcKJ/OTmJfGSg+ckrYja3iy6b8dTBrNSX51gXgKM9GFrg9z1m4oGcUzSh6n9SkKTbQmMtVJkAx7CKDYJPyBhAJTCzIxTxUtp5L9wa8BeSMpAa9vQHjcGUyaGQfqPbB0VTYm0XtKCdiPIsahyXGANidTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744620236; c=relaxed/simple; bh=OT+iV6RGXvYQH7Z4h/ikFvlwLhr9nic3CO6eW8fJEt4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hmwMWqmFjWHemuC8BK92+lnb0LrlwsiJv8F1wNlhvvb/nCPKB0SHVbwRtjg6PMLv3ErWJTjdjHVWA0TXZu0b1ucUm/PhWkzU2JF0nTve1wY0+nxRm8t6et4a4cfBHpnMmRWA6kQdVCd+oDt1IspcgdJbEkpXa6q/ktgJlS2wGZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A7m6e+Ef; 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="A7m6e+Ef" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E5B7C4CEE2; Mon, 14 Apr 2025 08:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744620233; bh=OT+iV6RGXvYQH7Z4h/ikFvlwLhr9nic3CO6eW8fJEt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7m6e+Efk2MGM6nBMZPMe5E74ui25Ums31WDJf3JExFC/aK4f62T9T5irNFdv5FeC dmJqMmGtcUK++yBjpd8wr9JCH0Zgn2r9UbOJlXbpH903vSXY7t9HNNyCOZbdWXG5al RhSiIiIGuW67unvI6WYVh5O4Bf6ITme/hT7w5xIF9jZ9tGVGrXX/Eos/igppTJrL6U tDHIcELONnd3ArOzx56DWs6PD3xINguHfTmKEO7viEEIrALeIHNnfkQSrmNw4g7qvo 9ClC+tJkorUyjnDoukaANHLkp3RJRodYLJbnXBa7iH09rzcnrxgcyeo6I956CRWRQl YRZPUjHeXsOtA== 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 v2 1/2] net: ethernet: ti: am65-cpsw: set fwnode for ports Date: Mon, 14 Apr 2025 10:43:35 +0200 Message-Id: <20250414084336.4017237-2-mwalle@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250414084336.4017237-1-mwalle@kernel.org> References: <20250414084336.4017237-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 .. Reviewed-by: Saravana Kannan Signed-off-by: Michael Walle --- v2: - move of_node_get() into own fixes patch: https://lore.kernel.org/netdev/20250414083942.4015060-1-mwalle@kernel.or= g/ drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/etherne= t/ti/am65-cpsw-nuss.c index 636f4cb66aa1..55a0c37da54c 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -2760,7 +2760,7 @@ 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(port->slave.port_np)); =20 eth_hw_addr_set(port->ndev, port->slave.mac_addr); =20 --=20 2.39.5 From nobody Fri Dec 19 20:13:10 2025 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 09CF5269D1D; Mon, 14 Apr 2025 08:43:56 +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=1744620237; cv=none; b=oIkGMggqNIrvDkweZFPh72RuZ1wQ/Jso0ofWP375YV5GAVO4jODxgAcTICo9PCazVYj0D0QDXh1OI/BKSpeo4MJVcF6E3WuywwOjVmQiMentV0dhZxqjuF7O3LzAmKzI+HoJvcWb6xERnd2wf15t+b5ca2ecPDAjJdsC/wMORQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744620237; c=relaxed/simple; bh=eUd5GxwszVXXzpuC1+ozLa4oZQpxUDf8OIF6/2qk9Ho=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CWYPXfubCNqbOaXOYU3I+1fucp2jWJ22hs5CmHn/QbBMm2jui+MHsgonEDakEuJ2u/5zVa3twrkp4mZrfav2YzA2heTKpqSldbKKZe26LvNKz2aqLH4Tg+FXnjimmAF444VTn7WJAcH636w95my/3slWGpWrkIdHj9a60xskKs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JMaaZInp; 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="JMaaZInp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E0BEC4CEEC; Mon, 14 Apr 2025 08:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744620236; bh=eUd5GxwszVXXzpuC1+ozLa4oZQpxUDf8OIF6/2qk9Ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JMaaZInpYv91Z0K+UTSGxHcfCYpKA001Mh0LT58uFmgEBS7yNsE8y0wmXIakIm8qh A2FpWGTbbqX7VYBXIdHQhK5+ctAt7oVFygD5USlZSXL9RAQQwgp94Nos2jZr5bUfi2 Z8Cc1YrDv6oFiHHVQ26a1DvpKVVSwZ2+S+YgOTsppjKiUwVfDKrOC8sTIsmggmRaly Y8Iv9FNtlTuZ+LWOKkRLxApeYCS2pWB/Mond34KJS3Ui+lNjq75E5zjZ4VSB73KjmI o77fpA+FWsNRMtOn3j/44u74tyOWZjzg0uCjCjIPmKA+PMHgh46b04gVjVoZpRNUyF r49Pc8F1Nhi9w== 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 v2 2/2] net: ethernet: ti: am65-cpsw: handle -EPROBE_DEFER Date: Mon, 14 Apr 2025 10:43:36 +0200 Message-Id: <20250414084336.4017237-3-mwalle@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250414084336.4017237-1-mwalle@kernel.org> References: <20250414084336.4017237-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 Reviewed-by: Andrew Lunn --- v2: - none 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 55a0c37da54c..988ce9119306 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); @@ -3561,6 +3563,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"); @@ -3577,16 +3589,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