Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
a5a1a03a
Commit
a5a1a03a
authored
Feb 28, 2006
by
Tony Lindgren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: OMAP: Fix next_timer_interrupt() for hrtimer
This is Thomas Gleixner's improved version of the patch.
parent
7d3ba9ce
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
5 deletions
+61
-5
arch/arm/kernel/time.c
arch/arm/kernel/time.c
+6
-4
include/linux/hrtimer.h
include/linux/hrtimer.h
+4
-0
kernel/hrtimer.c
kernel/hrtimer.c
+35
-0
kernel/timer.c
kernel/timer.c
+16
-1
No files found.
arch/arm/kernel/time.c
View file @
a5a1a03a
...
...
@@ -422,12 +422,14 @@ static int timer_dyn_tick_disable(void)
void
timer_dyn_reprogram
(
void
)
{
struct
dyn_tick_timer
*
dyn_tick
=
system_timer
->
dyn_tick
;
unsigned
long
next
,
seq
;
if
(
dyn_tick
)
{
write_seqlock
(
&
xtime_lock
);
if
(
dyn_tick
->
state
&
DYN_TICK_ENABLED
)
if
(
dyn_tick
&&
(
dyn_tick
->
state
&
DYN_TICK_ENABLED
))
{
next
=
next_timer_interrupt
();
do
{
seq
=
read_seqbegin
(
&
xtime_lock
);
dyn_tick
->
reprogram
(
next_timer_interrupt
()
-
jiffies
);
write_sequnlock
(
&
xtime_lock
);
}
while
(
read_seqretry
(
&
xtime_lock
,
seq
)
);
}
}
...
...
include/linux/hrtimer.h
View file @
a5a1a03a
...
...
@@ -116,6 +116,10 @@ extern int hrtimer_try_to_cancel(struct hrtimer *timer);
extern
ktime_t
hrtimer_get_remaining
(
const
struct
hrtimer
*
timer
);
extern
int
hrtimer_get_res
(
const
clockid_t
which_clock
,
struct
timespec
*
tp
);
#ifdef CONFIG_NO_IDLE_HZ
extern
ktime_t
hrtimer_get_next_event
(
void
);
#endif
static
inline
int
hrtimer_active
(
const
struct
hrtimer
*
timer
)
{
return
timer
->
state
==
HRTIMER_PENDING
;
...
...
kernel/hrtimer.c
View file @
a5a1a03a
...
...
@@ -505,6 +505,41 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
return
rem
;
}
#ifdef CONFIG_NO_IDLE_HZ
/**
* hrtimer_get_next_event - get the time until next expiry event
*
* Returns the delta to the next expiry event or KTIME_MAX if no timer
* is pending.
*/
ktime_t
hrtimer_get_next_event
(
void
)
{
struct
hrtimer_base
*
base
=
__get_cpu_var
(
hrtimer_bases
);
ktime_t
delta
,
mindelta
=
{
.
tv64
=
KTIME_MAX
};
unsigned
long
flags
;
int
i
;
for
(
i
=
0
;
i
<
MAX_HRTIMER_BASES
;
i
++
,
base
++
)
{
struct
hrtimer
*
timer
;
spin_lock_irqsave
(
&
base
->
lock
,
flags
);
if
(
!
base
->
first
)
{
spin_unlock_irqrestore
(
&
base
->
lock
,
flags
);
continue
;
}
timer
=
rb_entry
(
base
->
first
,
struct
hrtimer
,
node
);
delta
.
tv64
=
timer
->
expires
.
tv64
;
spin_unlock_irqrestore
(
&
base
->
lock
,
flags
);
delta
=
ktime_sub
(
delta
,
base
->
get_time
());
if
(
delta
.
tv64
<
mindelta
.
tv64
)
mindelta
.
tv64
=
delta
.
tv64
;
}
if
(
mindelta
.
tv64
<
0
)
mindelta
.
tv64
=
0
;
return
mindelta
;
}
#endif
/**
* hrtimer_init - initialize a timer to the given clock
*
...
...
kernel/timer.c
View file @
a5a1a03a
...
...
@@ -488,10 +488,21 @@ unsigned long next_timer_interrupt(void)
tvec_base_t
*
base
;
struct
list_head
*
list
;
struct
timer_list
*
nte
;
unsigned
long
expires
;
unsigned
long
expires
,
hr_expires
=
MAX_JIFFY_OFFSET
;
ktime_t
hr_delta
;
tvec_t
*
varray
[
4
];
int
i
,
j
;
hr_delta
=
hrtimer_get_next_event
();
if
(
hr_delta
.
tv64
!=
KTIME_MAX
)
{
struct
timespec
tsdelta
;
tsdelta
=
ktime_to_timespec
(
hr_delta
);
hr_expires
=
timespec_to_jiffies
(
&
tsdelta
);
if
(
hr_expires
<
3
)
return
hr_expires
+
jiffies
;
}
hr_expires
+=
jiffies
;
base
=
&
__get_cpu_var
(
tvec_bases
);
spin_lock
(
&
base
->
t_base
.
lock
);
expires
=
base
->
timer_jiffies
+
(
LONG_MAX
>>
1
);
...
...
@@ -542,6 +553,10 @@ found:
}
}
spin_unlock
(
&
base
->
t_base
.
lock
);
if
(
time_before
(
hr_expires
,
expires
))
return
hr_expires
;
return
expires
;
}
#endif
...
...
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