Skip to content

net: phy: relax error checking when creating sysfs link netdev->phydev

Grygorii Strashko linux-omap lkml netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- commit messages updated.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sysfs: symlink: export sysfs_create_link_nowarn()fs/sysfs/symlink.c+1 -01 reply
2/2net: phy: relax error checking when creating sysfs link netdev->phydevdrivers/net/phy/phy_device.c+11 -40 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchGreg Kroah-Hartman
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] net: phy: relax error checking when creating sysfs link netdev->phydev

Some ethernet drivers (like TI CPSW) may connect and manage >1 Net PHYs per one netdevice, as result such drivers will produce warning during system boot and fail to connect second phy to netdevice when PHYLIB framework will try to create sysfs link netdev->phydev for second PHY
in phy_attach_direct(), because sysfs link with the same name has been created already for the first PHY.
As result, second CPSW external port will became unusable.
This regression was introduced by commits:
5568363f0cb3 ("net: phy: Create sysfs reciprocal links for attached_dev/phydev" a3995460491d ("net: phy: Relax error checking on sysfs_create_link()"

Patch 1: exports sysfs_create_link_nowarn() function as preparation for Patch 2. Patch 2: relaxes error checking when PHYLIB framework is creating sysfs link netdev->phydev in phy_attach_direct(), suppresses warning by using sysfs_create_link_nowarn() and adds error message instead, so links creation failure is not fatal any more and system can continue working, which fixes TI CPSW issue and makes boot logs accessible
in case of NFS boot, for example.

This can be stable material 4.13+.

Changes in v2:
- commit messages updated.

v1:
https://patchwork.ozlabs.org/cover/886058/

Cc: Florian Fainelli <[email protected]>
Cc: Andrew Lunn <[email protected]>
Grygorii Strashko (2):
sysfs: symlink: export sysfs_create_link_nowarn()
net: phy: relax error checking when creating sysfs link netdev->phydev

 drivers/net/phy/phy_device.c | 15 +++++++++++----
 fs/sysfs/symlink.c           |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)
Signature · 1 line
2.10.5