net: phy: prevent uclass_eth device "node" field overwriting
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 5 repliesIn review
- v15 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- struct phy_device->node field initialization added to phy_device_create()
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | net: phy: add ofnode node to struct phy_devicedrivers/ include/ | +17 | 2 replies | |
| 2/5 | net: phy: dp83867: switch to use phy_get_ofnode()drivers/ | +5 | 1 reply | |
| 3/5 | net: phy: xilinx: switch to use phy_get_ofnode()drivers/ | +6 | 1 reply | |
| 4/5 | drivers: net: cpsw: fix phy dt node settingdrivers/ | +1 | 1 reply | |
| 5/5 | drivers: net: zynq_gem: fix phy dt node settingdrivers/ | +1 | 1 reply |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Joe Hershberger |
|---|---|
| 1/5 | A-b |
| 2/5 | A-b |
| 3/5 | A-b |
| 4/5 | A-b |
| 5/5 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [U-Boot] [PATCH v2 0/5] net: phy: prevent uclass_eth device "node" field overwriting
This series prevents the UCLASS_ETH device "node" field overwriting by some network drivers when Ethernet PHYs are linked to UCLASS_ETH device using "phy-handle" DT property and when Ethernet PHY driver needs to read some additional information from DT (like dp83867).
It fixes following cases:
- network drivers
priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface); <-- phydev is connected to dev which is UCLASS_ETH device if (priv->phy_of_handle > 0) dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle); <-- phydev->dev->node is overwritten by phy-handle DT node
- PHY driver in .config() callback
int node = dev_of_offset(dev);
<-- PHY driver uses overwritten dev->node
const void *fdt = gd->fdt_blob;
if (fdtdec_get_bool(fdt, node, "property"))
...As result, UCLASS_ETH device can't be used any more for DT accessing.
It adds new field ofnode node to struct phy_device and updates TI CPSW and zynq_gem drivers to use it.
zynq_gem.c, xilinx_phy.c changes only build tested.
Changes in v2:
- struct phy_device->node field initialization added to phy_device_create()
Dependency:
This series has dependency from
https://patchwork.ozlabs.org/cover/936370/
due to possible merge conflicts
PS: Not sure if any other Net drivers need to be updated,
at least I've not found any.
Grygorii Strashko (5):
net: phy: add ofnode node to struct phy_device
net: phy: dp83867: switch to use phy_get_ofnode()
net: phy: xilinx: switch to use phy_get_ofnode()
drivers: net: cpsw: fix phy dt node setting
drivers: net: zynq_gem: fix phy dt node setting
drivers/net/cpsw.c | 2 +- drivers/net/phy/phy.c | 4 ++++ drivers/net/phy/ti.c | 7 +++++-- drivers/net/phy/xilinx_phy.c | 10 ++++++---- drivers/net/zynq_gem.c | 2 +- include/phy.h | 13 +++++++++++++ 6 files changed, 30 insertions(+), 8 deletions(-)
Signature · 1 line
2.10.5