From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Birger Koblitz <mail@birger-koblitz.de>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Eric Dumazet <edumazet@kernel.org>
Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
Jianhui Xu <neuromoments@gmail.com>,
Emir Beganovic <beganovic.emir@gmail.com>,
Nicolai Buchwitz <nb@tipi-net.de>
Subject: Re: [PATCH net-next v20 01/13] phylink: Add phylink_mac_interrupt
Date: Fri, 6 Nov 2026 11:11:22 +0100 [thread overview]
Message-ID: <69be2cfe-e296-4f90-ad19-0bd48a83e287@bootlin.com> (raw)
In-Reply-To: <20261106-ax88179a-v20-1-37b5a1189983@birger-koblitz.de>
Hi,
On 11/6/26 08:21, Birger Koblitz wrote:
> Add the phylink_mac_interrupt() function to phylink, which
> passes a link-change interrupt received by the MAC to phylib.
> This function can be used by drivers which want to avoid
> polling the PHY and instead rely on an interrupt received by
> the MAC when a link-change happens.
>
> Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
> ---
> drivers/net/phy/phylink.c | 20 ++++++++++++++++++++
> include/linux/phylink.h | 1 +
> 2 files changed, 21 insertions(+)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index e885da1c28311a12a869e29ceb3c96886f31adc6..a87eaa2f3db5bef8fe56e12b90375bdb7f9c52e7 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -1616,6 +1616,26 @@ static bool phylink_link_is_up(struct phylink *pl)
> return pl->netdev ? netif_carrier_ok(pl->netdev) : pl->old_link_state;
> }
>
> +/**
> + * phylink_mac_interrupt() - wrapper for phy_mac_interrupt()
> + * @pl: a pointer to a &struct phylink returned from phylink_create()
> + *
> + * Passes a link-change interrupt received by the MAC to phylib.
> + * This function may be called in interrupt context, and therefore cannot take
> + * a mutex. However, it is safe to assume that the reference to phy does not
> + * disappear during the call, as only an SFP module may be unplugged to make a
> + * PHY disappear. SFP modules however do not support interrupts.
I don't see the relevance of PHY SFP supporting interrupts or not here,
this just re-triggers the PHY state machine. Looks like a comment to
make sashiko happy.
Anyways, I'm OK with the approach, maybe reword that comment if you need
to respin,
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
> + */
> +void phylink_mac_interrupt(struct phylink *pl)
> +{
> + struct phy_device *phy;
> +
> + phy = pl->phydev;
> + if (phy)
> + phy_mac_interrupt(phy);
> +}
> +EXPORT_SYMBOL_GPL(phylink_mac_interrupt);
> +
> static void phylink_resolve(struct work_struct *w)
> {
> struct phylink *pl = container_of(w, struct phylink, resolve);
> diff --git a/include/linux/phylink.h b/include/linux/phylink.h
> index 3a88a69882a610afb868b55df6f6e77aea918649..a7b6294cc4a075bd2aaa43ed6484de17a6cb88b1 100644
> --- a/include/linux/phylink.h
> +++ b/include/linux/phylink.h
> @@ -768,6 +768,7 @@ int phylink_ethtool_set_eee(struct phylink *link, struct ethtool_keee *eee);
> int phylink_mii_ioctl(struct phylink *, struct ifreq *, int);
> int phylink_speed_down(struct phylink *pl, bool sync);
> int phylink_speed_up(struct phylink *pl);
> +void phylink_mac_interrupt(struct phylink *pl);
>
> #define phylink_zero(bm) \
> bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS)
>
next prev parent reply other threads:[~2026-11-06 10:11 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 7:21 [PATCH net-next v20 00/13] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-11-06 7:21 ` [PATCH net-next v20 01/13] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-11-06 10:11 ` Maxime Chevallier [this message]
2026-11-06 15:32 ` Birger Koblitz
2026-11-06 15:55 ` Andrew Lunn
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-10 4:46 ` Birger Koblitz
2026-11-10 16:30 ` Andrew Lunn
2026-11-10 16:58 ` Birger Koblitz
2026-11-06 7:21 ` [PATCH net-next v20 02/13] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-06 7:21 ` [PATCH net-next v20 03/13] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 04/13] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 05/13] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 06/13] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 07/13] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 10/13] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 11/13] ax88179_178a: Update driver name and information Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 12/13] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
2026-11-06 7:21 ` [PATCH net-next v20 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-11-07 7:21 ` sashiko-bot
2026-11-10 1:38 ` netdev-bot+sashiko
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=69be2cfe-e296-4f90-ad19-0bd48a83e287@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=beganovic.emir@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kernel@xen0n.name \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=loongarch@lists.linux.dev \
--cc=mail@birger-koblitz.de \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=neuromoments@gmail.com \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.