diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/IPMI.txt | 13 | ||||
-rw-r--r-- | Documentation/RCU/NMI-RCU.txt | 112 | ||||
-rw-r--r-- | Documentation/cdrom/sonycd535 | 3 | ||||
-rw-r--r-- | Documentation/cpusets.txt | 12 | ||||
-rw-r--r-- | Documentation/dcdbas.txt | 91 | ||||
-rw-r--r-- | Documentation/dell_rbu.txt | 74 | ||||
-rw-r--r-- | Documentation/dvb/bt8xx.txt | 2 | ||||
-rw-r--r-- | Documentation/exception.txt | 2 | ||||
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 16 | ||||
-rw-r--r-- | Documentation/filesystems/relayfs.txt | 362 | ||||
-rw-r--r-- | Documentation/i386/boot.txt | 35 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 5 | ||||
-rw-r--r-- | Documentation/power/swsusp.txt | 101 | ||||
-rw-r--r-- | Documentation/power/video.txt | 1 | ||||
-rw-r--r-- | Documentation/sonypi.txt | 10 |
15 files changed, 756 insertions, 83 deletions
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/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 363909056e46..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 |
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/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/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.txt b/Documentation/power/swsusp.txt index ddf907fbcc05..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 |
@@ -312,9 +287,45 @@ 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. |
314 | 289 | ||
315 | Q: Why we cannot suspend to a swap file? | 290 | Q: Why can't we suspend to a swap file? |
316 | 291 | ||
317 | A: Because accessing swap file needs the filesystem mounted, and | 292 | A: Because accessing swap file needs the filesystem mounted, and |
318 | filesystem might do something wrong (like replaying the journal) | 293 | filesystem might do something wrong (like replaying the journal) |
319 | during mount. [Probably could be solved by modifying every filesystem | 294 | during mount. |
320 | to support some kind of "really read-only!" option. Patches welcome.] | 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 1a44e8acb54c..526d6dd267ea 100644 --- a/Documentation/power/video.txt +++ b/Documentation/power/video.txt | |||
@@ -120,6 +120,7 @@ IBM ThinkPad T42p (2373-GTG) s3_bios (2) | |||
120 | IBM TP X20 ??? (*) | 120 | IBM TP X20 ??? (*) |
121 | IBM TP X30 s3_bios (2) | 121 | IBM TP X30 s3_bios (2) |
122 | 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 | ||
123 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) | 124 | IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) |
124 | Medion MD4220 ??? (*) | 125 | Medion MD4220 ??? (*) |
125 | Samsung P35 vbetool needed (6) | 126 | Samsung P35 vbetool needed (6) |
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. |