Skip to content

Commit c9011b0

Browse files
Radhey Shyam Pandeykuba-moo
authored andcommitted
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: 32cee78 ("net: macb: Add zynqmp SGMII dynamic configuration support") Signed-off-by: Radhey Shyam Pandey <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reported-by: Michal Simek <[email protected]> Tested-by: Michal Simek <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cbe8319 commit c9011b0

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4627,25 +4627,26 @@ static int init_reset_optional(struct platform_device *pdev)
46274627
if (ret)
46284628
return dev_err_probe(&pdev->dev, ret,
46294629
"failed to init SGMII PHY\n");
4630-
}
46314630

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];
4634+
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;
46354644

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;
4645+
ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
4646+
if (ret)
4647+
goto err_out_phy_exit;
46414648
}
4642-
ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0);
4643-
if (ret)
4644-
goto err_out_phy_exit;
46454649

4646-
ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
4647-
if (ret)
4648-
goto err_out_phy_exit;
46494650
}
46504651

46514652
/* Fully reset controller at hardware level if mapped in device tree */

0 commit comments

Comments
 (0)