Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
08f10067
Commit
08f10067
authored
Dec 22, 2003
by
Nicolas Pitre
Committed by
Russell King
Dec 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM PATCH] 1729/1: workaround for PXA timer delay problem
Patch from Nicolas Pitre ... as discussed on linux-arm-kernel.
parent
fa7bfcb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
include/asm-arm/arch-pxa/time.h
include/asm-arm/arch-pxa/time.h
+15
-2
No files found.
include/asm-arm/arch-pxa/time.h
View file @
08f10067
...
@@ -33,7 +33,7 @@ static int pxa_set_rtc(void)
...
@@ -33,7 +33,7 @@ static int pxa_set_rtc(void)
/* IRQs are disabled before entering here from do_gettimeofday() */
/* IRQs are disabled before entering here from do_gettimeofday() */
static
unsigned
long
pxa_gettimeoffset
(
void
)
static
unsigned
long
pxa_gettimeoffset
(
void
)
{
{
unsigned
long
ticks_to_match
,
elapsed
,
usec
;
long
ticks_to_match
,
elapsed
,
usec
;
/* Get ticks before next timer match */
/* Get ticks before next timer match */
ticks_to_match
=
OSMR0
-
OSCR
;
ticks_to_match
=
OSMR0
-
OSCR
;
...
@@ -41,6 +41,10 @@ static unsigned long pxa_gettimeoffset (void)
...
@@ -41,6 +41,10 @@ static unsigned long pxa_gettimeoffset (void)
/* We need elapsed ticks since last match */
/* We need elapsed ticks since last match */
elapsed
=
LATCH
-
ticks_to_match
;
elapsed
=
LATCH
-
ticks_to_match
;
/* don't get fooled by the workaround in pxa_timer_interrupt() */
if
(
elapsed
<=
0
)
return
0
;
/* Now convert them to usec */
/* Now convert them to usec */
usec
=
(
unsigned
long
)(
elapsed
*
(
tick_nsec
/
1000
))
/
LATCH
;
usec
=
(
unsigned
long
)(
elapsed
*
(
tick_nsec
/
1000
))
/
LATCH
;
...
@@ -59,6 +63,15 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -59,6 +63,15 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* IRQs are disabled inside the loop to ensure coherence between
* IRQs are disabled inside the loop to ensure coherence between
* lost_ticks (updated in do_timer()) and the match reg value, so we
* lost_ticks (updated in do_timer()) and the match reg value, so we
* can use do_gettimeofday() from interrupt handlers.
* can use do_gettimeofday() from interrupt handlers.
*
* HACK ALERT: it seems that the PXA timer regs aren't updated right
* away in all cases when a write occurs. We therefore compare with
* 8 instead of 0 in the while() condition below to avoid missing a
* match if OSCR has already reached the next OSMR value.
* Experience has shown that up to 6 ticks are needed to work around
* this problem, but let's use 8 to be conservative. Note that this
* affect things only when the timer IRQ has been delayed by nearly
* exactly one tick period which should be a pretty rare event.
*/
*/
do
{
do
{
do_leds
();
do_leds
();
...
@@ -66,7 +79,7 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -66,7 +79,7 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
do_timer
(
regs
);
do_timer
(
regs
);
OSSR
=
OSSR_M0
;
/* Clear match on timer 0 */
OSSR
=
OSSR_M0
;
/* Clear match on timer 0 */
next_match
=
(
OSMR0
+=
LATCH
);
next_match
=
(
OSMR0
+=
LATCH
);
}
while
(
(
signed
long
)(
next_match
-
OSCR
)
<=
0
);
}
while
(
(
signed
long
)(
next_match
-
OSCR
)
<=
8
);
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
}
}
...
...
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