From 17d9ddc72fb8bba0d4f67868c9c612e472a594a9 Mon Sep 17 00:00:00 2001 From: "Pallipadi, Venkatesh" Date: Wed, 10 Feb 2010 15:23:44 -0800 Subject: rbtree: Add support for augmented rbtrees Add support for augmented rbtrees in core rbtree code. This will be used in subsequent patches, in x86 PAT code, which needs interval trees to efficiently keep track of PAT ranges. Signed-off-by: Venkatesh Pallipadi LKML-Reference: <20100210232343.GA11465@linux-os.sc.intel.com> Signed-off-by: Suresh Siddha Signed-off-by: H. Peter Anvin --- Documentation/rbtree.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'Documentation') diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt index aae8355d316..221f38be98f 100644 --- a/Documentation/rbtree.txt +++ b/Documentation/rbtree.txt @@ -190,3 +190,61 @@ Example: for (node = rb_first(&mytree); node; node = rb_next(node)) printk("key=%s\n", rb_entry(node, struct mytype, node)->keystring); +Support for Augmented rbtrees +----------------------------- + +Augmented rbtree is an rbtree with "some" additional data stored in each node. +This data can be used to augment some new functionality to rbtree. +Augmented rbtree is an optional feature built on top of basic rbtree +infrastructure. rbtree user who wants this feature will have an augment +callback function in rb_root initialized. + +This callback function will be called from rbtree core routines whenever +a node has a change in one or both of its children. It is the responsibility +of the callback function to recalculate the additional data that is in the +rb node using new children information. Note that if this new additional +data affects the parent node's additional data, then callback function has +to handle it and do the recursive updates. + + +Interval tree is an example of augmented rb tree. Reference - +"Introduction to Algorithms" by Cormen, Leiserson, Rivest and Stein. +More details about interval trees: + +Classical rbtree has a single key and it cannot be directly used to store +interval ranges like [lo:hi] and do a quick lookup for any overlap with a new +lo:hi or to find whether there is an exact match for a new lo:hi. + +However, rbtree can be augmented to store such interval ranges in a structured +way making it possible to do efficient lookup and exact match. + +This "extra information" stored in each node is the maximum hi +(max_hi) value among all the nodes that are its descendents. This +information can be maintained at each node just be looking at the node +and its immediate children. And this will be used in O(log n) lookup +for lowest match (lowest start address among all possible matches) +with something like: + +find_lowest_match(lo, hi, node) +{ + lowest_match = NULL; + while (node) { + if (max_hi(node->left) > lo) { + // Lowest overlap if any must be on left side + node = node->left; + } else if (overlap(lo, hi, node)) { + lowest_match = node; + break; + } else if (lo > node->lo) { + // Lowest overlap if any must be on right side + node = node->right; + } else { + break; + } + } + return lowest_match; +} + +Finding exact match will be to first find lowest match and then to follow +successor nodes looking for exact match, until the start of a node is beyond +the hi value we are looking for. -- cgit v1.2.2 From 69c86373c6ea1149aa559e6088362d58d8ec8835 Mon Sep 17 00:00:00 2001 From: "florian@mickler.org" Date: Wed, 24 Feb 2010 12:05:16 +0100 Subject: Document the rfkill sysfs ABI This moves sysfs ABI info from Documentation/rfkill.txt to the ABI subfolder and reformats it. This also schedules the deprecated sysfs parts to be removed in 2012 (claim file) and 2014 (state file). Signed-off-by: Florian Mickler Signed-off-by: John W. Linville --- Documentation/ABI/obsolete/sysfs-class-rfkill | 29 ++++++++++++++++++ Documentation/ABI/stable/sysfs-class-rfkill | 42 +++++++++++++++++++++++++ Documentation/feature-removal-schedule.txt | 18 +++++++++++ Documentation/rfkill.txt | 44 ++++++++------------------- 4 files changed, 102 insertions(+), 31 deletions(-) create mode 100644 Documentation/ABI/obsolete/sysfs-class-rfkill create mode 100644 Documentation/ABI/stable/sysfs-class-rfkill (limited to 'Documentation') diff --git a/Documentation/ABI/obsolete/sysfs-class-rfkill b/Documentation/ABI/obsolete/sysfs-class-rfkill new file mode 100644 index 00000000000..4201d5b0551 --- /dev/null +++ b/Documentation/ABI/obsolete/sysfs-class-rfkill @@ -0,0 +1,29 @@ +rfkill - radio frequency (RF) connector kill switch support + +For details to this subsystem look at Documentation/rfkill.txt. + +What: /sys/class/rfkill/rfkill[0-9]+/state +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: Current state of the transmitter. + This file is deprecated and sheduled to be removed in 2014, + because its not possible to express the 'soft and hard block' + state of the rfkill driver. +Values: A numeric value. + 0: RFKILL_STATE_SOFT_BLOCKED + transmitter is turned off by software + 1: RFKILL_STATE_UNBLOCKED + transmitter is (potentially) active + 2: RFKILL_STATE_HARD_BLOCKED + transmitter is forced off by something outside of + the driver's control. + +What: /sys/class/rfkill/rfkill[0-9]+/claim +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: This file is deprecated because there no longer is a way to + claim just control over a single rfkill instance. + This file is scheduled to be removed in 2012. +Values: 0: Kernel handles events diff --git a/Documentation/ABI/stable/sysfs-class-rfkill b/Documentation/ABI/stable/sysfs-class-rfkill new file mode 100644 index 00000000000..97d5064f4f8 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-class-rfkill @@ -0,0 +1,42 @@ +rfkill - radio frequency (RF) connector kill switch support + +For details to this subsystem look at Documentation/rfkill.txt. + +For the deprecated /sys/class/rfkill/*/state and +/sys/class/rfkill/*/claim knobs of this interface look in +Documentation/ABI/obsolte/sysfs-class-rfkill. + +What: /sys/class/rfkill +Date: 09-Jul-2007 +KernelVersion: v2.6.22 +Contact: linux-wireless@vger.kernel.org, +Description: The rfkill class subsystem folder. + Each registered rfkill driver is represented by an rfkillX + subfolder (X being an integer > 0). + + +What: /sys/class/rfkill/rfkill[0-9]+/name +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: Name assigned by driver to this key (interface or driver name). +Values: arbitrary string. + + +What: /sys/class/rfkill/rfkill[0-9]+/type +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: Driver type string ("wlan", "bluetooth", etc). +Values: See include/linux/rfkill.h. + + +What: /sys/class/rfkill/rfkill[0-9]+/persistent +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: Whether the soft blocked state is initialised from non-volatile + storage at startup. +Values: A numeric value. + 0: false + 1: true diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index a0a4fd43e62..a841e79dfac 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -520,6 +520,24 @@ Who: Hans de Goede ---------------------------- +What: sysfs-class-rfkill state file +When: Feb 2014 +Files: net/rfkill/core.c +Why: Documented as obsolete since Feb 2010. This file is limited to 3 + states while the rfkill drivers can have 4 states. +Who: anybody or Florian Mickler + +---------------------------- + +What: sysfs-class-rfkill claim file +When: Feb 2012 +Files: net/rfkill/core.c +Why: It is not possible to claim an rfkill driver since 2007. This is + Documented as obsolete since Feb 2010. +Who: anybody or Florian Mickler + +---------------------------- + What: capifs When: February 2011 Files: drivers/isdn/capi/capifs.* diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index b4860509c31..83668e5dd17 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt @@ -99,37 +99,15 @@ system. Also, it is possible to switch all rfkill drivers (or all drivers of a specified type) into a state which also updates the default state for hotplugged devices. -After an application opens /dev/rfkill, it can read the current state of -all devices, and afterwards can poll the descriptor for hotplug or state -change events. - -Applications must ignore operations (the "op" field) they do not handle, -this allows the API to be extended in the future. - -Additionally, each rfkill device is registered in sysfs and there has the -following attributes: - - name: Name assigned by driver to this key (interface or driver name). - type: Driver type string ("wlan", "bluetooth", etc). - persistent: Whether the soft blocked state is initialised from - non-volatile storage at startup. - state: Current state of the transmitter - 0: RFKILL_STATE_SOFT_BLOCKED - transmitter is turned off by software - 1: RFKILL_STATE_UNBLOCKED - transmitter is (potentially) active - 2: RFKILL_STATE_HARD_BLOCKED - transmitter is forced off by something outside of - the driver's control. - This file is deprecated because it can only properly show - three of the four possible states, soft-and-hard-blocked is - missing. - claim: 0: Kernel handles events - This file is deprecated because there no longer is a way to - claim just control over a single rfkill instance. - -rfkill devices also issue uevents (with an action of "change"), with the -following environment variables set: +After an application opens /dev/rfkill, it can read the current state of all +devices. Changes can be either obtained by either polling the descriptor for +hotplug or state change events or by listening for uevents emitted by the +rfkill core framework. + +Additionally, each rfkill device is registered in sysfs and emits uevents. + +rfkill devices issue uevents (with an action of "change"), with the following +environment variables set: RFKILL_NAME RFKILL_STATE @@ -137,3 +115,7 @@ RFKILL_TYPE The contents of these variables corresponds to the "name", "state" and "type" sysfs files explained above. + + +For further details consult Documentation/ABI/stable/dev-rfkill and +Documentation/ABI/stable/sysfs-class-rfkill. -- cgit v1.2.2 From 6c26361e4be3cf0dad7083e38ca52001a987e3e6 Mon Sep 17 00:00:00 2001 From: "florian@mickler.org" Date: Fri, 26 Feb 2010 12:01:34 +0100 Subject: enhance sysfs rfkill interface This commit introduces two new sysfs knobs. /sys/class/rfkill/rfkill[0-9]+/blocked_hw: (ro) hardblock kill state /sys/class/rfkill/rfkill[0-9]+/blocked_sw: (rw) softblock kill state Signed-off-by: Florian Mickler Signed-off-by: John W. Linville --- Documentation/ABI/stable/sysfs-class-rfkill | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Documentation') diff --git a/Documentation/ABI/stable/sysfs-class-rfkill b/Documentation/ABI/stable/sysfs-class-rfkill index 97d5064f4f8..b91c3f37453 100644 --- a/Documentation/ABI/stable/sysfs-class-rfkill +++ b/Documentation/ABI/stable/sysfs-class-rfkill @@ -40,3 +40,28 @@ Description: Whether the soft blocked state is initialised from non-volatile Values: A numeric value. 0: false 1: true + + +What: /sys/class/rfkill/rfkill[0-9]+/blocked_hw +Date: 23-Feb-2010 +KernelVersion v2.6.34 +Contact: linux-wireless@vger.kernel.org +Description: Current hardblock state. This file is read only. +Values: A numeric value. + 0: inactive + The transmitter is (potentially) active. + 1: active + The transmitter is forced off by something outside of + the driver's control. + + +What: /sys/class/rfkill/rfkill[0-9]+/blocked_sw +Date: 23-Feb-2010 +KernelVersion v2.6.34 +Contact: linux-wireless@vger.kernel.org +Description: Current softblock state. This file is read and write. +Values: A numeric value. + 0: inactive + The transmitter is (potentially) active. + 1: active + The transmitter is turned off by software. -- cgit v1.2.2 From 25268498c9e07870323aead10751b7c6e99a3a78 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 12 Mar 2010 14:56:00 -0800 Subject: time: Add xtime, wall_to_monotonic to feature-removal-schedule They aren't really features, but fair warning to out of tree driver folks who might be accessing these variables. Signed-off-by: John Stultz CC: Ingo Molnar LKML-Reference: <1268434560-2677-1-git-send-email-johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner --- Documentation/feature-removal-schedule.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index a5cc0db63d7..198acdc05fd 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -582,3 +582,13 @@ Why: The paravirt mmu host support is slower than non-paravirt mmu, both Who: Avi Kivity ---------------------------- + +What: xtime, wall_to_monotonic +When: 2.6.36+ +Files: kernel/time/timekeeping.c include/linux/time.h +Why: Cleaning up timekeeping internal values. Please use + existing timekeeping accessor functions to access + the equivalent functionality. +Who: John Stultz + +---------------------------- -- cgit v1.2.2 From 32e688b8c1afafa389223a4813b97e8c128a1636 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 15 Mar 2010 15:21:31 +0100 Subject: Documentation/filesystems/proc.txt typo fix. Typo fix for a filename in procfs documentation. Signed-off-by: Rob Landley Signed-off-by: Jiri Kosina --- Documentation/filesystems/proc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index a4f30faa4f1..770700317c2 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -305,7 +305,7 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7) cgtime guest time of the task children in jiffies .............................................................................. -The /proc/PID/map file containing the currently mapped memory regions and +The /proc/PID/maps file containing the currently mapped memory regions and their access permissions. The format is: -- cgit v1.2.2 From 5cc718b9dad682329a60e73547c6e708faa5bbe4 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Mon, 15 Mar 2010 13:00:54 -0400 Subject: kprobes: Hide CONFIG_OPTPROBES and set if arch supports optimized kprobes Hide CONFIG_OPTPROBES and set if the arch supports optimized kprobes (IOW, HAVE_OPTPROBES=y), since this option doesn't change the major behavior of kprobes, and workarounds for minor changes are documented. Signed-off-by: Masami Hiramatsu Cc: systemtap Cc: DLE Cc: Dieter Ries Cc: Ananth N Mavinakayanahalli Cc: OGAWA Hirofumi Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker LKML-Reference: <20100315170054.31593.3153.stgit@localhost6.localdomain6> Signed-off-by: Ingo Molnar --- Documentation/kprobes.txt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Documentation') diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 2f9115c0ae6..61c291cddf1 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt @@ -165,8 +165,8 @@ the user entry_handler invocation is also skipped. 1.4 How Does Jump Optimization Work? -If you configured your kernel with CONFIG_OPTPROBES=y (currently -this option is supported on x86/x86-64, non-preemptive kernel) and +If your kernel is built with CONFIG_OPTPROBES=y (currently this flag +is automatically set 'y' on x86/x86-64, non-preemptive kernel) and the "debug.kprobes_optimization" kernel parameter is set to 1 (see sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump instruction instead of a breakpoint instruction at each probepoint. @@ -271,8 +271,6 @@ tweak the kernel's execution path, you need to suppress optimization, using one of the following techniques: - Specify an empty function for the kprobe's post_handler or break_handler. or -- Config CONFIG_OPTPROBES=n. - or - Execute 'sysctl -w debug.kprobes_optimization=n' 2. Architectures Supported @@ -307,10 +305,6 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO), so you can use "objdump -d -l vmlinux" to see the source-to-object code mapping. -If you want to reduce probing overhead, set "Kprobes jump optimization -support" (CONFIG_OPTPROBES) to "y". You can find this option under the -"Kprobes" line. - 4. API Reference The Kprobes API includes a "register" function and an "unregister" -- cgit v1.2.2 From 88393161210493e317ae391696ee8ef463cb3c23 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Tue, 16 Mar 2010 11:47:56 +0100 Subject: Fix typos in comments [Ss]ytem => [Ss]ystem udpate => update paramters => parameters orginal => original Signed-off-by: Thomas Weber Acked-by: Randy Dunlap Signed-off-by: Jiri Kosina --- Documentation/cgroups/cgroups.txt | 2 +- Documentation/kbuild/kconfig.txt | 2 +- Documentation/sysfs-rules.txt | 2 +- Documentation/trace/events.txt | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index fd588ff0e29..5eb279a48fa 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt @@ -573,7 +573,7 @@ void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, Called when a task attach operation has failed after can_attach() has succeeded. A subsystem whose can_attach() has some side-effects should provide this -function, so that the subsytem can implement a rollback. If not, not necessary. +function, so that the subsystem can implement a rollback. If not, not necessary. This will be called only about subsystems whose can_attach() operation have succeeded. diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt index 49efae70397..b2cb16ebcb1 100644 --- a/Documentation/kbuild/kconfig.txt +++ b/Documentation/kbuild/kconfig.txt @@ -96,7 +96,7 @@ Environment variables for 'silentoldconfig' KCONFIG_NOSILENTUPDATE -------------------------------------------------- If this variable has a non-blank value, it prevents silent kernel -config udpates (requires explicit updates). +config updates (requires explicit updates). KCONFIG_AUTOCONFIG -------------------------------------------------- diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt index 5d8bc2cd250..c1a1fd636bf 100644 --- a/Documentation/sysfs-rules.txt +++ b/Documentation/sysfs-rules.txt @@ -125,7 +125,7 @@ versions of the sysfs interface. - Block The converted block subsystem at /sys/class/block or /sys/subsystem/block will contain the links for disks and partitions - at the same level, never in a hierarchy. Assuming the block subsytem to + at the same level, never in a hierarchy. Assuming the block subsystem to contain only disks and not partition devices in the same flat list is a bug in the application. diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt index 02ac6ed38b2..b22000dbc57 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt @@ -238,7 +238,7 @@ subsystem's filter file. For convenience, filters for every event in a subsystem can be set or cleared as a group by writing a filter expression into the filter file -at the root of the subsytem. Note however, that if a filter for any +at the root of the subsystem. Note however, that if a filter for any event within the subsystem lacks a field specified in the subsystem filter, or if the filter can't be applied for any other reason, the filter for that event will retain its previous setting. This can @@ -250,7 +250,7 @@ fields can be guaranteed to propagate successfully to all events. Here are a few subsystem filter examples that also illustrate the above points: -Clear the filters on all events in the sched subsytem: +Clear the filters on all events in the sched subsystem: # cd /sys/kernel/debug/tracing/events/sched # echo 0 > filter @@ -260,7 +260,7 @@ none none Set a filter using only common fields for all events in the sched -subsytem (all events end up with the same filter): +subsystem (all events end up with the same filter): # cd /sys/kernel/debug/tracing/events/sched # echo common_pid == 0 > filter @@ -270,7 +270,7 @@ common_pid == 0 common_pid == 0 Attempt to set a filter using a non-common field for all events in the -sched subsytem (all events but those that have a prev_pid field retain +sched subsystem (all events but those that have a prev_pid field retain their old filters): # cd /sys/kernel/debug/tracing/events/sched -- cgit v1.2.2 From 0cb47ea24d2f72ca91bbe60e1c831f57e03efa20 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 16 Mar 2010 18:25:12 +0100 Subject: netfilter: xtables: schedule xt_NOTRACK for removal It is being superseded by xt_CT (-j CT --notrack). Signed-off-by: Jan Engelhardt --- Documentation/feature-removal-schedule.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index ed511af0f79..8843fef0fce 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -589,3 +589,11 @@ Why: Useful in 2003, implementation is a hack. Generally invoked by accident today. Seen as doing more harm than good. Who: Len Brown + +--------------------------- + +What: xt_NOTRACK +Files: net/netfilter/xt_NOTRACK.c +When: April 2011 +Why: Superseded by xt_CT +Who: Netfilter developer team -- cgit v1.2.2 From 408ffaa4a11ddd6f730be520479fd5cd890c57d3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 28 Feb 2010 23:19:52 +0100 Subject: netfilter: update my email address Signed-off-by: Jan Engelhardt --- Documentation/feature-removal-schedule.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 8843fef0fce..fa327f673a3 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -247,7 +247,7 @@ What (Why): When: January 2009 or Linux 2.7.0, whichever comes first Why: Superseded by newer revisions or modules -Who: Jan Engelhardt +Who: Jan Engelhardt --------------------------- -- cgit v1.2.2 From 5be4a4f589841ef06fd79b241de3d5353a6c5efa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 1 Mar 2010 11:55:33 +0100 Subject: netfilter: xt_recent: remove old proc directory The compat option was introduced in October 2008. Signed-off-by: Jan Engelhardt --- Documentation/feature-removal-schedule.txt | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index fa327f673a3..ea227e3f528 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -241,16 +241,6 @@ Who: Thomas Gleixner --------------------------- -What (Why): - - xt_recent: the old ipt_recent proc dir - (superseded by /proc/net/xt_recent) - -When: January 2009 or Linux 2.7.0, whichever comes first -Why: Superseded by newer revisions or modules -Who: Jan Engelhardt - ---------------------------- - What: GPIO autorequest on gpio_direction_{input,output}() in gpiolib When: February 2010 Why: All callers should use explicit gpio_request()/gpio_free(). -- cgit v1.2.2 From ab5097b11f6fcb587b65cd08bd7241661ade77db Mon Sep 17 00:00:00 2001 From: Greg Thelen Date: Thu, 18 Mar 2010 15:04:39 -0700 Subject: memcg: fix typo in memcg documentation Updated memory.txt to be more consistent: s/swapiness/swappiness/ Signed-off-by: Greg Thelen Acked-by: Balbir Singh Signed-off-by: Jiri Kosina --- Documentation/cgroups/memory.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index f8bc802d70b..3a6aecd078b 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -340,7 +340,7 @@ Note: 5.3 swappiness Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. - Following cgroups' swapiness can't be changed. + Following cgroups' swappiness can't be changed. - root cgroup (uses /proc/sys/vm/swappiness). - a cgroup which uses hierarchy and it has child cgroup. - a cgroup which uses hierarchy and not the root of hierarchy. -- cgit v1.2.2 From 819bfecc4fc6b6e5a793f719a45b7146ce423b79 Mon Sep 17 00:00:00 2001 From: "florian@mickler.org" Date: Sat, 13 Mar 2010 13:31:05 +0100 Subject: rename new rfkill sysfs knobs This patch renames the (never officially released) sysfs-knobs "blocked_hw" and "blocked_sw" to "hard" and "soft", as the hardware vs software conotation is misleading. It also gets rid of not needed locks around u32-read-access. Signed-off-by: Florian Mickler Signed-off-by: John W. Linville --- Documentation/ABI/stable/sysfs-class-rfkill | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/stable/sysfs-class-rfkill b/Documentation/ABI/stable/sysfs-class-rfkill index b91c3f37453..097f522c33b 100644 --- a/Documentation/ABI/stable/sysfs-class-rfkill +++ b/Documentation/ABI/stable/sysfs-class-rfkill @@ -4,7 +4,7 @@ For details to this subsystem look at Documentation/rfkill.txt. For the deprecated /sys/class/rfkill/*/state and /sys/class/rfkill/*/claim knobs of this interface look in -Documentation/ABI/obsolte/sysfs-class-rfkill. +Documentation/ABI/obsolete/sysfs-class-rfkill. What: /sys/class/rfkill Date: 09-Jul-2007 @@ -42,8 +42,8 @@ Values: A numeric value. 1: true -What: /sys/class/rfkill/rfkill[0-9]+/blocked_hw -Date: 23-Feb-2010 +What: /sys/class/rfkill/rfkill[0-9]+/hard +Date: 12-March-2010 KernelVersion v2.6.34 Contact: linux-wireless@vger.kernel.org Description: Current hardblock state. This file is read only. @@ -55,8 +55,8 @@ Values: A numeric value. the driver's control. -What: /sys/class/rfkill/rfkill[0-9]+/blocked_sw -Date: 23-Feb-2010 +What: /sys/class/rfkill/rfkill[0-9]+/soft +Date: 12-March-2010 KernelVersion v2.6.34 Contact: linux-wireless@vger.kernel.org Description: Current softblock state. This file is read and write. -- cgit v1.2.2 From 4bd96a7a8185755b091233b16034c7436cbf57af Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Wed, 10 Mar 2010 14:36:10 +0800 Subject: x86, tboot: Add support for S3 memory integrity protection This patch adds support for S3 memory integrity protection within an Intel(R) TXT launched kernel, for all kernel and userspace memory. All RAM used by the kernel and userspace, as indicated by memory ranges of type E820_RAM and E820_RESERVED_KERN in the e820 table, will be integrity protected. The MAINTAINERS file is also updated to reflect the maintainers of the TXT-related code. All MACing is done in tboot, based on a complexity analysis and tradeoff. v3: Compared with v2, this patch adds a check of array size in tboot.c, and a note to specify which c/s of tboot supports this kind of MACing in intel_txt.txt. Signed-off-by: Shane Wang LKML-Reference: <4B973DDA.6050902@intel.com> Signed-off-by: Joseph Cihula Acked-by: Pavel Machek Acked-by: Rafael J. Wysocki Signed-off-by: H. Peter Anvin --- Documentation/intel_txt.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/intel_txt.txt b/Documentation/intel_txt.txt index f40a1f03001..87c8990dbbd 100644 --- a/Documentation/intel_txt.txt +++ b/Documentation/intel_txt.txt @@ -161,13 +161,15 @@ o In order to put a system into any of the sleep states after a TXT has been restored, it will restore the TPM PCRs and then transfer control back to the kernel's S3 resume vector. In order to preserve system integrity across S3, the kernel - provides tboot with a set of memory ranges (kernel - code/data/bss, S3 resume code, and AP trampoline) that tboot - will calculate a MAC (message authentication code) over and then - seal with the TPM. On resume and once the measured environment - has been re-established, tboot will re-calculate the MAC and - verify it against the sealed value. Tboot's policy determines - what happens if the verification fails. + provides tboot with a set of memory ranges (RAM and RESERVED_KERN + in the e820 table, but not any memory that BIOS might alter over + the S3 transition) that tboot will calculate a MAC (message + authentication code) over and then seal with the TPM. On resume + and once the measured environment has been re-established, tboot + will re-calculate the MAC and verify it against the sealed value. + Tboot's policy determines what happens if the verification fails. + Note that the c/s 194 of tboot which has the new MAC code supports + this. That's pretty much it for TXT support. -- cgit v1.2.2 From 14bf62cde79423a02a590e02664ed29a36facec1 Mon Sep 17 00:00:00 2001 From: Stefan Achatz Date: Thu, 18 Mar 2010 16:19:43 +0100 Subject: HID: add driver for Roccat Kone gaming mouse This Patch adds support for Kone gaming mouse from Roccat. It provides access to profiles, settings, firmware, weight, actual settings etc. through sysfs attributes. Event handling of this mouse differs from standard hid behaviour in that tilt button press is reported in each move event which results in strange behaviour if not handled by the driver. This is a heavily reworked version of the previously introduced driver. The changes include most of the previously raised concerns, memory leak and other fixes, code cleanups, adoption of additional achieved knowlege about the hardware and is (IMHO) a much better version than before even when I exchanged reduced USB-IO with a bigger memory consumption. I refused to implement one mentioned point: Removing the 'just-because-we-can' attributes. Motivation: Reading the clipped in weight: I'm no gamer and can't determine the usefulness of this feature but if the manufacturer implements such a feature it might make sense to someone and I would unwillingly limit the functionality besides its such a small feature. Reading the actual profile and dpi settings: Here I can testify that one can get lost of the actual settings when switching back and forth. The manufacturers windows driver has the ability for on-screen-display of the values and there is a mouse in the market that has an lcd on the underside of it to show these values. So I think this feature makes sense not only for me and shouldn't be removed. Signed-off-by: Stefan Achatz Signed-off-by: Jiri Kosina --- .../ABI/testing/sysfs-driver-hid-roccat-kone | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-kone (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone new file mode 100644 index 00000000000..88340a23ce9 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kone @@ -0,0 +1,111 @@ +What: /sys/bus/usb/devices/-:./actual_dpi +Date: March 2010 +Contact: Stefan Achatz +Description: It is possible to switch the dpi setting of the mouse with the + press of a button. + When read, this file returns the raw number of the actual dpi + setting reported by the mouse. This number has to be further + processed to receive the real dpi value. + + VALUE DPI + 1 800 + 2 1200 + 3 1600 + 4 2000 + 5 2400 + 6 3200 + + This file is readonly. + +What: /sys/bus/usb/devices/-:./actual_profile +Date: March 2010 +Contact: Stefan Achatz +Description: When read, this file returns the number of the actual profile. + This file is readonly. + +What: /sys/bus/usb/devices/-:./firmware_version +Date: March 2010 +Contact: Stefan Achatz +Description: When read, this file returns the raw integer version number of the + firmware reported by the mouse. Using the integer value eases + further usage in other programs. To receive the real version + number the decimal point has to be shifted 2 positions to the + left. E.g. a returned value of 138 means 1.38 + This file is readonly. + +What: /sys/bus/usb/devices/-:./kone_driver_version +Date: March 2010 +Contact: Stefan Achatz +Description: When read, this file returns the driver version. + The format of the string is "v..". + This attribute is used by the userland tools to find the sysfs- + paths of installed kone-mice and determine the capabilites of + the driver. Versions of this driver for old kernels replace + usbhid instead of generic-usb. The way to scan for this file + has been chosen to provide a consistent way for all supported + kernel versions. + This file is readonly. + +What: /sys/bus/usb/devices/-:./profile[1-5] +Date: March 2010 +Contact: Stefan Achatz +Description: The mouse can store 5 profiles which can be switched by the + press of a button. A profile holds informations like button + mappings, sensitivity, the colors of the 5 leds and light + effects. + When read, these files return the respective profile. The + returned data is 975 bytes in size. + When written, this file lets one write the respective profile + data back to the mouse. The data has to be 975 bytes long. + The mouse will reject invalid data, whereas the profile number + stored in the profile doesn't need to fit the number of the + store. + +What: /sys/bus/usb/devices/-:./settings +Date: March 2010 +Contact: Stefan Achatz +Description: When read, this file returns the settings stored in the mouse. + The size of the data is 36 bytes and holds information like the + startup_profile, tcu state and calibration_data. + When written, this file lets write settings back to the mouse. + The data has to be 36 bytes long. The mouse will reject invalid + data. + +What: /sys/bus/usb/devices/-:./startup_profile +Date: March 2010 +Contact: Stefan Achatz +Description: The integer value of this attribute ranges from 1 to 5. + When read, this attribute returns the number of the profile + that's active when the mouse is powered on. + When written, this file sets the number of the startup profile + and the mouse activates this profile immediately. + +What: /sys/bus/usb/devices/-:./tcu +Date: March 2010 +Contact: Stefan Achatz +Description: The mouse has a "Tracking Control Unit" which lets the user + calibrate the laser power to fit the mousepad surface. + When read, this file returns the current state of the TCU, + where 0 means off and 1 means on. + Writing 0 in this file will switch the TCU off. + Writing 1 in this file will start the calibration which takes + around 6 seconds to complete and activates the TCU. + +What: /sys/bus/usb/devices/-:./weight +Date: March 2010 +Contact: Stefan Achatz +Description: The mouse can be equipped with one of four supplied weights + ranging from 5 to 20 grams which are recognized by the mouse + and its value can be read out. When read, this file returns the + raw value returned by the mouse which eases further processing + in other software. + The values map to the weights as follows: + + VALUE WEIGHT + 0 none + 1 5g + 2 10g + 3 15g + 4 20g + + This file is readonly. -- cgit v1.2.2 From 92d6b71ab906be706f3679353b30a8d2c3831144 Mon Sep 17 00:00:00 2001 From: Dimitri Sivanich Date: Thu, 11 Mar 2010 14:08:56 -0800 Subject: genirq: Expose irq_desc->node in proc/irq Expose irq_desc->node as /proc/irq/*/node. This file provides device hardware locality information for apps desiring to include hardware locality in irq mapping decisions. Signed-off-by: Dimitri Sivanich Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner --- Documentation/filesystems/proc.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index a4f30faa4f1..6507d2ae523 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -566,6 +566,10 @@ The default_smp_affinity mask applies to all non-active IRQs, which are the IRQs which have not yet been allocated/activated, and hence which lack a /proc/irq/[0-9]* directory. +The node file on an SMP system shows the node to which the device using the IRQ +reports itself as being attached. This hardware locality information does not +include information about any possible driver locality preference. + prof_cpu_mask specifies which CPUs are to be profiled by the system wide profiler. Default value is ffffffff (all cpus). -- cgit v1.2.2 From 5239c4ff4ae9e810ba761518ad71b463f0ccbf3c Mon Sep 17 00:00:00 2001 From: Greg Thelen Date: Wed, 24 Mar 2010 14:48:30 -0700 Subject: cpuset: Fix documentation punctuation Fix cpusets.txt documentation punctuation. Signed-off-by: Greg Thelen Acked-by: Randy Dunlap Acked-by: Paul Menage Signed-off-by: Jiri Kosina --- Documentation/cgroups/cpusets.txt | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt index 4160df82b3f..51682ab2dd1 100644 --- a/Documentation/cgroups/cpusets.txt +++ b/Documentation/cgroups/cpusets.txt @@ -42,7 +42,7 @@ Nodes to a set of tasks. In this document "Memory Node" refers to an on-line node that contains memory. Cpusets constrain the CPU and Memory placement of tasks to only -the resources within a tasks current cpuset. They form a nested +the resources within a task's current cpuset. They form a nested hierarchy visible in a virtual file system. These are the essential hooks, beyond what is already present, required to manage dynamic job placement on large systems. @@ -53,11 +53,11 @@ Documentation/cgroups/cgroups.txt. Requests by a task, using the sched_setaffinity(2) system call to include CPUs in its CPU affinity mask, and using the mbind(2) and set_mempolicy(2) system calls to include Memory Nodes in its memory -policy, are both filtered through that tasks cpuset, filtering out any +policy, are both filtered through that task's cpuset, filtering out any CPUs or Memory Nodes not in that cpuset. The scheduler will not schedule a task on a CPU that is not allowed in its cpus_allowed vector, and the kernel page allocator will not allocate a page on a -node that is not allowed in the requesting tasks mems_allowed vector. +node that is not allowed in the requesting task's mems_allowed vector. User level code may create and destroy cpusets by name in the cgroup virtual file system, manage the attributes and permissions of these @@ -121,9 +121,9 @@ Cpusets extends these two mechanisms as follows: - Each task in the system is attached to a cpuset, via a pointer in the task structure to a reference counted cgroup structure. - Calls to sched_setaffinity are filtered to just those CPUs - allowed in that tasks cpuset. + allowed in that task's cpuset. - Calls to mbind and set_mempolicy are filtered to just - those Memory Nodes allowed in that tasks cpuset. + those Memory Nodes allowed in that task's cpuset. - The root cpuset contains all the systems CPUs and Memory Nodes. - For any cpuset, one can define child cpusets containing a subset @@ -141,11 +141,11 @@ into the rest of the kernel, none in performance critical paths: - in init/main.c, to initialize the root cpuset at system boot. - in fork and exit, to attach and detach a task from its cpuset. - in sched_setaffinity, to mask the requested CPUs by what's - allowed in that tasks cpuset. + allowed in that task's cpuset. - in sched.c migrate_live_tasks(), to keep migrating tasks within the CPUs allowed by their cpuset, if possible. - in the mbind and set_mempolicy system calls, to mask the requested - Memory Nodes by what's allowed in that tasks cpuset. + Memory Nodes by what's allowed in that task's cpuset. - in page_alloc.c, to restrict memory to allowed nodes. - in vmscan.c, to restrict page recovery to the current cpuset. @@ -155,7 +155,7 @@ new system calls are added for cpusets - all support for querying and modifying cpusets is via this cpuset file system. The /proc//status file for each task has four added lines, -displaying the tasks cpus_allowed (on which CPUs it may be scheduled) +displaying the task's cpus_allowed (on which CPUs it may be scheduled) and mems_allowed (on which Memory Nodes it may obtain memory), in the two formats seen in the following example: @@ -323,17 +323,17 @@ stack segment pages of a task. By default, both kinds of memory spreading are off, and memory pages are allocated on the node local to where the task is running, -except perhaps as modified by the tasks NUMA mempolicy or cpuset +except perhaps as modified by the task's NUMA mempolicy or cpuset configuration, so long as sufficient free memory pages are available. When new cpusets are created, they inherit the memory spread settings of their parent. Setting memory spreading causes allocations for the affected page -or slab caches to ignore the tasks NUMA mempolicy and be spread +or slab caches to ignore the task's NUMA mempolicy and be spread instead. Tasks using mbind() or set_mempolicy() calls to set NUMA mempolicies will not notice any change in these calls as a result of -their containing tasks memory spread settings. If memory spreading +their containing task's memory spread settings. If memory spreading is turned off, then the currently specified NUMA mempolicy once again applies to memory page allocations. @@ -357,7 +357,7 @@ pages from the node returned by cpuset_mem_spread_node(). The cpuset_mem_spread_node() routine is also simple. It uses the value of a per-task rotor cpuset_mem_spread_rotor to select the next -node in the current tasks mems_allowed to prefer for the allocation. +node in the current task's mems_allowed to prefer for the allocation. This memory placement policy is also known (in other contexts) as round-robin or interleave. @@ -594,7 +594,7 @@ is attached, is subtle. If a cpuset has its Memory Nodes modified, then for each task attached to that cpuset, the next time that the kernel attempts to allocate a page of memory for that task, the kernel will notice the change -in the tasks cpuset, and update its per-task memory placement to +in the task's cpuset, and update its per-task memory placement to remain within the new cpusets memory placement. If the task was using mempolicy MPOL_BIND, and the nodes to which it was bound overlap with its new cpuset, then the task will continue to use whatever subset @@ -603,13 +603,13 @@ was using MPOL_BIND and now none of its MPOL_BIND nodes are allowed in the new cpuset, then the task will be essentially treated as if it was MPOL_BIND bound to the new cpuset (even though its NUMA placement, as queried by get_mempolicy(), doesn't change). If a task is moved -from one cpuset to another, then the kernel will adjust the tasks +from one cpuset to another, then the kernel will adjust the task's memory placement, as above, the next time that the kernel attempts to allocate a page of memory for that task. If a cpuset has its 'cpuset.cpus' modified, then each task in that cpuset will have its allowed CPU placement changed immediately. Similarly, -if a tasks pid is written to another cpusets 'cpuset.tasks' file, then its +if a task's pid is written to another cpusets 'cpuset.tasks' file, then its allowed CPU placement is changed immediately. If such a task had been bound to some subset of its cpuset using the sched_setaffinity() call, the task will be allowed to run on any CPU allowed in its new cpuset, @@ -626,16 +626,16 @@ cpusets memory placement policy 'cpuset.mems' subsequently changes. If the cpuset flag file 'cpuset.memory_migrate' is set true, then when tasks are attached to that cpuset, any pages that task had allocated to it on nodes in its previous cpuset are migrated -to the tasks new cpuset. The relative placement of the page within +to the task's new cpuset. The relative placement of the page within the cpuset is preserved during these migration operations if possible. For example if the page was on the second valid node of the prior cpuset then the page will be placed on the second valid node of the new cpuset. -Also if 'cpuset.memory_migrate' is set true, then if that cpusets +Also if 'cpuset.memory_migrate' is set true, then if that cpuset's 'cpuset.mems' file is modified, pages allocated to tasks in that cpuset, that were on nodes in the previous setting of 'cpuset.mems', will be moved to nodes in the new setting of 'mems.' -Pages that were not in the tasks prior cpuset, or in the cpusets +Pages that were not in the task's prior cpuset, or in the cpuset's prior 'cpuset.mems' setting, will not be moved. There is an exception to the above. If hotplug functionality is used @@ -655,7 +655,7 @@ There is a second exception to the above. GFP_ATOMIC requests are kernel internal allocations that must be satisfied, immediately. The kernel may drop some request, in rare cases even panic, if a GFP_ATOMIC alloc fails. If the request cannot be satisfied within -the current tasks cpuset, then we relax the cpuset, and look for +the current task's cpuset, then we relax the cpuset, and look for memory anywhere we can find it. It's better to violate the cpuset than stress the kernel. -- cgit v1.2.2 From d879e19e18ebc69fc20a9b95612e9dd0acf4d7aa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 22 Mar 2010 19:39:04 +0100 Subject: netfilter: xtables: remove xt_string revision 0 Superseded by xt_string revision 1 (linux v2.6.26-rc8-1127-g4ad3f26, iptables 1.4.2-rc1). Signed-off-by: Jan Engelhardt --- Documentation/Changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/Changes b/Documentation/Changes index f08b313cd23..eca9f6e6fbe 100644 --- a/Documentation/Changes +++ b/Documentation/Changes @@ -49,7 +49,7 @@ o oprofile 0.9 # oprofiled --version o udev 081 # udevinfo -V o grub 0.93 # grub --version o mcelog 0.6 -o iptables 1.4.1 # iptables -V +o iptables 1.4.2 # iptables -V Kernel compilation -- cgit v1.2.2 From 225a9be24d799aa16d543c31fb09f0c9ed1d9caa Mon Sep 17 00:00:00 2001 From: Rajiv Andrade Date: Thu, 25 Mar 2010 00:55:32 -0300 Subject: TPM: workaround to enforce PCR updates across suspends Add a workaround for TPM's which fail to flush last written PCR values in a TPM_SaveState, in preparation for suspend. Signed-off-by: David Safford Acked-by: Rajiv Andrade Signed-off-by: James Morris --- Documentation/kernel-parameters.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index d80930d58da..e0df679c390 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -99,6 +99,7 @@ parameter is applicable: SWSUSP Software suspend (hibernation) is enabled. SUSPEND System suspend states are enabled. FTRACE Function tracing enabled. + TPM TPM drivers are enabled. TS Appropriate touchscreen support is enabled. UMS USB Mass Storage support is enabled. USB USB support is enabled. @@ -2619,6 +2620,15 @@ and is between 256 and 4096 characters. It is defined in the file tp720= [HW,PS2] + tpm_suspend_pcr=[HW,TPM] + Format: integer pcr id + Specify that at suspend time, the tpm driver + should extend the specified pcr with zeros, + as a workaround for some chips which fail to + flush the last written pcr on TPM_SaveState. + This will guarantee that all the other pcrs + are saved. + trace_buf_size=nn[KMG] [FTRACE] will set tracing buffer size. -- cgit v1.2.2 From cd508fe58b07499403e806b558c7f15c90442292 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 26 Mar 2010 10:28:46 +0100 Subject: ALSA: hda-intel - add special 'hwio' model to bypass initialization Using the 'model=hwio' option, the driver bypasses any codec initialization and the reset procedure for codecs is also bypassed. This mode is usefull to enable direct access using hwdep interface (using hdaverb or hda-analyzer tools) and retain codec setup from BIOS. Signed-off-by: Jaroslav Kysela --- Documentation/sound/alsa/HD-Audio.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation') diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index f4dd3bf99d1..ecacf53a865 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt @@ -196,6 +196,11 @@ generic parser regardless of the codec. Usually the codec-specific parser is much better than the generic parser (as now). Thus this option is more about the debugging purpose. +Another special meaning has 'model=hwio'. For this model, the driver +bypasses any codec initialization and the reset procedure for codecs +is also bypassed. This mode is usefull to enable direct access using +hwdep interface (using hdaverb or hda-analyzer tools) and retain +codec setup from BIOS. Speaker and Headphone Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.2 From 10e77ddac0e1f3b9cea04dfe8180f8641f329703 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 26 Mar 2010 11:04:38 +0100 Subject: ALSA: hda-intel - remove model=hwio , use probe_only=3 instead The probe_only module parameter skips the codec initialization, too. Remove the model=hwio code and use second bit in probe_only to skip the HDA codec reset procedure. Signed-off-by: Jaroslav Kysela --- Documentation/sound/alsa/HD-Audio.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index ecacf53a865..232a9077522 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt @@ -597,6 +597,9 @@ probing, the proc file is available, so you can get the raw codec information before modified by the driver. Of course, the driver isn't usable with `probe_only=1`. But you can continue the configuration via hwdep sysfs file if hda-reconfig option is enabled. +Using `probe_only` mask 2 skips the reset of HDA codecs (use +`probe_only=3` as module option). The hwdep interface can be used +to determine the BIOS codec initialization. hda-verb -- cgit v1.2.2 From 38f57968f45333585293e88ea12ca577811fb9a7 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 26 Mar 2010 11:14:55 +0100 Subject: ALSA: hda-intel - remove model=hwio from documentation Signed-off-by: Jaroslav Kysela --- Documentation/sound/alsa/HD-Audio.txt | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index 232a9077522..bdb220c2831 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt @@ -196,12 +196,6 @@ generic parser regardless of the codec. Usually the codec-specific parser is much better than the generic parser (as now). Thus this option is more about the debugging purpose. -Another special meaning has 'model=hwio'. For this model, the driver -bypasses any codec initialization and the reset procedure for codecs -is also bypassed. This mode is usefull to enable direct access using -hwdep interface (using hdaverb or hda-analyzer tools) and retain -codec setup from BIOS. - Speaker and Headphone Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One of the most frequent (and obvious) bugs with HD-audio is the -- cgit v1.2.2 From 4cb947b59c5835783fb96aad2f7d92b1e4250aff Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Thu, 25 Mar 2010 11:04:49 +0100 Subject: GFS2: docs update Now http://sources.redhat.com/cluster/ is redirected to http://sources.redhat.com/cluster/wiki/ Also fixed tabs in the end. Signed-off-by: Andrea Gelmini Signed-off-by: Steven Whitehouse --- Documentation/filesystems/gfs2.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/gfs2.txt b/Documentation/filesystems/gfs2.txt index 5e3ab8f3bef..0b59c020091 100644 --- a/Documentation/filesystems/gfs2.txt +++ b/Documentation/filesystems/gfs2.txt @@ -1,7 +1,7 @@ Global File System ------------------ -http://sources.redhat.com/cluster/ +http://sources.redhat.com/cluster/wiki/ GFS is a cluster file system. It allows a cluster of computers to simultaneously use a block device that is shared between them (with FC, @@ -36,11 +36,11 @@ GFS2 is not on-disk compatible with previous versions of GFS, but it is pretty close. The following man pages can be found at the URL above: - fsck.gfs2 to repair a filesystem - gfs2_grow to expand a filesystem online - gfs2_jadd to add journals to a filesystem online - gfs2_tool to manipulate, examine and tune a filesystem + fsck.gfs2 to repair a filesystem + gfs2_grow to expand a filesystem online + gfs2_jadd to add journals to a filesystem online + gfs2_tool to manipulate, examine and tune a filesystem gfs2_quota to examine and change quota values in a filesystem gfs2_convert to convert a gfs filesystem to gfs2 in-place mount.gfs2 to help mount(8) mount a filesystem - mkfs.gfs2 to make a filesystem + mkfs.gfs2 to make a filesystem -- cgit v1.2.2 From f77f13e22df4a40d237697df496152c8c37f3f2b Mon Sep 17 00:00:00 2001 From: Gilles Espinasse Date: Mon, 29 Mar 2010 15:41:47 +0200 Subject: Fix comment and Kconfig typos for 'require' and 'fragment' Signed-off-by: Gilles Espinasse Signed-off-by: Jiri Kosina --- Documentation/powerpc/dts-bindings/xilinx.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/powerpc/dts-bindings/xilinx.txt index ea68046bb9c..299d0923537 100644 --- a/Documentation/powerpc/dts-bindings/xilinx.txt +++ b/Documentation/powerpc/dts-bindings/xilinx.txt @@ -11,7 +11,7 @@ control how the core is synthesized. Historically, the EDK tool would extract the device parameters relevant to device drivers and copy them into an 'xparameters.h' in the form of #define symbols. This tells the - device drivers how the IP cores are configured, but it requres the kernel + device drivers how the IP cores are configured, but it requires the kernel to be recompiled every time the FPGA bitstream is resynthesized. The new approach is to export the parameters into the device tree and -- cgit v1.2.2 From edc7616c307ad315159a8aa050142237f524e079 Mon Sep 17 00:00:00 2001 From: Sjur Braendeland Date: Tue, 30 Mar 2010 13:56:29 +0000 Subject: net-caif: add CAIF documentation Documentation of the CAIF Protocol. Signed-off-by: Sjur Braendeland Signed-off-by: David S. Miller --- Documentation/networking/caif/Linux-CAIF.txt | 212 +++++++++++++++++++++++++++ Documentation/networking/caif/README | 109 ++++++++++++++ 2 files changed, 321 insertions(+) create mode 100644 Documentation/networking/caif/Linux-CAIF.txt create mode 100644 Documentation/networking/caif/README (limited to 'Documentation') diff --git a/Documentation/networking/caif/Linux-CAIF.txt b/Documentation/networking/caif/Linux-CAIF.txt new file mode 100644 index 00000000000..7fe7a9a33a4 --- /dev/null +++ b/Documentation/networking/caif/Linux-CAIF.txt @@ -0,0 +1,212 @@ +Linux CAIF +=========== +copyright (C) ST-Ericsson AB 2010 +Author: Sjur Brendeland/ sjur.brandeland@stericsson.com +License terms: GNU General Public License (GPL) version 2 + + +Introduction +------------ +CAIF is a MUX protocol used by ST-Ericsson cellular modems for +communication between Modem and host. The host processes can open virtual AT +channels, initiate GPRS Data connections, Video channels and Utility Channels. +The Utility Channels are general purpose pipes between modem and host. + +ST-Ericsson modems support a number of transports between modem +and host. Currently, UART and Loopback are available for Linux. + + +Architecture: +------------ +The implementation of CAIF is divided into: +* CAIF Socket Layer, Kernel API, and Net Device. +* CAIF Core Protocol Implementation +* CAIF Link Layer, implemented as NET devices. + + + RTNL + ! + ! +------+ +------+ +------+ + ! +------+! +------+! +------+! + ! ! Sock !! !Kernel!! ! Net !! + ! ! API !+ ! API !+ ! Dev !+ <- CAIF Client APIs + ! +------+ +------! +------+ + ! ! ! ! + ! +----------!----------+ + ! +------+ <- CAIF Protocol Implementation + +-------> ! CAIF ! + ! Core ! + +------+ + +--------!--------+ + ! ! + +------+ +-----+ + ! ! ! TTY ! <- Link Layer (Net Devices) + +------+ +-----+ + + +Using the Kernel API +---------------------- +The Kernel API is used for accessing CAIF channels from the +kernel. +The user of the API has to implement two callbacks for receive +and control. +The receive callback gives a CAIF packet as a SKB. The control +callback will +notify of channel initialization complete, and flow-on/flow- +off. + + + struct caif_device caif_dev = { + .caif_config = { + .name = "MYDEV" + .type = CAIF_CHTY_AT + } + .receive_cb = my_receive, + .control_cb = my_control, + }; + caif_add_device(&caif_dev); + caif_transmit(&caif_dev, skb); + +See the caif_kernel.h for details about the CAIF kernel API. + + +I M P L E M E N T A T I O N +=========================== +=========================== + +CAIF Core Protocol Layer +========================================= + +CAIF Core layer implements the CAIF protocol as defined by ST-Ericsson. +It implements the CAIF protocol stack in a layered approach, where +each layer described in the specification is implemented as a separate layer. +The architecture is inspired by the design patterns "Protocol Layer" and +"Protocol Packet". + +== CAIF structure == +The Core CAIF implementation contains: + - Simple implementation of CAIF. + - Layered architecture (a la Streams), each layer in the CAIF + specification is implemented in a separate c-file. + - Clients must implement PHY layer to access physical HW + with receive and transmit functions. + - Clients must call configuration function to add PHY layer. + - Clients must implement CAIF layer to consume/produce + CAIF payload with receive and transmit functions. + - Clients must call configuration function to add and connect the + Client layer. + - When receiving / transmitting CAIF Packets (cfpkt), ownership is passed + to the called function (except for framing layers' receive functions + or if a transmit function returns an error, in which case the caller + must free the packet). + +Layered Architecture +-------------------- +The CAIF protocol can be divided into two parts: Support functions and Protocol +Implementation. The support functions include: + + - CFPKT CAIF Packet. Implementation of CAIF Protocol Packet. The + CAIF Packet has functions for creating, destroying and adding content + and for adding/extracting header and trailers to protocol packets. + + - CFLST CAIF list implementation. + + - CFGLUE CAIF Glue. Contains OS Specifics, such as memory + allocation, endianness, etc. + +The CAIF Protocol implementation contains: + + - CFCNFG CAIF Configuration layer. Configures the CAIF Protocol + Stack and provides a Client interface for adding Link-Layer and + Driver interfaces on top of the CAIF Stack. + + - CFCTRL CAIF Control layer. Encodes and Decodes control messages + such as enumeration and channel setup. Also matches request and + response messages. + + - CFSERVL General CAIF Service Layer functionality; handles flow + control and remote shutdown requests. + + - CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual + External Interface). This layer encodes/decodes VEI frames. + + - CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP + traffic), encodes/decodes Datagram frames. + + - CFMUX CAIF Mux layer. Handles multiplexing between multiple + physical bearers and multiple channels such as VEI, Datagram, etc. + The MUX keeps track of the existing CAIF Channels and + Physical Instances and selects the apropriate instance based + on Channel-Id and Physical-ID. + + - CFFRML CAIF Framing layer. Handles Framing i.e. Frame length + and frame checksum. + + - CFSERL CAIF Serial layer. Handles concatenation/split of frames + into CAIF Frames with correct length. + + + + +---------+ + | Config | + | CFCNFG | + +---------+ + ! + +---------+ +---------+ +---------+ + | AT | | Control | | Datagram| + | CFVEIL | | CFCTRL | | CFDGML | + +---------+ +---------+ +---------+ + \_____________!______________/ + ! + +---------+ + | MUX | + | | + +---------+ + _____!_____ + / \ + +---------+ +---------+ + | CFFRML | | CFFRML | + | Framing | | Framing | + +---------+ +---------+ + ! ! + +---------+ +---------+ + | | | Serial | + | | | CFSERL | + +---------+ +---------+ + + +In this layered approach the following "rules" apply. + - All layers embed the same structure "struct cflayer" + - A layer does not depend on any other layer's private data. + - Layers are stacked by setting the pointers + layer->up , layer->dn + - In order to send data upwards, each layer should do + layer->up->receive(layer->up, packet); + - In order to send data downwards, each layer should do + layer->dn->transmit(layer->dn, packet); + + +Linux Driver Implementation +=========================== + +Linux GPRS Net Device and CAIF socket are implemented on top of the +CAIF Core protocol. The Net device and CAIF socket have an instance of +'struct cflayer', just like the CAIF Core protocol stack. +Net device and Socket implement the 'receive()' function defined by +'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and +receive of packets is handled as by the rest of the layers: the 'dn->transmit()' +function is called in order to transmit data. + +The layer on top of the CAIF Core implementation is +sometimes referred to as the "Client layer". + + +Configuration of Link Layer +--------------------------- +The Link Layer is implemented as Linux net devices (struct net_device). +Payload handling and registration is done using standard Linux mechanisms. + +The CAIF Protocol relies on a loss-less link layer without implementing +retransmission. This implies that packet drops must not happen. +Therefore a flow-control mechanism is implemented where the physical +interface can initiate flow stop for all CAIF Channels. diff --git a/Documentation/networking/caif/README b/Documentation/networking/caif/README new file mode 100644 index 00000000000..757ccfaa138 --- /dev/null +++ b/Documentation/networking/caif/README @@ -0,0 +1,109 @@ +Copyright (C) ST-Ericsson AB 2010 +Author: Sjur Brendeland/ sjur.brandeland@stericsson.com +License terms: GNU General Public License (GPL) version 2 +--------------------------------------------------------- + +=== Start === +If you have compiled CAIF for modules do: + +$modprobe crc_ccitt +$modprobe caif +$modprobe caif_socket +$modprobe chnl_net + + +=== Preparing the setup with a STE modem === + +If you are working on integration of CAIF you should make sure +that the kernel is built with module support. + +There are some things that need to be tweaked to get the host TTY correctly +set up to talk to the modem. +Since the CAIF stack is running in the kernel and we want to use the existing +TTY, we are installing our physical serial driver as a line discipline above +the TTY device. + +To achieve this we need to install the N_CAIF ldisc from user space. +The benefit is that we can hook up to any TTY. + +The use of Start-of-frame-extension (STX) must also be set as +module parameter "ser_use_stx". + +Normally Frame Checksum is always used on UART, but this is also provided as a +module parameter "ser_use_fcs". + +$ modprobe caif_serial ser_ttyname=/dev/ttyS0 ser_use_stx=yes +$ ifconfig caif_ttyS0 up + +PLEASE NOTE: There is a limitation in Android shell. + It only accepts one argument to insmod/modprobe! + +=== Trouble shooting === + +There are debugfs parameters provided for serial communication. +/sys/kernel/debug/caif_serial// + +* ser_state: Prints the bit-mask status where + - 0x02 means SENDING, this is a transient state. + - 0x10 means FLOW_OFF_SENT, i.e. the previous frame has not been sent + and is blocking further send operation. Flow OFF has been propagated + to all CAIF Channels using this TTY. + +* tty_status: Prints the bit-mask tty status information + - 0x01 - tty->warned is on. + - 0x02 - tty->low_latency is on. + - 0x04 - tty->packed is on. + - 0x08 - tty->flow_stopped is on. + - 0x10 - tty->hw_stopped is on. + - 0x20 - tty->stopped is on. + +* last_tx_msg: Binary blob Prints the last transmitted frame. + This can be printed with + $od --format=x1 /sys/kernel/debug/caif_serial//last_rx_msg. + The first two tx messages sent look like this. Note: The initial + byte 02 is start of frame extension (STX) used for re-syncing + upon errors. + + - Enumeration: + 0000000 02 05 00 00 03 01 d2 02 + | | | | | | + STX(1) | | | | + Length(2)| | | + Control Channel(1) + Command:Enumeration(1) + Link-ID(1) + Checksum(2) + - Channel Setup: + 0000000 02 07 00 00 00 21 a1 00 48 df + | | | | | | | | + STX(1) | | | | | | + Length(2)| | | | | + Control Channel(1) + Command:Channel Setup(1) + Channel Type(1) + Priority and Link-ID(1) + Endpoint(1) + Checksum(2) + +* last_rx_msg: Prints the last transmitted frame. + The RX messages for LinkSetup look almost identical but they have the + bit 0x20 set in the command bit, and Channel Setup has added one byte + before Checksum containing Channel ID. + NOTE: Several CAIF Messages might be concatenated. The maximum debug + buffer size is 128 bytes. + +== Error Scenarios: +- last_tx_msg contains channel setup message and last_rx_msg is empty -> + The host seems to be able to send over the UART, at least the CAIF ldisc get + notified that sending is completed. + +- last_tx_msg contains enumeration message and last_rx_msg is empty -> + The host is not able to send the message from UART, the tty has not been + able to complete the transmit operation. + +- if /sys/kernel/debug/caif_serial//tty_status is non-zero there + might be problems transmitting over UART. + E.g. host and modem wiring is not correct you will typically see + tty_status = 0x10 (hw_stopped) and ser_state = 0x10 (FLOW_OFF_SENT). + You will probably see the enumeration message in last_tx_message + and empty last_rx_message. -- cgit v1.2.2 From 236db47c2b3b69464d50c695ab2ddd516cf64520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= Date: Tue, 30 Mar 2010 22:33:50 +0200 Subject: HID: new driver for PicoLCD device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add basic driver for PicoLCD graphics device. Initially support keypad with input device and provide support for debugging communication via events file from debugfs. Signed-off-by: Bruno Prémont Signed-off-by: Jiri Kosina --- Documentation/ABI/testing/sysfs-driver-hid-picolcd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-picolcd (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-driver-hid-picolcd b/Documentation/ABI/testing/sysfs-driver-hid-picolcd new file mode 100644 index 00000000000..6fb4f21469f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-picolcd @@ -0,0 +1,17 @@ +What: /sys/bus/usb/devices/-:./::./operation_mode +Date: March 2010 +Contact: Bruno Prémont +Description: Make it possible to switch the PicoLCD device between LCD + (firmware) and bootloader (flasher) operation modes. + + Reading: returns list of available modes, the active mode being + enclosed in brackets ('[' and ']') + + Writing: causes operation mode switch. Permitted values are + the non-active mode names listed when read, optionally followed + by a delay value expressed in ms. + + Note: when switching mode the current PicoLCD HID device gets + disconnected and reconnects after above delay (default value + is 5 seconds though this default should not be relied on). + -- cgit v1.2.2 From b8c21cf697d165999cc21a90e6caa73690ac6190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= Date: Tue, 30 Mar 2010 22:34:30 +0200 Subject: HID: add framebuffer support to PicoLCD device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add framebuffer support to PicoLCD device with use of deferred-io. Only changed areas of framebuffer get sent to device in order to save USB bandwidth and especially resources on PicoLCD device or allow higher refresh rate for a small area. Changed tiles are determined while updating shadow framebuffer. Signed-off-by: Bruno Prémont Signed-off-by: Jiri Kosina --- Documentation/ABI/testing/sysfs-driver-hid-picolcd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-driver-hid-picolcd b/Documentation/ABI/testing/sysfs-driver-hid-picolcd index 6fb4f21469f..14f52d70621 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-picolcd +++ b/Documentation/ABI/testing/sysfs-driver-hid-picolcd @@ -15,3 +15,20 @@ Description: Make it possible to switch the PicoLCD device between LCD disconnected and reconnects after above delay (default value is 5 seconds though this default should not be relied on). + +What: /sys/bus/usb/devices/-:./::./fb_update_rate +Date: March 2010 +Contact: Bruno Prémont +Description: Make it possible to adjust defio refresh rate. + + Reading: returns list of available refresh rates (expressed in Hz), + the active refresh rate being enclosed in brackets ('[' and ']') + + Writing: accepts new refresh rate expressed in integer Hz + within permitted rates. + + Note: As device can barely do 2 complete refreshes a second + it only makes sense to adjust this value if only one or two + tiles get changed and it's not appropriate to expect the application + to flush it's tiny changes explicitely at higher than default rate. + -- cgit v1.2.2 From 25c2d55c00c6097e6792ebf21e31342f23b9b768 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Wed, 24 Mar 2010 13:17:50 +0800 Subject: sched: Remove USER_SCHED from documentation USER_SCHED has been removed, so update the documentation accordingly. Signed-off-by: Li Zefan Signed-off-by: Peter Zijlstra Acked-by: Serge E. Hallyn LKML-Reference: <4BA9A07E.8070508@cn.fujitsu.com> Signed-off-by: Ingo Molnar --- Documentation/scheduler/sched-design-CFS.txt | 54 ++-------------------------- Documentation/scheduler/sched-rt-group.txt | 20 +++-------- 2 files changed, 7 insertions(+), 67 deletions(-) (limited to 'Documentation') diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt index 6f33593e59e..8239ebbcddc 100644 --- a/Documentation/scheduler/sched-design-CFS.txt +++ b/Documentation/scheduler/sched-design-CFS.txt @@ -211,7 +211,7 @@ provide fair CPU time to each such task group. For example, it may be desirable to first provide fair CPU time to each user on the system and then to each task belonging to a user. -CONFIG_GROUP_SCHED strives to achieve exactly that. It lets tasks to be +CONFIG_CGROUP_SCHED strives to achieve exactly that. It lets tasks to be grouped and divides CPU time fairly among such groups. CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and @@ -220,38 +220,11 @@ SCHED_RR) tasks. CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and SCHED_BATCH) tasks. -At present, there are two (mutually exclusive) mechanisms to group tasks for -CPU bandwidth control purposes: - - - Based on user id (CONFIG_USER_SCHED) - - With this option, tasks are grouped according to their user id. - - - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED) - - This options needs CONFIG_CGROUPS to be defined, and lets the administrator + These options need CONFIG_CGROUPS to be defined, and let the administrator create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See Documentation/cgroups/cgroups.txt for more information about this filesystem. -Only one of these options to group tasks can be chosen and not both. - -When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new -user and a "cpu_share" file is added in that directory. - - # cd /sys/kernel/uids - # cat 512/cpu_share # Display user 512's CPU share - 1024 - # echo 2048 > 512/cpu_share # Modify user 512's CPU share - # cat 512/cpu_share # Display user 512's CPU share - 2048 - # - -CPU bandwidth between two users is divided in the ratio of their CPU shares. -For example: if you would like user "root" to get twice the bandwidth of user -"guest," then set the cpu_share for both the users such that "root"'s cpu_share -is twice "guest"'s cpu_share. - -When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each +When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each group created using the pseudo filesystem. See example steps below to create task groups and modify their CPU share using the "cgroups" pseudo filesystem. @@ -273,24 +246,3 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem. # #Launch gmplayer (or your favourite movie player) # echo > multimedia/tasks - -8. Implementation note: user namespaces - -User namespaces are intended to be hierarchical. But they are currently -only partially implemented. Each of those has ramifications for CFS. - -First, since user namespaces are hierarchical, the /sys/kernel/uids -presentation is inadequate. Eventually we will likely want to use sysfs -tagging to provide private views of /sys/kernel/uids within each user -namespace. - -Second, the hierarchical nature is intended to support completely -unprivileged use of user namespaces. So if using user groups, then -we want the users in a user namespace to be children of the user -who created it. - -That is currently unimplemented. So instead, every user in a new -user namespace will receive 1024 shares just like any user in the -initial user namespace. Note that at the moment creation of a new -user namespace requires each of CAP_SYS_ADMIN, CAP_SETUID, and -CAP_SETGID. diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt index 86eabe6c341..605b0d40329 100644 --- a/Documentation/scheduler/sched-rt-group.txt +++ b/Documentation/scheduler/sched-rt-group.txt @@ -126,23 +126,12 @@ priority! 2.3 Basis for grouping tasks ---------------------------- -There are two compile-time settings for allocating CPU bandwidth. These are -configured using the "Basis for grouping tasks" multiple choice menu under -General setup > Group CPU Scheduler: - -a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" = "user id") - -This lets you use the virtual files under -"/sys/kernel/uids//cpu_rt_runtime_us" to control he CPU time reserved for -each user . - -The other option is: - -.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups") +Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real +CPU bandwidth to task groups. This uses the /cgroup virtual file system and "/cgroup//cpu.rt_runtime_us" to control the CPU time reserved for each -control group instead. +control group. For more information on working with control groups, you should read Documentation/cgroups/cgroups.txt as well. @@ -161,8 +150,7 @@ For now, this can be simplified to just the following (but see Future plans): =============== There is work in progress to make the scheduling period for each group -("/sys/kernel/uids//cpu_rt_period_us" or -"/cgroup//cpu.rt_period_us" respectively) configurable as well. +("/cgroup//cpu.rt_period_us") configurable as well. The constraint on the period is that a subgroup must have a smaller or equal period to its parent. But realistically its not very useful _yet_ -- cgit v1.2.2 From 2b068618031a91929c21410069f872178ec00329 Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Mon, 22 Mar 2010 09:17:39 -0700 Subject: iwlwifi: merge module parameters into single place Module parameters used to be defined in both iwl-5000.c and iwl-4965.c, after the code re-structure, merge into iwl-agn.c for easy to read and maintenance. Number of module parameters are deprecated after this merge. These are also scheduled for removal by 2.6.40. The current supported parameters are: parm: debug50:50XX debug output mask (deprecated) (uint) parm: debug:debug output mask (uint) parm: swcrypto50:using crypto in software (default 0 [hardware]) (deprecated) (bool) parm: swcrypto:using crypto in software (default 0 [hardware]) (int) parm: queues_num50:number of hw queues in 50xx series (deprecated) (int) parm: queues_num:number of hw queues. (int) parm: 11n_disable50:disable 50XX 11n functionality (deprecated) (int) parm: 11n_disable:disable 11n functionality (int) parm: amsdu_size_8K50:enable 8K amsdu size in 50XX series (deprecated) (int) parm: amsdu_size_8K:enable 8K amsdu size (int) parm: fw_restart50:restart firmware in case of error (deprecated) (int) parm: fw_restart:restart firmware in case of error (int) parm: disable_hw_scan:disable hardware scanning (default 0) (int) Remove "antenna" module parameter, it is not being used in "agn" driver. Signed-off-by: Wey-Yi Guy Signed-off-by: Reinette Chatre --- Documentation/feature-removal-schedule.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index a841e79dfac..4e78611c526 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -545,3 +545,14 @@ Why: udev fully replaces this special file system that only contains CAPI NCCI TTY device nodes. User space (pppdcapiplugin) works without noticing the difference. Who: Jan Kiszka + +---------------------------- + +What: iwlwifi 50XX module parameters +When: 2.6.40 +Why: The "..50" modules parameters were used to configure 5000 series and + up devices; different set of module parameters also available for 4965 + with same functionalities. Consolidate both set into single place + in drivers/net/wireless/iwlwifi/iwl-agn.c + +Who: Wey-Yi Guy -- cgit v1.2.2 From d34a5a62da12ffa53b91895d094960b35474f2fc Mon Sep 17 00:00:00 2001 From: Wey-Yi Guy Date: Tue, 23 Mar 2010 10:17:03 -0700 Subject: iwlwifi: deprecate "iwl4965" alias support Internal alias support has been present in module-init-tools for some time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed. Signed-off-by: Wey-Yi Guy Signed-off-by: Reinette Chatre --- Documentation/feature-removal-schedule.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 4e78611c526..d46944f9de5 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -556,3 +556,15 @@ Why: The "..50" modules parameters were used to configure 5000 series and in drivers/net/wireless/iwlwifi/iwl-agn.c Who: Wey-Yi Guy + +---------------------------- + +What: iwl4965 alias support +When: 2.6.40 +Why: Internal alias support has been present in module-init-tools for some + time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed + with no impact. + +Who: Wey-Yi Guy + +---------------------------- -- cgit v1.2.2 From 2f77a3f50c4336dd5358aec0abb5247ded168515 Mon Sep 17 00:00:00 2001 From: James Chapman Date: Fri, 2 Apr 2010 06:19:46 +0000 Subject: l2tp: Update documentation This patch adds documentation about the L2TPv3 functionality. Signed-off-by: James Chapman Reviewed-by: Randy Dunlap Signed-off-by: David S. Miller --- Documentation/networking/l2tp.txt | 247 ++++++++++++++++++++++++++++++++------ 1 file changed, 213 insertions(+), 34 deletions(-) (limited to 'Documentation') diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.txt index 63214b280e0..e7bf3979fac 100644 --- a/Documentation/networking/l2tp.txt +++ b/Documentation/networking/l2tp.txt @@ -1,44 +1,95 @@ -This brief document describes how to use the kernel's PPPoL2TP driver -to provide L2TP functionality. L2TP is a protocol that tunnels one or -more PPP sessions over a UDP tunnel. It is commonly used for VPNs +This document describes how to use the kernel's L2TP drivers to +provide L2TP functionality. L2TP is a protocol that tunnels one or +more sessions over an IP tunnel. It is commonly used for VPNs (L2TP/IPSec) and by ISPs to tunnel subscriber PPP sessions over an IP -network infrastructure. +network infrastructure. With L2TPv3, it is also useful as a Layer-2 +tunneling infrastructure. + +Features +======== + +L2TPv2 (PPP over L2TP (UDP tunnels)). +L2TPv3 ethernet pseudowires. +L2TPv3 PPP pseudowires. +L2TPv3 IP encapsulation. +Netlink sockets for L2TPv3 configuration management. + +History +======= + +The original pppol2tp driver was introduced in 2.6.23 and provided +L2TPv2 functionality (rfc2661). L2TPv2 is used to tunnel one or more PPP +sessions over a UDP tunnel. + +L2TPv3 (rfc3931) changes the protocol to allow different frame types +to be passed over an L2TP tunnel by moving the PPP-specific parts of +the protocol out of the core L2TP packet headers. Each frame type is +known as a pseudowire type. Ethernet, PPP, HDLC, Frame Relay and ATM +pseudowires for L2TP are defined in separate RFC standards. Another +change for L2TPv3 is that it can be carried directly over IP with no +UDP header (UDP is optional). It is also possible to create static +unmanaged L2TPv3 tunnels manually without a control protocol +(userspace daemon) to manage them. + +To support L2TPv3, the original pppol2tp driver was split up to +separate the L2TP and PPP functionality. Existing L2TPv2 userspace +apps should be unaffected as the original pppol2tp sockets API is +retained. L2TPv3, however, uses netlink to manage L2TPv3 tunnels and +sessions. Design ====== -The PPPoL2TP driver, drivers/net/pppol2tp.c, provides a mechanism by -which PPP frames carried through an L2TP session are passed through -the kernel's PPP subsystem. The standard PPP daemon, pppd, handles all -PPP interaction with the peer. PPP network interfaces are created for -each local PPP endpoint. - -The L2TP protocol http://www.faqs.org/rfcs/rfc2661.html defines L2TP -control and data frames. L2TP control frames carry messages between -L2TP clients/servers and are used to setup / teardown tunnels and -sessions. An L2TP client or server is implemented in userspace and -will use a regular UDP socket per tunnel. L2TP data frames carry PPP -frames, which may be PPP control or PPP data. The kernel's PPP +The L2TP protocol separates control and data frames. The L2TP kernel +drivers handle only L2TP data frames; control frames are always +handled by userspace. L2TP control frames carry messages between L2TP +clients/servers and are used to setup / teardown tunnels and +sessions. An L2TP client or server is implemented in userspace. + +Each L2TP tunnel is implemented using a UDP or L2TPIP socket; L2TPIP +provides L2TPv3 IP encapsulation (no UDP) and is implemented using a +new l2tpip socket family. The tunnel socket is typically created by +userspace, though for unmanaged L2TPv3 tunnels, the socket can also be +created by the kernel. Each L2TP session (pseudowire) gets a network +interface instance. In the case of PPP, these interfaces are created +indirectly by pppd using a pppol2tp socket. In the case of ethernet, +the netdevice is created upon a netlink request to create an L2TPv3 +ethernet pseudowire. + +For PPP, the PPPoL2TP driver, net/l2tp/l2tp_ppp.c, provides a +mechanism by which PPP frames carried through an L2TP session are +passed through the kernel's PPP subsystem. The standard PPP daemon, +pppd, handles all PPP interaction with the peer. PPP network +interfaces are created for each local PPP endpoint. The kernel's PPP subsystem arranges for PPP control frames to be delivered to pppd, while data frames are forwarded as usual. +For ethernet, the L2TPETH driver, net/l2tp/l2tp_eth.c, implements a +netdevice driver, managing virtual ethernet devices, one per +pseudowire. These interfaces can be managed using standard Linux tools +such as "ip" and "ifconfig". If only IP frames are passed over the +tunnel, the interface can be given an IP addresses of itself and its +peer. If non-IP frames are to be passed over the tunnel, the interface +can be added to a bridge using brctl. All L2TP datapath protocol +functions are handled by the L2TP core driver. + Each tunnel and session within a tunnel is assigned a unique tunnel_id and session_id. These ids are carried in the L2TP header of every -control and data packet. The pppol2tp driver uses them to lookup -internal tunnel and/or session contexts. Zero tunnel / session ids are -treated specially - zero ids are never assigned to tunnels or sessions -in the network. In the driver, the tunnel context keeps a pointer to -the tunnel UDP socket. The session context keeps a pointer to the -PPPoL2TP socket, as well as other data that lets the driver interface -to the kernel PPP subsystem. - -Note that the pppol2tp kernel driver handles only L2TP data frames; -L2TP control frames are simply passed up to userspace in the UDP -tunnel socket. The kernel handles all datapath aspects of the -protocol, including data packet resequencing (if enabled). - -There are a number of requirements on the userspace L2TP daemon in -order to use the pppol2tp driver. +control and data packet. (Actually, in L2TPv3, the tunnel_id isn't +present in data frames - it is inferred from the IP connection on +which the packet was received.) The L2TP driver uses the ids to lookup +internal tunnel and/or session contexts to determine how to handle the +packet. Zero tunnel / session ids are treated specially - zero ids are +never assigned to tunnels or sessions in the network. In the driver, +the tunnel context keeps a reference to the tunnel UDP or L2TPIP +socket. The session context holds data that lets the driver interface +to the kernel's network frame type subsystems, i.e. PPP, ethernet. + +Userspace Programming +===================== + +For L2TPv2, there are a number of requirements on the userspace L2TP +daemon in order to use the pppol2tp driver. 1. Use a UDP socket per tunnel. @@ -86,6 +137,35 @@ In addition to the standard PPP ioctls, a PPPIOCGL2TPSTATS is provided to retrieve tunnel and session statistics from the kernel using the PPPoX socket of the appropriate tunnel or session. +For L2TPv3, userspace must use the netlink API defined in +include/linux/l2tp.h to manage tunnel and session contexts. The +general procedure to create a new L2TP tunnel with one session is:- + +1. Open a GENL socket using L2TP_GENL_NAME for configuring the kernel + using netlink. + +2. Create a UDP or L2TPIP socket for the tunnel. + +3. Create a new L2TP tunnel using a L2TP_CMD_TUNNEL_CREATE + request. Set attributes according to desired tunnel parameters, + referencing the UDP or L2TPIP socket created in the previous step. + +4. Create a new L2TP session in the tunnel using a + L2TP_CMD_SESSION_CREATE request. + +The tunnel and all of its sessions are closed when the tunnel socket +is closed. The netlink API may also be used to delete sessions and +tunnels. Configuration and status info may be set or read using netlink. + +The L2TP driver also supports static (unmanaged) L2TPv3 tunnels. These +are where there is no L2TP control message exchange with the peer to +setup the tunnel; the tunnel is configured manually at each end of the +tunnel. There is no need for an L2TP userspace application in this +case -- the tunnel socket is created by the kernel and configured +using parameters sent in the L2TP_CMD_TUNNEL_CREATE netlink +request. The "ip" utility of iproute2 has commands for managing static +L2TPv3 tunnels; do "ip l2tp help" for more information. + Debugging ========= @@ -102,6 +182,69 @@ PPPOL2TP_MSG_CONTROL userspace - kernel interface PPPOL2TP_MSG_SEQ sequence numbers handling PPPOL2TP_MSG_DATA data packets +If enabled, files under a l2tp debugfs directory can be used to dump +kernel state about L2TP tunnels and sessions. To access it, the +debugfs filesystem must first be mounted. + +# mount -t debugfs debugfs /debug + +Files under the l2tp directory can then be accessed. + +# cat /debug/l2tp/tunnels + +The debugfs files should not be used by applications to obtain L2TP +state information because the file format is subject to change. It is +implemented to provide extra debug information to help diagnose +problems.) Users should use the netlink API. + +/proc/net/pppol2tp is also provided for backwards compaibility with +the original pppol2tp driver. It lists information about L2TPv2 +tunnels and sessions only. Its use is discouraged. + +Unmanaged L2TPv3 Tunnels +======================== + +Some commercial L2TP products support unmanaged L2TPv3 ethernet +tunnels, where there is no L2TP control protocol; tunnels are +configured at each side manually. New commands are available in +iproute2's ip utility to support this. + +To create an L2TPv3 ethernet pseudowire between local host 192.168.1.1 +and peer 192.168.1.2, using IP addresses 10.5.1.1 and 10.5.1.2 for the +tunnel endpoints:- + +# modprobe l2tp_eth +# modprobe l2tp_netlink + +# ip l2tp add tunnel tunnel_id 1 peer_tunnel_id 1 udp_sport 5000 \ + udp_dport 5000 encap udp local 192.168.1.1 remote 192.168.1.2 +# ip l2tp add session tunnel_id 1 session_id 1 peer_session_id 1 +# ifconfig -a +# ip addr add 10.5.1.2/32 peer 10.5.1.1/32 dev l2tpeth0 +# ifconfig l2tpeth0 up + +Choose IP addresses to be the address of a local IP interface and that +of the remote system. The IP addresses of the l2tpeth0 interface can be +anything suitable. + +Repeat the above at the peer, with ports, tunnel/session ids and IP +addresses reversed. The tunnel and session IDs can be any non-zero +32-bit number, but the values must be reversed at the peer. + +Host 1 Host2 +udp_sport=5000 udp_sport=5001 +udp_dport=5001 udp_dport=5000 +tunnel_id=42 tunnel_id=45 +peer_tunnel_id=45 peer_tunnel_id=42 +session_id=128 session_id=5196755 +peer_session_id=5196755 peer_session_id=128 + +When done at both ends of the tunnel, it should be possible to send +data over the network. e.g. + +# ping 10.5.1.1 + + Sample Userspace Code ===================== @@ -158,12 +301,48 @@ Sample Userspace Code } return 0; +Internal Implementation +======================= + +The driver keeps a struct l2tp_tunnel context per L2TP tunnel and a +struct l2tp_session context for each session. The l2tp_tunnel is +always associated with a UDP or L2TP/IP socket and keeps a list of +sessions in the tunnel. The l2tp_session context keeps kernel state +about the session. It has private data which is used for data specific +to the session type. With L2TPv2, the session always carried PPP +traffic. With L2TPv3, the session can also carry ethernet frames +(ethernet pseudowire) or other data types such as ATM, HDLC or Frame +Relay. + +When a tunnel is first opened, the reference count on the socket is +increased using sock_hold(). This ensures that the kernel socket +cannot be removed while L2TP's data structures reference it. + +Some L2TP sessions also have a socket (PPP pseudowires) while others +do not (ethernet pseudowires). We can't use the socket reference count +as the reference count for session contexts. The L2TP implementation +therefore has its own internal reference counts on the session +contexts. + +To Do +===== + +Add L2TP tunnel switching support. This would route tunneled traffic +from one L2TP tunnel into another. Specified in +http://tools.ietf.org/html/draft-ietf-l2tpext-tunnel-switching-08 + +Add L2TPv3 VLAN pseudowire support. + +Add L2TPv3 IP pseudowire support. + +Add L2TPv3 ATM pseudowire support. + Miscellaneous -============ +============= -The PPPoL2TP driver was developed as part of the OpenL2TP project by +The L2TP drivers were developed as part of the OpenL2TP project by Katalix Systems Ltd. OpenL2TP is a full-featured L2TP client / server, designed from the ground up to have the L2TP datapath in the kernel. The project also implemented the pppol2tp plugin for pppd which allows pppd to use the kernel driver. Details can be found at -http://openl2tp.sourceforge.net. +http://www.openl2tp.org. -- cgit v1.2.2 From 84c124da9ff50bd71fab9c939ee5b7cd8bef2bd9 Mon Sep 17 00:00:00 2001 From: Divyesh Shah Date: Fri, 9 Apr 2010 08:31:19 +0200 Subject: blkio: Changes to IO controller additional stats patches that include some minor fixes and addresses all comments. Changelog: (most based on Vivek Goyal's comments) o renamed blkiocg_reset_write to blkiocg_reset_stats o more clarification in the documentation on io_service_time and io_wait_time o Initialize blkg->stats_lock o rename io_add_stat to blkio_add_stat and declare it static o use bool for direction and sync o derive direction and sync info from existing rq methods o use 12 for major:minor string length o define io_service_time better to cover the NCQ case o add a separate reset_stats interface o make the indexed stats a 2d array to simplify macro and function pointer code o blkio.time now exports in jiffies as before o Added stats description in patch description and Documentation/cgroup/blkio-controller.txt o Prefix all stats functions with blkio and make them static as applicable o replace IO_TYPE_MAX with IO_TYPE_TOTAL o Moved #define constant to top of blk-cgroup.c o Pass dev_t around instead of char * o Add note to documentation file about resetting stats o use BLK_CGROUP_MODULE in addition to BLK_CGROUP config option in #ifdef statements o Avoid struct request specific knowledge in blk-cgroup. blk-cgroup.h now has rq_direction() and rq_sync() functions which are used by CFQ and when using io-controller at a higher level, bio_* functions can be added. Signed-off-by: Divyesh Shah Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 48 +++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index 630879cd9a4..ed04fe9cce1 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -77,7 +77,6 @@ Details of cgroup files ======================= - blkio.weight - Specifies per cgroup weight. - Currently allowed range of weights is from 100 to 1000. - blkio.time @@ -92,6 +91,49 @@ Details of cgroup files third field specifies the number of sectors transferred by the group to/from the device. +- blkio.io_service_bytes + - Number of bytes transferred to/from the disk by the group. These + are further divided by the type of operation - read or write, sync + or async. First two fields specify the major and minor number of the + device, third field specifies the operation type and the fourth field + specifies the number of bytes. + +- blkio.io_serviced + - Number of IOs completed to/from the disk by the group. These + are further divided by the type of operation - read or write, sync + or async. First two fields specify the major and minor number of the + device, third field specifies the operation type and the fourth field + specifies the number of IOs. + +- blkio.io_service_time + - Total amount of time between request dispatch and request completion + for the IOs done by this cgroup. This is in nanoseconds to make it + meaningful for flash devices too. For devices with queue depth of 1, + this time represents the actual service time. When queue_depth > 1, + that is no longer true as requests may be served out of order. This + may cause the service time for a given IO to include the service time + of multiple IOs when served out of order which may result in total + io_service_time > actual time elapsed. This time is further divided by + the type of operation - read or write, sync or async. First two fields + specify the major and minor number of the device, third field + specifies the operation type and the fourth field specifies the + io_service_time in ns. + +- blkio.io_wait_time + - Total amount of time the IOs for this cgroup spent waiting in the + scheduler queues for service. This can be greater than the total time + elapsed since it is cumulative io_wait_time for all IOs. It is not a + measure of total time the cgroup spent waiting but rather a measure of + the wait_time for its individual IOs. For devices with queue_depth > 1 + this metric does not include the time spent waiting for service once + the IO is dispatched to the device but till it actually gets serviced + (there might be a time lag here due to re-ordering of requests by the + device). This is in nanoseconds to make it meaningful for flash + devices too. This time is further divided by the type of operation - + read or write, sync or async. First two fields specify the major and + minor number of the device, third field specifies the operation type + and the fourth field specifies the io_wait_time in ns. + - blkio.dequeue - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This gives the statistics about how many a times a group was dequeued @@ -99,6 +141,10 @@ Details of cgroup files and minor number of the device and third field specifies the number of times a group was dequeued from a particular device. +- blkio.reset_stats + - Writing an int to this file will result in resetting all the stats + for that cgroup. + CFQ sysfs tunable ================= /sys/block//queue/iosched/group_isolation -- cgit v1.2.2 From 812d402648f4fc1ab1091b2172a46fc1b367c724 Mon Sep 17 00:00:00 2001 From: Divyesh Shah Date: Thu, 8 Apr 2010 21:14:23 -0700 Subject: blkio: Add io_merged stat This includes both the number of bios merged into requests belonging to this cgroup as well as the number of requests merged together. In the past, we've observed different merging behavior across upstream kernels, some by design some actual bugs. This stat helps a lot in debugging such problems when applications report decreased throughput with a new kernel version. This needed adding an extra elevator function to capture bios being merged as I did not want to pollute elevator code with blkiocg knowledge and hence needed the accounting invocation to come from CFQ. Signed-off-by: Divyesh Shah Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index ed04fe9cce1..810e30171a5 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -134,6 +134,11 @@ Details of cgroup files minor number of the device, third field specifies the operation type and the fourth field specifies the io_wait_time in ns. +- blkio.io_merged + - Total number of bios/requests merged into requests belonging to this + cgroup. This is further divided by the type of operation - read or + write, sync or async. + - blkio.dequeue - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This gives the statistics about how many a times a group was dequeued -- cgit v1.2.2 From cdc1184cf4a7bd99f5473a91244197accc49146b Mon Sep 17 00:00:00 2001 From: Divyesh Shah Date: Thu, 8 Apr 2010 21:15:10 -0700 Subject: blkio: Add io_queued and avg_queue_size stats These stats are useful for getting a feel for the queue depth of the cgroup, i.e., how filled up its queues are at a given instant and over the existence of the cgroup. This ability is useful when debugging problems in the wild as it helps understand the application's IO pattern w/o having to read through the userspace code (coz its tedious or just not available) or w/o the ability to run blktrace (since you may not have root access and/or not want to disturb performance). Signed-off-by: Divyesh Shah Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index 810e30171a5..6e52e7c512a 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -139,6 +139,17 @@ Details of cgroup files cgroup. This is further divided by the type of operation - read or write, sync or async. +- blkio.io_queued + - Total number of requests queued up at any given instant for this + cgroup. This is further divided by the type of operation - read or + write, sync or async. + +- blkio.avg_queue_size + - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + The average queue size for this cgroup over the entire time of this + cgroup's existence. Queue size samples are taken each time one of the + queues of this cgroup gets a timeslice. + - blkio.dequeue - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This gives the statistics about how many a times a group was dequeued -- cgit v1.2.2 From 812df48d127365ffd0869aa139738f572a86759c Mon Sep 17 00:00:00 2001 From: Divyesh Shah Date: Thu, 8 Apr 2010 21:15:35 -0700 Subject: blkio: Add more debug-only per-cgroup stats 1) group_wait_time - This is the amount of time the cgroup had to wait to get a timeslice for one of its queues from when it became busy, i.e., went from 0 to 1 request queued. This is different from the io_wait_time which is the cumulative total of the amount of time spent by each IO in that cgroup waiting in the scheduler queue. This stat is a great way to find out any jobs in the fleet that are being starved or waiting for longer than what is expected (due to an IO controller bug or any other issue). 2) empty_time - This is the amount of time a cgroup spends w/o any pending requests. This stat is useful when a job does not seem to be able to use its assigned disk share by helping check if that is happening due to an IO controller bug or because the job is not submitting enough IOs. 3) idle_time - This is the amount of time spent by the IO scheduler idling for a given cgroup in anticipation of a better request than the exising ones from other queues/cgroups. All these stats are recorded using start and stop events. When reading these stats, we do not add the delta between the current time and the last start time if we're between the start and stop events. We avoid doing this to make sure that these numbers are always monotonically increasing when read. Since we're using sched_clock() which may use the tsc as its source, it may induce some inconsistency (due to tsc resync across cpus) if we included the current delta. Signed-off-by: Divyesh Shah Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index 6e52e7c512a..db054ea3e7f 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -150,6 +150,35 @@ Details of cgroup files cgroup's existence. Queue size samples are taken each time one of the queues of this cgroup gets a timeslice. +- blkio.group_wait_time + - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + This is the amount of time the cgroup had to wait since it became busy + (i.e., went from 0 to 1 request queued) to get a timeslice for one of + its queues. This is different from the io_wait_time which is the + cumulative total of the amount of time spent by each IO in that cgroup + waiting in the scheduler queue. This is in nanoseconds. If this is + read when the cgroup is in a waiting (for timeslice) state, the stat + will only report the group_wait_time accumulated till the last time it + got a timeslice and will not include the current delta. + +- blkio.empty_time + - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + This is the amount of time a cgroup spends without any pending + requests when not being served, i.e., it does not include any time + spent idling for one of the queues of the cgroup. This is in + nanoseconds. If this is read when the cgroup is in an empty state, + the stat will only report the empty_time accumulated till the last + time it had a pending request and will not include the current delta. + +- blkio.idle_time + - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + This is the amount of time spent by the IO scheduler idling for a + given cgroup in anticipation of a better request than the exising ones + from other queues/cgroups. This is in nanoseconds. If this is read + when the cgroup is in an idling state, the stat will only report the + idle_time accumulated till the last idle period and will not include + the current delta. + - blkio.dequeue - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This gives the statistics about how many a times a group was dequeued -- cgit v1.2.2 From da69da184c06f365b335a0e013dc6360a82abe85 Mon Sep 17 00:00:00 2001 From: Gui Jianfeng Date: Tue, 13 Apr 2010 16:07:50 +0800 Subject: io-controller: Document for blkio.weight_device Here is the document for blkio.weight_device Signed-off-by: Gui Jianfeng Acked-by: Vivek Goyal Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 31 +++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index db054ea3e7f..d422b410a99 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -76,9 +76,38 @@ CONFIG_DEBUG_BLK_CGROUP Details of cgroup files ======================= - blkio.weight - - Specifies per cgroup weight. + - Specifies per cgroup weight. This is default weight of the group + on all the devices until and unless overridden by per device rule. + (See blkio.weight_device). Currently allowed range of weights is from 100 to 1000. +- blkio.weight_device + - One can specify per cgroup per device rules using this interface. + These rules override the default value of group weight as specified + by blkio.weight. + + Following is the format. + + #echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device + Configure weight=300 on /dev/sdb (8:16) in this cgroup + # echo 8:16 300 > blkio.weight_device + # cat blkio.weight_device + dev weight + 8:16 300 + + Configure weight=500 on /dev/sda (8:0) in this cgroup + # echo 8:0 500 > blkio.weight_device + # cat blkio.weight_device + dev weight + 8:0 500 + 8:16 300 + + Remove specific weight for /dev/sda in this cgroup + # echo 8:0 0 > blkio.weight_device + # cat blkio.weight_device + dev weight + 8:16 300 + - blkio.time - disk time allocated to cgroup per device in milliseconds. First two fields specify the major and minor number of the device and -- cgit v1.2.2 From c56a3b18475b0f93b484c25162c1379f5aee367a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 13 Apr 2010 12:55:09 +0200 Subject: ALSA: Update the documentation for changes of proc files Signed-off-by: Takashi Iwai --- Documentation/DocBook/writing-an-alsa-driver.tmpl | 27 ++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl index 0d0f7b4d4b1..0ba149de260 100644 --- a/Documentation/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl @@ -5518,34 +5518,41 @@ struct _snd_pcm_runtime { ]]> + + For the raw data, size field must be + set properly. This specifies the maximum size of the proc file access. - The callback is much more complicated than the text-file - version. You need to use a low-level I/O functions such as + The read/write callbacks of raw mode are more direct than the text mode. + You need to use a low-level I/O functions such as copy_from/to_user() to transfer the data. local_max_size) - size = local_max_size - pos; - if (copy_to_user(buf, local_data + pos, size)) + if (copy_to_user(buf, local_data + pos, count)) return -EFAULT; - return size; + return count; } ]]> + + If the size of the info entry has been set up properly, + count and pos are + guaranteed to fit within 0 and the given size. + You don't have to check the range in the callbacks unless any + other condition is required. + -- cgit v1.2.2 From 6932bf37bed45ce8ed531928b1b0f98162fe6df6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 26 Mar 2010 00:06:55 +0000 Subject: genirq: Remove IRQF_DISABLED from core code Remove all code which is related to IRQF_DISABLED from the core kernel code. IRQF_DISABLED still exists as a flag, but becomes a NOOP and will be removed after a grace period. That way we can easily revert to the previous behaviour by just restoring the core code. Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Alan Cox Cc: Andi Kleen Cc: David Miller Cc: Greg Kroah-Hartman Cc: Arnaldo Carvalho de Melo Cc: Linus Torvalds LKML-Reference: <20100326000405.991244690@linutronix.de> --- Documentation/feature-removal-schedule.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index ed511af0f79..9c31c2e6368 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -589,3 +589,10 @@ Why: Useful in 2003, implementation is a hack. Generally invoked by accident today. Seen as doing more harm than good. Who: Len Brown + +---------------------------- + +What: IRQF_DISABLED +When: 2.6.36 +Why: The flag is a NOOP as we run interrupt handlers with interrupts disabled +Who: Thomas Gleixner -- cgit v1.2.2 From fc0c195aa8877fd46d837c8c4a9a61386a124401 Mon Sep 17 00:00:00 2001 From: viresh kumar Date: Thu, 1 Apr 2010 12:31:21 +0100 Subject: ARM: 6018/1: ST SPEAr: Updated Maintainers and added Documentation/arm/SPEAr Reviewed-by: Linus Walleij Signed-off-by: Viresh Kumar Signed-off-by: Russell King --- Documentation/arm/00-INDEX | 2 ++ Documentation/arm/SPEAr/overview.txt | 60 ++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Documentation/arm/SPEAr/overview.txt (limited to 'Documentation') diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index 82e418d648d..7f5fc3ba9c9 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX @@ -20,6 +20,8 @@ Samsung-S3C24XX - S3C24XX ARM Linux Overview Sharp-LH - Linux on Sharp LH79524 and LH7A40X System On a Chip (SOC) +SPEAr + - ST SPEAr platform Linux Overview VFP/ - Release notes for Linux Kernel Vector Floating Point support code empeg/ diff --git a/Documentation/arm/SPEAr/overview.txt b/Documentation/arm/SPEAr/overview.txt new file mode 100644 index 00000000000..253a35c6f78 --- /dev/null +++ b/Documentation/arm/SPEAr/overview.txt @@ -0,0 +1,60 @@ + SPEAr ARM Linux Overview + ========================== + +Introduction +------------ + + SPEAr (Structured Processor Enhanced Architecture). + weblink : http://www.st.com/spear + + The ST Microelectronics SPEAr range of ARM9/CortexA9 System-on-Chip CPUs are + supported by the 'spear' platform of ARM Linux. Currently SPEAr300, + SPEAr310, SPEAr320 and SPEAr600 SOCs are supported. Support for the SPEAr13XX + series is in progress. + + Hierarchy in SPEAr is as follows: + + SPEAr (Platform) + - SPEAr3XX (3XX SOC series, based on ARM9) + - SPEAr300 (SOC) + - SPEAr300_EVB (Evaluation Board) + - SPEAr310 (SOC) + - SPEAr310_EVB (Evaluation Board) + - SPEAr320 (SOC) + - SPEAr320_EVB (Evaluation Board) + - SPEAr6XX (6XX SOC series, based on ARM9) + - SPEAr600 (SOC) + - SPEAr600_EVB (Evaluation Board) + - SPEAr13XX (13XX SOC series, based on ARM CORTEXA9) + - SPEAr1300 (SOC) + + Configuration + ------------- + + A generic configuration is provided for each machine, and can be used as the + default by + make spear600_defconfig + make spear300_defconfig + make spear310_defconfig + make spear320_defconfig + + Layout + ------ + + The common files for multiple machine families (SPEAr3XX, SPEAr6XX and + SPEAr13XX) are located in the platform code contained in arch/arm/plat-spear + with headers in plat/. + + Each machine series have a directory with name arch/arm/mach-spear followed by + series name. Like mach-spear3xx, mach-spear6xx and mach-spear13xx. + + Common file for machines of spear3xx family is mach-spear3xx/spear3xx.c and for + spear6xx is mach-spear6xx/spear6xx.c. mach-spear* also contain soc/machine + specific files, like spear300.c, spear310.c, spear320.c and spear600.c. + mach-spear* also contains board specific files for each machine type. + + + Document Author + --------------- + + Viresh Kumar, (c) 2010 ST Microelectronics -- cgit v1.2.2 From 93ccae7a2227466a0d071fe52c51319f2f34c365 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Mon, 12 Apr 2010 13:17:08 -0400 Subject: tracing/kprobes: Support basic types on dynamic events Support basic types of integer (u8, u16, u32, u64, s8, s16, s32, s64) in kprobe tracer. With this patch, users can specify above basic types on each arguments after ':'. If omitted, the argument type is set as unsigned long (u32 or u64, arch-dependent). e.g. echo 'p account_system_time+0 hardirq_offset=%si:s32' > kprobe_events adds a probe recording hardirq_offset in signed-32bits value on the entry of account_system_time. Cc: Ingo Molnar Cc: Steven Rostedt Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Frederic Weisbecker LKML-Reference: <20100412171708.3790.18599.stgit@localhost6.localdomain6> Signed-off-by: Masami Hiramatsu Signed-off-by: Arnaldo Carvalho de Melo --- Documentation/trace/kprobetrace.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt index a9100b28eb8..ec94748ae65 100644 --- a/Documentation/trace/kprobetrace.txt +++ b/Documentation/trace/kprobetrace.txt @@ -40,7 +40,9 @@ Synopsis of kprobe_events $stack : Fetch stack address. $retval : Fetch return value.(*) +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**) - NAME=FETCHARG: Set NAME as the argument name of FETCHARG. + NAME=FETCHARG : Set NAME as the argument name of FETCHARG. + FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types + (u8/u16/u32/u64/s8/s16/s32/s64) are supported. (*) only for return probe. (**) this is useful for fetching a field of data structures. -- cgit v1.2.2 From aa2110cb1a7510f9b834adfb39b05d4843a35d35 Mon Sep 17 00:00:00 2001 From: Lin Ming Date: Thu, 8 Apr 2010 14:34:27 +0800 Subject: ACPI: add boot option acpi=copy_dsdt to fix corrupt DSDT Some BIOS on Toshiba machines corrupt the DSDT, so add a new boot option acpi=copy_dsdt to workaround it. Add warning message to ask users to use this option if corrupt DSDT detected. Also build a DMI blacklist to check it and automatically copy DSDT. https://bugzilla.kernel.org/show_bug.cgi?id=14679 Signed-off-by: Lin Ming Signed-off-by: Len Brown --- Documentation/kernel-parameters.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e2202e93b14..93f113a1b32 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -151,6 +151,7 @@ and is between 256 and 4096 characters. It is defined in the file strict -- Be less tolerant of platforms that are not strictly ACPI specification compliant. rsdt -- prefer RSDT over (default) XSDT + copy_dsdt -- copy DSDT to memory See also Documentation/power/pm.txt, pci=noacpi -- cgit v1.2.2 From 2d2ef822758e3f5da59c40a392d0c6d89394d4b4 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Mon, 26 Oct 2009 13:06:31 -0700 Subject: drm: add initial DRM developer documentation Add a DRM DocBook providing basic information about DRM interfaces, including TTM, GEM, KMS and vblank infrastructure. Intended to provide information to new and existing developers about how to perform driver initialization, implement mode setting and other DRM features. Signed-off-by: Jesse Barnes Signed-off-by: Dave Airlie --- Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/drm.tmpl | 839 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 840 insertions(+), 1 deletion(-) create mode 100644 Documentation/DocBook/drm.tmpl (limited to 'Documentation') diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 325cfd1d6d9..c7e5dc7e8cb 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -14,7 +14,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ mac80211.xml debugobjects.xml sh.xml regulator.xml \ alsa-driver-api.xml writing-an-alsa-driver.xml \ - tracepoint.xml media.xml + tracepoint.xml media.xml drm.xml ### # The build process is as follows (targets): diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl new file mode 100644 index 00000000000..7583dc7cf64 --- /dev/null +++ b/Documentation/DocBook/drm.tmpl @@ -0,0 +1,839 @@ + + + + + + Linux DRM Developer's Guide + + + 2008-2009 + + Intel Corporation (Jesse Barnes <jesse.barnes@intel.com>) + + + + + + The contents of this file may be used under the terms of the GNU + General Public License version 2 (the "GPL") as distributed in + the kernel source COPYING file. + + + + + + + + + + Introduction + + The Linux DRM layer contains code intended to support the needs + of complex graphics devices, usually containing programmable + pipelines well suited to 3D graphics acceleration. Graphics + drivers in the kernel can make use of DRM functions to make + tasks like memory management, interrupt handling and DMA easier, + and provide a uniform interface to applications. + + + A note on versions: this guide covers features found in the DRM + tree, including the TTM memory manager, output configuration and + mode setting, and the new vblank internals, in addition to all + the regular features found in current kernels. + + + [Insert diagram of typical DRM stack here] + + + + + + + DRM Internals + + This chapter documents DRM internals relevant to driver authors + and developers working to add support for the latest features to + existing drivers. + + + First, we'll go over some typical driver initialization + requirements, like setting up command buffers, creating an + initial output configuration, and initializing core services. + Subsequent sections will cover core internals in more detail, + providing implementation notes and examples. + + + The DRM layer provides several services to graphics drivers, + many of them driven by the application interfaces it provides + through libdrm, the library that wraps most of the DRM ioctls. + These include vblank event handling, memory + management, output management, framebuffer management, command + submission & fencing, suspend/resume support, and DMA + services. + + + The core of every DRM driver is struct drm_device. Drivers + will typically statically initialize a drm_device structure, + then pass it to drm_init() at load time. + + + + + + Driver initialization + + Before calling the DRM initialization routines, the driver must + first create and fill out a struct drm_device structure. + + + static struct drm_driver driver = { + /* don't use mtrr's here, the Xserver or user space app should + * deal with them for intel hardware. + */ + .driver_features = + DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | + DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_MODESET, + .load = i915_driver_load, + .unload = i915_driver_unload, + .firstopen = i915_driver_firstopen, + .lastclose = i915_driver_lastclose, + .preclose = i915_driver_preclose, + .save = i915_save, + .restore = i915_restore, + .device_is_agp = i915_driver_device_is_agp, + .get_vblank_counter = i915_get_vblank_counter, + .enable_vblank = i915_enable_vblank, + .disable_vblank = i915_disable_vblank, + .irq_preinstall = i915_driver_irq_preinstall, + .irq_postinstall = i915_driver_irq_postinstall, + .irq_uninstall = i915_driver_irq_uninstall, + .irq_handler = i915_driver_irq_handler, + .reclaim_buffers = drm_core_reclaim_buffers, + .get_map_ofs = drm_core_get_map_ofs, + .get_reg_ofs = drm_core_get_reg_ofs, + .fb_probe = intelfb_probe, + .fb_remove = intelfb_remove, + .fb_resize = intelfb_resize, + .master_create = i915_master_create, + .master_destroy = i915_master_destroy, +#if defined(CONFIG_DEBUG_FS) + .debugfs_init = i915_debugfs_init, + .debugfs_cleanup = i915_debugfs_cleanup, +#endif + .gem_init_object = i915_gem_init_object, + .gem_free_object = i915_gem_free_object, + .gem_vm_ops = &i915_gem_vm_ops, + .ioctls = i915_ioctls, + .fops = { + .owner = THIS_MODULE, + .open = drm_open, + .release = drm_release, + .ioctl = drm_ioctl, + .mmap = drm_mmap, + .poll = drm_poll, + .fasync = drm_fasync, +#ifdef CONFIG_COMPAT + .compat_ioctl = i915_compat_ioctl, +#endif + }, + .pci_driver = { + .name = DRIVER_NAME, + .id_table = pciidlist, + .probe = probe, + .remove = __devexit_p(drm_cleanup_pci), + }, + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, + }; + + + In the example above, taken from the i915 DRM driver, the driver + sets several flags indicating what core features it supports. + We'll go over the individual callbacks in later sections. Since + flags indicate which features your driver supports to the DRM + core, you need to set most of them prior to calling drm_init(). Some, + like DRIVER_MODESET can be set later based on user supplied parameters, + but that's the exception rather than the rule. + + + Driver flags + + DRIVER_USE_AGP + + Driver uses AGP interface + + + + DRIVER_REQUIRE_AGP + + Driver needs AGP interface to function. + + + + DRIVER_USE_MTRR + + + Driver uses MTRR interface for mapping memory. Deprecated. + + + + + DRIVER_PCI_DMA + + Driver is capable of PCI DMA. Deprecated. + + + + DRIVER_SG + + Driver can perform scatter/gather DMA. Deprecated. + + + + DRIVER_HAVE_DMA + Driver supports DMA. Deprecated. + + + DRIVER_HAVE_IRQDRIVER_IRQ_SHARED + + + DRIVER_HAVE_IRQ indicates whether the driver has a IRQ + handler, DRIVER_IRQ_SHARED indicates whether the device & + handler support shared IRQs (note that this is required of + PCI drivers). + + + + + DRIVER_DMA_QUEUE + + + If the driver queues DMA requests and completes them + asynchronously, this flag should be set. Deprecated. + + + + + DRIVER_FB_DMA + + + Driver supports DMA to/from the framebuffer. Deprecated. + + + + + DRIVER_MODESET + + + Driver supports mode setting interfaces. + + + + + + In this specific case, the driver requires AGP and supports + IRQs. DMA, as we'll see, is handled by device specific ioctls + in this case. It also supports the kernel mode setting APIs, though + unlike in the actual i915 driver source, this example unconditionally + exports KMS capability. + + + + + + + Driver load + + In the previous section, we saw what a typical drm_driver + structure might look like. One of the more important fields in + the structure is the hook for the load function. + + + static struct drm_driver driver = { + ... + .load = i915_driver_load, + ... + }; + + + The load function has many responsibilities: allocating a driver + private structure, specifying supported performance counters, + configuring the device (e.g. mapping registers & command + buffers), initializing the memory manager, and setting up the + initial output configuration. + + + Note that the tasks performed at driver load time must not + conflict with DRM client requirements. For instance, if user + level mode setting drivers are in use, it would be problematic + to perform output discovery & configuration at load time. + Likewise, if pre-memory management aware user level drivers are + in use, memory management and command buffer setup may need to + be omitted. These requirements are driver specific, and care + needs to be taken to keep both old and new applications and + libraries working. The i915 driver supports the "modeset" + module parameter to control whether advanced features are + enabled at load time or in legacy fashion. If compatibility is + a concern (e.g. with drivers converted over to the new interfaces + from the old ones), care must be taken to prevent incompatible + device initialization and control with the currently active + userspace drivers. + + + + Driver private & performance counters + + The driver private hangs off the main drm_device structure and + can be used for tracking various device specific bits of + information, like register offsets, command buffer status, + register state for suspend/resume, etc. At load time, a + driver can simply allocate one and set drm_device.dev_priv + appropriately; at unload the driver can free it and set + drm_device.dev_priv to NULL. + + + The DRM supports several counters which can be used for rough + performance characterization. Note that the DRM stat counter + system is not often used by applications, and supporting + additional counters is completely optional. + + + These interfaces are deprecated and should not be used. If performance + monitoring is desired, the developer should investigate and + potentially enhance the kernel perf and tracing infrastructure to export + GPU related performance information to performance monitoring + tools and applications. + + + + + Configuring the device + + Obviously, device configuration will be device specific. + However, there are several common operations: finding a + device's PCI resources, mapping them, and potentially setting + up an IRQ handler. + + + Finding & mapping resources is fairly straightforward. The + DRM wrapper functions, drm_get_resource_start() and + drm_get_resource_len() can be used to find BARs on the given + drm_device struct. Once those values have been retrieved, the + driver load function can call drm_addmap() to create a new + mapping for the BAR in question. Note you'll probably want a + drm_local_map_t in your driver private structure to track any + mappings you create. + + + + + if compatibility with other operating systems isn't a concern + (DRM drivers can run under various BSD variants and OpenSolaris), + native Linux calls can be used for the above, e.g. pci_resource_* + and iomap*/iounmap. See the Linux device driver book for more + info. + + + Once you have a register map, you can use the DRM_READn() and + DRM_WRITEn() macros to access the registers on your device, or + use driver specific versions to offset into your MMIO space + relative to a driver specific base pointer (see I915_READ for + example). + + + If your device supports interrupt generation, you may want to + setup an interrupt handler at driver load time as well. This + is done using the drm_irq_install() function. If your device + supports vertical blank interrupts, it should call + drm_vblank_init() to initialize the core vblank handling code before + enabling interrupts on your device. This ensures the vblank related + structures are allocated and allows the core to handle vblank events. + + + + Once your interrupt handler is registered (it'll use your + drm_driver.irq_handler as the actual interrupt handling + function), you can safely enable interrupts on your device, + assuming any other state your interrupt handler uses is also + initialized. + + + Another task that may be necessary during configuration is + mapping the video BIOS. On many devices, the VBIOS describes + device configuration, LCD panel timings (if any), and contains + flags indicating device state. Mapping the BIOS can be done + using the pci_map_rom() call, a convenience function that + takes care of mapping the actual ROM, whether it has been + shadowed into memory (typically at address 0xc0000) or exists + on the PCI device in the ROM BAR. Note that once you've + mapped the ROM and extracted any necessary information, be + sure to unmap it; on many devices the ROM address decoder is + shared with other BARs, so leaving it mapped can cause + undesired behavior like hangs or memory corruption. + + + + + + Memory manager initialization + + In order to allocate command buffers, cursor memory, scanout + buffers, etc., as well as support the latest features provided + by packages like Mesa and the X.Org X server, your driver + should support a memory manager. + + + If your driver supports memory management (it should!), you'll + need to set that up at load time as well. How you intialize + it depends on which memory manager you're using, TTM or GEM. + + + TTM initialization + + TTM (for Translation Table Manager) manages video memory and + aperture space for graphics devices. TTM supports both UMA devices + and devices with dedicated video RAM (VRAM), i.e. most discrete + graphics devices. If your device has dedicated RAM, supporting + TTM is desireable. TTM also integrates tightly with your + driver specific buffer execution function. See the radeon + driver for examples. + + + The core TTM structure is the ttm_bo_driver struct. It contains + several fields with function pointers for initializing the TTM, + allocating and freeing memory, waiting for command completion + and fence synchronization, and memory migration. See the + radeon_ttm.c file for an example of usage. + + + The ttm_global_reference structure is made up of several fields: + + + struct ttm_global_reference { + enum ttm_global_types global_type; + size_t size; + void *object; + int (*init) (struct ttm_global_reference *); + void (*release) (struct ttm_global_reference *); + }; + + + There should be one global reference structure for your memory + manager as a whole, and there will be others for each object + created by the memory manager at runtime. Your global TTM should + have a type of TTM_GLOBAL_TTM_MEM. The size field for the global + object should be sizeof(struct ttm_mem_global), and the init and + release hooks should point at your driver specific init and + release routines, which will probably eventually call + ttm_mem_global_init and ttm_mem_global_release respectively. + + + Once your global TTM accounting structure is set up and initialized + (done by calling ttm_global_item_ref on the global object you + just created), you'll need to create a buffer object TTM to + provide a pool for buffer object allocation by clients and the + kernel itself. The type of this object should be TTM_GLOBAL_TTM_BO, + and its size should be sizeof(struct ttm_bo_global). Again, + driver specific init and release functions can be provided, + likely eventually calling ttm_bo_global_init and + ttm_bo_global_release, respectively. Also like the previous + object, ttm_global_item_ref is used to create an initial reference + count for the TTM, which will call your initalization function. + + + + GEM initialization + + GEM is an alternative to TTM, designed specifically for UMA + devices. It has simpler initialization and execution requirements + than TTM, but has no VRAM management capability. Core GEM + initialization is comprised of a basic drm_mm_init call to create + a GTT DRM MM object, which provides an address space pool for + object allocation. In a KMS configuration, the driver will + need to allocate and initialize a command ring buffer following + basic GEM initialization. Most UMA devices have a so-called + "stolen" memory region, which provides space for the initial + framebuffer and large, contiguous memory regions required by the + device. This space is not typically managed by GEM, and must + be initialized separately into its own DRM MM object. + + + Initialization will be driver specific, and will depend on + the architecture of the device. In the case of Intel + integrated graphics chips like 965GM, GEM initialization can + be done by calling the internal GEM init function, + i915_gem_do_init(). Since the 965GM is a UMA device + (i.e. it doesn't have dedicated VRAM), GEM will manage + making regular RAM available for GPU operations. Memory set + aside by the BIOS (called "stolen" memory by the i915 + driver) will be managed by the DRM memrange allocator; the + rest of the aperture will be managed by GEM. + + /* Basic memrange allocator for stolen space (aka vram) */ + drm_memrange_init(&dev_priv->vram, 0, prealloc_size); + /* Let GEM Manage from end of prealloc space to end of aperture */ + i915_gem_do_init(dev, prealloc_size, agp_size); + + + + + Once the memory manager has been set up, we can allocate the + command buffer. In the i915 case, this is also done with a + GEM function, i915_gem_init_ringbuffer(). + + + + + + Output configuration + + The final initialization task is output configuration. This involves + finding and initializing the CRTCs, encoders and connectors + for your device, creating an initial configuration and + registering a framebuffer console driver. + + + Output discovery and initialization + + Several core functions exist to create CRTCs, encoders and + connectors, namely drm_crtc_init(), drm_connector_init() and + drm_encoder_init(), along with several "helper" functions to + perform common tasks. + + + Connectors should be registered with sysfs once they've been + detected and initialized, using the + drm_sysfs_connector_add() function. Likewise, when they're + removed from the system, they should be destroyed with + drm_sysfs_connector_remove(). + + +base; + drm_connector_init(dev, &intel_output->base, + &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA); + + drm_encoder_init(dev, &intel_output->enc, &intel_crt_enc_funcs, + DRM_MODE_ENCODER_DAC); + + drm_mode_connector_attach_encoder(&intel_output->base, + &intel_output->enc); + + /* Set up the DDC bus. */ + intel_output->ddc_bus = intel_i2c_create(dev, GPIOA, "CRTDDC_A"); + if (!intel_output->ddc_bus) { + dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration " + "failed.\n"); + return; + } + + intel_output->type = INTEL_OUTPUT_ANALOG; + connector->interlace_allowed = 0; + connector->doublescan_allowed = 0; + + drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); + drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); + + drm_sysfs_connector_add(connector); +} +]]> + + + In the example above (again, taken from the i915 driver), a + CRT connector and encoder combination is created. A device + specific i2c bus is also created, for fetching EDID data and + performing monitor detection. Once the process is complete, + the new connector is regsitered with sysfs, to make its + properties available to applications. + + + Helper functions and core functions + + Since many PC-class graphics devices have similar display output + designs, the DRM provides a set of helper functions to make + output management easier. The core helper routines handle + encoder re-routing and disabling of unused functions following + mode set. Using the helpers is optional, but recommended for + devices with PC-style architectures (i.e. a set of display planes + for feeding pixels to encoders which are in turn routed to + connectors). Devices with more complex requirements needing + finer grained management can opt to use the core callbacks + directly. + + + [Insert typical diagram here.] [Insert OMAP style config here.] + + + + For each encoder, CRTC and connector, several functions must + be provided, depending on the object type. Encoder objects + need should provide a DPMS (basically on/off) function, mode fixup + (for converting requested modes into native hardware timings), + and prepare, set and commit functions for use by the core DRM + helper functions. Connector helpers need to provide mode fetch and + validity functions as well as an encoder matching function for + returing an ideal encoder for a given connector. The core + connector functions include a DPMS callback, (deprecated) + save/restore routines, detection, mode probing, property handling, + and cleanup functions. + + + + + + + + + + + + VBlank event handling + + The DRM core exposes two vertical blank related ioctls: + DRM_IOCTL_WAIT_VBLANK and DRM_IOCTL_MODESET_CTL. + + + + DRM_IOCTL_WAIT_VBLANK takes a struct drm_wait_vblank structure + as its argument, and is used to block or request a signal when a + specified vblank event occurs. + + + DRM_IOCTL_MODESET_CTL should be called by application level + drivers before and after mode setting, since on many devices the + vertical blank counter will be reset at that time. Internally, + the DRM snapshots the last vblank count when the ioctl is called + with the _DRM_PRE_MODESET command so that the counter won't go + backwards (which is dealt with when _DRM_POST_MODESET is used). + + + To support the functions above, the DRM core provides several + helper functions for tracking vertical blank counters, and + requires drivers to provide several callbacks: + get_vblank_counter(), enable_vblank() and disable_vblank(). The + core uses get_vblank_counter() to keep the counter accurate + across interrupt disable periods. It should return the current + vertical blank event count, which is often tracked in a device + register. The enable and disable vblank callbacks should enable + and disable vertical blank interrupts, respectively. In the + absence of DRM clients waiting on vblank events, the core DRM + code will use the disable_vblank() function to disable + interrupts, which saves power. They'll be re-enabled again when + a client calls the vblank wait ioctl above. + + + Devices that don't provide a count register can simply use an + internal atomic counter incremented on every vertical blank + interrupt, and can make their enable and disable vblank + functions into no-ops. + + + + + Memory management + + The memory manager lies at the heart of many DRM operations, and + is also required to support advanced client features like OpenGL + pbuffers. The DRM currently contains two memory managers, TTM + and GEM. + + + + The Translation Table Manager (TTM) + + TTM was developed by Tungsten Graphics, primarily by Thomas + Hellström, and is intended to be a flexible, high performance + graphics memory manager. + + + Drivers wishing to support TTM must fill out a drm_bo_driver + structure. + + + TTM design background and information belongs here. + + + + + The Graphics Execution Manager (GEM) + + GEM is an Intel project, authored by Eric Anholt and Keith + Packard. It provides simpler interfaces than TTM, and is well + suited for UMA devices. + + + GEM-enabled drivers must provide gem_init_object() and + gem_free_object() callbacks to support the core memory + allocation routines. They should also provide several driver + specific ioctls to support command execution, pinning, buffer + read & write, mapping, and domain ownership transfers. + + + On a fundamental level, GEM involves several operations: memory + allocation and freeing, command execution, and aperture management + at command execution time. Buffer object allocation is relatively + straightforward and largely provided by Linux's shmem layer, which + provides memory to back each object. When mapped into the GTT + or used in a command buffer, the backing pages for an object are + flushed to memory and marked write combined so as to be coherent + with the GPU. Likewise, when the GPU finishes rendering to an object, + if the CPU accesses it, it must be made coherent with the CPU's view + of memory, usually involving GPU cache flushing of various kinds. + This core CPU<->GPU coherency management is provided by the GEM + set domain function, which evaluates an object's current domain and + performs any necessary flushing or synchronization to put the object + into the desired coherency domain (note that the object may be busy, + i.e. an active render target; in that case the set domain function + will block the client and wait for rendering to complete before + performing any necessary flushing operations). + + + Perhaps the most important GEM function is providing a command + execution interface to clients. Client programs construct command + buffers containing references to previously allocated memory objects + and submit them to GEM. At that point, GEM will take care to bind + all the objects into the GTT, execute the buffer, and provide + necessary synchronization between clients accessing the same buffers. + This often involves evicting some objects from the GTT and re-binding + others (a fairly expensive operation), and providing relocation + support which hides fixed GTT offsets from clients. Clients must + take care not to submit command buffers that reference more objects + than can fit in the GTT or GEM will reject them and no rendering + will occur. Similarly, if several objects in the buffer require + fence registers to be allocated for correct rendering (e.g. 2D blits + on pre-965 chips), care must be taken not to require more fence + registers than are available to the client. Such resource management + should be abstracted from the client in libdrm. + + + + + + + + Output management + + At the core of the DRM output management code is a set of + structures representing CRTCs, encoders and connectors. + + + A CRTC is an abstraction representing a part of the chip that + contains a pointer to a scanout buffer. Therefore, the number + of CRTCs available determines how many independent scanout + buffers can be active at any given time. The CRTC structure + contains several fields to support this: a pointer to some video + memory, a display mode, and an (x, y) offset into the video + memory to support panning or configurations where one piece of + video memory spans multiple CRTCs. + + + An encoder takes pixel data from a CRTC and converts it to a + format suitable for any attached connectors. On some devices, + it may be possible to have a CRTC send data to more than one + encoder. In that case, both encoders would receive data from + the same scanout buffer, resulting in a "cloned" display + configuration across the connectors attached to each encoder. + + + A connector is the final destination for pixel data on a device, + and usually connects directly to an external display device like + a monitor or laptop panel. A connector can only be attached to + one encoder at a time. The connector is also the structure + where information about the attached display is kept, so it + contains fields for display data, EDID data, DPMS & + connection status, and information about modes supported on the + attached displays. + + + + + + Framebuffer management + + In order to set a mode on a given CRTC, encoder and connector + configuration, clients need to provide a framebuffer object which + will provide a source of pixels for the CRTC to deliver to the encoder(s) + and ultimately the connector(s) in the configuration. A framebuffer + is fundamentally a driver specific memory object, made into an opaque + handle by the DRM addfb function. Once an fb has been created this + way it can be passed to the KMS mode setting routines for use in + a configuration. + + + + + Command submission & fencing + + This should cover a few device specific command submission + implementations. + + + + + Suspend/resume + + The DRM core provides some suspend/resume code, but drivers + wanting full suspend/resume support should provide save() and + restore() functions. These will be called at suspend, + hibernate, or resume time, and should perform any state save or + restore required by your device across suspend or hibernate + states. + + + + + DMA services + + This should cover how DMA mapping etc. is supported by the core. + These functions are deprecated and should not be used. + + + + + + + + Userland interfaces + + The DRM core exports several interfaces to applications, + generally intended to be used through corresponding libdrm + wrapper functions. In addition, drivers export device specific + interfaces for use by userspace drivers & device aware + applications through ioctls and sysfs files. + + + External interfaces include: memory mapping, context management, + DMA operations, AGP management, vblank control, fence + management, memory management, and output management. + + + Cover generic ioctls and sysfs layout here. Only need high + level info, since man pages will cover the rest. + + + + + + + DRM Driver API + + Include auto-generated API reference here (need to reference it + from paragraphs above too). + + + + -- cgit v1.2.2 From cecbca96da387428e220e307a9c945e37e2f4d9e Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Sun, 18 Apr 2010 19:08:41 +0200 Subject: tracing: Dump either the oops's cpu source or all cpus buffers The ftrace_dump_on_oops kernel parameter, sysctl and sysrq let one dump every cpu buffers when an oops or panic happens. It's nice when you have few cpus but it may take ages if have many, plus you miss the real origin of the problem in all the cpu traces. Sometimes, all you need is to dump the cpu buffer that triggered the opps, most of the time it is our main interest. This patch modifies ftrace_dump_on_oops to handle this choice. The ftrace_dump_on_oops kernel parameter, when it comes alone, has the same behaviour than before. But ftrace_dump_on_oops=orig_cpu will only dump the buffer of the cpu that oops'ed. Similarly, sysctl kernel.ftrace_dump_on_oops=1 and echo 1 > /proc/sys/kernel/ftrace_dump_on_oops keep their previous behaviour. But setting 2 jumps into cpu origin dump mode. v2: Fix double setup v3: Fix spelling issues reported by Randy Dunlap v4: Also update __ftrace_dump in the selftests Signed-off-by: Frederic Weisbecker Acked-by: David S. Miller Acked-by: Steven Rostedt Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Li Zefan Cc: Lai Jiangshan --- Documentation/kernel-parameters.txt | 6 +++++- Documentation/trace/ftrace.txt | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e4cbca58536..ab67b33300f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -789,8 +789,12 @@ and is between 256 and 4096 characters. It is defined in the file as early as possible in order to facilitate early boot debugging. - ftrace_dump_on_oops + ftrace_dump_on_oops[=orig_cpu] [FTRACE] will dump the trace buffers on oops. + If no parameter is passed, ftrace will dump + buffers of all CPUs, but if you pass orig_cpu, it will + dump only the buffer of the CPU that triggered the + oops. ftrace_filter=[function-list] [FTRACE] Limit the functions traced by the function diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 03485bfbd79..52011815c90 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt @@ -1337,12 +1337,14 @@ ftrace_dump_on_oops must be set. To set ftrace_dump_on_oops, one can either use the sysctl function or set it via the proc system interface. - sysctl kernel.ftrace_dump_on_oops=1 + sysctl kernel.ftrace_dump_on_oops=n or - echo 1 > /proc/sys/kernel/ftrace_dump_on_oops + echo n > /proc/sys/kernel/ftrace_dump_on_oops +If n = 1, ftrace will dump buffers of all CPUs, if n = 2 ftrace will +only dump the buffer of the CPU that triggered the oops. Here's an example of such a dump after a null pointer dereference in a kernel module: -- cgit v1.2.2 From 719f82d3987aad4cc9f46d19c35f362672545cad Mon Sep 17 00:00:00 2001 From: Eliot Blennerhassett Date: Wed, 21 Apr 2010 18:17:39 +0200 Subject: ALSA: Add support of AudioScience ASI boards Added the support of AudioScience ASI boards. The driver has been tested for years on alsa-driver external tree, now finally got merged to the kernel. Signed-off-by: Eliot Blennerhassett Signed-off-by: Takashi Iwai --- Documentation/sound/alsa/ALSA-Configuration.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index bfcbbf88c44..dc681badca6 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt @@ -227,6 +227,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. The power-management is supported. + Module snd-asihpi + ----------------- + + Module for AudioScience ASI soundcards + + enable_hpi_hwdep - enable HPI hwdep for AudioScience soundcard + + This module supports multiple cards. + The driver requires the firmware loader support on kernel. + Module snd-atiixp ----------------- -- cgit v1.2.2 From e904f0a4163bc7bd303d2430893d82362df6727e Mon Sep 17 00:00:00 2001 From: andrew hendry Date: Mon, 19 Apr 2010 13:30:36 +0000 Subject: X25: Update X25 interface documentation Signed-off-by: Andrew Hendry Signed-off-by: David S. Miller --- Documentation/networking/x25-iface.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Documentation') diff --git a/Documentation/networking/x25-iface.txt b/Documentation/networking/x25-iface.txt index 975cc87ebdd..78f662ee062 100644 --- a/Documentation/networking/x25-iface.txt +++ b/Documentation/networking/x25-iface.txt @@ -20,23 +20,23 @@ the rest of the skbuff, if any more information does exist. Packet Layer to Device Driver ----------------------------- -First Byte = 0x00 +First Byte = 0x00 (X25_IFACE_DATA) This indicates that the rest of the skbuff contains data to be transmitted over the LAPB link. The LAPB link should already exist before any data is passed down. -First Byte = 0x01 +First Byte = 0x01 (X25_IFACE_CONNECT) Establish the LAPB link. If the link is already established then the connect confirmation message should be returned as soon as possible. -First Byte = 0x02 +First Byte = 0x02 (X25_IFACE_DISCONNECT) Terminate the LAPB link. If it is already disconnected then the disconnect confirmation message should be returned as soon as possible. -First Byte = 0x03 +First Byte = 0x03 (X25_IFACE_PARAMS) LAPB parameters. To be defined. @@ -44,22 +44,22 @@ LAPB parameters. To be defined. Device Driver to Packet Layer ----------------------------- -First Byte = 0x00 +First Byte = 0x00 (X25_IFACE_DATA) This indicates that the rest of the skbuff contains data that has been received over the LAPB link. -First Byte = 0x01 +First Byte = 0x01 (X25_IFACE_CONNECT) LAPB link has been established. The same message is used for both a LAPB link connect_confirmation and a connect_indication. -First Byte = 0x02 +First Byte = 0x02 (X25_IFACE_DISCONNECT) LAPB link has been terminated. This same message is used for both a LAPB link disconnect_confirmation and a disconnect_indication. -First Byte = 0x03 +First Byte = 0x03 (X25_IFACE_PARAMS) LAPB parameters. To be defined. -- cgit v1.2.2 From a33f32244d8550da8b4a26e277ce07d5c6d158b5 Mon Sep 17 00:00:00 2001 From: Francis Galiegue Date: Fri, 23 Apr 2010 00:08:02 +0200 Subject: Documentation/: it's -> its where appropriate Fix obvious cases of "it's" being used when "its" was meant. Signed-off-by: Francis Galiegue Acked-by: Randy Dunlap Signed-off-by: Jiri Kosina --- Documentation/ABI/testing/sysfs-devices-memory | 2 +- Documentation/DMA-API-HOWTO.txt | 2 +- Documentation/DocBook/libata.tmpl | 2 +- Documentation/PCI/pci-error-recovery.txt | 4 ++-- Documentation/Smack.txt | 2 +- Documentation/arm/SA1100/ADSBitsy | 2 +- Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen | 2 +- Documentation/atomic_ops.txt | 2 +- Documentation/blackfin/bfin-gpio-notes.txt | 2 +- Documentation/cachetlb.txt | 6 +++--- Documentation/cgroups/memcg_test.txt | 2 +- Documentation/cgroups/memory.txt | 2 +- Documentation/connector/connector.txt | 2 +- Documentation/dvb/ci.txt | 2 +- Documentation/dvb/contributors.txt | 2 +- Documentation/filesystems/autofs4-mount-control.txt | 2 +- Documentation/filesystems/ceph.txt | 2 +- Documentation/filesystems/dlmfs.txt | 2 +- Documentation/filesystems/fiemap.txt | 12 ++++++------ Documentation/filesystems/fuse.txt | 4 ++-- Documentation/filesystems/hpfs.txt | 2 +- Documentation/filesystems/nfs/rpc-cache.txt | 2 +- Documentation/filesystems/proc.txt | 4 ++-- Documentation/filesystems/smbfs.txt | 2 +- Documentation/filesystems/vfs.txt | 2 +- Documentation/hwmon/lm85 | 2 +- Documentation/input/joystick.txt | 2 +- Documentation/intel_txt.txt | 2 +- Documentation/kbuild/kconfig-language.txt | 2 +- Documentation/kernel-docs.txt | 10 +++++----- Documentation/kprobes.txt | 2 +- Documentation/laptops/laptop-mode.txt | 2 +- Documentation/lguest/lguest.c | 2 +- Documentation/md.txt | 2 +- Documentation/netlabel/lsm_interface.txt | 2 +- Documentation/networking/ifenslave.c | 2 +- Documentation/networking/packet_mmap.txt | 4 ++-- Documentation/power/regulator/consumer.txt | 10 +++++----- Documentation/power/regulator/machine.txt | 2 +- Documentation/power/regulator/overview.txt | 6 +++--- Documentation/powerpc/booting-without-of.txt | 2 +- Documentation/powerpc/phyp-assisted-dump.txt | 2 +- Documentation/rt-mutex-design.txt | 2 +- Documentation/scsi/ChangeLog.lpfc | 4 ++-- Documentation/scsi/FlashPoint.txt | 2 +- Documentation/scsi/dtc3x80.txt | 2 +- Documentation/scsi/ncr53c8xx.txt | 2 +- Documentation/scsi/osst.txt | 2 +- Documentation/scsi/scsi_fc_transport.txt | 4 ++-- Documentation/scsi/sym53c8xx_2.txt | 2 +- Documentation/sound/alsa/soc/dapm.txt | 4 ++-- Documentation/sound/alsa/soc/machine.txt | 2 +- Documentation/sound/alsa/soc/overview.txt | 2 +- Documentation/usb/WUSB-Design-overview.txt | 2 +- Documentation/vm/numa_memory_policy.txt | 4 ++-- Documentation/w1/w1.generic | 2 +- 56 files changed, 81 insertions(+), 81 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory index bf1627b02a0..aba7d989208 100644 --- a/Documentation/ABI/testing/sysfs-devices-memory +++ b/Documentation/ABI/testing/sysfs-devices-memory @@ -43,7 +43,7 @@ Date: September 2008 Contact: Badari Pulavarty Description: The file /sys/devices/system/memory/memoryX/state - is read-write. When read, it's contents show the + is read-write. When read, its contents show the online/offline state of the memory section. When written, root can toggle the the online/offline state of a removable memory section (see removable file description above) diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt index 52618ab069a..2e435adfbd6 100644 --- a/Documentation/DMA-API-HOWTO.txt +++ b/Documentation/DMA-API-HOWTO.txt @@ -742,7 +742,7 @@ failure can be determined by: Closing -This document, and the API itself, would not be in it's current +This document, and the API itself, would not be in its current form without the feedback and suggestions from numerous individuals. We would like to specifically mention, in no particular order, the following people: diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index ba997577150..261b57bc6f0 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl @@ -490,7 +490,7 @@ void (*host_stop) (struct ata_host_set *host_set); allocates space for a legacy IDE PRD table and returns. - ->port_stop() is called after ->host_stop(). It's sole function + ->port_stop() is called after ->host_stop(). Its sole function is to release DMA/memory resources, now that they are no longer actively being used. Many drivers also free driver-private data from port at this time. diff --git a/Documentation/PCI/pci-error-recovery.txt b/Documentation/PCI/pci-error-recovery.txt index e83f2ea7641..898ded24510 100644 --- a/Documentation/PCI/pci-error-recovery.txt +++ b/Documentation/PCI/pci-error-recovery.txt @@ -216,7 +216,7 @@ The driver should return one of the following result codes: - PCI_ERS_RESULT_NEED_RESET Driver returns this if it thinks the device is not - recoverable in it's current state and it needs a slot + recoverable in its current state and it needs a slot reset to proceed. - PCI_ERS_RESULT_DISCONNECT @@ -241,7 +241,7 @@ in working condition. The driver is not supposed to restart normal driver I/O operations at this point. It should limit itself to "probing" the device to -check it's recoverability status. If all is right, then the platform +check its recoverability status. If all is right, then the platform will call resume() once all drivers have ack'd link_reset(). Result codes: diff --git a/Documentation/Smack.txt b/Documentation/Smack.txt index 34614b4c708..e9dab41c0fe 100644 --- a/Documentation/Smack.txt +++ b/Documentation/Smack.txt @@ -73,7 +73,7 @@ NOTE: Smack labels are limited to 23 characters. The attr command If you don't do anything special all users will get the floor ("_") label when they log in. If you do want to log in via the hacked ssh at other labels use the attr command to set the smack value on the -home directory and it's contents. +home directory and its contents. You can add access rules in /etc/smack/accesses. They take the form: diff --git a/Documentation/arm/SA1100/ADSBitsy b/Documentation/arm/SA1100/ADSBitsy index 7197a9e958e..f9f62e8c071 100644 --- a/Documentation/arm/SA1100/ADSBitsy +++ b/Documentation/arm/SA1100/ADSBitsy @@ -32,7 +32,7 @@ Notes: - The flash on board is divided into 3 partitions. You should be careful to use flash on board. - It's partition is different from GraphicsClient Plus and GraphicsMaster + Its partition is different from GraphicsClient Plus and GraphicsMaster - 16bpp mode requires a different cable than what ships with the board. Contact ADS or look through the manual to wire your own. Currently, diff --git a/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen b/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen index 1e6a23fdf2f..dc460f05564 100644 --- a/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen +++ b/Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen @@ -7,7 +7,7 @@ The driver only implements a four-wire touch panel protocol. The touchscreen driver is maintenance free except for the pen-down or touch threshold. Some resistive displays and board combinations may -require tuning of this threshold. The driver exposes some of it's +require tuning of this threshold. The driver exposes some of its internal state in the sys filesystem. If the kernel is configured with it, CONFIG_SYSFS, and sysfs is mounted at /sys, there will be a directory diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 396bec3b74e..ac4d4718712 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -320,7 +320,7 @@ counter decrement would not become globally visible until the obj->active update does. As a historical note, 32-bit Sparc used to only allow usage of -24-bits of it's atomic_t type. This was because it used 8 bits +24-bits of its atomic_t type. This was because it used 8 bits as a spinlock for SMP safety. Sparc32 lacked a "compare and swap" type instruction. However, 32-bit Sparc has since been moved over to a "hash table of spinlocks" scheme, that allows the full 32-bit diff --git a/Documentation/blackfin/bfin-gpio-notes.txt b/Documentation/blackfin/bfin-gpio-notes.txt index 9898c7ded7d..f731c1e5647 100644 --- a/Documentation/blackfin/bfin-gpio-notes.txt +++ b/Documentation/blackfin/bfin-gpio-notes.txt @@ -43,7 +43,7 @@ void bfin_gpio_irq_free(unsigned gpio); The request functions will record the function state for a certain pin, - the free functions will clear it's function state. + the free functions will clear its function state. Once a pin is requested, it can't be requested again before it is freed by previous caller, otherwise kernel will dump stacks, and the request function fail. diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt index 2b5f823abd0..9164ae3b83b 100644 --- a/Documentation/cachetlb.txt +++ b/Documentation/cachetlb.txt @@ -5,7 +5,7 @@ This document describes the cache/tlb flushing interfaces called by the Linux VM subsystem. It enumerates over each interface, -describes it's intended purpose, and what side effect is expected +describes its intended purpose, and what side effect is expected after the interface is invoked. The side effects described below are stated for a uniprocessor @@ -231,7 +231,7 @@ require a whole different set of interfaces to handle properly. The biggest problem is that of virtual aliasing in the data cache of a processor. -Is your port susceptible to virtual aliasing in it's D-cache? +Is your port susceptible to virtual aliasing in its D-cache? Well, if your D-cache is virtually indexed, is larger in size than PAGE_SIZE, and does not prevent multiple cache lines for the same physical address from existing at once, you have this problem. @@ -249,7 +249,7 @@ one way to solve this (in particular SPARC_FLAG_MMAPSHARED). Next, you have to solve the D-cache aliasing issue for all other cases. Please keep in mind that fact that, for a given page mapped into some user address space, there is always at least one more -mapping, that of the kernel in it's linear mapping starting at +mapping, that of the kernel in its linear mapping starting at PAGE_OFFSET. So immediately, once the first user maps a given physical page into its address space, by implication the D-cache aliasing problem has the potential to exist since the kernel already diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt index f7f68b2ac19..b7eececfb19 100644 --- a/Documentation/cgroups/memcg_test.txt +++ b/Documentation/cgroups/memcg_test.txt @@ -244,7 +244,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y. we have to check if OLDPAGE/NEWPAGE is a valid page after commit(). 8. LRU - Each memcg has its own private LRU. Now, it's handling is under global + Each memcg has its own private LRU. Now, its handling is under global VM's control (means that it's handled under global zone->lru_lock). Almost all routines around memcg's LRU is called by global LRU's list management functions under zone->lru_lock(). diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index 3a6aecd078b..6cab1f29da4 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt @@ -263,7 +263,7 @@ some of the pages cached in the cgroup (page cache pages). 4.2 Task migration -When a task migrates from one cgroup to another, it's charge is not +When a task migrates from one cgroup to another, its charge is not carried forward by default. The pages allocated from the original cgroup still remain charged to it, the charge is dropped when the page is freed or reclaimed. diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt index 78c9466a9aa..e5c5f5e6ab7 100644 --- a/Documentation/connector/connector.txt +++ b/Documentation/connector/connector.txt @@ -88,7 +88,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 __groups, int gfp_mask); int gfp_mask - GFP mask. Note: When registering new callback user, connector core assigns - netlink group to the user which is equal to it's id.idx. + netlink group to the user which is equal to its id.idx. /*****************************************/ Protocol description. diff --git a/Documentation/dvb/ci.txt b/Documentation/dvb/ci.txt index 2ecd834585e..4a0c2b56e69 100644 --- a/Documentation/dvb/ci.txt +++ b/Documentation/dvb/ci.txt @@ -41,7 +41,7 @@ This application requires the following to function properly as of now. * Cards that fall in this category ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -At present the cards that fall in this category are the Twinhan and it's +At present the cards that fall in this category are the Twinhan and its clones, these cards are available as VVMER, Tomato, Hercules, Orange and so on. diff --git a/Documentation/dvb/contributors.txt b/Documentation/dvb/contributors.txt index 4865addebe1..47c30098dab 100644 --- a/Documentation/dvb/contributors.txt +++ b/Documentation/dvb/contributors.txt @@ -1,7 +1,7 @@ Thanks go to the following people for patches and contributions: Michael Hunold - for the initial saa7146 driver and it's recent overhaul + for the initial saa7146 driver and its recent overhaul Christian Theiss for his work on the initial Linux DVB driver diff --git a/Documentation/filesystems/autofs4-mount-control.txt b/Documentation/filesystems/autofs4-mount-control.txt index 8f78ded4b64..51986bf08a4 100644 --- a/Documentation/filesystems/autofs4-mount-control.txt +++ b/Documentation/filesystems/autofs4-mount-control.txt @@ -146,7 +146,7 @@ found to be inadequate, in this case. The Generic Netlink system was used for this as raw Netlink would lead to a significant increase in complexity. There's no question that the Generic Netlink system is an elegant solution for common case ioctl functions but it's not a complete -replacement probably because it's primary purpose in life is to be a +replacement probably because its primary purpose in life is to be a message bus implementation rather than specifically an ioctl replacement. While it would be possible to work around this there is one concern that lead to the decision to not use it. This is that the autofs diff --git a/Documentation/filesystems/ceph.txt b/Documentation/filesystems/ceph.txt index 0660c9f5dee..763d8ebbbeb 100644 --- a/Documentation/filesystems/ceph.txt +++ b/Documentation/filesystems/ceph.txt @@ -90,7 +90,7 @@ Mount Options Specify the IP and/or port the client should bind to locally. There is normally not much reason to do this. If the IP is not specified, the client's IP address is determined by looking at the - address it's connection to the monitor originates from. + address its connection to the monitor originates from. wsize=X Specify the maximum write size in bytes. By default there is no diff --git a/Documentation/filesystems/dlmfs.txt b/Documentation/filesystems/dlmfs.txt index c50bbb2d52b..1b528b2ad80 100644 --- a/Documentation/filesystems/dlmfs.txt +++ b/Documentation/filesystems/dlmfs.txt @@ -47,7 +47,7 @@ You'll want to start heartbeating on a volume which all the nodes in your lockspace can access. The easiest way to do this is via ocfs2_hb_ctl (distributed with ocfs2-tools). Right now it requires that an OCFS2 file system be in place so that it can automatically -find it's heartbeat area, though it will eventually support heartbeat +find its heartbeat area, though it will eventually support heartbeat against raw disks. Please see the ocfs2_hb_ctl and mkfs.ocfs2 manual pages distributed diff --git a/Documentation/filesystems/fiemap.txt b/Documentation/filesystems/fiemap.txt index 606233cd461..1b805a0efbb 100644 --- a/Documentation/filesystems/fiemap.txt +++ b/Documentation/filesystems/fiemap.txt @@ -38,7 +38,7 @@ flags, it will return EBADR and the contents of fm_flags will contain the set of flags which caused the error. If the kernel is compatible with all flags passed, the contents of fm_flags will be unmodified. It is up to userspace to determine whether rejection of a particular -flag is fatal to it's operation. This scheme is intended to allow the +flag is fatal to its operation. This scheme is intended to allow the fiemap interface to grow in the future but without losing compatibility with old software. @@ -56,7 +56,7 @@ If this flag is set, the kernel will sync the file before mapping extents. * FIEMAP_FLAG_XATTR If this flag is set, the extents returned will describe the inodes -extended attribute lookup tree, instead of it's data tree. +extended attribute lookup tree, instead of its data tree. Extent Mapping @@ -89,7 +89,7 @@ struct fiemap_extent { }; All offsets and lengths are in bytes and mirror those on disk. It is valid -for an extents logical offset to start before the request or it's logical +for an extents logical offset to start before the request or its logical length to extend past the request. Unless FIEMAP_EXTENT_NOT_ALIGNED is returned, fe_logical, fe_physical, and fe_length will be aligned to the block size of the file system. With the exception of extents flagged as @@ -125,7 +125,7 @@ been allocated for the file yet. * FIEMAP_EXTENT_DELALLOC - This will also set FIEMAP_EXTENT_UNKNOWN. -Delayed allocation - while there is data for this extent, it's +Delayed allocation - while there is data for this extent, its physical location has not been allocated yet. * FIEMAP_EXTENT_ENCODED @@ -159,7 +159,7 @@ Data is located within a meta data block. Data is packed into a block with data from other files. * FIEMAP_EXTENT_UNWRITTEN -Unwritten extent - the extent is allocated but it's data has not been +Unwritten extent - the extent is allocated but its data has not been initialized. This indicates the extent's data will be all zero if read through the filesystem but the contents are undefined if read directly from the device. @@ -176,7 +176,7 @@ VFS -> File System Implementation File systems wishing to support fiemap must implement a ->fiemap callback on their inode_operations structure. The fs ->fiemap call is responsible for -defining it's set of supported fiemap flags, and calling a helper function on +defining its set of supported fiemap flags, and calling a helper function on each discovered extent: struct inode_operations { diff --git a/Documentation/filesystems/fuse.txt b/Documentation/filesystems/fuse.txt index 397a41adb4c..13af4a49e7d 100644 --- a/Documentation/filesystems/fuse.txt +++ b/Documentation/filesystems/fuse.txt @@ -91,7 +91,7 @@ Mount options 'default_permissions' By default FUSE doesn't check file access permissions, the - filesystem is free to implement it's access policy or leave it to + filesystem is free to implement its access policy or leave it to the underlying file access mechanism (e.g. in case of network filesystems). This option enables permission checking, restricting access based on file mode. It is usually useful together with the @@ -171,7 +171,7 @@ or may honor them by sending a reply to the _original_ request, with the error set to EINTR. It is also possible that there's a race between processing the -original request and it's INTERRUPT request. There are two possibilities: +original request and its INTERRUPT request. There are two possibilities: 1) The INTERRUPT request is processed before the original request is processed diff --git a/Documentation/filesystems/hpfs.txt b/Documentation/filesystems/hpfs.txt index fa45c3baed9..74630bd504f 100644 --- a/Documentation/filesystems/hpfs.txt +++ b/Documentation/filesystems/hpfs.txt @@ -103,7 +103,7 @@ to analyze or change OS2SYS.INI. Codepages HPFS can contain several uppercasing tables for several codepages and each -file has a pointer to codepage it's name is in. However OS/2 was created in +file has a pointer to codepage its name is in. However OS/2 was created in America where people don't care much about codepages and so multiple codepages support is quite buggy. I have Czech OS/2 working in codepage 852 on my disk. Once I booted English OS/2 working in cp 850 and I created a file on my 852 diff --git a/Documentation/filesystems/nfs/rpc-cache.txt b/Documentation/filesystems/nfs/rpc-cache.txt index 8a382bea680..ebcaaee2161 100644 --- a/Documentation/filesystems/nfs/rpc-cache.txt +++ b/Documentation/filesystems/nfs/rpc-cache.txt @@ -185,7 +185,7 @@ failed lookup meant a definite 'no'. request/response format ----------------------- -While each cache is free to use it's own format for requests +While each cache is free to use its own format for requests and responses over channel, the following is recommended as appropriate and support routines are available to help: Each request or response record should be printable ASCII diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 770700317c2..f6b1b5fca1d 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -965,7 +965,7 @@ your system and how much traffic was routed over those devices: ...] 1375103 17405 0 0 0 0 0 0 ...] 1703981 5535 0 0 0 3 0 0 -In addition, each Channel Bond interface has it's own directory. For +In addition, each Channel Bond interface has its own directory. For example, the bond0 device will have a directory called /proc/net/bond0/. It will contain information that is specific to that bond, such as the current slaves of the bond, the link status of the slaves, and how @@ -1362,7 +1362,7 @@ been accounted as having caused 1MB of write. In other words: The number of bytes which this process caused to not happen, by truncating pagecache. A task can cause "negative" IO too. If this task truncates some dirty pagecache, some IO which another task has been accounted -for (in it's write_bytes) will not be happening. We _could_ just subtract that +for (in its write_bytes) will not be happening. We _could_ just subtract that from the truncating task's write_bytes, but there is information loss in doing that. diff --git a/Documentation/filesystems/smbfs.txt b/Documentation/filesystems/smbfs.txt index f673ef0de0f..194fb0decd2 100644 --- a/Documentation/filesystems/smbfs.txt +++ b/Documentation/filesystems/smbfs.txt @@ -3,6 +3,6 @@ protocol used by Windows for Workgroups, Windows 95 and Windows NT. Smbfs was inspired by Samba, the program written by Andrew Tridgell that turns any Unix host into a file server for DOS or Windows clients. -Smbfs is a SMB client, but uses parts of samba for it's operation. For +Smbfs is a SMB client, but uses parts of samba for its operation. For more info on samba, including documentation, please go to http://www.samba.org/ and then on to your nearest mirror. diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 3de2f32edd9..b66858538df 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt @@ -72,7 +72,7 @@ structure (this is the kernel-side implementation of file descriptors). The freshly allocated file structure is initialized with a pointer to the dentry and a set of file operation member functions. These are taken from the inode data. The open() file method is then -called so the specific filesystem implementation can do it's work. You +called so the specific filesystem implementation can do its work. You can see that this is another switch performed by the VFS. The file structure is placed into the file descriptor table for the process. diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85 index a13680871bc..a76aefeeb68 100644 --- a/Documentation/hwmon/lm85 +++ b/Documentation/hwmon/lm85 @@ -157,7 +157,7 @@ temperature configuration points: There are three PWM outputs. The LM85 datasheet suggests that the pwm3 output control both fan3 and fan4. Each PWM can be individually -configured and assigned to a zone for it's control value. Each PWM can be +configured and assigned to a zone for its control value. Each PWM can be configured individually according to the following options. * pwm#_auto_pwm_min - this specifies the PWM value for temp#_auto_temp_off diff --git a/Documentation/input/joystick.txt b/Documentation/input/joystick.txt index 154d767b2ac..8007b7ca87b 100644 --- a/Documentation/input/joystick.txt +++ b/Documentation/input/joystick.txt @@ -402,7 +402,7 @@ for the port of the SoundFusion is supported by the cs461x.c module. ~~~~~~~~~~~~~~~~~~~~~~~~ The Live! has a special PCI gameport, which, although it doesn't provide any "Enhanced" stuff like 4DWave and friends, is quite a bit faster than -it's ISA counterparts. It also requires special support, hence the +its ISA counterparts. It also requires special support, hence the emu10k1-gp.c module for it instead of the normal ns558.c one. 3.15 SoundBlaster 64 and 128 - ES1370 and ES1371, ESS Solo1 and S3 SonicVibes diff --git a/Documentation/intel_txt.txt b/Documentation/intel_txt.txt index f40a1f03001..1423bcc7c50 100644 --- a/Documentation/intel_txt.txt +++ b/Documentation/intel_txt.txt @@ -126,7 +126,7 @@ o Tboot then applies an (optional) user-defined launch policy to o Tboot adjusts the e820 table provided by the bootloader to reserve its own location in memory as well as to reserve certain other TXT-related regions. -o As part of it's launch, tboot DMA protects all of RAM (using the +o As part of its launch, tboot DMA protects all of RAM (using the VT-d PMRs). Thus, the kernel must be booted with 'intel_iommu=on' in order to remove this blanket protection and use VT-d's page-level protection. diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index c412c245848..b472e4e0ba6 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt @@ -181,7 +181,7 @@ Expressions are listed in decreasing order of precedence. (7) Returns the result of max(/expr/, /expr/). An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 -respectively for calculations). A menu entry becomes visible when it's +respectively for calculations). A menu entry becomes visible when its expression evaluates to 'm' or 'y'. There are two types of symbols: constant and non-constant symbols. diff --git a/Documentation/kernel-docs.txt b/Documentation/kernel-docs.txt index 28cdc2af213..ec8d31ee12e 100644 --- a/Documentation/kernel-docs.txt +++ b/Documentation/kernel-docs.txt @@ -116,7 +116,7 @@ Author: Ingo Molnar, Gadi Oxman and Miguel de Icaza. URL: http://www.linuxjournal.com/article.php?sid=2391 Keywords: RAID, MD driver. - Description: Linux Journal Kernel Korner article. Here is it's + Description: Linux Journal Kernel Korner article. Here is its abstract: "A description of the implementation of the RAID-1, RAID-4 and RAID-5 personalities of the MD device driver in the Linux kernel, providing users with high performance and reliable, @@ -127,7 +127,7 @@ URL: http://www.linuxjournal.com/article.php?sid=1219 Keywords: device driver, module, loading/unloading modules, allocating resources. - Description: Linux Journal Kernel Korner article. Here is it's + Description: Linux Journal Kernel Korner article. Here is its abstract: "This is the first of a series of four articles co-authored by Alessandro Rubini and Georg Zezchwitz which present a practical approach to writing Linux device drivers as kernel @@ -141,7 +141,7 @@ Keywords: character driver, init_module, clean_up module, autodetection, mayor number, minor number, file operations, open(), close(). - Description: Linux Journal Kernel Korner article. Here is it's + Description: Linux Journal Kernel Korner article. Here is its abstract: "This article, the second of four, introduces part of the actual code to create custom module implementing a character device driver. It describes the code for module initialization and @@ -152,7 +152,7 @@ URL: http://www.linuxjournal.com/article.php?sid=1221 Keywords: read(), write(), select(), ioctl(), blocking/non blocking mode, interrupt handler. - Description: Linux Journal Kernel Korner article. Here is it's + Description: Linux Journal Kernel Korner article. Here is its abstract: "This article, the third of four on writing character device drivers, introduces concepts of reading, writing, and using ioctl-calls". @@ -161,7 +161,7 @@ Author: Alessandro Rubini and Georg v. Zezschwitz. URL: http://www.linuxjournal.com/article.php?sid=1222 Keywords: interrupts, irqs, DMA, bottom halves, task queues. - Description: Linux Journal Kernel Korner article. Here is it's + Description: Linux Journal Kernel Korner article. Here is its abstract: "This is the fourth in a series of articles about writing character device drivers as loadable kernel modules. This month, we further investigate the field of interrupt handling. diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 2f9115c0ae6..51ec634ac04 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt @@ -332,7 +332,7 @@ occurs during execution of kp->pre_handler or kp->post_handler, or during single-stepping of the probed instruction, Kprobes calls kp->fault_handler. Any or all handlers can be NULL. If kp->flags is set KPROBE_FLAG_DISABLED, that kp will be registered but disabled, -so, it's handlers aren't hit until calling enable_kprobe(kp). +so, its handlers aren't hit until calling enable_kprobe(kp). NOTE: 1. With the introduction of the "symbol_name" field to struct kprobe, diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt index 2c3c3509302..0bf25eebce9 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.txt @@ -207,7 +207,7 @@ Tips & Tricks * Drew Scott Daniels observed: "I don't know why, but when I decrease the number of colours that my display uses it consumes less battery power. I've seen this on powerbooks too. I hope that this is a piece of information that - might be useful to the Laptop Mode patch or it's users." + might be useful to the Laptop Mode patch or its users." * In syslog.conf, you can prefix entries with a dash ``-'' to omit syncing the file after every logging. When you're using laptop-mode and your disk doesn't diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 3119f5db75b..e9ce3c55451 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -263,7 +263,7 @@ static u8 *get_feature_bits(struct device *dev) * Launcher virtual with an offset. * * This can be tough to get your head around, but usually it just means that we - * use these trivial conversion functions when the Guest gives us it's + * use these trivial conversion functions when the Guest gives us its * "physical" addresses: */ static void *from_guest_phys(unsigned long addr) diff --git a/Documentation/md.txt b/Documentation/md.txt index 188f4768f1d..e4e893ef3e0 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt @@ -136,7 +136,7 @@ raid_disks != 0. Then uninitialized devices can be added with ADD_NEW_DISK. The structure passed to ADD_NEW_DISK must specify the state of the device -and it's role in the array. +and its role in the array. Once started with RUN_ARRAY, uninitialized spares can be added with HOT_ADD_DISK. diff --git a/Documentation/netlabel/lsm_interface.txt b/Documentation/netlabel/lsm_interface.txt index 98dd9f7430f..638c74f7de7 100644 --- a/Documentation/netlabel/lsm_interface.txt +++ b/Documentation/netlabel/lsm_interface.txt @@ -38,7 +38,7 @@ Depending on the exact configuration, translation between the network packet label and the internal LSM security identifier can be time consuming. The NetLabel label mapping cache is a caching mechanism which can be used to sidestep much of this overhead once a mapping has been established. Once the -LSM has received a packet, used NetLabel to decode it's security attributes, +LSM has received a packet, used NetLabel to decode its security attributes, and translated the security attributes into a LSM internal identifier the LSM can use the NetLabel caching functions to associate the LSM internal identifier with the network packet's label. This means that in the future diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c index 1b96ccda383..2bac9618c34 100644 --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c @@ -756,7 +756,7 @@ static int enslave(char *master_ifname, char *slave_ifname) */ if (abi_ver < 1) { /* For old ABI, the master needs to be - * down before setting it's hwaddr + * down before setting its hwaddr */ res = set_if_down(master_ifname, master_flags.ifr_flags); if (res) { diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 09ab0d29032..98f71a5cef0 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt @@ -100,7 +100,7 @@ by the kernel. The destruction of the socket and all associated resources is done by a simple call to close(fd). -Next I will describe PACKET_MMAP settings and it's constraints, +Next I will describe PACKET_MMAP settings and its constraints, also the mapping of the circular buffer in the user process and the use of this buffer. @@ -432,7 +432,7 @@ TP_STATUS_LOSING : indicates there were packet drops from last time the PACKET_STATISTICS option. TP_STATUS_CSUMNOTREADY: currently it's used for outgoing IP packets which - it's checksum will be done in hardware. So while + its checksum will be done in hardware. So while reading the packet we should not try to check the checksum. diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt index cdebb5145c2..55c4175d809 100644 --- a/Documentation/power/regulator/consumer.txt +++ b/Documentation/power/regulator/consumer.txt @@ -8,11 +8,11 @@ Please see overview.txt for a description of the terms used in this text. 1. Consumer Regulator Access (static & dynamic drivers) ======================================================= -A consumer driver can get access to it's supply regulator by calling :- +A consumer driver can get access to its supply regulator by calling :- regulator = regulator_get(dev, "Vcc"); -The consumer passes in it's struct device pointer and power supply ID. The core +The consumer passes in its struct device pointer and power supply ID. The core then finds the correct regulator by consulting a machine specific lookup table. If the lookup is successful then this call will return a pointer to the struct regulator that supplies this consumer. @@ -34,7 +34,7 @@ usually be called in your device drivers probe() and remove() respectively. 2. Regulator Output Enable & Disable (static & dynamic drivers) ==================================================================== -A consumer can enable it's power supply by calling:- +A consumer can enable its power supply by calling:- int regulator_enable(regulator); @@ -49,7 +49,7 @@ int regulator_is_enabled(regulator); This will return > zero when the regulator is enabled. -A consumer can disable it's supply when no longer needed by calling :- +A consumer can disable its supply when no longer needed by calling :- int regulator_disable(regulator); @@ -140,7 +140,7 @@ by calling :- int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); This will cause the core to recalculate the total load on the regulator (based -on all it's consumers) and change operating mode (if necessary and permitted) +on all its consumers) and change operating mode (if necessary and permitted) to best match the current operating load. The load_uA value can be determined from the consumers datasheet. e.g.most diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index 63728fed620..bdec39b9bd7 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt @@ -52,7 +52,7 @@ static struct regulator_init_data regulator1_data = { }; Regulator-1 supplies power to Regulator-2. This relationship must be registered -with the core so that Regulator-1 is also enabled when Consumer A enables it's +with the core so that Regulator-1 is also enabled when Consumer A enables its supply (Regulator-2). The supply regulator is set by the supply_regulator_dev field below:- diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt index ffd185bb605..9363e056188 100644 --- a/Documentation/power/regulator/overview.txt +++ b/Documentation/power/regulator/overview.txt @@ -35,16 +35,16 @@ Some terms used in this document:- o Consumer - Electronic device that is supplied power by a regulator. Consumers can be classified into two types:- - Static: consumer does not change it's supply voltage or + Static: consumer does not change its supply voltage or current limit. It only needs to enable or disable it's - power supply. It's supply voltage is set by the hardware, + power supply. Its supply voltage is set by the hardware, bootloader, firmware or kernel board initialisation code. Dynamic: consumer needs to change it's supply voltage or current limit to meet operation demands. - o Power Domain - Electronic circuit that is supplied it's input power by the + o Power Domain - Electronic circuit that is supplied its input power by the output power of a regulator, switch or by another power domain. diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 79f533f38c6..46d22105aa0 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt @@ -1289,7 +1289,7 @@ link between a device node and its interrupt parent in the interrupt tree. The value of interrupt-parent is the phandle of the parent node. -If the interrupt-parent property is not defined for a node, it's +If the interrupt-parent property is not defined for a node, its interrupt parent is assumed to be an ancestor in the node's _device tree_ hierarchy. diff --git a/Documentation/powerpc/phyp-assisted-dump.txt b/Documentation/powerpc/phyp-assisted-dump.txt index c4682b982a2..ad340205d96 100644 --- a/Documentation/powerpc/phyp-assisted-dump.txt +++ b/Documentation/powerpc/phyp-assisted-dump.txt @@ -19,7 +19,7 @@ dump offers several strong, practical advantages: immediately available to the system for normal use. -- After the dump is completed, no further reboots are required; the system will be fully usable, and running - in it's normal, production mode on it normal kernel. + in its normal, production mode on its normal kernel. The above can only be accomplished by coordination with, and assistance from the hypervisor. The procedure is diff --git a/Documentation/rt-mutex-design.txt b/Documentation/rt-mutex-design.txt index 4b736d24da7..8df0b782c4d 100644 --- a/Documentation/rt-mutex-design.txt +++ b/Documentation/rt-mutex-design.txt @@ -657,7 +657,7 @@ here. The waiter structure has a "task" field that points to the task that is blocked on the mutex. This field can be NULL the first time it goes through the loop -or if the task is a pending owner and had it's mutex stolen. If the "task" +or if the task is a pending owner and had its mutex stolen. If the "task" field is NULL then we need to set up the accounting for it. Task blocks on mutex diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc index 2ffc1148eb9..e759e92e286 100644 --- a/Documentation/scsi/ChangeLog.lpfc +++ b/Documentation/scsi/ChangeLog.lpfc @@ -707,7 +707,7 @@ Changes from 20040920 to 20041018 * Integrate patches from Christoph Hellwig: two new helpers common to lpfc_sli_resume_iocb and lpfc_sli_issue_iocb - singificant cleanup of those two functions - the unused SLI_IOCB_USE_TXQ is - gone - lpfc_sli_issue_iocb_wait loses it's flags argument + gone - lpfc_sli_issue_iocb_wait loses its flags argument totally. * Fix in lpfc_sli.c: we can not store a 5 bit value in a 4-bit field. @@ -1028,7 +1028,7 @@ Changes from 20040614 to 20040709 * Remove the need for buf_tmo. * Changed ULP_BDE64 to struct ulp_bde64. * Changed ULP_BDE to struct ulp_bde. - * Cleanup lpfc_os_return_scsi_cmd() and it's call path. + * Cleanup lpfc_os_return_scsi_cmd() and its call path. * Removed lpfc_no_device_delay. * Consolidating lpfc_hba_put_event() into lpfc_put_event(). * Removed following attributes and their functionality: diff --git a/Documentation/scsi/FlashPoint.txt b/Documentation/scsi/FlashPoint.txt index d5acaa300a4..1540a92f6d2 100644 --- a/Documentation/scsi/FlashPoint.txt +++ b/Documentation/scsi/FlashPoint.txt @@ -71,7 +71,7 @@ peters@mylex.com Ever since its introduction last October, the BusLogic FlashPoint LT has been problematic for members of the Linux community, in that no Linux -drivers have been available for this new Ultra SCSI product. Despite it's +drivers have been available for this new Ultra SCSI product. Despite its officially being positioned as a desktop workstation product, and not being particularly well suited for a high performance multitasking operating system like Linux, the FlashPoint LT has been touted by computer system diff --git a/Documentation/scsi/dtc3x80.txt b/Documentation/scsi/dtc3x80.txt index e8ae6230ab3..1d7af9f9a8e 100644 --- a/Documentation/scsi/dtc3x80.txt +++ b/Documentation/scsi/dtc3x80.txt @@ -12,7 +12,7 @@ The 3180 does not. Otherwise, they are identical. The DTC3x80 does not support DMA but it does have Pseudo-DMA which is supported by the driver. -It's DTC406 scsi chip is supposedly compatible with the NCR 53C400. +Its DTC406 scsi chip is supposedly compatible with the NCR 53C400. It is memory mapped, uses an IRQ, but no dma or io-port. There is internal DMA, between SCSI bus and an on-chip 128-byte buffer. Double buffering is done automagically by the chip. Data is transferred diff --git a/Documentation/scsi/ncr53c8xx.txt b/Documentation/scsi/ncr53c8xx.txt index 08e2b4d04aa..cda5f8fa2c6 100644 --- a/Documentation/scsi/ncr53c8xx.txt +++ b/Documentation/scsi/ncr53c8xx.txt @@ -1479,7 +1479,7 @@ Wide16 SCSI. Enabling serial NVRAM support enables detection of the serial NVRAM included on Symbios and some Symbios compatible host adaptors, and Tekram boards. The serial NVRAM is used by Symbios and Tekram to hold set up parameters for the -host adaptor and it's attached drives. +host adaptor and its attached drives. The Symbios NVRAM also holds data on the boot order of host adaptors in a system with more than one host adaptor. This enables the order of scanning diff --git a/Documentation/scsi/osst.txt b/Documentation/scsi/osst.txt index f536907e241..2b21890bc98 100644 --- a/Documentation/scsi/osst.txt +++ b/Documentation/scsi/osst.txt @@ -40,7 +40,7 @@ behavior looks very much the same as st to the userspace applications. History ------- -In the first place, osst shared it's identity very much with st. That meant +In the first place, osst shared its identity very much with st. That meant that it used the same kernel structures and the same device node as st. So you could only have either of them being present in the kernel. This has been fixed by registering an own device, now. diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt index aec6549ab09..e00192de4d1 100644 --- a/Documentation/scsi/scsi_fc_transport.txt +++ b/Documentation/scsi/scsi_fc_transport.txt @@ -70,7 +70,7 @@ Overview: up to an administrative entity controlling the vport. For example, if vports are to be associated with virtual machines, a XEN mgmt utility would be responsible for creating wwpn/wwnn's for the vport, - using it's own naming authority and OUI. (Note: it already does this + using its own naming authority and OUI. (Note: it already does this for virtual MAC addresses). @@ -81,7 +81,7 @@ Device Trees and Vport Objects: with rports and scsi target objects underneath it. Currently the FC transport creates the vport object and places it under the scsi_host object corresponding to the physical adapter. The LLDD will allocate - a new scsi_host for the vport and link it's object under the vport. + a new scsi_host for the vport and link its object under the vport. The remainder of the tree under the vports scsi_host is the same as the non-NPIV case. The transport is written currently to easily allow the parent of the vport to be something other than the scsi_host. diff --git a/Documentation/scsi/sym53c8xx_2.txt b/Documentation/scsi/sym53c8xx_2.txt index eb9a7b905b6..6f63b798967 100644 --- a/Documentation/scsi/sym53c8xx_2.txt +++ b/Documentation/scsi/sym53c8xx_2.txt @@ -687,7 +687,7 @@ maintain the driver code. Enabling serial NVRAM support enables detection of the serial NVRAM included on Symbios and some Symbios compatible host adaptors, and Tekram boards. The serial NVRAM is used by Symbios and Tekram to hold set up parameters for the -host adaptor and it's attached drives. +host adaptor and its attached drives. The Symbios NVRAM also holds data on the boot order of host adaptors in a system with more than one host adaptor. This information is no longer used diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt index 9ac842be9b4..05bf5a0eee4 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/alsa/soc/dapm.txt @@ -188,8 +188,8 @@ The WM8731 output mixer has 3 inputs (sources) 3. Mic Sidetone Input Each input in this example has a kcontrol associated with it (defined in example -above) and is connected to the output mixer via it's kcontrol name. We can now -connect the destination widget (wrt audio signal) with it's source widgets. +above) and is connected to the output mixer via its kcontrol name. We can now +connect the destination widget (wrt audio signal) with its source widgets. /* output mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index bab7711ce96..2524c75557d 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt @@ -67,7 +67,7 @@ static struct snd_soc_dai_link corgi_dai = { .ops = &corgi_ops, }; -struct snd_soc_card then sets up the machine with it's DAIs. e.g. +struct snd_soc_card then sets up the machine with its DAIs. e.g. /* corgi audio machine driver */ static struct snd_soc_card snd_soc_corgi = { diff --git a/Documentation/sound/alsa/soc/overview.txt b/Documentation/sound/alsa/soc/overview.txt index 1e4c6d3655f..138ac88c146 100644 --- a/Documentation/sound/alsa/soc/overview.txt +++ b/Documentation/sound/alsa/soc/overview.txt @@ -33,7 +33,7 @@ features :- and machines. * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC - interface and codec registers it's audio interface capabilities with the + interface and codec registers its audio interface capabilities with the core and are subsequently matched and configured when the application hardware parameters are known. diff --git a/Documentation/usb/WUSB-Design-overview.txt b/Documentation/usb/WUSB-Design-overview.txt index c480e9c32db..4c5e3793934 100644 --- a/Documentation/usb/WUSB-Design-overview.txt +++ b/Documentation/usb/WUSB-Design-overview.txt @@ -381,7 +381,7 @@ descriptor that gives us the status of the transfer, its identification we issue another URB to read into the destination buffer the chunk of data coming out of the remote endpoint. Done, wait for the next guy. The callbacks for the URBs issued from here are the ones that will declare -the xfer complete at some point and call it's callback. +the xfer complete at some point and call its callback. Seems simple, but the implementation is not trivial. diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt index be45dbb9d7f..6690fc34ef6 100644 --- a/Documentation/vm/numa_memory_policy.txt +++ b/Documentation/vm/numa_memory_policy.txt @@ -45,7 +45,7 @@ most general to most specific: to establish the task policy for a child task exec()'d from an executable image that has no awareness of memory policy. See the MEMORY POLICY APIS section, below, for an overview of the system call - that a task may use to set/change it's task/process policy. + that a task may use to set/change its task/process policy. In a multi-threaded task, task policies apply only to the thread [Linux kernel task] that installs the policy and any threads @@ -301,7 +301,7 @@ decrement this reference count, respectively. mpol_put() will only free the structure back to the mempolicy kmem cache when the reference count goes to zero. -When a new memory policy is allocated, it's reference count is initialized +When a new memory policy is allocated, its reference count is initialized to '1', representing the reference held by the task that is installing the new policy. When a pointer to a memory policy structure is stored in another structure, another reference is added, as the task's reference will be dropped diff --git a/Documentation/w1/w1.generic b/Documentation/w1/w1.generic index e3333eec432..212f4ac31c0 100644 --- a/Documentation/w1/w1.generic +++ b/Documentation/w1/w1.generic @@ -25,7 +25,7 @@ When a w1 master driver registers with the w1 subsystem, the following occurs: - sysfs entries for that w1 master are created - the w1 bus is periodically searched for new slave devices -When a device is found on the bus, w1 core checks if driver for it's family is +When a device is found on the bus, w1 core checks if driver for its family is loaded. If so, the family driver is attached to the slave. If there is no driver for the family, default one is assigned, which allows to perform almost any kind of operations. Each logical operation is a transaction -- cgit v1.2.2 From 15d8ee9a96e5019e698ad3c2c181970deb8ff888 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Wed, 21 Apr 2010 22:16:25 +0100 Subject: HID: wacom: add ABI doc entry for speed attribute Signed-off-by: Przemo Firszt Signed-off-by: Jiri Kosina --- Documentation/ABI/testing/sysfs-wacom | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-wacom (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-wacom b/Documentation/ABI/testing/sysfs-wacom new file mode 100644 index 00000000000..1517976e25c --- /dev/null +++ b/Documentation/ABI/testing/sysfs-wacom @@ -0,0 +1,10 @@ +What: /sys/class/hidraw/hidraw*/device/speed +Date: April 2010 +Kernel Version: 2.6.35 +Contact: linux-bluetooth@vger.kernel.org +Description: + The /sys/class/hidraw/hidraw*/device/speed file controls + reporting speed of wacom bluetooth tablet. Reading from + this file returns 1 if tablet reports in high speed mode + or 0 otherwise. Writing to this file one of these values + switches reporting speed. -- cgit v1.2.2 From 679613442f84702c06a80f2320cb8a50089200bc Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Sat, 13 Feb 2010 16:10:26 -0200 Subject: KVM: add doc note about PIO/MMIO completion API Document that partially emulated instructions leave the guest state inconsistent, and that the kernel will complete operations before checking for pending signals. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index c6416a39816..beb444a9501 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -820,6 +820,13 @@ executed a memory-mapped I/O instruction which could not be satisfied by kvm. The 'data' member contains the written data if 'is_write' is true, and should be filled by application code otherwise. +NOTE: For KVM_EXIT_IO and KVM_EXIT_MMIO, the corresponding operations +are complete (and guest state is consistent) only after userspace has +re-entered the kernel with KVM_RUN. The kernel side will first finish +incomplete operations and then check for pending signals. Userspace +can re-enter the guest with an unmasked signal pending to complete +pending operations. + /* KVM_EXIT_HYPERCALL */ struct { __u64 nr; -- cgit v1.2.2 From 48005f64d0ea965d454e38b5181af4aba9bdef5b Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 19 Feb 2010 19:38:07 +0100 Subject: KVM: x86: Save&restore interrupt shadow mask The interrupt shadow created by STI or MOV-SS-like operations is part of the VCPU state and must be preserved across migration. Transfer it in the spare padding field of kvm_vcpu_events.interrupt. As a side effect we now have to make vmx_set_interrupt_shadow robust against both shadow types being set. Give MOV SS a higher priority and skip STI in that case to avoid that VMX throws a fault on next entry. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index beb444a9501..9e5de5a1c4e 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -656,6 +656,7 @@ struct kvm_clock_data { 4.29 KVM_GET_VCPU_EVENTS Capability: KVM_CAP_VCPU_EVENTS +Extended by: KVM_CAP_INTR_SHADOW Architectures: x86 Type: vm ioctl Parameters: struct kvm_vcpu_event (out) @@ -676,7 +677,7 @@ struct kvm_vcpu_events { __u8 injected; __u8 nr; __u8 soft; - __u8 pad; + __u8 shadow; } interrupt; struct { __u8 injected; @@ -688,9 +689,13 @@ struct kvm_vcpu_events { __u32 flags; }; +KVM_VCPUEVENT_VALID_SHADOW may be set in the flags field to signal that +interrupt.shadow contains a valid state. Otherwise, this field is undefined. + 4.30 KVM_SET_VCPU_EVENTS Capability: KVM_CAP_VCPU_EVENTS +Extended by: KVM_CAP_INTR_SHADOW Architectures: x86 Type: vm ioctl Parameters: struct kvm_vcpu_event (in) @@ -709,6 +714,10 @@ current in-kernel state. The bits are: KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector +If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in +the flags field to signal that interrupt.shadow contains a valid state and +shall be written into the VCPU. + 5. The kvm_run structure -- cgit v1.2.2 From a1efbe77c1fd7c34a97a76a61520bf23fb3663f6 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 15 Feb 2010 10:45:43 +0100 Subject: KVM: x86: Add support for saving&restoring debug registers So far user space was not able to save and restore debug registers for migration or after reset. Plug this hole. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 9e5de5a1c4e..d170cb43554 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -718,6 +718,37 @@ If KVM_CAP_INTR_SHADOW is available, KVM_VCPUEVENT_VALID_SHADOW can be set in the flags field to signal that interrupt.shadow contains a valid state and shall be written into the VCPU. +4.32 KVM_GET_DEBUGREGS + +Capability: KVM_CAP_DEBUGREGS +Architectures: x86 +Type: vm ioctl +Parameters: struct kvm_debugregs (out) +Returns: 0 on success, -1 on error + +Reads debug registers from the vcpu. + +struct kvm_debugregs { + __u64 db[4]; + __u64 dr6; + __u64 dr7; + __u64 flags; + __u64 reserved[9]; +}; + +4.33 KVM_SET_DEBUGREGS + +Capability: KVM_CAP_DEBUGREGS +Architectures: x86 +Type: vm ioctl +Parameters: struct kvm_debugregs (in) +Returns: 0 on success, -1 on error + +Writes debug registers into the vcpu. + +See KVM_GET_DEBUGREGS for the data structure. The flags field is unused +yet and must be cleared on entry. + 5. The kvm_run structure -- cgit v1.2.2 From afc24d49c1e5dbeef745c1c1246f5ae6ebd97c71 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Mon, 26 Apr 2010 19:27:56 +0200 Subject: blk-cgroup: config options re-arrangement This patch fixes few usability and configurability issues. o All the cgroup based controller options are configurable from "Genral Setup/Control Group Support/" menu. blkio is the only exception. Hence make this option visible in above menu and make it configurable from there to bring it inline with rest of the cgroup based controllers. o Get rid of CONFIG_DEBUG_CFQ_IOSCHED. This option currently does two things. - Enable printing of cgroup paths in blktrace - Enables CONFIG_DEBUG_BLK_CGROUP, which in turn displays additional stat files in cgroup. If we are using group scheduling, blktrace data is of not really much use if cgroup information is not present. To get this data, currently one has to also enable CONFIG_DEBUG_CFQ_IOSCHED, which in turn brings the overhead of all the additional debug stat files which is not desired. Hence, this patch moves printing of cgroup paths under CONFIG_CFQ_GROUP_IOSCHED. This allows us to get rid of CONFIG_DEBUG_CFQ_IOSCHED completely. Now all the debug stat files are controlled only by CONFIG_DEBUG_BLK_CGROUP which can be enabled through config menu. Signed-off-by: Vivek Goyal Acked-by: Divyesh Shah Reviewed-by: Gui Jianfeng Signed-off-by: Jens Axboe --- Documentation/cgroups/blkio-controller.txt | 35 +++++++++++++----------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'Documentation') diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt index d422b410a99..48e0b21b005 100644 --- a/Documentation/cgroups/blkio-controller.txt +++ b/Documentation/cgroups/blkio-controller.txt @@ -17,6 +17,9 @@ HOWTO You can do a very simple testing of running two dd threads in two different cgroups. Here is what you can do. +- Enable Block IO controller + CONFIG_BLK_CGROUP=y + - Enable group scheduling in CFQ CONFIG_CFQ_GROUP_IOSCHED=y @@ -54,24 +57,16 @@ cgroups. Here is what you can do. Various user visible config options =================================== -CONFIG_CFQ_GROUP_IOSCHED - - Enables group scheduling in CFQ. Currently only 1 level of group - creation is allowed. - -CONFIG_DEBUG_CFQ_IOSCHED - - Enables some debugging messages in blktrace. Also creates extra - cgroup file blkio.dequeue. - -Config options selected automatically -===================================== -These config options are not user visible and are selected/deselected -automatically based on IO scheduler configuration. - CONFIG_BLK_CGROUP - - Block IO controller. Selected by CONFIG_CFQ_GROUP_IOSCHED. + - Block IO controller. CONFIG_DEBUG_BLK_CGROUP - - Debug help. Selected by CONFIG_DEBUG_CFQ_IOSCHED. + - Debug help. Right now some additional stats file show up in cgroup + if this option is enabled. + +CONFIG_CFQ_GROUP_IOSCHED + - Enables group scheduling in CFQ. Currently only 1 level of group + creation is allowed. Details of cgroup files ======================= @@ -174,13 +169,13 @@ Details of cgroup files write, sync or async. - blkio.avg_queue_size - - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + - Debugging aid only enabled if CONFIG_DEBUG_BLK_CGROUP=y. The average queue size for this cgroup over the entire time of this cgroup's existence. Queue size samples are taken each time one of the queues of this cgroup gets a timeslice. - blkio.group_wait_time - - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + - Debugging aid only enabled if CONFIG_DEBUG_BLK_CGROUP=y. This is the amount of time the cgroup had to wait since it became busy (i.e., went from 0 to 1 request queued) to get a timeslice for one of its queues. This is different from the io_wait_time which is the @@ -191,7 +186,7 @@ Details of cgroup files got a timeslice and will not include the current delta. - blkio.empty_time - - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + - Debugging aid only enabled if CONFIG_DEBUG_BLK_CGROUP=y. This is the amount of time a cgroup spends without any pending requests when not being served, i.e., it does not include any time spent idling for one of the queues of the cgroup. This is in @@ -200,7 +195,7 @@ Details of cgroup files time it had a pending request and will not include the current delta. - blkio.idle_time - - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. + - Debugging aid only enabled if CONFIG_DEBUG_BLK_CGROUP=y. This is the amount of time spent by the IO scheduler idling for a given cgroup in anticipation of a better request than the exising ones from other queues/cgroups. This is in nanoseconds. If this is read @@ -209,7 +204,7 @@ Details of cgroup files the current delta. - blkio.dequeue - - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This + - Debugging aid only enabled if CONFIG_DEBUG_BLK_CGROUP=y. This gives the statistics about how many a times a group was dequeued from service tree of the device. First two fields specify the major and minor number of the device and third field specifies the number -- cgit v1.2.2 From b03df87d119f50715891dcc09e487f6ae5c029f1 Mon Sep 17 00:00:00 2001 From: "Serge E. Hallyn" Date: Mon, 26 Apr 2010 11:58:49 +0100 Subject: CRED: Holding a spinlock does not imply the holding of RCU read lock Change the credentials documentation to make it clear that the RCU read lock must be explicitly held when accessing credentials pointers in some other task than current. Holding a spinlock does not implicitly hold the RCU read lock. Signed-off-by: Serge Hallyn Reviewed-by: Paul E. McKenney Signed-off-by: David Howells Signed-off-by: James Morris --- Documentation/credentials.txt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Documentation') diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt index df03169782e..a2db3528700 100644 --- a/Documentation/credentials.txt +++ b/Documentation/credentials.txt @@ -408,9 +408,6 @@ This should be used inside the RCU read lock, as in the following example: ... } -A function need not get RCU read lock to use __task_cred() if it is holding a -spinlock at the time as this implicitly holds the RCU read lock. - Should it be necessary to hold another task's credentials for a long period of time, and possibly to sleep whilst doing so, then the caller should get a reference on them using: @@ -426,17 +423,16 @@ credentials, hiding the RCU magic from the caller: uid_t task_uid(task) Task's real UID uid_t task_euid(task) Task's effective UID -If the caller is holding a spinlock or the RCU read lock at the time anyway, -then: +If the caller is holding the RCU read lock at the time anyway, then: __task_cred(task)->uid __task_cred(task)->euid should be used instead. Similarly, if multiple aspects of a task's credentials -need to be accessed, RCU read lock or a spinlock should be used, __task_cred() -called, the result stored in a temporary pointer and then the credential -aspects called from that before dropping the lock. This prevents the -potentially expensive RCU magic from being invoked multiple times. +need to be accessed, RCU read lock should be used, __task_cred() called, the +result stored in a temporary pointer and then the credential aspects called +from that before dropping the lock. This prevents the potentially expensive +RCU magic from being invoked multiple times. Should some other single aspect of another task's credentials need to be accessed, then this can be used: -- cgit v1.2.2 From 0b5adf92ec793c665b0de63ac146d190a921c391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= Date: Sun, 25 Apr 2010 21:29:16 +0200 Subject: HID: split picolcd's operation_mode sysfs attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original operation_mode sysfs attribute accepts the operation mode as main value with an option delay as second value to change the start-up delay on mode change. As it is preferred to have exactly one value per sysfs attribute, extract this delay into a separate sysfs attribute called operation_mode_delay. Signed-off-by: Bruno Prémont Signed-off-by: Jiri Kosina --- Documentation/ABI/testing/sysfs-driver-hid-picolcd | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-driver-hid-picolcd b/Documentation/ABI/testing/sysfs-driver-hid-picolcd index 14f52d70621..08579e7e1e8 100644 --- a/Documentation/ABI/testing/sysfs-driver-hid-picolcd +++ b/Documentation/ABI/testing/sysfs-driver-hid-picolcd @@ -8,12 +8,21 @@ Description: Make it possible to switch the PicoLCD device between LCD enclosed in brackets ('[' and ']') Writing: causes operation mode switch. Permitted values are - the non-active mode names listed when read, optionally followed - by a delay value expressed in ms. + the non-active mode names listed when read. Note: when switching mode the current PicoLCD HID device gets - disconnected and reconnects after above delay (default value - is 5 seconds though this default should not be relied on). + disconnected and reconnects after above delay (see attribute + operation_mode_delay for its value). + + +What: /sys/bus/usb/devices/-:./::./operation_mode_delay +Date: April 2010 +Contact: Bruno Prémont +Description: Delay PicoLCD waits before restarting in new mode when + operation_mode has changed. + + Reading/Writing: It is expressed in ms and permitted range is + 0..30000ms. What: /sys/bus/usb/devices/-:./::./fb_update_rate -- cgit v1.2.2 From 07271aa42d13378e67ebd79ea9ca1c4a5e2ad46f Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Fri, 23 Apr 2010 14:02:39 -0400 Subject: tracing: Add documentation for trace commands mod, traceon/traceoff The mod command went in as commit 64e7c440618998fd69eee6ab490b042d12248021 The traceon/traceoff commands went in as commit 23b4ff3aa479c9e3bb23cb6b2d0a97878399784a Signed-off-by: Chase Douglas LKML-Reference: <1272045759-32018-1-git-send-email-chase.douglas@canonical.com> Signed-off-by: Steven Rostedt --- Documentation/trace/ftrace.txt | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'Documentation') diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 52011815c90..557c1edecca 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt @@ -155,6 +155,9 @@ of ftrace. Here is a list of some of the key files: to be traced. Echoing names of functions into this file will limit the trace to only those functions. + This interface also allows for commands to be used. See the + "Filter commands" section for more details. + set_ftrace_notrace: This has an effect opposite to that of @@ -1824,6 +1827,47 @@ this special filter via: echo > set_graph_function +Filter commands +--------------- + +A few commands are supported by the set_ftrace_filter interface. +Trace commands have the following format: + +:: + +The following commands are supported: + +- mod + This command enables function filtering per module. The + parameter defines the module. For example, if only the write* + functions in the ext3 module are desired, run: + + echo 'write*:mod:ext3' > set_ftrace_filter + + This command interacts with the filter in the same way as + filtering based on function names. Thus, adding more functions + in a different module is accomplished by appending (>>) to the + filter file. Remove specific module functions by prepending + '!': + + echo '!writeback*:mod:ext3' >> set_ftrace_filter + +- traceon/traceoff + These commands turn tracing on and off when the specified + functions are hit. The parameter determines how many times the + tracing system is turned on and off. If unspecified, there is + no limit. For example, to disable tracing when a schedule bug + is hit the first 5 times, run: + + echo '__schedule_bug:traceoff:5' > set_ftrace_filter + + These commands are cumulative whether or not they are appended + to set_ftrace_filter. To remove a command, prepend it by '!' + and drop the parameter: + + echo '!__schedule_bug:traceoff' > set_ftrace_filter + + trace_pipe ---------- -- cgit v1.2.2 From 05be7a868e229b26a5a7de217343f39b4dfed205 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Tue, 27 Apr 2010 16:20:15 -0400 Subject: doc: Change urls for sparse The location of the sparse web page and git tree were no longer valid. This changes them to point to the current versions. Signed-off-by: Bill Pemberton Signed-off-by: Jiri Kosina --- Documentation/sparse.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt index 34c76a55bc0..9b659c79a54 100644 --- a/Documentation/sparse.txt +++ b/Documentation/sparse.txt @@ -54,12 +54,12 @@ Getting sparse ~~~~~~~~~~~~~~ You can get latest released versions from the Sparse homepage at -http://www.kernel.org/pub/linux/kernel/people/josh/sparse/ +https://sparse.wiki.kernel.org/index.php/Main_Page Alternatively, you can get snapshots of the latest development version of sparse using git to clone.. - git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git + git://git.kernel.org/pub/scm/devel/sparse/sparse.git DaveJ has hourly generated tarballs of the git tree available at.. -- cgit v1.2.2 From 16b32e0c9eec1bb8d53deedcd9f4704a114d84bb Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Mon, 3 May 2010 23:29:58 -0700 Subject: Input: remove obsolete {corgi,spitz,tosa}kbd.c Signed-off-by: Eric Miao Signed-off-by: Dmitry Torokhov --- Documentation/feature-removal-schedule.txt | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index ed511af0f79..c8659ad40b5 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -520,17 +520,6 @@ Who: Hans de Goede ---------------------------- -What: corgikbd, spitzkbd, tosakbd driver -When: 2.6.35 -Files: drivers/input/keyboard/{corgi,spitz,tosa}kbd.c -Why: We now have a generic GPIO based matrix keyboard driver that - are fully capable of handling all the keys on these devices. - The original drivers manipulate the GPIO registers directly - and so are difficult to maintain. -Who: Eric Miao - ----------------------------- - What: corgi_ssp and corgi_ts driver When: 2.6.35 Files: arch/arm/mach-pxa/corgi_ssp.c, drivers/input/touchscreen/corgi_ts.c -- cgit v1.2.2 From 03d646e62b06e9364e2dbb939d67934c6c9826cd Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Mon, 21 Dec 2009 14:27:24 +0800 Subject: tracing: Make the documentation clear on trace_event boot option Make it clear that event-list is a comma separated list of events. Reported-by: KOSAKI Motohiro Signed-off-by: Li Zefan LKML-Reference: <4B2F154C.2060503@cn.fujitsu.com> Signed-off-by: Steven Rostedt --- Documentation/trace/events.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt index 02ac6ed38b2..778ddf38b82 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt @@ -90,7 +90,8 @@ In order to facilitate early boot debugging, use boot option: trace_event=[event-list] -The format of this boot option is the same as described in section 2.1. +event-list is a comma separated list of events. See section 2.1 for event +format. 3. Defining an event-enabled tracepoint ======================================= -- cgit v1.2.2 From a32fe93daf9c6b6ffbab1d9b9e2a8e4c335bda5c Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Tue, 27 Apr 2010 22:13:34 +0000 Subject: powerpc/4xx: Add optional "reset_type" property to control reboot via dts By setting "reset_type" to one of the following values, the default software reset mechanism may be overidden. Here the possible values of "reset_type": 1 - PPC4xx core reset 2 - PPC4xx chip reset 3 - PPC4xx system reset (default) This will be used by a new PPC440SPe board port, which needs a "chip reset" instead of the default "system reset" to be asserted. Signed-off-by: Stefan Roese Cc: Josh Boyer Cc: Benjamin Herrenschmidt Acked-by: Josh Boyer Signed-off-by: Josh Boyer --- Documentation/powerpc/dts-bindings/4xx/reboot.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/powerpc/dts-bindings/4xx/reboot.txt (limited to 'Documentation') diff --git a/Documentation/powerpc/dts-bindings/4xx/reboot.txt b/Documentation/powerpc/dts-bindings/4xx/reboot.txt new file mode 100644 index 00000000000..d7217260589 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/4xx/reboot.txt @@ -0,0 +1,18 @@ +Reboot property to control system reboot on PPC4xx systems: + +By setting "reset_type" to one of the following values, the default +software reset mechanism may be overidden. Here the possible values of +"reset_type": + + 1 - PPC4xx core reset + 2 - PPC4xx chip reset + 3 - PPC4xx system reset (default) + +Example: + + cpu@0 { + device_type = "cpu"; + model = "PowerPC,440SPe"; + ... + reset-type = <2>; /* Use chip-reset */ + }; -- cgit v1.2.2 From d02f00cc057809d96c044cc72d5b9809d59f7d49 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 7 Dec 2009 13:10:48 -0800 Subject: ocfs2: allocation reservations This patch improves Ocfs2 allocation policy by allowing an inode to reserve a portion of the local alloc bitmap for itself. The reserved portion (allocation window) is advisory in that other allocation windows might steal it if the local alloc bitmap becomes full. Otherwise, the reservations are honored and guaranteed to be free. When the local alloc window is moved to a different portion of the bitmap, existing reservations are discarded. Reservation windows are represented internally by a red-black tree. Within that tree, each node represents the reservation window of one inode. An LRU of active reservations is also maintained. When new data is written, we allocate it from the inodes window. When all bits in a window are exhausted, we allocate a new one as close to the previous one as possible. Should we not find free space, an existing reservation is pulled off the LRU and cannibalized. Signed-off-by: Mark Fasheh --- Documentation/filesystems/ocfs2.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index c58b9f5ba00..412df909593 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt @@ -80,3 +80,6 @@ user_xattr (*) Enables Extended User Attributes. nouser_xattr Disables Extended User Attributes. acl Enables POSIX Access Control Lists support. noacl (*) Disables POSIX Access Control Lists support. +resv_level=4 (*) Set how agressive allocation reservations will be. + Valid values are between 0 (reservations off) to 8 + (maximum space for reservations). -- cgit v1.2.2 From b07f8f24dfe54da0f074b78949044842e8df881f Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 5 Apr 2010 18:17:15 -0700 Subject: ocfs2: change default reservation window sizes The default reservation size of 4 (32-bit windows) is a bit too ambitious. Scale it back to 16 bits (resv_level=2). I have been testing various sizes on a 4-node cluster which runs a mixed workload that is heavily threaded. With a 256MB local alloc, I get *roughly* the following levels of average file fragmentation: resv_level=0 70% resv_level=1 21% resv_level=2 23% resv_level=3 24% resv_level=4 60% resv_level=5 did not test resv_level=6 60% resv_level=2 seemed like a good compromise between not letting windows be too small, but not so big that heavier workloads will immediately suffer without tuning. This patch also change the behavior of directory reservations - they now track file reservations. The previous compromise of giving directory windows only 8 bits wound up fragmenting more at some window sizes because file allocations had smaller unused windows to poach from. Signed-off-by: Mark Fasheh Signed-off-by: Joel Becker --- Documentation/filesystems/ocfs2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index 412df909593..32339e584a9 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt @@ -80,6 +80,6 @@ user_xattr (*) Enables Extended User Attributes. nouser_xattr Disables Extended User Attributes. acl Enables POSIX Access Control Lists support. noacl (*) Disables POSIX Access Control Lists support. -resv_level=4 (*) Set how agressive allocation reservations will be. +resv_level=2 (*) Set how agressive allocation reservations will be. Valid values are between 0 (reservations off) to 8 (maximum space for reservations). -- cgit v1.2.2 From 83f92318fa33cc084e14e64dc903e605f75884c1 Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 5 Apr 2010 18:17:16 -0700 Subject: ocfs2: Add dir_resv_level mount option The default behavior for directory reservations stays the same, but we add a mount option so people can tweak the size of directory reservations according to their workloads. Signed-off-by: Mark Fasheh Signed-off-by: Joel Becker --- Documentation/filesystems/ocfs2.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index 32339e584a9..1f7ae144f6d 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt @@ -83,3 +83,7 @@ noacl (*) Disables POSIX Access Control Lists support. resv_level=2 (*) Set how agressive allocation reservations will be. Valid values are between 0 (reservations off) to 8 (maximum space for reservations). +dir_resv_level= (*) By default, directory reservations will scale with file + reservations - users should rarely need to change this + value. If allocation reservations are turned off, this + option will have no effect. -- cgit v1.2.2 From 969c79215a35b06e5e3efe69b9412f858df7856c Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 6 May 2010 18:49:21 +0200 Subject: sched: replace migration_thread with cpu_stop Currently migration_thread is serving three purposes - migration pusher, context to execute active_load_balance() and forced context switcher for expedited RCU synchronize_sched. All three roles are hardcoded into migration_thread() and determining which job is scheduled is slightly messy. This patch kills migration_thread and replaces all three uses with cpu_stop. The three different roles of migration_thread() are splitted into three separate cpu_stop callbacks - migration_cpu_stop(), active_load_balance_cpu_stop() and synchronize_sched_expedited_cpu_stop() - and each use case now simply asks cpu_stop to execute the callback as necessary. synchronize_sched_expedited() was implemented with private preallocated resources and custom multi-cpu queueing and waiting logic, both of which are provided by cpu_stop. synchronize_sched_expedited_count is made atomic and all other shared resources along with the mutex are dropped. synchronize_sched_expedited() also implemented a check to detect cases where not all the callback got executed on their assigned cpus and fall back to synchronize_sched(). If called with cpu hotplug blocked, cpu_stop already guarantees that and the condition cannot happen; otherwise, stop_machine() would break. However, this patch preserves the paranoid check using a cpumask to record on which cpus the stopper ran so that it can serve as a bisection point if something actually goes wrong theree. Because the internal execution state is no longer visible, rcu_expedited_torture_stats() is removed. This patch also renames cpu_stop threads to from "stopper/%d" to "migration/%d". The names of these threads ultimately don't matter and there's no reason to make unnecessary userland visible changes. With this patch applied, stop_machine() and sched now share the same resources. stop_machine() is faster without wasting any resources and sched migration users are much cleaner. Signed-off-by: Tejun Heo Acked-by: Peter Zijlstra Cc: Ingo Molnar Cc: Dipankar Sarma Cc: Josh Triplett Cc: Paul E. McKenney Cc: Oleg Nesterov Cc: Dimitri Sivanich --- Documentation/RCU/torture.txt | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt index 0e50bc2aa1e..5d9016795fd 100644 --- a/Documentation/RCU/torture.txt +++ b/Documentation/RCU/torture.txt @@ -182,16 +182,6 @@ Similarly, sched_expedited RCU provides the following: sched_expedited-torture: Reader Pipe: 12660320201 95875 0 0 0 0 0 0 0 0 0 sched_expedited-torture: Reader Batch: 12660424885 0 0 0 0 0 0 0 0 0 0 sched_expedited-torture: Free-Block Circulation: 1090795 1090795 1090794 1090793 1090792 1090791 1090790 1090789 1090788 1090787 0 - state: -1 / 0:0 3:0 4:0 - -As before, the first four lines are similar to those for RCU. -The last line shows the task-migration state. The first number is --1 if synchronize_sched_expedited() is idle, -2 if in the process of -posting wakeups to the migration kthreads, and N when waiting on CPU N. -Each of the colon-separated fields following the "/" is a CPU:state pair. -Valid states are "0" for idle, "1" for waiting for quiescent state, -"2" for passed through quiescent state, and "3" when a race with a -CPU-hotplug event forces use of the synchronize_sched() primitive. USAGE -- cgit v1.2.2 From 277a6a34175dcb0ee98dceee619e0e3190347a25 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Fri, 2 Apr 2010 18:02:33 +0900 Subject: nilfs2: change default of 'errors' mount option to 'remount-ro' mode Like ext3, nilfs has 'errors' mount option to allow specifying desired behavior on severe errors. Currently, the default action is 'errors=continue' and has potential to advance filesystem corruption for severe errors. This will change the action to 'errors=remount-ro' to avoid the issue. Signed-off-by: Ryusuke Konishi --- Documentation/filesystems/nilfs2.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt index cf6d0d85ca8..d3e7673995e 100644 --- a/Documentation/filesystems/nilfs2.txt +++ b/Documentation/filesystems/nilfs2.txt @@ -50,8 +50,8 @@ NILFS2 supports the following mount options: (*) == default nobarrier Disables barriers. -errors=continue(*) Keep going on a filesystem error. -errors=remount-ro Remount the filesystem read-only on an error. +errors=continue Keep going on a filesystem error. +errors=remount-ro(*) Remount the filesystem read-only on an error. errors=panic Panic and halt the machine if an error occurs. cp=n Specify the checkpoint-number of the snapshot to be mounted. Checkpoints and snapshots are listed by lscp -- cgit v1.2.2 From a20971b201ac1fcd236400942c98b0106c42c70a Mon Sep 17 00:00:00 2001 From: Krzysztof Helt Date: Mon, 10 May 2010 09:47:32 +0200 Subject: ALSA: Merge es1688 and es968 drivers The ESS ES968 chip is nothing more then a PnP companion for a non-PnP audio chip. It was paired with non-PnP ESS' chips: ES688 and ES1688. The ESS' audio chips are handled by the es1688 driver in native mode. The PnP cards are handled by the ES968 driver in SB compatible mode. Move the ES968 chip handling to the es1688 driver so the driver can handle both PnP and non-PnP cards. The es968 is removed. Also, a new PnP id is added for the card I acquired (the change was tested on this card). Signed-off-by: Krzysztof Helt Signed-off-by: Takashi Iwai --- Documentation/sound/alsa/ALSA-Configuration.txt | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'Documentation') diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index dc681badca6..2075bbb8b3e 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt @@ -632,28 +632,23 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. The power-management is supported. - Module snd-es968 - ---------------- - - Module for sound cards based on ESS ES968 chip (PnP only). - - This module supports multiple cards, PnP and autoprobe. - - The power-management is supported. - Module snd-es1688 ----------------- Module for ESS AudioDrive ES-1688 and ES-688 sound cards. - port - port # for ES-1688 chip (0x220,0x240,0x260) - fm_port - port # for OPL3 (option; share the same port as default) + isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default) - irq - IRQ # for ES-1688 chip (5,7,9,10) mpu_irq - IRQ # for MPU-401 port (5,7,9,10) + fm_port - port # for OPL3 (option; share the same port as default) + + with isapnp=0, the following additional options are available: + port - port # for ES-1688 chip (0x220,0x240,0x260) + irq - IRQ # for ES-1688 chip (5,7,9,10) dma8 - DMA # for ES-1688 chip (0,1,3) - This module supports multiple cards and autoprobe (without MPU-401 port). + This module supports multiple cards and autoprobe (without MPU-401 port) + and PnP with the ES968 chip. Module snd-es18xx ----------------- -- cgit v1.2.2 From eb14120f743d29744d9475bffec56ff4ad43a749 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 7 Mar 2010 12:21:16 +0100 Subject: pcmcia: re-work pcmcia_request_irq() Instead of the old pcmcia_request_irq() interface, drivers may now choose between: - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will clean up automatically on calls to pcmcia_disable_device() or device ejection. - drivers still not capable of IRQF_SHARED (or not telling us so) may use the deprecated pcmcia_request_exclusive_irq() for the time being; they might receive a shared IRQ nonetheless. CC: linux-bluetooth@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-usb@vger.kernel.org CC: linux-ide@vger.kernel.org Signed-off-by: Dominik Brodowski --- Documentation/pcmcia/driver-changes.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt index 446f43b309d..3268a9ae727 100644 --- a/Documentation/pcmcia/driver-changes.txt +++ b/Documentation/pcmcia/driver-changes.txt @@ -1,4 +1,14 @@ This file details changes in 2.6 which affect PCMCIA card driver authors: +* New IRQ request rules (as of 2.6.35) + Instead of the old pcmcia_request_irq() interface, drivers may now + choose between: + - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. + - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will + clean up automatically on calls to pcmcia_disable_device() or + device ejection. + - drivers still not capable of IRQF_SHARED (or not telling us so) may + use the deprecated pcmcia_request_exclusive_irq() for the time + being; they might receive a shared IRQ nonetheless. * no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33) Instead of the cs_error() callback or the CS_CHECK() macro, please use -- cgit v1.2.2 From b9300aa7449f6636b188743d09199dcf27b1a4b4 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 20 Mar 2010 19:43:40 +0100 Subject: pcmcia: dev_node removal (core) Remove the dev_node declaration. We now only pass the device name to the deprecated userspace tools. Signed-off-by: Dominik Brodowski --- Documentation/pcmcia/driver-changes.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt index 3268a9ae727..61bc4e94311 100644 --- a/Documentation/pcmcia/driver-changes.txt +++ b/Documentation/pcmcia/driver-changes.txt @@ -1,4 +1,7 @@ This file details changes in 2.6 which affect PCMCIA card driver authors: +* No dev_node_t (as of 2.6.35) + There is no more need to fill out a "dev_node_t" structure. + * New IRQ request rules (as of 2.6.35) Instead of the old pcmcia_request_irq() interface, drivers may now choose between: -- cgit v1.2.2 From a8cd4561ea176f51e9f4707873ca4eff8fd5ee70 Mon Sep 17 00:00:00 2001 From: Anand Gadiyar Date: Mon, 10 May 2010 14:51:19 +0530 Subject: fix "seperate" typos in comments s/seperate/separate Signed-off-by: Anand Gadiyar Signed-off-by: Jiri Kosina --- Documentation/filesystems/logfs.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/logfs.txt b/Documentation/filesystems/logfs.txt index e64c94ba401..bca42c22a14 100644 --- a/Documentation/filesystems/logfs.txt +++ b/Documentation/filesystems/logfs.txt @@ -59,7 +59,7 @@ Levels ------ Garbage collection (GC) may fail if all data is written -indiscriminately. One requirement of GC is that data is seperated +indiscriminately. One requirement of GC is that data is separated roughly according to the distance between the tree root and the data. Effectively that means all file data is on level 0, indirect blocks are on levels 1, 2, 3 4 or 5 for 1x, 2x, 3x, 4x or 5x indirect blocks, @@ -67,7 +67,7 @@ respectively. Inode file data is on level 6 for the inodes and 7-11 for indirect blocks. Each segment contains objects of a single level only. As a result, -each level requires its own seperate segment to be open for writing. +each level requires its own separate segment to be open for writing. Inode File ---------- @@ -106,9 +106,9 @@ Vim --- By cleverly predicting the life time of data, it is possible to -seperate long-living data from short-living data and thereby reduce +separate long-living data from short-living data and thereby reduce the GC overhead later. Each type of distinc life expectency (vim) can -have a seperate segment open for writing. Each (level, vim) tupel can +have a separate segment open for writing. Each (level, vim) tupel can be open just once. If an open segment with unknown vim is encountered at mount time, it is closed and ignored henceforth. -- cgit v1.2.2 From d21670acab9fcb4bc74a40b68a6941059234c55c Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Wed, 14 Apr 2010 17:39:26 -0700 Subject: rcu: reduce the number of spurious RCU_SOFTIRQ invocations Lai Jiangshan noted that up to 10% of the RCU_SOFTIRQ are spurious, and traced this down to the fact that the current grace-period machinery will uselessly raise RCU_SOFTIRQ when a given CPU needs to go through a quiescent state, but has not yet done so. In this situation, there might well be nothing that RCU_SOFTIRQ can do, and the overhead can be worth worrying about in the ksoftirqd case. This patch therefore avoids raising RCU_SOFTIRQ in this situation. Changes since v1 (http://lkml.org/lkml/2010/3/30/122 from Lai Jiangshan): o Omit the rcu_qs_pending() prechecks, as they aren't that much less expensive than the quiescent-state checks. o Merge with the set_need_resched() patch that reduces IPIs. o Add the new n_rp_report_qs field to the rcu_pending tracing output. o Update the tracing documentation accordingly. Signed-off-by: Lai Jiangshan Signed-off-by: Paul E. McKenney --- Documentation/RCU/trace.txt | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'Documentation') diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index 8608fd85e92..efd8cc95c06 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt @@ -256,23 +256,23 @@ o Each element of the form "1/1 0:127 ^0" represents one struct The output of "cat rcu/rcu_pending" looks as follows: rcu_sched: - 0 np=255892 qsp=53936 cbr=0 cng=14417 gpc=10033 gps=24320 nf=6445 nn=146741 - 1 np=261224 qsp=54638 cbr=0 cng=25723 gpc=16310 gps=2849 nf=5912 nn=155792 - 2 np=237496 qsp=49664 cbr=0 cng=2762 gpc=45478 gps=1762 nf=1201 nn=136629 - 3 np=236249 qsp=48766 cbr=0 cng=286 gpc=48049 gps=1218 nf=207 nn=137723 - 4 np=221310 qsp=46850 cbr=0 cng=26 gpc=43161 gps=4634 nf=3529 nn=123110 - 5 np=237332 qsp=48449 cbr=0 cng=54 gpc=47920 gps=3252 nf=201 nn=137456 - 6 np=219995 qsp=46718 cbr=0 cng=50 gpc=42098 gps=6093 nf=4202 nn=120834 - 7 np=249893 qsp=49390 cbr=0 cng=72 gpc=38400 gps=17102 nf=41 nn=144888 + 0 np=255892 qsp=53936 rpq=85 cbr=0 cng=14417 gpc=10033 gps=24320 nf=6445 nn=146741 + 1 np=261224 qsp=54638 rpq=33 cbr=0 cng=25723 gpc=16310 gps=2849 nf=5912 nn=155792 + 2 np=237496 qsp=49664 rpq=23 cbr=0 cng=2762 gpc=45478 gps=1762 nf=1201 nn=136629 + 3 np=236249 qsp=48766 rpq=98 cbr=0 cng=286 gpc=48049 gps=1218 nf=207 nn=137723 + 4 np=221310 qsp=46850 rpq=7 cbr=0 cng=26 gpc=43161 gps=4634 nf=3529 nn=123110 + 5 np=237332 qsp=48449 rpq=9 cbr=0 cng=54 gpc=47920 gps=3252 nf=201 nn=137456 + 6 np=219995 qsp=46718 rpq=12 cbr=0 cng=50 gpc=42098 gps=6093 nf=4202 nn=120834 + 7 np=249893 qsp=49390 rpq=42 cbr=0 cng=72 gpc=38400 gps=17102 nf=41 nn=144888 rcu_bh: - 0 np=146741 qsp=1419 cbr=0 cng=6 gpc=0 gps=0 nf=2 nn=145314 - 1 np=155792 qsp=12597 cbr=0 cng=0 gpc=4 gps=8 nf=3 nn=143180 - 2 np=136629 qsp=18680 cbr=0 cng=0 gpc=7 gps=6 nf=0 nn=117936 - 3 np=137723 qsp=2843 cbr=0 cng=0 gpc=10 gps=7 nf=0 nn=134863 - 4 np=123110 qsp=12433 cbr=0 cng=0 gpc=4 gps=2 nf=0 nn=110671 - 5 np=137456 qsp=4210 cbr=0 cng=0 gpc=6 gps=5 nf=0 nn=133235 - 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 - 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 + 0 np=146741 qsp=1419 rpq=6 cbr=0 cng=6 gpc=0 gps=0 nf=2 nn=145314 + 1 np=155792 qsp=12597 rpq=3 cbr=0 cng=0 gpc=4 gps=8 nf=3 nn=143180 + 2 np=136629 qsp=18680 rpq=1 cbr=0 cng=0 gpc=7 gps=6 nf=0 nn=117936 + 3 np=137723 qsp=2843 rpq=0 cbr=0 cng=0 gpc=10 gps=7 nf=0 nn=134863 + 4 np=123110 qsp=12433 rpq=0 cbr=0 cng=0 gpc=4 gps=2 nf=0 nn=110671 + 5 np=137456 qsp=4210 rpq=1 cbr=0 cng=0 gpc=6 gps=5 nf=0 nn=133235 + 6 np=120834 qsp=9902 rpq=2 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 + 7 np=144888 qsp=26336 rpq=0 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 As always, this is once again split into "rcu_sched" and "rcu_bh" portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional @@ -284,6 +284,9 @@ o "np" is the number of times that __rcu_pending() has been invoked o "qsp" is the number of times that the RCU was waiting for a quiescent state from this CPU. +o "rpq" is the number of times that the CPU had passed through + a quiescent state, but not yet reported it to RCU. + o "cbr" is the number of times that this CPU had RCU callbacks that had passed through a grace period, and were thus ready to be invoked. -- cgit v1.2.2 From f1d507beeab1d1d60a1c58eac7dc81522c6f4629 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Thu, 15 Apr 2010 15:49:46 -0700 Subject: rcu: improve the RCU CPU-stall warning documentation The existing Documentation/RCU/stallwarn.txt has proven unhelpful, so rework it a bit. In particular, show how to interpret the stall-warning messages. Signed-off-by: Paul E. McKenney --- Documentation/RCU/stallwarn.txt | 94 +++++++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 23 deletions(-) (limited to 'Documentation') diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 1423d2570d7..44c6dcc93d6 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt @@ -3,35 +3,79 @@ Using RCU's CPU Stall Detector The CONFIG_RCU_CPU_STALL_DETECTOR kernel config parameter enables RCU's CPU stall detector, which detects conditions that unduly delay RCU grace periods. The stall detector's idea of what constitutes -"unduly delayed" is controlled by a pair of C preprocessor macros: +"unduly delayed" is controlled by a set of C preprocessor macros: RCU_SECONDS_TILL_STALL_CHECK This macro defines the period of time that RCU will wait from the beginning of a grace period until it issues an RCU CPU - stall warning. It is normally ten seconds. + stall warning. This time period is normally ten seconds. RCU_SECONDS_TILL_STALL_RECHECK This macro defines the period of time that RCU will wait after - issuing a stall warning until it issues another stall warning. - It is normally set to thirty seconds. + issuing a stall warning until it issues another stall warning + for the same stall. This time period is normally set to thirty + seconds. RCU_STALL_RAT_DELAY - The CPU stall detector tries to make the offending CPU rat on itself, - as this often gives better-quality stack traces. However, if - the offending CPU does not detect its own stall in the number - of jiffies specified by RCU_STALL_RAT_DELAY, then other CPUs will - complain. This is normally set to two jiffies. + The CPU stall detector tries to make the offending CPU print its + own warnings, as this often gives better-quality stack traces. + However, if the offending CPU does not detect its own stall in + the number of jiffies specified by RCU_STALL_RAT_DELAY, then + some other CPU will complain. This delay is normally set to + two jiffies. -The following problems can result in an RCU CPU stall warning: +When a CPU detects that it is stalling, it will print a message similar +to the following: + +INFO: rcu_sched_state detected stall on CPU 5 (t=2500 jiffies) + +This message indicates that CPU 5 detected that it was causing a stall, +and that the stall was affecting RCU-sched. This message will normally be +followed by a stack dump of the offending CPU. On TREE_RCU kernel builds, +RCU and RCU-sched are implemented by the same underlying mechanism, +while on TREE_PREEMPT_RCU kernel builds, RCU is instead implemented +by rcu_preempt_state. + +On the other hand, if the offending CPU fails to print out a stall-warning +message quickly enough, some other CPU will print a message similar to +the following: + +INFO: rcu_bh_state detected stalls on CPUs/tasks: { 3 5 } (detected by 2, 2502 jiffies) + +This message indicates that CPU 2 detected that CPUs 3 and 5 were both +causing stalls, and that the stall was affecting RCU-bh. This message +will normally be followed by stack dumps for each CPU. Please note that +TREE_PREEMPT_RCU builds can be stalled by tasks as well as by CPUs, +and that the tasks will be indicated by PID, for example, "P3421". +It is even possible for a rcu_preempt_state stall to be caused by both +CPUs -and- tasks, in which case the offending CPUs and tasks will all +be called out in the list. + +Finally, if the grace period ends just as the stall warning starts +printing, there will be a spurious stall-warning message: + +INFO: rcu_bh_state detected stalls on CPUs/tasks: { } (detected by 4, 2502 jiffies) + +This is rare, but does happen from time to time in real life. + +So your kernel printed an RCU CPU stall warning. The next question is +"What caused it?" The following problems can result in RCU CPU stall +warnings: o A CPU looping in an RCU read-side critical section. -o A CPU looping with interrupts disabled. +o A CPU looping with interrupts disabled. This condition can + result in RCU-sched and RCU-bh stalls. -o A CPU looping with preemption disabled. +o A CPU looping with preemption disabled. This condition can + result in RCU-sched stalls and, if ksoftirqd is in use, RCU-bh + stalls. + +o A CPU looping with bottom halves disabled. This condition can + result in RCU-sched and RCU-bh stalls. o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel without invoking schedule(). @@ -39,20 +83,24 @@ o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel o A bug in the RCU implementation. o A hardware failure. This is quite unlikely, but has occurred - at least once in a former life. A CPU failed in a running system, + at least once in real life. A CPU failed in a running system, becoming unresponsive, but not causing an immediate crash. This resulted in a series of RCU CPU stall warnings, eventually leading the realization that the CPU had failed. -The RCU, RCU-sched, and RCU-bh implementations have CPU stall warning. -SRCU does not do so directly, but its calls to synchronize_sched() will -result in RCU-sched detecting any CPU stalls that might be occurring. - -To diagnose the cause of the stall, inspect the stack traces. The offending -function will usually be near the top of the stack. If you have a series -of stall warnings from a single extended stall, comparing the stack traces -can often help determine where the stall is occurring, which will usually -be in the function nearest the top of the stack that stays the same from -trace to trace. +The RCU, RCU-sched, and RCU-bh implementations have CPU stall +warning. SRCU does not have its own CPU stall warnings, but its +calls to synchronize_sched() will result in RCU-sched detecting +RCU-sched-related CPU stalls. Please note that RCU only detects +CPU stalls when there is a grace period in progress. No grace period, +no CPU stall warnings. + +To diagnose the cause of the stall, inspect the stack traces. +The offending function will usually be near the top of the stack. +If you have a series of stall warnings from a single extended stall, +comparing the stack traces can often help determine where the stall +is occurring, which will usually be in the function nearest the top of +that portion of the stack which remains the same from trace to trace. +If you can reliably trigger the stall, ftrace can be quite helpful. RCU bugs can often be debugged with the help of CONFIG_RCU_TRACE. -- cgit v1.2.2 From 624f6ec871886525ca19cf7841f918da91d4315e Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 26 Mar 2010 23:53:42 +0100 Subject: PM: Update device power management document The device PM document, Documentation/power/devices.txt, is badly outdated and requires total rework to fit the current design of the PM framework. Make it more up to date. Signed-off-by: Rafael J. Wysocki Reviewed-by: Randy Dunlap --- Documentation/power/devices.txt | 698 +++++++++++++++++++++++++--------------- 1 file changed, 431 insertions(+), 267 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index c9abbd86bc1..10018d19e0b 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt @@ -1,3 +1,7 @@ +Device Power Management + +(C) 2010 Rafael J. Wysocki , Novell Inc. + Most of the code in Linux is device drivers, so most of the Linux power management code is also driver-specific. Most drivers will do very little; others, especially for platforms with small batteries (like cell phones), @@ -25,31 +29,39 @@ states: them without loss of data. Some drivers can manage hardware wakeup events, which make the system - leave that low-power state. This feature may be disabled using the - relevant /sys/devices/.../power/wakeup file; enabling it may cost some - power usage, but let the whole system enter low power states more often. + leave that low-power state. This feature may be enabled or disabled + using the relevant /sys/devices/.../power/wakeup file (for Ethernet + drivers the ioctl interface used by ethtool may also be used for this + purpose); enabling it may cost some power usage, but let the whole + system enter low power states more often. Runtime Power Management model: - Drivers may also enter low power states while the system is running, - independently of other power management activity. Upstream drivers - will normally not know (or care) if the device is in some low power - state when issuing requests; the driver will auto-resume anything - that's needed when it gets a request. - - This doesn't have, or need much infrastructure; it's just something you - should do when writing your drivers. For example, clk_disable() unused - clocks as part of minimizing power drain for currently-unused hardware. - Of course, sometimes clusters of drivers will collaborate with each - other, which could involve task-specific power management. + Devices may also be put into low power states while the system is + running, independently of other power management activity in principle. + However, devices are not generally independent of each other (for + example, parent device cannot be suspended unless all of its child + devices have been suspended). Moreover, depending on the bus type the + device is on, it may be necessary to carry out some bus-specific + operations on the device for this purpose. Also, devices put into low + power states at run time may require special handling during system-wide + power transitions, like suspend to RAM. + + For these reasons not only the device driver itself, but also the + appropriate subsystem (bus type, device type or device class) driver + and the PM core are involved in the runtime power management of devices. + Like in the system sleep power management case, they need to collaborate + by implementing various role-specific suspend and resume methods, so + that the hardware is cleanly powered down and reactivated without data + or service loss. There's not a lot to be said about those low power states except that they are very system-specific, and often device-specific. Also, that if enough -drivers put themselves into low power states (at "runtime"), the effect may be -the same as entering some system-wide low-power state (system sleep) ... and -that synergies exist, so that several drivers using runtime pm might put the +devices have been put into low power states (at "run time"), the effect may be +very similar to entering some system-wide low-power state (system sleep) ... and +that synergies exist, so that several drivers using runtime PM might put the system into a state where even deeper power saving options are available. -Most suspended devices will have quiesced all I/O: no more DMA or irqs, no +Most suspended devices will have quiesced all I/O: no more DMA or IRQs, no more data read or written, and requests from upstream drivers are no longer accepted. A given bus or platform may have different requirements though. @@ -60,34 +72,67 @@ or removal (for PCMCIA, MMC/SD, USB, and so on). Interfaces for Entering System Sleep States =========================================== -Most of the programming interfaces a device driver needs to know about -relate to that first model: entering a system-wide low power state, -rather than just minimizing power consumption by one device. +There are programming interfaces provided for subsystem (bus type, device type, +device class) and device drivers in order to allow them to participate in the +power management of devices they are concerned with. They cover the system +sleep power management as well as the runtime power management of devices. + + +Device Power Management Operations +---------------------------------- +Device power management operations, at the subsystem level as well as at the +device driver level, are implemented by defining and populating objects of type +struct dev_pm_ops: + +struct dev_pm_ops { + int (*prepare)(struct device *dev); + void (*complete)(struct device *dev); + int (*suspend)(struct device *dev); + int (*resume)(struct device *dev); + int (*freeze)(struct device *dev); + int (*thaw)(struct device *dev); + int (*poweroff)(struct device *dev); + int (*restore)(struct device *dev); + int (*suspend_noirq)(struct device *dev); + int (*resume_noirq)(struct device *dev); + int (*freeze_noirq)(struct device *dev); + int (*thaw_noirq)(struct device *dev); + int (*poweroff_noirq)(struct device *dev); + int (*restore_noirq)(struct device *dev); + int (*runtime_suspend)(struct device *dev); + int (*runtime_resume)(struct device *dev); + int (*runtime_idle)(struct device *dev); +}; +This structure is defined in include/linux/pm.h and the methods included in it +are also described in that file. Their roles will be explained in what follows. +For now, it should be sufficient to remember that the last three of them are +specific to runtime power management, while the remaining ones are used during +system-wide power transitions. -Bus Driver Methods ------------------- -The core methods to suspend and resume devices reside in struct bus_type. -These are mostly of interest to people writing infrastructure for busses -like PCI or USB, or because they define the primitives that device drivers -may need to apply in domain-specific ways to their devices: - -struct bus_type { - ... - int (*suspend)(struct device *dev, pm_message_t state); - int (*resume)(struct device *dev); -}; +There also is an "old" or "legacy", deprecated way of implementing power +management operations available at least for some subsystems. This approach +does not use struct dev_pm_ops objects and it only is suitable for implementing +system sleep power management methods. Therefore it is not described in this +document, so please refer directly to the source code for more information about +it. + + +Subsystem-Level Methods +----------------------- +The core methods to suspend and resume devices reside in struct dev_pm_ops +pointed to by the pm member of struct bus_type, struct device_type and +struct class. They are mostly of interest to the people writing infrastructure +for buses, like PCI or USB, or device type and device class drivers. -Bus drivers implement those methods as appropriate for the hardware and +Bus drivers implement these methods as appropriate for the hardware and the drivers using it; PCI works differently from USB, and so on. Not many -people write bus drivers; most driver code is a "device driver" that +people write subsystem-level drivers; most driver code is a "device driver" that builds on top of bus-specific framework code. For more information on these driver calls, see the description later; they are called in phases for every device, respecting the parent-child -sequencing in the driver model tree. Note that as this is being written, -only the suspend() and resume() are widely available; not many bus drivers -leverage all of those phases, or pass them down to lower driver levels. +sequencing in the driver model tree. /sys/devices/.../power/wakeup files @@ -95,7 +140,7 @@ leverage all of those phases, or pass them down to lower driver levels. All devices in the driver model have two flags to control handling of wakeup events, which are hardware signals that can force the device and/or system out of a low power state. These are initialized by bus or device -driver code using device_init_wakeup(dev,can_wakeup). +driver code using device_init_wakeup(). The "can_wakeup" flag just records whether the device (and its driver) can physically support wakeup events. When that flag is clear, the sysfs @@ -103,64 +148,44 @@ physically support wakeup events. When that flag is clear, the sysfs For devices that can issue wakeup events, a separate flag controls whether that device should try to use its wakeup mechanism. The initial value of -device_may_wakeup() will be true, so that the device's "wakeup" file holds -the value "enabled". Userspace can change that to "disabled" so that -device_may_wakeup() returns false; or change it back to "enabled" (so that -it returns true again). - - -EXAMPLE: PCI Device Driver Methods ------------------------------------ -PCI framework software calls these methods when the PCI device driver bound -to a device device has provided them: - -struct pci_driver { - ... - int (*suspend)(struct pci_device *pdev, pm_message_t state); - int (*suspend_late)(struct pci_device *pdev, pm_message_t state); - - int (*resume_early)(struct pci_device *pdev); - int (*resume)(struct pci_device *pdev); -}; - -Drivers will implement those methods, and call PCI-specific procedures -like pci_set_power_state(), pci_enable_wake(), pci_save_state(), and -pci_restore_state() to manage PCI-specific mechanisms. (PCI config space -could be saved during driver probe, if it weren't for the fact that some -systems rely on userspace tweaking using setpci.) Devices are suspended -before their bridges enter low power states, and likewise bridges resume -before their devices. - - -Upper Layers of Driver Stacks ------------------------------ -Device drivers generally have at least two interfaces, and the methods -sketched above are the ones which apply to the lower level (nearer PCI, USB, -or other bus hardware). The network and block layers are examples of upper -level interfaces, as is a character device talking to userspace. - -Power management requests normally need to flow through those upper levels, -which often use domain-oriented requests like "blank that screen". In -some cases those upper levels will have power management intelligence that -relates to end-user activity, or other devices that work in cooperation. - -When those interfaces are structured using class interfaces, there is a -standard way to have the upper layer stop issuing requests to a given -class device (and restart later): - -struct class { - ... - int (*suspend)(struct device *dev, pm_message_t state); - int (*resume)(struct device *dev); -}; - -Those calls are issued in specific phases of the process by which the -system enters a low power "suspend" state, or resumes from it. +device_may_wakeup() will be false for the majority of devices, except for +power buttons, keyboards, and Ethernet adapters whose WoL (wake-on-LAN) feature +has been set up with ethtool. Thus in the majority of cases the device's +"wakeup" file will initially hold the value "disabled". Userspace can change +that to "enabled", so that device_may_wakeup() returns true, or change it back +to "disabled", so that it returns false again. + + +/sys/devices/.../power/control files +------------------------------------ +All devices in the driver model have a flag to control the desired behavior of +its driver with respect to runtime power management. This flag, called +runtime_auto, is initialized by the bus type (or generally subsystem) code using +pm_runtime_allow() or pm_runtime_forbid(), depending on whether or not the +driver is supposed to power manage the device at run time by default, +respectively. + +This setting may be adjusted by user space by writing either "on" or "auto" to +the device's "control" file. If "auto" is written, the device's runtime_auto +flag will be set and the driver will be allowed to power manage the device if +capable of doing that. If "on" is written, the driver is not allowed to power +manage the device which in turn is supposed to remain in the full power state at +run time. User space can check the current value of the runtime_auto flag by +reading from the device's "control" file. + +The device's runtime_auto flag has no effect on the handling of system-wide +power transitions by its driver. In particular, the device can (and in the +majority of cases should and will) be put into a low power state during a +system-wide transition to a sleep state (like "suspend-to-RAM") even though its +runtime_auto flag is unset (in which case its "control" file contains "on"). + +For more information about the runtime power management framework for devices +refer to Documentation/power/runtime_pm.txt. Calling Drivers to Enter System Sleep States ============================================ -When the system enters a low power state, each device's driver is asked +When the system goes into a sleep state, each device's driver is asked to suspend the device by putting it into state compatible with the target system state. That's usually some version of "off", but the details are system-specific. Also, wakeup-enabled devices will usually stay partly @@ -175,14 +200,13 @@ and then turn its hardware as "off" as possible with late_suspend. The matching resume calls would then completely reinitialize the hardware before reactivating its class I/O queues. -More power-aware drivers drivers will use more than one device low power -state, either at runtime or during system sleep states, and might trigger -system wakeup events. +More power-aware drivers might prepare the devices for triggering system wakeup +events. Call Sequence Guarantees ------------------------ -To ensure that bridges and similar links needed to talk to a device are +To ensure that bridges and similar links needing to talk to a device are available when the device is suspended or resumed, the device tree is walked in a bottom-up order to suspend devices. A top-down order is used to resume those devices. @@ -194,7 +218,7 @@ its parent; and can't be removed or suspended after that parent. The policy is that the device tree should match hardware bus topology. (Or at least the control bus, for devices which use multiple busses.) In particular, this means that a device registration may fail if the parent of -the device is suspending (ie. has been chosen by the PM core as the next +the device is suspending (i.e. has been chosen by the PM core as the next device to suspend) or has already suspended, as well as after all of the other devices have been suspended. Device drivers must be prepared to cope with such situations. @@ -207,54 +231,166 @@ system always includes every phase, executing calls for every device before the next phase begins. Not all busses or classes support all these callbacks; and not all drivers use all the callbacks. -The phases are seen by driver notifications issued in this order: +Generally, different callbacks are used depending on whether the system is +going to the standby or memory sleep state ("suspend-to-RAM") or it is going to +be hibernated ("suspend-to-disk"). + +If the system goes to the standby or memory sleep state the phases are seen by +driver notifications issued in this order: + + 1 bus->pm.prepare(dev) is called after tasks are frozen and it is supposed + to call the device driver's ->pm.prepare() method. + + The purpose of this method is mainly to prevent new children of the + device from being registered after it has returned. It also may be used + to generally prepare the device for the upcoming system transition, but + it should not put the device into a low power state. - 1 class.suspend(dev, message) is called after tasks are frozen, for - devices associated with a class that has such a method. This - method may sleep. + 2 class->pm.suspend(dev) is called if dev is associated with a class that + has such a method. It may invoke the device driver's ->pm.suspend() + method, unless type->pm.suspend(dev) or bus->pm.suspend() does that. - Since I/O activity usually comes from such higher layers, this is - a good place to quiesce all drivers of a given type (and keep such - code out of those drivers). + 3 type->pm.suspend(dev) is called if dev is associated with a device type + that has such a method. It may invoke the device driver's + ->pm.suspend() method, unless class->pm.suspend(dev) or + bus->pm.suspend() does that. - 2 bus.suspend(dev, message) is called next. This method may sleep, - and is often morphed into a device driver call with bus-specific - parameters and/or rules. + 4 bus->pm.suspend(dev) is called, if implemented. It usually calls the + device driver's ->pm.suspend() method. - This call should handle parts of device suspend logic that require - sleeping. It probably does work to quiesce the device which hasn't - been abstracted into class.suspend(). + This call should generally quiesce the device so that it doesn't do any + I/O after the call has returned. It also may save the device registers + and put it into the appropriate low power state, depending on the bus + type the device is on. -The pm_message_t parameter is currently used to refine those semantics -(described later). + 5 bus->pm.suspend_noirq(dev) is called, if implemented. It may call the + device driver's ->pm.suspend_noirq() method, depending on the bus type + in question. + + This method is invoked after device interrupts have been suspended, + which means that the driver's interrupt handler will not be called + while it is running. It should save the values of the device's + registers that weren't saved previously and finally put the device into + the appropriate low power state. + + The majority of subsystems and device drivers need not implement this + method. However, bus types allowing devices to share interrupt vectors, + like PCI, generally need to use it to prevent interrupt handling issues + from happening during suspend. At the end of those phases, drivers should normally have stopped all I/O transactions (DMA, IRQs), saved enough state that they can re-initialize or restore previous state (as needed by the hardware), and placed the device into a low-power state. On many platforms they will also use -clk_disable() to gate off one or more clock sources; sometimes they will -also switch off power supplies, or reduce voltages. Drivers which have -runtime PM support may already have performed some or all of the steps -needed to prepare for the upcoming system sleep state. +gate off one or more clock sources; sometimes they will also switch off power +supplies, or reduce voltages. [Drivers supporting runtime PM may already have +performed some or all of the steps needed to prepare for the upcoming system +state transition.] + +If device_may_wakeup(dev) returns true, the device should be prepared for +generating hardware wakeup signals when the system is in the sleep state to +trigger a system wakeup event. For example, enable_irq_wake() might identify +GPIO signals hooked up to a switch or other external hardware, and +pci_enable_wake() does something similar for the PCI PME signal. + +If a driver (or subsystem) fails it suspend method, the system won't enter the +desired low power state; it will resume all the devices it's suspended so far. + + +Hibernation Phases +------------------ +Hibernating the system is more complicated than putting it into the standby or +memory sleep state, because it involves creating a system image and saving it. +Therefore there are more phases of hibernation and special device PM methods are +used in this case. + +First, it is necessary to prepare the system for creating a hibernation image. +This is similar to putting the system into the standby or memory sleep state, +although it generally doesn't require that devices be put into low power states +(that is even not desirable at this point). Driver notifications are then +issued in the following order: + + 1 bus->pm.prepare(dev) is called after tasks have been frozen and enough + memory has been freed. + + 2 class->pm.freeze(dev) is called if implemented. It may invoke the + device driver's ->pm.freeze() method, unless type->pm.freeze(dev) or + bus->pm.freeze() does that. + + 3 type->pm.freeze(dev) is called if implemented. It may invoke the device + driver's ->pm.suspend() method, unless class->pm.freeze(dev) or + bus->pm.freeze() does that. -When any driver sees that its device_can_wakeup(dev), it should make sure -to use the relevant hardware signals to trigger a system wakeup event. -For example, enable_irq_wake() might identify GPIO signals hooked up to -a switch or other external hardware, and pci_enable_wake() does something -similar for PCI's PME# signal. + 4 bus->pm.freeze(dev) is called, if implemented. It usually calls the + device driver's ->pm.freeze() method. -If a driver (or bus, or class) fails it suspend method, the system won't -enter the desired low power state; it will resume all the devices it's -suspended so far. + 5 bus->pm.freeze_noirq(dev) is called, if implemented. It may call the + device driver's ->pm.freeze_noirq() method, depending on the bus type + in question. -Note that drivers may need to perform different actions based on the target -system lowpower/sleep state. At this writing, there are only platform -specific APIs through which drivers could determine those target states. +The difference between ->pm.freeze() and the corresponding ->pm.suspend() (and +similarly for the "noirq" variants) is that the former should avoid preparing +devices to trigger system wakeup events and putting devices into low power +states, although they generally have to save the values of device registers +so that it's possible to restore them during system resume. + +Second, after the system image has been created, the functionality of devices +has to be restored so that the image can be saved. That is similar to resuming +devices after the system has been woken up from the standby or memory sleep +state, which is described below, and causes the following device notifications +to be issued: + + 1 bus->pm.thaw_noirq(dev), if implemented; may call the device driver's + ->pm.thaw_noirq() method, depending on the bus type in question. + + 2 bus->pm.thaw(dev), if implemented; usually calls the device driver's + ->pm.thaw() method. + + 3 type->pm.thaw(dev), if implemented; may call the device driver's + ->pm.thaw() method if not called by the bus type or class. + + 4 class->pm.thaw(dev), if implemented; may call the device driver's + ->pm.thaw() method if not called by the bus type or device type. + + 5 bus->pm.complete(dev), if implemented; may call the device driver's + ->pm.complete() method. + +Generally, the role of the ->pm.thaw() methods (including the "noirq" variants) +is to bring the device back to the fully functional state, so that it may be +used for saving the image, if necessary. The role of bus->pm.complete() is to +reverse whatever bus->pm.prepare() did (likewise for the analogous device driver +callbacks). + +After the image has been saved, the devices need to be prepared for putting the +system into the low power state. That is analogous to suspending them before +putting the system into the standby or memory sleep state and involves the +following device notifications: + + 1 bus->pm.prepare(dev). + + 2 class->pm.poweroff(dev), if implemented; may invoke the device driver's + ->pm.poweroff() method if not called by the bus type or device type. + + 3 type->pm.poweroff(dev), if implemented; may invoke the device driver's + ->pm.poweroff() method if not called by the bus type or device class. + + 4 bus->pm.poweroff(dev), if implemented; usually calls the device driver's + ->pm.poweroff() method (if not called by the device class or type). + + 5 bus->pm.poweroff_noirq(dev), if implemented; may call the device + driver's ->pm.poweroff_noirq() method, depending on the bus type + in question. + +The difference between ->pm.poweroff() and the corresponding ->pm.suspend() (and +analogously for the "noirq" variants) is that the former need not save the +device's registers. Still, they should prepare the device for triggering +system wakeup events if necessary and finally put it into the appropriate low +power state. Device Low Power (suspend) States --------------------------------- -Device low-power states aren't very standard. One device might only handle +Device low-power states aren't standard. One device might only handle "on" and "off, while another might support a dozen different versions of "on" (how many engines are active?), plus a state that gets back to "on" faster than from a full "off". @@ -265,7 +401,7 @@ PCI device may not perform DMA or issue IRQs, and any wakeup events it issues would be issued through the PME# bus signal. Plus, there are several PCI-standard device states, some of which are optional. -In contrast, integrated system-on-chip processors often use irqs as the +In contrast, integrated system-on-chip processors often use IRQs as the wakeup event sources (so drivers would call enable_irq_wake) and might be able to treat DMA completion as a wakeup event (sometimes DMA can stay active too, it'd only be the CPU and some peripherals that sleep). @@ -284,84 +420,86 @@ ways; the aforementioned LCD might be active in one product's "standby", but a different product using the same SOC might work differently. -Meaning of pm_message_t.event ------------------------------ -Parameters to suspend calls include the device affected and a message of -type pm_message_t, which has one field: the event. If driver does not -recognize the event code, suspend calls may abort the request and return -a negative errno. However, most drivers will be fine if they implement -PM_EVENT_SUSPEND semantics for all messages. +Resuming Devices +---------------- +Resuming is done in multiple phases, much like suspending, with all +devices processing each phase's calls before the next phase begins. -The event codes are used to refine the goal of suspending the device, and -mostly matter when creating or resuming system memory image snapshots, as -used with suspend-to-disk: +Again, however, different callbacks are used depending on whether the system is +waking up from the standby or memory sleep state ("suspend-to-RAM") or from +hibernation ("suspend-to-disk"). - PM_EVENT_SUSPEND -- quiesce the driver and put hardware into a low-power - state. When used with system sleep states like "suspend-to-RAM" or - "standby", the upcoming resume() call will often be able to rely on - state kept in hardware, or issue system wakeup events. +If the system is waking up from the standby or memory sleep state, the phases +are seen by driver notifications issued in this order: - PM_EVENT_HIBERNATE -- Put hardware into a low-power state and enable wakeup - events as appropriate. It is only used with hibernation - (suspend-to-disk) and few devices are able to wake up the system from - this state; most are completely powered off. + 1 bus->pm.resume_noirq(dev) is called, if implemented. It may call the + device driver's ->pm.resume_noirq() method, depending on the bus type in + question. - PM_EVENT_FREEZE -- quiesce the driver, but don't necessarily change into - any low power mode. A system snapshot is about to be taken, often - followed by a call to the driver's resume() method. Neither wakeup - events nor DMA are allowed. + The role of this method is to perform actions that need to be performed + before device drivers' interrupt handlers are allowed to be invoked. If + the given bus type permits devices to share interrupt vectors, like PCI, + this method should bring the device and its driver into a state in which + the driver can recognize if the device is the source of incoming + interrupts, if any, and handle them correctly. - PM_EVENT_PRETHAW -- quiesce the driver, knowing that the upcoming resume() - will restore a suspend-to-disk snapshot from a different kernel image. - Drivers that are smart enough to look at their hardware state during - resume() processing need that state to be correct ... a PRETHAW could - be used to invalidate that state (by resetting the device), like a - shutdown() invocation would before a kexec() or system halt. Other - drivers might handle this the same way as PM_EVENT_FREEZE. Neither - wakeup events nor DMA are allowed. + For example, the PCI bus type's ->pm.resume_noirq() puts the device into + the full power state (D0 in the PCI terminology) and restores the + standard configuration registers of the device. Then, it calls the + device driver's ->pm.resume_noirq() method to perform device-specific + actions needed at this stage of resume. -To enter "standby" (ACPI S1) or "Suspend to RAM" (STR, ACPI S3) states, or -the similarly named APM states, only PM_EVENT_SUSPEND is used; the other event -codes are used for hibernation ("Suspend to Disk", STD, ACPI S4). + 2 bus->pm.resume(dev) is called, if implemented. It usually calls the + device driver's ->pm.resume() method. -There's also PM_EVENT_ON, a value which never appears as a suspend event -but is sometimes used to record the "not suspended" device state. + This call should generally bring the the device back to the working + state, so that it can do I/O as requested after the call has returned. + However, it may be more convenient to use the device class or device + type ->pm.resume() for this purpose, in which case the bus type's + ->pm.resume() method need not be implemented at all. + 3 type->pm.resume(dev) is called, if implemented. It may invoke the + device driver's ->pm.resume() method, unless class->pm.resume(dev) or + bus->pm.resume() does that. -Resuming Devices ----------------- -Resuming is done in multiple phases, much like suspending, with all -devices processing each phase's calls before the next phase begins. + For devices that are not associated with any bus type or device class + this method plays the role of bus->pm.resume(). -The phases are seen by driver notifications issued in this order: + 4 class->pm.resume(dev) is called, if implemented. It may invoke the + device driver's ->pm.resume() method, unless bus->pm.resume(dev) or + type->pm.resume() does that. - 1 bus.resume(dev) reverses the effects of bus.suspend(). This may - be morphed into a device driver call with bus-specific parameters; - implementations may sleep. + For devices that are not associated with any bus type or device type + this method plays the role of bus->pm.resume(). - 2 class.resume(dev) is called for devices associated with a class - that has such a method. Implementations may sleep. + 5 bus->pm.complete(dev) is called, if implemented. It is supposed to + invoke the device driver's ->pm.complete() method. - This reverses the effects of class.suspend(), and would usually - reactivate the device's I/O queue. + The role of this method is to reverse whatever bus->pm.prepare(dev) + (or the driver's ->pm.prepare()) did during suspend, if necessary. At the end of those phases, drivers should normally be as functional as they were before suspending: I/O can be performed using DMA and IRQs, and -the relevant clocks are gated on. The device need not be "fully on"; it -might be in a runtime lowpower/suspend state that acts as if it were. +the relevant clocks are gated on. In principle the device need not be +"fully on"; it might be in a runtime lowpower/suspend state during suspend and +the resume callbacks may try to restore that state, but that need not be +desirable from the user's point of view. In fact, there are multiple reasons +why it's better to always put devices into the "fully working" state in the +system sleep resume callbacks and they are discussed in more detail in +Documentation/power/runtime_pm.txt. However, the details here may again be platform-specific. For example, some systems support multiple "run" states, and the mode in effect at -the end of resume() might not be the one which preceded suspension. +the end of resume might not be the one which preceded suspension. That means availability of certain clocks or power supplies changed, which could easily affect how a driver works. - Drivers need to be able to handle hardware which has been reset since the suspend methods were called, for example by complete reinitialization. This may be the hardest part, and the one most protected by NDA'd documents and chip errata. It's simplest if the hardware state hasn't changed since -the suspend() was called, but that can't always be guaranteed. +the suspend was carried out, but that can't be guaranteed (in fact, it ususally +is not the case). Drivers must also be prepared to notice that the device has been removed while the system was powered off, whenever that's physically possible. @@ -371,11 +509,76 @@ will notice and handle such removals are currently bus-specific, and often involve a separate thread. -Note that the bus-specific runtime PM wakeup mechanism can exist, and might -be defined to share some of the same driver code as for system wakeup. For -example, a bus-specific device driver's resume() method might be used there, -so it wouldn't only be called from bus.resume() during system-wide wakeup. -See bus-specific information about how runtime wakeup events are handled. +Resume From Hibernation +----------------------- +Resuming from hibernation is, again, more complicated than resuming from a sleep +state in which the contents of main memory are preserved, because it requires +a system image to be loaded into memory and the pre-hibernation memory contents +to be restored before control can be passed back to the image kernel. + +In principle, the image might be loaded into memory and the pre-hibernation +memory contents might be restored by the boot loader. For this purpose, +however, the boot loader would need to know the image kernel's entry point and +there's no protocol defined for passing that information to boot loaders. As +a workaround, the boot loader loads a fresh instance of the kernel, called the +boot kernel, into memory and passes control to it in a usual way. Then, the +boot kernel reads the hibernation image, restores the pre-hibernation memory +contents and passes control to the image kernel. Thus, in fact, two different +kernels are involved in resuming from hibernation and in general they are not +only different because they play different roles in this operation. Actually, +the boot kernel may be completely different from the image kernel. Not only +the configuration of it, but also the version of it may be different. +The consequences of this are important to device drivers and their subsystems +(bus types, device classes and device types) too. + +Namely, to be able to load the hibernation image into memory, the boot kernel +needs to include at least the subset of device drivers allowing it to access the +storage medium containing the image, although it generally doesn't need to +include all of the drivers included into the image kernel. After the image has +been loaded the devices handled by those drivers need to be prepared for passing +control back to the image kernel. This is very similar to the preparation of +devices for creating a hibernation image described above. In fact, it is done +in the same way, with the help of the ->pm.prepare(), ->pm.freeze() and +->pm.freeze_noirq() callbacks, but only for device drivers included in the boot +kernel (whose versions may generally be different from the versions of the +analogous drivers from the image kernel). + +Should the restoration of the pre-hibernation memory contents fail, the boot +kernel would carry out the procedure of "thawing" devices described above, using +the ->pm.thaw_noirq(), ->pm.thaw(), and ->pm.complete() callbacks provided by +subsystems and device drivers. This, however, is a very rare condition. Most +often the pre-hibernation memory contents are restored successfully and control +is passed to the image kernel that is now responsible for bringing the system +back to the working state. + +To achieve this goal, among other things, the image kernel restores the +pre-hibernation functionality of devices. This operation is analogous to the +resuming of devices after waking up from the memory sleep state, although it +involves different device notifications which are the following: + + 1 bus->pm.restore_noirq(dev), if implemented; may call the device driver's + ->pm.restore_noirq() method, depending on the bus type in question. + + 2 bus->pm.restore(dev), if implemented; usually calls the device driver's + ->pm.restore() method. + + 3 type->pm.restore(dev), if implemented; may call the device driver's + ->pm.restore() method if not called by the bus type or class. + + 4 class->pm.restore(dev), if implemented; may call the device driver's + ->pm.restore() method if not called by the bus type or device type. + + 5 bus->pm.complete(dev), if implemented; may call the device driver's + ->pm.complete() method. + +The roles of the ->pm.restore_noirq() and ->pm.restore() callbacks are analogous +to the roles of the corresponding resume callbacks, but they must assume that +the device may have been accessed before by the boot kernel. Consequently, the +state of the device before they are called may be different from the state of it +right prior to calling the resume callbacks. That difference usually doesn't +matter, so the majority of device drivers can set their resume and restore +callback pointers to the same routine. Nevertheless, different callback +pointers are used in case there is a situation where it actually matters. System Devices @@ -389,10 +592,13 @@ System devices will only be suspended with interrupts disabled, and after all other devices have been suspended. On resume, they will be resumed before any other devices, and also with interrupts disabled. -That is, IRQs are disabled, the suspend_late() phase begins, then the -sysdev_driver.suspend() phase, and the system enters a sleep state. Then -the sysdev_driver.resume() phase begins, followed by the resume_early() -phase, after which IRQs are enabled. +That is, when the non-boot CPUs are all offline and IRQs are disabled on the +remaining online CPU, then the sysdev_driver.suspend() phase is carried out, and +the system enters a sleep state (or hibernation image is created). During +resume (or after the image has been created) the sysdev_driver.resume() phase +is carried out, IRQs are enabled on the only online CPU, the non-boot CPUs are +enabled and that is followed by the "early resume" phase (in which the "noirq" +callbacks provided by subsystems and device drivers are invoked). Code to actually enter and exit the system-wide low power state sometimes involves hardware details that are only known to the boot firmware, and @@ -400,6 +606,22 @@ may leave a CPU running software (from SRAM or flash memory) that monitors the system and manages its wakeup sequence. +Power Management Notifiers +-------------------------- +As stated in Documentation/power/notifiers.txt, there are some operations that +cannot be carried out by the power management callbacks discussed above, because +carrying them out at these points would be too late or too early. To handle +these cases subsystems and device drivers may register power management +notifiers that are called before tasks are frozen and after they have been +thawed. + +Generally speaking, the PM notifiers are suitable for performing actions that +either require user space to be available, or at least won't interfere with user +space in a wrong way. + +For details refer to Documentation/power/notifiers.txt. + + Runtime Power Management ======================== Many devices are able to dynamically power down while the system is still @@ -410,79 +632,21 @@ as "off", "sleep", "idle", "active", and so on. Those states will in some cases (like PCI) be partially constrained by a bus the device uses, and will usually include hardware states that are also used in system sleep states. -However, note that if a driver puts a device into a runtime low power state -and the system then goes into a system-wide sleep state, it normally ought -to resume into that runtime low power state rather than "full on". Such -distinctions would be part of the driver-internal state machine for that -hardware; the whole point of runtime power management is to be sure that -drivers are decoupled in that way from the state machine governing phases -of the system-wide power/sleep state transitions. - - -Power Saving Techniques ------------------------ -Normally runtime power management is handled by the drivers without specific -userspace or kernel intervention, by device-aware use of techniques like: - - Using information provided by other system layers - - stay deeply "off" except between open() and close() - - if transceiver/PHY indicates "nobody connected", stay "off" - - application protocols may include power commands or hints - - Using fewer CPU cycles - - using DMA instead of PIO - - removing timers, or making them lower frequency - - shortening "hot" code paths - - eliminating cache misses - - (sometimes) offloading work to device firmware - - Reducing other resource costs - - gating off unused clocks in software (or hardware) - - switching off unused power supplies - - eliminating (or delaying/merging) IRQs - - tuning DMA to use word and/or burst modes - - Using device-specific low power states - - using lower voltages - - avoiding needless DMA transfers - -Read your hardware documentation carefully to see the opportunities that -may be available. If you can, measure the actual power usage and check -it against the budget established for your project. - - -Examples: USB hosts, system timer, system CPU ----------------------------------------------- -USB host controllers make interesting, if complex, examples. In many cases -these have no work to do: no USB devices are connected, or all of them are -in the USB "suspend" state. Linux host controller drivers can then disable -periodic DMA transfers that would otherwise be a constant power drain on the -memory subsystem, and enter a suspend state. In power-aware controllers, -entering that suspend state may disable the clock used with USB signaling, -saving a certain amount of power. - -The controller will be woken from that state (with an IRQ) by changes to the -signal state on the data lines of a given port, for example by an existing -peripheral requesting "remote wakeup" or by plugging a new peripheral. The -same wakeup mechanism usually works from "standby" sleep states, and on some -systems also from "suspend to RAM" (or even "suspend to disk") states. -(Except that ACPI may be involved instead of normal IRQs, on some hardware.) - -System devices like timers and CPUs may have special roles in the platform -power management scheme. For example, system timers using a "dynamic tick" -approach don't just save CPU cycles (by eliminating needless timer IRQs), -but they may also open the door to using lower power CPU "idle" states that -cost more than a jiffie to enter and exit. On x86 systems these are states -like "C3"; note that periodic DMA transfers from a USB host controller will -also prevent entry to a C3 state, much like a periodic timer IRQ. - -That kind of runtime mechanism interaction is common. "System On Chip" (SOC) -processors often have low power idle modes that can't be entered unless -certain medium-speed clocks (often 12 or 48 MHz) are gated off. When the -drivers gate those clocks effectively, then the system idle task may be able -to use the lower power idle modes and thereby increase battery life. - -If the CPU can have a "cpufreq" driver, there also may be opportunities -to shift to lower voltage settings and reduce the power cost of executing -a given number of instructions. (Without voltage adjustment, it's rare -for cpufreq to save much power; the cost-per-instruction must go down.) +Note, however, that a system-wide power transition can be started while some +devices are in low power states due to the runtime power management. The system +sleep PM callbacks should generally recognize such situations and react to them +appropriately, but the recommended actions to be taken in that cases are +subsystem-specific. + +In some cases the decision may be made at the subsystem level while in some +other cases the device driver may be left to decide. In some cases it may be +desirable to leave a suspended device in that state during system-wide power +transition, but in some other cases the device ought to be put back into the +full power state, for example to be configured for system wakeup or so that its +system wakeup capability can be disabled. That all depends on the hardware +and the design of the subsystem and device driver in question. + +During system-wide resume from a sleep state it's better to put devices into +the full power state, as explained in Documentation/power/runtime_pm.txt. Refer +to that document for more information regarding this particular issue as well as +for information on the device runtime power management framework in general. -- cgit v1.2.2 From d6f9cda1fd241bc7a1d896da94950fd972eca9b7 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 26 Mar 2010 23:53:55 +0100 Subject: PM: Improve device power management document Improve the device power management document after it's been updated by the previous patch. Signed-off-by: Alan Stern Signed-off-by: Rafael J. Wysocki --- Documentation/power/devices.txt | 811 +++++++++++++++++++--------------------- 1 file changed, 383 insertions(+), 428 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 10018d19e0b..57080cd7457 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt @@ -1,11 +1,13 @@ Device Power Management -(C) 2010 Rafael J. Wysocki , Novell Inc. +Copyright (c) 2010 Rafael J. Wysocki , Novell Inc. +Copyright (c) 2010 Alan Stern + Most of the code in Linux is device drivers, so most of the Linux power -management code is also driver-specific. Most drivers will do very little; -others, especially for platforms with small batteries (like cell phones), -will do a lot. +management (PM) code is also driver-specific. Most drivers will do very +little; others, especially for platforms with small batteries (like cell +phones), will do a lot. This writeup gives an overview of how drivers interact with system-wide power management goals, emphasizing the models and interfaces that are @@ -19,9 +21,10 @@ Drivers will use one or both of these models to put devices into low-power states: System Sleep model: - Drivers can enter low power states as part of entering system-wide - low-power states like "suspend-to-ram", or (mostly for systems with - disks) "hibernate" (suspend-to-disk). + Drivers can enter low-power states as part of entering system-wide + low-power states like "suspend" (also known as "suspend-to-RAM"), or + (mostly for systems with disks) "hibernation" (also known as + "suspend-to-disk"). This is something that device, bus, and class drivers collaborate on by implementing various role-specific suspend and resume methods to @@ -29,41 +32,41 @@ states: them without loss of data. Some drivers can manage hardware wakeup events, which make the system - leave that low-power state. This feature may be enabled or disabled + leave the low-power state. This feature may be enabled or disabled using the relevant /sys/devices/.../power/wakeup file (for Ethernet drivers the ioctl interface used by ethtool may also be used for this purpose); enabling it may cost some power usage, but let the whole - system enter low power states more often. + system enter low-power states more often. Runtime Power Management model: - Devices may also be put into low power states while the system is + Devices may also be put into low-power states while the system is running, independently of other power management activity in principle. However, devices are not generally independent of each other (for - example, parent device cannot be suspended unless all of its child - devices have been suspended). Moreover, depending on the bus type the + example, a parent device cannot be suspended unless all of its child + devices have been suspended). Moreover, depending on the bus type the device is on, it may be necessary to carry out some bus-specific - operations on the device for this purpose. Also, devices put into low - power states at run time may require special handling during system-wide - power transitions, like suspend to RAM. + operations on the device for this purpose. Devices put into low power + states at run time may require special handling during system-wide power + transitions (suspend or hibernation). For these reasons not only the device driver itself, but also the - appropriate subsystem (bus type, device type or device class) driver - and the PM core are involved in the runtime power management of devices. - Like in the system sleep power management case, they need to collaborate - by implementing various role-specific suspend and resume methods, so - that the hardware is cleanly powered down and reactivated without data - or service loss. - -There's not a lot to be said about those low power states except that they -are very system-specific, and often device-specific. Also, that if enough -devices have been put into low power states (at "run time"), the effect may be -very similar to entering some system-wide low-power state (system sleep) ... and -that synergies exist, so that several drivers using runtime PM might put the -system into a state where even deeper power saving options are available. - -Most suspended devices will have quiesced all I/O: no more DMA or IRQs, no -more data read or written, and requests from upstream drivers are no longer -accepted. A given bus or platform may have different requirements though. + appropriate subsystem (bus type, device type or device class) driver and + the PM core are involved in runtime power management. As in the system + sleep power management case, they need to collaborate by implementing + various role-specific suspend and resume methods, so that the hardware + is cleanly powered down and reactivated without data or service loss. + +There's not a lot to be said about those low-power states except that they are +very system-specific, and often device-specific. Also, that if enough devices +have been put into low-power states (at runtime), the effect may be very similar +to entering some system-wide low-power state (system sleep) ... and that +synergies exist, so that several drivers using runtime PM might put the system +into a state where even deeper power saving options are available. + +Most suspended devices will have quiesced all I/O: no more DMA or IRQs (except +for wakeup events), no more data read or written, and requests from upstream +drivers are no longer accepted. A given bus or platform may have different +requirements though. Examples of hardware wakeup events include an alarm from a real time clock, network wake-on-LAN packets, keyboard or mouse activity, and media insertion @@ -72,10 +75,10 @@ or removal (for PCMCIA, MMC/SD, USB, and so on). Interfaces for Entering System Sleep States =========================================== -There are programming interfaces provided for subsystem (bus type, device type, -device class) and device drivers in order to allow them to participate in the -power management of devices they are concerned with. They cover the system -sleep power management as well as the runtime power management of devices. +There are programming interfaces provided for subsystems (bus type, device type, +device class) and device drivers to allow them to participate in the power +management of devices they are concerned with. These interfaces cover both +system sleep and runtime power management. Device Power Management Operations @@ -106,16 +109,15 @@ struct dev_pm_ops { This structure is defined in include/linux/pm.h and the methods included in it are also described in that file. Their roles will be explained in what follows. -For now, it should be sufficient to remember that the last three of them are -specific to runtime power management, while the remaining ones are used during +For now, it should be sufficient to remember that the last three methods are +specific to runtime power management while the remaining ones are used during system-wide power transitions. -There also is an "old" or "legacy", deprecated way of implementing power -management operations available at least for some subsystems. This approach -does not use struct dev_pm_ops objects and it only is suitable for implementing -system sleep power management methods. Therefore it is not described in this -document, so please refer directly to the source code for more information about -it. +There also is a deprecated "old" or "legacy" interface for power management +operations available at least for some subsystems. This approach does not use +struct dev_pm_ops objects and it is suitable only for implementing system sleep +power management methods. Therefore it is not described in this document, so +please refer directly to the source code for more information about it. Subsystem-Level Methods @@ -125,10 +127,10 @@ pointed to by the pm member of struct bus_type, struct device_type and struct class. They are mostly of interest to the people writing infrastructure for buses, like PCI or USB, or device type and device class drivers. -Bus drivers implement these methods as appropriate for the hardware and -the drivers using it; PCI works differently from USB, and so on. Not many -people write subsystem-level drivers; most driver code is a "device driver" that -builds on top of bus-specific framework code. +Bus drivers implement these methods as appropriate for the hardware and the +drivers using it; PCI works differently from USB, and so on. Not many people +write subsystem-level drivers; most driver code is a "device driver" that builds +on top of bus-specific framework code. For more information on these driver calls, see the description later; they are called in phases for every device, respecting the parent-child @@ -137,66 +139,78 @@ sequencing in the driver model tree. /sys/devices/.../power/wakeup files ----------------------------------- -All devices in the driver model have two flags to control handling of -wakeup events, which are hardware signals that can force the device and/or -system out of a low power state. These are initialized by bus or device -driver code using device_init_wakeup(). +All devices in the driver model have two flags to control handling of wakeup +events (hardware signals that can force the device and/or system out of a low +power state). These flags are initialized by bus or device driver code using +device_set_wakeup_capable() and device_set_wakeup_enable(), defined in +include/linux/pm_wakeup.h. The "can_wakeup" flag just records whether the device (and its driver) can -physically support wakeup events. When that flag is clear, the sysfs -"wakeup" file is empty, and device_may_wakeup() returns false. - -For devices that can issue wakeup events, a separate flag controls whether -that device should try to use its wakeup mechanism. The initial value of -device_may_wakeup() will be false for the majority of devices, except for -power buttons, keyboards, and Ethernet adapters whose WoL (wake-on-LAN) feature -has been set up with ethtool. Thus in the majority of cases the device's -"wakeup" file will initially hold the value "disabled". Userspace can change -that to "enabled", so that device_may_wakeup() returns true, or change it back -to "disabled", so that it returns false again. +physically support wakeup events. The device_set_wakeup_capable() routine +affects this flag. The "should_wakeup" flag controls whether the device should +try to use its wakeup mechanism. device_set_wakeup_enable() affects this flag; +for the most part drivers should not change its value. The initial value of +should_wakeup is supposed to be false for the majority of devices; the major +exceptions are power buttons, keyboards, and Ethernet adapters whose WoL +(wake-on-LAN) feature has been set up with ethtool. + +Whether or not a device is capable of issuing wakeup events is a hardware +matter, and the kernel is responsible for keeping track of it. By contrast, +whether or not a wakeup-capable device should issue wakeup events is a policy +decision, and it is managed by user space through a sysfs attribute: the +power/wakeup file. User space can write the strings "enabled" or "disabled" to +set or clear the should_wakeup flag, respectively. Reads from the file will +return the corresponding string if can_wakeup is true, but if can_wakeup is +false then reads will return an empty string, to indicate that the device +doesn't support wakeup events. (But even though the file appears empty, writes +will still affect the should_wakeup flag.) + +The device_may_wakeup() routine returns true only if both flags are set. +Drivers should check this routine when putting devices in a low-power state +during a system sleep transition, to see whether or not to enable the devices' +wakeup mechanisms. However for runtime power management, wakeup events should +be enabled whenever the device and driver both support them, regardless of the +should_wakeup flag. /sys/devices/.../power/control files ------------------------------------ -All devices in the driver model have a flag to control the desired behavior of -its driver with respect to runtime power management. This flag, called -runtime_auto, is initialized by the bus type (or generally subsystem) code using -pm_runtime_allow() or pm_runtime_forbid(), depending on whether or not the -driver is supposed to power manage the device at run time by default, -respectively. - -This setting may be adjusted by user space by writing either "on" or "auto" to -the device's "control" file. If "auto" is written, the device's runtime_auto -flag will be set and the driver will be allowed to power manage the device if -capable of doing that. If "on" is written, the driver is not allowed to power -manage the device which in turn is supposed to remain in the full power state at -run time. User space can check the current value of the runtime_auto flag by -reading from the device's "control" file. +Each device in the driver model has a flag to control whether it is subject to +runtime power management. This flag, called runtime_auto, is initialized by the +bus type (or generally subsystem) code using pm_runtime_allow() or +pm_runtime_forbid(); the default is to allow runtime power management. + +The setting can be adjusted by user space by writing either "on" or "auto" to +the device's power/control sysfs file. Writing "auto" calls pm_runtime_allow(), +setting the flag and allowing the device to be runtime power-managed by its +driver. Writing "on" calls pm_runtime_forbid(), clearing the flag, returning +the device to full power if it was in a low-power state, and preventing the +device from being runtime power-managed. User space can check the current value +of the runtime_auto flag by reading the file. The device's runtime_auto flag has no effect on the handling of system-wide -power transitions by its driver. In particular, the device can (and in the -majority of cases should and will) be put into a low power state during a -system-wide transition to a sleep state (like "suspend-to-RAM") even though its -runtime_auto flag is unset (in which case its "control" file contains "on"). +power transitions. In particular, the device can (and in the majority of cases +should and will) be put into a low-power state during a system-wide transition +to a sleep state even though its runtime_auto flag is clear. -For more information about the runtime power management framework for devices -refer to Documentation/power/runtime_pm.txt. +For more information about the runtime power management framework, refer to +Documentation/power/runtime_pm.txt. -Calling Drivers to Enter System Sleep States -============================================ -When the system goes into a sleep state, each device's driver is asked -to suspend the device by putting it into state compatible with the target +Calling Drivers to Enter and Leave System Sleep States +====================================================== +When the system goes into a sleep state, each device's driver is asked to +suspend the device by putting it into a state compatible with the target system state. That's usually some version of "off", but the details are system-specific. Also, wakeup-enabled devices will usually stay partly functional in order to wake the system. -When the system leaves that low power state, the device's driver is asked -to resume it. The suspend and resume operations always go together, and -both are multi-phase operations. +When the system leaves that low-power state, the device's driver is asked to +resume it by returning it to full power. The suspend and resume operations +always go together, and both are multi-phase operations. -For simple drivers, suspend might quiesce the device using the class code -and then turn its hardware as "off" as possible with late_suspend. The +For simple drivers, suspend might quiesce the device using class code +and then turn its hardware as "off" as possible during suspend_noirq. The matching resume calls would then completely reinitialize the hardware before reactivating its class I/O queues. @@ -224,269 +238,129 @@ devices have been suspended. Device drivers must be prepared to cope with such situations. -Suspending Devices ------------------- -Suspending a given device is done in several phases. Suspending the -system always includes every phase, executing calls for every device -before the next phase begins. Not all busses or classes support all -these callbacks; and not all drivers use all the callbacks. - -Generally, different callbacks are used depending on whether the system is -going to the standby or memory sleep state ("suspend-to-RAM") or it is going to -be hibernated ("suspend-to-disk"). +System Power Management Phases +------------------------------ +Suspending or resuming the system is done in several phases. Different phases +are used for standby or memory sleep states ("suspend-to-RAM") and the +hibernation state ("suspend-to-disk"). Each phase involves executing callbacks +for every device before the next phase begins. Not all busses or classes +support all these callbacks and not all drivers use all the callbacks. The +various phases always run after tasks have been frozen and before they are +unfrozen. Furthermore, the *_noirq phases run at a time when IRQ handlers have +been disabled (except for those marked with the IRQ_WAKEUP flag). -If the system goes to the standby or memory sleep state the phases are seen by -driver notifications issued in this order: +Most phases use bus, type, and class callbacks (that is, methods defined in +dev->bus->pm, dev->type->pm, and dev->class->pm). The prepare and complete +phases are exceptions; they use only bus callbacks. When multiple callbacks +are used in a phase, they are invoked in the order: during +power-down transitions and in the opposite order during power-up transitions. +For example, during the suspend phase the PM core invokes - 1 bus->pm.prepare(dev) is called after tasks are frozen and it is supposed - to call the device driver's ->pm.prepare() method. + dev->class->pm.suspend(dev); + dev->type->pm.suspend(dev); + dev->bus->pm.suspend(dev); - The purpose of this method is mainly to prevent new children of the - device from being registered after it has returned. It also may be used - to generally prepare the device for the upcoming system transition, but - it should not put the device into a low power state. +before moving on to the next device, whereas during the resume phase the core +invokes - 2 class->pm.suspend(dev) is called if dev is associated with a class that - has such a method. It may invoke the device driver's ->pm.suspend() - method, unless type->pm.suspend(dev) or bus->pm.suspend() does that. + dev->bus->pm.resume(dev); + dev->type->pm.resume(dev); + dev->class->pm.resume(dev); - 3 type->pm.suspend(dev) is called if dev is associated with a device type - that has such a method. It may invoke the device driver's - ->pm.suspend() method, unless class->pm.suspend(dev) or - bus->pm.suspend() does that. +These callbacks may in turn invoke device- or driver-specific methods stored in +dev->driver->pm, but they don't have to. - 4 bus->pm.suspend(dev) is called, if implemented. It usually calls the - device driver's ->pm.suspend() method. - This call should generally quiesce the device so that it doesn't do any - I/O after the call has returned. It also may save the device registers - and put it into the appropriate low power state, depending on the bus - type the device is on. - - 5 bus->pm.suspend_noirq(dev) is called, if implemented. It may call the - device driver's ->pm.suspend_noirq() method, depending on the bus type - in question. - - This method is invoked after device interrupts have been suspended, - which means that the driver's interrupt handler will not be called - while it is running. It should save the values of the device's - registers that weren't saved previously and finally put the device into - the appropriate low power state. +Entering System Suspend +----------------------- +When the system goes into the standby or memory sleep state, the phases are: + + prepare, suspend, suspend_noirq. + + 1. The prepare phase is meant to prevent races by preventing new devices + from being registered; the PM core would never know that all the + children of a device had been suspended if new children could be + registered at will. (By contrast, devices may be unregistered at any + time.) Unlike the other suspend-related phases, during the prepare + phase the device tree is traversed top-down. + + The prepare phase uses only a bus callback. After the callback method + returns, no new children may be registered below the device. The method + may also prepare the device or driver in some way for the upcoming + system power transition, but it should not put the device into a + low-power state. + + 2. The suspend methods should quiesce the device to stop it from performing + I/O. They also may save the device registers and put it into the + appropriate low-power state, depending on the bus type the device is on, + and they may enable wakeup events. + + 3. The suspend_noirq phase occurs after IRQ handlers have been disabled, + which means that the driver's interrupt handler will not be called while + the callback method is running. The methods should save the values of + the device's registers that weren't saved previously and finally put the + device into the appropriate low-power state. The majority of subsystems and device drivers need not implement this - method. However, bus types allowing devices to share interrupt vectors, - like PCI, generally need to use it to prevent interrupt handling issues - from happening during suspend. - -At the end of those phases, drivers should normally have stopped all I/O -transactions (DMA, IRQs), saved enough state that they can re-initialize -or restore previous state (as needed by the hardware), and placed the -device into a low-power state. On many platforms they will also use -gate off one or more clock sources; sometimes they will also switch off power -supplies, or reduce voltages. [Drivers supporting runtime PM may already have -performed some or all of the steps needed to prepare for the upcoming system -state transition.] + callback. However, bus types allowing devices to share interrupt + vectors, like PCI, generally need it; otherwise a driver might encounter + an error during the suspend phase by fielding a shared interrupt + generated by some other device after its own device had been set to low + power. + +At the end of these phases, drivers should have stopped all I/O transactions +(DMA, IRQs), saved enough state that they can re-initialize or restore previous +state (as needed by the hardware), and placed the device into a low-power state. +On many platforms they will gate off one or more clock sources; sometimes they +will also switch off power supplies or reduce voltages. (Drivers supporting +runtime PM may already have performed some or all of these steps.) If device_may_wakeup(dev) returns true, the device should be prepared for -generating hardware wakeup signals when the system is in the sleep state to -trigger a system wakeup event. For example, enable_irq_wake() might identify +generating hardware wakeup signals to trigger a system wakeup event when the +system is in the sleep state. For example, enable_irq_wake() might identify GPIO signals hooked up to a switch or other external hardware, and pci_enable_wake() does something similar for the PCI PME signal. -If a driver (or subsystem) fails it suspend method, the system won't enter the -desired low power state; it will resume all the devices it's suspended so far. - - -Hibernation Phases ------------------- -Hibernating the system is more complicated than putting it into the standby or -memory sleep state, because it involves creating a system image and saving it. -Therefore there are more phases of hibernation and special device PM methods are -used in this case. - -First, it is necessary to prepare the system for creating a hibernation image. -This is similar to putting the system into the standby or memory sleep state, -although it generally doesn't require that devices be put into low power states -(that is even not desirable at this point). Driver notifications are then -issued in the following order: - - 1 bus->pm.prepare(dev) is called after tasks have been frozen and enough - memory has been freed. - - 2 class->pm.freeze(dev) is called if implemented. It may invoke the - device driver's ->pm.freeze() method, unless type->pm.freeze(dev) or - bus->pm.freeze() does that. - - 3 type->pm.freeze(dev) is called if implemented. It may invoke the device - driver's ->pm.suspend() method, unless class->pm.freeze(dev) or - bus->pm.freeze() does that. - - 4 bus->pm.freeze(dev) is called, if implemented. It usually calls the - device driver's ->pm.freeze() method. - - 5 bus->pm.freeze_noirq(dev) is called, if implemented. It may call the - device driver's ->pm.freeze_noirq() method, depending on the bus type - in question. - -The difference between ->pm.freeze() and the corresponding ->pm.suspend() (and -similarly for the "noirq" variants) is that the former should avoid preparing -devices to trigger system wakeup events and putting devices into low power -states, although they generally have to save the values of device registers -so that it's possible to restore them during system resume. - -Second, after the system image has been created, the functionality of devices -has to be restored so that the image can be saved. That is similar to resuming -devices after the system has been woken up from the standby or memory sleep -state, which is described below, and causes the following device notifications -to be issued: - - 1 bus->pm.thaw_noirq(dev), if implemented; may call the device driver's - ->pm.thaw_noirq() method, depending on the bus type in question. - - 2 bus->pm.thaw(dev), if implemented; usually calls the device driver's - ->pm.thaw() method. - - 3 type->pm.thaw(dev), if implemented; may call the device driver's - ->pm.thaw() method if not called by the bus type or class. - - 4 class->pm.thaw(dev), if implemented; may call the device driver's - ->pm.thaw() method if not called by the bus type or device type. - - 5 bus->pm.complete(dev), if implemented; may call the device driver's - ->pm.complete() method. - -Generally, the role of the ->pm.thaw() methods (including the "noirq" variants) -is to bring the device back to the fully functional state, so that it may be -used for saving the image, if necessary. The role of bus->pm.complete() is to -reverse whatever bus->pm.prepare() did (likewise for the analogous device driver -callbacks). - -After the image has been saved, the devices need to be prepared for putting the -system into the low power state. That is analogous to suspending them before -putting the system into the standby or memory sleep state and involves the -following device notifications: - - 1 bus->pm.prepare(dev). - - 2 class->pm.poweroff(dev), if implemented; may invoke the device driver's - ->pm.poweroff() method if not called by the bus type or device type. - - 3 type->pm.poweroff(dev), if implemented; may invoke the device driver's - ->pm.poweroff() method if not called by the bus type or device class. - - 4 bus->pm.poweroff(dev), if implemented; usually calls the device driver's - ->pm.poweroff() method (if not called by the device class or type). - - 5 bus->pm.poweroff_noirq(dev), if implemented; may call the device - driver's ->pm.poweroff_noirq() method, depending on the bus type - in question. - -The difference between ->pm.poweroff() and the corresponding ->pm.suspend() (and -analogously for the "noirq" variants) is that the former need not save the -device's registers. Still, they should prepare the device for triggering -system wakeup events if necessary and finally put it into the appropriate low -power state. - - -Device Low Power (suspend) States ---------------------------------- -Device low-power states aren't standard. One device might only handle -"on" and "off, while another might support a dozen different versions of -"on" (how many engines are active?), plus a state that gets back to "on" -faster than from a full "off". - -Some busses define rules about what different suspend states mean. PCI -gives one example: after the suspend sequence completes, a non-legacy -PCI device may not perform DMA or issue IRQs, and any wakeup events it -issues would be issued through the PME# bus signal. Plus, there are -several PCI-standard device states, some of which are optional. - -In contrast, integrated system-on-chip processors often use IRQs as the -wakeup event sources (so drivers would call enable_irq_wake) and might -be able to treat DMA completion as a wakeup event (sometimes DMA can stay -active too, it'd only be the CPU and some peripherals that sleep). - -Some details here may be platform-specific. Systems may have devices that -can be fully active in certain sleep states, such as an LCD display that's -refreshed using DMA while most of the system is sleeping lightly ... and -its frame buffer might even be updated by a DSP or other non-Linux CPU while -the Linux control processor stays idle. - -Moreover, the specific actions taken may depend on the target system state. -One target system state might allow a given device to be very operational; -another might require a hard shut down with re-initialization on resume. -And two different target systems might use the same device in different -ways; the aforementioned LCD might be active in one product's "standby", -but a different product using the same SOC might work differently. +If any of these callbacks returns an error, the system won't enter the desired +low-power state. Instead the PM core will unwind its actions by resuming all +the devices that were suspended. -Resuming Devices ----------------- -Resuming is done in multiple phases, much like suspending, with all -devices processing each phase's calls before the next phase begins. +Leaving System Suspend +---------------------- +When resuming from standby or memory sleep, the phases are: -Again, however, different callbacks are used depending on whether the system is -waking up from the standby or memory sleep state ("suspend-to-RAM") or from -hibernation ("suspend-to-disk"). + resume_noirq, resume, complete. -If the system is waking up from the standby or memory sleep state, the phases -are seen by driver notifications issued in this order: - - 1 bus->pm.resume_noirq(dev) is called, if implemented. It may call the - device driver's ->pm.resume_noirq() method, depending on the bus type in - question. - - The role of this method is to perform actions that need to be performed - before device drivers' interrupt handlers are allowed to be invoked. If - the given bus type permits devices to share interrupt vectors, like PCI, - this method should bring the device and its driver into a state in which - the driver can recognize if the device is the source of incoming - interrupts, if any, and handle them correctly. + 1. The resume_noirq callback methods should perform any actions needed + before the driver's interrupt handlers are invoked. This generally + means undoing the actions of the suspend_noirq phase. If the bus type + permits devices to share interrupt vectors, like PCI, the method should + bring the device and its driver into a state in which the driver can + recognize if the device is the source of incoming interrupts, if any, + and handle them correctly. For example, the PCI bus type's ->pm.resume_noirq() puts the device into - the full power state (D0 in the PCI terminology) and restores the - standard configuration registers of the device. Then, it calls the + the full-power state (D0 in the PCI terminology) and restores the + standard configuration registers of the device. Then it calls the device driver's ->pm.resume_noirq() method to perform device-specific - actions needed at this stage of resume. - - 2 bus->pm.resume(dev) is called, if implemented. It usually calls the - device driver's ->pm.resume() method. - - This call should generally bring the the device back to the working - state, so that it can do I/O as requested after the call has returned. - However, it may be more convenient to use the device class or device - type ->pm.resume() for this purpose, in which case the bus type's - ->pm.resume() method need not be implemented at all. - - 3 type->pm.resume(dev) is called, if implemented. It may invoke the - device driver's ->pm.resume() method, unless class->pm.resume(dev) or - bus->pm.resume() does that. - - For devices that are not associated with any bus type or device class - this method plays the role of bus->pm.resume(). - - 4 class->pm.resume(dev) is called, if implemented. It may invoke the - device driver's ->pm.resume() method, unless bus->pm.resume(dev) or - type->pm.resume() does that. - - For devices that are not associated with any bus type or device type - this method plays the role of bus->pm.resume(). + actions. - 5 bus->pm.complete(dev) is called, if implemented. It is supposed to - invoke the device driver's ->pm.complete() method. + 2. The resume methods should bring the the device back to its operating + state, so that it can perform normal I/O. This generally involves + undoing the actions of the suspend phase. - The role of this method is to reverse whatever bus->pm.prepare(dev) - (or the driver's ->pm.prepare()) did during suspend, if necessary. + 3. The complete phase uses only a bus callback. The method should undo the + actions of the prepare phase. Note, however, that new children may be + registered below the device as soon as the resume callbacks occur; it's + not necessary to wait until the complete phase. -At the end of those phases, drivers should normally be as functional as -they were before suspending: I/O can be performed using DMA and IRQs, and -the relevant clocks are gated on. In principle the device need not be -"fully on"; it might be in a runtime lowpower/suspend state during suspend and -the resume callbacks may try to restore that state, but that need not be -desirable from the user's point of view. In fact, there are multiple reasons -why it's better to always put devices into the "fully working" state in the -system sleep resume callbacks and they are discussed in more detail in -Documentation/power/runtime_pm.txt. +At the end of these phases, drivers should be as functional as they were before +suspending: I/O can be performed using DMA and IRQs, and the relevant clocks are +gated on. Even if the device was in a low-power state before the system sleep +because of runtime power management, afterwards it should be back in its +full-power state. There are multiple reasons why it's best to do this; they are +discussed in more detail in Documentation/power/runtime_pm.txt. However, the details here may again be platform-specific. For example, some systems support multiple "run" states, and the mode in effect at @@ -502,103 +376,156 @@ the suspend was carried out, but that can't be guaranteed (in fact, it ususally is not the case). Drivers must also be prepared to notice that the device has been removed -while the system was powered off, whenever that's physically possible. +while the system was powered down, whenever that's physically possible. PCMCIA, MMC, USB, Firewire, SCSI, and even IDE are common examples of busses where common Linux platforms will see such removal. Details of how drivers will notice and handle such removals are currently bus-specific, and often involve a separate thread. +These callbacks may return an error value, but the PM core will ignore such +errors since there's nothing it can do about them other than printing them in +the system log. -Resume From Hibernation ------------------------ + +Entering Hibernation +-------------------- +Hibernating the system is more complicated than putting it into the standby or +memory sleep state, because it involves creating and saving a system image. +Therefore there are more phases for hibernation, with a different set of +callbacks. These phases always run after tasks have been frozen and memory has +been freed. + +The general procedure for hibernation is to quiesce all devices (freeze), create +an image of the system memory while everything is stable, reactivate all +devices (thaw), write the image to permanent storage, and finally shut down the +system (poweroff). The phases used to accomplish this are: + + prepare, freeze, freeze_noirq, thaw_noirq, thaw, complete, + prepare, poweroff, poweroff_noirq + + 1. The prepare phase is discussed in the "Entering System Suspend" section + above. + + 2. The freeze methods should quiesce the device so that it doesn't generate + IRQs or DMA, and they may need to save the values of device registers. + However the device does not have to be put in a low-power state, and to + save time it's best not to do so. Also, the device should not be + prepared to generate wakeup events. + + 3. The freeze_noirq phase is analogous to the suspend_noirq phase discussed + above, except again that the device should not be put in a low-power + state and should not be allowed to generate wakeup events. + +At this point the system image is created. All devices should be inactive and +the contents of memory should remain undisturbed while this happens, so that the +image forms an atomic snapshot of the system state. + + 4. The thaw_noirq phase is analogous to the resume_noirq phase discussed + above. The main difference is that its methods can assume the device is + in the same state as at the end of the freeze_noirq phase. + + 5. The thaw phase is analogous to the resume phase discussed above. Its + methods should bring the device back to an operating state, so that it + can be used for saving the image if necessary. + + 6. The complete phase is discussed in the "Leaving System Suspend" section + above. + +At this point the system image is saved, and the devices then need to be +prepared for the upcoming system shutdown. This is much like suspending them +before putting the system into the standby or memory sleep state, and the phases +are similar. + + 7. The prepare phase is discussed above. + + 8. The poweroff phase is analogous to the suspend phase. + + 9. The poweroff_noirq phase is analogous to the suspend_noirq phase. + +The poweroff and poweroff_noirq callbacks should do essentially the same things +as the suspend and suspend_noirq callbacks. The only notable difference is that +they need not store the device register values, because the registers should +already have been stored during the freeze or freeze_noirq phases. + + +Leaving Hibernation +------------------- Resuming from hibernation is, again, more complicated than resuming from a sleep state in which the contents of main memory are preserved, because it requires a system image to be loaded into memory and the pre-hibernation memory contents to be restored before control can be passed back to the image kernel. -In principle, the image might be loaded into memory and the pre-hibernation -memory contents might be restored by the boot loader. For this purpose, -however, the boot loader would need to know the image kernel's entry point and -there's no protocol defined for passing that information to boot loaders. As -a workaround, the boot loader loads a fresh instance of the kernel, called the -boot kernel, into memory and passes control to it in a usual way. Then, the -boot kernel reads the hibernation image, restores the pre-hibernation memory -contents and passes control to the image kernel. Thus, in fact, two different -kernels are involved in resuming from hibernation and in general they are not -only different because they play different roles in this operation. Actually, -the boot kernel may be completely different from the image kernel. Not only -the configuration of it, but also the version of it may be different. -The consequences of this are important to device drivers and their subsystems -(bus types, device classes and device types) too. - -Namely, to be able to load the hibernation image into memory, the boot kernel -needs to include at least the subset of device drivers allowing it to access the -storage medium containing the image, although it generally doesn't need to -include all of the drivers included into the image kernel. After the image has -been loaded the devices handled by those drivers need to be prepared for passing -control back to the image kernel. This is very similar to the preparation of -devices for creating a hibernation image described above. In fact, it is done -in the same way, with the help of the ->pm.prepare(), ->pm.freeze() and -->pm.freeze_noirq() callbacks, but only for device drivers included in the boot -kernel (whose versions may generally be different from the versions of the -analogous drivers from the image kernel). +Although in principle, the image might be loaded into memory and the +pre-hibernation memory contents restored by the boot loader, in practice this +can't be done because boot loaders aren't smart enough and there is no +established protocol for passing the necessary information. So instead, the +boot loader loads a fresh instance of the kernel, called the boot kernel, into +memory and passes control to it in the usual way. Then the boot kernel reads +the system image, restores the pre-hibernation memory contents, and passes +control to the image kernel. Thus two different kernels are involved in +resuming from hibernation. In fact, the boot kernel may be completely different +from the image kernel: a different configuration and even a different version. +This has important consequences for device drivers and their subsystems. + +To be able to load the system image into memory, the boot kernel needs to +include at least a subset of device drivers allowing it to access the storage +medium containing the image, although it doesn't need to include all of the +drivers present in the image kernel. After the image has been loaded, the +devices managed by the boot kernel need to be prepared for passing control back +to the image kernel. This is very similar to the initial steps involved in +creating a system image, and it is accomplished in the same way, using prepare, +freeze, and freeze_noirq phases. However the devices affected by these phases +are only those having drivers in the boot kernel; other devices will still be in +whatever state the boot loader left them. Should the restoration of the pre-hibernation memory contents fail, the boot -kernel would carry out the procedure of "thawing" devices described above, using -the ->pm.thaw_noirq(), ->pm.thaw(), and ->pm.complete() callbacks provided by -subsystems and device drivers. This, however, is a very rare condition. Most -often the pre-hibernation memory contents are restored successfully and control -is passed to the image kernel that is now responsible for bringing the system -back to the working state. +kernel would go through the "thawing" procedure described above, using the +thaw_noirq, thaw, and complete phases, and then continue running normally. This +happens only rarely. Most often the pre-hibernation memory contents are +restored successfully and control is passed to the image kernel, which then +becomes responsible for bringing the system back to the working state. -To achieve this goal, among other things, the image kernel restores the -pre-hibernation functionality of devices. This operation is analogous to the -resuming of devices after waking up from the memory sleep state, although it -involves different device notifications which are the following: +To achieve this, the image kernel must restore the devices' pre-hibernation +functionality. The operation is much like waking up from the memory sleep +state, although it involves different phases: - 1 bus->pm.restore_noirq(dev), if implemented; may call the device driver's - ->pm.restore_noirq() method, depending on the bus type in question. + restore_noirq, restore, complete - 2 bus->pm.restore(dev), if implemented; usually calls the device driver's - ->pm.restore() method. + 1. The restore_noirq phase is analogous to the resume_noirq phase. - 3 type->pm.restore(dev), if implemented; may call the device driver's - ->pm.restore() method if not called by the bus type or class. + 2. The restore phase is analogous to the resume phase. - 4 class->pm.restore(dev), if implemented; may call the device driver's - ->pm.restore() method if not called by the bus type or device type. + 3. The complete phase is discussed above. - 5 bus->pm.complete(dev), if implemented; may call the device driver's - ->pm.complete() method. - -The roles of the ->pm.restore_noirq() and ->pm.restore() callbacks are analogous -to the roles of the corresponding resume callbacks, but they must assume that -the device may have been accessed before by the boot kernel. Consequently, the -state of the device before they are called may be different from the state of it -right prior to calling the resume callbacks. That difference usually doesn't -matter, so the majority of device drivers can set their resume and restore -callback pointers to the same routine. Nevertheless, different callback -pointers are used in case there is a situation where it actually matters. +The main difference from resume[_noirq] is that restore[_noirq] must assume the +device has been accessed and reconfigured by the boot loader or the boot kernel. +Consequently the state of the device may be different from the state remembered +from the freeze and freeze_noirq phases. The device may even need to be reset +and completely re-initialized. In many cases this difference doesn't matter, so +the resume[_noirq] and restore[_norq] method pointers can be set to the same +routines. Nevertheless, different callback pointers are used in case there is a +situation where it actually matters. System Devices -------------- -System devices follow a slightly different API, which can be found in +System devices (sysdevs) follow a slightly different API, which can be found in include/linux/sysdev.h drivers/base/sys.c -System devices will only be suspended with interrupts disabled, and after -all other devices have been suspended. On resume, they will be resumed -before any other devices, and also with interrupts disabled. +System devices will be suspended with interrupts disabled, and after all other +devices have been suspended. On resume, they will be resumed before any other +devices, and also with interrupts disabled. These things occur in special +"sysdev_driver" phases, which affect only system devices. -That is, when the non-boot CPUs are all offline and IRQs are disabled on the -remaining online CPU, then the sysdev_driver.suspend() phase is carried out, and -the system enters a sleep state (or hibernation image is created). During -resume (or after the image has been created) the sysdev_driver.resume() phase -is carried out, IRQs are enabled on the only online CPU, the non-boot CPUs are -enabled and that is followed by the "early resume" phase (in which the "noirq" -callbacks provided by subsystems and device drivers are invoked). +Thus, after the suspend_noirq (or freeze_noirq or poweroff_noirq) phase, when +the non-boot CPUs are all offline and IRQs are disabled on the remaining online +CPU, then a sysdev_driver.suspend phase is carried out, and the system enters a +sleep state (or a system image is created). During resume (or after the image +has been created or loaded) a sysdev_driver.resume phase is carried out, IRQs +are enabled on the only online CPU, the non-boot CPUs are enabled, and the +resume_noirq (or thaw_noirq or restore_noirq) phase begins. Code to actually enter and exit the system-wide low power state sometimes involves hardware details that are only known to the boot firmware, and @@ -606,18 +533,47 @@ may leave a CPU running software (from SRAM or flash memory) that monitors the system and manages its wakeup sequence. +Device Low Power (suspend) States +--------------------------------- +Device low-power states aren't standard. One device might only handle +"on" and "off, while another might support a dozen different versions of +"on" (how many engines are active?), plus a state that gets back to "on" +faster than from a full "off". + +Some busses define rules about what different suspend states mean. PCI +gives one example: after the suspend sequence completes, a non-legacy +PCI device may not perform DMA or issue IRQs, and any wakeup events it +issues would be issued through the PME# bus signal. Plus, there are +several PCI-standard device states, some of which are optional. + +In contrast, integrated system-on-chip processors often use IRQs as the +wakeup event sources (so drivers would call enable_irq_wake) and might +be able to treat DMA completion as a wakeup event (sometimes DMA can stay +active too, it'd only be the CPU and some peripherals that sleep). + +Some details here may be platform-specific. Systems may have devices that +can be fully active in certain sleep states, such as an LCD display that's +refreshed using DMA while most of the system is sleeping lightly ... and +its frame buffer might even be updated by a DSP or other non-Linux CPU while +the Linux control processor stays idle. + +Moreover, the specific actions taken may depend on the target system state. +One target system state might allow a given device to be very operational; +another might require a hard shut down with re-initialization on resume. +And two different target systems might use the same device in different +ways; the aforementioned LCD might be active in one product's "standby", +but a different product using the same SOC might work differently. + + Power Management Notifiers -------------------------- -As stated in Documentation/power/notifiers.txt, there are some operations that -cannot be carried out by the power management callbacks discussed above, because -carrying them out at these points would be too late or too early. To handle -these cases subsystems and device drivers may register power management -notifiers that are called before tasks are frozen and after they have been -thawed. - -Generally speaking, the PM notifiers are suitable for performing actions that -either require user space to be available, or at least won't interfere with user -space in a wrong way. +There are some operations that cannot be carried out by the power management +callbacks discussed above, because the callbacks occur too late or too early. +To handle these cases, subsystems and device drivers may register power +management notifiers that are called before tasks are frozen and after they have +been thawed. Generally speaking, the PM notifiers are suitable for performing +actions that either require user space to be available, or at least won't +interfere with user space. For details refer to Documentation/power/notifiers.txt. @@ -629,24 +585,23 @@ running. This feature is useful for devices that are not being used, and can offer significant power savings on a running system. These devices often support a range of runtime power states, which might use names such as "off", "sleep", "idle", "active", and so on. Those states will in some -cases (like PCI) be partially constrained by a bus the device uses, and will +cases (like PCI) be partially constrained by the bus the device uses, and will usually include hardware states that are also used in system sleep states. -Note, however, that a system-wide power transition can be started while some -devices are in low power states due to the runtime power management. The system -sleep PM callbacks should generally recognize such situations and react to them -appropriately, but the recommended actions to be taken in that cases are -subsystem-specific. - -In some cases the decision may be made at the subsystem level while in some -other cases the device driver may be left to decide. In some cases it may be -desirable to leave a suspended device in that state during system-wide power -transition, but in some other cases the device ought to be put back into the -full power state, for example to be configured for system wakeup or so that its -system wakeup capability can be disabled. That all depends on the hardware -and the design of the subsystem and device driver in question. - -During system-wide resume from a sleep state it's better to put devices into -the full power state, as explained in Documentation/power/runtime_pm.txt. Refer -to that document for more information regarding this particular issue as well as +A system-wide power transition can be started while some devices are in low +power states due to runtime power management. The system sleep PM callbacks +should recognize such situations and react to them appropriately, but the +necessary actions are subsystem-specific. + +In some cases the decision may be made at the subsystem level while in other +cases the device driver may be left to decide. In some cases it may be +desirable to leave a suspended device in that state during a system-wide power +transition, but in other cases the device must be put back into the full-power +state temporarily, for example so that its system wakeup capability can be +disabled. This all depends on the hardware and the design of the subsystem and +device driver in question. + +During system-wide resume from a sleep state it's best to put devices into the +full-power state, as explained in Documentation/power/runtime_pm.txt. Refer to +that document for more information regarding this particular issue as well as for information on the device runtime power management framework in general. -- cgit v1.2.2 From bc6a0cbd576c66995d782331456f68ae63a50af4 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Fri, 23 Apr 2010 20:32:29 +0200 Subject: PM / Hibernate: document open(/dev/snapshot) side effects Opening and closing /dev/snapshot causes the kernel to carry out some hibernate preparations that should be documented. [rjw: Added the changelog.] Signed-off-by: Pavel Machek Signed-off-by: Rafael J. Wysocki --- Documentation/power/userland-swsusp.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/power/userland-swsusp.txt b/Documentation/power/userland-swsusp.txt index b967cd9137d..81680f9f590 100644 --- a/Documentation/power/userland-swsusp.txt +++ b/Documentation/power/userland-swsusp.txt @@ -24,6 +24,10 @@ assumed to be in the resume mode. The device cannot be open for simultaneous reading and writing. It is also impossible to have the device open more than once at a time. +Even opening the device has side effects. Data structures are +allocated, and PM_HIBERNATION_PREPARE / PM_RESTORE_PREPARE chains are +called. + The ioctl() commands recognized by the device are: SNAPSHOT_FREEZE - freeze user space processes (the current process is -- cgit v1.2.2 From ed77134bfccf5e75b6cbadab268e559dbe6a4ebb Mon Sep 17 00:00:00 2001 From: Mark Gross Date: Thu, 6 May 2010 01:59:26 +0200 Subject: PM QOS update This patch changes the string based list management to a handle base implementation to help with the hot path use of pm-qos, it also renames much of the API to use "request" as opposed to "requirement" that was used in the initial implementation. I did this because request more accurately represents what it actually does. Also, I added a string based ABI for users wanting to use a string interface. So if the user writes 0xDDDDDDDD formatted hex it will be accepted by the interface. (someone asked me for it and I don't think it hurts anything.) This patch updates some documentation input I got from Randy. Signed-off-by: markgross Signed-off-by: Rafael J. Wysocki --- Documentation/power/pm_qos_interface.txt | 48 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt index c40866e8b95..bfed898a03f 100644 --- a/Documentation/power/pm_qos_interface.txt +++ b/Documentation/power/pm_qos_interface.txt @@ -18,44 +18,46 @@ and pm_qos_params.h. This is done because having the available parameters being runtime configurable or changeable from a driver was seen as too easy to abuse. -For each parameter a list of performance requirements is maintained along with +For each parameter a list of performance requests is maintained along with an aggregated target value. The aggregated target value is updated with -changes to the requirement list or elements of the list. Typically the -aggregated target value is simply the max or min of the requirement values held +changes to the request list or elements of the list. Typically the +aggregated target value is simply the max or min of the request values held in the parameter list elements. From kernel mode the use of this interface is simple: -pm_qos_add_requirement(param_id, name, target_value): -Will insert a named element in the list for that identified PM_QOS parameter -with the target value. Upon change to this list the new target is recomputed -and any registered notifiers are called only if the target value is now -different. -pm_qos_update_requirement(param_id, name, new_target_value): -Will search the list identified by the param_id for the named list element and -then update its target value, calling the notification tree if the aggregated -target is changed. with that name is already registered. +handle = pm_qos_add_request(param_class, target_value): +Will insert an element into the list for that identified PM_QOS class with the +target value. Upon change to this list the new target is recomputed and any +registered notifiers are called only if the target value is now different. +Clients of pm_qos need to save the returned handle. -pm_qos_remove_requirement(param_id, name): -Will search the identified list for the named element and remove it, after -removal it will update the aggregate target and call the notification tree if -the target was changed as a result of removing the named requirement. +void pm_qos_update_request(handle, new_target_value): +Will update the list element pointed to by the handle with the new target value +and recompute the new aggregated target, calling the notification tree if the +target is changed. + +void pm_qos_remove_request(handle): +Will remove the element. After removal it will update the aggregate target and +call the notification tree if the target was changed as a result of removing +the request. From user mode: -Only processes can register a pm_qos requirement. To provide for automatic -cleanup for process the interface requires the process to register its -parameter requirements in the following way: +Only processes can register a pm_qos request. To provide for automatic +cleanup of a process, the interface requires the process to register its +parameter requests in the following way: To register the default pm_qos target for the specific parameter, the process must open one of /dev/[cpu_dma_latency, network_latency, network_throughput] As long as the device node is held open that process has a registered -requirement on the parameter. The name of the requirement is "process_" -derived from the current->pid from within the open system call. +request on the parameter. -To change the requested target value the process needs to write a s32 value to -the open device node. This translates to a pm_qos_update_requirement call. +To change the requested target value the process needs to write an s32 value to +the open device node. Alternatively the user mode program could write a hex +string for the value using 10 char long format e.g. "0x12345678". This +translates to a pm_qos_update_request call. To remove the user mode request for a target value simply close the device node. -- cgit v1.2.2 From ca0dbd86b12be9af7cda230890eb741d5cb8b624 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 7 May 2010 16:52:26 -0300 Subject: doc: inode uses a mutex instead of a semaphore. Replace the introduced i_sem by an i_mutex in the filesystem locking documentation. This was introduced [1] after all occurrences were already replaced in the same text [2]. However, the term "inode semaphore" has not been replaced then, and it's replaced now. [1] afddba49d18f346e5cc2938b6ed7c512db18ca68 [2] a7bc02f4f47fd0e7860c6589f0ad000d1476f7a3 Signed-off-by: Thadeu Lima de Souza Cascardo Cc: Nick Piggin Cc: Artem Bityutskiy Cc: Randy Dunlap Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: Jiri Kosina --- Documentation/filesystems/Locking | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 06bbbed7120..af1608070cd 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -178,7 +178,7 @@ prototypes: locking rules: All except set_page_dirty may block - BKL PageLocked(page) i_sem + BKL PageLocked(page) i_mutex writepage: no yes, unlocks (see below) readpage: no yes, unlocks sync_page: no maybe @@ -429,7 +429,7 @@ check_flags: no implementations. If your fs is not using generic_file_llseek, you need to acquire and release the appropriate locks in your ->llseek(). For many filesystems, it is probably safe to acquire the inode -semaphore. Note some filesystems (i.e. remote ones) provide no +mutex. Note some filesystems (i.e. remote ones) provide no protection for i_size so you will need to use the BKL. Note: ext2_release() was *the* source of contention on fs-intensive -- cgit v1.2.2 From a52357259680fe5368c2fabf5949209e231f2aa2 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 11 May 2010 17:12:33 +0200 Subject: x86/amd-iommu: Add amd_iommu=off command line option This patch adds a command line option to tell the AMD IOMMU driver to not initialize any IOMMU it finds. Signed-off-by: Joerg Roedel --- Documentation/kernel-parameters.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 839b21b0699..0c6c56076d1 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -324,6 +324,8 @@ and is between 256 and 4096 characters. It is defined in the file they are unmapped. Otherwise they are flushed before they will be reused, which is a lot of faster + off - do not initialize any AMD IOMMU found in + the system amijoy.map= [HW,JOY] Amiga joystick support Map of devices attached to JOY0DAT and JOY1DAT -- cgit v1.2.2 From 639b91a364fafea24fc1d2e8853c12ce45d4ceea Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Mon, 15 Mar 2010 22:39:27 +0800 Subject: [ARM] pxa: remove now un-used corgi_ssp.c and corgi_lcd.c The only use of corgi_ssp.c is corgi_ts.c, which is now deprecated and removed. Remove corgi_ssp.c and corgi_lcd.c and their relevant function declarations and data structures. Signed-off-by: Eric Miao Cc: Richard Purdie Cc: Pavel Machek --- Documentation/feature-removal-schedule.txt | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 05df0b7514b..6237d74be86 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -531,18 +531,6 @@ Who: Eric Miao ---------------------------- -What: corgi_ssp and corgi_ts driver -When: 2.6.35 -Files: arch/arm/mach-pxa/corgi_ssp.c, drivers/input/touchscreen/corgi_ts.c -Why: The corgi touchscreen is now deprecated in favour of the generic - ads7846.c driver. The noise reduction technique used in corgi_ts.c, - that's to wait till vsync before ADC sampling, is also integrated into - ads7846 driver now. Provided that the original driver is not generic - and is difficult to maintain, it will be removed later. -Who: Eric Miao - ----------------------------- - What: capifs When: February 2011 Files: drivers/isdn/capi/capifs.* -- cgit v1.2.2 From 25646d70a0d386ab923a189f9790aeae3eb4f1b5 Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Tue, 27 Apr 2010 14:50:54 +0800 Subject: input: remove obsolete {corgi,spitz,tosa}kbd.c Signed-off-by: Eric Miao --- Documentation/feature-removal-schedule.txt | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 6237d74be86..a5e381185de 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -520,17 +520,6 @@ Who: Hans de Goede ---------------------------- -What: corgikbd, spitzkbd, tosakbd driver -When: 2.6.35 -Files: drivers/input/keyboard/{corgi,spitz,tosa}kbd.c -Why: We now have a generic GPIO based matrix keyboard driver that - are fully capable of handling all the keys on these devices. - The original drivers manipulate the GPIO registers directly - and so are difficult to maintain. -Who: Eric Miao - ----------------------------- - What: capifs When: February 2011 Files: drivers/isdn/capi/capifs.* -- cgit v1.2.2 From 75568f8094eb0333e9c2109b23cbc8b82d318a3c Mon Sep 17 00:00:00 2001 From: Alex Chiang Date: Mon, 8 Mar 2010 10:24:29 -0700 Subject: PCI: create function symlinks in /sys/bus/pci/slots/N/ Create convenience symlinks in sysfs, linking slots to device functions, and vice versa. These links make it easier for users to figure out which devices actually live in what slots. For example: sapphire:/sys/bus/pci/slots # ls 1 10 2 3 4 5 6 7 8 9 sapphire:/sys/bus/pci/slots # ls -l 3 total 0 -r--r--r-- 1 root root 65536 Aug 18 14:10 address lrwxrwxrwx 1 root root 0 Aug 18 14:10 function0 -> ../../../../devices/pci0000:23/0000:23:01.0 lrwxrwxrwx 1 root root 0 Aug 18 14:10 function1 -> ../../../../devices/pci0000:23/0000:23:01.1 sapphire:/sys/bus/pci/slots # ls -l 3/function0/slot lrwxrwxrwx 1 root root 0 Aug 18 14:13 3/function0/slot -> ../../../bus/pci/slots/3 The original form of this patch was written by Matthew Wilcox, and was enhanced to include links from the sysfs slots/ directory pointing back at the device functions. Cc: willy@linux.intel.com Signed-off-by: Alex Chiang Signed-off-by: Jesse Barnes --- Documentation/ABI/testing/sysfs-bus-pci | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index 25be3250f7d..428676cfa61 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci @@ -133,6 +133,46 @@ Description: The symbolic link points to the PCI device sysfs entry of the Physical Function this device associates with. + +What: /sys/bus/pci/slots/... +Date: April 2005 (possibly older) +KernelVersion: 2.6.12 (possibly older) +Contact: linux-pci@vger.kernel.org +Description: + When the appropriate driver is loaded, it will create a + directory per claimed physical PCI slot in + /sys/bus/pci/slots/. The names of these directories are + specific to the driver, which in turn, are specific to the + platform, but in general, should match the label on the + machine's physical chassis. + + The drivers that can create slot directories include the + PCI hotplug drivers, and as of 2.6.27, the pci_slot driver. + + The slot directories contain, at a minimum, a file named + 'address' which contains the PCI bus:device:function tuple. + Other files may appear as well, but are specific to the + driver. + +What: /sys/bus/pci/slots/.../function[0-7] +Date: March 2010 +KernelVersion: 2.6.35 +Contact: linux-pci@vger.kernel.org +Description: + If PCI slot directories (as described above) are created, + and the physical slot is actually populated with a device, + symbolic links in the slot directory pointing to the + device's PCI functions are created as well. + +What: /sys/bus/pci/devices/.../slot +Date: March 2010 +KernelVersion: 2.6.35 +Contact: linux-pci@vger.kernel.org +Description: + If PCI slot directories (as described above) are created, + a symbolic link pointing to the slot directory will be + created as well. + What: /sys/bus/pci/slots/.../module Date: June 2009 Contact: linux-pci@vger.kernel.org -- cgit v1.2.2 From d4dfd7278eade24c4aa4b36b8df981fab04f2f26 Mon Sep 17 00:00:00 2001 From: Hidetoshi Seto Date: Thu, 15 Apr 2010 13:08:24 +0900 Subject: PCI: aerdrv, doc: update example output in pcieaer-howto.txt Follow new format. Signed-off-by: Hidetoshi Seto Reviewed-by: Kenji Kaneshige Signed-off-by: Jesse Barnes --- Documentation/PCI/pcieaer-howto.txt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'Documentation') diff --git a/Documentation/PCI/pcieaer-howto.txt b/Documentation/PCI/pcieaer-howto.txt index be21001ab14..8c406a49679 100644 --- a/Documentation/PCI/pcieaer-howto.txt +++ b/Documentation/PCI/pcieaer-howto.txt @@ -71,15 +71,11 @@ console. If it's a correctable error, it is outputed as a warning. Otherwise, it is printed as an error. So users could choose different log level to filter out correctable error messages. -Below shows an example. -+------ PCI-Express Device Error -----+ -Error Severity : Uncorrected (Fatal) -PCIE Bus Error type : Transaction Layer -Unsupported Request : First -Requester ID : 0500 -VendorID=8086h, DeviceID=0329h, Bus=05h, Device=00h, Function=00h -TLB Header: -04000001 00200a03 05010000 00050100 +Below shows an example: +0000:50:00.0: PCIe Bus Error: severity=Uncorrected (Fatal), type=Transaction Layer, id=0500(Requester ID) +0000:50:00.0: device [8086:0329] error status/mask=00100000/00000000 +0000:50:00.0: [20] Unsupported Request (First) +0000:50:00.0: TLP Header: 04000001 00200a03 05010000 00050100 In the example, 'Requester ID' means the ID of the device who sends the error message to root port. Pls. refer to pci express specs for -- cgit v1.2.2 From 89713422a768458a0d375f0c2f3586cd5ccde6a1 Mon Sep 17 00:00:00 2001 From: Hidetoshi Seto Date: Thu, 15 Apr 2010 13:21:27 +0900 Subject: PCI: aerdrv: introduce default_downstream_reset_link I noticed that when I inject a fatal error to an endpoint via aer-inject, aer_root_reset() is called as reset_link for a downstream port at upstream of the endpoint: pcieport 0000:00:06.0: AER: Uncorrected (Fatal) error received: id=5401 : pcieport 0000:52:02.0: Root Port link has been reset It externally appears to be working, but internally issues some accesses to PCI_ERR_ROOT_COMMAND/STATUS registers that is for root port so not available on downstream port. This patch introduces default_downstream_reset_link that is a version of aer_root_reset() with no accesses to root port's register. It is used for downstream ports that has no reset_link function its specific. This patch also updates related description in pcieaer-howto.txt. Some minor fixes are included. Signed-off-by: Hidetoshi Seto Reviewed-by: Kenji Kaneshige Signed-off-by: Jesse Barnes --- Documentation/PCI/pcieaer-howto.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/PCI/pcieaer-howto.txt b/Documentation/PCI/pcieaer-howto.txt index 8c406a49679..26d3d945c3c 100644 --- a/Documentation/PCI/pcieaer-howto.txt +++ b/Documentation/PCI/pcieaer-howto.txt @@ -13,7 +13,7 @@ Reporting (AER) driver and provides information on how to use it, as well as how to enable the drivers of endpoint devices to conform with PCI Express AER driver. -1.2 Copyright © Intel Corporation 2006. +1.2 Copyright (C) Intel Corporation 2006. 1.3 What is the PCI Express AER Driver? @@ -108,7 +108,7 @@ but the PCI Express link itself is fully functional. Fatal errors, on the other hand, cause the link to be unreliable. When AER is enabled, a PCI Express device will automatically send an -error message to the PCIE root port above it when the device captures +error message to the PCIe root port above it when the device captures an error. The Root Port, upon receiving an error reporting message, internally processes and logs the error message in its PCI Express capability structure. Error information being logged includes storing @@ -194,8 +194,9 @@ to reset link, AER port service driver is required to provide the function to reset link. Firstly, kernel looks for if the upstream component has an aer driver. If it has, kernel uses the reset_link callback of the aer driver. If the upstream component has no aer driver -and the port is downstream port, we will use the aer driver of the -root port who reports the AER error. As for upstream ports, +and the port is downstream port, we will perform a hot reset as the +default by setting the Secondary Bus Reset bit of the Bridge Control +register associated with the downstream port. As for upstream ports, they should provide their own aer service drivers with reset_link function. If error_detected returns PCI_ERS_RESULT_CAN_RECOVER and reset_link returns PCI_ERS_RESULT_RECOVERED, the error handling goes @@ -249,11 +250,11 @@ cleanup uncorrectable status register. Pls. refer to section 3.3. 4. Software error injection -Debugging PCIE AER error recovery code is quite difficult because it +Debugging PCIe AER error recovery code is quite difficult because it is hard to trigger real hardware errors. Software based error -injection can be used to fake various kinds of PCIE errors. +injection can be used to fake various kinds of PCIe errors. -First you should enable PCIE AER software error injection in kernel +First you should enable PCIe AER software error injection in kernel configuration, that is, following item should be in your .config. CONFIG_PCIEAER_INJECT=y or CONFIG_PCIEAER_INJECT=m -- cgit v1.2.2 From 3a370ca1dcf8c80aff7a0a21d6b0f50ca2a151e9 Mon Sep 17 00:00:00 2001 From: Don Prince Date: Wed, 12 May 2010 15:18:59 +0200 Subject: HID: Prodikeys PC-MIDI HID Driver A specialised HID driver for the Creative Prodikeys PC-MIDI USB Keyboard. The Prodikeys PC-MIDI is a multifunction keyboard comprising a qwerty keyboard, multimedia keys and a touch sensitive musical keyboard. The specialised HID driver adds full support for the musical keyboard and extra multimedia keys which are not currently handled by the default HID driver. The specialised HID driver interfaces with ALSA, and presents the midi keyboard as a rawmidi device. Sustain duration, octave shifting and the midi output channel can be read/written form userspace via sysfs. Signed-off-by: Don Prince ALSA parts: Acked-by: Clemens Ladisch Signed-off-by: Jiri Kosina --- .../ABI/testing/sysfs-driver-hid-prodikeys | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-hid-prodikeys (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-driver-hid-prodikeys b/Documentation/ABI/testing/sysfs-driver-hid-prodikeys new file mode 100644 index 00000000000..05d988c29a8 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-hid-prodikeys @@ -0,0 +1,29 @@ +What: /sys/bus/hid/drivers/prodikeys/.../channel +Date: April 2010 +KernelVersion: 2.6.34 +Contact: Don Prince +Description: + Allows control (via software) the midi channel to which + that the pc-midi keyboard will output.midi data. + Range: 0..15 + Type: Read/write +What: /sys/bus/hid/drivers/prodikeys/.../sustain +Date: April 2010 +KernelVersion: 2.6.34 +Contact: Don Prince +Description: + Allows control (via software) the sustain duration of a + note held by the pc-midi driver. + 0 means sustain mode is disabled. + Range: 0..5000 (milliseconds) + Type: Read/write +What: /sys/bus/hid/drivers/prodikeys/.../octave +Date: April 2010 +KernelVersion: 2.6.34 +Contact: Don Prince +Description: + Controls the octave shift modifier in the pc-midi driver. + The octave can be shifted via software up/down 2 octaves. + 0 means the no ocatve shift. + Range: -2..2 (minus 2 to plus 2) + Type: Read/Write -- cgit v1.2.2 From a71ba09655d197f22938fffa6f5d210ff5134f98 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 13 May 2010 18:42:25 +0900 Subject: sh: fixup the docbook paths for clock framework shuffling. Now that the definitions have been consolidated in an alternate header, update the template accordingly. Signed-off-by: Paul Mundt --- Documentation/DocBook/sh.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl index 0c3dc4c69dd..d858d92cf6d 100644 --- a/Documentation/DocBook/sh.tmpl +++ b/Documentation/DocBook/sh.tmpl @@ -19,13 +19,17 @@ - 2008 + 2008-2010 Paul Mundt - 2008 + 2008-2010 Renesas Technology Corp. + + 2010 + Renesas Electronics Corp. + @@ -77,7 +81,7 @@ Clock Framework Extensions -!Iarch/sh/include/asm/clock.h +!Iinclude/linux/sh_clk.h Machine Specific Interfaces -- cgit v1.2.2 From 4dc6ec00f6347b72312fa41dfc587d5302b05544 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 19 Apr 2010 15:11:28 -0400 Subject: nfsd4: implement reclaim_complete This is a mandatory operation. Also, here (not in open) is where we should be committing the reboot recovery information. Signed-off-by: J. Bruce Fields --- Documentation/filesystems/nfs/nfs41-server.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/filesystems/nfs/nfs41-server.txt b/Documentation/filesystems/nfs/nfs41-server.txt index 6a53a84afc7..04884914a1c 100644 --- a/Documentation/filesystems/nfs/nfs41-server.txt +++ b/Documentation/filesystems/nfs/nfs41-server.txt @@ -137,7 +137,7 @@ NS*| OPENATTR | OPT | | Section 18.17 | | READ | REQ | | Section 18.22 | | READDIR | REQ | | Section 18.23 | | READLINK | OPT | | Section 18.24 | -NS | RECLAIM_COMPLETE | REQ | | Section 18.51 | + | RECLAIM_COMPLETE | REQ | | Section 18.51 | | RELEASE_LOCKOWNER | MNI | | N/A | | REMOVE | REQ | | Section 18.25 | | RENAME | REQ | | Section 18.26 | -- cgit v1.2.2 From 4047f8b1f9f4b4ecc4863f5f10cd9ba388b32a94 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Wed, 12 May 2010 14:23:48 -0600 Subject: Add a document describing the padata interface This originally appeared as http://lwn.net/Articles/382257/. Cc: Steffen Klassert Signed-off-by: Jonathan Corbet --- Documentation/00-INDEX | 2 + Documentation/padata.txt | 107 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 Documentation/padata.txt (limited to 'Documentation') diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 06b982affe7..dd10b51b4e6 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -250,6 +250,8 @@ numastat.txt - info on how to read Numa policy hit/miss statistics in sysfs. oops-tracing.txt - how to decode those nasty internal kernel error dump messages. +padata.txt + - An introduction to the "padata" parallel execution API parisc/ - directory with info on using Linux on PA-RISC architecture. parport.txt diff --git a/Documentation/padata.txt b/Documentation/padata.txt new file mode 100644 index 00000000000..269d7d0d833 --- /dev/null +++ b/Documentation/padata.txt @@ -0,0 +1,107 @@ +The padata parallel execution mechanism +Last updated for 2.6.34 + +Padata is a mechanism by which the kernel can farm work out to be done in +parallel on multiple CPUs while retaining the ordering of tasks. It was +developed for use with the IPsec code, which needs to be able to perform +encryption and decryption on large numbers of packets without reordering +those packets. The crypto developers made a point of writing padata in a +sufficiently general fashion that it could be put to other uses as well. + +The first step in using padata is to set up a padata_instance structure for +overall control of how tasks are to be run: + + #include + + struct padata_instance *padata_alloc(const struct cpumask *cpumask, + struct workqueue_struct *wq); + +The cpumask describes which processors will be used to execute work +submitted to this instance. The workqueue wq is where the work will +actually be done; it should be a multithreaded queue, naturally. + +There are functions for enabling and disabling the instance: + + void padata_start(struct padata_instance *pinst); + void padata_stop(struct padata_instance *pinst); + +These functions literally do nothing beyond setting or clearing the +"padata_start() was called" flag; if that flag is not set, other functions +will refuse to work. + +The list of CPUs to be used can be adjusted with these functions: + + int padata_set_cpumask(struct padata_instance *pinst, + cpumask_var_t cpumask); + int padata_add_cpu(struct padata_instance *pinst, int cpu); + int padata_remove_cpu(struct padata_instance *pinst, int cpu); + +Changing the CPU mask has the look of an expensive operation, though, so it +probably should not be done with great frequency. + +Actually submitting work to the padata instance requires the creation of a +padata_priv structure: + + struct padata_priv { + /* Other stuff here... */ + void (*parallel)(struct padata_priv *padata); + void (*serial)(struct padata_priv *padata); + }; + +This structure will almost certainly be embedded within some larger +structure specific to the work to be done. Most its fields are private to +padata, but the structure should be zeroed at initialization time, and the +parallel() and serial() functions should be provided. Those functions will +be called in the process of getting the work done as we will see +momentarily. + +The submission of work is done with: + + int padata_do_parallel(struct padata_instance *pinst, + struct padata_priv *padata, int cb_cpu); + +The pinst and padata structures must be set up as described above; cb_cpu +specifies which CPU will be used for the final callback when the work is +done; it must be in the current instance's CPU mask. The return value from +padata_do_parallel() is a little strange; zero is an error return +indicating that the caller forgot the padata_start() formalities. -EBUSY +means that somebody, somewhere else is messing with the instance's CPU +mask, while -EINVAL is a complaint about cb_cpu not being in that CPU mask. +If all goes well, this function will return -EINPROGRESS, indicating that +the work is in progress. + +Each task submitted to padata_do_parallel() will, in turn, be passed to +exactly one call to the above-mentioned parallel() function, on one CPU, so +true parallelism is achieved by submitting multiple tasks. Despite the +fact that the workqueue is used to make these calls, parallel() is run with +software interrupts disabled and thus cannot sleep. The parallel() +function gets the padata_priv structure pointer as its lone parameter; +information about the actual work to be done is probably obtained by using +container_of() to find the enclosing structure. + +Note that parallel() has no return value; the padata subsystem assumes that +parallel() will take responsibility for the task from this point. The work +need not be completed during this call, but, if parallel() leaves work +outstanding, it should be prepared to be called again with a new job before +the previous one completes. When a task does complete, parallel() (or +whatever function actually finishes the job) should inform padata of the +fact with a call to: + + void padata_do_serial(struct padata_priv *padata); + +At some point in the future, padata_do_serial() will trigger a call to the +serial() function in the padata_priv structure. That call will happen on +the CPU requested in the initial call to padata_do_parallel(); it, too, is +done through the workqueue, but with local software interrupts disabled. +Note that this call may be deferred for a while since the padata code takes +pains to ensure that tasks are completed in the order in which they were +submitted. + +The one remaining function in the padata API should be called to clean up +when a padata instance is no longer needed: + + void padata_free(struct padata_instance *pinst); + +This function will busy-wait while any remaining tasks are completed, so it +might be best not to call it while there is work outstanding. Shutting +down the workqueue, if necessary, should be done separately. -- cgit v1.2.2 From 294440887b32c58d220fb54b73b7a58079b78f20 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Thu, 22 Apr 2010 20:03:35 +0400 Subject: libata-sff: kill unused ata_bus_reset() ... since I see no callers of it. Signed-off-by: Sergei Shtylyov Signed-off-by: Jeff Garzik --- Documentation/DocBook/libata.tmpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index ff3e5bec1c2..70b811e9f2c 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl @@ -81,16 +81,14 @@ void (*port_disable) (struct ata_port *); - Called from ata_bus_probe() and ata_bus_reset() error paths, - as well as when unregistering from the SCSI module (rmmod, hot - unplug). + Called from ata_bus_probe() error path, as well as when + unregistering from the SCSI module (rmmod, hot unplug). This function should do whatever needs to be done to take the port out of use. In most cases, ata_port_disable() can be used as this hook. Called from ata_bus_probe() on a failed probe. - Called from ata_bus_reset() on a failed bus reset. Called from ata_scsi_release(). -- cgit v1.2.2 From 41dec29bcb05eb8ec396f70ce791c6e3e4ce4712 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Fri, 7 May 2010 22:47:50 +0400 Subject: libata: introduce sff_set_devctl() method The set of libata's taskfile access methods is clearly incomplete as it lacks a method to write to the device control register -- which forces drivers like 'pata_bf54x' and 'pata_scc' to implement more "high level" (and more weighty) methods like freeze() and postreset(). So, introduce the optional sff_set_devctl() method which the drivers only have to implement if the standard iowrite8() can't be used (just like the existing sff_check_altstatus() method) and make use of it in the freeze() and postreset() method implementations (I could also have used it in softreset() method but it also reads other taskfile registers without using tf_read() making that quite pointless); this makes freeze() method implementations in the 'pata_bf54x' and 'pata_scc' methods virtually identical to ata_sff_freeze(), so we can get rid of them completely. Signed-off-by: Sergei Shtylyov Signed-off-by: Jeff Garzik --- Documentation/DocBook/libata.tmpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index 70b811e9f2c..828748c4e78 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl @@ -225,6 +225,18 @@ u8 (*sff_check_altstatus)(struct ata_port *ap); + Write specific ATA shadow register + +void (*sff_set_devctl)(struct ata_port *ap, u8 ctl); + + + + Write the device control ATA shadow register to the hardware. + Most drivers don't need to define this. + + + + Select ATA device on bus void (*sff_dev_select)(struct ata_port *ap, unsigned int device); -- cgit v1.2.2 From e3826f1e946e7d2354943232f1457be1455a29e2 Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Wed, 5 May 2010 00:27:06 +0000 Subject: net: reserve ports for applications using fixed port numbers (Dropped the infiniband part, because Tetsuo modified the related code, I will send a separate patch for it once this is accepted.) This patch introduces /proc/sys/net/ipv4/ip_local_reserved_ports which allows users to reserve ports for third-party applications. The reserved ports will not be used by automatic port assignments (e.g. when calling connect() or bind() with port number 0). Explicit port allocation behavior is unchanged. Signed-off-by: Octavian Purdila Signed-off-by: WANG Cong Cc: Neil Horman Cc: Eric Dumazet Cc: Eric W. Biederman Signed-off-by: David S. Miller --- Documentation/networking/ip-sysctl.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Documentation') diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 8b72c88ba21..d0536b5a4e0 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -588,6 +588,37 @@ ip_local_port_range - 2 INTEGERS (i.e. by default) range 1024-4999 is enough to issue up to 2000 connections per second to systems supporting timestamps. +ip_local_reserved_ports - list of comma separated ranges + Specify the ports which are reserved for known third-party + applications. These ports will not be used by automatic port + assignments (e.g. when calling connect() or bind() with port + number 0). Explicit port allocation behavior is unchanged. + + The format used for both input and output is a comma separated + list of ranges (e.g. "1,2-4,10-10" for ports 1, 2, 3, 4 and + 10). Writing to the file will clear all previously reserved + ports and update the current list with the one given in the + input. + + Note that ip_local_port_range and ip_local_reserved_ports + settings are independent and both are considered by the kernel + when determining which ports are available for automatic port + assignments. + + You can reserve ports which are not in the current + ip_local_port_range, e.g.: + + $ cat /proc/sys/net/ipv4/ip_local_port_range + 32000 61000 + $ cat /proc/sys/net/ipv4/ip_local_reserved_ports + 8080,9148 + + although this is redundant. However such a setting is useful + if later the port range is changed to a value that will + include the reserved ports. + + Default: Empty + ip_nonlocal_bind - BOOLEAN If set, allows processes to bind() to non-local IP addresses, which can be quite useful - but may break some applications. -- cgit v1.2.2 From 3b098e2d7c693796cc4dffb07caa249fc0f70771 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Sat, 15 May 2010 23:57:10 -0700 Subject: net: Consistent skb timestamping With RPS inclusion, skb timestamping is not consistent in RX path. If netif_receive_skb() is used, its deferred after RPS dispatch. If netif_rx() is used, its done before RPS dispatch. This can give strange tcpdump timestamps results. I think timestamping should be done as soon as possible in the receive path, to get meaningful values (ie timestamps taken at the time packet was delivered by NIC driver to our stack), even if NAPI already can defer timestamping a bit (RPS can help to reduce the gap) Tom Herbert prefer to sample timestamps after RPS dispatch. In case sampling is expensive (HPET/acpi_pm on x86), this makes sense. Let admins switch from one mode to another, using a new sysctl, /proc/sys/net/core/netdev_tstamp_prequeue Its default value (1), means timestamps are taken as soon as possible, before backlog queueing, giving accurate timestamps. Setting a 0 value permits to sample timestamps when processing backlog, after RPS dispatch, to lower the load of the pre-RPS cpu. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- Documentation/sysctl/net.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Documentation') diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt index df38ef046f8..cbd05ffc606 100644 --- a/Documentation/sysctl/net.txt +++ b/Documentation/sysctl/net.txt @@ -84,6 +84,16 @@ netdev_max_backlog Maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them. +netdev_tstamp_prequeue +---------------------- + +If set to 0, RX packet timestamps can be sampled after RPS processing, when +the target CPU processes packets. It might give some delay on timestamps, but +permit to distribute the load on several cpus. + +If set to 1 (default), timestamps are sampled as soon as possible, before +queueing. + optmem_max ---------- -- cgit v1.2.2 From 69df49eb31e14fb01d9404497b751bfda9bfa012 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Sun, 16 May 2010 19:45:38 -0300 Subject: thinkpad-acpi: update HKEY and hotkey subdriver documentation (v2) Update the hotkey driver documentation to match the behaviour of the fixed NVRAM polling code. This also documents some HKEY events such as the alarms, which is very important information. Signed-off-by: Henrique de Moraes Holschuh --- Documentation/laptops/thinkpad-acpi.txt | 66 ++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 17 deletions(-) (limited to 'Documentation') diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 39c0a09d010..fc15538d8b4 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt @@ -292,13 +292,13 @@ sysfs notes: Warning: when in NVRAM mode, the volume up/down/mute keys are synthesized according to changes in the mixer, - so you have to use volume up or volume down to unmute, - as per the ThinkPad volume mixer user interface. When - in ACPI event mode, volume up/down/mute are reported as - separate events, but this behaviour may be corrected in - future releases of this driver, in which case the - ThinkPad volume mixer user interface semantics will be - enforced. + which uses a single volume up or volume down hotkey + press to unmute, as per the ThinkPad volume mixer user + interface. When in ACPI event mode, volume up/down/mute + events are reported by the firmware and can behave + differently (and that behaviour changes with firmware + version -- not just with firmware models -- as well as + OSI(Linux) state). hotkey_poll_freq: frequency in Hz for hot key polling. It must be between @@ -309,7 +309,7 @@ sysfs notes: will cause hot key presses that require NVRAM polling to never be reported. - Setting hotkey_poll_freq too low will cause repeated + Setting hotkey_poll_freq too low may cause repeated pressings of the same hot key to be misreported as a single key press, or to not even be detected at all. The recommended polling frequency is 10Hz. @@ -397,6 +397,7 @@ ACPI Scan event code Key Notes 0x1001 0x00 FN+F1 - + 0x1002 0x01 FN+F2 IBM: battery (rare) Lenovo: Screen lock @@ -404,7 +405,8 @@ event code Key Notes this hot key, even with hot keys disabled or with Fn+F3 masked off - IBM: screen lock + IBM: screen lock, often turns + off the ThinkLight as side-effect Lenovo: battery 0x1004 0x03 FN+F4 Sleep button (ACPI sleep button @@ -433,7 +435,8 @@ event code Key Notes Do you feel lucky today? 0x1008 0x07 FN+F8 IBM: toggle screen expand - Lenovo: configure UltraNav + Lenovo: configure UltraNav, + or toggle screen expand 0x1009 0x08 FN+F9 - .. .. .. @@ -444,7 +447,7 @@ event code Key Notes either through the ACPI event, or through a hotkey event. The firmware may refuse to - generate further FN+F4 key + generate further FN+F12 key press events until a S3 or S4 ACPI sleep cycle is performed, or some time passes. @@ -512,15 +515,19 @@ events for switches: SW_RFKILL_ALL T60 and later hardware rfkill rocker switch SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A -Non hot-key ACPI HKEY event map: +Non hotkey ACPI HKEY event map: +------------------------------- + +Events that are not propagated by the driver, except for legacy +compatibility purposes when hotkey_report_mode is set to 1: + 0x5001 Lid closed 0x5002 Lid opened 0x5009 Tablet swivel: switched to tablet mode 0x500A Tablet swivel: switched to normal mode 0x7000 Radio Switch may have changed state -The above events are not propagated by the driver, except for legacy -compatibility purposes when hotkey_report_mode is set to 1. +Events that are never propagated by the driver: 0x2304 System is waking up from suspend to undock 0x2305 System is waking up from suspend to eject bay @@ -528,14 +535,39 @@ compatibility purposes when hotkey_report_mode is set to 1. 0x2405 System is waking up from hibernation to eject bay 0x5010 Brightness level changed/control event -The above events are never propagated by the driver. +Events that are propagated by the driver to userspace: +0x2313 ALARM: System is waking up from suspend because + the battery is nearly empty +0x2413 ALARM: System is waking up from hibernation because + the battery is nearly empty 0x3003 Bay ejection (see 0x2x05) complete, can sleep again +0x3006 Bay hotplug request (hint to power up SATA link when + the optical drive tray is ejected) 0x4003 Undocked (see 0x2x04), can sleep again 0x500B Tablet pen inserted into its storage bay 0x500C Tablet pen removed from its storage bay - -The above events are propagated by the driver. +0x6011 ALARM: battery is too hot +0x6012 ALARM: battery is extremely hot +0x6021 ALARM: a sensor is too hot +0x6022 ALARM: a sensor is extremely hot +0x6030 System thermal table changed + +Battery nearly empty alarms are a last resort attempt to get the +operating system to hibernate or shutdown cleanly (0x2313), or shutdown +cleanly (0x2413) before power is lost. They must be acted upon, as the +wake up caused by the firmware will have negated most safety nets... + +When any of the "too hot" alarms happen, according to Lenovo the user +should suspend or hibernate the laptop (and in the case of battery +alarms, unplug the AC adapter) to let it cool down. These alarms do +signal that something is wrong, they should never happen on normal +operating conditions. + +The "extremely hot" alarms are emergencies. According to Lenovo, the +operating system is to force either an immediate suspend or hibernate +cycle, or a system shutdown. Obviously, something is very wrong if this +happens. Compatibility notes: -- cgit v1.2.2 From 0f2d8f4dd0663defff8c1738d33478c1fb65a4f5 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 25 Mar 2010 12:16:48 +0200 Subject: KVM: Document KVM_SET_USER_MEMORY_REGION Acked-by: Pekka Enberg Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index d170cb43554..9d6e64753d2 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -749,6 +749,51 @@ Writes debug registers into the vcpu. See KVM_GET_DEBUGREGS for the data structure. The flags field is unused yet and must be cleared on entry. +4.34 KVM_SET_USER_MEMORY_REGION + +Capability: KVM_CAP_USER_MEM +Architectures: all +Type: vm ioctl +Parameters: struct kvm_userspace_memory_region (in) +Returns: 0 on success, -1 on error + +struct kvm_userspace_memory_region { + __u32 slot; + __u32 flags; + __u64 guest_phys_addr; + __u64 memory_size; /* bytes */ + __u64 userspace_addr; /* start of the userspace allocated memory */ +}; + +/* for kvm_memory_region::flags */ +#define KVM_MEM_LOG_DIRTY_PAGES 1UL + +This ioctl allows the user to create or modify a guest physical memory +slot. When changing an existing slot, it may be moved in the guest +physical memory space, or its flags may be modified. It may not be +resized. Slots may not overlap in guest physical address space. + +Memory for the region is taken starting at the address denoted by the +field userspace_addr, which must point at user addressable memory for +the entire memory slot size. Any object may back this memory, including +anonymous memory, ordinary files, and hugetlbfs. + +It is recommended that the lower 21 bits of guest_phys_addr and userspace_addr +be identical. This allows large pages in the guest to be backed by large +pages in the host. + +The flags field supports just one flag, KVM_MEM_LOG_DIRTY_PAGES, which +instructs kvm to keep track of writes to memory within the slot. See +the KVM_GET_DIRTY_LOG ioctl. + +When the KVM_CAP_SYNC_MMU capability, changes in the backing of the memory +region are automatically reflected into the guest. For example, an mmap() +that affects the region will be made visible immediately. Another example +is madvise(MADV_DROP). + +It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl. +The KVM_SET_MEMORY_REGION does not allow fine grained control over memory +allocation and is deprecated. 5. The kvm_run structure -- cgit v1.2.2 From 8a5416db832895b84b85ad0bcbb11d1cce0d3d37 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 25 Mar 2010 12:27:30 +0200 Subject: KVM: Document KVM_SET_TSS_ADDR Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 9d6e64753d2..2cc0120ccdb 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -795,6 +795,24 @@ It is recommended to use this API instead of the KVM_SET_MEMORY_REGION ioctl. The KVM_SET_MEMORY_REGION does not allow fine grained control over memory allocation and is deprecated. +4.35 KVM_SET_TSS_ADDR + +Capability: KVM_CAP_SET_TSS_ADDR +Architectures: x86 +Type: vm ioctl +Parameters: unsigned long tss_address (in) +Returns: 0 on success, -1 on error + +This ioctl defines the physical address of a three-page region in the guest +physical address space. The region must be within the first 4GB of the +guest physical address space and must not conflict with any memory slot +or any mmio address. The guest may malfunction if it accesses this memory +region. + +This ioctl is required on Intel-based hosts. This is needed on Intel hardware +because of a quirk in the virtualization implementation (see the internals +documentation when it pops into existence). + 5. The kvm_run structure Application code obtains a pointer to the kvm_run structure by -- cgit v1.2.2 From 71fbfd5f38f73515f1516a68fbe04dba198b70f0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 24 Mar 2010 21:48:29 +0100 Subject: KVM: Add support for enabling capabilities per-vcpu Some times we don't want all capabilities to be available to all our vcpus. One example for that is the OSI interface, implemented in the next patch. In order to have a generic mechanism in how to enable capabilities individually, this patch introduces a new ioctl that can be used for this purpose. That way features we don't want in all guests or userspace configurations can just not be enabled and we're good. Signed-off-by: Alexander Graf Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 2cc0120ccdb..f9724dc8d07 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -813,6 +813,41 @@ This ioctl is required on Intel-based hosts. This is needed on Intel hardware because of a quirk in the virtualization implementation (see the internals documentation when it pops into existence). +4.36 KVM_ENABLE_CAP + +Capability: KVM_CAP_ENABLE_CAP +Architectures: ppc +Type: vcpu ioctl +Parameters: struct kvm_enable_cap (in) +Returns: 0 on success; -1 on error + ++Not all extensions are enabled by default. Using this ioctl the application +can enable an extension, making it available to the guest. + +On systems that do not support this ioctl, it always fails. On systems that +do support it, it only works for extensions that are supported for enablement. + +To check if a capability can be enabled, the KVM_CHECK_EXTENSION ioctl should +be used. + +struct kvm_enable_cap { + /* in */ + __u32 cap; + +The capability that is supposed to get enabled. + + __u32 flags; + +A bitfield indicating future enhancements. Has to be 0 for now. + + __u64 args[4]; + +Arguments for enabling a feature. If a feature needs initial values to +function properly, this is the place to put them. + + __u8 pad[64]; +}; + 5. The kvm_run structure Application code obtains a pointer to the kvm_run structure by -- cgit v1.2.2 From ad0a048b096ac819f28667602285453468a8d8f9 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 24 Mar 2010 21:48:30 +0100 Subject: KVM: PPC: Add OSI hypercall interface MOL uses its own hypercall interface to call back into userspace when the guest wants to do something. So let's implement that as an exit reason, specify it with a CAP and only really use it when userspace wants us to. The only user of it so far is MOL. Signed-off-by: Alexander Graf Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index f9724dc8d07..6f362356e73 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -958,9 +958,9 @@ executed a memory-mapped I/O instruction which could not be satisfied by kvm. The 'data' member contains the written data if 'is_write' is true, and should be filled by application code otherwise. -NOTE: For KVM_EXIT_IO and KVM_EXIT_MMIO, the corresponding operations -are complete (and guest state is consistent) only after userspace has -re-entered the kernel with KVM_RUN. The kernel side will first finish +NOTE: For KVM_EXIT_IO, KVM_EXIT_MMIO and KVM_EXIT_OSI, the corresponding +operations are complete (and guest state is consistent) only after userspace +has re-entered the kernel with KVM_RUN. The kernel side will first finish incomplete operations and then check for pending signals. Userspace can re-enter the guest with an unmasked signal pending to complete pending operations. @@ -1015,6 +1015,19 @@ s390 specific. powerpc specific. + /* KVM_EXIT_OSI */ + struct { + __u64 gprs[32]; + } osi; + +MOL uses a special hypercall interface it calls 'OSI'. To enable it, we catch +hypercalls and exit with this exit struct that contains all the guest gprs. + +If exit_reason is KVM_EXIT_OSI, then the vcpu has triggered such a hypercall. +Userspace can now handle the hypercall and when it's done modify the gprs as +necessary. Upon guest entry all guest GPRs will then be replaced by the values +in this struct. + /* Fix the size of the union. */ char padding[256]; }; -- cgit v1.2.2 From 647dc49eebad2c30f823cae2bd8204b66c739f9c Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 1 Apr 2010 14:39:21 +0300 Subject: KVM: Document replacements for KVM_EXIT_HYPERCALL Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 6f362356e73..baa8fde8bd1 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -974,7 +974,9 @@ pending operations. __u32 pad; } hypercall; -Unused. +Unused. This was once used for 'hypercall to userspace'. To implement +such functionality, use KVM_EXIT_IO (x86) or KVM_EXIT_MMIO (all except s390). +Note KVM_EXIT_IO is significantly faster than KVM_EXIT_MMIO. /* KVM_EXIT_TPR_ACCESS */ struct { -- cgit v1.2.2 From 039091875ce4629d83db64c055528e7b86337d50 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 21 Apr 2010 16:08:20 +0300 Subject: KVM: Document mmu Signed-off-by: Avi Kivity --- Documentation/kvm/mmu.txt | 302 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 Documentation/kvm/mmu.txt (limited to 'Documentation') diff --git a/Documentation/kvm/mmu.txt b/Documentation/kvm/mmu.txt new file mode 100644 index 00000000000..da046711362 --- /dev/null +++ b/Documentation/kvm/mmu.txt @@ -0,0 +1,302 @@ +The x86 kvm shadow mmu +====================== + +The mmu (in arch/x86/kvm, files mmu.[ch] and paging_tmpl.h) is responsible +for presenting a standard x86 mmu to the guest, while translating guest +physical addresses to host physical addresses. + +The mmu code attempts to satisfy the following requirements: + +- correctness: the guest should not be able to determine that it is running + on an emulated mmu except for timing (we attempt to comply + with the specification, not emulate the characteristics of + a particular implementation such as tlb size) +- security: the guest must not be able to touch host memory not assigned + to it +- performance: minimize the performance penalty imposed by the mmu +- scaling: need to scale to large memory and large vcpu guests +- hardware: support the full range of x86 virtualization hardware +- integration: Linux memory management code must be in control of guest memory + so that swapping, page migration, page merging, transparent + hugepages, and similar features work without change +- dirty tracking: report writes to guest memory to enable live migration + and framebuffer-based displays +- footprint: keep the amount of pinned kernel memory low (most memory + should be shrinkable) +- reliablity: avoid multipage or GFP_ATOMIC allocations + +Acronyms +======== + +pfn host page frame number +hpa host physical address +hva host virtual address +gfn guest frame number +gpa guest physical address +gva guest virtual address +ngpa nested guest physical address +ngva nested guest virtual address +pte page table entry (used also to refer generically to paging structure + entries) +gpte guest pte (referring to gfns) +spte shadow pte (referring to pfns) +tdp two dimensional paging (vendor neutral term for NPT and EPT) + +Virtual and real hardware supported +=================================== + +The mmu supports first-generation mmu hardware, which allows an atomic switch +of the current paging mode and cr3 during guest entry, as well as +two-dimensional paging (AMD's NPT and Intel's EPT). The emulated hardware +it exposes is the traditional 2/3/4 level x86 mmu, with support for global +pages, pae, pse, pse36, cr0.wp, and 1GB pages. Work is in progress to support +exposing NPT capable hardware on NPT capable hosts. + +Translation +=========== + +The primary job of the mmu is to program the processor's mmu to translate +addresses for the guest. Different translations are required at different +times: + +- when guest paging is disabled, we translate guest physical addresses to + host physical addresses (gpa->hpa) +- when guest paging is enabled, we translate guest virtual addresses, to + guest physical addresses, to host physical addresses (gva->gpa->hpa) +- when the guest launches a guest of its own, we translate nested guest + virtual addresses, to nested guest physical addresses, to guest physical + addresses, to host physical addresses (ngva->ngpa->gpa->hpa) + +The primary challenge is to encode between 1 and 3 translations into hardware +that support only 1 (traditional) and 2 (tdp) translations. When the +number of required translations matches the hardware, the mmu operates in +direct mode; otherwise it operates in shadow mode (see below). + +Memory +====== + +Guest memory (gpa) is part of user address space of the process that is using +kvm. Userspace defines the translation between guest addresses and user +addresses (gpa->hva); note that two gpas may alias to the same gva, but not +vice versa. + +These gvas may be backed using any method available to the host: anonymous +memory, file backed memory, and device memory. Memory might be paged by the +host at any time. + +Events +====== + +The mmu is driven by events, some from the guest, some from the host. + +Guest generated events: +- writes to control registers (especially cr3) +- invlpg/invlpga instruction execution +- access to missing or protected translations + +Host generated events: +- changes in the gpa->hpa translation (either through gpa->hva changes or + through hva->hpa changes) +- memory pressure (the shrinker) + +Shadow pages +============ + +The principal data structure is the shadow page, 'struct kvm_mmu_page'. A +shadow page contains 512 sptes, which can be either leaf or nonleaf sptes. A +shadow page may contain a mix of leaf and nonleaf sptes. + +A nonleaf spte allows the hardware mmu to reach the leaf pages and +is not related to a translation directly. It points to other shadow pages. + +A leaf spte corresponds to either one or two translations encoded into +one paging structure entry. These are always the lowest level of the +translation stack, with an optional higher level translations left to NPT/EPT. +Leaf ptes point at guest pages. + +The following table shows translations encoded by leaf ptes, with higher-level +translations in parentheses: + + Non-nested guests: + nonpaging: gpa->hpa + paging: gva->gpa->hpa + paging, tdp: (gva->)gpa->hpa + Nested guests: + non-tdp: ngva->gpa->hpa (*) + tdp: (ngva->)ngpa->gpa->hpa + +(*) the guest hypervisor will encode the ngva->gpa translation into its page + tables if npt is not present + +Shadow pages contain the following information: + role.level: + The level in the shadow paging hierarchy that this shadow page belongs to. + 1=4k sptes, 2=2M sptes, 3=1G sptes, etc. + role.direct: + If set, leaf sptes reachable from this page are for a linear range. + Examples include real mode translation, large guest pages backed by small + host pages, and gpa->hpa translations when NPT or EPT is active. + The linear range starts at (gfn << PAGE_SHIFT) and its size is determined + by role.level (2MB for first level, 1GB for second level, 0.5TB for third + level, 256TB for fourth level) + If clear, this page corresponds to a guest page table denoted by the gfn + field. + role.quadrant: + When role.cr4_pae=0, the guest uses 32-bit gptes while the host uses 64-bit + sptes. That means a guest page table contains more ptes than the host, + so multiple shadow pages are needed to shadow one guest page. + For first-level shadow pages, role.quadrant can be 0 or 1 and denotes the + first or second 512-gpte block in the guest page table. For second-level + page tables, each 32-bit gpte is converted to two 64-bit sptes + (since each first-level guest page is shadowed by two first-level + shadow pages) so role.quadrant takes values in the range 0..3. Each + quadrant maps 1GB virtual address space. + role.access: + Inherited guest access permissions in the form uwx. Note execute + permission is positive, not negative. + role.invalid: + The page is invalid and should not be used. It is a root page that is + currently pinned (by a cpu hardware register pointing to it); once it is + unpinned it will be destroyed. + role.cr4_pae: + Contains the value of cr4.pae for which the page is valid (e.g. whether + 32-bit or 64-bit gptes are in use). + role.cr4_nxe: + Contains the value of efer.nxe for which the page is valid. + gfn: + Either the guest page table containing the translations shadowed by this + page, or the base page frame for linear translations. See role.direct. + spt: + A pageful of 64-bit sptes containig the translations for this page. + Accessed by both kvm and hardware. + The page pointed to by spt will have its page->private pointing back + at the shadow page structure. + sptes in spt point either at guest pages, or at lower-level shadow pages. + Specifically, if sp1 and sp2 are shadow pages, then sp1->spt[n] may point + at __pa(sp2->spt). sp2 will point back at sp1 through parent_pte. + The spt array forms a DAG structure with the shadow page as a node, and + guest pages as leaves. + gfns: + An array of 512 guest frame numbers, one for each present pte. Used to + perform a reverse map from a pte to a gfn. + slot_bitmap: + A bitmap containing one bit per memory slot. If the page contains a pte + mapping a page from memory slot n, then bit n of slot_bitmap will be set + (if a page is aliased among several slots, then it is not guaranteed that + all slots will be marked). + Used during dirty logging to avoid scanning a shadow page if none if its + pages need tracking. + root_count: + A counter keeping track of how many hardware registers (guest cr3 or + pdptrs) are now pointing at the page. While this counter is nonzero, the + page cannot be destroyed. See role.invalid. + multimapped: + Whether there exist multiple sptes pointing at this page. + parent_pte/parent_ptes: + If multimapped is zero, parent_pte points at the single spte that points at + this page's spt. Otherwise, parent_ptes points at a data structure + with a list of parent_ptes. + unsync: + If true, then the translations in this page may not match the guest's + translation. This is equivalent to the state of the tlb when a pte is + changed but before the tlb entry is flushed. Accordingly, unsync ptes + are synchronized when the guest executes invlpg or flushes its tlb by + other means. Valid for leaf pages. + unsync_children: + How many sptes in the page point at pages that are unsync (or have + unsynchronized children). + unsync_child_bitmap: + A bitmap indicating which sptes in spt point (directly or indirectly) at + pages that may be unsynchronized. Used to quickly locate all unsychronized + pages reachable from a given page. + +Reverse map +=========== + +The mmu maintains a reverse mapping whereby all ptes mapping a page can be +reached given its gfn. This is used, for example, when swapping out a page. + +Synchronized and unsynchronized pages +===================================== + +The guest uses two events to synchronize its tlb and page tables: tlb flushes +and page invalidations (invlpg). + +A tlb flush means that we need to synchronize all sptes reachable from the +guest's cr3. This is expensive, so we keep all guest page tables write +protected, and synchronize sptes to gptes when a gpte is written. + +A special case is when a guest page table is reachable from the current +guest cr3. In this case, the guest is obliged to issue an invlpg instruction +before using the translation. We take advantage of that by removing write +protection from the guest page, and allowing the guest to modify it freely. +We synchronize modified gptes when the guest invokes invlpg. This reduces +the amount of emulation we have to do when the guest modifies multiple gptes, +or when the a guest page is no longer used as a page table and is used for +random guest data. + +As a side effect we have resynchronize all reachable unsynchronized shadow +pages on a tlb flush. + + +Reaction to events +================== + +- guest page fault (or npt page fault, or ept violation) + +This is the most complicated event. The cause of a page fault can be: + + - a true guest fault (the guest translation won't allow the access) (*) + - access to a missing translation + - access to a protected translation + - when logging dirty pages, memory is write protected + - synchronized shadow pages are write protected (*) + - access to untranslatable memory (mmio) + + (*) not applicable in direct mode + +Handling a page fault is performed as follows: + + - if needed, walk the guest page tables to determine the guest translation + (gva->gpa or ngpa->gpa) + - if permissions are insufficient, reflect the fault back to the guest + - determine the host page + - if this is an mmio request, there is no host page; call the emulator + to emulate the instruction instead + - walk the shadow page table to find the spte for the translation, + instantiating missing intermediate page tables as necessary + - try to unsynchronize the page + - if successful, we can let the guest continue and modify the gpte + - emulate the instruction + - if failed, unshadow the page and let the guest continue + - update any translations that were modified by the instruction + +invlpg handling: + + - walk the shadow page hierarchy and drop affected translations + - try to reinstantiate the indicated translation in the hope that the + guest will use it in the near future + +Guest control register updates: + +- mov to cr3 + - look up new shadow roots + - synchronize newly reachable shadow pages + +- mov to cr0/cr4/efer + - set up mmu context for new paging mode + - look up new shadow roots + - synchronize newly reachable shadow pages + +Host translation updates: + + - mmu notifier called with updated hva + - look up affected sptes through reverse map + - drop (or update) translations + +Further reading +=============== + +- NPT presentation from KVM Forum 2008 + http://www.linux-kvm.org/wiki/images/c/c8/KvmForum2008%24kdf2008_21.pdf + -- cgit v1.2.2 From b843f065481488fd1d1f4ff2179aaf4f300a1358 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 25 Apr 2010 15:51:46 +0300 Subject: KVM: Document KVM_GET_MP_STATE and KVM_SET_MP_STATE Acked-by: Pekka Enberg Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- Documentation/kvm/api.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index baa8fde8bd1..a237518e51b 100644 --- a/Documentation/kvm/api.txt +++ b/Documentation/kvm/api.txt @@ -848,6 +848,50 @@ function properly, this is the place to put them. __u8 pad[64]; }; +4.37 KVM_GET_MP_STATE + +Capability: KVM_CAP_MP_STATE +Architectures: x86, ia64 +Type: vcpu ioctl +Parameters: struct kvm_mp_state (out) +Returns: 0 on success; -1 on error + +struct kvm_mp_state { + __u32 mp_state; +}; + +Returns the vcpu's current "multiprocessing state" (though also valid on +uniprocessor guests). + +Possible values are: + + - KVM_MP_STATE_RUNNABLE: the vcpu is currently running + - KVM_MP_STATE_UNINITIALIZED: the vcpu is an application processor (AP) + which has not yet received an INIT signal + - KVM_MP_STATE_INIT_RECEIVED: the vcpu has received an INIT signal, and is + now ready for a SIPI + - KVM_MP_STATE_HALTED: the vcpu has executed a HLT instruction and + is waiting for an interrupt + - KVM_MP_STATE_SIPI_RECEIVED: the vcpu has just received a SIPI (vector + accesible via KVM_GET_VCPU_EVENTS) + +This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel +irqchip, the multiprocessing state must be maintained by userspace. + +4.38 KVM_SET_MP_STATE + +Capability: KVM_CAP_MP_STATE +Architectures: x86, ia64 +Type: vcpu ioctl +Parameters: struct kvm_mp_state (in) +Returns: 0 on success; -1 on error + +Sets the vcpu's current "multiprocessing state"; see KVM_GET_MP_STATE for +arguments. + +This ioctl is only useful after KVM_CREATE_IRQCHIP. Without an in-kernel +irqchip, the multiprocessing state must be maintained by userspace. + 5. The kvm_run structure Application code obtains a pointer to the kvm_run structure by -- cgit v1.2.2 From c4bd09b28907ca17cdb307c32bbcc9882c280feb Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 26 Apr 2010 11:59:21 +0300 Subject: KVM: Minor MMU documentation edits Reported by Andrew Jones. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- Documentation/kvm/mmu.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Documentation') diff --git a/Documentation/kvm/mmu.txt b/Documentation/kvm/mmu.txt index da046711362..0cc28fb84f4 100644 --- a/Documentation/kvm/mmu.txt +++ b/Documentation/kvm/mmu.txt @@ -75,8 +75,8 @@ direct mode; otherwise it operates in shadow mode (see below). Memory ====== -Guest memory (gpa) is part of user address space of the process that is using -kvm. Userspace defines the translation between guest addresses and user +Guest memory (gpa) is part of the user address space of the process that is +using kvm. Userspace defines the translation between guest addresses and user addresses (gpa->hva); note that two gpas may alias to the same gva, but not vice versa. @@ -111,7 +111,7 @@ is not related to a translation directly. It points to other shadow pages. A leaf spte corresponds to either one or two translations encoded into one paging structure entry. These are always the lowest level of the -translation stack, with an optional higher level translations left to NPT/EPT. +translation stack, with optional higher level translations left to NPT/EPT. Leaf ptes point at guest pages. The following table shows translations encoded by leaf ptes, with higher-level @@ -167,7 +167,7 @@ Shadow pages contain the following information: Either the guest page table containing the translations shadowed by this page, or the base page frame for linear translations. See role.direct. spt: - A pageful of 64-bit sptes containig the translations for this page. + A pageful of 64-bit sptes containing the translations for this page. Accessed by both kvm and hardware. The page pointed to by spt will have its page->private pointing back at the shadow page structure. @@ -235,7 +235,7 @@ the amount of emulation we have to do when the guest modifies multiple gptes, or when the a guest page is no longer used as a page table and is used for random guest data. -As a side effect we have resynchronize all reachable unsynchronized shadow +As a side effect we have to resynchronize all reachable unsynchronized shadow pages on a tlb flush. -- cgit v1.2.2 From 345e5c8a1cc30ebd527bcc122d9540538942f1ba Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 7 Jan 2010 17:57:46 +0100 Subject: powerpc: Add interrupt support to mpc8xxx_gpio Signed-off-by: Peter Korsgaard Acked-by: Anton Vorontsov Signed-off-by: Kumar Gala --- .../powerpc/dts-bindings/fsl/8xxx_gpio.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt b/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt index d015dcec401..b0019eb5330 100644 --- a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt +++ b/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt @@ -11,7 +11,7 @@ Required properties: 83xx, "fsl,mpc8572-gpio" for 85xx and "fsl,mpc8610-gpio" for 86xx. - #gpio-cells : Should be two. The first cell is the pin number and the second cell is used to specify optional parameters (currently unused). - - interrupts : Interrupt mapping for GPIO IRQ (currently unused). + - interrupts : Interrupt mapping for GPIO IRQ. - interrupt-parent : Phandle for the interrupt controller that services interrupts for this device. - gpio-controller : Marks the port as GPIO controller. @@ -38,3 +38,23 @@ Example of gpio-controller nodes for a MPC8347 SoC: See booting-without-of.txt for details of how to specify GPIO information for devices. + +To use GPIO pins as interrupt sources for peripherals, specify the +GPIO controller as the interrupt parent and define GPIO number + +trigger mode using the interrupts property, which is defined like +this: + +interrupts = , where: + - number: GPIO pin (0..31) + - trigger: trigger mode: + 2 = trigger on falling edge + 3 = trigger on both edges + +Example of device using this is: + + funkyfpga@0 { + compatible = "funky-fpga"; + ... + interrupts = <4 3>; + interrupt-parent = <&gpio1>; + }; -- cgit v1.2.2 From 8f27fd9605a28225bb71f2b3ade5d248231cd824 Mon Sep 17 00:00:00 2001 From: Vladimir Ermakov Date: Wed, 10 Mar 2010 12:44:57 -0300 Subject: V4L/DVB: saa7134: add capture boards Hawell HW-404M7 and HW-808M7 Adds new capture boards Hawell HW-404M7 and HW-808M7. Those cards have 4 or 8 SAA7130 chips and for the work it only needs initialize registers. The value of those registers were dumped under Windows using flytest. But board haven't EEPROM. For the first chip: SAA7130 (0x7130, SubVenID:1131, SubDevID:0000, Rev: 01) I2C slave devices found: No devices GPIO pins: Mode : 0x00389C00 Value: 0x00016C00 Video input: 3 Audio input: Analog Line1 For other chips: SAA7130 (0x7130, SubVenID:1131, SubDevID:0000, Rev: 01) I2C slave devices found: No devices GPIO pins: Mode : 0x00389200 Value: 0x00010000 Video input: 3 Audio input: Analog Line1 Signed-off-by: Vladimir Ermakov Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.saa7134 | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index b4a767060ed..3de042a9c4f 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 @@ -175,3 +175,4 @@ 174 -> Asus Europa Hybrid OEM [1043:4847] 175 -> Leadtek Winfast DTV1000S [107d:6655] 176 -> Beholder BeholdTV 505 RDS [0000:5051] +177 -> Hawell HW-404M7 / HW-808M7 -- cgit v1.2.2 From 9583183acbd40fc6e972ac39ae0a2173976f288e Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 13 Mar 2010 19:03:21 -0300 Subject: V4L/DVB: v4l doc: fix font of field name The field 'reserved' was not tagged as a 'structfield' as it should. This made the text a bit confusing. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/vidioc-reqbufs.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/v4l/vidioc-reqbufs.xml index 1c081637207..69800ae2334 100644 --- a/Documentation/DocBook/v4l/vidioc-reqbufs.xml +++ b/Documentation/DocBook/v4l/vidioc-reqbufs.xml @@ -61,7 +61,7 @@ fields of the v4l2_requestbuffers structure. They set the type field to the respective stream or buffer type, the count field to the desired number of buffers, memory -must be set to the requested I/O method and the reserved array +must be set to the requested I/O method and the reserved array must be zeroed. When the ioctl is called with a pointer to this structure the driver will attempt to allocate the requested number of buffers and it stores the actual number -- cgit v1.2.2 From ad98c0f674796848c6fd8fe614ef83ef971ebfcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Moine?= Date: Thu, 18 Mar 2010 05:15:30 -0300 Subject: V4L/DVB: gspca - sonixj: Add webcam 0c45:6142 with sensors gc0307 and po2030n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/gspca.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 181b9e6fd98..9475e1e1441 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt @@ -305,6 +305,7 @@ sonixj 0c45:6138 Sn9c120 Mo4000 sonixj 0c45:613a Microdia Sonix PC Camera sonixj 0c45:613b Surfer SN-206 sonixj 0c45:613c Sonix Pccam168 +sonixj 0c45:6142 Hama PC-Webcam AC-150 sonixj 0c45:6143 Sonix Pccam168 sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia sonixj 0c45:614a Frontech E-Ccam (JIL-2225) -- cgit v1.2.2 From e99ac54da6d3e44e6152aaab693fa311279dec7c Mon Sep 17 00:00:00 2001 From: Brian Johnson Date: Tue, 16 Mar 2010 13:58:28 -0300 Subject: V4L/DVB: gspca - sn9c20x: Add support for cameras using the MT9M112 sensor Adds the following models: - 0c45:624c - 0c45:628c - 0458:704a - 0458:704c Signed-off-by: Brian Johnson Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/gspca.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 9475e1e1441..8f3f5d33327 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt @@ -50,6 +50,8 @@ zc3xx 0458:700f Genius VideoCam Web V2 sonixj 0458:7025 Genius Eye 311Q sn9c20x 0458:7029 Genius Look 320s sonixj 0458:702e Genius Slim 310 NB +sn9c20x 0458:704a Genius Slim 1320 +sn9c20x 0458:704c Genius i-Look 1321 sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650) sonixj 045e:00f5 MicroSoft VX3000 sonixj 045e:00f7 MicroSoft VX1000 @@ -312,6 +314,7 @@ sonixj 0c45:614a Frontech E-Ccam (JIL-2225) sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) +sn9c20x 0c45:624c PC Camera (SN9C201 + MT9M112) sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968) sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650) sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650) @@ -324,6 +327,7 @@ sn9c20x 0c45:627f PC Camera (SN9C201 + OV9650) sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001) sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111) sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655) +sn9c20x 0c45:628c PC Camera (SN9C201 + MT9M112) sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968) sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650) sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670) -- cgit v1.2.2 From 7a01f6dbc7abb85a6ec048dd45db92ef1b91fe78 Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Thu, 11 Mar 2010 21:27:59 -0300 Subject: V4L/DVB: videodev2: introduce a common control for chroma gain Introduce a new control for modifying the chroma gain. This allows for user intervention in abnormal signal conditions cases where the decoder's chroma AGC cannot compensate and the value needs to be adjusted manually. This work was sponsored by EyeMagnet Limited. Signed-off-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/controls.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index f4645061041..e1bdbb6eff8 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml @@ -266,6 +266,12 @@ minimum value disables backlight compensation. boolean Chroma automatic gain control. + + V4L2_CID_CHROMA_GAIN + integer + Adjusts the Chroma gain control (for use when chroma AGC + is disabled). + V4L2_CID_COLOR_KILLER boolean -- cgit v1.2.2 From 449adf94ada543026a0fc4d0139faf60304b899f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 22 Mar 2010 14:37:52 -0300 Subject: V4L/DVB: Fix cx88 and em28xx cardlists There are some missing entries there Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.cx88 | 1 + Documentation/video4linux/CARDLIST.em28xx | 1 + 2 files changed, 2 insertions(+) (limited to 'Documentation') diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 7ec3c4e4b60..f2510541373 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 @@ -82,3 +82,4 @@ 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] 82 -> WinFast DTV2000 H rev. J [107d:6f2b] 83 -> Prof 7301 DVB-S/S2 [b034:3034] + 84 -> Samsung SMT 7020 DVB-S [18ac:dc00,18ac:dccd] diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 0c166ff003a..76c39081c29 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx @@ -70,3 +70,4 @@ 72 -> Gadmei UTV330+ (em2861) 73 -> Reddo DVB-C USB TV Box (em2870) 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800) + 75 -> Dikom DK300 (em2882) -- cgit v1.2.2 From 27e5842a9ad7a929f680ed151b5b1126456fb5f6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 24 Mar 2010 09:34:39 -0300 Subject: V4L/DVB: saa7134: Use the same name on CARDLIST as found at the driver Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.saa7134 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 3de042a9c4f..bb3d5faa34e 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 @@ -175,4 +175,4 @@ 174 -> Asus Europa Hybrid OEM [1043:4847] 175 -> Leadtek Winfast DTV1000S [107d:6655] 176 -> Beholder BeholdTV 505 RDS [0000:5051] -177 -> Hawell HW-404M7 / HW-808M7 +177 -> Hawell HW-404M7 -- cgit v1.2.2 From 443fed9fa42bbeacdb8d336b8a5002a262cac15c Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Fri, 19 Mar 2010 23:53:12 -0300 Subject: V4L/DVB: em28xx: add em286x/tvp5150 reference design Add support for design which has an em2863/tvp5150 and uses the standard empia USB ID. In Sander's case, it was branded as an "Eminent model EM3705" Thanks to Sander Van Ginkel for testing and help debugging the support. [mchehab@redhat.com: move it to a vague card number slot (card=29)] Signed-off-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.em28xx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index 76c39081c29..3a623aaeae5 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx @@ -1,5 +1,5 @@ 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] - 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] + 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2863,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] @@ -27,6 +27,7 @@ 26 -> Hercules Smart TV USB 2.0 (em2820/em2840) 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840) 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840) + 29 -> EM2860/TVP5150 Reference Design (em2860) 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840) 31 -> Usbgear VD204v9 (em2821) 32 -> Supercomp USB 2.0 TV (em2821) -- cgit v1.2.2 From b3e212dcbddb10b44d472a5f4c23d5aa0b5876ca Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 22 Mar 2010 04:52:21 -0300 Subject: V4L/DVB: v4l: add V4L2_PIX_FMT_Y4 and V4L2_PIX_FMT_Y6 pixelformats Old 4 and 6 bit greyscale pixel formats for the old bw-qcam webcam. This is needed to convert it to V4L2. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/pixfmt.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index 885968d6a2f..c4ad0a8e42d 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml @@ -792,6 +792,18 @@ http://www.thedirks.org/winnov/ 'YYUV' unknown + + V4L2_PIX_FMT_Y4 + 'Y04 ' + Old 4-bit greyscale format. Only the least significant 4 bits of each byte are used, +the other bits are set to 0. + + + V4L2_PIX_FMT_Y6 + 'Y06 ' + Old 6-bit greyscale format. Only the least significant 6 bits of each byte are used, +the other bits are set to 0. + -- cgit v1.2.2 From 48213fe3f981d2cbccd926d6858fa9cf8617beed Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 20 Jan 2010 12:12:57 -0300 Subject: V4L/DVB: v4l: Add V4L2_CID_IRIS_ABSOLUTE and V4L2_CID_IRIS_RELATIVE controls Those control, as their names imply, control the camera aperture settings. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/compat.xml | 11 +++++++++++ Documentation/DocBook/v4l/controls.xml | 19 +++++++++++++++++++ Documentation/DocBook/v4l/videodev2.h.xml | 3 +++ 3 files changed, 33 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml index b9dbdf9e6d2..854235b5208 100644 --- a/Documentation/DocBook/v4l/compat.xml +++ b/Documentation/DocBook/v4l/compat.xml @@ -2332,6 +2332,17 @@ more information. +
+ V4L2 in Linux 2.6.34 + + + Added +V4L2_CID_IRIS_ABSOLUTE and +V4L2_CID_IRIS_RELATIVE controls to the + Camera controls class. + + +
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index e1bdbb6eff8..7e0c6874713 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml @@ -1830,6 +1830,25 @@ wide-angle direction. The zoom speed unit is driver-specific. + + V4L2_CID_IRIS_ABSOLUTE  + integer + This control sets the +camera's aperture to the specified value. The unit is undefined. +Larger values open the iris wider, smaller values close it. + + + + + V4L2_CID_IRIS_RELATIVE  + integer + This control modifies the +camera's aperture by the specified amount. The unit is undefined. +Positive values open the iris one step further, negative values close +it one step further. This is a write-only control. + + + V4L2_CID_PRIVACY  boolean diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 06832594065..c18dfebedef 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml @@ -1271,6 +1271,9 @@ enum v4l2_exposure_auto_type { #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) +#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17) +#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18) + /* FM Modulator class control IDs */ #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) -- cgit v1.2.2 From b79995700e25dd6b0b0aff7edd0c102d1b6281f7 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 18 May 2010 00:23:24 +0200 Subject: PM/PCI: Update PCI power management documentation I power management document, Documentation/power/pci.txt, is outdated and partially inaccurate. It also is missing some important information about the power management of PCI device. Rewrite it to make it more up to date and more complete. Reviewed-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki --- Documentation/power/pci.txt | 1258 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 992 insertions(+), 266 deletions(-) (limited to 'Documentation') diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index dd8fe43888d..62328d76b55 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt @@ -1,299 +1,1025 @@ - PCI Power Management -~~~~~~~~~~~~~~~~~~~~ -An overview of the concepts and the related functions in the Linux kernel +Copyright (c) 2010 Rafael J. Wysocki , Novell Inc. + +An overview of concepts and the Linux kernel's interfaces related to PCI power +management. Based on previous work by Patrick Mochel +(and others). -Patrick Mochel -(and others) +This document only covers the aspects of power management specific to PCI +devices. For general description of the kernel's interfaces related to device +power management refer to Documentation/power/devices.txt and +Documentation/power/runtime_pm.txt. --------------------------------------------------------------------------- -1. Overview -2. How the PCI Subsystem Does Power Management -3. PCI Utility Functions -4. PCI Device Drivers -5. Resources - -1. Overview -~~~~~~~~~~~ - -The PCI Power Management Specification was introduced between the PCI 2.1 and -PCI 2.2 Specifications. It a standard interface for controlling various -power management operations. - -Implementation of the PCI PM Spec is optional, as are several sub-components of -it. If a device supports the PCI PM Spec, the device will have an 8 byte -capability field in its PCI configuration space. This field is used to describe -and control the standard PCI power management features. - -The PCI PM spec defines 4 operating states for devices (D0 - D3) and for buses -(B0 - B3). The higher the number, the less power the device consumes. However, -the higher the number, the longer the latency is for the device to return to -an operational state (D0). - -There are actually two D3 states. When someone talks about D3, they usually -mean D3hot, which corresponds to an ACPI D2 state (power is reduced, the -device may lose some context). But they may also mean D3cold, which is an -ACPI D3 state (power is fully off, all state was discarded); or both. - -Bus power management is not covered in this version of this document. - -Note that all PCI devices support D0 and D3cold by default, regardless of -whether or not they implement any of the PCI PM spec. - -The possible state transitions that a device can undergo are: - -+---------------------------+ -| Current State | New State | -+---------------------------+ -| D0 | D1, D2, D3| -+---------------------------+ -| D1 | D2, D3 | -+---------------------------+ -| D2 | D3 | -+---------------------------+ -| D1, D2, D3 | D0 | -+---------------------------+ - -Note that when the system is entering a global suspend state, all devices will -be placed into D3 and when resuming, all devices will be placed into D0. -However, when the system is running, other state transitions are possible. - -2. How The PCI Subsystem Handles Power Management -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The PCI suspend/resume functionality is accessed indirectly via the Power -Management subsystem. At boot, the PCI driver registers a power management -callback with that layer. Upon entering a suspend state, the PM layer iterates -through all of its registered callbacks. This currently takes place only during -APM state transitions. - -Upon going to sleep, the PCI subsystem walks its device tree twice. Both times, -it does a depth first walk of the device tree. The first walk saves each of the -device's state and checks for devices that will prevent the system from entering -a global power state. The next walk then places the devices in a low power +1. Hardware and Platform Support for PCI Power Management +2. PCI Subsystem and Device Power Management +3. PCI Device Drivers and Power Management +4. Resources + + +1. Hardware and Platform Support for PCI Power Management +========================================================= + +1.1. Native and Platform-Based Power Management +----------------------------------------------- +In general, power management is a feature allowing one to save energy by putting +devices into states in which they draw less power (low-power states) at the +price of reduced functionality or performance. + +Usually, a device is put into a low-power state when it is underutilized or +completely inactive. However, when it is necessary to use the device once +again, it has to be put back into the "fully functional" state (full-power +state). This may happen when there are some data for the device to handle or +as a result of an external event requiring the device to be active, which may +be signaled by the device itself. + +PCI devices may be put into low-power states in two ways, by using the device +capabilities introduced by the PCI Bus Power Management Interface Specification, +or with the help of platform firmware, such as an ACPI BIOS. In the first +approach, that is referred to as the native PCI power management (native PCI PM) +in what follows, the device power state is changed as a result of writing a +specific value into one of its standard configuration registers. The second +approach requires the platform firmware to provide special methods that may be +used by the kernel to change the device's power state. + +Devices supporting the native PCI PM usually can generate wakeup signals called +Power Management Events (PMEs) to let the kernel know about external events +requiring the device to be active. After receiving a PME the kernel is supposed +to put the device that sent it into the full-power state. However, the PCI Bus +Power Management Interface Specification doesn't define any standard method of +delivering the PME from the device to the CPU and the operating system kernel. +It is assumed that the platform firmware will perform this task and therefore, +even though a PCI device is set up to generate PMEs, it also may be necessary to +prepare the platform firmware for notifying the CPU of the PMEs coming from the +device (e.g. by generating interrupts). + +In turn, if the methods provided by the platform firmware are used for changing +the power state of a device, usually the platform also provides a method for +preparing the device to generate wakeup signals. In that case, however, it +often also is necessary to prepare the device for generating PMEs using the +native PCI PM mechanism, because the method provided by the platform depends on +that. + +Thus in many situations both the native and the platform-based power management +mechanisms have to be used simultaneously to obtain the desired result. + +1.2. Native PCI Power Management +-------------------------------- +The PCI Bus Power Management Interface Specification (PCI PM Spec) was +introduced between the PCI 2.1 and PCI 2.2 Specifications. It defined a +standard interface for performing various operations related to power +management. + +The implementation of the PCI PM Spec is optional for conventional PCI devices, +but it is mandatory for PCI Express devices. If a device supports the PCI PM +Spec, it has an 8 byte power management capability field in its PCI +configuration space. This field is used to describe and control the standard +features related to the native PCI power management. + +The PCI PM Spec defines 4 operating states for devices (D0-D3) and for buses +(B0-B3). The higher the number, the less power is drawn by the device or bus +in that state. However, the higher the number, the longer the latency for +the device or bus to return to the full-power state (D0 or B0, respectively). + +There are two variants of the D3 state defined by the specification. The first +one is D3hot, referred to as the software accessible D3, because devices can be +programmed to go into it. The second one, D3cold, is the state that PCI devices +are in when the supply voltage (Vcc) is removed from them. It is not possible +to program a PCI device to go into D3cold, although there may be a programmable +interface for putting the bus the device is on into a state in which Vcc is +removed from all devices on the bus. + +PCI bus power management, however, is not supported by the Linux kernel at the +time of this writing and therefore it is not covered by this document. + +Note that every PCI device can be in the full-power state (D0) or in D3cold, +regardless of whether or not it implements the PCI PM Spec. In addition to +that, if the PCI PM Spec is implemented by the device, it must support D3hot +as well as D0. The support for the D1 and D2 power states is optional. + +PCI devices supporting the PCI PM Spec can be programmed to go to any of the +supported low-power states (except for D3cold). While in D1-D3hot the +standard configuration registers of the device must be accessible to software +(i.e. the device is required to respond to PCI configuration accesses), although +its I/O and memory spaces are then disabled. This allows the device to be +programmatically put into D0. Thus the kernel can switch the device back and +forth between D0 and the supported low-power states (except for D3cold) and the +possible power state transitions the device can undergo are the following: + ++----------------------------+ +| Current State | New State | ++----------------------------+ +| D0 | D1, D2, D3 | ++----------------------------+ +| D1 | D2, D3 | ++----------------------------+ +| D2 | D3 | ++----------------------------+ +| D1, D2, D3 | D0 | ++----------------------------+ + +The transition from D3cold to D0 occurs when the supply voltage is provided to +the device (i.e. power is restored). In that case the device returns to D0 with +a full power-on reset sequence and the power-on defaults are restored to the +device by hardware just as at initial power up. + +PCI devices supporting the PCI PM Spec can be programmed to generate PMEs +while in a low-power state (D1-D3), but they are not required to be capable +of generating PMEs from all supported low-power states. In particular, the +capability of generating PMEs from D3cold is optional and depends on the +presence of additional voltage (3.3Vaux) allowing the device to remain +sufficiently active to generate a wakeup signal. + +1.3. ACPI Device Power Management +--------------------------------- +The platform firmware support for the power management of PCI devices is +system-specific. However, if the system in question is compliant with the +Advanced Configuration and Power Interface (ACPI) Specification, like the +majority of x86-based systems, it is supposed to implement device power +management interfaces defined by the ACPI standard. + +For this purpose the ACPI BIOS provides special functions called "control +methods" that may be executed by the kernel to perform specific tasks, such as +putting a device into a low-power state. These control methods are encoded +using special byte-code language called the ACPI Machine Language (AML) and +stored in the machine's BIOS. The kernel loads them from the BIOS and executes +them as needed using an AML interpreter that translates the AML byte code into +computations and memory or I/O space accesses. This way, in theory, a BIOS +writer can provide the kernel with a means to perform actions depending +on the system design in a system-specific fashion. + +ACPI control methods may be divided into global control methods, that are not +associated with any particular devices, and device control methods, that have +to be defined separately for each device supposed to be handled with the help of +the platform. This means, in particular, that ACPI device control methods can +only be used to handle devices that the BIOS writer knew about in advance. The +ACPI methods used for device power management fall into that category. + +The ACPI specification assumes that devices can be in one of four power states +labeled as D0, D1, D2, and D3 that roughly correspond to the native PCI PM +D0-D3 states (although the difference between D3hot and D3cold is not taken +into account by ACPI). Moreover, for each power state of a device there is a +set of power resources that have to be enabled for the device to be put into +that state. These power resources are controlled (i.e. enabled or disabled) +with the help of their own control methods, _ON and _OFF, that have to be +defined individually for each of them. + +To put a device into the ACPI power state Dx (where x is a number between 0 and +3 inclusive) the kernel is supposed to (1) enable the power resources required +by the device in this state using their _ON control methods and (2) execute the +_PSx control method defined for the device. In addition to that, if the device +is going to be put into a low-power state (D1-D3) and is supposed to generate +wakeup signals from that state, the _DSW (or _PSW, replaced with _DSW by ACPI +3.0) control method defined for it has to be executed before _PSx. Power +resources that are not required by the device in the target power state and are +not required any more by any other device should be disabled (by executing their +_OFF control methods). If the current power state of the device is D3, it can +only be put into D0 this way. + +However, quite often the power states of devices are changed during a +system-wide transition into a sleep state or back into the working state. ACPI +defines four system sleep states, S1, S2, S3, and S4, and denotes the system +working state as S0. In general, the target system sleep (or working) state +determines the highest power (lowest number) state the device can be put +into and the kernel is supposed to obtain this information by executing the +device's _SxD control method (where x is a number between 0 and 4 inclusive). +If the device is required to wake up the system from the target sleep state, the +lowest power (highest number) state it can be put into is also determined by the +target state of the system. The kernel is then supposed to use the device's +_SxW control method to obtain the number of that state. It also is supposed to +use the device's _PRW control method to learn which power resources need to be +enabled for the device to be able to generate wakeup signals. + +1.4. Wakeup Signaling +--------------------- +Wakeup signals generated by PCI devices, either as native PCI PMEs, or as +a result of the execution of the _DSW (or _PSW) ACPI control method before +putting the device into a low-power state, have to be caught and handled as +appropriate. If they are sent while the system is in the working state +(ACPI S0), they should be translated into interrupts so that the kernel can +put the devices generating them into the full-power state and take care of the +events that triggered them. In turn, if they are sent while the system is +sleeping, they should cause the system's core logic to trigger wakeup. + +On ACPI-based systems wakeup signals sent by conventional PCI devices are +converted into ACPI General-Purpose Events (GPEs) which are hardware signals +from the system core logic generated in response to various events that need to +be acted upon. Every GPE is associated with one or more sources of potentially +interesting events. In particular, a GPE may be associated with a PCI device +capable of signaling wakeup. The information on the connections between GPEs +and event sources is recorded in the system's ACPI BIOS from where it can be +read by the kernel. + +If a PCI device known to the system's ACPI BIOS signals wakeup, the GPE +associated with it (if there is one) is triggered. The GPEs associated with PCI +bridges may also be triggered in response to a wakeup signal from one of the +devices below the bridge (this also is the case for root bridges) and, for +example, native PCI PMEs from devices unknown to the system's ACPI BIOS may be +handled this way. + +A GPE may be triggered when the system is sleeping (i.e. when it is in one of +the ACPI S1-S4 states), in which case system wakeup is started by its core logic +(the device that was the source of the signal causing the system wakeup to occur +may be identified later). The GPEs used in such situations are referred to as +wakeup GPEs. + +Usually, however, GPEs are also triggered when the system is in the working +state (ACPI S0) and in that case the system's core logic generates a System +Control Interrupt (SCI) to notify the kernel of the event. Then, the SCI +handler identifies the GPE that caused the interrupt to be generated which, +in turn, allows the kernel to identify the source of the event (that may be +a PCI device signaling wakeup). The GPEs used for notifying the kernel of +events occurring while the system is in the working state are referred to as +runtime GPEs. + +Unfortunately, there is no standard way of handling wakeup signals sent by +conventional PCI devices on systems that are not ACPI-based, but there is one +for PCI Express devices. Namely, the PCI Express Base Specification introduced +a native mechanism for converting native PCI PMEs into interrupts generated by +root ports. For conventional PCI devices native PMEs are out-of-band, so they +are routed separately and they need not pass through bridges (in principle they +may be routed directly to the system's core logic), but for PCI Express devices +they are in-band messages that have to pass through the PCI Express hierarchy, +including the root port on the path from the device to the Root Complex. Thus +it was possible to introduce a mechanism by which a root port generates an +interrupt whenever it receives a PME message from one of the devices below it. +The PCI Express Requester ID of the device that sent the PME message is then +recorded in one of the root port's configuration registers from where it may be +read by the interrupt handler allowing the device to be identified. [PME +messages sent by PCI Express endpoints integrated with the Root Complex don't +pass through root ports, but instead they cause a Root Complex Event Collector +(if there is one) to generate interrupts.] + +In principle the native PCI Express PME signaling may also be used on ACPI-based +systems along with the GPEs, but to use it the kernel has to ask the system's +ACPI BIOS to release control of root port configuration registers. The ACPI +BIOS, however, is not required to allow the kernel to control these registers +and if it doesn't do that, the kernel must not modify their contents. Of course +the native PCI Express PME signaling cannot be used by the kernel in that case. + + +2. PCI Subsystem and Device Power Management +============================================ + +2.1. Device Power Management Callbacks +-------------------------------------- +The PCI Subsystem participates in the power management of PCI devices in a +number of ways. First of all, it provides an intermediate code layer between +the device power management core (PM core) and PCI device drivers. +Specifically, the pm field of the PCI subsystem's struct bus_type object, +pci_bus_type, points to a struct dev_pm_ops object, pci_dev_pm_ops, containing +pointers to several device power management callbacks: + +const struct dev_pm_ops pci_dev_pm_ops = { + .prepare = pci_pm_prepare, + .complete = pci_pm_complete, + .suspend = pci_pm_suspend, + .resume = pci_pm_resume, + .freeze = pci_pm_freeze, + .thaw = pci_pm_thaw, + .poweroff = pci_pm_poweroff, + .restore = pci_pm_restore, + .suspend_noirq = pci_pm_suspend_noirq, + .resume_noirq = pci_pm_resume_noirq, + .freeze_noirq = pci_pm_freeze_noirq, + .thaw_noirq = pci_pm_thaw_noirq, + .poweroff_noirq = pci_pm_poweroff_noirq, + .restore_noirq = pci_pm_restore_noirq, + .runtime_suspend = pci_pm_runtime_suspend, + .runtime_resume = pci_pm_runtime_resume, + .runtime_idle = pci_pm_runtime_idle, +}; + +These callbacks are executed by the PM core in various situations related to +device power management and they, in turn, execute power management callbacks +provided by PCI device drivers. They also perform power management operations +involving some standard configuration registers of PCI devices that device +drivers need not know or care about. + +The structure representing a PCI device, struct pci_dev, contains several fields +that these callbacks operate on: + +struct pci_dev { + ... + pci_power_t current_state; /* Current operating state. */ + int pm_cap; /* PM capability offset in the + configuration space */ + unsigned int pme_support:5; /* Bitmask of states from which PME# + can be generated */ + unsigned int pme_interrupt:1;/* Is native PCIe PME signaling used? */ + unsigned int d1_support:1; /* Low power state D1 is supported */ + unsigned int d2_support:1; /* Low power state D2 is supported */ + unsigned int no_d1d2:1; /* D1 and D2 are forbidden */ + unsigned int wakeup_prepared:1; /* Device prepared for wake up */ + unsigned int d3_delay; /* D3->D0 transition time in ms */ + ... +}; + +They also indirectly use some fields of the struct device that is embedded in +struct pci_dev. + +2.2. Device Initialization +-------------------------- +The PCI subsystem's first task related to device power management is to +prepare the device for power management and initialize the fields of struct +pci_dev used for this purpose. This happens in two functions defined in +drivers/pci/pci.c, pci_pm_init() and platform_pci_wakeup_init(). + +The first of these functions checks if the device supports native PCI PM +and if that's the case the offset of its power management capability structure +in the configuration space is stored in the pm_cap field of the device's struct +pci_dev object. Next, the function checks which PCI low-power states are +supported by the device and from which low-power states the device can generate +native PCI PMEs. The power management fields of the device's struct pci_dev and +the struct device embedded in it are updated accordingly and the generation of +PMEs by the device is disabled. + +The second function checks if the device can be prepared to signal wakeup with +the help of the platform firmware, such as the ACPI BIOS. If that is the case, +the function updates the wakeup fields in struct device embedded in the +device's struct pci_dev and uses the firmware-provided method to prevent the +device from signaling wakeup. + +At this point the device is ready for power management. For driverless devices, +however, this functionality is limited to a few basic operations carried out +during system-wide transitions to a sleep state and back to the working state. + +2.3. Runtime Device Power Management +------------------------------------ +The PCI subsystem plays a vital role in the runtime power management of PCI +devices. For this purpose it uses the general runtime power management +(runtime PM) framework described in Documentation/power/runtime_pm.txt. +Namely, it provides subsystem-level callbacks: + + pci_pm_runtime_suspend() + pci_pm_runtime_resume() + pci_pm_runtime_idle() + +that are executed by the core runtime PM routines. It also implements the +entire mechanics necessary for handling runtime wakeup signals from PCI devices +in low-power states, which at the time of this writing works for both the native +PCI Express PME signaling and the ACPI GPE-based wakeup signaling described in +Section 1. + +First, a PCI device is put into a low-power state, or suspended, with the help +of pm_schedule_suspend() or pm_runtime_suspend() which for PCI devices call +pci_pm_runtime_suspend() to do the actual job. For this to work, the device's +driver has to provide a pm->runtime_suspend() callback (see below), which is +run by pci_pm_runtime_suspend() as the first action. If the driver's callback +returns successfully, the device's standard configuration registers are saved, +the device is prepared to generate wakeup signals and, finally, it is put into +the target low-power state. + +The low-power state to put the device into is the lowest-power (highest number) +state from which it can signal wakeup. The exact method of signaling wakeup is +system-dependent and is determined by the PCI subsystem on the basis of the +reported capabilities of the device and the platform firmware. To prepare the +device for signaling wakeup and put it into the selected low-power state, the +PCI subsystem can use the platform firmware as well as the device's native PCI +PM capabilities, if supported. + +It is expected that the device driver's pm->runtime_suspend() callback will +not attempt to prepare the device for signaling wakeup or to put it into a +low-power state. The driver ought to leave these tasks to the PCI subsystem +that has all of the information necessary to perform them. + +A suspended device is brought back into the "active" state, or resumed, +with the help of pm_request_resume() or pm_runtime_resume() which both call +pci_pm_runtime_resume() for PCI devices. Again, this only works if the device's +driver provides a pm->runtime_resume() callback (see below). However, before +the driver's callback is executed, pci_pm_runtime_resume() brings the device +back into the full-power state, prevents it from signaling wakeup while in that +state and restores its standard configuration registers. Thus the driver's +callback need not worry about the PCI-specific aspects of the device resume. + +Note that generally pci_pm_runtime_resume() may be called in two different +situations. First, it may be called at the request of the device's driver, for +example if there are some data for it to process. Second, it may be called +as a result of a wakeup signal from the device itself (this sometimes is +referred to as "remote wakeup"). Of course, for this purpose the wakeup signal +is handled in one of the ways described in Section 1 and finally converted into +a notification for the PCI subsystem after the source device has been +identified. + +The pci_pm_runtime_idle() function, called for PCI devices by pm_runtime_idle() +and pm_request_idle(), executes the device driver's pm->runtime_idle() +callback, if defined, and if that callback doesn't return error code (or is not +present at all), suspends the device with the help of pm_runtime_suspend(). +Sometimes pci_pm_runtime_idle() is called automatically by the PM core (for +example, it is called right after the device has just been resumed), in which +cases it is expected to suspend the device if that makes sense. Usually, +however, the PCI subsystem doesn't really know if the device really can be +suspended, so it lets the device's driver decide by running its +pm->runtime_idle() callback. + +2.4. System-Wide Power Transitions +---------------------------------- +There are a few different types of system-wide power transitions, described in +Documentation/power/devices.txt. Each of them requires devices to be handled +in a specific way and the PM core executes subsystem-level power management +callbacks for this purpose. They are executed in phases such that each phase +involves executing the same subsystem-level callback for every device belonging +to the given subsystem before the next phase begins. These phases always run +after tasks have been frozen. + +2.4.1. System Suspend + +When the system is going into a sleep state in which the contents of memory will +be preserved, such as one of the ACPI sleep states S1-S3, the phases are: + + prepare, suspend, suspend_noirq. + +The following PCI bus type's callbacks, respectively, are used in these phases: + + pci_pm_prepare() + pci_pm_suspend() + pci_pm_suspend_noirq() + +The pci_pm_prepare() routine first puts the device into the "fully functional" +state with the help of pm_runtime_resume(). Then, it executes the device +driver's pm->prepare() callback if defined (i.e. if the driver's struct +dev_pm_ops object is present and the prepare pointer in that object is valid). + +The pci_pm_suspend() routine first checks if the device's driver implements +legacy PCI suspend routines (see Section 3), in which case the driver's legacy +suspend callback is executed, if present, and its result is returned. Next, if +the device's driver doesn't provide a struct dev_pm_ops object (containing +pointers to the driver's callbacks), pci_pm_default_suspend() is called, which +simply turns off the device's bus master capability and runs +pcibios_disable_device() to disable it, unless the device is a bridge (PCI +bridges are ignored by this routine). Next, the device driver's pm->suspend() +callback is executed, if defined, and its result is returned if it fails. +Finally, pci_fixup_device() is called to apply hardware suspend quirks related +to the device if necessary. + +Note that the suspend phase is carried out asynchronously for PCI devices, so +the pci_pm_suspend() callback may be executed in parallel for any pair of PCI +devices that don't depend on each other in a known way (i.e. none of the paths +in the device tree from the root bridge to a leaf device contains both of them). + +The pci_pm_suspend_noirq() routine is executed after suspend_device_irqs() has +been called, which means that the device driver's interrupt handler won't be +invoked while this routine is running. It first checks if the device's driver +implements legacy PCI suspends routines (Section 3), in which case the legacy +late suspend routine is called and its result is returned (the standard +configuration registers of the device are saved if the driver's callback hasn't +done that). Second, if the device driver's struct dev_pm_ops object is not +present, the device's standard configuration registers are saved and the routine +returns success. Otherwise the device driver's pm->suspend_noirq() callback is +executed, if present, and its result is returned if it fails. Next, if the +device's standard configuration registers haven't been saved yet (one of the +device driver's callbacks executed before might do that), pci_pm_suspend_noirq() +saves them, prepares the device to signal wakeup (if necessary) and puts it into +a low-power state. + +The low-power state to put the device into is the lowest-power (highest number) +state from which it can signal wakeup while the system is in the target sleep +state. Just like in the runtime PM case described above, the mechanism of +signaling wakeup is system-dependent and determined by the PCI subsystem, which +is also responsible for preparing the device to signal wakeup from the system's +target sleep state as appropriate. + +PCI device drivers (that don't implement legacy power management callbacks) are +generally not expected to prepare devices for signaling wakeup or to put them +into low-power states. However, if one of the driver's suspend callbacks +(pm->suspend() or pm->suspend_noirq()) saves the device's standard configuration +registers, pci_pm_suspend_noirq() will assume that the device has been prepared +to signal wakeup and put into a low-power state by the driver (the driver is +then assumed to have used the helper functions provided by the PCI subsystem for +this purpose). PCI device drivers are not encouraged to do that, but in some +rare cases doing that in the driver may be the optimum approach. + +2.4.2. System Resume + +When the system is undergoing a transition from a sleep state in which the +contents of memory have been preserved, such as one of the ACPI sleep states +S1-S3, into the working state (ACPI S0), the phases are: + + resume_noirq, resume, complete. + +The following PCI bus type's callbacks, respectively, are executed in these +phases: + + pci_pm_resume_noirq() + pci_pm_resume() + pci_pm_complete() + +The pci_pm_resume_noirq() routine first puts the device into the full-power +state, restores its standard configuration registers and applies early resume +hardware quirks related to the device, if necessary. This is done +unconditionally, regardless of whether or not the device's driver implements +legacy PCI power management callbacks (this way all PCI devices are in the +full-power state and their standard configuration registers have been restored +when their interrupt handlers are invoked for the first time during resume, +which allows the kernel to avoid problems with the handling of shared interrupts +by drivers whose devices are still suspended). If legacy PCI power management +callbacks (see Section 3) are implemented by the device's driver, the legacy +early resume callback is executed and its result is returned. Otherwise, the +device driver's pm->resume_noirq() callback is executed, if defined, and its +result is returned. + +The pci_pm_resume() routine first checks if the device's standard configuration +registers have been restored and restores them if that's not the case (this +only is necessary in the error path during a failing suspend). Next, resume +hardware quirks related to the device are applied, if necessary, and if the +device's driver implements legacy PCI power management callbacks (see +Section 3), the driver's legacy resume callback is executed and its result is +returned. Otherwise, the device's wakeup signaling mechanisms are blocked and +its driver's pm->resume() callback is executed, if defined (the callback's +result is then returned). + +The resume phase is carried out asynchronously for PCI devices, like the +suspend phase described above, which means that if two PCI devices don't depend +on each other in a known way, the pci_pm_resume() routine may be executed for +the both of them in parallel. + +The pci_pm_complete() routine only executes the device driver's pm->complete() +callback, if defined. + +2.4.3. System Hibernation + +System hibernation is more complicated than system suspend, because it requires +a system image to be created and written into a persistent storage medium. The +image is created atomically and all devices are quiesced, or frozen, before that +happens. + +The freezing of devices is carried out after enough memory has been freed (at +the time of this writing the image creation requires at least 50% of system RAM +to be free) in the following three phases: + + prepare, freeze, freeze_noirq + +that correspond to the PCI bus type's callbacks: + + pci_pm_prepare() + pci_pm_freeze() + pci_pm_freeze_noirq() + +This means that the prepare phase is exactly the same as for system suspend. +The other two phases, however, are different. + +The pci_pm_freeze() routine is quite similar to pci_pm_suspend(), but it runs +the device driver's pm->freeze() callback, if defined, instead of pm->suspend(), +and it doesn't apply the suspend-related hardware quirks. It is executed +asynchronously for different PCI devices that don't depend on each other in a +known way. + +The pci_pm_freeze_noirq() routine, in turn, is similar to +pci_pm_suspend_noirq(), but it calls the device driver's pm->freeze_noirq() +routine instead of pm->suspend_noirq(). It also doesn't attempt to prepare the +device for signaling wakeup and put it into a low-power state. Still, it saves +the device's standard configuration registers if they haven't been saved by one +of the driver's callbacks. + +Once the image has been created, it has to be saved. However, at this point all +devices are frozen and they cannot handle I/O, while their ability to handle +I/O is obviously necessary for the image saving. Thus they have to be brought +back to the fully functional state and this is done in the following phases: + + thaw_noirq, thaw, complete + +using the following PCI bus type's callbacks: + + pci_pm_thaw_noirq() + pci_pm_thaw() + pci_pm_complete() + +respectively. + +The first of them, pci_pm_thaw_noirq(), is analogous to pci_pm_resume_noirq(), +but it doesn't put the device into the full power state and doesn't attempt to +restore its standard configuration registers. It also executes the device +driver's pm->thaw_noirq() callback, if defined, instead of pm->resume_noirq(). + +The pci_pm_thaw() routine is similar to pci_pm_resume(), but it runs the device +driver's pm->thaw() callback instead of pm->resume(). It is executed +asynchronously for different PCI devices that don't depend on each other in a +known way. + +The complete phase it the same as for system resume. + +After saving the image, devices need to be powered down before the system can +enter the target sleep state (ACPI S4 for ACPI-based systems). This is done in +three phases: + + prepare, poweroff, poweroff_noirq + +where the prepare phase is exactly the same as for system suspend. The other +two phases are analogous to the suspend and suspend_noirq phases, respectively. +The PCI subsystem-level callbacks they correspond to + + pci_pm_poweroff() + pci_pm_poweroff_noirq() + +work in analogy with pci_pm_suspend() and pci_pm_poweroff_noirq(), respectively, +although they don't attempt to save the device's standard configuration +registers. + +2.4.4. System Restore + +System restore requires a hibernation image to be loaded into memory and the +pre-hibernation memory contents to be restored before the pre-hibernation system +activity can be resumed. + +As described in Documentation/power/devices.txt, the hibernation image is loaded +into memory by a fresh instance of the kernel, called the boot kernel, which in +turn is loaded and run by a boot loader in the usual way. After the boot kernel +has loaded the image, it needs to replace its own code and data with the code +and data of the "hibernated" kernel stored within the image, called the image +kernel. For this purpose all devices are frozen just like before creating +the image during hibernation, in the + + prepare, freeze, freeze_noirq + +phases described above. However, the devices affected by these phases are only +those having drivers in the boot kernel; other devices will still be in whatever +state the boot loader left them. + +Should the restoration of the pre-hibernation memory contents fail, the boot +kernel would go through the "thawing" procedure described above, using the +thaw_noirq, thaw, and complete phases (that will only affect the devices having +drivers in the boot kernel), and then continue running normally. + +If the pre-hibernation memory contents are restored successfully, which is the +usual situation, control is passed to the image kernel, which then becomes +responsible for bringing the system back to the working state. To achieve this, +it must restore the devices' pre-hibernation functionality, which is done much +like waking up from the memory sleep state, although it involves different +phases: + + restore_noirq, restore, complete + +The first two of these are analogous to the resume_noirq and resume phases +described above, respectively, and correspond to the following PCI subsystem +callbacks: + + pci_pm_restore_noirq() + pci_pm_restore() + +These callbacks work in analogy with pci_pm_resume_noirq() and pci_pm_resume(), +respectively, but they execute the device driver's pm->restore_noirq() and +pm->restore() callbacks, if available. + +The complete phase is carried out in exactly the same way as during system +resume. + + +3. PCI Device Drivers and Power Management +========================================== + +3.1. Power Management Callbacks +------------------------------- +PCI device drivers participate in power management by providing callbacks to be +executed by the PCI subsystem's power management routines described above and by +controlling the runtime power management of their devices. + +At the time of this writing there are two ways to define power management +callbacks for a PCI device driver, the recommended one, based on using a +dev_pm_ops structure described in Documentation/power/devices.txt, and the +"legacy" one, in which the .suspend(), .suspend_late(), .resume_early(), and +.resume() callbacks from struct pci_driver are used. The legacy approach, +however, doesn't allow one to define runtime power management callbacks and is +not really suitable for any new drivers. Therefore it is not covered by this +document (refer to the source code to learn more about it). + +It is recommended that all PCI device drivers define a struct dev_pm_ops object +containing pointers to power management (PM) callbacks that will be executed by +the PCI subsystem's PM routines in various circumstances. A pointer to the +driver's struct dev_pm_ops object has to be assigned to the driver.pm field in +its struct pci_driver object. Once that has happened, the "legacy" PM callbacks +in struct pci_driver are ignored (even if they are not NULL). + +The PM callbacks in struct dev_pm_ops are not mandatory and if they are not +defined (i.e. the respective fields of struct dev_pm_ops are unset) the PCI +subsystem will handle the device in a simplified default manner. If they are +defined, though, they are expected to behave as described in the following +subsections. + +3.1.1. prepare() + +The prepare() callback is executed during system suspend, during hibernation +(when a hibernation image is about to be created), during power-off after +saving a hibernation image and during system restore, when a hibernation image +has just been loaded into memory. + +This callback is only necessary if the driver's device has children that in +general may be registered at any time. In that case the role of the prepare() +callback is to prevent new children of the device from being registered until +one of the resume_noirq(), thaw_noirq(), or restore_noirq() callbacks is run. + +In addition to that the prepare() callback may carry out some operations +preparing the device to be suspended, although it should not allocate memory +(if additional memory is required to suspend the device, it has to be +preallocated earlier, for example in a suspend/hibernate notifier as described +in Documentation/power/notifiers.txt). + +3.1.2. suspend() + +The suspend() callback is only executed during system suspend, after prepare() +callbacks have been executed for all devices in the system. + +This callback is expected to quiesce the device and prepare it to be put into a +low-power state by the PCI subsystem. It is not required (in fact it even is +not recommended) that a PCI driver's suspend() callback save the standard +configuration registers of the device, prepare it for waking up the system, or +put it into a low-power state. All of these operations can very well be taken +care of by the PCI subsystem, without the driver's participation. + +However, in some rare case it is convenient to carry out these operations in +a PCI driver. Then, pci_save_state(), pci_prepare_to_sleep(), and +pci_set_power_state() should be used to save the device's standard configuration +registers, to prepare it for system wakeup (if necessary), and to put it into a +low-power state, respectively. Moreover, if the driver calls pci_save_state(), +the PCI subsystem will not execute either pci_prepare_to_sleep(), or +pci_set_power_state() for its device, so the driver is then responsible for +handling the device as appropriate. + +While the suspend() callback is being executed, the driver's interrupt handler +can be invoked to handle an interrupt from the device, so all suspend-related +operations relying on the driver's ability to handle interrupts should be +carried out in this callback. + +3.1.3. suspend_noirq() + +The suspend_noirq() callback is only executed during system suspend, after +suspend() callbacks have been executed for all devices in the system and +after device interrupts have been disabled by the PM core. + +The difference between suspend_noirq() and suspend() is that the driver's +interrupt handler will not be invoked while suspend_noirq() is running. Thus +suspend_noirq() can carry out operations that would cause race conditions to +arise if they were performed in suspend(). + +3.1.4. freeze() + +The freeze() callback is hibernation-specific and is executed in two situations, +during hibernation, after prepare() callbacks have been executed for all devices +in preparation for the creation of a system image, and during restore, +after a system image has been loaded into memory from persistent storage and the +prepare() callbacks have been executed for all devices. + +The role of this callback is analogous to the role of the suspend() callback +described above. In fact, they only need to be different in the rare cases when +the driver takes the responsibility for putting the device into a low-power state. -The first walk allows a graceful recovery in the event of a failure, since none -of the devices have actually been powered down. - -In both walks, in particular the second, all children of a bridge are touched -before the actual bridge itself. This allows the bridge to retain power while -its children are being accessed. - -Upon resuming from sleep, just the opposite must be true: all bridges must be -powered on and restored before their children are powered on. This is easily -accomplished with a breadth-first walk of the PCI device tree. - - -3. PCI Utility Functions -~~~~~~~~~~~~~~~~~~~~~~~~ - -These are helper functions designed to be called by individual device drivers. -Assuming that a device behaves as advertised, these should be applicable in most -cases. However, results may vary. - -Note that these functions are never implicitly called for the driver. The driver -is always responsible for deciding when and if to call these. - - -pci_save_state --------------- - -Usage: - pci_save_state(struct pci_dev *dev); - -Description: - Save first 64 bytes of PCI config space, along with any additional - PCI-Express or PCI-X information. - - -pci_restore_state ------------------ - -Usage: - pci_restore_state(struct pci_dev *dev); - -Description: - Restore previously saved config space. - - -pci_set_power_state -------------------- - -Usage: - pci_set_power_state(struct pci_dev *dev, pci_power_t state); - -Description: - Transition device to low power state using PCI PM Capabilities - registers. - - Will fail under one of the following conditions: - - If state is less than current state, but not D0 (illegal transition) - - Device doesn't support PM Capabilities - - Device does not support requested state - - -pci_enable_wake ---------------- - -Usage: - pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); - -Description: - Enable device to generate PME# during low power state using PCI PM - Capabilities. - - Checks whether if device supports generating PME# from requested state - and fail if it does not, unless enable == 0 (request is to disable wake - events, which is implicit if it doesn't even support it in the first - place). - - Note that the PMC Register in the device's PM Capabilities has a bitmask - of the states it supports generating PME# from. D3hot is bit 3 and - D3cold is bit 4. So, while a value of 4 as the state may not seem - semantically correct, it is. - - -4. PCI Device Drivers -~~~~~~~~~~~~~~~~~~~~~ - -These functions are intended for use by individual drivers, and are defined in -struct pci_driver: - - int (*suspend) (struct pci_dev *dev, pm_message_t state); - int (*resume) (struct pci_dev *dev); - - -suspend -------- - -Usage: - -if (dev->driver && dev->driver->suspend) - dev->driver->suspend(dev,state); - -A driver uses this function to actually transition the device into a low power -state. This should include disabling I/O, IRQs, and bus-mastering, as well as -physically transitioning the device to a lower power state; it may also include -calls to pci_enable_wake(). - -Bus mastering may be disabled by doing: - -pci_disable_device(dev); - -For devices that support the PCI PM Spec, this may be used to set the device's -power state to match the suspend() parameter: - -pci_set_power_state(dev,state); - -The driver is also responsible for disabling any other device-specific features -(e.g blanking screen, turning off on-card memory, etc). - -The driver should be sure to track the current state of the device, as it may -obviate the need for some operations. - -The driver should update the current_state field in its pci_dev structure in -this function, except for PM-capable devices when pci_set_power_state is used. - -resume ------- - -Usage: - -if (dev->driver && dev->driver->resume) - dev->driver->resume(dev) +In that cases the freeze() callback should not prepare the device system wakeup +or put it into a low-power state. Still, either it or freeze_noirq() should +save the device's standard configuration registers using pci_save_state(). -The resume callback may be called from any power state, and is always meant to -transition the device to the D0 state. +3.1.5. freeze_noirq() -The driver is responsible for reenabling any features of the device that had -been disabled during previous suspend calls, such as IRQs and bus mastering, -as well as calling pci_restore_state(). +The freeze_noirq() callback is hibernation-specific. It is executed during +hibernation, after prepare() and freeze() callbacks have been executed for all +devices in preparation for the creation of a system image, and during restore, +after a system image has been loaded into memory and after prepare() and +freeze() callbacks have been executed for all devices. It is always executed +after device interrupts have been disabled by the PM core. -If the device is currently in D3, it may need to be reinitialized in resume(). +The role of this callback is analogous to the role of the suspend_noirq() +callback described above and it very rarely is necessary to define +freeze_noirq(). - * Some types of devices, like bus controllers, will preserve context in D3hot - (using Vcc power). Their drivers will often want to avoid re-initializing - them after re-entering D0 (perhaps to avoid resetting downstream devices). +The difference between freeze_noirq() and freeze() is analogous to the +difference between suspend_noirq() and suspend(). - * Other kinds of devices in D3hot will discard device context as part of a - soft reset when re-entering the D0 state. - - * Devices resuming from D3cold always go through a power-on reset. Some - device context can also be preserved using Vaux power. +3.1.6. poweroff() - * Some systems hide D3cold resume paths from drivers. For example, on PCs - the resume path for suspend-to-disk often runs BIOS powerup code, which - will sometimes re-initialize the device. +The poweroff() callback is hibernation-specific. It is executed when the system +is about to be powered off after saving a hibernation image to a persistent +storage. prepare() callbacks are executed for all devices before poweroff() is +called. -To handle resets during D3 to D0 transitions, it may be convenient to share -device initialization code between probe() and resume(). Device parameters -can also be saved before the driver suspends into D3, avoiding re-probe. +The role of this callback is analogous to the role of the suspend() and freeze() +callbacks described above, although it does not need to save the contents of +the device's registers. In particular, if the driver wants to put the device +into a low-power state itself instead of allowing the PCI subsystem to do that, +the poweroff() callback should use pci_prepare_to_sleep() and +pci_set_power_state() to prepare the device for system wakeup and to put it +into a low-power state, respectively, but it need not save the device's standard +configuration registers. -If the device supports the PCI PM Spec, it can use this to physically transition -the device to D0: +3.1.7. poweroff_noirq() -pci_set_power_state(dev,0); +The poweroff_noirq() callback is hibernation-specific. It is executed after +poweroff() callbacks have been executed for all devices in the system. -Note that if the entire system is transitioning out of a global sleep state, all -devices will be placed in the D0 state, so this is not necessary. However, in -the event that the device is placed in the D3 state during normal operation, -this call is necessary. It is impossible to determine which of the two events is -taking place in the driver, so it is always a good idea to make that call. +The role of this callback is analogous to the role of the suspend_noirq() and +freeze_noirq() callbacks described above, but it does not need to save the +contents of the device's registers. -The driver should take note of the state that it is resuming from in order to -ensure correct (and speedy) operation. +The difference between poweroff_noirq() and poweroff() is analogous to the +difference between suspend_noirq() and suspend(). -The driver should update the current_state field in its pci_dev structure in -this function, except for PM-capable devices when pci_set_power_state is used. +3.1.8. resume_noirq() +The resume_noirq() callback is only executed during system resume, after the +PM core has enabled the non-boot CPUs. The driver's interrupt handler will not +be invoked while resume_noirq() is running, so this callback can carry out +operations that might race with the interrupt handler. +Since the PCI subsystem unconditionally puts all devices into the full power +state in the resume_noirq phase of system resume and restores their standard +configuration registers, resume_noirq() is usually not necessary. In general +it should only be used for performing operations that would lead to race +conditions if carried out by resume(). -A reference implementation -------------------------- -.suspend() -{ - /* driver specific operations */ +3.1.9. resume() - /* Disable IRQ */ - free_irq(); - /* If using MSI */ - pci_disable_msi(); +The resume() callback is only executed during system resume, after +resume_noirq() callbacks have been executed for all devices in the system and +device interrupts have been enabled by the PM core. - pci_save_state(); - pci_enable_wake(); - /* Disable IO/bus master/irq router */ - pci_disable_device(); - pci_set_power_state(pci_choose_state()); -} +This callback is responsible for restoring the pre-suspend configuration of the +device and bringing it back to the fully functional state. The device should be +able to process I/O in a usual way after resume() has returned. -.resume() -{ - pci_set_power_state(PCI_D0); - pci_restore_state(); - /* device's irq possibly is changed, driver should take care */ - pci_enable_device(); - pci_set_master(); +3.1.10. thaw_noirq() - /* if using MSI, device's vector possibly is changed */ - pci_enable_msi(); +The thaw_noirq() callback is hibernation-specific. It is executed after a +system image has been created and the non-boot CPUs have been enabled by the PM +core, in the thaw_noirq phase of hibernation. It also may be executed if the +loading of a hibernation image fails during system restore (it is then executed +after enabling the non-boot CPUs). The driver's interrupt handler will not be +invoked while thaw_noirq() is running. - request_irq(); - /* driver specific operations; */ -} +The role of this callback is analogous to the role of resume_noirq(). The +difference between these two callbacks is that thaw_noirq() is executed after +freeze() and freeze_noirq(), so in general it does not need to modify the +contents of the device's registers. -This is a typical implementation. Drivers can slightly change the order -of the operations in the implementation, ignore some operations or add -more driver specific operations in it, but drivers should do something like -this on the whole. +3.1.11. thaw() -5. Resources -~~~~~~~~~~~~ +The thaw() callback is hibernation-specific. It is executed after thaw_noirq() +callbacks have been executed for all devices in the system and after device +interrupts have been enabled by the PM core. -PCI Local Bus Specification -PCI Bus Power Management Interface Specification +This callback is responsible for restoring the pre-freeze configuration of +the device, so that it will work in a usual way after thaw() has returned. - http://www.pcisig.com +3.1.12. restore_noirq() +The restore_noirq() callback is hibernation-specific. It is executed in the +restore_noirq phase of hibernation, when the boot kernel has passed control to +the image kernel and the non-boot CPUs have been enabled by the image kernel's +PM core. + +This callback is analogous to resume_noirq() with the exception that it cannot +make any assumption on the previous state of the device, even if the BIOS (or +generally the platform firmware) is known to preserve that state over a +suspend-resume cycle. + +For the vast majority of PCI device drivers there is no difference between +resume_noirq() and restore_noirq(). + +3.1.13. restore() + +The restore() callback is hibernation-specific. It is executed after +restore_noirq() callbacks have been executed for all devices in the system and +after the PM core has enabled device drivers' interrupt handlers to be invoked. + +This callback is analogous to resume(), just like restore_noirq() is analogous +to resume_noirq(). Consequently, the difference between restore_noirq() and +restore() is analogous to the difference between resume_noirq() and resume(). + +For the vast majority of PCI device drivers there is no difference between +resume() and restore(). + +3.1.14. complete() + +The complete() callback is executed in the following situations: + - during system resume, after resume() callbacks have been executed for all + devices, + - during hibernation, before saving the system image, after thaw() callbacks + have been executed for all devices, + - during system restore, when the system is going back to its pre-hibernation + state, after restore() callbacks have been executed for all devices. +It also may be executed if the loading of a hibernation image into memory fails +(in that case it is run after thaw() callbacks have been executed for all +devices that have drivers in the boot kernel). + +This callback is entirely optional, although it may be necessary if the +prepare() callback performs operations that need to be reversed. + +3.1.15. runtime_suspend() + +The runtime_suspend() callback is specific to device runtime power management +(runtime PM). It is executed by the PM core's runtime PM framework when the +device is about to be suspended (i.e. quiesced and put into a low-power state) +at run time. + +This callback is responsible for freezing the device and preparing it to be +put into a low-power state, but it must allow the PCI subsystem to perform all +of the PCI-specific actions necessary for suspending the device. + +3.1.16. runtime_resume() + +The runtime_resume() callback is specific to device runtime PM. It is executed +by the PM core's runtime PM framework when the device is about to be resumed +(i.e. put into the full-power state and programmed to process I/O normally) at +run time. + +This callback is responsible for restoring the normal functionality of the +device after it has been put into the full-power state by the PCI subsystem. +The device is expected to be able to process I/O in the usual way after +runtime_resume() has returned. + +3.1.17. runtime_idle() + +The runtime_idle() callback is specific to device runtime PM. It is executed +by the PM core's runtime PM framework whenever it may be desirable to suspend +the device according to the PM core's information. In particular, it is +automatically executed right after runtime_resume() has returned in case the +resume of the device has happened as a result of a spurious event. + +This callback is optional, but if it is not implemented or if it returns 0, the +PCI subsystem will call pm_runtime_suspend() for the device, which in turn will +cause the driver's runtime_suspend() callback to be executed. + +3.1.18. Pointing Multiple Callback Pointers to One Routine + +Although in principle each of the callbacks described in the previous +subsections can be defined as a separate function, it often is convenient to +point two or more members of struct dev_pm_ops to the same routine. There are +a few convenience macros that can be used for this purpose. + +The SIMPLE_DEV_PM_OPS macro declares a struct dev_pm_ops object with one +suspend routine pointed to by the .suspend(), .freeze(), and .poweroff() +members and one resume routine pointed to by the .resume(), .thaw(), and +.restore() members. The other function pointers in this struct dev_pm_ops are +unset. + +The UNIVERSAL_DEV_PM_OPS macro is similar to SIMPLE_DEV_PM_OPS, but it +additionally sets the .runtime_resume() pointer to the same value as +.resume() (and .thaw(), and .restore()) and the .runtime_suspend() pointer to +the same value as .suspend() (and .freeze() and .poweroff()). + +The SET_SYSTEM_SLEEP_PM_OPS can be used inside of a declaration of struct +dev_pm_ops to indicate that one suspend routine is to be pointed to by the +.suspend(), .freeze(), and .poweroff() members and one resume routine is to +be pointed to by the .resume(), .thaw(), and .restore() members. + +3.2. Device Runtime Power Management +------------------------------------ +In addition to providing device power management callbacks PCI device drivers +are responsible for controlling the runtime power management (runtime PM) of +their devices. + +The PCI device runtime PM is optional, but it is recommended that PCI device +drivers implement it at least in the cases where there is a reliable way of +verifying that the device is not used (like when the network cable is detached +from an Ethernet adapter or there are no devices attached to a USB controller). + +To support the PCI runtime PM the driver first needs to implement the +runtime_suspend() and runtime_resume() callbacks. It also may need to implement +the runtime_idle() callback to prevent the device from being suspended again +every time right after the runtime_resume() callback has returned +(alternatively, the runtime_suspend() callback will have to check if the +device should really be suspended and return -EAGAIN if that is not the case). + +The runtime PM of PCI devices is disabled by default. It is also blocked by +pci_pm_init() that runs the pm_runtime_forbid() helper function. If a PCI +driver implements the runtime PM callbacks and intends to use the runtime PM +framework provided by the PM core and the PCI subsystem, it should enable this +feature by executing the pm_runtime_enable() helper function. However, the +driver should not call the pm_runtime_allow() helper function unblocking +the runtime PM of the device. Instead, it should allow user space or some +platform-specific code to do that (user space can do it via sysfs), although +once it has called pm_runtime_enable(), it must be prepared to handle the +runtime PM of the device correctly as soon as pm_runtime_allow() is called +(which may happen at any time). [It also is possible that user space causes +pm_runtime_allow() to be called via sysfs before the driver is loaded, so in +fact the driver has to be prepared to handle the runtime PM of the device as +soon as it calls pm_runtime_enable().] + +The runtime PM framework works by processing requests to suspend or resume +devices, or to check if they are idle (in which cases it is reasonable to +subsequently request that they be suspended). These requests are represented +by work items put into the power management workqueue, pm_wq. Although there +are a few situations in which power management requests are automatically +queued by the PM core (for example, after processing a request to resume a +device the PM core automatically queues a request to check if the device is +idle), device drivers are generally responsible for queuing power management +requests for their devices. For this purpose they should use the runtime PM +helper functions provided by the PM core, discussed in +Documentation/power/runtime_pm.txt. + +Devices can also be suspended and resumed synchronously, without placing a +request into pm_wq. In the majority of cases this also is done by their +drivers that use helper functions provided by the PM core for this purpose. + +For more information on the runtime PM of devices refer to +Documentation/power/runtime_pm.txt. + + +4. Resources +============ + +PCI Local Bus Specification, Rev. 3.0 +PCI Bus Power Management Interface Specification, Rev. 1.2 +Advanced Configuration and Power Interface (ACPI) Specification, Rev. 3.0b +PCI Express Base Specification, Rev. 2.0 +Documentation/power/devices.txt +Documentation/power/runtime_pm.txt -- cgit v1.2.2 From b2be05273a1744d175bf4b67f6665637bb9ac7a8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 3 Apr 2010 19:34:56 +0100 Subject: panic: Allow warnings to set different taint flags WARN() is used in some places to report firmware or hardware bugs that are then worked-around. These bugs do not affect the stability of the kernel and should not set the flag for TAINT_WARN. To allow for this, add WARN_TAINT() and WARN_TAINT_ONCE() macros that take a taint number as argument. Architectures that implement warnings using trap instructions instead of calls to warn_slowpath_*() now implement __WARN_TAINT(taint) instead of __WARN(). Signed-off-by: Ben Hutchings Acked-by: Helge Deller Tested-by: Paul Mundt Signed-off-by: David Woodhouse --- Documentation/oops-tracing.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation') diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index c10c022b911..069fab3ea4d 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt @@ -256,6 +256,7 @@ characters, each representing a particular tainted value. 9: 'A' if the ACPI table has been overridden. 10: 'W' if a warning has previously been issued by the kernel. + (Though some warnings may set more specific taint flags.) 11: 'C' if a staging driver has been loaded. -- cgit v1.2.2 From 92946bc72f2e74c3281b7fc12be9704d455fb3ed Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 3 Apr 2010 19:36:42 +0100 Subject: panic: Add taint flag TAINT_FIRMWARE_WORKAROUND ('I') This taint flag will initially be used when warning about invalid ACPI DMAR tables. Signed-off-by: Ben Hutchings Signed-off-by: David Woodhouse --- Documentation/oops-tracing.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index 069fab3ea4d..6fe9001b926 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt @@ -260,6 +260,9 @@ characters, each representing a particular tainted value. 11: 'C' if a staging driver has been loaded. + 12: 'I' if the kernel is working around a severe bug in the platform + firmware (BIOS or similar). + The primary reason for the 'Tainted: ' string is to tell kernel debuggers if this is a clean kernel or if anything unusual has occurred. Tainting is permanent: even if an offending module is -- cgit v1.2.2 From 24af3202459d9a25643009b1ab8ab5ff04d94b49 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 18 May 2010 22:26:40 +0200 Subject: ds2760_battery: Document ABI change Add some documentation for the newly added writeable properties. Suggested-by: Greg KH Signed-off-by: Daniel Mack Signed-off-by: Anton Vorontsov --- Documentation/ABI/testing/sysfs-class-power | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-power (limited to 'Documentation') diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power new file mode 100644 index 00000000000..78c7baca358 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-class-power @@ -0,0 +1,20 @@ +What: /sys/class/power/ds2760-battery.*/charge_now +Date: May 2010 +KernelVersion: 2.6.35 +Contact: Daniel Mack +Description: + This file is writeable and can be used to set the current + coloumb counter value inside the battery monitor chip. This + is needed for unavoidable corrections of aging batteries. + A userspace daemon can monitor the battery charging logic + and once the counter drops out of considerable bounds, take + appropriate action. + +What: /sys/class/power/ds2760-battery.*/charge_full +Date: May 2010 +KernelVersion: 2.6.35 +Contact: Daniel Mack +Description: + This file is writeable and can be used to set the assumed + battery 'full level'. As batteries age, this value has to be + amended over time. -- cgit v1.2.2 From 09c9e81366b9167b88ff05cf29fa94dc3553eb3d Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 11 May 2010 12:17:47 -0400 Subject: KVM: Add cpuid.txt file This file documents cpuid bits used by KVM. Signed-off-by: Glauber Costa Acked-by: Zachary Amsden Signed-off-by: Marcelo Tosatti --- Documentation/kvm/cpuid.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/kvm/cpuid.txt (limited to 'Documentation') diff --git a/Documentation/kvm/cpuid.txt b/Documentation/kvm/cpuid.txt new file mode 100644 index 00000000000..14a12ea92b7 --- /dev/null +++ b/Documentation/kvm/cpuid.txt @@ -0,0 +1,42 @@ +KVM CPUID bits +Glauber Costa , Red Hat Inc, 2010 +===================================================== + +A guest running on a kvm host, can check some of its features using +cpuid. This is not always guaranteed to work, since userspace can +mask-out some, or even all KVM-related cpuid features before launching +a guest. + +KVM cpuid functions are: + +function: KVM_CPUID_SIGNATURE (0x40000000) +returns : eax = 0, + ebx = 0x4b4d564b, + ecx = 0x564b4d56, + edx = 0x4d. +Note that this value in ebx, ecx and edx corresponds to the string "KVMKVMKVM". +This function queries the presence of KVM cpuid leafs. + + +function: define KVM_CPUID_FEATURES (0x40000001) +returns : ebx, ecx, edx = 0 + eax = and OR'ed group of (1 << flag), where each flags is: + + +flag || value || meaning +============================================================================= +KVM_FEATURE_CLOCKSOURCE || 0 || kvmclock available at msrs + || || 0x11 and 0x12. +------------------------------------------------------------------------------ +KVM_FEATURE_NOP_IO_DELAY || 1 || not necessary to perform delays + || || on PIO operations. +------------------------------------------------------------------------------ +KVM_FEATURE_MMU_OP || 2 || deprecated. +------------------------------------------------------------------------------ +KVM_FEATURE_CLOCKSOURCE2 || 3 || kvmclock available at msrs + || || 0x4b564d00 and 0x4b564d01 +------------------------------------------------------------------------------ +KVM_FEATURE_CLOCKSOURCE_STABLE_BIT || 24 || host will warn if no guest-side + || || per-cpu warps are expected in + || || kvmclock. +------------------------------------------------------------------------------ -- cgit v1.2.2 From 3dbe141595faa48a067add3e47bba3205b79d33c Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 12 May 2010 11:48:18 +0300 Subject: KVM: MMU: Segregate shadow pages with different cr0.wp When cr0.wp=0, we may shadow a gpte having u/s=1 and r/w=0 with an spte having u/s=0 and r/w=1. This allows excessive access if the guest sets cr0.wp=1 and accesses through this spte. Fix by making cr0.wp part of the base role; we'll have different sptes for the two cases and the problem disappears. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- Documentation/kvm/mmu.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation') diff --git a/Documentation/kvm/mmu.txt b/Documentation/kvm/mmu.txt index 0cc28fb84f4..aaed6ab9d7a 100644 --- a/Documentation/kvm/mmu.txt +++ b/Documentation/kvm/mmu.txt @@ -163,6 +163,8 @@ Shadow pages contain the following information: 32-bit or 64-bit gptes are in use). role.cr4_nxe: Contains the value of efer.nxe for which the page is valid. + role.cr0_wp: + Contains the value of cr0.wp for which the page is valid. gfn: Either the guest page table containing the translations shadowed by this page, or the base page frame for linear translations. See role.direct. -- cgit v1.2.2 From 860553023bfed0179b3fe5d01838635f54a314a3 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 6 Apr 2010 06:41:28 -0300 Subject: V4L/DVB: V4L2 Spec: fix V4L2_CTRL_TYPE_CTRL_CLASS documentation The spec says that the control ID for these types of controls is the same as that of the control class. But it should read: 'control class + 1'. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/vidioc-queryctrl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml index 4876ff1a1a0..8e0e055ac93 100644 --- a/Documentation/DocBook/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/v4l/vidioc-queryctrl.xml @@ -325,7 +325,7 @@ should be part of the control documentation. n/a This is not a control. When VIDIOC_QUERYCTRL is called with a control ID -equal to a control class code (see ), the +equal to a control class code (see ) + 1, the ioctl returns the name of the control class and this control type. Older drivers which do not support this feature return an &EINVAL;. -- cgit v1.2.2 From e426e8663f028272b99f91e57bbbab6fda603bf1 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 6 Apr 2010 10:32:19 -0300 Subject: V4L/DVB: DocBook/v4l/compat.xml: add missing
The indentation of the sections had gone wrong, causing a mistake with section nesting. Fixed. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/compat.xml | 115 ++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 57 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml index 854235b5208..b42b935913c 100644 --- a/Documentation/DocBook/v4l/compat.xml +++ b/Documentation/DocBook/v4l/compat.xml @@ -2343,15 +2343,15 @@ more information. - + -
- Relation of V4L2 to other Linux multimedia APIs +
+ Relation of V4L2 to other Linux multimedia APIs -
- X Video Extension +
+ X Video Extension - The X Video Extension (abbreviated XVideo or just Xv) is + The X Video Extension (abbreviated XVideo or just Xv) is an extension of the X Window system, implemented for example by the XFree86 project. Its scope is similar to V4L2, an API to video capture and output devices for X clients. Xv allows applications to display @@ -2362,7 +2362,7 @@ capture or output still images in XPixmaps extension available across many operating systems and architectures. - Because the driver is embedded into the X server Xv has a + Because the driver is embedded into the X server Xv has a number of advantages over the V4L2 video overlay interface. The driver can easily determine the overlay target, &ie; visible graphics memory or off-screen buffers for a @@ -2371,16 +2371,16 @@ overlay, scaling or color-keying, or the clipping functions of the video capture hardware, always in sync with drawing operations or windows moving or changing their stacking order. - To combine the advantages of Xv and V4L a special Xv + To combine the advantages of Xv and V4L a special Xv driver exists in XFree86 and XOrg, just programming any overlay capable Video4Linux device it finds. To enable it /etc/X11/XF86Config must contain these lines: - + Section "Module" Load "v4l" EndSection - As of XFree86 4.2 this driver still supports only V4L + As of XFree86 4.2 this driver still supports only V4L ioctls, however it should work just fine with all V4L2 devices through the V4L2 backward-compatibility layer. Since V4L2 permits multiple opens it is possible (if supported by the V4L2 driver) to capture @@ -2388,83 +2388,84 @@ video while an X client requested video overlay. Restrictions of simultaneous capturing and overlay are discussed in apply. - Only marginally related to V4L2, XFree86 extended Xv to + Only marginally related to V4L2, XFree86 extended Xv to support hardware YUV to RGB conversion and scaling for faster video playback, and added an interface to MPEG-2 decoding hardware. This API is useful to display images captured with V4L2 devices. -
+
-
- Digital Video +
+ Digital Video - V4L2 does not support digital terrestrial, cable or + V4L2 does not support digital terrestrial, cable or satellite broadcast. A separate project aiming at digital receivers exists. You can find its homepage at http://linuxtv.org. The Linux DVB API has no connection to the V4L2 API except that drivers for hybrid hardware may support both. -
+
-
- Audio Interfaces +
+ Audio Interfaces - [to do - OSS/ALSA] + [to do - OSS/ALSA] +
-
-
- Experimental API Elements +
+ Experimental API Elements - The following V4L2 API elements are currently experimental + The following V4L2 API elements are currently experimental and may change in the future. - - - Video Output Overlay (OSD) Interface, + + Video Output Overlay (OSD) Interface, . - + - V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, &v4l2-buf-type;, . - - - V4L2_CAP_VIDEO_OUTPUT_OVERLAY, + + + V4L2_CAP_VIDEO_OUTPUT_OVERLAY, &VIDIOC-QUERYCAP; ioctl, . - - - &VIDIOC-ENUM-FRAMESIZES; and + + + &VIDIOC-ENUM-FRAMESIZES; and &VIDIOC-ENUM-FRAMEINTERVALS; ioctls. - - - &VIDIOC-G-ENC-INDEX; ioctl. - - - &VIDIOC-ENCODER-CMD; and &VIDIOC-TRY-ENCODER-CMD; + + + &VIDIOC-G-ENC-INDEX; ioctl. + + + &VIDIOC-ENCODER-CMD; and &VIDIOC-TRY-ENCODER-CMD; ioctls. - - - &VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER; + + + &VIDIOC-DBG-G-REGISTER; and &VIDIOC-DBG-S-REGISTER; ioctls. - - - &VIDIOC-DBG-G-CHIP-IDENT; ioctl. - - -
+ + + &VIDIOC-DBG-G-CHIP-IDENT; ioctl. + + +
-
- Obsolete API Elements +
+ Obsolete API Elements - The following V4L2 API elements were superseded by new + The following V4L2 API elements were superseded by new interfaces and should not be implemented in new drivers. - - - VIDIOC_G_MPEGCOMP and + + + VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP ioctls. Use Extended Controls, . - - + + +
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml index 060105af49e..9737243377a 100644 --- a/Documentation/DocBook/v4l/v4l2.xml +++ b/Documentation/DocBook/v4l/v4l2.xml @@ -401,6 +401,7 @@ and discussions on the V4L mailing list.
&sub-dev-teletext;
&sub-dev-radio;
&sub-dev-rds;
+
&sub-dev-event;
@@ -426,6 +427,7 @@ and discussions on the V4L mailing list. &sub-cropcap; &sub-dbg-g-chip-ident; &sub-dbg-g-register; + &sub-dqevent; &sub-encoder-cmd; &sub-enumaudio; &sub-enumaudioout; @@ -467,6 +469,7 @@ and discussions on the V4L mailing list. &sub-reqbufs; &sub-s-hw-freq-seek; &sub-streamon; + &sub-subscribe-event; &sub-mmap; &sub-munmap; diff --git a/Documentation/DocBook/v4l/vidioc-dqevent.xml b/Documentation/DocBook/v4l/vidioc-dqevent.xml new file mode 100644 index 00000000000..eb45c1695d8 --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-dqevent.xml @@ -0,0 +1,124 @@ + + + ioctl VIDIOC_DQEVENT + &manvol; + + + + VIDIOC_DQEVENT + Dequeue event + + + + + + int ioctl + int fd + int request + struct v4l2_event +*argp + + + + + + Arguments + + + + fd + + &fd; + + + + request + + VIDIOC_DQEVENT + + + + argp + + + + + + + + + Description + + Dequeue an event from a video device. No input is required + for this ioctl. All the fields of the &v4l2-event; structure are + filled by the driver. The file handle will also receive exceptions + which the application may get by e.g. using the select system + call. + + + struct <structname>v4l2_event</structname> + + &cs-str; + + + __u32 + type + + Type of the event. + + + union + u + + + + + + __u8 + data[64] + Event data. Defined by the event type. The union + should be used to define easily accessible type for + events. + + + __u32 + pending + + Number of pending events excluding this one. + + + __u32 + sequence + + Event sequence number. The sequence number is + incremented for every subscribed event that takes place. + If sequence numbers are not contiguous it means that + events have been lost. + + + + struct timeval + timestamp + + Event timestamp. + + + __u32 + reserved[9] + + Reserved for future extensions. Drivers must set + the array to zero. + + + +
+ +
+
+ diff --git a/Documentation/DocBook/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/v4l/vidioc-subscribe-event.xml new file mode 100644 index 00000000000..71ab88cb76b --- /dev/null +++ b/Documentation/DocBook/v4l/vidioc-subscribe-event.xml @@ -0,0 +1,104 @@ + + + ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT + &manvol; + + + + VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT + Subscribe or unsubscribe event + + + + + + int ioctl + int fd + int request + struct v4l2_event_subscription +*argp + + + + + + Arguments + + + + fd + + &fd; + + + + request + + VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT + + + + argp + + + + + + + + + Description + + Subscribe or unsubscribe V4L2 event. Subscribed events are + dequeued by using the &VIDIOC-DQEVENT; ioctl. + + + struct <structname>v4l2_event_subscription</structname> + + &cs-str; + + + __u32 + type + Type of the event. + + + __u32 + reserved[7] + Reserved for future extensions. Drivers and applications + must set the array to zero. + + + +
+ + + Event Types + + &cs-def; + + + V4L2_EVENT_ALL + 0 + All events. V4L2_EVENT_ALL is valid only for + VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. + + + + V4L2_EVENT_PRIVATE_START + 0x08000000 + Base event number for driver-private events. + + + +
+ +
+
+ diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 48f0adfbc98..e831aaca66f 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt @@ -680,3 +680,63 @@ int my_release(struct file *file) ... } + +V4L2 events +----------- + +The V4L2 events provide a generic way to pass events to user space. +The driver must use v4l2_fh to be able to support V4L2 events. + +Useful functions: + +- v4l2_event_alloc() + + To use events, the driver must allocate events for the file handle. By + calling the function more than once, the driver may assure that at least n + events in total have been allocated. The function may not be called in + atomic context. + +- v4l2_event_queue() + + Queue events to video device. The driver's only responsibility is to fill + in the type and the data fields. The other fields will be filled in by + V4L2. + +- v4l2_event_subscribe() + + The video_device->ioctl_ops->vidioc_subscribe_event must check the driver + is able to produce events with specified event id. Then it calls + v4l2_event_subscribe() to subscribe the event. + +- v4l2_event_unsubscribe() + + vidioc_unsubscribe_event in struct v4l2_ioctl_ops. A driver may use + v4l2_event_unsubscribe() directly unless it wants to be involved in + unsubscription process. + + The special type V4L2_EVENT_ALL may be used to unsubscribe all events. The + drivers may want to handle this in a special way. + +- v4l2_event_pending() + + Returns the number of pending events. Useful when implementing poll. + +Drivers do not initialise events directly. The events are initialised +through v4l2_fh_init() if video_device->ioctl_ops->vidioc_subscribe_event is +non-NULL. This *MUST* be performed in the driver's +v4l2_file_operations->open() handler. + +Events are delivered to user space through the poll system call. The driver +can use v4l2_fh->events->wait wait_queue_head_t as the argument for +poll_wait(). + +There are standard and private events. New standard events must use the +smallest available event type. The drivers must allocate their events from +their own class starting from class base. Class base is +V4L2_EVENT_PRIVATE_START + n * 1000 where n is the lowest available number. +The first event type in the class is reserved for future use, so the first +available event type is 'class base + 1'. + +An example on how the V4L2 events may be used can be found in the OMAP +3 ISP driver available at as of +writing this. -- cgit v1.2.2 From 37089368c1b1bea3c71217163e6d5d3b01ef1f19 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 27 Mar 2010 14:10:37 -0300 Subject: V4L/DVB: v4l spec: document what odd and even fields are Document that odd == top and even == bottom. I can never remember this, so it is probably worth documenting. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/v4l/io.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/v4l/io.xml b/Documentation/DocBook/v4l/io.xml index e870330cbf7..bb685ed6fe7 100644 --- a/Documentation/DocBook/v4l/io.xml +++ b/Documentation/DocBook/v4l/io.xml @@ -918,8 +918,8 @@ order. When the driver provides or accepts images field by field rather than interleaved, it is also important applications understand -how the fields combine to frames. We distinguish between top and -bottom fields, the spatial order: The first line +how the fields combine to frames. We distinguish between top (aka odd) and +bottom (aka even) fields, the spatial order: The first line of the top field is the first line of an interlaced frame, the first line of the bottom field is the second line of that frame. @@ -972,12 +972,12 @@ between V4L2_FIELD_TOP and V4L2_FIELD_TOP 2 - Images consist of the top field only. + Images consist of the top (aka odd) field only. V4L2_FIELD_BOTTOM 3 - Images consist of the bottom field only. + Images consist of the bottom (aka even) field only. Applications may wish to prevent a device from capturing interlaced images because they will have "comb" or "feathering" artefacts around moving objects. -- cgit v1.2.2 From 0e1de38db83606d802cf2b3e00cf95fc693b8ca2 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 27 Mar 2010 14:10:57 -0300 Subject: V4L/DVB: v4l spec: document new events Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media-entities.tmpl | 2 ++ Documentation/DocBook/v4l/vidioc-dqevent.xml | 9 ++++++- .../DocBook/v4l/vidioc-subscribe-event.xml | 29 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl index 770be3c3ba7..5d4d40f429a 100644 --- a/Documentation/DocBook/media-entities.tmpl +++ b/Documentation/DocBook/media-entities.tmpl @@ -85,6 +85,7 @@ VIDIOC_TRY_ENCODER_CMD"> VIDIOC_TRY_EXT_CTRLS"> VIDIOC_TRY_FMT"> +VIDIOC_UNSUBSCRIBE_EVENT"> v4l2_std_id"> @@ -145,6 +146,7 @@ v4l2_encoder_cmd"> v4l2_event"> v4l2_event_subscription"> +v4l2_event_vsync"> v4l2_ext_control"> v4l2_ext_controls"> v4l2_fmtdesc"> diff --git a/Documentation/DocBook/v4l/vidioc-dqevent.xml b/Documentation/DocBook/v4l/vidioc-dqevent.xml index eb45c1695d8..4e0a7cc3081 100644 --- a/Documentation/DocBook/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/v4l/vidioc-dqevent.xml @@ -72,6 +72,13 @@ + + + &v4l2-event-vsync; + vsync + Event data for event V4L2_EVENT_VSYNC. + + __u8 @@ -97,7 +104,7 @@ - struct timeval + struct timespec timestamp Event timestamp. diff --git a/Documentation/DocBook/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/v4l/vidioc-subscribe-event.xml index 71ab88cb76b..8b501791aa6 100644 --- a/Documentation/DocBook/v4l/vidioc-subscribe-event.xml +++ b/Documentation/DocBook/v4l/vidioc-subscribe-event.xml @@ -84,6 +84,21 @@ VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once. + + V4L2_EVENT_VSYNC + 1 + This event is triggered on the vertical sync. + This event has &v4l2-event-vsync; associated with it. + + + + V4L2_EVENT_EOS + 2 + This event is triggered when the end of a stream is reached. + This is typically used with MPEG decoders to report to the application + when the last of the MPEG stream has been decoded. + + V4L2_EVENT_PRIVATE_START 0x08000000 @@ -93,6 +108,20 @@ + + struct <structname>v4l2_event_vsync</structname> + + &cs-str; + + + __u8 + field + The upcoming field. See &v4l2-field;. + + + +
+