Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f7d998e authored by Christoph Lameter's avatar Christoph Lameter Committed by Kyle McMartin
Browse files

[PARISC] Use page allocator instead of slab allocator in pci-dma.c



Slab pages obtained via kmalloc are not cacheline aligned.  Nor is it
advisable to perform VM operations designed for page allocator pages on
memory obtained via kmalloc.

So replace the page sized allocations in kernel/pci-dma.c with page allocator
pages.

Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Matthew Wilcox <willy@debian.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarKyle McMartin <kyle@mcmartin.ca>
parent f13cec84
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -569,10 +569,9 @@ static void *fail_alloc_consistent(struct device *dev, size_t size,
static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
					  dma_addr_t *dma_handle, gfp_t flag)
					  dma_addr_t *dma_handle, gfp_t flag)
{
{
	void *addr = NULL;
	void *addr;


	/* rely on kmalloc to be cacheline aligned */
	addr = (void *)__get_free_pages(flag, get_order(size));
	addr = kmalloc(size, flag);
	if (addr)
	if (addr)
		*dma_handle = (dma_addr_t)virt_to_phys(addr);
		*dma_handle = (dma_addr_t)virt_to_phys(addr);


@@ -582,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size,
static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
static void pa11_dma_free_noncoherent(struct device *dev, size_t size,
					void *vaddr, dma_addr_t iova)
					void *vaddr, dma_addr_t iova)
{
{
	kfree(vaddr);
	free_pages((unsigned long)vaddr, get_order(size));
	return;
	return;
}
}