From: <Claudiu.Beznea@microchip.com>
To: <radhey.shyam.pandey@amd.com>, <Nicolas.Ferre@microchip.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <andrew@lunn.ch>
Cc: <git@amd.com>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: macb: Perform zynqmp dynamic configuration only for SGMII interface
Date: Fri, 3 Feb 2023 11:23:29 +0000 [thread overview]
Message-ID: <b8c85e4e-d426-a68b-2d3d-704fc7675963@microchip.com> (raw)
In-Reply-To: <1675340779-27499-1-git-send-email-radhey.shyam.pandey@amd.com>
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
>
next prev parent reply other threads:[~2023-02-03 11:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-02-04 4:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8c85e4e-d426-a68b-2d3d-704fc7675963@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=git@amd.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).