Skip to content

Commit

Permalink
[PATCH] MSI-X: fix resume crash
Browse files Browse the repository at this point in the history
So I think the right solution is to simply make pci_enable_device just
flip enable bits and move the rest of the work someplace else.

However a thorough cleanup is a little extreme for this point in the
release cycle, so I think a quick hack that makes the code not stomp the
irq when msi irq's are enabled should be the first fix.  Then we can
later make the code not change the irqs at all.

Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ebiederm authored and Linus Torvalds committed Mar 28, 2007
1 parent 4dfc896 commit bba6f6f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion arch/cris/arch-v32/drivers/pci/bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err;

return pcibios_enable_irq(dev);
if (!dev->msi_enabled)
pcibios_enable_irq(dev);
return 0;
}

int pcibios_assign_resources(void)
Expand Down
3 changes: 2 additions & 1 deletion arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)

if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err;
pcibios_enable_irq(dev);
if (!dev->msi_enabled)
pcibios_enable_irq(dev);
return 0;
}
6 changes: 4 additions & 2 deletions arch/i386/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err;

return pcibios_enable_irq(dev);
if (!dev->msi_enabled)
return pcibios_enable_irq(dev);
return 0;
}

void pcibios_disable_device (struct pci_dev *dev)
{
if (pcibios_disable_irq)
if (!dev->msi_enabled && pcibios_disable_irq)
pcibios_disable_irq(dev);
}
8 changes: 6 additions & 2 deletions arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,14 +557,18 @@ pcibios_enable_device (struct pci_dev *dev, int mask)
if (ret < 0)
return ret;

return acpi_pci_irq_enable(dev);
if (!dev->msi_enabled)
return acpi_pci_irq_enable(dev);
return 0;
}

void
pcibios_disable_device (struct pci_dev *dev)
{
BUG_ON(atomic_read(&dev->enable_cnt));
acpi_pci_irq_disable(dev);
if (!dev->msi_enabled)
acpi_pci_irq_disable(dev);
return 0;
}

void
Expand Down

0 comments on commit bba6f6f

Please sign in to comment.