Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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 TDC 1ns 5cha - Software
Commits
ed85f99f
Commit
ed85f99f
authored
Apr 24, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: inform on missing edges
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
46d07c47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
fmc-tdc.h
kernel/fmc-tdc.h
+1
-1
ft-irq.c
kernel/ft-irq.c
+12
-1
No files found.
kernel/fmc-tdc.h
View file @
ed85f99f
...
@@ -127,7 +127,7 @@ struct ft_channel_state {
...
@@ -127,7 +127,7 @@ struct ft_channel_state {
int
expected_edge
;
int
expected_edge
;
int
cur_seq_id
;
int
cur_seq_id
;
int
delay_reference
;
int
delay_reference
;
uint32_t
prev_hseq
;
int32_t
user_offset
;
int32_t
user_offset
;
struct
ft_wr_timestamp
prev_ts
;
/**< used to validate time-stamps
struct
ft_wr_timestamp
prev_ts
;
/**< used to validate time-stamps
...
...
kernel/ft-irq.c
View file @
ed85f99f
...
@@ -115,6 +115,7 @@ static inline int process_timestamp(struct zio_cset *cset,
...
@@ -115,6 +115,7 @@ static inline int process_timestamp(struct zio_cset *cset,
struct
ft_wr_timestamp
ts
;
struct
ft_wr_timestamp
ts
;
struct
ft_wr_timestamp
diff
;
struct
ft_wr_timestamp
diff
;
int
channel
,
edge
,
frac
,
ret
=
0
;
int
channel
,
edge
,
frac
,
ret
=
0
;
uint32_t
hseq
,
prev_hseq
;
st
=
&
ft
->
channels
[
cset
->
index
];
st
=
&
ft
->
channels
[
cset
->
index
];
...
@@ -129,6 +130,9 @@ static inline int process_timestamp(struct zio_cset *cset,
...
@@ -129,6 +130,9 @@ static inline int process_timestamp(struct zio_cset *cset,
return
0
;
return
0
;
}
}
edge
=
hwts
->
metadata
&
(
1
<<
4
)
?
1
:
0
;
edge
=
hwts
->
metadata
&
(
1
<<
4
)
?
1
:
0
;
prev_hseq
=
st
->
prev_hseq
;
hseq
=
hwts
->
metadata
>>
5
;
st
->
prev_hseq
=
hseq
;
/* first, convert the timestamp from the HDL units (81 ps bins)
/* first, convert the timestamp from the HDL units (81 ps bins)
to the WR format (where fractional part is 8 ns rescaled to
to the WR format (where fractional part is 8 ns rescaled to
...
@@ -160,6 +164,13 @@ static inline int process_timestamp(struct zio_cset *cset,
...
@@ -160,6 +164,13 @@ static inline int process_timestamp(struct zio_cset *cset,
return
0
;
return
0
;
}
}
if
(
unlikely
(
prev_hseq
+
1
!=
hseq
))
{
/* we missed some edges */
dev_warn
(
&
cset
->
head
.
dev
,
"missed edges. Last seen %u, current %u
\n
"
,
prev_hseq
,
hseq
);
}
/* From this point we are working with the expected EDGE */
/* From this point we are working with the expected EDGE */
...
@@ -197,7 +208,7 @@ static inline int process_timestamp(struct zio_cset *cset,
...
@@ -197,7 +208,7 @@ static inline int process_timestamp(struct zio_cset *cset,
st
->
cur_seq_id
++
;
st
->
cur_seq_id
++
;
}
}
ts
.
hseq_id
=
h
wts
->
metadata
>>
5
;
ts
.
hseq_id
=
h
seq
;
/* Return a valid timestamp */
/* Return a valid timestamp */
*
wrts
=
ts
;
*
wrts
=
ts
;
...
...
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