提交 bb507fe1 编写于 作者: S shemminger@osdl.org 提交者: Jeff Garzik

[PATCH] 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: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 97bda706
...@@ -3189,6 +3189,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw) ...@@ -3189,6 +3189,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
struct pci_dev *pdev = hw->pdev; struct pci_dev *pdev = hw->pdev;
int err; int err;
init_waitqueue_head (&hw->msi_wait);
sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw); err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw);
...@@ -3198,10 +3200,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw) ...@@ -3198,10 +3200,8 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw)
return err; return err;
} }
init_waitqueue_head (&hw->msi_wait);
sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ); 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); wait_event_timeout(hw->msi_wait, hw->msi_detected, HZ/10);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册