search for: virtio_9p_lock

Displaying 20 results from an estimated 26 matches for "virtio_9p_lock".

2015 Mar 09
2
[PATCH] 9p/trans_virtio: fix hot-unplug
...const char *devname, char *args) static void p9_virtio_remove(struct virtio_device *vdev) { struct virtio_chan *chan = vdev->priv; - - if (chan->inuse) - p9_virtio_close(chan->client); - vdev->config->del_vqs(vdev); + unsigned long warning_time; + bool inuse; mutex_lock(&virtio_9p_lock); + + /* Remove self from list so we don't get new users. */ list_del(&chan->chan_list); + warning_time = jiffies; + + /* Wait for existing users to close. */ + while (chan->inuse) { + mutex_unlock(&virtio_9p_lock); + msleep(250); + if (time_after(jiffies, warnin...
2015 Mar 09
2
[PATCH] 9p/trans_virtio: fix hot-unplug
...const char *devname, char *args) static void p9_virtio_remove(struct virtio_device *vdev) { struct virtio_chan *chan = vdev->priv; - - if (chan->inuse) - p9_virtio_close(chan->client); - vdev->config->del_vqs(vdev); + unsigned long warning_time; + bool inuse; mutex_lock(&virtio_9p_lock); + + /* Remove self from list so we don't get new users. */ list_del(&chan->chan_list); + warning_time = jiffies; + + /* Wait for existing users to close. */ + while (chan->inuse) { + mutex_unlock(&virtio_9p_lock); + msleep(250); + if (time_after(jiffies, warnin...
2015 Mar 12
1
[PATCH] 9p/trans_virtio: fix hot-unplug
...{ > > struct virtio_chan *chan = vdev->priv; > > - > > - if (chan->inuse) > > - p9_virtio_close(chan->client); > > - vdev->config->del_vqs(vdev); > > + unsigned long warning_time; > > + bool inuse; > > > > mutex_lock(&virtio_9p_lock); > > + > > + /* Remove self from list so we don't get new users. */ > > list_del(&chan->chan_list); > > + warning_time = jiffies; > > + > > + /* Wait for existing users to close. */ > > + while (chan->inuse) { > > + mutex_unlock(&amp...
2015 Mar 12
1
[PATCH] 9p/trans_virtio: fix hot-unplug
...{ > > struct virtio_chan *chan = vdev->priv; > > - > > - if (chan->inuse) > > - p9_virtio_close(chan->client); > > - vdev->config->del_vqs(vdev); > > + unsigned long warning_time; > > + bool inuse; > > > > mutex_lock(&virtio_9p_lock); > > + > > + /* Remove self from list so we don't get new users. */ > > list_del(&chan->chan_list); > > + warning_time = jiffies; > > + > > + /* Wait for existing users to close. */ > > + while (chan->inuse) { > > + mutex_unlock(&amp...
2015 Mar 12
0
[PATCH] 9p/trans_virtio: fix hot-unplug
...irtio_remove(struct virtio_device *vdev) > { > struct virtio_chan *chan = vdev->priv; > - > - if (chan->inuse) > - p9_virtio_close(chan->client); > - vdev->config->del_vqs(vdev); > + unsigned long warning_time; > + bool inuse; > > mutex_lock(&virtio_9p_lock); > + > + /* Remove self from list so we don't get new users. */ > list_del(&chan->chan_list); > + warning_time = jiffies; > + > + /* Wait for existing users to close. */ > + while (chan->inuse) { > + mutex_unlock(&virtio_9p_lock); > + msleep(250); &...
2015 Mar 12
0
[PATCH] 9p/trans_virtio: fix hot-unplug
...irtio_remove(struct virtio_device *vdev) > { > struct virtio_chan *chan = vdev->priv; > - > - if (chan->inuse) > - p9_virtio_close(chan->client); > - vdev->config->del_vqs(vdev); > + unsigned long warning_time; > + bool inuse; > > mutex_lock(&virtio_9p_lock); > + > + /* Remove self from list so we don't get new users. */ > list_del(&chan->chan_list); > + warning_time = jiffies; > + > + /* Wait for existing users to close. */ > + while (chan->inuse) { > + mutex_unlock(&virtio_9p_lock); > + msleep(250); &...
2012 Aug 28
3
[PATCH v2 1/2] virtio-ring: Use threshold for switching to indirect descriptors
.....fc93962 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2012 Aug 28
3
[PATCH v2 1/2] virtio-ring: Use threshold for switching to indirect descriptors
.....fc93962 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2012 Jun 18
2
[RFC 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...7bfba 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh = 0; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2012 Jun 18
2
[RFC 1/2] virtio-ring: Use threshold for switching to indirect descriptors
...7bfba 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh = 0; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2012 Aug 30
2
[PATCH v3 1/2] virtio-ring: Use threshold for switching to indirect descriptors
.....418f933 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2012 Aug 30
2
[PATCH v3 1/2] virtio-ring: Use threshold for switching to indirect descriptors
.....418f933 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -52,6 +52,9 @@ #define VIRTQUEUE_NUM 128 +static unsigned int indirect_thresh; +module_param(indirect_thresh, uint, S_IRUGO); + /* a single mutex to manage channel initialization and attachment */ static DEFINE_MUTEX(virtio_9p_lock); static DECLARE_WAIT_QUEUE_HEAD(vp_wq); @@ -501,6 +504,7 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ + vdev->indirect_thresh = indirect_thresh; chan->vq = virtio_find_single_vq(vdev, req_done, "req...
2015 Jul 09
0
[PATCH] 9p/trans_virtio: reset virtio device on remove
...p/trans_virtio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 9dd49ca..6e70ddb 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -704,6 +704,7 @@ static void p9_virtio_remove(struct virtio_device *vdev) mutex_unlock(&virtio_9p_lock); + vdev->config->reset(vdev); vdev->config->del_vqs(vdev); sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); -- 2.3.8
2015 Jul 09
0
[PATCH] 9p/trans_virtio: reset virtio device on remove
...p/trans_virtio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 9dd49ca..6e70ddb 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -704,6 +704,7 @@ static void p9_virtio_remove(struct virtio_device *vdev) mutex_unlock(&virtio_9p_lock); + vdev->config->reset(vdev); vdev->config->del_vqs(vdev); sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); -- 2.3.8
2009 May 12
0
[PATCHv4] virtio: find_vqs/del_vqs virtio operations
...4 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -230,6 +230,8 @@ static int p9_virtio_probe(struct virtio_device *vdev) int err; struct virtio_chan *chan; int index; + vq_callback_t *callbacks[] = { req_done }; + const char *names[] = { "requests" }; mutex_lock(&virtio_9p_lock); index = chan_index++; @@ -246,11 +248,9 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ - chan->vq = vdev->config->find_vq(vdev, 0, req_done, "requests"); - if (IS_ERR(chan->vq)) { - err =...
2009 May 12
0
[PATCHv4] virtio: find_vqs/del_vqs virtio operations
...4 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -230,6 +230,8 @@ static int p9_virtio_probe(struct virtio_device *vdev) int err; struct virtio_chan *chan; int index; + vq_callback_t *callbacks[] = { req_done }; + const char *names[] = { "requests" }; mutex_lock(&virtio_9p_lock); index = chan_index++; @@ -246,11 +248,9 @@ static int p9_virtio_probe(struct virtio_device *vdev) chan->vdev = vdev; /* We expect one virtqueue, for requests. */ - chan->vq = vdev->config->find_vq(vdev, 0, req_done, "requests"); - if (IS_ERR(chan->vq)) { - err =...
2009 May 14
1
[PATCHv6 2/4] virtio: find_vqs/del_vqs virtio operations
This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations, and updates all drivers. This is needed for MSI support, because MSI needs to know the total number of vectors upfront. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/block/virtio_blk.c | 6 ++-- drivers/char/hw_random/virtio-rng.c | 6 ++-- drivers/char/virtio_console.c | 26
2009 May 14
1
[PATCHv6 2/4] virtio: find_vqs/del_vqs virtio operations
This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations, and updates all drivers. This is needed for MSI support, because MSI needs to know the total number of vectors upfront. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/block/virtio_blk.c | 6 ++-- drivers/char/hw_random/virtio-rng.c | 6 ++-- drivers/char/virtio_console.c | 26
2014 Oct 06
25
[PATCH v2 00/15] virtio: fix spec compliance issues
Rusty, I have a mind to include this patchset for this merge window. Any input on this? This fixes the following virtio spec compliance issues: 1. on restore, drivers use device before setting ACKNOWLEDGE and DRIVER bits 2. on probe, drivers aren't prepared to handle config interrupts arriving before probe returns 3. on probe, drivers use device before DRIVER_OK it set Note that 1 is a
2014 Oct 06
25
[PATCH v2 00/15] virtio: fix spec compliance issues
Rusty, I have a mind to include this patchset for this merge window. Any input on this? This fixes the following virtio spec compliance issues: 1. on restore, drivers use device before setting ACKNOWLEDGE and DRIVER bits 2. on probe, drivers aren't prepared to handle config interrupts arriving before probe returns 3. on probe, drivers use device before DRIVER_OK it set Note that 1 is a