Commit bba6f6fc authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds

[PATCH] MSI-X: fix resume crash

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: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4dfc896e
...@@ -100,7 +100,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -100,7 +100,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
if ((err = pcibios_enable_resources(dev, mask)) < 0) if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err; return err;
return pcibios_enable_irq(dev); if (!dev->msi_enabled)
pcibios_enable_irq(dev);
return 0;
} }
int pcibios_assign_resources(void) int pcibios_assign_resources(void)
......
...@@ -466,6 +466,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -466,6 +466,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
if ((err = pcibios_enable_resources(dev, mask)) < 0) if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err; return err;
if (!dev->msi_enabled)
pcibios_enable_irq(dev); pcibios_enable_irq(dev);
return 0; return 0;
} }
...@@ -434,11 +434,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -434,11 +434,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
if ((err = pcibios_enable_resources(dev, mask)) < 0) if ((err = pcibios_enable_resources(dev, mask)) < 0)
return err; return err;
if (!dev->msi_enabled)
return pcibios_enable_irq(dev); return pcibios_enable_irq(dev);
return 0;
} }
void pcibios_disable_device (struct pci_dev *dev) void pcibios_disable_device (struct pci_dev *dev)
{ {
if (pcibios_disable_irq) if (!dev->msi_enabled && pcibios_disable_irq)
pcibios_disable_irq(dev); pcibios_disable_irq(dev);
} }
...@@ -557,14 +557,18 @@ pcibios_enable_device (struct pci_dev *dev, int mask) ...@@ -557,14 +557,18 @@ pcibios_enable_device (struct pci_dev *dev, int mask)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (!dev->msi_enabled)
return acpi_pci_irq_enable(dev); return acpi_pci_irq_enable(dev);
return 0;
} }
void void
pcibios_disable_device (struct pci_dev *dev) pcibios_disable_device (struct pci_dev *dev)
{ {
BUG_ON(atomic_read(&dev->enable_cnt)); BUG_ON(atomic_read(&dev->enable_cnt));
if (!dev->msi_enabled)
acpi_pci_irq_disable(dev); acpi_pci_irq_disable(dev);
return 0;
} }
void void
......
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