Skip to content

Commit

Permalink
[PATCH] sky2: MSI test timing
Browse files Browse the repository at this point in the history
The test for MSI IRQ could have timing issues. The PCI write needs to be
pushed out before waiting, and the wait queue should be initialized before
the IRQ.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
shemminger@osdl.org authored and Jeff Garzik committed Aug 29, 2006
1 parent 97bda70 commit bb507fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
struct pci_dev *pdev = hw->pdev;
int err;

init_waitqueue_head (&hw->msi_wait);

sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);

err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw);
Expand All @@ -3198,10 +3200,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
return err;
}

init_waitqueue_head (&hw->msi_wait);

sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ);
wmb();
sky2_read8(hw, B0_CTST);

wait_event_timeout(hw->msi_wait, hw->msi_detected, HZ/10);

Expand Down

0 comments on commit bb507fe

Please sign in to comment.