diff options
Diffstat (limited to 'arch/i386/kernel/apm.c')
-rw-r--r-- | arch/i386/kernel/apm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index a60358fe9a49..199016927541 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -231,6 +231,7 @@ | |||
231 | #include <asm/uaccess.h> | 231 | #include <asm/uaccess.h> |
232 | #include <asm/desc.h> | 232 | #include <asm/desc.h> |
233 | #include <asm/i8253.h> | 233 | #include <asm/i8253.h> |
234 | #include <asm/paravirt.h> | ||
234 | 235 | ||
235 | #include "io_ports.h" | 236 | #include "io_ports.h" |
236 | 237 | ||
@@ -784,7 +785,11 @@ static int apm_do_idle(void) | |||
784 | polling = !!(current_thread_info()->status & TS_POLLING); | 785 | polling = !!(current_thread_info()->status & TS_POLLING); |
785 | if (polling) { | 786 | if (polling) { |
786 | current_thread_info()->status &= ~TS_POLLING; | 787 | current_thread_info()->status &= ~TS_POLLING; |
787 | smp_mb__after_clear_bit(); | 788 | /* |
789 | * TS_POLLING-cleared state must be visible before we | ||
790 | * test NEED_RESCHED: | ||
791 | */ | ||
792 | smp_mb(); | ||
788 | } | 793 | } |
789 | if (!need_resched()) { | 794 | if (!need_resched()) { |
790 | idled = 1; | 795 | idled = 1; |
@@ -1603,7 +1608,7 @@ static int do_open(struct inode * inode, struct file * filp) | |||
1603 | { | 1608 | { |
1604 | struct apm_user * as; | 1609 | struct apm_user * as; |
1605 | 1610 | ||
1606 | as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); | 1611 | as = kmalloc(sizeof(*as), GFP_KERNEL); |
1607 | if (as == NULL) { | 1612 | if (as == NULL) { |
1608 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", | 1613 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", |
1609 | sizeof(*as)); | 1614 | sizeof(*as)); |
@@ -2235,7 +2240,7 @@ static int __init apm_init(void) | |||
2235 | 2240 | ||
2236 | dmi_check_system(apm_dmi_table); | 2241 | dmi_check_system(apm_dmi_table); |
2237 | 2242 | ||
2238 | if (apm_info.bios.version == 0) { | 2243 | if (apm_info.bios.version == 0 || paravirt_enabled()) { |
2239 | printk(KERN_INFO "apm: BIOS not found.\n"); | 2244 | printk(KERN_INFO "apm: BIOS not found.\n"); |
2240 | return -ENODEV; | 2245 | return -ENODEV; |
2241 | } | 2246 | } |