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
Kirill Smelkov
linux
Commits
461b6f0d
Commit
461b6f0d
authored
Oct 02, 2012
by
Marek Szyprowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'next-cleanup' into for-v3.7
parents
abebfb18
75c59716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
arch/arm/mm/dma-mapping.c
arch/arm/mm/dma-mapping.c
+6
-5
drivers/base/dma-contiguous.c
drivers/base/dma-contiguous.c
+7
-11
No files found.
arch/arm/mm/dma-mapping.c
View file @
461b6f0d
...
...
@@ -1059,11 +1059,12 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t
if
(
!
pages
[
i
])
goto
error
;
if
(
order
)
if
(
order
)
{
split_page
(
pages
[
i
],
order
);
j
=
1
<<
order
;
while
(
--
j
)
pages
[
i
+
j
]
=
pages
[
i
]
+
j
;
j
=
1
<<
order
;
while
(
--
j
)
pages
[
i
+
j
]
=
pages
[
i
]
+
j
;
}
__dma_clear_buffer
(
pages
[
i
],
PAGE_SIZE
<<
order
);
i
+=
1
<<
order
;
...
...
@@ -1814,7 +1815,7 @@ int arm_iommu_attach_device(struct device *dev,
dev
->
archdata
.
mapping
=
mapping
;
set_dma_ops
(
dev
,
&
iommu_ops
);
pr_
info
(
"Attached IOMMU controller to %s device.
\n
"
,
dev_name
(
dev
));
pr_
debug
(
"Attached IOMMU controller to %s device.
\n
"
,
dev_name
(
dev
));
return
0
;
}
...
...
drivers/base/dma-contiguous.c
View file @
461b6f0d
...
...
@@ -315,6 +315,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
{
unsigned
long
mask
,
pfn
,
pageno
,
start
=
0
;
struct
cma
*
cma
=
dev_get_cma_area
(
dev
);
struct
page
*
page
=
NULL
;
int
ret
;
if
(
!
cma
||
!
cma
->
count
)
...
...
@@ -336,18 +337,17 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
for
(;;)
{
pageno
=
bitmap_find_next_zero_area
(
cma
->
bitmap
,
cma
->
count
,
start
,
count
,
mask
);
if
(
pageno
>=
cma
->
count
)
{
ret
=
-
ENOMEM
;
goto
error
;
}
if
(
pageno
>=
cma
->
count
)
break
;
pfn
=
cma
->
base_pfn
+
pageno
;
ret
=
alloc_contig_range
(
pfn
,
pfn
+
count
,
MIGRATE_CMA
);
if
(
ret
==
0
)
{
bitmap_set
(
cma
->
bitmap
,
pageno
,
count
);
page
=
pfn_to_page
(
pfn
);
break
;
}
else
if
(
ret
!=
-
EBUSY
)
{
goto
error
;
break
;
}
pr_debug
(
"%s(): memory range at %p is busy, retrying
\n
"
,
__func__
,
pfn_to_page
(
pfn
));
...
...
@@ -356,12 +356,8 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
}
mutex_unlock
(
&
cma_mutex
);
pr_debug
(
"%s(): returned %p
\n
"
,
__func__
,
pfn_to_page
(
pfn
));
return
pfn_to_page
(
pfn
);
error:
mutex_unlock
(
&
cma_mutex
);
return
NULL
;
pr_debug
(
"%s(): returned %p
\n
"
,
__func__
,
page
);
return
page
;
}
/**
...
...
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