All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Andre Edich <andre.edich@microchip.com>,
	Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH net v4 0/3] net: phy: smsc: use IRQ + relaxed polling to fix missed link-up
Date: Thu, 18 Sep 2025 21:08:14 +0100	[thread overview]
Message-ID: <aMxmrnmDEqn0Nvx1@shell.armlinux.org.uk> (raw)
In-Reply-To: <a873e8e3-e1c9-4e82-b3e8-4b1cc8052a73@lunn.ch>

On Thu, Sep 18, 2025 at 09:48:33PM +0200, Andrew Lunn wrote:
> > How about a minimal change instead: conditionally call
> > phy_queue_state_machine() from lan87xx_config_aneg()? That would trigger
> > a poll in the broken mode without touching phydev->irq or core teardown
> > paths. Seems less intrusive than rewriting IRQ handling.
> 
> It is currently a static function, so that would have to change.
> 
> Or it might be better to add phy_trigger_machine_soon(), using the
> default 1 second delay? And i would document it as only to be used by
> broken PHYs, to try to stop it being abused. Anybody using it needs to
> acknowledge their PHY is broken.

Couldn't this be even simpler? If the problem is the interrupt
isn't raised, then how about the following.

(This assumes there is no issue with calling phy_trigger_machine()
from IRQ context.)

When lan87xx_config_aneg() detects that we're configuring into the
broken mode, start a timer (which has been pre-initialised at probe
time.) When the timer fires, call phy_trigger_machine(), and modify
the timer for the next poll interval.

When lan87xx_config_aneg() detects that we aren't in the broken
mode, delete the timer synchronously. Also delete the timer when
the PHY is suspended or unbound.

This requires no changes necessary to the core phylib code, and no
fiddling with fragile state either. Does it matter if the
interrupt does fire? Not really.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

      reply	other threads:[~2025-09-18 20:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14  9:52 [PATCH net v4 0/3] net: phy: smsc: use IRQ + relaxed polling to fix missed link-up Oleksij Rempel
2025-07-14  9:52 ` [PATCH net v4 1/3] net: phy: enable polling when driver implements get_next_update_time Oleksij Rempel
2025-07-14  9:52 ` [PATCH net v4 2/3] net: phy: allow drivers to disable polling via get_next_update_time() Oleksij Rempel
2025-07-14  9:52 ` [PATCH net v4 3/3] net: phy: smsc: recover missed link-up IRQs on LAN8700 with adaptive polling Oleksij Rempel
2025-07-17  0:20 ` [PATCH net v4 0/3] net: phy: smsc: use IRQ + relaxed polling to fix missed link-up Jakub Kicinski
2025-07-18 13:58 ` Andrew Lunn
2025-09-17 13:00   ` Oleksij Rempel
2025-09-18 19:48     ` Andrew Lunn
2025-09-18 20:08       ` Russell King (Oracle) [this message]

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=aMxmrnmDEqn0Nvx1@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andre.edich@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --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.