Re: reboot vs poweroff

From: Eric W. Biederman (ebiederm_at_xmission.com)
Date: 09/02/05

  • Next message: Andrew Morton: "Re: [RFC] [PATCH] cache pollution aware __copy_from_user_ll()"
    To: Pavel Machek <pavel@ucw.cz>
    Date:	Thu, 01 Sep 2005 22:26:59 -0600
    
    

    Pavel Machek <pavel@ucw.cz> writes:

    > Hi!
    >>
    >> Thanks.
    >>
    >> This is clearly a code path I missed when I was fixing things.
    >>
    >> When I made the final acpi change I checked for any other users
    >> of device_suspend and it seems I was blind and missed this one.
    >> Looking again...
    >>
    >> The patch in the bug report looks correct. However it is still
    >> a little incomplete. In particular the reboot notifier is not
    >> being called, and since not everything has been converted into
    >> using shutdown methods that could lead to some other inconsistent
    >> behavior.
    >>
    >> Does anyone have any problems with the patch below?
    >> If not I will send this off to Linus..
    >
    > Yes. kernel_suspend is *way* too generic name. kernel_suspend_off?
    > kernel_powe_off_suspend?

    Darn. You have a point there.

    >> @@ -420,6 +421,15 @@ void kernel_power_off(void)
    >> }
    >> EXPORT_SYMBOL_GPL(kernel_power_off);
    >>
    >> +int kernel_suspend(void)
    >> +{
    >> + notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
    >> + system_state = SYSTEM_POWER_OFF;
    >> + device_shutdown();
    >> + return pm_ops->enter(PM_SUSPEND_DISK);
    >> +}
    >> +EXPORT_SYMBOL_GPL(kernel_suspend);
    >> +
    >
    > Are you sure pm_ops exists in !CONFIG_PM case?

    Hmm. Good point. I hadn't considered that. I am now certain
    it only exists when CONFIG_PM is set.

    Thinking about it more I probably want to simply have a
    kernel_power_off_shutdown(); common factor and call
    that instead of device_shutdown().

    Ok some sleep and then I will see if I can better version of this
    cleanup.

    Eric
    -
    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: Andrew Morton: "Re: [RFC] [PATCH] cache pollution aware __copy_from_user_ll()"

    Relevant Pages

    • Re: reboot vs poweroff
      ... >This is clearly a code path I missed when I was fixing things. ... >When I made the final acpi change I checked for any other users ... >The patch in the bug report looks correct. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] hfsplus: dont oops on bad FS
      ... My understanding of the driver is limited, that's why my initial patch ... you that my initial patch wasn't about fixing the ... Oops: kernel access of bad area, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: reboot vs poweroff
      ... > This is clearly a code path I missed when I was fixing things. ... > When I made the final acpi change I checked for any other users ... > The patch in the bug report looks correct. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Remove trailing whitespace in wbsd
      ... Unfortunately, this patch is white-space damaged, so doesn't apply. ... I've tried fixing up the obvious stuff due to the wrapping, ... Hunk #82 FAILED at 1743. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [BK PATCHES] ide-2.6 update
      ... > Even after fixing the 4 wrapped lines in the patch, ... What src tree is this to be applied to? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)