We face the issue that link change interrupt and link status may be reported by different PHY layers. As a result the link change interrupt may occur before the link status changes. Export phy_queue_state_machine to allow PHY drivers to specify a delay between link status change interrupt and link status check. v2: - change jiffies parameter type to unsigned long
Unified · Split
| @@ -29,6 +29,8 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/uaccess.h> |
| 30 | 30 | #include <linux/atomic.h> |
| 31 | 31 | |
| 32 | +#define PHY_STATE_TIME HZ | |
| 33 | + | |
| 32 | 34 | #define PHY_STATE_STR(_state) \ |
| 33 | 35 | case PHY_##_state: \ |
| 34 | 36 | return __stringify(_state); \ |
| @@ -478,12 +480,12 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd) · 443 unmodified lines | ||
| 478 | 480 | } |
| 479 | 481 | EXPORT_SYMBOL(phy_mii_ioctl); |
| 480 | 482 | |
| 481 | −static void phy_queue_state_machine(struct phy_device *phydev, | |
| 482 | − unsigned int secs) | |
| 483 | +void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies) | |
| 483 | 484 | { |
| 484 | 485 | mod_delayed_work(system_power_efficient_wq, &phydev->state_queue, |
| 485 | − secs * HZ); | |
| 486 | + jiffies); | |
| 486 | 487 | } |
| 488 | +EXPORT_SYMBOL(phy_queue_state_machine); | |
| 487 | 489 | |
| 488 | 490 | static void phy_trigger_machine(struct phy_device *phydev) |
| 489 | 491 | { |
| @@ -188,7 +188,6 @@ static inline const char *phy_modes(phy_interface_t interface) · 187 unmodified lines | ||
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | #define PHY_INIT_TIMEOUT 100000 |
| 191 | −#define PHY_STATE_TIME 1 | |
| 192 | 191 | #define PHY_FORCE_TIMEOUT 10 |
| 193 | 192 | |
| 194 | 193 | #define PHY_MAX_ADDR 32 |
| @@ -1140,6 +1139,7 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner); · 945 unmodified lines | ||
| 1140 | 1139 | int phy_drivers_register(struct phy_driver *new_driver, int n, |
| 1141 | 1140 | struct module *owner); |
| 1142 | 1141 | void phy_state_machine(struct work_struct *work); |
| 1142 | +void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies); | |
| 1143 | 1143 | void phy_mac_interrupt(struct phy_device *phydev); |
| 1144 | 1144 | void phy_start_machine(struct phy_device *phydev); |
| 1145 | 1145 | void phy_stop_machine(struct phy_device *phydev); |