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
d4f7a112
Commit
d4f7a112
authored
Jan 06, 2003
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Fix a delay which could occur when booting on machines
without an RTC.
parent
87113c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
arch/ppc/kernel/time.c
arch/ppc/kernel/time.c
+9
-11
No files found.
arch/ppc/kernel/time.c
View file @
d4f7a112
...
...
@@ -286,13 +286,11 @@ void do_settimeofday(struct timeval *tv)
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
}
/* This function is only called on the boot processor */
void
__init
time_init
(
void
)
{
time_t
sec
,
old_sec
;
unsigned
old_stamp
,
stamp
,
elapsed
;
/* This function is only called on the boot processor */
unsigned
long
flags
;
if
(
ppc_md
.
time_init
!=
NULL
)
time_offset
=
ppc_md
.
time_init
();
...
...
@@ -309,31 +307,31 @@ void __init time_init(void)
/* Now that the decrementer is calibrated, it can be used in case the
* clock is stuck, but the fact that we have to handle the 601
* makes things more complex. Repeatedly read the RTC until the
* next second boundary to try to achieve some precision...
* next second boundary to try to achieve some precision. If there
* is no RTC, we still need to set tb_last_stamp and
* last_jiffy_stamp(cpu 0) to the current stamp.
*/
stamp
=
get_native_tbl
();
if
(
ppc_md
.
get_rtc_time
)
{
stamp
=
get_native_tbl
();
sec
=
ppc_md
.
get_rtc_time
();
elapsed
=
0
;
do
{
old_stamp
=
stamp
;
old_sec
=
sec
;
stamp
=
get_native_tbl
();
if
(
__USE_RTC
()
&&
stamp
<
old_stamp
)
old_stamp
-=
1000000000
;
if
(
__USE_RTC
()
&&
stamp
<
old_stamp
)
old_stamp
-=
1000000000
;
elapsed
+=
stamp
-
old_stamp
;
sec
=
ppc_md
.
get_rtc_time
();
}
while
(
sec
==
old_sec
&&
elapsed
<
2
*
HZ
*
tb_ticks_per_jiffy
);
if
(
sec
==
old_sec
)
{
if
(
sec
==
old_sec
)
printk
(
"Warning: real time clock seems stuck!
\n
"
);
}
write_lock_irqsave
(
&
xtime_lock
,
flags
);
xtime
.
tv_sec
=
sec
;
last_jiffy_stamp
(
0
)
=
tb_last_stamp
=
stamp
;
xtime
.
tv_nsec
=
0
;
/* No update now, we just read the time from the RTC ! */
last_rtc_update
=
xtime
.
tv_sec
;
write_unlock_irqrestore
(
&
xtime_lock
,
flags
);
}
last_jiffy_stamp
(
0
)
=
tb_last_stamp
=
stamp
;
/* Not exact, but the timer interrupt takes care of this */
set_dec
(
tb_ticks_per_jiffy
);
...
...
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