Re: Power Management Update

From: Pavel Machek (pavel_at_ucw.cz)
Date: 08/31/03

  • Next message: Stephan von Krawczynski: "Bug Report: 2.4.22 3ware hang on dying drive"
    Date:	Sun, 31 Aug 2003 23:28:14 +0200
    To: Patrick Mochel <mochel@osdl.org>
    
    

    Hi!

    > <mochel@osdl.org> (03/08/22 1.1276.19.8)
    > [power] swsusp Cleanups
    >
    > - do_magic()
    > - Rename to swsusp_arch_suspend().
    > - Move declaration to swsusp.c
    >
    > - arch_prepare_suspend()
    > - Return an int
    > - Fix x86 version to return -EFAULT if cpu does not have pse, instead of
    > calling panic().
    > - Call from swsusp_save().
    >
    > - do_magic_suspend_1()
    > - Move body to pm_suspend_disk()
    > - Remove.
    >
    > - do_magic_suspend_2()
    > - Rename to swsusp_suspend()
    > - Move IRQ fiddling to suspend_save_image(), since that's the only call
    > that needs it.
    > - Return an int.
    >
    > - do_magic_resume_1()
    > - Move body to pm_resume().
    > - Remove
    >
    > - do_magic_resume_2()
    > - Rename to swsusp_resume().
    > - Return an int.
    >
    > - swsusp general
    > - Remove unnecessary includes.
    > - Remove suspend_pagedir_lock, since it was only used to disable IRQs.
    > - Change swsusp_{suspend,resume} return an int, so pm_suspend_disk() knows
    > if anything failed.

    Gracious renames to make sure I can not orient in the code :-(.

    -/* do_magic() is implemented in arch/?/kernel/suspend_asm.S, and
    basically does:
    +/* swsusp_arch_suspend() is implemented in arch/?/power/swsusp.S,
    + and basically does:

            if (!resume) {
    - do_magic_suspend_1();
                    save_processor_state();
                    SAVE_REGISTERS
    - do_magic_suspend_2();
    + swsusp_suspend();
                    return;
            }
            GO_TO_SWAPPER_PAGE_TABLES
    - do_magic_resume_1();
            COPY_PAGES_BACK
            RESTORE_REGISTERS
            restore_processor_state();
    - do_magic_resume_2();
    + swsusp_resume();

      */

    do_magic_suspend_1() did disable interrupts, where do you disable them
    now?

    Did you test it with CONFIG_PREEMPT to hunt for "scheduling in atomic"
    bugs?

    Your new naming is even worse than my original (and that's quite an
    achievement).

    swsusp_write() does
            swsusp_arch_suspend(), which in turn calls
                    swsusp_suspend()
                            ^- and that does the writing.
                            Ouch. do_magic_* was clearer than *that*.

    I do not see why you had to change to BIOs just now. Perhaps you
    should get it into stable state, first, and then adding more code to
    make it look 2.6-like is good idea?

    [Will add more comments after a test].
                                                                            Pavel

    -- 
    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
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Stephan von Krawczynski: "Bug Report: 2.4.22 3ware hang on dying drive"

    Relevant Pages

    • Re: bug in Real-Time Preemption
      ... lib/rwsem.c:153: warning: type defaults to `int' in declaration of `type name' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • 2.6.13-rt14 build problem on Powerpc board
      ... kernel/ntp.c:84: warning: excess elements in scalar initializer ... kernel/ntp.c:104: warning: type defaults to `int' in declaration of ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: PATCH 1/2: Make gotoxy & siblings use unsigned variables
      ... should stuck with int. ... When do you have a heart between your knees? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] Real-Time Preemption, -RT-2.6.9-mm1-V0.6.8
      ... fs/lockd/svc.c:49: warning: type defaults to `int' in declaration of ... fs/lockd/svc.c:49: warning: parameter names in function ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • TCP_SKB_CB question
      ... int switch_check ... However I am getting the following compile errors when I try to recompile ... implicit declaration of function TCP_SKB_CB ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)