diff options
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 3ff1f425f1bb..61755cbd978e 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -434,7 +434,7 @@ void phy_start_machine(struct phy_device *phydev, | |||
434 | phydev->adjust_state = handler; | 434 | phydev->adjust_state = handler; |
435 | 435 | ||
436 | INIT_DELAYED_WORK(&phydev->state_queue, phy_state_machine); | 436 | INIT_DELAYED_WORK(&phydev->state_queue, phy_state_machine); |
437 | schedule_delayed_work(&phydev->state_queue, jiffies + HZ); | 437 | schedule_delayed_work(&phydev->state_queue, HZ); |
438 | } | 438 | } |
439 | 439 | ||
440 | /** | 440 | /** |
@@ -655,6 +655,10 @@ static void phy_change(struct work_struct *work) | |||
655 | struct phy_device *phydev = | 655 | struct phy_device *phydev = |
656 | container_of(work, struct phy_device, phy_queue); | 656 | container_of(work, struct phy_device, phy_queue); |
657 | 657 | ||
658 | if (phydev->drv->did_interrupt && | ||
659 | !phydev->drv->did_interrupt(phydev)) | ||
660 | goto ignore; | ||
661 | |||
658 | err = phy_disable_interrupts(phydev); | 662 | err = phy_disable_interrupts(phydev); |
659 | 663 | ||
660 | if (err) | 664 | if (err) |
@@ -681,6 +685,11 @@ static void phy_change(struct work_struct *work) | |||
681 | 685 | ||
682 | return; | 686 | return; |
683 | 687 | ||
688 | ignore: | ||
689 | atomic_dec(&phydev->irq_disable); | ||
690 | enable_irq(phydev->irq); | ||
691 | return; | ||
692 | |||
684 | irq_enable_err: | 693 | irq_enable_err: |
685 | disable_irq(phydev->irq); | 694 | disable_irq(phydev->irq); |
686 | atomic_inc(&phydev->irq_disable); | 695 | atomic_inc(&phydev->irq_disable); |
@@ -937,6 +946,5 @@ static void phy_state_machine(struct work_struct *work) | |||
937 | if (err < 0) | 946 | if (err < 0) |
938 | phy_error(phydev); | 947 | phy_error(phydev); |
939 | 948 | ||
940 | schedule_delayed_work(&phydev->state_queue, | 949 | schedule_delayed_work(&phydev->state_queue, PHY_STATE_TIME * HZ); |
941 | jiffies + PHY_STATE_TIME * HZ); | ||
942 | } | 950 | } |