Commit 3489a9e8 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Greg Kroah-Hartman

sky2: MSI test timing

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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f117ca32
......@@ -3184,6 +3184,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, SA_SHIRQ, DRV_NAME, hw);
......@@ -3193,10 +3195,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment