Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
20f7462a
Commit
20f7462a
authored
Jul 08, 2013
by
Alexander Graf
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'cmadma/for-v3.12-cma-dma' into kvm-ppc-next
Add prerequisite patch for CMA RMA allocation patches
parents
03617c18
f825c736
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
22 deletions
+34
-22
arch/arm/include/asm/dma-contiguous.h
arch/arm/include/asm/dma-contiguous.h
+1
-1
arch/arm/mm/dma-mapping.c
arch/arm/mm/dma-mapping.c
+3
-3
drivers/base/Kconfig
drivers/base/Kconfig
+4
-16
drivers/base/Makefile
drivers/base/Makefile
+1
-1
include/linux/dma-contiguous.h
include/linux/dma-contiguous.h
+1
-1
mm/Kconfig
mm/Kconfig
+24
-0
No files found.
arch/arm/include/asm/dma-contiguous.h
View file @
20f7462a
...
...
@@ -2,7 +2,7 @@
#define ASMARM_DMA_CONTIGUOUS_H
#ifdef __KERNEL__
#ifdef CONFIG_CMA
#ifdef CONFIG_
DMA_
CMA
#include <linux/types.h>
#include <asm-generic/dma-contiguous.h>
...
...
arch/arm/mm/dma-mapping.c
View file @
20f7462a
...
...
@@ -358,7 +358,7 @@ static int __init atomic_pool_init(void)
if
(
!
pages
)
goto
no_pages
;
if
(
IS_ENABLED
(
CONFIG_CMA
))
if
(
IS_ENABLED
(
CONFIG_
DMA_
CMA
))
ptr
=
__alloc_from_contiguous
(
NULL
,
pool
->
size
,
prot
,
&
page
,
atomic_pool_init
);
else
...
...
@@ -670,7 +670,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
addr
=
__alloc_simple_buffer
(
dev
,
size
,
gfp
,
&
page
);
else
if
(
!
(
gfp
&
__GFP_WAIT
))
addr
=
__alloc_from_pool
(
size
,
&
page
);
else
if
(
!
IS_ENABLED
(
CONFIG_CMA
))
else
if
(
!
IS_ENABLED
(
CONFIG_
DMA_
CMA
))
addr
=
__alloc_remap_buffer
(
dev
,
size
,
gfp
,
prot
,
&
page
,
caller
);
else
addr
=
__alloc_from_contiguous
(
dev
,
size
,
prot
,
&
page
,
caller
);
...
...
@@ -759,7 +759,7 @@ static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
__dma_free_buffer
(
page
,
size
);
}
else
if
(
__free_from_pool
(
cpu_addr
,
size
))
{
return
;
}
else
if
(
!
IS_ENABLED
(
CONFIG_CMA
))
{
}
else
if
(
!
IS_ENABLED
(
CONFIG_
DMA_
CMA
))
{
__dma_free_remap
(
cpu_addr
,
size
);
__dma_free_buffer
(
page
,
size
);
}
else
{
...
...
drivers/base/Kconfig
View file @
20f7462a
...
...
@@ -200,11 +200,9 @@ config DMA_SHARED_BUFFER
APIs extension; the file's descriptor can then be passed on to other
driver.
config CMA
bool "Contiguous Memory Allocator"
depends on HAVE_DMA_CONTIGUOUS && HAVE_MEMBLOCK
select MIGRATION
select MEMORY_ISOLATION
config DMA_CMA
bool "DMA Contiguous Memory Allocator"
depends on HAVE_DMA_CONTIGUOUS && CMA
help
This enables the Contiguous Memory Allocator which allows drivers
to allocate big physically-contiguous blocks of memory for use with
...
...
@@ -213,17 +211,7 @@ config CMA
For more information see <include/linux/dma-contiguous.h>.
If unsure, say "n".
if CMA
config CMA_DEBUG
bool "CMA debug messages (DEVELOPMENT)"
depends on DEBUG_KERNEL
help
Turns on debug messages in CMA. This produces KERN_DEBUG
messages for every CMA call as well as various messages while
processing calls such as dma_alloc_from_contiguous().
This option does not affect warning and error messages.
if DMA_CMA
comment "Default contiguous memory area size:"
config CMA_SIZE_MBYTES
...
...
drivers/base/Makefile
View file @
20f7462a
...
...
@@ -6,7 +6,7 @@ obj-y := core.o bus.o dd.o syscore.o \
attribute_container.o transport_class.o
\
topology.o
obj-$(CONFIG_DEVTMPFS)
+=
devtmpfs.o
obj-$(CONFIG_CMA)
+=
dma-contiguous.o
obj-$(CONFIG_
DMA_
CMA)
+=
dma-contiguous.o
obj-y
+=
power/
obj-$(CONFIG_HAS_DMA)
+=
dma-mapping.o
obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT)
+=
dma-coherent.o
...
...
include/linux/dma-contiguous.h
View file @
20f7462a
...
...
@@ -57,7 +57,7 @@ struct cma;
struct
page
;
struct
device
;
#ifdef CONFIG_CMA
#ifdef CONFIG_
DMA_
CMA
/*
* There is always at least global CMA area and a few optional device
...
...
mm/Kconfig
View file @
20f7462a
...
...
@@ -477,3 +477,27 @@ config FRONTSWAP
and swap data is stored as normal on the matching swap device.
If unsure, say Y to enable frontswap.
config CMA
bool "Contiguous Memory Allocator"
depends on HAVE_MEMBLOCK
select MIGRATION
select MEMORY_ISOLATION
help
This enables the Contiguous Memory Allocator which allows other
subsystems to allocate big physically-contiguous blocks of memory.
CMA reserves a region of memory and allows only movable pages to
be allocated from it. This way, the kernel can use the memory for
pagecache and when a subsystem requests for contiguous area, the
allocated pages are migrated away to serve the contiguous request.
If unsure, say "n".
config CMA_DEBUG
bool "CMA debug messages (DEVELOPMENT)"
depends on DEBUG_KERNEL && CMA
help
Turns on debug messages in CMA. This produces KERN_DEBUG
messages for every CMA call as well as various messages while
processing calls such as dma_alloc_from_contiguous().
This option does not affect warning and error messages.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment