PCI MSI: Unmask MSI if setup failed
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Tue, 23 Jun 2009 08:39:27 +0000 (17:39 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 29 Jun 2009 19:16:19 +0000 (12:16 -0700)
The initial state of mask register of MSI is unmasked.  We set it
masked before calling arch_setup_msi_irqs().  If arch_setup_msi_irq()
fails, it is better to restore the state of the mask register.

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/msi.c

index a088fc6f5838855f9f21ff6faa1484a6f325cb79..9ab4fe8f20af2f64ec7912a68953e5f9a2c81661 100644 (file)
@@ -383,6 +383,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
        /* Configure MSI capability structure */
        ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI);
        if (ret) {
+               msi_mask_irq(entry, mask, ~mask);
                msi_free_irqs(dev);
                return ret;
        }