Commit 28b2e0d2 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: remove parameter new_link from phy_mac_interrupt()

I see two issues with parameter new_link:

1. It's not needed. See also phy_interrupt(), works w/o this parameter.
   phy_mac_interrupt sets the state to PHY_CHANGELINK and triggers the
   state machine which then calls phy_read_status. And phy_read_status
   updates the link state.

2. phy_mac_interrupt is used in interrupt context and getting the link
   state may sleep (at least when having to access the PHY registers
   via MDIO bus).

So let's remove it.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent febafc84
...@@ -2527,9 +2527,10 @@ static void bcmgenet_irq_task(struct work_struct *work) ...@@ -2527,9 +2527,10 @@ static void bcmgenet_irq_task(struct work_struct *work)
spin_unlock_irq(&priv->lock); spin_unlock_irq(&priv->lock);
/* Link UP/DOWN event */ /* Link UP/DOWN event */
if (status & UMAC_IRQ_LINK_EVENT) if (status & UMAC_IRQ_LINK_EVENT) {
phy_mac_interrupt(priv->dev->phydev, priv->dev->phydev->link = !!(status & UMAC_IRQ_LINK_UP);
!!(status & UMAC_IRQ_LINK_UP)); phy_mac_interrupt(priv->dev->phydev);
}
} }
/* bcmgenet_isr1: handle Rx and Tx priority queues */ /* bcmgenet_isr1: handle Rx and Tx priority queues */
......
...@@ -1057,16 +1057,12 @@ void phy_state_machine(struct work_struct *work) ...@@ -1057,16 +1057,12 @@ void phy_state_machine(struct work_struct *work)
/** /**
* phy_mac_interrupt - MAC says the link has changed * phy_mac_interrupt - MAC says the link has changed
* @phydev: phy_device struct with changed link * @phydev: phy_device struct with changed link
* @new_link: Link is Up/Down.
* *
* Description: The MAC layer is able indicate there has been a change * The MAC layer is able to indicate there has been a change in the PHY link
* in the PHY link status. Set the new link status, and trigger the * status. Trigger the state machine and work a work queue.
* state machine, work a work queue.
*/ */
void phy_mac_interrupt(struct phy_device *phydev, int new_link) void phy_mac_interrupt(struct phy_device *phydev)
{ {
phydev->link = new_link;
/* Trigger a state machine change */ /* Trigger a state machine change */
queue_work(system_power_efficient_wq, &phydev->phy_queue); queue_work(system_power_efficient_wq, &phydev->phy_queue);
} }
......
...@@ -964,7 +964,7 @@ int phy_drivers_register(struct phy_driver *new_driver, int n, ...@@ -964,7 +964,7 @@ int phy_drivers_register(struct phy_driver *new_driver, int n,
void phy_state_machine(struct work_struct *work); void phy_state_machine(struct work_struct *work);
void phy_change(struct phy_device *phydev); void phy_change(struct phy_device *phydev);
void phy_change_work(struct work_struct *work); void phy_change_work(struct work_struct *work);
void phy_mac_interrupt(struct phy_device *phydev, int new_link); void phy_mac_interrupt(struct phy_device *phydev);
void phy_start_machine(struct phy_device *phydev); void phy_start_machine(struct phy_device *phydev);
void phy_stop_machine(struct phy_device *phydev); void phy_stop_machine(struct phy_device *phydev);
void phy_trigger_machine(struct phy_device *phydev, bool sync); void phy_trigger_machine(struct phy_device *phydev, bool sync);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment