diff mbox series

net: axienet: Set mac_managed_pm

Message ID 20250217055843.19799-1-nick.hu@sifive.com (mailing list archive)
State Accepted
Commit a370295367b55662a32a4be92565fe72a5aa79bb
Delegated to: Netdev Maintainers
Headers show
Series net: axienet: Set mac_managed_pm | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: linux-riscv@lists.infradead.org samuel.holland@sifive.com paul.walmsley@sifive.com
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 4 this patch: 4
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-18--00-00 (tests: 891)

Commit Message

Nick Hu Feb. 17, 2025, 5:58 a.m. UTC
The external PHY will undergo a soft reset twice during the resume process
when it wake up from suspend. The first reset occurs when the axienet
driver calls phylink_of_phy_connect(), and the second occurs when
mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
external PHY does not reinitialize the internal PHY, which causes issues
with the internal PHY, resulting in the PHY link being down. To prevent
this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
function.

Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
Signed-off-by: Nick Hu <nick.hu@sifive.com>
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Keller, Jacob E Feb. 19, 2025, 11:29 p.m. UTC | #1
On 2/16/2025 9:58 PM, Nick Hu wrote:
Nit: subject should include the "net" prefix since this is clearly a bug
fix.

> The external PHY will undergo a soft reset twice during the resume process
> when it wake up from suspend. The first reset occurs when the axienet
> driver calls phylink_of_phy_connect(), and the second occurs when
> mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> external PHY does not reinitialize the internal PHY, which causes issues
> with the internal PHY, resulting in the PHY link being down. To prevent
> this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> function.
> 
> Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
> Signed-off-by: Nick Hu <nick.hu@sifive.com>
> ---

Otherwise, the fix seems correct to me.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 2ffaad0b0477..2deeb982bf6b 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
>  
>  	lp->phylink_config.dev = &ndev->dev;
>  	lp->phylink_config.type = PHYLINK_NETDEV;
> +	lp->phylink_config.mac_managed_pm = true;
>  	lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
>  		MAC_10FD | MAC_100FD | MAC_1000FD;
>
Nick Hu Feb. 20, 2025, 2:47 a.m. UTC | #2
Hi Jacob

On Thu, Feb 20, 2025 at 7:29 AM Jacob Keller <jacob.e.keller@intel.com> wrote:
>
>
>
> On 2/16/2025 9:58 PM, Nick Hu wrote:
> Nit: subject should include the "net" prefix since this is clearly a bug
> fix.
>
I've added the 'net' prefix to the subject 'net: axienet: Set
mac_managed_pm'. Is there something I'm missing?

> > The external PHY will undergo a soft reset twice during the resume process
> > when it wake up from suspend. The first reset occurs when the axienet
> > driver calls phylink_of_phy_connect(), and the second occurs when
> > mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> > external PHY does not reinitialize the internal PHY, which causes issues
> > with the internal PHY, resulting in the PHY link being down. To prevent
> > this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> > function.
> >
> > Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
> > Signed-off-by: Nick Hu <nick.hu@sifive.com>
> > ---
>
> Otherwise, the fix seems correct to me.
>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>
> >  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > index 2ffaad0b0477..2deeb982bf6b 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > @@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
> >
> >       lp->phylink_config.dev = &ndev->dev;
> >       lp->phylink_config.type = PHYLINK_NETDEV;
> > +     lp->phylink_config.mac_managed_pm = true;
> >       lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
> >               MAC_10FD | MAC_100FD | MAC_1000FD;
> >
>

Regards,
Nick
Michal Swiatkowski Feb. 20, 2025, 6:56 a.m. UTC | #3
On Thu, Feb 20, 2025 at 10:47:40AM +0800, Nick Hu wrote:
> Hi Jacob
> 
> On Thu, Feb 20, 2025 at 7:29 AM Jacob Keller <jacob.e.keller@intel.com> wrote:
> >
> >
> >
> > On 2/16/2025 9:58 PM, Nick Hu wrote:
> > Nit: subject should include the "net" prefix since this is clearly a bug
> > fix.
> >
> I've added the 'net' prefix to the subject 'net: axienet: Set
> mac_managed_pm'. Is there something I'm missing?
> 

It should be [PATCH net] net: axienet: Set mac_managed_pm
Like here for example [1]. You can look at netdev FAQ [2]. It is
described there how to specify the subject.

Probably you don't need to resend it only because of that.

[1] https://lore.kernel.org/netdev/CAL+tcoC3TuZPTwnHTDvXC+JPoJbgW2UywZ2=xv=E=utokb3pCQ@mail.gmail.com/T/#m2b5603fbf355216ab035aa0f69c10c5f4ba98772
[2] https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Thanks,
Michal

