diff mbox

pci, msi: Unmask MSI if setup failed

Message ID 4A4094BF.6030909@jp.fujitsu.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Hidetoshi Seto June 23, 2009, 8:39 a.m. UTC
The initial state of mask register of MSI is unmasked.
We setup it masked before calling arch_setup_msi_irqs().
In case if arch_setup_msi_irq() failed, it is better to restore
the state of the mask register.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
 drivers/pci/msi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Matthew Wilcox June 23, 2009, 1:14 p.m. UTC | #1
On Tue, Jun 23, 2009 at 05:39:27PM +0900, Hidetoshi Seto wrote:
> The initial state of mask register of MSI is unmasked.
> We setup it masked before calling arch_setup_msi_irqs().
> In case if arch_setup_msi_irq() failed, it is better to restore
> the state of the mask register.
> 
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Jesse Barnes June 29, 2009, 7:18 p.m. UTC | #2
On Tue, 23 Jun 2009 17:39:27 +0900
Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> wrote:

> The initial state of mask register of MSI is unmasked.
> We setup it masked before calling arch_setup_msi_irqs().
> In case if arch_setup_msi_irq() failed, it is better to restore
> the state of the mask register.
> 
> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

Thanks Hidetoshi-san & Matthew, I applied this series of MSI patches to
my for-linus branch.
diff mbox

Patch

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index e784526..339d94a 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -409,6 +409,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;
 	}