lkml.org 
[lkml]   [2002]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch: linux-2.5.42/kernel/sys.c - warm reboot should not suspend devices

> device_shutdown and device_suspend are for power management.
> It is important to turn the device off as soon as possible if a power
> management routine has told you that the device is not going to be
> used any more.

device_suspend() is for power management. device_shutdown() is for
quiescing devices before a system reboot or power off.

It's true that the same function is called when the device is physically
removed from the system as when the system is shutting down, and that
might be kinda bad. If it gets to the point where it's really difficult to
deal with for drivers, we can create another callback: ->shutdown() for
struct device_driver.

> If you've identified a bunch of devices that need
> reboot_notifier, please list them so we can fix them rather than
> taxing the users with unnecessarily slow reboots or poor battery life
> (due to device not being shut down when they are no longer being used).

No, reboot notifiers are the completely wrong way to go, for one reason
alone: ordering. device_shutdown() does a depth-first walk of the tree to
shut down children devices before ancestors. You cannot guarantee that
with reboot notifiers.

Please don't try and convolute the code because you're worried about a few
microseconds. It's about correctness first; then we can worry about
micro-optimizing the hell out of it.

-pat

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.093 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site