Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha
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
1
Merge Requests
1
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 TDC 1ns 5cha
Commits
5f1ab70a
Commit
5f1ab70a
authored
Nov 16, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: fix pointer to FMC fru.h
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
08f01f24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
59 deletions
+14
-59
Kbuild
kernel/Kbuild
+1
-0
calibration.c
kernel/calibration.c
+1
-1
ft-buf.c
kernel/ft-buf.c
+11
-57
ft-core.c
kernel/ft-core.c
+1
-1
No files found.
kernel/Kbuild
View file @
5f1ab70a
...
...
@@ -11,6 +11,7 @@ ccflags-y = -DVERSION=\"$(VERSION)\"
ccflags-y += -I$(src)
ccflags-y += -I$(ZIO_ABS)/include
ccflags-y += -I$(FMC_ABS)/include
ccflags-y += -I$(FMC_ABS)/include/uapi
ccflags-$(CONFIG_FMC_TDC_DEBUG) += -DDEBUG
...
...
kernel/calibration.c
View file @
5f1ab70a
...
...
@@ -14,7 +14,7 @@
#include <linux/jhash.h>
#include <linux/slab.h>
#include <linux/fmc.h>
#include <linux/ipmi
-
fru.h>
#include <linux/ipmi
/
fru.h>
#include <linux/zio.h>
#include "fmc-tdc.h"
...
...
kernel/ft-buf.c
View file @
5f1ab70a
...
...
@@ -285,52 +285,9 @@ static int ft_zio_block_nr_pages(struct zio_block *block)
return
nr_pages
;
}
static
int
sg_alloc_table_from_block_vmalloc
(
struct
sg_table
*
sgt
,
struct
zio_block
*
block
)
{
struct
scatterlist
*
sg
;
unsigned
int
nr_pages
;
int
bytesleft
=
0
;
void
*
bufp
=
NULL
;
int
mapbytes
;
int
i
;
int
err
;
nr_pages
=
ft_zio_block_nr_pages
(
block
);
err
=
sg_alloc_table
(
sgt
,
nr_pages
,
GFP_KERNEL
);
if
(
err
)
return
err
;
bytesleft
=
block
->
datalen
;
bufp
=
block
->
data
;
for_each_sg
(
sgt
->
sgl
,
sg
,
sgt
->
nents
,
i
)
{
/*
* If there are less bytes left than what fits
* in the current page (plus page alignment offset)
* we just feed in this, else we stuff in as much
* as we can.
*/
if
(
bytesleft
<
(
PAGE_SIZE
-
offset_in_page
(
bufp
)))
mapbytes
=
bytesleft
;
else
mapbytes
=
PAGE_SIZE
-
offset_in_page
(
bufp
);
sg_set_page
(
sg
,
vmalloc_to_page
(
bufp
),
mapbytes
,
offset_in_page
(
bufp
));
/* Configure next values */
bufp
+=
mapbytes
;
bytesleft
-=
mapbytes
;
pr_debug
(
"sg item (%p(+0x%lx), len:%d, left:%d)
\n
"
,
virt_to_page
(
bufp
),
offset_in_page
(
bufp
),
mapbytes
,
bytesleft
);
}
return
0
;
}
static
int
sg_alloc_table_from_block_kmalloc
(
struct
device
*
dev
,
struct
sg_table
*
sgt
,
struct
zio_block
*
block
)
static
int
sg_alloc_table_from_block
(
struct
device
*
dev
,
struct
sg_table
*
sgt
,
struct
zio_block
*
block
)
{
struct
page
**
pages
;
unsigned
int
nr_pages
;
...
...
@@ -348,8 +305,14 @@ static int sg_alloc_table_from_block_kmalloc(struct device *dev,
return
-
ENOMEM
;
data
=
(
void
*
)
block
->
data
;
for
(
i
=
0
;
i
<
nr_pages
;
++
i
)
pages
[
i
]
=
virt_to_page
(
data
+
PAGE_SIZE
*
i
);
if
(
is_vmalloc_addr
(
data
))
{
for
(
i
=
0
;
i
<
nr_pages
;
++
i
)
{
pages
[
i
]
=
vmalloc_to_page
(
data
+
PAGE_SIZE
*
i
);
}
}
else
{
for
(
i
=
0
;
i
<
nr_pages
;
++
i
)
pages
[
i
]
=
virt_to_page
(
data
+
PAGE_SIZE
*
i
);
}
max_segment_size
=
dma_get_max_seg_size
(
dev
);
max_segment_size
&=
PAGE_MASK
;
/* to make alloc_table happy */
...
...
@@ -362,15 +325,6 @@ static int sg_alloc_table_from_block_kmalloc(struct device *dev,
kfree
(
pages
);
return
err
;
}
static
int
sg_alloc_table_from_block
(
struct
device
*
dev
,
struct
sg_table
*
sgt
,
struct
zio_block
*
block
)
{
if
(
is_vmalloc_addr
(
block
->
data
))
return
sg_alloc_table_from_block_vmalloc
(
sgt
,
block
);
else
return
sg_alloc_table_from_block_kmalloc
(
dev
,
sgt
,
block
);
}
static
int
ft_zio_block_dma_map_sg
(
struct
fmctdc_dev
*
ft
,
unsigned
int
ch
,
struct
zio_block
*
block
,
...
...
kernel/ft-core.c
View file @
5f1ab70a
...
...
@@ -20,7 +20,7 @@
#include <linux/list.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/ipmi
-
fru.h>
#include <linux/ipmi
/
fru.h>
#include <linux/fmc.h>
#include <linux/zio.h>
...
...
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