alistair23-linux/drivers/pci
Marc Zyngier f3b0946d62 genirq/msi: Make sure PCI MSIs are activated early
Bharat Kumar Gogada reported issues with the generic MSI code, where the
end-point ended up with garbage in its MSI configuration (both for the vector
and the message).

It turns out that the two MSI paths in the kernel are doing slightly different
things:

generic MSI: disable MSI -> allocate MSI -> enable MSI -> setup EP
PCI MSI: disable MSI -> allocate MSI -> setup EP -> enable MSI

And it turns out that end-points are allowed to latch the content of the MSI
configuration registers as soon as MSIs are enabled.  In Bharat's case, the
end-point ends up using whatever was there already, which is not what you
want.

In order to make things converge, we introduce a new MSI domain flag
(MSI_FLAG_ACTIVATE_EARLY) that is unconditionally set for PCI/MSI. When set,
this flag forces the programming of the end-point as soon as the MSIs are
allocated.

A consequence of this is that we have an extra activate in irq_startup, but
that should be without much consequence.

tglx: 

 - Several people reported a VMWare regression with PCI/MSI-X passthrough. It
   turns out that the patch also cures that issue.

 - We need to have a look at the MSI disable interrupt path, where we write
   the msg to all zeros without disabling MSI in the PCI device. Is that
   correct?

Fixes: 52f518a3a7 "x86/MSI: Use hierarchical irqdomains to manage MSI interrupts"
Reported-and-tested-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Reported-and-tested-by: Foster Snowhill <forst@forstwoof.ru>
Reported-by: Matthias Prager <linux@matthiasprager.de>
Reported-by: Jason Taylor <jason.taylor@simplivity.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1468426713-31431-1-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-08-09 09:19:32 +02:00
..
host Merge branches 'pci/host-aardvark', 'pci/host-altera', 'pci/host-dra7xx', 'pci/host-hv', 'pci/host-vmd' and 'pci/host-xilinx' into next 2016-08-01 12:32:13 -05:00
hotplug ACPI / hotplug / PCI: Runtime resume bridges before bus rescans 2016-08-04 21:33:58 -04:00
pcie Merge branches 'pci/aspm', 'pci/dpc', 'pci/hotplug', 'pci/misc', 'pci/msi', 'pci/pm' and 'pci/virtualization' into next 2016-08-01 12:23:31 -05:00
access.c
ats.c
bus.c Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next 2016-08-01 12:23:57 -05:00
ecam.c tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
host-bridge.c
hotplug-pci.c
htirq.c
iov.c
irq.c
Kconfig
Makefile
msi.c genirq/msi: Make sure PCI MSIs are activated early 2016-08-09 09:19:32 +02:00
of.c
pci-acpi.c
pci-driver.c
pci-label.c
pci-mid.c
pci-stub.c
pci-sysfs.c
pci.c PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
pci.h
probe.c Merge branches 'pci/aspm', 'pci/dpc', 'pci/hotplug', 'pci/misc', 'pci/msi', 'pci/pm' and 'pci/virtualization' into next 2016-08-01 12:23:31 -05:00
proc.c
quirks.c PCI: Add ACS quirk for Solarflare SFC9220 2016-07-29 17:28:24 -05:00
remove.c
rom.c
search.c
setup-bus.c PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
setup-irq.c
setup-res.c
slot.c
syscall.c
vc.c
vpd.c
xen-pcifront.c treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00