summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-12-04 20:13:11 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2022-01-18 10:17:26 +0000
commit32f0035cace2d21b72177f99ed95033fe4ee7ca4 (patch)
treecb49cbfa2c96b1b98cbe2eeca9a779406406af03 /include/linux
parent4a6332d33f6a9eb1edfdeadb3707c898d0221b9b (diff)
net: phy: generate PHY mdio modalias
The modalias string provided in the uevent sysfs file does not conform to the format used in PHY driver modules. One of the reasons is that udev loading of PHY driver modules has not been an expected use case. This patch changes the MODALIAS entry for only PHY devices from: MODALIAS=of:Nethernet-phyT(null) to: MODALIAS=mdio:00000000001000100001010100010011 Other MDIO devices (such as DSA) remain as before. However, having udev automatically load the module has the advantage of making use of existing functionality to have the module loaded before the device is bound to the driver, thus taking advantage of multithreaded boot systems, potentially decreasing the boot time. However, this patch will not solve any issues with the driver module not being loaded prior to the network device needing to use the PHY. This is something that is completely out of control of any patch to change the uevent mechanism. Reported-by: Yinbo Zhu <zhuyinbo@loongson.cn> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mdio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 2cb80dcfd536..cd99fe71296f 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -38,6 +38,8 @@ struct mdio_device {
char modalias[MDIO_NAME_SIZE];
int (*bus_match)(struct device *dev, struct device_driver *drv);
+ int (*bus_uevent)(struct mdio_device *mdiodev,
+ struct kobj_uevent_env *env);
void (*device_free)(struct mdio_device *mdiodev);
void (*device_remove)(struct mdio_device *mdiodev);