mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 14:43:16 +00:00
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
This commit is contained in:
commit
a7b917256d
@ -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,
|
|||||||
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,
|
|||||||
|
|
||||||
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++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user