]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.17/virtio-pci-disable-msi-at-startup.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / virtio-pci-disable-msi-at-startup.patch
1 From b03214d559471359e2a85ae256686381d0672f29 Mon Sep 17 00:00:00 2001
2 From: Michael S. Tsirkin <mst@redhat.com>
3 Date: Wed, 23 Jun 2010 22:49:06 -0600
4 Subject: virtio-pci: disable msi at startup
5
6 From: Michael S. Tsirkin <mst@redhat.com>
7
8 commit b03214d559471359e2a85ae256686381d0672f29 upstream.
9
10 virtio-pci resets the device at startup by writing to the status
11 register, but this does not clear the pci config space,
12 specifically msi enable status which affects register
13 layout.
14
15 This breaks things like kdump when they try to use e.g. virtio-blk.
16
17 Fix by forcing msi off at startup. Since pci.c already has
18 a routine to do this, we export and use it instead of duplicating code.
19
20 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
21 Tested-by: Vivek Goyal <vgoyal@redhat.com>
22 Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
23 Cc: linux-pci@vger.kernel.org
24 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27 ---
28 drivers/pci/pci.c | 1 +
29 drivers/virtio/virtio_pci.c | 3 +++
30 2 files changed, 4 insertions(+)
31
32 --- a/drivers/pci/pci.c
33 +++ b/drivers/pci/pci.c
34 @@ -2046,6 +2046,7 @@ void pci_msi_off(struct pci_dev *dev)
35 pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
36 }
37 }
38 +EXPORT_SYMBOL_GPL(pci_msi_off);
39
40 #ifndef HAVE_ARCH_PCI_SET_DMA_MASK
41 /*
42 --- a/drivers/virtio/virtio_pci.c
43 +++ b/drivers/virtio/virtio_pci.c
44 @@ -635,6 +635,9 @@ static int __devinit virtio_pci_probe(st
45 INIT_LIST_HEAD(&vp_dev->virtqueues);
46 spin_lock_init(&vp_dev->lock);
47
48 + /* Disable MSI/MSIX to bring device to a known good state. */
49 + pci_msi_off(pci_dev);
50 +
51 /* enable the device */
52 err = pci_enable_device(pci_dev);
53 if (err)