History

net: phy: export phy_queue_state_machine

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

Heiner Kallweit committed 7 years ago

Commit 97b33bd1 parent 49644e62 files · +6 −4Browse files

Unified · Split

2 files
  1. drivers/net/phy/phy.c +5 −3
  2. include/linux/phy.h +1 −1
drivers/net/phy/phy.c+5−3
@@ -29,6 +29,8 @@ · 28 unmodified lines
29#include <linux/uaccess.h>29#include <linux/uaccess.h>
30#include <linux/atomic.h>30#include <linux/atomic.h>
31 31
32#define PHY_STATE_TIME HZ
33
32#define PHY_STATE_STR(_state) \34#define PHY_STATE_STR(_state) \
33 case PHY_##_state: \35 case PHY_##_state: \
34 return __stringify(_state); \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}
479EXPORT_SYMBOL(phy_mii_ioctl);481EXPORT_SYMBOL(phy_mii_ioctl);
480 482
481static void phy_queue_state_machine(struct phy_device *phydev,483void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies)
482 unsigned int secs)
483{484{
484 mod_delayed_work(system_power_efficient_wq, &phydev->state_queue,485 mod_delayed_work(system_power_efficient_wq, &phydev->state_queue,
485 secs * HZ);486 jiffies);
486}487}
488EXPORT_SYMBOL(phy_queue_state_machine);
487 489
488static void phy_trigger_machine(struct phy_device *phydev)490static void phy_trigger_machine(struct phy_device *phydev)
489{491{
include/linux/phy.h+1−1
@@ -188,7 +188,6 @@ static inline const char *phy_modes(phy_interface_t interface) · 187 unmodified lines
188 188
189 189
190#define PHY_INIT_TIMEOUT 100000190#define PHY_INIT_TIMEOUT 100000
191#define PHY_STATE_TIME 1
192#define PHY_FORCE_TIMEOUT 10191#define PHY_FORCE_TIMEOUT 10
193 192
194#define PHY_MAX_ADDR 32193#define PHY_MAX_ADDR 32
@@ -1140,6 +1139,7 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner); · 945 unmodified lines
1140int phy_drivers_register(struct phy_driver *new_driver, int n,1139int phy_drivers_register(struct phy_driver *new_driver, int n,
1141 struct module *owner);1140 struct module *owner);
1142void phy_state_machine(struct work_struct *work);1141void phy_state_machine(struct work_struct *work);
1142void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies);
1143void phy_mac_interrupt(struct phy_device *phydev);1143void phy_mac_interrupt(struct phy_device *phydev);
1144void phy_start_machine(struct phy_device *phydev);1144void phy_start_machine(struct phy_device *phydev);
1145void phy_stop_machine(struct phy_device *phydev);1145void phy_stop_machine(struct phy_device *phydev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t