]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PCI: Fix the NIU MSI-X problem in a better way
authorMatthew Wilcox <willy@linux.intel.com>
Fri, 19 Jun 2009 02:15:59 +0000 (19:15 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 19 Jun 2009 22:11:39 +0000 (15:11 -0700)
commitf598282f5145036312d90875d0ed5c14b49fd8a7
tree3cb76a5a2cbd161ce03007370f5e38c133efe21d
parent5c92ffb1ecc7f13267cdef5dda8a838937912c93
PCI: Fix the NIU MSI-X problem in a better way

The previous MSI-X fix (8d181018532dd709ec1f789e374cda92d7b01ce1) had
three bugs.  First, it didn't move the write that disabled the vector.
This led to writing garbage to the MSI-X vector (spotted by Michael
Ellerman).  It didn't fix the PCI resume case, and it had a race window
where the device could generate an interrupt before the MSI-X registers
were programmed (leading to a DMA to random addresses).

Fortunately, the MSI-X capability has a bit to mask all the vectors.
By setting this bit instead of clearing the enable bit, we can ensure
the device will not generate spurious interrupts.  Since the capability
is now enabled, the NIU device will not have a problem with the reads
and writes to the MSI-X registers being in the original order in the code.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/msi.c