Displaying 20 results from an estimated 131 matches for "free_buf".
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
...nux/module.h>
+#include <linux/dma-mapping.h>
#include "../tty/hvc/hvc_console.h"
/*
@@ -334,20 +335,60 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+/* Allcoate data buffer from DMA memory if requested */
+static inline void *
+alloc_databuf(struct virtio_device *vdev, size_t size, dma_addr_t *dma_handle,
+ gfp_t flag)
{
- kfree(buf->buf);
+#ifdef CONFIG_HAS_DMA
+ if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_D...
2012 Sep 03
3
[RFC 1/2] virtio_console: Add support for DMA memory allocation
...nux/module.h>
+#include <linux/dma-mapping.h>
#include "../tty/hvc/hvc_console.h"
/*
@@ -334,20 +335,60 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+/* Allcoate data buffer from DMA memory if requested */
+static inline void *
+alloc_databuf(struct virtio_device *vdev, size_t size, dma_addr_t *dma_handle,
+ gfp_t flag)
{
- kfree(buf->buf);
+#ifdef CONFIG_HAS_DMA
+ if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_D...
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
NOTE: These two patches are identical to first two patches of the V8 patch-set,
but are rebased to
2012 Dec 12
2
[PATCHv9 0/2] virtio_console: Add rproc_serial driver
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
NOTE: These two patches are identical to first two patches of the V8 patch-set,
but are rebased to
2016 Oct 11
2
[PATCH] virtio: console: Unlock vqs while freeing buffers
Commit c6017e793b93 ("virtio: console: add locks around buffer removal
in port unplug path") added locking around the freeing of buffers in the
vq. However, when free_buf() is called with can_sleep = true and rproc
is enabled, it calls dma_free_coherent() directly, requiring interrupts
to be enabled. Currently a WARNING is triggered due to the spin locking
around free_buf, with a call stack like this:
WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
fr...
2016 Oct 11
2
[PATCH] virtio: console: Unlock vqs while freeing buffers
Commit c6017e793b93 ("virtio: console: add locks around buffer removal
in port unplug path") added locking around the freeing of buffers in the
vq. However, when free_buf() is called with can_sleep = true and rproc
is enabled, it calls dma_free_coherent() directly, requiring interrupts
to be enabled. Currently a WARNING is triggered due to the spin locking
around free_buf, with a call stack like this:
WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
fr...
2012 Oct 30
5
[PATCHv8 0/3]virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
Changes since v7:
- Rebased to
2012 Oct 30
5
[PATCHv8 0/3]virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
Changes since v7:
- Rebased to
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
This patch-set is a rework of the
2012 Oct 15
7
[PATCHv7 0/4] virtio_console: Add rproc_serial driver
From: Sjur Br?ndeland <sjur.brandeland at stericsson.com>
This patch-set introduces a new virtio type "rproc_serial" for communicating
with remote processors over shared memory. The driver depends on the
the remoteproc framework. As preparation for introducing "rproc_serial"
I've done a refactoring of the transmit buffer handling.
This patch-set is a rework of the
2012 Sep 07
4
[RFCv2 1/2] virtio_console: Add support for DMA memory allocation
...ndif
+
/*
* This is a global struct for storing common data for all the devices
* this driver handles.
@@ -334,20 +341,56 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+/* Allocate data buffer from DMA memory if requested */
+static inline void *
+alloc_databuf(struct virtio_device *vdev, size_t size, gfp_t flag)
+{
+ if (VIRTIO_CONSOLE_HAS_DMA &&
+ virtio_has_feature(vdev, VIRTIO_CONSOLE_F_DMA_MEM)) {
+ struct device *dev =...
2012 Sep 07
4
[RFCv2 1/2] virtio_console: Add support for DMA memory allocation
...ndif
+
/*
* This is a global struct for storing common data for all the devices
* this driver handles.
@@ -334,20 +341,56 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+/* Allocate data buffer from DMA memory if requested */
+static inline void *
+alloc_databuf(struct virtio_device *vdev, size_t size, gfp_t flag)
+{
+ if (VIRTIO_CONSOLE_HAS_DMA &&
+ virtio_has_feature(vdev, VIRTIO_CONSOLE_F_DMA_MEM)) {
+ struct device *dev =...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct port_buffer *buf, size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *alloc_bu...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct port_buffer *buf, size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *alloc_bu...
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct port_buffer *buf, size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *alloc_bu...
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...return;
+ }
+ kfree(cpu_addr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,20 +382,22 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void
+free_buf(struct virtqueue *vq, struct port_buffer *buf, size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *alloc_bu...
2012 Sep 20
0
[PATCHv3] virtio_console: Add support for remoteproc serial
...+ return;
+ }
+ kfree(vaddr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,22 +385,24 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void free_buf(struct virtqueue *vq, struct port_buffer *buf,
+ size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *a...
2012 Sep 20
0
[PATCHv3] virtio_console: Add support for remoteproc serial
...+ return;
+ }
+ kfree(vaddr);
+}
+
static inline bool use_multiport(struct ports_device *portdev)
{
/*
@@ -334,22 +385,24 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
-static void free_buf(struct port_buffer *buf)
+static void free_buf(struct virtqueue *vq, struct port_buffer *buf,
+ size_t buf_size)
{
- kfree(buf->buf);
+ free_databuf(vq->vdev, buf_size, buf->buf);
kfree(buf);
}
-static struct port_buffer *alloc_buf(size_t buf_size)
+static struct port_buffer *a...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...ports_device *portdev)
{
/*
@@ -334,20 +352,99 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
+static DEFINE_SPINLOCK(list_lock);
+static LIST_HEAD(pending_free_list);
+
static void free_buf(struct port_buffer *buf)
{
- kfree(buf->buf);
+ unsigned long flags;
+
+ if (!buf->dev) {
+ kfree(buf->buf);
+ goto freebuf;
+ }
+
+ BUG_ON(!rproc_enabled);
+
+ /* dma_free_coherent requires interrupts to be enabled */
+ if (rproc_enabled && !irqs_disabled()) {
+ dma_free_coher...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...ports_device *portdev)
{
/*
@@ -334,20 +352,99 @@ static inline bool use_multiport(struct ports_device *portdev)
return portdev->vdev->features[0] & (1 << VIRTIO_CONSOLE_F_MULTIPORT);
}
+static DEFINE_SPINLOCK(list_lock);
+static LIST_HEAD(pending_free_list);
+
static void free_buf(struct port_buffer *buf)
{
- kfree(buf->buf);
+ unsigned long flags;
+
+ if (!buf->dev) {
+ kfree(buf->buf);
+ goto freebuf;
+ }
+
+ BUG_ON(!rproc_enabled);
+
+ /* dma_free_coherent requires interrupts to be enabled */
+ if (rproc_enabled && !irqs_disabled()) {
+ dma_free_coher...