Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: macb: Perform zynqmp dynamic configuration only for SGMII interface

In zynqmp platforms where firmware supports dynamic SGMII configuration
but has other non-SGMII ethernet devices, it fails them with no packets
received at the RX interface.

To fix this behaviour perform SGMII dynamic configuration only
for the SGMII phy interface.

Fixes: 32cee7818111 ("net: macb: Add zynqmp SGMII dynamic configuration support")
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reported-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1675340779-27499-1-git-send-email-radhey.shyam.pandey@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Radhey Shyam Pandey and committed by
Jakub Kicinski
c9011b02 cbe83191

+16 -15
+16 -15
drivers/net/ethernet/cadence/macb_main.c
··· 4627 4627 if (ret) 4628 4628 return dev_err_probe(&pdev->dev, ret, 4629 4629 "failed to init SGMII PHY\n"); 4630 - } 4631 4630 4632 - ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); 4633 - if (!ret) { 4634 - u32 pm_info[2]; 4631 + ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); 4632 + if (!ret) { 4633 + u32 pm_info[2]; 4635 4634 4636 - ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", 4637 - pm_info, ARRAY_SIZE(pm_info)); 4638 - if (ret) { 4639 - dev_err(&pdev->dev, "Failed to read power management information\n"); 4640 - goto err_out_phy_exit; 4635 + ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", 4636 + pm_info, ARRAY_SIZE(pm_info)); 4637 + if (ret) { 4638 + dev_err(&pdev->dev, "Failed to read power management information\n"); 4639 + goto err_out_phy_exit; 4640 + } 4641 + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); 4642 + if (ret) 4643 + goto err_out_phy_exit; 4644 + 4645 + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); 4646 + if (ret) 4647 + goto err_out_phy_exit; 4641 4648 } 4642 - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); 4643 - if (ret) 4644 - goto err_out_phy_exit; 4645 4649 4646 - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); 4647 - if (ret) 4648 - goto err_out_phy_exit; 4649 4650 } 4650 4651 4651 4652 /* Fully reset controller at hardware level if mapped in device tree */