diff mbox series

[net-next] net: txgbe: use phylink_pcs_change() to report PCS link change events

Message ID E1s0OH2-009hgx-Qw@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit dd1941f801bc958d2ee13f5be8b38db6b034b806
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: txgbe: use phylink_pcs_change() to report PCS link change events | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for 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: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: mengyuanlou@net-swift.com
netdev/build_clang success Errors and warnings before: 937 this patch: 937
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-29--15-00 (tests: 994)

Commit Message

Russell King (Oracle) April 26, 2024, 4:18 p.m. UTC
Use phylink_pcs_change() when reporting changes in PCS link state to
phylink as the interrupts are informing us about changes to the PCS
state.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiawen Wu April 28, 2024, 7:50 a.m. UTC | #1
On Sat, April 27, 2024 12:18 AM, Russell King <rmk@armlinux.org.uk> wrote:
> Use phylink_pcs_change() when reporting changes in PCS link state to
> phylink as the interrupts are informing us about changes to the PCS
> state.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> index 93295916b1d2..5f502265f0a6 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> @@ -302,7 +302,7 @@ irqreturn_t txgbe_link_irq_handler(int irq, void *data)
>  	status = rd32(wx, TXGBE_CFG_PORT_ST);
>  	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
> 
> -	phylink_mac_change(wx->phylink, up);
> +	phylink_pcs_change(&txgbe->xpcs->pcs, up);
> 
>  	return IRQ_HANDLED;
>  }

Does this only affect the log of phylink_dbg()?
If so,
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
Russell King (Oracle) April 28, 2024, 8:02 a.m. UTC | #2
On Sun, Apr 28, 2024 at 03:50:24PM +0800, Jiawen Wu wrote:
> On Sat, April 27, 2024 12:18 AM, Russell King <rmk@armlinux.org.uk> wrote:
> > Use phylink_pcs_change() when reporting changes in PCS link state to
> > phylink as the interrupts are informing us about changes to the PCS
> > state.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> >  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> > index 93295916b1d2..5f502265f0a6 100644
> > --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> > +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> > @@ -302,7 +302,7 @@ irqreturn_t txgbe_link_irq_handler(int irq, void *data)
> >  	status = rd32(wx, TXGBE_CFG_PORT_ST);
> >  	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
> > 
> > -	phylink_mac_change(wx->phylink, up);
> > +	phylink_pcs_change(&txgbe->xpcs->pcs, up);
> > 
> >  	return IRQ_HANDLED;
> >  }
> 
> Does this only affect the log of phylink_dbg()?

It means that phylink won't react unless the PCS is being used. The link
status should be coming from the PCS block since MII itself doesn't have
the notion of link status.

I'm trying to get rid of phylink_mac_change(), which was fine back in
the days when it was invented (when phylink didn't distinguish between
the MAC and PCS) but it now does.
patchwork-bot+netdevbpf@kernel.org April 30, 2024, 2:20 a.m. UTC | #3
Hello:

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

On Fri, 26 Apr 2024 17:18:08 +0100 you wrote:
> Use phylink_pcs_change() when reporting changes in PCS link state to
> phylink as the interrupts are informing us about changes to the PCS
> state.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: txgbe: use phylink_pcs_change() to report PCS link change events
    https://git.kernel.org/netdev/net-next/c/dd1941f801bc

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 93295916b1d2..5f502265f0a6 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -302,7 +302,7 @@  irqreturn_t txgbe_link_irq_handler(int irq, void *data)
 	status = rd32(wx, TXGBE_CFG_PORT_ST);
 	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
 
-	phylink_mac_change(wx->phylink, up);
+	phylink_pcs_change(&txgbe->xpcs->pcs, up);
 
 	return IRQ_HANDLED;
 }