Sleep fixes

Sleep fixes

Post by Pavel Mache » Thu, 13 Feb 2003 23:00:11



Hi!

This fixes error conditions in sleep, and makes acpi ask for
suspend_disable. Please apply,
                                                                Pavel

--- clean/arch/i386/kernel/acpi.c       2003-02-11 17:40:33.000000000 +0100

        panic("S3 and PAE do not like each other for now.");
        return 1;
 #endif
+       if (!acpi_wakeup_address)
+               return 1;
        init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
        memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);

 /**
  * acpi_reserve_bootmem - do _very_ early ACPI initialisation
  *
- * We allocate a page in low memory for the wakeup
+ * We allocate a page from the first 1MB of memory for the wakeup
  * routine for when we come back from a sleep state. The
- * runtime allocator allows specification of <16M pages, but not
- * <1M pages.
+ * runtime allocator allows specification of <16MB pages, but not
+ * <1MB pages.
  */
 void __init acpi_reserve_bootmem(void)
 {
        acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
+       if (!acpi_wakeup_address)
+               printk(KERN_ERR "ACPI: Cannot allocate lowmem. S3 disabled.\n");
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
                printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
-       printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
 }

 static int __init acpi_sleep_setup(char *str)
--- clean/drivers/acpi/sleep.c  2003-01-05 22:58:25.000000000 +0100

                        return error;
                }

+               error = device_suspend(state, SUSPEND_DISABLE);
+               if (error)
+                       panic("Sorry, devices really should know how to disable\n");
+
                /* flush caches */
                ACPI_FLUSH_CPU_CACHE();

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. [PATCH] Fix drivers/acpi/sleep.c compile error if swsusp is disabled

Hi, this should fix this compile problem (if this is correct).

Please apply.

Shawn.

diff -urpN  linux-2.5.47-vanilla/drivers/acpi/sleep.c linux-2.5.47-fixes/drivers/acpi/sleep.c
--- linux-2.5.47-vanilla/drivers/acpi/sleep.c   2002-11-13 22:40:07.000000000 -0500

                break;

        case ACPI_STATE_S2:
+#ifdef CONFIG_SOFTWARE_SUSPEND
        case ACPI_STATE_S3:
                do_suspend_lowlevel(0);
+#endif
                break;
        }
        local_irq_restore(flags);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. search the code for "Understanding Network Internals" book

3. How should nano_sleep be fixed (was: ptrace(), fork(), sleep(), exit(), SIGCHLD)

4. Problem with sendmail in Solaris 9

5. ext2/3 bugfix 1/6: Fix illegal sleep in mbcache.

6. Learning UNIX

7. 2.5.x fixes IDE sleep problems, (hdparm -Y), on PIIX3, (at least).

8. MySQL 3.23.38 on OpenBSD 2.8

9. input: fix sleep support, kill bad ifdefs, cleanup comments

10. Sleep in ksh script ignored until the sleep time expires

11. Process sleeping < sleep time

12. Bug in glibc-2.1.1: sleep(0) sleeps 10ms

13. sleep() sleeps the thread or the proc?