[S390] qdio: make sure qdr is aligned to page size
authorJan Glauber <jang@linux.vnet.ibm.com>
Fri, 1 Aug 2008 14:39:17 +0000 (16:39 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 1 Aug 2008 14:39:34 +0000 (16:39 +0200)
kzalloc does not guarantee the required alignment of qdr to page size,
use get_zeroed_page instead.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
drivers/s390/cio/qdio_main.c
drivers/s390/cio/qdio_setup.c

index d10c73c..d156485 100644 (file)
@@ -1355,7 +1355,7 @@ int qdio_allocate(struct qdio_initialize *init_data)
                goto out_rel;
 
        /* qdr is used in ccw1.cda which is u32 */
-       irq_ptr->qdr = kzalloc(sizeof(struct qdr), GFP_KERNEL | GFP_DMA);
+       irq_ptr->qdr = (struct qdr *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
        if (!irq_ptr->qdr)
                goto out_rel;
        WARN_ON((unsigned long)irq_ptr->qdr & 0xfff);
index f0923a8..56fdd57 100644 (file)
@@ -325,7 +325,7 @@ void qdio_release_memory(struct qdio_irq *irq_ptr)
                        kmem_cache_free(qdio_q_cache, q);
                }
        }
-       kfree(irq_ptr->qdr);
+       free_page((unsigned long) irq_ptr->qdr);
        free_page(irq_ptr->chsc_page);
        free_page((unsigned long) irq_ptr);
 }