netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
@ 2023-02-02 12:26 Radhey Shyam Pandey
  2023-02-02 13:10 ` Jiri Pirko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Radhey Shyam Pandey @ 2023-02-02 12:26 UTC (permalink / raw)
  To: nicolas.ferre, claudiu.beznea, davem, edumazet, kuba, pabeni, andrew
  Cc: git, netdev, linux-kernel, Radhey Shyam Pandey

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>
---
 drivers/net/ethernet/cadence/macb_main.c | 31 ++++++++++++------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 72e42820713d..6cda31520c42 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4627,25 +4627,26 @@ static int init_reset_optional(struct platform_device *pdev)
 		if (ret)
 			return dev_err_probe(&pdev->dev, ret,
 					     "failed to init SGMII PHY\n");
-	}
 
-	ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG);
-	if (!ret) {
-		u32 pm_info[2];
+		ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG);
+		if (!ret) {
+			u32 pm_info[2];
+
+			ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains",
+							 pm_info, ARRAY_SIZE(pm_info));
+			if (ret) {
+				dev_err(&pdev->dev, "Failed to read power management information\n");
+				goto err_out_phy_exit;
+			}
+			ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0);
+			if (ret)
+				goto err_out_phy_exit;
 
-		ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains",
-						 pm_info, ARRAY_SIZE(pm_info));
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to read power management information\n");
-			goto err_out_phy_exit;
+			ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
+			if (ret)
+				goto err_out_phy_exit;
 		}
-		ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0);
-		if (ret)
-			goto err_out_phy_exit;
 
-		ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
-		if (ret)
-			goto err_out_phy_exit;
 	}
 
 	/* Fully reset controller at hardware level if mapped in device tree */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
  2023-02-02 12:26 [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface Radhey Shyam Pandey
@ 2023-02-02 13:10 ` Jiri Pirko
  2023-02-02 13:46 ` Michal Simek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2023-02-02 13:10 UTC (permalink / raw)
  To: Radhey Shyam Pandey
  Cc: nicolas.ferre, claudiu.beznea, davem, edumazet, kuba, pabeni,
	andrew, git, netdev, linux-kernel

Thu, Feb 02, 2023 at 01:26:19PM CET, radhey.shyam.pandey@amd.com wrote:
>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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
  2023-02-02 12:26 [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface Radhey Shyam Pandey
  2023-02-02 13:10 ` Jiri Pirko
@ 2023-02-02 13:46 ` Michal Simek
  2023-02-03 11:23 ` Claudiu.Beznea
  2023-02-04  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2023-02-02 13:46 UTC (permalink / raw)
  To: Radhey Shyam Pandey, nicolas.ferre, claudiu.beznea, davem,
	edumazet, kuba, pabeni, andrew
  Cc: git, netdev, linux-kernel



On 2/2/23 13:26, Radhey Shyam Pandey wrote:
> 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>

Reported-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
  2023-02-02 12:26 [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface Radhey Shyam Pandey
  2023-02-02 13:10 ` Jiri Pirko
  2023-02-02 13:46 ` Michal Simek
@ 2023-02-03 11:23 ` Claudiu.Beznea
  2023-02-04  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Claudiu.Beznea @ 2023-02-03 11:23 UTC (permalink / raw)
  To: radhey.shyam.pandey, Nicolas.Ferre, davem, edumazet, kuba,
	pabeni, andrew
  Cc: git, netdev, linux-kernel

On 02.02.2023 14:26, Radhey Shyam Pandey wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/net/ethernet/cadence/macb_main.c | 31 ++++++++++++------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 72e42820713d..6cda31520c42 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4627,25 +4627,26 @@ static int init_reset_optional(struct platform_device *pdev)
>                 if (ret)
>                         return dev_err_probe(&pdev->dev, ret,
>                                              "failed to init SGMII PHY\n");
> -       }
> 
> -       ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG);
> -       if (!ret) {
> -               u32 pm_info[2];
> +               ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG);
> +               if (!ret) {
> +                       u32 pm_info[2];
> +
> +                       ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains",
> +                                                        pm_info, ARRAY_SIZE(pm_info));
> +                       if (ret) {
> +                               dev_err(&pdev->dev, "Failed to read power management information\n");
> +                               goto err_out_phy_exit;
> +                       }
> +                       ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0);
> +                       if (ret)
> +                               goto err_out_phy_exit;
> 
> -               ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains",
> -                                                pm_info, ARRAY_SIZE(pm_info));
> -               if (ret) {
> -                       dev_err(&pdev->dev, "Failed to read power management information\n");
> -                       goto err_out_phy_exit;
> +                       ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
> +                       if (ret)
> +                               goto err_out_phy_exit;
>                 }
> -               ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0);
> -               if (ret)
> -                       goto err_out_phy_exit;
> 
> -               ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1);
> -               if (ret)
> -                       goto err_out_phy_exit;
>         }
> 
>         /* Fully reset controller at hardware level if mapped in device tree */
> --
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
  2023-02-02 12:26 [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface Radhey Shyam Pandey
                   ` (2 preceding siblings ...)
  2023-02-03 11:23 ` Claudiu.Beznea
@ 2023-02-04  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-04  4:00 UTC (permalink / raw)
  To: Radhey Shyam Pandey
  Cc: nicolas.ferre, claudiu.beznea, davem, edumazet, kuba, pabeni,
	andrew, git, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 2 Feb 2023 17:56:19 +0530 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - net: macb: Perform zynqmp dynamic configuration only for SGMII interface
    https://git.kernel.org/netdev/net/c/c9011b028e95

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-04  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 12:26 [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface Radhey Shyam Pandey
2023-02-02 13:10 ` Jiri Pirko
2023-02-02 13:46 ` Michal Simek
2023-02-03 11:23 ` Claudiu.Beznea
2023-02-04  4:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).