netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] Resolve races in phy accessors
@ 2018-01-02 10:52 Russell King - ARM Linux
  2018-01-02 10:58 ` [PATCH net-next v2 1/7] net: mdiobus: add unlocked accessors Russell King
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Russell King - ARM Linux @ 2018-01-02 10:52 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli; +Cc: netdev

Hi,

This series resolves races with various accesses to PHY registers.
The first five patches are necessary before we add phylink support
to mvneta, the remaining three are merely cleanups for unobserved
races, and hence are less critical.

There are two possible classes of races that can occur: where we
write to a page register that changes the meaning of a group of
other registers, and where we read-modify-write a register.

Resolve these races by performing the accesses under the mdio bus
lock, ensuring that no other user can access the bus while the
series of atomic operations are being performed.

These patches have been posted before, and have been modified
along the lines of previous feedback:

- The third patch was originally reviewed by Florian, but as I've
  added __phy_modify() to it, I've removed that attributation.
- Included generic page-based accessors as suggested last time
  around.
- Since we have the unlocked __phy_modify() in this patch series,
  it is sensible to include the changes for this to marvell.c -
  these accessors have to change anyway to avoid deadlocks on the
  mdio bus lock.

I haven't been able to test the at803x.c changes yet beyond compile
testing - although I do have systems with an ar8035 PHY.  However,
they should be straight forward to review.

This is targetted for net-next because the races have not been
found in existing drivers, but have been observed with phylink
integrated into mvneta - that's not to say that the races do not
exist today, they are just unobserved (probably through lack of
rigorous enough testing.)  The race provoking condition is detailed
in patch 5.

 drivers/net/phy/at803x.c     |  20 +-
 drivers/net/phy/marvell.c    | 442 +++++++++++++++++--------------------------
 drivers/net/phy/mdio_bus.c   |  65 +++++--
 drivers/net/phy/phy-core.c   | 216 ++++++++++++++++++++-
 drivers/net/phy/phy_device.c |  50 +----
 include/linux/mdio.h         |   3 +
 include/linux/phy.h          |  40 ++++
 7 files changed, 490 insertions(+), 346 deletions(-)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-01-03 18:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-02 10:52 [PATCH net-next v2 0/7] Resolve races in phy accessors Russell King - ARM Linux
2018-01-02 10:58 ` [PATCH net-next v2 1/7] net: mdiobus: add unlocked accessors Russell King
2018-01-02 10:58 ` [PATCH net-next v2 2/7] net: phy: use unlocked accessors for indirect MMD accesses Russell King
2018-01-02 10:58 ` [PATCH net-next v2 3/7] net: phy: add unlocked accessors Russell King
2018-01-02 15:49   ` Andrew Lunn
2018-01-02 10:58 ` [PATCH net-next v2 4/7] net: phy: add paged phy register accessors Russell King
2018-01-02 15:52   ` Andrew Lunn
2018-01-02 10:58 ` [PATCH net-next v2 5/7] net: phy: marvell: fix paged access races Russell King
2018-01-02 16:00   ` Andrew Lunn
2018-01-02 10:58 ` [PATCH net-next v2 6/7] net: phy: add phy_modify() accessor Russell King
2018-01-02 16:01   ` Andrew Lunn
2018-01-02 10:58 ` [PATCH net-next v2 7/7] net: phy: convert read-modify-write to phy_modify() Russell King
2018-01-02 16:05   ` Andrew Lunn
2018-01-03 16:04 ` [PATCH net-next v2 0/7] Resolve races in phy accessors David Miller
2018-01-03 17:32   ` Russell King - ARM Linux
2018-01-03 18:38     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).