Commit 90e2105e authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Update uptime after suspend

Update uptime after suspend

Derived from i386

Adjust jiffies after suspend to keep uptime. 
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2601ad70
......@@ -955,7 +955,7 @@ void __init time_init_smp(void)
__setup("report_lost_ticks", time_setup);
static long clock_cmos_diff;
static long clock_cmos_diff, sleep_start;
static int timer_suspend(struct sys_device *dev, u32 state)
{
......@@ -964,6 +964,7 @@ static int timer_suspend(struct sys_device *dev, u32 state)
*/
clock_cmos_diff = -get_cmos_time();
clock_cmos_diff += get_seconds();
sleep_start = jiffies;
return 0;
}
......@@ -971,15 +972,18 @@ static int timer_resume(struct sys_device *dev)
{
unsigned long flags;
unsigned long sec;
unsigned long ctime = get_cmos_time();
unsigned long sleep_length = ctime - sleep_start;
if (vxtime.hpet_address)
hpet_reenable();
sec = get_cmos_time() + clock_cmos_diff;
sec = ctime + clock_cmos_diff;
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;
}
......
......@@ -16,14 +16,14 @@
#include <asm/proto.h>
#include <asm/numa.h>
static DECLARE_BITMAP(nodes_parsed, MAXNODE) __initdata;
static struct node nodes[MAXNODE] __initdata;
static DECLARE_BITMAP(nodes_parsed, MAX_NUMNODES) __initdata;
static struct node nodes[MAX_NUMNODES] __initdata;
static __u8 pxm2node[256] __initdata = { [0 ... 255] = 0xff };
static __init int setup_node(int pxm)
{
if (pxm2node[pxm] == 0xff) {
if (numnodes > MAXNODE)
if (numnodes > MAX_NUMNODES)
return -1;
pxm2node[pxm] = numnodes - 1;
numnodes++;
......@@ -169,7 +169,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
bad_srat();
return -1;
}
for (i = 0; i < MAXNODE; i++) {
for (i = 0; i < MAX_NUMNODES; i++) {
if (!test_bit(i, &nodes_parsed))
continue;
cutoff_node(i, start, end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment