phylib: Wake PHY state machine on interrupt

Submitted by Trent Piepho on Sept. 25, 2008, 12:02 a.m.

Details

Message ID 1222300931-21242-1-git-send-email-tpiepho@freescale.com
State Accepted
Delegated to: Jeff Garzik
Headers show

Commit Message

Trent Piepho Sept. 25, 2008, 12:02 a.m.
This way the phy layer will respond to a change in phy state immediately,
instead of up to one second later when the state machine timer runs.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
---
 drivers/net/phy/phy.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 45cc291..b9572d8 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -728,6 +728,11 @@  static void phy_change(struct work_struct *work)
 	if (err)
 		goto irq_enable_err;
 
+	/* Stop timer and run the state queue now.  The work function for
+	 * state_queue will start the timer up again.  */
+	del_timer(&phydev->phy_timer);
+	schedule_work(&phydev->state_queue);
+
 	return;
 
 irq_enable_err: