phylib: Wake PHY state machine on interrupt
authorTrent Piepho <tpiepho@freescale.com>
Wed, 8 Oct 2008 22:46:57 +0000 (15:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Oct 2008 22:46:57 +0000 (15:46 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c

index 0433fcd009438b65aee19afed77eed75f0bd9e3c..20cc82c781370ec5fb2a1e27652c3e7e0769c862 100644 (file)
@@ -729,6 +729,12 @@ 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: