Commit bba6f6fc68e74d4572028646f61dd3505a68747e

Authored by Eric W. Biederman
Committed by Linus Torvalds
1 parent 4dfc896e90

[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: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 4 changed files with 15 additions and 6 deletions Side-by-side Diff

arch/cris/arch-v32/drivers/pci/bios.c
... ... @@ -100,7 +100,9 @@
100 100 if ((err = pcibios_enable_resources(dev, mask)) < 0)
101 101 return err;
102 102  
103   - return pcibios_enable_irq(dev);
  103 + if (!dev->msi_enabled)
  104 + pcibios_enable_irq(dev);
  105 + return 0;
104 106 }
105 107  
106 108 int pcibios_assign_resources(void)
arch/frv/mb93090-mb00/pci-vdk.c
... ... @@ -466,7 +466,8 @@
466 466  
467 467 if ((err = pcibios_enable_resources(dev, mask)) < 0)
468 468 return err;
469   - pcibios_enable_irq(dev);
  469 + if (!dev->msi_enabled)
  470 + pcibios_enable_irq(dev);
470 471 return 0;
471 472 }
arch/i386/pci/common.c
... ... @@ -434,12 +434,14 @@
434 434 if ((err = pcibios_enable_resources(dev, mask)) < 0)
435 435 return err;
436 436  
437   - return pcibios_enable_irq(dev);
  437 + if (!dev->msi_enabled)
  438 + return pcibios_enable_irq(dev);
  439 + return 0;
438 440 }
439 441  
440 442 void pcibios_disable_device (struct pci_dev *dev)
441 443 {
442   - if (pcibios_disable_irq)
  444 + if (!dev->msi_enabled && pcibios_disable_irq)
443 445 pcibios_disable_irq(dev);
444 446 }
... ... @@ -557,14 +557,18 @@
557 557 if (ret < 0)
558 558 return ret;
559 559  
560   - return acpi_pci_irq_enable(dev);
  560 + if (!dev->msi_enabled)
  561 + return acpi_pci_irq_enable(dev);
  562 + return 0;
561 563 }
562 564  
563 565 void
564 566 pcibios_disable_device (struct pci_dev *dev)
565 567 {
566 568 BUG_ON(atomic_read(&dev->enable_cnt));
567   - acpi_pci_irq_disable(dev);
  569 + if (!dev->msi_enabled)
  570 + acpi_pci_irq_disable(dev);
  571 + return 0;
568 572 }
569 573  
570 574 void