diff options
author | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
commit | 64e47488c913ac704d465a6af86a26786d1412a5 (patch) | |
tree | d3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /Documentation | |
parent | 4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'Documentation')
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, | |||
605 | it will send the proper IPMI commands to do this. This is supported on | 605 | it will send the proper IPMI commands to do this. This is supported on |
606 | several platforms. | 606 | several platforms. |
607 | 607 | ||
608 | There is a module parameter named "poweroff_control" that may either be zero | 608 | There 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 | 609 | either be zero (do a power down) or non-zero (do a power cycle, power |
610 | it on in a few seconds). Setting ipmi_poweroff.poweroff_control=x will do | 610 | the system off, then power it on in a few seconds). Setting |
611 | the same thing on the kernel command line. The parameter is also available | 611 | ipmi_poweroff.poweroff_control=x will do the same thing on the kernel |
612 | via the proc filesystem in /proc/ipmi/poweroff_control. Note that if the | 612 | command line. The parameter is also available via the proc filesystem |
613 | system does not support power cycling, it will always to the power off. | 613 | in /proc/sys/dev/ipmi/poweroff_powercycle. Note that if the system |
614 | does not support power cycling, it will always do the power off. | ||
614 | 615 | ||
615 | Note that if you have ACPI enabled, the system will prefer using ACPI to | 616 | Note that if you have ACPI enabled, the system will prefer using ACPI to |
616 | power off. | 617 | power 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 @@ | |||
1 | Using RCU to Protect Dynamic NMI Handlers | ||
2 | |||
3 | |||
4 | Although RCU is usually used to protect read-mostly data structures, | ||
5 | it is possible to use RCU to provide dynamic non-maskable interrupt | ||
6 | handlers, as well as dynamic irq handlers. This document describes | ||
7 | how to do this, drawing loosely from Zwane Mwaikambo's NMI-timer | ||
8 | work in "arch/i386/oprofile/nmi_timer_int.c" and in | ||
9 | "arch/i386/kernel/traps.c". | ||
10 | |||
11 | The relevant pieces of code are listed below, each followed by a | ||
12 | brief explanation. | ||
13 | |||
14 | static int dummy_nmi_callback(struct pt_regs *regs, int cpu) | ||
15 | { | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | The dummy_nmi_callback() function is a "dummy" NMI handler that does | ||
20 | nothing, but returns zero, thus saying that it did nothing, allowing | ||
21 | the NMI handler to take the default machine-specific action. | ||
22 | |||
23 | static nmi_callback_t nmi_callback = dummy_nmi_callback; | ||
24 | |||
25 | This nmi_callback variable is a global function pointer to the current | ||
26 | NMI 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 | |||
43 | The do_nmi() function processes each NMI. It first disables preemption | ||
44 | in the same way that a hardware irq would, then increments the per-CPU | ||
45 | count of NMIs. It then invokes the NMI handler stored in the nmi_callback | ||
46 | function pointer. If this handler returns zero, do_nmi() invokes the | ||
47 | default_do_nmi() function to handle a machine-specific NMI. Finally, | ||
48 | preemption is restored. | ||
49 | |||
50 | Strictly speaking, rcu_dereference() is not needed, since this code runs | ||
51 | only on i386, which does not need rcu_dereference() anyway. However, | ||
52 | it is a good documentation aid, particularly for anyone attempting to | ||
53 | do something similar on Alpha. | ||
54 | |||
55 | Quick Quiz: Why might the rcu_dereference() be necessary on Alpha, | ||
56 | given that the code referenced by the pointer is read-only? | ||
57 | |||
58 | |||
59 | Back 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 | |||
66 | The set_nmi_callback() function registers an NMI handler. Note that any | ||
67 | data that is to be used by the callback must be initialized up -before- | ||
68 | the call to set_nmi_callback(). On architectures that do not order | ||
69 | writes, the rcu_assign_pointer() ensures that the NMI handler sees the | ||
70 | initialized values. | ||
71 | |||
72 | void unset_nmi_callback(void) | ||
73 | { | ||
74 | rcu_assign_pointer(nmi_callback, dummy_nmi_callback); | ||
75 | } | ||
76 | |||
77 | This function unregisters an NMI handler, restoring the original | ||
78 | dummy_nmi_handler(). However, there may well be an NMI handler | ||
79 | currently executing on some other CPU. We therefore cannot free | ||
80 | up any data structures used by the old NMI handler until execution | ||
81 | of it completes on all other CPUs. | ||
82 | |||
83 | One way to accomplish this is via synchronize_sched(), perhaps as | ||
84 | follows: | ||
85 | |||
86 | unset_nmi_callback(); | ||
87 | synchronize_sched(); | ||
88 | kfree(my_nmi_data); | ||
89 | |||
90 | This works because synchronize_sched() blocks until all CPUs complete | ||
91 | any preemption-disabled segments of code that they were executing. | ||
92 | Since NMI handlers disable preemption, synchronize_sched() is guaranteed | ||
93 | not to return until all ongoing NMI handlers exit. It is therefore safe | ||
94 | to free up the handler's data as soon as synchronize_sched() returns. | ||
95 | |||
96 | |||
97 | Answer 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 | |||
68 | Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches | 68 | Porfiri Claudio <C.Porfiri@nisms.tei.ericsson.se> for patches |
69 | to make the driver work with the older CDU-510/515 series, and | 69 | to make the driver work with the older CDU-510/515 series, and |
70 | Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that | 70 | Heiko Eissfeldt <heiko@colossus.escape.de> for pointing out that |
71 | the verify_area() checks were ignoring the results of said checks. | 71 | the 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:) |
74 | Thanks to Corey Minyard who wrote the original CDU-31A driver on which | 75 | Thanks 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 | |||
60 | load balancing code trying to pull tasks outside of the cpu exclusive | 60 | load balancing code trying to pull tasks outside of the cpu exclusive |
61 | cpuset only to be prevented by the tasks' cpus_allowed mask. | 61 | cpuset only to be prevented by the tasks' cpus_allowed mask. |
62 | 62 | ||
63 | A cpuset that is mem_exclusive restricts kernel allocations for | ||
64 | page, buffer and other data commonly shared by the kernel across | ||
65 | multiple users. All cpusets, whether mem_exclusive or not, restrict | ||
66 | allocations of memory for user space. This enables configuring a | ||
67 | system so that several independent jobs can share common kernel | ||
68 | data, such as file system pages, while isolating each jobs user | ||
69 | allocation in its own cpuset. To do this, construct a large | ||
70 | mem_exclusive cpuset to hold all the jobs, and construct child, | ||
71 | non-mem_exclusive cpusets for each individual job. Only a small | ||
72 | amount of typical kernel memory, such as requests from interrupt | ||
73 | handlers, is allowed to be taken outside even a mem_exclusive cpuset. | ||
74 | |||
63 | User level code may create and destroy cpusets by name in the cpuset | 75 | User level code may create and destroy cpusets by name in the cpuset |
64 | virtual file system, manage the attributes and permissions of these | 76 | virtual file system, manage the attributes and permissions of these |
65 | cpusets and which CPUs and Memory Nodes are assigned to each cpuset, | 77 | cpusets 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 | ||
224 | TEA/XTEA algorithm contributors: | 224 | TEA/XTEA algorithm contributors: |
225 | Aaron Grothe | 225 | Aaron Grothe |
226 | Michael Ringe | ||
226 | 227 | ||
227 | Khazad algorithm contributors: | 228 | Khazad 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 @@ | |||
1 | Overview | ||
2 | |||
3 | The Dell Systems Management Base Driver provides a sysfs interface for | ||
4 | systems management software such as Dell OpenManage to perform system | ||
5 | management interrupts and host control actions (system power cycle or | ||
6 | power off after OS shutdown) on certain Dell systems. | ||
7 | |||
8 | Dell OpenManage requires this driver on the following Dell PowerEdge systems: | ||
9 | 300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC, | ||
10 | 700, and 750. Other Dell software such as the open source libsmbios project | ||
11 | is expected to make use of this driver, and it may include the use of this | ||
12 | driver on other Dell systems. | ||
13 | |||
14 | The Dell libsmbios project aims towards providing access to as much BIOS | ||
15 | information as possible. See http://linux.dell.com/libsmbios/main/ for | ||
16 | more information about the libsmbios project. | ||
17 | |||
18 | |||
19 | System Management Interrupt | ||
20 | |||
21 | On some Dell systems, systems management software must access certain | ||
22 | management information via a system management interrupt (SMI). The SMI data | ||
23 | buffer must reside in 32-bit address space, and the physical address of the | ||
24 | buffer is required for the SMI. The driver maintains the memory required for | ||
25 | the SMI and provides a way for the application to generate the SMI. | ||
26 | The driver creates the following sysfs entries for systems management | ||
27 | software 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 | |||
34 | Systems management software must perform the following steps to execute | ||
35 | a SMI using this driver: | ||
36 | |||
37 | 1) Lock smi_data. | ||
38 | 2) Write system management command to smi_data. | ||
39 | 3) Write "1" to smi_request to generate a calling interface SMI or | ||
40 | "2" to generate a raw SMI. | ||
41 | 4) Read system management command response from smi_data. | ||
42 | 5) Unlock smi_data. | ||
43 | |||
44 | |||
45 | Host Control Action | ||
46 | |||
47 | Dell OpenManage supports a host control feature that allows the administrator | ||
48 | to perform a power cycle or power off of the system after the OS has finished | ||
49 | shutting down. On some Dell systems, this host control feature requires that | ||
50 | a driver perform a SMI after the OS has finished shutting down. | ||
51 | |||
52 | The driver creates the following sysfs entries for systems management software | ||
53 | to schedule the driver to perform a power cycle or power off host control | ||
54 | action 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 | |||
60 | Dell OpenManage performs the following steps to execute a power cycle or | ||
61 | power off host control action using this driver: | ||
62 | |||
63 | 1) Write host control action to be performed to host_control_action. | ||
64 | 2) Write type of SMI that driver needs to perform to host_control_smi_type. | ||
65 | 3) Write "1" to host_control_on_shutdown to enable host control action. | ||
66 | 4) Initiate OS shutdown. | ||
67 | (Driver will perform host control SMI when it is notified that the OS | ||
68 | has finished shutting down.) | ||
69 | |||
70 | |||
71 | Host Control SMI Type | ||
72 | |||
73 | The following table shows the value to write to host_control_smi_type to | ||
74 | perform a power cycle or power off host control action: | ||
75 | |||
76 | PowerEdge 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 @@ | |||
1 | Purpose: | ||
2 | Demonstrate the usage of the new open sourced rbu (Remote BIOS Update) driver | ||
3 | for updating BIOS images on Dell servers and desktops. | ||
4 | |||
5 | Scope: | ||
6 | This document discusses the functionality of the rbu driver only. | ||
7 | It does not cover the support needed from aplications to enable the BIOS to | ||
8 | update itself with the image downloaded in to the memory. | ||
9 | |||
10 | Overview: | ||
11 | This driver works with Dell OpenManage or Dell Update Packages for updating | ||
12 | the BIOS on Dell servers (starting from servers sold since 1999), desktops | ||
13 | and notebooks (starting from those sold in 2005). | ||
14 | Please go to http://support.dell.com register and you can find info on | ||
15 | OpenManage and Dell Update packages (DUP). | ||
16 | |||
17 | Dell_RBU driver supports BIOS update using the monilothic image and packetized | ||
18 | image methods. In case of moniolithic the driver allocates a contiguous chunk | ||
19 | of physical pages having the BIOS image. In case of packetized the app | ||
20 | using the driver breaks the image in to packets of fixed sizes and the driver | ||
21 | would place each packet in contiguous physical memory. The driver also | ||
22 | maintains a link list of packets for reading them back. | ||
23 | If the dell_rbu driver is unloaded all the allocated memory is freed. | ||
24 | |||
25 | The rbu driver needs to have an application which will inform the BIOS to | ||
26 | enable the update in the next system reboot. | ||
27 | |||
28 | The user should not unload the rbu driver after downloading the BIOS image | ||
29 | or updating. | ||
30 | |||
31 | The 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 | |||
37 | The driver supports two types of update mechanism; monolithic and packetized. | ||
38 | These update mechanism depends upon the BIOS currently running on the system. | ||
39 | Most of the Dell systems support a monolithic update where the BIOS image is | ||
40 | copied to a single contiguous block of physical memory. | ||
41 | In case of packet mechanism the single memory can be broken in smaller chuks | ||
42 | of contiguous memory and the BIOS image is scattered in these packets. | ||
43 | |||
44 | By default the driver uses monolithic memory for the update type. This can be | ||
45 | changed to contiguous during the driver load time by specifying the load | ||
46 | parameter image_type=packet. This can also be changed later as below | ||
47 | echo packet > /sys/devices/platform/dell_rbu/image_type | ||
48 | |||
49 | Do the steps below to download the BIOS image. | ||
50 | 1) echo 1 > /sys/class/firmware/dell_rbu/loading | ||
51 | 2) cp bios_image.hdr /sys/class/firmware/dell_rbu/data | ||
52 | 3) echo 0 > /sys/class/firmware/dell_rbu/loading | ||
53 | |||
54 | The /sys/class/firmware/dell_rbu/ entries will remain till the following is | ||
55 | done. | ||
56 | echo -1 > /sys/class/firmware/dell_rbu/loading | ||
57 | |||
58 | Until this step is completed the drivr cannot be unloaded. | ||
59 | |||
60 | Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to | ||
61 | read back the image downloaded. This is useful in case of packet update | ||
62 | mechanism where the above steps 1,2,3 will repeated for every packet. | ||
63 | By reading the /sys/devices/platform/dell_rbu/data file all packet data | ||
64 | downloaded can be verified in a single file. | ||
65 | The packets are arranged in this file one after the other in a FIFO order. | ||
66 | |||
67 | NOTE: | ||
68 | This driver requires a patch for firmware_class.c which has the addition | ||
69 | of request_firmware_nowait_nohotplug function to wortk | ||
70 | Also after updating the BIOS image an user mdoe application neeeds to execute | ||
71 | code which message the BIOS update request to the BIOS. So on the next reboot | ||
72 | the BIOS knows about the new image downloaded and it updates it self. | ||
73 | Also 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 | ||
21 | 3) Loading Modules, described by two approaches | 21 | 3) 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 | ||
8 | In older versions of Linux this was done with the | 8 | In older versions of Linux this was done with the |
9 | int verify_area(int type, const void * addr, unsigned long size) | 9 | int verify_area(int type, const void * addr, unsigned long size) |
10 | function. | 10 | function (which has since been replaced by access_ok()). |
11 | 11 | ||
12 | This function verified that the memory area starting at address | 12 | This function verified that the memory area starting at address |
13 | addr and of size size was accessible for the operation specified | 13 | addr 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 | ||
54 | What: register_ioctl32_conversion() / unregister_ioctl32_conversion() | ||
55 | When: April 2005 | ||
56 | Why: Replaced by ->compat_ioctl in file_operations and other method | ||
57 | vecors. | ||
58 | Who: Andi Kleen <ak@muc.de>, Christoph Hellwig <hch@lst.de> | ||
59 | |||
60 | --------------------------- | ||
61 | |||
62 | What: RCU API moves to EXPORT_SYMBOL_GPL | 54 | What: RCU API moves to EXPORT_SYMBOL_GPL |
63 | When: April 2006 | 55 | When: April 2006 |
64 | Files: include/linux/rcupdate.h, kernel/rcupdate.c | 56 | Files: 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 | ||
77 | What: remove verify_area() | ||
78 | When: July 2006 | ||
79 | Files: Various uaccess.h headers. | ||
80 | Why: Deprecated and redundant. access_ok() should be used instead. | ||
81 | Who: Jesper Juhl <juhl-lkml@dif.dk> | ||
82 | |||
83 | --------------------------- | ||
84 | |||
85 | What: IEEE1394 Audio and Music Data Transmission Protocol driver, | 69 | What: IEEE1394 Audio and Music Data Transmission Protocol driver, |
86 | Connection Management Procedures driver | 70 | Connection Management Procedures driver |
87 | When: November 2005 | 71 | When: November 2005 |
@@ -102,16 +86,6 @@ Who: Jody McIntyre <scjody@steamballoon.com> | |||
102 | 86 | ||
103 | --------------------------- | 87 | --------------------------- |
104 | 88 | ||
105 | What: register_serial/unregister_serial | ||
106 | When: September 2005 | ||
107 | Why: 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. | ||
111 | Who: Russell King <rmk@arm.linux.org.uk> | ||
112 | |||
113 | --------------------------- | ||
114 | |||
115 | What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid | 89 | What: i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid |
116 | When: November 2005 | 90 | When: November 2005 |
117 | Files: drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c | 91 | Files: 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 | ||
138 | For example, to get the status information of a process, all you have to do is | 139 | For 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 | |||
2 | relayfs - a high-speed data relay filesystem | ||
3 | ============================================ | ||
4 | |||
5 | relayfs is a filesystem designed to provide an efficient mechanism for | ||
6 | tools and facilities to relay large and potentially sustained streams | ||
7 | of data from kernel space to user space. | ||
8 | |||
9 | The main abstraction of relayfs is the 'channel'. A channel consists | ||
10 | of a set of per-cpu kernel buffers each represented by a file in the | ||
11 | relayfs filesystem. Kernel clients write into a channel using | ||
12 | efficient write functions which automatically log to the current cpu's | ||
13 | channel buffer. User space applications mmap() the per-cpu files and | ||
14 | retrieve the data as it becomes available. | ||
15 | |||
16 | The format of the data logged into the channel buffers is completely | ||
17 | up to the relayfs client; relayfs does however provide hooks which | ||
18 | allow clients to impose some stucture on the buffer data. Nor does | ||
19 | relayfs implement any form of data filtering - this also is left to | ||
20 | the client. The purpose is to keep relayfs as simple as possible. | ||
21 | |||
22 | This document provides an overview of the relayfs API. The details of | ||
23 | the function parameters are documented along with the functions in the | ||
24 | filesystem code - please see that for details. | ||
25 | |||
26 | Semantics | ||
27 | ========= | ||
28 | |||
29 | Each relayfs channel has one buffer per CPU, each buffer has one or | ||
30 | more sub-buffers. Messages are written to the first sub-buffer until | ||
31 | it is too full to contain a new message, in which case it it is | ||
32 | written to the next (if available). Messages are never split across | ||
33 | sub-buffers. At this point, userspace can be notified so it empties | ||
34 | the first sub-buffer, while the kernel continues writing to the next. | ||
35 | |||
36 | When notified that a sub-buffer is full, the kernel knows how many | ||
37 | bytes of it are padding i.e. unused. Userspace can use this knowledge | ||
38 | to copy only valid data. | ||
39 | |||
40 | After copying it, userspace can notify the kernel that a sub-buffer | ||
41 | has been consumed. | ||
42 | |||
43 | relayfs can operate in a mode where it will overwrite data not yet | ||
44 | collected by userspace, and not wait for it to consume it. | ||
45 | |||
46 | relayfs itself does not provide for communication of such data between | ||
47 | userspace and kernel, allowing the kernel side to remain simple and not | ||
48 | impose a single interface on userspace. It does provide a separate | ||
49 | helper though, described below. | ||
50 | |||
51 | klog, relay-app & librelay | ||
52 | ========================== | ||
53 | |||
54 | relayfs itself is ready to use, but to make things easier, two | ||
55 | additional systems are provided. klog is a simple wrapper to make | ||
56 | writing formatted text or raw data to a channel simpler, regardless of | ||
57 | whether a channel to write into exists or not, or whether relayfs is | ||
58 | compiled into the kernel or is configured as a module. relay-app is | ||
59 | the kernel counterpart of userspace librelay.c, combined these two | ||
60 | files provide glue to easily stream data to disk, without having to | ||
61 | bother with housekeeping. klog and relay-app can be used together, | ||
62 | with klog providing high-level logging functions to the kernel and | ||
63 | relay-app taking care of kernel-user control and disk-logging chores. | ||
64 | |||
65 | It is possible to use relayfs without relay-app & librelay, but you'll | ||
66 | have to implement communication between userspace and kernel, allowing | ||
67 | both to convey the state of buffers (full, empty, amount of padding). | ||
68 | |||
69 | klog, relay-app and librelay can be found in the relay-apps tarball on | ||
70 | http://relayfs.sourceforge.net | ||
71 | |||
72 | The relayfs user space API | ||
73 | ========================== | ||
74 | |||
75 | relayfs implements basic file operations for user space access to | ||
76 | relayfs channel buffer data. Here are the file operations that are | ||
77 | available and some comments regarding their behavior: | ||
78 | |||
79 | open() enables user to open an _existing_ buffer. | ||
80 | |||
81 | mmap() 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 | |||
85 | read() 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 | |||
95 | poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are | ||
96 | notified when sub-buffer boundaries are crossed. | ||
97 | |||
98 | close() 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 | |||
103 | In order for a user application to make use of relayfs files, the | ||
104 | relayfs filesystem must be mounted. For example, | ||
105 | |||
106 | mount -t relayfs relayfs /mnt/relay | ||
107 | |||
108 | NOTE: 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 | |||
113 | The relayfs kernel API | ||
114 | ====================== | ||
115 | |||
116 | Here'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 | |||
151 | Creating a channel | ||
152 | ------------------ | ||
153 | |||
154 | relay_open() is used to create a channel, along with its per-cpu | ||
155 | channel buffers. Each channel buffer will have an associated file | ||
156 | created for it in the relayfs filesystem, which can be opened and | ||
157 | mmapped from user space if desired. The files are named | ||
158 | basename0...basenameN-1 where N is the number of online cpus, and by | ||
159 | default will be created in the root of the filesystem. If you want a | ||
160 | directory structure to contain your relayfs files, you can create it | ||
161 | with relayfs_create_dir() and pass the parent directory to | ||
162 | relay_open(). Clients are responsible for cleaning up any directory | ||
163 | structure they create when the channel is closed - use | ||
164 | relayfs_remove_dir() for that. | ||
165 | |||
166 | The total size of each per-cpu buffer is calculated by multiplying the | ||
167 | number of sub-buffers by the sub-buffer size passed into relay_open(). | ||
168 | The idea behind sub-buffers is that they're basically an extension of | ||
169 | double-buffering to N buffers, and they also allow applications to | ||
170 | easily implement random-access-on-buffer-boundary schemes, which can | ||
171 | be important for some high-volume applications. The number and size | ||
172 | of sub-buffers is completely dependent on the application and even for | ||
173 | the same application, different conditions will warrant different | ||
174 | values for these parameters at different times. Typically, the right | ||
175 | values to use are best decided after some experimentation; in general, | ||
176 | though, it's safe to assume that having only 1 sub-buffer is a bad | ||
177 | idea - you're guaranteed to either overwrite data or lose events | ||
178 | depending on the channel mode being used. | ||
179 | |||
180 | Channel 'modes' | ||
181 | --------------- | ||
182 | |||
183 | relayfs channels can be used in either of two modes - 'overwrite' or | ||
184 | 'no-overwrite'. The mode is entirely determined by the implementation | ||
185 | of the subbuf_start() callback, as described below. In 'overwrite' | ||
186 | mode, also known as 'flight recorder' mode, writes continuously cycle | ||
187 | around the buffer and will never fail, but will unconditionally | ||
188 | overwrite old data regardless of whether it's actually been consumed. | ||
189 | In no-overwrite mode, writes will fail i.e. data will be lost, if the | ||
190 | number of unconsumed sub-buffers equals the total number of | ||
191 | sub-buffers in the channel. It should be clear that if there is no | ||
192 | consumer or if the consumer can't consume sub-buffers fast enought, | ||
193 | data will be lost in either case; the only difference is whether data | ||
194 | is lost from the beginning or the end of a buffer. | ||
195 | |||
196 | As explained above, a relayfs channel is made of up one or more | ||
197 | per-cpu channel buffers, each implemented as a circular buffer | ||
198 | subdivided into one or more sub-buffers. Messages are written into | ||
199 | the current sub-buffer of the channel's current per-cpu buffer via the | ||
200 | write functions described below. Whenever a message can't fit into | ||
201 | the current sub-buffer, because there's no room left for it, the | ||
202 | client is notified via the subbuf_start() callback that a switch to a | ||
203 | new sub-buffer is about to occur. The client uses this callback to 1) | ||
204 | initialize the next sub-buffer if appropriate 2) finalize the previous | ||
205 | sub-buffer if appropriate and 3) return a boolean value indicating | ||
206 | whether or not to actually go ahead with the sub-buffer switch. | ||
207 | |||
208 | To implement 'no-overwrite' mode, the userspace client would provide | ||
209 | an implementation of the subbuf_start() callback something like the | ||
210 | following: | ||
211 | |||
212 | static 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 | |||
228 | If the current buffer is full i.e. all sub-buffers remain unconsumed, | ||
229 | the callback returns 0 to indicate that the buffer switch should not | ||
230 | occur yet i.e. until the consumer has had a chance to read the current | ||
231 | set of ready sub-buffers. For the relay_buf_full() function to make | ||
232 | sense, the consumer is reponsible for notifying relayfs when | ||
233 | sub-buffers have been consumed via relay_subbufs_consumed(). Any | ||
234 | subsequent attempts to write into the buffer will again invoke the | ||
235 | subbuf_start() callback with the same parameters; only when the | ||
236 | consumer has consumed one or more of the ready sub-buffers will | ||
237 | relay_buf_full() return 0, in which case the buffer switch can | ||
238 | continue. | ||
239 | |||
240 | The implementation of the subbuf_start() callback for 'overwrite' mode | ||
241 | would be very similar: | ||
242 | |||
243 | static 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 | |||
256 | In this case, the relay_buf_full() check is meaningless and the | ||
257 | callback always returns 1, causing the buffer switch to occur | ||
258 | unconditionally. It's also meaningless for the client to use the | ||
259 | relay_subbufs_consumed() function in this mode, as it's never | ||
260 | consulted. | ||
261 | |||
262 | The default subbuf_start() implementation, used if the client doesn't | ||
263 | define any callbacks, or doesn't define the subbuf_start() callback, | ||
264 | implements the simplest possible 'no-overwrite' mode i.e. it does | ||
265 | nothing but return 0. | ||
266 | |||
267 | Header information can be reserved at the beginning of each sub-buffer | ||
268 | by calling the subbuf_start_reserve() helper function from within the | ||
269 | subbuf_start() callback. This reserved area can be used to store | ||
270 | whatever information the client wants. In the example above, room is | ||
271 | reserved in each sub-buffer to store the padding count for that | ||
272 | sub-buffer. This is filled in for the previous sub-buffer in the | ||
273 | subbuf_start() implementation; the padding value for the previous | ||
274 | sub-buffer is passed into the subbuf_start() callback along with a | ||
275 | pointer to the previous sub-buffer, since the padding value isn't | ||
276 | known until a sub-buffer is filled. The subbuf_start() callback is | ||
277 | also called for the first sub-buffer when the channel is opened, to | ||
278 | give the client a chance to reserve space in it. In this case the | ||
279 | previous sub-buffer pointer passed into the callback will be NULL, so | ||
280 | the client should check the value of the prev_subbuf pointer before | ||
281 | writing into the previous sub-buffer. | ||
282 | |||
283 | Writing to a channel | ||
284 | -------------------- | ||
285 | |||
286 | kernel clients write data into the current cpu's channel buffer using | ||
287 | relay_write() or __relay_write(). relay_write() is the main logging | ||
288 | function - it uses local_irqsave() to protect the buffer and should be | ||
289 | used if you might be logging from interrupt context. If you know | ||
290 | you'll never be logging from interrupt context, you can use | ||
291 | __relay_write(), which only disables preemption. These functions | ||
292 | don't return a value, so you can't determine whether or not they | ||
293 | failed - the assumption is that you wouldn't want to check a return | ||
294 | value in the fast logging path anyway, and that they'll always succeed | ||
295 | unless the buffer is full and no-overwrite mode is being used, in | ||
296 | which case you can detect a failed write in the subbuf_start() | ||
297 | callback by calling the relay_buf_full() helper function. | ||
298 | |||
299 | relay_reserve() is used to reserve a slot in a channel buffer which | ||
300 | can be written to later. This would typically be used in applications | ||
301 | that need to write directly into a channel buffer without having to | ||
302 | stage data in a temporary buffer beforehand. Because the actual write | ||
303 | may not happen immediately after the slot is reserved, applications | ||
304 | using relay_reserve() can keep a count of the number of bytes actually | ||
305 | written, either in space reserved in the sub-buffers themselves or as | ||
306 | a separate array. See the 'reserve' example in the relay-apps tarball | ||
307 | at http://relayfs.sourceforge.net for an example of how this can be | ||
308 | done. Because the write is under control of the client and is | ||
309 | separated from the reserve, relay_reserve() doesn't protect the buffer | ||
310 | at all - it's up to the client to provide the appropriate | ||
311 | synchronization when using relay_reserve(). | ||
312 | |||
313 | Closing a channel | ||
314 | ----------------- | ||
315 | |||
316 | The client calls relay_close() when it's finished using the channel. | ||
317 | The channel and its associated buffers are destroyed when there are no | ||
318 | longer any references to any of the channel buffers. relay_flush() | ||
319 | forces a sub-buffer switch on all the channel buffers, and can be used | ||
320 | to finalize and process the last sub-buffers before the channel is | ||
321 | closed. | ||
322 | |||
323 | Misc | ||
324 | ---- | ||
325 | |||
326 | Some applications may want to keep a channel around and re-use it | ||
327 | rather than open and close a new channel for each use. relay_reset() | ||
328 | can be used for this purpose - it resets a channel to its initial | ||
329 | state without reallocating channel buffer memory or destroying | ||
330 | existing mappings. It should however only be called when it's safe to | ||
331 | do so i.e. when the channel isn't currently being written to. | ||
332 | |||
333 | Finally, there are a couple of utility callbacks that can be used for | ||
334 | different purposes. buf_mapped() is called whenever a channel buffer | ||
335 | is mmapped from user space and buf_unmapped() is called when it's | ||
336 | unmapped. The client can use this notification to trigger actions | ||
337 | within the kernel application, such as enabling/disabling logging to | ||
338 | the channel. | ||
339 | |||
340 | |||
341 | Resources | ||
342 | ========= | ||
343 | |||
344 | For news, example code, mailing list, etc. see the relayfs homepage: | ||
345 | |||
346 | http://relayfs.sourceforge.net | ||
347 | |||
348 | |||
349 | Credits | ||
350 | ======= | ||
351 | |||
352 | The ideas and specs for relayfs came about as a result of discussions | ||
353 | on tracing involving the following: | ||
354 | |||
355 | Michel Dagenais <michel.dagenais@polymtl.ca> | ||
356 | Richard Moore <richardj_moore@uk.ibm.com> | ||
357 | Bob Wisniewski <bob@watson.ibm.com> | ||
358 | Karim Yaghmour <karim@opersys.com> | ||
359 | Tom Zanussi <zanussi@us.ibm.com> | ||
360 | |||
361 | Also thanks to Hubertus Franke for a lot of useful suggestions and bug | ||
362 | reports. | ||
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 | ||
91 | It also defines this helper for defining device attributes: | 91 | It 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) \ |
94 | struct device_attribute dev_attr_##_name = { \ | 94 | struct 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 | ||
100 | For example, declaring | 100 | For example, declaring |
101 | 101 | ||
102 | static DEVICE_ATTR(foo,0644,show_foo,store_foo); | 102 | static DEVICE_ATTR(foo, S_IWUSR | S_IRUGO, show_foo, store_foo); |
103 | 103 | ||
104 | is equivalent to doing: | 104 | is equivalent to doing: |
105 | 105 | ||
106 | static struct device_attribute dev_attr_foo = { | 106 | static 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 | |||
121 | show and store methods of the attribute owners. | 121 | show and store methods of the attribute owners. |
122 | 122 | ||
123 | struct sysfs_ops { | 123 | struct 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 | ||
138 | To illustrate: | 138 | To 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 | ||
143 | static ssize_t | 143 | static 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 | ||
217 | static ssize_t show_name(struct device *dev, struct device_attribute *attr, char *buf) | 217 | static 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 | ||
222 | static ssize_t store_name(struct device * dev, const char * buf) | 222 | static 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 | ||
228 | static DEVICE_ATTR(name,S_IRUGO,show_name,store_name); | 228 | static 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 | ||
291 | Declaring: | 291 | Declaring: |
292 | 292 | ||
293 | DEVICE_ATTR(_name,_str,_mode,_show,_store); | 293 | DEVICE_ATTR(_name, _str, _mode, _show, _store); |
294 | 294 | ||
295 | Creation/Removal: | 295 | Creation/Removal: |
296 | 296 | ||
@@ -310,7 +310,7 @@ struct bus_attribute { | |||
310 | 310 | ||
311 | Declaring: | 311 | Declaring: |
312 | 312 | ||
313 | BUS_ATTR(_name,_mode,_show,_store) | 313 | BUS_ATTR(_name, _mode, _show, _store) |
314 | 314 | ||
315 | Creation/Removal: | 315 | Creation/Removal: |
316 | 316 | ||
@@ -331,7 +331,7 @@ struct driver_attribute { | |||
331 | 331 | ||
332 | Declaring: | 332 | Declaring: |
333 | 333 | ||
334 | DRIVER_ATTR(_name,_mode,_show,_store) | 334 | DRIVER_ATTR(_name, _mode, _show, _store) |
335 | 335 | ||
336 | Creation/Removal: | 336 | Creation/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 | ||
4 | Supported chips: | 4 | Supported 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 @@ | |||
1 | Kernel driver w83792d | ||
2 | ===================== | ||
3 | |||
4 | Supported 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 | |||
10 | Author: Chunhao Huang | ||
11 | Contact: DZShen <DZShen@Winbond.com.tw> | ||
12 | |||
13 | |||
14 | Module 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 | |||
29 | Description | ||
30 | ----------- | ||
31 | |||
32 | This driver implements support for the Winbond W83792AD/D. | ||
33 | |||
34 | Detection of the chip can sometimes be foiled because it can be in an | ||
35 | internal state that allows no clean access (Bank with ID register is not | ||
36 | currently selected). If you know the address of the chip, use a 'force' | ||
37 | parameter; this will put it into a more well-behaved state first. | ||
38 | |||
39 | The driver implements three temperature sensors, seven fan rotation speed | ||
40 | sensors, nine voltage sensors, and two automatic fan regulation | ||
41 | strategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II. | ||
42 | Automatic fan control mode is possible only for fan1-fan3. Fan4-fan7 can run | ||
43 | synchronized with selected fan (fan1-fan3). This functionality and manual PWM | ||
44 | control for fan4-fan7 is not yet implemented. | ||
45 | |||
46 | Temperatures are measured in degrees Celsius and measurement resolution is 1 | ||
47 | degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when | ||
48 | the temperature gets higher than the Overtemperature Shutdown value; it stays | ||
49 | on until the temperature falls below the Hysteresis value. | ||
50 | |||
51 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is | ||
52 | triggered if the rotation speed has dropped below a programmable limit. Fan | ||
53 | readings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or | ||
54 | 128) to give the readings more range or accuracy. | ||
55 | |||
56 | Voltage sensors (also known as IN sensors) report their values in millivolts. | ||
57 | An alarm is triggered if the voltage has crossed a programmable minimum | ||
58 | or maximum limit. | ||
59 | |||
60 | Alarms are provided as output from "realtime status register". Following bits | ||
61 | are defined: | ||
62 | |||
63 | bit - alarm on: | ||
64 | 0 - in0 | ||
65 | 1 - in1 | ||
66 | 2 - temp1 | ||
67 | 3 - temp2 | ||
68 | 4 - temp3 | ||
69 | 5 - fan1 | ||
70 | 6 - fan2 | ||
71 | 7 - fan3 | ||
72 | 8 - in2 | ||
73 | 9 - in3 | ||
74 | 10 - in4 | ||
75 | 11 - in5 | ||
76 | 12 - in6 | ||
77 | 13 - VID change | ||
78 | 14 - chassis | ||
79 | 15 - fan7 | ||
80 | 16 - tart1 | ||
81 | 17 - tart2 | ||
82 | 18 - tart3 | ||
83 | 19 - in7 | ||
84 | 20 - in8 | ||
85 | 21 - fan4 | ||
86 | 22 - fan5 | ||
87 | 23 - fan6 | ||
88 | |||
89 | Tart will be asserted while target temperature cannot be achieved after 3 minutes | ||
90 | of full speed rotation of corresponding fan. | ||
91 | |||
92 | In addition to the alarms described above, there is a CHAS alarm on the chips | ||
93 | which triggers if your computer case is open (This one is latched, contrary | ||
94 | to realtime alarms). | ||
95 | |||
96 | The chips only update values each 3 seconds; reading them more often will | ||
97 | do no harm, but will return 'old' values. | ||
98 | |||
99 | |||
100 | W83792D PROBLEMS | ||
101 | ---------------- | ||
102 | Known 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 | |||
115 | Fan control | ||
116 | ----------- | ||
117 | |||
118 | Manual mode | ||
119 | ----------- | ||
120 | |||
121 | Works as expected. You just need to specify desired PWM/DC value (fan speed) | ||
122 | in appropriate pwm# file. | ||
123 | |||
124 | Thermal cruise | ||
125 | -------------- | ||
126 | |||
127 | In this mode, W83792D provides the Smart Fan system to automatically control | ||
128 | fan speed to keep the temperatures of CPU and the system within specific | ||
129 | range. At first a wanted temperature and interval must be set. This is done | ||
130 | via thermal_cruise# file. The tolerance# file serves to create T +- tolerance | ||
131 | interval. The fan speed will be lowered as long as the current temperature | ||
132 | remains below the thermal_cruise# +- tolerance# value. Once the temperature | ||
133 | exceeds the high limit (T+tolerance), the fan will be turned on with a | ||
134 | specific speed set by pwm# and automatically controlled its PWM duty cycle | ||
135 | with the temperature varying. Three conditions may occur: | ||
136 | |||
137 | (1) If the temperature still exceeds the high limit, PWM duty | ||
138 | cycle will increase slowly. | ||
139 | |||
140 | (2) If the temperature goes below the high limit, but still above the low | ||
141 | limit (T-tolerance), the fan speed will be fixed at the current speed because | ||
142 | the temperature is in the target range. | ||
143 | |||
144 | (3) If the temperature goes below the low limit, PWM duty cycle will decrease | ||
145 | slowly to 0 or a preset stop value until the temperature exceeds the low | ||
146 | limit. (The preset stop value handling is not yet implemented in driver) | ||
147 | |||
148 | Smart Fan II | ||
149 | ------------ | ||
150 | |||
151 | W83792D also provides a special mode for fan. Four temperature points are | ||
152 | available. When related temperature sensors detects the temperature in preset | ||
153 | temperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run | ||
154 | on programmed value from sf2_level@_fan#. You need to set four temperatures | ||
155 | for each fan. | ||
156 | |||
157 | |||
158 | /sys files | ||
159 | ---------- | ||
160 | |||
161 | pwm[1-3] - this file stores PWM duty cycle or DC value (fan speed) in range: | ||
162 | 0 (stop) to 255 (full) | ||
163 | pwm[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 | ||
168 | pwm[1-3]_mode - Select PWM of DC mode | ||
169 | * 0 DC | ||
170 | * 1 PWM | ||
171 | thermal_cruise[1-3] - Selects the desired temperature for cruise (degC) | ||
172 | tolerance[1-3] - Value in degrees of Celsius (degC) for +- T | ||
173 | sf2_point[1-4]_fan[1-3] - four temperature points for each fan for Smart Fan II | ||
174 | sf2_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 | |||
4 | Supported chips: | 4 | Supported 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 | ||
11 | Author: Ben Gardner <bgardner@wabtec.com> | 11 | Author: Ben Gardner <bgardner@wabtec.com> |
12 | 12 | ||
13 | 13 | ||
14 | Module 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 | |||
23 | Description | 14 | Description |
24 | ----------- | 15 | ----------- |
25 | 16 | ||
@@ -33,34 +24,85 @@ registers. | |||
33 | 24 | ||
34 | The Maxim MAX6874 is a similar, mostly compatible device, with more intputs | 25 | The Maxim MAX6874 is a similar, mostly compatible device, with more intputs |
35 | and outputs: | 26 | and outputs: |
36 | |||
37 | vin gpi vout | 27 | vin gpi vout |
38 | MAX6874 6 4 8 | 28 | MAX6874 6 4 8 |
39 | MAX6875 4 3 5 | 29 | MAX6875 4 3 5 |
40 | 30 | ||
41 | MAX6874 chips can have four different addresses (as opposed to only two for | 31 | See the datasheet for more information. |
42 | the MAX6875). The additional addresses (0x54 and 0x56) are not probed by | ||
43 | this driver by default, but the probe module parameter can be used if | ||
44 | needed. | ||
45 | |||
46 | See the datasheet for details on how to program the EEPROM. | ||
47 | 32 | ||
48 | 33 | ||
49 | Sysfs entries | 34 | Sysfs entries |
50 | ------------- | 35 | ------------- |
51 | 36 | ||
52 | eeprom_user - 512 bytes of user-defined EEPROM space. Only writable if | 37 | eeprom - 512 bytes of user-defined EEPROM space. |
53 | allow_write was set and register 0x43 is 0. | ||
54 | |||
55 | eeprom_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 | |||
58 | reg_config - 70 bytes of register space. Any changes take affect immediately. | ||
59 | 38 | ||
60 | 39 | ||
61 | General Remarks | 40 | General Remarks |
62 | --------------- | 41 | --------------- |
63 | 42 | ||
64 | A typical application will require that the EEPROMs be programmed once and | 43 | Valid addresses for the MAX6875 are 0x50 and 0x52. |
65 | never altered afterwards. | 44 | Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. |
45 | The driver does not probe any address, so you must force the address. | ||
46 | |||
47 | Example: | ||
48 | $ modprobe max6875 force=0,0x50 | ||
49 | |||
50 | The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple | ||
51 | addresses. For example, for address 0x50, it also reserves 0x51. | ||
52 | The even-address instance is called 'max6875', the odd one is 'max6875 subclient'. | ||
53 | |||
54 | |||
55 | Programming the chip using i2c-dev | ||
56 | ---------------------------------- | ||
57 | |||
58 | Use the i2c-dev interface to access and program the chips. | ||
59 | Reads and writes are performed differently depending on the address range. | ||
60 | |||
61 | The configuration registers are at addresses 0x00 - 0x45. | ||
62 | Use i2c_smbus_write_byte_data() to write a register and | ||
63 | i2c_smbus_read_byte_data() to read a register. | ||
64 | The command is the register number. | ||
65 | |||
66 | Examples: | ||
67 | To write a 1 to register 0x45: | ||
68 | i2c_smbus_write_byte_data(fd, 0x45, 1); | ||
69 | |||
70 | To read register 0x45: | ||
71 | value = i2c_smbus_read_byte_data(fd, 0x45); | ||
72 | |||
73 | |||
74 | The configuration EEPROM is at addresses 0x8000 - 0x8045. | ||
75 | The user EEPROM is at addresses 0x8100 - 0x82ff. | ||
76 | |||
77 | Use i2c_smbus_write_word_data() to write a byte to EEPROM. | ||
78 | |||
79 | The command is the upper byte of the address: 0x80, 0x81, or 0x82. | ||
80 | The 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 | |||
84 | Example: | ||
85 | To write 0x5a to address 0x8003: | ||
86 | i2c_smbus_write_word_data(fd, 0x80, 0x5a03); | ||
87 | |||
88 | |||
89 | Reading data from the EEPROM is a little more complicated. | ||
90 | Use i2c_smbus_write_byte_data() to set the read address and then | ||
91 | i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data. | ||
92 | |||
93 | Example: | ||
94 | To read data starting at offset 0x8100, first set the address: | ||
95 | i2c_smbus_write_byte_data(fd, 0x81, 0x00); | ||
96 | |||
97 | And 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 | |||
104 | The block read should read 16 bytes. | ||
105 | 0x84 is the block read command. | ||
106 | |||
107 | See 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 | |||
115 | If you try to access an adapter from a userspace program, you will have | 115 | If you try to access an adapter from a userspace program, you will have |
116 | to use the /dev interface. You will still have to check whether the | 116 | to use the /dev interface. You will still have to check whether the |
117 | functionality you need is supported, of course. This is done using | 117 | functionality you need is supported, of course. This is done using |
118 | the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2c_detect | 118 | the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect |
119 | program, is below: | 119 | program, 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 @@ | |||
1 | Revision 4, 2004-03-30 | 1 | Revision 5, 2005-07-29 |
2 | Jean Delvare <khali@linux-fr.org> | 2 | Jean Delvare <khali@linux-fr.org> |
3 | Greg KH <greg@kroah.com> | 3 | Greg KH <greg@kroah.com> |
4 | 4 | ||
@@ -17,20 +17,22 @@ yours for best results. | |||
17 | 17 | ||
18 | Technical changes: | 18 | Technical 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 | |||
148 | detection algorithm. | 148 | detection algorithm. |
149 | 149 | ||
150 | You do not have to use this parameter interface; but don't try to use | 150 | You do not have to use this parameter interface; but don't try to use |
151 | function i2c_probe() (or i2c_detect()) if you don't. | 151 | function i2c_probe() if you don't. |
152 | 152 | ||
153 | NOTE: If you want to write a `sensors' driver, the interface is slightly | 153 | NOTE: 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 | ||
158 | Probing classes (i2c) | 158 | Probing classes |
159 | --------------------- | 159 | --------------- |
160 | 160 | ||
161 | All parameters are given as lists of unsigned 16-bit integers. Lists are | 161 | All parameters are given as lists of unsigned 16-bit integers. Lists are |
162 | terminated by I2C_CLIENT_END. | 162 | terminated 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 | ||
180 | Additionally, kind-specific force lists may optionally be defined if | ||
181 | the driver supports several chip kinds. They are grouped in a | ||
182 | NULL-terminated list of pointers named forces, those first element if the | ||
183 | generic force list mentioned above. Each additional list correspond to an | ||
184 | insmod parameter of the form force_<kind>. | ||
185 | |||
180 | Fortunately, as a module writer, you just have to define the `normal_i2c' | 186 | Fortunately, as a module writer, you just have to define the `normal_i2c' |
181 | parameter. The complete declaration could look like this: | 187 | parameter. 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 | |||
198 | If you use the multi-kind form, an enum will be defined for you: | ||
199 | enum chips { any_chip, foo, bar, ... } | ||
200 | You can then (and certainly should) use it in the driver code. | ||
189 | 201 | ||
190 | Note that you *have* to call the defined variable `normal_i2c', | 202 | Note that you *have* to call the defined variable `normal_i2c', |
191 | without any prefix! | 203 | without any prefix! |
192 | 204 | ||
193 | 205 | ||
194 | Probing classes (sensors) | ||
195 | ------------------------- | ||
196 | |||
197 | If you write a `sensors' driver, you use a slightly different interface. | ||
198 | As well as I2C addresses, we have to cope with ISA addresses. Also, we | ||
199 | use a enum of chip types. Don't forget to include `sensors.h'. | ||
200 | |||
201 | The 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 | |||
217 | Also 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 | |||
226 | So we have a generic insmod variabled `force', and chip-specific variables | ||
227 | `force_CHIPNAME'. | ||
228 | |||
229 | Fortunately, as a module writer, you just have to define the `normal_i2c' | ||
230 | and `normal_isa' parameters, and define what chip names are used. | ||
231 | The 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 | |||
241 | If you have one chip, you use macro SENSORS_INSMOD_1(chip), if you have 2 | ||
242 | you use macro SENSORS_INSMOD_2(chip1,chip2), etc. If you do not want to | ||
243 | bother with chip types, you can use SENSORS_INSMOD_0. | ||
244 | |||
245 | A enum is automatically defined as follows: | ||
246 | enum chips { any_chip, chip1, chip2, ... } | ||
247 | |||
248 | |||
249 | Attaching to an adapter | 206 | Attaching 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 | ||
267 | For `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 | |||
274 | Remember, structure `addr_data' is defined by the macros explained above, | 224 | Remember, structure `addr_data' is defined by the macros explained above, |
275 | so you do not have to define it yourself. | 225 | so you do not have to define it yourself. |
276 | 226 | ||
277 | The i2c_probe or i2c_detect function will call the foo_detect_client | 227 | The i2c_probe function will call the foo_detect_client |
278 | function only for those i2c addresses that actually have a device on | 228 | function only for those i2c addresses that actually have a device on |
279 | them (unless a `force' parameter was used). In addition, addresses that | 229 | them (unless a `force' parameter was used). In addition, addresses that |
280 | are already in use (by some other registered client) are skipped. | 230 | are 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. | |||
283 | The detect client function | 233 | The detect client function |
284 | -------------------------- | 234 | -------------------------- |
285 | 235 | ||
286 | The detect client function is called by i2c_probe or i2c_detect. | 236 | The detect client function is called by i2c_probe. The `kind' parameter |
287 | The `kind' parameter contains 0 if this call is due to a `force' | 237 | contains -1 for a probed detection, 0 for a forced detection, or a positive |
288 | parameter, and -1 otherwise (for i2c_detect, it contains 0 if | 238 | number for a forced detection with a chip type forced. |
289 | this call is due to the generic `force' parameter, and the chip type | ||
290 | number if it is due to a specific `force' parameter). | ||
291 | 239 | ||
292 | Below, some things are only needed if this is a `sensors' driver. Those | 240 | Below, some things are only needed if this is a `sensors' driver. Those |
293 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ | 241 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ |
294 | markers. | 242 | markers. |
295 | 243 | ||
296 | This function should only return an error (any value != 0) if there is | 244 | Returning an error different from -ENODEV in a detect function will cause |
297 | some reason why no more detection should be done anymore. If the | 245 | the detection to stop: other addresses and adapters won't be scanned. |
298 | detection just fails for this address, return 0. | 246 | This should only be done on fatal or internal errors, such as a memory |
247 | shortage or i2c_attach_client failing. | ||
299 | 248 | ||
300 | For now, you can ignore the `flags' parameter. It is there for future use. | 249 | For 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 | ||
7 | On the i386 platform, the Linux kernel uses a rather complicated boot | 7 | On the i386 platform, the Linux kernel uses a rather complicated boot |
8 | convention. This has evolved partially due to historical aspects, as | 8 | convention. 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. | |||
34 | Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible | 34 | Protocol 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 | ||
37 | Protocol 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: | |||
103 | Offset Proto Name Meaning | 105 | Offset Proto Name Meaning |
104 | /Size | 106 | /Size |
105 | 107 | ||
106 | 01F1/1 ALL setup_sects The size of the setup in sectors | 108 | 01F1/1 ALL(1 setup_sects The size of the setup in sectors |
107 | 01F2/2 ALL root_flags If set, the root is mounted readonly | 109 | 01F2/2 ALL root_flags If set, the root is mounted readonly |
108 | 01F4/2 ALL syssize DO NOT USE - for bootsect.S use only | 110 | 01F4/4 2.04+(2 syssize The size of the 32-bit code in 16-byte paras |
109 | 01F6/2 ALL swap_dev DO NOT USE - obsolete | ||
110 | 01F8/2 ALL ram_size DO NOT USE - for bootsect.S use only | 111 | 01F8/2 ALL ram_size DO NOT USE - for bootsect.S use only |
111 | 01FA/2 ALL vid_mode Video mode control | 112 | 01FA/2 ALL vid_mode Video mode control |
112 | 01FC/2 ALL root_dev Default root device number | 113 | 01FC/2 ALL root_dev Default root device number |
@@ -129,8 +130,12 @@ Offset Proto Name Meaning | |||
129 | 0228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line | 130 | 0228/4 2.02+ cmd_line_ptr 32-bit pointer to the kernel command line |
130 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address | 131 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address |
131 | 132 | ||
132 | For backwards compatibility, if the setup_sects field contains 0, the | 133 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
133 | real 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 | ||
135 | If the "HdrS" (0x53726448) magic number is not found at offset 0x202, | 140 | If the "HdrS" (0x53726448) magic number is not found at offset 0x202, |
136 | the boot protocol version is "old". Loading an old kernel, the | 141 | the 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 | |||
230 | relevant to the boot loader itself, see "special command line options" | 235 | relevant to the boot loader itself, see "special command line options" |
231 | below. | 236 | below. |
232 | 237 | ||
233 | The kernel command line is a null-terminated string up to 255 | 238 | The kernel command line is a null-terminated string currently up to |
234 | characters long, plus the final null. | 239 | 255 characters long, plus the final null. A string that is too long |
240 | will be automatically truncated by the kernel, a boot loader may allow | ||
241 | a longer command line to be passed to permit future kernels to extend | ||
242 | this limit. | ||
235 | 243 | ||
236 | If the boot protocol version is 2.02 or later, the address of the | 244 | If the boot protocol version is 2.02 or later, the address of the |
237 | kernel command line is given by the header field cmd_line_ptr (see | 245 | kernel command line is given by the header field cmd_line_ptr (see |
238 | above.) | 246 | above.) This address can be anywhere between the end of the setup |
247 | heap and 0xA0000. | ||
239 | 248 | ||
240 | If the protocol version is *not* 2.02 or higher, the kernel | 249 | If the protocol version is *not* 2.02 or higher, the kernel |
241 | command line is entered using the following protocol: | 250 | command 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 | ||
257 | As a sample configuration, assume the following layout of the real | 266 | As a sample configuration, assume the following layout of the real |
258 | mode segment: | 267 | mode 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 | ||
315 | The non-real-mode kernel starts at offset (setup_sects+1)*512 in the | 324 | The 32-bit (non-real-mode) kernel starts at offset (setup_sects+1)*512 |
316 | kernel file (again, if setup_sects == 0 the real value is 4.) It | 325 | in the kernel file (again, if setup_sects == 0 the real value is 4.) |
317 | should be loaded at address 0x10000 for Image/zImage kernels and | 326 | It should be loaded at address 0x10000 for Image/zImage kernels and |
318 | 0x100000 for bzImage kernels. | 327 | 0x100000 for bzImage kernels. |
319 | 328 | ||
320 | The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 | 329 | The 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 @@ | |||
1 | Author: Andreas Steinmetz <ast@domdv.de> | ||
2 | |||
3 | |||
4 | How to use dm-crypt and swsusp together: | ||
5 | ======================================== | ||
6 | |||
7 | Some prerequisites: | ||
8 | You know how dm-crypt works. If not, visit the following web page: | ||
9 | http://www.saout.de/misc/dm-crypt/ | ||
10 | You have read Documentation/power/swsusp.txt and understand it. | ||
11 | You did read Documentation/initrd.txt and know how an initrd works. | ||
12 | You know how to create or how to modify an initrd. | ||
13 | |||
14 | Now your system is properly set up, your disk is encrypted except for | ||
15 | the swap device(s) and the boot partition which may contain a mini | ||
16 | system for crypto setup and/or rescue purposes. You may even have | ||
17 | an initrd that does your current crypto setup already. | ||
18 | |||
19 | At this point you want to encrypt your swap, too. Still you want to | ||
20 | be able to suspend using swsusp. This, however, means that you | ||
21 | have to be able to either enter a passphrase or that you read | ||
22 | the key(s) from an external device like a pcmcia flash disk | ||
23 | or an usb stick prior to resume. So you need an initrd, that sets | ||
24 | up dm-crypt and then asks swsusp to resume from the encrypted | ||
25 | swap device. | ||
26 | |||
27 | The most important thing is that you set up dm-crypt in such | ||
28 | a way that the swap device you suspend to/resume from has | ||
29 | always the same major/minor within the initrd as well as | ||
30 | within your running system. The easiest way to achieve this is | ||
31 | to always set up this swap device first with dmsetup, so that | ||
32 | it will always look like the following: | ||
33 | |||
34 | brw------- 1 root root 254, 0 Jul 28 13:37 /dev/mapper/swap0 | ||
35 | |||
36 | Now set up your kernel to use /dev/mapper/swap0 as the default | ||
37 | resume partition, so your kernel .config contains: | ||
38 | |||
39 | CONFIG_PM_STD_PARTITION="/dev/mapper/swap0" | ||
40 | |||
41 | Prepare your boot loader to use the initrd you will create or | ||
42 | modify. For lilo the simplest setup looks like the following | ||
43 | lines: | ||
44 | |||
45 | image=/boot/vmlinuz | ||
46 | initrd=/boot/initrd.gz | ||
47 | label=linux | ||
48 | append="root=/dev/ram0 init=/linuxrc rw" | ||
49 | |||
50 | Finally you need to create or modify your initrd. Lets assume | ||
51 | you create an initrd that reads the required dm-crypt setup | ||
52 | from a pcmcia flash disk card. The card is formatted with an ext2 | ||
53 | fs which resides on /dev/hde1 when the card is inserted. The | ||
54 | card contains at least the encrypted swap setup in a file | ||
55 | named "swapkey". /etc/fstab of your initrd contains something | ||
56 | like the following: | ||
57 | |||
58 | /dev/hda1 /mnt ext3 ro 0 0 | ||
59 | none /proc proc defaults,noatime,nodiratime 0 0 | ||
60 | none /sys sysfs defaults,noatime,nodiratime 0 0 | ||
61 | |||
62 | /dev/hda1 contains an unencrypted mini system that sets up all | ||
63 | of your crypto devices, again by reading the setup from the | ||
64 | pcmcia flash disk. What follows now is a /linuxrc for your | ||
65 | initrd that allows you to resume from encrypted swap and that | ||
66 | continues boot with your mini system on /dev/hda1 if resume | ||
67 | does not happen: | ||
68 | |||
69 | #!/bin/sh | ||
70 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
71 | mount /proc | ||
72 | mount /sys | ||
73 | mapped=0 | ||
74 | noresume=`grep -c noresume /proc/cmdline` | ||
75 | if [ "$*" != "" ] | ||
76 | then | ||
77 | noresume=1 | ||
78 | fi | ||
79 | dmesg -n 1 | ||
80 | /sbin/cardmgr -q | ||
81 | for i in 1 2 3 4 5 6 7 8 9 0 | ||
82 | do | ||
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 | ||
95 | done | ||
96 | killproc /sbin/cardmgr | ||
97 | dmesg -n 6 | ||
98 | if [ $mapped = 1 ] | ||
99 | then | ||
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 | ||
106 | fi | ||
107 | umount /sys | ||
108 | mount /mnt | ||
109 | umount /proc | ||
110 | cd /mnt | ||
111 | pivot_root . mnt | ||
112 | mount /proc | ||
113 | umount -l /mnt | ||
114 | umount /proc | ||
115 | exec chroot . /sbin/init $* < dev/console > dev/console 2>&1 | ||
116 | |||
117 | Please don't mind the weird loop above, busybox's msh doesn't know | ||
118 | the let statement. Now, what is happening in the script? | ||
119 | First we have to decide if we want to try to resume, or not. | ||
120 | We will not resume if booting with "noresume" or any parameters | ||
121 | for init like "single" or "emergency" as boot parameters. | ||
122 | |||
123 | Then we need to set up dmcrypt with the setup data from the | ||
124 | pcmcia flash disk. If this succeeds we need to reset the swap | ||
125 | device if we don't want to resume. The line "echo 254:0 > /sys/power/resume" | ||
126 | then attempts to resume from the first device mapper device. | ||
127 | Note that it is important to set the device in /sys/power/resume, | ||
128 | regardless if resuming or not, otherwise later suspend will fail. | ||
129 | If resume starts, script execution terminates here. | ||
130 | |||
131 | Otherwise we just remove the encrypted swap device and leave it to the | ||
132 | mini system on /dev/hda1 to set the whole crypto up (it is up to | ||
133 | you to modify this to your taste). | ||
134 | |||
135 | What then follows is the well known process to change the root | ||
136 | file system and continue booting from there. I prefer to unmount | ||
137 | the initrd prior to continue booting but it is up to you to modify | ||
138 | this. | ||
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 @@ | |||
1 | From kernel/suspend.c: | 1 | Some 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 | |||
30 | echo platform > /sys/power/disk; echo disk > /sys/power/state | 28 | echo platform > /sys/power/disk; echo disk > /sys/power/state |
31 | 29 | ||
32 | 30 | ||
31 | Encrypted suspend image: | ||
32 | ------------------------ | ||
33 | If you want to store your suspend image encrypted with a temporary | ||
34 | key to prevent data gathering after resume you must compile | ||
35 | crypto and the aes algorithm into the kernel - modules won't work | ||
36 | as they cannot be loaded at resume time. | ||
37 | |||
33 | 38 | ||
34 | Article about goals and implementation of Software Suspend for Linux | 39 | Article about goals and implementation of Software Suspend for Linux |
35 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -85,11 +90,6 @@ resume. | |||
85 | You have your server on UPS. Power died, and UPS is indicating 30 | 90 | You have your server on UPS. Power died, and UPS is indicating 30 |
86 | seconds to failure. What do you do? Suspend to disk. | 91 | seconds to failure. What do you do? Suspend to disk. |
87 | 92 | ||
88 | Ethernet card in your server died. You want to replace it. Your | ||
89 | server is not hotplug capable. What do you do? Suspend to disk, | ||
90 | replace ethernet card, resume. If you are fast your users will not | ||
91 | even see broken connections. | ||
92 | |||
93 | 93 | ||
94 | Q: Maybe I'm missing something, but why don't the regular I/O paths work? | 94 | Q: 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 | ||
118 | A: Yes. That's what echo platform > /sys/power/disk does. | 118 | A: Yes. That's what echo platform > /sys/power/disk does. |
119 | 119 | ||
120 | Q: My machine doesn't work with ACPI. How can I use swsusp than ? | ||
121 | |||
122 | A: Do a reboot() syscall with right parameters. Warning: glibc gets in | ||
123 | its way, so check with strace: | ||
124 | |||
125 | reboot(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 | |||
136 | int main() | ||
137 | { | ||
138 | syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, | ||
139 | LINUX_REBOOT_CMD_SW_SUSPEND, 0); | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | Also /sys/ interface should be still present. | ||
144 | |||
145 | Q: What is 'suspend2'? | 120 | Q: What is 'suspend2'? |
146 | 121 | ||
147 | A: suspend2 is 'Software Suspend 2', a forked implementation of | 122 | A: 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 | |||
311 | system is shut down or suspended. Additionally use the encrypted | 286 | system is shut down or suspended. Additionally use the encrypted |
312 | suspend image to prevent sensitive data from being stolen after | 287 | suspend image to prevent sensitive data from being stolen after |
313 | resume. | 288 | resume. |
289 | |||
290 | Q: Why can't we suspend to a swap file? | ||
291 | |||
292 | A: Because accessing swap file needs the filesystem mounted, and | ||
293 | filesystem might do something wrong (like replaying the journal) | ||
294 | during mount. | ||
295 | |||
296 | There are few ways to get that fixed: | ||
297 | |||
298 | 1) Probably could be solved by modifying every filesystem to support | ||
299 | some kind of "really read-only!" option. Patches welcome. | ||
300 | |||
301 | 2) suspend2 gets around that by storing absolute positions in on-disk | ||
302 | image (and blocksize), with resume parameter pointing directly to | ||
303 | suspend header. | ||
304 | |||
305 | Q: Is there a maximum system RAM size that is supported by swsusp? | ||
306 | |||
307 | A: It should work okay with highmem. | ||
308 | |||
309 | Q: Does swsusp (to disk) use only one swap partition or can it use | ||
310 | multiple swap partitions (aggregate them into one logical space)? | ||
311 | |||
312 | A: Only one swap partition, sorry. | ||
313 | |||
314 | Q: 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 | ||
316 | to be useless to try to suspend to disk while that app is running? | ||
317 | |||
318 | A: No, it should work okay, as long as your app does not mlock() | ||
319 | it. Just prepare big enough swap partition. | ||
320 | |||
321 | Q: What information is usefull for debugging suspend-to-disk problems? | ||
322 | |||
323 | A: Well, last messages on the screen are always useful. If something | ||
324 | is broken, it is usually some kernel driver, therefore trying with as | ||
325 | little as possible modules loaded helps a lot. I also prefer people to | ||
326 | suspend from console, preferably without X running. Booting with | ||
327 | init=/bin/bash, then swapon and starting suspend sequence manually | ||
328 | usually does the trick. Then it is good idea to try with latest | ||
329 | vanilla 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 | |||
49 | Now, if you pass acpi_sleep=something, and it does not work with your | 55 | Now, if you pass acpi_sleep=something, and it does not work with your |
50 | bios, you'll get a hard crash during resume. Be careful. Also it is | 56 | bios, you'll get a hard crash during resume. Be careful. Also it is |
51 | safest to do your experiments with plain old VGA console. The vesafb | 57 | safest to do your experiments with plain old VGA console. The vesafb |
@@ -64,7 +70,8 @@ Model hack (or "how to do it") | |||
64 | ------------------------------------------------------------------------------ | 70 | ------------------------------------------------------------------------------ |
65 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI | 71 | Acer Aspire 1406LC ole's late BIOS init (7), turn off DRI |
66 | Acer TM 242FX vbetool (6) | 72 | Acer TM 242FX vbetool (6) |
67 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) | 73 | Acer TM C110 video_post (8) |
74 | Acer TM C300 vga=normal (only suspend on console, not in X), vbetool (6) or video_post (8) | ||
68 | Acer TM 4052LCi s3_bios (2) | 75 | Acer TM 4052LCi s3_bios (2) |
69 | Acer TM 636Lci s3_bios vga=normal (2) | 76 | Acer TM 636Lci s3_bios vga=normal (2) |
70 | Acer TM 650 (Radeon M7) vga=normal plus boot-radeon (5) gets text console back | 77 | Acer 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) | |||
113 | IBM TP X20 ??? (*) | 120 | IBM TP X20 ??? (*) |
114 | IBM TP X30 s3_bios (2) | 121 | IBM TP X30 s3_bios (2) |
115 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. | 122 | IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. |
123 | IBM TP X32 none (1), but backlight is on and video is trashed after long suspend | ||
116 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) | 124 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) |
117 | Medion MD4220 ??? (*) | 125 | Medion MD4220 ??? (*) |
118 | Samsung P35 vbetool needed (6) | 126 | Samsung 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 | ||
133 | 2. Version History | 133 | 2. 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 | **/ | ||
477 | void 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 | **/ | ||
583 | int 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 | |||
83 | vmtruncate) does not lose sending ipi's to cloned threads that might | 83 | vmtruncate) does not lose sending ipi's to cloned threads that might |
84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. | 84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. |
85 | 85 | ||
86 | swap_list_lock/swap_device_lock | 86 | swap_lock |
87 | ------------------------------- | 87 | -------------- |
88 | The swap devices are chained in priority order from the "swap_list" header. | 88 | The swap devices are chained in priority order from the "swap_list" header. |
89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. | 89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. |
90 | The #free swaphandles is maintained in "nr_swap_pages". These two together | 90 | The #free swaphandles is maintained in "nr_swap_pages". These two together |
91 | are protected by the swap_list_lock. | 91 | are protected by the swap_lock. |
92 | 92 | ||
93 | The swap_device_lock, which is per swap device, protects the reference | 93 | The swap_lock also protects all the device reference counts on the |
94 | counts on the corresponding swaphandles, maintained in the "swap_map" | 94 | corresponding swaphandles, maintained in the "swap_map" array, and the |
95 | array, and the "highest_bit" and "lowest_bit" fields. | 95 | "highest_bit" and "lowest_bit" fields. |
96 | 96 | ||
97 | Both of these are spinlocks, and are never acquired from intr level. The | 97 | The swap_lock is a spinlock, and is never acquired from intr level. |
98 | locking hierarchy is swap_list_lock -> swap_device_lock. | ||
99 | 98 | ||
100 | To prevent races between swap space deletion or async readahead swapins | 99 | To prevent races between swap space deletion or async readahead swapins |
101 | deciding whether a swap handle is being used, ie worthy of being read in | 100 | deciding 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 | ||
231 | booke_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 | |||
231 | eurotechwdt.c -- Eurotech CPU-1220/1410 | 251 | eurotechwdt.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 |