Displaying 20 results from an estimated 34 matches for "cio_gp_dma_zalloc".
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...t; +{
> + /* No need to free up the resources: compiled in */
> + cio_dma_pool = cio_gp_dma_create(cio_get_dma_css_dev(), 1);
Does it make sense to continue if you did not get a pool here? I don't
think that should happen unless things were really bad already?
> +}
> +
> +void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> + size_t size)
> +{
> + dma_addr_t dma_addr;
> + unsigned long addr;
> + size_t chunk_size;
> +
> + addr = gen_pool_alloc(gp_dma, size);
> + while (!addr) {
> + chunk_size = round_up(size, PAGE_SIZE);
> + addr = (u...
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...t; +{
> + /* No need to free up the resources: compiled in */
> + cio_dma_pool = cio_gp_dma_create(cio_get_dma_css_dev(), 1);
Does it make sense to continue if you did not get a pool here? I don't
think that should happen unless things were really bad already?
> +}
> +
> +void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> + size_t size)
> +{
> + dma_addr_t dma_addr;
> + unsigned long addr;
> + size_t chunk_size;
> +
> + addr = gen_pool_alloc(gp_dma, size);
> + while (!addr) {
> + chunk_size = round_up(size, PAGE_SIZE);
> + addr = (u...
2019 May 27
0
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...addr)
> > + return gp_dma;
>
> So, you may return here with no memory added to the pool at all (or
> less than requested), but for the caller that is indistinguishable from
> an allocation that went all right. May that be a problem?
>
I do not think it can cause a problem: cio_gp_dma_zalloc() is going to
try to allocate the memory required and put it in the pool. If that
fails as well, we return a NULL pointer like kmalloc(). So I think we
are clean.
> > + gen_pool_add_virt(gp_dma, (unsigned long) cpu_addr,
> > + dma_addr, PAGE_SIZE, -1);
> > + }
> > + r...
2019 May 23
0
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/*...
2019 Apr 26
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/*...
2019 May 29
0
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+struct gen_pool;
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/*...
2019 Jun 06
0
[PATCH v4 2/8] s390/cio: introduce DMA pools to cio
...-328,6 +329,16 @@ static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/*...
2019 Jun 12
0
[PATCH v5 2/8] s390/cio: introduce DMA pools to cio
...-328,6 +329,16 @@ static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void);
+extern void *cio_dma_zalloc(size_t size);
+extern void cio_dma_free(void *cpu_addr, size_t size);
+extern struct device *cio_get_dma_css_dev(void);
+
+void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
+ size_t size);
+void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
+void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
+struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
+
/*...
2019 May 10
3
[PATCH 05/10] s390/cio: introduce DMA pools to cio
On Fri, 10 May 2019 00:11:12 +0200
Halil Pasic <pasic at linux.ibm.com> wrote:
> On Thu, 9 May 2019 12:11:06 +0200
> Cornelia Huck <cohuck at redhat.com> wrote:
>
> > On Wed, 8 May 2019 23:22:10 +0200
> > Halil Pasic <pasic at linux.ibm.com> wrote:
> >
> > > On Wed, 8 May 2019 15:18:10 +0200 (CEST)
> > > Sebastian Ott <sebott
2019 May 10
3
[PATCH 05/10] s390/cio: introduce DMA pools to cio
On Fri, 10 May 2019 00:11:12 +0200
Halil Pasic <pasic at linux.ibm.com> wrote:
> On Thu, 9 May 2019 12:11:06 +0200
> Cornelia Huck <cohuck at redhat.com> wrote:
>
> > On Wed, 8 May 2019 23:22:10 +0200
> > Halil Pasic <pasic at linux.ibm.com> wrote:
> >
> > > On Wed, 8 May 2019 15:18:10 +0200 (CEST)
> > > Sebastian Ott <sebott
2019 May 13
2
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...e *) data, PAGE_SIZE,
> +
> + size_t chunk_size = chunk->end_addr - chunk->start_addr + 1;
> +
> + dma_free_coherent((struct device *) data, chunk_size,
> (void *) chunk->start_addr,
> (dma_addr_t) chunk->phys_addr);
> }
> @@ -1088,13 +1091,15 @@ void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> {
> dma_addr_t dma_addr;
> unsigned long addr = gen_pool_alloc(gp_dma, size);
> + size_t chunk_size;
>
> if (!addr) {
> + chunk_size = round_up(size, PAGE_SIZE);
Doesn't that mean that we still go up to chunks of...
2019 May 13
2
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...e *) data, PAGE_SIZE,
> +
> + size_t chunk_size = chunk->end_addr - chunk->start_addr + 1;
> +
> + dma_free_coherent((struct device *) data, chunk_size,
> (void *) chunk->start_addr,
> (dma_addr_t) chunk->phys_addr);
> }
> @@ -1088,13 +1091,15 @@ void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> {
> dma_addr_t dma_addr;
> unsigned long addr = gen_pool_alloc(gp_dma, size);
> + size_t chunk_size;
>
> if (!addr) {
> + chunk_size = round_up(size, PAGE_SIZE);
Doesn't that mean that we still go up to chunks of...
2019 May 12
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...ta)
{
- dma_free_coherent((struct device *) data, PAGE_SIZE,
+
+ size_t chunk_size = chunk->end_addr - chunk->start_addr + 1;
+
+ dma_free_coherent((struct device *) data, chunk_size,
(void *) chunk->start_addr,
(dma_addr_t) chunk->phys_addr);
}
@@ -1088,13 +1091,15 @@ void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
{
dma_addr_t dma_addr;
unsigned long addr = gen_pool_alloc(gp_dma, size);
+ size_t chunk_size;
if (!addr) {
+ chunk_size = round_up(size, PAGE_SIZE);
addr = (unsigned long) dma_alloc_coherent(dma_dev,
- PAGE_SIZE, &dma_addr, CIO_...
2019 May 15
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...gt; + size_t chunk_size = chunk->end_addr - chunk->start_addr + 1;
> > +
> > + dma_free_coherent((struct device *) data, chunk_size,
> > (void *) chunk->start_addr,
> > (dma_addr_t) chunk->phys_addr);
> > }
> > @@ -1088,13 +1091,15 @@ void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> > {
> > dma_addr_t dma_addr;
> > unsigned long addr = gen_pool_alloc(gp_dma, size);
> > + size_t chunk_size;
> >
> > if (!addr) {
> > + chunk_size = round_up(size, PAGE_SIZE);
>
> Doesn'...
2019 Jun 03
5
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...>
> +extern void *cio_dma_zalloc(size_t size);
> +extern void cio_dma_free(void *cpu_addr, size_t size);
> +extern struct device *cio_get_dma_css_dev(void);
> +
> +struct gen_pool;
That forward declaration is a bit ugly... I guess the alternative was
include hell?
> +void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> + size_t size);
> +void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
> +void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev,...
2019 Jun 03
5
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...>
> +extern void *cio_dma_zalloc(size_t size);
> +extern void cio_dma_free(void *cpu_addr, size_t size);
> +extern struct device *cio_get_dma_css_dev(void);
> +
> +struct gen_pool;
That forward declaration is a bit ugly... I guess the alternative was
include hell?
> +void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
> + size_t size);
> +void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
> +void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev,...
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
On Tue, 11 Jun 2019 16:27:21 +0200
Halil Pasic <pasic at linux.ibm.com> wrote:
> On Tue, 11 Jun 2019 12:17:21 +0200
> Cornelia Huck <cohuck at redhat.com> wrote:
>
> > On Thu, 6 Jun 2019 13:51:23 +0200
> > Halil Pasic <pasic at linux.ibm.com> wrote:
> >
> > > Protected virtualization guests have to use shared pages for airq
> > >
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
On Tue, 11 Jun 2019 16:27:21 +0200
Halil Pasic <pasic at linux.ibm.com> wrote:
> On Tue, 11 Jun 2019 12:17:21 +0200
> Cornelia Huck <cohuck at redhat.com> wrote:
>
> > On Thu, 6 Jun 2019 13:51:23 +0200
> > Halil Pasic <pasic at linux.ibm.com> wrote:
> >
> > > Protected virtualization guests have to use shared pages for airq
> > >
2019 Jun 03
0
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...s_dev(void);
>> +
>> +struct gen_pool;
>
> That forward declaration is a bit ugly... I guess the alternative was
> include hell?
That's an easy one.
#include <linux/bitops.h>
+#include <linux/genalloc.h>
#include <asm/types.h>
>
>> +void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
>> + size_t size);
>> +void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
>> +void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
>> +struct gen_pool *cio_gp_dma_create(struct d...
2019 Jun 06
15
[PATCH v4 0/8] s390: virtio: support protected virtualization
Enhanced virtualization protection technology may require the use of
bounce buffers for I/O. While support for this was built into the virtio
core, virtio-ccw wasn't changed accordingly.
Some background on technology (not part of this series) and the
terminology used.
* Protected Virtualization (PV):
Protected Virtualization guarantees, that non-shared memory of a guest
that operates in PV