Skip to content

Commit

Permalink
Merge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
Linus Torvalds committed Jun 27, 2010
2 parents dee70a3 + b03214d commit a7b9172
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,7 @@ void pci_msi_off(struct pci_dev *dev)
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
int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size)
Expand Down
3 changes: 3 additions & 0 deletions drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,9 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
INIT_LIST_HEAD(&vp_dev->virtqueues);
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 */
err = pci_enable_device(pci_dev);
if (err)
Expand Down
2 changes: 1 addition & 1 deletion drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq,

desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc)
return vq->vring.num;
return -ENOMEM;

/* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) {
Expand Down

0 comments on commit a7b9172

Please sign in to comment.