search for: nr_added_buf

Displaying 20 results from an estimated 75 matches for "nr_added_buf".

Did you mean: nr_added_bufs
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...+1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + r...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...+1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + r...
2019 Nov 14
3
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...+1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + r...
2019 Nov 14
3
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...+1325,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols) port->cons.ws.ws_col = cols; } -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) { struct port_buffer *buf; - unsigned int nr_added_bufs; + int nr_added_bufs; int ret; nr_added_bufs = 0; do { buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); if (!buf) - break; + return -ENOMEM; spin_lock_irq(lock); ret = add_inbuf(vq, buf); if (ret < 0) { spin_unlock_irq(lock); free_buf(buf, true); - break; + r...
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...> spin_lock_init(&port->outvq_lock); > > > init_waitqueue_head(&port->waitqueue); > > > > > > + virtio_device_ready(portdev->vdev); > > > + > > > /* Fill the in_vq with buffers so the host can send us data. */ > > > nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); > > > if (!nr_added_bufs) { > > > > Seems like probe and add_port() now both set VIRTIO_CONFIG_S_DRIVER_OK > > I think we need to set this in the probe function instead, otherwise we > fail for multiqueue (wh...
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...> spin_lock_init(&port->outvq_lock); > > > init_waitqueue_head(&port->waitqueue); > > > > > > + virtio_device_ready(portdev->vdev); > > > + > > > /* Fill the in_vq with buffers so the host can send us data. */ > > > nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); > > > if (!nr_added_bufs) { > > > > Seems like probe and add_port() now both set VIRTIO_CONFIG_S_DRIVER_OK > > I think we need to set this in the probe function instead, otherwise we > fail for multiqueue (wh...
2019 Oct 18
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...ar/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1421,12 +1421,17 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue); - /* Fill the in_vq with buffers so the host can send us data. */ - nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); - if (!nr_added_bufs) { - dev_err(port->dev, "Error allocating inbufs\n"); - err = -ENOMEM; - goto free_device; + /* if the in_vq has not already been filled (the port has already been + * used and unplugged), fill the in_vq...
2019 Oct 18
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...ar/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1421,12 +1421,17 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue); - /* Fill the in_vq with buffers so the host can send us data. */ - nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); - if (!nr_added_bufs) { - dev_err(port->dev, "Error allocating inbufs\n"); - err = -ENOMEM; - goto free_device; + /* if the in_vq has not already been filled (the port has already been + * used and unplugged), fill the in_vq...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...> > port->cons.ws.ws_col = cols; > > } > > > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > { > > struct port_buffer *buf; > > - unsigned int nr_added_bufs; > > + int nr_added_bufs; > > int ret; > > > > nr_added_bufs = 0; > > do { > > buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); > > if (!buf) > > - break; > > + return -ENOMEM; > > > > spin_lock_irq(lock); > &gt...
2019 Nov 13
2
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...> > port->cons.ws.ws_col = cols; > > } > > > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > { > > struct port_buffer *buf; > > - unsigned int nr_added_bufs; > > + int nr_added_bufs; > > int ret; > > > > nr_added_bufs = 0; > > do { > > buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); > > if (!buf) > > - break; > > + return -ENOMEM; > > > > spin_lock_irq(lock); > &gt...
2019 Nov 13
0
[PATCH v2] virtio_console: allocate inbufs in add_port() only if it is needed
...e(struct port *port, u16 rows, u16 cols) > port->cons.ws.ws_col = cols; > } > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > { > struct port_buffer *buf; > - unsigned int nr_added_bufs; > + int nr_added_bufs; > int ret; > > nr_added_bufs = 0; > do { > buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); > if (!buf) > - break; > + return -ENOMEM; > > spin_lock_irq(lock); > ret = add_inbuf(vq, buf); > if (ret < 0) { &gt...
2019 Dec 03
0
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...ort > *port, u16 rows, u16 cols) > port->cons.ws.ws_col = cols; > } > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t > *lock) > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > { > struct port_buffer *buf; > - unsigned int nr_added_bufs; > + int nr_added_bufs; > int ret; > > nr_added_bufs = 0; > do { > buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); > if (!buf) > - break; > + return -ENOMEM; > > spin_lock_irq(lock); > ret = add_inbuf(vq, buf); > if (ret < 0) { &gt...
2019 Nov 06
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...c >> @@ -1421,12 +1421,17 @@ static int add_port(struct ports_device *portdev, u32 id) >> spin_lock_init(&port->outvq_lock); >> init_waitqueue_head(&port->waitqueue); >> >> - /* Fill the in_vq with buffers so the host can send us data. */ >> - nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); >> - if (!nr_added_bufs) { >> - dev_err(port->dev, "Error allocating inbufs\n"); >> - err = -ENOMEM; >> - goto free_device; >> + /* if the in_vq has not already been filled (the port has already b...
2019 Nov 06
3
[PATCH] virtio_console: allocate inbufs in add_port() only if it is needed
...c >> @@ -1421,12 +1421,17 @@ static int add_port(struct ports_device *portdev, u32 id) >> spin_lock_init(&port->outvq_lock); >> init_waitqueue_head(&port->waitqueue); >> >> - /* Fill the in_vq with buffers so the host can send us data. */ >> - nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); >> - if (!nr_added_bufs) { >> - dev_err(port->dev, "Error allocating inbufs\n"); >> - err = -ENOMEM; >> - goto free_device; >> + /* if the in_vq has not already been filled (the port has already b...
2014 Oct 13
2
[PATCH v4 13/25] virtio_console: enable VQs early
...rtio_console.c @@ -1449,6 +1449,8 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue); + virtio_device_ready(portdev->vdev); + /* Fill the in_vq with buffers so the host can send us data. */ nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); if (!nr_added_bufs) { -- MST
2014 Oct 13
2
[PATCH v4 13/25] virtio_console: enable VQs early
...rtio_console.c @@ -1449,6 +1449,8 @@ static int add_port(struct ports_device *portdev, u32 id) spin_lock_init(&port->outvq_lock); init_waitqueue_head(&port->waitqueue); + virtio_device_ready(portdev->vdev); + /* Fill the in_vq with buffers so the host can send us data. */ nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); if (!nr_added_bufs) { -- MST
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...@ static int add_port(struct ports_device *portdev, u32 id) > spin_lock_init(&port->outvq_lock); > init_waitqueue_head(&port->waitqueue); > > + virtio_device_ready(portdev->vdev); > + > /* Fill the in_vq with buffers so the host can send us data. */ > nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); > if (!nr_added_bufs) { Seems like probe and add_port() now both set VIRTIO_CONFIG_S_DRIVER_OK 1.839658] kernel BUG at include/linux/virtio_config.h:125! [ 1.839995] invalid opcode: 0000 [#1] SMP [ 1.840169] Modules linked i...
2019 Dec 03
1
[PATCH v3] virtio_console: allocate inbufs in add_port() only if it is needed
...port->cons.ws.ws_col = cols; > > } > > > > -static unsigned int fill_queue(struct virtqueue *vq, spinlock_t > > *lock) > > +static int fill_queue(struct virtqueue *vq, spinlock_t *lock) > > { > > struct port_buffer *buf; > > - unsigned int nr_added_bufs; > > + int nr_added_bufs; > > int ret; > > > > nr_added_bufs = 0; > > do { > > buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); > > if (!buf) > > - break; > > + return -ENOMEM; > > > > spin_lock_irq(lock); > &gt...
2014 Oct 20
4
[PATCH v4 13/25] virtio_console: enable VQs early
...@ static int add_port(struct ports_device *portdev, u32 id) > spin_lock_init(&port->outvq_lock); > init_waitqueue_head(&port->waitqueue); > > + virtio_device_ready(portdev->vdev); > + > /* Fill the in_vq with buffers so the host can send us data. */ > nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); > if (!nr_added_bufs) { Seems like probe and add_port() now both set VIRTIO_CONFIG_S_DRIVER_OK 1.839658] kernel BUG at include/linux/virtio_config.h:125! [ 1.839995] invalid opcode: 0000 [#1] SMP [ 1.840169] Modules linked i...
2013 Mar 29
3
[PATCH v2 0/2] virtio: console: add locking around control out-vq
The in-vq operations were protected by a lock, but the out-vq operations were not. This caused panics / errors as described in patch 2. Fix that. The first patch renames the existing cvq_lock to c_ivq_lock to match c_ivq. The second patch introduces the c_ovq_lock for the c_ovq. Please apply. I also believe this is a candidate for stable. v2: * Use spin_lock instead of spin_lock_irq.