Netdev List
 help / color / mirror / Atom feed
From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Nathan Whitehorn" <nwhitehorn@pa.msu.edu>, <netdev@vger.kernel.org>
Cc: <conor.dooley@microchip.com>, <charles.perry@microchip.com>,
	<andrew@lunn.ch>
Subject: Re: [PATCH net-next v3 1/2] net: macb: Poll for link state changes when using the internal PCS.
Date: Wed, 05 Aug 2026 21:43:03 +0200	[thread overview]
Message-ID: <DKH9MEANKO19.1B5B9Y1V1YEXY@bootlin.com> (raw)
In-Reply-To: <20260729192748.6928-2-nwhitehorn@pa.msu.edu>

Hello Nathan,

On Wed Jul 29, 2026 at 9:21 PM CEST, Nathan Whitehorn wrote:
> When used with an offboard transceiver (e.g. an SFP), link state needs
> to be measured at the PCS rather than an onboard PHY. Poll the link
> state when the PCS is active to allow the kernel to detect link state
> changes in this case.
>
> Signed-off-by: Nathan Whitehorn <nwhitehorn@pa.msu.edu>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index d394f1f43b68..c15a9c7e69d3 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1025,6 +1025,7 @@ static int macb_mii_probe(struct net_device *dev)
>  	struct macb *bp = netdev_priv(dev);
>  
>  	bp->phylink_sgmii_pcs.ops = &macb_phylink_pcs_ops;
> +	bp->phylink_sgmii_pcs.poll = true;
>  	bp->phylink_usx_pcs.ops = &macb_phylink_usx_pcs_ops;
>  
>  	bp->phylink_config.dev = &dev->dev;

Hardware has an IRQ for that, would you want to use it instead of
polling? The user guide contains more info.

   /* Bitfields in ISR/IER/IDR/IMR */
   ...
   #define MACB_ISR_LINK_OFFSET  9 /* Enable link change interrupt */
   #define MACB_ISR_LINK_SIZE 1
   ...

I've checked with an on-board SGMII PHY and I get an IRQ once unmasked.

If you don't care, then:

Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com>

Regards,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2026-08-05 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 19:21 [PATCH net-next v3 0/2] net: macb: 1000BASE-X on internal PCS Nathan Whitehorn
2026-07-29 19:21 ` [PATCH net-next v3 1/2] net: macb: Poll for link state changes when using the " Nathan Whitehorn
2026-08-05 19:43   ` Théo Lebrun [this message]
2026-08-05 20:14     ` Nathan Whitehorn
2026-07-29 19:21 ` [PATCH net-next v3 2/2] net: macb: add support for 1000BASE-X autonegotiation to PCS Nathan Whitehorn
2026-08-04  8:37   ` Paolo Abeni
2026-08-04 15:08     ` Nathan Whitehorn
2026-08-05 19:59       ` Théo Lebrun

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=DKH9MEANKO19.1B5B9Y1V1YEXY@bootlin.com \
    --to=theo.lebrun@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=charles.perry@microchip.com \
    --cc=conor.dooley@microchip.com \
    --cc=netdev@vger.kernel.org \
    --cc=nwhitehorn@pa.msu.edu \
    /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