Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
a2fda0da
Commit
a2fda0da
authored
Jul 17, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: wr_clocksource needs a spinlock
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
0b279361
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
wr_clocksource.c
kernel/wr_clocksource/wr_clocksource.c
+5
-0
No files found.
kernel/wr_clocksource/wr_clocksource.c
View file @
a2fda0da
...
...
@@ -46,9 +46,12 @@ static inline void wrcs_do_stats(void)
ncalls
++
;
}
DEFINE_SPINLOCK
(
wrcs_lock
);
static
cycle_t
wrcs_read
(
struct
clocksource
*
cs
)
{
static
uint32_t
offset
,
last
,
this
;
unsigned
long
flags
;
wrcs_do_stats
();
...
...
@@ -59,10 +62,12 @@ static cycle_t wrcs_read(struct clocksource *cs)
* We reset at 0x3b9aca0, so without this we should use mask = 0x1f
* and mac_idle = 32 ticks = 512ns. Unaffordable.
*/
spin_lock_irqsave
(
&
wrcs_lock
,
flags
);
this
=
readl
(
&
wrcs_ppsg
->
CNTR_NSEC
);
if
(
this
<
last
)
offset
+=
WRCS_FREQUENCY
;
last
=
this
;
spin_unlock_irqrestore
(
&
wrcs_lock
,
flags
);
return
offset
+
this
;
}
...
...
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