Displaying 20 results from an estimated 41 matches for "cio_get_dma_css_dev".
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
....notifier_call = css_power_event,
> };
>
> +#define POOL_INIT_PAGES 1
> +static struct gen_pool *cio_dma_pool;
> +/* Currently cio supports only a single css */
This comment looks misplaced.
> +#define CIO_DMA_GFP (GFP_KERNEL | __GFP_ZERO)
> +
> +
> +struct device *cio_get_dma_css_dev(void)
> +{
> + return &channel_subsystems[0]->device;
> +}
> +
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages)
> +{
> + struct gen_pool *gp_dma;
> + void *cpu_addr;
> + dma_addr_t dma_addr;
> + int i;
> +
> + gp_dma = gen_pool_c...
2019 May 27
3
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
....notifier_call = css_power_event,
> };
>
> +#define POOL_INIT_PAGES 1
> +static struct gen_pool *cio_dma_pool;
> +/* Currently cio supports only a single css */
This comment looks misplaced.
> +#define CIO_DMA_GFP (GFP_KERNEL | __GFP_ZERO)
> +
> +
> +struct device *cio_get_dma_css_dev(void)
> +{
> + return &channel_subsystems[0]->device;
> +}
> +
> +struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages)
> +{
> + struct gen_pool *gp_dma;
> + void *cpu_addr;
> + dma_addr_t dma_addr;
> + int i;
> +
> + gp_dma = gen_pool_c...
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
.....f11f437 100644
> --- a/drivers/s390/cio/airq.c
> +++ b/drivers/s390/cio/airq.c
> @@ -136,8 +136,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
> goto out;
> iv->bits = bits;
> size = iv_size(bits);
> - iv->vector = dma_alloc_coherent(cio_get_dma_css_dev(), size,
> - &iv->vector_dma, GFP_KERNEL);
> + iv->vector = cio_dma_zalloc(size);
> if (!iv->vector)
> goto out_free;
> if (flags & AIRQ_IV_ALLOC) {
> @@ -172,8 +171,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
> k...
2019 May 13
2
[PATCH 05/10] s390/cio: introduce DMA pools to cio
.....f11f437 100644
> --- a/drivers/s390/cio/airq.c
> +++ b/drivers/s390/cio/airq.c
> @@ -136,8 +136,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
> goto out;
> iv->bits = bits;
> size = iv_size(bits);
> - iv->vector = dma_alloc_coherent(cio_get_dma_css_dev(), size,
> - &iv->vector_dma, GFP_KERNEL);
> + iv->vector = cio_dma_zalloc(size);
> if (!iv->vector)
> goto out_free;
> if (flags & AIRQ_IV_ALLOC) {
> @@ -172,8 +171,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
> k...
2019 May 23
0
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...+++ b/arch/s390/include/asm/cio.h
@@ -328,6 +328,17 @@ 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...
2019 Apr 26
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...+++ b/arch/s390/include/asm/cio.h
@@ -328,6 +328,17 @@ 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...
2019 May 29
0
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...+++ b/arch/s390/include/asm/cio.h
@@ -328,6 +328,17 @@ 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...
2019 Apr 26
0
[PATCH 07/10] s390/airq: use DMA memory for adapter interrupts
...v;
- unsigned long size;
+ unsigned long size = 0;
iv = kzalloc(sizeof(*iv), GFP_KERNEL);
if (!iv)
goto out;
iv->bits = bits;
- size = BITS_TO_LONGS(bits) * sizeof(unsigned long);
- iv->vector = kzalloc(size, GFP_KERNEL);
+ size = iv_size(bits);
+ iv->vector = dma_alloc_coherent(cio_get_dma_css_dev(), size,
+ &iv->vector_dma, GFP_KERNEL);
if (!iv->vector)
goto out_free;
if (flags & AIRQ_IV_ALLOC) {
@@ -165,7 +172,8 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
kfree(iv->ptr);
kfree(iv->bitlock);
kfree(iv->avail);
- kfree(i...
2019 May 12
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...ivers/s390/cio/airq.c
index 7a5c0a0..f11f437 100644
--- a/drivers/s390/cio/airq.c
+++ b/drivers/s390/cio/airq.c
@@ -136,8 +136,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
goto out;
iv->bits = bits;
size = iv_size(bits);
- iv->vector = dma_alloc_coherent(cio_get_dma_css_dev(), size,
- &iv->vector_dma, GFP_KERNEL);
+ iv->vector = cio_dma_zalloc(size);
if (!iv->vector)
goto out_free;
if (flags & AIRQ_IV_ALLOC) {
@@ -172,8 +171,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
kfree(iv->ptr);
kfree(iv->bi...
2019 Jun 06
0
[PATCH v4 2/8] s390/cio: introduce DMA pools to cio
...h>
#define LPM_ANYPATH 0xff
@@ -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 dev...
2019 Jun 12
0
[PATCH v5 2/8] s390/cio: introduce DMA pools to cio
...h>
#define LPM_ANYPATH 0xff
@@ -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 dev...
2019 May 27
0
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
...ES 1
> > +static struct gen_pool *cio_dma_pool;
> > +/* Currently cio supports only a single css */
>
> This comment looks misplaced.
Right! Move to ...
>
> > +#define CIO_DMA_GFP (GFP_KERNEL | __GFP_ZERO)
> > +
> > +
... here?
> > +struct device *cio_get_dma_css_dev(void)
> > +{
> > + return &channel_subsystems[0]->device;
> > +}
> > +
> > +struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages)
> > +{
> > + struct gen_pool *gp_dma;
> > + void *cpu_addr;
> > + dma_addr_t dma_addr;
&g...
2019 May 15
0
[PATCH 05/10] s390/cio: introduce DMA pools to cio
...ivers/s390/cio/airq.c
> > +++ b/drivers/s390/cio/airq.c
> > @@ -136,8 +136,7 @@ struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags)
> > goto out;
> > iv->bits = bits;
> > size = iv_size(bits);
> > - iv->vector = dma_alloc_coherent(cio_get_dma_css_dev(), size,
> > - &iv->vector_dma, GFP_KERNEL);
> > + iv->vector = cio_dma_zalloc(size);
> > if (!iv->vector)
> > goto out_free;
> > if (flags & AIRQ_IV_ALLOC) {
> > @@ -172,8 +171,7 @@ struct airq_iv *airq_iv_create(unsigned long bits,...
2019 May 25
1
[PATCH v2 2/8] s390/cio: introduce DMA pools to cio
On Thu, 23 May 2019, Michael Mueller wrote:
> +static void __init cio_dma_pool_init(void)
> +{
> + /* No need to free up the resources: compiled in */
> + cio_dma_pool = cio_gp_dma_create(cio_get_dma_css_dev(), 1);
This can return NULL.
> +/**
> + * Allocate dma memory from the css global pool. Intended for memory not
> + * specific to any single device within the css. The allocated memory
> + * is not guaranteed to be 31-bit addressable.
> + *
> + * Caution: Not suitable for early...
2019 Jun 03
5
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...gt; @@ -328,6 +328,17 @@ 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;
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...
2019 Jun 03
5
[PATCH v3 2/8] s390/cio: introduce DMA pools to cio
...gt; @@ -328,6 +328,17 @@ 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;
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...
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...L(airq_iv_scan);
>
> -static int __init airq_init(void)
> +int __init airq_init(void)
> {
> - airq_iv_cache = kmem_cache_create("airq_iv_cache", cache_line_size(),
> - cache_line_size(), 0, NULL);
> + airq_iv_cache = dma_pool_create("airq_iv_cache", cio_get_dma_css_dev(),
> + cache_line_size(),
> + cache_line_size(), PAGE_SIZE);
> if (!airq_iv_cache)
> return -ENOMEM;
Sorry about not noticing that in the last iteration; but you may return
an error here if airq_iv_cache could not be allocated...
> return 0;
> }
> -subsys_init...
2019 Jun 11
2
[PATCH v4 4/8] s390/airq: use DMA memory for adapter interrupts
...L(airq_iv_scan);
>
> -static int __init airq_init(void)
> +int __init airq_init(void)
> {
> - airq_iv_cache = kmem_cache_create("airq_iv_cache", cache_line_size(),
> - cache_line_size(), 0, NULL);
> + airq_iv_cache = dma_pool_create("airq_iv_cache", cio_get_dma_css_dev(),
> + cache_line_size(),
> + cache_line_size(), PAGE_SIZE);
> if (!airq_iv_cache)
> return -ENOMEM;
Sorry about not noticing that in the last iteration; but you may return
an error here if airq_iv_cache could not be allocated...
> return 0;
> }
> -subsys_init...