From: Andrew Lunn <andrew@lunn.ch>
To: Aleksei Sviridkin <f@lex.la>
Cc: Vladimir Oltean <olteanv@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] net: phy: restore the interrupt after a generic-driver bind cycle
Date: Sat, 22 Aug 2026 21:28:48 +0200 [thread overview]
Message-ID: <7e23f6a3-0fc0-4a6b-b80f-4bf70455e29b@lunn.ch> (raw)
In-Reply-To: <20260822155259.87146-3-f@lex.la>
> if (phydev->is_genphy_driven) {
> + /* Give back the interrupt phy_probe() parked when the generic
> + * driver bound, before the device becomes bindable again. A
> + * PHY that was in polling mode for any other reason had
> + * PHY_POLL saved, and the restore is skipped.
> + */
> + if (phydev->genphy_saved_irq > 0 && phydev->irq == PHY_POLL)
> + phydev->irq = phydev->genphy_saved_irq;
> + phydev->genphy_saved_irq = 0;
> +
I _think_ it can be simpler:
int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
struct phy_device *phy,
struct fwnode_handle *child, u32 addr)
{
int rc;
rc = fwnode_irq_get(child, 0);
/* Don't wait forever if the IRQ provider doesn't become available,
* just fall back to poll mode
*/
if (rc == -EPROBE_DEFER)
rc = driver_deferred_probe_check_state(&phy->mdio.dev);
if (rc == -EPROBE_DEFER)
return rc;
if (rc > 0) {
phy->irq = rc;
mdio->irq[addr] = rc;
} else {
phy->irq = mdio->irq[addr];
}
So if there was an interrupt in DT, mdio->irq[addr] has been set to
it. So all i think you need is
phydev->irq = mdio->irq[addr];
And a comment.
Andrew
---
pw-bot: cr
next prev parent reply other threads:[~2026-08-22 19:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 15:52 [PATCH net-next 0/3] net: survive a PHY whose driver arrives after the switch probes Aleksei Sviridkin
2026-08-22 15:52 ` [PATCH net-next 1/3] net: phylink: unwind the PHY binding when bringup fails late Aleksei Sviridkin
2026-08-22 17:30 ` Andrew Lunn
2026-08-22 15:52 ` [PATCH net-next 2/3] net: phy: restore the interrupt after a generic-driver bind cycle Aleksei Sviridkin
2026-08-22 19:28 ` Andrew Lunn [this message]
2026-08-22 15:52 ` [PATCH net-next 3/3] net: dsa: connect a late-arriving PHY at ifup Aleksei Sviridkin
2026-08-22 19:38 ` Andrew Lunn
2026-08-23 0:05 ` Aleksei Sviridkin
2026-08-23 1:24 ` Andrew Lunn
2026-08-23 12:37 ` Aleksei Sviridkin
2026-08-23 15:20 ` Andrew Lunn
2026-08-24 2:40 ` Aleksei Sviridkin
2026-08-24 16:25 ` [PATCH net-next 0/3] net: survive a PHY whose driver arrives after the switch probes Andrew Lunn
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=7e23f6a3-0fc0-4a6b-b80f-4bf70455e29b@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f@lex.la \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®