[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1354280283-28365-1-git-send-email-vitalya@ti.com>
Date: Fri, 30 Nov 2012 07:58:03 -0500
From: Vitaly Andrianov <vitalya@...com>
To: <mina86@...a86.com>, <m.szyprowski@...sung.com>,
<kyungmin.park@...sung.com>, <arnd@...db.de>,
<linux-kernel@...r.kernel.org>, <linux-keystone@...t.ti.com>
CC: Vitaly Andrianov <vitalya@...com>, Cyril Chemparathy <cyril@...com>
Subject: [PATCH] drivers: cma: fix addressing on PAE machines
This patch fixes a couple of bugs that otherwise impair CMA functionality on
PAE machines:
- alignment must be a 64-bit type when running on systems with 64-bit
physical addresses. If this is not the case, the limit calculation thunks
allocations down to an address range < 4G.
- The allocated range check is removed. On 32bit ARM kernel with LPAE
enabled the base may be allocated outside the fist 4GB of physical
memory (keystone SoC for example).
Signed-off-by: Vitaly Andrianov <vitalya@...com>
Signed-off-by: Cyril Chemparathy <cyril@...com>
---
drivers/base/dma-contiguous.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 9a14694..7936b2e 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -234,7 +234,7 @@ int __init dma_declare_contiguous(struct device *dev, unsigned long size,
phys_addr_t base, phys_addr_t limit)
{
struct cma_reserved *r = &cma_reserved[cma_reserved_count];
- unsigned long alignment;
+ phys_addr_t alignment;
pr_debug("%s(size %lx, base %08lx, limit %08lx)\n", __func__,
(unsigned long)size, (unsigned long)base,
@@ -271,10 +271,6 @@ int __init dma_declare_contiguous(struct device *dev, unsigned long size,
if (!addr) {
base = -ENOMEM;
goto err;
- } else if (addr + size > ~(unsigned long)0) {
- memblock_free(addr, size);
- base = -EINVAL;
- goto err;
} else {
base = addr;
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists