Commit a7b91725 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6

* 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6:
  virtio-pci: disable msi at startup
  virtio: return ENOMEM on out of memory
parents dee70a32 b03214d5
...@@ -2292,6 +2292,7 @@ void pci_msi_off(struct pci_dev *dev) ...@@ -2292,6 +2292,7 @@ void pci_msi_off(struct pci_dev *dev)
pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control); pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
} }
} }
EXPORT_SYMBOL_GPL(pci_msi_off);
#ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE
int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size)
......
...@@ -636,6 +636,9 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, ...@@ -636,6 +636,9 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
INIT_LIST_HEAD(&vp_dev->virtqueues); INIT_LIST_HEAD(&vp_dev->virtqueues);
spin_lock_init(&vp_dev->lock); spin_lock_init(&vp_dev->lock);
/* Disable MSI/MSIX to bring device to a known good state. */
pci_msi_off(pci_dev);
/* enable the device */ /* enable the device */
err = pci_enable_device(pci_dev); err = pci_enable_device(pci_dev);
if (err) if (err)
......
...@@ -119,7 +119,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq, ...@@ -119,7 +119,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq,
desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp); desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc) if (!desc)
return vq->vring.num; return -ENOMEM;
/* Transfer entries from the sg list into the indirect page */ /* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) { for (i = 0; i < out; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment