Skip to contentSkip to conversation

Hibernation and time and dhcp

DISCUSSION Michal Semler 4 participants 7 messages Oct 20, 2004 – Oct 22, 2004

lore
Share & tools
lore
#0 lore raw

Hi guys,

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00 - when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Same problem with dhcp - it should ask for IP when rehibernate.

Thanks for fixing

Michal

#1 lore raw

hibernate.conf:

### clock
SaveClock yes

OnResume 20 dhcpcd -n

Quoted 22 lines · Michal Semler

Hi guys,

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00 - when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Same problem with dhcp - it should ask for IP when rehibernate.

Thanks for fixing

Michal
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
In reply to Michal Semler
Quoted 6 lines · Michal Semler

Hi guys,

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

Quoted 6 lines

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00 - when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Same problem with dhcp - it should ask for IP when rehibernate.

These should be handled in userspace. You can put together some simple shell script to do it with (hwclock or ntpdate) and [u]dhcp* --
vda

#3 lore raw

Dne čt 21. října 2004 14:31 Denis Vlasenko napsal(a):

Quoted 13 lines · Michal Semler
Quoted 12 lines

Hi guys,

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00
- when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Quoted 6 lines
Quoted 1 line

Same problem with dhcp - it should ask for IP when rehibernate.

These should be handled in userspace. You can put together some simple shell script to do it with (hwclock or ntpdate) and [u]dhcp* --
vda

Yes, it's possible, but many programs crashes when time is moved about hours or days. And till time they will be repaired, we should ask for time BIOS to have little time difference.

Michal

#4 lore raw
Quoted 6 lines · Michal Semler
Quoted 2 lines

These should be handled in userspace. You can put together some simple shell script to do it with (hwclock or ntpdate) and [u]dhcp*

Yes, it's possible, but many programs crashes when time is moved about hours or days. And till time they will be repaired, we should ask for time BIOS to have little time difference.

Those programs are buggy.
--
vda

#5 lore raw
In reply to Michal Semler

Hi!

Quoted 10 lines

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00 - when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Same problem with dhcp - it should ask for IP when rehibernate.

Known bug and I posted patch at least to acpi list few hours ago.

Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#6 lore raw

Hi!

Quoted 4 lines
Quoted 4 lines

with 2.6.9 hibernation to disk finally works! Thanks
To ram it still don't work, system starts with lcd disabled - but it is another story.

Quoted 8 lines
Quoted 6 lines

I have now this problem - when I hibernate and then system is started up in other company, it don't update time and shows still for example 14:00 - when I rehibernate for example in 20:00 - could you ask bios for current time? It's better to have bad time about few seconds instead of hours.

Same problem with dhcp - it should ask for IP when rehibernate.

Known bug and I posted patch at least to acpi list few hours ago.

Here it is...

Pavel

arch/i386/kernel/time.c +5 -1
@@ -319,7 +319,7 @@
 	return retval;
 }
 
-static long clock_cmos_diff;
+static long clock_cmos_diff, sleep_start;
 
 static int time_suspend(struct sys_device *dev, u32 state)
 {
@@ -328,6 +328,7 @@
 	 */
 	clock_cmos_diff = -get_cmos_time();
 	clock_cmos_diff += get_seconds();
+	sleep_start = get_cmos_time();
 	return 0;
 }
 
@@ -335,10 +336,13 @@
 {
 	unsigned long flags;
 	unsigned long sec = get_cmos_time() + clock_cmos_diff;
+	unsigned long sleep_length = get_cmos_time() - sleep_start;
+
 	write_seqlock_irqsave(&xtime_lock, flags);
 	xtime.tv_sec = sec;
 	xtime.tv_nsec = 0;
 	write_sequnlock_irqrestore(&xtime_lock, flags);
+	jiffies += sleep_length * HZ;
 	return 0;
 }
 
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!