Patchwork phylib: Wake PHY state machine on interrupt

login
register
mail settings
Submitter Trent Piepho
Date Sept. 25, 2008, 12:02 a.m.
Message ID <1222300931-21242-1-git-send-email-tpiepho@freescale.com>
Download mbox | patch
Permalink /patch/1407/
State Accepted
Delegated to: Jeff Garzik
Headers show

Comments

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

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: