Skip to contentSkip to conversation

net: xilinx: axienet: Treat xlnx,rxmem as a required property

PATCH Applied Suraj Gupta 3 participants 3 messages Aug 6 – Aug 10

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: xilinx: axienet: Treat xlnx,rxmem as a required property

"xlnx,rxmem" device-tree property is used to learn the size of the Rx/Tx packet buffer built into the ethernet IP, but return value of of_property_read_u32() is ignored. When the property is absent lp->rxmem is left at 0, which silently limits the interface to the default MTU and disables jumbo frames with no indication of the misconfiguration.

"xlnx,rxmem" has been documented as a required property since the binding was introduced. Check the return value of of_property_read_u32() and fail probe when the property is missing, so a misconfigured device tree is reported rather than silently degrading functionality.

---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +4 -1
index fcf517069d16..1722b7038f34 100644
@@ -2898,7 +2898,10 @@ static int axienet_probe(struct platform_device *pdev)
 	 * Here we check for memory allocated for Rx/Tx in the hardware from
 	 * the device-tree and accordingly set flags.
 	 */
-	of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
+	ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret,
+				     "failed to read xlnx,rxmem property\n");
 
 	lp->switch_x_sgmii = of_property_read_bool(pdev->dev.of_node,
 						   "xlnx,switch-x-sgmii");
Signature · 1 line
2.25.1
Reviewed-by Radhey Shyam Pandey on v1 1/1
#1 lore raw
Quoted 6 lines · Suraj Gupta

"xlnx,rxmem" device-tree property is used to learn the size of the Rx/Tx packet buffer built into the ethernet IP, but return value of of_property_read_u32() is ignored. When the property is absent lp->rxmem is left at 0, which silently limits the interface to the default MTU and disables jumbo frames with no indication of the misconfiguration.

Quoted 6 lines

"xlnx,rxmem" has been documented as a required property since the binding was introduced. Check the return value of of_property_read_u32() and fail probe when the property is missing, so a misconfigured device tree is reported rather than silently degrading functionality.

Thanks!> ---

Quoted 19 lines
  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +4 -1
index fcf517069d16..1722b7038f34 100644
@@ -2898,7 +2898,10 @@ static int axienet_probe(struct platform_device *pdev)
  	 * Here we check for memory allocated for Rx/Tx in the hardware from
  	 * the device-tree and accordingly set flags.
  	 */
-	of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
+	ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret,
+				     "failed to read xlnx,rxmem property\n");
 
  	lp->switch_x_sgmii = of_property_read_bool(pdev->dev.of_node,
  						   "xlnx,switch-x-sgmii");
#2 lore raw
In reply to Suraj Gupta
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Thu, 6 Aug 2026 22:32:53 +0530 you wrote:

"xlnx,rxmem" device-tree property is used to learn the size of the Rx/Tx packet buffer built into the ethernet IP, but return value of of_property_read_u32() is ignored. When the property is absent lp->rxmem is left at 0, which silently limits the interface to the default MTU and disables jumbo frames with no indication of the misconfiguration.

Quoted 6 lines

"xlnx,rxmem" has been documented as a required property since the binding was introduced. Check the return value of of_property_read_u32() and fail probe when the property is missing, so a misconfigured device tree is reported rather than silently degrading functionality.

[...]

Here is the summary with links:
- [net-next] net: xilinx: axienet: Treat xlnx,rxmem as a required property

    https://git.kernel.org/netdev/net-next/c/34b270e7893f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html