aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-05-19 15:59:01 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-05-19 15:59:01 -0700
commitf946bcab1c35689ca563072cde8ba3a4844fbd14 (patch)
tree3a684c968562ee2b8d489fee59cc9aff828a4c49 /driver
parent25041f79438a354d98305ea5650676997d915670 (diff)
downloadpatches-f946bcab1c35689ca563072cde8ba3a4844fbd14.tar.gz
usb patches added
Diffstat (limited to 'driver')
-rw-r--r--driver/driver-core-pm_debug-device-suspend-messages-become-informative.patch56
-rw-r--r--driver/remove-duplication-from-documentation-power-devices.txt.patch115
2 files changed, 171 insertions, 0 deletions
diff --git a/driver/driver-core-pm_debug-device-suspend-messages-become-informative.patch b/driver/driver-core-pm_debug-device-suspend-messages-become-informative.patch
new file mode 100644
index 0000000000000..f6c3a98a85182
--- /dev/null
+++ b/driver/driver-core-pm_debug-device-suspend-messages-become-informative.patch
@@ -0,0 +1,56 @@
+From david-b@pacbell.net Tue May 16 17:42:31 2006
+From: David Brownell <david-b@pacbell.net>
+To: Greg KH <greg@kroah.com>
+Subject: Driver core: PM_DEBUG device suspend() messages become informative
+Date: Tue, 16 May 2006 17:03:25 -0700
+Cc: linux-pm@lists.osdl.org
+Message-Id: <200605161703.26678.david-b@pacbell.net>
+
+This makes the driver model PM suspend debug messages more useful, by
+
+ (a) explaining what event is being sent, since not all suspend()
+ requests mean the same thing;
+
+ (b) reporting when a PM_EVENT_SUSPEND call is allowing the device
+ to issue wakeup events.
+
+Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/base/power/suspend.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/base/power/suspend.c
++++ gregkh-2.6/drivers/base/power/suspend.c
+@@ -30,6 +30,15 @@
+ * lists. This way, the ancestors will be accessed before their descendents.
+ */
+
++static inline char *suspend_verb(u32 event)
++{
++ switch (event) {
++ case PM_EVENT_SUSPEND: return "suspend";
++ case PM_EVENT_FREEZE: return "freeze";
++ default: return "(unknown suspend event)";
++ }
++}
++
+
+ /**
+ * suspend_device - Save state of one device.
+@@ -58,7 +67,13 @@ int suspend_device(struct device * dev,
+ dev->power.prev_state = dev->power.power_state;
+
+ if (dev->bus && dev->bus->suspend && !dev->power.power_state.event) {
+- dev_dbg(dev, "suspending\n");
++ dev_dbg(dev, "%s%s\n",
++ suspend_verb(state.event),
++ ((state.event == PM_EVENT_SUSPEND)
++ && device_may_wakeup(dev))
++ ? ", may wakeup"
++ : ""
++ );
+ error = dev->bus->suspend(dev, state);
+ suspend_report_result(dev->bus->suspend, error);
+ }
diff --git a/driver/remove-duplication-from-documentation-power-devices.txt.patch b/driver/remove-duplication-from-documentation-power-devices.txt.patch
new file mode 100644
index 0000000000000..6301c8aa94ba4
--- /dev/null
+++ b/driver/remove-duplication-from-documentation-power-devices.txt.patch
@@ -0,0 +1,115 @@
+From david-b@pacbell.net Tue May 16 17:42:31 2006
+From: David Brownell <david-b@pacbell.net>
+To: Greg KH <greg@kroah.com>
+Subject: remove duplication from Documentation/power/devices.txt
+Date: Tue, 16 May 2006 17:00:08 -0700
+Cc: linux-pm@lists.osdl.org
+Message-Id: <200605161700.10100.david-b@pacbell.net>
+
+Remove a chunk of duplicated documentation text.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/power/devices.txt | 90 ----------------------------------------
+ 1 file changed, 90 deletions(-)
+
+--- gregkh-2.6.orig/Documentation/power/devices.txt
++++ gregkh-2.6/Documentation/power/devices.txt
+@@ -135,96 +135,6 @@ HW.
+
+ FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from
+ scratch. That probably means stop accepting upstream requests, the
+-actual policy of what to do with them beeing specific to a given
+-driver. It's acceptable for a network driver to just drop packets
+-while a block driver is expected to block the queue so no request is
+-lost. (Use IDE as an example on how to do that). FREEZE requires no
+-power state change, and it's expected for drivers to be able to
+-quickly transition back to operating state.
+-
+-SUSPEND -- like FREEZE, but also put hardware into low-power state. If
+-there's need to distinguish several levels of sleep, additional flag
+-is probably best way to do that.
+-
+-Transitions are only from a resumed state to a suspended state, never
+-between 2 suspended states. (ON -> FREEZE or ON -> SUSPEND can happen,
+-FREEZE -> SUSPEND or SUSPEND -> FREEZE can not).
+-
+-All events are:
+-
+-[NOTE NOTE NOTE: If you are driver author, you should not care; you
+-should only look at event, and ignore flags.]
+-
+-#Prepare for suspend -- userland is still running but we are going to
+-#enter suspend state. This gives drivers chance to load firmware from
+-#disk and store it in memory, or do other activities taht require
+-#operating userland, ability to kmalloc GFP_KERNEL, etc... All of these
+-#are forbiden once the suspend dance is started.. event = ON, flags =
+-#PREPARE_TO_SUSPEND
+-
+-Apm standby -- prepare for APM event. Quiesce devices to make life
+-easier for APM BIOS. event = FREEZE, flags = APM_STANDBY
+-
+-Apm suspend -- same as APM_STANDBY, but it we should probably avoid
+-spinning down disks. event = FREEZE, flags = APM_SUSPEND
+-
+-System halt, reboot -- quiesce devices to make life easier for BIOS. event
+-= FREEZE, flags = SYSTEM_HALT or SYSTEM_REBOOT
+-
+-System shutdown -- at least disks need to be spun down, or data may be
+-lost. Quiesce devices, just to make life easier for BIOS. event =
+-FREEZE, flags = SYSTEM_SHUTDOWN
+-
+-Kexec -- turn off DMAs and put hardware into some state where new
+-kernel can take over. event = FREEZE, flags = KEXEC
+-
+-Powerdown at end of swsusp -- very similar to SYSTEM_SHUTDOWN, except wake
+-may need to be enabled on some devices. This actually has at least 3
+-subtypes, system can reboot, enter S4 and enter S5 at the end of
+-swsusp. event = FREEZE, flags = SWSUSP and one of SYSTEM_REBOOT,
+-SYSTEM_SHUTDOWN, SYSTEM_S4
+-
+-Suspend to ram -- put devices into low power state. event = SUSPEND,
+-flags = SUSPEND_TO_RAM
+-
+-Freeze for swsusp snapshot -- stop DMA and interrupts. No need to put
+-devices into low power mode, but you must be able to reinitialize
+-device from scratch in resume method. This has two flavors, its done
+-once on suspending kernel, once on resuming kernel. event = FREEZE,
+-flags = DURING_SUSPEND or DURING_RESUME
+-
+-Device detach requested from /sys -- deinitialize device; proably same as
+-SYSTEM_SHUTDOWN, I do not understand this one too much. probably event
+-= FREEZE, flags = DEV_DETACH.
+-
+-#These are not really events sent:
+-#
+-#System fully on -- device is working normally; this is probably never
+-#passed to suspend() method... event = ON, flags = 0
+-#
+-#Ready after resume -- userland is now running, again. Time to free any
+-#memory you ate during prepare to suspend... event = ON, flags =
+-#READY_AFTER_RESUME
+-#
+-
+-
+-pm_message_t meaning
+-
+-pm_message_t has two fields. event ("major"), and flags. If driver
+-does not know event code, it aborts the request, returning error. Some
+-drivers may need to deal with special cases based on the actual type
+-of suspend operation being done at the system level. This is why
+-there are flags.
+-
+-Event codes are:
+-
+-ON -- no need to do anything except special cases like broken
+-HW.
+-
+-# NOTIFICATION -- pretty much same as ON?
+-
+-FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from
+-scratch. That probably means stop accepting upstream requests, the
+ actual policy of what to do with them being specific to a given
+ driver. It's acceptable for a network driver to just drop packets
+ while a block driver is expected to block the queue so no request is