Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
8a8ce4cc
Commit
8a8ce4cc
authored
Aug 12, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv:dma: always fixup DMA descriptor
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
8bb6eb64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
spec-gn412x-dma.c
software/kernel/spec-gn412x-dma.c
+9
-10
No files found.
software/kernel/spec-gn412x-dma.c
View file @
8a8ce4cc
...
...
@@ -381,9 +381,11 @@ static dma_cookie_t gn412x_dma_tx_submit(struct dma_async_tx_descriptor *tx)
return
cookie
;
}
static
void
gn412x_dma_prep_fixup
_next
(
struct
gn412x_dma_tx_hw
*
tx_hw
,
dma_addr_t
next_addr
)
static
void
gn412x_dma_prep_fixup
(
struct
gn412x_dma_tx_hw
*
tx_hw
,
dma_addr_t
next_addr
)
{
if
(
!
tx_hw
||
!
next_addr
)
return
;
tx_hw
->
next_addr_l
=
((
next_addr
>>
0
)
&
0xFFFFFFFF
);
tx_hw
->
next_addr_h
=
((
next_addr
>>
32
)
&
0xFFFFFFFF
);
}
...
...
@@ -414,6 +416,8 @@ static struct dma_async_tx_descriptor *gn412x_dma_prep_slave_sg(
struct
dma_slave_config
*
sconfig
=
&
to_gn412x_dma_chan
(
chan
)
->
sconfig
;
struct
gn412x_dma_tx
*
gn412x_dma_tx
;
struct
scatterlist
*
sg
;
struct
gn412x_dma_tx_hw
*
tx_hw
=
NULL
;
dma_addr_t
phys
=
0
;
int
i
;
if
(
unlikely
(
direction
!=
DMA_DEV_TO_MEM
))
{
...
...
@@ -443,18 +447,13 @@ static struct dma_async_tx_descriptor *gn412x_dma_prep_slave_sg(
if
(
!
gn412x_dma_tx
->
sgl_hw
)
goto
err_alloc_sglhw
;
for_each_sg
(
sgl
,
sg
,
sg_len
,
i
)
{
struct
gn412x_dma_tx_hw
*
tx_hw
;
dma_addr_t
phys
;
/* Allocate a descriptor for the next transfer */
src_addr
=
sconfig
->
src_addr
;
for_each_sg
(
sgl
,
sg
,
sg_len
,
i
)
{
gn412x_dma_prep_fixup
(
tx_hw
,
phys
);
tx_hw
=
dma_pool_alloc
(
gn412x_dma
->
pool
,
GFP_NOWAIT
,
&
phys
);
if
(
!
tx_hw
)
goto
err_alloc_pool
;
if
(
i
>
0
)
{
gn412x_dma_prep_fixup_next
(
gn412x_dma_tx
->
sgl_hw
[
i
-
1
],
phys
);
}
gn412x_dma_prep
(
tx_hw
,
sg
,
sconfig
->
src_addr
);
gn412x_dma_tx
->
sgl_hw
[
i
]
=
tx_hw
;
...
...
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