aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
committerLen Brown <len.brown@intel.com>2005-09-08 01:45:47 -0400
commit64e47488c913ac704d465a6af86a26786d1412a5 (patch)
treed3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /Documentation
parent4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff)
parentcaf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff)
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DocBook/mcabook.tmpl2
-rw-r--r--Documentation/IPMI.txt13
-rw-r--r--Documentation/RCU/NMI-RCU.txt112
-rw-r--r--Documentation/cdrom/sonycd5353
-rw-r--r--Documentation/cpusets.txt12
-rw-r--r--Documentation/crypto/api-intro.txt1
-rw-r--r--Documentation/dcdbas.txt91
-rw-r--r--Documentation/dell_rbu.txt74
-rw-r--r--Documentation/dvb/bt8xx.txt2
-rw-r--r--Documentation/exception.txt2
-rw-r--r--Documentation/feature-removal-schedule.txt26
-rw-r--r--Documentation/filesystems/proc.txt1
-rw-r--r--Documentation/filesystems/relayfs.txt362
-rw-r--r--Documentation/filesystems/sysfs.txt28
-rw-r--r--Documentation/hwmon/lm787
-rw-r--r--Documentation/hwmon/w83792d174
-rw-r--r--Documentation/i2c/chips/max687594
-rw-r--r--Documentation/i2c/functionality2
-rw-r--r--Documentation/i2c/porting-clients25
-rw-r--r--Documentation/i2c/writing-clients114
-rw-r--r--Documentation/i386/boot.txt35
-rw-r--r--Documentation/kbuild/makefiles.txt6
-rw-r--r--Documentation/kernel-parameters.txt5
-rw-r--r--Documentation/power/swsusp-dmcrypt.txt138
-rw-r--r--Documentation/power/swsusp.txt102
-rw-r--r--Documentation/power/video.txt10
-rw-r--r--Documentation/scsi/aic7xxx.txt6
-rw-r--r--Documentation/scsi/scsi_mid_low_api.txt41
-rw-r--r--Documentation/sonypi.txt10
-rw-r--r--Documentation/vm/locking15
-rw-r--r--Documentation/watchdog/watchdog-api.txt20
31 files changed, 1251 insertions, 282 deletions
diff --git a/Documentation/DocBook/mcabook.tmpl b/Documentation/DocBook/mcabook.tmpl
index 4367f4642f3d..42a760cd7467 100644
--- a/Documentation/DocBook/mcabook.tmpl
+++ b/Documentation/DocBook/mcabook.tmpl
@@ -96,7 +96,7 @@
96 96
97 <chapter id="pubfunctions"> 97 <chapter id="pubfunctions">
98 <title>Public Functions Provided</title> 98 <title>Public Functions Provided</title>
99!Earch/i386/kernel/mca.c 99!Edrivers/mca/mca-legacy.c
100 </chapter> 100 </chapter>
101 101
102 <chapter id="dmafunctions"> 102 <chapter id="dmafunctions">
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt
index 84d3d4d10c17..bf1cf98d2a27 100644
--- a/Documentation/IPMI.txt
+++ b/Documentation/IPMI.txt
@@ -605,12 +605,13 @@ is in the ipmi_poweroff module. When the system requests a powerdown,
605it will send the proper IPMI commands to do this. This is supported on 605it will send the proper IPMI commands to do this. This is supported on
606several platforms. 606several platforms.
607 607
608There is a module parameter named "poweroff_control" that may either be zero 608There is a module parameter named "poweroff_powercycle" that may
609(do a power down) or 2 (do a power cycle, power the system off, then power 609either be zero (do a power down) or non-zero (do a power cycle, power
610it on in a few seconds). Setting ipmi_poweroff.poweroff_control=x will do 610the system off, then power it on in a few seconds). Setting
611the same thing on the kernel command line. The parameter is also available 611ipmi_poweroff.poweroff_control=x will do the same thing on the kernel
612via the proc filesystem in /proc/ipmi/poweroff_control. Note that if the 612command line. The parameter is also available via the proc filesystem
613system does not support power cycling, it will always to the power off. 613in /proc/sys/dev/ipmi/poweroff_powercycle. Note that if the system
614does not support power cycling, it will always do the power off.
614 615
615Note that if you have ACPI enabled, the system will prefer using ACPI to 616Note that if you have ACPI enabled, the system will prefer using ACPI to
616power off. 617power off.
diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt
new file mode 100644
index 000000000000..d0634a5c3445
--- /dev/null
+++ b/Documentation/RCU/NMI-RCU.txt
@@ -0,0 +1,112 @@
1Using RCU to Protect Dynamic NMI Handlers
2
3
4Although RCU is usually used to protect read-mostly data structures,
5it is possible to use RCU to provide dynamic non-maskable interrupt
6handlers, as well as dynamic irq handlers. This document describes
7how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer
8work in "arch/i386/oprofile/nmi_timer_int.c" and in
9"arch/i386/kernel/traps.c".
10
11The relevant pieces of code are listed below, each followed by a
12brief explanation.
13
14 static int dummy_nmi_callback(struct pt_regs *regs, int cpu)
15 {
16 return 0;
17 }
18
19The dummy_nmi_callback() function is a "dummy" NMI handler that does
20nothing, but returns zero, thus saying that it did nothing, allowing
21the NMI handler to take the default machine-specific action.
22
23 static nmi_callback_t nmi_callback = dummy_nmi_callback;
24
25This nmi_callback variable is a global function pointer to the current
26NMI handler.
27
28 fastcall void do_nmi(struct pt_regs * regs, long error_code)
29 {
30 int cpu;
31
32 nmi_enter();
33
34 cpu = smp_processor_id();
35 ++nmi_count(cpu);
36
37 if (!rcu_dereference(nmi_callback)(regs, cpu))
38 default_do_nmi(regs);
39
40 nmi_exit();
41 }
42
43The do_nmi() function processes each NMI. It first disables preemption
44in the same way that a hardware irq would, then increments the per-CPU
45count of NMIs. It then invokes the NMI handler stored in the nmi_callback
46function pointer. If this handler returns zero, do_nmi() invokes the
47default_do_nmi() function to handle a machine-specific NMI. Finally,
48preemption is restored.
49
50Strictly speaking, rcu_dereference() is not needed, since this code runs
51only on i386, which does not need rcu_dereference() anyway. However,
52it is a good documentation aid, particularly for anyone attempting to
53do something similar on Alpha.
54
55Quick Quiz: Why might the rcu_dereference() be necessary on Alpha,
56 given that the code referenced by the pointer is read-only?
57
58
59Back to the discussion of NMI and RCU...
60
61 void set_nmi_callback(nmi_callback_t callback)
62 {
63 rcu_assign_pointer(nmi_callback, callback);
64 }
65
66The set_nmi_callback() function registers an NMI handler. Note that any
67data that is to be used by the callback must be initialized up -before-
68the call to set_nmi_callback(). On architectures that do not order
69writes, the rcu_assign_pointer() ensures that the NMI handler sees the
70initialized values.
71
72 void unset_nmi_callback(void)
73 {
74 rcu_assign_pointer(nmi_callback, dummy_nmi_callback);
75 }
76
77This function unregisters an NMI handler, restoring the original
78dummy_nmi_handler(). However, there may well be an NMI handler
79currently executing on some other CPU. We therefore cannot free
80up any data structures used by the old NMI handler until execution
81of it completes on all other CPUs.
82
83One way to accomplish this is via synchronize_sched(), perhaps as
84follows:
85
86 unset_nmi_callback();
87 synchronize_sched();
88 kfree(my_nmi_data);
89
90This works because synchronize_sched() blocks until all CPUs complete
91any preemption-disabled segments of code that they were executing.
92Since NMI handlers disable preemption, synchronize_sched() is guaranteed
93not to return until all ongoing NMI handlers exit. It is therefore safe
94to free up the handler's data as soon as synchronize_sched() returns.
95
96
97Answer to Quick Quiz
98
99 Why might the rcu_dereference() be necessary on Alpha, given
100 that the code referenced by the pointer is read-only?
101
102 Answer: The caller to set_nmi_callback() might well have
103 initialized some data that is to be used by the
104 new NMI handler. In this case, the rcu_dereference()
105 would be needed, because otherwise a CPU that received
106 an NMI just after the new handler was set might see
107 the pointer to the new NMI handler, but the old
108 pre-initialized version of the handler's data.
109
110 More important, the rcu_dereference() makes it clear
111 to someone reading the code that the pointer is being
112 protected by RCU.
diff --git a/Documentation/cdrom/sonycd535 b/Documentation/cdrom/sonycd535
index 59581a4b302a..b81e109970aa 100644
--- a/Documentation/cdrom/sonycd535
+++ b/Documentation/cdrom/sonycd535
@@ -68,7 +68,8 @@ it a better device citizen. Further thanks to Joel Katz
68Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches 68Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches
69to make the driver work with the older CDU-510/515 series, and 69to make the driver work with the older CDU-510/515 series, and
70Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that 70Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that
71the verify_area() checks were ignoring the results of said checks. 71the verify_area() checks were ignoring the results of said checks
72(note: verify_area() has since been replaced by access_ok()).
72 73
73(Acknowledgments from Ron Jeppesen in the 0.3 release:) 74(Acknowledgments from Ron Jeppesen in the 0.3 release:)
74Thanks to Corey Minyard who wrote the original CDU-31A driver on which 75Thanks to Corey Minyard who wrote the original CDU-31A driver on which
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index ad944c060312..47f4114fbf54 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -60,6 +60,18 @@ all of the cpus in the system. This removes any overhead due to
60load balancing code trying to pull tasks outside of the cpu exclusive 60load balancing code trying to pull tasks outside of the cpu exclusive
61cpuset only to be prevented by the tasks' cpus_allowed mask. 61cpuset only to be prevented by the tasks' cpus_allowed mask.
62 62
63A cpuset that is mem_exclusive restricts kernel allocations for
64page, buffer and other data commonly shared by the kernel across
65multiple users. All cpusets, whether mem_exclusive or not, restrict
66allocations of memory for user space. This enables configuring a
67system so that several independent jobs can share common kernel
68data, such as file system pages, while isolating each jobs user
69allocation in its own cpuset. To do this, construct a large
70mem_exclusive cpuset to hold all the jobs, and construct child,
71non-mem_exclusive cpusets for each individual job. Only a small
72amount of typical kernel memory, such as requests from interrupt
73handlers, is allowed to be taken outside even a mem_exclusive cpuset.
74
63User level code may create and destroy cpusets by name in the cpuset 75User level code may create and destroy cpusets by name in the cpuset
64virtual file system, manage the attributes and permissions of these 76virtual file system, manage the attributes and permissions of these
65cpusets and which CPUs and Memory Nodes are assigned to each cpuset, 77cpusets and which CPUs and Memory Nodes are assigned to each cpuset,
diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt
index a2d5b4900772..74dffc68ff9f 100644
--- a/Documentation/crypto/api-intro.txt
+++ b/Documentation/crypto/api-intro.txt
@@ -223,6 +223,7 @@ CAST5 algorithm contributors:
223 223
224TEA/XTEA algorithm contributors: 224TEA/XTEA algorithm contributors:
225 Aaron Grothe 225 Aaron Grothe
226 Michael Ringe
226 227
227Khazad algorithm contributors: 228Khazad algorithm contributors:
228 Aaron Grothe 229 Aaron Grothe
diff --git a/Documentation/dcdbas.txt b/Documentation/dcdbas.txt
new file mode 100644
index 000000000000..e1c52e2dc361
--- /dev/null
+++ b/Documentation/dcdbas.txt
@@ -0,0 +1,91 @@
1Overview
2
3The Dell Systems Management Base Driver provides a sysfs interface for
4systems management software such as Dell OpenManage to perform system
5management interrupts and host control actions (system power cycle or
6power off after OS shutdown) on certain Dell systems.
7
8Dell OpenManage requires this driver on the following Dell PowerEdge systems:
9300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
10700, and 750. Other Dell software such as the open source libsmbios project
11is expected to make use of this driver, and it may include the use of this
12driver on other Dell systems.
13
14The Dell libsmbios project aims towards providing access to as much BIOS
15information as possible. See http://linux.dell.com/libsmbios/main/ for
16more information about the libsmbios project.
17
18
19System Management Interrupt
20
21On some Dell systems, systems management software must access certain
22management information via a system management interrupt (SMI). The SMI data
23buffer must reside in 32-bit address space, and the physical address of the
24buffer is required for the SMI. The driver maintains the memory required for
25the SMI and provides a way for the application to generate the SMI.
26The driver creates the following sysfs entries for systems management
27software to perform these system management interrupts:
28
29/sys/devices/platform/dcdbas/smi_data
30/sys/devices/platform/dcdbas/smi_data_buf_phys_addr
31/sys/devices/platform/dcdbas/smi_data_buf_size
32/sys/devices/platform/dcdbas/smi_request
33
34Systems management software must perform the following steps to execute
35a SMI using this driver:
36
371) Lock smi_data.
382) Write system management command to smi_data.
393) Write "1" to smi_request to generate a calling interface SMI or
40 "2" to generate a raw SMI.
414) Read system management command response from smi_data.
425) Unlock smi_data.
43
44
45Host Control Action
46
47Dell OpenManage supports a host control feature that allows the administrator
48to perform a power cycle or power off of the system after the OS has finished
49shutting down. On some Dell systems, this host control feature requires that
50a driver perform a SMI after the OS has finished shutting down.
51
52The driver creates the following sysfs entries for systems management software
53to schedule the driver to perform a power cycle or power off host control
54action after the system has finished shutting down:
55
56/sys/devices/platform/dcdbas/host_control_action
57/sys/devices/platform/dcdbas/host_control_smi_type
58/sys/devices/platform/dcdbas/host_control_on_shutdown
59
60Dell OpenManage performs the following steps to execute a power cycle or
61power off host control action using this driver:
62
631) Write host control action to be performed to host_control_action.
642) Write type of SMI that driver needs to perform to host_control_smi_type.
653) Write "1" to host_control_on_shutdown to enable host control action.
664) Initiate OS shutdown.
67 (Driver will perform host control SMI when it is notified that the OS
68 has finished shutting down.)
69
70
71Host Control SMI Type
72
73The following table shows the value to write to host_control_smi_type to
74perform a power cycle or power off host control action:
75
76PowerEdge System Host Control SMI Type
77---------------- ---------------------
78 300 HC_SMITYPE_TYPE1
79 1300 HC_SMITYPE_TYPE1
80 1400 HC_SMITYPE_TYPE2
81 500SC HC_SMITYPE_TYPE2
82 1500SC HC_SMITYPE_TYPE2
83 1550 HC_SMITYPE_TYPE2
84 600SC HC_SMITYPE_TYPE2
85 1600SC HC_SMITYPE_TYPE2
86 650 HC_SMITYPE_TYPE2
87 1655MC HC_SMITYPE_TYPE2
88 700 HC_SMITYPE_TYPE3
89 750 HC_SMITYPE_TYPE3
90
91
diff --git a/Documentation/dell_rbu.txt b/Documentation/dell_rbu.txt
new file mode 100644
index 000000000000..bcfa5c35036b
--- /dev/null
+++ b/Documentation/dell_rbu.txt
@@ -0,0 +1,74 @@
1Purpose:
2Demonstrate the usage of the new open sourced rbu (Remote BIOS Update) driver
3for updating BIOS images on Dell servers and desktops.
4
5Scope:
6This document discusses the functionality of the rbu driver only.
7It does not cover the support needed from aplications to enable the BIOS to
8update itself with the image downloaded in to the memory.
9
10Overview:
11This driver works with Dell OpenManage or Dell Update Packages for updating
12the BIOS on Dell servers (starting from servers sold since 1999), desktops
13and notebooks (starting from those sold in 2005).
14Please go to http://support.dell.com register and you can find info on
15OpenManage and Dell Update packages (DUP).
16
17Dell_RBU driver supports BIOS update using the monilothic image and packetized
18image methods. In case of moniolithic the driver allocates a contiguous chunk
19of physical pages having the BIOS image. In case of packetized the app
20using the driver breaks the image in to packets of fixed sizes and the driver
21would place each packet in contiguous physical memory. The driver also
22maintains a link list of packets for reading them back.
23If the dell_rbu driver is unloaded all the allocated memory is freed.
24
25The rbu driver needs to have an application which will inform the BIOS to
26enable the update in the next system reboot.
27
28The user should not unload the rbu driver after downloading the BIOS image
29or updating.
30
31The driver load creates the following directories under the /sys file system.
32/sys/class/firmware/dell_rbu/loading
33/sys/class/firmware/dell_rbu/data
34/sys/devices/platform/dell_rbu/image_type
35/sys/devices/platform/dell_rbu/data
36
37The driver supports two types of update mechanism; monolithic and packetized.
38These update mechanism depends upon the BIOS currently running on the system.
39Most of the Dell systems support a monolithic update where the BIOS image is
40copied to a single contiguous block of physical memory.
41In case of packet mechanism the single memory can be broken in smaller chuks
42of contiguous memory and the BIOS image is scattered in these packets.
43
44By default the driver uses monolithic memory for the update type. This can be
45changed to contiguous during the driver load time by specifying the load
46parameter image_type=packet. This can also be changed later as below
47echo packet > /sys/devices/platform/dell_rbu/image_type
48
49Do the steps below to download the BIOS image.
501) echo 1 > /sys/class/firmware/dell_rbu/loading
512) cp bios_image.hdr /sys/class/firmware/dell_rbu/data
523) echo 0 > /sys/class/firmware/dell_rbu/loading
53
54The /sys/class/firmware/dell_rbu/ entries will remain till the following is
55done.
56echo -1 > /sys/class/firmware/dell_rbu/loading
57
58Until this step is completed the drivr cannot be unloaded.
59
60Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to
61read back the image downloaded. This is useful in case of packet update
62mechanism where the above steps 1,2,3 will repeated for every packet.
63By reading the /sys/devices/platform/dell_rbu/data file all packet data
64downloaded can be verified in a single file.
65The packets are arranged in this file one after the other in a FIFO order.
66
67NOTE:
68This driver requires a patch for firmware_class.c which has the addition
69of request_firmware_nowait_nohotplug function to wortk
70Also after updating the BIOS image an user mdoe application neeeds to execute
71code which message the BIOS update request to the BIOS. So on the next reboot
72the BIOS knows about the new image downloaded and it updates it self.
73Also don't unload the rbu drive if the image has to be updated.
74
diff --git a/Documentation/dvb/bt8xx.txt b/Documentation/dvb/bt8xx.txt
index e6b8d05bc08d..4b8c326c6aac 100644
--- a/Documentation/dvb/bt8xx.txt
+++ b/Documentation/dvb/bt8xx.txt
@@ -16,7 +16,7 @@ Enable the following options:
16"Device drivers" => "Multimedia devices" 16"Device drivers" => "Multimedia devices"
17 => "Video For Linux" => "BT848 Video For Linux" 17 => "Video For Linux" => "BT848 Video For Linux"
18"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices" 18"Device drivers" => "Multimedia devices" => "Digital Video Broadcasting Devices"
19 => "DVB for Linux" "DVB Core Support" "Nebula/Pinnacle PCTV/TwinHan PCI Cards" 19 => "DVB for Linux" "DVB Core Support" "BT8xx based PCI cards"
20 20
213) Loading Modules, described by two approaches 213) Loading Modules, described by two approaches
22=============================================== 22===============================================
diff --git a/Documentation/exception.txt b/Documentation/exception.txt
index f1d436993eb1..3cb39ade290e 100644
--- a/Documentation/exception.txt
+++ b/Documentation/exception.txt
@@ -7,7 +7,7 @@ To protect itself the kernel has to verify this address.
7 7
8In older versions of Linux this was done with the 8In older versions of Linux this was done with the
9int verify_area(int type, const void * addr, unsigned long size) 9int verify_area(int type, const void * addr, unsigned long size)
10function. 10function (which has since been replaced by access_ok()).
11 11
12This function verified that the memory area starting at address 12This function verified that the memory area starting at address
13addr and of size size was accessible for the operation specified 13addr and of size size was accessible for the operation specified
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 0665cb12bd66..2e0a01b21fe0 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -51,14 +51,6 @@ Who: Adrian Bunk <bunk@stusta.de>
51 51
52--------------------------- 52---------------------------
53 53
54What: register_ioctl32_conversion() / unregister_ioctl32_conversion()
55When: April 2005
56Why: Replaced by ->compat_ioctl in file_operations and other method
57 vecors.
58Who: Andi Kleen <ak@muc.de>, Christoph Hellwig <hch@lst.de>
59
60---------------------------
61
62What: RCU API moves to EXPORT_SYMBOL_GPL 54What: RCU API moves to EXPORT_SYMBOL_GPL
63When: April 2006 55When: April 2006
64Files: include/linux/rcupdate.h, kernel/rcupdate.c 56Files: include/linux/rcupdate.h, kernel/rcupdate.c
@@ -74,14 +66,6 @@ Who: Paul E. McKenney <paulmck@us.ibm.com>
74 66
75--------------------------- 67---------------------------
76 68
77What: remove verify_area()
78When: July 2006
79Files: Various uaccess.h headers.
80Why: Deprecated and redundant. access_ok() should be used instead.
81Who: Jesper Juhl <juhl-lkml@dif.dk>
82
83---------------------------
84
85What: IEEE1394 Audio and Music Data Transmission Protocol driver, 69What: IEEE1394 Audio and Music Data Transmission Protocol driver,
86 Connection Management Procedures driver 70 Connection Management Procedures driver
87When: November 2005 71When: November 2005
@@ -102,16 +86,6 @@ Who: Jody McIntyre <scjody@steamballoon.com>
102 86
103--------------------------- 87---------------------------
104 88
105What: register_serial/unregister_serial
106When: September 2005
107Why: This interface does not allow serial ports to be registered against
108 a struct device, and as such does not allow correct power management
109 of such ports. 8250-based ports should use serial8250_register_port
110 and serial8250_unregister_port, or platform devices instead.
111Who: Russell King <rmk@arm.linux.org.uk>
112
113---------------------------
114
115What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid 89What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid
116When: November 2005 90When: November 2005
117Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c 91Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 6c98f2bd421e..5024ba7a592c 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -133,6 +133,7 @@ Table 1-1: Process specific entries in /proc
133 statm Process memory status information 133 statm Process memory status information
134 status Process status in human readable form 134 status Process status in human readable form
135 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan 135 wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan
136 smaps Extension based on maps, presenting the rss size for each mapped file
136.............................................................................. 137..............................................................................
137 138
138For example, to get the status information of a process, all you have to do is 139For example, to get the status information of a process, all you have to do is
diff --git a/Documentation/filesystems/relayfs.txt b/Documentation/filesystems/relayfs.txt
new file mode 100644
index 000000000000..d24e1b0d4f39
--- /dev/null
+++ b/Documentation/filesystems/relayfs.txt
@@ -0,0 +1,362 @@
1
2relayfs - a high-speed data relay filesystem
3============================================
4
5relayfs is a filesystem designed to provide an efficient mechanism for
6tools and facilities to relay large and potentially sustained streams
7of data from kernel space to user space.
8
9The main abstraction of relayfs is the 'channel'. A channel consists
10of a set of per-cpu kernel buffers each represented by a file in the
11relayfs filesystem. Kernel clients write into a channel using
12efficient write functions which automatically log to the current cpu's
13channel buffer. User space applications mmap() the per-cpu files and
14retrieve the data as it becomes available.
15
16The format of the data logged into the channel buffers is completely
17up to the relayfs client; relayfs does however provide hooks which
18allow clients to impose some stucture on the buffer data. Nor does
19relayfs implement any form of data filtering - this also is left to
20the client. The purpose is to keep relayfs as simple as possible.
21
22This document provides an overview of the relayfs API. The details of
23the function parameters are documented along with the functions in the
24filesystem code - please see that for details.
25
26Semantics
27=========
28
29Each relayfs channel has one buffer per CPU, each buffer has one or
30more sub-buffers. Messages are written to the first sub-buffer until
31it is too full to contain a new message, in which case it it is
32written to the next (if available). Messages are never split across
33sub-buffers. At this point, userspace can be notified so it empties
34the first sub-buffer, while the kernel continues writing to the next.
35
36When notified that a sub-buffer is full, the kernel knows how many
37bytes of it are padding i.e. unused. Userspace can use this knowledge
38to copy only valid data.
39
40After copying it, userspace can notify the kernel that a sub-buffer
41has been consumed.
42
43relayfs can operate in a mode where it will overwrite data not yet
44collected by userspace, and not wait for it to consume it.
45
46relayfs itself does not provide for communication of such data between
47userspace and kernel, allowing the kernel side to remain simple and not
48impose a single interface on userspace. It does provide a separate
49helper though, described below.
50
51klog, relay-app & librelay
52==========================
53
54relayfs itself is ready to use, but to make things easier, two
55additional systems are provided. klog is a simple wrapper to make
56writing formatted text or raw data to a channel simpler, regardless of
57whether a channel to write into exists or not, or whether relayfs is
58compiled into the kernel or is configured as a module. relay-app is
59the kernel counterpart of userspace librelay.c, combined these two
60files provide glue to easily stream data to disk, without having to
61bother with housekeeping. klog and relay-app can be used together,
62with klog providing high-level logging functions to the kernel and
63relay-app taking care of kernel-user control and disk-logging chores.
64
65It is possible to use relayfs without relay-app & librelay, but you'll
66have to implement communication between userspace and kernel, allowing
67both to convey the state of buffers (full, empty, amount of padding).
68
69klog, relay-app and librelay can be found in the relay-apps tarball on
70http://relayfs.sourceforge.net
71
72The relayfs user space API
73==========================
74
75relayfs implements basic file operations for user space access to
76relayfs channel buffer data. Here are the file operations that are
77available and some comments regarding their behavior:
78
79open() enables user to open an _existing_ buffer.
80
81mmap() results in channel buffer being mapped into the caller's
82 memory space. Note that you can't do a partial mmap - you must
83 map the entire file, which is NRBUF * SUBBUFSIZE.
84
85read() read the contents of a channel buffer. The bytes read are
86 'consumed' by the reader i.e. they won't be available again
87 to subsequent reads. If the channel is being used in
88 no-overwrite mode (the default), it can be read at any time
89 even if there's an active kernel writer. If the channel is
90 being used in overwrite mode and there are active channel
91 writers, results may be unpredictable - users should make
92 sure that all logging to the channel has ended before using
93 read() with overwrite mode.
94
95poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are
96 notified when sub-buffer boundaries are crossed.
97
98close() decrements the channel buffer's refcount. When the refcount
99 reaches 0 i.e. when no process or kernel client has the buffer
100 open, the channel buffer is freed.
101
102
103In order for a user application to make use of relayfs files, the
104relayfs filesystem must be mounted. For example,
105
106 mount -t relayfs relayfs /mnt/relay
107
108NOTE: relayfs doesn't need to be mounted for kernel clients to create
109 or use channels - it only needs to be mounted when user space
110 applications need access to the buffer data.
111
112
113The relayfs kernel API
114======================
115
116Here's a summary of the API relayfs provides to in-kernel clients:
117
118
119 channel management functions:
120
121 relay_open(base_filename, parent, subbuf_size, n_subbufs,
122 callbacks)
123 relay_close(chan)
124 relay_flush(chan)
125 relay_reset(chan)
126 relayfs_create_dir(name, parent)
127 relayfs_remove_dir(dentry)
128
129 channel management typically called on instigation of userspace:
130
131 relay_subbufs_consumed(chan, cpu, subbufs_consumed)
132
133 write functions:
134
135 relay_write(chan, data, length)
136 __relay_write(chan, data, length)
137 relay_reserve(chan, length)
138
139 callbacks:
140
141 subbuf_start(buf, subbuf, prev_subbuf, prev_padding)
142 buf_mapped(buf, filp)
143 buf_unmapped(buf, filp)
144
145 helper functions:
146
147 relay_buf_full(buf)
148 subbuf_start_reserve(buf, length)
149
150
151Creating a channel
152------------------
153
154relay_open() is used to create a channel, along with its per-cpu
155channel buffers. Each channel buffer will have an associated file
156created for it in the relayfs filesystem, which can be opened and
157mmapped from user space if desired. The files are named
158basename0...basenameN-1 where N is the number of online cpus, and by
159default will be created in the root of the filesystem. If you want a
160directory structure to contain your relayfs files, you can create it
161with relayfs_create_dir() and pass the parent directory to
162relay_open(). Clients are responsible for cleaning up any directory
163structure they create when the channel is closed - use
164relayfs_remove_dir() for that.
165
166The total size of each per-cpu buffer is calculated by multiplying the
167number of sub-buffers by the sub-buffer size passed into relay_open().
168The idea behind sub-buffers is that they're basically an extension of
169double-buffering to N buffers, and they also allow applications to
170easily implement random-access-on-buffer-boundary schemes, which can
171be important for some high-volume applications. The number and size
172of sub-buffers is completely dependent on the application and even for
173the same application, different conditions will warrant different
174values for these parameters at different times. Typically, the right
175values to use are best decided after some experimentation; in general,
176though, it's safe to assume that having only 1 sub-buffer is a bad
177idea - you're guaranteed to either overwrite data or lose events
178depending on the channel mode being used.
179
180Channel 'modes'
181---------------
182
183relayfs channels can be used in either of two modes - 'overwrite' or
184'no-overwrite'. The mode is entirely determined by the implementation
185of the subbuf_start() callback, as described below. In 'overwrite'
186mode, also known as 'flight recorder' mode, writes continuously cycle
187around the buffer and will never fail, but will unconditionally
188overwrite old data regardless of whether it's actually been consumed.
189In no-overwrite mode, writes will fail i.e. data will be lost, if the
190number of unconsumed sub-buffers equals the total number of
191sub-buffers in the channel. It should be clear that if there is no
192consumer or if the consumer can't consume sub-buffers fast enought,
193data will be lost in either case; the only difference is whether data
194is lost from the beginning or the end of a buffer.
195
196As explained above, a relayfs channel is made of up one or more
197per-cpu channel buffers, each implemented as a circular buffer
198subdivided into one or more sub-buffers. Messages are written into
199the current sub-buffer of the channel's current per-cpu buffer via the
200write functions described below. Whenever a message can't fit into
201the current sub-buffer, because there's no room left for it, the
202client is notified via the subbuf_start() callback that a switch to a
203new sub-buffer is about to occur. The client uses this callback to 1)
204initialize the next sub-buffer if appropriate 2) finalize the previous
205sub-buffer if appropriate and 3) return a boolean value indicating
206whether or not to actually go ahead with the sub-buffer switch.
207
208To implement 'no-overwrite' mode, the userspace client would provide
209an implementation of the subbuf_start() callback something like the
210following:
211
212static int subbuf_start(struct rchan_buf *buf,
213 void *subbuf,
214 void *prev_subbuf,
215 unsigned int prev_padding)
216{
217 if (prev_subbuf)
218 *((unsigned *)prev_subbuf) = prev_padding;
219
220 if (relay_buf_full(buf))
221 return 0;
222
223 subbuf_start_reserve(buf, sizeof(unsigned int));
224
225 return 1;
226}
227
228If the current buffer is full i.e. all sub-buffers remain unconsumed,
229the callback returns 0 to indicate that the buffer switch should not
230occur yet i.e. until the consumer has had a chance to read the current
231set of ready sub-buffers. For the relay_buf_full() function to make
232sense, the consumer is reponsible for notifying relayfs when
233sub-buffers have been consumed via relay_subbufs_consumed(). Any
234subsequent attempts to write into the buffer will again invoke the
235subbuf_start() callback with the same parameters; only when the
236consumer has consumed one or more of the ready sub-buffers will
237relay_buf_full() return 0, in which case the buffer switch can
238continue.
239
240The implementation of the subbuf_start() callback for 'overwrite' mode
241would be very similar:
242
243static int subbuf_start(struct rchan_buf *buf,
244 void *subbuf,
245 void *prev_subbuf,
246 unsigned int prev_padding)
247{
248 if (prev_subbuf)
249 *((unsigned *)prev_subbuf) = prev_padding;
250
251 subbuf_start_reserve(buf, sizeof(unsigned int));
252
253 return 1;
254}
255
256In this case, the relay_buf_full() check is meaningless and the
257callback always returns 1, causing the buffer switch to occur
258unconditionally. It's also meaningless for the client to use the
259relay_subbufs_consumed() function in this mode, as it's never
260consulted.
261
262The default subbuf_start() implementation, used if the client doesn't
263define any callbacks, or doesn't define the subbuf_start() callback,
264implements the simplest possible 'no-overwrite' mode i.e. it does
265nothing but return 0.
266
267Header information can be reserved at the beginning of each sub-buffer
268by calling the subbuf_start_reserve() helper function from within the
269subbuf_start() callback. This reserved area can be used to store
270whatever information the client wants. In the example above, room is
271reserved in each sub-buffer to store the padding count for that
272sub-buffer. This is filled in for the previous sub-buffer in the
273subbuf_start() implementation; the padding value for the previous
274sub-buffer is passed into the subbuf_start() callback along with a
275pointer to the previous sub-buffer, since the padding value isn't
276known until a sub-buffer is filled. The subbuf_start() callback is
277also called for the first sub-buffer when the channel is opened, to
278give the client a chance to reserve space in it. In this case the
279previous sub-buffer pointer passed into the callback will be NULL, so
280the client should check the value of the prev_subbuf pointer before
281writing into the previous sub-buffer.
282
283Writing to a channel
284--------------------
285
286kernel clients write data into the current cpu's channel buffer using
287relay_write() or __relay_write(). relay_write() is the main logging
288function - it uses local_irqsave() to protect the buffer and should be
289used if you might be logging from interrupt context. If you know
290you'll never be logging from interrupt context, you can use
291__relay_write(), which only disables preemption. These functions
292don't return a value, so you can't determine whether or not they
293failed - the assumption is that you wouldn't want to check a return
294value in the fast logging path anyway, and that they'll always succeed
295unless the buffer is full and no-overwrite mode is being used, in
296which case you can detect a failed write in the subbuf_start()
297callback by calling the relay_buf_full() helper function.
298
299relay_reserve() is used to reserve a slot in a channel buffer which
300can be written to later. This would typically be used in applications
301that need to write directly into a channel buffer without having to
302stage data in a temporary buffer beforehand. Because the actual write
303may not happen immediately after the slot is reserved, applications
304using relay_reserve() can keep a count of the number of bytes actually
305written, either in space reserved in the sub-buffers themselves or as
306a separate array. See the 'reserve' example in the relay-apps tarball
307at http://relayfs.sourceforge.net for an example of how this can be
308done. Because the write is under control of the client and is
309separated from the reserve, relay_reserve() doesn't protect the buffer
310at all - it's up to the client to provide the appropriate
311synchronization when using relay_reserve().
312
313Closing a channel
314-----------------
315
316The client calls relay_close() when it's finished using the channel.
317The channel and its associated buffers are destroyed when there are no
318longer any references to any of the channel buffers. relay_flush()
319forces a sub-buffer switch on all the channel buffers, and can be used
320to finalize and process the last sub-buffers before the channel is
321closed.
322
323Misc
324----
325
326Some applications may want to keep a channel around and re-use it
327rather than open and close a new channel for each use. relay_reset()
328can be used for this purpose - it resets a channel to its initial
329state without reallocating channel buffer memory or destroying
330existing mappings. It should however only be called when it's safe to
331do so i.e. when the channel isn't currently being written to.
332
333Finally, there are a couple of utility callbacks that can be used for
334different purposes. buf_mapped() is called whenever a channel buffer
335is mmapped from user space and buf_unmapped() is called when it's
336unmapped. The client can use this notification to trigger actions
337within the kernel application, such as enabling/disabling logging to
338the channel.
339
340
341Resources
342=========
343
344For news, example code, mailing list, etc. see the relayfs homepage:
345
346 http://relayfs.sourceforge.net
347
348
349Credits
350=======
351
352The ideas and specs for relayfs came about as a result of discussions
353on tracing involving the following:
354
355Michel Dagenais <michel.dagenais@polymtl.ca>
356Richard Moore <richardj_moore@uk.ibm.com>
357Bob Wisniewski <bob@watson.ibm.com>
358Karim Yaghmour <karim@opersys.com>
359Tom Zanussi <zanussi@us.ibm.com>
360
361Also thanks to Hubertus Franke for a lot of useful suggestions and bug
362reports.
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index dc276598a65a..c8bce82ddcac 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -90,7 +90,7 @@ void device_remove_file(struct device *, struct device_attribute *);
90 90
91It also defines this helper for defining device attributes: 91It also defines this helper for defining device attributes:
92 92
93#define DEVICE_ATTR(_name,_mode,_show,_store) \ 93#define DEVICE_ATTR(_name, _mode, _show, _store) \
94struct device_attribute dev_attr_##_name = { \ 94struct device_attribute dev_attr_##_name = { \
95 .attr = {.name = __stringify(_name) , .mode = _mode }, \ 95 .attr = {.name = __stringify(_name) , .mode = _mode }, \
96 .show = _show, \ 96 .show = _show, \
@@ -99,14 +99,14 @@ struct device_attribute dev_attr_##_name = { \
99 99
100For example, declaring 100For example, declaring
101 101
102static DEVICE_ATTR(foo,0644,show_foo,store_foo); 102static DEVICE_ATTR(foo, S_IWUSR | S_IRUGO, show_foo, store_foo);
103 103
104is equivalent to doing: 104is equivalent to doing:
105 105
106static struct device_attribute dev_attr_foo = { 106static struct device_attribute dev_attr_foo = {
107 .attr = { 107 .attr = {
108 .name = "foo", 108 .name = "foo",
109 .mode = 0644, 109 .mode = S_IWUSR | S_IRUGO,
110 }, 110 },
111 .show = show_foo, 111 .show = show_foo,
112 .store = store_foo, 112 .store = store_foo,
@@ -121,8 +121,8 @@ set of sysfs operations for forwarding read and write calls to the
121show and store methods of the attribute owners. 121show and store methods of the attribute owners.
122 122
123struct sysfs_ops { 123struct sysfs_ops {
124 ssize_t (*show)(struct kobject *, struct attribute *,char *); 124 ssize_t (*show)(struct kobject *, struct attribute *, char *);
125 ssize_t (*store)(struct kobject *,struct attribute *,const char *); 125 ssize_t (*store)(struct kobject *, struct attribute *, const char *);
126}; 126};
127 127
128[ Subsystems should have already defined a struct kobj_type as a 128[ Subsystems should have already defined a struct kobj_type as a
@@ -137,7 +137,7 @@ calls the associated methods.
137 137
138To illustrate: 138To illustrate:
139 139
140#define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr) 140#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
141#define to_dev(d) container_of(d, struct device, kobj) 141#define to_dev(d) container_of(d, struct device, kobj)
142 142
143static ssize_t 143static ssize_t
@@ -148,7 +148,7 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
148 ssize_t ret = 0; 148 ssize_t ret = 0;
149 149
150 if (dev_attr->show) 150 if (dev_attr->show)
151 ret = dev_attr->show(dev,buf); 151 ret = dev_attr->show(dev, buf);
152 return ret; 152 return ret;
153} 153}
154 154
@@ -216,16 +216,16 @@ A very simple (and naive) implementation of a device attribute is:
216 216
217static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) 217static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf)
218{ 218{
219 return sprintf(buf,"%s\n",dev->name); 219 return snprintf(buf, PAGE_SIZE, "%s\n", dev->name);
220} 220}
221 221
222static ssize_t store_name(struct device * dev, const char * buf) 222static ssize_t store_name(struct device * dev, const char * buf)
223{ 223{
224 sscanf(buf,"%20s",dev->name); 224 sscanf(buf, "%20s", dev->name);
225 return strlen(buf); 225 return strnlen(buf, PAGE_SIZE);
226} 226}
227 227
228static DEVICE_ATTR(name,S_IRUGO,show_name,store_name); 228static DEVICE_ATTR(name, S_IRUGO, show_name, store_name);
229 229
230 230
231(Note that the real implementation doesn't allow userspace to set the 231(Note that the real implementation doesn't allow userspace to set the
@@ -290,7 +290,7 @@ struct device_attribute {
290 290
291Declaring: 291Declaring:
292 292
293DEVICE_ATTR(_name,_str,_mode,_show,_store); 293DEVICE_ATTR(_name, _str, _mode, _show, _store);
294 294
295Creation/Removal: 295Creation/Removal:
296 296
@@ -310,7 +310,7 @@ struct bus_attribute {
310 310
311Declaring: 311Declaring:
312 312
313BUS_ATTR(_name,_mode,_show,_store) 313BUS_ATTR(_name, _mode, _show, _store)
314 314
315Creation/Removal: 315Creation/Removal:
316 316
@@ -331,7 +331,7 @@ struct driver_attribute {
331 331
332Declaring: 332Declaring:
333 333
334DRIVER_ATTR(_name,_mode,_show,_store) 334DRIVER_ATTR(_name, _mode, _show, _store)
335 335
336Creation/Removal: 336Creation/Removal:
337 337
diff --git a/Documentation/hwmon/lm78 b/Documentation/hwmon/lm78
index 357086ed7f64..fd5dc7a19f0e 100644
--- a/Documentation/hwmon/lm78
+++ b/Documentation/hwmon/lm78
@@ -2,16 +2,11 @@ Kernel driver lm78
2================== 2==================
3 3
4Supported chips: 4Supported chips:
5 * National Semiconductor LM78 5 * National Semiconductor LM78 / LM78-J
6 Prefix: 'lm78' 6 Prefix: 'lm78'
7 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) 7 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
8 Datasheet: Publicly available at the National Semiconductor website 8 Datasheet: Publicly available at the National Semiconductor website
9 http://www.national.com/ 9 http://www.national.com/
10 * National Semiconductor LM78-J
11 Prefix: 'lm78-j'
12 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
13 Datasheet: Publicly available at the National Semiconductor website
14 http://www.national.com/
15 * National Semiconductor LM79 10 * National Semiconductor LM79
16 Prefix: 'lm79' 11 Prefix: 'lm79'
17 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports) 12 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
diff --git a/Documentation/hwmon/w83792d b/Documentation/hwmon/w83792d
new file mode 100644
index 000000000000..8171c285bb55
--- /dev/null
+++ b/Documentation/hwmon/w83792d
@@ -0,0 +1,174 @@
1Kernel driver w83792d
2=====================
3
4Supported chips:
5 * Winbond W83792D
6 Prefix: 'w83792d'
7 Addresses scanned: I2C 0x2c - 0x2f
8 Datasheet: http://www.winbond.com.tw/E-WINBONDHTM/partner/PDFresult.asp?Pname=1035
9
10Author: Chunhao Huang
11Contact: DZShen <DZShen@Winbond.com.tw>
12
13
14Module Parameters
15-----------------
16
17* init int
18 (default 1)
19 Use 'init=0' to bypass initializing the chip.
20 Try this if your computer crashes when you load the module.
21
22* force_subclients=bus,caddr,saddr,saddr
23 This is used to force the i2c addresses for subclients of
24 a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b'
25 to force the subclients of chip 0x2f on bus 0 to i2c addresses
26 0x4a and 0x4b.
27
28
29Description
30-----------
31
32This driver implements support for the Winbond W83792AD/D.
33
34Detection of the chip can sometimes be foiled because it can be in an
35internal state that allows no clean access (Bank with ID register is not
36currently selected). If you know the address of the chip, use a 'force'
37parameter; this will put it into a more well-behaved state first.
38
39The driver implements three temperature sensors, seven fan rotation speed
40sensors, nine voltage sensors, and two automatic fan regulation
41strategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II.
42Automatic fan control mode is possible only for fan1-fan3. Fan4-fan7 can run
43synchronized with selected fan (fan1-fan3). This functionality and manual PWM
44control for fan4-fan7 is not yet implemented.
45
46Temperatures are measured in degrees Celsius and measurement resolution is 1
47degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
48the temperature gets higher than the Overtemperature Shutdown value; it stays
49on until the temperature falls below the Hysteresis value.
50
51Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
52triggered if the rotation speed has dropped below a programmable limit. Fan
53readings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
54128) to give the readings more range or accuracy.
55
56Voltage sensors (also known as IN sensors) report their values in millivolts.
57An alarm is triggered if the voltage has crossed a programmable minimum
58or maximum limit.
59
60Alarms are provided as output from "realtime status register". Following bits
61are defined:
62
63bit - alarm on:
640 - in0
651 - in1
662 - temp1
673 - temp2
684 - temp3
695 - fan1
706 - fan2
717 - fan3
728 - in2
739 - in3
7410 - in4
7511 - in5
7612 - in6
7713 - VID change
7814 - chassis
7915 - fan7
8016 - tart1
8117 - tart2
8218 - tart3
8319 - in7
8420 - in8
8521 - fan4
8622 - fan5
8723 - fan6
88
89Tart will be asserted while target temperature cannot be achieved after 3 minutes
90of full speed rotation of corresponding fan.
91
92In addition to the alarms described above, there is a CHAS alarm on the chips
93which triggers if your computer case is open (This one is latched, contrary
94to realtime alarms).
95
96The chips only update values each 3 seconds; reading them more often will
97do no harm, but will return 'old' values.
98
99
100W83792D PROBLEMS
101----------------
102Known problems:
103 - This driver is only for Winbond W83792D C version device, there
104 are also some motherboards with B version W83792D device. The
105 calculation method to in6-in7(measured value, limits) is a little
106 different between C and B version. C or B version can be identified
107 by CR[0x49h].
108 - The function of vid and vrm has not been finished, because I'm NOT
109 very familiar with them. Adding support is welcome.
110  - The function of chassis open detection needs more tests.
111 - If you have ASUS server board and chip was not found: Then you will
112 need to upgrade to latest (or beta) BIOS. If it does not help please
113 contact us.
114
115Fan control
116-----------
117
118Manual mode
119-----------
120
121Works as expected. You just need to specify desired PWM/DC value (fan speed)
122in appropriate pwm# file.
123
124Thermal cruise
125--------------
126
127In this mode, W83792D provides the Smart Fan system to automatically control
128fan speed to keep the temperatures of CPU and the system within specific
129range. At first a wanted temperature and interval must be set. This is done
130via thermal_cruise# file. The tolerance# file serves to create T +- tolerance
131interval. The fan speed will be lowered as long as the current temperature
132remains below the thermal_cruise# +- tolerance# value. Once the temperature
133exceeds the high limit (T+tolerance), the fan will be turned on with a
134specific speed set by pwm# and automatically controlled its PWM duty cycle
135with the temperature varying. Three conditions may occur:
136
137(1) If the temperature still exceeds the high limit, PWM duty
138cycle will increase slowly.
139
140(2) If the temperature goes below the high limit, but still above the low
141limit (T-tolerance), the fan speed will be fixed at the current speed because
142the temperature is in the target range.
143
144(3) If the temperature goes below the low limit, PWM duty cycle will decrease
145slowly to 0 or a preset stop value until the temperature exceeds the low
146limit. (The preset stop value handling is not yet implemented in driver)
147
148Smart Fan II
149------------
150
151W83792D also provides a special mode for fan. Four temperature points are
152available. When related temperature sensors detects the temperature in preset
153temperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run
154on programmed value from sf2_level@_fan#. You need to set four temperatures
155for each fan.
156
157
158/sys files
159----------
160
161pwm[1-3] - this file stores PWM duty cycle or DC value (fan speed) in range:
162 0 (stop) to 255 (full)
163pwm[1-3]_enable - this file controls mode of fan/temperature control:
164 * 0 Disabled
165 * 1 Manual mode
166 * 2 Smart Fan II
167 * 3 Thermal Cruise
168pwm[1-3]_mode - Select PWM of DC mode
169 * 0 DC
170 * 1 PWM
171thermal_cruise[1-3] - Selects the desired temperature for cruise (degC)
172tolerance[1-3] - Value in degrees of Celsius (degC) for +- T
173sf2_point[1-4]_fan[1-3] - four temperature points for each fan for Smart Fan II
174sf2_level[1-3]_fan[1-3] - three PWM/DC levels for each fan for Smart Fan II
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
index b02002898a09..96fec562a8e9 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -4,22 +4,13 @@ Kernel driver max6875
4Supported chips: 4Supported chips:
5 * Maxim MAX6874, MAX6875 5 * Maxim MAX6874, MAX6875
6 Prefix: 'max6875' 6 Prefix: 'max6875'
7 Addresses scanned: 0x50, 0x52 7 Addresses scanned: None (see below)
8 Datasheet: 8 Datasheet:
9 http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf 9 http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf
10 10
11Author: Ben Gardner <bgardner@wabtec.com> 11Author: Ben Gardner <bgardner@wabtec.com>
12 12
13 13
14Module Parameters
15-----------------
16
17* allow_write int
18 Set to non-zero to enable write permission:
19 *0: Read only
20 1: Read and write
21
22
23Description 14Description
24----------- 15-----------
25 16
@@ -33,34 +24,85 @@ registers.
33 24
34The Maxim MAX6874 is a similar, mostly compatible device, with more intputs 25The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
35and outputs: 26and outputs:
36
37 vin gpi vout 27 vin gpi vout
38MAX6874 6 4 8 28MAX6874 6 4 8
39MAX6875 4 3 5 29MAX6875 4 3 5
40 30
41MAX6874 chips can have four different addresses (as opposed to only two for 31See the datasheet for more information.
42the MAX6875). The additional addresses (0x54 and 0x56) are not probed by
43this driver by default, but the probe module parameter can be used if
44needed.
45
46See the datasheet for details on how to program the EEPROM.
47 32
48 33
49Sysfs entries 34Sysfs entries
50------------- 35-------------
51 36
52eeprom_user - 512 bytes of user-defined EEPROM space. Only writable if 37eeprom - 512 bytes of user-defined EEPROM space.
53 allow_write was set and register 0x43 is 0.
54
55eeprom_config - 70 bytes of config EEPROM. Note that changes will not get
56 loaded into register space until a power cycle or device reset.
57
58reg_config - 70 bytes of register space. Any changes take affect immediately.
59 38
60 39
61General Remarks 40General Remarks
62--------------- 41---------------
63 42
64A typical application will require that the EEPROMs be programmed once and 43Valid addresses for the MAX6875 are 0x50 and 0x52.
65never altered afterwards. 44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
45The driver does not probe any address, so you must force the address.
46
47Example:
48$ modprobe max6875 force=0,0x50
49
50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51addresses. For example, for address 0x50, it also reserves 0x51.
52The even-address instance is called 'max6875', the odd one is 'max6875 subclient'.
53
54
55Programming the chip using i2c-dev
56----------------------------------
57
58Use the i2c-dev interface to access and program the chips.
59Reads and writes are performed differently depending on the address range.
60
61The configuration registers are at addresses 0x00 - 0x45.
62Use i2c_smbus_write_byte_data() to write a register and
63i2c_smbus_read_byte_data() to read a register.
64The command is the register number.
65
66Examples:
67To write a 1 to register 0x45:
68 i2c_smbus_write_byte_data(fd, 0x45, 1);
69
70To read register 0x45:
71 value = i2c_smbus_read_byte_data(fd, 0x45);
72
73
74The configuration EEPROM is at addresses 0x8000 - 0x8045.
75The user EEPROM is at addresses 0x8100 - 0x82ff.
76
77Use i2c_smbus_write_word_data() to write a byte to EEPROM.
78
79The command is the upper byte of the address: 0x80, 0x81, or 0x82.
80The data word is the lower part of the address or'd with data << 8.
81 cmd = address >> 8;
82 val = (address & 0xff) | (data << 8);
83
84Example:
85To write 0x5a to address 0x8003:
86 i2c_smbus_write_word_data(fd, 0x80, 0x5a03);
87
88
89Reading data from the EEPROM is a little more complicated.
90Use i2c_smbus_write_byte_data() to set the read address and then
91i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data.
92
93Example:
94To read data starting at offset 0x8100, first set the address:
95 i2c_smbus_write_byte_data(fd, 0x81, 0x00);
96
97And then read the data
98 value = i2c_smbus_read_byte(fd);
99
100 or
101
102 count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);
103
104The block read should read 16 bytes.
1050x84 is the block read command.
106
107See the datasheet for more details.
66 108
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality
index 8a78a95ae04e..41ffefbdc60c 100644
--- a/Documentation/i2c/functionality
+++ b/Documentation/i2c/functionality
@@ -115,7 +115,7 @@ CHECKING THROUGH /DEV
115If you try to access an adapter from a userspace program, you will have 115If you try to access an adapter from a userspace program, you will have
116to use the /dev interface. You will still have to check whether the 116to use the /dev interface. You will still have to check whether the
117functionality you need is supported, of course. This is done using 117functionality you need is supported, of course. This is done using
118the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2c_detect 118the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect
119program, is below: 119program, is below:
120 120
121 int file; 121 int file;
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients
index a7adbdd9ea8a..4849dfd6961c 100644
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -1,4 +1,4 @@
1Revision 4, 2004-03-30 1Revision 5, 2005-07-29
2Jean Delvare <khali@linux-fr.org> 2Jean Delvare <khali@linux-fr.org>
3Greg KH <greg@kroah.com> 3Greg KH <greg@kroah.com>
4 4
@@ -17,20 +17,22 @@ yours for best results.
17 17
18Technical changes: 18Technical changes:
19 19
20* [Includes] Get rid of "version.h". Replace <linux/i2c-proc.h> with 20* [Includes] Get rid of "version.h" and <linux/i2c-proc.h>.
21 <linux/i2c-sensor.h>. Includes typically look like that: 21 Includes typically look like that:
22 #include <linux/module.h> 22 #include <linux/module.h>
23 #include <linux/init.h> 23 #include <linux/init.h>
24 #include <linux/slab.h> 24 #include <linux/slab.h>
25 #include <linux/i2c.h> 25 #include <linux/i2c.h>
26 #include <linux/i2c-sensor.h> 26 #include <linux/hwmon.h> /* for hardware monitoring drivers */
27 #include <linux/i2c-vid.h> /* if you need VRM support */ 27 #include <linux/hwmon-sysfs.h>
28 #include <linux/hwmon-vid.h> /* if you need VRM support */
28 #include <asm/io.h> /* if you have I/O operations */ 29 #include <asm/io.h> /* if you have I/O operations */
29 Please respect this inclusion order. Some extra headers may be 30 Please respect this inclusion order. Some extra headers may be
30 required for a given driver (e.g. "lm75.h"). 31 required for a given driver (e.g. "lm75.h").
31 32
32* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, SENSORS_ISA_END 33* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses
33 becomes I2C_CLIENT_ISA_END. 34 are no more handled by the i2c core.
35 SENSORS_INSMOD_<n> becomes I2C_CLIENT_INSMOD_<n>.
34 36
35* [Client data] Get rid of sysctl_id. Try using standard names for 37* [Client data] Get rid of sysctl_id. Try using standard names for
36 register values (for example, temp_os becomes temp_max). You're 38 register values (for example, temp_os becomes temp_max). You're
@@ -66,13 +68,15 @@ Technical changes:
66 if (!(adapter->class & I2C_CLASS_HWMON)) 68 if (!(adapter->class & I2C_CLASS_HWMON))
67 return 0; 69 return 0;
68 ISA-only drivers of course don't need this. 70 ISA-only drivers of course don't need this.
71 Call i2c_probe() instead of i2c_detect().
69 72
70* [Detect] As mentioned earlier, the flags parameter is gone. 73* [Detect] As mentioned earlier, the flags parameter is gone.
71 The type_name and client_name strings are replaced by a single 74 The type_name and client_name strings are replaced by a single
72 name string, which will be filled with a lowercase, short string 75 name string, which will be filled with a lowercase, short string
73 (typically the driver name, e.g. "lm75"). 76 (typically the driver name, e.g. "lm75").
74 In i2c-only drivers, drop the i2c_is_isa_adapter check, it's 77 In i2c-only drivers, drop the i2c_is_isa_adapter check, it's
75 useless. 78 useless. Same for isa-only drivers, as the test would always be
79 true. Only hybrid drivers (which are quite rare) still need it.
76 The errorN labels are reduced to the number needed. If that number 80 The errorN labels are reduced to the number needed. If that number
77 is 2 (i2c-only drivers), it is advised that the labels are named 81 is 2 (i2c-only drivers), it is advised that the labels are named
78 exit and exit_free. For i2c+isa drivers, labels should be named 82 exit and exit_free. For i2c+isa drivers, labels should be named
@@ -86,6 +90,8 @@ Technical changes:
86 device_create_file. Move the driver initialization before any 90 device_create_file. Move the driver initialization before any
87 sysfs file creation. 91 sysfs file creation.
88 Drop client->id. 92 Drop client->id.
93 Drop any 24RF08 corruption prevention you find, as this is now done
94 at the i2c-core level, and doing it twice voids it.
89 95
90* [Init] Limits must not be set by the driver (can be done later in 96* [Init] Limits must not be set by the driver (can be done later in
91 user-space). Chip should not be reset default (although a module 97 user-space). Chip should not be reset default (although a module
@@ -93,7 +99,8 @@ Technical changes:
93 limited to the strictly necessary steps. 99 limited to the strictly necessary steps.
94 100
95* [Detach] Get rid of data, remove the call to 101* [Detach] Get rid of data, remove the call to
96 i2c_deregister_entry. 102 i2c_deregister_entry. Do not log an error message if
103 i2c_detach_client fails, as i2c-core will now do it for you.
97 104
98* [Update] Don't access client->data directly, use 105* [Update] Don't access client->data directly, use
99 i2c_get_clientdata(client) instead. 106 i2c_get_clientdata(client) instead.
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 91664be91ffc..077275722a7c 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -148,15 +148,15 @@ are defined in i2c.h to help you support them, as well as a generic
148detection algorithm. 148detection algorithm.
149 149
150You do not have to use this parameter interface; but don't try to use 150You do not have to use this parameter interface; but don't try to use
151function i2c_probe() (or i2c_detect()) if you don't. 151function i2c_probe() if you don't.
152 152
153NOTE: If you want to write a `sensors' driver, the interface is slightly 153NOTE: If you want to write a `sensors' driver, the interface is slightly
154 different! See below. 154 different! See below.
155 155
156 156
157 157
158Probing classes (i2c) 158Probing classes
159--------------------- 159---------------
160 160
161All parameters are given as lists of unsigned 16-bit integers. Lists are 161All parameters are given as lists of unsigned 16-bit integers. Lists are
162terminated by I2C_CLIENT_END. 162terminated by I2C_CLIENT_END.
@@ -171,12 +171,18 @@ The following lists are used internally:
171 ignore: insmod parameter. 171 ignore: insmod parameter.
172 A list of pairs. The first value is a bus number (-1 for any I2C bus), 172 A list of pairs. The first value is a bus number (-1 for any I2C bus),
173 the second is the I2C address. These addresses are never probed. 173 the second is the I2C address. These addresses are never probed.
174 This parameter overrules 'normal' and 'probe', but not the 'force' lists. 174 This parameter overrules the 'normal_i2c' list only.
175 force: insmod parameter. 175 force: insmod parameter.
176 A list of pairs. The first value is a bus number (-1 for any I2C bus), 176 A list of pairs. The first value is a bus number (-1 for any I2C bus),
177 the second is the I2C address. A device is blindly assumed to be on 177 the second is the I2C address. A device is blindly assumed to be on
178 the given address, no probing is done. 178 the given address, no probing is done.
179 179
180Additionally, kind-specific force lists may optionally be defined if
181the driver supports several chip kinds. They are grouped in a
182NULL-terminated list of pointers named forces, those first element if the
183generic force list mentioned above. Each additional list correspond to an
184insmod parameter of the form force_<kind>.
185
180Fortunately, as a module writer, you just have to define the `normal_i2c' 186Fortunately, as a module writer, you just have to define the `normal_i2c'
181parameter. The complete declaration could look like this: 187parameter. The complete declaration could look like this:
182 188
@@ -186,66 +192,17 @@ parameter. The complete declaration could look like this:
186 192
187 /* Magic definition of all other variables and things */ 193 /* Magic definition of all other variables and things */
188 I2C_CLIENT_INSMOD; 194 I2C_CLIENT_INSMOD;
195 /* Or, if your driver supports, say, 2 kind of devices: */
196 I2C_CLIENT_INSMOD_2(foo, bar);
197
198If you use the multi-kind form, an enum will be defined for you:
199 enum chips { any_chip, foo, bar, ... }
200You can then (and certainly should) use it in the driver code.
189 201
190Note that you *have* to call the defined variable `normal_i2c', 202Note that you *have* to call the defined variable `normal_i2c',
191without any prefix! 203without any prefix!
192 204
193 205
194Probing classes (sensors)
195-------------------------
196
197If you write a `sensors' driver, you use a slightly different interface.
198As well as I2C addresses, we have to cope with ISA addresses. Also, we
199use a enum of chip types. Don't forget to include `sensors.h'.
200
201The following lists are used internally. They are all lists of integers.
202
203 normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.
204 A list of I2C addresses which should normally be examined.
205 normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
206 A list of ISA addresses which should normally be examined.
207 probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.
208 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
209 the ISA bus, -1 for any I2C bus), the second is the address. These
210 addresses are also probed, as if they were in the 'normal' list.
211 ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.
212 A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
213 the ISA bus, -1 for any I2C bus), the second is the I2C address. These
214 addresses are never probed. This parameter overrules 'normal' and
215 'probe', but not the 'force' lists.
216
217Also used is a list of pointers to sensors_force_data structures:
218 force_data: insmod parameters. A list, ending with an element of which
219 the force field is NULL.
220 Each element contains the type of chip and a list of pairs.
221 The first value is a bus number (SENSORS_ISA_BUS for the ISA bus,
222 -1 for any I2C bus), the second is the address.
223 These are automatically translated to insmod variables of the form
224 force_foo.
225
226So we have a generic insmod variabled `force', and chip-specific variables
227`force_CHIPNAME'.
228
229Fortunately, as a module writer, you just have to define the `normal_i2c'
230and `normal_isa' parameters, and define what chip names are used.
231The complete declaration could look like this:
232 /* Scan i2c addresses 0x37, and 0x48 to 0x4f */
233 static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
234 0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
235 /* Scan ISA address 0x290 */
236 static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END};
237
238 /* Define chips foo and bar, as well as all module parameters and things */
239 SENSORS_INSMOD_2(foo,bar);
240
241If you have one chip, you use macro SENSORS_INSMOD_1(chip), if you have 2
242you use macro SENSORS_INSMOD_2(chip1,chip2), etc. If you do not want to
243bother with chip types, you can use SENSORS_INSMOD_0.
244
245A enum is automatically defined as follows:
246 enum chips { any_chip, chip1, chip2, ... }
247
248
249Attaching to an adapter 206Attaching to an adapter
250----------------------- 207-----------------------
251 208
@@ -264,17 +221,10 @@ detected at a specific address, another callback is called.
264 return i2c_probe(adapter,&addr_data,&foo_detect_client); 221 return i2c_probe(adapter,&addr_data,&foo_detect_client);
265 } 222 }
266 223
267For `sensors' drivers, use the i2c_detect function instead:
268
269 int foo_attach_adapter(struct i2c_adapter *adapter)
270 {
271 return i2c_detect(adapter,&addr_data,&foo_detect_client);
272 }
273
274Remember, structure `addr_data' is defined by the macros explained above, 224Remember, structure `addr_data' is defined by the macros explained above,
275so you do not have to define it yourself. 225so you do not have to define it yourself.
276 226
277The i2c_probe or i2c_detect function will call the foo_detect_client 227The i2c_probe function will call the foo_detect_client
278function only for those i2c addresses that actually have a device on 228function only for those i2c addresses that actually have a device on
279them (unless a `force' parameter was used). In addition, addresses that 229them (unless a `force' parameter was used). In addition, addresses that
280are already in use (by some other registered client) are skipped. 230are already in use (by some other registered client) are skipped.
@@ -283,19 +233,18 @@ are already in use (by some other registered client) are skipped.
283The detect client function 233The detect client function
284-------------------------- 234--------------------------
285 235
286The detect client function is called by i2c_probe or i2c_detect. 236The detect client function is called by i2c_probe. The `kind' parameter
287The `kind' parameter contains 0 if this call is due to a `force' 237contains -1 for a probed detection, 0 for a forced detection, or a positive
288parameter, and -1 otherwise (for i2c_detect, it contains 0 if 238number for a forced detection with a chip type forced.
289this call is due to the generic `force' parameter, and the chip type
290number if it is due to a specific `force' parameter).
291 239
292Below, some things are only needed if this is a `sensors' driver. Those 240Below, some things are only needed if this is a `sensors' driver. Those
293parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ 241parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */
294markers. 242markers.
295 243
296This function should only return an error (any value != 0) if there is 244Returning an error different from -ENODEV in a detect function will cause
297some reason why no more detection should be done anymore. If the 245the detection to stop: other addresses and adapters won't be scanned.
298detection just fails for this address, return 0. 246This should only be done on fatal or internal errors, such as a memory
247shortage or i2c_attach_client failing.
299 248
300For now, you can ignore the `flags' parameter. It is there for future use. 249For now, you can ignore the `flags' parameter. It is there for future use.
301 250
@@ -320,11 +269,10 @@ For now, you can ignore the `flags' parameter. It is there for future use.
320 const char *type_name = ""; 269 const char *type_name = "";
321 int is_isa = i2c_is_isa_adapter(adapter); 270 int is_isa = i2c_is_isa_adapter(adapter);
322 271
323 if (is_isa) { 272 /* Do this only if the chip can additionally be found on the ISA bus
273 (hybrid chip). */
324 274
325 /* If this client can't be on the ISA bus at all, we can stop now 275 if (is_isa) {
326 (call `goto ERROR0'). But for kicks, we will assume it is all
327 right. */
328 276
329 /* Discard immediately if this ISA range is already used */ 277 /* Discard immediately if this ISA range is already used */
330 if (check_region(address,FOO_EXTENT)) 278 if (check_region(address,FOO_EXTENT))
@@ -495,15 +443,13 @@ much simpler than the attachment code, fortunately!
495 /* SENSORS ONLY END */ 443 /* SENSORS ONLY END */
496 444
497 /* Try to detach the client from i2c space */ 445 /* Try to detach the client from i2c space */
498 if ((err = i2c_detach_client(client))) { 446 if ((err = i2c_detach_client(client)))
499 printk("foo.o: Client deregistration failed, client not detached.\n");
500 return err; 447 return err;
501 }
502 448
503 /* SENSORS ONLY START */ 449 /* HYBRID SENSORS CHIP ONLY START */
504 if i2c_is_isa_client(client) 450 if i2c_is_isa_client(client)
505 release_region(client->addr,LM78_EXTENT); 451 release_region(client->addr,LM78_EXTENT);
506 /* SENSORS ONLY END */ 452 /* HYBRID SENSORS CHIP ONLY END */
507 453
508 kfree(client); /* Frees client data too, if allocated at the same time */ 454 kfree(client); /* Frees client data too, if allocated at the same time */
509 return 0; 455 return 0;
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index 1c48f0eba6fb..10312bebe55d 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -2,7 +2,7 @@
2 ---------------------------- 2 ----------------------------
3 3
4 H. Peter Anvin <hpa@zytor.com> 4 H. Peter Anvin <hpa@zytor.com>
5 Last update 2002-01-01 5 Last update 2005-09-02
6 6
7On the i386 platform, the Linux kernel uses a rather complicated boot 7On the i386 platform, the Linux kernel uses a rather complicated boot
8convention. This has evolved partially due to historical aspects, as 8convention. This has evolved partially due to historical aspects, as
@@ -34,6 +34,8 @@ Protocol 2.02: (Kernel 2.4.0-test3-pre3) New command line protocol.
34Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible 34Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible
35 initrd address available to the bootloader. 35 initrd address available to the bootloader.
36 36
37Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes.
38
37 39
38**** MEMORY LAYOUT 40**** MEMORY LAYOUT
39 41
@@ -103,10 +105,9 @@ The header looks like:
103Offset Proto Name Meaning 105Offset Proto Name Meaning
104/Size 106/Size
105 107
10601F1/1 ALL setup_sects The size of the setup in sectors 10801F1/1 ALL(1 setup_sects The size of the setup in sectors
10701F2/2 ALL root_flags If set, the root is mounted readonly 10901F2/2 ALL root_flags If set, the root is mounted readonly
10801F4/2 ALL syssize DO NOT USE - for bootsect.S use only 11001F4/4 2.04+(2 syssize The size of the 32-bit code in 16-byte paras
10901F6/2 ALL swap_dev DO NOT USE - obsolete
11001F8/2 ALL ram_size DO NOT USE - for bootsect.S use only 11101F8/2 ALL ram_size DO NOT USE - for bootsect.S use only
11101FA/2 ALL vid_mode Video mode control 11201FA/2 ALL vid_mode Video mode control
11201FC/2 ALL root_dev Default root device number 11301FC/2 ALL root_dev Default root device number
@@ -129,8 +130,12 @@ Offset Proto Name Meaning
1290228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line 1300228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line
130022C/4 2.03+ initrd_addr_max Highest legal initrd address 131022C/4 2.03+ initrd_addr_max Highest legal initrd address
131 132
132For backwards compatibility, if the setup_sects field contains 0, the 133(1) For backwards compatibility, if the setup_sects field contains 0, the
133real value is 4. 134 real value is 4.
135
136(2) For boot protocol prior to 2.04, the upper two bytes of the syssize
137 field are unusable, which means the size of a bzImage kernel
138 cannot be determined.
134 139
135If the "HdrS" (0x53726448) magic number is not found at offset 0x202, 140If the "HdrS" (0x53726448) magic number is not found at offset 0x202,
136the boot protocol version is "old". Loading an old kernel, the 141the boot protocol version is "old". Loading an old kernel, the
@@ -230,12 +235,16 @@ loader to communicate with the kernel. Some of its options are also
230relevant to the boot loader itself, see "special command line options" 235relevant to the boot loader itself, see "special command line options"
231below. 236below.
232 237
233The kernel command line is a null-terminated string up to 255 238The kernel command line is a null-terminated string currently up to
234characters long, plus the final null. 239255 characters long, plus the final null. A string that is too long
240will be automatically truncated by the kernel, a boot loader may allow
241a longer command line to be passed to permit future kernels to extend
242this limit.
235 243
236If the boot protocol version is 2.02 or later, the address of the 244If the boot protocol version is 2.02 or later, the address of the
237kernel command line is given by the header field cmd_line_ptr (see 245kernel command line is given by the header field cmd_line_ptr (see
238above.) 246above.) This address can be anywhere between the end of the setup
247heap and 0xA0000.
239 248
240If the protocol version is *not* 2.02 or higher, the kernel 249If the protocol version is *not* 2.02 or higher, the kernel
241command line is entered using the following protocol: 250command line is entered using the following protocol:
@@ -255,7 +264,7 @@ command line is entered using the following protocol:
255**** SAMPLE BOOT CONFIGURATION 264**** SAMPLE BOOT CONFIGURATION
256 265
257As a sample configuration, assume the following layout of the real 266As a sample configuration, assume the following layout of the real
258mode segment: 267mode segment (this is a typical, and recommended layout):
259 268
260 0x0000-0x7FFF Real mode kernel 269 0x0000-0x7FFF Real mode kernel
261 0x8000-0x8FFF Stack and heap 270 0x8000-0x8FFF Stack and heap
@@ -312,9 +321,9 @@ Such a boot loader should enter the following fields in the header:
312 321
313**** LOADING THE REST OF THE KERNEL 322**** LOADING THE REST OF THE KERNEL
314 323
315The non-real-mode kernel starts at offset (setup_sects+1)*512 in the 324The 32-bit (non-real-mode) kernel starts at offset (setup_sects+1)*512
316kernel file (again, if setup_sects == 0 the real value is 4.) It 325in the kernel file (again, if setup_sects == 0 the real value is 4.)
317should be loaded at address 0x10000 for Image/zImage kernels and 326It should be loaded at address 0x10000 for Image/zImage kernels and
3180x100000 for bzImage kernels. 3270x100000 for bzImage kernels.
319 328
320The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 329The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 2616a58a5a4b..9a1586590d82 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -872,7 +872,13 @@ When kbuild executes the following steps are followed (roughly):
872 Assignments to $(targets) are without $(obj)/ prefix. 872 Assignments to $(targets) are without $(obj)/ prefix.
873 if_changed may be used in conjunction with custom commands as 873 if_changed may be used in conjunction with custom commands as
874 defined in 6.7 "Custom kbuild commands". 874 defined in 6.7 "Custom kbuild commands".
875
875 Note: It is a typical mistake to forget the FORCE prerequisite. 876 Note: It is a typical mistake to forget the FORCE prerequisite.
877 Another common pitfall is that whitespace is sometimes
878 significant; for instance, the below will fail (note the extra space
879 after the comma):
880 target: source(s) FORCE
881 #WRONG!# $(call if_changed, ld/objcopy/gzip)
876 882
877 ld 883 ld
878 Link target. Often LDFLAGS_$@ is used to set specific options to ld. 884 Link target. Often LDFLAGS_$@ is used to set specific options to ld.
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 3d5cd7a09b2f..d2f0c67ba1fb 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1174,6 +1174,11 @@ running once the system is up.
1174 New name for the ramdisk parameter. 1174 New name for the ramdisk parameter.
1175 See Documentation/ramdisk.txt. 1175 See Documentation/ramdisk.txt.
1176 1176
1177 rdinit= [KNL]
1178 Format: <full_path>
1179 Run specified binary instead of /init from the ramdisk,
1180 used for early userspace startup. See initrd.
1181
1177 reboot= [BUGS=IA-32,BUGS=ARM,BUGS=IA-64] Rebooting mode 1182 reboot= [BUGS=IA-32,BUGS=ARM,BUGS=IA-64] Rebooting mode
1178 Format: <reboot_mode>[,<reboot_mode2>[,...]] 1183 Format: <reboot_mode>[,<reboot_mode2>[,...]]
1179 See arch/*/kernel/reboot.c. 1184 See arch/*/kernel/reboot.c.
diff --git a/Documentation/power/swsusp-dmcrypt.txt b/Documentation/power/swsusp-dmcrypt.txt
new file mode 100644
index 000000000000..59931b46ff7e
--- /dev/null
+++ b/Documentation/power/swsusp-dmcrypt.txt
@@ -0,0 +1,138 @@
1Author: Andreas Steinmetz <ast@domdv.de>
2
3
4How to use dm-crypt and swsusp together:
5========================================
6
7Some prerequisites:
8You know how dm-crypt works. If not, visit the following web page:
9http://www.saout.de/misc/dm-crypt/
10You have read Documentation/power/swsusp.txt and understand it.
11You did read Documentation/initrd.txt and know how an initrd works.
12You know how to create or how to modify an initrd.
13
14Now your system is properly set up, your disk is encrypted except for
15the swap device(s) and the boot partition which may contain a mini
16system for crypto setup and/or rescue purposes. You may even have
17an initrd that does your current crypto setup already.
18
19At this point you want to encrypt your swap, too. Still you want to
20be able to suspend using swsusp. This, however, means that you
21have to be able to either enter a passphrase or that you read
22the key(s) from an external device like a pcmcia flash disk
23or an usb stick prior to resume. So you need an initrd, that sets
24up dm-crypt and then asks swsusp to resume from the encrypted
25swap device.
26
27The most important thing is that you set up dm-crypt in such
28a way that the swap device you suspend to/resume from has
29always the same major/minor within the initrd as well as
30within your running system. The easiest way to achieve this is
31to always set up this swap device first with dmsetup, so that
32it will always look like the following:
33
34brw------- 1 root root 254, 0 Jul 28 13:37 /dev/mapper/swap0
35
36Now set up your kernel to use /dev/mapper/swap0 as the default
37resume partition, so your kernel .config contains:
38
39CONFIG_PM_STD_PARTITION="/dev/mapper/swap0"
40
41Prepare your boot loader to use the initrd you will create or
42modify. For lilo the simplest setup looks like the following
43lines:
44
45image=/boot/vmlinuz
46initrd=/boot/initrd.gz
47label=linux
48append="root=/dev/ram0 init=/linuxrc rw"
49
50Finally you need to create or modify your initrd. Lets assume
51you create an initrd that reads the required dm-crypt setup
52from a pcmcia flash disk card. The card is formatted with an ext2
53fs which resides on /dev/hde1 when the card is inserted. The
54card contains at least the encrypted swap setup in a file
55named "swapkey". /etc/fstab of your initrd contains something
56like the following:
57
58/dev/hda1 /mnt ext3 ro 0 0
59none /proc proc defaults,noatime,nodiratime 0 0
60none /sys sysfs defaults,noatime,nodiratime 0 0
61
62/dev/hda1 contains an unencrypted mini system that sets up all
63of your crypto devices, again by reading the setup from the
64pcmcia flash disk. What follows now is a /linuxrc for your
65initrd that allows you to resume from encrypted swap and that
66continues boot with your mini system on /dev/hda1 if resume
67does not happen:
68
69#!/bin/sh
70PATH=/sbin:/bin:/usr/sbin:/usr/bin
71mount /proc
72mount /sys
73mapped=0
74noresume=`grep -c noresume /proc/cmdline`
75if [ "$*" != "" ]
76then
77 noresume=1
78fi
79dmesg -n 1
80/sbin/cardmgr -q
81for i in 1 2 3 4 5 6 7 8 9 0
82do
83 if [ -f /proc/ide/hde/media ]
84 then
85 usleep 500000
86 mount -t ext2 -o ro /dev/hde1 /mnt
87 if [ -f /mnt/swapkey ]
88 then
89 dmsetup create swap0 /mnt/swapkey > /dev/null 2>&1 && mapped=1
90 fi
91 umount /mnt
92 break
93 fi
94 usleep 500000
95done
96killproc /sbin/cardmgr
97dmesg -n 6
98if [ $mapped = 1 ]
99then
100 if [ $noresume != 0 ]
101 then
102 mkswap /dev/mapper/swap0 > /dev/null 2>&1
103 fi
104 echo 254:0 > /sys/power/resume
105 dmsetup remove swap0
106fi
107umount /sys
108mount /mnt
109umount /proc
110cd /mnt
111pivot_root . mnt
112mount /proc
113umount -l /mnt
114umount /proc
115exec chroot . /sbin/init $* < dev/console > dev/console 2>&1
116
117Please don't mind the weird loop above, busybox's msh doesn't know
118the let statement. Now, what is happening in the script?
119First we have to decide if we want to try to resume, or not.
120We will not resume if booting with "noresume" or any parameters
121for init like "single" or "emergency" as boot parameters.
122
123Then we need to set up dmcrypt with the setup data from the
124pcmcia flash disk. If this succeeds we need to reset the swap
125device if we don't want to resume. The line "echo 254:0 > /sys/power/resume"
126then attempts to resume from the first device mapper device.
127Note that it is important to set the device in /sys/power/resume,
128regardless if resuming or not, otherwise later suspend will fail.
129If resume starts, script execution terminates here.
130
131Otherwise we just remove the encrypted swap device and leave it to the
132mini system on /dev/hda1 to set the whole crypto up (it is up to
133you to modify this to your taste).
134
135What then follows is the well known process to change the root
136file system and continue booting from there. I prefer to unmount
137the initrd prior to continue booting but it is up to you to modify
138this.
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 7a6b78966459..b0d50840788e 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -1,22 +1,20 @@
1From kernel/suspend.c: 1Some warnings, first.
2 2
3 * BIG FAT WARNING ********************************************************* 3 * BIG FAT WARNING *********************************************************
4 * 4 *
5 * If you have unsupported (*) devices using DMA...
6 * ...say goodbye to your data.
7 *
8 * If you touch anything on disk between suspend and resume... 5 * If you touch anything on disk between suspend and resume...
9 * ...kiss your data goodbye. 6 * ...kiss your data goodbye.
10 * 7 *
11 * If your disk driver does not support suspend... (IDE does) 8 * If you do resume from initrd after your filesystems are mounted...
12 * ...you'd better find out how to get along 9 * ...bye bye root partition.
13 * without your data. 10 * [this is actually same case as above]
14 *
15 * If you change kernel command line between suspend and resume...
16 * ...prepare for nasty fsck or worse.
17 * 11 *
18 * If you change your hardware while system is suspended... 12 * If you have unsupported (*) devices using DMA, you may have some
19 * ...well, it was not good idea. 13 * problems. If your disk driver does not support suspend... (IDE does),
14 * it may cause some problems, too. If you change kernel command line
15 * between suspend and resume, it may do something wrong. If you change
16 * your hardware while system is suspended... well, it was not good idea;
17 * but it will probably only crash.
20 * 18 *
21 * (*) suspend/resume support is needed to make it safe. 19 * (*) suspend/resume support is needed to make it safe.
22 20
@@ -30,6 +28,13 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state
30echo platform > /sys/power/disk; echo disk > /sys/power/state 28echo platform > /sys/power/disk; echo disk > /sys/power/state
31 29
32 30
31Encrypted suspend image:
32------------------------
33If you want to store your suspend image encrypted with a temporary
34key to prevent data gathering after resume you must compile
35crypto and the aes algorithm into the kernel - modules won't work
36as they cannot be loaded at resume time.
37
33 38
34Article about goals and implementation of Software Suspend for Linux 39Article about goals and implementation of Software Suspend for Linux
35~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -85,11 +90,6 @@ resume.
85You have your server on UPS. Power died, and UPS is indicating 30 90You have your server on UPS. Power died, and UPS is indicating 30
86seconds to failure. What do you do? Suspend to disk. 91seconds to failure. What do you do? Suspend to disk.
87 92
88Ethernet card in your server died. You want to replace it. Your
89server is not hotplug capable. What do you do? Suspend to disk,
90replace ethernet card, resume. If you are fast your users will not
91even see broken connections.
92
93 93
94Q: Maybe I'm missing something, but why don't the regular I/O paths work? 94Q: Maybe I'm missing something, but why don't the regular I/O paths work?
95 95
@@ -117,31 +117,6 @@ Q: Does linux support ACPI S4?
117 117
118A: Yes. That's what echo platform > /sys/power/disk does. 118A: Yes. That's what echo platform > /sys/power/disk does.
119 119
120Q: My machine doesn't work with ACPI. How can I use swsusp than ?
121
122A: Do a reboot() syscall with right parameters. Warning: glibc gets in
123its way, so check with strace:
124
125reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, 0xd000fce2)
126
127(Thanks to Peter Osterlund:)
128
129#include <unistd.h>
130#include <syscall.h>
131
132#define LINUX_REBOOT_MAGIC1 0xfee1dead
133#define LINUX_REBOOT_MAGIC2 672274793
134#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
135
136int main()
137{
138 syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
139 LINUX_REBOOT_CMD_SW_SUSPEND, 0);
140 return 0;
141}
142
143Also /sys/ interface should be still present.
144
145Q: What is 'suspend2'? 120Q: What is 'suspend2'?
146 121
147A: suspend2 is 'Software Suspend 2', a forked implementation of 122A: suspend2 is 'Software Suspend 2', a forked implementation of
@@ -311,3 +286,46 @@ As a rule of thumb use encrypted swap to protect your data while your
311system is shut down or suspended. Additionally use the encrypted 286system is shut down or suspended. Additionally use the encrypted
312suspend image to prevent sensitive data from being stolen after 287suspend image to prevent sensitive data from being stolen after
313resume. 288resume.
289
290Q: Why can't we suspend to a swap file?
291
292A: Because accessing swap file needs the filesystem mounted, and
293filesystem might do something wrong (like replaying the journal)
294during mount.
295
296There are few ways to get that fixed:
297
2981) Probably could be solved by modifying every filesystem to support
299some kind of "really read-only!" option. Patches welcome.
300
3012) suspend2 gets around that by storing absolute positions in on-disk
302image (and blocksize), with resume parameter pointing directly to
303suspend header.
304
305Q: Is there a maximum system RAM size that is supported by swsusp?
306
307A: It should work okay with highmem.
308
309Q: Does swsusp (to disk) use only one swap partition or can it use
310multiple swap partitions (aggregate them into one logical space)?
311
312A: Only one swap partition, sorry.
313
314Q: If my application(s) causes lots of memory & swap space to be used
315(over half of the total system RAM), is it correct that it is likely
316to be useless to try to suspend to disk while that app is running?
317
318A: No, it should work okay, as long as your app does not mlock()
319it. Just prepare big enough swap partition.
320
321Q: What information is usefull for debugging suspend-to-disk problems?
322
323A: Well, last messages on the screen are always useful. If something
324is broken, it is usually some kernel driver, therefore trying with as
325little as possible modules loaded helps a lot. I also prefer people to
326suspend from console, preferably without X running. Booting with
327init=/bin/bash, then swapon and starting suspend sequence manually
328usually does the trick. Then it is good idea to try with latest
329vanilla kernel.
330
331
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index 7a4a5036d123..526d6dd267ea 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -46,6 +46,12 @@ There are a few types of systems where video works after S3 resume:
46 POSTing bios works. Ole Rohne has patch to do just that at 46 POSTing bios works. Ole Rohne has patch to do just that at
47 http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2. 47 http://dev.gentoo.org/~marineam/patch-radeonfb-2.6.11-rc2-mm2.
48 48
49(8) on some systems, you can use the video_post utility mentioned here:
50 http://bugzilla.kernel.org/show_bug.cgi?id=3670. Do echo 3 > /sys/power/state
51 && /usr/sbin/video_post - which will initialize the display in console mode.
52 If you are in X, you can switch to a virtual terminal and back to X using
53 CTRL+ALT+F1 - CTRL+ALT+F7 to get the display working in graphical mode again.
54
49Now, if you pass acpi_sleep=something, and it does not work with your 55Now, if you pass acpi_sleep=something, and it does not work with your
50bios, you'll get a hard crash during resume. Be careful. Also it is 56bios, you'll get a hard crash during resume. Be careful. Also it is
51safest to do your experiments with plain old VGA console. The vesafb 57safest to do your experiments with plain old VGA console. The vesafb
@@ -64,7 +70,8 @@ Model hack (or "how to do it")
64------------------------------------------------------------------------------ 70------------------------------------------------------------------------------
65Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI 71Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI
66Acer TM 242FX vbetool (6) 72Acer TM 242FX vbetool (6)
67Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) 73Acer TM C110 video_post (8)
74Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8)
68Acer TM 4052LCi s3_bios (2) 75Acer TM 4052LCi s3_bios (2)
69Acer TM 636Lci s3_bios vga=normal (2) 76Acer TM 636Lci s3_bios vga=normal (2)
70Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back 77Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back
@@ -113,6 +120,7 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2)
113IBM TP X20 ??? (*) 120IBM TP X20 ??? (*)
114IBM TP X30 s3_bios (2) 121IBM TP X30 s3_bios (2)
115IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. 122IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
123IBM TP X32 none (1), but backlight is on and video is trashed after long suspend
116IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) 124IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
117Medion MD4220 ??? (*) 125Medion MD4220 ??? (*)
118Samsung P35 vbetool needed (6) 126Samsung P35 vbetool needed (6)
diff --git a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt
index 160e7354cd1e..47e74ddc4bc9 100644
--- a/Documentation/scsi/aic7xxx.txt
+++ b/Documentation/scsi/aic7xxx.txt
@@ -1,5 +1,5 @@
1==================================================================== 1====================================================================
2= Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v6.2.28 = 2= Adaptec Aic7xxx Fast -> Ultra160 Family Manager Set v7.0 =
3= README for = 3= README for =
4= The Linux Operating System = 4= The Linux Operating System =
5==================================================================== 5====================================================================
@@ -131,6 +131,10 @@ The following information is available in this file:
131 SCSI "stub" effects. 131 SCSI "stub" effects.
132 132
1332. Version History 1332. Version History
134 7.0 (4th August, 2005)
135 - Updated driver to use SCSI transport class infrastructure
136 - Upported sequencer and core fixes from last adaptec released
137 version of the driver.
134 6.2.36 (June 3rd, 2003) 138 6.2.36 (June 3rd, 2003)
135 - Correct code that disables PCI parity error checking. 139 - Correct code that disables PCI parity error checking.
136 - Correct and simplify handling of the ignore wide residue 140 - Correct and simplify handling of the ignore wide residue
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index 7536823c0cb1..44df89c9c049 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -373,13 +373,11 @@ Summary:
373 scsi_activate_tcq - turn on tag command queueing 373 scsi_activate_tcq - turn on tag command queueing
374 scsi_add_device - creates new scsi device (lu) instance 374 scsi_add_device - creates new scsi device (lu) instance
375 scsi_add_host - perform sysfs registration and SCSI bus scan. 375 scsi_add_host - perform sysfs registration and SCSI bus scan.
376 scsi_add_timer - (re-)start timer on a SCSI command.
377 scsi_adjust_queue_depth - change the queue depth on a SCSI device 376 scsi_adjust_queue_depth - change the queue depth on a SCSI device
378 scsi_assign_lock - replace default host_lock with given lock 377 scsi_assign_lock - replace default host_lock with given lock
379 scsi_bios_ptable - return copy of block device's partition table 378 scsi_bios_ptable - return copy of block device's partition table
380 scsi_block_requests - prevent further commands being queued to given host 379 scsi_block_requests - prevent further commands being queued to given host
381 scsi_deactivate_tcq - turn off tag command queueing 380 scsi_deactivate_tcq - turn off tag command queueing
382 scsi_delete_timer - cancel timer on a SCSI command.
383 scsi_host_alloc - return a new scsi_host instance whose refcount==1 381 scsi_host_alloc - return a new scsi_host instance whose refcount==1
384 scsi_host_get - increments Scsi_Host instance's refcount 382 scsi_host_get - increments Scsi_Host instance's refcount
385 scsi_host_put - decrements Scsi_Host instance's refcount (free if 0) 383 scsi_host_put - decrements Scsi_Host instance's refcount (free if 0)
@@ -458,27 +456,6 @@ int scsi_add_host(struct Scsi_Host *shost, struct device * dev)
458 456
459 457
460/** 458/**
461 * scsi_add_timer - (re-)start timer on a SCSI command.
462 * @scmd: pointer to scsi command instance
463 * @timeout: duration of timeout in "jiffies"
464 * @complete: pointer to function to call if timeout expires
465 *
466 * Returns nothing
467 *
468 * Might block: no
469 *
470 * Notes: Each scsi command has its own timer, and as it is added
471 * to the queue, we set up the timer. When the command completes,
472 * we cancel the timer. An LLD can use this function to change
473 * the existing timeout value.
474 *
475 * Defined in: drivers/scsi/scsi_error.c
476 **/
477void scsi_add_timer(struct scsi_cmnd *scmd, int timeout,
478 void (*complete)(struct scsi_cmnd *))
479
480
481/**
482 * scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device 459 * scsi_adjust_queue_depth - allow LLD to change queue depth on a SCSI device
483 * @sdev: pointer to SCSI device to change queue depth on 460 * @sdev: pointer to SCSI device to change queue depth on
484 * @tagged: 0 - no tagged queuing 461 * @tagged: 0 - no tagged queuing
@@ -566,24 +543,6 @@ void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
566 543
567 544
568/** 545/**
569 * scsi_delete_timer - cancel timer on a SCSI command.
570 * @scmd: pointer to scsi command instance
571 *
572 * Returns 1 if able to cancel timer else 0 (i.e. too late or already
573 * cancelled).
574 *
575 * Might block: no [may in the future if it invokes del_timer_sync()]
576 *
577 * Notes: All commands issued by upper levels already have a timeout
578 * associated with them. An LLD can use this function to cancel the
579 * timer.
580 *
581 * Defined in: drivers/scsi/scsi_error.c
582 **/
583int scsi_delete_timer(struct scsi_cmnd *scmd)
584
585
586/**
587 * scsi_host_alloc - create a scsi host adapter instance and perform basic 546 * scsi_host_alloc - create a scsi host adapter instance and perform basic
588 * initialization. 547 * initialization.
589 * @sht: pointer to scsi host template 548 * @sht: pointer to scsi host template
diff --git a/Documentation/sonypi.txt b/Documentation/sonypi.txt
index 0f3b2405d09e..c1237a925505 100644
--- a/Documentation/sonypi.txt
+++ b/Documentation/sonypi.txt
@@ -99,6 +99,7 @@ statically linked into the kernel). Those options are:
99 SONYPI_MEYE_MASK 0x0400 99 SONYPI_MEYE_MASK 0x0400
100 SONYPI_MEMORYSTICK_MASK 0x0800 100 SONYPI_MEMORYSTICK_MASK 0x0800
101 SONYPI_BATTERY_MASK 0x1000 101 SONYPI_BATTERY_MASK 0x1000
102 SONYPI_WIRELESS_MASK 0x2000
102 103
103 useinput: if set (which is the default) two input devices are 104 useinput: if set (which is the default) two input devices are
104 created, one which interprets the jogdial events as 105 created, one which interprets the jogdial events as
@@ -137,6 +138,15 @@ Bugs:
137 speed handling etc). Use ACPI instead of APM if it works on your 138 speed handling etc). Use ACPI instead of APM if it works on your
138 laptop. 139 laptop.
139 140
141 - sonypi lacks the ability to distinguish between certain key
142 events on some models.
143
144 - some models with the nvidia card (geforce go 6200 tc) uses a
145 different way to adjust the backlighting of the screen. There
146 is a userspace utility to adjust the brightness on those models,
147 which can be downloaded from
148 http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2
149
140 - since all development was done by reverse engineering, there is 150 - since all development was done by reverse engineering, there is
141 _absolutely no guarantee_ that this driver will not crash your 151 _absolutely no guarantee_ that this driver will not crash your
142 laptop. Permanently. 152 laptop. Permanently.
diff --git a/Documentation/vm/locking b/Documentation/vm/locking
index c3ef09ae3bb1..f366fa956179 100644
--- a/Documentation/vm/locking
+++ b/Documentation/vm/locking
@@ -83,19 +83,18 @@ single address space optimization, so that the zap_page_range (from
83vmtruncate) does not lose sending ipi's to cloned threads that might 83vmtruncate) does not lose sending ipi's to cloned threads that might
84be spawned underneath it and go to user mode to drag in pte's into tlbs. 84be spawned underneath it and go to user mode to drag in pte's into tlbs.
85 85
86swap_list_lock/swap_device_lock 86swap_lock
87------------------------------- 87--------------
88The swap devices are chained in priority order from the "swap_list" header. 88The swap devices are chained in priority order from the "swap_list" header.
89The "swap_list" is used for the round-robin swaphandle allocation strategy. 89The "swap_list" is used for the round-robin swaphandle allocation strategy.
90The #free swaphandles is maintained in "nr_swap_pages". These two together 90The #free swaphandles is maintained in "nr_swap_pages". These two together
91are protected by the swap_list_lock. 91are protected by the swap_lock.
92 92
93The swap_device_lock, which is per swap device, protects the reference 93The swap_lock also protects all the device reference counts on the
94counts on the corresponding swaphandles, maintained in the "swap_map" 94corresponding swaphandles, maintained in the "swap_map" array, and the
95array, and the "highest_bit" and "lowest_bit" fields. 95"highest_bit" and "lowest_bit" fields.
96 96
97Both of these are spinlocks, and are never acquired from intr level. The 97The swap_lock is a spinlock, and is never acquired from intr level.
98locking hierarchy is swap_list_lock -> swap_device_lock.
99 98
100To prevent races between swap space deletion or async readahead swapins 99To prevent races between swap space deletion or async readahead swapins
101deciding whether a swap handle is being used, ie worthy of being read in 100deciding whether a swap handle is being used, ie worthy of being read in
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
index 28388aa700c6..c5beb548cfc4 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.txt
@@ -228,6 +228,26 @@ advantechwdt.c -- Advantech Single Board Computer
228 The GETSTATUS call returns if the device is open or not. 228 The GETSTATUS call returns if the device is open or not.
229 [FIXME -- silliness again?] 229 [FIXME -- silliness again?]
230 230
231booke_wdt.c -- PowerPC BookE Watchdog Timer
232
233 Timeout default varies according to frequency, supports
234 SETTIMEOUT
235
236 Watchdog can not be turned off, CONFIG_WATCHDOG_NOWAYOUT
237 does not make sense
238
239 GETSUPPORT returns the watchdog_info struct, and
240 GETSTATUS returns the supported options. GETBOOTSTATUS
241 returns a 1 if the last reset was caused by the
242 watchdog and a 0 otherwise. This watchdog can not be
243 disabled once it has been started. The wdt_period kernel
244 parameter selects which bit of the time base changing
245 from 0->1 will trigger the watchdog exception. Changing
246 the timeout from the ioctl calls will change the
247 wdt_period as defined above. Finally if you would like to
248 replace the default Watchdog Handler you can implement the
249 WatchdogHandler() function in your own code.
250
231eurotechwdt.c -- Eurotech CPU-1220/1410 251eurotechwdt.c -- Eurotech CPU-1220/1410
232 252
233 The timeout can be set using the SETTIMEOUT ioctl and defaults 253 The timeout can be set using the SETTIMEOUT ioctl and defaults