All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Gantois <romain.gantois@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: 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>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 6/6] net: phy: dp83869: Fix link up reporting in SGMII bridge mode
Date: Tue, 02 Jul 2024 11:04:37 +0200	[thread overview]
Message-ID: <8435724.NyiUUSuA9g@fw-rgant> (raw)
In-Reply-To: <289c5122-759f-408a-a48a-a3719f0331f9@lunn.ch>

On lundi 1 juillet 2024 19:09:40 UTC+2 Andrew Lunn wrote:
> > +			if (dp83869->mod_phy) {
> > +				ret = phy_read_status(dp83869->mod_phy);
> > +				if (ret)
> > +					return ret;
> 
> Locking? When phylib does this in phy_check_link_status(), we have:
> 
> 	lockdep_assert_held(&phydev->lock);
> 
> I don't see anything which takes the downstreams PHY lock.
> 
> Is this also introducing race conditions? What happens if the link
> just went down? phy_check_link_status() takes actions. Will they still
> happen when phylib next talks to the downstream PHY? It is probably
> safer to call phy_check_link_status() than phy_read_status().

Given that the phylib state machine will call phy_check_link_status() itself,
I think that this call to phy_read_status() could be dropped entirely and that
dp83869_read_status() could just directly read mod_phy->{link,speed,duplex}.

This raises the question of a potential race condition when reading
mod_phy->{link, speed, duplex}. I haven't seen any kind of locking used in
other parts of the net subsystem when reading these parameters.

Thanks,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




  reply	other threads:[~2024-07-02  9:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  8:51 [PATCH net-next 0/6] net: phy: dp83869: Add support for downstream SFP cages Romain Gantois
2024-07-01  8:51 ` [PATCH net-next 1/6] net: phy: dp83869: Disable autonegotiation in RGMII/1000Base-X mode Romain Gantois
2024-07-01 16:40   ` Andrew Lunn
2024-07-02  8:44     ` Romain Gantois
2024-07-02  9:24       ` Russell King (Oracle)
2024-07-02  9:42         ` Romain Gantois
2024-07-02 10:15           ` Russell King (Oracle)
2024-07-02 13:01             ` Romain Gantois
2024-07-01  8:51 ` [PATCH net-next 2/6] net: phy: dp83869: Perform software restart after configuring op mode Romain Gantois
2024-07-01 16:44   ` Andrew Lunn
2024-07-02  8:45     ` Romain Gantois
2024-07-01  8:51 ` [PATCH net-next 3/6] net: phy: dp83869: Ensure that the FORCE_LINK_GOOD bit is cleared Romain Gantois
2024-07-01  8:51 ` [PATCH net-next 4/6] net: phy: dp83869: Support 1000Base-X and 100Base-FX SFP modules Romain Gantois
2024-07-01 16:49   ` Andrew Lunn
2024-07-01  8:51 ` [PATCH net-next 5/6] net: phy: dp83869: Support SGMII " Romain Gantois
2024-07-01 17:00   ` Andrew Lunn
2024-07-02  8:11     ` Romain Gantois
2024-07-02 13:21       ` Andrew Lunn
2024-07-02 14:56         ` Maxime Chevallier
2024-07-02 18:13           ` Russell King (Oracle)
2024-07-02 19:55             ` Andrew Lunn
2024-07-02 15:18         ` Russell King (Oracle)
2024-07-01  8:51 ` [PATCH net-next 6/6] net: phy: dp83869: Fix link up reporting in SGMII bridge mode Romain Gantois
2024-07-01 17:09   ` Andrew Lunn
2024-07-02  9:04     ` Romain Gantois [this message]
2024-07-02  9:28       ` Russell King (Oracle)

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=8435724.NyiUUSuA9g@fw-rgant \
    --to=romain.gantois@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.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.