Displaying 20 results from an estimated 43 matches for "incnt".
2020 Sep 08
0
[PATCH 2/3] drm/virtio: return virtio_gpu_queue errors
..._t size, int *sg_ents)
return sgt;
}
-static void virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
- struct virtio_gpu_vbuffer *vbuf,
- struct virtio_gpu_fence *fence,
- int elemcnt,
- struct scatterlist **sgs,
- int outcnt,
- int incnt)
+static int virtio_gpu_queue_ctrl_sgs(struct virtio_gpu_device *vgdev,
+ struct virtio_gpu_vbuffer *vbuf,
+ struct virtio_gpu_fence *fence,
+ int elemcnt,
+ struct scatterlist **sgs,
+ int outcnt,
+ int incnt)
{
struct virtqueue *vq = vgdev->ct...
2018 Apr 03
3
[PATCH] drm/virtio: fix vq wait_event condition
.../drivers/gpu/drm/virtio/virtgpu_vq.c
index 48e4f1df6e..020070d483 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -293,7 +293,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
if (ret == -ENOSPC) {
spin_unlock(&vgdev->ctrlq.qlock);
- wait_event(vgdev->ctrlq.ack_queue, vq->num_free);
+ wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt);
spin_lock(&vgdev->ctrlq.qlock);
goto retry;
} else {
@@ -...
2018 Apr 03
3
[PATCH] drm/virtio: fix vq wait_event condition
.../drivers/gpu/drm/virtio/virtgpu_vq.c
index 48e4f1df6e..020070d483 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -293,7 +293,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
if (ret == -ENOSPC) {
spin_unlock(&vgdev->ctrlq.qlock);
- wait_event(vgdev->ctrlq.ack_queue, vq->num_free);
+ wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt);
spin_lock(&vgdev->ctrlq.qlock);
goto retry;
} else {
@@ -...
2019 Sep 10
0
[PATCH v3 2/2] drm/virtio: Use vmalloc for command buffer allocations.
...gpu_vbuffer *vbuf,
+ struct scatterlist *vout)
__releases(&vgdev->ctrlq.qlock)
__acquires(&vgdev->ctrlq.qlock)
{
struct virtqueue *vq = vgdev->ctrlq.vq;
- struct scatterlist *sgs[3], vcmd, vout, vresp;
+ struct scatterlist *sgs[3], vcmd, vresp;
int outcnt = 0, incnt = 0;
int ret;
@@ -268,9 +309,8 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
sgs[outcnt + incnt] = &vcmd;
outcnt++;
- if (vbuf->data_size) {
- sg_init_one(&vout, vbuf->data_buf, vbuf->data_size);
- sgs[outcnt + incnt] = &vout;
+...
2019 Sep 11
1
[PATCH v4 2/2] drm/virtio: Use vmalloc for command buffer allocations.
...irtio_gpu_vbuffer *vbuf,
+ struct scatterlist *vout)
__releases(&vgdev->ctrlq.qlock)
__acquires(&vgdev->ctrlq.qlock)
{
struct virtqueue *vq = vgdev->ctrlq.vq;
- struct scatterlist *sgs[3], vcmd, vout, vresp;
+ struct scatterlist *sgs[3], vcmd, vresp;
int outcnt = 0, incnt = 0;
bool notify = false;
int ret;
@@ -274,9 +315,8 @@ static bool virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
sgs[outcnt + incnt] = &vcmd;
outcnt++;
- if (vbuf->data_size) {
- sg_init_one(&vout, vbuf->data_buf, vbuf->data_size);
- sgs[outcnt +...
2019 Sep 05
2
[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.
...gpu_vbuffer *vbuf,
+ struct scatterlist *vout)
__releases(&vgdev->ctrlq.qlock)
__acquires(&vgdev->ctrlq.qlock)
{
struct virtqueue *vq = vgdev->ctrlq.vq;
- struct scatterlist *sgs[3], vcmd, vout, vresp;
+ struct scatterlist *sgs[3], vcmd, vresp;
int outcnt = 0, incnt = 0;
int ret;
@@ -268,9 +325,8 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
sgs[outcnt + incnt] = &vcmd;
outcnt++;
- if (vbuf->data_size) {
- sg_init_one(&vout, vbuf->data_buf, vbuf->data_size);
- sgs[outcnt + incnt] = &vout;
+...
2019 Sep 05
2
[PATCH v2] drm/virtio: Use vmalloc for command buffer allocations.
...gpu_vbuffer *vbuf,
+ struct scatterlist *vout)
__releases(&vgdev->ctrlq.qlock)
__acquires(&vgdev->ctrlq.qlock)
{
struct virtqueue *vq = vgdev->ctrlq.vq;
- struct scatterlist *sgs[3], vcmd, vout, vresp;
+ struct scatterlist *sgs[3], vcmd, vresp;
int outcnt = 0, incnt = 0;
int ret;
@@ -268,9 +325,8 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
sgs[outcnt + incnt] = &vcmd;
outcnt++;
- if (vbuf->data_size) {
- sg_init_one(&vout, vbuf->data_buf, vbuf->data_size);
- sgs[outcnt + incnt] = &vout;
+...
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...>> +}
>> +
>> +static int virtio_i2c_add_msg(struct virtqueue *vq,
>> +????????????????? struct virtio_i2c_msg *vmsg,
>> +????????????????? struct i2c_msg *msg)
>> +{
>> +??? struct scatterlist *sgs[3], hdr, bout, bin, status;
>> +??? int outcnt = 0, incnt = 0;
>> +
>> +??? if (!msg->len)
>> +??????? return -EINVAL;
>> +
>> +??? vmsg->hdr.addr = msg->addr;
>> +??? vmsg->hdr.flags = msg->flags;
>> +??? vmsg->hdr.len = msg->len;
>
>
> Missing endian conversion?
>
You are right....
2020 Sep 04
2
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...>> +}
>> +
>> +static int virtio_i2c_add_msg(struct virtqueue *vq,
>> +????????????????? struct virtio_i2c_msg *vmsg,
>> +????????????????? struct i2c_msg *msg)
>> +{
>> +??? struct scatterlist *sgs[3], hdr, bout, bin, status;
>> +??? int outcnt = 0, incnt = 0;
>> +
>> +??? if (!msg->len)
>> +??????? return -EINVAL;
>> +
>> +??? vmsg->hdr.addr = msg->addr;
>> +??? vmsg->hdr.flags = msg->flags;
>> +??? vmsg->hdr.len = msg->len;
>
>
> Missing endian conversion?
>
You are right....
2018 Apr 20
0
[PATCH] drm/virtio: fix vq wait_event condition
...irtgpu_vq.c
> index 48e4f1df6e..020070d483 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_vq.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
> @@ -293,7 +293,7 @@ static int virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
> ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
> if (ret == -ENOSPC) {
> spin_unlock(&vgdev->ctrlq.qlock);
> - wait_event(vgdev->ctrlq.ack_queue, vq->num_free);
> + wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt);
> spin_lock(&vgdev->ctrlq.qlock);
>...
2019 Aug 13
0
[PATCH 2/2] drm/virtio: notify virtqueues without holding spinlock
...__releases(&vgdev->ctrlq.qlock)
__acquires(&vgdev->ctrlq.qlock)
@@ -260,10 +260,11 @@ static void virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
struct virtqueue *vq = vgdev->ctrlq.vq;
struct scatterlist *sgs[3], vcmd, vout, vresp;
int outcnt = 0, incnt = 0;
+ bool notify = false;
int ret;
if (!vgdev->vqs_ready)
- return;
+ return notify;
sg_init_one(&vcmd, vbuf->buf, vbuf->size);
sgs[outcnt + incnt] = &vcmd;
@@ -292,16 +293,21 @@ static void virtio_gpu_queue_ctrl_buffer_locked(struct virtio_gpu_device *vgdev,
tra...
2020 Sep 07
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...>>> +static int virtio_i2c_add_msg(struct virtqueue *vq,
>>> +????????????????? struct virtio_i2c_msg *vmsg,
>>> +????????????????? struct i2c_msg *msg)
>>> +{
>>> +??? struct scatterlist *sgs[3], hdr, bout, bin, status;
>>> +??? int outcnt = 0, incnt = 0;
>>> +
>>> +??? if (!msg->len)
>>> +??????? return -EINVAL;
>>> +
>>> +??? vmsg->hdr.addr = msg->addr;
>>> +??? vmsg->hdr.flags = msg->flags;
>>> +??? vmsg->hdr.len = msg->len;
>>
>>
>> Missing...
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...ue *vq)
+{
+ struct virtio_i2c *vi = vq->vdev->priv;
+
+ complete(&vi->completion);
+}
+
+static int virtio_i2c_add_msg(struct virtqueue *vq,
+ struct virtio_i2c_msg *vmsg,
+ struct i2c_msg *msg)
+{
+ struct scatterlist *sgs[3], hdr, bout, bin, status;
+ int outcnt = 0, incnt = 0;
+
+ if (!msg->len)
+ return -EINVAL;
+
+ vmsg->hdr.addr = msg->addr;
+ vmsg->hdr.flags = msg->flags;
+ vmsg->hdr.len = msg->len;
+
+ vmsg->buf = kzalloc(vmsg->hdr.len, GFP_KERNEL);
+ if (!vmsg->buf)
+ return -ENOMEM;
+
+ sg_init_one(&hdr, &vmsg->hdr,...
2020 Sep 03
9
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...ue *vq)
+{
+ struct virtio_i2c *vi = vq->vdev->priv;
+
+ complete(&vi->completion);
+}
+
+static int virtio_i2c_add_msg(struct virtqueue *vq,
+ struct virtio_i2c_msg *vmsg,
+ struct i2c_msg *msg)
+{
+ struct scatterlist *sgs[3], hdr, bout, bin, status;
+ int outcnt = 0, incnt = 0;
+
+ if (!msg->len)
+ return -EINVAL;
+
+ vmsg->hdr.addr = msg->addr;
+ vmsg->hdr.flags = msg->flags;
+ vmsg->hdr.len = msg->len;
+
+ vmsg->buf = kzalloc(vmsg->hdr.len, GFP_KERNEL);
+ if (!vmsg->buf)
+ return -ENOMEM;
+
+ sg_init_one(&hdr, &vmsg->hdr,...
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...ue *vq)
+{
+ struct virtio_i2c *vi = vq->vdev->priv;
+
+ complete(&vi->completion);
+}
+
+static int virtio_i2c_add_msg(struct virtqueue *vq,
+ struct virtio_i2c_msg *vmsg,
+ struct i2c_msg *msg)
+{
+ struct scatterlist *sgs[3], hdr, bout, bin, status;
+ int outcnt = 0, incnt = 0;
+
+ if (!msg->len)
+ return -EINVAL;
+
+ vmsg->hdr.addr = cpu_to_le16(msg->addr);
+ vmsg->hdr.flags = cpu_to_le16(msg->flags);
+ vmsg->hdr.len = cpu_to_le16(msg->len);
+
+ vmsg->buf = kzalloc(msg->len, GFP_KERNEL);
+ if (!vmsg->buf)
+ return -ENOMEM;
+
+ sg_init...
2020 Sep 22
3
[PATCH v3] i2c: virtio: add a virtio i2c frontend driver
...ue *vq)
+{
+ struct virtio_i2c *vi = vq->vdev->priv;
+
+ complete(&vi->completion);
+}
+
+static int virtio_i2c_add_msg(struct virtqueue *vq,
+ struct virtio_i2c_msg *vmsg,
+ struct i2c_msg *msg)
+{
+ struct scatterlist *sgs[3], hdr, bout, bin, status;
+ int outcnt = 0, incnt = 0;
+
+ if (!msg->len)
+ return -EINVAL;
+
+ vmsg->hdr.addr = cpu_to_le16(msg->addr);
+ vmsg->hdr.flags = cpu_to_le16(msg->flags);
+ vmsg->hdr.len = cpu_to_le16(msg->len);
+
+ vmsg->buf = kzalloc(msg->len, GFP_KERNEL);
+ if (!vmsg->buf)
+ return -ENOMEM;
+
+ sg_init...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...gt;priv;
> +
> + complete(&vi->completion);
> +}
> +
> +static int virtio_i2c_add_msg(struct virtqueue *vq,
> + struct virtio_i2c_msg *vmsg,
> + struct i2c_msg *msg)
> +{
> + struct scatterlist *sgs[3], hdr, bout, bin, status;
> + int outcnt = 0, incnt = 0;
> +
> + if (!msg->len)
> + return -EINVAL;
> +
> + vmsg->hdr.addr = msg->addr;
> + vmsg->hdr.flags = msg->flags;
> + vmsg->hdr.len = msg->len;
> +
> + vmsg->buf = kzalloc(vmsg->hdr.len, GFP_KERNEL);
> + if (!vmsg->buf)
> + return...
2020 Sep 03
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...gt;priv;
> +
> + complete(&vi->completion);
> +}
> +
> +static int virtio_i2c_add_msg(struct virtqueue *vq,
> + struct virtio_i2c_msg *vmsg,
> + struct i2c_msg *msg)
> +{
> + struct scatterlist *sgs[3], hdr, bout, bin, status;
> + int outcnt = 0, incnt = 0;
> +
> + if (!msg->len)
> + return -EINVAL;
> +
> + vmsg->hdr.addr = msg->addr;
> + vmsg->hdr.flags = msg->flags;
> + vmsg->hdr.len = msg->len;
> +
> + vmsg->buf = kzalloc(vmsg->hdr.len, GFP_KERNEL);
> + if (!vmsg->buf)
> + return...
2020 Sep 14
0
[PATCH v2] i2c: virtio: add a virtio i2c frontend driver
...gt;priv;
> +
> + complete(&vi->completion);
> +}
> +
> +static int virtio_i2c_add_msg(struct virtqueue *vq,
> + struct virtio_i2c_msg *vmsg,
> + struct i2c_msg *msg)
> +{
> + struct scatterlist *sgs[3], hdr, bout, bin, status;
> + int outcnt = 0, incnt = 0;
> +
> + if (!msg->len)
> + return -EINVAL;
> +
> + vmsg->hdr.addr = cpu_to_le16(msg->addr);
> + vmsg->hdr.flags = cpu_to_le16(msg->flags);
> + vmsg->hdr.len = cpu_to_le16(msg->len);
> +
> + vmsg->buf = kzalloc(msg->len, GFP_KERNEL);
> +...
2020 Sep 04
0
[PATCH] i2c: virtio: add a virtio i2c frontend driver
...gt;priv;
> +
> + complete(&vi->completion);
> +}
> +
> +static int virtio_i2c_add_msg(struct virtqueue *vq,
> + struct virtio_i2c_msg *vmsg,
> + struct i2c_msg *msg)
> +{
> + struct scatterlist *sgs[3], hdr, bout, bin, status;
> + int outcnt = 0, incnt = 0;
> +
> + if (!msg->len)
> + return -EINVAL;
> +
> + vmsg->hdr.addr = msg->addr;
> + vmsg->hdr.flags = msg->flags;
> + vmsg->hdr.len = msg->len;
Missing endian conversion?
> +
> + vmsg->buf = kzalloc(vmsg->hdr.len, GFP_KERNEL);
> + if...