diff options
Diffstat (limited to 'Documentation')
142 files changed, 4892 insertions, 743 deletions
diff --git a/Documentation/ABI/removed/devfs b/Documentation/ABI/removed/devfs index 8195c4e0d0a1..8ffd28bf6598 100644 --- a/Documentation/ABI/removed/devfs +++ b/Documentation/ABI/removed/devfs | |||
@@ -6,7 +6,7 @@ Description: | |||
6 | races, contains a naming policy within the kernel that is | 6 | races, contains a naming policy within the kernel that is |
7 | against the LSB, and can be replaced by using udev. | 7 | against the LSB, and can be replaced by using udev. |
8 | The files fs/devfs/*, include/linux/devfs_fs*.h were removed, | 8 | The files fs/devfs/*, include/linux/devfs_fs*.h were removed, |
9 | along with the the assorted devfs function calls throughout the | 9 | along with the assorted devfs function calls throughout the |
10 | kernel tree. | 10 | kernel tree. |
11 | 11 | ||
12 | Users: | 12 | Users: |
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 9069189e78ef..afc286775891 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle | |||
@@ -160,6 +160,21 @@ supply of new-lines on your screen is not a renewable resource (think | |||
160 | 25-line terminal screens here), you have more empty lines to put | 160 | 25-line terminal screens here), you have more empty lines to put |
161 | comments on. | 161 | comments on. |
162 | 162 | ||
163 | Do not unnecessarily use braces where a single statement will do. | ||
164 | |||
165 | if (condition) | ||
166 | action(); | ||
167 | |||
168 | This does not apply if one branch of a conditional statement is a single | ||
169 | statement. Use braces in both branches. | ||
170 | |||
171 | if (condition) { | ||
172 | do_this(); | ||
173 | do_that(); | ||
174 | } else { | ||
175 | otherwise(); | ||
176 | } | ||
177 | |||
163 | 3.1: Spaces | 178 | 3.1: Spaces |
164 | 179 | ||
165 | Linux kernel style for use of spaces depends (mostly) on | 180 | Linux kernel style for use of spaces depends (mostly) on |
@@ -625,7 +640,7 @@ language. | |||
625 | 640 | ||
626 | There appears to be a common misperception that gcc has a magic "make me | 641 | There appears to be a common misperception that gcc has a magic "make me |
627 | faster" speedup option called "inline". While the use of inlines can be | 642 | faster" speedup option called "inline". While the use of inlines can be |
628 | appropriate (for example as a means of replacing macros, see Chapter 11), it | 643 | appropriate (for example as a means of replacing macros, see Chapter 12), it |
629 | very often is not. Abundant use of the inline keyword leads to a much bigger | 644 | very often is not. Abundant use of the inline keyword leads to a much bigger |
630 | kernel, which in turn slows the system as a whole down, due to a bigger | 645 | kernel, which in turn slows the system as a whole down, due to a bigger |
631 | icache footprint for the CPU and simply because there is less memory | 646 | icache footprint for the CPU and simply because there is less memory |
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 867608ab3ca0..6fd1646d3204 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -41,8 +41,9 @@ psdocs: $(PS) | |||
41 | PDF := $(patsubst %.xml, %.pdf, $(BOOKS)) | 41 | PDF := $(patsubst %.xml, %.pdf, $(BOOKS)) |
42 | pdfdocs: $(PDF) | 42 | pdfdocs: $(PDF) |
43 | 43 | ||
44 | HTML := $(patsubst %.xml, %.html, $(BOOKS)) | 44 | HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) |
45 | htmldocs: $(HTML) | 45 | htmldocs: $(HTML) |
46 | $(call build_main_index) | ||
46 | 47 | ||
47 | MAN := $(patsubst %.xml, %.9, $(BOOKS)) | 48 | MAN := $(patsubst %.xml, %.9, $(BOOKS)) |
48 | mandocs: $(MAN) | 49 | mandocs: $(MAN) |
@@ -132,10 +133,17 @@ quiet_cmd_db2pdf = PDF $@ | |||
132 | %.pdf : %.xml | 133 | %.pdf : %.xml |
133 | $(call cmd,db2pdf) | 134 | $(call cmd,db2pdf) |
134 | 135 | ||
136 | |||
137 | main_idx = Documentation/DocBook/index.html | ||
138 | build_main_index = rm -rf $(main_idx) && \ | ||
139 | echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ | ||
140 | echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ | ||
141 | cat $(HTML) >> $(main_idx) | ||
142 | |||
135 | quiet_cmd_db2html = HTML $@ | 143 | quiet_cmd_db2html = HTML $@ |
136 | cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ | 144 | cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ |
137 | echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ | 145 | echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ |
138 | Goto $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ | 146 | $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ |
139 | 147 | ||
140 | %.html: %.xml | 148 | %.html: %.xml |
141 | @(which xmlto > /dev/null 2>&1) || \ | 149 | @(which xmlto > /dev/null 2>&1) || \ |
@@ -152,6 +160,7 @@ quiet_cmd_db2man = MAN $@ | |||
152 | @(which xmlto > /dev/null 2>&1) || \ | 160 | @(which xmlto > /dev/null 2>&1) || \ |
153 | (echo "*** You need to install xmlto ***"; \ | 161 | (echo "*** You need to install xmlto ***"; \ |
154 | exit 1) | 162 | exit 1) |
163 | $(Q)mkdir -p $(obj)/man | ||
155 | $(call cmd,db2man) | 164 | $(call cmd,db2man) |
156 | @touch $@ | 165 | @touch $@ |
157 | 166 | ||
@@ -212,11 +221,7 @@ clean-files := $(DOCBOOKS) \ | |||
212 | $(patsubst %.xml, %.9, $(DOCBOOKS)) \ | 221 | $(patsubst %.xml, %.9, $(DOCBOOKS)) \ |
213 | $(C-procfs-example) | 222 | $(C-procfs-example) |
214 | 223 | ||
215 | clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) | 224 | clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man |
216 | |||
217 | #man put files in man subdir - traverse down | ||
218 | subdir- := man/ | ||
219 | |||
220 | 225 | ||
221 | # Declare the contents of the .PHONY variable as phony. We keep that | 226 | # Declare the contents of the .PHONY variable as phony. We keep that |
222 | # information in a variable se we can use it in if_changed and friends. | 227 | # information in a variable se we can use it in if_changed and friends. |
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index b61dfc79e1b8..38f88b6ae405 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -84,6 +84,10 @@ X!Iinclude/linux/kobject.h | |||
84 | !Ekernel/rcupdate.c | 84 | !Ekernel/rcupdate.c |
85 | </sect1> | 85 | </sect1> |
86 | 86 | ||
87 | <sect1><title>Device Resource Management</title> | ||
88 | !Edrivers/base/devres.c | ||
89 | </sect1> | ||
90 | |||
87 | </chapter> | 91 | </chapter> |
88 | 92 | ||
89 | <chapter id="adt"> | 93 | <chapter id="adt"> |
@@ -576,4 +580,67 @@ X!Idrivers/video/console/fonts.c | |||
576 | !Edrivers/input/ff-core.c | 580 | !Edrivers/input/ff-core.c |
577 | !Edrivers/input/ff-memless.c | 581 | !Edrivers/input/ff-memless.c |
578 | </chapter> | 582 | </chapter> |
583 | |||
584 | <chapter id="spi"> | ||
585 | <title>Serial Peripheral Interface (SPI)</title> | ||
586 | <para> | ||
587 | SPI is the "Serial Peripheral Interface", widely used with | ||
588 | embedded systems because it is a simple and efficient | ||
589 | interface: basically a multiplexed shift register. | ||
590 | Its three signal wires hold a clock (SCK, often in the range | ||
591 | of 1-20 MHz), a "Master Out, Slave In" (MOSI) data line, and | ||
592 | a "Master In, Slave Out" (MISO) data line. | ||
593 | SPI is a full duplex protocol; for each bit shifted out the | ||
594 | MOSI line (one per clock) another is shifted in on the MISO line. | ||
595 | Those bits are assembled into words of various sizes on the | ||
596 | way to and from system memory. | ||
597 | An additional chipselect line is usually active-low (nCS); | ||
598 | four signals are normally used for each peripheral, plus | ||
599 | sometimes an interrupt. | ||
600 | </para> | ||
601 | <para> | ||
602 | The SPI bus facilities listed here provide a generalized | ||
603 | interface to declare SPI busses and devices, manage them | ||
604 | according to the standard Linux driver model, and perform | ||
605 | input/output operations. | ||
606 | At this time, only "master" side interfaces are supported, | ||
607 | where Linux talks to SPI peripherals and does not implement | ||
608 | such a peripheral itself. | ||
609 | (Interfaces to support implementing SPI slaves would | ||
610 | necessarily look different.) | ||
611 | </para> | ||
612 | <para> | ||
613 | The programming interface is structured around two kinds of driver, | ||
614 | and two kinds of device. | ||
615 | A "Controller Driver" abstracts the controller hardware, which may | ||
616 | be as simple as a set of GPIO pins or as complex as a pair of FIFOs | ||
617 | connected to dual DMA engines on the other side of the SPI shift | ||
618 | register (maximizing throughput). Such drivers bridge between | ||
619 | whatever bus they sit on (often the platform bus) and SPI, and | ||
620 | expose the SPI side of their device as a | ||
621 | <structname>struct spi_master</structname>. | ||
622 | SPI devices are children of that master, represented as a | ||
623 | <structname>struct spi_device</structname> and manufactured from | ||
624 | <structname>struct spi_board_info</structname> descriptors which | ||
625 | are usually provided by board-specific initialization code. | ||
626 | A <structname>struct spi_driver</structname> is called a | ||
627 | "Protocol Driver", and is bound to a spi_device using normal | ||
628 | driver model calls. | ||
629 | </para> | ||
630 | <para> | ||
631 | The I/O model is a set of queued messages. Protocol drivers | ||
632 | submit one or more <structname>struct spi_message</structname> | ||
633 | objects, which are processed and completed asynchronously. | ||
634 | (There are synchronous wrappers, however.) Messages are | ||
635 | built from one or more <structname>struct spi_transfer</structname> | ||
636 | objects, each of which wraps a full duplex SPI transfer. | ||
637 | A variety of protocol tweaking options are needed, because | ||
638 | different chips adopt very different policies for how they | ||
639 | use the bits transferred with SPI. | ||
640 | </para> | ||
641 | !Iinclude/linux/spi/spi.h | ||
642 | !Fdrivers/spi/spi.c spi_register_board_info | ||
643 | !Edrivers/spi/spi.c | ||
644 | </chapter> | ||
645 | |||
579 | </book> | 646 | </book> |
diff --git a/Documentation/DocBook/librs.tmpl b/Documentation/DocBook/librs.tmpl index 3ff39bafc00e..94f21361e0ed 100644 --- a/Documentation/DocBook/librs.tmpl +++ b/Documentation/DocBook/librs.tmpl | |||
@@ -79,12 +79,12 @@ | |||
79 | <chapter id="usage"> | 79 | <chapter id="usage"> |
80 | <title>Usage</title> | 80 | <title>Usage</title> |
81 | <para> | 81 | <para> |
82 | This chapter provides examples how to use the library. | 82 | This chapter provides examples of how to use the library. |
83 | </para> | 83 | </para> |
84 | <sect1> | 84 | <sect1> |
85 | <title>Initializing</title> | 85 | <title>Initializing</title> |
86 | <para> | 86 | <para> |
87 | The init function init_rs returns a pointer to a | 87 | The init function init_rs returns a pointer to an |
88 | rs decoder structure, which holds the necessary | 88 | rs decoder structure, which holds the necessary |
89 | information for encoding, decoding and error correction | 89 | information for encoding, decoding and error correction |
90 | with the given polynomial. It either uses an existing | 90 | with the given polynomial. It either uses an existing |
@@ -98,10 +98,10 @@ | |||
98 | static struct rs_control *rs_decoder; | 98 | static struct rs_control *rs_decoder; |
99 | 99 | ||
100 | /* Symbolsize is 10 (bits) | 100 | /* Symbolsize is 10 (bits) |
101 | * Primitve polynomial is x^10+x^3+1 | 101 | * Primitive polynomial is x^10+x^3+1 |
102 | * first consecutive root is 0 | 102 | * first consecutive root is 0 |
103 | * primitve element to generate roots = 1 | 103 | * primitive element to generate roots = 1 |
104 | * generator polinomial degree (number of roots) = 6 | 104 | * generator polynomial degree (number of roots) = 6 |
105 | */ | 105 | */ |
106 | rs_decoder = init_rs (10, 0x409, 0, 1, 6); | 106 | rs_decoder = init_rs (10, 0x409, 0, 1, 6); |
107 | </programlisting> | 107 | </programlisting> |
@@ -116,12 +116,12 @@ rs_decoder = init_rs (10, 0x409, 0, 1, 6); | |||
116 | </para> | 116 | </para> |
117 | <para> | 117 | <para> |
118 | The expanded data can be inverted on the fly by | 118 | The expanded data can be inverted on the fly by |
119 | providing a non zero inversion mask. The expanded data is | 119 | providing a non-zero inversion mask. The expanded data is |
120 | XOR'ed with the mask. This is used e.g. for FLASH | 120 | XOR'ed with the mask. This is used e.g. for FLASH |
121 | ECC, where the all 0xFF is inverted to an all 0x00. | 121 | ECC, where the all 0xFF is inverted to an all 0x00. |
122 | The Reed-Solomon code for all 0x00 is all 0x00. The | 122 | The Reed-Solomon code for all 0x00 is all 0x00. The |
123 | code is inverted before storing to FLASH so it is 0xFF | 123 | code is inverted before storing to FLASH so it is 0xFF |
124 | too. This prevent's that reading from an erased FLASH | 124 | too. This prevents that reading from an erased FLASH |
125 | results in ECC errors. | 125 | results in ECC errors. |
126 | </para> | 126 | </para> |
127 | <para> | 127 | <para> |
@@ -273,7 +273,7 @@ free_rs(rs_decoder); | |||
273 | May be used under the terms of the GNU General Public License (GPL) | 273 | May be used under the terms of the GNU General Public License (GPL) |
274 | </programlisting> | 274 | </programlisting> |
275 | <para> | 275 | <para> |
276 | The wrapper functions and interfaces are written by Thomas Gleixner | 276 | The wrapper functions and interfaces are written by Thomas Gleixner. |
277 | </para> | 277 | </para> |
278 | <para> | 278 | <para> |
279 | Many users have provided bugfixes, improvements and helping hands for testing. | 279 | Many users have provided bugfixes, improvements and helping hands for testing. |
diff --git a/Documentation/DocBook/man/Makefile b/Documentation/DocBook/man/Makefile deleted file mode 100644 index 4fb7ea0f7ac8..000000000000 --- a/Documentation/DocBook/man/Makefile +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # Rules are put in Documentation/DocBook | ||
2 | |||
3 | clean-files := *.9.gz *.sgml manpage.links manpage.refs | ||
diff --git a/Documentation/MSI-HOWTO.txt b/Documentation/MSI-HOWTO.txt index d389388c733e..0d8240774fca 100644 --- a/Documentation/MSI-HOWTO.txt +++ b/Documentation/MSI-HOWTO.txt | |||
@@ -480,8 +480,8 @@ The PCI stack provides 3 possible levels of MSI disabling: | |||
480 | 480 | ||
481 | 6.1. Disabling MSI on a single device | 481 | 6.1. Disabling MSI on a single device |
482 | 482 | ||
483 | Under some circumstances, it might be required to disable MSI on a | 483 | Under some circumstances it might be required to disable MSI on a |
484 | single device, It may be achived by either not calling pci_enable_msi() | 484 | single device. This may be achieved by either not calling pci_enable_msi() |
485 | or all, or setting the pci_dev->no_msi flag before (most of the time | 485 | or all, or setting the pci_dev->no_msi flag before (most of the time |
486 | in a quirk). | 486 | in a quirk). |
487 | 487 | ||
@@ -492,7 +492,7 @@ being able to route MSI between busses. In this case, MSI have to be | |||
492 | disabled on all devices behind this bridge. It is achieves by setting | 492 | disabled on all devices behind this bridge. It is achieves by setting |
493 | the PCI_BUS_FLAGS_NO_MSI flag in the pci_bus->bus_flags of the bridge | 493 | the PCI_BUS_FLAGS_NO_MSI flag in the pci_bus->bus_flags of the bridge |
494 | subordinate bus. There is no need to set the same flag on bridges that | 494 | subordinate bus. There is no need to set the same flag on bridges that |
495 | are below the broken brigde. When pci_enable_msi() is called to enable | 495 | are below the broken bridge. When pci_enable_msi() is called to enable |
496 | MSI on a device, pci_msi_supported() takes care of checking the NO_MSI | 496 | MSI on a device, pci_msi_supported() takes care of checking the NO_MSI |
497 | flag in all parent busses of the device. | 497 | flag in all parent busses of the device. |
498 | 498 | ||
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index bd23dc0bc0c7..6491b2c45dd4 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -80,3 +80,7 @@ kernel patches. | |||
80 | 23: Tested after it has been merged into the -mm patchset to make sure | 80 | 23: Tested after it has been merged into the -mm patchset to make sure |
81 | that it still works with all of the other queued patches and various | 81 | that it still works with all of the other queued patches and various |
82 | changes in the VM, VFS, and other subsystems. | 82 | changes in the VM, VFS, and other subsystems. |
83 | |||
84 | 24: Avoid whitespace damage such as indenting with spaces or whitespace | ||
85 | at the end of lines. You can test this by feeding the patch to | ||
86 | "git apply --check --whitespace=error-all" | ||
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers index 58bead05eabb..d7e26427e426 100644 --- a/Documentation/SubmittingDrivers +++ b/Documentation/SubmittingDrivers | |||
@@ -87,6 +87,21 @@ Clarity: It helps if anyone can see how to fix the driver. It helps | |||
87 | driver that intentionally obfuscates how the hardware works | 87 | driver that intentionally obfuscates how the hardware works |
88 | it will go in the bitbucket. | 88 | it will go in the bitbucket. |
89 | 89 | ||
90 | PM support: Since Linux is used on many portable and desktop systems, your | ||
91 | driver is likely to be used on such a system and therefore it | ||
92 | should support basic power management by implementing, if | ||
93 | necessary, the .suspend and .resume methods used during the | ||
94 | system-wide suspend and resume transitions. You should verify | ||
95 | that your driver correctly handles the suspend and resume, but | ||
96 | if you are unable to ensure that, please at least define the | ||
97 | .suspend method returning the -ENOSYS ("Function not | ||
98 | implemented") error. You should also try to make sure that your | ||
99 | driver uses as little power as possible when it's not doing | ||
100 | anything. For the driver testing instructions see | ||
101 | Documentation/power/drivers-testing.txt and for a relatively | ||
102 | complete overview of the power management issues related to | ||
103 | drivers see Documentation/power/devices.txt . | ||
104 | |||
90 | Control: In general if there is active maintainance of a driver by | 105 | Control: In general if there is active maintainance of a driver by |
91 | the author then patches will be redirected to them unless | 106 | the author then patches will be redirected to them unless |
92 | they are totally obvious and without need of checking. | 107 | they are totally obvious and without need of checking. |
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index b0d0043f7c46..a417b25fb1aa 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -363,7 +363,8 @@ area or subsystem of the kernel is being patched. | |||
363 | The "summary phrase" in the email's Subject should concisely | 363 | The "summary phrase" in the email's Subject should concisely |
364 | describe the patch which that email contains. The "summary | 364 | describe the patch which that email contains. The "summary |
365 | phrase" should not be a filename. Do not use the same "summary | 365 | phrase" should not be a filename. Do not use the same "summary |
366 | phrase" for every patch in a whole patch series. | 366 | phrase" for every patch in a whole patch series (where a "patch |
367 | series" is an ordered sequence of multiple, related patches). | ||
367 | 368 | ||
368 | Bear in mind that the "summary phrase" of your email becomes | 369 | Bear in mind that the "summary phrase" of your email becomes |
369 | a globally-unique identifier for that patch. It propagates | 370 | a globally-unique identifier for that patch. It propagates |
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index e9126e794ed7..71acc28ed0d1 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c | |||
@@ -61,8 +61,6 @@ __u64 stime, utime; | |||
61 | #define MAX_MSG_SIZE 1024 | 61 | #define MAX_MSG_SIZE 1024 |
62 | /* Maximum number of cpus expected to be specified in a cpumask */ | 62 | /* Maximum number of cpus expected to be specified in a cpumask */ |
63 | #define MAX_CPUS 32 | 63 | #define MAX_CPUS 32 |
64 | /* Maximum length of pathname to log file */ | ||
65 | #define MAX_FILENAME 256 | ||
66 | 64 | ||
67 | struct msgtemplate { | 65 | struct msgtemplate { |
68 | struct nlmsghdr n; | 66 | struct nlmsghdr n; |
@@ -72,6 +70,16 @@ struct msgtemplate { | |||
72 | 70 | ||
73 | char cpumask[100+6*MAX_CPUS]; | 71 | char cpumask[100+6*MAX_CPUS]; |
74 | 72 | ||
73 | static void usage(void) | ||
74 | { | ||
75 | fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] " | ||
76 | "[-m cpumask] [-t tgid] [-p pid]\n"); | ||
77 | fprintf(stderr, " -d: print delayacct stats\n"); | ||
78 | fprintf(stderr, " -i: print IO accounting (works only with -p)\n"); | ||
79 | fprintf(stderr, " -l: listen forever\n"); | ||
80 | fprintf(stderr, " -v: debug on\n"); | ||
81 | } | ||
82 | |||
75 | /* | 83 | /* |
76 | * Create a raw netlink socket and bind | 84 | * Create a raw netlink socket and bind |
77 | */ | 85 | */ |
@@ -221,13 +229,13 @@ int main(int argc, char *argv[]) | |||
221 | int count = 0; | 229 | int count = 0; |
222 | int write_file = 0; | 230 | int write_file = 0; |
223 | int maskset = 0; | 231 | int maskset = 0; |
224 | char logfile[128]; | 232 | char *logfile = NULL; |
225 | int loop = 0; | 233 | int loop = 0; |
226 | 234 | ||
227 | struct msgtemplate msg; | 235 | struct msgtemplate msg; |
228 | 236 | ||
229 | while (1) { | 237 | while (1) { |
230 | c = getopt(argc, argv, "diw:r:m:t:p:v:l"); | 238 | c = getopt(argc, argv, "diw:r:m:t:p:vl"); |
231 | if (c < 0) | 239 | if (c < 0) |
232 | break; | 240 | break; |
233 | 241 | ||
@@ -241,7 +249,7 @@ int main(int argc, char *argv[]) | |||
241 | print_io_accounting = 1; | 249 | print_io_accounting = 1; |
242 | break; | 250 | break; |
243 | case 'w': | 251 | case 'w': |
244 | strncpy(logfile, optarg, MAX_FILENAME); | 252 | logfile = strdup(optarg); |
245 | printf("write to file %s\n", logfile); | 253 | printf("write to file %s\n", logfile); |
246 | write_file = 1; | 254 | write_file = 1; |
247 | break; | 255 | break; |
@@ -277,7 +285,7 @@ int main(int argc, char *argv[]) | |||
277 | loop = 1; | 285 | loop = 1; |
278 | break; | 286 | break; |
279 | default: | 287 | default: |
280 | printf("Unknown option %d\n", c); | 288 | usage(); |
281 | exit(-1); | 289 | exit(-1); |
282 | } | 290 | } |
283 | } | 291 | } |
diff --git a/Documentation/arm/Interrupts b/Documentation/arm/Interrupts index 72c93de8cd4e..0d3dbf1099bc 100644 --- a/Documentation/arm/Interrupts +++ b/Documentation/arm/Interrupts | |||
@@ -149,7 +149,7 @@ So, what's changed? | |||
149 | 149 | ||
150 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. | 150 | 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. |
151 | 151 | ||
152 | 4. Direct access to SA1111 INTPOL is depreciated. Use set_irq_type instead. | 152 | 4. Direct access to SA1111 INTPOL is deprecated. Use set_irq_type instead. |
153 | 153 | ||
154 | 5. A handler is expected to perform any necessary acknowledgement of the | 154 | 5. A handler is expected to perform any necessary acknowledgement of the |
155 | parent IRQ via the correct chip specific function. For instance, if | 155 | parent IRQ via the correct chip specific function. For instance, if |
diff --git a/Documentation/arm/Samsung-S3C24XX/H1940.txt b/Documentation/arm/Samsung-S3C24XX/H1940.txt index d6b1de92b111..f4a7b22c8664 100644 --- a/Documentation/arm/Samsung-S3C24XX/H1940.txt +++ b/Documentation/arm/Samsung-S3C24XX/H1940.txt | |||
@@ -23,7 +23,7 @@ Support | |||
23 | 23 | ||
24 | http://handhelds.org/moin/moin.cgi/HpIpaqH1940 | 24 | http://handhelds.org/moin/moin.cgi/HpIpaqH1940 |
25 | 25 | ||
26 | Herbert Pötzl pages: | 26 | Herbert Pötzl pages: |
27 | 27 | ||
28 | http://vserver.13thfloor.at/H1940/ | 28 | http://vserver.13thfloor.at/H1940/ |
29 | 29 | ||
@@ -32,7 +32,7 @@ Maintainers | |||
32 | ----------- | 32 | ----------- |
33 | 33 | ||
34 | This project is being maintained and developed by a variety | 34 | This project is being maintained and developed by a variety |
35 | of people, including Ben Dooks, Arnaud Patard, and Herbert Pötzl. | 35 | of people, including Ben Dooks, Arnaud Patard, and Herbert Pötzl. |
36 | 36 | ||
37 | Thanks to the many others who have also provided support. | 37 | Thanks to the many others who have also provided support. |
38 | 38 | ||
diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b index 3572b98f45b8..b714183d4125 100644 --- a/Documentation/auxdisplay/cfag12864b +++ b/Documentation/auxdisplay/cfag12864b | |||
@@ -78,9 +78,9 @@ Select (17)------------------------------(16) Data / Instruction | |||
78 | Ground (18)---[GND] [+5v]---(19) LED + | 78 | Ground (18)---[GND] [+5v]---(19) LED + |
79 | Ground (19)---[GND] | 79 | Ground (19)---[GND] |
80 | Ground (20)---[GND] E A Values: | 80 | Ground (20)---[GND] E A Values: |
81 | Ground (21)---[GND] [GND]---[P1]---(18) Vee · R = Resistor = 22 ohm | 81 | Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm |
82 | Ground (22)---[GND] | · P1 = Preset = 10 Kohm | 82 | Ground (22)---[GND] | - P1 = Preset = 10 Kohm |
83 | Ground (23)---[GND] ---- S ------( 3) V0 · P2 = Preset = 1 Kohm | 83 | Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm |
84 | Ground (24)---[GND] | | | 84 | Ground (24)---[GND] | | |
85 | Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - | 85 | Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - |
86 | 86 | ||
diff --git a/Documentation/binfmt_misc.txt b/Documentation/binfmt_misc.txt index d097f09ee15a..f609ebf9c78f 100644 --- a/Documentation/binfmt_misc.txt +++ b/Documentation/binfmt_misc.txt | |||
@@ -113,4 +113,4 @@ cause unexpected behaviour and can be a security hazard. | |||
113 | There is a web page about binfmt_misc at | 113 | There is a web page about binfmt_misc at |
114 | http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html | 114 | http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html |
115 | 115 | ||
116 | Richard Günther <rguenth@tat.physik.uni-tuebingen.de> | 116 | Richard Günther <rguenth@tat.physik.uni-tuebingen.de> |
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX new file mode 100644 index 000000000000..7cb3b356b249 --- /dev/null +++ b/Documentation/blackfin/00-INDEX | |||
@@ -0,0 +1,11 @@ | |||
1 | 00-INDEX | ||
2 | - This file | ||
3 | |||
4 | cache-lock.txt | ||
5 | - HOWTO for blackfin cache locking. | ||
6 | |||
7 | cachefeatures.txt | ||
8 | - Supported cache features. | ||
9 | |||
10 | Filesystems | ||
11 | - Requirements for mounting the root file system. | ||
diff --git a/Documentation/blackfin/Filesystems b/Documentation/blackfin/Filesystems new file mode 100644 index 000000000000..51260a1b8032 --- /dev/null +++ b/Documentation/blackfin/Filesystems | |||
@@ -0,0 +1,169 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/Filesystems | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: Filesystems 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | How to mount the root file system in uClinux/Blackfin | ||
19 | ----------------------------------------------------- | ||
20 | |||
21 | 1 Mounting EXT3 File system. | ||
22 | ------------------------ | ||
23 | |||
24 | Creating an EXT3 File system for uClinux/Blackfin: | ||
25 | |||
26 | |||
27 | Please follow the steps to form the EXT3 File system and mount the same as root | ||
28 | file system. | ||
29 | |||
30 | a Make an ext3 file system as large as you want the final root file | ||
31 | system. | ||
32 | |||
33 | mkfs.ext3 /dev/ram0 <your-rootfs-size-in-1k-blocks> | ||
34 | |||
35 | b Mount this Empty file system on a free directory as: | ||
36 | |||
37 | mount -t ext3 /dev/ram0 ./test | ||
38 | where ./test is the empty directory. | ||
39 | |||
40 | c Copy your root fs directory that you have so carefully made over. | ||
41 | |||
42 | cp -af /tmp/my_final_rootfs_files/* ./test | ||
43 | |||
44 | (For ex: cp -af uClinux-dist/romfs/* ./test) | ||
45 | |||
46 | d If you have done everything right till now you should be able to see | ||
47 | the required "root" dir's (that's etc, root, bin, lib, sbin...) | ||
48 | |||
49 | e Now unmount the file system | ||
50 | |||
51 | umount ./test | ||
52 | |||
53 | f Create the root file system image. | ||
54 | |||
55 | dd if=/dev/ram0 bs=1k count=<your-rootfs-size-in-1k-blocks> \ | ||
56 | > ext3fs.img | ||
57 | |||
58 | |||
59 | Now you have to tell the kernel that will be mounting this file system as | ||
60 | rootfs. | ||
61 | So do a make menuconfig under kernel and select the Ext3 journaling file system | ||
62 | support under File system --> submenu. | ||
63 | |||
64 | |||
65 | 2. Mounting EXT2 File system. | ||
66 | ------------------------- | ||
67 | |||
68 | By default the ext2 file system image will be created if you invoke make from | ||
69 | the top uClinux-dist directory. | ||
70 | |||
71 | |||
72 | 3. Mounting CRAMFS File System | ||
73 | ---------------------------- | ||
74 | |||
75 | To create a CRAMFS file system image execute the command | ||
76 | |||
77 | mkfs.cramfs ./test cramfs.img | ||
78 | |||
79 | where ./test is the target directory. | ||
80 | |||
81 | |||
82 | 4. Mounting ROMFS File System | ||
83 | -------------------------- | ||
84 | |||
85 | To create a ROMFS file system image execute the command | ||
86 | |||
87 | genromfs -v -V "ROMdisk" -f romfs.img -d ./test | ||
88 | |||
89 | where ./test is the target directory | ||
90 | |||
91 | |||
92 | 5. Mounting the JFFS2 Filesystem | ||
93 | ----------------------------- | ||
94 | |||
95 | To create a compressed JFFS filesystem (JFFS2), please execute the command | ||
96 | |||
97 | mkfs.jffs2 -d ./test -o jffs2.img | ||
98 | |||
99 | where ./test is the target directory. | ||
100 | |||
101 | However, please make sure the following is in your kernel config. | ||
102 | |||
103 | /* | ||
104 | * RAM/ROM/Flash chip drivers | ||
105 | */ | ||
106 | #define CONFIG_MTD_CFI 1 | ||
107 | #define CONFIG_MTD_ROM 1 | ||
108 | /* | ||
109 | * Mapping drivers for chip access | ||
110 | */ | ||
111 | #define CONFIG_MTD_COMPLEX_MAPPINGS 1 | ||
112 | #define CONFIG_MTD_BF533 1 | ||
113 | #undef CONFIG_MTD_UCLINUX | ||
114 | |||
115 | Through the u-boot boot loader, use the jffs2.img in the corresponding | ||
116 | partition made in linux-2.6.x/drivers/mtd/maps/bf533_flash.c. | ||
117 | |||
118 | NOTE - Currently the Flash driver is available only for EZKIT. Watch out for a | ||
119 | STAMP driver soon. | ||
120 | |||
121 | |||
122 | 6. Mounting the NFS File system | ||
123 | ----------------------------- | ||
124 | |||
125 | For mounting the NFS please do the following in the kernel config. | ||
126 | |||
127 | In Networking Support --> Networking options --> TCP/IP networking --> | ||
128 | IP: kernel level autoconfiguration | ||
129 | |||
130 | Enable BOOTP Support. | ||
131 | |||
132 | In Kernel hacking --> Compiled-in kernel boot parameter add the following | ||
133 | |||
134 | root=/dev/nfs rw ip=bootp | ||
135 | |||
136 | In File system --> Network File system, Enable | ||
137 | |||
138 | NFS file system support --> NFSv3 client support | ||
139 | Root File system on NFS | ||
140 | |||
141 | in uClibc menuconfig, do the following | ||
142 | In Networking Support | ||
143 | enable Remote Procedure Call (RPC) support | ||
144 | Full RPC Support | ||
145 | |||
146 | On the Host side, ensure that /etc/dhcpd.conf looks something like this | ||
147 | |||
148 | ddns-update-style ad-hoc; | ||
149 | allow bootp; | ||
150 | subnet 10.100.4.0 netmask 255.255.255.0 { | ||
151 | default-lease-time 122209600; | ||
152 | max-lease-time 31557600; | ||
153 | group { | ||
154 | host bf533 { | ||
155 | hardware ethernet 00:CF:52:49:C3:01; | ||
156 | fixed-address 10.100.4.50; | ||
157 | option root-path "/home/nfsmount"; | ||
158 | } | ||
159 | } | ||
160 | |||
161 | ensure that /etc/exports looks something like this | ||
162 | /home/nfsmount *(rw,no_root_squash,no_all_squash) | ||
163 | |||
164 | run the following commands as root (may differ depending on your | ||
165 | distribution) : | ||
166 | - service nfs start | ||
167 | - service portmap start | ||
168 | - service dhcpd start | ||
169 | - /usr/sbin/exportfs | ||
diff --git a/Documentation/blackfin/cache-lock.txt b/Documentation/blackfin/cache-lock.txt new file mode 100644 index 000000000000..88ba1e6c31c3 --- /dev/null +++ b/Documentation/blackfin/cache-lock.txt | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/cache-lock.txt | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: cache-lock.txt 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | How to lock your code in cache in uClinux/blackfin | ||
19 | -------------------------------------------------- | ||
20 | |||
21 | There are only a few steps required to lock your code into the cache. | ||
22 | Currently you can lock the code by Way. | ||
23 | |||
24 | Below are the interface provided for locking the cache. | ||
25 | |||
26 | |||
27 | 1. cache_grab_lock(int Ways); | ||
28 | |||
29 | This function grab the lock for locking your code into the cache specified | ||
30 | by Ways. | ||
31 | |||
32 | |||
33 | 2. cache_lock(int Ways); | ||
34 | |||
35 | This function should be called after your critical code has been executed. | ||
36 | Once the critical code exits, the code is now loaded into the cache. This | ||
37 | function locks the code into the cache. | ||
38 | |||
39 | |||
40 | So, the example sequence will be: | ||
41 | |||
42 | cache_grab_lock(WAY0_L); /* Grab the lock */ | ||
43 | |||
44 | critical_code(); /* Execute the code of interest */ | ||
45 | |||
46 | cache_lock(WAY0_L); /* Lock the cache */ | ||
47 | |||
48 | Where WAY0_L signifies WAY0 locking. | ||
diff --git a/Documentation/blackfin/cachefeatures.txt b/Documentation/blackfin/cachefeatures.txt new file mode 100644 index 000000000000..0fbec23becb5 --- /dev/null +++ b/Documentation/blackfin/cachefeatures.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * File: Documentation/blackfin/cachefeatures.txt | ||
3 | * Based on: | ||
4 | * Author: | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: This file contains the simple DMA Implementation for Blackfin | ||
8 | * | ||
9 | * Rev: $Id: cachefeatures.txt 2384 2006-11-01 04:12:43Z magicyang $ | ||
10 | * | ||
11 | * Modified: | ||
12 | * Copyright 2004-2006 Analog Devices Inc. | ||
13 | * | ||
14 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | - Instruction and Data cache initialization. | ||
19 | icache_init(); | ||
20 | dcache_init(); | ||
21 | |||
22 | - Instruction and Data cache Invalidation Routines, when flushing the | ||
23 | same is not required. | ||
24 | _icache_invalidate(); | ||
25 | _dcache_invalidate(); | ||
26 | |||
27 | Also, for invalidating the entire instruction and data cache, the below | ||
28 | routines are provided (another method for invalidation, refer page no 267 and 287 of | ||
29 | ADSP-BF533 Hardware Reference manual) | ||
30 | |||
31 | invalidate_entire_dcache(); | ||
32 | invalidate_entire_icache(); | ||
33 | |||
34 | -External Flushing of Instruction and data cache routines. | ||
35 | |||
36 | flush_instruction_cache(); | ||
37 | flush_data_cache(); | ||
38 | |||
39 | - Internal Flushing of Instruction and Data Cache. | ||
40 | |||
41 | icplb_flush(); | ||
42 | dcplb_flush(); | ||
43 | |||
44 | - Locking the cache. | ||
45 | |||
46 | cache_grab_lock(); | ||
47 | cache_lock(); | ||
48 | |||
49 | Please refer linux-2.6.x/Documentation/blackfin/cache-lock.txt for how to | ||
50 | lock the cache. | ||
51 | |||
52 | Locking the cache is optional feature. | ||
53 | |||
54 | - Miscellaneous cache functions. | ||
55 | |||
56 | flush_cache_all(); | ||
57 | flush_cache_mm(); | ||
58 | invalidate_dcache_range(); | ||
59 | flush_dcache_range(); | ||
60 | flush_dcache_page(); | ||
61 | flush_cache_range(); | ||
62 | flush_cache_page(); | ||
63 | invalidate_dcache_range(); | ||
64 | flush_page_to_ram(); | ||
65 | |||
diff --git a/Documentation/block/ioprio.txt b/Documentation/block/ioprio.txt index 96ccf681075e..1b930ef5a079 100644 --- a/Documentation/block/ioprio.txt +++ b/Documentation/block/ioprio.txt | |||
@@ -6,10 +6,10 @@ Intro | |||
6 | ----- | 6 | ----- |
7 | 7 | ||
8 | With the introduction of cfq v3 (aka cfq-ts or time sliced cfq), basic io | 8 | With the introduction of cfq v3 (aka cfq-ts or time sliced cfq), basic io |
9 | priorities is supported for reads on files. This enables users to io nice | 9 | priorities are supported for reads on files. This enables users to io nice |
10 | processes or process groups, similar to what has been possible to cpu | 10 | processes or process groups, similar to what has been possible with cpu |
11 | scheduling for ages. This document mainly details the current possibilites | 11 | scheduling for ages. This document mainly details the current possibilities |
12 | with cfq, other io schedulers do not support io priorities so far. | 12 | with cfq; other io schedulers do not support io priorities thus far. |
13 | 13 | ||
14 | Scheduling classes | 14 | Scheduling classes |
15 | ------------------ | 15 | ------------------ |
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt index f74affe5c829..e65736c6b8bc 100644 --- a/Documentation/cciss.txt +++ b/Documentation/cciss.txt | |||
@@ -22,14 +22,21 @@ This driver is known to work with the following cards: | |||
22 | * SA E200i | 22 | * SA E200i |
23 | * SA E500 | 23 | * SA E500 |
24 | 24 | ||
25 | If nodes are not already created in the /dev/cciss directory, run as root: | 25 | Detecting drive failures: |
26 | ------------------------- | ||
26 | 27 | ||
27 | # cd /dev | 28 | To get the status of logical volumes and to detect physical drive |
28 | # ./MAKEDEV cciss | 29 | failures, you can use the cciss_vol_status program found here: |
30 | http://cciss.sourceforge.net/#cciss_utils | ||
29 | 31 | ||
30 | Device Naming: | 32 | Device Naming: |
31 | -------------- | 33 | -------------- |
32 | 34 | ||
35 | If nodes are not already created in the /dev/cciss directory, run as root: | ||
36 | |||
37 | # cd /dev | ||
38 | # ./MAKEDEV cciss | ||
39 | |||
33 | You need some entries in /dev for the cciss device. The MAKEDEV script | 40 | You need some entries in /dev for the cciss device. The MAKEDEV script |
34 | can make device nodes for you automatically. Currently the device setup | 41 | can make device nodes for you automatically. Currently the device setup |
35 | is as follows: | 42 | is as follows: |
diff --git a/Documentation/cpu-freq/cpufreq-stats.txt b/Documentation/cpu-freq/cpufreq-stats.txt index 53d62c1e1c94..fc647492e940 100644 --- a/Documentation/cpu-freq/cpufreq-stats.txt +++ b/Documentation/cpu-freq/cpufreq-stats.txt | |||
@@ -17,7 +17,7 @@ Contents | |||
17 | 17 | ||
18 | 1. Introduction | 18 | 1. Introduction |
19 | 19 | ||
20 | cpufreq-stats is a driver that provices CPU frequency statistics for each CPU. | 20 | cpufreq-stats is a driver that provides CPU frequency statistics for each CPU. |
21 | These statistics are provided in /sysfs as a bunch of read_only interfaces. This | 21 | These statistics are provided in /sysfs as a bunch of read_only interfaces. This |
22 | interface (when configured) will appear in a separate directory under cpufreq | 22 | interface (when configured) will appear in a separate directory under cpufreq |
23 | in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU. | 23 | in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU. |
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index cc60d29b954c..b6d24c22274b 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -217,14 +217,17 @@ Q: What happens when a CPU is being logically offlined? | |||
217 | A: The following happen, listed in no particular order :-) | 217 | A: The following happen, listed in no particular order :-) |
218 | 218 | ||
219 | - A notification is sent to in-kernel registered modules by sending an event | 219 | - A notification is sent to in-kernel registered modules by sending an event |
220 | CPU_DOWN_PREPARE | 220 | CPU_DOWN_PREPARE or CPU_DOWN_PREPARE_FROZEN, depending on whether or not the |
221 | CPU is being offlined while tasks are frozen due to a suspend operation in | ||
222 | progress | ||
221 | - All process is migrated away from this outgoing CPU to a new CPU | 223 | - All process is migrated away from this outgoing CPU to a new CPU |
222 | - All interrupts targeted to this CPU is migrated to a new CPU | 224 | - All interrupts targeted to this CPU is migrated to a new CPU |
223 | - timers/bottom half/task lets are also migrated to a new CPU | 225 | - timers/bottom half/task lets are also migrated to a new CPU |
224 | - Once all services are migrated, kernel calls an arch specific routine | 226 | - Once all services are migrated, kernel calls an arch specific routine |
225 | __cpu_disable() to perform arch specific cleanup. | 227 | __cpu_disable() to perform arch specific cleanup. |
226 | - Once this is successful, an event for successful cleanup is sent by an event | 228 | - Once this is successful, an event for successful cleanup is sent by an event |
227 | CPU_DEAD. | 229 | CPU_DEAD (or CPU_DEAD_FROZEN if tasks are frozen due to a suspend while the |
230 | CPU is being offlined). | ||
228 | 231 | ||
229 | "It is expected that each service cleans up when the CPU_DOWN_PREPARE | 232 | "It is expected that each service cleans up when the CPU_DOWN_PREPARE |
230 | notifier is called, when CPU_DEAD is called its expected there is nothing | 233 | notifier is called, when CPU_DEAD is called its expected there is nothing |
@@ -242,9 +245,11 @@ A: This is what you would need in your kernel code to receive notifications. | |||
242 | 245 | ||
243 | switch (action) { | 246 | switch (action) { |
244 | case CPU_ONLINE: | 247 | case CPU_ONLINE: |
248 | case CPU_ONLINE_FROZEN: | ||
245 | foobar_online_action(cpu); | 249 | foobar_online_action(cpu); |
246 | break; | 250 | break; |
247 | case CPU_DEAD: | 251 | case CPU_DEAD: |
252 | case CPU_DEAD_FROZEN: | ||
248 | foobar_dead_action(cpu); | 253 | foobar_dead_action(cpu); |
249 | break; | 254 | break; |
250 | } | 255 | } |
diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt index 9b84b805ab75..a2ac6d294793 100644 --- a/Documentation/crypto/api-intro.txt +++ b/Documentation/crypto/api-intro.txt | |||
@@ -177,7 +177,7 @@ Portions of this API were derived from the following projects: | |||
177 | and; | 177 | and; |
178 | 178 | ||
179 | Nettle (http://www.lysator.liu.se/~nisse/nettle/) | 179 | Nettle (http://www.lysator.liu.se/~nisse/nettle/) |
180 | Niels Möller | 180 | Niels Möller |
181 | 181 | ||
182 | Original developers of the crypto algorithms: | 182 | Original developers of the crypto algorithms: |
183 | 183 | ||
@@ -200,8 +200,8 @@ SHA1 algorithm contributors: | |||
200 | 200 | ||
201 | DES algorithm contributors: | 201 | DES algorithm contributors: |
202 | Raimar Falke | 202 | Raimar Falke |
203 | Gisle Sælensminde | 203 | Gisle Sælensminde |
204 | Niels Möller | 204 | Niels Möller |
205 | 205 | ||
206 | Blowfish algorithm contributors: | 206 | Blowfish algorithm contributors: |
207 | Herbert Valerio Riedel | 207 | Herbert Valerio Riedel |
diff --git a/Documentation/device-mapper/delay.txt b/Documentation/device-mapper/delay.txt new file mode 100644 index 000000000000..15adc55359e5 --- /dev/null +++ b/Documentation/device-mapper/delay.txt | |||
@@ -0,0 +1,26 @@ | |||
1 | dm-delay | ||
2 | ======== | ||
3 | |||
4 | Device-Mapper's "delay" target delays reads and/or writes | ||
5 | and maps them to different devices. | ||
6 | |||
7 | Parameters: | ||
8 | <device> <offset> <delay> [<write_device> <write_offset> <write_delay>] | ||
9 | |||
10 | With separate write parameters, the first set is only used for reads. | ||
11 | Delays are specified in milliseconds. | ||
12 | |||
13 | Example scripts | ||
14 | =============== | ||
15 | [[ | ||
16 | #!/bin/sh | ||
17 | # Create device delaying rw operation for 500ms | ||
18 | echo "0 `blockdev --getsize $1` delay $1 0 500" | dmsetup create delayed | ||
19 | ]] | ||
20 | |||
21 | [[ | ||
22 | #!/bin/sh | ||
23 | # Create device delaying only write operation for 500ms and | ||
24 | # splitting reads and writes to different devices $1 $2 | ||
25 | echo "0 `blockdev --getsize $1` delay $1 0 0 $2 0 500" | dmsetup create delayed | ||
26 | ]] | ||
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 63c2d0c55aa2..64e9f6c4826b 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -55,8 +55,8 @@ aic7*seq.h* | |||
55 | aicasm | 55 | aicasm |
56 | aicdb.h* | 56 | aicdb.h* |
57 | asm | 57 | asm |
58 | asm-offsets.* | 58 | asm-offsets.h |
59 | asm_offsets.* | 59 | asm_offsets.h |
60 | autoconf.h* | 60 | autoconf.h* |
61 | bbootsect | 61 | bbootsect |
62 | bin2c | 62 | bin2c |
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 5163b85308f5..6c8d8f27db34 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -182,7 +182,7 @@ For example, you can do something like the following. | |||
182 | 182 | ||
183 | ... | 183 | ... |
184 | 184 | ||
185 | devres_close_group(dev, my_midlayer_something); | 185 | devres_close_group(dev, my_midlayer_create_something); |
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt index f7c9262b2dc8..19c4a6e13676 100644 --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt | |||
@@ -16,7 +16,7 @@ host bridges to peripheral buses, and most controllers integrated | |||
16 | into system-on-chip platforms. What they usually have in common | 16 | into system-on-chip platforms. What they usually have in common |
17 | is direct addressing from a CPU bus. Rarely, a platform_device will | 17 | is direct addressing from a CPU bus. Rarely, a platform_device will |
18 | be connected through a segment of some other kind of bus; but its | 18 | be connected through a segment of some other kind of bus; but its |
19 | registers will still be directly addressible. | 19 | registers will still be directly addressable. |
20 | 20 | ||
21 | Platform devices are given a name, used in driver binding, and a | 21 | Platform devices are given a name, used in driver binding, and a |
22 | list of resources such as addresses and IRQs. | 22 | list of resources such as addresses and IRQs. |
@@ -125,7 +125,7 @@ three different ways to find such a match: | |||
125 | usually register later during booting, or by module loading. | 125 | usually register later during booting, or by module loading. |
126 | 126 | ||
127 | - Registering a driver using platform_driver_probe() works just like | 127 | - Registering a driver using platform_driver_probe() works just like |
128 | using platform_driver_register(), except that the the driver won't | 128 | using platform_driver_register(), except that the driver won't |
129 | be probed later if another device registers. (Which is OK, since | 129 | be probed later if another device registers. (Which is OK, since |
130 | this interface is only for use with non-hotpluggable devices.) | 130 | this interface is only for use with non-hotpluggable devices.) |
131 | 131 | ||
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb index 46b78b7331c2..bf2a9cdfe7bb 100644 --- a/Documentation/dvb/README.dvb-usb +++ b/Documentation/dvb/README.dvb-usb | |||
@@ -228,5 +228,5 @@ Patches, comments and suggestions are very very welcome. | |||
228 | 228 | ||
229 | Ulf Hermenau for helping me out with traditional chinese. | 229 | Ulf Hermenau for helping me out with traditional chinese. |
230 | 230 | ||
231 | André Smoktun and Christian Frömmel for supporting me with | 231 | André Smoktun and Christian Frömmel for supporting me with |
232 | hardware and listening to my problems very patiently. | 232 | hardware and listening to my problems very patiently. |
diff --git a/Documentation/dvb/contributors.txt b/Documentation/dvb/contributors.txt index 4c33cced5f65..4865addebe1c 100644 --- a/Documentation/dvb/contributors.txt +++ b/Documentation/dvb/contributors.txt | |||
@@ -66,7 +66,7 @@ Michael Dreher <michael@5dot1.de> | |||
66 | Andreas 'randy' Weinberger | 66 | Andreas 'randy' Weinberger |
67 | for the support of the Fujitsu-Siemens Activy budget DVB-S | 67 | for the support of the Fujitsu-Siemens Activy budget DVB-S |
68 | 68 | ||
69 | Kenneth Aafløy <ke-aa@frisurf.no> | 69 | Kenneth Aafløy <ke-aa@frisurf.no> |
70 | for adding support for Typhoon DVB-S budget card | 70 | for adding support for Typhoon DVB-S budget card |
71 | 71 | ||
72 | Ernst Peinlich <e.peinlich@inode.at> | 72 | Ernst Peinlich <e.peinlich@inode.at> |
diff --git a/Documentation/fb/arkfb.txt b/Documentation/fb/arkfb.txt new file mode 100644 index 000000000000..e8487a9d6a05 --- /dev/null +++ b/Documentation/fb/arkfb.txt | |||
@@ -0,0 +1,68 @@ | |||
1 | |||
2 | arkfb - fbdev driver for ARK Logic chips | ||
3 | ======================================== | ||
4 | |||
5 | |||
6 | Supported Hardware | ||
7 | ================== | ||
8 | |||
9 | ARK 2000PV chip | ||
10 | ICS 5342 ramdac | ||
11 | |||
12 | - only BIOS initialized VGA devices supported | ||
13 | - probably not working on big endian | ||
14 | |||
15 | |||
16 | Supported Features | ||
17 | ================== | ||
18 | |||
19 | * 4 bpp pseudocolor modes (with 18bit palette, two variants) | ||
20 | * 8 bpp pseudocolor mode (with 18bit palette) | ||
21 | * 16 bpp truecolor modes (RGB 555 and RGB 565) | ||
22 | * 24 bpp truecolor mode (RGB 888) | ||
23 | * 32 bpp truecolor mode (RGB 888) | ||
24 | * text mode (activated by bpp = 0) | ||
25 | * doublescan mode variant (not available in text mode) | ||
26 | * panning in both directions | ||
27 | * suspend/resume support | ||
28 | |||
29 | Text mode is supported even in higher resolutions, but there is limitation to | ||
30 | lower pixclocks (i got maximum about 70 MHz, it is dependent on specific | ||
31 | hardware). This limitation is not enforced by driver. Text mode supports 8bit | ||
32 | wide fonts only (hardware limitation) and 16bit tall fonts (driver | ||
33 | limitation). Unfortunately character attributes (like color) in text mode are | ||
34 | broken for unknown reason, so its usefulness is limited. | ||
35 | |||
36 | There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with | ||
37 | packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode | ||
38 | with interleaved planes (1 byte interleave), MSB first. Both modes support | ||
39 | 8bit wide fonts only (driver limitation). | ||
40 | |||
41 | Suspend/resume works on systems that initialize video card during resume and | ||
42 | if device is active (for example used by fbcon). | ||
43 | |||
44 | |||
45 | Missing Features | ||
46 | ================ | ||
47 | (alias TODO list) | ||
48 | |||
49 | * secondary (not initialized by BIOS) device support | ||
50 | * big endian support | ||
51 | * DPMS support | ||
52 | * MMIO support | ||
53 | * interlaced mode variant | ||
54 | * support for fontwidths != 8 in 4 bpp modes | ||
55 | * support for fontheight != 16 in text mode | ||
56 | * hardware cursor | ||
57 | * vsync synchronization | ||
58 | * feature connector support | ||
59 | * acceleration support (8514-like 2D) | ||
60 | |||
61 | |||
62 | Known bugs | ||
63 | ========== | ||
64 | |||
65 | * character attributes (and cursor) in text mode are broken | ||
66 | |||
67 | -- | ||
68 | Ondrej Zajicek <santiago@crfreenet.org> | ||
diff --git a/Documentation/fb/aty128fb.txt b/Documentation/fb/aty128fb.txt index 069262fb619d..b605204fcfe1 100644 --- a/Documentation/fb/aty128fb.txt +++ b/Documentation/fb/aty128fb.txt | |||
@@ -54,8 +54,8 @@ Accepted options: | |||
54 | 54 | ||
55 | noaccel - do not use acceleration engine. It is default. | 55 | noaccel - do not use acceleration engine. It is default. |
56 | accel - use acceleration engine. Not finished. | 56 | accel - use acceleration engine. Not finished. |
57 | vmode:x - chooses PowerMacintosh video mode <x>. Depreciated. | 57 | vmode:x - chooses PowerMacintosh video mode <x>. Deprecated. |
58 | cmode:x - chooses PowerMacintosh colour mode <x>. Depreciated. | 58 | cmode:x - chooses PowerMacintosh colour mode <x>. Deprecated. |
59 | <XxX@X> - selects startup videomode. See modedb.txt for detailed | 59 | <XxX@X> - selects startup videomode. See modedb.txt for detailed |
60 | explanation. Default is 640x480x8bpp. | 60 | explanation. Default is 640x480x8bpp. |
61 | 61 | ||
diff --git a/Documentation/fb/deferred_io.txt b/Documentation/fb/deferred_io.txt new file mode 100644 index 000000000000..73cf9fb7cf60 --- /dev/null +++ b/Documentation/fb/deferred_io.txt | |||
@@ -0,0 +1,75 @@ | |||
1 | Deferred IO | ||
2 | ----------- | ||
3 | |||
4 | Deferred IO is a way to delay and repurpose IO. It uses host memory as a | ||
5 | buffer and the MMU pagefault as a pretrigger for when to perform the device | ||
6 | IO. The following example may be a useful explaination of how one such setup | ||
7 | works: | ||
8 | |||
9 | - userspace app like Xfbdev mmaps framebuffer | ||
10 | - deferred IO and driver sets up nopage and page_mkwrite handlers | ||
11 | - userspace app tries to write to mmaped vaddress | ||
12 | - we get pagefault and reach nopage handler | ||
13 | - nopage handler finds and returns physical page | ||
14 | - we get page_mkwrite where we add this page to a list | ||
15 | - schedule a workqueue task to be run after a delay | ||
16 | - app continues writing to that page with no additional cost. this is | ||
17 | the key benefit. | ||
18 | - the workqueue task comes in and mkcleans the pages on the list, then | ||
19 | completes the work associated with updating the framebuffer. this is | ||
20 | the real work talking to the device. | ||
21 | - app tries to write to the address (that has now been mkcleaned) | ||
22 | - get pagefault and the above sequence occurs again | ||
23 | |||
24 | As can be seen from above, one benefit is roughly to allow bursty framebuffer | ||
25 | writes to occur at minimum cost. Then after some time when hopefully things | ||
26 | have gone quiet, we go and really update the framebuffer which would be | ||
27 | a relatively more expensive operation. | ||
28 | |||
29 | For some types of nonvolatile high latency displays, the desired image is | ||
30 | the final image rather than the intermediate stages which is why it's okay | ||
31 | to not update for each write that is occuring. | ||
32 | |||
33 | It may be the case that this is useful in other scenarios as well. Paul Mundt | ||
34 | has mentioned a case where it is beneficial to use the page count to decide | ||
35 | whether to coalesce and issue SG DMA or to do memory bursts. | ||
36 | |||
37 | Another one may be if one has a device framebuffer that is in an usual format, | ||
38 | say diagonally shifting RGB, this may then be a mechanism for you to allow | ||
39 | apps to pretend to have a normal framebuffer but reswizzle for the device | ||
40 | framebuffer at vsync time based on the touched pagelist. | ||
41 | |||
42 | How to use it: (for applications) | ||
43 | --------------------------------- | ||
44 | No changes needed. mmap the framebuffer like normal and just use it. | ||
45 | |||
46 | How to use it: (for fbdev drivers) | ||
47 | ---------------------------------- | ||
48 | The following example may be helpful. | ||
49 | |||
50 | 1. Setup your structure. Eg: | ||
51 | |||
52 | static struct fb_deferred_io hecubafb_defio = { | ||
53 | .delay = HZ, | ||
54 | .deferred_io = hecubafb_dpy_deferred_io, | ||
55 | }; | ||
56 | |||
57 | The delay is the minimum delay between when the page_mkwrite trigger occurs | ||
58 | and when the deferred_io callback is called. The deferred_io callback is | ||
59 | explained below. | ||
60 | |||
61 | 2. Setup your deferred IO callback. Eg: | ||
62 | static void hecubafb_dpy_deferred_io(struct fb_info *info, | ||
63 | struct list_head *pagelist) | ||
64 | |||
65 | The deferred_io callback is where you would perform all your IO to the display | ||
66 | device. You receive the pagelist which is the list of pages that were written | ||
67 | to during the delay. You must not modify this list. This callback is called | ||
68 | from a workqueue. | ||
69 | |||
70 | 3. Call init | ||
71 | info->fbdefio = &hecubafb_defio; | ||
72 | fb_deferred_io_init(info); | ||
73 | |||
74 | 4. Call cleanup | ||
75 | fb_deferred_io_cleanup(info); | ||
diff --git a/Documentation/fb/framebuffer.txt b/Documentation/fb/framebuffer.txt index 610e7801207b..b3e3a0356839 100644 --- a/Documentation/fb/framebuffer.txt +++ b/Documentation/fb/framebuffer.txt | |||
@@ -215,11 +215,11 @@ vertical retrace time is the sum of the upper margin, the lower margin and the | |||
215 | vsync length. | 215 | vsync length. |
216 | 216 | ||
217 | +----------+---------------------------------------------+----------+-------+ | 217 | +----------+---------------------------------------------+----------+-------+ |
218 | | | ^ | | | | 218 | | | ↑ | | | |
219 | | | |upper_margin | | | | 219 | | | |upper_margin | | | |
220 | | | ¥ | | | | 220 | | | ↓ | | | |
221 | +----------###############################################----------+-------+ | 221 | +----------###############################################----------+-------+ |
222 | | # ^ # | | | 222 | | # ↑ # | | |
223 | | # | # | | | 223 | | # | # | | |
224 | | # | # | | | 224 | | # | # | | |
225 | | # | # | | | 225 | | # | # | | |
@@ -238,15 +238,15 @@ vsync length. | |||
238 | | # | # | | | 238 | | # | # | | |
239 | | # | # | | | 239 | | # | # | | |
240 | | # | # | | | 240 | | # | # | | |
241 | | # ¥ # | | | 241 | | # ↓ # | | |
242 | +----------###############################################----------+-------+ | 242 | +----------###############################################----------+-------+ |
243 | | | ^ | | | | 243 | | | ↑ | | | |
244 | | | |lower_margin | | | | 244 | | | |lower_margin | | | |
245 | | | ¥ | | | | 245 | | | ↓ | | | |
246 | +----------+---------------------------------------------+----------+-------+ | 246 | +----------+---------------------------------------------+----------+-------+ |
247 | | | ^ | | | | 247 | | | ↑ | | | |
248 | | | |vsync_len | | | | 248 | | | |vsync_len | | | |
249 | | | ¥ | | | | 249 | | | ↓ | | | |
250 | +----------+---------------------------------------------+----------+-------+ | 250 | +----------+---------------------------------------------+----------+-------+ |
251 | 251 | ||
252 | The frame buffer device expects all horizontal timings in number of dotclocks | 252 | The frame buffer device expects all horizontal timings in number of dotclocks |
diff --git a/Documentation/fb/imacfb.txt b/Documentation/fb/imacfb.txt index 759028545a7e..316ec9bb7deb 100644 --- a/Documentation/fb/imacfb.txt +++ b/Documentation/fb/imacfb.txt | |||
@@ -17,7 +17,7 @@ How to use it? | |||
17 | ============== | 17 | ============== |
18 | 18 | ||
19 | Imacfb does not have any kind of autodetection of your machine. | 19 | Imacfb does not have any kind of autodetection of your machine. |
20 | You have to add the fillowing kernel parameters in your elilo.conf: | 20 | You have to add the following kernel parameters in your elilo.conf: |
21 | Macbook : | 21 | Macbook : |
22 | video=imacfb:macbook | 22 | video=imacfb:macbook |
23 | MacMini : | 23 | MacMini : |
diff --git a/Documentation/fb/s3fb.txt b/Documentation/fb/s3fb.txt index 8a04c0da0c91..2c97770bdbaa 100644 --- a/Documentation/fb/s3fb.txt +++ b/Documentation/fb/s3fb.txt | |||
@@ -35,10 +35,12 @@ Supported Features | |||
35 | * suspend/resume support | 35 | * suspend/resume support |
36 | * DPMS support | 36 | * DPMS support |
37 | 37 | ||
38 | Text mode is supported even in higher resolutions, but there is limitation | 38 | Text mode is supported even in higher resolutions, but there is limitation to |
39 | to lower pixclocks (maximum between 50-60 MHz, depending on specific hardware). | 39 | lower pixclocks (maximum usually between 50-60 MHz, depending on specific |
40 | This limitation is not enforced by driver. Text mode supports 8bit wide fonts | 40 | hardware, i get best results from plain S3 Trio32 card - about 75 MHz). This |
41 | only (hardware limitation) and 16bit tall fonts (driver limitation). | 41 | limitation is not enforced by driver. Text mode supports 8bit wide fonts only |
42 | (hardware limitation) and 16bit tall fonts (driver limitation). Text mode | ||
43 | support is broken on S3 Trio64 V2/DX. | ||
42 | 44 | ||
43 | There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with | 45 | There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with |
44 | packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode | 46 | packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode |
@@ -73,6 +75,8 @@ Known bugs | |||
73 | ========== | 75 | ========== |
74 | 76 | ||
75 | * cursor disable in text mode doesn't work | 77 | * cursor disable in text mode doesn't work |
78 | * text mode broken on S3 Trio64 V2/DX | ||
79 | |||
76 | 80 | ||
77 | -- | 81 | -- |
78 | Ondrej Zajicek <santiago@crfreenet.org> | 82 | Ondrej Zajicek <santiago@crfreenet.org> |
diff --git a/Documentation/fb/sstfb.txt b/Documentation/fb/sstfb.txt index df27f5bf15db..550ca775a4cb 100644 --- a/Documentation/fb/sstfb.txt +++ b/Documentation/fb/sstfb.txt | |||
@@ -2,9 +2,9 @@ | |||
2 | Introduction | 2 | Introduction |
3 | 3 | ||
4 | This is a frame buffer device driver for 3dfx' Voodoo Graphics | 4 | This is a frame buffer device driver for 3dfx' Voodoo Graphics |
5 | (aka voodoo 1, aka sst1) and Voodoo² (aka Voodoo 2, aka CVG) based | 5 | (aka voodoo 1, aka sst1) and Voodoo² (aka Voodoo 2, aka CVG) based |
6 | video boards. It's highly experimental code, but is guaranteed to work | 6 | video boards. It's highly experimental code, but is guaranteed to work |
7 | on my computer, with my "Maxi Gamer 3D" and "Maxi Gamer 3d²" boards, | 7 | on my computer, with my "Maxi Gamer 3D" and "Maxi Gamer 3d²" boards, |
8 | and with me "between chair and keyboard". Some people tested other | 8 | and with me "between chair and keyboard". Some people tested other |
9 | combinations and it seems that it works. | 9 | combinations and it seems that it works. |
10 | The main page is located at <http://sstfb.sourceforge.net>, and if | 10 | The main page is located at <http://sstfb.sourceforge.net>, and if |
diff --git a/Documentation/fb/vt8623fb.txt b/Documentation/fb/vt8623fb.txt new file mode 100644 index 000000000000..f654576c56b7 --- /dev/null +++ b/Documentation/fb/vt8623fb.txt | |||
@@ -0,0 +1,64 @@ | |||
1 | |||
2 | vt8623fb - fbdev driver for graphics core in VIA VT8623 chipset | ||
3 | =============================================================== | ||
4 | |||
5 | |||
6 | Supported Hardware | ||
7 | ================== | ||
8 | |||
9 | VIA VT8623 [CLE266] chipset and its graphics core | ||
10 | (known as CastleRock or Unichrome) | ||
11 | |||
12 | I tested vt8623fb on VIA EPIA ML-6000 | ||
13 | |||
14 | |||
15 | Supported Features | ||
16 | ================== | ||
17 | |||
18 | * 4 bpp pseudocolor modes (with 18bit palette, two variants) | ||
19 | * 8 bpp pseudocolor mode (with 18bit palette) | ||
20 | * 16 bpp truecolor mode (RGB 565) | ||
21 | * 32 bpp truecolor mode (RGB 888) | ||
22 | * text mode (activated by bpp = 0) | ||
23 | * doublescan mode variant (not available in text mode) | ||
24 | * panning in both directions | ||
25 | * suspend/resume support | ||
26 | * DPMS support | ||
27 | |||
28 | Text mode is supported even in higher resolutions, but there is limitation to | ||
29 | lower pixclocks (maximum about 100 MHz). This limitation is not enforced by | ||
30 | driver. Text mode supports 8bit wide fonts only (hardware limitation) and | ||
31 | 16bit tall fonts (driver limitation). | ||
32 | |||
33 | There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with | ||
34 | packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode | ||
35 | with interleaved planes (1 byte interleave), MSB first. Both modes support | ||
36 | 8bit wide fonts only (driver limitation). | ||
37 | |||
38 | Suspend/resume works on systems that initialize video card during resume and | ||
39 | if device is active (for example used by fbcon). | ||
40 | |||
41 | |||
42 | Missing Features | ||
43 | ================ | ||
44 | (alias TODO list) | ||
45 | |||
46 | * secondary (not initialized by BIOS) device support | ||
47 | * MMIO support | ||
48 | * interlaced mode variant | ||
49 | * support for fontwidths != 8 in 4 bpp modes | ||
50 | * support for fontheight != 16 in text mode | ||
51 | * hardware cursor | ||
52 | * video overlay support | ||
53 | * vsync synchronization | ||
54 | * acceleration support (8514-like 2D, busmaster transfers) | ||
55 | |||
56 | |||
57 | Known bugs | ||
58 | ========== | ||
59 | |||
60 | * cursor disable in text mode doesn't work | ||
61 | |||
62 | |||
63 | -- | ||
64 | Ondrej Zajicek <santiago@crfreenet.org> | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index d6d183f24cc9..c6322c760348 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -6,6 +6,14 @@ be removed from this file. | |||
6 | 6 | ||
7 | --------------------------- | 7 | --------------------------- |
8 | 8 | ||
9 | What: MXSER | ||
10 | When: December 2007 | ||
11 | Why: Old mxser driver is obsoleted by the mxser_new. Give it some time yet | ||
12 | and remove it. | ||
13 | Who: Jiri Slaby <jirislaby@gmail.com> | ||
14 | |||
15 | --------------------------- | ||
16 | |||
9 | What: V4L2 VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP | 17 | What: V4L2 VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP |
10 | When: October 2007 | 18 | When: October 2007 |
11 | Why: Broken attempt to set MPEG compression parameters. These ioctls are | 19 | Why: Broken attempt to set MPEG compression parameters. These ioctls are |
@@ -51,6 +59,15 @@ Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de> | |||
51 | 59 | ||
52 | --------------------------- | 60 | --------------------------- |
53 | 61 | ||
62 | What: old NCR53C9x driver | ||
63 | When: October 2007 | ||
64 | Why: Replaced by the much better esp_scsi driver. Actual low-level | ||
65 | driver can ported over almost trivially. | ||
66 | Who: David Miller <davem@davemloft.net> | ||
67 | Christoph Hellwig <hch@lst.de> | ||
68 | |||
69 | --------------------------- | ||
70 | |||
54 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 71 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
55 | When: December 2006 | 72 | When: December 2006 |
56 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 | 73 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 |
@@ -117,25 +134,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
117 | 134 | ||
118 | --------------------------- | 135 | --------------------------- |
119 | 136 | ||
120 | What: pci_module_init(driver) | ||
121 | When: January 2007 | ||
122 | Why: Is replaced by pci_register_driver(pci_driver). | ||
123 | Who: Richard Knutsson <ricknu-0@student.ltu.se> and Greg Kroah-Hartman <gregkh@suse.de> | ||
124 | |||
125 | --------------------------- | ||
126 | |||
127 | What: Usage of invalid timevals in setitimer | ||
128 | When: March 2007 | ||
129 | Why: POSIX requires to validate timevals in the setitimer call. This | ||
130 | was never done by Linux. The invalid (e.g. negative timevals) were | ||
131 | silently converted to more or less random timeouts and intervals. | ||
132 | Until the removal a per boot limited number of warnings is printed | ||
133 | and the timevals are sanitized. | ||
134 | |||
135 | Who: Thomas Gleixner <tglx@linutronix.de> | ||
136 | |||
137 | --------------------------- | ||
138 | |||
139 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports | 137 | What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports |
140 | (temporary transition config option provided until then) | 138 | (temporary transition config option provided until then) |
141 | The transition config option will also be removed at the same time. | 139 | The transition config option will also be removed at the same time. |
@@ -163,7 +161,7 @@ Who: Greg Kroah-Hartman <gregkh@suse.de> | |||
163 | --------------------------- | 161 | --------------------------- |
164 | 162 | ||
165 | What: Interrupt only SA_* flags | 163 | What: Interrupt only SA_* flags |
166 | When: Januar 2007 | 164 | When: September 2007 |
167 | Why: The interrupt related SA_* flags are replaced by IRQF_* to move them | 165 | Why: The interrupt related SA_* flags are replaced by IRQF_* to move them |
168 | out of the signal namespace. | 166 | out of the signal namespace. |
169 | 167 | ||
@@ -190,18 +188,10 @@ Who: Jean Delvare <khali@linux-fr.org> | |||
190 | 188 | ||
191 | --------------------------- | 189 | --------------------------- |
192 | 190 | ||
193 | What: i2c_adapter.dev | 191 | What: i2c_adapter.list |
194 | i2c_adapter.list | ||
195 | When: July 2007 | 192 | When: July 2007 |
196 | Why: Superfluous, given i2c_adapter.class_dev: | 193 | Why: Superfluous, this list duplicates the one maintained by the driver |
197 | * The "dev" was a stand-in for the physical device node that legacy | 194 | core. |
198 | drivers would not have; but now it's almost always present. Any | ||
199 | remaining legacy drivers must upgrade (they now trigger warnings). | ||
200 | * The "list" duplicates class device children. | ||
201 | The delay in removing this is so upgraded lm_sensors and libsensors | ||
202 | can get deployed. (Removal causes minor changes in the sysfs layout, | ||
203 | notably the location of the adapter type name and parenting the i2c | ||
204 | client hardware directly from their controller.) | ||
205 | Who: Jean Delvare <khali@linux-fr.org>, | 195 | Who: Jean Delvare <khali@linux-fr.org>, |
206 | David Brownell <dbrownell@users.sourceforge.net> | 196 | David Brownell <dbrownell@users.sourceforge.net> |
207 | 197 | ||
@@ -306,3 +296,35 @@ Why: Code was merged, then submitter immediately disappeared leaving | |||
306 | Who: David S. Miller <davem@davemloft.net> | 296 | Who: David S. Miller <davem@davemloft.net> |
307 | 297 | ||
308 | --------------------------- | 298 | --------------------------- |
299 | |||
300 | What: read_dev_chars(), read_conf_data{,_lpm}() (s390 common I/O layer) | ||
301 | When: December 2007 | ||
302 | Why: These functions are a leftover from 2.4 times. They have several | ||
303 | problems: | ||
304 | - Duplication of checks that are done in the device driver's | ||
305 | interrupt handler | ||
306 | - common I/O layer can't do device specific error recovery | ||
307 | - device driver can't be notified for conditions happening during | ||
308 | execution of the function | ||
309 | Device drivers should issue the read device characteristics and read | ||
310 | configuration data ccws and do the appropriate error handling | ||
311 | themselves. | ||
312 | Who: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
313 | |||
314 | --------------------------- | ||
315 | |||
316 | What: i2c-ixp2000, i2c-ixp4xx and scx200_i2c drivers | ||
317 | When: September 2007 | ||
318 | Why: Obsolete. The new i2c-gpio driver replaces all hardware-specific | ||
319 | I2C-over-GPIO drivers. | ||
320 | Who: Jean Delvare <khali@linux-fr.org> | ||
321 | |||
322 | --------------------------- | ||
323 | |||
324 | What: drivers depending on OSS_OBSOLETE | ||
325 | When: options in 2.6.23, code in 2.6.25 | ||
326 | Why: obsolete OSS drivers | ||
327 | Who: Adrian Bunk <bunk@stusta.de> | ||
328 | |||
329 | --------------------------- | ||
330 | |||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 28bfea75bcf2..d866551be037 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -15,6 +15,7 @@ prototypes: | |||
15 | int (*d_delete)(struct dentry *); | 15 | int (*d_delete)(struct dentry *); |
16 | void (*d_release)(struct dentry *); | 16 | void (*d_release)(struct dentry *); |
17 | void (*d_iput)(struct dentry *, struct inode *); | 17 | void (*d_iput)(struct dentry *, struct inode *); |
18 | char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen); | ||
18 | 19 | ||
19 | locking rules: | 20 | locking rules: |
20 | none have BKL | 21 | none have BKL |
@@ -25,6 +26,7 @@ d_compare: no yes no no | |||
25 | d_delete: yes no yes no | 26 | d_delete: yes no yes no |
26 | d_release: no no no yes | 27 | d_release: no no no yes |
27 | d_iput: no no no yes | 28 | d_iput: no no no yes |
29 | d_dname: no no no no | ||
28 | 30 | ||
29 | --------------------------- inode_operations --------------------------- | 31 | --------------------------- inode_operations --------------------------- |
30 | prototypes: | 32 | prototypes: |
@@ -52,7 +54,7 @@ ata *); | |||
52 | 54 | ||
53 | locking rules: | 55 | locking rules: |
54 | all may block, none have BKL | 56 | all may block, none have BKL |
55 | i_sem(inode) | 57 | i_mutex(inode) |
56 | lookup: yes | 58 | lookup: yes |
57 | create: yes | 59 | create: yes |
58 | link: yes (both) | 60 | link: yes (both) |
@@ -72,7 +74,7 @@ setxattr: yes | |||
72 | getxattr: no | 74 | getxattr: no |
73 | listxattr: no | 75 | listxattr: no |
74 | removexattr: yes | 76 | removexattr: yes |
75 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_sem on | 77 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on |
76 | victim. | 78 | victim. |
77 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. | 79 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. |
78 | ->truncate() is never called directly - it's a callback, not a | 80 | ->truncate() is never called directly - it's a callback, not a |
@@ -459,7 +461,7 @@ doesn't take the BKL. | |||
459 | ->read on directories probably must go away - we should just enforce -EISDIR | 461 | ->read on directories probably must go away - we should just enforce -EISDIR |
460 | in sys_read() and friends. | 462 | in sys_read() and friends. |
461 | 463 | ||
462 | ->fsync() has i_sem on inode. | 464 | ->fsync() has i_mutex on inode. |
463 | 465 | ||
464 | --------------------------- dquot_operations ------------------------------- | 466 | --------------------------- dquot_operations ------------------------------- |
465 | prototypes: | 467 | prototypes: |
diff --git a/Documentation/filesystems/hpfs.txt b/Documentation/filesystems/hpfs.txt index 38aba03efc5e..fa45c3baed98 100644 --- a/Documentation/filesystems/hpfs.txt +++ b/Documentation/filesystems/hpfs.txt | |||
@@ -290,7 +290,7 @@ History | |||
290 | 2.07 More fixes for Warp Server. Now it really works | 290 | 2.07 More fixes for Warp Server. Now it really works |
291 | 2.08 Creating new files is not so slow on large disks | 291 | 2.08 Creating new files is not so slow on large disks |
292 | An attempt to sync deleted file does not generate filesystem error | 292 | An attempt to sync deleted file does not generate filesystem error |
293 | 2.09 Fixed error on extremly fragmented files | 293 | 2.09 Fixed error on extremely fragmented files |
294 | 294 | ||
295 | 295 | ||
296 | vim: set textwidth=80: | 296 | vim: set textwidth=80: |
diff --git a/Documentation/filesystems/jfs.txt b/Documentation/filesystems/jfs.txt index bae128663748..26ebde77e821 100644 --- a/Documentation/filesystems/jfs.txt +++ b/Documentation/filesystems/jfs.txt | |||
@@ -29,7 +29,13 @@ errors=continue Keep going on a filesystem error. | |||
29 | errors=remount-ro Default. Remount the filesystem read-only on an error. | 29 | errors=remount-ro Default. Remount the filesystem read-only on an error. |
30 | errors=panic Panic and halt the machine if an error occurs. | 30 | errors=panic Panic and halt the machine if an error occurs. |
31 | 31 | ||
32 | Please send bugs, comments, cards and letters to shaggy@austin.ibm.com. | 32 | uid=value Override on-disk uid with specified value |
33 | gid=value Override on-disk gid with specified value | ||
34 | umask=value Override on-disk umask with specified octal value. For | ||
35 | directories, the execute bit will be set if the corresponding | ||
36 | read bit is set. | ||
37 | |||
38 | Please send bugs, comments, cards and letters to shaggy@linux.vnet.ibm.com. | ||
33 | 39 | ||
34 | The JFS mailing list can be subscribed to by using the link labeled | 40 | The JFS mailing list can be subscribed to by using the link labeled |
35 | "Mail list Subscribe" at our web page http://jfs.sourceforge.net/ | 41 | "Mail list Subscribe" at our web page http://jfs.sourceforge.net/ |
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt index 81779068b09b..8ee10ec88293 100644 --- a/Documentation/filesystems/ntfs.txt +++ b/Documentation/filesystems/ntfs.txt | |||
@@ -349,7 +349,7 @@ end of the line. | |||
349 | Note the "Should sync?" parameter "nosync" means that the two mirrors are | 349 | Note the "Should sync?" parameter "nosync" means that the two mirrors are |
350 | already in sync which will be the case on a clean shutdown of Windows. If the | 350 | already in sync which will be the case on a clean shutdown of Windows. If the |
351 | mirrors are not clean, you can specify the "sync" option instead of "nosync" | 351 | mirrors are not clean, you can specify the "sync" option instead of "nosync" |
352 | and the Device-Mapper driver will then copy the entirey of the "Source Device" | 352 | and the Device-Mapper driver will then copy the entirety of the "Source Device" |
353 | to the "Target Device" or if you specified multipled target devices to all of | 353 | to the "Target Device" or if you specified multipled target devices to all of |
354 | them. | 354 | them. |
355 | 355 | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 7aaf09b86a55..8756a07f4dc3 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -122,21 +122,22 @@ subdirectory has the entries listed in Table 1-1. | |||
122 | 122 | ||
123 | Table 1-1: Process specific entries in /proc | 123 | Table 1-1: Process specific entries in /proc |
124 | .............................................................................. | 124 | .............................................................................. |
125 | File Content | 125 | File Content |
126 | cmdline Command line arguments | 126 | clear_refs Clears page referenced bits shown in smaps output |
127 | cpu Current and last cpu in which it was executed (2.4)(smp) | 127 | cmdline Command line arguments |
128 | cwd Link to the current working directory | 128 | cpu Current and last cpu in which it was executed (2.4)(smp) |
129 | environ Values of environment variables | 129 | cwd Link to the current working directory |
130 | exe Link to the executable of this process | 130 | environ Values of environment variables |
131 | fd Directory, which contains all file descriptors | 131 | exe Link to the executable of this process |
132 | maps Memory maps to executables and library files (2.4) | 132 | fd Directory, which contains all file descriptors |
133 | mem Memory held by this process | 133 | maps Memory maps to executables and library files (2.4) |
134 | root Link to the root directory of this process | 134 | mem Memory held by this process |
135 | stat Process status | 135 | root Link to the root directory of this process |
136 | statm Process memory status information | 136 | stat Process status |
137 | status Process status in human readable form | 137 | statm Process memory status information |
138 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan | 138 | status Process status in human readable form |
139 | smaps Extension based on maps, presenting the rss size for each mapped file | 139 | wchan If CONFIG_KALLSYMS is set, a pre-decoded wchan |
140 | smaps Extension based on maps, the rss size for each mapped file | ||
140 | .............................................................................. | 141 | .............................................................................. |
141 | 142 | ||
142 | For example, to get the status information of a process, all you have to do is | 143 | For example, to get the status information of a process, all you have to do is |
@@ -228,7 +229,7 @@ Table 1-3: Kernel info in /proc | |||
228 | mounts Mounted filesystems | 229 | mounts Mounted filesystems |
229 | net Networking info (see text) | 230 | net Networking info (see text) |
230 | partitions Table of partitions known to the system | 231 | partitions Table of partitions known to the system |
231 | pci Depreciated info of PCI bus (new way -> /proc/bus/pci/, | 232 | pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, |
232 | decoupled by lspci (2.4) | 233 | decoupled by lspci (2.4) |
233 | rtc Real time clock | 234 | rtc Real time clock |
234 | scsi SCSI info (see text) | 235 | scsi SCSI info (see text) |
@@ -1137,6 +1138,13 @@ determine whether or not they are still functioning properly. | |||
1137 | Because the NMI watchdog shares registers with oprofile, by disabling the NMI | 1138 | Because the NMI watchdog shares registers with oprofile, by disabling the NMI |
1138 | watchdog, oprofile may have more registers to utilize. | 1139 | watchdog, oprofile may have more registers to utilize. |
1139 | 1140 | ||
1141 | maps_protect | ||
1142 | ------------ | ||
1143 | |||
1144 | Enables/Disables the protection of the per-process proc entries "maps" and | ||
1145 | "smaps". When enabled, the contents of these files are visible only to | ||
1146 | readers that are allowed to ptrace() the given process. | ||
1147 | |||
1140 | 1148 | ||
1141 | 2.4 /proc/sys/vm - The virtual memory subsystem | 1149 | 2.4 /proc/sys/vm - The virtual memory subsystem |
1142 | ----------------------------------------------- | 1150 | ----------------------------------------------- |
diff --git a/Documentation/filesystems/relay.txt b/Documentation/filesystems/relay.txt index 7fbb6ffe5769..18d23f9a18c7 100644 --- a/Documentation/filesystems/relay.txt +++ b/Documentation/filesystems/relay.txt | |||
@@ -351,7 +351,7 @@ If the current buffer is full, i.e. all sub-buffers remain unconsumed, | |||
351 | the callback returns 0 to indicate that the buffer switch should not | 351 | the callback returns 0 to indicate that the buffer switch should not |
352 | occur yet, i.e. until the consumer has had a chance to read the | 352 | occur yet, i.e. until the consumer has had a chance to read the |
353 | current set of ready sub-buffers. For the relay_buf_full() function | 353 | current set of ready sub-buffers. For the relay_buf_full() function |
354 | to make sense, the consumer is reponsible for notifying the relay | 354 | to make sense, the consumer is responsible for notifying the relay |
355 | interface when sub-buffers have been consumed via | 355 | interface when sub-buffers have been consumed via |
356 | relay_subbufs_consumed(). Any subsequent attempts to write into the | 356 | relay_subbufs_consumed(). Any subsequent attempts to write into the |
357 | buffer will again invoke the subbuf_start() callback with the same | 357 | buffer will again invoke the subbuf_start() callback with the same |
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt index 069cb1094300..fcc123ffa252 100644 --- a/Documentation/filesystems/vfat.txt +++ b/Documentation/filesystems/vfat.txt | |||
@@ -57,6 +57,13 @@ nonumtail=<bool> -- When creating 8.3 aliases, normally the alias will | |||
57 | currently exist in the directory, 'longfile.txt' will | 57 | currently exist in the directory, 'longfile.txt' will |
58 | be the short alias instead of 'longfi~1.txt'. | 58 | be the short alias instead of 'longfi~1.txt'. |
59 | 59 | ||
60 | usefree -- Use the "free clusters" value stored on FSINFO. It'll | ||
61 | be used to determine number of free clusters without | ||
62 | scanning disk. But it's not used by default, because | ||
63 | recent Windows don't update it correctly in some | ||
64 | case. If you are sure the "free clusters" on FSINFO is | ||
65 | correct, by this option you can avoid scanning disk. | ||
66 | |||
60 | quiet -- Stops printing certain warning messages. | 67 | quiet -- Stops printing certain warning messages. |
61 | 68 | ||
62 | check=s|r|n -- Case sensitivity checking setting. | 69 | check=s|r|n -- Case sensitivity checking setting. |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index ea271f2d3954..a47cc819f37b 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -827,7 +827,7 @@ This describes how a filesystem can overload the standard dentry | |||
827 | operations. Dentries and the dcache are the domain of the VFS and the | 827 | operations. Dentries and the dcache are the domain of the VFS and the |
828 | individual filesystem implementations. Device drivers have no business | 828 | individual filesystem implementations. Device drivers have no business |
829 | here. These methods may be set to NULL, as they are either optional or | 829 | here. These methods may be set to NULL, as they are either optional or |
830 | the VFS uses a default. As of kernel 2.6.13, the following members are | 830 | the VFS uses a default. As of kernel 2.6.22, the following members are |
831 | defined: | 831 | defined: |
832 | 832 | ||
833 | struct dentry_operations { | 833 | struct dentry_operations { |
@@ -837,6 +837,7 @@ struct dentry_operations { | |||
837 | int (*d_delete)(struct dentry *); | 837 | int (*d_delete)(struct dentry *); |
838 | void (*d_release)(struct dentry *); | 838 | void (*d_release)(struct dentry *); |
839 | void (*d_iput)(struct dentry *, struct inode *); | 839 | void (*d_iput)(struct dentry *, struct inode *); |
840 | char *(*d_dname)(struct dentry *, char *, int); | ||
840 | }; | 841 | }; |
841 | 842 | ||
842 | d_revalidate: called when the VFS needs to revalidate a dentry. This | 843 | d_revalidate: called when the VFS needs to revalidate a dentry. This |
@@ -859,6 +860,26 @@ struct dentry_operations { | |||
859 | VFS calls iput(). If you define this method, you must call | 860 | VFS calls iput(). If you define this method, you must call |
860 | iput() yourself | 861 | iput() yourself |
861 | 862 | ||
863 | d_dname: called when the pathname of a dentry should be generated. | ||
864 | Usefull for some pseudo filesystems (sockfs, pipefs, ...) to delay | ||
865 | pathname generation. (Instead of doing it when dentry is created, | ||
866 | its done only when the path is needed.). Real filesystems probably | ||
867 | dont want to use it, because their dentries are present in global | ||
868 | dcache hash, so their hash should be an invariant. As no lock is | ||
869 | held, d_dname() should not try to modify the dentry itself, unless | ||
870 | appropriate SMP safety is used. CAUTION : d_path() logic is quite | ||
871 | tricky. The correct way to return for example "Hello" is to put it | ||
872 | at the end of the buffer, and returns a pointer to the first char. | ||
873 | dynamic_dname() helper function is provided to take care of this. | ||
874 | |||
875 | Example : | ||
876 | |||
877 | static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen) | ||
878 | { | ||
879 | return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]", | ||
880 | dentry->d_inode->i_ino); | ||
881 | } | ||
882 | |||
862 | Each dentry has a pointer to its parent dentry, as well as a hash list | 883 | Each dentry has a pointer to its parent dentry, as well as a hash list |
863 | of child dentries. Child dentries are basically like files in a | 884 | of child dentries. Child dentries are basically like files in a |
864 | directory. | 885 | directory. |
diff --git a/Documentation/filesystems/xip.txt b/Documentation/filesystems/xip.txt index 6c0cef10eb4d..3cc4010521a0 100644 --- a/Documentation/filesystems/xip.txt +++ b/Documentation/filesystems/xip.txt | |||
@@ -19,7 +19,7 @@ completely. With execute-in-place, read&write type operations are performed | |||
19 | directly from/to the memory backed storage device. For file mappings, the | 19 | directly from/to the memory backed storage device. For file mappings, the |
20 | storage device itself is mapped directly into userspace. | 20 | storage device itself is mapped directly into userspace. |
21 | 21 | ||
22 | This implementation was initialy written for shared memory segments between | 22 | This implementation was initially written for shared memory segments between |
23 | different virtual machines on s390 hardware to allow multiple machines to | 23 | different virtual machines on s390 hardware to allow multiple machines to |
24 | share the same binaries and libraries. | 24 | share the same binaries and libraries. |
25 | 25 | ||
diff --git a/Documentation/fujitsu/frv/gdbstub.txt b/Documentation/fujitsu/frv/gdbstub.txt index 9304fb36ae8a..b92bfd902a4e 100644 --- a/Documentation/fujitsu/frv/gdbstub.txt +++ b/Documentation/fujitsu/frv/gdbstub.txt | |||
@@ -126,5 +126,5 @@ GDB stub and the debugger: | |||
126 | 126 | ||
127 | Furthermore, the GDB stub will intercept a number of exceptions automatically | 127 | Furthermore, the GDB stub will intercept a number of exceptions automatically |
128 | if they are caused by kernel execution. It will also intercept BUG() macro | 128 | if they are caused by kernel execution. It will also intercept BUG() macro |
129 | invokation. | 129 | invocation. |
130 | 130 | ||
diff --git a/Documentation/hwmon/adm1026 b/Documentation/hwmon/adm1026 index 473c689d7924..f4327db2307e 100644 --- a/Documentation/hwmon/adm1026 +++ b/Documentation/hwmon/adm1026 | |||
@@ -80,7 +80,7 @@ temperature sensor inputs. Both the PWM output and the DAC output can be | |||
80 | used to control fan speed. Usually only one of these two outputs will be | 80 | used to control fan speed. Usually only one of these two outputs will be |
81 | used. Write the minimum PWM or DAC value to the appropriate control | 81 | used. Write the minimum PWM or DAC value to the appropriate control |
82 | register. Then set the low temperature limit in the tmin values for each | 82 | register. Then set the low temperature limit in the tmin values for each |
83 | temperature sensor. The range of control is fixed at 20 °C, and the | 83 | temperature sensor. The range of control is fixed at 20 °C, and the |
84 | largest difference between current and tmin of the temperature sensors sets | 84 | largest difference between current and tmin of the temperature sensors sets |
85 | the control output. See the datasheet for several example circuits for | 85 | the control output. See the datasheet for several example circuits for |
86 | controlling fan speed with the PWM and DAC outputs. The fan speed sensors | 86 | controlling fan speed with the PWM and DAC outputs. The fan speed sensors |
diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp new file mode 100644 index 000000000000..870cda9416e9 --- /dev/null +++ b/Documentation/hwmon/coretemp | |||
@@ -0,0 +1,36 @@ | |||
1 | Kernel driver coretemp | ||
2 | ====================== | ||
3 | |||
4 | Supported chips: | ||
5 | * All Intel Core family | ||
6 | Prefix: 'coretemp' | ||
7 | CPUID: family 0x6, models 0xe, 0xf | ||
8 | Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual | ||
9 | Volume 3A: System Programming Guide | ||
10 | |||
11 | Author: Rudolf Marek | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | This driver permits reading temperature sensor embedded inside Intel Core CPU. | ||
17 | Temperature is measured in degrees Celsius and measurement resolution is | ||
18 | 1 degree C. Valid temperatures are from 0 to TjMax degrees C, because | ||
19 | the actual value of temperature register is in fact a delta from TjMax. | ||
20 | |||
21 | Temperature known as TjMax is the maximum junction temperature of processor. | ||
22 | Intel defines this temperature as 85C or 100C. At this temperature, protection | ||
23 | mechanism will perform actions to forcibly cool down the processor. Alarm | ||
24 | may be raised, if the temperature grows enough (more than TjMax) to trigger | ||
25 | the Out-Of-Spec bit. Following table summarizes the exported sysfs files: | ||
26 | |||
27 | temp1_input - Core temperature (in millidegrees Celsius). | ||
28 | temp1_crit - Maximum junction temperature (in millidegrees Celsius). | ||
29 | temp1_crit_alarm - Set when Out-of-spec bit is set, never clears. | ||
30 | Correct CPU operation is no longer guaranteed. | ||
31 | temp1_label - Contains string "Core X", where X is processor | ||
32 | number. | ||
33 | |||
34 | The TjMax temperature is set to 85 degrees C if undocumented model specific | ||
35 | register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as | ||
36 | (sometimes) documented in processor datasheet. | ||
diff --git a/Documentation/hwmon/gl518sm b/Documentation/hwmon/gl518sm index ce0881883bca..229f8b789185 100644 --- a/Documentation/hwmon/gl518sm +++ b/Documentation/hwmon/gl518sm | |||
@@ -13,7 +13,7 @@ Supported chips: | |||
13 | 13 | ||
14 | Authors: | 14 | Authors: |
15 | Frodo Looijaard <frodol@dds.nl>, | 15 | Frodo Looijaard <frodol@dds.nl>, |
16 | Kyösti Mälkki <kmalkki@cc.hut.fi> | 16 | Kyösti Mälkki <kmalkki@cc.hut.fi> |
17 | Hong-Gunn Chew <hglinux@gunnet.org> | 17 | Hong-Gunn Chew <hglinux@gunnet.org> |
18 | Jean Delvare <khali@linux-fr.org> | 18 | Jean Delvare <khali@linux-fr.org> |
19 | 19 | ||
diff --git a/Documentation/hwmon/lm83 b/Documentation/hwmon/lm83 index f7aad1489cb0..a04d1fe9269c 100644 --- a/Documentation/hwmon/lm83 +++ b/Documentation/hwmon/lm83 | |||
@@ -45,7 +45,7 @@ Unconfirmed motherboards: | |||
45 | The LM82 is confirmed to have been found on most AMD Geode reference | 45 | The LM82 is confirmed to have been found on most AMD Geode reference |
46 | designs and test platforms. | 46 | designs and test platforms. |
47 | 47 | ||
48 | The driver has been successfully tested by Magnus Forsström, who I'd | 48 | The driver has been successfully tested by Magnus Forsström, who I'd |
49 | like to thank here. More testers will be of course welcome. | 49 | like to thank here. More testers will be of course welcome. |
50 | 50 | ||
51 | The fact that the LM83 is only scarcely used can be easily explained. | 51 | The fact that the LM83 is only scarcely used can be easily explained. |
diff --git a/Documentation/hwmon/max6650 b/Documentation/hwmon/max6650 new file mode 100644 index 000000000000..8be7beb9e3e8 --- /dev/null +++ b/Documentation/hwmon/max6650 | |||
@@ -0,0 +1,53 @@ | |||
1 | Kernel driver max6650 | ||
2 | ===================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Maxim 6650 / 6651 | ||
6 | Prefix: 'max6650' | ||
7 | Addresses scanned: I2C 0x1b, 0x1f, 0x48, 0x4b | ||
8 | Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf | ||
9 | |||
10 | Authors: | ||
11 | Hans J. Koch <hjk@linutronix.de> | ||
12 | John Morris <john.morris@spirentcom.com> | ||
13 | Claus Gindhart <claus.gindhart@kontron.com> | ||
14 | |||
15 | Description | ||
16 | ----------- | ||
17 | |||
18 | This driver implements support for the Maxim 6650/6651 | ||
19 | |||
20 | The 2 devices are very similar, but the Maxim 6550 has a reduced feature | ||
21 | set, e.g. only one fan-input, instead of 4 for the 6651. | ||
22 | |||
23 | The driver is not able to distinguish between the 2 devices. | ||
24 | |||
25 | The driver provides the following sensor accesses in sysfs: | ||
26 | |||
27 | fan1_input ro fan tachometer speed in RPM | ||
28 | fan2_input ro " | ||
29 | fan3_input ro " | ||
30 | fan4_input ro " | ||
31 | fan1_target rw desired fan speed in RPM (closed loop mode only) | ||
32 | pwm1_enable rw regulator mode, 0=full on, 1=open loop, 2=closed loop | ||
33 | pwm1 rw relative speed (0-255), 255=max. speed. | ||
34 | Used in open loop mode only. | ||
35 | fan1_div rw sets the speed range the inputs can handle. Legal | ||
36 | values are 1, 2, 4, and 8. Use lower values for | ||
37 | faster fans. | ||
38 | |||
39 | Module parameters | ||
40 | ----------------- | ||
41 | |||
42 | If your board has a BIOS that initializes the MAX6650/6651 correctly, you can | ||
43 | simply load your module without parameters. It won't touch the configuration | ||
44 | registers then. If your board BIOS doesn't initialize the chip, or you want | ||
45 | different settings, you can set the following parameters: | ||
46 | |||
47 | voltage_12V: 5=5V fan, 12=12V fan, 0=don't change | ||
48 | prescaler: Possible values are 1,2,4,8,16, or 0 for don't change | ||
49 | clock: The clock frequency in Hz of the chip the driver should assume [254000] | ||
50 | |||
51 | Please have a look at the MAX6650/6651 data sheet and make sure that you fully | ||
52 | understand the meaning of these parameters before you attempt to change them. | ||
53 | |||
diff --git a/Documentation/hwmon/sis5595 b/Documentation/hwmon/sis5595 index b7ae36b8cdf5..4f8877a34f37 100644 --- a/Documentation/hwmon/sis5595 +++ b/Documentation/hwmon/sis5595 | |||
@@ -8,7 +8,7 @@ Supported chips: | |||
8 | Datasheet: Publicly available at the Silicon Integrated Systems Corp. site. | 8 | Datasheet: Publicly available at the Silicon Integrated Systems Corp. site. |
9 | 9 | ||
10 | Authors: | 10 | Authors: |
11 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 11 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
12 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 12 | Mark D. Studebaker <mdsxyz123@yahoo.com>, |
13 | Aurelien Jarno <aurelien@aurel32.net> 2.6 port | 13 | Aurelien Jarno <aurelien@aurel32.net> 2.6 port |
14 | 14 | ||
diff --git a/Documentation/hwmon/smsc47m1 b/Documentation/hwmon/smsc47m1 index 04a11124f667..42c8431b3c9d 100644 --- a/Documentation/hwmon/smsc47m1 +++ b/Documentation/hwmon/smsc47m1 | |||
@@ -14,6 +14,10 @@ Supported chips: | |||
14 | http://www.smsc.com/main/datasheets/47m14x.pdf | 14 | http://www.smsc.com/main/datasheets/47m14x.pdf |
15 | http://www.smsc.com/main/tools/discontinued/47m15x.pdf | 15 | http://www.smsc.com/main/tools/discontinued/47m15x.pdf |
16 | http://www.smsc.com/main/datasheets/47m192.pdf | 16 | http://www.smsc.com/main/datasheets/47m192.pdf |
17 | * SMSC LPC47M292 | ||
18 | Addresses scanned: none, address read from Super I/O config space | ||
19 | Prefix: 'smsc47m2' | ||
20 | Datasheet: Not public | ||
17 | * SMSC LPC47M997 | 21 | * SMSC LPC47M997 |
18 | Addresses scanned: none, address read from Super I/O config space | 22 | Addresses scanned: none, address read from Super I/O config space |
19 | Prefix: 'smsc47m1' | 23 | Prefix: 'smsc47m1' |
@@ -32,9 +36,10 @@ Description | |||
32 | The Standard Microsystems Corporation (SMSC) 47M1xx Super I/O chips | 36 | The Standard Microsystems Corporation (SMSC) 47M1xx Super I/O chips |
33 | contain monitoring and PWM control circuitry for two fans. | 37 | contain monitoring and PWM control circuitry for two fans. |
34 | 38 | ||
35 | The 47M15x and 47M192 chips contain a full 'hardware monitoring block' | 39 | The LPC47M15x, LPC47M192 and LPC47M292 chips contain a full 'hardware |
36 | in addition to the fan monitoring and control. The hardware monitoring | 40 | monitoring block' in addition to the fan monitoring and control. The |
37 | block is not supported by the driver. | 41 | hardware monitoring block is not supported by this driver, use the |
42 | smsc47m192 driver for that. | ||
38 | 43 | ||
39 | No documentation is available for the 47M997, but it has the same device | 44 | No documentation is available for the 47M997, but it has the same device |
40 | ID as the 47M15x and 47M192 chips and seems to be compatible. | 45 | ID as the 47M15x and 47M192 chips and seems to be compatible. |
diff --git a/Documentation/hwmon/smsc47m192 b/Documentation/hwmon/smsc47m192 index 45d6453cd435..6d54ecb7b3f8 100644 --- a/Documentation/hwmon/smsc47m192 +++ b/Documentation/hwmon/smsc47m192 | |||
@@ -2,12 +2,13 @@ Kernel driver smsc47m192 | |||
2 | ======================== | 2 | ======================== |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | * SMSC LPC47M192 and LPC47M997 | 5 | * SMSC LPC47M192, LPC47M15x, LPC47M292 and LPC47M997 |
6 | Prefix: 'smsc47m192' | 6 | Prefix: 'smsc47m192' |
7 | Addresses scanned: I2C 0x2c - 0x2d | 7 | Addresses scanned: I2C 0x2c - 0x2d |
8 | Datasheet: The datasheet for LPC47M192 is publicly available from | 8 | Datasheet: The datasheet for LPC47M192 is publicly available from |
9 | http://www.smsc.com/ | 9 | http://www.smsc.com/ |
10 | The LPC47M997 is compatible for hardware monitoring. | 10 | The LPC47M15x, LPC47M292 and LPC47M997 are compatible for |
11 | hardware monitoring. | ||
11 | 12 | ||
12 | Author: Hartmut Rick <linux@rick.claranet.de> | 13 | Author: Hartmut Rick <linux@rick.claranet.de> |
13 | Special thanks to Jean Delvare for careful checking | 14 | Special thanks to Jean Delvare for careful checking |
@@ -18,7 +19,7 @@ Description | |||
18 | ----------- | 19 | ----------- |
19 | 20 | ||
20 | This driver implements support for the hardware sensor capabilities | 21 | This driver implements support for the hardware sensor capabilities |
21 | of the SMSC LPC47M192 and LPC47M997 Super-I/O chips. | 22 | of the SMSC LPC47M192 and compatible Super-I/O chips. |
22 | 23 | ||
23 | These chips support 3 temperature channels and 8 voltage inputs | 24 | These chips support 3 temperature channels and 8 voltage inputs |
24 | as well as CPU voltage VID input. | 25 | as well as CPU voltage VID input. |
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index d73d2e8c7534..a9a18ad0d17a 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface | |||
@@ -152,6 +152,13 @@ fan[1-*]_div Fan divisor. | |||
152 | Note that this is actually an internal clock divisor, which | 152 | Note that this is actually an internal clock divisor, which |
153 | affects the measurable speed range, not the read value. | 153 | affects the measurable speed range, not the read value. |
154 | 154 | ||
155 | fan[1-*]_target | ||
156 | Desired fan speed | ||
157 | Unit: revolution/min (RPM) | ||
158 | RW | ||
159 | Only makes sense if the chip supports closed-loop fan speed | ||
160 | control based on the measured fan speed. | ||
161 | |||
155 | Also see the Alarms section for status flags associated with fans. | 162 | Also see the Alarms section for status flags associated with fans. |
156 | 163 | ||
157 | 164 | ||
diff --git a/Documentation/hwmon/via686a b/Documentation/hwmon/via686a index a936fb3824b2..d651b25f7519 100644 --- a/Documentation/hwmon/via686a +++ b/Documentation/hwmon/via686a | |||
@@ -8,7 +8,7 @@ Supported chips: | |||
8 | Datasheet: On request through web form (http://www.via.com.tw/en/support/datasheets/) | 8 | Datasheet: On request through web form (http://www.via.com.tw/en/support/datasheets/) |
9 | 9 | ||
10 | Authors: | 10 | Authors: |
11 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 11 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
12 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 12 | Mark D. Studebaker <mdsxyz123@yahoo.com> |
13 | Bob Dougherty <bobd@stanford.edu> | 13 | Bob Dougherty <bobd@stanford.edu> |
14 | (Some conversion-factor data were contributed by | 14 | (Some conversion-factor data were contributed by |
diff --git a/Documentation/hwmon/w83792d b/Documentation/hwmon/w83792d index 8171c285bb55..14a668ed8aaa 100644 --- a/Documentation/hwmon/w83792d +++ b/Documentation/hwmon/w83792d | |||
@@ -107,7 +107,7 @@ Known problems: | |||
107 | by CR[0x49h]. | 107 | by CR[0x49h]. |
108 | - The function of vid and vrm has not been finished, because I'm NOT | 108 | - The function of vid and vrm has not been finished, because I'm NOT |
109 | very familiar with them. Adding support is welcome. | 109 | very familiar with them. Adding support is welcome. |
110 | - The function of chassis open detection needs more tests. | 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 | 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 | 112 | need to upgrade to latest (or beta) BIOS. If it does not help please |
113 | contact us. | 113 | contact us. |
diff --git a/Documentation/i2c/busses/i2c-i810 b/Documentation/i2c/busses/i2c-i810 index 83c3b9743c3c..778210ee1583 100644 --- a/Documentation/i2c/busses/i2c-i810 +++ b/Documentation/i2c/busses/i2c-i810 | |||
@@ -7,7 +7,7 @@ Supported adapters: | |||
7 | Authors: | 7 | Authors: |
8 | Frodo Looijaard <frodol@dds.nl>, | 8 | Frodo Looijaard <frodol@dds.nl>, |
9 | Philip Edelbrock <phil@netroedge.com>, | 9 | Philip Edelbrock <phil@netroedge.com>, |
10 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 10 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
11 | Ralph Metzler <rjkm@thp.uni-koeln.de>, | 11 | Ralph Metzler <rjkm@thp.uni-koeln.de>, |
12 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 12 | Mark D. Studebaker <mdsxyz123@yahoo.com> |
13 | 13 | ||
diff --git a/Documentation/i2c/busses/i2c-nforce2 b/Documentation/i2c/busses/i2c-nforce2 index 7f61fbc03f7f..fae3495bcbaf 100644 --- a/Documentation/i2c/busses/i2c-nforce2 +++ b/Documentation/i2c/busses/i2c-nforce2 | |||
@@ -9,6 +9,8 @@ Supported adapters: | |||
9 | * nForce4 MCP-04 10de:0034 | 9 | * nForce4 MCP-04 10de:0034 |
10 | * nForce4 MCP51 10de:0264 | 10 | * nForce4 MCP51 10de:0264 |
11 | * nForce4 MCP55 10de:0368 | 11 | * nForce4 MCP55 10de:0368 |
12 | * nForce4 MCP61 10de:03EB | ||
13 | * nForce4 MCP65 10de:0446 | ||
12 | 14 | ||
13 | Datasheet: not publicly available, but seems to be similar to the | 15 | Datasheet: not publicly available, but seems to be similar to the |
14 | AMD-8111 SMBus 2.0 adapter. | 16 | AMD-8111 SMBus 2.0 adapter. |
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x index 08d7b2dac69a..266481fd26e2 100644 --- a/Documentation/i2c/busses/i2c-sis96x +++ b/Documentation/i2c/busses/i2c-sis96x | |||
@@ -60,7 +60,7 @@ Mark D. Studebaker <mdsxyz123@yahoo.com> | |||
60 | - design hints and bug fixes | 60 | - design hints and bug fixes |
61 | Alexander Maylsh <amalysh@web.de> | 61 | Alexander Maylsh <amalysh@web.de> |
62 | - ditto, plus an important datasheet... almost the one I really wanted | 62 | - ditto, plus an important datasheet... almost the one I really wanted |
63 | Hans-Günter Lütke Uphues <hg_lu@t-online.de> | 63 | Hans-Günter Lütke Uphues <hg_lu@t-online.de> |
64 | - patch for SiS735 | 64 | - patch for SiS735 |
65 | Robert Zwerus <arzie@dds.nl> | 65 | Robert Zwerus <arzie@dds.nl> |
66 | - testing for SiS645DX | 66 | - testing for SiS645DX |
diff --git a/Documentation/i2c/busses/i2c-via b/Documentation/i2c/busses/i2c-via index 55edfe1a640b..343870661ac3 100644 --- a/Documentation/i2c/busses/i2c-via +++ b/Documentation/i2c/busses/i2c-via | |||
@@ -4,7 +4,7 @@ Supported adapters: | |||
4 | * VIA Technologies, InC. VT82C586B | 4 | * VIA Technologies, InC. VT82C586B |
5 | Datasheet: Publicly available at the VIA website | 5 | Datasheet: Publicly available at the VIA website |
6 | 6 | ||
7 | Author: Kyösti Mälkki <kmalkki@cc.hut.fi> | 7 | Author: Kyösti Mälkki <kmalkki@cc.hut.fi> |
8 | 8 | ||
9 | Description | 9 | Description |
10 | ----------- | 10 | ----------- |
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro index 775f489e86f6..06b4be3ef6d8 100644 --- a/Documentation/i2c/busses/i2c-viapro +++ b/Documentation/i2c/busses/i2c-viapro | |||
@@ -17,7 +17,7 @@ Supported adapters: | |||
17 | Datasheet: available on request and under NDA from VIA | 17 | Datasheet: available on request and under NDA from VIA |
18 | 18 | ||
19 | Authors: | 19 | Authors: |
20 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 20 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
21 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 21 | Mark D. Studebaker <mdsxyz123@yahoo.com>, |
22 | Jean Delvare <khali@linux-fr.org> | 22 | Jean Delvare <khali@linux-fr.org> |
23 | 23 | ||
diff --git a/Documentation/i2c/i2c-protocol b/Documentation/i2c/i2c-protocol index b4022c914210..579b92d5f3a3 100644 --- a/Documentation/i2c/i2c-protocol +++ b/Documentation/i2c/i2c-protocol | |||
@@ -68,7 +68,7 @@ We have found some I2C devices that needs the following modifications: | |||
68 | 68 | ||
69 | Flags I2C_M_IGNORE_NAK | 69 | Flags I2C_M_IGNORE_NAK |
70 | Normally message is interrupted immediately if there is [NA] from the | 70 | Normally message is interrupted immediately if there is [NA] from the |
71 | client. Setting this flag treats any [NA] as [A], and all of | 71 | client. Setting this flag treats any [NA] as [A], and all of |
72 | message is sent. | 72 | message is sent. |
73 | These messages may still fail to SCL lo->hi timeout. | 73 | These messages may still fail to SCL lo->hi timeout. |
74 | 74 | ||
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index ca272b263a92..7bf82c08f6ca 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -1,4 +1,4 @@ | |||
1 | Revision 6, 2005-11-20 | 1 | Revision 7, 2007-04-19 |
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 | ||
@@ -20,6 +20,10 @@ yours for best results. | |||
20 | 20 | ||
21 | Technical changes: | 21 | Technical changes: |
22 | 22 | ||
23 | * [Driver type] Any driver that was relying on i2c-isa has to be | ||
24 | converted to a proper isa, platform or pci driver. This is not | ||
25 | covered by this guide. | ||
26 | |||
23 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. | 27 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. |
24 | Includes typically look like that: | 28 | Includes typically look like that: |
25 | #include <linux/module.h> | 29 | #include <linux/module.h> |
@@ -27,12 +31,10 @@ Technical changes: | |||
27 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
28 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
29 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
30 | #include <linux/i2c-isa.h> /* for ISA drivers */ | ||
31 | #include <linux/hwmon.h> /* for hardware monitoring drivers */ | 34 | #include <linux/hwmon.h> /* for hardware monitoring drivers */ |
32 | #include <linux/hwmon-sysfs.h> | 35 | #include <linux/hwmon-sysfs.h> |
33 | #include <linux/hwmon-vid.h> /* if you need VRM support */ | 36 | #include <linux/hwmon-vid.h> /* if you need VRM support */ |
34 | #include <linux/err.h> /* for class registration */ | 37 | #include <linux/err.h> /* for class registration */ |
35 | #include <asm/io.h> /* if you have I/O operations */ | ||
36 | Please respect this inclusion order. Some extra headers may be | 38 | Please respect this inclusion order. Some extra headers may be |
37 | required for a given driver (e.g. "lm75.h"). | 39 | required for a given driver (e.g. "lm75.h"). |
38 | 40 | ||
@@ -69,20 +71,16 @@ Technical changes: | |||
69 | sensors mailing list <lm-sensors@lm-sensors.org> by providing a | 71 | sensors mailing list <lm-sensors@lm-sensors.org> by providing a |
70 | patch to the Documentation/hwmon/sysfs-interface file. | 72 | patch to the Documentation/hwmon/sysfs-interface file. |
71 | 73 | ||
72 | * [Attach] For I2C drivers, the attach function should make sure | 74 | * [Attach] The attach function should make sure that the adapter's |
73 | that the adapter's class has I2C_CLASS_HWMON (or whatever class is | 75 | class has I2C_CLASS_HWMON (or whatever class is suitable for your |
74 | suitable for your driver), using the following construct: | 76 | driver), using the following construct: |
75 | if (!(adapter->class & I2C_CLASS_HWMON)) | 77 | if (!(adapter->class & I2C_CLASS_HWMON)) |
76 | return 0; | 78 | return 0; |
77 | ISA-only drivers of course don't need this. | ||
78 | Call i2c_probe() instead of i2c_detect(). | 79 | Call i2c_probe() instead of i2c_detect(). |
79 | 80 | ||
80 | * [Detect] As mentioned earlier, the flags parameter is gone. | 81 | * [Detect] As mentioned earlier, the flags parameter is gone. |
81 | The type_name and client_name strings are replaced by a single | 82 | The type_name and client_name strings are replaced by a single |
82 | name string, which will be filled with a lowercase, short string. | 83 | name string, which will be filled with a lowercase, short string. |
83 | In i2c-only drivers, drop the i2c_is_isa_adapter check, it's | ||
84 | useless. Same for isa-only drivers, as the test would always be | ||
85 | true. Only hybrid drivers (which are quite rare) still need it. | ||
86 | The labels used for error paths are reduced to the number needed. | 84 | The labels used for error paths are reduced to the number needed. |
87 | It is advised that the labels are given descriptive names such as | 85 | It is advised that the labels are given descriptive names such as |
88 | exit and exit_free. Don't forget to properly set err before | 86 | exit and exit_free. Don't forget to properly set err before |
diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary index 41dde8776791..aea60bf7e8f0 100644 --- a/Documentation/i2c/summary +++ b/Documentation/i2c/summary | |||
@@ -4,17 +4,23 @@ I2C and SMBus | |||
4 | ============= | 4 | ============= |
5 | 5 | ||
6 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a | 6 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a |
7 | slow two-wire protocol (10-400 kHz), but it suffices for many types of | 7 | slow two-wire protocol (variable speed, up to 400 kHz), with a high speed |
8 | devices. | 8 | extension (3.4 MHz). It provides an inexpensive bus for connecting many |
9 | types of devices with infrequent or low bandwidth communications needs. | ||
10 | I2C is widely used with embedded systems. Some systems use variants that | ||
11 | don't meet branding requirements, and so are not advertised as being I2C. | ||
9 | 12 | ||
10 | SMBus (System Management Bus) is a subset of the I2C protocol. Many | 13 | SMBus (System Management Bus) is based on the I2C protocol, and is mostly |
11 | modern mainboards have a System Management Bus. There are a lot of | 14 | a subset of I2C protocols and signaling. Many I2C devices will work on an |
12 | devices which can be connected to a SMBus; the most notable are modern | 15 | SMBus, but some SMBus protocols add semantics beyond what is required to |
13 | memory chips with EEPROM memories and chips for hardware monitoring. | 16 | achieve I2C branding. Modern PC mainboards rely on SMBus. The most common |
17 | devices connected through SMBus are RAM modules configured using I2C EEPROMs, | ||
18 | and hardware monitoring chips. | ||
14 | 19 | ||
15 | Because the SMBus is just a special case of the generalized I2C bus, we | 20 | Because the SMBus is mostly a subset of the generalized I2C bus, we can |
16 | can simulate the SMBus protocol on plain I2C busses. The reverse is | 21 | use its protocols on many I2C systems. However, there are systems that don't |
17 | regretfully impossible. | 22 | meet both SMBus and I2C electrical constraints; and others which can't |
23 | implement all the common SMBus protocol semantics or messages. | ||
18 | 24 | ||
19 | 25 | ||
20 | Terminology | 26 | Terminology |
@@ -29,6 +35,7 @@ When we talk about I2C, we use the following terms: | |||
29 | An Algorithm driver contains general code that can be used for a whole class | 35 | An Algorithm driver contains general code that can be used for a whole class |
30 | of I2C adapters. Each specific adapter driver depends on one algorithm | 36 | of I2C adapters. Each specific adapter driver depends on one algorithm |
31 | driver. | 37 | driver. |
38 | |||
32 | A Driver driver (yes, this sounds ridiculous, sorry) contains the general | 39 | A Driver driver (yes, this sounds ridiculous, sorry) contains the general |
33 | code to access some type of device. Each detected device gets its own | 40 | code to access some type of device. Each detected device gets its own |
34 | data in the Client structure. Usually, Driver and Client are more closely | 41 | data in the Client structure. Usually, Driver and Client are more closely |
@@ -40,6 +47,10 @@ a separate Adapter and Algorithm driver), and drivers for your I2C devices | |||
40 | in this package. See the lm_sensors project http://www.lm-sensors.nu | 47 | in this package. See the lm_sensors project http://www.lm-sensors.nu |
41 | for device drivers. | 48 | for device drivers. |
42 | 49 | ||
50 | At this time, Linux only operates I2C (or SMBus) in master mode; you can't | ||
51 | use these APIs to make a Linux system behave as a slave/device, either to | ||
52 | speak a custom protocol or to emulate some other device. | ||
53 | |||
43 | 54 | ||
44 | Included Bus Drivers | 55 | Included Bus Drivers |
45 | ==================== | 56 | ==================== |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index fbcff96f4ca1..3d8d36b0ad12 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -1,5 +1,5 @@ | |||
1 | This is a small guide for those who want to write kernel drivers for I2C | 1 | This is a small guide for those who want to write kernel drivers for I2C |
2 | or SMBus devices. | 2 | or SMBus devices, using Linux as the protocol host/master (not slave). |
3 | 3 | ||
4 | To set up a driver, you need to do several things. Some are optional, and | 4 | To set up a driver, you need to do several things. Some are optional, and |
5 | some things can be done slightly or completely different. Use this as a | 5 | some things can be done slightly or completely different. Use this as a |
@@ -29,8 +29,16 @@ static struct i2c_driver foo_driver = { | |||
29 | .driver = { | 29 | .driver = { |
30 | .name = "foo", | 30 | .name = "foo", |
31 | }, | 31 | }, |
32 | |||
33 | /* iff driver uses driver model ("new style") binding model: */ | ||
34 | .probe = foo_probe, | ||
35 | .remove = foo_remove, | ||
36 | |||
37 | /* else, driver uses "legacy" binding model: */ | ||
32 | .attach_adapter = foo_attach_adapter, | 38 | .attach_adapter = foo_attach_adapter, |
33 | .detach_client = foo_detach_client, | 39 | .detach_client = foo_detach_client, |
40 | |||
41 | /* these may be used regardless of the driver binding model */ | ||
34 | .shutdown = foo_shutdown, /* optional */ | 42 | .shutdown = foo_shutdown, /* optional */ |
35 | .suspend = foo_suspend, /* optional */ | 43 | .suspend = foo_suspend, /* optional */ |
36 | .resume = foo_resume, /* optional */ | 44 | .resume = foo_resume, /* optional */ |
@@ -40,7 +48,8 @@ static struct i2c_driver foo_driver = { | |||
40 | The name field is the driver name, and must not contain spaces. It | 48 | The name field is the driver name, and must not contain spaces. It |
41 | should match the module name (if the driver can be compiled as a module), | 49 | should match the module name (if the driver can be compiled as a module), |
42 | although you can use MODULE_ALIAS (passing "foo" in this example) to add | 50 | although you can use MODULE_ALIAS (passing "foo" in this example) to add |
43 | another name for the module. | 51 | another name for the module. If the driver name doesn't match the module |
52 | name, the module won't be automatically loaded (hotplug/coldplug). | ||
44 | 53 | ||
45 | All other fields are for call-back functions which will be explained | 54 | All other fields are for call-back functions which will be explained |
46 | below. | 55 | below. |
@@ -65,16 +74,13 @@ An example structure is below. | |||
65 | 74 | ||
66 | struct foo_data { | 75 | struct foo_data { |
67 | struct i2c_client client; | 76 | struct i2c_client client; |
68 | struct semaphore lock; /* For ISA access in `sensors' drivers. */ | ||
69 | int sysctl_id; /* To keep the /proc directory entry for | ||
70 | `sensors' drivers. */ | ||
71 | enum chips type; /* To keep the chips type for `sensors' drivers. */ | 77 | enum chips type; /* To keep the chips type for `sensors' drivers. */ |
72 | 78 | ||
73 | /* Because the i2c bus is slow, it is often useful to cache the read | 79 | /* Because the i2c bus is slow, it is often useful to cache the read |
74 | information of a chip for some time (for example, 1 or 2 seconds). | 80 | information of a chip for some time (for example, 1 or 2 seconds). |
75 | It depends of course on the device whether this is really worthwhile | 81 | It depends of course on the device whether this is really worthwhile |
76 | or even sensible. */ | 82 | or even sensible. */ |
77 | struct semaphore update_lock; /* When we are reading lots of information, | 83 | struct mutex update_lock; /* When we are reading lots of information, |
78 | another process should not update the | 84 | another process should not update the |
79 | below information */ | 85 | below information */ |
80 | char valid; /* != 0 if the following fields are valid. */ | 86 | char valid; /* != 0 if the following fields are valid. */ |
@@ -95,8 +101,7 @@ some obscure clients). But we need generic reading and writing routines. | |||
95 | I have found it useful to define foo_read and foo_write function for this. | 101 | I have found it useful to define foo_read and foo_write function for this. |
96 | For some cases, it will be easier to call the i2c functions directly, | 102 | For some cases, it will be easier to call the i2c functions directly, |
97 | but many chips have some kind of register-value idea that can easily | 103 | but many chips have some kind of register-value idea that can easily |
98 | be encapsulated. Also, some chips have both ISA and I2C interfaces, and | 104 | be encapsulated. |
99 | it useful to abstract from this (only for `sensors' drivers). | ||
100 | 105 | ||
101 | The below functions are simple examples, and should not be copied | 106 | The below functions are simple examples, and should not be copied |
102 | literally. | 107 | literally. |
@@ -119,28 +124,101 @@ literally. | |||
119 | return i2c_smbus_write_word_data(client,reg,value); | 124 | return i2c_smbus_write_word_data(client,reg,value); |
120 | } | 125 | } |
121 | 126 | ||
122 | For sensors code, you may have to cope with ISA registers too. Something | ||
123 | like the below often works. Note the locking! | ||
124 | |||
125 | int foo_read_value(struct i2c_client *client, u8 reg) | ||
126 | { | ||
127 | int res; | ||
128 | if (i2c_is_isa_client(client)) { | ||
129 | down(&(((struct foo_data *) (client->data)) -> lock)); | ||
130 | outb_p(reg,client->addr + FOO_ADDR_REG_OFFSET); | ||
131 | res = inb_p(client->addr + FOO_DATA_REG_OFFSET); | ||
132 | up(&(((struct foo_data *) (client->data)) -> lock)); | ||
133 | return res; | ||
134 | } else | ||
135 | return i2c_smbus_read_byte_data(client,reg); | ||
136 | } | ||
137 | |||
138 | Writing is done the same way. | ||
139 | |||
140 | 127 | ||
141 | Probing and attaching | 128 | Probing and attaching |
142 | ===================== | 129 | ===================== |
143 | 130 | ||
131 | The Linux I2C stack was originally written to support access to hardware | ||
132 | monitoring chips on PC motherboards, and thus it embeds some assumptions | ||
133 | that are more appropriate to SMBus (and PCs) than to I2C. One of these | ||
134 | assumptions is that most adapters and devices drivers support the SMBUS_QUICK | ||
135 | protocol to probe device presence. Another is that devices and their drivers | ||
136 | can be sufficiently configured using only such probe primitives. | ||
137 | |||
138 | As Linux and its I2C stack became more widely used in embedded systems | ||
139 | and complex components such as DVB adapters, those assumptions became more | ||
140 | problematic. Drivers for I2C devices that issue interrupts need more (and | ||
141 | different) configuration information, as do drivers handling chip variants | ||
142 | that can't be distinguished by protocol probing, or which need some board | ||
143 | specific information to operate correctly. | ||
144 | |||
145 | Accordingly, the I2C stack now has two models for associating I2C devices | ||
146 | with their drivers: the original "legacy" model, and a newer one that's | ||
147 | fully compatible with the Linux 2.6 driver model. These models do not mix, | ||
148 | since the "legacy" model requires drivers to create "i2c_client" device | ||
149 | objects after SMBus style probing, while the Linux driver model expects | ||
150 | drivers to be given such device objects in their probe() routines. | ||
151 | |||
152 | |||
153 | Standard Driver Model Binding ("New Style") | ||
154 | ------------------------------------------- | ||
155 | |||
156 | System infrastructure, typically board-specific initialization code or | ||
157 | boot firmware, reports what I2C devices exist. For example, there may be | ||
158 | a table, in the kernel or from the boot loader, identifying I2C devices | ||
159 | and linking them to board-specific configuration information about IRQs | ||
160 | and other wiring artifacts, chip type, and so on. That could be used to | ||
161 | create i2c_client objects for each I2C device. | ||
162 | |||
163 | I2C device drivers using this binding model work just like any other | ||
164 | kind of driver in Linux: they provide a probe() method to bind to | ||
165 | those devices, and a remove() method to unbind. | ||
166 | |||
167 | static int foo_probe(struct i2c_client *client); | ||
168 | static int foo_remove(struct i2c_client *client); | ||
169 | |||
170 | Remember that the i2c_driver does not create those client handles. The | ||
171 | handle may be used during foo_probe(). If foo_probe() reports success | ||
172 | (zero not a negative status code) it may save the handle and use it until | ||
173 | foo_remove() returns. That binding model is used by most Linux drivers. | ||
174 | |||
175 | Drivers match devices when i2c_client.driver_name and the driver name are | ||
176 | the same; this approach is used in several other busses that don't have | ||
177 | device typing support in the hardware. The driver and module name should | ||
178 | match, so hotplug/coldplug mechanisms will modprobe the driver. | ||
179 | |||
180 | |||
181 | Device Creation (Standard driver model) | ||
182 | --------------------------------------- | ||
183 | |||
184 | If you know for a fact that an I2C device is connected to a given I2C bus, | ||
185 | you can instantiate that device by simply filling an i2c_board_info | ||
186 | structure with the device address and driver name, and calling | ||
187 | i2c_new_device(). This will create the device, then the driver core will | ||
188 | take care of finding the right driver and will call its probe() method. | ||
189 | If a driver supports different device types, you can specify the type you | ||
190 | want using the type field. You can also specify an IRQ and platform data | ||
191 | if needed. | ||
192 | |||
193 | Sometimes you know that a device is connected to a given I2C bus, but you | ||
194 | don't know the exact address it uses. This happens on TV adapters for | ||
195 | example, where the same driver supports dozens of slightly different | ||
196 | models, and I2C device addresses change from one model to the next. In | ||
197 | that case, you can use the i2c_new_probed_device() variant, which is | ||
198 | similar to i2c_new_device(), except that it takes an additional list of | ||
199 | possible I2C addresses to probe. A device is created for the first | ||
200 | responsive address in the list. If you expect more than one device to be | ||
201 | present in the address range, simply call i2c_new_probed_device() that | ||
202 | many times. | ||
203 | |||
204 | The call to i2c_new_device() or i2c_new_probed_device() typically happens | ||
205 | in the I2C bus driver. You may want to save the returned i2c_client | ||
206 | reference for later use. | ||
207 | |||
208 | |||
209 | Device Deletion (Standard driver model) | ||
210 | --------------------------------------- | ||
211 | |||
212 | Each I2C device which has been created using i2c_new_device() or | ||
213 | i2c_new_probed_device() can be unregistered by calling | ||
214 | i2c_unregister_device(). If you don't call it explicitly, it will be | ||
215 | called automatically before the underlying I2C bus itself is removed, as a | ||
216 | device can't survive its parent in the device driver model. | ||
217 | |||
218 | |||
219 | Legacy Driver Binding Model | ||
220 | --------------------------- | ||
221 | |||
144 | Most i2c devices can be present on several i2c addresses; for some this | 222 | Most i2c devices can be present on several i2c addresses; for some this |
145 | is determined in hardware (by soldering some chip pins to Vcc or Ground), | 223 | is determined in hardware (by soldering some chip pins to Vcc or Ground), |
146 | for others this can be changed in software (by writing to specific client | 224 | for others this can be changed in software (by writing to specific client |
@@ -157,13 +235,9 @@ detection algorithm. | |||
157 | You do not have to use this parameter interface; but don't try to use | 235 | You do not have to use this parameter interface; but don't try to use |
158 | function i2c_probe() if you don't. | 236 | function i2c_probe() if you don't. |
159 | 237 | ||
160 | NOTE: If you want to write a `sensors' driver, the interface is slightly | ||
161 | different! See below. | ||
162 | |||
163 | 238 | ||
164 | 239 | Probing classes (Legacy model) | |
165 | Probing classes | 240 | ------------------------------ |
166 | --------------- | ||
167 | 241 | ||
168 | All parameters are given as lists of unsigned 16-bit integers. Lists are | 242 | All parameters are given as lists of unsigned 16-bit integers. Lists are |
169 | terminated by I2C_CLIENT_END. | 243 | terminated by I2C_CLIENT_END. |
@@ -210,8 +284,8 @@ Note that you *have* to call the defined variable `normal_i2c', | |||
210 | without any prefix! | 284 | without any prefix! |
211 | 285 | ||
212 | 286 | ||
213 | Attaching to an adapter | 287 | Attaching to an adapter (Legacy model) |
214 | ----------------------- | 288 | -------------------------------------- |
215 | 289 | ||
216 | Whenever a new adapter is inserted, or for all adapters if the driver is | 290 | Whenever a new adapter is inserted, or for all adapters if the driver is |
217 | being registered, the callback attach_adapter() is called. Now is the | 291 | being registered, the callback attach_adapter() is called. Now is the |
@@ -237,17 +311,13 @@ them (unless a `force' parameter was used). In addition, addresses that | |||
237 | are already in use (by some other registered client) are skipped. | 311 | are already in use (by some other registered client) are skipped. |
238 | 312 | ||
239 | 313 | ||
240 | The detect client function | 314 | The detect client function (Legacy model) |
241 | -------------------------- | 315 | ----------------------------------------- |
242 | 316 | ||
243 | The detect client function is called by i2c_probe. The `kind' parameter | 317 | The detect client function is called by i2c_probe. The `kind' parameter |
244 | contains -1 for a probed detection, 0 for a forced detection, or a positive | 318 | contains -1 for a probed detection, 0 for a forced detection, or a positive |
245 | number for a forced detection with a chip type forced. | 319 | number for a forced detection with a chip type forced. |
246 | 320 | ||
247 | Below, some things are only needed if this is a `sensors' driver. Those | ||
248 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ | ||
249 | markers. | ||
250 | |||
251 | Returning an error different from -ENODEV in a detect function will cause | 321 | Returning an error different from -ENODEV in a detect function will cause |
252 | the detection to stop: other addresses and adapters won't be scanned. | 322 | the detection to stop: other addresses and adapters won't be scanned. |
253 | This should only be done on fatal or internal errors, such as a memory | 323 | This should only be done on fatal or internal errors, such as a memory |
@@ -256,64 +326,20 @@ shortage or i2c_attach_client failing. | |||
256 | For now, you can ignore the `flags' parameter. It is there for future use. | 326 | For now, you can ignore the `flags' parameter. It is there for future use. |
257 | 327 | ||
258 | int foo_detect_client(struct i2c_adapter *adapter, int address, | 328 | int foo_detect_client(struct i2c_adapter *adapter, int address, |
259 | unsigned short flags, int kind) | 329 | int kind) |
260 | { | 330 | { |
261 | int err = 0; | 331 | int err = 0; |
262 | int i; | 332 | int i; |
263 | struct i2c_client *new_client; | 333 | struct i2c_client *client; |
264 | struct foo_data *data; | 334 | struct foo_data *data; |
265 | const char *client_name = ""; /* For non-`sensors' drivers, put the real | 335 | const char *name = ""; |
266 | name here! */ | ||
267 | 336 | ||
268 | /* Let's see whether this adapter can support what we need. | 337 | /* Let's see whether this adapter can support what we need. |
269 | Please substitute the things you need here! | 338 | Please substitute the things you need here! */ |
270 | For `sensors' drivers, add `! is_isa &&' to the if statement */ | ||
271 | if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA | | 339 | if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA | |
272 | I2C_FUNC_SMBUS_WRITE_BYTE)) | 340 | I2C_FUNC_SMBUS_WRITE_BYTE)) |
273 | goto ERROR0; | 341 | goto ERROR0; |
274 | 342 | ||
275 | /* SENSORS ONLY START */ | ||
276 | const char *type_name = ""; | ||
277 | int is_isa = i2c_is_isa_adapter(adapter); | ||
278 | |||
279 | /* Do this only if the chip can additionally be found on the ISA bus | ||
280 | (hybrid chip). */ | ||
281 | |||
282 | if (is_isa) { | ||
283 | |||
284 | /* Discard immediately if this ISA range is already used */ | ||
285 | /* FIXME: never use check_region(), only request_region() */ | ||
286 | if (check_region(address,FOO_EXTENT)) | ||
287 | goto ERROR0; | ||
288 | |||
289 | /* Probe whether there is anything on this address. | ||
290 | Some example code is below, but you will have to adapt this | ||
291 | for your own driver */ | ||
292 | |||
293 | if (kind < 0) /* Only if no force parameter was used */ { | ||
294 | /* We may need long timeouts at least for some chips. */ | ||
295 | #define REALLY_SLOW_IO | ||
296 | i = inb_p(address + 1); | ||
297 | if (inb_p(address + 2) != i) | ||
298 | goto ERROR0; | ||
299 | if (inb_p(address + 3) != i) | ||
300 | goto ERROR0; | ||
301 | if (inb_p(address + 7) != i) | ||
302 | goto ERROR0; | ||
303 | #undef REALLY_SLOW_IO | ||
304 | |||
305 | /* Let's just hope nothing breaks here */ | ||
306 | i = inb_p(address + 5) & 0x7f; | ||
307 | outb_p(~i & 0x7f,address+5); | ||
308 | if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) { | ||
309 | outb_p(i,address+5); | ||
310 | return 0; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | |||
315 | /* SENSORS ONLY END */ | ||
316 | |||
317 | /* OK. For now, we presume we have a valid client. We now create the | 343 | /* OK. For now, we presume we have a valid client. We now create the |
318 | client structure, even though we cannot fill it completely yet. | 344 | client structure, even though we cannot fill it completely yet. |
319 | But it allows us to access several i2c functions safely */ | 345 | But it allows us to access several i2c functions safely */ |
@@ -323,13 +349,12 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
323 | goto ERROR0; | 349 | goto ERROR0; |
324 | } | 350 | } |
325 | 351 | ||
326 | new_client = &data->client; | 352 | client = &data->client; |
327 | i2c_set_clientdata(new_client, data); | 353 | i2c_set_clientdata(client, data); |
328 | 354 | ||
329 | new_client->addr = address; | 355 | client->addr = address; |
330 | new_client->adapter = adapter; | 356 | client->adapter = adapter; |
331 | new_client->driver = &foo_driver; | 357 | client->driver = &foo_driver; |
332 | new_client->flags = 0; | ||
333 | 358 | ||
334 | /* Now, we do the remaining detection. If no `force' parameter is used. */ | 359 | /* Now, we do the remaining detection. If no `force' parameter is used. */ |
335 | 360 | ||
@@ -337,19 +362,17 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
337 | parameter was used. */ | 362 | parameter was used. */ |
338 | if (kind < 0) { | 363 | if (kind < 0) { |
339 | /* The below is of course bogus */ | 364 | /* The below is of course bogus */ |
340 | if (foo_read(new_client,FOO_REG_GENERIC) != FOO_GENERIC_VALUE) | 365 | if (foo_read(client, FOO_REG_GENERIC) != FOO_GENERIC_VALUE) |
341 | goto ERROR1; | 366 | goto ERROR1; |
342 | } | 367 | } |
343 | 368 | ||
344 | /* SENSORS ONLY START */ | ||
345 | |||
346 | /* Next, specific detection. This is especially important for `sensors' | 369 | /* Next, specific detection. This is especially important for `sensors' |
347 | devices. */ | 370 | devices. */ |
348 | 371 | ||
349 | /* Determine the chip type. Not needed if a `force_CHIPTYPE' parameter | 372 | /* Determine the chip type. Not needed if a `force_CHIPTYPE' parameter |
350 | was used. */ | 373 | was used. */ |
351 | if (kind <= 0) { | 374 | if (kind <= 0) { |
352 | i = foo_read(new_client,FOO_REG_CHIPTYPE); | 375 | i = foo_read(client, FOO_REG_CHIPTYPE); |
353 | if (i == FOO_TYPE_1) | 376 | if (i == FOO_TYPE_1) |
354 | kind = chip1; /* As defined in the enum */ | 377 | kind = chip1; /* As defined in the enum */ |
355 | else if (i == FOO_TYPE_2) | 378 | else if (i == FOO_TYPE_2) |
@@ -363,63 +386,31 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
363 | 386 | ||
364 | /* Now set the type and chip names */ | 387 | /* Now set the type and chip names */ |
365 | if (kind == chip1) { | 388 | if (kind == chip1) { |
366 | type_name = "chip1"; /* For /proc entry */ | 389 | name = "chip1"; |
367 | client_name = "CHIP 1"; | ||
368 | } else if (kind == chip2) { | 390 | } else if (kind == chip2) { |
369 | type_name = "chip2"; /* For /proc entry */ | 391 | name = "chip2"; |
370 | client_name = "CHIP 2"; | ||
371 | } | 392 | } |
372 | 393 | ||
373 | /* Reserve the ISA region */ | ||
374 | if (is_isa) | ||
375 | request_region(address,FOO_EXTENT,type_name); | ||
376 | |||
377 | /* SENSORS ONLY END */ | ||
378 | |||
379 | /* Fill in the remaining client fields. */ | 394 | /* Fill in the remaining client fields. */ |
380 | strcpy(new_client->name,client_name); | 395 | strlcpy(client->name, name, I2C_NAME_SIZE); |
381 | |||
382 | /* SENSORS ONLY BEGIN */ | ||
383 | data->type = kind; | 396 | data->type = kind; |
384 | /* SENSORS ONLY END */ | 397 | mutex_init(&data->update_lock); /* Only if you use this field */ |
385 | |||
386 | data->valid = 0; /* Only if you use this field */ | ||
387 | init_MUTEX(&data->update_lock); /* Only if you use this field */ | ||
388 | 398 | ||
389 | /* Any other initializations in data must be done here too. */ | 399 | /* Any other initializations in data must be done here too. */ |
390 | 400 | ||
391 | /* Tell the i2c layer a new client has arrived */ | ||
392 | if ((err = i2c_attach_client(new_client))) | ||
393 | goto ERROR3; | ||
394 | |||
395 | /* SENSORS ONLY BEGIN */ | ||
396 | /* Register a new directory entry with module sensors. See below for | ||
397 | the `template' structure. */ | ||
398 | if ((i = i2c_register_entry(new_client, type_name, | ||
399 | foo_dir_table_template,THIS_MODULE)) < 0) { | ||
400 | err = i; | ||
401 | goto ERROR4; | ||
402 | } | ||
403 | data->sysctl_id = i; | ||
404 | |||
405 | /* SENSORS ONLY END */ | ||
406 | |||
407 | /* This function can write default values to the client registers, if | 401 | /* This function can write default values to the client registers, if |
408 | needed. */ | 402 | needed. */ |
409 | foo_init_client(new_client); | 403 | foo_init_client(client); |
404 | |||
405 | /* Tell the i2c layer a new client has arrived */ | ||
406 | if ((err = i2c_attach_client(client))) | ||
407 | goto ERROR1; | ||
408 | |||
410 | return 0; | 409 | return 0; |
411 | 410 | ||
412 | /* OK, this is not exactly good programming practice, usually. But it is | 411 | /* OK, this is not exactly good programming practice, usually. But it is |
413 | very code-efficient in this case. */ | 412 | very code-efficient in this case. */ |
414 | 413 | ||
415 | ERROR4: | ||
416 | i2c_detach_client(new_client); | ||
417 | ERROR3: | ||
418 | ERROR2: | ||
419 | /* SENSORS ONLY START */ | ||
420 | if (is_isa) | ||
421 | release_region(address,FOO_EXTENT); | ||
422 | /* SENSORS ONLY END */ | ||
423 | ERROR1: | 414 | ERROR1: |
424 | kfree(data); | 415 | kfree(data); |
425 | ERROR0: | 416 | ERROR0: |
@@ -427,8 +418,8 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
427 | } | 418 | } |
428 | 419 | ||
429 | 420 | ||
430 | Removing the client | 421 | Removing the client (Legacy model) |
431 | =================== | 422 | ================================== |
432 | 423 | ||
433 | The detach_client call back function is called when a client should be | 424 | The detach_client call back function is called when a client should be |
434 | removed. It may actually fail, but only when panicking. This code is | 425 | removed. It may actually fail, but only when panicking. This code is |
@@ -436,22 +427,12 @@ much simpler than the attachment code, fortunately! | |||
436 | 427 | ||
437 | int foo_detach_client(struct i2c_client *client) | 428 | int foo_detach_client(struct i2c_client *client) |
438 | { | 429 | { |
439 | int err,i; | 430 | int err; |
440 | |||
441 | /* SENSORS ONLY START */ | ||
442 | /* Deregister with the `i2c-proc' module. */ | ||
443 | i2c_deregister_entry(((struct lm78_data *)(client->data))->sysctl_id); | ||
444 | /* SENSORS ONLY END */ | ||
445 | 431 | ||
446 | /* Try to detach the client from i2c space */ | 432 | /* Try to detach the client from i2c space */ |
447 | if ((err = i2c_detach_client(client))) | 433 | if ((err = i2c_detach_client(client))) |
448 | return err; | 434 | return err; |
449 | 435 | ||
450 | /* HYBRID SENSORS CHIP ONLY START */ | ||
451 | if i2c_is_isa_client(client) | ||
452 | release_region(client->addr,LM78_EXTENT); | ||
453 | /* HYBRID SENSORS CHIP ONLY END */ | ||
454 | |||
455 | kfree(i2c_get_clientdata(client)); | 436 | kfree(i2c_get_clientdata(client)); |
456 | return 0; | 437 | return 0; |
457 | } | 438 | } |
@@ -464,45 +445,34 @@ When the kernel is booted, or when your foo driver module is inserted, | |||
464 | you have to do some initializing. Fortunately, just attaching (registering) | 445 | you have to do some initializing. Fortunately, just attaching (registering) |
465 | the driver module is usually enough. | 446 | the driver module is usually enough. |
466 | 447 | ||
467 | /* Keep track of how far we got in the initialization process. If several | ||
468 | things have to initialized, and we fail halfway, only those things | ||
469 | have to be cleaned up! */ | ||
470 | static int __initdata foo_initialized = 0; | ||
471 | |||
472 | static int __init foo_init(void) | 448 | static int __init foo_init(void) |
473 | { | 449 | { |
474 | int res; | 450 | int res; |
475 | printk("foo version %s (%s)\n",FOO_VERSION,FOO_DATE); | ||
476 | 451 | ||
477 | if ((res = i2c_add_driver(&foo_driver))) { | 452 | if ((res = i2c_add_driver(&foo_driver))) { |
478 | printk("foo: Driver registration failed, module not inserted.\n"); | 453 | printk("foo: Driver registration failed, module not inserted.\n"); |
479 | foo_cleanup(); | ||
480 | return res; | 454 | return res; |
481 | } | 455 | } |
482 | foo_initialized ++; | ||
483 | return 0; | 456 | return 0; |
484 | } | 457 | } |
485 | 458 | ||
486 | void foo_cleanup(void) | 459 | static void __exit foo_cleanup(void) |
487 | { | 460 | { |
488 | if (foo_initialized == 1) { | 461 | i2c_del_driver(&foo_driver); |
489 | if ((res = i2c_del_driver(&foo_driver))) { | ||
490 | printk("foo: Driver registration failed, module not removed.\n"); | ||
491 | return; | ||
492 | } | ||
493 | foo_initialized --; | ||
494 | } | ||
495 | } | 462 | } |
496 | 463 | ||
497 | /* Substitute your own name and email address */ | 464 | /* Substitute your own name and email address */ |
498 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | 465 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" |
499 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | 466 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); |
500 | 467 | ||
468 | /* a few non-GPL license types are also allowed */ | ||
469 | MODULE_LICENSE("GPL"); | ||
470 | |||
501 | module_init(foo_init); | 471 | module_init(foo_init); |
502 | module_exit(foo_cleanup); | 472 | module_exit(foo_cleanup); |
503 | 473 | ||
504 | Note that some functions are marked by `__init', and some data structures | 474 | Note that some functions are marked by `__init', and some data structures |
505 | by `__init_data'. Hose functions and structures can be removed after | 475 | by `__initdata'. These functions and structures can be removed after |
506 | kernel booting (or module loading) is completed. | 476 | kernel booting (or module loading) is completed. |
507 | 477 | ||
508 | 478 | ||
@@ -632,110 +602,7 @@ General purpose routines | |||
632 | Below all general purpose routines are listed, that were not mentioned | 602 | Below all general purpose routines are listed, that were not mentioned |
633 | before. | 603 | before. |
634 | 604 | ||
635 | /* This call returns a unique low identifier for each registered adapter, | 605 | /* This call returns a unique low identifier for each registered adapter. |
636 | * or -1 if the adapter was not registered. | ||
637 | */ | 606 | */ |
638 | extern int i2c_adapter_id(struct i2c_adapter *adap); | 607 | extern int i2c_adapter_id(struct i2c_adapter *adap); |
639 | 608 | ||
640 | |||
641 | The sensors sysctl/proc interface | ||
642 | ================================= | ||
643 | |||
644 | This section only applies if you write `sensors' drivers. | ||
645 | |||
646 | Each sensors driver creates a directory in /proc/sys/dev/sensors for each | ||
647 | registered client. The directory is called something like foo-i2c-4-65. | ||
648 | The sensors module helps you to do this as easily as possible. | ||
649 | |||
650 | The template | ||
651 | ------------ | ||
652 | |||
653 | You will need to define a ctl_table template. This template will automatically | ||
654 | be copied to a newly allocated structure and filled in where necessary when | ||
655 | you call sensors_register_entry. | ||
656 | |||
657 | First, I will give an example definition. | ||
658 | static ctl_table foo_dir_table_template[] = { | ||
659 | { FOO_SYSCTL_FUNC1, "func1", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
660 | &i2c_sysctl_real,NULL,&foo_func }, | ||
661 | { FOO_SYSCTL_FUNC2, "func2", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
662 | &i2c_sysctl_real,NULL,&foo_func }, | ||
663 | { FOO_SYSCTL_DATA, "data", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
664 | &i2c_sysctl_real,NULL,&foo_data }, | ||
665 | { 0 } | ||
666 | }; | ||
667 | |||
668 | In the above example, three entries are defined. They can either be | ||
669 | accessed through the /proc interface, in the /proc/sys/dev/sensors/* | ||
670 | directories, as files named func1, func2 and data, or alternatively | ||
671 | through the sysctl interface, in the appropriate table, with identifiers | ||
672 | FOO_SYSCTL_FUNC1, FOO_SYSCTL_FUNC2 and FOO_SYSCTL_DATA. | ||
673 | |||
674 | The third, sixth and ninth parameters should always be NULL, and the | ||
675 | fourth should always be 0. The fifth is the mode of the /proc file; | ||
676 | 0644 is safe, as the file will be owned by root:root. | ||
677 | |||
678 | The seventh and eighth parameters should be &i2c_proc_real and | ||
679 | &i2c_sysctl_real if you want to export lists of reals (scaled | ||
680 | integers). You can also use your own function for them, as usual. | ||
681 | Finally, the last parameter is the call-back to gather the data | ||
682 | (see below) if you use the *_proc_real functions. | ||
683 | |||
684 | |||
685 | Gathering the data | ||
686 | ------------------ | ||
687 | |||
688 | The call back functions (foo_func and foo_data in the above example) | ||
689 | can be called in several ways; the operation parameter determines | ||
690 | what should be done: | ||
691 | |||
692 | * If operation == SENSORS_PROC_REAL_INFO, you must return the | ||
693 | magnitude (scaling) in nrels_mag; | ||
694 | * If operation == SENSORS_PROC_REAL_READ, you must read information | ||
695 | from the chip and return it in results. The number of integers | ||
696 | to display should be put in nrels_mag; | ||
697 | * If operation == SENSORS_PROC_REAL_WRITE, you must write the | ||
698 | supplied information to the chip. nrels_mag will contain the number | ||
699 | of integers, results the integers themselves. | ||
700 | |||
701 | The *_proc_real functions will display the elements as reals for the | ||
702 | /proc interface. If you set the magnitude to 2, and supply 345 for | ||
703 | SENSORS_PROC_REAL_READ, it would display 3.45; and if the user would | ||
704 | write 45.6 to the /proc file, it would be returned as 4560 for | ||
705 | SENSORS_PROC_REAL_WRITE. A magnitude may even be negative! | ||
706 | |||
707 | An example function: | ||
708 | |||
709 | /* FOO_FROM_REG and FOO_TO_REG translate between scaled values and | ||
710 | register values. Note the use of the read cache. */ | ||
711 | void foo_in(struct i2c_client *client, int operation, int ctl_name, | ||
712 | int *nrels_mag, long *results) | ||
713 | { | ||
714 | struct foo_data *data = client->data; | ||
715 | int nr = ctl_name - FOO_SYSCTL_FUNC1; /* reduce to 0 upwards */ | ||
716 | |||
717 | if (operation == SENSORS_PROC_REAL_INFO) | ||
718 | *nrels_mag = 2; | ||
719 | else if (operation == SENSORS_PROC_REAL_READ) { | ||
720 | /* Update the readings cache (if necessary) */ | ||
721 | foo_update_client(client); | ||
722 | /* Get the readings from the cache */ | ||
723 | results[0] = FOO_FROM_REG(data->foo_func_base[nr]); | ||
724 | results[1] = FOO_FROM_REG(data->foo_func_more[nr]); | ||
725 | results[2] = FOO_FROM_REG(data->foo_func_readonly[nr]); | ||
726 | *nrels_mag = 2; | ||
727 | } else if (operation == SENSORS_PROC_REAL_WRITE) { | ||
728 | if (*nrels_mag >= 1) { | ||
729 | /* Update the cache */ | ||
730 | data->foo_base[nr] = FOO_TO_REG(results[0]); | ||
731 | /* Update the chip */ | ||
732 | foo_write_value(client,FOO_REG_FUNC_BASE(nr),data->foo_base[nr]); | ||
733 | } | ||
734 | if (*nrels_mag >= 2) { | ||
735 | /* Update the cache */ | ||
736 | data->foo_more[nr] = FOO_TO_REG(results[1]); | ||
737 | /* Update the chip */ | ||
738 | foo_write_value(client,FOO_REG_FUNC_MORE(nr),data->foo_more[nr]); | ||
739 | } | ||
740 | } | ||
741 | } | ||
diff --git a/Documentation/i2o/README b/Documentation/i2o/README index 9aa6ddb446eb..0ebf58c73f54 100644 --- a/Documentation/i2o/README +++ b/Documentation/i2o/README | |||
@@ -30,13 +30,13 @@ Juha Sievanen, University of Helsinki Finland | |||
30 | Bug fixes | 30 | Bug fixes |
31 | Core code extensions | 31 | Core code extensions |
32 | 32 | ||
33 | Auvo Häkkinen, University of Helsinki Finland | 33 | Auvo Häkkinen, University of Helsinki Finland |
34 | LAN OSM code | 34 | LAN OSM code |
35 | /Proc interface to LAN class | 35 | /Proc interface to LAN class |
36 | Bug fixes | 36 | Bug fixes |
37 | Core code extensions | 37 | Core code extensions |
38 | 38 | ||
39 | Taneli Vähäkangas, University of Helsinki Finland | 39 | Taneli Vähäkangas, University of Helsinki Finland |
40 | Fixes to i2o_config | 40 | Fixes to i2o_config |
41 | 41 | ||
42 | CREDITS | 42 | CREDITS |
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 38fe1f03fb14..d01b7a2a0f2e 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 2007-01-26 | 5 | Last update 2007-05-07 |
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 |
@@ -11,7 +11,7 @@ bootable image, the complicated PC memory model and due to changed | |||
11 | expectations in the PC industry caused by the effective demise of | 11 | expectations in the PC industry caused by the effective demise of |
12 | real-mode DOS as a mainstream operating system. | 12 | real-mode DOS as a mainstream operating system. |
13 | 13 | ||
14 | Currently, four versions of the Linux/i386 boot protocol exist. | 14 | Currently, the following versions of the Linux/i386 boot protocol exist. |
15 | 15 | ||
16 | Old kernels: zImage/Image support only. Some very early kernels | 16 | Old kernels: zImage/Image support only. Some very early kernels |
17 | may not even support a command line. | 17 | may not even support a command line. |
@@ -35,9 +35,13 @@ 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. | 37 | Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes. |
38 | |||
38 | Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. | 39 | Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. |
39 | Introduce relocatable_kernel and kernel_alignment fields. | 40 | Introduce relocatable_kernel and kernel_alignment fields. |
40 | 41 | ||
42 | Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of | ||
43 | the boot command line | ||
44 | |||
41 | 45 | ||
42 | **** MEMORY LAYOUT | 46 | **** MEMORY LAYOUT |
43 | 47 | ||
@@ -133,6 +137,8 @@ Offset Proto Name Meaning | |||
133 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address | 137 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address |
134 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel | 138 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel |
135 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not | 139 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not |
140 | 0235/3 N/A pad2 Unused | ||
141 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line | ||
136 | 142 | ||
137 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 143 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
138 | real value is 4. | 144 | real value is 4. |
@@ -177,9 +183,9 @@ filled out, however: | |||
177 | a version number. Otherwise, enter 0xFF here. | 183 | a version number. Otherwise, enter 0xFF here. |
178 | 184 | ||
179 | Assigned boot loader ids: | 185 | Assigned boot loader ids: |
180 | 0 LILO | 186 | 0 LILO (0x00 reserved for pre-2.00 bootloader) |
181 | 1 Loadlin | 187 | 1 Loadlin |
182 | 2 bootsect-loader | 188 | 2 bootsect-loader (0x20, all other values reserved) |
183 | 3 SYSLINUX | 189 | 3 SYSLINUX |
184 | 4 EtherBoot | 190 | 4 EtherBoot |
185 | 5 ELILO | 191 | 5 ELILO |
@@ -204,6 +210,9 @@ filled out, however: | |||
204 | additional data (such as the kernel command line) moved in | 210 | additional data (such as the kernel command line) moved in |
205 | addition to the real-mode kernel itself. | 211 | addition to the real-mode kernel itself. |
206 | 212 | ||
213 | The unit is bytes starting with the beginning of the boot | ||
214 | sector. | ||
215 | |||
207 | ramdisk_image, ramdisk_size: | 216 | ramdisk_image, ramdisk_size: |
208 | If your boot loader has loaded an initial ramdisk (initrd), | 217 | If your boot loader has loaded an initial ramdisk (initrd), |
209 | set ramdisk_image to the 32-bit pointer to the ramdisk data | 218 | set ramdisk_image to the 32-bit pointer to the ramdisk data |
@@ -233,6 +242,12 @@ filled out, however: | |||
233 | if your ramdisk is exactly 131072 bytes long and this field is | 242 | if your ramdisk is exactly 131072 bytes long and this field is |
234 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) | 243 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) |
235 | 244 | ||
245 | cmdline_size: | ||
246 | The maximum size of the command line without the terminating | ||
247 | zero. This means that the command line can contain at most | ||
248 | cmdline_size characters. With protocol version 2.05 and | ||
249 | earlier, the maximum size was 255. | ||
250 | |||
236 | 251 | ||
237 | **** THE KERNEL COMMAND LINE | 252 | **** THE KERNEL COMMAND LINE |
238 | 253 | ||
@@ -241,11 +256,10 @@ loader to communicate with the kernel. Some of its options are also | |||
241 | relevant to the boot loader itself, see "special command line options" | 256 | relevant to the boot loader itself, see "special command line options" |
242 | below. | 257 | below. |
243 | 258 | ||
244 | The kernel command line is a null-terminated string currently up to | 259 | The kernel command line is a null-terminated string. The maximum |
245 | 255 characters long, plus the final null. A string that is too long | 260 | length can be retrieved from the field cmdline_size. Before protocol |
246 | will be automatically truncated by the kernel, a boot loader may allow | 261 | version 2.06, the maximum was 255 characters. A string that is too |
247 | a longer command line to be passed to permit future kernels to extend | 262 | long will be automatically truncated by the kernel. |
248 | this limit. | ||
249 | 263 | ||
250 | If the boot protocol version is 2.02 or later, the address of the | 264 | If the boot protocol version is 2.02 or later, the address of the |
251 | kernel command line is given by the header field cmd_line_ptr (see | 265 | kernel command line is given by the header field cmd_line_ptr (see |
@@ -267,14 +281,54 @@ command line is entered using the following protocol: | |||
267 | field. | 281 | field. |
268 | 282 | ||
269 | 283 | ||
284 | **** MEMORY LAYOUT OF THE REAL-MODE CODE | ||
285 | |||
286 | The real-mode code requires a stack/heap to be set up, as well as | ||
287 | memory allocated for the kernel command line. This needs to be done | ||
288 | in the real-mode accessible memory in bottom megabyte. | ||
289 | |||
290 | It should be noted that modern machines often have a sizable Extended | ||
291 | BIOS Data Area (EBDA). As a result, it is advisable to use as little | ||
292 | of the low megabyte as possible. | ||
293 | |||
294 | Unfortunately, under the following circumstances the 0x90000 memory | ||
295 | segment has to be used: | ||
296 | |||
297 | - When loading a zImage kernel ((loadflags & 0x01) == 0). | ||
298 | - When loading a 2.01 or earlier boot protocol kernel. | ||
299 | |||
300 | -> For the 2.00 and 2.01 boot protocols, the real-mode code | ||
301 | can be loaded at another address, but it is internally | ||
302 | relocated to 0x90000. For the "old" protocol, the | ||
303 | real-mode code must be loaded at 0x90000. | ||
304 | |||
305 | When loading at 0x90000, avoid using memory above 0x9a000. | ||
306 | |||
307 | For boot protocol 2.02 or higher, the command line does not have to be | ||
308 | located in the same 64K segment as the real-mode setup code; it is | ||
309 | thus permitted to give the stack/heap the full 64K segment and locate | ||
310 | the command line above it. | ||
311 | |||
312 | The kernel command line should not be located below the real-mode | ||
313 | code, nor should it be located in high memory. | ||
314 | |||
315 | |||
270 | **** SAMPLE BOOT CONFIGURATION | 316 | **** SAMPLE BOOT CONFIGURATION |
271 | 317 | ||
272 | As a sample configuration, assume the following layout of the real | 318 | As a sample configuration, assume the following layout of the real |
273 | mode segment (this is a typical, and recommended layout): | 319 | mode segment: |
320 | |||
321 | When loading below 0x90000, use the entire segment: | ||
274 | 322 | ||
275 | 0x0000-0x7FFF Real mode kernel | 323 | 0x0000-0x7fff Real mode kernel |
276 | 0x8000-0x8FFF Stack and heap | 324 | 0x8000-0xdfff Stack and heap |
277 | 0x9000-0x90FF Kernel command line | 325 | 0xe000-0xffff Kernel command line |
326 | |||
327 | When loading at 0x90000 OR the protocol version is 2.01 or earlier: | ||
328 | |||
329 | 0x0000-0x7fff Real mode kernel | ||
330 | 0x8000-0x97ff Stack and heap | ||
331 | 0x9800-0x9fff Kernel command line | ||
278 | 332 | ||
279 | Such a boot loader should enter the following fields in the header: | 333 | Such a boot loader should enter the following fields in the header: |
280 | 334 | ||
@@ -290,22 +344,33 @@ Such a boot loader should enter the following fields in the header: | |||
290 | ramdisk_image = <initrd_address>; | 344 | ramdisk_image = <initrd_address>; |
291 | ramdisk_size = <initrd_size>; | 345 | ramdisk_size = <initrd_size>; |
292 | } | 346 | } |
347 | |||
348 | if ( protocol >= 0x0202 && loadflags & 0x01 ) | ||
349 | heap_end = 0xe000; | ||
350 | else | ||
351 | heap_end = 0x9800; | ||
352 | |||
293 | if ( protocol >= 0x0201 ) { | 353 | if ( protocol >= 0x0201 ) { |
294 | heap_end_ptr = 0x9000 - 0x200; | 354 | heap_end_ptr = heap_end - 0x200; |
295 | loadflags |= 0x80; /* CAN_USE_HEAP */ | 355 | loadflags |= 0x80; /* CAN_USE_HEAP */ |
296 | } | 356 | } |
357 | |||
297 | if ( protocol >= 0x0202 ) { | 358 | if ( protocol >= 0x0202 ) { |
298 | cmd_line_ptr = base_ptr + 0x9000; | 359 | cmd_line_ptr = base_ptr + heap_end; |
360 | strcpy(cmd_line_ptr, cmdline); | ||
299 | } else { | 361 | } else { |
300 | cmd_line_magic = 0xA33F; | 362 | cmd_line_magic = 0xA33F; |
301 | cmd_line_offset = 0x9000; | 363 | cmd_line_offset = heap_end; |
302 | setup_move_size = 0x9100; | 364 | setup_move_size = heap_end + strlen(cmdline)+1; |
365 | strcpy(base_ptr+cmd_line_offset, cmdline); | ||
303 | } | 366 | } |
304 | } else { | 367 | } else { |
305 | /* Very old kernel */ | 368 | /* Very old kernel */ |
306 | 369 | ||
370 | heap_end = 0x9800; | ||
371 | |||
307 | cmd_line_magic = 0xA33F; | 372 | cmd_line_magic = 0xA33F; |
308 | cmd_line_offset = 0x9000; | 373 | cmd_line_offset = heap_end; |
309 | 374 | ||
310 | /* A very old kernel MUST have its real-mode code | 375 | /* A very old kernel MUST have its real-mode code |
311 | loaded at 0x90000 */ | 376 | loaded at 0x90000 */ |
@@ -313,12 +378,11 @@ Such a boot loader should enter the following fields in the header: | |||
313 | if ( base_ptr != 0x90000 ) { | 378 | if ( base_ptr != 0x90000 ) { |
314 | /* Copy the real-mode kernel */ | 379 | /* Copy the real-mode kernel */ |
315 | memcpy(0x90000, base_ptr, (setup_sects+1)*512); | 380 | memcpy(0x90000, base_ptr, (setup_sects+1)*512); |
316 | /* Copy the command line */ | ||
317 | memcpy(0x99000, base_ptr+0x9000, 256); | ||
318 | |||
319 | base_ptr = 0x90000; /* Relocated */ | 381 | base_ptr = 0x90000; /* Relocated */ |
320 | } | 382 | } |
321 | 383 | ||
384 | strcpy(0x90000+cmd_line_offset, cmdline); | ||
385 | |||
322 | /* It is recommended to clear memory up to the 32K mark */ | 386 | /* It is recommended to clear memory up to the 32K mark */ |
323 | memset(0x90000 + (setup_sects+1)*512, 0, | 387 | memset(0x90000 + (setup_sects+1)*512, 0, |
324 | (64-(setup_sects+1))*512); | 388 | (64-(setup_sects+1))*512); |
@@ -364,10 +428,11 @@ conflict with actual kernel options now or in the future. | |||
364 | line is parsed. | 428 | line is parsed. |
365 | 429 | ||
366 | mem=<size> | 430 | mem=<size> |
367 | <size> is an integer in C notation optionally followed by K, M | 431 | <size> is an integer in C notation optionally followed by |
368 | or G (meaning << 10, << 20 or << 30). This specifies the end | 432 | (case insensitive) K, M, G, T, P or E (meaning << 10, << 20, |
369 | of memory to the kernel. This affects the possible placement | 433 | << 30, << 40, << 50 or << 60). This specifies the end of |
370 | of an initrd, since an initrd should be placed near end of | 434 | memory to the kernel. This affects the possible placement of |
435 | an initrd, since an initrd should be placed near end of | ||
371 | memory. Note that this is an option to *both* the kernel and | 436 | memory. Note that this is an option to *both* the kernel and |
372 | the bootloader! | 437 | the bootloader! |
373 | 438 | ||
@@ -417,7 +482,7 @@ In our example from above, we would do: | |||
417 | 482 | ||
418 | /* Set up the real-mode kernel stack */ | 483 | /* Set up the real-mode kernel stack */ |
419 | _SS = seg; | 484 | _SS = seg; |
420 | _SP = 0x9000; /* Load SP immediately after loading SS! */ | 485 | _SP = heap_end; |
421 | 486 | ||
422 | _DS = _ES = _FS = _GS = seg; | 487 | _DS = _ES = _FS = _GS = seg; |
423 | jmp_far(seg+0x20, 0); /* Run the kernel */ | 488 | jmp_far(seg+0x20, 0); /* Run the kernel */ |
@@ -449,8 +514,9 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and | |||
449 | code32_start: | 514 | code32_start: |
450 | A 32-bit flat-mode routine *jumped* to immediately after the | 515 | A 32-bit flat-mode routine *jumped* to immediately after the |
451 | transition to protected mode, but before the kernel is | 516 | transition to protected mode, but before the kernel is |
452 | uncompressed. No segments, except CS, are set up; you should | 517 | uncompressed. No segments, except CS, are guaranteed to be |
453 | set them up to KERNEL_DS (0x18) yourself. | 518 | set up (current kernels do, but older ones do not); you should |
519 | set them up to BOOT_DS (0x18) yourself. | ||
454 | 520 | ||
455 | After completing your hook, you should jump to the address | 521 | After completing your hook, you should jump to the address |
456 | that was in this field before your boot loader overwrote it. | 522 | that was in this field before your boot loader overwrote it. |
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c new file mode 100644 index 000000000000..3153167b41c3 --- /dev/null +++ b/Documentation/ia64/aliasing-test.c | |||
@@ -0,0 +1,247 @@ | |||
1 | /* | ||
2 | * Exercise /dev/mem mmap cases that have been troublesome in the past | ||
3 | * | ||
4 | * (c) Copyright 2007 Hewlett-Packard Development Company, L.P. | ||
5 | * Bjorn Helgaas <bjorn.helgaas@hp.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <stdlib.h> | ||
13 | #include <stdio.h> | ||
14 | #include <sys/types.h> | ||
15 | #include <dirent.h> | ||
16 | #include <fcntl.h> | ||
17 | #include <fnmatch.h> | ||
18 | #include <string.h> | ||
19 | #include <sys/mman.h> | ||
20 | #include <sys/stat.h> | ||
21 | #include <unistd.h> | ||
22 | |||
23 | int sum; | ||
24 | |||
25 | int map_mem(char *path, off_t offset, size_t length, int touch) | ||
26 | { | ||
27 | int fd, rc; | ||
28 | void *addr; | ||
29 | int *c; | ||
30 | |||
31 | fd = open(path, O_RDWR); | ||
32 | if (fd == -1) { | ||
33 | perror(path); | ||
34 | return -1; | ||
35 | } | ||
36 | |||
37 | addr = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); | ||
38 | if (addr == MAP_FAILED) | ||
39 | return 1; | ||
40 | |||
41 | if (touch) { | ||
42 | c = (int *) addr; | ||
43 | while (c < (int *) (offset + length)) | ||
44 | sum += *c++; | ||
45 | } | ||
46 | |||
47 | rc = munmap(addr, length); | ||
48 | if (rc == -1) { | ||
49 | perror("munmap"); | ||
50 | return -1; | ||
51 | } | ||
52 | |||
53 | close(fd); | ||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | int scan_sysfs(char *path, char *file, off_t offset, size_t length, int touch) | ||
58 | { | ||
59 | struct dirent **namelist; | ||
60 | char *name, *path2; | ||
61 | int i, n, r, rc, result = 0; | ||
62 | struct stat buf; | ||
63 | |||
64 | n = scandir(path, &namelist, 0, alphasort); | ||
65 | if (n < 0) { | ||
66 | perror("scandir"); | ||
67 | return -1; | ||
68 | } | ||
69 | |||
70 | for (i = 0; i < n; i++) { | ||
71 | name = namelist[i]->d_name; | ||
72 | |||
73 | if (fnmatch(".", name, 0) == 0) | ||
74 | goto skip; | ||
75 | if (fnmatch("..", name, 0) == 0) | ||
76 | goto skip; | ||
77 | |||
78 | path2 = malloc(strlen(path) + strlen(name) + 3); | ||
79 | strcpy(path2, path); | ||
80 | strcat(path2, "/"); | ||
81 | strcat(path2, name); | ||
82 | |||
83 | if (fnmatch(file, name, 0) == 0) { | ||
84 | rc = map_mem(path2, offset, length, touch); | ||
85 | if (rc == 0) | ||
86 | fprintf(stderr, "PASS: %s 0x%lx-0x%lx is %s\n", path2, offset, offset + length, touch ? "readable" : "mappable"); | ||
87 | else if (rc > 0) | ||
88 | fprintf(stderr, "PASS: %s 0x%lx-0x%lx not mappable\n", path2, offset, offset + length); | ||
89 | else { | ||
90 | fprintf(stderr, "FAIL: %s 0x%lx-0x%lx not accessible\n", path2, offset, offset + length); | ||
91 | return rc; | ||
92 | } | ||
93 | } else { | ||
94 | r = lstat(path2, &buf); | ||
95 | if (r == 0 && S_ISDIR(buf.st_mode)) { | ||
96 | rc = scan_sysfs(path2, file, offset, length, touch); | ||
97 | if (rc < 0) | ||
98 | return rc; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | result |= rc; | ||
103 | free(path2); | ||
104 | |||
105 | skip: | ||
106 | free(namelist[i]); | ||
107 | } | ||
108 | free(namelist); | ||
109 | return rc; | ||
110 | } | ||
111 | |||
112 | char buf[1024]; | ||
113 | |||
114 | int read_rom(char *path) | ||
115 | { | ||
116 | int fd, rc; | ||
117 | size_t size = 0; | ||
118 | |||
119 | fd = open(path, O_RDWR); | ||
120 | if (fd == -1) { | ||
121 | perror(path); | ||
122 | return -1; | ||
123 | } | ||
124 | |||
125 | rc = write(fd, "1", 2); | ||
126 | if (rc <= 0) { | ||
127 | perror("write"); | ||
128 | return -1; | ||
129 | } | ||
130 | |||
131 | do { | ||
132 | rc = read(fd, buf, sizeof(buf)); | ||
133 | if (rc > 0) | ||
134 | size += rc; | ||
135 | } while (rc > 0); | ||
136 | |||
137 | close(fd); | ||
138 | return size; | ||
139 | } | ||
140 | |||
141 | int scan_rom(char *path, char *file) | ||
142 | { | ||
143 | struct dirent **namelist; | ||
144 | char *name, *path2; | ||
145 | int i, n, r, rc, result = 0; | ||
146 | struct stat buf; | ||
147 | |||
148 | n = scandir(path, &namelist, 0, alphasort); | ||
149 | if (n < 0) { | ||
150 | perror("scandir"); | ||
151 | return -1; | ||
152 | } | ||
153 | |||
154 | for (i = 0; i < n; i++) { | ||
155 | name = namelist[i]->d_name; | ||
156 | |||
157 | if (fnmatch(".", name, 0) == 0) | ||
158 | goto skip; | ||
159 | if (fnmatch("..", name, 0) == 0) | ||
160 | goto skip; | ||
161 | |||
162 | path2 = malloc(strlen(path) + strlen(name) + 3); | ||
163 | strcpy(path2, path); | ||
164 | strcat(path2, "/"); | ||
165 | strcat(path2, name); | ||
166 | |||
167 | if (fnmatch(file, name, 0) == 0) { | ||
168 | rc = read_rom(path2); | ||
169 | |||
170 | /* | ||
171 | * It's OK if the ROM is unreadable. Maybe there | ||
172 | * is no ROM, or some other error ocurred. The | ||
173 | * important thing is that no MCA happened. | ||
174 | */ | ||
175 | if (rc > 0) | ||
176 | fprintf(stderr, "PASS: %s read %ld bytes\n", path2, rc); | ||
177 | else { | ||
178 | fprintf(stderr, "PASS: %s not readable\n", path2); | ||
179 | return rc; | ||
180 | } | ||
181 | } else { | ||
182 | r = lstat(path2, &buf); | ||
183 | if (r == 0 && S_ISDIR(buf.st_mode)) { | ||
184 | rc = scan_rom(path2, file); | ||
185 | if (rc < 0) | ||
186 | return rc; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | result |= rc; | ||
191 | free(path2); | ||
192 | |||
193 | skip: | ||
194 | free(namelist[i]); | ||
195 | } | ||
196 | free(namelist); | ||
197 | return rc; | ||
198 | } | ||
199 | |||
200 | main() | ||
201 | { | ||
202 | int rc; | ||
203 | |||
204 | if (map_mem("/dev/mem", 0, 0xA0000, 1) == 0) | ||
205 | fprintf(stderr, "PASS: /dev/mem 0x0-0xa0000 is readable\n"); | ||
206 | else | ||
207 | fprintf(stderr, "FAIL: /dev/mem 0x0-0xa0000 not accessible\n"); | ||
208 | |||
209 | /* | ||
210 | * It's not safe to blindly read the VGA frame buffer. If you know | ||
211 | * how to poke the card the right way, it should respond, but it's | ||
212 | * not safe in general. Many machines, e.g., Intel chipsets, cover | ||
213 | * up a non-responding card by just returning -1, but others will | ||
214 | * report the failure as a machine check. | ||
215 | */ | ||
216 | if (map_mem("/dev/mem", 0xA0000, 0x20000, 0) == 0) | ||
217 | fprintf(stderr, "PASS: /dev/mem 0xa0000-0xc0000 is mappable\n"); | ||
218 | else | ||
219 | fprintf(stderr, "FAIL: /dev/mem 0xa0000-0xc0000 not accessible\n"); | ||
220 | |||
221 | if (map_mem("/dev/mem", 0xC0000, 0x40000, 1) == 0) | ||
222 | fprintf(stderr, "PASS: /dev/mem 0xc0000-0x100000 is readable\n"); | ||
223 | else | ||
224 | fprintf(stderr, "FAIL: /dev/mem 0xc0000-0x100000 not accessible\n"); | ||
225 | |||
226 | /* | ||
227 | * Often you can map all the individual pieces above (0-0xA0000, | ||
228 | * 0xA0000-0xC0000, and 0xC0000-0x100000), but can't map the whole | ||
229 | * thing at once. This is because the individual pieces use different | ||
230 | * attributes, and there's no single attribute supported over the | ||
231 | * whole region. | ||
232 | */ | ||
233 | rc = map_mem("/dev/mem", 0, 1024*1024, 0); | ||
234 | if (rc == 0) | ||
235 | fprintf(stderr, "PASS: /dev/mem 0x0-0x100000 is mappable\n"); | ||
236 | else if (rc > 0) | ||
237 | fprintf(stderr, "PASS: /dev/mem 0x0-0x100000 not mappable\n"); | ||
238 | else | ||
239 | fprintf(stderr, "FAIL: /dev/mem 0x0-0x100000 not accessible\n"); | ||
240 | |||
241 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0, 0xA0000, 1); | ||
242 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0xA0000, 0x20000, 0); | ||
243 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0xC0000, 0x40000, 1); | ||
244 | scan_sysfs("/sys/class/pci_bus", "legacy_mem", 0, 1024*1024, 0); | ||
245 | |||
246 | scan_rom("/sys/devices", "rom"); | ||
247 | } | ||
diff --git a/Documentation/ia64/aliasing.txt b/Documentation/ia64/aliasing.txt index 38f9a52d1820..9a431a7d0f5d 100644 --- a/Documentation/ia64/aliasing.txt +++ b/Documentation/ia64/aliasing.txt | |||
@@ -112,16 +112,6 @@ POTENTIAL ATTRIBUTE ALIASING CASES | |||
112 | 112 | ||
113 | The /dev/mem mmap constraints apply. | 113 | The /dev/mem mmap constraints apply. |
114 | 114 | ||
115 | However, since this is for mapping legacy MMIO space, WB access | ||
116 | does not make sense. This matters on machines without legacy | ||
117 | VGA support: these machines may have WB memory for the entire | ||
118 | first megabyte (or even the entire first granule). | ||
119 | |||
120 | On these machines, we could mmap legacy_mem as WB, which would | ||
121 | be safe in terms of attribute aliasing, but X has no way of | ||
122 | knowing that it is accessing regular memory, not a frame buffer, | ||
123 | so the kernel should fail the mmap rather than doing it with WB. | ||
124 | |||
125 | read/write of /dev/mem | 115 | read/write of /dev/mem |
126 | 116 | ||
127 | This uses copy_from_user(), which implicitly uses a kernel | 117 | This uses copy_from_user(), which implicitly uses a kernel |
@@ -138,14 +128,20 @@ POTENTIAL ATTRIBUTE ALIASING CASES | |||
138 | 128 | ||
139 | ioremap() | 129 | ioremap() |
140 | 130 | ||
141 | This returns a kernel identity mapping for use inside the | 131 | This returns a mapping for use inside the kernel. |
142 | kernel. | ||
143 | 132 | ||
144 | If the region is in kern_memmap, we should use the attribute | 133 | If the region is in kern_memmap, we should use the attribute |
145 | specified there. Otherwise, if the EFI memory map reports that | 134 | specified there. |
146 | the entire granule supports WB, we should use that (granules | 135 | |
147 | that are partially reserved or occupied by firmware do not appear | 136 | If the EFI memory map reports that the entire granule supports |
148 | in kern_memmap). Otherwise, we should use a UC mapping. | 137 | WB, we should use that (granules that are partially reserved |
138 | or occupied by firmware do not appear in kern_memmap). | ||
139 | |||
140 | If the granule contains non-WB memory, but we can cover the | ||
141 | region safely with kernel page table mappings, we can use | ||
142 | ioremap_page_range() as most other architectures do. | ||
143 | |||
144 | Failing all of the above, we have to fall back to a UC mapping. | ||
149 | 145 | ||
150 | PAST PROBLEM CASES | 146 | PAST PROBLEM CASES |
151 | 147 | ||
@@ -158,7 +154,7 @@ PAST PROBLEM CASES | |||
158 | succeed. It may create either WB or UC user mappings, depending | 154 | succeed. It may create either WB or UC user mappings, depending |
159 | on whether the region is in kern_memmap or the EFI memory map. | 155 | on whether the region is in kern_memmap or the EFI memory map. |
160 | 156 | ||
161 | mmap of 0x0-0xA0000 /dev/mem by "hwinfo" on HP sx1000 with VGA enabled | 157 | mmap of 0x0-0x9FFFF /dev/mem by "hwinfo" on HP sx1000 with VGA enabled |
162 | 158 | ||
163 | See https://bugzilla.novell.com/show_bug.cgi?id=140858. | 159 | See https://bugzilla.novell.com/show_bug.cgi?id=140858. |
164 | 160 | ||
@@ -171,28 +167,25 @@ PAST PROBLEM CASES | |||
171 | so it is safe to use WB mappings. | 167 | so it is safe to use WB mappings. |
172 | 168 | ||
173 | The kernel VGA driver may ioremap the VGA frame buffer at 0xA0000, | 169 | The kernel VGA driver may ioremap the VGA frame buffer at 0xA0000, |
174 | which will use a granule-sized UC mapping covering 0-0xFFFFF. This | 170 | which uses a granule-sized UC mapping. This granule will cover some |
175 | granule covers some WB-only memory, but since UC is non-speculative, | 171 | WB-only memory, but since UC is non-speculative, the processor will |
176 | the processor will never generate an uncacheable reference to the | 172 | never generate an uncacheable reference to the WB-only areas unless |
177 | WB-only areas unless the driver explicitly touches them. | 173 | the driver explicitly touches them. |
178 | 174 | ||
179 | mmap of 0x0-0xFFFFF legacy_mem by "X" | 175 | mmap of 0x0-0xFFFFF legacy_mem by "X" |
180 | 176 | ||
181 | If the EFI memory map reports this entire range as WB, there | 177 | If the EFI memory map reports that the entire range supports the |
182 | is no VGA MMIO hole, and the mmap should fail or be done with | 178 | same attributes, we can allow the mmap (and we will prefer WB if |
183 | a WB mapping. | 179 | supported, as is the case with HP sx[12]000 machines with VGA |
180 | disabled). | ||
184 | 181 | ||
185 | There's no easy way for X to determine whether the 0xA0000-0xBFFFF | 182 | If EFI reports the range as partly WB and partly UC (as on sx[12]000 |
186 | region is a frame buffer or just memory, so I think it's best to | 183 | machines with VGA enabled), we must fail the mmap because there's no |
187 | just fail this mmap request rather than using a WB mapping. As | 184 | safe attribute to use. |
188 | far as I know, there's no need to map legacy_mem with WB | ||
189 | mappings. | ||
190 | 185 | ||
191 | Otherwise, a UC mapping of the entire region is probably safe. | 186 | If EFI reports some of the range but not all (as on Intel firmware |
192 | The VGA hole means the region will not be in kern_memmap. The | 187 | that doesn't report the VGA frame buffer at all), we should fail the |
193 | HP sx1000 chipset doesn't support UC access to the memory surrounding | 188 | mmap and force the user to map just the specific region of interest. |
194 | the VGA hole, but X doesn't need that area anyway and should not | ||
195 | reference it. | ||
196 | 189 | ||
197 | mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled | 190 | mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled |
198 | 191 | ||
@@ -202,6 +195,16 @@ PAST PROBLEM CASES | |||
202 | This is a special case of the previous case, and the mmap should | 195 | This is a special case of the previous case, and the mmap should |
203 | fail for the same reason as above. | 196 | fail for the same reason as above. |
204 | 197 | ||
198 | read of /sys/devices/.../rom | ||
199 | |||
200 | For VGA devices, this may cause an ioremap() of 0xC0000. This | ||
201 | used to be done with a UC mapping, because the VGA frame buffer | ||
202 | at 0xA0000 prevents use of a WB granule. The UC mapping causes | ||
203 | an MCA on HP sx[12]000 chipsets. | ||
204 | |||
205 | We should use WB page table mappings to avoid covering the VGA | ||
206 | frame buffer. | ||
207 | |||
205 | NOTES | 208 | NOTES |
206 | 209 | ||
207 | [1] SDM rev 2.2, vol 2, sec 4.4.1. | 210 | [1] SDM rev 2.2, vol 2, sec 4.4.1. |
diff --git a/Documentation/ia64/err_inject.txt b/Documentation/ia64/err_inject.txt new file mode 100644 index 000000000000..6449a7090dbb --- /dev/null +++ b/Documentation/ia64/err_inject.txt | |||
@@ -0,0 +1,1068 @@ | |||
1 | |||
2 | IPF Machine Check (MC) error inject tool | ||
3 | ======================================== | ||
4 | |||
5 | IPF Machine Check (MC) error inject tool is used to inject MC | ||
6 | errors from Linux. The tool is a test bed for IPF MC work flow including | ||
7 | hardware correctable error handling, OS recoverable error handling, MC | ||
8 | event logging, etc. | ||
9 | |||
10 | The tool includes two parts: a kernel driver and a user application | ||
11 | sample. The driver provides interface to PAL to inject error | ||
12 | and query error injection capabilities. The driver code is in | ||
13 | arch/ia64/kernel/err_inject.c. The application sample (shown below) | ||
14 | provides a combination of various errors and calls the driver's interface | ||
15 | (sysfs interface) to inject errors or query error injection capabilities. | ||
16 | |||
17 | The tool can be used to test Intel IPF machine MC handling capabilities. | ||
18 | It's especially useful for people who can not access hardware MC injection | ||
19 | tool to inject error. It's also very useful to integrate with other | ||
20 | software test suits to do stressful testing on IPF. | ||
21 | |||
22 | Below is a sample application as part of the whole tool. The sample | ||
23 | can be used as a working test tool. Or it can be expanded to include | ||
24 | more features. It also can be a integrated into a libary or other user | ||
25 | application to have more thorough test. | ||
26 | |||
27 | The sample application takes err.conf as error configuation input. Gcc | ||
28 | compiles the code. After you install err_inject driver, you can run | ||
29 | this sample application to inject errors. | ||
30 | |||
31 | Errata: Itanium 2 Processors Specification Update lists some errata against | ||
32 | the pal_mc_error_inject PAL procedure. The following err.conf has been tested | ||
33 | on latest Montecito PAL. | ||
34 | |||
35 | err.conf: | ||
36 | |||
37 | #This is configuration file for err_inject_tool. | ||
38 | #The format of the each line is: | ||
39 | #cpu, loop, interval, err_type_info, err_struct_info, err_data_buffer | ||
40 | #where | ||
41 | # cpu: logical cpu number the error will be inject in. | ||
42 | # loop: times the error will be injected. | ||
43 | # interval: In second. every so often one error is injected. | ||
44 | # err_type_info, err_struct_info: PAL parameters. | ||
45 | # | ||
46 | #Note: All values are hex w/o or w/ 0x prefix. | ||
47 | |||
48 | |||
49 | #On cpu2, inject only total 0x10 errors, interval 5 seconds | ||
50 | #corrected, data cache, hier-2, physical addr(assigned by tool code). | ||
51 | #working on Montecito latest PAL. | ||
52 | 2, 10, 5, 4101, 95 | ||
53 | |||
54 | #On cpu4, inject and consume total 0x10 errors, interval 5 seconds | ||
55 | #corrected, data cache, hier-2, physical addr(assigned by tool code). | ||
56 | #working on Montecito latest PAL. | ||
57 | 4, 10, 5, 4109, 95 | ||
58 | |||
59 | #On cpu15, inject and consume total 0x10 errors, interval 5 seconds | ||
60 | #recoverable, DTR0, hier-2. | ||
61 | #working on Montecito latest PAL. | ||
62 | 0xf, 0x10, 5, 4249, 15 | ||
63 | |||
64 | The sample application source code: | ||
65 | |||
66 | err_injection_tool.c: | ||
67 | |||
68 | /* | ||
69 | * This program is free software; you can redistribute it and/or modify | ||
70 | * it under the terms of the GNU General Public License as published by | ||
71 | * the Free Software Foundation; either version 2 of the License, or | ||
72 | * (at your option) any later version. | ||
73 | * | ||
74 | * This program is distributed in the hope that it will be useful, but | ||
75 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
76 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
77 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
78 | * details. | ||
79 | * | ||
80 | * You should have received a copy of the GNU General Public License | ||
81 | * along with this program; if not, write to the Free Software | ||
82 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
83 | * | ||
84 | * Copyright (C) 2006 Intel Co | ||
85 | * Fenghua Yu <fenghua.yu@intel.com> | ||
86 | * | ||
87 | */ | ||
88 | #include <sys/types.h> | ||
89 | #include <sys/stat.h> | ||
90 | #include <fcntl.h> | ||
91 | #include <stdio.h> | ||
92 | #include <sched.h> | ||
93 | #include <unistd.h> | ||
94 | #include <stdlib.h> | ||
95 | #include <stdarg.h> | ||
96 | #include <string.h> | ||
97 | #include <errno.h> | ||
98 | #include <time.h> | ||
99 | #include <sys/ipc.h> | ||
100 | #include <sys/sem.h> | ||
101 | #include <sys/wait.h> | ||
102 | #include <sys/mman.h> | ||
103 | #include <sys/shm.h> | ||
104 | |||
105 | #define MAX_FN_SIZE 256 | ||
106 | #define MAX_BUF_SIZE 256 | ||
107 | #define DATA_BUF_SIZE 256 | ||
108 | #define NR_CPUS 512 | ||
109 | #define MAX_TASK_NUM 2048 | ||
110 | #define MIN_INTERVAL 5 // seconds | ||
111 | #define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte. | ||
112 | #define PARA_FIELD_NUM 5 | ||
113 | #define MASK_SIZE (NR_CPUS/64) | ||
114 | #define PATH_FORMAT "/sys/devices/system/cpu/cpu%d/err_inject/" | ||
115 | |||
116 | int sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask); | ||
117 | |||
118 | int verbose; | ||
119 | #define vbprintf if (verbose) printf | ||
120 | |||
121 | int log_info(int cpu, const char *fmt, ...) | ||
122 | { | ||
123 | FILE *log; | ||
124 | char fn[MAX_FN_SIZE]; | ||
125 | char buf[MAX_BUF_SIZE]; | ||
126 | va_list args; | ||
127 | |||
128 | sprintf(fn, "%d.log", cpu); | ||
129 | log=fopen(fn, "a+"); | ||
130 | if (log==NULL) { | ||
131 | perror("Error open:"); | ||
132 | return -1; | ||
133 | } | ||
134 | |||
135 | va_start(args, fmt); | ||
136 | vprintf(fmt, args); | ||
137 | memset(buf, 0, MAX_BUF_SIZE); | ||
138 | vsprintf(buf, fmt, args); | ||
139 | va_end(args); | ||
140 | |||
141 | fwrite(buf, sizeof(buf), 1, log); | ||
142 | fclose(log); | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | typedef unsigned long u64; | ||
148 | typedef unsigned int u32; | ||
149 | |||
150 | typedef union err_type_info_u { | ||
151 | struct { | ||
152 | u64 mode : 3, /* 0-2 */ | ||
153 | err_inj : 3, /* 3-5 */ | ||
154 | err_sev : 2, /* 6-7 */ | ||
155 | err_struct : 5, /* 8-12 */ | ||
156 | struct_hier : 3, /* 13-15 */ | ||
157 | reserved : 48; /* 16-63 */ | ||
158 | } err_type_info_u; | ||
159 | u64 err_type_info; | ||
160 | } err_type_info_t; | ||
161 | |||
162 | typedef union err_struct_info_u { | ||
163 | struct { | ||
164 | u64 siv : 1, /* 0 */ | ||
165 | c_t : 2, /* 1-2 */ | ||
166 | cl_p : 3, /* 3-5 */ | ||
167 | cl_id : 3, /* 6-8 */ | ||
168 | cl_dp : 1, /* 9 */ | ||
169 | reserved1 : 22, /* 10-31 */ | ||
170 | tiv : 1, /* 32 */ | ||
171 | trigger : 4, /* 33-36 */ | ||
172 | trigger_pl : 3, /* 37-39 */ | ||
173 | reserved2 : 24; /* 40-63 */ | ||
174 | } err_struct_info_cache; | ||
175 | struct { | ||
176 | u64 siv : 1, /* 0 */ | ||
177 | tt : 2, /* 1-2 */ | ||
178 | tc_tr : 2, /* 3-4 */ | ||
179 | tr_slot : 8, /* 5-12 */ | ||
180 | reserved1 : 19, /* 13-31 */ | ||
181 | tiv : 1, /* 32 */ | ||
182 | trigger : 4, /* 33-36 */ | ||
183 | trigger_pl : 3, /* 37-39 */ | ||
184 | reserved2 : 24; /* 40-63 */ | ||
185 | } err_struct_info_tlb; | ||
186 | struct { | ||
187 | u64 siv : 1, /* 0 */ | ||
188 | regfile_id : 4, /* 1-4 */ | ||
189 | reg_num : 7, /* 5-11 */ | ||
190 | reserved1 : 20, /* 12-31 */ | ||
191 | tiv : 1, /* 32 */ | ||
192 | trigger : 4, /* 33-36 */ | ||
193 | trigger_pl : 3, /* 37-39 */ | ||
194 | reserved2 : 24; /* 40-63 */ | ||
195 | } err_struct_info_register; | ||
196 | struct { | ||
197 | u64 reserved; | ||
198 | } err_struct_info_bus_processor_interconnect; | ||
199 | u64 err_struct_info; | ||
200 | } err_struct_info_t; | ||
201 | |||
202 | typedef union err_data_buffer_u { | ||
203 | struct { | ||
204 | u64 trigger_addr; /* 0-63 */ | ||
205 | u64 inj_addr; /* 64-127 */ | ||
206 | u64 way : 5, /* 128-132 */ | ||
207 | index : 20, /* 133-152 */ | ||
208 | : 39; /* 153-191 */ | ||
209 | } err_data_buffer_cache; | ||
210 | struct { | ||
211 | u64 trigger_addr; /* 0-63 */ | ||
212 | u64 inj_addr; /* 64-127 */ | ||
213 | u64 way : 5, /* 128-132 */ | ||
214 | index : 20, /* 133-152 */ | ||
215 | reserved : 39; /* 153-191 */ | ||
216 | } err_data_buffer_tlb; | ||
217 | struct { | ||
218 | u64 trigger_addr; /* 0-63 */ | ||
219 | } err_data_buffer_register; | ||
220 | struct { | ||
221 | u64 reserved; /* 0-63 */ | ||
222 | } err_data_buffer_bus_processor_interconnect; | ||
223 | u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; | ||
224 | } err_data_buffer_t; | ||
225 | |||
226 | typedef union capabilities_u { | ||
227 | struct { | ||
228 | u64 i : 1, | ||
229 | d : 1, | ||
230 | rv : 1, | ||
231 | tag : 1, | ||
232 | data : 1, | ||
233 | mesi : 1, | ||
234 | dp : 1, | ||
235 | reserved1 : 3, | ||
236 | pa : 1, | ||
237 | va : 1, | ||
238 | wi : 1, | ||
239 | reserved2 : 20, | ||
240 | trigger : 1, | ||
241 | trigger_pl : 1, | ||
242 | reserved3 : 30; | ||
243 | } capabilities_cache; | ||
244 | struct { | ||
245 | u64 d : 1, | ||
246 | i : 1, | ||
247 | rv : 1, | ||
248 | tc : 1, | ||
249 | tr : 1, | ||
250 | reserved1 : 27, | ||
251 | trigger : 1, | ||
252 | trigger_pl : 1, | ||
253 | reserved2 : 30; | ||
254 | } capabilities_tlb; | ||
255 | struct { | ||
256 | u64 gr_b0 : 1, | ||
257 | gr_b1 : 1, | ||
258 | fr : 1, | ||
259 | br : 1, | ||
260 | pr : 1, | ||
261 | ar : 1, | ||
262 | cr : 1, | ||
263 | rr : 1, | ||
264 | pkr : 1, | ||
265 | dbr : 1, | ||
266 | ibr : 1, | ||
267 | pmc : 1, | ||
268 | pmd : 1, | ||
269 | reserved1 : 3, | ||
270 | regnum : 1, | ||
271 | reserved2 : 15, | ||
272 | trigger : 1, | ||
273 | trigger_pl : 1, | ||
274 | reserved3 : 30; | ||
275 | } capabilities_register; | ||
276 | struct { | ||
277 | u64 reserved; | ||
278 | } capabilities_bus_processor_interconnect; | ||
279 | } capabilities_t; | ||
280 | |||
281 | typedef struct resources_s { | ||
282 | u64 ibr0 : 1, | ||
283 | ibr2 : 1, | ||
284 | ibr4 : 1, | ||
285 | ibr6 : 1, | ||
286 | dbr0 : 1, | ||
287 | dbr2 : 1, | ||
288 | dbr4 : 1, | ||
289 | dbr6 : 1, | ||
290 | reserved : 48; | ||
291 | } resources_t; | ||
292 | |||
293 | |||
294 | long get_page_size(void) | ||
295 | { | ||
296 | long page_size=sysconf(_SC_PAGESIZE); | ||
297 | return page_size; | ||
298 | } | ||
299 | |||
300 | #define PAGE_SIZE (get_page_size()==-1?0x4000:get_page_size()) | ||
301 | #define SHM_SIZE (2*PAGE_SIZE*NR_CPUS) | ||
302 | #define SHM_VA 0x2000000100000000 | ||
303 | |||
304 | int shmid; | ||
305 | void *shmaddr; | ||
306 | |||
307 | int create_shm(void) | ||
308 | { | ||
309 | key_t key; | ||
310 | char fn[MAX_FN_SIZE]; | ||
311 | |||
312 | /* cpu0 is always existing */ | ||
313 | sprintf(fn, PATH_FORMAT, 0); | ||
314 | if ((key = ftok(fn, 's')) == -1) { | ||
315 | perror("ftok"); | ||
316 | return -1; | ||
317 | } | ||
318 | |||
319 | shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT); | ||
320 | if (shmid == -1) { | ||
321 | if (errno==EEXIST) { | ||
322 | shmid = shmget(key, SHM_SIZE, 0); | ||
323 | if (shmid == -1) { | ||
324 | perror("shmget"); | ||
325 | return -1; | ||
326 | } | ||
327 | } | ||
328 | else { | ||
329 | perror("shmget"); | ||
330 | return -1; | ||
331 | } | ||
332 | } | ||
333 | vbprintf("shmid=%d", shmid); | ||
334 | |||
335 | /* connect to the segment: */ | ||
336 | shmaddr = shmat(shmid, (void *)SHM_VA, 0); | ||
337 | if (shmaddr == (void*)-1) { | ||
338 | perror("shmat"); | ||
339 | return -1; | ||
340 | } | ||
341 | |||
342 | memset(shmaddr, 0, SHM_SIZE); | ||
343 | mlock(shmaddr, SHM_SIZE); | ||
344 | |||
345 | return 0; | ||
346 | } | ||
347 | |||
348 | int free_shm() | ||
349 | { | ||
350 | munlock(shmaddr, SHM_SIZE); | ||
351 | shmdt(shmaddr); | ||
352 | semctl(shmid, 0, IPC_RMID); | ||
353 | |||
354 | return 0; | ||
355 | } | ||
356 | |||
357 | #ifdef _SEM_SEMUN_UNDEFINED | ||
358 | union semun | ||
359 | { | ||
360 | int val; | ||
361 | struct semid_ds *buf; | ||
362 | unsigned short int *array; | ||
363 | struct seminfo *__buf; | ||
364 | }; | ||
365 | #endif | ||
366 | |||
367 | u32 mode=1; /* 1: physical mode; 2: virtual mode. */ | ||
368 | int one_lock=1; | ||
369 | key_t key[NR_CPUS]; | ||
370 | int semid[NR_CPUS]; | ||
371 | |||
372 | int create_sem(int cpu) | ||
373 | { | ||
374 | union semun arg; | ||
375 | char fn[MAX_FN_SIZE]; | ||
376 | int sid; | ||
377 | |||
378 | sprintf(fn, PATH_FORMAT, cpu); | ||
379 | sprintf(fn, "%s/%s", fn, "err_type_info"); | ||
380 | if ((key[cpu] = ftok(fn, 'e')) == -1) { | ||
381 | perror("ftok"); | ||
382 | return -1; | ||
383 | } | ||
384 | |||
385 | if (semid[cpu]!=0) | ||
386 | return 0; | ||
387 | |||
388 | /* clear old semaphore */ | ||
389 | if ((sid = semget(key[cpu], 1, 0)) != -1) | ||
390 | semctl(sid, 0, IPC_RMID); | ||
391 | |||
392 | /* get one semaphore */ | ||
393 | if ((semid[cpu] = semget(key[cpu], 1, IPC_CREAT | IPC_EXCL)) == -1) { | ||
394 | perror("semget"); | ||
395 | printf("Please remove semaphore with key=0x%lx, then run the tool.\n", | ||
396 | (u64)key[cpu]); | ||
397 | return -1; | ||
398 | } | ||
399 | |||
400 | vbprintf("semid[%d]=0x%lx, key[%d]=%lx\n",cpu,(u64)semid[cpu],cpu, | ||
401 | (u64)key[cpu]); | ||
402 | /* initialize the semaphore to 1: */ | ||
403 | arg.val = 1; | ||
404 | if (semctl(semid[cpu], 0, SETVAL, arg) == -1) { | ||
405 | perror("semctl"); | ||
406 | return -1; | ||
407 | } | ||
408 | |||
409 | return 0; | ||
410 | } | ||
411 | |||
412 | static int lock(int cpu) | ||
413 | { | ||
414 | struct sembuf lock; | ||
415 | |||
416 | lock.sem_num = cpu; | ||
417 | lock.sem_op = 1; | ||
418 | semop(semid[cpu], &lock, 1); | ||
419 | |||
420 | return 0; | ||
421 | } | ||
422 | |||
423 | static int unlock(int cpu) | ||
424 | { | ||
425 | struct sembuf unlock; | ||
426 | |||
427 | unlock.sem_num = cpu; | ||
428 | unlock.sem_op = -1; | ||
429 | semop(semid[cpu], &unlock, 1); | ||
430 | |||
431 | return 0; | ||
432 | } | ||
433 | |||
434 | void free_sem(int cpu) | ||
435 | { | ||
436 | semctl(semid[cpu], 0, IPC_RMID); | ||
437 | } | ||
438 | |||
439 | int wr_multi(char *fn, unsigned long *data, int size) | ||
440 | { | ||
441 | int fd; | ||
442 | char buf[MAX_BUF_SIZE]; | ||
443 | int ret; | ||
444 | |||
445 | if (size==1) | ||
446 | sprintf(buf, "%lx", *data); | ||
447 | else if (size==3) | ||
448 | sprintf(buf, "%lx,%lx,%lx", data[0], data[1], data[2]); | ||
449 | else { | ||
450 | fprintf(stderr,"write to file with wrong size!\n"); | ||
451 | return -1; | ||
452 | } | ||
453 | |||
454 | fd=open(fn, O_RDWR); | ||
455 | if (!fd) { | ||
456 | perror("Error:"); | ||
457 | return -1; | ||
458 | } | ||
459 | ret=write(fd, buf, sizeof(buf)); | ||
460 | close(fd); | ||
461 | return ret; | ||
462 | } | ||
463 | |||
464 | int wr(char *fn, unsigned long data) | ||
465 | { | ||
466 | return wr_multi(fn, &data, 1); | ||
467 | } | ||
468 | |||
469 | int rd(char *fn, unsigned long *data) | ||
470 | { | ||
471 | int fd; | ||
472 | char buf[MAX_BUF_SIZE]; | ||
473 | |||
474 | fd=open(fn, O_RDONLY); | ||
475 | if (fd<0) { | ||
476 | perror("Error:"); | ||
477 | return -1; | ||
478 | } | ||
479 | read(fd, buf, MAX_BUF_SIZE); | ||
480 | *data=strtoul(buf, NULL, 16); | ||
481 | close(fd); | ||
482 | return 0; | ||
483 | } | ||
484 | |||
485 | int rd_status(char *path, int *status) | ||
486 | { | ||
487 | char fn[MAX_FN_SIZE]; | ||
488 | sprintf(fn, "%s/status", path); | ||
489 | if (rd(fn, (u64*)status)<0) { | ||
490 | perror("status reading error.\n"); | ||
491 | return -1; | ||
492 | } | ||
493 | |||
494 | return 0; | ||
495 | } | ||
496 | |||
497 | int rd_capabilities(char *path, u64 *capabilities) | ||
498 | { | ||
499 | char fn[MAX_FN_SIZE]; | ||
500 | sprintf(fn, "%s/capabilities", path); | ||
501 | if (rd(fn, capabilities)<0) { | ||
502 | perror("capabilities reading error.\n"); | ||
503 | return -1; | ||
504 | } | ||
505 | |||
506 | return 0; | ||
507 | } | ||
508 | |||
509 | int rd_all(char *path) | ||
510 | { | ||
511 | unsigned long err_type_info, err_struct_info, err_data_buffer; | ||
512 | int status; | ||
513 | unsigned long capabilities, resources; | ||
514 | char fn[MAX_FN_SIZE]; | ||
515 | |||
516 | sprintf(fn, "%s/err_type_info", path); | ||
517 | if (rd(fn, &err_type_info)<0) { | ||
518 | perror("err_type_info reading error.\n"); | ||
519 | return -1; | ||
520 | } | ||
521 | printf("err_type_info=%lx\n", err_type_info); | ||
522 | |||
523 | sprintf(fn, "%s/err_struct_info", path); | ||
524 | if (rd(fn, &err_struct_info)<0) { | ||
525 | perror("err_struct_info reading error.\n"); | ||
526 | return -1; | ||
527 | } | ||
528 | printf("err_struct_info=%lx\n", err_struct_info); | ||
529 | |||
530 | sprintf(fn, "%s/err_data_buffer", path); | ||
531 | if (rd(fn, &err_data_buffer)<0) { | ||
532 | perror("err_data_buffer reading error.\n"); | ||
533 | return -1; | ||
534 | } | ||
535 | printf("err_data_buffer=%lx\n", err_data_buffer); | ||
536 | |||
537 | sprintf(fn, "%s/status", path); | ||
538 | if (rd("status", (u64*)&status)<0) { | ||
539 | perror("status reading error.\n"); | ||
540 | return -1; | ||
541 | } | ||
542 | printf("status=%d\n", status); | ||
543 | |||
544 | sprintf(fn, "%s/capabilities", path); | ||
545 | if (rd(fn,&capabilities)<0) { | ||
546 | perror("capabilities reading error.\n"); | ||
547 | return -1; | ||
548 | } | ||
549 | printf("capabilities=%lx\n", capabilities); | ||
550 | |||
551 | sprintf(fn, "%s/resources", path); | ||
552 | if (rd(fn, &resources)<0) { | ||
553 | perror("resources reading error.\n"); | ||
554 | return -1; | ||
555 | } | ||
556 | printf("resources=%lx\n", resources); | ||
557 | |||
558 | return 0; | ||
559 | } | ||
560 | |||
561 | int query_capabilities(char *path, err_type_info_t err_type_info, | ||
562 | u64 *capabilities) | ||
563 | { | ||
564 | char fn[MAX_FN_SIZE]; | ||
565 | err_struct_info_t err_struct_info; | ||
566 | err_data_buffer_t err_data_buffer; | ||
567 | |||
568 | err_struct_info.err_struct_info=0; | ||
569 | memset(err_data_buffer.err_data_buffer, -1, ERR_DATA_BUFFER_SIZE*8); | ||
570 | |||
571 | sprintf(fn, "%s/err_type_info", path); | ||
572 | wr(fn, err_type_info.err_type_info); | ||
573 | sprintf(fn, "%s/err_struct_info", path); | ||
574 | wr(fn, 0x0); | ||
575 | sprintf(fn, "%s/err_data_buffer", path); | ||
576 | wr_multi(fn, err_data_buffer.err_data_buffer, ERR_DATA_BUFFER_SIZE); | ||
577 | |||
578 | // Fire pal_mc_error_inject procedure. | ||
579 | sprintf(fn, "%s/call_start", path); | ||
580 | wr(fn, mode); | ||
581 | |||
582 | if (rd_capabilities(path, capabilities)<0) | ||
583 | return -1; | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | |||
588 | int query_all_capabilities() | ||
589 | { | ||
590 | int status; | ||
591 | err_type_info_t err_type_info; | ||
592 | int err_sev, err_struct, struct_hier; | ||
593 | int cap=0; | ||
594 | u64 capabilities; | ||
595 | char path[MAX_FN_SIZE]; | ||
596 | |||
597 | err_type_info.err_type_info=0; // Initial | ||
598 | err_type_info.err_type_info_u.mode=0; // Query mode; | ||
599 | err_type_info.err_type_info_u.err_inj=0; | ||
600 | |||
601 | printf("All capabilities implemented in pal_mc_error_inject:\n"); | ||
602 | sprintf(path, PATH_FORMAT ,0); | ||
603 | for (err_sev=0;err_sev<3;err_sev++) | ||
604 | for (err_struct=0;err_struct<5;err_struct++) | ||
605 | for (struct_hier=0;struct_hier<5;struct_hier++) | ||
606 | { | ||
607 | status=-1; | ||
608 | capabilities=0; | ||
609 | err_type_info.err_type_info_u.err_sev=err_sev; | ||
610 | err_type_info.err_type_info_u.err_struct=err_struct; | ||
611 | err_type_info.err_type_info_u.struct_hier=struct_hier; | ||
612 | |||
613 | if (query_capabilities(path, err_type_info, &capabilities)<0) | ||
614 | continue; | ||
615 | |||
616 | if (rd_status(path, &status)<0) | ||
617 | continue; | ||
618 | |||
619 | if (status==0) { | ||
620 | cap=1; | ||
621 | printf("For err_sev=%d, err_struct=%d, struct_hier=%d: ", | ||
622 | err_sev, err_struct, struct_hier); | ||
623 | printf("capabilities 0x%lx\n", capabilities); | ||
624 | } | ||
625 | } | ||
626 | if (!cap) { | ||
627 | printf("No capabilities supported.\n"); | ||
628 | return 0; | ||
629 | } | ||
630 | |||
631 | return 0; | ||
632 | } | ||
633 | |||
634 | int err_inject(int cpu, char *path, err_type_info_t err_type_info, | ||
635 | err_struct_info_t err_struct_info, | ||
636 | err_data_buffer_t err_data_buffer) | ||
637 | { | ||
638 | int status; | ||
639 | char fn[MAX_FN_SIZE]; | ||
640 | |||
641 | log_info(cpu, "err_type_info=%lx, err_struct_info=%lx, ", | ||
642 | err_type_info.err_type_info, | ||
643 | err_struct_info.err_struct_info); | ||
644 | log_info(cpu,"err_data_buffer=[%lx,%lx,%lx]\n", | ||
645 | err_data_buffer.err_data_buffer[0], | ||
646 | err_data_buffer.err_data_buffer[1], | ||
647 | err_data_buffer.err_data_buffer[2]); | ||
648 | sprintf(fn, "%s/err_type_info", path); | ||
649 | wr(fn, err_type_info.err_type_info); | ||
650 | sprintf(fn, "%s/err_struct_info", path); | ||
651 | wr(fn, err_struct_info.err_struct_info); | ||
652 | sprintf(fn, "%s/err_data_buffer", path); | ||
653 | wr_multi(fn, err_data_buffer.err_data_buffer, ERR_DATA_BUFFER_SIZE); | ||
654 | |||
655 | // Fire pal_mc_error_inject procedure. | ||
656 | sprintf(fn, "%s/call_start", path); | ||
657 | wr(fn,mode); | ||
658 | |||
659 | if (rd_status(path, &status)<0) { | ||
660 | vbprintf("fail: read status\n"); | ||
661 | return -100; | ||
662 | } | ||
663 | |||
664 | if (status!=0) { | ||
665 | log_info(cpu, "fail: status=%d\n", status); | ||
666 | return status; | ||
667 | } | ||
668 | |||
669 | return status; | ||
670 | } | ||
671 | |||
672 | static int construct_data_buf(char *path, err_type_info_t err_type_info, | ||
673 | err_struct_info_t err_struct_info, | ||
674 | err_data_buffer_t *err_data_buffer, | ||
675 | void *va1) | ||
676 | { | ||
677 | char fn[MAX_FN_SIZE]; | ||
678 | u64 virt_addr=0, phys_addr=0; | ||
679 | |||
680 | vbprintf("va1=%lx\n", (u64)va1); | ||
681 | memset(&err_data_buffer->err_data_buffer_cache, 0, ERR_DATA_BUFFER_SIZE*8); | ||
682 | |||
683 | switch (err_type_info.err_type_info_u.err_struct) { | ||
684 | case 1: // Cache | ||
685 | switch (err_struct_info.err_struct_info_cache.cl_id) { | ||
686 | case 1: //Virtual addr | ||
687 | err_data_buffer->err_data_buffer_cache.inj_addr=(u64)va1; | ||
688 | break; | ||
689 | case 2: //Phys addr | ||
690 | sprintf(fn, "%s/virtual_to_phys", path); | ||
691 | virt_addr=(u64)va1; | ||
692 | if (wr(fn,virt_addr)<0) | ||
693 | return -1; | ||
694 | rd(fn, &phys_addr); | ||
695 | err_data_buffer->err_data_buffer_cache.inj_addr=phys_addr; | ||
696 | break; | ||
697 | default: | ||
698 | printf("Not supported cl_id\n"); | ||
699 | break; | ||
700 | } | ||
701 | break; | ||
702 | case 2: // TLB | ||
703 | break; | ||
704 | case 3: // Register file | ||
705 | break; | ||
706 | case 4: // Bus/system interconnect | ||
707 | default: | ||
708 | printf("Not supported err_struct\n"); | ||
709 | break; | ||
710 | } | ||
711 | |||
712 | return 0; | ||
713 | } | ||
714 | |||
715 | typedef struct { | ||
716 | u64 cpu; | ||
717 | u64 loop; | ||
718 | u64 interval; | ||
719 | u64 err_type_info; | ||
720 | u64 err_struct_info; | ||
721 | u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; | ||
722 | } parameters_t; | ||
723 | |||
724 | parameters_t line_para; | ||
725 | int para; | ||
726 | |||
727 | static int empty_data_buffer(u64 *err_data_buffer) | ||
728 | { | ||
729 | int empty=1; | ||
730 | int i; | ||
731 | |||
732 | for (i=0;i<ERR_DATA_BUFFER_SIZE; i++) | ||
733 | if (err_data_buffer[i]!=-1) | ||
734 | empty=0; | ||
735 | |||
736 | return empty; | ||
737 | } | ||
738 | |||
739 | int err_inj() | ||
740 | { | ||
741 | err_type_info_t err_type_info; | ||
742 | err_struct_info_t err_struct_info; | ||
743 | err_data_buffer_t err_data_buffer; | ||
744 | int count; | ||
745 | FILE *fp; | ||
746 | unsigned long cpu, loop, interval, err_type_info_conf, err_struct_info_conf; | ||
747 | u64 err_data_buffer_conf[ERR_DATA_BUFFER_SIZE]; | ||
748 | int num; | ||
749 | int i; | ||
750 | char path[MAX_FN_SIZE]; | ||
751 | parameters_t parameters[MAX_TASK_NUM]={}; | ||
752 | pid_t child_pid[MAX_TASK_NUM]; | ||
753 | time_t current_time; | ||
754 | int status; | ||
755 | |||
756 | if (!para) { | ||
757 | fp=fopen("err.conf", "r"); | ||
758 | if (fp==NULL) { | ||
759 | perror("Error open err.conf"); | ||
760 | return -1; | ||
761 | } | ||
762 | |||
763 | num=0; | ||
764 | while (!feof(fp)) { | ||
765 | char buf[256]; | ||
766 | memset(buf,0,256); | ||
767 | fgets(buf, 256, fp); | ||
768 | count=sscanf(buf, "%lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx\n", | ||
769 | &cpu, &loop, &interval,&err_type_info_conf, | ||
770 | &err_struct_info_conf, | ||
771 | &err_data_buffer_conf[0], | ||
772 | &err_data_buffer_conf[1], | ||
773 | &err_data_buffer_conf[2]); | ||
774 | if (count!=PARA_FIELD_NUM+3) { | ||
775 | err_data_buffer_conf[0]=-1; | ||
776 | err_data_buffer_conf[1]=-1; | ||
777 | err_data_buffer_conf[2]=-1; | ||
778 | count=sscanf(buf, "%lx, %lx, %lx, %lx, %lx\n", | ||
779 | &cpu, &loop, &interval,&err_type_info_conf, | ||
780 | &err_struct_info_conf); | ||
781 | if (count!=PARA_FIELD_NUM) | ||
782 | continue; | ||
783 | } | ||
784 | |||
785 | parameters[num].cpu=cpu; | ||
786 | parameters[num].loop=loop; | ||
787 | parameters[num].interval= interval>MIN_INTERVAL | ||
788 | ?interval:MIN_INTERVAL; | ||
789 | parameters[num].err_type_info=err_type_info_conf; | ||
790 | parameters[num].err_struct_info=err_struct_info_conf; | ||
791 | memcpy(parameters[num++].err_data_buffer, | ||
792 | err_data_buffer_conf,ERR_DATA_BUFFER_SIZE*8) ; | ||
793 | |||
794 | if (num>=MAX_TASK_NUM) | ||
795 | break; | ||
796 | } | ||
797 | } | ||
798 | else { | ||
799 | parameters[0].cpu=line_para.cpu; | ||
800 | parameters[0].loop=line_para.loop; | ||
801 | parameters[0].interval= line_para.interval>MIN_INTERVAL | ||
802 | ?line_para.interval:MIN_INTERVAL; | ||
803 | parameters[0].err_type_info=line_para.err_type_info; | ||
804 | parameters[0].err_struct_info=line_para.err_struct_info; | ||
805 | memcpy(parameters[0].err_data_buffer, | ||
806 | line_para.err_data_buffer,ERR_DATA_BUFFER_SIZE*8) ; | ||
807 | |||
808 | num=1; | ||
809 | } | ||
810 | |||
811 | /* Create semaphore: If one_lock, one semaphore for all processors. | ||
812 | Otherwise, one sempaphore for each processor. */ | ||
813 | if (one_lock) { | ||
814 | if (create_sem(0)) { | ||
815 | printf("Can not create semaphore...exit\n"); | ||
816 | free_sem(0); | ||
817 | return -1; | ||
818 | } | ||
819 | } | ||
820 | else { | ||
821 | for (i=0;i<num;i++) { | ||
822 | if (create_sem(parameters[i].cpu)) { | ||
823 | printf("Can not create semaphore for cpu%d...exit\n",i); | ||
824 | free_sem(parameters[num].cpu); | ||
825 | return -1; | ||
826 | } | ||
827 | } | ||
828 | } | ||
829 | |||
830 | /* Create a shm segment which will be used to inject/consume errors on.*/ | ||
831 | if (create_shm()==-1) { | ||
832 | printf("Error to create shm...exit\n"); | ||
833 | return -1; | ||
834 | } | ||
835 | |||
836 | for (i=0;i<num;i++) { | ||
837 | pid_t pid; | ||
838 | |||
839 | current_time=time(NULL); | ||
840 | log_info(parameters[i].cpu, "\nBegine at %s", ctime(¤t_time)); | ||
841 | log_info(parameters[i].cpu, "Configurations:\n"); | ||
842 | log_info(parameters[i].cpu,"On cpu%ld: loop=%lx, interval=%lx(s)", | ||
843 | parameters[i].cpu, | ||
844 | parameters[i].loop, | ||
845 | parameters[i].interval); | ||
846 | log_info(parameters[i].cpu," err_type_info=%lx,err_struct_info=%lx\n", | ||
847 | parameters[i].err_type_info, | ||
848 | parameters[i].err_struct_info); | ||
849 | |||
850 | sprintf(path, PATH_FORMAT, (int)parameters[i].cpu); | ||
851 | err_type_info.err_type_info=parameters[i].err_type_info; | ||
852 | err_struct_info.err_struct_info=parameters[i].err_struct_info; | ||
853 | memcpy(err_data_buffer.err_data_buffer, | ||
854 | parameters[i].err_data_buffer, | ||
855 | ERR_DATA_BUFFER_SIZE*8); | ||
856 | |||
857 | pid=fork(); | ||
858 | if (pid==0) { | ||
859 | unsigned long mask[MASK_SIZE]; | ||
860 | int j, k; | ||
861 | |||
862 | void *va1, *va2; | ||
863 | |||
864 | /* Allocate two memory areas va1 and va2 in shm */ | ||
865 | va1=shmaddr+parameters[i].cpu*PAGE_SIZE; | ||
866 | va2=shmaddr+parameters[i].cpu*PAGE_SIZE+PAGE_SIZE; | ||
867 | |||
868 | vbprintf("va1=%lx, va2=%lx\n", (u64)va1, (u64)va2); | ||
869 | memset(va1, 0x1, PAGE_SIZE); | ||
870 | memset(va2, 0x2, PAGE_SIZE); | ||
871 | |||
872 | if (empty_data_buffer(err_data_buffer.err_data_buffer)) | ||
873 | /* If not specified yet, construct data buffer | ||
874 | * with va1 | ||
875 | */ | ||
876 | construct_data_buf(path, err_type_info, | ||
877 | err_struct_info, &err_data_buffer,va1); | ||
878 | |||
879 | for (j=0;j<MASK_SIZE;j++) | ||
880 | mask[j]=0; | ||
881 | |||
882 | cpu=parameters[i].cpu; | ||
883 | k = cpu%64; | ||
884 | j = cpu/64; | ||
885 | mask[j]=1<<k; | ||
886 | |||
887 | if (sched_setaffinity(0, MASK_SIZE*8, mask)==-1) { | ||
888 | perror("Error sched_setaffinity:"); | ||
889 | return -1; | ||
890 | } | ||
891 | |||
892 | for (j=0; j<parameters[i].loop; j++) { | ||
893 | log_info(parameters[i].cpu,"Injection "); | ||
894 | log_info(parameters[i].cpu,"on cpu%ld: #%d/%ld ", | ||
895 | |||
896 | parameters[i].cpu,j+1, parameters[i].loop); | ||
897 | |||
898 | /* Hold the lock */ | ||
899 | if (one_lock) | ||
900 | lock(0); | ||
901 | else | ||
902 | /* Hold lock on this cpu */ | ||
903 | lock(parameters[i].cpu); | ||
904 | |||
905 | if ((status=err_inject(parameters[i].cpu, | ||
906 | path, err_type_info, | ||
907 | err_struct_info, err_data_buffer)) | ||
908 | ==0) { | ||
909 | /* consume the error for "inject only"*/ | ||
910 | memcpy(va2, va1, PAGE_SIZE); | ||
911 | memcpy(va1, va2, PAGE_SIZE); | ||
912 | log_info(parameters[i].cpu, | ||
913 | "successful\n"); | ||
914 | } | ||
915 | else { | ||
916 | log_info(parameters[i].cpu,"fail:"); | ||
917 | log_info(parameters[i].cpu, | ||
918 | "status=%d\n", status); | ||
919 | unlock(parameters[i].cpu); | ||
920 | break; | ||
921 | } | ||
922 | if (one_lock) | ||
923 | /* Release the lock */ | ||
924 | unlock(0); | ||
925 | /* Release lock on this cpu */ | ||
926 | else | ||
927 | unlock(parameters[i].cpu); | ||
928 | |||
929 | if (j < parameters[i].loop-1) | ||
930 | sleep(parameters[i].interval); | ||
931 | } | ||
932 | current_time=time(NULL); | ||
933 | log_info(parameters[i].cpu, "Done at %s", ctime(¤t_time)); | ||
934 | return 0; | ||
935 | } | ||
936 | else if (pid<0) { | ||
937 | perror("Error fork:"); | ||
938 | continue; | ||
939 | } | ||
940 | child_pid[i]=pid; | ||
941 | } | ||
942 | for (i=0;i<num;i++) | ||
943 | waitpid(child_pid[i], NULL, 0); | ||
944 | |||
945 | if (one_lock) | ||
946 | free_sem(0); | ||
947 | else | ||
948 | for (i=0;i<num;i++) | ||
949 | free_sem(parameters[i].cpu); | ||
950 | |||
951 | printf("All done.\n"); | ||
952 | |||
953 | return 0; | ||
954 | } | ||
955 | |||
956 | void help() | ||
957 | { | ||
958 | printf("err_inject_tool:\n"); | ||
959 | printf("\t-q: query all capabilities. default: off\n"); | ||
960 | printf("\t-m: procedure mode. 1: physical 2: virtual. default: 1\n"); | ||
961 | printf("\t-i: inject errors. default: off\n"); | ||
962 | printf("\t-l: one lock per cpu. default: one lock for all\n"); | ||
963 | printf("\t-e: error parameters:\n"); | ||
964 | printf("\t\tcpu,loop,interval,err_type_info,err_struct_info[,err_data_buffer[0],err_data_buffer[1],err_data_buffer[2]]\n"); | ||
965 | printf("\t\t cpu: logical cpu number the error will be inject in.\n"); | ||
966 | printf("\t\t loop: times the error will be injected.\n"); | ||
967 | printf("\t\t interval: In second. every so often one error is injected.\n"); | ||
968 | printf("\t\t err_type_info, err_struct_info: PAL parameters.\n"); | ||
969 | printf("\t\t err_data_buffer: PAL parameter. Optional. If not present,\n"); | ||
970 | printf("\t\t it's constructed by tool automatically. Be\n"); | ||
971 | printf("\t\t careful to provide err_data_buffer and make\n"); | ||
972 | printf("\t\t sure it's working with the environment.\n"); | ||
973 | printf("\t Note:no space between error parameters.\n"); | ||
974 | printf("\t default: Take error parameters from err.conf instead of command line.\n"); | ||
975 | printf("\t-v: verbose. default: off\n"); | ||
976 | printf("\t-h: help\n\n"); | ||
977 | printf("The tool will take err.conf file as "); | ||
978 | printf("input to inject single or multiple errors "); | ||
979 | printf("on one or multiple cpus in parallel.\n"); | ||
980 | } | ||
981 | |||
982 | int main(int argc, char **argv) | ||
983 | { | ||
984 | char c; | ||
985 | int do_err_inj=0; | ||
986 | int do_query_all=0; | ||
987 | int count; | ||
988 | u32 m; | ||
989 | |||
990 | /* Default one lock for all cpu's */ | ||
991 | one_lock=1; | ||
992 | while ((c = getopt(argc, argv, "m:iqvhle:")) != EOF) | ||
993 | switch (c) { | ||
994 | case 'm': /* Procedure mode. 1: phys 2: virt */ | ||
995 | count=sscanf(optarg, "%x", &m); | ||
996 | if (count!=1 || (m!=1 && m!=2)) { | ||
997 | printf("Wrong mode number.\n"); | ||
998 | help(); | ||
999 | return -1; | ||
1000 | } | ||
1001 | mode=m; | ||
1002 | break; | ||
1003 | case 'i': /* Inject errors */ | ||
1004 | do_err_inj=1; | ||
1005 | break; | ||
1006 | case 'q': /* Query */ | ||
1007 | do_query_all=1; | ||
1008 | break; | ||
1009 | case 'v': /* Verbose */ | ||
1010 | verbose=1; | ||
1011 | break; | ||
1012 | case 'l': /* One lock per cpu */ | ||
1013 | one_lock=0; | ||
1014 | break; | ||
1015 | case 'e': /* error arguments */ | ||
1016 | /* Take parameters: | ||
1017 | * #cpu, loop, interval, err_type_info, err_struct_info[, err_data_buffer] | ||
1018 | * err_data_buffer is optional. Recommend not to specify | ||
1019 | * err_data_buffer. Better to use tool to generate it. | ||
1020 | */ | ||
1021 | count=sscanf(optarg, | ||
1022 | "%lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx\n", | ||
1023 | &line_para.cpu, | ||
1024 | &line_para.loop, | ||
1025 | &line_para.interval, | ||
1026 | &line_para.err_type_info, | ||
1027 | &line_para.err_struct_info, | ||
1028 | &line_para.err_data_buffer[0], | ||
1029 | &line_para.err_data_buffer[1], | ||
1030 | &line_para.err_data_buffer[2]); | ||
1031 | if (count!=PARA_FIELD_NUM+3) { | ||
1032 | line_para.err_data_buffer[0]=-1, | ||
1033 | line_para.err_data_buffer[1]=-1, | ||
1034 | line_para.err_data_buffer[2]=-1; | ||
1035 | count=sscanf(optarg, "%lx, %lx, %lx, %lx, %lx\n", | ||
1036 | &line_para.cpu, | ||
1037 | &line_para.loop, | ||
1038 | &line_para.interval, | ||
1039 | &line_para.err_type_info, | ||
1040 | &line_para.err_struct_info); | ||
1041 | if (count!=PARA_FIELD_NUM) { | ||
1042 | printf("Wrong error arguments.\n"); | ||
1043 | help(); | ||
1044 | return -1; | ||
1045 | } | ||
1046 | } | ||
1047 | para=1; | ||
1048 | break; | ||
1049 | continue; | ||
1050 | break; | ||
1051 | case 'h': | ||
1052 | help(); | ||
1053 | return 0; | ||
1054 | default: | ||
1055 | break; | ||
1056 | } | ||
1057 | |||
1058 | if (do_query_all) | ||
1059 | query_all_capabilities(); | ||
1060 | if (do_err_inj) | ||
1061 | err_inj(); | ||
1062 | |||
1063 | if (!do_query_all && !do_err_inj) | ||
1064 | help(); | ||
1065 | |||
1066 | return 0; | ||
1067 | } | ||
1068 | |||
diff --git a/Documentation/input/atarikbd.txt b/Documentation/input/atarikbd.txt index 668f4d0d97d6..ab050621e20f 100644 --- a/Documentation/input/atarikbd.txt +++ b/Documentation/input/atarikbd.txt | |||
@@ -179,9 +179,9 @@ reporting mode for joystick 1, with both buttons being logically assigned to | |||
179 | the mouse. After any joystick command, the ikbd assumes that joysticks are | 179 | the mouse. After any joystick command, the ikbd assumes that joysticks are |
180 | connected to both Joystick0 and Joystick1. Any mouse command (except MOUSE | 180 | connected to both Joystick0 and Joystick1. Any mouse command (except MOUSE |
181 | DISABLE) then causes port 0 to again be scanned as if it were a mouse, and | 181 | DISABLE) then causes port 0 to again be scanned as if it were a mouse, and |
182 | both buttons are logically connected to it. If a mouse diable command is | 182 | both buttons are logically connected to it. If a mouse disable command is |
183 | received while port 0 is presumed to be a mouse, the button is logically | 183 | received while port 0 is presumed to be a mouse, the button is logically |
184 | assigned to Joystick1 ( until the mouse is reenabled by another mouse command). | 184 | assigned to Joystick1 (until the mouse is reenabled by another mouse command). |
185 | 185 | ||
186 | 9. ikbd Command Set | 186 | 9. ikbd Command Set |
187 | 187 | ||
diff --git a/Documentation/input/input-programming.txt b/Documentation/input/input-programming.txt index 180e0689676c..d9d523099bb7 100644 --- a/Documentation/input/input-programming.txt +++ b/Documentation/input/input-programming.txt | |||
@@ -1,5 +1,3 @@ | |||
1 | $Id: input-programming.txt,v 1.4 2001/05/04 09:47:14 vojtech Exp $ | ||
2 | |||
3 | Programming input drivers | 1 | Programming input drivers |
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~ | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 | 3 | ||
@@ -20,28 +18,51 @@ pressed or released a BUTTON_IRQ happens. The driver could look like: | |||
20 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
21 | #include <asm/io.h> | 19 | #include <asm/io.h> |
22 | 20 | ||
21 | static struct input_dev *button_dev; | ||
22 | |||
23 | static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) | 23 | static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) |
24 | { | 24 | { |
25 | input_report_key(&button_dev, BTN_1, inb(BUTTON_PORT) & 1); | 25 | input_report_key(button_dev, BTN_1, inb(BUTTON_PORT) & 1); |
26 | input_sync(&button_dev); | 26 | input_sync(button_dev); |
27 | } | 27 | } |
28 | 28 | ||
29 | static int __init button_init(void) | 29 | static int __init button_init(void) |
30 | { | 30 | { |
31 | int error; | ||
32 | |||
31 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { | 33 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { |
32 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); | 34 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); |
33 | return -EBUSY; | 35 | return -EBUSY; |
34 | } | 36 | } |
35 | 37 | ||
36 | button_dev.evbit[0] = BIT(EV_KEY); | 38 | button_dev = input_allocate_device(); |
37 | button_dev.keybit[LONG(BTN_0)] = BIT(BTN_0); | 39 | if (!button_dev) { |
38 | 40 | printk(KERN_ERR "button.c: Not enough memory\n"); | |
39 | input_register_device(&button_dev); | 41 | error = -ENOMEM; |
42 | goto err_free_irq; | ||
43 | } | ||
44 | |||
45 | button_dev->evbit[0] = BIT(EV_KEY); | ||
46 | button_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); | ||
47 | |||
48 | error = input_register_device(button_dev); | ||
49 | if (error) { | ||
50 | printk(KERN_ERR "button.c: Failed to register device\n"); | ||
51 | goto err_free_dev; | ||
52 | } | ||
53 | |||
54 | return 0; | ||
55 | |||
56 | err_free_dev: | ||
57 | input_free_device(button_dev); | ||
58 | err_free_irq: | ||
59 | free_irq(BUTTON_IRQ, button_interrupt); | ||
60 | return error; | ||
40 | } | 61 | } |
41 | 62 | ||
42 | static void __exit button_exit(void) | 63 | static void __exit button_exit(void) |
43 | { | 64 | { |
44 | input_unregister_device(&button_dev); | 65 | input_unregister_device(button_dev); |
45 | free_irq(BUTTON_IRQ, button_interrupt); | 66 | free_irq(BUTTON_IRQ, button_interrupt); |
46 | } | 67 | } |
47 | 68 | ||
@@ -58,17 +79,18 @@ In the _init function, which is called either upon module load or when | |||
58 | booting the kernel, it grabs the required resources (it should also check | 79 | booting the kernel, it grabs the required resources (it should also check |
59 | for the presence of the device). | 80 | for the presence of the device). |
60 | 81 | ||
61 | Then it sets the input bitfields. This way the device driver tells the other | 82 | Then it allocates a new input device structure with input_aloocate_device() |
83 | and sets up input bitfields. This way the device driver tells the other | ||
62 | parts of the input systems what it is - what events can be generated or | 84 | parts of the input systems what it is - what events can be generated or |
63 | accepted by this input device. Our example device can only generate EV_KEY type | 85 | accepted by this input device. Our example device can only generate EV_KEY |
64 | events, and from those only BTN_0 event code. Thus we only set these two | 86 | type events, and from those only BTN_0 event code. Thus we only set these |
65 | bits. We could have used | 87 | two bits. We could have used |
66 | 88 | ||
67 | set_bit(EV_KEY, button_dev.evbit); | 89 | set_bit(EV_KEY, button_dev.evbit); |
68 | set_bit(BTN_0, button_dev.keybit); | 90 | set_bit(BTN_0, button_dev.keybit); |
69 | 91 | ||
70 | as well, but with more than single bits the first approach tends to be | 92 | as well, but with more than single bits the first approach tends to be |
71 | shorter. | 93 | shorter. |
72 | 94 | ||
73 | Then the example driver registers the input device structure by calling | 95 | Then the example driver registers the input device structure by calling |
74 | 96 | ||
@@ -76,16 +98,15 @@ Then the example driver registers the input device structure by calling | |||
76 | 98 | ||
77 | This adds the button_dev structure to linked lists of the input driver and | 99 | This adds the button_dev structure to linked lists of the input driver and |
78 | calls device handler modules _connect functions to tell them a new input | 100 | calls device handler modules _connect functions to tell them a new input |
79 | device has appeared. Because the _connect functions may call kmalloc(, | 101 | device has appeared. input_register_device() may sleep and therefore must |
80 | GFP_KERNEL), which can sleep, input_register_device() must not be called | 102 | not be called from an interrupt or with a spinlock held. |
81 | from an interrupt or with a spinlock held. | ||
82 | 103 | ||
83 | While in use, the only used function of the driver is | 104 | While in use, the only used function of the driver is |
84 | 105 | ||
85 | button_interrupt() | 106 | button_interrupt() |
86 | 107 | ||
87 | which upon every interrupt from the button checks its state and reports it | 108 | which upon every interrupt from the button checks its state and reports it |
88 | via the | 109 | via the |
89 | 110 | ||
90 | input_report_key() | 111 | input_report_key() |
91 | 112 | ||
@@ -113,16 +134,10 @@ can use the open and close callback to know when it can stop polling or | |||
113 | release the interrupt and when it must resume polling or grab the interrupt | 134 | release the interrupt and when it must resume polling or grab the interrupt |
114 | again. To do that, we would add this to our example driver: | 135 | again. To do that, we would add this to our example driver: |
115 | 136 | ||
116 | int button_used = 0; | ||
117 | |||
118 | static int button_open(struct input_dev *dev) | 137 | static int button_open(struct input_dev *dev) |
119 | { | 138 | { |
120 | if (button_used++) | ||
121 | return 0; | ||
122 | |||
123 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { | 139 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { |
124 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); | 140 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); |
125 | button_used--; | ||
126 | return -EBUSY; | 141 | return -EBUSY; |
127 | } | 142 | } |
128 | 143 | ||
@@ -131,20 +146,21 @@ static int button_open(struct input_dev *dev) | |||
131 | 146 | ||
132 | static void button_close(struct input_dev *dev) | 147 | static void button_close(struct input_dev *dev) |
133 | { | 148 | { |
134 | if (!--button_used) | 149 | free_irq(IRQ_AMIGA_VERTB, button_interrupt); |
135 | free_irq(IRQ_AMIGA_VERTB, button_interrupt); | ||
136 | } | 150 | } |
137 | 151 | ||
138 | static int __init button_init(void) | 152 | static int __init button_init(void) |
139 | { | 153 | { |
140 | ... | 154 | ... |
141 | button_dev.open = button_open; | 155 | button_dev->open = button_open; |
142 | button_dev.close = button_close; | 156 | button_dev->close = button_close; |
143 | ... | 157 | ... |
144 | } | 158 | } |
145 | 159 | ||
146 | Note the button_used variable - we have to track how many times the open | 160 | Note that input core keeps track of number of users for the device and |
147 | function was called to know when exactly our device stops being used. | 161 | makes sure that dev->open() is called only when the first user connects |
162 | to the device and that dev->close() is called when the very last user | ||
163 | disconnects. Calls to both callbacks are serialized. | ||
148 | 164 | ||
149 | The open() callback should return a 0 in case of success or any nonzero value | 165 | The open() callback should return a 0 in case of success or any nonzero value |
150 | in case of failure. The close() callback (which is void) must always succeed. | 166 | in case of failure. The close() callback (which is void) must always succeed. |
@@ -175,7 +191,7 @@ set the corresponding bits and call the | |||
175 | 191 | ||
176 | input_report_rel(struct input_dev *dev, int code, int value) | 192 | input_report_rel(struct input_dev *dev, int code, int value) |
177 | 193 | ||
178 | function. Events are generated only for nonzero value. | 194 | function. Events are generated only for nonzero value. |
179 | 195 | ||
180 | However EV_ABS requires a little special care. Before calling | 196 | However EV_ABS requires a little special care. Before calling |
181 | input_register_device, you have to fill additional fields in the input_dev | 197 | input_register_device, you have to fill additional fields in the input_dev |
@@ -187,6 +203,10 @@ the ABS_X axis: | |||
187 | button_dev.absfuzz[ABS_X] = 4; | 203 | button_dev.absfuzz[ABS_X] = 4; |
188 | button_dev.absflat[ABS_X] = 8; | 204 | button_dev.absflat[ABS_X] = 8; |
189 | 205 | ||
206 | Or, you can just say: | ||
207 | |||
208 | input_set_abs_params(button_dev, ABS_X, 0, 255, 4, 8); | ||
209 | |||
190 | This setting would be appropriate for a joystick X axis, with the minimum of | 210 | This setting would be appropriate for a joystick X axis, with the minimum of |
191 | 0, maximum of 255 (which the joystick *must* be able to reach, no problem if | 211 | 0, maximum of 255 (which the joystick *must* be able to reach, no problem if |
192 | it sometimes reports more, but it must be able to always reach the min and | 212 | it sometimes reports more, but it must be able to always reach the min and |
@@ -197,14 +217,7 @@ If you don't need absfuzz and absflat, you can set them to zero, which mean | |||
197 | that the thing is precise and always returns to exactly the center position | 217 | that the thing is precise and always returns to exactly the center position |
198 | (if it has any). | 218 | (if it has any). |
199 | 219 | ||
200 | 1.4 The void *private field | 220 | 1.4 NBITS(), LONG(), BIT() |
201 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
202 | |||
203 | This field in the input structure can be used to point to any private data | ||
204 | structures in the input device driver, in case the driver handles more than | ||
205 | one device. You'll need it in the open and close callbacks. | ||
206 | |||
207 | 1.5 NBITS(), LONG(), BIT() | ||
208 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 221 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
209 | 222 | ||
210 | These three macros from input.h help some bitfield computations: | 223 | These three macros from input.h help some bitfield computations: |
@@ -213,13 +226,9 @@ These three macros from input.h help some bitfield computations: | |||
213 | LONG(x) - returns the index in the array in longs for bit x | 226 | LONG(x) - returns the index in the array in longs for bit x |
214 | BIT(x) - returns the index in a long for bit x | 227 | BIT(x) - returns the index in a long for bit x |
215 | 228 | ||
216 | 1.6 The number, id* and name fields | 229 | 1.5 The id* and name fields |
217 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 230 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
218 | 231 | ||
219 | The dev->number is assigned by the input system to the input device when it | ||
220 | is registered. It has no use except for identifying the device to the user | ||
221 | in system messages. | ||
222 | |||
223 | The dev->name should be set before registering the input device by the input | 232 | The dev->name should be set before registering the input device by the input |
224 | device driver. It's a string like 'Generic button device' containing a | 233 | device driver. It's a string like 'Generic button device' containing a |
225 | user friendly name of the device. | 234 | user friendly name of the device. |
@@ -234,15 +243,25 @@ driver. | |||
234 | 243 | ||
235 | The id and name fields can be passed to userland via the evdev interface. | 244 | The id and name fields can be passed to userland via the evdev interface. |
236 | 245 | ||
237 | 1.7 The keycode, keycodemax, keycodesize fields | 246 | 1.6 The keycode, keycodemax, keycodesize fields |
238 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 247 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
239 | 248 | ||
240 | These two fields will be used for any input devices that report their data | 249 | These three fields should be used by input devices that have dense keymaps. |
241 | as scancodes. If not all scancodes can be known by autodetection, they may | 250 | The keycode is an array used to map from scancodes to input system keycodes. |
242 | need to be set by userland utilities. The keycode array then is an array | 251 | The keycode max should contain the size of the array and keycodesize the |
243 | used to map from scancodes to input system keycodes. The keycode max will | 252 | size of each entry in it (in bytes). |
244 | contain the size of the array and keycodesize the size of each entry in it | 253 | |
245 | (in bytes). | 254 | Userspace can query and alter current scancode to keycode mappings using |
255 | EVIOCGKEYCODE and EVIOCSKEYCODE ioctls on corresponding evdev interface. | ||
256 | When a device has all 3 aforementioned fields filled in, the driver may | ||
257 | rely on kernel's default implementation of setting and querying keycode | ||
258 | mappings. | ||
259 | |||
260 | 1.7 dev->getkeycode() and dev->setkeycode() | ||
261 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
262 | getkeycode() and setkeycode() callbacks allow drivers to override default | ||
263 | keycode/keycodesize/keycodemax mapping mechanism provided by input core | ||
264 | and implement sparse keycode maps. | ||
246 | 265 | ||
247 | 1.8 Key autorepeat | 266 | 1.8 Key autorepeat |
248 | ~~~~~~~~~~~~~~~~~~ | 267 | ~~~~~~~~~~~~~~~~~~ |
@@ -266,7 +285,7 @@ direction - from the system to the input device driver. If your input device | |||
266 | driver can handle these events, it has to set the respective bits in evbit, | 285 | driver can handle these events, it has to set the respective bits in evbit, |
267 | *and* also the callback routine: | 286 | *and* also the callback routine: |
268 | 287 | ||
269 | button_dev.event = button_event; | 288 | button_dev->event = button_event; |
270 | 289 | ||
271 | int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 290 | int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
272 | { | 291 | { |
diff --git a/Documentation/input/xpad.txt b/Documentation/input/xpad.txt index 5427bdf225ed..aae0d404c566 100644 --- a/Documentation/input/xpad.txt +++ b/Documentation/input/xpad.txt | |||
@@ -65,15 +65,15 @@ of buttons, see section 0.3 - Unknown Controllers | |||
65 | I've tested this with Stepmania, and it works quite well. | 65 | I've tested this with Stepmania, and it works quite well. |
66 | 66 | ||
67 | 67 | ||
68 | 0.3 Unkown Controllers | 68 | 0.3 Unknown Controllers |
69 | ---------------------- | 69 | ---------------------- |
70 | If you have an unkown xbox controller, it should work just fine with | 70 | If you have an unknown xbox controller, it should work just fine with |
71 | the default settings. | 71 | the default settings. |
72 | 72 | ||
73 | HOWEVER if you have an unknown dance pad not listed below, it will not | 73 | HOWEVER if you have an unknown dance pad not listed below, it will not |
74 | work UNLESS you set "dpad_to_buttons" to 1 in the module configuration. | 74 | work UNLESS you set "dpad_to_buttons" to 1 in the module configuration. |
75 | 75 | ||
76 | PLEASE if you have an unkown controller, email Dom <binary1230@yahoo.com> with | 76 | PLEASE, if you have an unknown controller, email Dom <binary1230@yahoo.com> with |
77 | a dump from /proc/bus/usb and a description of the pad (manufacturer, country, | 77 | a dump from /proc/bus/usb and a description of the pad (manufacturer, country, |
78 | whether it is a dance pad or normal controller) so that we can add your pad | 78 | whether it is a dance pad or normal controller) so that we can add your pad |
79 | to the list of supported devices, ensuring that it will work out of the | 79 | to the list of supported devices, ensuring that it will work out of the |
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index 8f750c0efed5..3de7d379cf07 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -138,7 +138,8 @@ Code Seq# Include File Comments | |||
138 | 'm' 00-1F net/irda/irmod.h conflict! | 138 | 'm' 00-1F net/irda/irmod.h conflict! |
139 | 'n' 00-7F linux/ncp_fs.h | 139 | 'n' 00-7F linux/ncp_fs.h |
140 | 'n' E0-FF video/matrox.h matroxfb | 140 | 'n' E0-FF video/matrox.h matroxfb |
141 | 'p' 00-3F linux/mc146818rtc.h | 141 | 'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) |
142 | 'p' 00-3F linux/mc146818rtc.h conflict! | ||
142 | 'p' 40-7F linux/nvram.h | 143 | 'p' 40-7F linux/nvram.h |
143 | 'p' 80-9F user-space parport | 144 | 'p' 80-9F user-space parport |
144 | <mailto:tim@cyberelk.net> | 145 | <mailto:tim@cyberelk.net> |
diff --git a/Documentation/isdn/CREDITS b/Documentation/isdn/CREDITS index e1b3023efaa8..7c17c837064f 100644 --- a/Documentation/isdn/CREDITS +++ b/Documentation/isdn/CREDITS | |||
@@ -2,7 +2,7 @@ | |||
2 | I want to thank all who contributed to this project and especially to: | 2 | I want to thank all who contributed to this project and especially to: |
3 | (in alphabetical order) | 3 | (in alphabetical order) |
4 | 4 | ||
5 | Thomas Bogendörfer (tsbogend@bigbug.franken.de) | 5 | Thomas Bogendörfer (tsbogend@bigbug.franken.de) |
6 | Tester, lots of bugfixes and hints. | 6 | Tester, lots of bugfixes and hints. |
7 | 7 | ||
8 | Alan Cox (alan@redhat.com) | 8 | Alan Cox (alan@redhat.com) |
@@ -11,7 +11,7 @@ Alan Cox (alan@redhat.com) | |||
11 | Henner Eisen (eis@baty.hanse.de) | 11 | Henner Eisen (eis@baty.hanse.de) |
12 | For X.25 implementation. | 12 | For X.25 implementation. |
13 | 13 | ||
14 | Volker Götz (volker@oops.franken.de) | 14 | Volker Götz (volker@oops.franken.de) |
15 | For contribution of man-pages, the imontty-tool and a perfect | 15 | For contribution of man-pages, the imontty-tool and a perfect |
16 | maintaining of the mailing-list at hub-wue. | 16 | maintaining of the mailing-list at hub-wue. |
17 | 17 | ||
diff --git a/Documentation/isdn/README b/Documentation/isdn/README index 761595243931..6783437f21c2 100644 --- a/Documentation/isdn/README +++ b/Documentation/isdn/README | |||
@@ -402,7 +402,7 @@ README for the ISDN-subsystem | |||
402 | the script tools/tcltk/isdnmon. You can add actions for line-status | 402 | the script tools/tcltk/isdnmon. You can add actions for line-status |
403 | changes. See the comments at the beginning of the script for how to | 403 | changes. See the comments at the beginning of the script for how to |
404 | do that. There are other tty-based tools in the tools-subdirectory | 404 | do that. There are other tty-based tools in the tools-subdirectory |
405 | contributed by Michael Knigge (imon), Volker Götz (imontty) and | 405 | contributed by Michael Knigge (imon), Volker Götz (imontty) and |
406 | Andreas Kool (isdnmon). | 406 | Andreas Kool (isdnmon). |
407 | 407 | ||
408 | l) For initial testing, you can set the verbose-level to 2 (default: 0). | 408 | l) For initial testing, you can set the verbose-level to 2 (default: 0). |
diff --git a/Documentation/isdn/README.icn b/Documentation/isdn/README.icn index a5f55eadb3ca..13f833d4e910 100644 --- a/Documentation/isdn/README.icn +++ b/Documentation/isdn/README.icn | |||
@@ -3,8 +3,8 @@ $Id: README.icn,v 1.7 2000/08/06 09:22:51 armin Exp $ | |||
3 | You can get the ICN-ISDN-card from: | 3 | You can get the ICN-ISDN-card from: |
4 | 4 | ||
5 | Thinking Objects Software GmbH | 5 | Thinking Objects Software GmbH |
6 | Versbacher Röthe 159 | 6 | Versbacher Röthe 159 |
7 | 97078 Würzburg | 7 | 97078 Würzburg |
8 | Tel: +49 931 2877950 | 8 | Tel: +49 931 2877950 |
9 | Fax: +49 931 2877951 | 9 | Fax: +49 931 2877951 |
10 | 10 | ||
diff --git a/Documentation/java.txt b/Documentation/java.txt index c768dc63b34e..3cce3fbb6644 100644 --- a/Documentation/java.txt +++ b/Documentation/java.txt | |||
@@ -390,7 +390,7 @@ the execution bit, then just do | |||
390 | 390 | ||
391 | 391 | ||
392 | originally by Brian A. Lantz, brian@lantz.com | 392 | originally by Brian A. Lantz, brian@lantz.com |
393 | heavily edited for binfmt_misc by Richard Günther | 393 | heavily edited for binfmt_misc by Richard Günther |
394 | new scripts by Colin J. Watson <cjw44@cam.ac.uk> | 394 | new scripts by Colin J. Watson <cjw44@cam.ac.uk> |
395 | added executable Jar file support by Kurt Huwig <kurt@iku-netz.de> | 395 | added executable Jar file support by Kurt Huwig <kurt@iku-netz.de> |
396 | 396 | ||
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt index 769ee05ee4d1..1d247d59ad56 100644 --- a/Documentation/kbuild/modules.txt +++ b/Documentation/kbuild/modules.txt | |||
@@ -249,7 +249,7 @@ following files: | |||
249 | --> filename: Makefile | 249 | --> filename: Makefile |
250 | KERNELDIR := /lib/modules/`uname -r`/build | 250 | KERNELDIR := /lib/modules/`uname -r`/build |
251 | all:: | 251 | all:: |
252 | $(MAKE) -C $KERNELDIR M=`pwd` $@ | 252 | $(MAKE) -C $(KERNELDIR) M=`pwd` $@ |
253 | 253 | ||
254 | # Module specific targets | 254 | # Module specific targets |
255 | genbin: | 255 | genbin: |
diff --git a/Documentation/kernel-docs.txt b/Documentation/kernel-docs.txt index c68dafeda7a7..d9e3b199929b 100644 --- a/Documentation/kernel-docs.txt +++ b/Documentation/kernel-docs.txt | |||
@@ -236,7 +236,7 @@ | |||
236 | 236 | ||
237 | * Title: "Design and Implementation of the Second Extended | 237 | * Title: "Design and Implementation of the Second Extended |
238 | Filesystem" | 238 | Filesystem" |
239 | Author: Rémy Card, Theodore Ts'o, Stephen Tweedie. | 239 | Author: Rémy Card, Theodore Ts'o, Stephen Tweedie. |
240 | URL: http://web.mit.edu/tytso/www/linux/ext2intro.html | 240 | URL: http://web.mit.edu/tytso/www/linux/ext2intro.html |
241 | Keywords: ext2, linux fs history, inode, directory, link, devices, | 241 | Keywords: ext2, linux fs history, inode, directory, link, devices, |
242 | VFS, physical structure, performance, benchmarks, ext2fs library, | 242 | VFS, physical structure, performance, benchmarks, ext2fs library, |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 84c3bd05c639..09220a1e22d9 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -64,6 +64,7 @@ parameter is applicable: | |||
64 | GENERIC_TIME The generic timeofday code is enabled. | 64 | GENERIC_TIME The generic timeofday code is enabled. |
65 | NFS Appropriate NFS support is enabled. | 65 | NFS Appropriate NFS support is enabled. |
66 | OSS OSS sound support is enabled. | 66 | OSS OSS sound support is enabled. |
67 | PV_OPS A paravirtualized kernel | ||
67 | PARIDE The ParIDE subsystem is enabled. | 68 | PARIDE The ParIDE subsystem is enabled. |
68 | PARISC The PA-RISC architecture is enabled. | 69 | PARISC The PA-RISC architecture is enabled. |
69 | PCI PCI bus support is enabled. | 70 | PCI PCI bus support is enabled. |
@@ -495,6 +496,30 @@ and is between 256 and 4096 characters. It is defined in the file | |||
495 | Format: <area>[,<node>] | 496 | Format: <area>[,<node>] |
496 | See also Documentation/networking/decnet.txt. | 497 | See also Documentation/networking/decnet.txt. |
497 | 498 | ||
499 | default_blu= [VT] | ||
500 | Format: <blue0>,<blue1>,<blue2>,...,<blue15> | ||
501 | Change the default blue palette of the console. | ||
502 | This is a 16-member array composed of values | ||
503 | ranging from 0-255. | ||
504 | |||
505 | default_grn= [VT] | ||
506 | Format: <green0>,<green1>,<green2>,...,<green15> | ||
507 | Change the default green palette of the console. | ||
508 | This is a 16-member array composed of values | ||
509 | ranging from 0-255. | ||
510 | |||
511 | default_red= [VT] | ||
512 | Format: <red0>,<red1>,<red2>,...,<red15> | ||
513 | Change the default red palette of the console. | ||
514 | This is a 16-member array composed of values | ||
515 | ranging from 0-255. | ||
516 | |||
517 | default_utf8= [VT] | ||
518 | Format=<0|1> | ||
519 | Set system-wide default UTF-8 mode for all tty's. | ||
520 | Default is 0 and by setting to 1, it enables UTF-8 | ||
521 | mode for all newly opened or allocated terminals. | ||
522 | |||
498 | dhash_entries= [KNL] | 523 | dhash_entries= [KNL] |
499 | Set number of hash buckets for dentry cache. | 524 | Set number of hash buckets for dentry cache. |
500 | 525 | ||
@@ -695,8 +720,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
695 | idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed | 720 | idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed |
696 | See Documentation/ide.txt. | 721 | See Documentation/ide.txt. |
697 | 722 | ||
698 | idle= [HW] | 723 | idle= [X86] |
699 | Format: idle=poll or idle=halt | 724 | Format: idle=poll or idle=mwait |
725 | Poll forces a polling idle loop that can slightly improves the performance | ||
726 | of waking up a idle CPU, but will use a lot of power and make the system | ||
727 | run hot. Not recommended. | ||
728 | idle=mwait. On systems which support MONITOR/MWAIT but the kernel chose | ||
729 | to not use it because it doesn't save as much power as a normal idle | ||
730 | loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same | ||
731 | as idle=poll. | ||
700 | 732 | ||
701 | ignore_loglevel [KNL] | 733 | ignore_loglevel [KNL] |
702 | Ignore loglevel setting - this will print /all/ | 734 | Ignore loglevel setting - this will print /all/ |
@@ -722,14 +754,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
722 | inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver | 754 | inport.irq= [HW] Inport (ATI XL and Microsoft) busmouse driver |
723 | Format: <irq> | 755 | Format: <irq> |
724 | 756 | ||
725 | combined_mode= [HW] control which driver uses IDE ports in combined | ||
726 | mode: legacy IDE driver, libata, or both | ||
727 | (in the libata case, libata.atapi_enabled=1 may be | ||
728 | useful as well). Note that using the ide or libata | ||
729 | options may affect your device naming (e.g. by | ||
730 | changing hdc to sdb). | ||
731 | Format: combined (default), ide, or libata | ||
732 | |||
733 | inttest= [IA64] | 757 | inttest= [IA64] |
734 | 758 | ||
735 | io7= [HW] IO7 for Marvel based alpha systems | 759 | io7= [HW] IO7 for Marvel based alpha systems |
@@ -808,6 +832,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
808 | lasi= [HW,SCSI] PARISC LASI driver for the 53c700 chip | 832 | lasi= [HW,SCSI] PARISC LASI driver for the 53c700 chip |
809 | Format: addr:<io>,irq:<irq> | 833 | Format: addr:<io>,irq:<irq> |
810 | 834 | ||
835 | legacy_serial.force [HW,IA-32,X86-64] | ||
836 | Probe for COM ports at legacy addresses even | ||
837 | if PNPBIOS or ACPI should describe them. This | ||
838 | is for working around firmware defects. | ||
839 | |||
811 | llsc*= [IA64] See function print_params() in | 840 | llsc*= [IA64] See function print_params() in |
812 | arch/ia64/sn/kernel/llsc4.c. | 841 | arch/ia64/sn/kernel/llsc4.c. |
813 | 842 | ||
@@ -1157,6 +1186,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1157 | 1186 | ||
1158 | nomce [IA-32] Machine Check Exception | 1187 | nomce [IA-32] Machine Check Exception |
1159 | 1188 | ||
1189 | noreplace-paravirt [IA-32,PV_OPS] Don't patch paravirt_ops | ||
1190 | |||
1191 | noreplace-smp [IA-32,SMP] Don't replace SMP instructions | ||
1192 | with UP alternatives | ||
1193 | |||
1160 | noresidual [PPC] Don't use residual data on PReP machines. | 1194 | noresidual [PPC] Don't use residual data on PReP machines. |
1161 | 1195 | ||
1162 | noresume [SWSUSP] Disables resume and restores original swap | 1196 | noresume [SWSUSP] Disables resume and restores original swap |
@@ -1562,6 +1596,20 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1562 | smart2= [HW] | 1596 | smart2= [HW] |
1563 | Format: <io1>[,<io2>[,...,<io8>]] | 1597 | Format: <io1>[,<io2>[,...,<io8>]] |
1564 | 1598 | ||
1599 | smp-alt-once [IA-32,SMP] On a hotplug CPU system, only | ||
1600 | attempt to substitute SMP alternatives once at boot. | ||
1601 | |||
1602 | smsc-ircc2.nopnp [HW] Don't use PNP to discover SMC devices | ||
1603 | smsc-ircc2.ircc_cfg= [HW] Device configuration I/O port | ||
1604 | smsc-ircc2.ircc_sir= [HW] SIR base I/O port | ||
1605 | smsc-ircc2.ircc_fir= [HW] FIR base I/O port | ||
1606 | smsc-ircc2.ircc_irq= [HW] IRQ line | ||
1607 | smsc-ircc2.ircc_dma= [HW] DMA channel | ||
1608 | smsc-ircc2.ircc_transceiver= [HW] Transceiver type: | ||
1609 | 0: Toshiba Satellite 1800 (GP data pin select) | ||
1610 | 1: Fast pin select (default) | ||
1611 | 2: ATC IRMode | ||
1612 | |||
1565 | snd-ad1816a= [HW,ALSA] | 1613 | snd-ad1816a= [HW,ALSA] |
1566 | 1614 | ||
1567 | snd-ad1848= [HW,ALSA] | 1615 | snd-ad1848= [HW,ALSA] |
@@ -1820,6 +1868,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1820 | [USBHID] The interval which mice are to be polled at. | 1868 | [USBHID] The interval which mice are to be polled at. |
1821 | 1869 | ||
1822 | vdso= [IA-32,SH] | 1870 | vdso= [IA-32,SH] |
1871 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) | ||
1823 | vdso=1: enable VDSO (default) | 1872 | vdso=1: enable VDSO (default) |
1824 | vdso=0: disable VDSO mapping | 1873 | vdso=0: disable VDSO mapping |
1825 | 1874 | ||
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index d71fafffce90..da5404ab7569 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -14,6 +14,7 @@ CONTENTS | |||
14 | 8. Kprobes Example | 14 | 8. Kprobes Example |
15 | 9. Jprobes Example | 15 | 9. Jprobes Example |
16 | 10. Kretprobes Example | 16 | 10. Kretprobes Example |
17 | Appendix A: The kprobes debugfs interface | ||
17 | 18 | ||
18 | 1. Concepts: Kprobes, Jprobes, Return Probes | 19 | 1. Concepts: Kprobes, Jprobes, Return Probes |
19 | 20 | ||
@@ -349,9 +350,12 @@ for instrumentation and error reporting.) | |||
349 | 350 | ||
350 | If the number of times a function is called does not match the number | 351 | If the number of times a function is called does not match the number |
351 | of times it returns, registering a return probe on that function may | 352 | of times it returns, registering a return probe on that function may |
352 | produce undesirable results. We have the do_exit() case covered. | 353 | produce undesirable results. In such a case, a line: |
353 | do_execve() and do_fork() are not an issue. We're unaware of other | 354 | kretprobe BUG!: Processing kretprobe d000000000041aa8 @ c00000000004f48c |
354 | specific cases where this could be a problem. | 355 | gets printed. With this information, one will be able to correlate the |
356 | exact instance of the kretprobe that caused the problem. We have the | ||
357 | do_exit() case covered. do_execve() and do_fork() are not an issue. | ||
358 | We're unaware of other specific cases where this could be a problem. | ||
355 | 359 | ||
356 | If, upon entry to or exit from a function, the CPU is running on | 360 | If, upon entry to or exit from a function, the CPU is running on |
357 | a stack other than that of the current task, registering a return | 361 | a stack other than that of the current task, registering a return |
@@ -614,3 +618,27 @@ http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe | |||
614 | http://www.redhat.com/magazine/005mar05/features/kprobes/ | 618 | http://www.redhat.com/magazine/005mar05/features/kprobes/ |
615 | http://www-users.cs.umn.edu/~boutcher/kprobes/ | 619 | http://www-users.cs.umn.edu/~boutcher/kprobes/ |
616 | http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) | 620 | http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) |
621 | |||
622 | |||
623 | Appendix A: The kprobes debugfs interface | ||
624 | |||
625 | With recent kernels (> 2.6.20) the list of registered kprobes is visible | ||
626 | under the /debug/kprobes/ directory (assuming debugfs is mounted at /debug). | ||
627 | |||
628 | /debug/kprobes/list: Lists all registered probes on the system | ||
629 | |||
630 | c015d71a k vfs_read+0x0 | ||
631 | c011a316 j do_fork+0x0 | ||
632 | c03dedc5 r tcp_v4_rcv+0x0 | ||
633 | |||
634 | The first column provides the kernel address where the probe is inserted. | ||
635 | The second column identifies the type of probe (k - kprobe, r - kretprobe | ||
636 | and j - jprobe), while the third column specifies the symbol+offset of | ||
637 | the probe. If the probed function belongs to a module, the module name | ||
638 | is also specified. | ||
639 | |||
640 | /debug/kprobes/enabled: Turn kprobes ON/OFF | ||
641 | |||
642 | Provides a knob to globally turn registered kprobes ON or OFF. By default, | ||
643 | all kprobes are enabled. By echoing "0" to this file, all registered probes | ||
644 | will be disarmed, till such time a "1" is echoed to this file. | ||
diff --git a/Documentation/laptop-mode.txt b/Documentation/laptop-mode.txt index 6f639e3473af..eeedee11c8c2 100644 --- a/Documentation/laptop-mode.txt +++ b/Documentation/laptop-mode.txt | |||
@@ -33,7 +33,7 @@ or anything. Simply install all the files included in this document, and | |||
33 | laptop mode will automatically be started when you're on battery. For | 33 | laptop mode will automatically be started when you're on battery. For |
34 | your convenience, a tarball containing an installer can be downloaded at: | 34 | your convenience, a tarball containing an installer can be downloaded at: |
35 | 35 | ||
36 | http://www.xs4all.nl/~bsamwel/laptop_mode/tools/ | 36 | http://www.samwel.tk/laptop_mode/laptop_mode/ |
37 | 37 | ||
38 | To configure laptop mode, you need to edit the configuration file, which is | 38 | To configure laptop mode, you need to edit the configuration file, which is |
39 | located in /etc/default/laptop-mode on Debian-based systems, or in | 39 | located in /etc/default/laptop-mode on Debian-based systems, or in |
diff --git a/Documentation/m68k/README.buddha b/Documentation/m68k/README.buddha index ef484a719bb9..3ea9827ba3c7 100644 --- a/Documentation/m68k/README.buddha +++ b/Documentation/m68k/README.buddha | |||
@@ -204,7 +204,7 @@ always shows a "no IRQ here" on the Buddha, and accesses to | |||
204 | the third IDE port are going into data's Nirwana on the | 204 | the third IDE port are going into data's Nirwana on the |
205 | Buddha. | 205 | Buddha. |
206 | 206 | ||
207 | Jens Schönfeld february 19th, 1997 | 207 | Jens Schönfeld february 19th, 1997 |
208 | updated may 27th, 1997 | 208 | updated may 27th, 1997 |
209 | eMail: sysop@nostlgic.tng.oche.de | 209 | eMail: sysop@nostlgic.tng.oche.de |
210 | 210 | ||
diff --git a/Documentation/magic-number.txt b/Documentation/magic-number.txt index 0e740c812d12..bd450e797558 100644 --- a/Documentation/magic-number.txt +++ b/Documentation/magic-number.txt | |||
@@ -129,7 +129,7 @@ SAVEKMSG_MAGIC1 0x53415645 savekmsg arch/*/amiga/config.c | |||
129 | GDA_MAGIC 0x58464552 gda include/asm-mips64/sn/gda.h | 129 | GDA_MAGIC 0x58464552 gda include/asm-mips64/sn/gda.h |
130 | RED_MAGIC1 0x5a2cf071 (any) mm/slab.c | 130 | RED_MAGIC1 0x5a2cf071 (any) mm/slab.c |
131 | STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h | 131 | STL_PORTMAGIC 0x5a7182c9 stlport include/linux/stallion.h |
132 | EEPROM_MAGIC_VALUE 0X5ab478d2 lanai_dev drivers/atm/lanai.c | 132 | EEPROM_MAGIC_VALUE 0x5ab478d2 lanai_dev drivers/atm/lanai.c |
133 | HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h | 133 | HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state include/linux/hdlcdrv.h |
134 | EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h | 134 | EPCA_MAGIC 0x5c6df104 channel include/linux/epca.h |
135 | PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h | 135 | PCXX_MAGIC 0x5c6df104 channel drivers/char/pcxx.h |
diff --git a/Documentation/md.txt b/Documentation/md.txt index 2202f5dc8ac2..5818628207b5 100644 --- a/Documentation/md.txt +++ b/Documentation/md.txt | |||
@@ -178,6 +178,21 @@ All md devices contain: | |||
178 | The size should be at least PAGE_SIZE (4k) and should be a power | 178 | The size should be at least PAGE_SIZE (4k) and should be a power |
179 | of 2. This can only be set while assembling an array | 179 | of 2. This can only be set while assembling an array |
180 | 180 | ||
181 | layout | ||
182 | The "layout" for the array for the particular level. This is | ||
183 | simply a number that is interpretted differently by different | ||
184 | levels. It can be written while assembling an array. | ||
185 | |||
186 | reshape_position | ||
187 | This is either "none" or a sector number within the devices of | ||
188 | the array where "reshape" is up to. If this is set, the three | ||
189 | attributes mentioned above (raid_disks, chunk_size, layout) can | ||
190 | potentially have 2 values, an old and a new value. If these | ||
191 | values differ, reading the attribute returns | ||
192 | new (old) | ||
193 | and writing will effect the 'new' value, leaving the 'old' | ||
194 | unchanged. | ||
195 | |||
181 | component_size | 196 | component_size |
182 | For arrays with data redundancy (i.e. not raid0, linear, faulty, | 197 | For arrays with data redundancy (i.e. not raid0, linear, faulty, |
183 | multipath), all components must be the same size - or at least | 198 | multipath), all components must be the same size - or at least |
@@ -193,11 +208,6 @@ All md devices contain: | |||
193 | 1.2 (newer format in varying locations) or "none" indicating that | 208 | 1.2 (newer format in varying locations) or "none" indicating that |
194 | the kernel isn't managing metadata at all. | 209 | the kernel isn't managing metadata at all. |
195 | 210 | ||
196 | layout | ||
197 | The "layout" for the array for the particular level. This is | ||
198 | simply a number that is interpretted differently by different | ||
199 | levels. It can be written while assembling an array. | ||
200 | |||
201 | resync_start | 211 | resync_start |
202 | The point at which resync should start. If no resync is needed, | 212 | The point at which resync should start. If no resync is needed, |
203 | this will be a very large number. At array creation it will | 213 | this will be a very large number. At array creation it will |
@@ -259,29 +269,6 @@ All md devices contain: | |||
259 | like active, but no writes have been seen for a while (safe_mode_delay). | 269 | like active, but no writes have been seen for a while (safe_mode_delay). |
260 | 270 | ||
261 | 271 | ||
262 | sync_speed_min | ||
263 | sync_speed_max | ||
264 | This are similar to /proc/sys/dev/raid/speed_limit_{min,max} | ||
265 | however they only apply to the particular array. | ||
266 | If no value has been written to these, of if the word 'system' | ||
267 | is written, then the system-wide value is used. If a value, | ||
268 | in kibibytes-per-second is written, then it is used. | ||
269 | When the files are read, they show the currently active value | ||
270 | followed by "(local)" or "(system)" depending on whether it is | ||
271 | a locally set or system-wide value. | ||
272 | |||
273 | sync_completed | ||
274 | This shows the number of sectors that have been completed of | ||
275 | whatever the current sync_action is, followed by the number of | ||
276 | sectors in total that could need to be processed. The two | ||
277 | numbers are separated by a '/' thus effectively showing one | ||
278 | value, a fraction of the process that is complete. | ||
279 | |||
280 | sync_speed | ||
281 | This shows the current actual speed, in K/sec, of the current | ||
282 | sync_action. It is averaged over the last 30 seconds. | ||
283 | |||
284 | |||
285 | As component devices are added to an md array, they appear in the 'md' | 272 | As component devices are added to an md array, they appear in the 'md' |
286 | directory as new directories named | 273 | directory as new directories named |
287 | dev-XXX | 274 | dev-XXX |
@@ -412,6 +399,35 @@ also have | |||
412 | Note that the numbers are 'bit' numbers, not 'block' numbers. | 399 | Note that the numbers are 'bit' numbers, not 'block' numbers. |
413 | They should be scaled by the bitmap_chunksize. | 400 | They should be scaled by the bitmap_chunksize. |
414 | 401 | ||
402 | sync_speed_min | ||
403 | sync_speed_max | ||
404 | This are similar to /proc/sys/dev/raid/speed_limit_{min,max} | ||
405 | however they only apply to the particular array. | ||
406 | If no value has been written to these, of if the word 'system' | ||
407 | is written, then the system-wide value is used. If a value, | ||
408 | in kibibytes-per-second is written, then it is used. | ||
409 | When the files are read, they show the currently active value | ||
410 | followed by "(local)" or "(system)" depending on whether it is | ||
411 | a locally set or system-wide value. | ||
412 | |||
413 | sync_completed | ||
414 | This shows the number of sectors that have been completed of | ||
415 | whatever the current sync_action is, followed by the number of | ||
416 | sectors in total that could need to be processed. The two | ||
417 | numbers are separated by a '/' thus effectively showing one | ||
418 | value, a fraction of the process that is complete. | ||
419 | |||
420 | sync_speed | ||
421 | This shows the current actual speed, in K/sec, of the current | ||
422 | sync_action. It is averaged over the last 30 seconds. | ||
423 | |||
424 | suspend_lo | ||
425 | suspend_hi | ||
426 | The two values, given as numbers of sectors, indicate a range | ||
427 | within the array where IO will be blocked. This is currently | ||
428 | only supported for raid4/5/6. | ||
429 | |||
430 | |||
415 | Each active md device may also have attributes specific to the | 431 | Each active md device may also have attributes specific to the |
416 | personality module that manages it. | 432 | personality module that manages it. |
417 | These are specific to the implementation of the module and could | 433 | These are specific to the implementation of the module and could |
diff --git a/Documentation/netlabel/introduction.txt b/Documentation/netlabel/introduction.txt index a4ffba1694c8..5ecd8d1dcf4e 100644 --- a/Documentation/netlabel/introduction.txt +++ b/Documentation/netlabel/introduction.txt | |||
@@ -30,7 +30,7 @@ The communication layer exists to allow NetLabel configuration and monitoring | |||
30 | from user space. The NetLabel communication layer uses a message based | 30 | from user space. The NetLabel communication layer uses a message based |
31 | protocol built on top of the Generic NETLINK transport mechanism. The exact | 31 | protocol built on top of the Generic NETLINK transport mechanism. The exact |
32 | formatting of these NetLabel messages as well as the Generic NETLINK family | 32 | formatting of these NetLabel messages as well as the Generic NETLINK family |
33 | names can be found in the the 'net/netlabel/' directory as comments in the | 33 | names can be found in the 'net/netlabel/' directory as comments in the |
34 | header files as well as in 'include/net/netlabel.h'. | 34 | header files as well as in 'include/net/netlabel.h'. |
35 | 35 | ||
36 | * Security Module API | 36 | * Security Module API |
diff --git a/Documentation/networking/6pack.txt b/Documentation/networking/6pack.txt index 48ed2b711bd2..d0777a1200e1 100644 --- a/Documentation/networking/6pack.txt +++ b/Documentation/networking/6pack.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | This is the 6pack-mini-HOWTO, written by | 1 | This is the 6pack-mini-HOWTO, written by |
2 | 2 | ||
3 | Andreas Könsgen DG3KQ | 3 | Andreas Könsgen DG3KQ |
4 | Internet: ajk@iehk.rwth-aachen.de | 4 | Internet: ajk@iehk.rwth-aachen.de |
5 | AMPR-net: dg3kq@db0pra.ampr.org | 5 | AMPR-net: dg3kq@db0pra.ampr.org |
6 | AX.25: dg3kq@db0ach.#nrw.deu.eu | 6 | AX.25: dg3kq@db0ach.#nrw.deu.eu |
diff --git a/Documentation/networking/NAPI_HOWTO.txt b/Documentation/networking/NAPI_HOWTO.txt index fb8dc6422a52..7907435a661c 100644 --- a/Documentation/networking/NAPI_HOWTO.txt +++ b/Documentation/networking/NAPI_HOWTO.txt | |||
@@ -160,7 +160,7 @@ on current cpu. This primitive is called by dev->poll(), when | |||
160 | it completes its work. The device cannot be out of poll list at this | 160 | it completes its work. The device cannot be out of poll list at this |
161 | call, if it is then clearly it is a BUG(). You'll know ;-> | 161 | call, if it is then clearly it is a BUG(). You'll know ;-> |
162 | 162 | ||
163 | All these above nethods are used below. So keep reading for clarity. | 163 | All of the above methods are used below, so keep reading for clarity. |
164 | 164 | ||
165 | Device driver changes to be made when porting NAPI | 165 | Device driver changes to be made when porting NAPI |
166 | ================================================== | 166 | ================================================== |
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 5a232d946be3..db0cd5169581 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -13,7 +13,7 @@ You can find the latest version of this document at | |||
13 | 13 | ||
14 | Please send me your comments to | 14 | Please send me your comments to |
15 | 15 | ||
16 | Ulisses Alonso Camaró <uaca@i.hate.spam.alumni.uv.es> | 16 | Ulisses Alonso Camaró <uaca@i.hate.spam.alumni.uv.es> |
17 | 17 | ||
18 | ------------------------------------------------------------------------------- | 18 | ------------------------------------------------------------------------------- |
19 | + Why use PACKET_MMAP | 19 | + Why use PACKET_MMAP |
diff --git a/Documentation/networking/slicecom.hun b/Documentation/networking/slicecom.hun index 5acf1918694a..bed2f045e550 100644 --- a/Documentation/networking/slicecom.hun +++ b/Documentation/networking/slicecom.hun | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | SliceCOM adapter felhasznaloi dokumentacioja - 0.51 verziohoz | 2 | SliceCOM adapter felhasznaloi dokumentacioja - 0.51 verziohoz |
3 | 3 | ||
4 | Bartók István <bartoki@itc.hu> | 4 | Bartók István <bartoki@itc.hu> |
5 | Utolso modositas: Wed Aug 29 17:26:58 CEST 2001 | 5 | Utolso modositas: Wed Aug 29 17:26:58 CEST 2001 |
6 | 6 | ||
7 | ----------------------------------------------------------------- | 7 | ----------------------------------------------------------------- |
diff --git a/Documentation/networking/slicecom.txt b/Documentation/networking/slicecom.txt index 32d3b916afad..c82c0cf981b4 100644 --- a/Documentation/networking/slicecom.txt +++ b/Documentation/networking/slicecom.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | SliceCOM adapter user's documentation - for the 0.51 driver version | 2 | SliceCOM adapter user's documentation - for the 0.51 driver version |
3 | 3 | ||
4 | Written by Bartók István <bartoki@itc.hu> | 4 | Written by Bartók István <bartoki@itc.hu> |
5 | 5 | ||
6 | English translation: Lakatos György <gyuri@itc.hu> | 6 | English translation: Lakatos György <gyuri@itc.hu> |
7 | Mon Dec 11 15:28:42 CET 2000 | 7 | Mon Dec 11 15:28:42 CET 2000 |
8 | 8 | ||
9 | Last modified: Wed Aug 29 17:25:37 CEST 2001 | 9 | Last modified: Wed Aug 29 17:25:37 CEST 2001 |
diff --git a/Documentation/networking/tms380tr.txt b/Documentation/networking/tms380tr.txt index c169a57bc925..1f73e13058df 100644 --- a/Documentation/networking/tms380tr.txt +++ b/Documentation/networking/tms380tr.txt | |||
@@ -71,24 +71,24 @@ Below find attached the setting for the SK NET TR 4/16 ISA adapters | |||
71 | CHAPTER 1 LOCATION OF DIP-SWITCH | 71 | CHAPTER 1 LOCATION OF DIP-SWITCH |
72 | ============================================================== | 72 | ============================================================== |
73 | 73 | ||
74 | UÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ | 74 | UÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ |
75 | þUÄÄÄÄÄÄ¿ UÄÄÄÄÄ¿ UÄÄÄ¿ þ | 75 | þUÄÄÄÄÄÄ¿ UÄÄÄÄÄ¿ UÄÄÄ¿ þ |
76 | þAÄÄÄÄÄÄU W1 AÄÄÄÄÄU UÄÄÄÄ¿ þ þ þ | 76 | þAÄÄÄÄÄÄU W1 AÄÄÄÄÄU UÄÄÄÄ¿ þ þ þ |
77 | þUÄÄÄÄÄÄ¿ þ þ þ þ UÄÄÅ¿ | 77 | þUÄÄÄÄÄÄ¿ þ þ þ þ UÄÄÅ¿ |
78 | þAÄÄÄÄÄÄU UÄÄÄÄÄÄÄÄÄÄÄ¿ AÄÄÄÄU þ þ þ þþ | 78 | þAÄÄÄÄÄÄU UÄÄÄÄÄÄÄÄÄÄÄ¿ AÄÄÄÄU þ þ þ þþ |
79 | þUÄÄÄÄÄÄ¿ þ þ UÄÄÄ¿ AÄÄÄU AÄÄÅU | 79 | þUÄÄÄÄÄÄ¿ þ þ UÄÄÄ¿ AÄÄÄU AÄÄÅU |
80 | þAÄÄÄÄÄÄU þ TMS380C26 þ þ þ þ | 80 | þAÄÄÄÄÄÄU þ TMS380C26 þ þ þ þ |
81 | þUÄÄÄÄÄÄ¿ þ þ AÄÄÄU AÄ¿ | 81 | þUÄÄÄÄÄÄ¿ þ þ AÄÄÄU AÄ¿ |
82 | þAÄÄÄÄÄÄU þ þ þ þ | 82 | þAÄÄÄÄÄÄU þ þ þ þ |
83 | þ AÄÄÄÄÄÄÄÄÄÄÄU þ þ | 83 | þ AÄÄÄÄÄÄÄÄÄÄÄU þ þ |
84 | þ þ þ | 84 | þ þ þ |
85 | þ AÄU | 85 | þ AÄU |
86 | þ þ | 86 | þ þ |
87 | þ þ | 87 | þ þ |
88 | þ þ | 88 | þ þ |
89 | þ þ | 89 | þ þ |
90 | AÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄU | 90 | AÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄU |
91 | AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU | 91 | AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄU |
92 | 92 | ||
93 | ============================================================== | 93 | ============================================================== |
94 | CHAPTER 2 DEFAULT SETTINGS | 94 | CHAPTER 2 DEFAULT SETTINGS |
@@ -108,9 +108,9 @@ AÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄAÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄAÄÄÄÄÄÄÄÄÄU | |||
108 | CHAPTER 3 DIP SWITCH W1 DESCRIPTION | 108 | CHAPTER 3 DIP SWITCH W1 DESCRIPTION |
109 | ============================================================== | 109 | ============================================================== |
110 | 110 | ||
111 | UÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄ¿ ON | 111 | UÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄ¿ ON |
112 | þ 1 þ 2 þ 3 þ 4 þ 5 þ 6 þ 7 þ 8 þ | 112 | þ 1 þ 2 þ 3 þ 4 þ 5 þ 6 þ 7 þ 8 þ |
113 | AÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄU OFF | 113 | AÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄAÄÄÄU OFF |
114 | |AD | BootROM Addr. | I/O | | 114 | |AD | BootROM Addr. | I/O | |
115 | +-+-+-------+-------+-----+-----+ | 115 | +-+-+-------+-------+-----+-----+ |
116 | | | | | 116 | | | | |
diff --git a/Documentation/networking/udplite.txt b/Documentation/networking/udplite.txt index dd6f46b83dab..6be09ba24a36 100644 --- a/Documentation/networking/udplite.txt +++ b/Documentation/networking/udplite.txt | |||
@@ -139,7 +139,7 @@ | |||
139 | 3) Disabling the Checksum Computation | 139 | 3) Disabling the Checksum Computation |
140 | 140 | ||
141 | On both sender and receiver, checksumming will always be performed | 141 | On both sender and receiver, checksumming will always be performed |
142 | and can not be disabled using SO_NO_CHECK. Thus | 142 | and cannot be disabled using SO_NO_CHECK. Thus |
143 | 143 | ||
144 | setsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, ... ); | 144 | setsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, ... ); |
145 | 145 | ||
diff --git a/Documentation/networking/wan-router.txt b/Documentation/networking/wan-router.txt index 07dd6d9930a1..bc2ab419a74a 100644 --- a/Documentation/networking/wan-router.txt +++ b/Documentation/networking/wan-router.txt | |||
@@ -335,7 +335,7 @@ REVISION HISTORY | |||
335 | creating applications using BiSync | 335 | creating applications using BiSync |
336 | streaming. | 336 | streaming. |
337 | 337 | ||
338 | 2.0.5 Aug 04, 1999 CHDLC initializatin bug fix. | 338 | 2.0.5 Aug 04, 1999 CHDLC initialization bug fix. |
339 | PPP interrupt driven driver: | 339 | PPP interrupt driven driver: |
340 | Fix to the PPP line hangup problem. | 340 | Fix to the PPP line hangup problem. |
341 | New PPP firmware | 341 | New PPP firmware |
@@ -372,7 +372,7 @@ REVISION HISTORY | |||
372 | o cfgft1 GUI csu/dsu configurator | 372 | o cfgft1 GUI csu/dsu configurator |
373 | o wancfg GUI configuration file | 373 | o wancfg GUI configuration file |
374 | configurator. | 374 | configurator. |
375 | o Architectual directory changes. | 375 | o Architectural directory changes. |
376 | 376 | ||
377 | beta-2.1.4 Jul 2000 o Dynamic interface configuration: | 377 | beta-2.1.4 Jul 2000 o Dynamic interface configuration: |
378 | Network interfaces reflect the state | 378 | Network interfaces reflect the state |
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt index ea55ea8bc8ef..7d5b60dea551 100644 --- a/Documentation/oops-tracing.txt +++ b/Documentation/oops-tracing.txt | |||
@@ -234,9 +234,6 @@ characters, each representing a particular tainted value. | |||
234 | 6: 'B' if a page-release function has found a bad page reference or | 234 | 6: 'B' if a page-release function has found a bad page reference or |
235 | some unexpected page flags. | 235 | some unexpected page flags. |
236 | 236 | ||
237 | 7: 'U' if a user specifically requested that the Tainted flag be set, | ||
238 | ' ' otherwise. | ||
239 | |||
240 | 7: 'U' if a user or user application specifically requested that the | 237 | 7: 'U' if a user or user application specifically requested that the |
241 | Tainted flag be set, ' ' otherwise. | 238 | Tainted flag be set, ' ' otherwise. |
242 | 239 | ||
diff --git a/Documentation/pci.txt b/Documentation/pci.txt index cdf2f3c0ab14..d38261b67905 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt | |||
@@ -124,10 +124,6 @@ initialization with a pointer to a structure describing the driver | |||
124 | 124 | ||
125 | err_handler See Documentation/pci-error-recovery.txt | 125 | err_handler See Documentation/pci-error-recovery.txt |
126 | 126 | ||
127 | multithread_probe Enable multi-threaded probe/scan. Driver must | ||
128 | provide its own locking/syncronization for init | ||
129 | operations if this is enabled. | ||
130 | |||
131 | 127 | ||
132 | The ID table is an array of struct pci_device_id entries ending with an | 128 | The ID table is an array of struct pci_device_id entries ending with an |
133 | all-zero entry. Each entry consists of: | 129 | all-zero entry. Each entry consists of: |
@@ -163,9 +159,9 @@ echo "vendor device subvendor subdevice class class_mask driver_data" > \ | |||
163 | /sys/bus/pci/drivers/{driver}/new_id | 159 | /sys/bus/pci/drivers/{driver}/new_id |
164 | 160 | ||
165 | All fields are passed in as hexadecimal values (no leading 0x). | 161 | All fields are passed in as hexadecimal values (no leading 0x). |
166 | Users need pass only as many fields as necessary: | 162 | The vendor and device fields are mandatory, the others are optional. Users |
167 | o vendor, device, subvendor, and subdevice fields default | 163 | need pass only as many optional fields as necessary: |
168 | to PCI_ANY_ID (FFFFFFFF), | 164 | o subvendor and subdevice fields default to PCI_ANY_ID (FFFFFFFF) |
169 | o class and classmask fields default to 0 | 165 | o class and classmask fields default to 0 |
170 | o driver_data defaults to 0UL. | 166 | o driver_data defaults to 0UL. |
171 | 167 | ||
@@ -377,7 +373,7 @@ E.g. clearing pending interrupts. | |||
377 | 373 | ||
378 | 3.6 Register IRQ handler | 374 | 3.6 Register IRQ handler |
379 | ~~~~~~~~~~~~~~~~~~~~~~~~ | 375 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
380 | While calling request_irq() is the the last step described here, | 376 | While calling request_irq() is the last step described here, |
381 | this is often just another intermediate step to initialize a device. | 377 | this is often just another intermediate step to initialize a device. |
382 | This step can often be deferred until the device is opened for use. | 378 | This step can often be deferred until the device is opened for use. |
383 | 379 | ||
@@ -549,8 +545,6 @@ pci_find_slot() Find pci_dev corresponding to given bus and | |||
549 | pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3) | 545 | pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3) |
550 | pci_find_capability() Find specified capability in device's capability | 546 | pci_find_capability() Find specified capability in device's capability |
551 | list. | 547 | list. |
552 | pci_module_init() Inline helper function for ensuring correct | ||
553 | pci_driver initialization and error handling. | ||
554 | pci_resource_start() Returns bus start address for a given PCI region | 548 | pci_resource_start() Returns bus start address for a given PCI region |
555 | pci_resource_end() Returns bus end address for a given PCI region | 549 | pci_resource_end() Returns bus end address for a given PCI region |
556 | pci_resource_len() Returns the byte length of a PCI region | 550 | pci_resource_len() Returns the byte length of a PCI region |
diff --git a/Documentation/pcieaer-howto.txt b/Documentation/pcieaer-howto.txt index 16c251230c82..d5da86170106 100644 --- a/Documentation/pcieaer-howto.txt +++ b/Documentation/pcieaer-howto.txt | |||
@@ -13,7 +13,7 @@ Reporting (AER) driver and provides information on how to use it, as | |||
13 | well as how to enable the drivers of endpoint devices to conform with | 13 | well as how to enable the drivers of endpoint devices to conform with |
14 | PCI Express AER driver. | 14 | PCI Express AER driver. |
15 | 15 | ||
16 | 1.2 Copyright © Intel Corporation 2006. | 16 | 1.2 Copyright © Intel Corporation 2006. |
17 | 17 | ||
18 | 1.3 What is the PCI Express AER Driver? | 18 | 1.3 What is the PCI Express AER Driver? |
19 | 19 | ||
diff --git a/Documentation/pcmcia/driver.txt b/Documentation/pcmcia/driver.txt new file mode 100644 index 000000000000..0ac167920778 --- /dev/null +++ b/Documentation/pcmcia/driver.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | PCMCIA Driver | ||
2 | ------------- | ||
3 | |||
4 | |||
5 | sysfs | ||
6 | ----- | ||
7 | |||
8 | New PCMCIA IDs may be added to a device driver pcmcia_device_id table at | ||
9 | runtime as shown below: | ||
10 | |||
11 | echo "match_flags manf_id card_id func_id function device_no \ | ||
12 | prod_id_hash[0] prod_id_hash[1] prod_id_hash[2] prod_id_hash[3]" > \ | ||
13 | /sys/bus/pcmcia/drivers/{driver}/new_id | ||
14 | |||
15 | All fields are passed in as hexadecimal values (no leading 0x). | ||
16 | The meaning is described in the PCMCIA specification, the match_flags is | ||
17 | a bitwise or-ed combination from PCMCIA_DEV_ID_MATCH_* constants | ||
18 | defined in include/linux/mod_devicetable.h. | ||
19 | |||
20 | Once added, the driver probe routine will be invoked for any unclaimed | ||
21 | PCMCIA device listed in its (newly updated) pcmcia_device_id list. | ||
22 | |||
23 | A common use-case is to add a new device according to the manufacturer ID | ||
24 | and the card ID (form the manf_id and card_id file in the device tree). | ||
25 | For this, just use: | ||
26 | |||
27 | echo "0x3 manf_id card_id 0 0 0 0 0 0 0" > \ | ||
28 | /sys/bus/pcmcia/drivers/{driver}/new_id | ||
29 | |||
30 | after loading the driver. | ||
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt index 28037aa1846c..481faf515d53 100644 --- a/Documentation/pnp.txt +++ b/Documentation/pnp.txt | |||
@@ -140,7 +140,7 @@ Plug and Play but it is planned to be in the near future. | |||
140 | Requirements for a Linux PnP protocol: | 140 | Requirements for a Linux PnP protocol: |
141 | 1.) the protocol must use EISA IDs | 141 | 1.) the protocol must use EISA IDs |
142 | 2.) the protocol must inform the PnP Layer of a devices current configuration | 142 | 2.) the protocol must inform the PnP Layer of a devices current configuration |
143 | - the ability to set resources is optional but prefered. | 143 | - the ability to set resources is optional but preferred. |
144 | 144 | ||
145 | The following are PnP protocol related functions: | 145 | The following are PnP protocol related functions: |
146 | 146 | ||
diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt new file mode 100644 index 000000000000..1a85e2b964dc --- /dev/null +++ b/Documentation/power/basic-pm-debugging.txt | |||
@@ -0,0 +1,106 @@ | |||
1 | Debugging suspend and resume | ||
2 | (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL | ||
3 | |||
4 | 1. Testing suspend to disk (STD) | ||
5 | |||
6 | To verify that the STD works, you can try to suspend in the "reboot" mode: | ||
7 | |||
8 | # echo reboot > /sys/power/disk | ||
9 | # echo disk > /sys/power/state | ||
10 | |||
11 | and the system should suspend, reboot, resume and get back to the command prompt | ||
12 | where you have started the transition. If that happens, the STD is most likely | ||
13 | to work correctly, but you need to repeat the test at least a couple of times in | ||
14 | a row for confidence. This is necessary, because some problems only show up on | ||
15 | a second attempt at suspending and resuming the system. You should also test | ||
16 | the "platform" and "shutdown" modes of suspend: | ||
17 | |||
18 | # echo platform > /sys/power/disk | ||
19 | # echo disk > /sys/power/state | ||
20 | |||
21 | or | ||
22 | |||
23 | # echo shutdown > /sys/power/disk | ||
24 | # echo disk > /sys/power/state | ||
25 | |||
26 | in which cases you will have to press the power button to make the system | ||
27 | resume. If that does not work, you will need to identify what goes wrong. | ||
28 | |||
29 | a) Test mode of STD | ||
30 | |||
31 | To verify if there are any drivers that cause problems you can run the STD | ||
32 | in the test mode: | ||
33 | |||
34 | # echo test > /sys/power/disk | ||
35 | # echo disk > /sys/power/state | ||
36 | |||
37 | in which case the system should freeze tasks, suspend devices, disable nonboot | ||
38 | CPUs (if any), wait for 5 seconds, enable nonboot CPUs, resume devices, thaw | ||
39 | tasks and return to your command prompt. If that fails, most likely there is | ||
40 | a driver that fails to either suspend or resume (in the latter case the system | ||
41 | may hang or be unstable after the test, so please take that into consideration). | ||
42 | To find this driver, you can carry out a binary search according to the rules: | ||
43 | - if the test fails, unload a half of the drivers currently loaded and repeat | ||
44 | (that would probably involve rebooting the system, so always note what drivers | ||
45 | have been loaded before the test), | ||
46 | - if the test succeeds, load a half of the drivers you have unloaded most | ||
47 | recently and repeat. | ||
48 | |||
49 | Once you have found the failing driver (there can be more than just one of | ||
50 | them), you have to unload it every time before the STD transition. In that case | ||
51 | please make sure to report the problem with the driver. | ||
52 | |||
53 | It is also possible that a cycle can still fail after you have unloaded | ||
54 | all modules. In that case, you would want to look in your kernel configuration | ||
55 | for the drivers that can be compiled as modules (testing again with them as | ||
56 | modules), and possibly also try boot time options such as "noapic" or "noacpi". | ||
57 | |||
58 | b) Testing minimal configuration | ||
59 | |||
60 | If the test mode of STD works, you can boot the system with "init=/bin/bash" | ||
61 | and attempt to suspend in the "reboot", "shutdown" and "platform" modes. If | ||
62 | that does not work, there probably is a problem with a driver statically | ||
63 | compiled into the kernel and you can try to compile more drivers as modules, | ||
64 | so that they can be tested individually. Otherwise, there is a problem with a | ||
65 | modular driver and you can find it by loading a half of the modules you normally | ||
66 | use and binary searching in accordance with the algorithm: | ||
67 | - if there are n modules loaded and the attempt to suspend and resume fails, | ||
68 | unload n/2 of the modules and try again (that would probably involve rebooting | ||
69 | the system), | ||
70 | - if there are n modules loaded and the attempt to suspend and resume succeeds, | ||
71 | load n/2 modules more and try again. | ||
72 | |||
73 | Again, if you find the offending module(s), it(they) must be unloaded every time | ||
74 | before the STD transition, and please report the problem with it(them). | ||
75 | |||
76 | c) Advanced debugging | ||
77 | |||
78 | In case the STD does not work on your system even in the minimal configuration | ||
79 | and compiling more drivers as modules is not practical or some modules cannot | ||
80 | be unloaded, you can use one of the more advanced debugging techniques to find | ||
81 | the problem. First, if there is a serial port in your box, you can set the | ||
82 | CONFIG_DISABLE_CONSOLE_SUSPEND kernel configuration option and try to log kernel | ||
83 | messages using the serial console. This may provide you with some information | ||
84 | about the reasons of the suspend (resume) failure. Alternatively, it may be | ||
85 | possible to use a FireWire port for debugging with firescope | ||
86 | (ftp://ftp.firstfloor.org/pub/ak/firescope/). On i386 it is also possible to | ||
87 | use the PM_TRACE mechanism documented in Documentation/s2ram.txt . | ||
88 | |||
89 | 2. Testing suspend to RAM (STR) | ||
90 | |||
91 | To verify that the STR works, it is generally more convenient to use the s2ram | ||
92 | tool available from http://suspend.sf.net and documented at | ||
93 | http://en.opensuse.org/s2ram . However, before doing that it is recommended to | ||
94 | carry out the procedure described in section 1. | ||
95 | |||
96 | Assume you have resolved the problems with the STD and you have found some | ||
97 | failing drivers. These drivers are also likely to fail during the STR or | ||
98 | during the resume, so it is better to unload them every time before the STR | ||
99 | transition. Now, you can follow the instructions at | ||
100 | http://en.opensuse.org/s2ram to test the system, but if it does not work | ||
101 | "out of the box", you may need to boot it with "init=/bin/bash" and test | ||
102 | s2ram in the minimal configuration. In that case, you may be able to search | ||
103 | for failing drivers by following the procedure analogous to the one described in | ||
104 | 1b). If you find some failing drivers, you will have to unload them every time | ||
105 | before the STR transition (ie. before you run s2ram), and please report the | ||
106 | problems with them. | ||
diff --git a/Documentation/power/drivers-testing.txt b/Documentation/power/drivers-testing.txt new file mode 100644 index 000000000000..33016c2f18dd --- /dev/null +++ b/Documentation/power/drivers-testing.txt | |||
@@ -0,0 +1,42 @@ | |||
1 | Testing suspend and resume support in device drivers | ||
2 | (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL | ||
3 | |||
4 | 1. Preparing the test system | ||
5 | |||
6 | Unfortunately, to effectively test the support for the system-wide suspend and | ||
7 | resume transitions in a driver, it is necessary to suspend and resume a fully | ||
8 | functional system with this driver loaded. Moreover, that should be done | ||
9 | several times, preferably several times in a row, and separately for the suspend | ||
10 | to disk (STD) and the suspend to RAM (STR) transitions, because each of these | ||
11 | cases involves different ordering of operations and different interactions with | ||
12 | the machine's BIOS. | ||
13 | |||
14 | Of course, for this purpose the test system has to be known to suspend and | ||
15 | resume without the driver being tested. Thus, if possible, you should first | ||
16 | resolve all suspend/resume-related problems in the test system before you start | ||
17 | testing the new driver. Please see Documents/power/basic-pm-debugging.txt for | ||
18 | more information about the debugging of suspend/resume functionality. | ||
19 | |||
20 | 2. Testing the driver | ||
21 | |||
22 | Once you have resolved the suspend/resume-related problems with your test system | ||
23 | without the new driver, you are ready to test it: | ||
24 | |||
25 | a) Build the driver as a module, load it and try the STD in the test mode (see: | ||
26 | Documents/power/basic-pm-debugging.txt, 1a)). | ||
27 | |||
28 | b) Load the driver and attempt to suspend to disk in the "reboot", "shutdown" | ||
29 | and "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1). | ||
30 | |||
31 | c) Compile the driver directly into the kernel and try the STD in the test mode. | ||
32 | |||
33 | d) Attempt to suspend to disk with the driver compiled directly into the kernel | ||
34 | in the "reboot", "shutdown" and "platform" modes. | ||
35 | |||
36 | e) Attempt to suspend to RAM using the s2ram tool with the driver loaded (see: | ||
37 | Documents/power/basic-pm-debugging.txt, 2). As far as the STR tests are | ||
38 | concerned, it should not matter whether or not the driver is built as a module. | ||
39 | |||
40 | Each of the above tests should be repeated several times and the STD tests | ||
41 | should be mixed with the STR tests. If any of them fails, the driver cannot be | ||
42 | regarded as suspend/resume-safe. | ||
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index 8c5b41bf3f36..fd5192a8fa8a 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt | |||
@@ -34,8 +34,12 @@ for 5 seconds, resume devices, unfreeze tasks and enable nonboot CPUs. Then, | |||
34 | we are able to look in the log messages and work out, for example, which code | 34 | we are able to look in the log messages and work out, for example, which code |
35 | is being slow and which device drivers are misbehaving. | 35 | is being slow and which device drivers are misbehaving. |
36 | 36 | ||
37 | Reading from this file will display what the mode is currently set | 37 | Reading from this file will display all supported modes and the currently |
38 | to. Writing to this file will accept one of | 38 | selected one in brackets, for example |
39 | |||
40 | [shutdown] reboot test testproc | ||
41 | |||
42 | Writing to this file will accept one of | ||
39 | 43 | ||
40 | 'platform' (only if the platform supports it) | 44 | 'platform' (only if the platform supports it) |
41 | 'shutdown' | 45 | 'shutdown' |
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index b6a3cbf7e846..e00b099a4b86 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt | |||
@@ -203,7 +203,7 @@ resume | |||
203 | 203 | ||
204 | Usage: | 204 | Usage: |
205 | 205 | ||
206 | if (dev->driver && dev->driver->suspend) | 206 | if (dev->driver && dev->driver->resume) |
207 | dev->driver->resume(dev) | 207 | dev->driver->resume(dev) |
208 | 208 | ||
209 | The resume callback may be called from any power state, and is always meant to | 209 | The resume callback may be called from any power state, and is always meant to |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index c55bd5079b90..5b8d6953f05e 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -48,7 +48,7 @@ before suspend (it is limited to 500 MB by default). | |||
48 | 48 | ||
49 | Article about goals and implementation of Software Suspend for Linux | 49 | Article about goals and implementation of Software Suspend for Linux |
50 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 50 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
51 | Author: G‚ábor Kuti | 51 | Author: G‚ábor Kuti |
52 | Last revised: 2003-10-20 by Pavel Machek | 52 | Last revised: 2003-10-20 by Pavel Machek |
53 | 53 | ||
54 | Idea and goals to achieve | 54 | Idea and goals to achieve |
diff --git a/Documentation/power/userland-swsusp.txt b/Documentation/power/userland-swsusp.txt index 000556c932e9..e00c6cf09e85 100644 --- a/Documentation/power/userland-swsusp.txt +++ b/Documentation/power/userland-swsusp.txt | |||
@@ -93,21 +93,23 @@ SNAPSHOT_S2RAM - suspend to RAM; using this call causes the kernel to | |||
93 | to resume the system from RAM if there's enough battery power or restore | 93 | to resume the system from RAM if there's enough battery power or restore |
94 | its state on the basis of the saved suspend image otherwise) | 94 | its state on the basis of the saved suspend image otherwise) |
95 | 95 | ||
96 | SNAPSHOT_PMOPS - enable the usage of the pmops->prepare, pmops->enter and | 96 | SNAPSHOT_PMOPS - enable the usage of the hibernation_ops->prepare, |
97 | pmops->finish methods (the in-kernel swsusp knows these as the "platform | 97 | hibernate_ops->enter and hibernation_ops->finish methods (the in-kernel |
98 | method") which are needed on many machines to (among others) speed up | 98 | swsusp knows these as the "platform method") which are needed on many |
99 | the resume by letting the BIOS skip some steps or to let the system | 99 | machines to (among others) speed up the resume by letting the BIOS skip |
100 | recognise the correct state of the hardware after the resume (in | 100 | some steps or to let the system recognise the correct state of the |
101 | particular on many machines this ensures that unplugged AC | 101 | hardware after the resume (in particular on many machines this ensures |
102 | adapters get correctly detected and that kacpid does not run wild after | 102 | that unplugged AC adapters get correctly detected and that kacpid does |
103 | the resume). The last ioctl() argument can take one of the three | 103 | not run wild after the resume). The last ioctl() argument can take one |
104 | values, defined in kernel/power/power.h: | 104 | of the three values, defined in kernel/power/power.h: |
105 | PMOPS_PREPARE - make the kernel carry out the | 105 | PMOPS_PREPARE - make the kernel carry out the |
106 | pm_ops->prepare(PM_SUSPEND_DISK) operation | 106 | hibernation_ops->prepare() operation |
107 | PMOPS_ENTER - make the kernel power off the system by calling | 107 | PMOPS_ENTER - make the kernel power off the system by calling |
108 | pm_ops->enter(PM_SUSPEND_DISK) | 108 | hibernation_ops->enter() |
109 | PMOPS_FINISH - make the kernel carry out the | 109 | PMOPS_FINISH - make the kernel carry out the |
110 | pm_ops->finish(PM_SUSPEND_DISK) operation | 110 | hibernation_ops->finish() operation |
111 | Note that the actual constants are misnamed because they surface | ||
112 | internal kernel implementation details that have changed. | ||
111 | 113 | ||
112 | The device's read() operation can be used to transfer the snapshot image from | 114 | The device's read() operation can be used to transfer the snapshot image from |
113 | the kernel. It has the following limitations: | 115 | the kernel. It has the following limitations: |
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index 033a3f3b3ab7..b49ce169a63a 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -1444,7 +1444,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1444 | Basically, it is a bus of devices, that could act more or less | 1444 | Basically, it is a bus of devices, that could act more or less |
1445 | as a complete entity (UCC, USB etc ). All of them should be siblings on | 1445 | as a complete entity (UCC, USB etc ). All of them should be siblings on |
1446 | the "root" qe node, using the common properties from there. | 1446 | the "root" qe node, using the common properties from there. |
1447 | The description below applies to the the qe of MPC8360 and | 1447 | The description below applies to the qe of MPC8360 and |
1448 | more nodes and properties would be extended in the future. | 1448 | more nodes and properties would be extended in the future. |
1449 | 1449 | ||
1450 | i) Root QE device | 1450 | i) Root QE device |
@@ -1560,6 +1560,9 @@ platforms are moved over to use the flattened-device-tree model. | |||
1560 | network device. This is used by the bootwrapper to interpret | 1560 | network device. This is used by the bootwrapper to interpret |
1561 | MAC addresses passed by the firmware when no information other | 1561 | MAC addresses passed by the firmware when no information other |
1562 | than indices is available to associate an address with a device. | 1562 | than indices is available to associate an address with a device. |
1563 | - phy-connection-type : a string naming the controller/PHY interface type, | ||
1564 | i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "tbi", | ||
1565 | or "rtbi". | ||
1563 | 1566 | ||
1564 | Example: | 1567 | Example: |
1565 | ucc@2000 { | 1568 | ucc@2000 { |
@@ -1574,6 +1577,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1574 | rx-clock = "none"; | 1577 | rx-clock = "none"; |
1575 | tx-clock = "clk9"; | 1578 | tx-clock = "clk9"; |
1576 | phy-handle = <212000>; | 1579 | phy-handle = <212000>; |
1580 | phy-connection-type = "gmii"; | ||
1577 | pio-handle = <140001>; | 1581 | pio-handle = <140001>; |
1578 | }; | 1582 | }; |
1579 | 1583 | ||
@@ -1629,7 +1633,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1629 | - assignment : function number of the pin according to the Pin Assignment | 1633 | - assignment : function number of the pin according to the Pin Assignment |
1630 | tables in User Manual. Each pin can have up to 4 possible functions in | 1634 | tables in User Manual. Each pin can have up to 4 possible functions in |
1631 | QE and two options for CPM. | 1635 | QE and two options for CPM. |
1632 | - has_irq : indicates if the pin is used as source of exteral | 1636 | - has_irq : indicates if the pin is used as source of external |
1633 | interrupts. | 1637 | interrupts. |
1634 | 1638 | ||
1635 | Example: | 1639 | Example: |
diff --git a/Documentation/rtc.txt b/Documentation/rtc.txt index 1ef6bb88cd00..7c701b88d6d5 100644 --- a/Documentation/rtc.txt +++ b/Documentation/rtc.txt | |||
@@ -147,7 +147,7 @@ RTC class framework, but can't be supported by the older driver. | |||
147 | 147 | ||
148 | * RTC_AIE_ON, RTC_AIE_OFF, RTC_ALM_SET, RTC_ALM_READ ... when the RTC | 148 | * RTC_AIE_ON, RTC_AIE_OFF, RTC_ALM_SET, RTC_ALM_READ ... when the RTC |
149 | is connected to an IRQ line, it can often issue an alarm IRQ up to | 149 | is connected to an IRQ line, it can often issue an alarm IRQ up to |
150 | 24 hours in the future. | 150 | 24 hours in the future. (Use RTC_WKALM_* by preference.) |
151 | 151 | ||
152 | * RTC_WKALM_SET, RTC_WKALM_RD ... RTCs that can issue alarms beyond | 152 | * RTC_WKALM_SET, RTC_WKALM_RD ... RTCs that can issue alarms beyond |
153 | the next 24 hours use a slightly more powerful API, which supports | 153 | the next 24 hours use a slightly more powerful API, which supports |
@@ -175,10 +175,7 @@ driver returns ENOIOCTLCMD. Some common examples: | |||
175 | called with appropriate values. | 175 | called with appropriate values. |
176 | 176 | ||
177 | * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the | 177 | * RTC_ALM_SET, RTC_ALM_READ, RTC_WKALM_SET, RTC_WKALM_RD: the |
178 | set_alarm/read_alarm functions will be called. To differentiate | 178 | set_alarm/read_alarm functions will be called. |
179 | between the ALM and WKALM, check the larger fields of the rtc_wkalrm | ||
180 | struct (like tm_year). These will be set to -1 when using ALM and | ||
181 | will be set to proper values when using WKALM. | ||
182 | 179 | ||
183 | * RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called | 180 | * RTC_IRQP_SET, RTC_IRQP_READ: the irq_set_freq function will be called |
184 | to set the frequency while the framework will handle the read for you | 181 | to set the frequency while the framework will handle the read for you |
diff --git a/Documentation/s390/Debugging390.txt b/Documentation/s390/Debugging390.txt index 0993969609cf..d30a281c570f 100644 --- a/Documentation/s390/Debugging390.txt +++ b/Documentation/s390/Debugging390.txt | |||
@@ -2209,7 +2209,7 @@ Breakpoint 2 at 0x4d87a4: file top.c, line 2609. | |||
2209 | #3 0x5167e6 in readline_internal_char () at readline.c:454 | 2209 | #3 0x5167e6 in readline_internal_char () at readline.c:454 |
2210 | #4 0x5168ee in readline_internal_charloop () at readline.c:507 | 2210 | #4 0x5168ee in readline_internal_charloop () at readline.c:507 |
2211 | #5 0x51692c in readline_internal () at readline.c:521 | 2211 | #5 0x51692c in readline_internal () at readline.c:521 |
2212 | #6 0x5164fe in readline (prompt=0x7ffff810 "\177ÿøx\177ÿ÷Ø\177ÿøxÀ") | 2212 | #6 0x5164fe in readline (prompt=0x7ffff810 "\177ÂÿÂøx\177ÂÿÂ÷ÂØ\177ÂÿÂøxÂÀ") |
2213 | at readline.c:349 | 2213 | at readline.c:349 |
2214 | #7 0x4d7a8a in command_line_input (prrompt=0x564420 "(gdb) ", repeat=1, | 2214 | #7 0x4d7a8a in command_line_input (prrompt=0x564420 "(gdb) ", repeat=1, |
2215 | annotation_suffix=0x4d6b44 "prompt") at top.c:2091 | 2215 | annotation_suffix=0x4d6b44 "prompt") at top.c:2091 |
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt index dc8e44fc650f..ce3cb42507bd 100644 --- a/Documentation/scsi/aacraid.txt +++ b/Documentation/scsi/aacraid.txt | |||
@@ -37,7 +37,11 @@ Supported Cards/Chipsets | |||
37 | 9005:0286:9005:029d Adaptec 2420SA (Intruder HP release) | 37 | 9005:0286:9005:029d Adaptec 2420SA (Intruder HP release) |
38 | 9005:0286:9005:02ac Adaptec 1800 (Typhoon44) | 38 | 9005:0286:9005:02ac Adaptec 1800 (Typhoon44) |
39 | 9005:0285:9005:02b5 Adaptec 5445 (Voodoo44) | 39 | 9005:0285:9005:02b5 Adaptec 5445 (Voodoo44) |
40 | 9005:0285:15d9:02b5 SMC AOC-USAS-S4i | ||
41 | 9005:0285:15d9:02c9 SMC AOC-USAS-S4iR | ||
40 | 9005:0285:9005:02b6 Adaptec 5805 (Voodoo80) | 42 | 9005:0285:9005:02b6 Adaptec 5805 (Voodoo80) |
43 | 9005:0285:15d9:02b6 SMC AOC-USAS-S8i | ||
44 | 9005:0285:15d9:02ca SMC AOC-USAS-S8iR | ||
41 | 9005:0285:9005:02b7 Adaptec 5085 (Voodoo08) | 45 | 9005:0285:9005:02b7 Adaptec 5085 (Voodoo08) |
42 | 9005:0285:9005:02bb Adaptec 3405 (Marauder40LP) | 46 | 9005:0285:9005:02bb Adaptec 3405 (Marauder40LP) |
43 | 9005:0285:9005:02bc Adaptec 3805 (Marauder80LP) | 47 | 9005:0285:9005:02bc Adaptec 3805 (Marauder80LP) |
@@ -93,6 +97,9 @@ Supported Cards/Chipsets | |||
93 | 9005:0286:9005:02ae (Aurora Lite ARK) | 97 | 9005:0286:9005:02ae (Aurora Lite ARK) |
94 | 9005:0285:9005:02b0 (Sunrise Lake ARK) | 98 | 9005:0285:9005:02b0 (Sunrise Lake ARK) |
95 | 9005:0285:9005:02b1 Adaptec (Voodoo 8 internal 8 external) | 99 | 9005:0285:9005:02b1 Adaptec (Voodoo 8 internal 8 external) |
100 | 9005:0285:108e:7aac SUN STK RAID REM (Voodoo44 Coyote) | ||
101 | 9005:0285:108e:0286 SUN STK RAID INT (Cougar) | ||
102 | 9005:0285:108e:0287 SUN STK RAID EXT (Prometheus) | ||
96 | 103 | ||
97 | People | 104 | People |
98 | ------------------------- | 105 | ------------------------- |
diff --git a/Documentation/scsi/aha152x.txt b/Documentation/scsi/aha152x.txt index 2ce022cec9be..29ce6d87e451 100644 --- a/Documentation/scsi/aha152x.txt +++ b/Documentation/scsi/aha152x.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | $Id: README.aha152x,v 1.2 1999/12/25 15:32:30 fischer Exp fischer $ | 1 | $Id: README.aha152x,v 1.2 1999/12/25 15:32:30 fischer Exp fischer $ |
2 | Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x) | 2 | Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x) |
3 | 3 | ||
4 | Copyright 1993-1999 Jürgen Fischer <fischer@norbit.de> | 4 | Copyright 1993-1999 Jürgen Fischer <fischer@norbit.de> |
5 | TC1550 patches by Luuk van Dijk (ldz@xs4all.nl) | 5 | TC1550 patches by Luuk van Dijk (ldz@xs4all.nl) |
6 | 6 | ||
7 | 7 | ||
diff --git a/Documentation/scsi/aic7xxx.txt b/Documentation/scsi/aic7xxx.txt index 9b894f116d95..5f34d2ba69b4 100644 --- a/Documentation/scsi/aic7xxx.txt +++ b/Documentation/scsi/aic7xxx.txt | |||
@@ -40,7 +40,7 @@ The following information is available in this file: | |||
40 | 2. Multi-function Twin Channel Device - Two controllers on one chip. | 40 | 2. Multi-function Twin Channel Device - Two controllers on one chip. |
41 | 3. Command Channel Secondary DMA Engine - Allows scatter gather list | 41 | 3. Command Channel Secondary DMA Engine - Allows scatter gather list |
42 | and SCB prefetch. | 42 | and SCB prefetch. |
43 | 4. 64 Byte SCB Support - Allows disconnected, unttagged request table | 43 | 4. 64 Byte SCB Support - Allows disconnected, untagged request table |
44 | for all possible target/lun combinations. | 44 | for all possible target/lun combinations. |
45 | 5. Block Move Instruction Support - Doubles the speed of certain | 45 | 5. Block Move Instruction Support - Doubles the speed of certain |
46 | sequencer operations. | 46 | sequencer operations. |
diff --git a/Documentation/scsi/aic7xxx_old.txt b/Documentation/scsi/aic7xxx_old.txt index 05667e7308d4..7bd210ab45a1 100644 --- a/Documentation/scsi/aic7xxx_old.txt +++ b/Documentation/scsi/aic7xxx_old.txt | |||
@@ -356,7 +356,7 @@ linux-1.1.x and fairly stable since linux-1.2.x, and are also in FreeBSD | |||
356 | or enable Tagged Command Queueing (TCQ) on specific devices. As of | 356 | or enable Tagged Command Queueing (TCQ) on specific devices. As of |
357 | driver version 5.1.11, TCQ is now either on or off by default | 357 | driver version 5.1.11, TCQ is now either on or off by default |
358 | according to the setting you choose during the make config process. | 358 | according to the setting you choose during the make config process. |
359 | In order to en/disable TCQ for certian devices at boot time, a user | 359 | In order to en/disable TCQ for certain devices at boot time, a user |
360 | may use this boot param. The driver will then parse this message out | 360 | may use this boot param. The driver will then parse this message out |
361 | and en/disable the specific device entries that are present based upon | 361 | and en/disable the specific device entries that are present based upon |
362 | the value given. The param line is parsed in the following manner: | 362 | the value given. The param line is parsed in the following manner: |
diff --git a/Documentation/scsi/ncr53c8xx.txt b/Documentation/scsi/ncr53c8xx.txt index caf10b155185..39d409a8efe5 100644 --- a/Documentation/scsi/ncr53c8xx.txt +++ b/Documentation/scsi/ncr53c8xx.txt | |||
@@ -562,11 +562,6 @@ if only one has a flaw for some SCSI feature, you can disable the | |||
562 | support by the driver of this feature at linux start-up and enable | 562 | support by the driver of this feature at linux start-up and enable |
563 | this feature after boot-up only for devices that support it safely. | 563 | this feature after boot-up only for devices that support it safely. |
564 | 564 | ||
565 | CONFIG_SCSI_NCR53C8XX_PROFILE_SUPPORT (default answer: n) | ||
566 | This option must be set for profiling information to be gathered | ||
567 | and printed out through the proc file system. This features may | ||
568 | impact performances. | ||
569 | |||
570 | CONFIG_SCSI_NCR53C8XX_IOMAPPED (default answer: n) | 565 | CONFIG_SCSI_NCR53C8XX_IOMAPPED (default answer: n) |
571 | Answer "y" if you suspect your mother board to not allow memory mapped I/O. | 566 | Answer "y" if you suspect your mother board to not allow memory mapped I/O. |
572 | May slow down performance a little. This option is required by | 567 | May slow down performance a little. This option is required by |
@@ -1265,7 +1260,7 @@ then the request of the IRQ obviously will not succeed for all the drivers. | |||
1265 | 15.1 Problem tracking | 1260 | 15.1 Problem tracking |
1266 | 1261 | ||
1267 | Most SCSI problems are due to a non conformant SCSI bus or to buggy | 1262 | Most SCSI problems are due to a non conformant SCSI bus or to buggy |
1268 | devices. If infortunately you have SCSI problems, you can check the | 1263 | devices. If unfortunately you have SCSI problems, you can check the |
1269 | following things: | 1264 | following things: |
1270 | 1265 | ||
1271 | - SCSI bus cables | 1266 | - SCSI bus cables |
diff --git a/Documentation/scsi/st.txt b/Documentation/scsi/st.txt index 3c12422f7f41..b7be95b5bd24 100644 --- a/Documentation/scsi/st.txt +++ b/Documentation/scsi/st.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | This file contains brief information about the SCSI tape driver. | 1 | This file contains brief information about the SCSI tape driver. |
2 | The driver is currently maintained by Kai Mäkisara (email | 2 | The driver is currently maintained by Kai Mäkisara (email |
3 | Kai.Makisara@kolumbus.fi) | 3 | Kai.Makisara@kolumbus.fi) |
4 | 4 | ||
5 | Last modified: Mon Mar 7 21:14:44 2005 by kai.makisara | 5 | Last modified: Mon Mar 7 21:14:44 2005 by kai.makisara |
diff --git a/Documentation/scsi/sym53c8xx_2.txt b/Documentation/scsi/sym53c8xx_2.txt index 2c1745a9df00..3d9f06bb3d00 100644 --- a/Documentation/scsi/sym53c8xx_2.txt +++ b/Documentation/scsi/sym53c8xx_2.txt | |||
@@ -587,7 +587,7 @@ devices, ... may cause a SCSI signal to be wrong when te driver reads it. | |||
587 | 15.1 Problem tracking | 587 | 15.1 Problem tracking |
588 | 588 | ||
589 | Most SCSI problems are due to a non conformant SCSI bus or too buggy | 589 | Most SCSI problems are due to a non conformant SCSI bus or too buggy |
590 | devices. If infortunately you have SCSI problems, you can check the | 590 | devices. If unfortunately you have SCSI problems, you can check the |
591 | following things: | 591 | following things: |
592 | 592 | ||
593 | - SCSI bus cables | 593 | - SCSI bus cables |
diff --git a/Documentation/scsi/tmscsim.txt b/Documentation/scsi/tmscsim.txt index 8b2168aa4fc7..61c0531e044a 100644 --- a/Documentation/scsi/tmscsim.txt +++ b/Documentation/scsi/tmscsim.txt | |||
@@ -426,7 +426,7 @@ Thanks to Linus Torvalds, Alan Cox, the FSF people, the XFree86 team and | |||
426 | all the others for the wonderful OS and software. | 426 | all the others for the wonderful OS and software. |
427 | Thanks to C.L. Huang and Philip Giang (Tekram) for the initial driver | 427 | Thanks to C.L. Huang and Philip Giang (Tekram) for the initial driver |
428 | release and support. | 428 | release and support. |
429 | Thanks to Doug Ledford, Gérard Roudier for support with SCSI coding. | 429 | Thanks to Doug Ledford, Gérard Roudier for support with SCSI coding. |
430 | Thanks to a lot of people (espec. Chiaki Ishikawa, Andreas Haumer, Hubert | 430 | Thanks to a lot of people (espec. Chiaki Ishikawa, Andreas Haumer, Hubert |
431 | Tonneau) for intensively testing the driver (and even risking data loss | 431 | Tonneau) for intensively testing the driver (and even risking data loss |
432 | doing this during early revisions). | 432 | doing this during early revisions). |
diff --git a/Documentation/sh/clk.txt b/Documentation/sh/clk.txt new file mode 100644 index 000000000000..9aef710e9a4b --- /dev/null +++ b/Documentation/sh/clk.txt | |||
@@ -0,0 +1,32 @@ | |||
1 | Clock framework on SuperH architecture | ||
2 | |||
3 | The framework on SH extends existing API by the function clk_set_rate_ex, | ||
4 | which prototype is as follows: | ||
5 | |||
6 | clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id) | ||
7 | |||
8 | The algo_id parameter is used to specify algorithm used to recalculate clocks, | ||
9 | adjanced to clock, specified as first argument. It is assumed that algo_id==0 | ||
10 | means no changes to adjanced clock | ||
11 | |||
12 | Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, | ||
13 | if it is present in ops structure. The method should set the clock rate and adjust | ||
14 | all needed clocks according to the passed algo_id. | ||
15 | Exact values for algo_id are machine-dependend. For the sh7722, the following | ||
16 | values are defined: | ||
17 | |||
18 | NO_CHANGE = 0, | ||
19 | IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */ | ||
20 | IUS_322, /* I:U:Sh = 3:2:2 */ | ||
21 | IUS_522, /* I:U:Sh = 5:2:2 */ | ||
22 | IUS_N11, /* I:U:Sh = N:1:1 */ | ||
23 | SB_N1, /* Sh:B = N:1 */ | ||
24 | SB3_N1, /* Sh:B3 = N:1 */ | ||
25 | SB3_32, /* Sh:B3 = 3:2 */ | ||
26 | SB3_43, /* Sh:B3 = 4:3 */ | ||
27 | SB3_54, /* Sh:B3 = 5:4 */ | ||
28 | BP_N1, /* B:P = N:1 */ | ||
29 | IP_N1 /* I:P = N:1 */ | ||
30 | |||
31 | Each of these constants means relation between clocks that can be set via the FRQCR | ||
32 | register | ||
diff --git a/Documentation/sonypi.txt b/Documentation/sonypi.txt index c1237a925505..4857acfc50f1 100644 --- a/Documentation/sonypi.txt +++ b/Documentation/sonypi.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Sony Programmable I/O Control Device Driver Readme | 1 | Sony Programmable I/O Control Device Driver Readme |
2 | -------------------------------------------------- | 2 | -------------------------------------------------- |
3 | Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> | 3 | Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> |
4 | Copyright (C) 2001-2002 Alcôve <www.alcove.com> | 4 | Copyright (C) 2001-2002 Alcôve <www.alcove.com> |
5 | Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> | 5 | Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> |
6 | Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp> | 6 | Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp> |
7 | Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp> | 7 | Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp> |
diff --git a/Documentation/sound/oss/mwave b/Documentation/sound/oss/mwave index 858334bb46b0..5fbcb1609275 100644 --- a/Documentation/sound/oss/mwave +++ b/Documentation/sound/oss/mwave | |||
@@ -163,7 +163,7 @@ OR the Default= line COULD be | |||
163 | Default=SBPRO | 163 | Default=SBPRO |
164 | 164 | ||
165 | Reboot to Windows 95 and choose Linux. When booted, use sndconfig to configure | 165 | Reboot to Windows 95 and choose Linux. When booted, use sndconfig to configure |
166 | the sound modules and voilà - ThinkPad sound with Linux. | 166 | the sound modules and voilà - ThinkPad sound with Linux. |
167 | 167 | ||
168 | Now the gotchas - you can either have CD sound OR Mixers but not both. That's a | 168 | Now the gotchas - you can either have CD sound OR Mixers but not both. That's a |
169 | problem with the SB1.5 (CD sound) or SBPRO (Mixers) settings. No one knows why | 169 | problem with the SB1.5 (CD sound) or SBPRO (Mixers) settings. No one knows why |
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx index f9717fe9bd85..215e3b8e7266 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx | |||
@@ -62,7 +62,7 @@ static struct resource pxa_spi_nssp_resources[] = { | |||
62 | 62 | ||
63 | static struct pxa2xx_spi_master pxa_nssp_master_info = { | 63 | static struct pxa2xx_spi_master pxa_nssp_master_info = { |
64 | .ssp_type = PXA25x_NSSP, /* Type of SSP */ | 64 | .ssp_type = PXA25x_NSSP, /* Type of SSP */ |
65 | .clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */ | 65 | .clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */ |
66 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ | 66 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ |
67 | .enable_dma = 1, /* Enables NSSP DMA */ | 67 | .enable_dma = 1, /* Enables NSSP DMA */ |
68 | }; | 68 | }; |
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index ecc7c9eb9f29..795fbb48ffa7 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -8,7 +8,7 @@ What is SPI? | |||
8 | The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial | 8 | The "Serial Peripheral Interface" (SPI) is a synchronous four wire serial |
9 | link used to connect microcontrollers to sensors, memory, and peripherals. | 9 | link used to connect microcontrollers to sensors, memory, and peripherals. |
10 | 10 | ||
11 | The three signal wires hold a clock (SCLK, often on the order of 10 MHz), | 11 | The three signal wires hold a clock (SCK, often on the order of 10 MHz), |
12 | and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In, | 12 | and parallel data lines with "Master Out, Slave In" (MOSI) or "Master In, |
13 | Slave Out" (MISO) signals. (Other names are also used.) There are four | 13 | Slave Out" (MISO) signals. (Other names are also used.) There are four |
14 | clocking modes through which data is exchanged; mode-0 and mode-3 are most | 14 | clocking modes through which data is exchanged; mode-0 and mode-3 are most |
@@ -22,7 +22,7 @@ other signals, often including an interrupt to the master. | |||
22 | 22 | ||
23 | Unlike serial busses like USB or SMBUS, even low level protocols for | 23 | Unlike serial busses like USB or SMBUS, even low level protocols for |
24 | SPI slave functions are usually not interoperable between vendors | 24 | SPI slave functions are usually not interoperable between vendors |
25 | (except for cases like SPI memory chips). | 25 | (except for commodities like SPI memory chips). |
26 | 26 | ||
27 | - SPI may be used for request/response style device protocols, as with | 27 | - SPI may be used for request/response style device protocols, as with |
28 | touchscreen sensors and memory chips. | 28 | touchscreen sensors and memory chips. |
@@ -77,8 +77,9 @@ cards without needing a special purpose MMC/SD/SDIO controller. | |||
77 | How do these driver programming interfaces work? | 77 | How do these driver programming interfaces work? |
78 | ------------------------------------------------ | 78 | ------------------------------------------------ |
79 | The <linux/spi/spi.h> header file includes kerneldoc, as does the | 79 | The <linux/spi/spi.h> header file includes kerneldoc, as does the |
80 | main source code, and you should certainly read that. This is just | 80 | main source code, and you should certainly read that chapter of the |
81 | an overview, so you get the big picture before the details. | 81 | kernel API document. This is just an overview, so you get the big |
82 | picture before those details. | ||
82 | 83 | ||
83 | SPI requests always go into I/O queues. Requests for a given SPI device | 84 | SPI requests always go into I/O queues. Requests for a given SPI device |
84 | are always executed in FIFO order, and complete asynchronously through | 85 | are always executed in FIFO order, and complete asynchronously through |
@@ -88,7 +89,7 @@ a command and then reading its response. | |||
88 | 89 | ||
89 | There are two types of SPI driver, here called: | 90 | There are two types of SPI driver, here called: |
90 | 91 | ||
91 | Controller drivers ... these are often built in to System-On-Chip | 92 | Controller drivers ... controllers may be built in to System-On-Chip |
92 | processors, and often support both Master and Slave roles. | 93 | processors, and often support both Master and Slave roles. |
93 | These drivers touch hardware registers and may use DMA. | 94 | These drivers touch hardware registers and may use DMA. |
94 | Or they can be PIO bitbangers, needing just GPIO pins. | 95 | Or they can be PIO bitbangers, needing just GPIO pins. |
@@ -108,18 +109,18 @@ those two types of driver. At this writing, Linux has no slave side | |||
108 | programming interface. | 109 | programming interface. |
109 | 110 | ||
110 | There is a minimal core of SPI programming interfaces, focussing on | 111 | There is a minimal core of SPI programming interfaces, focussing on |
111 | using driver model to connect controller and protocol drivers using | 112 | using the driver model to connect controller and protocol drivers using |
112 | device tables provided by board specific initialization code. SPI | 113 | device tables provided by board specific initialization code. SPI |
113 | shows up in sysfs in several locations: | 114 | shows up in sysfs in several locations: |
114 | 115 | ||
115 | /sys/devices/.../CTLR/spiB.C ... spi_device for on bus "B", | 116 | /sys/devices/.../CTLR/spiB.C ... spi_device on bus "B", |
116 | chipselect C, accessed through CTLR. | 117 | chipselect C, accessed through CTLR. |
117 | 118 | ||
118 | /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver | 119 | /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver |
119 | that should be used with this device (for hotplug/coldplug) | 120 | that should be used with this device (for hotplug/coldplug) |
120 | 121 | ||
121 | /sys/bus/spi/devices/spiB.C ... symlink to the physical | 122 | /sys/bus/spi/devices/spiB.C ... symlink to the physical |
122 | spiB-C device | 123 | spiB.C device |
123 | 124 | ||
124 | /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices | 125 | /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices |
125 | 126 | ||
@@ -240,7 +241,7 @@ The board_info should provide enough information to let the system work | |||
240 | without the chip's driver being loaded. The most troublesome aspect of | 241 | without the chip's driver being loaded. The most troublesome aspect of |
241 | that is likely the SPI_CS_HIGH bit in the spi_device.mode field, since | 242 | that is likely the SPI_CS_HIGH bit in the spi_device.mode field, since |
242 | sharing a bus with a device that interprets chipselect "backwards" is | 243 | sharing a bus with a device that interprets chipselect "backwards" is |
243 | not possible. | 244 | not possible until the infrastructure knows how to deselect it. |
244 | 245 | ||
245 | Then your board initialization code would register that table with the SPI | 246 | Then your board initialization code would register that table with the SPI |
246 | infrastructure, so that it's available later when the SPI master controller | 247 | infrastructure, so that it's available later when the SPI master controller |
@@ -268,16 +269,14 @@ board info based on the board that was hotplugged. Of course, you'd later | |||
268 | call at least spi_unregister_device() when that board is removed. | 269 | call at least spi_unregister_device() when that board is removed. |
269 | 270 | ||
270 | When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those | 271 | When Linux includes support for MMC/SD/SDIO/DataFlash cards through SPI, those |
271 | configurations will also be dynamic. Fortunately, those devices all support | 272 | configurations will also be dynamic. Fortunately, such devices all support |
272 | basic device identification probes, so that support should hotplug normally. | 273 | basic device identification probes, so they should hotplug normally. |
273 | 274 | ||
274 | 275 | ||
275 | How do I write an "SPI Protocol Driver"? | 276 | How do I write an "SPI Protocol Driver"? |
276 | ---------------------------------------- | 277 | ---------------------------------------- |
277 | All SPI drivers are currently kernel drivers. A userspace driver API | 278 | Most SPI drivers are currently kernel drivers, but there's also support |
278 | would just be another kernel driver, probably offering some lowlevel | 279 | for userspace drivers. Here we talk only about kernel drivers. |
279 | access through aio_read(), aio_write(), and ioctl() calls and using the | ||
280 | standard userspace sysfs mechanisms to bind to a given SPI device. | ||
281 | 280 | ||
282 | SPI protocol drivers somewhat resemble platform device drivers: | 281 | SPI protocol drivers somewhat resemble platform device drivers: |
283 | 282 | ||
@@ -319,7 +318,8 @@ might look like this unless you're creating a class_device: | |||
319 | 318 | ||
320 | As soon as it enters probe(), the driver may issue I/O requests to | 319 | As soon as it enters probe(), the driver may issue I/O requests to |
321 | the SPI device using "struct spi_message". When remove() returns, | 320 | the SPI device using "struct spi_message". When remove() returns, |
322 | the driver guarantees that it won't submit any more such messages. | 321 | or after probe() fails, the driver guarantees that it won't submit |
322 | any more such messages. | ||
323 | 323 | ||
324 | - An spi_message is a sequence of protocol operations, executed | 324 | - An spi_message is a sequence of protocol operations, executed |
325 | as one atomic sequence. SPI driver controls include: | 325 | as one atomic sequence. SPI driver controls include: |
@@ -368,7 +368,8 @@ the driver guarantees that it won't submit any more such messages. | |||
368 | Some drivers may need to modify spi_device characteristics like the | 368 | Some drivers may need to modify spi_device characteristics like the |
369 | transfer mode, wordsize, or clock rate. This is done with spi_setup(), | 369 | transfer mode, wordsize, or clock rate. This is done with spi_setup(), |
370 | which would normally be called from probe() before the first I/O is | 370 | which would normally be called from probe() before the first I/O is |
371 | done to the device. | 371 | done to the device. However, that can also be called at any time |
372 | that no message is pending for that device. | ||
372 | 373 | ||
373 | While "spi_device" would be the bottom boundary of the driver, the | 374 | While "spi_device" would be the bottom boundary of the driver, the |
374 | upper boundaries might include sysfs (especially for sensor readings), | 375 | upper boundaries might include sysfs (especially for sensor readings), |
@@ -445,11 +446,15 @@ SPI MASTER METHODS | |||
445 | This sets up the device clock rate, SPI mode, and word sizes. | 446 | This sets up the device clock rate, SPI mode, and word sizes. |
446 | Drivers may change the defaults provided by board_info, and then | 447 | Drivers may change the defaults provided by board_info, and then |
447 | call spi_setup(spi) to invoke this routine. It may sleep. | 448 | call spi_setup(spi) to invoke this routine. It may sleep. |
449 | Unless each SPI slave has its own configuration registers, don't | ||
450 | change them right away ... otherwise drivers could corrupt I/O | ||
451 | that's in progress for other SPI devices. | ||
448 | 452 | ||
449 | master->transfer(struct spi_device *spi, struct spi_message *message) | 453 | master->transfer(struct spi_device *spi, struct spi_message *message) |
450 | This must not sleep. Its responsibility is arrange that the | 454 | This must not sleep. Its responsibility is arrange that the |
451 | transfer happens and its complete() callback is issued; the two | 455 | transfer happens and its complete() callback is issued. The two |
452 | will normally happen later, after other transfers complete. | 456 | will normally happen later, after other transfers complete, and |
457 | if the controller is idle it will need to be kickstarted. | ||
453 | 458 | ||
454 | master->cleanup(struct spi_device *spi) | 459 | master->cleanup(struct spi_device *spi) |
455 | Your controller driver may use spi_device.controller_state to hold | 460 | Your controller driver may use spi_device.controller_state to hold |
diff --git a/Documentation/spi/spidev b/Documentation/spi/spidev new file mode 100644 index 000000000000..5c8e1b988a08 --- /dev/null +++ b/Documentation/spi/spidev | |||
@@ -0,0 +1,307 @@ | |||
1 | SPI devices have a limited userspace API, supporting basic half-duplex | ||
2 | read() and write() access to SPI slave devices. Using ioctl() requests, | ||
3 | full duplex transfers and device I/O configuration are also available. | ||
4 | |||
5 | #include <fcntl.h> | ||
6 | #include <unistd.h> | ||
7 | #include <sys/ioctl.h> | ||
8 | #include <linux/types.h> | ||
9 | #include <linux/spi/spidev.h> | ||
10 | |||
11 | Some reasons you might want to use this programming interface include: | ||
12 | |||
13 | * Prototyping in an environment that's not crash-prone; stray pointers | ||
14 | in userspace won't normally bring down any Linux system. | ||
15 | |||
16 | * Developing simple protocols used to talk to microcontrollers acting | ||
17 | as SPI slaves, which you may need to change quite often. | ||
18 | |||
19 | Of course there are drivers that can never be written in userspace, because | ||
20 | they need to access kernel interfaces (such as IRQ handlers or other layers | ||
21 | of the driver stack) that are not accessible to userspace. | ||
22 | |||
23 | |||
24 | DEVICE CREATION, DRIVER BINDING | ||
25 | =============================== | ||
26 | The simplest way to arrange to use this driver is to just list it in the | ||
27 | spi_board_info for a device as the driver it should use: the "modalias" | ||
28 | entry is "spidev", matching the name of the driver exposing this API. | ||
29 | Set up the other device characteristics (bits per word, SPI clocking, | ||
30 | chipselect polarity, etc) as usual, so you won't always need to override | ||
31 | them later. | ||
32 | |||
33 | (Sysfs also supports userspace driven binding/unbinding of drivers to | ||
34 | devices. That mechanism might be supported here in the future.) | ||
35 | |||
36 | When you do that, the sysfs node for the SPI device will include a child | ||
37 | device node with a "dev" attribute that will be understood by udev or mdev. | ||
38 | (Larger systems will have "udev". Smaller ones may configure "mdev" into | ||
39 | busybox; it's less featureful, but often enough.) For a SPI device with | ||
40 | chipselect C on bus B, you should see: | ||
41 | |||
42 | /dev/spidevB.C ... character special device, major number 153 with | ||
43 | a dynamically chosen minor device number. This is the node | ||
44 | that userspace programs will open, created by "udev" or "mdev". | ||
45 | |||
46 | /sys/devices/.../spiB.C ... as usual, the SPI device node will | ||
47 | be a child of its SPI master controller. | ||
48 | |||
49 | /sys/class/spidev/spidevB.C ... created when the "spidev" driver | ||
50 | binds to that device. (Directory or symlink, based on whether | ||
51 | or not you enabled the "deprecated sysfs files" Kconfig option.) | ||
52 | |||
53 | Do not try to manage the /dev character device special file nodes by hand. | ||
54 | That's error prone, and you'd need to pay careful attention to system | ||
55 | security issues; udev/mdev should already be configured securely. | ||
56 | |||
57 | If you unbind the "spidev" driver from that device, those two "spidev" nodes | ||
58 | (in sysfs and in /dev) should automatically be removed (respectively by the | ||
59 | kernel and by udev/mdev). You can unbind by removing the "spidev" driver | ||
60 | module, which will affect all devices using this driver. You can also unbind | ||
61 | by having kernel code remove the SPI device, probably by removing the driver | ||
62 | for its SPI controller (so its spi_master vanishes). | ||
63 | |||
64 | Since this is a standard Linux device driver -- even though it just happens | ||
65 | to expose a low level API to userspace -- it can be associated with any number | ||
66 | of devices at a time. Just provide one spi_board_info record for each such | ||
67 | SPI device, and you'll get a /dev device node for each device. | ||
68 | |||
69 | |||
70 | BASIC CHARACTER DEVICE API | ||
71 | ========================== | ||
72 | Normal open() and close() operations on /dev/spidevB.D files work as you | ||
73 | would expect. | ||
74 | |||
75 | Standard read() and write() operations are obviously only half-duplex, and | ||
76 | the chipselect is deactivated between those operations. Full-duplex access, | ||
77 | and composite operation without chipselect de-activation, is available using | ||
78 | the SPI_IOC_MESSAGE(N) request. | ||
79 | |||
80 | Several ioctl() requests let your driver read or override the device's current | ||
81 | settings for data transfer parameters: | ||
82 | |||
83 | SPI_IOC_RD_MODE, SPI_IOC_WR_MODE ... pass a pointer to a byte which will | ||
84 | return (RD) or assign (WR) the SPI transfer mode. Use the constants | ||
85 | SPI_MODE_0..SPI_MODE_3; or if you prefer you can combine SPI_CPOL | ||
86 | (clock polarity, idle high iff this is set) or SPI_CPHA (clock phase, | ||
87 | sample on trailing edge iff this is set) flags. | ||
88 | |||
89 | SPI_IOC_RD_LSB_FIRST, SPI_IOC_WR_LSB_FIRST ... pass a pointer to a byte | ||
90 | which will return (RD) or assign (WR) the bit justification used to | ||
91 | transfer SPI words. Zero indicates MSB-first; other values indicate | ||
92 | the less common LSB-first encoding. In both cases the specified value | ||
93 | is right-justified in each word, so that unused (TX) or undefined (RX) | ||
94 | bits are in the MSBs. | ||
95 | |||
96 | SPI_IOC_RD_BITS_PER_WORD, SPI_IOC_WR_BITS_PER_WORD ... pass a pointer to | ||
97 | a byte which will return (RD) or assign (WR) the number of bits in | ||
98 | each SPI transfer word. The value zero signifies eight bits. | ||
99 | |||
100 | SPI_IOC_RD_MAX_SPEED_HZ, SPI_IOC_WR_MAX_SPEED_HZ ... pass a pointer to a | ||
101 | u32 which will return (RD) or assign (WR) the maximum SPI transfer | ||
102 | speed, in Hz. The controller can't necessarily assign that specific | ||
103 | clock speed. | ||
104 | |||
105 | NOTES: | ||
106 | |||
107 | - At this time there is no async I/O support; everything is purely | ||
108 | synchronous. | ||
109 | |||
110 | - There's currently no way to report the actual bit rate used to | ||
111 | shift data to/from a given device. | ||
112 | |||
113 | - From userspace, you can't currently change the chip select polarity; | ||
114 | that could corrupt transfers to other devices sharing the SPI bus. | ||
115 | Each SPI device is deselected when it's not in active use, allowing | ||
116 | other drivers to talk to other devices. | ||
117 | |||
118 | - There's a limit on the number of bytes each I/O request can transfer | ||
119 | to the SPI device. It defaults to one page, but that can be changed | ||
120 | using a module parameter. | ||
121 | |||
122 | - Because SPI has no low-level transfer acknowledgement, you usually | ||
123 | won't see any I/O errors when talking to a non-existent device. | ||
124 | |||
125 | |||
126 | FULL DUPLEX CHARACTER DEVICE API | ||
127 | ================================ | ||
128 | |||
129 | See the sample program below for one example showing the use of the full | ||
130 | duplex programming interface. (Although it doesn't perform a full duplex | ||
131 | transfer.) The model is the same as that used in the kernel spi_sync() | ||
132 | request; the individual transfers offer the same capabilities as are | ||
133 | available to kernel drivers (except that it's not asynchronous). | ||
134 | |||
135 | The example shows one half-duplex RPC-style request and response message. | ||
136 | These requests commonly require that the chip not be deselected between | ||
137 | the request and response. Several such requests could be chained into | ||
138 | a single kernel request, even allowing the chip to be deselected after | ||
139 | each response. (Other protocol options include changing the word size | ||
140 | and bitrate for each transfer segment.) | ||
141 | |||
142 | To make a full duplex request, provide both rx_buf and tx_buf for the | ||
143 | same transfer. It's even OK if those are the same buffer. | ||
144 | |||
145 | |||
146 | SAMPLE PROGRAM | ||
147 | ============== | ||
148 | |||
149 | -------------------------------- CUT HERE | ||
150 | #include <stdio.h> | ||
151 | #include <unistd.h> | ||
152 | #include <stdlib.h> | ||
153 | #include <fcntl.h> | ||
154 | #include <string.h> | ||
155 | |||
156 | #include <sys/ioctl.h> | ||
157 | #include <sys/types.h> | ||
158 | #include <sys/stat.h> | ||
159 | |||
160 | #include <linux/types.h> | ||
161 | #include <linux/spi/spidev.h> | ||
162 | |||
163 | |||
164 | static int verbose; | ||
165 | |||
166 | static void do_read(int fd, int len) | ||
167 | { | ||
168 | unsigned char buf[32], *bp; | ||
169 | int status; | ||
170 | |||
171 | /* read at least 2 bytes, no more than 32 */ | ||
172 | if (len < 2) | ||
173 | len = 2; | ||
174 | else if (len > sizeof(buf)) | ||
175 | len = sizeof(buf); | ||
176 | memset(buf, 0, sizeof buf); | ||
177 | |||
178 | status = read(fd, buf, len); | ||
179 | if (status < 0) { | ||
180 | perror("read"); | ||
181 | return; | ||
182 | } | ||
183 | if (status != len) { | ||
184 | fprintf(stderr, "short read\n"); | ||
185 | return; | ||
186 | } | ||
187 | |||
188 | printf("read(%2d, %2d): %02x %02x,", len, status, | ||
189 | buf[0], buf[1]); | ||
190 | status -= 2; | ||
191 | bp = buf + 2; | ||
192 | while (status-- > 0) | ||
193 | printf(" %02x", *bp++); | ||
194 | printf("\n"); | ||
195 | } | ||
196 | |||
197 | static void do_msg(int fd, int len) | ||
198 | { | ||
199 | struct spi_ioc_transfer xfer[2]; | ||
200 | unsigned char buf[32], *bp; | ||
201 | int status; | ||
202 | |||
203 | memset(xfer, 0, sizeof xfer); | ||
204 | memset(buf, 0, sizeof buf); | ||
205 | |||
206 | if (len > sizeof buf) | ||
207 | len = sizeof buf; | ||
208 | |||
209 | buf[0] = 0xaa; | ||
210 | xfer[0].tx_buf = (__u64) buf; | ||
211 | xfer[0].len = 1; | ||
212 | |||
213 | xfer[1].rx_buf = (__u64) buf; | ||
214 | xfer[1].len = len; | ||
215 | |||
216 | status = ioctl(fd, SPI_IOC_MESSAGE(2), xfer); | ||
217 | if (status < 0) { | ||
218 | perror("SPI_IOC_MESSAGE"); | ||
219 | return; | ||
220 | } | ||
221 | |||
222 | printf("response(%2d, %2d): ", len, status); | ||
223 | for (bp = buf; len; len--) | ||
224 | printf(" %02x", *bp++); | ||
225 | printf("\n"); | ||
226 | } | ||
227 | |||
228 | static void dumpstat(const char *name, int fd) | ||
229 | { | ||
230 | __u8 mode, lsb, bits; | ||
231 | __u32 speed; | ||
232 | |||
233 | if (ioctl(fd, SPI_IOC_RD_MODE, &mode) < 0) { | ||
234 | perror("SPI rd_mode"); | ||
235 | return; | ||
236 | } | ||
237 | if (ioctl(fd, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) { | ||
238 | perror("SPI rd_lsb_fist"); | ||
239 | return; | ||
240 | } | ||
241 | if (ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits) < 0) { | ||
242 | perror("SPI bits_per_word"); | ||
243 | return; | ||
244 | } | ||
245 | if (ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) { | ||
246 | perror("SPI max_speed_hz"); | ||
247 | return; | ||
248 | } | ||
249 | |||
250 | printf("%s: spi mode %d, %d bits %sper word, %d Hz max\n", | ||
251 | name, mode, bits, lsb ? "(lsb first) " : "", speed); | ||
252 | } | ||
253 | |||
254 | int main(int argc, char **argv) | ||
255 | { | ||
256 | int c; | ||
257 | int readcount = 0; | ||
258 | int msglen = 0; | ||
259 | int fd; | ||
260 | const char *name; | ||
261 | |||
262 | while ((c = getopt(argc, argv, "hm:r:v")) != EOF) { | ||
263 | switch (c) { | ||
264 | case 'm': | ||
265 | msglen = atoi(optarg); | ||
266 | if (msglen < 0) | ||
267 | goto usage; | ||
268 | continue; | ||
269 | case 'r': | ||
270 | readcount = atoi(optarg); | ||
271 | if (readcount < 0) | ||
272 | goto usage; | ||
273 | continue; | ||
274 | case 'v': | ||
275 | verbose++; | ||
276 | continue; | ||
277 | case 'h': | ||
278 | case '?': | ||
279 | usage: | ||
280 | fprintf(stderr, | ||
281 | "usage: %s [-h] [-m N] [-r N] /dev/spidevB.D\n", | ||
282 | argv[0]); | ||
283 | return 1; | ||
284 | } | ||
285 | } | ||
286 | |||
287 | if ((optind + 1) != argc) | ||
288 | goto usage; | ||
289 | name = argv[optind]; | ||
290 | |||
291 | fd = open(name, O_RDWR); | ||
292 | if (fd < 0) { | ||
293 | perror("open"); | ||
294 | return 1; | ||
295 | } | ||
296 | |||
297 | dumpstat(name, fd); | ||
298 | |||
299 | if (msglen) | ||
300 | do_msg(fd, msglen); | ||
301 | |||
302 | if (readcount) | ||
303 | do_read(fd, readcount); | ||
304 | |||
305 | close(fd); | ||
306 | return 0; | ||
307 | } | ||
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt index 5922e84d9133..111fd28727ec 100644 --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt | |||
@@ -221,14 +221,14 @@ Controls the kernel's behaviour when an oops or BUG is encountered. | |||
221 | 221 | ||
222 | 0: try to continue operation | 222 | 0: try to continue operation |
223 | 223 | ||
224 | 1: panic immediatly. If the `panic' sysctl is also non-zero then the | 224 | 1: panic immediately. If the `panic' sysctl is also non-zero then the |
225 | machine will be rebooted. | 225 | machine will be rebooted. |
226 | 226 | ||
227 | ============================================================== | 227 | ============================================================== |
228 | 228 | ||
229 | pid_max: | 229 | pid_max: |
230 | 230 | ||
231 | PID allocation wrap value. When the kenrel's next PID value | 231 | PID allocation wrap value. When the kernel's next PID value |
232 | reaches this value, it wraps back to a minimum PID value. | 232 | reaches this value, it wraps back to a minimum PID value. |
233 | PIDs of value pid_max or larger are not allocated. | 233 | PIDs of value pid_max or larger are not allocated. |
234 | 234 | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index e96a341eb7e4..1d192565e182 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -197,11 +197,22 @@ and may not be fast. | |||
197 | 197 | ||
198 | panic_on_oom | 198 | panic_on_oom |
199 | 199 | ||
200 | This enables or disables panic on out-of-memory feature. If this is set to 1, | 200 | This enables or disables panic on out-of-memory feature. |
201 | the kernel panics when out-of-memory happens. If this is set to 0, the kernel | ||
202 | will kill some rogue process, called oom_killer. Usually, oom_killer can kill | ||
203 | rogue processes and system will survive. If you want to panic the system | ||
204 | rather than killing rogue processes, set this to 1. | ||
205 | 201 | ||
206 | The default value is 0. | 202 | If this is set to 0, the kernel will kill some rogue process, |
203 | called oom_killer. Usually, oom_killer can kill rogue processes and | ||
204 | system will survive. | ||
205 | |||
206 | If this is set to 1, the kernel panics when out-of-memory happens. | ||
207 | However, if a process limits using nodes by mempolicy/cpusets, | ||
208 | and those nodes become memory exhaustion status, one process | ||
209 | may be killed by oom-killer. No panic occurs in this case. | ||
210 | Because other nodes' memory may be free. This means system total status | ||
211 | may be not fatal yet. | ||
207 | 212 | ||
213 | If this is set to 2, the kernel panics compulsorily even on the | ||
214 | above-mentioned. | ||
215 | |||
216 | The default value is 0. | ||
217 | 1 and 2 are for failover of clustering. Please select either | ||
218 | according to your policy of failover. | ||
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index d43aa9d3c105..ba328f255417 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Linux Magic System Request Key Hacks | 1 | Linux Magic System Request Key Hacks |
2 | Documentation for sysrq.c | 2 | Documentation for sysrq.c |
3 | Last update: 2007-JAN-06 | 3 | Last update: 2007-MAR-14 |
4 | 4 | ||
5 | * What is the magic SysRq key? | 5 | * What is the magic SysRq key? |
6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -75,7 +75,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.: | |||
75 | 75 | ||
76 | 'f' - Will call oom_kill to kill a memory hog process. | 76 | 'f' - Will call oom_kill to kill a memory hog process. |
77 | 77 | ||
78 | 'g' - Used by kgdb on ppc platforms. | 78 | 'g' - Used by kgdb on ppc and sh platforms. |
79 | 79 | ||
80 | 'h' - Will display help (actually any other key than those listed | 80 | 'h' - Will display help (actually any other key than those listed |
81 | above will display help. but 'h' is easy to remember :-) | 81 | above will display help. but 'h' is easy to remember :-) |
diff --git a/Documentation/tty.txt b/Documentation/tty.txt index 5f799e612e03..048a8762cfb5 100644 --- a/Documentation/tty.txt +++ b/Documentation/tty.txt | |||
@@ -108,7 +108,9 @@ hardware driver through the function pointers within the tty->driver | |||
108 | structure: | 108 | structure: |
109 | 109 | ||
110 | write() Write a block of characters to the tty device. | 110 | write() Write a block of characters to the tty device. |
111 | Returns the number of characters accepted. | 111 | Returns the number of characters accepted. The |
112 | character buffer passed to this method is already | ||
113 | in kernel space. | ||
112 | 114 | ||
113 | put_char() Queues a character for writing to the tty device. | 115 | put_char() Queues a character for writing to the tty device. |
114 | If there is no room in the queue, the character is | 116 | If there is no room in the queue, the character is |
diff --git a/Documentation/usb/CREDITS b/Documentation/usb/CREDITS index 27a721635f92..67c59cdc9959 100644 --- a/Documentation/usb/CREDITS +++ b/Documentation/usb/CREDITS | |||
@@ -65,7 +65,7 @@ THANKS file in Inaky's driver): | |||
65 | will sell keyboards to some of the 3 million (at least) | 65 | will sell keyboards to some of the 3 million (at least) |
66 | Linux users. | 66 | Linux users. |
67 | 67 | ||
68 | - Many thanks to ing büro h doran [http://www.ibhdoran.com]! | 68 | - Many thanks to ing büro h doran [http://www.ibhdoran.com]! |
69 | It was almost impossible to get a PC backplate USB connector | 69 | It was almost impossible to get a PC backplate USB connector |
70 | for the motherboard here at Europe (mine, home-made, was | 70 | for the motherboard here at Europe (mine, home-made, was |
71 | quite lousy :). Now I know where to acquire nice USB stuff! | 71 | quite lousy :). Now I know where to acquire nice USB stuff! |
diff --git a/Documentation/usb/usb-serial.txt b/Documentation/usb/usb-serial.txt index d61f6e7865de..5b635ae84944 100644 --- a/Documentation/usb/usb-serial.txt +++ b/Documentation/usb/usb-serial.txt | |||
@@ -42,12 +42,12 @@ ConnectTech WhiteHEAT 4 port converter | |||
42 | http://www.connecttech.com | 42 | http://www.connecttech.com |
43 | 43 | ||
44 | For any questions or problems with this driver, please contact | 44 | For any questions or problems with this driver, please contact |
45 | Stuart MacDonald at stuartm@connecttech.com | 45 | Connect Tech's Support Department at support@connecttech.com |
46 | 46 | ||
47 | 47 | ||
48 | HandSpring Visor, Palm USB, and Clié USB driver | 48 | HandSpring Visor, Palm USB, and Clié USB driver |
49 | 49 | ||
50 | This driver works with all HandSpring USB, Palm USB, and Sony Clié USB | 50 | This driver works with all HandSpring USB, Palm USB, and Sony Clié USB |
51 | devices. | 51 | devices. |
52 | 52 | ||
53 | Only when the device tries to connect to the host, will the device show | 53 | Only when the device tries to connect to the host, will the device show |
@@ -69,7 +69,7 @@ HandSpring Visor, Palm USB, and Clié USB driver | |||
69 | the port to use for the HotSync transfer. The "Generic" port can be used | 69 | the port to use for the HotSync transfer. The "Generic" port can be used |
70 | for other device communication, such as a PPP link. | 70 | for other device communication, such as a PPP link. |
71 | 71 | ||
72 | For some Sony Clié devices, /dev/ttyUSB0 must be used to talk to the | 72 | For some Sony Clié devices, /dev/ttyUSB0 must be used to talk to the |
73 | device. This is true for all OS version 3.5 devices, and most devices | 73 | device. This is true for all OS version 3.5 devices, and most devices |
74 | that have had a flash upgrade to a newer version of the OS. See the | 74 | that have had a flash upgrade to a newer version of the OS. See the |
75 | kernel system log for information on which is the correct port to use. | 75 | kernel system log for information on which is the correct port to use. |
diff --git a/Documentation/video4linux/README.pvrusb2 b/Documentation/video4linux/README.pvrusb2 index a4b7ae800866..a747200fe67c 100644 --- a/Documentation/video4linux/README.pvrusb2 +++ b/Documentation/video4linux/README.pvrusb2 | |||
@@ -8,7 +8,7 @@ Background: | |||
8 | 8 | ||
9 | This driver is intended for the "Hauppauge WinTV PVR USB 2.0", which | 9 | This driver is intended for the "Hauppauge WinTV PVR USB 2.0", which |
10 | is a USB 2.0 hosted TV Tuner. This driver is a work in progress. | 10 | is a USB 2.0 hosted TV Tuner. This driver is a work in progress. |
11 | Its history started with the reverse-engineering effort by Björn | 11 | Its history started with the reverse-engineering effort by Björn |
12 | Danielsson <pvrusb2@dax.nu> whose web page can be found here: | 12 | Danielsson <pvrusb2@dax.nu> whose web page can be found here: |
13 | 13 | ||
14 | http://pvrusb2.dax.nu/ | 14 | http://pvrusb2.dax.nu/ |
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran index 85c575ac4fb9..295462b2317a 100644 --- a/Documentation/video4linux/Zoran +++ b/Documentation/video4linux/Zoran | |||
@@ -242,7 +242,7 @@ can generate: PAL , NTSC , SECAM | |||
242 | 242 | ||
243 | Conexant bt866 TV encoder | 243 | Conexant bt866 TV encoder |
244 | is used in AVS6EYES, and | 244 | is used in AVS6EYES, and |
245 | can generate: NTSC/PAL, PALM, PALN | 245 | can generate: NTSC/PAL, PALÂM, PALÂN |
246 | 246 | ||
247 | The adv717x, should be able to produce PAL N. But you find nothing PAL N | 247 | The adv717x, should be able to produce PAL N. But you find nothing PAL N |
248 | specific in the registers. Seem that you have to reuse a other standard | 248 | specific in the registers. Seem that you have to reuse a other standard |
diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt index 5e51c59bf2b0..bf3af5fe558f 100644 --- a/Documentation/video4linux/meye.txt +++ b/Documentation/video4linux/meye.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | Vaio Picturebook Motion Eye Camera Driver Readme | 1 | Vaio Picturebook Motion Eye Camera Driver Readme |
2 | ------------------------------------------------ | 2 | ------------------------------------------------ |
3 | Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> | 3 | Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> |
4 | Copyright (C) 2001-2002 Alcôve <www.alcove.com> | 4 | Copyright (C) 2001-2002 Alcôve <www.alcove.com> |
5 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> | 5 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> |
6 | 6 | ||
7 | This driver enable the use of video4linux compatible applications with the | 7 | This driver enable the use of video4linux compatible applications with the |
diff --git a/Documentation/video4linux/ov511.txt b/Documentation/video4linux/ov511.txt index 79af610d4ba5..b3326b167ada 100644 --- a/Documentation/video4linux/ov511.txt +++ b/Documentation/video4linux/ov511.txt | |||
@@ -195,11 +195,11 @@ MODULE PARAMETERS: | |||
195 | NAME: bandingfilter | 195 | NAME: bandingfilter |
196 | TYPE: integer (Boolean) | 196 | TYPE: integer (Boolean) |
197 | DEFAULT: 0 (off) | 197 | DEFAULT: 0 (off) |
198 | DESC: Enables the sensor´s banding filter exposure algorithm. This reduces | 198 | DESC: Enables the sensor´s banding filter exposure algorithm. This reduces |
199 | or stabilizes the "banding" caused by some artificial light sources | 199 | or stabilizes the "banding" caused by some artificial light sources |
200 | (especially fluorescent). You might have to set lightfreq correctly for | 200 | (especially fluorescent). You might have to set lightfreq correctly for |
201 | this to work right. As an added bonus, this sometimes makes it | 201 | this to work right. As an added bonus, this sometimes makes it |
202 | possible to capture your monitor´s output. | 202 | possible to capture your monitor´s output. |
203 | 203 | ||
204 | NAME: fastset | 204 | NAME: fastset |
205 | TYPE: integer (Boolean) | 205 | TYPE: integer (Boolean) |
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c new file mode 100644 index 000000000000..686a8e04a4f3 --- /dev/null +++ b/Documentation/vm/slabinfo.c | |||
@@ -0,0 +1,1221 @@ | |||
1 | /* | ||
2 | * Slabinfo: Tool to get reports about slabs | ||
3 | * | ||
4 | * (C) 2007 sgi, Christoph Lameter <clameter@sgi.com> | ||
5 | * | ||
6 | * Compile by: | ||
7 | * | ||
8 | * gcc -o slabinfo slabinfo.c | ||
9 | */ | ||
10 | #include <stdio.h> | ||
11 | #include <stdlib.h> | ||
12 | #include <sys/types.h> | ||
13 | #include <dirent.h> | ||
14 | #include <string.h> | ||
15 | #include <unistd.h> | ||
16 | #include <stdarg.h> | ||
17 | #include <getopt.h> | ||
18 | #include <regex.h> | ||
19 | #include <errno.h> | ||
20 | |||
21 | #define MAX_SLABS 500 | ||
22 | #define MAX_ALIASES 500 | ||
23 | #define MAX_NODES 1024 | ||
24 | |||
25 | struct slabinfo { | ||
26 | char *name; | ||
27 | int alias; | ||
28 | int refs; | ||
29 | int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu; | ||
30 | int hwcache_align, object_size, objs_per_slab; | ||
31 | int sanity_checks, slab_size, store_user, trace; | ||
32 | int order, poison, reclaim_account, red_zone; | ||
33 | unsigned long partial, objects, slabs; | ||
34 | int numa[MAX_NODES]; | ||
35 | int numa_partial[MAX_NODES]; | ||
36 | } slabinfo[MAX_SLABS]; | ||
37 | |||
38 | struct aliasinfo { | ||
39 | char *name; | ||
40 | char *ref; | ||
41 | struct slabinfo *slab; | ||
42 | } aliasinfo[MAX_ALIASES]; | ||
43 | |||
44 | int slabs = 0; | ||
45 | int actual_slabs = 0; | ||
46 | int aliases = 0; | ||
47 | int alias_targets = 0; | ||
48 | int highest_node = 0; | ||
49 | |||
50 | char buffer[4096]; | ||
51 | |||
52 | int show_empty = 0; | ||
53 | int show_report = 0; | ||
54 | int show_alias = 0; | ||
55 | int show_slab = 0; | ||
56 | int skip_zero = 1; | ||
57 | int show_numa = 0; | ||
58 | int show_track = 0; | ||
59 | int show_first_alias = 0; | ||
60 | int validate = 0; | ||
61 | int shrink = 0; | ||
62 | int show_inverted = 0; | ||
63 | int show_single_ref = 0; | ||
64 | int show_totals = 0; | ||
65 | int sort_size = 0; | ||
66 | int set_debug = 0; | ||
67 | int show_ops = 0; | ||
68 | |||
69 | /* Debug options */ | ||
70 | int sanity = 0; | ||
71 | int redzone = 0; | ||
72 | int poison = 0; | ||
73 | int tracking = 0; | ||
74 | int tracing = 0; | ||
75 | |||
76 | int page_size; | ||
77 | |||
78 | regex_t pattern; | ||
79 | |||
80 | void fatal(const char *x, ...) | ||
81 | { | ||
82 | va_list ap; | ||
83 | |||
84 | va_start(ap, x); | ||
85 | vfprintf(stderr, x, ap); | ||
86 | va_end(ap); | ||
87 | exit(1); | ||
88 | } | ||
89 | |||
90 | void usage(void) | ||
91 | { | ||
92 | printf("slabinfo 5/7/2007. (c) 2007 sgi. clameter@sgi.com\n\n" | ||
93 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" | ||
94 | "-a|--aliases Show aliases\n" | ||
95 | "-d<options>|--debug=<options> Set/Clear Debug options\n" | ||
96 | "-e|--empty Show empty slabs\n" | ||
97 | "-f|--first-alias Show first alias\n" | ||
98 | "-h|--help Show usage information\n" | ||
99 | "-i|--inverted Inverted list\n" | ||
100 | "-l|--slabs Show slabs\n" | ||
101 | "-n|--numa Show NUMA information\n" | ||
102 | "-o|--ops Show kmem_cache_ops\n" | ||
103 | "-s|--shrink Shrink slabs\n" | ||
104 | "-r|--report Detailed report on single slabs\n" | ||
105 | "-S|--Size Sort by size\n" | ||
106 | "-t|--tracking Show alloc/free information\n" | ||
107 | "-T|--Totals Show summary information\n" | ||
108 | "-v|--validate Validate slabs\n" | ||
109 | "-z|--zero Include empty slabs\n" | ||
110 | "-1|--1ref Single reference\n" | ||
111 | "\nValid debug options (FZPUT may be combined)\n" | ||
112 | "a / A Switch on all debug options (=FZUP)\n" | ||
113 | "- Switch off all debug options\n" | ||
114 | "f / F Sanity Checks (SLAB_DEBUG_FREE)\n" | ||
115 | "z / Z Redzoning\n" | ||
116 | "p / P Poisoning\n" | ||
117 | "u / U Tracking\n" | ||
118 | "t / T Tracing\n" | ||
119 | ); | ||
120 | } | ||
121 | |||
122 | unsigned long read_obj(char *name) | ||
123 | { | ||
124 | FILE *f = fopen(name, "r"); | ||
125 | |||
126 | if (!f) | ||
127 | buffer[0] = 0; | ||
128 | else { | ||
129 | if (!fgets(buffer,sizeof(buffer), f)) | ||
130 | buffer[0] = 0; | ||
131 | fclose(f); | ||
132 | if (buffer[strlen(buffer)] == '\n') | ||
133 | buffer[strlen(buffer)] = 0; | ||
134 | } | ||
135 | return strlen(buffer); | ||
136 | } | ||
137 | |||
138 | |||
139 | /* | ||
140 | * Get the contents of an attribute | ||
141 | */ | ||
142 | unsigned long get_obj(char *name) | ||
143 | { | ||
144 | if (!read_obj(name)) | ||
145 | return 0; | ||
146 | |||
147 | return atol(buffer); | ||
148 | } | ||
149 | |||
150 | unsigned long get_obj_and_str(char *name, char **x) | ||
151 | { | ||
152 | unsigned long result = 0; | ||
153 | char *p; | ||
154 | |||
155 | *x = NULL; | ||
156 | |||
157 | if (!read_obj(name)) { | ||
158 | x = NULL; | ||
159 | return 0; | ||
160 | } | ||
161 | result = strtoul(buffer, &p, 10); | ||
162 | while (*p == ' ') | ||
163 | p++; | ||
164 | if (*p) | ||
165 | *x = strdup(p); | ||
166 | return result; | ||
167 | } | ||
168 | |||
169 | void set_obj(struct slabinfo *s, char *name, int n) | ||
170 | { | ||
171 | char x[100]; | ||
172 | FILE *f; | ||
173 | |||
174 | sprintf(x, "%s/%s", s->name, name); | ||
175 | f = fopen(x, "w"); | ||
176 | if (!f) | ||
177 | fatal("Cannot write to %s\n", x); | ||
178 | |||
179 | fprintf(f, "%d\n", n); | ||
180 | fclose(f); | ||
181 | } | ||
182 | |||
183 | unsigned long read_slab_obj(struct slabinfo *s, char *name) | ||
184 | { | ||
185 | char x[100]; | ||
186 | FILE *f; | ||
187 | int l; | ||
188 | |||
189 | sprintf(x, "%s/%s", s->name, name); | ||
190 | f = fopen(x, "r"); | ||
191 | if (!f) { | ||
192 | buffer[0] = 0; | ||
193 | l = 0; | ||
194 | } else { | ||
195 | l = fread(buffer, 1, sizeof(buffer), f); | ||
196 | buffer[l] = 0; | ||
197 | fclose(f); | ||
198 | } | ||
199 | return l; | ||
200 | } | ||
201 | |||
202 | |||
203 | /* | ||
204 | * Put a size string together | ||
205 | */ | ||
206 | int store_size(char *buffer, unsigned long value) | ||
207 | { | ||
208 | unsigned long divisor = 1; | ||
209 | char trailer = 0; | ||
210 | int n; | ||
211 | |||
212 | if (value > 1000000000UL) { | ||
213 | divisor = 100000000UL; | ||
214 | trailer = 'G'; | ||
215 | } else if (value > 1000000UL) { | ||
216 | divisor = 100000UL; | ||
217 | trailer = 'M'; | ||
218 | } else if (value > 1000UL) { | ||
219 | divisor = 100; | ||
220 | trailer = 'K'; | ||
221 | } | ||
222 | |||
223 | value /= divisor; | ||
224 | n = sprintf(buffer, "%ld",value); | ||
225 | if (trailer) { | ||
226 | buffer[n] = trailer; | ||
227 | n++; | ||
228 | buffer[n] = 0; | ||
229 | } | ||
230 | if (divisor != 1) { | ||
231 | memmove(buffer + n - 2, buffer + n - 3, 4); | ||
232 | buffer[n-2] = '.'; | ||
233 | n++; | ||
234 | } | ||
235 | return n; | ||
236 | } | ||
237 | |||
238 | void decode_numa_list(int *numa, char *t) | ||
239 | { | ||
240 | int node; | ||
241 | int nr; | ||
242 | |||
243 | memset(numa, 0, MAX_NODES * sizeof(int)); | ||
244 | |||
245 | while (*t == 'N') { | ||
246 | t++; | ||
247 | node = strtoul(t, &t, 10); | ||
248 | if (*t == '=') { | ||
249 | t++; | ||
250 | nr = strtoul(t, &t, 10); | ||
251 | numa[node] = nr; | ||
252 | if (node > highest_node) | ||
253 | highest_node = node; | ||
254 | } | ||
255 | while (*t == ' ') | ||
256 | t++; | ||
257 | } | ||
258 | } | ||
259 | |||
260 | void slab_validate(struct slabinfo *s) | ||
261 | { | ||
262 | set_obj(s, "validate", 1); | ||
263 | } | ||
264 | |||
265 | void slab_shrink(struct slabinfo *s) | ||
266 | { | ||
267 | set_obj(s, "shrink", 1); | ||
268 | } | ||
269 | |||
270 | int line = 0; | ||
271 | |||
272 | void first_line(void) | ||
273 | { | ||
274 | printf("Name Objects Objsize Space " | ||
275 | "Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\n"); | ||
276 | } | ||
277 | |||
278 | /* | ||
279 | * Find the shortest alias of a slab | ||
280 | */ | ||
281 | struct aliasinfo *find_one_alias(struct slabinfo *find) | ||
282 | { | ||
283 | struct aliasinfo *a; | ||
284 | struct aliasinfo *best = NULL; | ||
285 | |||
286 | for(a = aliasinfo;a < aliasinfo + aliases; a++) { | ||
287 | if (a->slab == find && | ||
288 | (!best || strlen(best->name) < strlen(a->name))) { | ||
289 | best = a; | ||
290 | if (strncmp(a->name,"kmall", 5) == 0) | ||
291 | return best; | ||
292 | } | ||
293 | } | ||
294 | return best; | ||
295 | } | ||
296 | |||
297 | unsigned long slab_size(struct slabinfo *s) | ||
298 | { | ||
299 | return s->slabs * (page_size << s->order); | ||
300 | } | ||
301 | |||
302 | void slab_numa(struct slabinfo *s, int mode) | ||
303 | { | ||
304 | int node; | ||
305 | |||
306 | if (strcmp(s->name, "*") == 0) | ||
307 | return; | ||
308 | |||
309 | if (!highest_node) { | ||
310 | printf("\n%s: No NUMA information available.\n", s->name); | ||
311 | return; | ||
312 | } | ||
313 | |||
314 | if (skip_zero && !s->slabs) | ||
315 | return; | ||
316 | |||
317 | if (!line) { | ||
318 | printf("\n%-21s:", mode ? "NUMA nodes" : "Slab"); | ||
319 | for(node = 0; node <= highest_node; node++) | ||
320 | printf(" %4d", node); | ||
321 | printf("\n----------------------"); | ||
322 | for(node = 0; node <= highest_node; node++) | ||
323 | printf("-----"); | ||
324 | printf("\n"); | ||
325 | } | ||
326 | printf("%-21s ", mode ? "All slabs" : s->name); | ||
327 | for(node = 0; node <= highest_node; node++) { | ||
328 | char b[20]; | ||
329 | |||
330 | store_size(b, s->numa[node]); | ||
331 | printf(" %4s", b); | ||
332 | } | ||
333 | printf("\n"); | ||
334 | if (mode) { | ||
335 | printf("%-21s ", "Partial slabs"); | ||
336 | for(node = 0; node <= highest_node; node++) { | ||
337 | char b[20]; | ||
338 | |||
339 | store_size(b, s->numa_partial[node]); | ||
340 | printf(" %4s", b); | ||
341 | } | ||
342 | printf("\n"); | ||
343 | } | ||
344 | line++; | ||
345 | } | ||
346 | |||
347 | void show_tracking(struct slabinfo *s) | ||
348 | { | ||
349 | printf("\n%s: Kernel object allocation\n", s->name); | ||
350 | printf("-----------------------------------------------------------------------\n"); | ||
351 | if (read_slab_obj(s, "alloc_calls")) | ||
352 | printf(buffer); | ||
353 | else | ||
354 | printf("No Data\n"); | ||
355 | |||
356 | printf("\n%s: Kernel object freeing\n", s->name); | ||
357 | printf("------------------------------------------------------------------------\n"); | ||
358 | if (read_slab_obj(s, "free_calls")) | ||
359 | printf(buffer); | ||
360 | else | ||
361 | printf("No Data\n"); | ||
362 | |||
363 | } | ||
364 | |||
365 | void ops(struct slabinfo *s) | ||
366 | { | ||
367 | if (strcmp(s->name, "*") == 0) | ||
368 | return; | ||
369 | |||
370 | if (read_slab_obj(s, "ops")) { | ||
371 | printf("\n%s: kmem_cache operations\n", s->name); | ||
372 | printf("--------------------------------------------\n"); | ||
373 | printf(buffer); | ||
374 | } else | ||
375 | printf("\n%s has no kmem_cache operations\n", s->name); | ||
376 | } | ||
377 | |||
378 | const char *onoff(int x) | ||
379 | { | ||
380 | if (x) | ||
381 | return "On "; | ||
382 | return "Off"; | ||
383 | } | ||
384 | |||
385 | void report(struct slabinfo *s) | ||
386 | { | ||
387 | if (strcmp(s->name, "*") == 0) | ||
388 | return; | ||
389 | printf("\nSlabcache: %-20s Aliases: %2d Order : %2d\n", s->name, s->aliases, s->order); | ||
390 | if (s->hwcache_align) | ||
391 | printf("** Hardware cacheline aligned\n"); | ||
392 | if (s->cache_dma) | ||
393 | printf("** Memory is allocated in a special DMA zone\n"); | ||
394 | if (s->destroy_by_rcu) | ||
395 | printf("** Slabs are destroyed via RCU\n"); | ||
396 | if (s->reclaim_account) | ||
397 | printf("** Reclaim accounting active\n"); | ||
398 | |||
399 | printf("\nSizes (bytes) Slabs Debug Memory\n"); | ||
400 | printf("------------------------------------------------------------------------\n"); | ||
401 | printf("Object : %7d Total : %7ld Sanity Checks : %s Total: %7ld\n", | ||
402 | s->object_size, s->slabs, onoff(s->sanity_checks), | ||
403 | s->slabs * (page_size << s->order)); | ||
404 | printf("SlabObj: %7d Full : %7ld Redzoning : %s Used : %7ld\n", | ||
405 | s->slab_size, s->slabs - s->partial - s->cpu_slabs, | ||
406 | onoff(s->red_zone), s->objects * s->object_size); | ||
407 | printf("SlabSiz: %7d Partial: %7ld Poisoning : %s Loss : %7ld\n", | ||
408 | page_size << s->order, s->partial, onoff(s->poison), | ||
409 | s->slabs * (page_size << s->order) - s->objects * s->object_size); | ||
410 | printf("Loss : %7d CpuSlab: %7d Tracking : %s Lalig: %7ld\n", | ||
411 | s->slab_size - s->object_size, s->cpu_slabs, onoff(s->store_user), | ||
412 | (s->slab_size - s->object_size) * s->objects); | ||
413 | printf("Align : %7d Objects: %7d Tracing : %s Lpadd: %7ld\n", | ||
414 | s->align, s->objs_per_slab, onoff(s->trace), | ||
415 | ((page_size << s->order) - s->objs_per_slab * s->slab_size) * | ||
416 | s->slabs); | ||
417 | |||
418 | ops(s); | ||
419 | show_tracking(s); | ||
420 | slab_numa(s, 1); | ||
421 | } | ||
422 | |||
423 | void slabcache(struct slabinfo *s) | ||
424 | { | ||
425 | char size_str[20]; | ||
426 | char dist_str[40]; | ||
427 | char flags[20]; | ||
428 | char *p = flags; | ||
429 | |||
430 | if (strcmp(s->name, "*") == 0) | ||
431 | return; | ||
432 | |||
433 | if (actual_slabs == 1) { | ||
434 | report(s); | ||
435 | return; | ||
436 | } | ||
437 | |||
438 | if (skip_zero && !show_empty && !s->slabs) | ||
439 | return; | ||
440 | |||
441 | if (show_empty && s->slabs) | ||
442 | return; | ||
443 | |||
444 | store_size(size_str, slab_size(s)); | ||
445 | sprintf(dist_str,"%lu/%lu/%d", s->slabs, s->partial, s->cpu_slabs); | ||
446 | |||
447 | if (!line++) | ||
448 | first_line(); | ||
449 | |||
450 | if (s->aliases) | ||
451 | *p++ = '*'; | ||
452 | if (s->cache_dma) | ||
453 | *p++ = 'd'; | ||
454 | if (s->hwcache_align) | ||
455 | *p++ = 'A'; | ||
456 | if (s->poison) | ||
457 | *p++ = 'P'; | ||
458 | if (s->reclaim_account) | ||
459 | *p++ = 'a'; | ||
460 | if (s->red_zone) | ||
461 | *p++ = 'Z'; | ||
462 | if (s->sanity_checks) | ||
463 | *p++ = 'F'; | ||
464 | if (s->store_user) | ||
465 | *p++ = 'U'; | ||
466 | if (s->trace) | ||
467 | *p++ = 'T'; | ||
468 | |||
469 | *p = 0; | ||
470 | printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n", | ||
471 | s->name, s->objects, s->object_size, size_str, dist_str, | ||
472 | s->objs_per_slab, s->order, | ||
473 | s->slabs ? (s->partial * 100) / s->slabs : 100, | ||
474 | s->slabs ? (s->objects * s->object_size * 100) / | ||
475 | (s->slabs * (page_size << s->order)) : 100, | ||
476 | flags); | ||
477 | } | ||
478 | |||
479 | /* | ||
480 | * Analyze debug options. Return false if something is amiss. | ||
481 | */ | ||
482 | int debug_opt_scan(char *opt) | ||
483 | { | ||
484 | if (!opt || !opt[0] || strcmp(opt, "-") == 0) | ||
485 | return 1; | ||
486 | |||
487 | if (strcasecmp(opt, "a") == 0) { | ||
488 | sanity = 1; | ||
489 | poison = 1; | ||
490 | redzone = 1; | ||
491 | tracking = 1; | ||
492 | return 1; | ||
493 | } | ||
494 | |||
495 | for ( ; *opt; opt++) | ||
496 | switch (*opt) { | ||
497 | case 'F' : case 'f': | ||
498 | if (sanity) | ||
499 | return 0; | ||
500 | sanity = 1; | ||
501 | break; | ||
502 | case 'P' : case 'p': | ||
503 | if (poison) | ||
504 | return 0; | ||
505 | poison = 1; | ||
506 | break; | ||
507 | |||
508 | case 'Z' : case 'z': | ||
509 | if (redzone) | ||
510 | return 0; | ||
511 | redzone = 1; | ||
512 | break; | ||
513 | |||
514 | case 'U' : case 'u': | ||
515 | if (tracking) | ||
516 | return 0; | ||
517 | tracking = 1; | ||
518 | break; | ||
519 | |||
520 | case 'T' : case 't': | ||
521 | if (tracing) | ||
522 | return 0; | ||
523 | tracing = 1; | ||
524 | break; | ||
525 | default: | ||
526 | return 0; | ||
527 | } | ||
528 | return 1; | ||
529 | } | ||
530 | |||
531 | int slab_empty(struct slabinfo *s) | ||
532 | { | ||
533 | if (s->objects > 0) | ||
534 | return 0; | ||
535 | |||
536 | /* | ||
537 | * We may still have slabs even if there are no objects. Shrinking will | ||
538 | * remove them. | ||
539 | */ | ||
540 | if (s->slabs != 0) | ||
541 | set_obj(s, "shrink", 1); | ||
542 | |||
543 | return 1; | ||
544 | } | ||
545 | |||
546 | void slab_debug(struct slabinfo *s) | ||
547 | { | ||
548 | if (sanity && !s->sanity_checks) { | ||
549 | set_obj(s, "sanity", 1); | ||
550 | } | ||
551 | if (!sanity && s->sanity_checks) { | ||
552 | if (slab_empty(s)) | ||
553 | set_obj(s, "sanity", 0); | ||
554 | else | ||
555 | fprintf(stderr, "%s not empty cannot disable sanity checks\n", s->name); | ||
556 | } | ||
557 | if (redzone && !s->red_zone) { | ||
558 | if (slab_empty(s)) | ||
559 | set_obj(s, "red_zone", 1); | ||
560 | else | ||
561 | fprintf(stderr, "%s not empty cannot enable redzoning\n", s->name); | ||
562 | } | ||
563 | if (!redzone && s->red_zone) { | ||
564 | if (slab_empty(s)) | ||
565 | set_obj(s, "red_zone", 0); | ||
566 | else | ||
567 | fprintf(stderr, "%s not empty cannot disable redzoning\n", s->name); | ||
568 | } | ||
569 | if (poison && !s->poison) { | ||
570 | if (slab_empty(s)) | ||
571 | set_obj(s, "poison", 1); | ||
572 | else | ||
573 | fprintf(stderr, "%s not empty cannot enable poisoning\n", s->name); | ||
574 | } | ||
575 | if (!poison && s->poison) { | ||
576 | if (slab_empty(s)) | ||
577 | set_obj(s, "poison", 0); | ||
578 | else | ||
579 | fprintf(stderr, "%s not empty cannot disable poisoning\n", s->name); | ||
580 | } | ||
581 | if (tracking && !s->store_user) { | ||
582 | if (slab_empty(s)) | ||
583 | set_obj(s, "store_user", 1); | ||
584 | else | ||
585 | fprintf(stderr, "%s not empty cannot enable tracking\n", s->name); | ||
586 | } | ||
587 | if (!tracking && s->store_user) { | ||
588 | if (slab_empty(s)) | ||
589 | set_obj(s, "store_user", 0); | ||
590 | else | ||
591 | fprintf(stderr, "%s not empty cannot disable tracking\n", s->name); | ||
592 | } | ||
593 | if (tracing && !s->trace) { | ||
594 | if (slabs == 1) | ||
595 | set_obj(s, "trace", 1); | ||
596 | else | ||
597 | fprintf(stderr, "%s can only enable trace for one slab at a time\n", s->name); | ||
598 | } | ||
599 | if (!tracing && s->trace) | ||
600 | set_obj(s, "trace", 1); | ||
601 | } | ||
602 | |||
603 | void totals(void) | ||
604 | { | ||
605 | struct slabinfo *s; | ||
606 | |||
607 | int used_slabs = 0; | ||
608 | char b1[20], b2[20], b3[20], b4[20]; | ||
609 | unsigned long long max = 1ULL << 63; | ||
610 | |||
611 | /* Object size */ | ||
612 | unsigned long long min_objsize = max, max_objsize = 0, avg_objsize; | ||
613 | |||
614 | /* Number of partial slabs in a slabcache */ | ||
615 | unsigned long long min_partial = max, max_partial = 0, | ||
616 | avg_partial, total_partial = 0; | ||
617 | |||
618 | /* Number of slabs in a slab cache */ | ||
619 | unsigned long long min_slabs = max, max_slabs = 0, | ||
620 | avg_slabs, total_slabs = 0; | ||
621 | |||
622 | /* Size of the whole slab */ | ||
623 | unsigned long long min_size = max, max_size = 0, | ||
624 | avg_size, total_size = 0; | ||
625 | |||
626 | /* Bytes used for object storage in a slab */ | ||
627 | unsigned long long min_used = max, max_used = 0, | ||
628 | avg_used, total_used = 0; | ||
629 | |||
630 | /* Waste: Bytes used for alignment and padding */ | ||
631 | unsigned long long min_waste = max, max_waste = 0, | ||
632 | avg_waste, total_waste = 0; | ||
633 | /* Number of objects in a slab */ | ||
634 | unsigned long long min_objects = max, max_objects = 0, | ||
635 | avg_objects, total_objects = 0; | ||
636 | /* Waste per object */ | ||
637 | unsigned long long min_objwaste = max, | ||
638 | max_objwaste = 0, avg_objwaste, | ||
639 | total_objwaste = 0; | ||
640 | |||
641 | /* Memory per object */ | ||
642 | unsigned long long min_memobj = max, | ||
643 | max_memobj = 0, avg_memobj, | ||
644 | total_objsize = 0; | ||
645 | |||
646 | /* Percentage of partial slabs per slab */ | ||
647 | unsigned long min_ppart = 100, max_ppart = 0, | ||
648 | avg_ppart, total_ppart = 0; | ||
649 | |||
650 | /* Number of objects in partial slabs */ | ||
651 | unsigned long min_partobj = max, max_partobj = 0, | ||
652 | avg_partobj, total_partobj = 0; | ||
653 | |||
654 | /* Percentage of partial objects of all objects in a slab */ | ||
655 | unsigned long min_ppartobj = 100, max_ppartobj = 0, | ||
656 | avg_ppartobj, total_ppartobj = 0; | ||
657 | |||
658 | |||
659 | for (s = slabinfo; s < slabinfo + slabs; s++) { | ||
660 | unsigned long long size; | ||
661 | unsigned long used; | ||
662 | unsigned long long wasted; | ||
663 | unsigned long long objwaste; | ||
664 | long long objects_in_partial_slabs; | ||
665 | unsigned long percentage_partial_slabs; | ||
666 | unsigned long percentage_partial_objs; | ||
667 | |||
668 | if (!s->slabs || !s->objects) | ||
669 | continue; | ||
670 | |||
671 | used_slabs++; | ||
672 | |||
673 | size = slab_size(s); | ||
674 | used = s->objects * s->object_size; | ||
675 | wasted = size - used; | ||
676 | objwaste = s->slab_size - s->object_size; | ||
677 | |||
678 | objects_in_partial_slabs = s->objects - | ||
679 | (s->slabs - s->partial - s ->cpu_slabs) * | ||
680 | s->objs_per_slab; | ||
681 | |||
682 | if (objects_in_partial_slabs < 0) | ||
683 | objects_in_partial_slabs = 0; | ||
684 | |||
685 | percentage_partial_slabs = s->partial * 100 / s->slabs; | ||
686 | if (percentage_partial_slabs > 100) | ||
687 | percentage_partial_slabs = 100; | ||
688 | |||
689 | percentage_partial_objs = objects_in_partial_slabs * 100 | ||
690 | / s->objects; | ||
691 | |||
692 | if (percentage_partial_objs > 100) | ||
693 | percentage_partial_objs = 100; | ||
694 | |||
695 | if (s->object_size < min_objsize) | ||
696 | min_objsize = s->object_size; | ||
697 | if (s->partial < min_partial) | ||
698 | min_partial = s->partial; | ||
699 | if (s->slabs < min_slabs) | ||
700 | min_slabs = s->slabs; | ||
701 | if (size < min_size) | ||
702 | min_size = size; | ||
703 | if (wasted < min_waste) | ||
704 | min_waste = wasted; | ||
705 | if (objwaste < min_objwaste) | ||
706 | min_objwaste = objwaste; | ||
707 | if (s->objects < min_objects) | ||
708 | min_objects = s->objects; | ||
709 | if (used < min_used) | ||
710 | min_used = used; | ||
711 | if (objects_in_partial_slabs < min_partobj) | ||
712 | min_partobj = objects_in_partial_slabs; | ||
713 | if (percentage_partial_slabs < min_ppart) | ||
714 | min_ppart = percentage_partial_slabs; | ||
715 | if (percentage_partial_objs < min_ppartobj) | ||
716 | min_ppartobj = percentage_partial_objs; | ||
717 | if (s->slab_size < min_memobj) | ||
718 | min_memobj = s->slab_size; | ||
719 | |||
720 | if (s->object_size > max_objsize) | ||
721 | max_objsize = s->object_size; | ||
722 | if (s->partial > max_partial) | ||
723 | max_partial = s->partial; | ||
724 | if (s->slabs > max_slabs) | ||
725 | max_slabs = s->slabs; | ||
726 | if (size > max_size) | ||
727 | max_size = size; | ||
728 | if (wasted > max_waste) | ||
729 | max_waste = wasted; | ||
730 | if (objwaste > max_objwaste) | ||
731 | max_objwaste = objwaste; | ||
732 | if (s->objects > max_objects) | ||
733 | max_objects = s->objects; | ||
734 | if (used > max_used) | ||
735 | max_used = used; | ||
736 | if (objects_in_partial_slabs > max_partobj) | ||
737 | max_partobj = objects_in_partial_slabs; | ||
738 | if (percentage_partial_slabs > max_ppart) | ||
739 | max_ppart = percentage_partial_slabs; | ||
740 | if (percentage_partial_objs > max_ppartobj) | ||
741 | max_ppartobj = percentage_partial_objs; | ||
742 | if (s->slab_size > max_memobj) | ||
743 | max_memobj = s->slab_size; | ||
744 | |||
745 | total_partial += s->partial; | ||
746 | total_slabs += s->slabs; | ||
747 | total_size += size; | ||
748 | total_waste += wasted; | ||
749 | |||
750 | total_objects += s->objects; | ||
751 | total_used += used; | ||
752 | total_partobj += objects_in_partial_slabs; | ||
753 | total_ppart += percentage_partial_slabs; | ||
754 | total_ppartobj += percentage_partial_objs; | ||
755 | |||
756 | total_objwaste += s->objects * objwaste; | ||
757 | total_objsize += s->objects * s->slab_size; | ||
758 | } | ||
759 | |||
760 | if (!total_objects) { | ||
761 | printf("No objects\n"); | ||
762 | return; | ||
763 | } | ||
764 | if (!used_slabs) { | ||
765 | printf("No slabs\n"); | ||
766 | return; | ||
767 | } | ||
768 | |||
769 | /* Per slab averages */ | ||
770 | avg_partial = total_partial / used_slabs; | ||
771 | avg_slabs = total_slabs / used_slabs; | ||
772 | avg_size = total_size / used_slabs; | ||
773 | avg_waste = total_waste / used_slabs; | ||
774 | |||
775 | avg_objects = total_objects / used_slabs; | ||
776 | avg_used = total_used / used_slabs; | ||
777 | avg_partobj = total_partobj / used_slabs; | ||
778 | avg_ppart = total_ppart / used_slabs; | ||
779 | avg_ppartobj = total_ppartobj / used_slabs; | ||
780 | |||
781 | /* Per object object sizes */ | ||
782 | avg_objsize = total_used / total_objects; | ||
783 | avg_objwaste = total_objwaste / total_objects; | ||
784 | avg_partobj = total_partobj * 100 / total_objects; | ||
785 | avg_memobj = total_objsize / total_objects; | ||
786 | |||
787 | printf("Slabcache Totals\n"); | ||
788 | printf("----------------\n"); | ||
789 | printf("Slabcaches : %3d Aliases : %3d->%-3d Active: %3d\n", | ||
790 | slabs, aliases, alias_targets, used_slabs); | ||
791 | |||
792 | store_size(b1, total_size);store_size(b2, total_waste); | ||
793 | store_size(b3, total_waste * 100 / total_used); | ||
794 | printf("Memory used: %6s # Loss : %6s MRatio: %6s%%\n", b1, b2, b3); | ||
795 | |||
796 | store_size(b1, total_objects);store_size(b2, total_partobj); | ||
797 | store_size(b3, total_partobj * 100 / total_objects); | ||
798 | printf("# Objects : %6s # PartObj: %6s ORatio: %6s%%\n", b1, b2, b3); | ||
799 | |||
800 | printf("\n"); | ||
801 | printf("Per Cache Average Min Max Total\n"); | ||
802 | printf("---------------------------------------------------------\n"); | ||
803 | |||
804 | store_size(b1, avg_objects);store_size(b2, min_objects); | ||
805 | store_size(b3, max_objects);store_size(b4, total_objects); | ||
806 | printf("#Objects %10s %10s %10s %10s\n", | ||
807 | b1, b2, b3, b4); | ||
808 | |||
809 | store_size(b1, avg_slabs);store_size(b2, min_slabs); | ||
810 | store_size(b3, max_slabs);store_size(b4, total_slabs); | ||
811 | printf("#Slabs %10s %10s %10s %10s\n", | ||
812 | b1, b2, b3, b4); | ||
813 | |||
814 | store_size(b1, avg_partial);store_size(b2, min_partial); | ||
815 | store_size(b3, max_partial);store_size(b4, total_partial); | ||
816 | printf("#PartSlab %10s %10s %10s %10s\n", | ||
817 | b1, b2, b3, b4); | ||
818 | store_size(b1, avg_ppart);store_size(b2, min_ppart); | ||
819 | store_size(b3, max_ppart); | ||
820 | store_size(b4, total_partial * 100 / total_slabs); | ||
821 | printf("%%PartSlab %10s%% %10s%% %10s%% %10s%%\n", | ||
822 | b1, b2, b3, b4); | ||
823 | |||
824 | store_size(b1, avg_partobj);store_size(b2, min_partobj); | ||
825 | store_size(b3, max_partobj); | ||
826 | store_size(b4, total_partobj); | ||
827 | printf("PartObjs %10s %10s %10s %10s\n", | ||
828 | b1, b2, b3, b4); | ||
829 | |||
830 | store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj); | ||
831 | store_size(b3, max_ppartobj); | ||
832 | store_size(b4, total_partobj * 100 / total_objects); | ||
833 | printf("%% PartObj %10s%% %10s%% %10s%% %10s%%\n", | ||
834 | b1, b2, b3, b4); | ||
835 | |||
836 | store_size(b1, avg_size);store_size(b2, min_size); | ||
837 | store_size(b3, max_size);store_size(b4, total_size); | ||
838 | printf("Memory %10s %10s %10s %10s\n", | ||
839 | b1, b2, b3, b4); | ||
840 | |||
841 | store_size(b1, avg_used);store_size(b2, min_used); | ||
842 | store_size(b3, max_used);store_size(b4, total_used); | ||
843 | printf("Used %10s %10s %10s %10s\n", | ||
844 | b1, b2, b3, b4); | ||
845 | |||
846 | store_size(b1, avg_waste);store_size(b2, min_waste); | ||
847 | store_size(b3, max_waste);store_size(b4, total_waste); | ||
848 | printf("Loss %10s %10s %10s %10s\n", | ||
849 | b1, b2, b3, b4); | ||
850 | |||
851 | printf("\n"); | ||
852 | printf("Per Object Average Min Max\n"); | ||
853 | printf("---------------------------------------------\n"); | ||
854 | |||
855 | store_size(b1, avg_memobj);store_size(b2, min_memobj); | ||
856 | store_size(b3, max_memobj); | ||
857 | printf("Memory %10s %10s %10s\n", | ||
858 | b1, b2, b3); | ||
859 | store_size(b1, avg_objsize);store_size(b2, min_objsize); | ||
860 | store_size(b3, max_objsize); | ||
861 | printf("User %10s %10s %10s\n", | ||
862 | b1, b2, b3); | ||
863 | |||
864 | store_size(b1, avg_objwaste);store_size(b2, min_objwaste); | ||
865 | store_size(b3, max_objwaste); | ||
866 | printf("Loss %10s %10s %10s\n", | ||
867 | b1, b2, b3); | ||
868 | } | ||
869 | |||
870 | void sort_slabs(void) | ||
871 | { | ||
872 | struct slabinfo *s1,*s2; | ||
873 | |||
874 | for (s1 = slabinfo; s1 < slabinfo + slabs; s1++) { | ||
875 | for (s2 = s1 + 1; s2 < slabinfo + slabs; s2++) { | ||
876 | int result; | ||
877 | |||
878 | if (sort_size) | ||
879 | result = slab_size(s1) < slab_size(s2); | ||
880 | else | ||
881 | result = strcasecmp(s1->name, s2->name); | ||
882 | |||
883 | if (show_inverted) | ||
884 | result = -result; | ||
885 | |||
886 | if (result > 0) { | ||
887 | struct slabinfo t; | ||
888 | |||
889 | memcpy(&t, s1, sizeof(struct slabinfo)); | ||
890 | memcpy(s1, s2, sizeof(struct slabinfo)); | ||
891 | memcpy(s2, &t, sizeof(struct slabinfo)); | ||
892 | } | ||
893 | } | ||
894 | } | ||
895 | } | ||
896 | |||
897 | void sort_aliases(void) | ||
898 | { | ||
899 | struct aliasinfo *a1,*a2; | ||
900 | |||
901 | for (a1 = aliasinfo; a1 < aliasinfo + aliases; a1++) { | ||
902 | for (a2 = a1 + 1; a2 < aliasinfo + aliases; a2++) { | ||
903 | char *n1, *n2; | ||
904 | |||
905 | n1 = a1->name; | ||
906 | n2 = a2->name; | ||
907 | if (show_alias && !show_inverted) { | ||
908 | n1 = a1->ref; | ||
909 | n2 = a2->ref; | ||
910 | } | ||
911 | if (strcasecmp(n1, n2) > 0) { | ||
912 | struct aliasinfo t; | ||
913 | |||
914 | memcpy(&t, a1, sizeof(struct aliasinfo)); | ||
915 | memcpy(a1, a2, sizeof(struct aliasinfo)); | ||
916 | memcpy(a2, &t, sizeof(struct aliasinfo)); | ||
917 | } | ||
918 | } | ||
919 | } | ||
920 | } | ||
921 | |||
922 | void link_slabs(void) | ||
923 | { | ||
924 | struct aliasinfo *a; | ||
925 | struct slabinfo *s; | ||
926 | |||
927 | for (a = aliasinfo; a < aliasinfo + aliases; a++) { | ||
928 | |||
929 | for (s = slabinfo; s < slabinfo + slabs; s++) | ||
930 | if (strcmp(a->ref, s->name) == 0) { | ||
931 | a->slab = s; | ||
932 | s->refs++; | ||
933 | break; | ||
934 | } | ||
935 | if (s == slabinfo + slabs) | ||
936 | fatal("Unresolved alias %s\n", a->ref); | ||
937 | } | ||
938 | } | ||
939 | |||
940 | void alias(void) | ||
941 | { | ||
942 | struct aliasinfo *a; | ||
943 | char *active = NULL; | ||
944 | |||
945 | sort_aliases(); | ||
946 | link_slabs(); | ||
947 | |||
948 | for(a = aliasinfo; a < aliasinfo + aliases; a++) { | ||
949 | |||
950 | if (!show_single_ref && a->slab->refs == 1) | ||
951 | continue; | ||
952 | |||
953 | if (!show_inverted) { | ||
954 | if (active) { | ||
955 | if (strcmp(a->slab->name, active) == 0) { | ||
956 | printf(" %s", a->name); | ||
957 | continue; | ||
958 | } | ||
959 | } | ||
960 | printf("\n%-12s <- %s", a->slab->name, a->name); | ||
961 | active = a->slab->name; | ||
962 | } | ||
963 | else | ||
964 | printf("%-20s -> %s\n", a->name, a->slab->name); | ||
965 | } | ||
966 | if (active) | ||
967 | printf("\n"); | ||
968 | } | ||
969 | |||
970 | |||
971 | void rename_slabs(void) | ||
972 | { | ||
973 | struct slabinfo *s; | ||
974 | struct aliasinfo *a; | ||
975 | |||
976 | for (s = slabinfo; s < slabinfo + slabs; s++) { | ||
977 | if (*s->name != ':') | ||
978 | continue; | ||
979 | |||
980 | if (s->refs > 1 && !show_first_alias) | ||
981 | continue; | ||
982 | |||
983 | a = find_one_alias(s); | ||
984 | |||
985 | if (a) | ||
986 | s->name = a->name; | ||
987 | else { | ||
988 | s->name = "*"; | ||
989 | actual_slabs--; | ||
990 | } | ||
991 | } | ||
992 | } | ||
993 | |||
994 | int slab_mismatch(char *slab) | ||
995 | { | ||
996 | return regexec(&pattern, slab, 0, NULL, 0); | ||
997 | } | ||
998 | |||
999 | void read_slab_dir(void) | ||
1000 | { | ||
1001 | DIR *dir; | ||
1002 | struct dirent *de; | ||
1003 | struct slabinfo *slab = slabinfo; | ||
1004 | struct aliasinfo *alias = aliasinfo; | ||
1005 | char *p; | ||
1006 | char *t; | ||
1007 | int count; | ||
1008 | |||
1009 | if (chdir("/sys/slab")) | ||
1010 | fatal("SYSFS support for SLUB not active\n"); | ||
1011 | |||
1012 | dir = opendir("."); | ||
1013 | while ((de = readdir(dir))) { | ||
1014 | if (de->d_name[0] == '.' || | ||
1015 | (de->d_name[0] != ':' && slab_mismatch(de->d_name))) | ||
1016 | continue; | ||
1017 | switch (de->d_type) { | ||
1018 | case DT_LNK: | ||
1019 | alias->name = strdup(de->d_name); | ||
1020 | count = readlink(de->d_name, buffer, sizeof(buffer)); | ||
1021 | |||
1022 | if (count < 0) | ||
1023 | fatal("Cannot read symlink %s\n", de->d_name); | ||
1024 | |||
1025 | buffer[count] = 0; | ||
1026 | p = buffer + count; | ||
1027 | while (p > buffer && p[-1] != '/') | ||
1028 | p--; | ||
1029 | alias->ref = strdup(p); | ||
1030 | alias++; | ||
1031 | break; | ||
1032 | case DT_DIR: | ||
1033 | if (chdir(de->d_name)) | ||
1034 | fatal("Unable to access slab %s\n", slab->name); | ||
1035 | slab->name = strdup(de->d_name); | ||
1036 | slab->alias = 0; | ||
1037 | slab->refs = 0; | ||
1038 | slab->aliases = get_obj("aliases"); | ||
1039 | slab->align = get_obj("align"); | ||
1040 | slab->cache_dma = get_obj("cache_dma"); | ||
1041 | slab->cpu_slabs = get_obj("cpu_slabs"); | ||
1042 | slab->destroy_by_rcu = get_obj("destroy_by_rcu"); | ||
1043 | slab->hwcache_align = get_obj("hwcache_align"); | ||
1044 | slab->object_size = get_obj("object_size"); | ||
1045 | slab->objects = get_obj("objects"); | ||
1046 | slab->objs_per_slab = get_obj("objs_per_slab"); | ||
1047 | slab->order = get_obj("order"); | ||
1048 | slab->partial = get_obj("partial"); | ||
1049 | slab->partial = get_obj_and_str("partial", &t); | ||
1050 | decode_numa_list(slab->numa_partial, t); | ||
1051 | slab->poison = get_obj("poison"); | ||
1052 | slab->reclaim_account = get_obj("reclaim_account"); | ||
1053 | slab->red_zone = get_obj("red_zone"); | ||
1054 | slab->sanity_checks = get_obj("sanity_checks"); | ||
1055 | slab->slab_size = get_obj("slab_size"); | ||
1056 | slab->slabs = get_obj_and_str("slabs", &t); | ||
1057 | decode_numa_list(slab->numa, t); | ||
1058 | slab->store_user = get_obj("store_user"); | ||
1059 | slab->trace = get_obj("trace"); | ||
1060 | chdir(".."); | ||
1061 | if (slab->name[0] == ':') | ||
1062 | alias_targets++; | ||
1063 | slab++; | ||
1064 | break; | ||
1065 | default : | ||
1066 | fatal("Unknown file type %lx\n", de->d_type); | ||
1067 | } | ||
1068 | } | ||
1069 | closedir(dir); | ||
1070 | slabs = slab - slabinfo; | ||
1071 | actual_slabs = slabs; | ||
1072 | aliases = alias - aliasinfo; | ||
1073 | if (slabs > MAX_SLABS) | ||
1074 | fatal("Too many slabs\n"); | ||
1075 | if (aliases > MAX_ALIASES) | ||
1076 | fatal("Too many aliases\n"); | ||
1077 | } | ||
1078 | |||
1079 | void output_slabs(void) | ||
1080 | { | ||
1081 | struct slabinfo *slab; | ||
1082 | |||
1083 | for (slab = slabinfo; slab < slabinfo + slabs; slab++) { | ||
1084 | |||
1085 | if (slab->alias) | ||
1086 | continue; | ||
1087 | |||
1088 | |||
1089 | if (show_numa) | ||
1090 | slab_numa(slab, 0); | ||
1091 | else if (show_track) | ||
1092 | show_tracking(slab); | ||
1093 | else if (validate) | ||
1094 | slab_validate(slab); | ||
1095 | else if (shrink) | ||
1096 | slab_shrink(slab); | ||
1097 | else if (set_debug) | ||
1098 | slab_debug(slab); | ||
1099 | else if (show_ops) | ||
1100 | ops(slab); | ||
1101 | else if (show_slab) | ||
1102 | slabcache(slab); | ||
1103 | } | ||
1104 | } | ||
1105 | |||
1106 | struct option opts[] = { | ||
1107 | { "aliases", 0, NULL, 'a' }, | ||
1108 | { "debug", 2, NULL, 'd' }, | ||
1109 | { "empty", 0, NULL, 'e' }, | ||
1110 | { "first-alias", 0, NULL, 'f' }, | ||
1111 | { "help", 0, NULL, 'h' }, | ||
1112 | { "inverted", 0, NULL, 'i'}, | ||
1113 | { "numa", 0, NULL, 'n' }, | ||
1114 | { "ops", 0, NULL, 'o' }, | ||
1115 | { "report", 0, NULL, 'r' }, | ||
1116 | { "shrink", 0, NULL, 's' }, | ||
1117 | { "slabs", 0, NULL, 'l' }, | ||
1118 | { "track", 0, NULL, 't'}, | ||
1119 | { "validate", 0, NULL, 'v' }, | ||
1120 | { "zero", 0, NULL, 'z' }, | ||
1121 | { "1ref", 0, NULL, '1'}, | ||
1122 | { NULL, 0, NULL, 0 } | ||
1123 | }; | ||
1124 | |||
1125 | int main(int argc, char *argv[]) | ||
1126 | { | ||
1127 | int c; | ||
1128 | int err; | ||
1129 | char *pattern_source; | ||
1130 | |||
1131 | page_size = getpagesize(); | ||
1132 | |||
1133 | while ((c = getopt_long(argc, argv, "ad::efhil1noprstvzTS", | ||
1134 | opts, NULL)) != -1) | ||
1135 | switch(c) { | ||
1136 | case '1': | ||
1137 | show_single_ref = 1; | ||
1138 | break; | ||
1139 | case 'a': | ||
1140 | show_alias = 1; | ||
1141 | break; | ||
1142 | case 'd': | ||
1143 | set_debug = 1; | ||
1144 | if (!debug_opt_scan(optarg)) | ||
1145 | fatal("Invalid debug option '%s'\n", optarg); | ||
1146 | break; | ||
1147 | case 'e': | ||
1148 | show_empty = 1; | ||
1149 | break; | ||
1150 | case 'f': | ||
1151 | show_first_alias = 1; | ||
1152 | break; | ||
1153 | case 'h': | ||
1154 | usage(); | ||
1155 | return 0; | ||
1156 | case 'i': | ||
1157 | show_inverted = 1; | ||
1158 | break; | ||
1159 | case 'n': | ||
1160 | show_numa = 1; | ||
1161 | break; | ||
1162 | case 'o': | ||
1163 | show_ops = 1; | ||
1164 | break; | ||
1165 | case 'r': | ||
1166 | show_report = 1; | ||
1167 | break; | ||
1168 | case 's': | ||
1169 | shrink = 1; | ||
1170 | break; | ||
1171 | case 'l': | ||
1172 | show_slab = 1; | ||
1173 | break; | ||
1174 | case 't': | ||
1175 | show_track = 1; | ||
1176 | break; | ||
1177 | case 'v': | ||
1178 | validate = 1; | ||
1179 | break; | ||
1180 | case 'z': | ||
1181 | skip_zero = 0; | ||
1182 | break; | ||
1183 | case 'T': | ||
1184 | show_totals = 1; | ||
1185 | break; | ||
1186 | case 'S': | ||
1187 | sort_size = 1; | ||
1188 | break; | ||
1189 | |||
1190 | default: | ||
1191 | fatal("%s: Invalid option '%c'\n", argv[0], optopt); | ||
1192 | |||
1193 | } | ||
1194 | |||
1195 | if (!show_slab && !show_alias && !show_track && !show_report | ||
1196 | && !validate && !shrink && !set_debug && !show_ops) | ||
1197 | show_slab = 1; | ||
1198 | |||
1199 | if (argc > optind) | ||
1200 | pattern_source = argv[optind]; | ||
1201 | else | ||
1202 | pattern_source = ".*"; | ||
1203 | |||
1204 | err = regcomp(&pattern, pattern_source, REG_ICASE|REG_NOSUB); | ||
1205 | if (err) | ||
1206 | fatal("%s: Invalid pattern '%s' code %d\n", | ||
1207 | argv[0], pattern_source, err); | ||
1208 | read_slab_dir(); | ||
1209 | if (show_alias) | ||
1210 | alias(); | ||
1211 | else | ||
1212 | if (show_totals) | ||
1213 | totals(); | ||
1214 | else { | ||
1215 | link_slabs(); | ||
1216 | rename_slabs(); | ||
1217 | sort_slabs(); | ||
1218 | output_slabs(); | ||
1219 | } | ||
1220 | return 0; | ||
1221 | } | ||
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt new file mode 100644 index 000000000000..727c8d81aeaf --- /dev/null +++ b/Documentation/vm/slub.txt | |||
@@ -0,0 +1,113 @@ | |||
1 | Short users guide for SLUB | ||
2 | -------------------------- | ||
3 | |||
4 | First of all slub should transparently replace SLAB. If you enable | ||
5 | SLUB then everything should work the same (Note the word "should". | ||
6 | There is likely not much value in that word at this point). | ||
7 | |||
8 | The basic philosophy of SLUB is very different from SLAB. SLAB | ||
9 | requires rebuilding the kernel to activate debug options for all | ||
10 | SLABS. SLUB always includes full debugging but its off by default. | ||
11 | SLUB can enable debugging only for selected slabs in order to avoid | ||
12 | an impact on overall system performance which may make a bug more | ||
13 | difficult to find. | ||
14 | |||
15 | In order to switch debugging on one can add a option "slub_debug" | ||
16 | to the kernel command line. That will enable full debugging for | ||
17 | all slabs. | ||
18 | |||
19 | Typically one would then use the "slabinfo" command to get statistical | ||
20 | data and perform operation on the slabs. By default slabinfo only lists | ||
21 | slabs that have data in them. See "slabinfo -h" for more options when | ||
22 | running the command. slabinfo can be compiled with | ||
23 | |||
24 | gcc -o slabinfo Documentation/vm/slabinfo.c | ||
25 | |||
26 | Some of the modes of operation of slabinfo require that slub debugging | ||
27 | be enabled on the command line. F.e. no tracking information will be | ||
28 | available without debugging on and validation can only partially | ||
29 | be performed if debugging was not switched on. | ||
30 | |||
31 | Some more sophisticated uses of slub_debug: | ||
32 | ------------------------------------------- | ||
33 | |||
34 | Parameters may be given to slub_debug. If none is specified then full | ||
35 | debugging is enabled. Format: | ||
36 | |||
37 | slub_debug=<Debug-Options> Enable options for all slabs | ||
38 | slub_debug=<Debug-Options>,<slab name> | ||
39 | Enable options only for select slabs | ||
40 | |||
41 | Possible debug options are | ||
42 | F Sanity checks on (enables SLAB_DEBUG_FREE. Sorry | ||
43 | SLAB legacy issues) | ||
44 | Z Red zoning | ||
45 | P Poisoning (object and padding) | ||
46 | U User tracking (free and alloc) | ||
47 | T Trace (please only use on single slabs) | ||
48 | |||
49 | F.e. in order to boot just with sanity checks and red zoning one would specify: | ||
50 | |||
51 | slub_debug=FZ | ||
52 | |||
53 | Trying to find an issue in the dentry cache? Try | ||
54 | |||
55 | slub_debug=,dentry_cache | ||
56 | |||
57 | to only enable debugging on the dentry cache. | ||
58 | |||
59 | Red zoning and tracking may realign the slab. We can just apply sanity checks | ||
60 | to the dentry cache with | ||
61 | |||
62 | slub_debug=F,dentry_cache | ||
63 | |||
64 | In case you forgot to enable debugging on the kernel command line: It is | ||
65 | possible to enable debugging manually when the kernel is up. Look at the | ||
66 | contents of: | ||
67 | |||
68 | /sys/slab/<slab name>/ | ||
69 | |||
70 | Look at the writable files. Writing 1 to them will enable the | ||
71 | corresponding debug option. All options can be set on a slab that does | ||
72 | not contain objects. If the slab already contains objects then sanity checks | ||
73 | and tracing may only be enabled. The other options may cause the realignment | ||
74 | of objects. | ||
75 | |||
76 | Careful with tracing: It may spew out lots of information and never stop if | ||
77 | used on the wrong slab. | ||
78 | |||
79 | SLAB Merging | ||
80 | ------------ | ||
81 | |||
82 | If no debugging is specified then SLUB may merge similar slabs together | ||
83 | in order to reduce overhead and increase cache hotness of objects. | ||
84 | slabinfo -a displays which slabs were merged together. | ||
85 | |||
86 | Getting more performance | ||
87 | ------------------------ | ||
88 | |||
89 | To some degree SLUB's performance is limited by the need to take the | ||
90 | list_lock once in a while to deal with partial slabs. That overhead is | ||
91 | governed by the order of the allocation for each slab. The allocations | ||
92 | can be influenced by kernel parameters: | ||
93 | |||
94 | slub_min_objects=x (default 8) | ||
95 | slub_min_order=x (default 0) | ||
96 | slub_max_order=x (default 4) | ||
97 | |||
98 | slub_min_objects allows to specify how many objects must at least fit | ||
99 | into one slab in order for the allocation order to be acceptable. | ||
100 | In general slub will be able to perform this number of allocations | ||
101 | on a slab without consulting centralized resources (list_lock) where | ||
102 | contention may occur. | ||
103 | |||
104 | slub_min_order specifies a minim order of slabs. A similar effect like | ||
105 | slub_min_objects. | ||
106 | |||
107 | slub_max_order specified the order at which slub_min_objects should no | ||
108 | longer be checked. This is useful to avoid SLUB trying to generate | ||
109 | super large order pages to fit slub_min_objects of a slab cache with | ||
110 | large object sizes into one high order page. | ||
111 | |||
112 | |||
113 | Christoph Lameter, <clameter@sgi.com>, April 10, 2007 | ||
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 85f51e5a749f..6177d881983f 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -149,7 +149,19 @@ NUMA | |||
149 | 149 | ||
150 | numa=noacpi Don't parse the SRAT table for NUMA setup | 150 | numa=noacpi Don't parse the SRAT table for NUMA setup |
151 | 151 | ||
152 | numa=fake=X Fake X nodes and ignore NUMA setup of the actual machine. | 152 | numa=fake=CMDLINE |
153 | If a number, fakes CMDLINE nodes and ignores NUMA setup of the | ||
154 | actual machine. Otherwise, system memory is configured | ||
155 | depending on the sizes and coefficients listed. For example: | ||
156 | numa=fake=2*512,1024,4*256,*128 | ||
157 | gives two 512M nodes, a 1024M node, four 256M nodes, and the | ||
158 | rest split into 128M chunks. If the last character of CMDLINE | ||
159 | is a *, the remaining memory is divided up equally among its | ||
160 | coefficient: | ||
161 | numa=fake=2*512,2* | ||
162 | gives two 512M nodes and the rest split into two nodes. | ||
163 | Otherwise, the remaining system RAM is allocated to an | ||
164 | additional node. | ||
153 | 165 | ||
154 | numa=hotadd=percent | 166 | numa=hotadd=percent |
155 | Only allow hotadd memory to preallocate page structures upto | 167 | Only allow hotadd memory to preallocate page structures upto |
diff --git a/Documentation/x86_64/fake-numa-for-cpusets b/Documentation/x86_64/fake-numa-for-cpusets new file mode 100644 index 000000000000..d1a985c5b00a --- /dev/null +++ b/Documentation/x86_64/fake-numa-for-cpusets | |||
@@ -0,0 +1,66 @@ | |||
1 | Using numa=fake and CPUSets for Resource Management | ||
2 | Written by David Rientjes <rientjes@cs.washington.edu> | ||
3 | |||
4 | This document describes how the numa=fake x86_64 command-line option can be used | ||
5 | in conjunction with cpusets for coarse memory management. Using this feature, | ||
6 | you can create fake NUMA nodes that represent contiguous chunks of memory and | ||
7 | assign them to cpusets and their attached tasks. This is a way of limiting the | ||
8 | amount of system memory that are available to a certain class of tasks. | ||
9 | |||
10 | For more information on the features of cpusets, see Documentation/cpusets.txt. | ||
11 | There are a number of different configurations you can use for your needs. For | ||
12 | more information on the numa=fake command line option and its various ways of | ||
13 | configuring fake nodes, see Documentation/x86_64/boot-options.txt. | ||
14 | |||
15 | For the purposes of this introduction, we'll assume a very primitive NUMA | ||
16 | emulation setup of "numa=fake=4*512,". This will split our system memory into | ||
17 | four equal chunks of 512M each that we can now use to assign to cpusets. As | ||
18 | you become more familiar with using this combination for resource control, | ||
19 | you'll determine a better setup to minimize the number of nodes you have to deal | ||
20 | with. | ||
21 | |||
22 | A machine may be split as follows with "numa=fake=4*512," as reported by dmesg: | ||
23 | |||
24 | Faking node 0 at 0000000000000000-0000000020000000 (512MB) | ||
25 | Faking node 1 at 0000000020000000-0000000040000000 (512MB) | ||
26 | Faking node 2 at 0000000040000000-0000000060000000 (512MB) | ||
27 | Faking node 3 at 0000000060000000-0000000080000000 (512MB) | ||
28 | ... | ||
29 | On node 0 totalpages: 130975 | ||
30 | On node 1 totalpages: 131072 | ||
31 | On node 2 totalpages: 131072 | ||
32 | On node 3 totalpages: 131072 | ||
33 | |||
34 | Now following the instructions for mounting the cpusets filesystem from | ||
35 | Documentation/cpusets.txt, you can assign fake nodes (i.e. contiguous memory | ||
36 | address spaces) to individual cpusets: | ||
37 | |||
38 | [root@xroads /]# mkdir exampleset | ||
39 | [root@xroads /]# mount -t cpuset none exampleset | ||
40 | [root@xroads /]# mkdir exampleset/ddset | ||
41 | [root@xroads /]# cd exampleset/ddset | ||
42 | [root@xroads /exampleset/ddset]# echo 0-1 > cpus | ||
43 | [root@xroads /exampleset/ddset]# echo 0-1 > mems | ||
44 | |||
45 | Now this cpuset, 'ddset', will only allowed access to fake nodes 0 and 1 for | ||
46 | memory allocations (1G). | ||
47 | |||
48 | You can now assign tasks to these cpusets to limit the memory resources | ||
49 | available to them according to the fake nodes assigned as mems: | ||
50 | |||
51 | [root@xroads /exampleset/ddset]# echo $$ > tasks | ||
52 | [root@xroads /exampleset/ddset]# dd if=/dev/zero of=tmp bs=1024 count=1G | ||
53 | [1] 13425 | ||
54 | |||
55 | Notice the difference between the system memory usage as reported by | ||
56 | /proc/meminfo between the restricted cpuset case above and the unrestricted | ||
57 | case (i.e. running the same 'dd' command without assigning it to a fake NUMA | ||
58 | cpuset): | ||
59 | Unrestricted Restricted | ||
60 | MemTotal: 3091900 kB 3091900 kB | ||
61 | MemFree: 42113 kB 1513236 kB | ||
62 | |||
63 | This allows for coarse memory management for the tasks you assign to particular | ||
64 | cpusets. Since cpusets can form a hierarchy, you can create some pretty | ||
65 | interesting combinations of use-cases for various classes of tasks for your | ||
66 | memory management needs. | ||
diff --git a/Documentation/x86_64/machinecheck b/Documentation/x86_64/machinecheck index 068a6d9904b9..feaeaf6f6e4d 100644 --- a/Documentation/x86_64/machinecheck +++ b/Documentation/x86_64/machinecheck | |||
@@ -36,7 +36,12 @@ between all CPUs. | |||
36 | 36 | ||
37 | check_interval | 37 | check_interval |
38 | How often to poll for corrected machine check errors, in seconds | 38 | How often to poll for corrected machine check errors, in seconds |
39 | (Note output is hexademical). Default 5 minutes. | 39 | (Note output is hexademical). Default 5 minutes. When the poller |
40 | finds MCEs it triggers an exponential speedup (poll more often) on | ||
41 | the polling interval. When the poller stops finding MCEs, it | ||
42 | triggers an exponential backoff (poll less often) on the polling | ||
43 | interval. The check_interval variable is both the initial and | ||
44 | maximum polling interval. | ||
40 | 45 | ||
41 | tolerant | 46 | tolerant |
42 | Tolerance level. When a machine check exception occurs for a non | 47 | Tolerance level. When a machine check exception occurs for a non |