search for: vp_reset

Displaying 20 results from an estimated 92 matches for "vp_reset".

2014 Nov 09
1
[PATCH] virtio-pci: Reset device on shutdown
.../drivers/virtio/virtio_pci.c index d34ebfa..cd7be6f 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -743,6 +743,14 @@ out: return err; } +static void virtio_pci_shutdown(struct pci_dev *pci_dev) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + + vp_reset(&vp_dev->vdev); +} + + static void virtio_pci_remove(struct pci_dev *pci_dev) { struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); @@ -794,6 +802,7 @@ static struct pci_driver virtio_pci_driver = { .id_table = virtio_pci_id_table, .probe = virtio_pci_probe, .remove = vi...
2014 Nov 09
1
[PATCH] virtio-pci: Reset device on shutdown
.../drivers/virtio/virtio_pci.c index d34ebfa..cd7be6f 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -743,6 +743,14 @@ out: return err; } +static void virtio_pci_shutdown(struct pci_dev *pci_dev) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + + vp_reset(&vp_dev->vdev); +} + + static void virtio_pci_remove(struct pci_dev *pci_dev) { struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); @@ -794,6 +802,7 @@ static struct pci_driver virtio_pci_driver = { .id_table = virtio_pci_id_table, .probe = virtio_pci_probe, .remove = vi...
2014 Sep 23
5
[PATCH RFC] virtio_pci: fix virtio spec compliance on restore
...v; + unsigned status = 0; int ret; drv = container_of(vp_dev->vdev.dev.driver, @@ -795,14 +796,41 @@ static int virtio_pci_restore(struct device *dev) return ret; pci_set_master(pci_dev); + /* We always start by resetting the device, in case a previous + * driver messed it up. */ + vp_reset(&vp_dev->vdev); + + /* Acknowledge that we've seen the device. */ + status |= VIRTIO_CONFIG_S_ACKNOWLEDGE; + vp_set_status(&vp_dev->vdev, status); + + /* Maybe driver failed before freeze. + * Restore the failed status, for debugging. */ + status |= vp_dev->saved_status &...
2014 Sep 23
5
[PATCH RFC] virtio_pci: fix virtio spec compliance on restore
...v; + unsigned status = 0; int ret; drv = container_of(vp_dev->vdev.dev.driver, @@ -795,14 +796,41 @@ static int virtio_pci_restore(struct device *dev) return ret; pci_set_master(pci_dev); + /* We always start by resetting the device, in case a previous + * driver messed it up. */ + vp_reset(&vp_dev->vdev); + + /* Acknowledge that we've seen the device. */ + status |= VIRTIO_CONFIG_S_ACKNOWLEDGE; + vp_set_status(&vp_dev->vdev, status); + + /* Maybe driver failed before freeze. + * Restore the failed status, for debugging. */ + status |= vp_dev->saved_status &...
2016 Apr 03
1
[PATCH] virtio: virtio 1.0 cs04 spec compliance for reset
...virtio_pci_modern.c index f6f28cc..e76bd91 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -17,6 +17,7 @@ * */ +#include <linux/delay.h> #define VIRTIO_PCI_NO_LEGACY #include "virtio_pci_common.h" @@ -271,9 +272,13 @@ static void vp_reset(struct virtio_device *vdev) struct virtio_pci_device *vp_dev = to_vp_device(vdev); /* 0 status means a reset. */ vp_iowrite8(0, &vp_dev->common->device_status); - /* Flush out the status write, and flush in device writes, - * including MSI-X interrupts, if any. */ - vp_ioread8(&amp...
2016 Apr 03
1
[PATCH] virtio: virtio 1.0 cs04 spec compliance for reset
...virtio_pci_modern.c index f6f28cc..e76bd91 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -17,6 +17,7 @@ * */ +#include <linux/delay.h> #define VIRTIO_PCI_NO_LEGACY #include "virtio_pci_common.h" @@ -271,9 +272,13 @@ static void vp_reset(struct virtio_device *vdev) struct virtio_pci_device *vp_dev = to_vp_device(vdev); /* 0 status means a reset. */ vp_iowrite8(0, &vp_dev->common->device_status); - /* Flush out the status write, and flush in device writes, - * including MSI-X interrupts, if any. */ - vp_ioread8(&amp...
2008 Jan 23
2
[PATCH 1/2] reset support: make net driver alloc/cleanup in probe and remove
Since we want to reset the device to remove them, this is simpler (device is reset for us on driver remove). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- drivers/net/virtio_net.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff -r 7e5b3ff06f60 drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Wed Jan 23 22:53:14
2008 Jan 23
2
[PATCH 1/2] reset support: make net driver alloc/cleanup in probe and remove
Since we want to reset the device to remove them, this is simpler (device is reset for us on driver remove). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> --- drivers/net/virtio_net.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff -r 7e5b3ff06f60 drivers/net/virtio_net.c --- a/drivers/net/virtio_net.c Wed Jan 23 22:53:14
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...tio_device *vdev) +void vp_synchronize_vectors(struct virtio_device *vdev) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); int i; @@ -198,20 +29,8 @@ static void vp_synchronize_vectors(struct virtio_device *vdev) synchronize_irq(vp_dev->msix_entries[i].vector); } -static void vp_reset(struct virtio_device *vdev) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - /* 0 status means a reset. */ - iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS); - /* Flush out the status write, and flush in device writes, - * including MSi-X interrupts, if any. */ - ioread8(vp_dev-&gt...
2014 Dec 08
0
[PATCH v2 08/10] virtio_pci: split out legacy device support
...tio_device *vdev) +void vp_synchronize_vectors(struct virtio_device *vdev) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); int i; @@ -198,20 +29,8 @@ static void vp_synchronize_vectors(struct virtio_device *vdev) synchronize_irq(vp_dev->msix_entries[i].vector); } -static void vp_reset(struct virtio_device *vdev) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - /* 0 status means a reset. */ - iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS); - /* Flush out the status write, and flush in device writes, - * including MSi-X interrupts, if any. */ - ioread8(vp_dev-&gt...
2014 Dec 08
0
[PATCH 8/9] virtio_pci: split out legacy device support
...tio_device *vdev) +void vp_synchronize_vectors(struct virtio_device *vdev) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); int i; @@ -198,20 +29,8 @@ static void vp_synchronize_vectors(struct virtio_device *vdev) synchronize_irq(vp_dev->msix_entries[i].vector); } -static void vp_reset(struct virtio_device *vdev) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - /* 0 status means a reset. */ - iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS); - /* Flush out the status write, and flush in device writes, - * including MSi-X interrupts, if any. */ - ioread8(vp_dev-&gt...
2014 Dec 08
0
[PATCH 8/9] virtio_pci: split out legacy device support
...tio_device *vdev) +void vp_synchronize_vectors(struct virtio_device *vdev) { struct virtio_pci_device *vp_dev = to_vp_device(vdev); int i; @@ -198,20 +29,8 @@ static void vp_synchronize_vectors(struct virtio_device *vdev) synchronize_irq(vp_dev->msix_entries[i].vector); } -static void vp_reset(struct virtio_device *vdev) -{ - struct virtio_pci_device *vp_dev = to_vp_device(vdev); - /* 0 status means a reset. */ - iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS); - /* Flush out the status write, and flush in device writes, - * including MSi-X interrupts, if any. */ - ioread8(vp_dev-&gt...
2015 Feb 15
3
[PATCH 1/2] virtio_pci_modern: type-safe io accessors
The spec is very clear on this: 4.1.3.1 Driver Requirements: PCI Device Layout The driver MUST access each field using the ?natural? access method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit fields and 8-bit accesses for 8-bit fields. Add type-safe wrappers to prevent access with incorrect width. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> ---
2015 Feb 15
3
[PATCH 1/2] virtio_pci_modern: type-safe io accessors
The spec is very clear on this: 4.1.3.1 Driver Requirements: PCI Device Layout The driver MUST access each field using the ?natural? access method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit fields and 8-bit accesses for 8-bit fields. Add type-safe wrappers to prevent access with incorrect width. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> ---
2023 Apr 11
0
[PATCH] virtio_pci: Wait for legacy device to be reset
...S. Tsirkin <mst at redhat.com> > > > */ > > > > > > +#include <linux/delay.h> > > > #include "linux/virtio_pci_legacy.h" > > > #include "virtio_pci_common.h" > > > > > > @@ -97,7 +98,8 @@ static void vp_reset(struct virtio_device *vdev) > > > vp_legacy_set_status(&vp_dev->ldev, 0); > > > /* Flush out the status write, and flush in device writes, > > > * including MSi-X interrupts, if any. */ > > > - vp_legacy_get_status(&vp_de...
2012 May 19
0
Notes on libguestfs on Fedora/ARM
...3.4-4.fc17.armv7hl \ FEBOOTSTRAP_MODULES=/lib/modules/3.3.4-4.fc17.armv7hl \ LIBGUESTFS_MEMSIZE=256 \ LIBGUESTFS_DEBUG=1 \ make check (4) Currently this will fail because the virtio-pci driver doesn't work on ARM. The characteristic stack trace starts with: [ 4.841052] [<c0230a08>] (vp_reset+0x14/0x64) from [<c022fa48>] (register_virtio_device+0x4c/0x94) [ 4.844047] [<c022fa48>] (register_virtio_device+0x4c/0x94) from [<c04277bc>] (virtio_pci_probe+0x100/0x168) [ 4.846966] [<c04277bc>] (virtio_pci_probe+0x100/0x168) from [<c02138e0>] (pci_device_prob...
2014 Sep 23
0
[PATCH RFC] virtio_pci: fix virtio spec compliance on restore
...;vdev.dev.driver, > @@ -795,14 +796,41 @@ static int virtio_pci_restore(struct device *dev) > return ret; > > pci_set_master(pci_dev); > + /* We always start by resetting the device, in case a previous > + * driver messed it up. */ > + vp_reset(&vp_dev->vdev); This should happen before enabling PCI bus mastering. > + > + /* Acknowledge that we've seen the device. */ > + status |= VIRTIO_CONFIG_S_ACKNOWLEDGE; > + vp_set_status(&vp_dev->vdev, status); > + > + /* Maybe driver fail...
2014 Oct 07
0
[PATCH v2 01/15] virtio_pci: fix virtio spec compliance on restore
...gt; drv = container_of(vp_dev->vdev.dev.driver, > @@ -799,14 +800,41 @@ static int virtio_pci_restore(struct device *dev) > return ret; > > pci_set_master(pci_dev); > + /* We always start by resetting the device, in case a previous > + * driver messed it up. */ > + vp_reset(&vp_dev->vdev); > + > + /* Acknowledge that we've seen the device. */ > + status |= VIRTIO_CONFIG_S_ACKNOWLEDGE; > + vp_set_status(&vp_dev->vdev, status); > + > + /* Maybe driver failed before freeze. > + * Restore the failed status, for debugging. */ > +...
2014 Dec 08
0
[PATCH v2 04/10] virtio_pci: use priv for vq notification
...> --- drivers/virtio/virtio_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 6a7b8bf..7b82eb5 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -204,11 +204,9 @@ static void vp_reset(struct virtio_device *vdev) /* the notify function used when creating a virt queue */ static bool vp_notify(struct virtqueue *vq) { - struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); - /* we write the queue's selector into the notification register to * signal the other end...
2014 Dec 08
0
[PATCH v2 04/10] virtio_pci: use priv for vq notification
...> --- drivers/virtio/virtio_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 6a7b8bf..7b82eb5 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -204,11 +204,9 @@ static void vp_reset(struct virtio_device *vdev) /* the notify function used when creating a virt queue */ static bool vp_notify(struct virtqueue *vq) { - struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); - /* we write the queue's selector into the notification register to * signal the other end...