Commit 83425eee authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio: console: Enable call to hvc_remove() on console port remove
  virtio_pci: Prevent double-free of pci regions after device hot-unplug
  virtio: Decrement avail idx on buffer detach
parents 8ed54bd5 afa2689e
...@@ -1280,18 +1280,7 @@ static void unplug_port(struct port *port) ...@@ -1280,18 +1280,7 @@ static void unplug_port(struct port *port)
spin_lock_irq(&pdrvdata_lock); spin_lock_irq(&pdrvdata_lock);
list_del(&port->cons.list); list_del(&port->cons.list);
spin_unlock_irq(&pdrvdata_lock); spin_unlock_irq(&pdrvdata_lock);
#if 0
/*
* hvc_remove() not called as removing one hvc port
* results in other hvc ports getting frozen.
*
* Once this is resolved in hvc, this functionality
* will be enabled. Till that is done, the -EPIPE
* return from get_chars() above will help
* hvc_console.c to clean up on ports we remove here.
*/
hvc_remove(port->cons.hvc); hvc_remove(port->cons.hvc);
#endif
} }
/* Remove unused data this port might have received. */ /* Remove unused data this port might have received. */
......
...@@ -590,15 +590,10 @@ static struct virtio_config_ops virtio_pci_config_ops = { ...@@ -590,15 +590,10 @@ static struct virtio_config_ops virtio_pci_config_ops = {
static void virtio_pci_release_dev(struct device *_d) static void virtio_pci_release_dev(struct device *_d)
{ {
struct virtio_device *dev = container_of(_d, struct virtio_device, dev); struct virtio_device *dev = container_of(_d, struct virtio_device,
dev);
struct virtio_pci_device *vp_dev = to_vp_device(dev); struct virtio_pci_device *vp_dev = to_vp_device(dev);
struct pci_dev *pci_dev = vp_dev->pci_dev;
vp_del_vqs(dev);
pci_set_drvdata(pci_dev, NULL);
pci_iounmap(pci_dev, vp_dev->ioaddr);
pci_release_regions(pci_dev);
pci_disable_device(pci_dev);
kfree(vp_dev); kfree(vp_dev);
} }
...@@ -681,6 +676,12 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev) ...@@ -681,6 +676,12 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
unregister_virtio_device(&vp_dev->vdev); unregister_virtio_device(&vp_dev->vdev);
vp_del_vqs(&vp_dev->vdev);
pci_set_drvdata(pci_dev, NULL);
pci_iounmap(pci_dev, vp_dev->ioaddr);
pci_release_regions(pci_dev);
pci_disable_device(pci_dev);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -371,6 +371,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq) ...@@ -371,6 +371,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq)
/* detach_buf clears data, so grab it now. */ /* detach_buf clears data, so grab it now. */
buf = vq->data[i]; buf = vq->data[i];
detach_buf(vq, i); detach_buf(vq, i);
vq->vring.avail->idx--;
END_USE(vq); END_USE(vq);
return buf; return buf;
} }
......
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