Skip to content

Commit

Permalink
Merge branch 'fixes_for_linus' of git://git.linaro.org/people/mszypro…
Browse files Browse the repository at this point in the history
…wski/linux-dma-mapping

Pull CMA and DMA-mapping fixes from Marek Szyprowski:
 "This consists mainly of a set of one-liner fixes and cleanups for a
  few minor issues identified in both Contiguous Memory Allocator code
  and ARM DMA-mapping subsystem."

* 'fixes_for_linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping:
  ARM: mm: Remove unused arm_vmregion priv field
  ARM: dma-mapping: fix build warning in __dma_alloc()
  ARM: dma-mapping: support debug_dma_mapping_error
  mm: cma: alloc_contig_range: return early for err path
  drivers: cma: Fix wrong CMA selected region size default value
  drivers: dma-coherent: Fix typo in dma_mmap_from_coherent documentation
  drivers: dma-contiguous: Don't redefine SZ_1M
  • Loading branch information
torvalds committed Oct 25, 2012
2 parents 4864ccb + 4e85fb8 commit cff7b8b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions arch/arm/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
*/
static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
debug_dma_mapping_error(dev, dma_addr);
return dma_addr == DMA_ERROR_CODE;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
gfp_t gfp, pgprot_t prot, bool is_coherent, const void *caller)
{
u64 mask = get_coherent_dma_mask(dev);
struct page *page;
struct page *page = NULL;
void *addr;

#ifdef CONFIG_DMA_API_DEBUG
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mm/vmregion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct arm_vmregion {
struct list_head vm_list;
unsigned long vm_start;
unsigned long vm_end;
void *priv;
int vm_active;
const void *caller;
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/base/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ config CMA_SIZE_PERCENTAGE

choice
prompt "Selected region size"
default CMA_SIZE_SEL_ABSOLUTE
default CMA_SIZE_SEL_MBYTES

config CMA_SIZE_SEL_MBYTES
bool "Use mega bytes value only"
Expand Down
5 changes: 2 additions & 3 deletions drivers/base/dma-coherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,8 @@ EXPORT_SYMBOL(dma_release_from_coherent);
* This checks whether the memory was allocated from the per-device
* coherent memory pool and if so, maps that memory to the provided vma.
*
* Returns 1 if we correctly mapped the memory, or 0 if
* dma_release_coherent() should proceed with mapping memory from
* generic pools.
* Returns 1 if we correctly mapped the memory, or 0 if the caller should
* proceed with mapping memory from generic pools.
*/
int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
void *vaddr, size_t size, int *ret)
Expand Down
5 changes: 1 addition & 4 deletions drivers/base/dma-contiguous.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/page-isolation.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/swap.h>
#include <linux/mm_types.h>
#include <linux/dma-contiguous.h>

#ifndef SZ_1M
#define SZ_1M (1 << 20)
#endif

struct cma {
unsigned long base_pfn;
unsigned long count;
Expand Down
2 changes: 1 addition & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5825,7 +5825,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
ret = start_isolate_page_range(pfn_max_align_down(start),
pfn_max_align_up(end), migratetype);
if (ret)
goto done;
return ret;

ret = __alloc_contig_migrate_range(&cc, start, end);
if (ret)
Expand Down

0 comments on commit cff7b8b

Please sign in to comment.