Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Software
Commits
eca2978c
Commit
eca2978c
authored
Aug 08, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: limit DMA segment size to the maximum supported by the system
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e608461a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
fa-core.c
kernel/fa-core.c
+2
-1
fa-dma.c
kernel/fa-dma.c
+4
-1
fmc-adc-100m14b4cha.h
kernel/fmc-adc-100m14b4cha.h
+1
-0
No files found.
kernel/fa-core.c
View file @
eca2978c
...
@@ -48,6 +48,7 @@ static int sg_alloc_table_from_pages_no_squash(struct sg_table *sgt,
...
@@ -48,6 +48,7 @@ static int sg_alloc_table_from_pages_no_squash(struct sg_table *sgt,
unsigned
int
n_pages
,
unsigned
int
n_pages
,
unsigned
int
offset
,
unsigned
int
offset
,
unsigned
long
size
,
unsigned
long
size
,
unsigned
int
max_segment
,
gfp_t
gfp_mask
)
gfp_t
gfp_mask
)
{
{
struct
scatterlist
*
sg
;
struct
scatterlist
*
sg
;
...
@@ -510,7 +511,7 @@ int fa_probe(struct platform_device *pdev)
...
@@ -510,7 +511,7 @@ int fa_probe(struct platform_device *pdev)
case
ADC_VER_SPEC
:
case
ADC_VER_SPEC
:
memops
.
read
=
ioread32
;
memops
.
read
=
ioread32
;
memops
.
write
=
iowrite32
;
memops
.
write
=
iowrite32
;
fa
->
sg_alloc_table_from_pages
=
sg_alloc_table_from_pages
;
fa
->
sg_alloc_table_from_pages
=
__
sg_alloc_table_from_pages
;
break
;
break
;
case
ADC_VER_SVEC
:
case
ADC_VER_SVEC
:
memops
.
read
=
ioread32be
;
memops
.
read
=
ioread32be
;
...
...
kernel/fa-dma.c
View file @
eca2978c
...
@@ -306,6 +306,7 @@ static int zfad_dma_prep_slave_sg(struct dma_chan *dchan,
...
@@ -306,6 +306,7 @@ static int zfad_dma_prep_slave_sg(struct dma_chan *dchan,
struct
dma_async_tx_descriptor
*
tx
;
struct
dma_async_tx_descriptor
*
tx
;
struct
page
**
pages
;
struct
page
**
pages
;
unsigned
int
nr_pages
,
sg_mapped
;
unsigned
int
nr_pages
,
sg_mapped
;
size_t
max_segment_size
;
int
err
;
int
err
;
/* prepare the context for the block transfer */
/* prepare the context for the block transfer */
...
@@ -323,9 +324,11 @@ static int zfad_dma_prep_slave_sg(struct dma_chan *dchan,
...
@@ -323,9 +324,11 @@ static int zfad_dma_prep_slave_sg(struct dma_chan *dchan,
goto
err_to_pages
;
goto
err_to_pages
;
/* With some version we cannot use the version from the Linux kernel */
/* With some version we cannot use the version from the Linux kernel */
max_segment_size
=
dma_get_max_seg_size
(
dchan
->
device
->
dev
);
fa
->
sg_alloc_table_from_pages
(
&
zfad_block
->
sgt
,
pages
,
nr_pages
,
fa
->
sg_alloc_table_from_pages
(
&
zfad_block
->
sgt
,
pages
,
nr_pages
,
offset_in_page
(
zfad_block
->
block
->
data
),
offset_in_page
(
zfad_block
->
block
->
data
),
zfad_block
->
block
->
datalen
,
GFP_KERNEL
);
zfad_block
->
block
->
datalen
,
max_segment_size
,
GFP_KERNEL
);
if
(
unlikely
(
err
))
if
(
unlikely
(
err
))
goto
err_sgt
;
goto
err_sgt
;
...
...
kernel/fmc-adc-100m14b4cha.h
View file @
eca2978c
...
@@ -451,6 +451,7 @@ struct fa_dev {
...
@@ -451,6 +451,7 @@ struct fa_dev {
unsigned
int
n_pages
,
unsigned
int
n_pages
,
unsigned
int
offset
,
unsigned
int
offset
,
unsigned
long
size
,
unsigned
long
size
,
unsigned
int
max_segment
,
gfp_t
gfp_mask
);
gfp_t
gfp_mask
);
};
};
...
...
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