> > > The external PHY will undergo a soft reset twice during the resume process
> > > when it wake up from suspend. The first reset occurs when the axienet
> > > driver calls phylink_of_phy_connect(), and the second occurs when
> > > mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> > > external PHY does not reinitialize the internal PHY, which causes issues
> > > with the internal PHY, resulting in the PHY link being down. To prevent
> > > this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> > > function.
> > >
> > > Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
> > > Signed-off-by: Nick Hu <nick.hu@sifive.com>
> > > ---
> >
> > Otherwise, the fix seems correct to me.
> >
> > Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> >
> > >  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > index 2ffaad0b0477..2deeb982bf6b 100644
> > > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > @@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
> > >
> > >       lp->phylink_config.dev = &ndev->dev;
> > >       lp->phylink_config.type = PHYLINK_NETDEV;
> > > +     lp->phylink_config.mac_managed_pm = true;
> > >       lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
> > >               MAC_10FD | MAC_100FD | MAC_1000FD;
> > >
> >
> 
> Regards,
> Nick
Nick Hu Feb. 20, 2025, 7:04 a.m. UTC | #4
Hi Michal

Thanks for the information! I'll pay attention next time.

On Thu, Feb 20, 2025 at 3:00 PM Michal Swiatkowski
<michal.swiatkowski@linux.intel.com> wrote:
>
> On Thu, Feb 20, 2025 at 10:47:40AM +0800, Nick Hu wrote:
> > Hi Jacob
> >
> > On Thu, Feb 20, 2025 at 7:29 AM Jacob Keller <jacob.e.keller@intel.com> wrote:
> > >
> > >
> > >
> > > On 2/16/2025 9:58 PM, Nick Hu wrote:
> > > Nit: subject should include the "net" prefix since this is clearly a bug
> > > fix.
> > >
> > I've added the 'net' prefix to the subject 'net: axienet: Set
> > mac_managed_pm'. Is there something I'm missing?
> >
>
> It should be [PATCH net] net: axienet: Set mac_managed_pm
> Like here for example [1]. You can look at netdev FAQ [2]. It is
> described there how to specify the subject.
>
> Probably you don't need to resend it only because of that.
>
> [1] https://lore.kernel.org/netdev/CAL+tcoC3TuZPTwnHTDvXC+JPoJbgW2UywZ2=xv=E=utokb3pCQ@mail.gmail.com/T/#m2b5603fbf355216ab035aa0f69c10c5f4ba98772
> [2] https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt
>
> Thanks,
> Michal
>
> > > > The external PHY will undergo a soft reset twice during the resume process
> > > > when it wake up from suspend. The first reset occurs when the axienet
> > > > driver calls phylink_of_phy_connect(), and the second occurs when
> > > > mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> > > > external PHY does not reinitialize the internal PHY, which causes issues
> > > > with the internal PHY, resulting in the PHY link being down. To prevent
> > > > this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> > > > function.
> > > >
> > > > Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
> > > > Signed-off-by: Nick Hu <nick.hu@sifive.com>
> > > > ---
> > >
> > > Otherwise, the fix seems correct to me.
> > >
> > > Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> > >
> > > >  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > > index 2ffaad0b0477..2deeb982bf6b 100644
> > > > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > > > @@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
> > > >
> > > >       lp->phylink_config.dev = &ndev->dev;
> > > >       lp->phylink_config.type = PHYLINK_NETDEV;
> > > > +     lp->phylink_config.mac_managed_pm = true;
> > > >       lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
> > > >               MAC_10FD | MAC_100FD | MAC_1000FD;
> > > >
> > >
> >
> > Regards,
> > Nick

Regards,
Nick
patchwork-bot+netdevbpf@kernel.org Feb. 20, 2025, 8:30 a.m. UTC | #5
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 17 Feb 2025 13:58:42 +0800 you wrote:
> The external PHY will undergo a soft reset twice during the resume process
> when it wake up from suspend. The first reset occurs when the axienet
> driver calls phylink_of_phy_connect(), and the second occurs when
> mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> external PHY does not reinitialize the internal PHY, which causes issues
> with the internal PHY, resulting in the PHY link being down. To prevent
> this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> function.
> 
> [...]

Here is the summary with links:
  - net: axienet: Set mac_managed_pm
    https://git.kernel.org/netdev/net/c/a370295367b5

You are awesome, thank you!
Jakub Kicinski Feb. 20, 2025, 4:58 p.m. UTC | #6
On Mon, 17 Feb 2025 13:58:42 +0800 Nick Hu wrote:
> The external PHY will undergo a soft reset twice during the resume process
> when it wake up from suspend. The first reset occurs when the axienet
> driver calls phylink_of_phy_connect(), and the second occurs when
> mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the
> external PHY does not reinitialize the internal PHY, which causes issues
> with the internal PHY, resulting in the PHY link being down. To prevent
> this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume()
> function.
> 
> Fixes: a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
> Signed-off-by: Nick Hu <nick.hu@sifive.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 2ffaad0b0477..2deeb982bf6b 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -3078,6 +3078,7 @@  static int axienet_probe(struct platform_device *pdev)
 
 	lp->phylink_config.dev = &ndev->dev;
 	lp->phylink_config.type = PHYLINK_NETDEV;
+	lp->phylink_config.mac_managed_pm = true;
 	lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
 		MAC_10FD | MAC_100FD | MAC_1000FD;