Commit 7e90e81
PCI/MSI: Enable and mask MSI-X early
commit 4385539 upstream.
The ordering of MSI-X enable in hardware is dysfunctional:
1) MSI-X is disabled in the control register
2) Various setup functions
3) pci_msi_setup_msi_irqs() is invoked which ends up accessing
the MSI-X table entries
4) MSI-X is enabled and masked in the control register with the
comment that enabling is required for some hardware to access
the MSI-X table
Step #4 obviously contradicts #3. The history of this is an issue with the
NIU hardware. When #4 was introduced the table access actually happened in
msix_program_entries() which was invoked after enabling and masking MSI-X.
This was changed in commit d71d643 ("PCI/MSI: Kill redundant call of
irq_set_msi_desc() for MSI-X interrupts") which removed the table write
from msix_program_entries().
Interestingly enough nobody noticed and either NIU still works or it did
not get any testing with a kernel 3.19 or later.
Nevertheless this is inconsistent and there is no reason why MSI-X can't be
enabled and masked in the control register early on, i.e. move step #4
above to step #1. This preserves the NIU workaround and has no side effects
on other hardware.
Fixes: d71d643 ("PCI/MSI: Kill redundant call of irq_set_msi_desc() for MSI-X interrupts")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210729222542.344136412@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 2d2c668 commit 7e90e81
1 file changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
783 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
784 | 789 | | |
785 | 790 | | |
786 | 791 | | |
787 | 792 | | |
788 | | - | |
789 | | - | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
790 | 797 | | |
791 | 798 | | |
792 | 799 | | |
793 | | - | |
| 800 | + | |
794 | 801 | | |
795 | 802 | | |
796 | 803 | | |
| |||
801 | 808 | | |
802 | 809 | | |
803 | 810 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | 811 | | |
813 | 812 | | |
814 | 813 | | |
| |||
843 | 842 | | |
844 | 843 | | |
845 | 844 | | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
| |||
0 commit comments