Skip to content

Commit 56b880e

Browse files
committed
Merge branch 'fixes-for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull DMA-mapping fixes from Marek Szyprowski: "A set of minor fixes for dma-mapping code (ARM and x86) required for Contiguous Memory Allocator (CMA) patches merged in v3.5-rc1." * 'fixes-for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: x86: dma-mapping: fix broken allocation when dma_mask has been provided ARM: dma-mapping: fix debug messages in dmabounce code ARM: mm: fix type of the arm_dma_limit global variable ARM: dma-mapping: Add missing static storage class specifier
2 parents 1043e3b + c080e26 commit 56b880e

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

arch/arm/common/dmabounce.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ static int __dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
366366
struct safe_buffer *buf;
367367
unsigned long off;
368368

369-
dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
370-
__func__, addr, off, sz, dir);
369+
dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n",
370+
__func__, addr, sz, dir);
371371

372372
buf = find_safe_buffer_dev(dev, addr, __func__);
373373
if (!buf)
@@ -377,8 +377,8 @@ static int __dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
377377

378378
BUG_ON(buf->direction != dir);
379379

380-
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
381-
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
380+
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x off=%#lx) mapped to %p (dma=%#x)\n",
381+
__func__, buf->ptr, virt_to_dma(dev, buf->ptr), off,
382382
buf->safe, buf->safe_dma_addr);
383383

384384
DO_STATS(dev->archdata.dmabounce->bounce_count++);
@@ -406,8 +406,8 @@ static int __dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,
406406
struct safe_buffer *buf;
407407
unsigned long off;
408408

409-
dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
410-
__func__, addr, off, sz, dir);
409+
dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n",
410+
__func__, addr, sz, dir);
411411

412412
buf = find_safe_buffer_dev(dev, addr, __func__);
413413
if (!buf)
@@ -417,8 +417,8 @@ static int __dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,
417417

418418
BUG_ON(buf->direction != dir);
419419

420-
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
421-
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
420+
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x off=%#lx) mapped to %p (dma=%#x)\n",
421+
__func__, buf->ptr, virt_to_dma(dev, buf->ptr), off,
422422
buf->safe, buf->safe_dma_addr);
423423

424424
DO_STATS(dev->archdata.dmabounce->bounce_count++);

arch/arm/mm/dma-mapping.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static pte_t **consistent_pte;
228228

229229
#define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
230230

231-
unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
231+
static unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
232232

233233
void __init init_consistent_dma_size(unsigned long size)
234234
{
@@ -321,7 +321,7 @@ static struct arm_vmregion_head coherent_head = {
321321
.vm_list = LIST_HEAD_INIT(coherent_head.vm_list),
322322
};
323323

324-
size_t coherent_pool_size = DEFAULT_CONSISTENT_DMA_SIZE / 8;
324+
static size_t coherent_pool_size = DEFAULT_CONSISTENT_DMA_SIZE / 8;
325325

326326
static int __init early_coherent_pool(char *p)
327327
{

arch/arm/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ EXPORT_SYMBOL(arm_dma_zone_size);
212212
* allocations. This must be the smallest DMA mask in the system,
213213
* so a successful GFP_DMA allocation will always satisfy this.
214214
*/
215-
u32 arm_dma_limit;
215+
phys_addr_t arm_dma_limit;
216216

217217
static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
218218
unsigned long dma_size)

arch/arm/mm/mm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
6262
#endif
6363

6464
#ifdef CONFIG_ZONE_DMA
65-
extern u32 arm_dma_limit;
65+
extern phys_addr_t arm_dma_limit;
6666
#else
6767
#define arm_dma_limit ((u32)~0)
6868
#endif

arch/x86/kernel/pci-dma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
100100
struct dma_attrs *attrs)
101101
{
102102
unsigned long dma_mask;
103-
struct page *page = NULL;
103+
struct page *page;
104104
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
105105
dma_addr_t addr;
106106

107107
dma_mask = dma_alloc_coherent_mask(dev, flag);
108108

109109
flag |= __GFP_ZERO;
110110
again:
111+
page = NULL;
111112
if (!(flag & GFP_ATOMIC))
112113
page = dma_alloc_from_contiguous(dev, count, get_order(size));
113114
if (!page)

0 commit comments

Comments
 (0)