diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-17 19:22:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-17 19:22:26 -0400 |
commit | 7c672abc120a55f678e5571ae2ee93f06ca4d7f9 (patch) | |
tree | 7beebc09f9626ca8d5f7df4dded0a553de479323 | |
parent | 1902314157b19754e0ff25b44527654847cfd127 (diff) | |
parent | fe013f8bc160d79c6e33bb66d9bb0cd24949274c (diff) |
Merge tag 'docs-5.4' of git://git.lwn.net/linux
Pull documentation updates from Jonathan Corbet:
"It's a somewhat calmer cycle for docs this time, as the churn of the
mass RST conversion is happily mostly behind us.
- A new document on reproducible builds.
- We finally got around to zapping the documentation for hardware
support that was removed in 2004; one doesn't want to rush these
things.
- The usual assortment of fixes, typo corrections, etc"
* tag 'docs-5.4' of git://git.lwn.net/linux: (67 commits)
Documentation: kbuild: Add document about reproducible builds
docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]
Documentation: Add "earlycon=sbi" to the admin guide
doc:lock: remove reference to clever use of read-write lock
devices.txt: improve entry for comedi (char major 98)
docs: mtd: Update spi nor reference driver
doc: arm64: fix grammar dtb placed in no attributes region
Documentation: sysrq: don't recommend 'S' 'U' before 'B'
mailmap: Update email address for Quentin Perret
docs: ftrace: clarify when tracing is disabled by the trace file
docs: process: fix broken link
Documentation/arm/samsung-s3c24xx: Remove stray U+FEFF character to fix title
Documentation/arm/sa1100/assabet: Fix 'make assabet_defconfig' command
Documentation/arm/sa1100: Remove some obsolete documentation
docs/zh_CN: update Chinese howto.rst for latexdocs making
Documentation: virt: Fix broken reference to virt tree's index
docs: Fix typo on pull requests guide
kernel-doc: Allow anonymous enum
Documentation: sphinx: Don't parse socket() as identifier reference
Documentation: sphinx: Add missing comma to list of strings
...
249 files changed, 5169 insertions, 3963 deletions
@@ -47,6 +47,8 @@ Boris Brezillon <bbrezillon@kernel.org> <b.brezillon.dev@gmail.com> | |||
47 | Boris Brezillon <bbrezillon@kernel.org> <b.brezillon@overkiz.com> | 47 | Boris Brezillon <bbrezillon@kernel.org> <b.brezillon@overkiz.com> |
48 | Brian Avery <b.avery@hp.com> | 48 | Brian Avery <b.avery@hp.com> |
49 | Brian King <brking@us.ibm.com> | 49 | Brian King <brking@us.ibm.com> |
50 | Chao Yu <chao@kernel.org> <chao2.yu@samsung.com> | ||
51 | Chao Yu <chao@kernel.org> <yuchao0@huawei.com> | ||
50 | Christoph Hellwig <hch@lst.de> | 52 | Christoph Hellwig <hch@lst.de> |
51 | Christophe Ricard <christophe.ricard@gmail.com> | 53 | Christophe Ricard <christophe.ricard@gmail.com> |
52 | Corey Minyard <minyard@acm.org> | 54 | Corey Minyard <minyard@acm.org> |
@@ -80,6 +82,8 @@ Frank Rowand <frowand.list@gmail.com> <frowand@mvista.com> | |||
80 | Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com> | 82 | Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com> |
81 | Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com> | 83 | Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com> |
82 | Frank Zago <fzago@systemfabricworks.com> | 84 | Frank Zago <fzago@systemfabricworks.com> |
85 | Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com> | ||
86 | Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com> | ||
83 | Greg Kroah-Hartman <greg@echidna.(none)> | 87 | Greg Kroah-Hartman <greg@echidna.(none)> |
84 | Greg Kroah-Hartman <gregkh@suse.de> | 88 | Greg Kroah-Hartman <gregkh@suse.de> |
85 | Greg Kroah-Hartman <greg@kroah.com> | 89 | Greg Kroah-Hartman <greg@kroah.com> |
@@ -90,6 +94,9 @@ Henrik Kretzschmar <henne@nachtwindheim.de> | |||
90 | Henrik Rydberg <rydberg@bitmath.org> | 94 | Henrik Rydberg <rydberg@bitmath.org> |
91 | Herbert Xu <herbert@gondor.apana.org.au> | 95 | Herbert Xu <herbert@gondor.apana.org.au> |
92 | Jacob Shin <Jacob.Shin@amd.com> | 96 | Jacob Shin <Jacob.Shin@amd.com> |
97 | Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com> | ||
98 | Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com> | ||
99 | Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com> | ||
93 | James Bottomley <jejb@mulgrave.(none)> | 100 | James Bottomley <jejb@mulgrave.(none)> |
94 | James Bottomley <jejb@titanic.il.steeleye.com> | 101 | James Bottomley <jejb@titanic.il.steeleye.com> |
95 | James E Wilson <wilson@specifix.com> | 102 | James E Wilson <wilson@specifix.com> |
@@ -181,6 +188,11 @@ Nguyen Anh Quynh <aquynh@gmail.com> | |||
181 | Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> | 188 | Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> |
182 | Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> | 189 | Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> |
183 | Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> | 190 | Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> |
191 | Oleksij Rempel <linux@rempel-privat.de> <bug-track@fisher-privat.net> | ||
192 | Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com> | ||
193 | Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com> | ||
194 | Oleksij Rempel <linux@rempel-privat.de> <o.rempel@pengutronix.de> | ||
195 | Oleksij Rempel <linux@rempel-privat.de> <ore@pengutronix.de> | ||
184 | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 196 | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> |
185 | Patrick Mochel <mochel@digitalimplant.org> | 197 | Patrick Mochel <mochel@digitalimplant.org> |
186 | Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com> | 198 | Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com> |
@@ -191,11 +203,7 @@ Pratyush Anand <pratyush.anand@gmail.com> <pratyush.anand@st.com> | |||
191 | Praveen BP <praveenbp@ti.com> | 203 | Praveen BP <praveenbp@ti.com> |
192 | Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com> | 204 | Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com> |
193 | Qais Yousef <qsyousef@gmail.com> <qais.yousef@imgtec.com> | 205 | Qais Yousef <qsyousef@gmail.com> <qais.yousef@imgtec.com> |
194 | Oleksij Rempel <linux@rempel-privat.de> <bug-track@fisher-privat.net> | 206 | Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com> |
195 | Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com> | ||
196 | Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com> | ||
197 | Oleksij Rempel <linux@rempel-privat.de> <o.rempel@pengutronix.de> | ||
198 | Oleksij Rempel <linux@rempel-privat.de> <ore@pengutronix.de> | ||
199 | Rajesh Shah <rajesh.shah@intel.com> | 207 | Rajesh Shah <rajesh.shah@intel.com> |
200 | Ralf Baechle <ralf@linux-mips.org> | 208 | Ralf Baechle <ralf@linux-mips.org> |
201 | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 209 | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> |
@@ -230,6 +238,7 @@ Sumit Semwal <sumit.semwal@ti.com> | |||
230 | Tejun Heo <htejun@gmail.com> | 238 | Tejun Heo <htejun@gmail.com> |
231 | Thomas Graf <tgraf@suug.ch> | 239 | Thomas Graf <tgraf@suug.ch> |
232 | Thomas Pedersen <twp@codeaurora.org> | 240 | Thomas Pedersen <twp@codeaurora.org> |
241 | Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org> | ||
233 | Tony Luck <tony.luck@intel.com> | 242 | Tony Luck <tony.luck@intel.com> |
234 | TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn> | 243 | TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn> |
235 | TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org> | 244 | TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org> |
diff --git a/Documentation/ABI/stable/sysfs-bus-w1 b/Documentation/ABI/stable/sysfs-bus-w1 index 140d85b4ae92..992dfb183ed0 100644 --- a/Documentation/ABI/stable/sysfs-bus-w1 +++ b/Documentation/ABI/stable/sysfs-bus-w1 | |||
@@ -6,6 +6,6 @@ Description: Bus scanning interval, microseconds component. | |||
6 | control systems are attached/generate presence for as short as | 6 | control systems are attached/generate presence for as short as |
7 | 100 ms - hence the tens-to-hundreds milliseconds scan intervals | 7 | 100 ms - hence the tens-to-hundreds milliseconds scan intervals |
8 | are required. | 8 | are required. |
9 | see Documentation/w1/w1.generic for detailed information. | 9 | see Documentation/w1/w1-generic.rst for detailed information. |
10 | Users: any user space application which wants to know bus scanning | 10 | Users: any user space application which wants to know bus scanning |
11 | interval | 11 | interval |
diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28e04 b/Documentation/ABI/stable/sysfs-driver-w1_ds28e04 index 26579ee868c9..3e1c1fa8d54d 100644 --- a/Documentation/ABI/stable/sysfs-driver-w1_ds28e04 +++ b/Documentation/ABI/stable/sysfs-driver-w1_ds28e04 | |||
@@ -2,7 +2,7 @@ What: /sys/bus/w1/devices/.../pio | |||
2 | Date: May 2012 | 2 | Date: May 2012 |
3 | Contact: Markus Franke <franm@hrz.tu-chemnitz.de> | 3 | Contact: Markus Franke <franm@hrz.tu-chemnitz.de> |
4 | Description: read/write the contents of the two PIO's of the DS28E04-100 | 4 | Description: read/write the contents of the two PIO's of the DS28E04-100 |
5 | see Documentation/w1/slaves/w1_ds28e04 for detailed information | 5 | see Documentation/w1/slaves/w1_ds28e04.rst for detailed information |
6 | Users: any user space application which wants to communicate with DS28E04-100 | 6 | Users: any user space application which wants to communicate with DS28E04-100 |
7 | 7 | ||
8 | 8 | ||
@@ -11,5 +11,5 @@ What: /sys/bus/w1/devices/.../eeprom | |||
11 | Date: May 2012 | 11 | Date: May 2012 |
12 | Contact: Markus Franke <franm@hrz.tu-chemnitz.de> | 12 | Contact: Markus Franke <franm@hrz.tu-chemnitz.de> |
13 | Description: read/write the contents of the EEPROM memory of the DS28E04-100 | 13 | Description: read/write the contents of the EEPROM memory of the DS28E04-100 |
14 | see Documentation/w1/slaves/w1_ds28e04 for detailed information | 14 | see Documentation/w1/slaves/w1_ds28e04.rst for detailed information |
15 | Users: any user space application which wants to communicate with DS28E04-100 | 15 | Users: any user space application which wants to communicate with DS28E04-100 |
diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 index e928def14f28..534e63731a49 100644 --- a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 +++ b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 | |||
@@ -2,5 +2,5 @@ What: /sys/bus/w1/devices/.../w1_seq | |||
2 | Date: Apr 2015 | 2 | Date: Apr 2015 |
3 | Contact: Matt Campbell <mattrcampbell@gmail.com> | 3 | Contact: Matt Campbell <mattrcampbell@gmail.com> |
4 | Description: Support for the DS28EA00 chain sequence function | 4 | Description: Support for the DS28EA00 chain sequence function |
5 | see Documentation/w1/slaves/w1_therm for detailed information | 5 | see Documentation/w1/slaves/w1_therm.rst for detailed information |
6 | Users: any user space application which wants to communicate with DS28EA00 | 6 | Users: any user space application which wants to communicate with DS28EA00 |
diff --git a/Documentation/admin-guide/auxdisplay/cfag12864b.rst b/Documentation/admin-guide/auxdisplay/cfag12864b.rst new file mode 100644 index 000000000000..18c2865bd322 --- /dev/null +++ b/Documentation/admin-guide/auxdisplay/cfag12864b.rst | |||
@@ -0,0 +1,98 @@ | |||
1 | =================================== | ||
2 | cfag12864b LCD Driver Documentation | ||
3 | =================================== | ||
4 | |||
5 | :License: GPLv2 | ||
6 | :Author & Maintainer: Miguel Ojeda Sandonis | ||
7 | :Date: 2006-10-27 | ||
8 | |||
9 | |||
10 | |||
11 | .. INDEX | ||
12 | |||
13 | 1. DRIVER INFORMATION | ||
14 | 2. DEVICE INFORMATION | ||
15 | 3. WIRING | ||
16 | 4. USERSPACE PROGRAMMING | ||
17 | |||
18 | 1. Driver Information | ||
19 | --------------------- | ||
20 | |||
21 | This driver supports a cfag12864b LCD. | ||
22 | |||
23 | |||
24 | 2. Device Information | ||
25 | --------------------- | ||
26 | |||
27 | :Manufacturer: Crystalfontz | ||
28 | :Device Name: Crystalfontz 12864b LCD Series | ||
29 | :Device Code: cfag12864b | ||
30 | :Webpage: http://www.crystalfontz.com | ||
31 | :Device Webpage: http://www.crystalfontz.com/products/12864b/ | ||
32 | :Type: LCD (Liquid Crystal Display) | ||
33 | :Width: 128 | ||
34 | :Height: 64 | ||
35 | :Colors: 2 (B/N) | ||
36 | :Controller: ks0108 | ||
37 | :Controllers: 2 | ||
38 | :Pages: 8 each controller | ||
39 | :Addresses: 64 each page | ||
40 | :Data size: 1 byte each address | ||
41 | :Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte | ||
42 | |||
43 | |||
44 | 3. Wiring | ||
45 | --------- | ||
46 | |||
47 | The cfag12864b LCD Series don't have official wiring. | ||
48 | |||
49 | The common wiring is done to the parallel port as shown:: | ||
50 | |||
51 | Parallel Port cfag12864b | ||
52 | |||
53 | Name Pin# Pin# Name | ||
54 | |||
55 | Strobe ( 1)------------------------------(17) Enable | ||
56 | Data 0 ( 2)------------------------------( 4) Data 0 | ||
57 | Data 1 ( 3)------------------------------( 5) Data 1 | ||
58 | Data 2 ( 4)------------------------------( 6) Data 2 | ||
59 | Data 3 ( 5)------------------------------( 7) Data 3 | ||
60 | Data 4 ( 6)------------------------------( 8) Data 4 | ||
61 | Data 5 ( 7)------------------------------( 9) Data 5 | ||
62 | Data 6 ( 8)------------------------------(10) Data 6 | ||
63 | Data 7 ( 9)------------------------------(11) Data 7 | ||
64 | (10) [+5v]---( 1) Vdd | ||
65 | (11) [GND]---( 2) Ground | ||
66 | (12) [+5v]---(14) Reset | ||
67 | (13) [GND]---(15) Read / Write | ||
68 | Line (14)------------------------------(13) Controller Select 1 | ||
69 | (15) | ||
70 | Init (16)------------------------------(12) Controller Select 2 | ||
71 | Select (17)------------------------------(16) Data / Instruction | ||
72 | Ground (18)---[GND] [+5v]---(19) LED + | ||
73 | Ground (19)---[GND] | ||
74 | Ground (20)---[GND] E A Values: | ||
75 | Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm | ||
76 | Ground (22)---[GND] | - P1 = Preset = 10 Kohm | ||
77 | Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm | ||
78 | Ground (24)---[GND] | | | ||
79 | Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - | ||
80 | |||
81 | |||
82 | 4. Userspace Programming | ||
83 | ------------------------ | ||
84 | |||
85 | The cfag12864bfb describes a framebuffer device (/dev/fbX). | ||
86 | |||
87 | It has a size of 1024 bytes = 1 Kbyte. | ||
88 | Each bit represents one pixel. If the bit is high, the pixel will | ||
89 | turn on. If the pixel is low, the pixel will turn off. | ||
90 | |||
91 | You can use the framebuffer as a file: fopen, fwrite, fclose... | ||
92 | Although the LCD won't get updated until the next refresh time arrives. | ||
93 | |||
94 | Also, you can mmap the framebuffer: open & mmap, munmap & close... | ||
95 | which is the best option for most uses. | ||
96 | |||
97 | Check samples/auxdisplay/cfag12864b-example.c | ||
98 | for a real working userspace complete program with usage examples. | ||
diff --git a/Documentation/admin-guide/auxdisplay/index.rst b/Documentation/admin-guide/auxdisplay/index.rst new file mode 100644 index 000000000000..e466f0595248 --- /dev/null +++ b/Documentation/admin-guide/auxdisplay/index.rst | |||
@@ -0,0 +1,16 @@ | |||
1 | ========================= | ||
2 | Auxiliary Display Support | ||
3 | ========================= | ||
4 | |||
5 | .. toctree:: | ||
6 | :maxdepth: 1 | ||
7 | |||
8 | ks0108.rst | ||
9 | cfag12864b.rst | ||
10 | |||
11 | .. only:: subproject and html | ||
12 | |||
13 | Indices | ||
14 | ======= | ||
15 | |||
16 | * :ref:`genindex` | ||
diff --git a/Documentation/admin-guide/auxdisplay/ks0108.rst b/Documentation/admin-guide/auxdisplay/ks0108.rst new file mode 100644 index 000000000000..c0b7faf73136 --- /dev/null +++ b/Documentation/admin-guide/auxdisplay/ks0108.rst | |||
@@ -0,0 +1,50 @@ | |||
1 | ========================================== | ||
2 | ks0108 LCD Controller Driver Documentation | ||
3 | ========================================== | ||
4 | |||
5 | :License: GPLv2 | ||
6 | :Author & Maintainer: Miguel Ojeda Sandonis | ||
7 | :Date: 2006-10-27 | ||
8 | |||
9 | |||
10 | |||
11 | .. INDEX | ||
12 | |||
13 | 1. DRIVER INFORMATION | ||
14 | 2. DEVICE INFORMATION | ||
15 | 3. WIRING | ||
16 | |||
17 | |||
18 | 1. Driver Information | ||
19 | --------------------- | ||
20 | |||
21 | This driver supports the ks0108 LCD controller. | ||
22 | |||
23 | |||
24 | 2. Device Information | ||
25 | --------------------- | ||
26 | |||
27 | :Manufacturer: Samsung | ||
28 | :Device Name: KS0108 LCD Controller | ||
29 | :Device Code: ks0108 | ||
30 | :Webpage: - | ||
31 | :Device Webpage: - | ||
32 | :Type: LCD Controller (Liquid Crystal Display Controller) | ||
33 | :Width: 64 | ||
34 | :Height: 64 | ||
35 | :Colors: 2 (B/N) | ||
36 | :Pages: 8 | ||
37 | :Addresses: 64 each page | ||
38 | :Data size: 1 byte each address | ||
39 | :Memory size: 8 * 64 * 1 = 512 bytes | ||
40 | |||
41 | |||
42 | 3. Wiring | ||
43 | --------- | ||
44 | |||
45 | The driver supports data parallel port wiring. | ||
46 | |||
47 | If you aren't building LCD related hardware, you should check | ||
48 | your LCD specific wiring information in the same folder. | ||
49 | |||
50 | For example, check Documentation/admin-guide/auxdisplay/cfag12864b.rst | ||
diff --git a/Documentation/admin-guide/cgroup-v1/blkio-controller.rst b/Documentation/admin-guide/cgroup-v1/blkio-controller.rst index 1d7d962933be..36d43ae7dc13 100644 --- a/Documentation/admin-guide/cgroup-v1/blkio-controller.rst +++ b/Documentation/admin-guide/cgroup-v1/blkio-controller.rst | |||
@@ -130,12 +130,6 @@ Proportional weight policy files | |||
130 | dev weight | 130 | dev weight |
131 | 8:16 300 | 131 | 8:16 300 |
132 | 132 | ||
133 | - blkio.leaf_weight[_device] | ||
134 | - Equivalents of blkio.weight[_device] for the purpose of | ||
135 | deciding how much weight tasks in the given cgroup has while | ||
136 | competing with the cgroup's child cgroups. For details, | ||
137 | please refer to Documentation/block/cfq-iosched.txt. | ||
138 | |||
139 | - blkio.time | 133 | - blkio.time |
140 | - disk time allocated to cgroup per device in milliseconds. First | 134 | - disk time allocated to cgroup per device in milliseconds. First |
141 | two fields specify the major and minor number of the device and | 135 | two fields specify the major and minor number of the device and |
diff --git a/Documentation/filesystems/cifs/AUTHORS b/Documentation/admin-guide/cifs/authors.rst index 75865da2ce14..b02d6dd6c070 100644 --- a/Documentation/filesystems/cifs/AUTHORS +++ b/Documentation/admin-guide/cifs/authors.rst | |||
@@ -1,5 +1,10 @@ | |||
1 | ======= | ||
2 | Authors | ||
3 | ======= | ||
4 | |||
1 | Original Author | 5 | Original Author |
2 | =============== | 6 | --------------- |
7 | |||
3 | Steve French (sfrench@samba.org) | 8 | Steve French (sfrench@samba.org) |
4 | 9 | ||
5 | The author wishes to express his appreciation and thanks to: | 10 | The author wishes to express his appreciation and thanks to: |
@@ -12,7 +17,7 @@ side of the original CIFS Unix extensions and reviewing and implementing | |||
12 | portions of the newer CIFS POSIX extensions into the Samba 3 file server. Thank | 17 | portions of the newer CIFS POSIX extensions into the Samba 3 file server. Thank |
13 | Dave Boutcher of IBM Rochester (author of the OS/400 smb/cifs filesystem client) | 18 | Dave Boutcher of IBM Rochester (author of the OS/400 smb/cifs filesystem client) |
14 | for proving years ago that very good smb/cifs clients could be done on Unix-like | 19 | for proving years ago that very good smb/cifs clients could be done on Unix-like |
15 | operating systems. Volker Lendecke, Andrew Tridgell, Urban Widmark, John | 20 | operating systems. Volker Lendecke, Andrew Tridgell, Urban Widmark, John |
16 | Newbigin and others for their work on the Linux smbfs module. Thanks to | 21 | Newbigin and others for their work on the Linux smbfs module. Thanks to |
17 | the other members of the Storage Network Industry Association CIFS Technical | 22 | the other members of the Storage Network Industry Association CIFS Technical |
18 | Workgroup for their work specifying this highly complex protocol and finally | 23 | Workgroup for their work specifying this highly complex protocol and finally |
@@ -20,33 +25,34 @@ thanks to the Samba team for their technical advice and encouragement. | |||
20 | 25 | ||
21 | Patch Contributors | 26 | Patch Contributors |
22 | ------------------ | 27 | ------------------ |
23 | Zwane Mwaikambo | 28 | |
24 | Andi Kleen | 29 | - Zwane Mwaikambo |
25 | Amrut Joshi | 30 | - Andi Kleen |
26 | Shobhit Dayal | 31 | - Amrut Joshi |
27 | Sergey Vlasov | 32 | - Shobhit Dayal |
28 | Richard Hughes | 33 | - Sergey Vlasov |
29 | Yury Umanets | 34 | - Richard Hughes |
30 | Mark Hamzy (for some of the early cifs IPv6 work) | 35 | - Yury Umanets |
31 | Domen Puncer | 36 | - Mark Hamzy (for some of the early cifs IPv6 work) |
32 | Jesper Juhl (in particular for lots of whitespace/formatting cleanup) | 37 | - Domen Puncer |
33 | Vince Negri and Dave Stahl (for finding an important caching bug) | 38 | - Jesper Juhl (in particular for lots of whitespace/formatting cleanup) |
34 | Adrian Bunk (kcalloc cleanups) | 39 | - Vince Negri and Dave Stahl (for finding an important caching bug) |
35 | Miklos Szeredi | 40 | - Adrian Bunk (kcalloc cleanups) |
36 | Kazeon team for various fixes especially for 2.4 version. | 41 | - Miklos Szeredi |
37 | Asser Ferno (Change Notify support) | 42 | - Kazeon team for various fixes especially for 2.4 version. |
38 | Shaggy (Dave Kleikamp) for innumerable small fs suggestions and some good cleanup | 43 | - Asser Ferno (Change Notify support) |
39 | Gunter Kukkukk (testing and suggestions for support of old servers) | 44 | - Shaggy (Dave Kleikamp) for innumerable small fs suggestions and some good cleanup |
40 | Igor Mammedov (DFS support) | 45 | - Gunter Kukkukk (testing and suggestions for support of old servers) |
41 | Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) | 46 | - Igor Mammedov (DFS support) |
42 | Scott Lovenberg | 47 | - Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) |
43 | Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) | 48 | - Scott Lovenberg |
44 | Aurelien Aptel (for DFS SMB3 work and some key bug fixes) | 49 | - Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) |
45 | Ronnie Sahlberg (for SMB3 xattr work, bug fixes, and lots of great work on compounding) | 50 | - Aurelien Aptel (for DFS SMB3 work and some key bug fixes) |
46 | Shirish Pargaonkar (for many ACL patches over the years) | 51 | - Ronnie Sahlberg (for SMB3 xattr work, bug fixes, and lots of great work on compounding) |
47 | Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security) | 52 | - Shirish Pargaonkar (for many ACL patches over the years) |
48 | Paulo Alcantara | 53 | - Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security) |
49 | Long Li (some great work on RDMA, SMB Direct) | 54 | - Paulo Alcantara |
55 | - Long Li (some great work on RDMA, SMB Direct) | ||
50 | 56 | ||
51 | 57 | ||
52 | Test case and Bug Report contributors | 58 | Test case and Bug Report contributors |
diff --git a/Documentation/filesystems/cifs/CHANGES b/Documentation/admin-guide/cifs/changes.rst index 1df7f4910eb2..71f2ecb62299 100644 --- a/Documentation/filesystems/cifs/CHANGES +++ b/Documentation/admin-guide/cifs/changes.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ======= | ||
2 | Changes | ||
3 | ======= | ||
4 | |||
1 | See https://wiki.samba.org/index.php/LinuxCIFSKernel for summary | 5 | See https://wiki.samba.org/index.php/LinuxCIFSKernel for summary |
2 | information (that may be easier to read than parsing the output of | 6 | information (that may be easier to read than parsing the output of |
3 | "git log fs/cifs") about fixes/improvements to CIFS/SMB2/SMB3 support (changes | 7 | "git log fs/cifs") about fixes/improvements to CIFS/SMB2/SMB3 support (changes |
diff --git a/Documentation/admin-guide/cifs/index.rst b/Documentation/admin-guide/cifs/index.rst new file mode 100644 index 000000000000..fad5268635f5 --- /dev/null +++ b/Documentation/admin-guide/cifs/index.rst | |||
@@ -0,0 +1,21 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ==== | ||
4 | CIFS | ||
5 | ==== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | introduction | ||
11 | usage | ||
12 | todo | ||
13 | changes | ||
14 | authors | ||
15 | |||
16 | .. only:: subproject and html | ||
17 | |||
18 | Indices | ||
19 | ======= | ||
20 | |||
21 | * :ref:`genindex` | ||
diff --git a/Documentation/filesystems/cifs/cifs.txt b/Documentation/admin-guide/cifs/introduction.rst index 1be3d21c286e..0b98f672d36f 100644 --- a/Documentation/filesystems/cifs/cifs.txt +++ b/Documentation/admin-guide/cifs/introduction.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ============ | ||
2 | Introduction | ||
3 | ============ | ||
4 | |||
1 | This is the client VFS module for the SMB3 NAS protocol as well | 5 | This is the client VFS module for the SMB3 NAS protocol as well |
2 | as for older dialects such as the Common Internet File System (CIFS) | 6 | as for older dialects such as the Common Internet File System (CIFS) |
3 | protocol which was the successor to the Server Message Block | 7 | protocol which was the successor to the Server Message Block |
@@ -33,7 +37,9 @@ | |||
33 | tools (including smbinfo and setcifsacl) that can be obtained from | 37 | tools (including smbinfo and setcifsacl) that can be obtained from |
34 | 38 | ||
35 | https://git.samba.org/?p=cifs-utils.git | 39 | https://git.samba.org/?p=cifs-utils.git |
40 | |||
36 | or | 41 | or |
42 | |||
37 | git://git.samba.org/cifs-utils.git | 43 | git://git.samba.org/cifs-utils.git |
38 | 44 | ||
39 | mount.cifs should be installed in the directory with the other mount helpers. | 45 | mount.cifs should be installed in the directory with the other mount helpers. |
@@ -41,5 +47,7 @@ | |||
41 | For more information on the module see the project wiki page at | 47 | For more information on the module see the project wiki page at |
42 | 48 | ||
43 | https://wiki.samba.org/index.php/LinuxCIFS | 49 | https://wiki.samba.org/index.php/LinuxCIFS |
50 | |||
44 | and | 51 | and |
52 | |||
45 | https://wiki.samba.org/index.php/LinuxCIFS_utils | 53 | https://wiki.samba.org/index.php/LinuxCIFS_utils |
diff --git a/Documentation/filesystems/cifs/TODO b/Documentation/admin-guide/cifs/todo.rst index edbbccda1942..084c25f92dcb 100644 --- a/Documentation/filesystems/cifs/TODO +++ b/Documentation/admin-guide/cifs/todo.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ==== | ||
2 | TODO | ||
3 | ==== | ||
4 | |||
1 | Version 2.14 December 21, 2018 | 5 | Version 2.14 December 21, 2018 |
2 | 6 | ||
3 | A Partial List of Missing Features | 7 | A Partial List of Missing Features |
@@ -8,55 +12,58 @@ for visible, important contributions to this module. Here | |||
8 | is a partial list of the known problems and missing features: | 12 | is a partial list of the known problems and missing features: |
9 | 13 | ||
10 | a) SMB3 (and SMB3.1.1) missing optional features: | 14 | a) SMB3 (and SMB3.1.1) missing optional features: |
15 | |||
11 | - multichannel (started), integration with RDMA | 16 | - multichannel (started), integration with RDMA |
12 | - directory leases (improved metadata caching), started (root dir only) | 17 | - directory leases (improved metadata caching), started (root dir only) |
13 | - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl | 18 | - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl |
14 | currently the only two server side copy mechanisms supported) | 19 | currently the only two server side copy mechanisms supported) |
15 | 20 | ||
16 | b) improved sparse file support (fiemap and SEEK_HOLE are implemented | 21 | b) improved sparse file support (fiemap and SEEK_HOLE are implemented |
17 | but additional features would be supportable by the protocol). | 22 | but additional features would be supportable by the protocol). |
18 | 23 | ||
19 | c) Directory entry caching relies on a 1 second timer, rather than | 24 | c) Directory entry caching relies on a 1 second timer, rather than |
20 | using Directory Leases, currently only the root file handle is cached longer | 25 | using Directory Leases, currently only the root file handle is cached longer |
21 | 26 | ||
22 | d) quota support (needs minor kernel change since quota calls | 27 | d) quota support (needs minor kernel change since quota calls |
23 | to make it to network filesystems or deviceless filesystems) | 28 | to make it to network filesystems or deviceless filesystems) |
24 | 29 | ||
25 | e) Additional use cases can be optimized to use "compounding" | 30 | e) Additional use cases can be optimized to use "compounding" (e.g. |
26 | (e.g. open/query/close and open/setinfo/close) to reduce the number | 31 | open/query/close and open/setinfo/close) to reduce the number of |
27 | of roundtrips to the server and improve performance. Various cases | 32 | roundtrips to the server and improve performance. Various cases |
28 | (stat, statfs, create, unlink, mkdir) already have been improved by | 33 | (stat, statfs, create, unlink, mkdir) already have been improved by |
29 | using compounding but more can be done. In addition we could significantly | 34 | using compounding but more can be done. In addition we could |
30 | reduce redundant opens by using deferred close (with handle caching leases) | 35 | significantly reduce redundant opens by using deferred close (with |
31 | and better using reference counters on file handles. | 36 | handle caching leases) and better using reference counters on file |
37 | handles. | ||
32 | 38 | ||
33 | f) Finish inotify support so kde and gnome file list windows | 39 | f) Finish inotify support so kde and gnome file list windows |
34 | will autorefresh (partially complete by Asser). Needs minor kernel | 40 | will autorefresh (partially complete by Asser). Needs minor kernel |
35 | vfs change to support removing D_NOTIFY on a file. | 41 | vfs change to support removing D_NOTIFY on a file. |
36 | 42 | ||
37 | g) Add GUI tool to configure /proc/fs/cifs settings and for display of | 43 | g) Add GUI tool to configure /proc/fs/cifs settings and for display of |
38 | the CIFS statistics (started) | 44 | the CIFS statistics (started) |
39 | 45 | ||
40 | h) implement support for security and trusted categories of xattrs | 46 | h) implement support for security and trusted categories of xattrs |
41 | (requires minor protocol extension) to enable better support for SELINUX | 47 | (requires minor protocol extension) to enable better support for SELINUX |
42 | 48 | ||
43 | i) Add support for tree connect contexts (see MS-SMB2) a new SMB3.1.1 protocol | 49 | i) Add support for tree connect contexts (see MS-SMB2) a new SMB3.1.1 protocol |
44 | feature (may be especially useful for virtualization). | 50 | feature (may be especially useful for virtualization). |
45 | 51 | ||
46 | j) Create UID mapping facility so server UIDs can be mapped on a per | 52 | j) Create UID mapping facility so server UIDs can be mapped on a per |
47 | mount or a per server basis to client UIDs or nobody if no mapping | 53 | mount or a per server basis to client UIDs or nobody if no mapping |
48 | exists. Also better integration with winbind for resolving SID owners | 54 | exists. Also better integration with winbind for resolving SID owners |
49 | 55 | ||
50 | k) Add tools to take advantage of more smb3 specific ioctls and features | 56 | k) Add tools to take advantage of more smb3 specific ioctls and features |
51 | (passthrough ioctl/fsctl is now implemented in cifs.ko to allow sending | 57 | (passthrough ioctl/fsctl is now implemented in cifs.ko to allow |
52 | various SMB3 fsctls and query info and set info calls directly from user space) | 58 | sending various SMB3 fsctls and query info and set info calls |
53 | Add tools to make setting various non-POSIX metadata attributes easier | 59 | directly from user space) Add tools to make setting various non-POSIX |
54 | from tools (e.g. extending what was done in smb-info tool). | 60 | metadata attributes easier from tools (e.g. extending what was done |
61 | in smb-info tool). | ||
55 | 62 | ||
56 | l) encrypted file support | 63 | l) encrypted file support |
57 | 64 | ||
58 | m) improved stats gathering tools (perhaps integration with nfsometer?) | 65 | m) improved stats gathering tools (perhaps integration with nfsometer?) |
59 | to extend and make easier to use what is currently in /proc/fs/cifs/Stats | 66 | to extend and make easier to use what is currently in /proc/fs/cifs/Stats |
60 | 67 | ||
61 | n) Add support for claims based ACLs ("DAC") | 68 | n) Add support for claims based ACLs ("DAC") |
62 | 69 | ||
@@ -69,57 +76,58 @@ p) Add support for witness protocol (perhaps ioctl to cifs.ko from user space | |||
69 | different servers, and the server we are connected to has gone down. | 76 | different servers, and the server we are connected to has gone down. |
70 | 77 | ||
71 | q) Allow mount.cifs to be more verbose in reporting errors with dialect | 78 | q) Allow mount.cifs to be more verbose in reporting errors with dialect |
72 | or unsupported feature errors. | 79 | or unsupported feature errors. |
73 | 80 | ||
74 | r) updating cifs documentation, and user guide. | 81 | r) updating cifs documentation, and user guide. |
75 | 82 | ||
76 | s) Addressing bugs found by running a broader set of xfstests in standard | 83 | s) Addressing bugs found by running a broader set of xfstests in standard |
77 | file system xfstest suite. | 84 | file system xfstest suite. |
78 | 85 | ||
79 | t) split cifs and smb3 support into separate modules so legacy (and less | 86 | t) split cifs and smb3 support into separate modules so legacy (and less |
80 | secure) CIFS dialect can be disabled in environments that don't need it | 87 | secure) CIFS dialect can be disabled in environments that don't need it |
81 | and simplify the code. | 88 | and simplify the code. |
82 | 89 | ||
83 | v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added | 90 | v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added |
84 | so far). | 91 | so far). |
85 | 92 | ||
86 | w) Add support for additional strong encryption types, and additional spnego | 93 | w) Add support for additional strong encryption types, and additional spnego |
87 | authentication mechanisms (see MS-SMB2) | 94 | authentication mechanisms (see MS-SMB2) |
88 | 95 | ||
89 | x) Finish support for SMB3.1.1 compression | 96 | x) Finish support for SMB3.1.1 compression |
90 | 97 | ||
91 | KNOWN BUGS | 98 | Known Bugs |
92 | ==================================== | 99 | ========== |
100 | |||
93 | See http://bugzilla.samba.org - search on product "CifsVFS" for | 101 | See http://bugzilla.samba.org - search on product "CifsVFS" for |
94 | current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS) | 102 | current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS) |
95 | 103 | ||
96 | 1) existing symbolic links (Windows reparse points) are recognized but | 104 | 1) existing symbolic links (Windows reparse points) are recognized but |
97 | can not be created remotely. They are implemented for Samba and those that | 105 | can not be created remotely. They are implemented for Samba and those that |
98 | support the CIFS Unix extensions, although earlier versions of Samba | 106 | support the CIFS Unix extensions, although earlier versions of Samba |
99 | overly restrict the pathnames. | 107 | overly restrict the pathnames. |
100 | 2) follow_link and readdir code does not follow dfs junctions | 108 | 2) follow_link and readdir code does not follow dfs junctions |
101 | but recognizes them | 109 | but recognizes them |
102 | 110 | ||
103 | Misc testing to do | 111 | Misc testing to do |
104 | ================== | 112 | ================== |
105 | 1) check out max path names and max path name components against various server | 113 | 1) check out max path names and max path name components against various server |
106 | types. Try nested symlinks (8 deep). Return max path name in stat -f information | 114 | types. Try nested symlinks (8 deep). Return max path name in stat -f information |
107 | 115 | ||
108 | 2) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test | 116 | 2) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test |
109 | cifs/smb3 better | 117 | cifs/smb3 better |
110 | 118 | ||
111 | 3) Additional performance testing and optimization using iozone and similar - | 119 | 3) Additional performance testing and optimization using iozone and similar - |
112 | there are some easy changes that can be done to parallelize sequential writes, | 120 | there are some easy changes that can be done to parallelize sequential writes, |
113 | and when signing is disabled to request larger read sizes (larger than | 121 | and when signing is disabled to request larger read sizes (larger than |
114 | negotiated size) and send larger write sizes to modern servers. | 122 | negotiated size) and send larger write sizes to modern servers. |
115 | 123 | ||
116 | 4) More exhaustively test against less common servers | 124 | 4) More exhaustively test against less common servers |
117 | 125 | ||
118 | 5) Continue to extend the smb3 "buildbot" which does automated xfstesting | 126 | 5) Continue to extend the smb3 "buildbot" which does automated xfstesting |
119 | against Windows, Samba and Azure currently - to add additional tests and | 127 | against Windows, Samba and Azure currently - to add additional tests and |
120 | to allow the buildbot to execute the tests faster. The URL for the | 128 | to allow the buildbot to execute the tests faster. The URL for the |
121 | buildbot is: http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com | 129 | buildbot is: http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com |
122 | 130 | ||
123 | 6) Address various coverity warnings (most are not bugs per-se, but | 131 | 6) Address various coverity warnings (most are not bugs per-se, but |
124 | the more warnings are addressed, the easier it is to spot real | 132 | the more warnings are addressed, the easier it is to spot real |
125 | problems that static analyzers will point out in the future). | 133 | problems that static analyzers will point out in the future). |
diff --git a/Documentation/filesystems/cifs/README b/Documentation/admin-guide/cifs/usage.rst index 4a804619cff2..d3fb67b8a976 100644 --- a/Documentation/filesystems/cifs/README +++ b/Documentation/admin-guide/cifs/usage.rst | |||
@@ -1,53 +1,61 @@ | |||
1 | ===== | ||
2 | Usage | ||
3 | ===== | ||
4 | |||
1 | This module supports the SMB3 family of advanced network protocols (as well | 5 | This module supports the SMB3 family of advanced network protocols (as well |
2 | as older dialects, originally called "CIFS" or SMB1). | 6 | as older dialects, originally called "CIFS" or SMB1). |
3 | 7 | ||
4 | The CIFS VFS module for Linux supports many advanced network filesystem | 8 | The CIFS VFS module for Linux supports many advanced network filesystem |
5 | features such as hierarchical DFS like namespace, hardlinks, locking and more. | 9 | features such as hierarchical DFS like namespace, hardlinks, locking and more. |
6 | It was designed to comply with the SNIA CIFS Technical Reference (which | 10 | It was designed to comply with the SNIA CIFS Technical Reference (which |
7 | supersedes the 1992 X/Open SMB Standard) as well as to perform best practice | 11 | supersedes the 1992 X/Open SMB Standard) as well as to perform best practice |
8 | practical interoperability with Windows 2000, Windows XP, Samba and equivalent | 12 | practical interoperability with Windows 2000, Windows XP, Samba and equivalent |
9 | servers. This code was developed in participation with the Protocol Freedom | 13 | servers. This code was developed in participation with the Protocol Freedom |
10 | Information Foundation. CIFS and now SMB3 has now become a defacto | 14 | Information Foundation. CIFS and now SMB3 has now become a defacto |
11 | standard for interoperating between Macs and Windows and major NAS appliances. | 15 | standard for interoperating between Macs and Windows and major NAS appliances. |
12 | 16 | ||
13 | Please see | 17 | Please see |
14 | MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification) | 18 | MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification) |
15 | http://protocolfreedom.org/ and | 19 | http://protocolfreedom.org/ and |
16 | http://samba.org/samba/PFIF/ | 20 | http://samba.org/samba/PFIF/ |
17 | for more details. | 21 | for more details. |
18 | 22 | ||
19 | 23 | ||
20 | For questions or bug reports please contact: | 24 | For questions or bug reports please contact: |
25 | |||
21 | smfrench@gmail.com | 26 | smfrench@gmail.com |
22 | 27 | ||
23 | See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils | 28 | See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils |
24 | 29 | ||
25 | Build instructions: | 30 | Build instructions |
26 | ================== | 31 | ================== |
32 | |||
27 | For Linux: | 33 | For Linux: |
34 | |||
28 | 1) Download the kernel (e.g. from http://www.kernel.org) | 35 | 1) Download the kernel (e.g. from http://www.kernel.org) |
29 | and change directory into the top of the kernel directory tree | 36 | and change directory into the top of the kernel directory tree |
30 | (e.g. /usr/src/linux-2.5.73) | 37 | (e.g. /usr/src/linux-2.5.73) |
31 | 2) make menuconfig (or make xconfig) | 38 | 2) make menuconfig (or make xconfig) |
32 | 3) select cifs from within the network filesystem choices | 39 | 3) select cifs from within the network filesystem choices |
33 | 4) save and exit | 40 | 4) save and exit |
34 | 5) make | 41 | 5) make |
35 | 42 | ||
36 | 43 | ||
37 | Installation instructions: | 44 | Installation instructions |
38 | ========================= | 45 | ========================= |
46 | |||
39 | If you have built the CIFS vfs as module (successfully) simply | 47 | If you have built the CIFS vfs as module (successfully) simply |
40 | type "make modules_install" (or if you prefer, manually copy the file to | 48 | type ``make modules_install`` (or if you prefer, manually copy the file to |
41 | the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko). | 49 | the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko). |
42 | 50 | ||
43 | If you have built the CIFS vfs into the kernel itself, follow the instructions | 51 | If you have built the CIFS vfs into the kernel itself, follow the instructions |
44 | for your distribution on how to install a new kernel (usually you | 52 | for your distribution on how to install a new kernel (usually you |
45 | would simply type "make install"). | 53 | would simply type ``make install``). |
46 | 54 | ||
47 | If you do not have the utility mount.cifs (in the Samba 4.x source tree and on | 55 | If you do not have the utility mount.cifs (in the Samba 4.x source tree and on |
48 | the CIFS VFS web site) copy it to the same directory in which mount helpers | 56 | the CIFS VFS web site) copy it to the same directory in which mount helpers |
49 | reside (usually /sbin). Although the helper software is not | 57 | reside (usually /sbin). Although the helper software is not |
50 | required, mount.cifs is recommended. Most distros include a "cifs-utils" | 58 | required, mount.cifs is recommended. Most distros include a ``cifs-utils`` |
51 | package that includes this utility so it is recommended to install this. | 59 | package that includes this utility so it is recommended to install this. |
52 | 60 | ||
53 | Note that running the Winbind pam/nss module (logon service) on all of your | 61 | Note that running the Winbind pam/nss module (logon service) on all of your |
@@ -57,13 +65,16 @@ found at cifs-utils.git on git.samba.org | |||
57 | 65 | ||
58 | If cifs is built as a module, then the size and number of network buffers | 66 | If cifs is built as a module, then the size and number of network buffers |
59 | and maximum number of simultaneous requests to one server can be configured. | 67 | and maximum number of simultaneous requests to one server can be configured. |
60 | Changing these from their defaults is not recommended. By executing modinfo | 68 | Changing these from their defaults is not recommended. By executing modinfo:: |
69 | |||
61 | modinfo kernel/fs/cifs/cifs.ko | 70 | modinfo kernel/fs/cifs/cifs.ko |
71 | |||
62 | on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made | 72 | on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made |
63 | at module initialization time (by running insmod cifs.ko) can be seen. | 73 | at module initialization time (by running insmod cifs.ko) can be seen. |
64 | 74 | ||
65 | Recommendations | 75 | Recommendations |
66 | =============== | 76 | =============== |
77 | |||
67 | To improve security the SMB2.1 dialect or later (usually will get SMB3) is now | 78 | To improve security the SMB2.1 dialect or later (usually will get SMB3) is now |
68 | the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" | 79 | the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" |
69 | on mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is | 80 | on mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is |
@@ -72,156 +83,168 @@ many advanced security features such as downgrade attack detection | |||
72 | and encrypted shares and stronger signing and authentication algorithms. | 83 | and encrypted shares and stronger signing and authentication algorithms. |
73 | There are additional mount options that may be helpful for SMB3 to get | 84 | There are additional mount options that may be helpful for SMB3 to get |
74 | improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1): | 85 | improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1): |
75 | "mfsymlinks" and "cifsacl" and "idsfromsid" | 86 | |
87 | ``mfsymlinks`` and ``cifsacl`` and ``idsfromsid`` | ||
76 | 88 | ||
77 | Allowing User Mounts | 89 | Allowing User Mounts |
78 | ==================== | 90 | ==================== |
91 | |||
79 | To permit users to mount and unmount over directories they own is possible | 92 | To permit users to mount and unmount over directories they own is possible |
80 | with the cifs vfs. A way to enable such mounting is to mark the mount.cifs | 93 | with the cifs vfs. A way to enable such mounting is to mark the mount.cifs |
81 | utility as suid (e.g. "chmod +s /sbin/mount.cifs). To enable users to | 94 | utility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to |
82 | umount shares they mount requires | 95 | umount shares they mount requires |
96 | |||
83 | 1) mount.cifs version 1.4 or later | 97 | 1) mount.cifs version 1.4 or later |
84 | 2) an entry for the share in /etc/fstab indicating that a user may | 98 | 2) an entry for the share in /etc/fstab indicating that a user may |
85 | unmount it e.g. | 99 | unmount it e.g.:: |
86 | //server/usersharename /mnt/username cifs user 0 0 | 100 | |
101 | //server/usersharename /mnt/username cifs user 0 0 | ||
87 | 102 | ||
88 | Note that when the mount.cifs utility is run suid (allowing user mounts), | 103 | Note that when the mount.cifs utility is run suid (allowing user mounts), |
89 | in order to reduce risks, the "nosuid" mount flag is passed in on mount to | 104 | in order to reduce risks, the ``nosuid`` mount flag is passed in on mount to |
90 | disallow execution of an suid program mounted on the remote target. | 105 | disallow execution of an suid program mounted on the remote target. |
91 | When mount is executed as root, nosuid is not passed in by default, | 106 | When mount is executed as root, nosuid is not passed in by default, |
92 | and execution of suid programs on the remote target would be enabled | 107 | and execution of suid programs on the remote target would be enabled |
93 | by default. This can be changed, as with nfs and other filesystems, | 108 | by default. This can be changed, as with nfs and other filesystems, |
94 | by simply specifying "nosuid" among the mount options. For user mounts | 109 | by simply specifying ``nosuid`` among the mount options. For user mounts |
95 | though to be able to pass the suid flag to mount requires rebuilding | 110 | though to be able to pass the suid flag to mount requires rebuilding |
96 | mount.cifs with the following flag: CIFS_ALLOW_USR_SUID | 111 | mount.cifs with the following flag: CIFS_ALLOW_USR_SUID |
97 | 112 | ||
98 | There is a corresponding manual page for cifs mounting in the Samba 3.0 and | 113 | There is a corresponding manual page for cifs mounting in the Samba 3.0 and |
99 | later source tree in docs/manpages/mount.cifs.8 | 114 | later source tree in docs/manpages/mount.cifs.8 |
100 | 115 | ||
101 | Allowing User Unmounts | 116 | Allowing User Unmounts |
102 | ====================== | 117 | ====================== |
118 | |||
103 | To permit users to ummount directories that they have user mounted (see above), | 119 | To permit users to ummount directories that they have user mounted (see above), |
104 | the utility umount.cifs may be used. It may be invoked directly, or if | 120 | the utility umount.cifs may be used. It may be invoked directly, or if |
105 | umount.cifs is placed in /sbin, umount can invoke the cifs umount helper | 121 | umount.cifs is placed in /sbin, umount can invoke the cifs umount helper |
106 | (at least for most versions of the umount utility) for umount of cifs | 122 | (at least for most versions of the umount utility) for umount of cifs |
107 | mounts, unless umount is invoked with -i (which will avoid invoking a umount | 123 | mounts, unless umount is invoked with -i (which will avoid invoking a umount |
108 | helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked | 124 | helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked |
109 | as suid (e.g. "chmod +s /sbin/umount.cifs") or equivalent (some distributions | 125 | as suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions |
110 | allow adding entries to a file to the /etc/permissions file to achieve the | 126 | allow adding entries to a file to the /etc/permissions file to achieve the |
111 | equivalent suid effect). For this utility to succeed the target path | 127 | equivalent suid effect). For this utility to succeed the target path |
112 | must be a cifs mount, and the uid of the current user must match the uid | 128 | must be a cifs mount, and the uid of the current user must match the uid |
113 | of the user who mounted the resource. | 129 | of the user who mounted the resource. |
114 | 130 | ||
115 | Also note that the customary way of allowing user mounts and unmounts is | 131 | Also note that the customary way of allowing user mounts and unmounts is |
116 | (instead of using mount.cifs and unmount.cifs as suid) to add a line | 132 | (instead of using mount.cifs and unmount.cifs as suid) to add a line |
117 | to the file /etc/fstab for each //server/share you wish to mount, but | 133 | to the file /etc/fstab for each //server/share you wish to mount, but |
118 | this can become unwieldy when potential mount targets include many | 134 | this can become unwieldy when potential mount targets include many |
119 | or unpredictable UNC names. | 135 | or unpredictable UNC names. |
120 | 136 | ||
121 | Samba Considerations | 137 | Samba Considerations |
122 | ==================== | 138 | ==================== |
139 | |||
123 | Most current servers support SMB2.1 and SMB3 which are more secure, | 140 | Most current servers support SMB2.1 and SMB3 which are more secure, |
124 | but there are useful protocol extensions for the older less secure CIFS | 141 | but there are useful protocol extensions for the older less secure CIFS |
125 | dialect, so to get the maximum benefit if mounting using the older dialect | 142 | dialect, so to get the maximum benefit if mounting using the older dialect |
126 | (CIFS/SMB1), we recommend using a server that supports the SNIA CIFS | 143 | (CIFS/SMB1), we recommend using a server that supports the SNIA CIFS |
127 | Unix Extensions standard (e.g. almost any version of Samba ie version | 144 | Unix Extensions standard (e.g. almost any version of Samba ie version |
128 | 2.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers. | 145 | 2.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers. |
129 | Note that uid, gid and file permissions will display default values if you do | 146 | Note that uid, gid and file permissions will display default values if you do |
130 | not have a server that supports the Unix extensions for CIFS (such as Samba | 147 | not have a server that supports the Unix extensions for CIFS (such as Samba |
131 | 2.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add | 148 | 2.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add |
132 | the line: | 149 | the line:: |
133 | 150 | ||
134 | unix extensions = yes | 151 | unix extensions = yes |
135 | 152 | ||
136 | to your smb.conf file on the server. Note that the following smb.conf settings | 153 | to your smb.conf file on the server. Note that the following smb.conf settings |
137 | are also useful (on the Samba server) when the majority of clients are Unix or | 154 | are also useful (on the Samba server) when the majority of clients are Unix or |
138 | Linux: | 155 | Linux:: |
139 | 156 | ||
140 | case sensitive = yes | 157 | case sensitive = yes |
141 | delete readonly = yes | 158 | delete readonly = yes |
142 | ea support = yes | 159 | ea support = yes |
143 | 160 | ||
144 | Note that server ea support is required for supporting xattrs from the Linux | 161 | Note that server ea support is required for supporting xattrs from the Linux |
145 | cifs client, and that EA support is present in later versions of Samba (e.g. | 162 | cifs client, and that EA support is present in later versions of Samba (e.g. |
146 | 3.0.6 and later (also EA support works in all versions of Windows, at least to | 163 | 3.0.6 and later (also EA support works in all versions of Windows, at least to |
147 | shares on NTFS filesystems). Extended Attribute (xattr) support is an optional | 164 | shares on NTFS filesystems). Extended Attribute (xattr) support is an optional |
148 | feature of most Linux filesystems which may require enabling via | 165 | feature of most Linux filesystems which may require enabling via |
149 | make menuconfig. Client support for extended attributes (user xattr) can be | 166 | make menuconfig. Client support for extended attributes (user xattr) can be |
150 | disabled on a per-mount basis by specifying "nouser_xattr" on mount. | 167 | disabled on a per-mount basis by specifying ``nouser_xattr`` on mount. |
151 | 168 | ||
152 | The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers | 169 | The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers |
153 | version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and | 170 | version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and |
154 | then POSIX support in the CIFS configuration options when building the cifs | 171 | then POSIX support in the CIFS configuration options when building the cifs |
155 | module. POSIX ACL support can be disabled on a per mount basic by specifying | 172 | module. POSIX ACL support can be disabled on a per mount basic by specifying |
156 | "noacl" on mount. | 173 | ``noacl`` on mount. |
157 | 174 | ||
158 | Some administrators may want to change Samba's smb.conf "map archive" and | 175 | Some administrators may want to change Samba's smb.conf ``map archive`` and |
159 | "create mask" parameters from the default. Unless the create mask is changed | 176 | ``create mask`` parameters from the default. Unless the create mask is changed |
160 | newly created files can end up with an unnecessarily restrictive default mode, | 177 | newly created files can end up with an unnecessarily restrictive default mode, |
161 | which may not be what you want, although if the CIFS Unix extensions are | 178 | which may not be what you want, although if the CIFS Unix extensions are |
162 | enabled on the server and client, subsequent setattr calls (e.g. chmod) can | 179 | enabled on the server and client, subsequent setattr calls (e.g. chmod) can |
163 | fix the mode. Note that creating special devices (mknod) remotely | 180 | fix the mode. Note that creating special devices (mknod) remotely |
164 | may require specifying a mkdev function to Samba if you are not using | 181 | may require specifying a mkdev function to Samba if you are not using |
165 | Samba 3.0.6 or later. For more information on these see the manual pages | 182 | Samba 3.0.6 or later. For more information on these see the manual pages |
166 | ("man smb.conf") on the Samba server system. Note that the cifs vfs, | 183 | (``man smb.conf``) on the Samba server system. Note that the cifs vfs, |
167 | unlike the smbfs vfs, does not read the smb.conf on the client system | 184 | unlike the smbfs vfs, does not read the smb.conf on the client system |
168 | (the few optional settings are passed in on mount via -o parameters instead). | 185 | (the few optional settings are passed in on mount via -o parameters instead). |
169 | Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete | 186 | Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete |
170 | open files (required for strict POSIX compliance). Windows Servers already | 187 | open files (required for strict POSIX compliance). Windows Servers already |
171 | supported this feature. Samba server does not allow symlinks that refer to files | 188 | supported this feature. Samba server does not allow symlinks that refer to files |
172 | outside of the share, so in Samba versions prior to 3.0.6, most symlinks to | 189 | outside of the share, so in Samba versions prior to 3.0.6, most symlinks to |
173 | files with absolute paths (ie beginning with slash) such as: | 190 | files with absolute paths (ie beginning with slash) such as:: |
191 | |||
174 | ln -s /mnt/foo bar | 192 | ln -s /mnt/foo bar |
175 | would be forbidden. Samba 3.0.6 server or later includes the ability to create | 193 | |
176 | such symlinks safely by converting unsafe symlinks (ie symlinks to server | 194 | would be forbidden. Samba 3.0.6 server or later includes the ability to create |
195 | such symlinks safely by converting unsafe symlinks (ie symlinks to server | ||
177 | files that are outside of the share) to a samba specific format on the server | 196 | files that are outside of the share) to a samba specific format on the server |
178 | that is ignored by local server applications and non-cifs clients and that will | 197 | that is ignored by local server applications and non-cifs clients and that will |
179 | not be traversed by the Samba server). This is opaque to the Linux client | 198 | not be traversed by the Samba server). This is opaque to the Linux client |
180 | application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or | 199 | application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or |
181 | later, but only for remote clients using the CIFS Unix extensions, and will | 200 | later, but only for remote clients using the CIFS Unix extensions, and will |
182 | be invisbile to Windows clients and typically will not affect local | 201 | be invisbile to Windows clients and typically will not affect local |
183 | applications running on the same server as Samba. | 202 | applications running on the same server as Samba. |
184 | 203 | ||
185 | Use instructions: | 204 | Use instructions |
186 | ================ | 205 | ================ |
187 | Once the CIFS VFS support is built into the kernel or installed as a module | 206 | |
207 | Once the CIFS VFS support is built into the kernel or installed as a module | ||
188 | (cifs.ko), you can use mount syntax like the following to access Samba or | 208 | (cifs.ko), you can use mount syntax like the following to access Samba or |
189 | Mac or Windows servers: | 209 | Mac or Windows servers:: |
190 | 210 | ||
191 | mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword | 211 | mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword |
192 | 212 | ||
193 | Before -o the option -v may be specified to make the mount.cifs | 213 | Before -o the option -v may be specified to make the mount.cifs |
194 | mount helper display the mount steps more verbosely. | 214 | mount helper display the mount steps more verbosely. |
195 | After -o the following commonly used cifs vfs specific options | 215 | After -o the following commonly used cifs vfs specific options |
196 | are supported: | 216 | are supported:: |
197 | 217 | ||
198 | username=<username> | 218 | username=<username> |
199 | password=<password> | 219 | password=<password> |
200 | domain=<domain name> | 220 | domain=<domain name> |
201 | 221 | ||
202 | Other cifs mount options are described below. Use of TCP names (in addition to | 222 | Other cifs mount options are described below. Use of TCP names (in addition to |
203 | ip addresses) is available if the mount helper (mount.cifs) is installed. If | 223 | ip addresses) is available if the mount helper (mount.cifs) is installed. If |
204 | you do not trust the server to which are mounted, or if you do not have | 224 | you do not trust the server to which are mounted, or if you do not have |
205 | cifs signing enabled (and the physical network is insecure), consider use | 225 | cifs signing enabled (and the physical network is insecure), consider use |
206 | of the standard mount options "noexec" and "nosuid" to reduce the risk of | 226 | of the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of |
207 | running an altered binary on your local system (downloaded from a hostile server | 227 | running an altered binary on your local system (downloaded from a hostile server |
208 | or altered by a hostile router). | 228 | or altered by a hostile router). |
209 | 229 | ||
210 | Although mounting using format corresponding to the CIFS URL specification is | 230 | Although mounting using format corresponding to the CIFS URL specification is |
211 | not possible in mount.cifs yet, it is possible to use an alternate format | 231 | not possible in mount.cifs yet, it is possible to use an alternate format |
212 | for the server and sharename (which is somewhat similar to NFS style mount | 232 | for the server and sharename (which is somewhat similar to NFS style mount |
213 | syntax) instead of the more widely used UNC format (i.e. \\server\share): | 233 | syntax) instead of the more widely used UNC format (i.e. \\server\share):: |
234 | |||
214 | mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd | 235 | mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd |
215 | 236 | ||
216 | When using the mount helper mount.cifs, passwords may be specified via alternate | 237 | When using the mount helper mount.cifs, passwords may be specified via alternate |
217 | mechanisms, instead of specifying it after -o using the normal "pass=" syntax | 238 | mechanisms, instead of specifying it after -o using the normal ``pass=`` syntax |
218 | on the command line: | 239 | on the command line: |
219 | 1) By including it in a credential file. Specify credentials=filename as one | 240 | 1) By including it in a credential file. Specify credentials=filename as one |
220 | of the mount options. Credential files contain two lines | 241 | of the mount options. Credential files contain two lines:: |
221 | username=someuser | 242 | |
222 | password=your_password | 243 | username=someuser |
244 | password=your_password | ||
245 | |||
223 | 2) By specifying the password in the PASSWD environment variable (similarly | 246 | 2) By specifying the password in the PASSWD environment variable (similarly |
224 | the user name can be taken from the USER environment variable). | 247 | the user name can be taken from the USER environment variable). |
225 | 3) By specifying the password in a file by name via PASSWD_FILE | 248 | 3) By specifying the password in a file by name via PASSWD_FILE |
226 | 4) By specifying the password in a file by file descriptor via PASSWD_FD | 249 | 4) By specifying the password in a file by file descriptor via PASSWD_FD |
227 | 250 | ||
@@ -229,39 +252,47 @@ If no password is provided, mount.cifs will prompt for password entry | |||
229 | 252 | ||
230 | Restrictions | 253 | Restrictions |
231 | ============ | 254 | ============ |
232 | Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC | 255 | |
233 | 1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a | 256 | Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC |
257 | 1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a | ||
234 | problem as most servers support this. | 258 | problem as most servers support this. |
235 | 259 | ||
236 | Valid filenames differ between Windows and Linux. Windows typically restricts | 260 | Valid filenames differ between Windows and Linux. Windows typically restricts |
237 | filenames which contain certain reserved characters (e.g.the character : | 261 | filenames which contain certain reserved characters (e.g.the character : |
238 | which is used to delimit the beginning of a stream name by Windows), while | 262 | which is used to delimit the beginning of a stream name by Windows), while |
239 | Linux allows a slightly wider set of valid characters in filenames. Windows | 263 | Linux allows a slightly wider set of valid characters in filenames. Windows |
240 | servers can remap such characters when an explicit mapping is specified in | 264 | servers can remap such characters when an explicit mapping is specified in |
241 | the Server's registry. Samba starting with version 3.10 will allow such | 265 | the Server's registry. Samba starting with version 3.10 will allow such |
242 | filenames (ie those which contain valid Linux characters, which normally | 266 | filenames (ie those which contain valid Linux characters, which normally |
243 | would be forbidden for Windows/CIFS semantics) as long as the server is | 267 | would be forbidden for Windows/CIFS semantics) as long as the server is |
244 | configured for Unix Extensions (and the client has not disabled | 268 | configured for Unix Extensions (and the client has not disabled |
245 | /proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option | 269 | /proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option |
246 | "mapposix" can be used on CIFS (vers=1.0) to force the mapping of | 270 | ``mapposix`` can be used on CIFS (vers=1.0) to force the mapping of |
247 | illegal Windows/NTFS/SMB characters to a remap range (this mount parm | 271 | illegal Windows/NTFS/SMB characters to a remap range (this mount parm |
248 | is the default for SMB3). This remap ("mapposix") range is also | 272 | is the default for SMB3). This remap (``mapposix``) range is also |
249 | compatible with Mac (and "Services for Mac" on some older Windows). | 273 | compatible with Mac (and "Services for Mac" on some older Windows). |
250 | 274 | ||
251 | CIFS VFS Mount Options | 275 | CIFS VFS Mount Options |
252 | ====================== | 276 | ====================== |
253 | A partial list of the supported mount options follows: | 277 | A partial list of the supported mount options follows: |
254 | username The user name to use when trying to establish | 278 | |
279 | username | ||
280 | The user name to use when trying to establish | ||
255 | the CIFS session. | 281 | the CIFS session. |
256 | password The user password. If the mount helper is | 282 | password |
283 | The user password. If the mount helper is | ||
257 | installed, the user will be prompted for password | 284 | installed, the user will be prompted for password |
258 | if not supplied. | 285 | if not supplied. |
259 | ip The ip address of the target server | 286 | ip |
260 | unc The target server Universal Network Name (export) to | 287 | The ip address of the target server |
261 | mount. | 288 | unc |
262 | domain Set the SMB/CIFS workgroup name prepended to the | 289 | The target server Universal Network Name (export) to |
290 | mount. | ||
291 | domain | ||
292 | Set the SMB/CIFS workgroup name prepended to the | ||
263 | username during CIFS session establishment | 293 | username during CIFS session establishment |
264 | forceuid Set the default uid for inodes to the uid | 294 | forceuid |
295 | Set the default uid for inodes to the uid | ||
265 | passed in on mount. For mounts to servers | 296 | passed in on mount. For mounts to servers |
266 | which do support the CIFS Unix extensions, such as a | 297 | which do support the CIFS Unix extensions, such as a |
267 | properly configured Samba server, the server provides | 298 | properly configured Samba server, the server provides |
@@ -276,32 +307,39 @@ A partial list of the supported mount options follows: | |||
276 | extensions, the default uid (and gid) returned on lookup | 307 | extensions, the default uid (and gid) returned on lookup |
277 | of existing files will be the uid (gid) of the person | 308 | of existing files will be the uid (gid) of the person |
278 | who executed the mount (root, except when mount.cifs | 309 | who executed the mount (root, except when mount.cifs |
279 | is configured setuid for user mounts) unless the "uid=" | 310 | is configured setuid for user mounts) unless the ``uid=`` |
280 | (gid) mount option is specified. Also note that permission | 311 | (gid) mount option is specified. Also note that permission |
281 | checks (authorization checks) on accesses to a file occur | 312 | checks (authorization checks) on accesses to a file occur |
282 | at the server, but there are cases in which an administrator | 313 | at the server, but there are cases in which an administrator |
283 | may want to restrict at the client as well. For those | 314 | may want to restrict at the client as well. For those |
284 | servers which do not report a uid/gid owner | 315 | servers which do not report a uid/gid owner |
285 | (such as Windows), permissions can also be checked at the | 316 | (such as Windows), permissions can also be checked at the |
286 | client, and a crude form of client side permission checking | 317 | client, and a crude form of client side permission checking |
287 | can be enabled by specifying file_mode and dir_mode on | 318 | can be enabled by specifying file_mode and dir_mode on |
288 | the client. (default) | 319 | the client. (default) |
289 | forcegid (similar to above but for the groupid instead of uid) (default) | 320 | forcegid |
290 | noforceuid Fill in file owner information (uid) by requesting it from | 321 | (similar to above but for the groupid instead of uid) (default) |
322 | noforceuid | ||
323 | Fill in file owner information (uid) by requesting it from | ||
291 | the server if possible. With this option, the value given in | 324 | the server if possible. With this option, the value given in |
292 | the uid= option (on mount) will only be used if the server | 325 | the uid= option (on mount) will only be used if the server |
293 | can not support returning uids on inodes. | 326 | can not support returning uids on inodes. |
294 | noforcegid (similar to above but for the group owner, gid, instead of uid) | 327 | noforcegid |
295 | uid Set the default uid for inodes, and indicate to the | 328 | (similar to above but for the group owner, gid, instead of uid) |
329 | uid | ||
330 | Set the default uid for inodes, and indicate to the | ||
296 | cifs kernel driver which local user mounted. If the server | 331 | cifs kernel driver which local user mounted. If the server |
297 | supports the unix extensions the default uid is | 332 | supports the unix extensions the default uid is |
298 | not used to fill in the owner fields of inodes (files) | 333 | not used to fill in the owner fields of inodes (files) |
299 | unless the "forceuid" parameter is specified. | 334 | unless the ``forceuid`` parameter is specified. |
300 | gid Set the default gid for inodes (similar to above). | 335 | gid |
301 | file_mode If CIFS Unix extensions are not supported by the server | 336 | Set the default gid for inodes (similar to above). |
337 | file_mode | ||
338 | If CIFS Unix extensions are not supported by the server | ||
302 | this overrides the default mode for file inodes. | 339 | this overrides the default mode for file inodes. |
303 | fsc Enable local disk caching using FS-Cache (off by default). This | 340 | fsc |
304 | option could be useful to improve performance on a slow link, | 341 | Enable local disk caching using FS-Cache (off by default). This |
342 | option could be useful to improve performance on a slow link, | ||
305 | heavily loaded server and/or network where reading from the | 343 | heavily loaded server and/or network where reading from the |
306 | disk is faster than reading from the server (over the network). | 344 | disk is faster than reading from the server (over the network). |
307 | This could also impact scalability positively as the | 345 | This could also impact scalability positively as the |
@@ -310,18 +348,22 @@ A partial list of the supported mount options follows: | |||
310 | type workloads. So, you need to consider carefully your | 348 | type workloads. So, you need to consider carefully your |
311 | workload/scenario before using this option. Currently, local | 349 | workload/scenario before using this option. Currently, local |
312 | disk caching is functional for CIFS files opened as read-only. | 350 | disk caching is functional for CIFS files opened as read-only. |
313 | dir_mode If CIFS Unix extensions are not supported by the server | 351 | dir_mode |
352 | If CIFS Unix extensions are not supported by the server | ||
314 | this overrides the default mode for directory inodes. | 353 | this overrides the default mode for directory inodes. |
315 | port attempt to contact the server on this tcp port, before | 354 | port |
355 | attempt to contact the server on this tcp port, before | ||
316 | trying the usual ports (port 445, then 139). | 356 | trying the usual ports (port 445, then 139). |
317 | iocharset Codepage used to convert local path names to and from | 357 | iocharset |
358 | Codepage used to convert local path names to and from | ||
318 | Unicode. Unicode is used by default for network path | 359 | Unicode. Unicode is used by default for network path |
319 | names if the server supports it. If iocharset is | 360 | names if the server supports it. If iocharset is |
320 | not specified then the nls_default specified | 361 | not specified then the nls_default specified |
321 | during the local client kernel build will be used. | 362 | during the local client kernel build will be used. |
322 | If server does not support Unicode, this parameter is | 363 | If server does not support Unicode, this parameter is |
323 | unused. | 364 | unused. |
324 | rsize default read size (usually 16K). The client currently | 365 | rsize |
366 | default read size (usually 16K). The client currently | ||
325 | can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize | 367 | can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize |
326 | defaults to 16K and may be changed (from 8K to the maximum | 368 | defaults to 16K and may be changed (from 8K to the maximum |
327 | kmalloc size allowed by your kernel) at module install time | 369 | kmalloc size allowed by your kernel) at module install time |
@@ -333,10 +375,12 @@ A partial list of the supported mount options follows: | |||
333 | newer servers (e.g. Samba 3.0.26 or later) do. rsize can be | 375 | newer servers (e.g. Samba 3.0.26 or later) do. rsize can be |
334 | set from a minimum of 2048 to a maximum of 130048 (127K or | 376 | set from a minimum of 2048 to a maximum of 130048 (127K or |
335 | CIFSMaxBufSize, whichever is smaller) | 377 | CIFSMaxBufSize, whichever is smaller) |
336 | wsize default write size (default 57344) | 378 | wsize |
379 | default write size (default 57344) | ||
337 | maximum wsize currently allowed by CIFS is 57344 (fourteen | 380 | maximum wsize currently allowed by CIFS is 57344 (fourteen |
338 | 4096 byte pages) | 381 | 4096 byte pages) |
339 | actimeo=n attribute cache timeout in seconds (default 1 second). | 382 | actimeo=n |
383 | attribute cache timeout in seconds (default 1 second). | ||
340 | After this timeout, the cifs client requests fresh attribute | 384 | After this timeout, the cifs client requests fresh attribute |
341 | information from the server. This option allows to tune the | 385 | information from the server. This option allows to tune the |
342 | attribute cache timeout to suit the workload needs. Shorter | 386 | attribute cache timeout to suit the workload needs. Shorter |
@@ -345,49 +389,67 @@ A partial list of the supported mount options follows: | |||
345 | of calls to the server at the expense of less stricter cache | 389 | of calls to the server at the expense of less stricter cache |
346 | coherency checks (i.e. incorrect attribute cache for a short | 390 | coherency checks (i.e. incorrect attribute cache for a short |
347 | period of time). | 391 | period of time). |
348 | rw mount the network share read-write (note that the | 392 | rw |
393 | mount the network share read-write (note that the | ||
349 | server may still consider the share read-only) | 394 | server may still consider the share read-only) |
350 | ro mount network share read-only | 395 | ro |
351 | version used to distinguish different versions of the | 396 | mount network share read-only |
397 | version | ||
398 | used to distinguish different versions of the | ||
352 | mount helper utility (not typically needed) | 399 | mount helper utility (not typically needed) |
353 | sep if first mount option (after the -o), overrides | 400 | sep |
401 | if first mount option (after the -o), overrides | ||
354 | the comma as the separator between the mount | 402 | the comma as the separator between the mount |
355 | parms. e.g. | 403 | parms. e.g.:: |
404 | |||
356 | -o user=myname,password=mypassword,domain=mydom | 405 | -o user=myname,password=mypassword,domain=mydom |
357 | could be passed instead with period as the separator by | 406 | |
407 | could be passed instead with period as the separator by:: | ||
408 | |||
358 | -o sep=.user=myname.password=mypassword.domain=mydom | 409 | -o sep=.user=myname.password=mypassword.domain=mydom |
410 | |||
359 | this might be useful when comma is contained within username | 411 | this might be useful when comma is contained within username |
360 | or password or domain. This option is less important | 412 | or password or domain. This option is less important |
361 | when the cifs mount helper cifs.mount (version 1.1 or later) | 413 | when the cifs mount helper cifs.mount (version 1.1 or later) |
362 | is used. | 414 | is used. |
363 | nosuid Do not allow remote executables with the suid bit | 415 | nosuid |
416 | Do not allow remote executables with the suid bit | ||
364 | program to be executed. This is only meaningful for mounts | 417 | program to be executed. This is only meaningful for mounts |
365 | to servers such as Samba which support the CIFS Unix Extensions. | 418 | to servers such as Samba which support the CIFS Unix Extensions. |
366 | If you do not trust the servers in your network (your mount | 419 | If you do not trust the servers in your network (your mount |
367 | targets) it is recommended that you specify this option for | 420 | targets) it is recommended that you specify this option for |
368 | greater security. | 421 | greater security. |
369 | exec Permit execution of binaries on the mount. | 422 | exec |
370 | noexec Do not permit execution of binaries on the mount. | 423 | Permit execution of binaries on the mount. |
371 | dev Recognize block devices on the remote mount. | 424 | noexec |
372 | nodev Do not recognize devices on the remote mount. | 425 | Do not permit execution of binaries on the mount. |
373 | suid Allow remote files on this mountpoint with suid enabled to | 426 | dev |
427 | Recognize block devices on the remote mount. | ||
428 | nodev | ||
429 | Do not recognize devices on the remote mount. | ||
430 | suid | ||
431 | Allow remote files on this mountpoint with suid enabled to | ||
374 | be executed (default for mounts when executed as root, | 432 | be executed (default for mounts when executed as root, |
375 | nosuid is default for user mounts). | 433 | nosuid is default for user mounts). |
376 | credentials Although ignored by the cifs kernel component, it is used by | 434 | credentials |
435 | Although ignored by the cifs kernel component, it is used by | ||
377 | the mount helper, mount.cifs. When mount.cifs is installed it | 436 | the mount helper, mount.cifs. When mount.cifs is installed it |
378 | opens and reads the credential file specified in order | 437 | opens and reads the credential file specified in order |
379 | to obtain the userid and password arguments which are passed to | 438 | to obtain the userid and password arguments which are passed to |
380 | the cifs vfs. | 439 | the cifs vfs. |
381 | guest Although ignored by the kernel component, the mount.cifs | 440 | guest |
441 | Although ignored by the kernel component, the mount.cifs | ||
382 | mount helper will not prompt the user for a password | 442 | mount helper will not prompt the user for a password |
383 | if guest is specified on the mount options. If no | 443 | if guest is specified on the mount options. If no |
384 | password is specified a null password will be used. | 444 | password is specified a null password will be used. |
385 | perm Client does permission checks (vfs_permission check of uid | 445 | perm |
446 | Client does permission checks (vfs_permission check of uid | ||
386 | and gid of the file against the mode and desired operation), | 447 | and gid of the file against the mode and desired operation), |
387 | Note that this is in addition to the normal ACL check on the | 448 | Note that this is in addition to the normal ACL check on the |
388 | target machine done by the server software. | 449 | target machine done by the server software. |
389 | Client permission checking is enabled by default. | 450 | Client permission checking is enabled by default. |
390 | noperm Client does not do permission checks. This can expose | 451 | noperm |
452 | Client does not do permission checks. This can expose | ||
391 | files on this mount to access by other users on the local | 453 | files on this mount to access by other users on the local |
392 | client system. It is typically only needed when the server | 454 | client system. It is typically only needed when the server |
393 | supports the CIFS Unix Extensions but the UIDs/GIDs on the | 455 | supports the CIFS Unix Extensions but the UIDs/GIDs on the |
@@ -399,7 +461,8 @@ A partial list of the supported mount options follows: | |||
399 | Note that this does not affect the normal ACL check on the | 461 | Note that this does not affect the normal ACL check on the |
400 | target machine done by the server software (of the server | 462 | target machine done by the server software (of the server |
401 | ACL against the user name provided at mount time). | 463 | ACL against the user name provided at mount time). |
402 | serverino Use server's inode numbers instead of generating automatically | 464 | serverino |
465 | Use server's inode numbers instead of generating automatically | ||
403 | incrementing inode numbers on the client. Although this will | 466 | incrementing inode numbers on the client. Although this will |
404 | make it easier to spot hardlinked files (as they will have | 467 | make it easier to spot hardlinked files (as they will have |
405 | the same inode numbers) and inode numbers may be persistent, | 468 | the same inode numbers) and inode numbers may be persistent, |
@@ -412,14 +475,16 @@ A partial list of the supported mount options follows: | |||
412 | or the CIFS Unix Extensions equivalent and for those | 475 | or the CIFS Unix Extensions equivalent and for those |
413 | this mount option will have no effect. Exporting cifs mounts | 476 | this mount option will have no effect. Exporting cifs mounts |
414 | under nfsd requires this mount option on the cifs mount. | 477 | under nfsd requires this mount option on the cifs mount. |
415 | This is now the default if server supports the | 478 | This is now the default if server supports the |
416 | required network operation. | 479 | required network operation. |
417 | noserverino Client generates inode numbers (rather than using the actual one | 480 | noserverino |
481 | Client generates inode numbers (rather than using the actual one | ||
418 | from the server). These inode numbers will vary after | 482 | from the server). These inode numbers will vary after |
419 | unmount or reboot which can confuse some applications, | 483 | unmount or reboot which can confuse some applications, |
420 | but not all server filesystems support unique inode | 484 | but not all server filesystems support unique inode |
421 | numbers. | 485 | numbers. |
422 | setuids If the CIFS Unix extensions are negotiated with the server | 486 | setuids |
487 | If the CIFS Unix extensions are negotiated with the server | ||
423 | the client will attempt to set the effective uid and gid of | 488 | the client will attempt to set the effective uid and gid of |
424 | the local process on newly created files, directories, and | 489 | the local process on newly created files, directories, and |
425 | devices (create, mkdir, mknod). If the CIFS Unix Extensions | 490 | devices (create, mkdir, mknod). If the CIFS Unix Extensions |
@@ -427,9 +492,10 @@ A partial list of the supported mount options follows: | |||
427 | instead of using the default uid and gid specified on | 492 | instead of using the default uid and gid specified on |
428 | the mount, cache the new file's uid and gid locally which means | 493 | the mount, cache the new file's uid and gid locally which means |
429 | that the uid for the file can change when the inode is | 494 | that the uid for the file can change when the inode is |
430 | reloaded (or the user remounts the share). | 495 | reloaded (or the user remounts the share). |
431 | nosetuids The client will not attempt to set the uid and gid on | 496 | nosetuids |
432 | on newly created files, directories, and devices (create, | 497 | The client will not attempt to set the uid and gid on |
498 | on newly created files, directories, and devices (create, | ||
433 | mkdir, mknod) which will result in the server setting the | 499 | mkdir, mknod) which will result in the server setting the |
434 | uid and gid to the default (usually the server uid of the | 500 | uid and gid to the default (usually the server uid of the |
435 | user who mounted the share). Letting the server (rather than | 501 | user who mounted the share). Letting the server (rather than |
@@ -437,38 +503,49 @@ A partial list of the supported mount options follows: | |||
437 | Unix Extensions are not negotiated then the uid and gid for | 503 | Unix Extensions are not negotiated then the uid and gid for |
438 | new files will appear to be the uid (gid) of the mounter or the | 504 | new files will appear to be the uid (gid) of the mounter or the |
439 | uid (gid) parameter specified on the mount. | 505 | uid (gid) parameter specified on the mount. |
440 | netbiosname When mounting to servers via port 139, specifies the RFC1001 | 506 | netbiosname |
441 | source name to use to represent the client netbios machine | 507 | When mounting to servers via port 139, specifies the RFC1001 |
508 | source name to use to represent the client netbios machine | ||
442 | name when doing the RFC1001 netbios session initialize. | 509 | name when doing the RFC1001 netbios session initialize. |
443 | direct Do not do inode data caching on files opened on this mount. | 510 | direct |
511 | Do not do inode data caching on files opened on this mount. | ||
444 | This precludes mmapping files on this mount. In some cases | 512 | This precludes mmapping files on this mount. In some cases |
445 | with fast networks and little or no caching benefits on the | 513 | with fast networks and little or no caching benefits on the |
446 | client (e.g. when the application is doing large sequential | 514 | client (e.g. when the application is doing large sequential |
447 | reads bigger than page size without rereading the same data) | 515 | reads bigger than page size without rereading the same data) |
448 | this can provide better performance than the default | 516 | this can provide better performance than the default |
449 | behavior which caches reads (readahead) and writes | 517 | behavior which caches reads (readahead) and writes |
450 | (writebehind) through the local Linux client pagecache | 518 | (writebehind) through the local Linux client pagecache |
451 | if oplock (caching token) is granted and held. Note that | 519 | if oplock (caching token) is granted and held. Note that |
452 | direct allows write operations larger than page size | 520 | direct allows write operations larger than page size |
453 | to be sent to the server. | 521 | to be sent to the server. |
454 | strictcache Use for switching on strict cache mode. In this mode the | 522 | strictcache |
523 | Use for switching on strict cache mode. In this mode the | ||
455 | client read from the cache all the time it has Oplock Level II, | 524 | client read from the cache all the time it has Oplock Level II, |
456 | otherwise - read from the server. All written data are stored | 525 | otherwise - read from the server. All written data are stored |
457 | in the cache, but if the client doesn't have Exclusive Oplock, | 526 | in the cache, but if the client doesn't have Exclusive Oplock, |
458 | it writes the data to the server. | 527 | it writes the data to the server. |
459 | rwpidforward Forward pid of a process who opened a file to any read or write | 528 | rwpidforward |
529 | Forward pid of a process who opened a file to any read or write | ||
460 | operation on that file. This prevent applications like WINE | 530 | operation on that file. This prevent applications like WINE |
461 | from failing on read and write if we use mandatory brlock style. | 531 | from failing on read and write if we use mandatory brlock style. |
462 | acl Allow setfacl and getfacl to manage posix ACLs if server | 532 | acl |
533 | Allow setfacl and getfacl to manage posix ACLs if server | ||
463 | supports them. (default) | 534 | supports them. (default) |
464 | noacl Do not allow setfacl and getfacl calls on this mount | 535 | noacl |
465 | user_xattr Allow getting and setting user xattrs (those attributes whose | 536 | Do not allow setfacl and getfacl calls on this mount |
466 | name begins with "user." or "os2.") as OS/2 EAs (extended | 537 | user_xattr |
538 | Allow getting and setting user xattrs (those attributes whose | ||
539 | name begins with ``user.`` or ``os2.``) as OS/2 EAs (extended | ||
467 | attributes) to the server. This allows support of the | 540 | attributes) to the server. This allows support of the |
468 | setfattr and getfattr utilities. (default) | 541 | setfattr and getfattr utilities. (default) |
469 | nouser_xattr Do not allow getfattr/setfattr to get/set/list xattrs | 542 | nouser_xattr |
470 | mapchars Translate six of the seven reserved characters (not backslash) | 543 | Do not allow getfattr/setfattr to get/set/list xattrs |
544 | mapchars | ||
545 | Translate six of the seven reserved characters (not backslash):: | ||
546 | |||
471 | *?<>|: | 547 | *?<>|: |
548 | |||
472 | to the remap range (above 0xF000), which also | 549 | to the remap range (above 0xF000), which also |
473 | allows the CIFS client to recognize files created with | 550 | allows the CIFS client to recognize files created with |
474 | such characters by Windows's POSIX emulation. This can | 551 | such characters by Windows's POSIX emulation. This can |
@@ -477,39 +554,47 @@ A partial list of the supported mount options follows: | |||
477 | whose names contain any of these seven characters). | 554 | whose names contain any of these seven characters). |
478 | This has no effect if the server does not support | 555 | This has no effect if the server does not support |
479 | Unicode on the wire. | 556 | Unicode on the wire. |
480 | nomapchars Do not translate any of these seven characters (default). | 557 | nomapchars |
481 | nocase Request case insensitive path name matching (case | 558 | Do not translate any of these seven characters (default). |
559 | nocase | ||
560 | Request case insensitive path name matching (case | ||
482 | sensitive is the default if the server supports it). | 561 | sensitive is the default if the server supports it). |
483 | (mount option "ignorecase" is identical to "nocase") | 562 | (mount option ``ignorecase`` is identical to ``nocase``) |
484 | posixpaths If CIFS Unix extensions are supported, attempt to | 563 | posixpaths |
564 | If CIFS Unix extensions are supported, attempt to | ||
485 | negotiate posix path name support which allows certain | 565 | negotiate posix path name support which allows certain |
486 | characters forbidden in typical CIFS filenames, without | 566 | characters forbidden in typical CIFS filenames, without |
487 | requiring remapping. (default) | 567 | requiring remapping. (default) |
488 | noposixpaths If CIFS Unix extensions are supported, do not request | 568 | noposixpaths |
569 | If CIFS Unix extensions are supported, do not request | ||
489 | posix path name support (this may cause servers to | 570 | posix path name support (this may cause servers to |
490 | reject creatingfile with certain reserved characters). | 571 | reject creatingfile with certain reserved characters). |
491 | nounix Disable the CIFS Unix Extensions for this mount (tree | 572 | nounix |
573 | Disable the CIFS Unix Extensions for this mount (tree | ||
492 | connection). This is rarely needed, but it may be useful | 574 | connection). This is rarely needed, but it may be useful |
493 | in order to turn off multiple settings all at once (ie | 575 | in order to turn off multiple settings all at once (ie |
494 | posix acls, posix locks, posix paths, symlink support | 576 | posix acls, posix locks, posix paths, symlink support |
495 | and retrieving uids/gids/mode from the server) or to | 577 | and retrieving uids/gids/mode from the server) or to |
496 | work around a bug in server which implement the Unix | 578 | work around a bug in server which implement the Unix |
497 | Extensions. | 579 | Extensions. |
498 | nobrl Do not send byte range lock requests to the server. | 580 | nobrl |
581 | Do not send byte range lock requests to the server. | ||
499 | This is necessary for certain applications that break | 582 | This is necessary for certain applications that break |
500 | with cifs style mandatory byte range locks (and most | 583 | with cifs style mandatory byte range locks (and most |
501 | cifs servers do not yet support requesting advisory | 584 | cifs servers do not yet support requesting advisory |
502 | byte range locks). | 585 | byte range locks). |
503 | forcemandatorylock Even if the server supports posix (advisory) byte range | 586 | forcemandatorylock |
587 | Even if the server supports posix (advisory) byte range | ||
504 | locking, send only mandatory lock requests. For some | 588 | locking, send only mandatory lock requests. For some |
505 | (presumably rare) applications, originally coded for | 589 | (presumably rare) applications, originally coded for |
506 | DOS/Windows, which require Windows style mandatory byte range | 590 | DOS/Windows, which require Windows style mandatory byte range |
507 | locking, they may be able to take advantage of this option, | 591 | locking, they may be able to take advantage of this option, |
508 | forcing the cifs client to only send mandatory locks | 592 | forcing the cifs client to only send mandatory locks |
509 | even if the cifs server would support posix advisory locks. | 593 | even if the cifs server would support posix advisory locks. |
510 | "forcemand" is accepted as a shorter form of this mount | 594 | ``forcemand`` is accepted as a shorter form of this mount |
511 | option. | 595 | option. |
512 | nostrictsync If this mount option is set, when an application does an | 596 | nostrictsync |
597 | If this mount option is set, when an application does an | ||
513 | fsync call then the cifs client does not send an SMB Flush | 598 | fsync call then the cifs client does not send an SMB Flush |
514 | to the server (to force the server to write all dirty data | 599 | to the server (to force the server to write all dirty data |
515 | for this file immediately to disk), although cifs still sends | 600 | for this file immediately to disk), although cifs still sends |
@@ -522,41 +607,50 @@ A partial list of the supported mount options follows: | |||
522 | crash. If this mount option is not set, by default cifs will | 607 | crash. If this mount option is not set, by default cifs will |
523 | send an SMB flush request (and wait for a response) on every | 608 | send an SMB flush request (and wait for a response) on every |
524 | fsync call. | 609 | fsync call. |
525 | nodfs Disable DFS (global name space support) even if the | 610 | nodfs |
611 | Disable DFS (global name space support) even if the | ||
526 | server claims to support it. This can help work around | 612 | server claims to support it. This can help work around |
527 | a problem with parsing of DFS paths with Samba server | 613 | a problem with parsing of DFS paths with Samba server |
528 | versions 3.0.24 and 3.0.25. | 614 | versions 3.0.24 and 3.0.25. |
529 | remount remount the share (often used to change from ro to rw mounts | 615 | remount |
530 | or vice versa) | 616 | remount the share (often used to change from ro to rw mounts |
531 | cifsacl Report mode bits (e.g. on stat) based on the Windows ACL for | 617 | or vice versa) |
532 | the file. (EXPERIMENTAL) | 618 | cifsacl |
533 | servern Specify the server 's netbios name (RFC1001 name) to use | 619 | Report mode bits (e.g. on stat) based on the Windows ACL for |
534 | when attempting to setup a session to the server. | 620 | the file. (EXPERIMENTAL) |
621 | servern | ||
622 | Specify the server 's netbios name (RFC1001 name) to use | ||
623 | when attempting to setup a session to the server. | ||
535 | This is needed for mounting to some older servers (such | 624 | This is needed for mounting to some older servers (such |
536 | as OS/2 or Windows 98 and Windows ME) since they do not | 625 | as OS/2 or Windows 98 and Windows ME) since they do not |
537 | support a default server name. A server name can be up | 626 | support a default server name. A server name can be up |
538 | to 15 characters long and is usually uppercased. | 627 | to 15 characters long and is usually uppercased. |
539 | sfu When the CIFS Unix Extensions are not negotiated, attempt to | 628 | sfu |
629 | When the CIFS Unix Extensions are not negotiated, attempt to | ||
540 | create device files and fifos in a format compatible with | 630 | create device files and fifos in a format compatible with |
541 | Services for Unix (SFU). In addition retrieve bits 10-12 | 631 | Services for Unix (SFU). In addition retrieve bits 10-12 |
542 | of the mode via the SETFILEBITS extended attribute (as | 632 | of the mode via the SETFILEBITS extended attribute (as |
543 | SFU does). In the future the bottom 9 bits of the | 633 | SFU does). In the future the bottom 9 bits of the |
544 | mode also will be emulated using queries of the security | 634 | mode also will be emulated using queries of the security |
545 | descriptor (ACL). | 635 | descriptor (ACL). |
546 | mfsymlinks Enable support for Minshall+French symlinks | 636 | mfsymlinks |
637 | Enable support for Minshall+French symlinks | ||
547 | (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks) | 638 | (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks) |
548 | This option is ignored when specified together with the | 639 | This option is ignored when specified together with the |
549 | 'sfu' option. Minshall+French symlinks are used even if | 640 | 'sfu' option. Minshall+French symlinks are used even if |
550 | the server supports the CIFS Unix Extensions. | 641 | the server supports the CIFS Unix Extensions. |
551 | sign Must use packet signing (helps avoid unwanted data modification | 642 | sign |
643 | Must use packet signing (helps avoid unwanted data modification | ||
552 | by intermediate systems in the route). Note that signing | 644 | by intermediate systems in the route). Note that signing |
553 | does not work with lanman or plaintext authentication. | 645 | does not work with lanman or plaintext authentication. |
554 | seal Must seal (encrypt) all data on this mounted share before | 646 | seal |
647 | Must seal (encrypt) all data on this mounted share before | ||
555 | sending on the network. Requires support for Unix Extensions. | 648 | sending on the network. Requires support for Unix Extensions. |
556 | Note that this differs from the sign mount option in that it | 649 | Note that this differs from the sign mount option in that it |
557 | causes encryption of data sent over this mounted share but other | 650 | causes encryption of data sent over this mounted share but other |
558 | shares mounted to the same server are unaffected. | 651 | shares mounted to the same server are unaffected. |
559 | locallease This option is rarely needed. Fcntl F_SETLEASE is | 652 | locallease |
653 | This option is rarely needed. Fcntl F_SETLEASE is | ||
560 | used by some applications such as Samba and NFSv4 server to | 654 | used by some applications such as Samba and NFSv4 server to |
561 | check to see whether a file is cacheable. CIFS has no way | 655 | check to see whether a file is cacheable. CIFS has no way |
562 | to explicitly request a lease, but can check whether a file | 656 | to explicitly request a lease, but can check whether a file |
@@ -569,51 +663,73 @@ A partial list of the supported mount options follows: | |||
569 | will allow the cifs client to check for leases (only) locally | 663 | will allow the cifs client to check for leases (only) locally |
570 | for files which are not oplocked instead of denying leases | 664 | for files which are not oplocked instead of denying leases |
571 | in that case. (EXPERIMENTAL) | 665 | in that case. (EXPERIMENTAL) |
572 | sec Security mode. Allowed values are: | 666 | sec |
573 | none attempt to connection as a null user (no name) | 667 | Security mode. Allowed values are: |
574 | krb5 Use Kerberos version 5 authentication | 668 | |
575 | krb5i Use Kerberos authentication and packet signing | 669 | none |
576 | ntlm Use NTLM password hashing (default) | 670 | attempt to connection as a null user (no name) |
577 | ntlmi Use NTLM password hashing with signing (if | 671 | krb5 |
672 | Use Kerberos version 5 authentication | ||
673 | krb5i | ||
674 | Use Kerberos authentication and packet signing | ||
675 | ntlm | ||
676 | Use NTLM password hashing (default) | ||
677 | ntlmi | ||
678 | Use NTLM password hashing with signing (if | ||
578 | /proc/fs/cifs/PacketSigningEnabled on or if | 679 | /proc/fs/cifs/PacketSigningEnabled on or if |
579 | server requires signing also can be the default) | 680 | server requires signing also can be the default) |
580 | ntlmv2 Use NTLMv2 password hashing | 681 | ntlmv2 |
581 | ntlmv2i Use NTLMv2 password hashing with packet signing | 682 | Use NTLMv2 password hashing |
582 | lanman (if configured in kernel config) use older | 683 | ntlmv2i |
684 | Use NTLMv2 password hashing with packet signing | ||
685 | lanman | ||
686 | (if configured in kernel config) use older | ||
583 | lanman hash | 687 | lanman hash |
584 | hard Retry file operations if server is not responding | 688 | hard |
585 | soft Limit retries to unresponsive servers (usually only | 689 | Retry file operations if server is not responding |
690 | soft | ||
691 | Limit retries to unresponsive servers (usually only | ||
586 | one retry) before returning an error. (default) | 692 | one retry) before returning an error. (default) |
587 | 693 | ||
588 | The mount.cifs mount helper also accepts a few mount options before -o | 694 | The mount.cifs mount helper also accepts a few mount options before -o |
589 | including: | 695 | including: |
590 | 696 | ||
697 | =============== =============================================================== | ||
591 | -S take password from stdin (equivalent to setting the environment | 698 | -S take password from stdin (equivalent to setting the environment |
592 | variable "PASSWD_FD=0" | 699 | variable ``PASSWD_FD=0`` |
593 | -V print mount.cifs version | 700 | -V print mount.cifs version |
594 | -? display simple usage information | 701 | -? display simple usage information |
702 | =============== =============================================================== | ||
595 | 703 | ||
596 | With most 2.6 kernel versions of modutils, the version of the cifs kernel | 704 | With most 2.6 kernel versions of modutils, the version of the cifs kernel |
597 | module can be displayed via modinfo. | 705 | module can be displayed via modinfo. |
598 | 706 | ||
599 | Misc /proc/fs/cifs Flags and Debug Info | 707 | Misc /proc/fs/cifs Flags and Debug Info |
600 | ======================================= | 708 | ======================================= |
709 | |||
601 | Informational pseudo-files: | 710 | Informational pseudo-files: |
711 | |||
712 | ======================= ======================================================= | ||
602 | DebugData Displays information about active CIFS sessions and | 713 | DebugData Displays information about active CIFS sessions and |
603 | shares, features enabled as well as the cifs.ko | 714 | shares, features enabled as well as the cifs.ko |
604 | version. | 715 | version. |
605 | Stats Lists summary resource usage information as well as per | 716 | Stats Lists summary resource usage information as well as per |
606 | share statistics. | 717 | share statistics. |
718 | ======================= ======================================================= | ||
607 | 719 | ||
608 | Configuration pseudo-files: | 720 | Configuration pseudo-files: |
721 | |||
722 | ======================= ======================================================= | ||
609 | SecurityFlags Flags which control security negotiation and | 723 | SecurityFlags Flags which control security negotiation and |
610 | also packet signing. Authentication (may/must) | 724 | also packet signing. Authentication (may/must) |
611 | flags (e.g. for NTLM and/or NTLMv2) may be combined with | 725 | flags (e.g. for NTLM and/or NTLMv2) may be combined with |
612 | the signing flags. Specifying two different password | 726 | the signing flags. Specifying two different password |
613 | hashing mechanisms (as "must use") on the other hand | 727 | hashing mechanisms (as "must use") on the other hand |
614 | does not make much sense. Default flags are | 728 | does not make much sense. Default flags are:: |
615 | 0x07007 | 729 | |
616 | (NTLM, NTLMv2 and packet signing allowed). The maximum | 730 | 0x07007 |
731 | |||
732 | (NTLM, NTLMv2 and packet signing allowed). The maximum | ||
617 | allowable flags if you want to allow mounts to servers | 733 | allowable flags if you want to allow mounts to servers |
618 | using weaker password hashes is 0x37037 (lanman, | 734 | using weaker password hashes is 0x37037 (lanman, |
619 | plaintext, ntlm, ntlmv2, signing allowed). Some | 735 | plaintext, ntlm, ntlmv2, signing allowed). Some |
@@ -626,21 +742,21 @@ SecurityFlags Flags which control security negotiation and | |||
626 | laintext passwords using the older lanman dialect | 742 | laintext passwords using the older lanman dialect |
627 | form of the session setup SMB. (e.g. for authentication | 743 | form of the session setup SMB. (e.g. for authentication |
628 | using plain text passwords, set the SecurityFlags | 744 | using plain text passwords, set the SecurityFlags |
629 | to 0x30030): | 745 | to 0x30030):: |
630 | 746 | ||
631 | may use packet signing 0x00001 | 747 | may use packet signing 0x00001 |
632 | must use packet signing 0x01001 | 748 | must use packet signing 0x01001 |
633 | may use NTLM (most common password hash) 0x00002 | 749 | may use NTLM (most common password hash) 0x00002 |
634 | must use NTLM 0x02002 | 750 | must use NTLM 0x02002 |
635 | may use NTLMv2 0x00004 | 751 | may use NTLMv2 0x00004 |
636 | must use NTLMv2 0x04004 | 752 | must use NTLMv2 0x04004 |
637 | may use Kerberos security 0x00008 | 753 | may use Kerberos security 0x00008 |
638 | must use Kerberos 0x08008 | 754 | must use Kerberos 0x08008 |
639 | may use lanman (weak) password hash 0x00010 | 755 | may use lanman (weak) password hash 0x00010 |
640 | must use lanman password hash 0x10010 | 756 | must use lanman password hash 0x10010 |
641 | may use plaintext passwords 0x00020 | 757 | may use plaintext passwords 0x00020 |
642 | must use plaintext passwords 0x20020 | 758 | must use plaintext passwords 0x20020 |
643 | (reserved for future packet encryption) 0x00040 | 759 | (reserved for future packet encryption) 0x00040 |
644 | 760 | ||
645 | cifsFYI If set to non-zero value, additional debug information | 761 | cifsFYI If set to non-zero value, additional debug information |
646 | will be logged to the system error log. This field | 762 | will be logged to the system error log. This field |
@@ -650,14 +766,19 @@ cifsFYI If set to non-zero value, additional debug information | |||
650 | Some debugging statements are not compiled into the | 766 | Some debugging statements are not compiled into the |
651 | cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the | 767 | cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the |
652 | kernel configuration. cifsFYI may be set to one or | 768 | kernel configuration. cifsFYI may be set to one or |
653 | nore of the following flags (7 sets them all): | 769 | nore of the following flags (7 sets them all):: |
654 | 770 | ||
655 | log cifs informational messages 0x01 | 771 | +-----------------------------------------------+------+ |
656 | log return codes from cifs entry points 0x02 | 772 | | log cifs informational messages | 0x01 | |
657 | log slow responses (ie which take longer than 1 second) | 773 | +-----------------------------------------------+------+ |
658 | CONFIG_CIFS_STATS2 must be enabled in .config 0x04 | 774 | | log return codes from cifs entry points | 0x02 | |
659 | 775 | +-----------------------------------------------+------+ | |
660 | 776 | | log slow responses | 0x04 | | |
777 | | (ie which take longer than 1 second) | | | ||
778 | | | | | ||
779 | | CONFIG_CIFS_STATS2 must be enabled in .config | | | ||
780 | +-----------------------------------------------+------+ | ||
781 | |||
661 | traceSMB If set to one, debug information is logged to the | 782 | traceSMB If set to one, debug information is logged to the |
662 | system error log with the start of smb requests | 783 | system error log with the start of smb requests |
663 | and responses (default 0) | 784 | and responses (default 0) |
@@ -671,24 +792,25 @@ LinuxExtensionsEnabled If set to one then the client will attempt to | |||
671 | as support symbolic links. If you use servers | 792 | as support symbolic links. If you use servers |
672 | such as Samba that support the CIFS Unix | 793 | such as Samba that support the CIFS Unix |
673 | extensions but do not want to use symbolic link | 794 | extensions but do not want to use symbolic link |
674 | support and want to map the uid and gid fields | 795 | support and want to map the uid and gid fields |
675 | to values supplied at mount (rather than the | 796 | to values supplied at mount (rather than the |
676 | actual values, then set this to zero. (default 1) | 797 | actual values, then set this to zero. (default 1) |
798 | ======================= ======================================================= | ||
677 | 799 | ||
678 | These experimental features and tracing can be enabled by changing flags in | 800 | These experimental features and tracing can be enabled by changing flags in |
679 | /proc/fs/cifs (after the cifs module has been installed or built into the | 801 | /proc/fs/cifs (after the cifs module has been installed or built into the |
680 | kernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable | 802 | kernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable |
681 | tracing to the kernel message log type: | 803 | tracing to the kernel message log type:: |
682 | 804 | ||
683 | echo 7 > /proc/fs/cifs/cifsFYI | 805 | echo 7 > /proc/fs/cifs/cifsFYI |
684 | 806 | ||
685 | cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel | 807 | cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel |
686 | logging of various informational messages. 2 enables logging of non-zero | 808 | logging of various informational messages. 2 enables logging of non-zero |
687 | SMB return codes while 4 enables logging of requests that take longer | 809 | SMB return codes while 4 enables logging of requests that take longer |
688 | than one second to complete (except for byte range lock requests). | 810 | than one second to complete (except for byte range lock requests). |
689 | Setting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration | 811 | Setting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration |
690 | (.config). Setting it to seven enables all three. Finally, tracing | 812 | (.config). Setting it to seven enables all three. Finally, tracing |
691 | the start of smb requests and responses can be enabled via: | 813 | the start of smb requests and responses can be enabled via:: |
692 | 814 | ||
693 | echo 1 > /proc/fs/cifs/traceSMB | 815 | echo 1 > /proc/fs/cifs/traceSMB |
694 | 816 | ||
@@ -700,10 +822,10 @@ server) SMB3 (or cifs) requests grouped by request type (read, write, close etc. | |||
700 | Also recorded is the total bytes read and bytes written to the server for | 822 | Also recorded is the total bytes read and bytes written to the server for |
701 | that share. Note that due to client caching effects this can be less than the | 823 | that share. Note that due to client caching effects this can be less than the |
702 | number of bytes read and written by the application running on the client. | 824 | number of bytes read and written by the application running on the client. |
703 | Statistics can be reset to zero by "echo 0 > /proc/fs/cifs/Stats" which may be | 825 | Statistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be |
704 | useful if comparing performance of two different scenarios. | 826 | useful if comparing performance of two different scenarios. |
705 | 827 | ||
706 | Also note that "cat /proc/fs/cifs/DebugData" will display information about | 828 | Also note that ``cat /proc/fs/cifs/DebugData`` will display information about |
707 | the active sessions and the shares that are mounted. | 829 | the active sessions and the shares that are mounted. |
708 | 830 | ||
709 | Enabling Kerberos (extended security) works but requires version 1.2 or later | 831 | Enabling Kerberos (extended security) works but requires version 1.2 or later |
@@ -725,19 +847,23 @@ space to ease network configuration and improve reliability. | |||
725 | 847 | ||
726 | To use cifs Kerberos and DFS support, the Linux keyutils package should be | 848 | To use cifs Kerberos and DFS support, the Linux keyutils package should be |
727 | installed and something like the following lines should be added to the | 849 | installed and something like the following lines should be added to the |
728 | /etc/request-key.conf file: | 850 | /etc/request-key.conf file:: |
729 | 851 | ||
730 | create cifs.spnego * * /usr/local/sbin/cifs.upcall %k | 852 | create cifs.spnego * * /usr/local/sbin/cifs.upcall %k |
731 | create dns_resolver * * /usr/local/sbin/cifs.upcall %k | 853 | create dns_resolver * * /usr/local/sbin/cifs.upcall %k |
732 | 854 | ||
733 | CIFS kernel module parameters | 855 | CIFS kernel module parameters |
734 | ============================= | 856 | ============================= |
735 | These module parameters can be specified or modified either during the time of | 857 | These module parameters can be specified or modified either during the time of |
736 | module loading or during the runtime by using the interface | 858 | module loading or during the runtime by using the interface:: |
859 | |||
737 | /proc/module/cifs/parameters/<param> | 860 | /proc/module/cifs/parameters/<param> |
738 | 861 | ||
739 | i.e. echo "value" > /sys/module/cifs/parameters/<param> | 862 | i.e.:: |
740 | 863 | ||
741 | 1. enable_oplocks - Enable or disable oplocks. Oplocks are enabled by default. | 864 | echo "value" > /sys/module/cifs/parameters/<param> |
742 | [Y/y/1]. To disable use any of [N/n/0]. | ||
743 | 865 | ||
866 | ================= ========================================================== | ||
867 | 1. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default. | ||
868 | [Y/y/1]. To disable use any of [N/n/0]. | ||
869 | ================= ========================================================== | ||
diff --git a/Documentation/filesystems/cifs/winucase_convert.pl b/Documentation/admin-guide/cifs/winucase_convert.pl index 322a9c833f23..322a9c833f23 100755 --- a/Documentation/filesystems/cifs/winucase_convert.pl +++ b/Documentation/admin-guide/cifs/winucase_convert.pl | |||
diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index e56e00655153..1c5d2281efc9 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt | |||
@@ -1647,8 +1647,17 @@ | |||
1647 | 0 = /dev/comedi0 First comedi device | 1647 | 0 = /dev/comedi0 First comedi device |
1648 | 1 = /dev/comedi1 Second comedi device | 1648 | 1 = /dev/comedi1 Second comedi device |
1649 | ... | 1649 | ... |
1650 | 47 = /dev/comedi47 48th comedi device | ||
1650 | 1651 | ||
1651 | See http://stm.lbl.gov/comedi. | 1652 | Minors 48 to 255 are reserved for comedi subdevices with |
1653 | pathnames of the form "/dev/comediX_subdY", where "X" is the | ||
1654 | minor number of the associated comedi device and "Y" is the | ||
1655 | subdevice number. These subdevice minors are assigned | ||
1656 | dynamically, so there is no fixed mapping from subdevice | ||
1657 | pathnames to minor numbers. | ||
1658 | |||
1659 | See http://www.comedi.org/ for information about the Comedi | ||
1660 | project. | ||
1652 | 1661 | ||
1653 | 98 block User-mode virtual block device | 1662 | 98 block User-mode virtual block device |
1654 | 0 = /dev/ubda First user-mode block device | 1663 | 0 = /dev/ubda First user-mode block device |
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst index 33feab2f4084..34cc20ee7f3a 100644 --- a/Documentation/admin-guide/index.rst +++ b/Documentation/admin-guide/index.rst | |||
@@ -77,7 +77,10 @@ configure specific aspects of kernel behavior to your liking. | |||
77 | blockdev/index | 77 | blockdev/index |
78 | ext4 | 78 | ext4 |
79 | binderfs | 79 | binderfs |
80 | cifs/index | ||
80 | xfs | 81 | xfs |
82 | jfs | ||
83 | ufs | ||
81 | pm/index | 84 | pm/index |
82 | thunderbolt | 85 | thunderbolt |
83 | LSM/index | 86 | LSM/index |
@@ -98,6 +101,7 @@ configure specific aspects of kernel behavior to your liking. | |||
98 | iostats | 101 | iostats |
99 | kernel-per-CPU-kthreads | 102 | kernel-per-CPU-kthreads |
100 | laptops/index | 103 | laptops/index |
104 | auxdisplay/index | ||
101 | lcd-panel-cgram | 105 | lcd-panel-cgram |
102 | ldm | 106 | ldm |
103 | lockup-watchdogs | 107 | lockup-watchdogs |
@@ -105,6 +109,7 @@ configure specific aspects of kernel behavior to your liking. | |||
105 | pnp | 109 | pnp |
106 | rtc | 110 | rtc |
107 | svga | 111 | svga |
112 | wimax/index | ||
108 | video-output | 113 | video-output |
109 | 114 | ||
110 | .. only:: subproject and html | 115 | .. only:: subproject and html |
diff --git a/Documentation/filesystems/jfs.txt b/Documentation/admin-guide/jfs.rst index 41fd757997b3..9e12d936bc90 100644 --- a/Documentation/filesystems/jfs.txt +++ b/Documentation/admin-guide/jfs.rst | |||
@@ -1,45 +1,59 @@ | |||
1 | =========================================== | ||
1 | IBM's Journaled File System (JFS) for Linux | 2 | IBM's Journaled File System (JFS) for Linux |
3 | =========================================== | ||
2 | 4 | ||
3 | JFS Homepage: http://jfs.sourceforge.net/ | 5 | JFS Homepage: http://jfs.sourceforge.net/ |
4 | 6 | ||
5 | The following mount options are supported: | 7 | The following mount options are supported: |
8 | |||
6 | (*) == default | 9 | (*) == default |
7 | 10 | ||
8 | iocharset=name Character set to use for converting from Unicode to | 11 | iocharset=name |
12 | Character set to use for converting from Unicode to | ||
9 | ASCII. The default is to do no conversion. Use | 13 | ASCII. The default is to do no conversion. Use |
10 | iocharset=utf8 for UTF-8 translations. This requires | 14 | iocharset=utf8 for UTF-8 translations. This requires |
11 | CONFIG_NLS_UTF8 to be set in the kernel .config file. | 15 | CONFIG_NLS_UTF8 to be set in the kernel .config file. |
12 | iocharset=none specifies the default behavior explicitly. | 16 | iocharset=none specifies the default behavior explicitly. |
13 | 17 | ||
14 | resize=value Resize the volume to <value> blocks. JFS only supports | 18 | resize=value |
19 | Resize the volume to <value> blocks. JFS only supports | ||
15 | growing a volume, not shrinking it. This option is only | 20 | growing a volume, not shrinking it. This option is only |
16 | valid during a remount, when the volume is mounted | 21 | valid during a remount, when the volume is mounted |
17 | read-write. The resize keyword with no value will grow | 22 | read-write. The resize keyword with no value will grow |
18 | the volume to the full size of the partition. | 23 | the volume to the full size of the partition. |
19 | 24 | ||
20 | nointegrity Do not write to the journal. The primary use of this option | 25 | nointegrity |
26 | Do not write to the journal. The primary use of this option | ||
21 | is to allow for higher performance when restoring a volume | 27 | is to allow for higher performance when restoring a volume |
22 | from backup media. The integrity of the volume is not | 28 | from backup media. The integrity of the volume is not |
23 | guaranteed if the system abnormally abends. | 29 | guaranteed if the system abnormally abends. |
24 | 30 | ||
25 | integrity(*) Commit metadata changes to the journal. Use this option to | 31 | integrity(*) |
32 | Commit metadata changes to the journal. Use this option to | ||
26 | remount a volume where the nointegrity option was | 33 | remount a volume where the nointegrity option was |
27 | previously specified in order to restore normal behavior. | 34 | previously specified in order to restore normal behavior. |
28 | 35 | ||
29 | errors=continue Keep going on a filesystem error. | 36 | errors=continue |
30 | errors=remount-ro(*) Remount the filesystem read-only on an error. | 37 | Keep going on a filesystem error. |
31 | errors=panic Panic and halt the machine if an error occurs. | 38 | errors=remount-ro(*) |
39 | Remount the filesystem read-only on an error. | ||
40 | errors=panic | ||
41 | Panic and halt the machine if an error occurs. | ||
32 | 42 | ||
33 | uid=value Override on-disk uid with specified value | 43 | uid=value |
34 | gid=value Override on-disk gid with specified value | 44 | Override on-disk uid with specified value |
35 | umask=value Override on-disk umask with specified octal value. For | 45 | gid=value |
36 | directories, the execute bit will be set if the corresponding | 46 | Override on-disk gid with specified value |
47 | umask=value | ||
48 | Override on-disk umask with specified octal value. For | ||
49 | directories, the execute bit will be set if the corresponding | ||
37 | read bit is set. | 50 | read bit is set. |
38 | 51 | ||
39 | discard=minlen This enables/disables the use of discard/TRIM commands. | 52 | discard=minlen, discard/nodiscard(*) |
40 | discard The discard/TRIM commands are sent to the underlying | 53 | This enables/disables the use of discard/TRIM commands. |
41 | nodiscard(*) block device when blocks are freed. This is useful for SSD | 54 | The discard/TRIM commands are sent to the underlying |
42 | devices and sparse/thinly-provisioned LUNs. The FITRIM ioctl | 55 | block device when blocks are freed. This is useful for SSD |
56 | devices and sparse/thinly-provisioned LUNs. The FITRIM ioctl | ||
43 | command is also available together with the nodiscard option. | 57 | command is also available together with the nodiscard option. |
44 | The value of minlen specifies the minimum blockcount, when | 58 | The value of minlen specifies the minimum blockcount, when |
45 | a TRIM command to the block device is considered useful. | 59 | a TRIM command to the block device is considered useful. |
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 520dedae7150..3e2d22eb5e59 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -1044,6 +1044,10 @@ | |||
1044 | specified address. The serial port must already be | 1044 | specified address. The serial port must already be |
1045 | setup and configured. Options are not yet supported. | 1045 | setup and configured. Options are not yet supported. |
1046 | 1046 | ||
1047 | sbi | ||
1048 | Use RISC-V SBI (Supervisor Binary Interface) for early | ||
1049 | console. | ||
1050 | |||
1047 | smh Use ARM semihosting calls for early console. | 1051 | smh Use ARM semihosting calls for early console. |
1048 | 1052 | ||
1049 | s3c2410,<addr> | 1053 | s3c2410,<addr> |
diff --git a/Documentation/admin-guide/sysrq.rst b/Documentation/admin-guide/sysrq.rst index 7b9035c01a2e..72b2cfb066f4 100644 --- a/Documentation/admin-guide/sysrq.rst +++ b/Documentation/admin-guide/sysrq.rst | |||
@@ -171,22 +171,20 @@ It seems others find it useful as (System Attention Key) which is | |||
171 | useful when you want to exit a program that will not let you switch consoles. | 171 | useful when you want to exit a program that will not let you switch consoles. |
172 | (For example, X or a svgalib program.) | 172 | (For example, X or a svgalib program.) |
173 | 173 | ||
174 | ``reboot(b)`` is good when you're unable to shut down. But you should also | 174 | ``reboot(b)`` is good when you're unable to shut down, it is an equivalent |
175 | ``sync(s)`` and ``umount(u)`` first. | 175 | of pressing the "reset" button. |
176 | 176 | ||
177 | ``crash(c)`` can be used to manually trigger a crashdump when the system is hung. | 177 | ``crash(c)`` can be used to manually trigger a crashdump when the system is hung. |
178 | Note that this just triggers a crash if there is no dump mechanism available. | 178 | Note that this just triggers a crash if there is no dump mechanism available. |
179 | 179 | ||
180 | ``sync(s)`` is great when your system is locked up, it allows you to sync your | 180 | ``sync(s)`` is handy before yanking removable medium or after using a rescue |
181 | disks and will certainly lessen the chance of data loss and fscking. Note | 181 | shell that provides no graceful shutdown -- it will ensure your data is |
182 | that the sync hasn't taken place until you see the "OK" and "Done" appear | 182 | safely written to the disk. Note that the sync hasn't taken place until you see |
183 | on the screen. (If the kernel is really in strife, you may not ever get the | 183 | the "OK" and "Done" appear on the screen. |
184 | OK or Done message...) | ||
185 | 184 | ||
186 | ``umount(u)`` is basically useful in the same ways as ``sync(s)``. I generally | 185 | ``umount(u)`` can be used to mark filesystems as properly unmounted. From the |
187 | ``sync(s)``, ``umount(u)``, then ``reboot(b)`` when my system locks. It's saved | 186 | running system's point of view, they will be remounted read-only. The remount |
188 | me many a fsck. Again, the unmount (remount read-only) hasn't taken place until | 187 | isn't complete until you see the "OK" and "Done" message appear on the screen. |
189 | you see the "OK" and "Done" message appear on the screen. | ||
190 | 188 | ||
191 | The loglevels ``0``-``9`` are useful when your console is being flooded with | 189 | The loglevels ``0``-``9`` are useful when your console is being flooded with |
192 | kernel messages you do not want to see. Selecting ``0`` will prevent all but | 190 | kernel messages you do not want to see. Selecting ``0`` will prevent all but |
diff --git a/Documentation/filesystems/ufs.txt b/Documentation/admin-guide/ufs.rst index 7a602adeca2b..55d15297f8d7 100644 --- a/Documentation/filesystems/ufs.txt +++ b/Documentation/admin-guide/ufs.rst | |||
@@ -1,37 +1,45 @@ | |||
1 | USING UFS | 1 | ========= |
2 | Using UFS | ||
2 | ========= | 3 | ========= |
3 | 4 | ||
4 | mount -t ufs -o ufstype=type_of_ufs device dir | 5 | mount -t ufs -o ufstype=type_of_ufs device dir |
5 | 6 | ||
6 | 7 | ||
7 | UFS OPTIONS | 8 | UFS Options |
8 | =========== | 9 | =========== |
9 | 10 | ||
10 | ufstype=type_of_ufs | 11 | ufstype=type_of_ufs |
11 | UFS is a file system widely used in different operating systems. | 12 | UFS is a file system widely used in different operating systems. |
12 | The problem are differences among implementations. Features of | 13 | The problem are differences among implementations. Features of |
13 | some implementations are undocumented, so its hard to recognize | 14 | some implementations are undocumented, so its hard to recognize |
14 | type of ufs automatically. That's why user must specify type of | 15 | type of ufs automatically. That's why user must specify type of |
15 | ufs manually by mount option ufstype. Possible values are: | 16 | ufs manually by mount option ufstype. Possible values are: |
16 | 17 | ||
17 | old old format of ufs | 18 | old |
19 | old format of ufs | ||
18 | default value, supported as read-only | 20 | default value, supported as read-only |
19 | 21 | ||
20 | 44bsd used in FreeBSD, NetBSD, OpenBSD | 22 | 44bsd |
23 | used in FreeBSD, NetBSD, OpenBSD | ||
21 | supported as read-write | 24 | supported as read-write |
22 | 25 | ||
23 | ufs2 used in FreeBSD 5.x | 26 | ufs2 |
27 | used in FreeBSD 5.x | ||
24 | supported as read-write | 28 | supported as read-write |
25 | 29 | ||
26 | 5xbsd synonym for ufs2 | 30 | 5xbsd |
31 | synonym for ufs2 | ||
27 | 32 | ||
28 | sun used in SunOS (Solaris) | 33 | sun |
34 | used in SunOS (Solaris) | ||
29 | supported as read-write | 35 | supported as read-write |
30 | 36 | ||
31 | sunx86 used in SunOS for Intel (Solarisx86) | 37 | sunx86 |
38 | used in SunOS for Intel (Solarisx86) | ||
32 | supported as read-write | 39 | supported as read-write |
33 | 40 | ||
34 | hp used in HP-UX | 41 | hp |
42 | used in HP-UX | ||
35 | supported as read-only | 43 | supported as read-only |
36 | 44 | ||
37 | nextstep | 45 | nextstep |
@@ -47,14 +55,14 @@ ufstype=type_of_ufs | |||
47 | supported as read-only | 55 | supported as read-only |
48 | 56 | ||
49 | 57 | ||
50 | POSSIBLE PROBLEMS | 58 | Possible Problems |
51 | ================= | 59 | ----------------- |
52 | 60 | ||
53 | See next section, if you have any. | 61 | See next section, if you have any. |
54 | 62 | ||
55 | 63 | ||
56 | BUG REPORTS | 64 | Bug Reports |
57 | =========== | 65 | ----------- |
58 | 66 | ||
59 | Any ufs bug report you can send to daniel.pirkl@email.cz or | 67 | Any ufs bug report you can send to daniel.pirkl@email.cz or |
60 | to dushistov@mail.ru (do not send partition tables bug reports). | 68 | to dushistov@mail.ru (do not send partition tables bug reports). |
diff --git a/Documentation/wimax/README.i2400m b/Documentation/admin-guide/wimax/i2400m.rst index 7dffd8919cb0..194388c0c351 100644 --- a/Documentation/wimax/README.i2400m +++ b/Documentation/admin-guide/wimax/i2400m.rst | |||
@@ -1,18 +1,23 @@ | |||
1 | .. include:: <isonum.txt> | ||
1 | 2 | ||
2 | Driver for the Intel Wireless Wimax Connection 2400m | 3 | ==================================================== |
4 | Driver for the Intel Wireless Wimax Connection 2400m | ||
5 | ==================================================== | ||
3 | 6 | ||
4 | (C) 2008 Intel Corporation < linux-wimax@intel.com > | 7 | :Copyright: |copy| 2008 Intel Corporation < linux-wimax@intel.com > |
5 | 8 | ||
6 | This provides a driver for the Intel Wireless WiMAX Connection 2400m | 9 | This provides a driver for the Intel Wireless WiMAX Connection 2400m |
7 | and a basic Linux kernel WiMAX stack. | 10 | and a basic Linux kernel WiMAX stack. |
8 | 11 | ||
9 | 1. Requirements | 12 | 1. Requirements |
13 | =============== | ||
10 | 14 | ||
11 | * Linux installation with Linux kernel 2.6.22 or newer (if building | 15 | * Linux installation with Linux kernel 2.6.22 or newer (if building |
12 | from a separate tree) | 16 | from a separate tree) |
13 | * Intel i2400m Echo Peak or Baxter Peak; this includes the Intel | 17 | * Intel i2400m Echo Peak or Baxter Peak; this includes the Intel |
14 | Wireless WiMAX/WiFi Link 5x50 series. | 18 | Wireless WiMAX/WiFi Link 5x50 series. |
15 | * build tools: | 19 | * build tools: |
20 | |||
16 | + Linux kernel development package for the target kernel; to | 21 | + Linux kernel development package for the target kernel; to |
17 | build against your currently running kernel, you need to have | 22 | build against your currently running kernel, you need to have |
18 | the kernel development package corresponding to the running | 23 | the kernel development package corresponding to the running |
@@ -22,8 +27,10 @@ | |||
22 | + GNU C Compiler, make | 27 | + GNU C Compiler, make |
23 | 28 | ||
24 | 2. Compilation and installation | 29 | 2. Compilation and installation |
30 | =============================== | ||
25 | 31 | ||
26 | 2.1. Compilation of the drivers included in the kernel | 32 | 2.1. Compilation of the drivers included in the kernel |
33 | ------------------------------------------------------ | ||
27 | 34 | ||
28 | Configure the kernel; to enable the WiMAX drivers select Drivers > | 35 | Configure the kernel; to enable the WiMAX drivers select Drivers > |
29 | Networking Drivers > WiMAX device support. Enable all of them as | 36 | Networking Drivers > WiMAX device support. Enable all of them as |
@@ -36,37 +43,39 @@ | |||
36 | Compile and install your kernel as usual. | 43 | Compile and install your kernel as usual. |
37 | 44 | ||
38 | 2.2. Compilation of the drivers distributed as an standalone module | 45 | 2.2. Compilation of the drivers distributed as an standalone module |
46 | ------------------------------------------------------------------- | ||
39 | 47 | ||
40 | To compile | 48 | To compile:: |
41 | 49 | ||
42 | $ cd source/directory | 50 | $ cd source/directory |
43 | $ make | 51 | $ make |
44 | 52 | ||
45 | Once built you can load and unload using the provided load.sh script; | 53 | Once built you can load and unload using the provided load.sh script; |
46 | load.sh will load the modules, load.sh u will unload them. | 54 | load.sh will load the modules, load.sh u will unload them. |
47 | 55 | ||
48 | To install in the default kernel directories (and enable auto loading | 56 | To install in the default kernel directories (and enable auto loading |
49 | when the device is plugged): | 57 | when the device is plugged):: |
50 | 58 | ||
51 | $ make install | 59 | $ make install |
52 | $ depmod -a | 60 | $ depmod -a |
53 | 61 | ||
54 | If your kernel development files are located in a non standard | 62 | If your kernel development files are located in a non standard |
55 | directory or if you want to build for a kernel that is not the | 63 | directory or if you want to build for a kernel that is not the |
56 | currently running one, set KDIR to the right location: | 64 | currently running one, set KDIR to the right location:: |
57 | 65 | ||
58 | $ make KDIR=/path/to/kernel/dev/tree | 66 | $ make KDIR=/path/to/kernel/dev/tree |
59 | 67 | ||
60 | For more information, please contact linux-wimax@intel.com. | 68 | For more information, please contact linux-wimax@intel.com. |
61 | 69 | ||
62 | 3. Installing the firmware | 70 | 3. Installing the firmware |
71 | -------------------------- | ||
63 | 72 | ||
64 | The firmware can be obtained from http://linuxwimax.org or might have | 73 | The firmware can be obtained from http://linuxwimax.org or might have |
65 | been supplied with your hardware. | 74 | been supplied with your hardware. |
66 | 75 | ||
67 | It has to be installed in the target system: | 76 | It has to be installed in the target system:: |
68 | * | 77 | |
69 | $ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf | 78 | $ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf |
70 | 79 | ||
71 | * NOTE: if your firmware came in an .rpm or .deb file, just install | 80 | * NOTE: if your firmware came in an .rpm or .deb file, just install |
72 | it as normal, with the rpm (rpm -i FIRMWARE.rpm) or dpkg | 81 | it as normal, with the rpm (rpm -i FIRMWARE.rpm) or dpkg |
@@ -76,6 +85,7 @@ $ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf | |||
76 | with other types. | 85 | with other types. |
77 | 86 | ||
78 | 4. Design | 87 | 4. Design |
88 | ========= | ||
79 | 89 | ||
80 | This package contains two major parts: a WiMAX kernel stack and a | 90 | This package contains two major parts: a WiMAX kernel stack and a |
81 | driver for the Intel i2400m. | 91 | driver for the Intel i2400m. |
@@ -102,16 +112,17 @@ $ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf | |||
102 | API calls should be replaced with the target OS's. | 112 | API calls should be replaced with the target OS's. |
103 | 113 | ||
104 | 5. Usage | 114 | 5. Usage |
115 | ======== | ||
105 | 116 | ||
106 | To load the driver, follow the instructions in the install section; | 117 | To load the driver, follow the instructions in the install section; |
107 | once the driver is loaded, plug in the device (unless it is permanently | 118 | once the driver is loaded, plug in the device (unless it is permanently |
108 | plugged in). The driver will enumerate the device, upload the firmware | 119 | plugged in). The driver will enumerate the device, upload the firmware |
109 | and output messages in the kernel log (dmesg, /var/log/messages or | 120 | and output messages in the kernel log (dmesg, /var/log/messages or |
110 | /var/log/kern.log) such as: | 121 | /var/log/kern.log) such as:: |
111 | 122 | ||
112 | ... | 123 | ... |
113 | i2400m_usb 5-4:1.0: firmware interface version 8.0.0 | 124 | i2400m_usb 5-4:1.0: firmware interface version 8.0.0 |
114 | i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready | 125 | i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready |
115 | 126 | ||
116 | At this point the device is ready to work. | 127 | At this point the device is ready to work. |
117 | 128 | ||
@@ -120,38 +131,42 @@ i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready | |||
120 | on how to scan, connect and disconnect. | 131 | on how to scan, connect and disconnect. |
121 | 132 | ||
122 | 5.1. Module parameters | 133 | 5.1. Module parameters |
134 | ---------------------- | ||
123 | 135 | ||
124 | Module parameters can be set at kernel or module load time or by | 136 | Module parameters can be set at kernel or module load time or by |
125 | echoing values: | 137 | echoing values:: |
126 | 138 | ||
127 | $ echo VALUE > /sys/module/MODULENAME/parameters/PARAMETERNAME | 139 | $ echo VALUE > /sys/module/MODULENAME/parameters/PARAMETERNAME |
128 | 140 | ||
129 | To make changes permanent, for example, for the i2400m module, you can | 141 | To make changes permanent, for example, for the i2400m module, you can |
130 | also create a file named /etc/modprobe.d/i2400m containing: | 142 | also create a file named /etc/modprobe.d/i2400m containing:: |
131 | 143 | ||
132 | options i2400m idle_mode_disabled=1 | 144 | options i2400m idle_mode_disabled=1 |
133 | 145 | ||
134 | To find which parameters are supported by a module, run: | 146 | To find which parameters are supported by a module, run:: |
135 | 147 | ||
136 | $ modinfo path/to/module.ko | 148 | $ modinfo path/to/module.ko |
137 | 149 | ||
138 | During kernel bootup (if the driver is linked in the kernel), specify | 150 | During kernel bootup (if the driver is linked in the kernel), specify |
139 | the following to the kernel command line: | 151 | the following to the kernel command line:: |
140 | 152 | ||
141 | i2400m.PARAMETER=VALUE | 153 | i2400m.PARAMETER=VALUE |
142 | 154 | ||
143 | 5.1.1. i2400m: idle_mode_disabled | 155 | 5.1.1. i2400m: idle_mode_disabled |
156 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
144 | 157 | ||
145 | The i2400m module supports a parameter to disable idle mode. This | 158 | The i2400m module supports a parameter to disable idle mode. This |
146 | parameter, once set, will take effect only when the device is | 159 | parameter, once set, will take effect only when the device is |
147 | reinitialized by the driver (eg: following a reset or a reconnect). | 160 | reinitialized by the driver (eg: following a reset or a reconnect). |
148 | 161 | ||
149 | 5.2. Debug operations: debugfs entries | 162 | 5.2. Debug operations: debugfs entries |
163 | -------------------------------------- | ||
150 | 164 | ||
151 | The driver will register debugfs entries that allow the user to tweak | 165 | The driver will register debugfs entries that allow the user to tweak |
152 | debug settings. There are three main container directories where | 166 | debug settings. There are three main container directories where |
153 | entries are placed, which correspond to the three blocks a i2400m WiMAX | 167 | entries are placed, which correspond to the three blocks a i2400m WiMAX |
154 | driver has: | 168 | driver has: |
169 | |||
155 | * /sys/kernel/debug/wimax:DEVNAME/ for the generic WiMAX stack | 170 | * /sys/kernel/debug/wimax:DEVNAME/ for the generic WiMAX stack |
156 | controls | 171 | controls |
157 | * /sys/kernel/debug/wimax:DEVNAME/i2400m for the i2400m generic | 172 | * /sys/kernel/debug/wimax:DEVNAME/i2400m for the i2400m generic |
@@ -163,52 +178,55 @@ i2400m.PARAMETER=VALUE | |||
163 | /sys/kernel/debug, those paths will change. | 178 | /sys/kernel/debug, those paths will change. |
164 | 179 | ||
165 | 5.2.1. Increasing debug output | 180 | 5.2.1. Increasing debug output |
181 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
166 | 182 | ||
167 | The files named *dl_* indicate knobs for controlling the debug output | 183 | The files named *dl_* indicate knobs for controlling the debug output |
168 | of different submodules: | 184 | of different submodules:: |
169 | * | 185 | |
170 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* | 186 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* |
171 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_tx | 187 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_tx |
172 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_rx | 188 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_rx |
173 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_notif | 189 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_notif |
174 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_fw | 190 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_fw |
175 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_usb | 191 | /sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_usb |
176 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx | 192 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx |
177 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rx | 193 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rx |
178 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rfkill | 194 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_rfkill |
179 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_netdev | 195 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_netdev |
180 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_fw | 196 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_fw |
181 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_debugfs | 197 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_debugfs |
182 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_driver | 198 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_driver |
183 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_control | 199 | /sys/kernel/debug/wimax:wmx0/i2400m/dl_control |
184 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack | 200 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack |
185 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill | 201 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill |
186 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset | 202 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset |
187 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg | 203 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg |
188 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | 204 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table |
189 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs | 205 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs |
190 | 206 | ||
191 | By reading the file you can obtain the current value of said debug | 207 | By reading the file you can obtain the current value of said debug |
192 | level; by writing to it, you can set it. | 208 | level; by writing to it, you can set it. |
193 | 209 | ||
194 | To increase the debug level of, for example, the i2400m's generic TX | 210 | To increase the debug level of, for example, the i2400m's generic TX |
195 | engine, just write: | 211 | engine, just write:: |
196 | 212 | ||
197 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx | 213 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx |
198 | 214 | ||
199 | Increasing numbers yield increasing debug information; for details of | 215 | Increasing numbers yield increasing debug information; for details of |
200 | what is printed and the available levels, check the source. The code | 216 | what is printed and the available levels, check the source. The code |
201 | uses 0 for disabled and increasing values until 8. | 217 | uses 0 for disabled and increasing values until 8. |
202 | 218 | ||
203 | 5.2.2. RX and TX statistics | 219 | 5.2.2. RX and TX statistics |
220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
204 | 221 | ||
205 | The i2400m/rx_stats and i2400m/tx_stats provide statistics about the | 222 | The i2400m/rx_stats and i2400m/tx_stats provide statistics about the |
206 | data reception/delivery from the device: | 223 | data reception/delivery from the device:: |
207 | 224 | ||
208 | $ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats | 225 | $ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats |
209 | 45 1 3 34 3104 48 480 | 226 | 45 1 3 34 3104 48 480 |
227 | |||
228 | The numbers reported are: | ||
210 | 229 | ||
211 | The numbers reported are | ||
212 | * packets/RX-buffer: total, min, max | 230 | * packets/RX-buffer: total, min, max |
213 | * RX-buffers: total RX buffers received, accumulated RX buffer size | 231 | * RX-buffers: total RX buffers received, accumulated RX buffer size |
214 | in bytes, min size received, max size received | 232 | in bytes, min size received, max size received |
@@ -216,9 +234,9 @@ $ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats | |||
216 | Thus, to find the average buffer size received, divide accumulated | 234 | Thus, to find the average buffer size received, divide accumulated |
217 | RX-buffer / total RX-buffers. | 235 | RX-buffer / total RX-buffers. |
218 | 236 | ||
219 | To clear the statistics back to 0, write anything to the rx_stats file: | 237 | To clear the statistics back to 0, write anything to the rx_stats file:: |
220 | 238 | ||
221 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats | 239 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats |
222 | 240 | ||
223 | Likewise for TX. | 241 | Likewise for TX. |
224 | 242 | ||
@@ -227,14 +245,16 @@ $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats | |||
227 | to the host. See drivers/net/wimax/i2400m/tx.c. | 245 | to the host. See drivers/net/wimax/i2400m/tx.c. |
228 | 246 | ||
229 | 5.2.3. Tracing messages received from user space | 247 | 5.2.3. Tracing messages received from user space |
248 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
230 | 249 | ||
231 | To echo messages received from user space into the trace pipe that the | 250 | To echo messages received from user space into the trace pipe that the |
232 | i2400m driver creates, set the debug file i2400m/trace_msg_from_user to | 251 | i2400m driver creates, set the debug file i2400m/trace_msg_from_user to |
233 | 1: | 252 | 1:: |
234 | * | 253 | |
235 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user | 254 | $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user |
236 | 255 | ||
237 | 5.2.4. Performing a device reset | 256 | 5.2.4. Performing a device reset |
257 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
238 | 258 | ||
239 | By writing a 0, a 1 or a 2 to the file | 259 | By writing a 0, a 1 or a 2 to the file |
240 | /sys/kernel/debug/wimax:wmx0/reset, the driver performs a warm (without | 260 | /sys/kernel/debug/wimax:wmx0/reset, the driver performs a warm (without |
@@ -242,18 +262,21 @@ $ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user | |||
242 | (bus specific) reset on the device. | 262 | (bus specific) reset on the device. |
243 | 263 | ||
244 | 5.2.5. Asking the device to enter power saving mode | 264 | 5.2.5. Asking the device to enter power saving mode |
265 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
245 | 266 | ||
246 | By writing any value to the /sys/kernel/debug/wimax:wmx0 file, the | 267 | By writing any value to the /sys/kernel/debug/wimax:wmx0 file, the |
247 | device will attempt to enter power saving mode. | 268 | device will attempt to enter power saving mode. |
248 | 269 | ||
249 | 6. Troubleshooting | 270 | 6. Troubleshooting |
271 | ================== | ||
250 | 272 | ||
251 | 6.1. Driver complains about 'i2400m-fw-usb-1.2.sbcf: request failed' | 273 | 6.1. Driver complains about ``i2400m-fw-usb-1.2.sbcf: request failed`` |
274 | ---------------------------------------------------------------------- | ||
252 | 275 | ||
253 | If upon connecting the device, the following is output in the kernel | 276 | If upon connecting the device, the following is output in the kernel |
254 | log: | 277 | log:: |
255 | 278 | ||
256 | i2400m_usb 5-4:1.0: fw i2400m-fw-usb-1.3.sbcf: request failed: -2 | 279 | i2400m_usb 5-4:1.0: fw i2400m-fw-usb-1.3.sbcf: request failed: -2 |
257 | 280 | ||
258 | This means that the driver cannot locate the firmware file named | 281 | This means that the driver cannot locate the firmware file named |
259 | /lib/firmware/i2400m-fw-usb-1.2.sbcf. Check that the file is present in | 282 | /lib/firmware/i2400m-fw-usb-1.2.sbcf. Check that the file is present in |
diff --git a/Documentation/admin-guide/wimax/index.rst b/Documentation/admin-guide/wimax/index.rst new file mode 100644 index 000000000000..fdf7c1f99ff5 --- /dev/null +++ b/Documentation/admin-guide/wimax/index.rst | |||
@@ -0,0 +1,19 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | =============== | ||
4 | WiMAX subsystem | ||
5 | =============== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | wimax | ||
11 | |||
12 | i2400m | ||
13 | |||
14 | .. only:: subproject and html | ||
15 | |||
16 | Indices | ||
17 | ======= | ||
18 | |||
19 | * :ref:`genindex` | ||
diff --git a/Documentation/wimax/README.wimax b/Documentation/admin-guide/wimax/wimax.rst index b78c4378084e..817ee8ba2732 100644 --- a/Documentation/wimax/README.wimax +++ b/Documentation/admin-guide/wimax/wimax.rst | |||
@@ -1,12 +1,16 @@ | |||
1 | .. include:: <isonum.txt> | ||
1 | 2 | ||
2 | Linux kernel WiMAX stack | 3 | ======================== |
4 | Linux kernel WiMAX stack | ||
5 | ======================== | ||
3 | 6 | ||
4 | (C) 2008 Intel Corporation < linux-wimax@intel.com > | 7 | :Copyright: |copy| 2008 Intel Corporation < linux-wimax@intel.com > |
5 | 8 | ||
6 | This provides a basic Linux kernel WiMAX stack to provide a common | 9 | This provides a basic Linux kernel WiMAX stack to provide a common |
7 | control API for WiMAX devices, usable from kernel and user space. | 10 | control API for WiMAX devices, usable from kernel and user space. |
8 | 11 | ||
9 | 1. Design | 12 | 1. Design |
13 | ========= | ||
10 | 14 | ||
11 | The WiMAX stack is designed to provide for common WiMAX control | 15 | The WiMAX stack is designed to provide for common WiMAX control |
12 | services to current and future WiMAX devices from any vendor. | 16 | services to current and future WiMAX devices from any vendor. |
@@ -31,6 +35,7 @@ | |||
31 | include/linux/wimax.h. | 35 | include/linux/wimax.h. |
32 | 36 | ||
33 | 2. Usage | 37 | 2. Usage |
38 | ======== | ||
34 | 39 | ||
35 | For usage in a driver (registration, API, etc) please refer to the | 40 | For usage in a driver (registration, API, etc) please refer to the |
36 | instructions in the header file include/linux/wimax.h. | 41 | instructions in the header file include/linux/wimax.h. |
@@ -40,6 +45,7 @@ | |||
40 | control. | 45 | control. |
41 | 46 | ||
42 | 2.1. Obtaining debug information: debugfs entries | 47 | 2.1. Obtaining debug information: debugfs entries |
48 | ------------------------------------------------- | ||
43 | 49 | ||
44 | The WiMAX stack is compiled, by default, with debug messages that can | 50 | The WiMAX stack is compiled, by default, with debug messages that can |
45 | be used to diagnose issues. By default, said messages are disabled. | 51 | be used to diagnose issues. By default, said messages are disabled. |
@@ -52,20 +58,22 @@ | |||
52 | create more subentries below it. | 58 | create more subentries below it. |
53 | 59 | ||
54 | 2.1.1. Increasing debug output | 60 | 2.1.1. Increasing debug output |
61 | ------------------------------ | ||
55 | 62 | ||
56 | The files named *dl_* indicate knobs for controlling the debug output | 63 | The files named *dl_* indicate knobs for controlling the debug output |
57 | of different submodules of the WiMAX stack: | 64 | of different submodules of the WiMAX stack:: |
58 | * | 65 | |
59 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* | 66 | # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\* |
60 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack | 67 | /sys/kernel/debug/wimax:wmx0/wimax_dl_stack |
61 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill | 68 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill |
62 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset | 69 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset |
63 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg | 70 | /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg |
64 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | 71 | /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table |
65 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs | 72 | /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs |
66 | /sys/kernel/debug/wimax:wmx0/.... # other driver specific files | 73 | /sys/kernel/debug/wimax:wmx0/.... # other driver specific files |
67 | 74 | ||
68 | NOTE: Of course, if debugfs is mounted in a directory other than | 75 | NOTE: |
76 | Of course, if debugfs is mounted in a directory other than | ||
69 | /sys/kernel/debug, those paths will change. | 77 | /sys/kernel/debug, those paths will change. |
70 | 78 | ||
71 | By reading the file you can obtain the current value of said debug | 79 | By reading the file you can obtain the current value of said debug |
@@ -74,7 +82,7 @@ | |||
74 | To increase the debug level of, for example, the id-table submodule, | 82 | To increase the debug level of, for example, the id-table submodule, |
75 | just write: | 83 | just write: |
76 | 84 | ||
77 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table | 85 | $ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table |
78 | 86 | ||
79 | Increasing numbers yield increasing debug information; for details of | 87 | Increasing numbers yield increasing debug information; for details of |
80 | what is printed and the available levels, check the source. The code | 88 | what is printed and the available levels, check the source. The code |
diff --git a/Documentation/admin-guide/xfs.rst b/Documentation/admin-guide/xfs.rst index e76665a8f2f2..fb5b39f73059 100644 --- a/Documentation/admin-guide/xfs.rst +++ b/Documentation/admin-guide/xfs.rst | |||
@@ -337,11 +337,12 @@ None at present. | |||
337 | Removed Sysctls | 337 | Removed Sysctls |
338 | =============== | 338 | =============== |
339 | 339 | ||
340 | ============================= ======= | ||
340 | Name Removed | 341 | Name Removed |
341 | ---- ------- | 342 | ============================= ======= |
342 | fs.xfs.xfsbufd_centisec v4.0 | 343 | fs.xfs.xfsbufd_centisec v4.0 |
343 | fs.xfs.age_buffer_centisecs v4.0 | 344 | fs.xfs.age_buffer_centisecs v4.0 |
344 | 345 | ============================= ======= | |
345 | 346 | ||
346 | Error handling | 347 | Error handling |
347 | ============== | 348 | ============== |
diff --git a/Documentation/arm/sa1100/adsbitsy.rst b/Documentation/arm/sa1100/adsbitsy.rst deleted file mode 100644 index c179cb26b682..000000000000 --- a/Documentation/arm/sa1100/adsbitsy.rst +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | =============================== | ||
2 | ADS Bitsy Single Board Computer | ||
3 | =============================== | ||
4 | |||
5 | (It is different from Bitsy(iPAQ) of Compaq) | ||
6 | |||
7 | For more details, contact Applied Data Systems or see | ||
8 | http://www.applieddata.net/products.html | ||
9 | |||
10 | The Linux support for this product has been provided by | ||
11 | Woojung Huh <whuh@applieddata.net> | ||
12 | |||
13 | Use 'make adsbitsy_config' before any 'make config'. | ||
14 | This will set up defaults for ADS Bitsy support. | ||
15 | |||
16 | The kernel zImage is linked to be loaded and executed at 0xc0400000. | ||
17 | |||
18 | Linux can be used with the ADS BootLoader that ships with the | ||
19 | newer rev boards. See their documentation on how to load Linux. | ||
20 | |||
21 | Supported peripherals | ||
22 | ===================== | ||
23 | |||
24 | - SA1100 LCD frame buffer (8/16bpp...sort of) | ||
25 | - SA1111 USB Master | ||
26 | - SA1100 serial port | ||
27 | - pcmcia, compact flash | ||
28 | - touchscreen(ucb1200) | ||
29 | - console on LCD screen | ||
30 | - serial ports (ttyS[0-2]) | ||
31 | - ttyS0 is default for serial console | ||
32 | |||
33 | To do | ||
34 | ===== | ||
35 | |||
36 | - everything else! :-) | ||
37 | |||
38 | Notes | ||
39 | ===== | ||
40 | |||
41 | - The flash on board is divided into 3 partitions. | ||
42 | You should be careful to use flash on board. | ||
43 | Its partition is different from GraphicsClient Plus and GraphicsMaster | ||
44 | |||
45 | - 16bpp mode requires a different cable than what ships with the board. | ||
46 | Contact ADS or look through the manual to wire your own. Currently, | ||
47 | if you compile with 16bit mode support and switch into a lower bpp | ||
48 | mode, the timing is off so the image is corrupted. This will be | ||
49 | fixed soon. | ||
50 | |||
51 | Any contribution can be sent to nico@fluxnic.net and will be greatly welcome! | ||
diff --git a/Documentation/arm/sa1100/assabet.rst b/Documentation/arm/sa1100/assabet.rst index 3e704831c311..a761e128fb08 100644 --- a/Documentation/arm/sa1100/assabet.rst +++ b/Documentation/arm/sa1100/assabet.rst | |||
@@ -14,7 +14,7 @@ Building the kernel | |||
14 | 14 | ||
15 | To build the kernel with current defaults:: | 15 | To build the kernel with current defaults:: |
16 | 16 | ||
17 | make assabet_config | 17 | make assabet_defconfig |
18 | make oldconfig | 18 | make oldconfig |
19 | make zImage | 19 | make zImage |
20 | 20 | ||
diff --git a/Documentation/arm/sa1100/brutus.rst b/Documentation/arm/sa1100/brutus.rst deleted file mode 100644 index e1a23bee6d44..000000000000 --- a/Documentation/arm/sa1100/brutus.rst +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | ====== | ||
2 | Brutus | ||
3 | ====== | ||
4 | |||
5 | Brutus is an evaluation platform for the SA1100 manufactured by Intel. | ||
6 | For more details, see: | ||
7 | |||
8 | http://developer.intel.com | ||
9 | |||
10 | To compile for Brutus, you must issue the following commands:: | ||
11 | |||
12 | make brutus_config | ||
13 | make config | ||
14 | [accept all the defaults] | ||
15 | make zImage | ||
16 | |||
17 | The resulting kernel will end up in linux/arch/arm/boot/zImage. This file | ||
18 | must be loaded at 0xc0008000 in Brutus's memory and execution started at | ||
19 | 0xc0008000 as well with the value of registers r0 = 0 and r1 = 16 upon | ||
20 | entry. | ||
21 | |||
22 | But prior to execute the kernel, a ramdisk image must also be loaded in | ||
23 | memory. Use memory address 0xd8000000 for this. Note that the file | ||
24 | containing the (compressed) ramdisk image must not exceed 4 MB. | ||
25 | |||
26 | Typically, you'll need angelboot to load the kernel. | ||
27 | The following angelboot.opt file should be used:: | ||
28 | |||
29 | base 0xc0008000 | ||
30 | entry 0xc0008000 | ||
31 | r0 0x00000000 | ||
32 | r1 0x00000010 | ||
33 | device /dev/ttyS0 | ||
34 | options "9600 8N1" | ||
35 | baud 115200 | ||
36 | otherfile ramdisk_img.gz | ||
37 | otherbase 0xd8000000 | ||
38 | |||
39 | Then load the kernel and ramdisk with:: | ||
40 | |||
41 | angelboot -f angelboot.opt zImage | ||
42 | |||
43 | The first Brutus serial port (assumed to be linked to /dev/ttyS0 on your | ||
44 | host PC) is used by angel to load the kernel and ramdisk image. The serial | ||
45 | console is provided through the second Brutus serial port. To access it, | ||
46 | you may use minicom configured with /dev/ttyS1, 9600 baud, 8N1, no flow | ||
47 | control. | ||
48 | |||
49 | Currently supported | ||
50 | =================== | ||
51 | |||
52 | - RS232 serial ports | ||
53 | - audio output | ||
54 | - LCD screen | ||
55 | - keyboard | ||
56 | |||
57 | The actual Brutus support may not be complete without extra patches. | ||
58 | If such patches exist, they should be found from | ||
59 | ftp.netwinder.org/users/n/nico. | ||
60 | |||
61 | A full PCMCIA support is still missing, although it's possible to hack | ||
62 | some drivers in order to drive already inserted cards at boot time with | ||
63 | little modifications. | ||
64 | |||
65 | Any contribution is welcome. | ||
66 | |||
67 | Please send patches to nico@fluxnic.net | ||
68 | |||
69 | Have Fun ! | ||
diff --git a/Documentation/arm/sa1100/freebird.rst b/Documentation/arm/sa1100/freebird.rst deleted file mode 100644 index 81043d0c6d64..000000000000 --- a/Documentation/arm/sa1100/freebird.rst +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | ======== | ||
2 | Freebird | ||
3 | ======== | ||
4 | |||
5 | Freebird-1.1 is produced by Legend(C), Inc. | ||
6 | `http://web.archive.org/web/*/http://www.legend.com.cn` | ||
7 | and software/linux maintained by Coventive(C), Inc. | ||
8 | (http://www.coventive.com) | ||
9 | |||
10 | Based on the Nicolas's strongarm kernel tree. | ||
11 | |||
12 | Maintainer: | ||
13 | |||
14 | Chester Kuo | ||
15 | - <chester@coventive.com> | ||
16 | - <chester@linux.org.tw> | ||
17 | |||
18 | Author: | ||
19 | |||
20 | - Tim wu <timwu@coventive.com> | ||
21 | - CIH <cih@coventive.com> | ||
22 | - Eric Peng <ericpeng@coventive.com> | ||
23 | - Jeff Lee <jeff_lee@coventive.com> | ||
24 | - Allen Cheng | ||
25 | - Tony Liu <tonyliu@coventive.com> | ||
diff --git a/Documentation/arm/sa1100/graphicsclient.rst b/Documentation/arm/sa1100/graphicsclient.rst deleted file mode 100644 index a73d61c3ce91..000000000000 --- a/Documentation/arm/sa1100/graphicsclient.rst +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | ============================================= | ||
2 | ADS GraphicsClient Plus Single Board Computer | ||
3 | ============================================= | ||
4 | |||
5 | For more details, contact Applied Data Systems or see | ||
6 | http://www.applieddata.net/products.html | ||
7 | |||
8 | The original Linux support for this product has been provided by | ||
9 | Nicolas Pitre <nico@fluxnic.net>. Continued development work by | ||
10 | Woojung Huh <whuh@applieddata.net> | ||
11 | |||
12 | It's currently possible to mount a root filesystem via NFS providing a | ||
13 | complete Linux environment. Otherwise a ramdisk image may be used. The | ||
14 | board supports MTD/JFFS, so you could also mount something on there. | ||
15 | |||
16 | Use 'make graphicsclient_config' before any 'make config'. This will set up | ||
17 | defaults for GraphicsClient Plus support. | ||
18 | |||
19 | The kernel zImage is linked to be loaded and executed at 0xc0200000. | ||
20 | Also the following registers should have the specified values upon entry:: | ||
21 | |||
22 | r0 = 0 | ||
23 | r1 = 29 (this is the GraphicsClient architecture number) | ||
24 | |||
25 | Linux can be used with the ADS BootLoader that ships with the | ||
26 | newer rev boards. See their documentation on how to load Linux. | ||
27 | Angel is not available for the GraphicsClient Plus AFAIK. | ||
28 | |||
29 | There is a board known as just the GraphicsClient that ADS used to | ||
30 | produce but has end of lifed. This code will not work on the older | ||
31 | board with the ADS bootloader, but should still work with Angel, | ||
32 | as outlined below. In any case, if you're planning on deploying | ||
33 | something en masse, you should probably get the newer board. | ||
34 | |||
35 | If using Angel on the older boards, here is a typical angel.opt option file | ||
36 | if the kernel is loaded through the Angel Debug Monitor:: | ||
37 | |||
38 | base 0xc0200000 | ||
39 | entry 0xc0200000 | ||
40 | r0 0x00000000 | ||
41 | r1 0x0000001d | ||
42 | device /dev/ttyS1 | ||
43 | options "38400 8N1" | ||
44 | baud 115200 | ||
45 | #otherfile ramdisk.gz | ||
46 | #otherbase 0xc0800000 | ||
47 | exec minicom | ||
48 | |||
49 | Then the kernel (and ramdisk if otherfile/otherbase lines above are | ||
50 | uncommented) would be loaded with:: | ||
51 | |||
52 | angelboot -f angelboot.opt zImage | ||
53 | |||
54 | Here it is assumed that the board is connected to ttyS1 on your PC | ||
55 | and that minicom is preconfigured with /dev/ttyS1, 38400 baud, 8N1, no flow | ||
56 | control by default. | ||
57 | |||
58 | If any other bootloader is used, ensure it accomplish the same, especially | ||
59 | for r0/r1 register values before jumping into the kernel. | ||
60 | |||
61 | |||
62 | Supported peripherals | ||
63 | ===================== | ||
64 | |||
65 | - SA1100 LCD frame buffer (8/16bpp...sort of) | ||
66 | - on-board SMC 92C96 ethernet NIC | ||
67 | - SA1100 serial port | ||
68 | - flash memory access (MTD/JFFS) | ||
69 | - pcmcia | ||
70 | - touchscreen(ucb1200) | ||
71 | - ps/2 keyboard | ||
72 | - console on LCD screen | ||
73 | - serial ports (ttyS[0-2]) | ||
74 | - ttyS0 is default for serial console | ||
75 | - Smart I/O (ADC, keypad, digital inputs, etc) | ||
76 | See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation | ||
77 | and example user space code. ps/2 keybd is multiplexed through this driver | ||
78 | |||
79 | To do | ||
80 | ===== | ||
81 | |||
82 | - UCB1200 audio with new ucb_generic layer | ||
83 | - everything else! :-) | ||
84 | |||
85 | Notes | ||
86 | ===== | ||
87 | |||
88 | - The flash on board is divided into 3 partitions. mtd0 is where | ||
89 | the ADS boot ROM and zImage is stored. It's been marked as | ||
90 | read-only to keep you from blasting over the bootloader. :) mtd1 is | ||
91 | for the ramdisk.gz image. mtd2 is user flash space and can be | ||
92 | utilized for either JFFS or if you're feeling crazy, running ext2 | ||
93 | on top of it. If you're not using the ADS bootloader, you're | ||
94 | welcome to blast over the mtd1 partition also. | ||
95 | |||
96 | - 16bpp mode requires a different cable than what ships with the board. | ||
97 | Contact ADS or look through the manual to wire your own. Currently, | ||
98 | if you compile with 16bit mode support and switch into a lower bpp | ||
99 | mode, the timing is off so the image is corrupted. This will be | ||
100 | fixed soon. | ||
101 | |||
102 | Any contribution can be sent to nico@fluxnic.net and will be greatly welcome! | ||
diff --git a/Documentation/arm/sa1100/graphicsmaster.rst b/Documentation/arm/sa1100/graphicsmaster.rst deleted file mode 100644 index e39892514f0c..000000000000 --- a/Documentation/arm/sa1100/graphicsmaster.rst +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | ======================================== | ||
2 | ADS GraphicsMaster Single Board Computer | ||
3 | ======================================== | ||
4 | |||
5 | For more details, contact Applied Data Systems or see | ||
6 | http://www.applieddata.net/products.html | ||
7 | |||
8 | The original Linux support for this product has been provided by | ||
9 | Nicolas Pitre <nico@fluxnic.net>. Continued development work by | ||
10 | Woojung Huh <whuh@applieddata.net> | ||
11 | |||
12 | Use 'make graphicsmaster_config' before any 'make config'. | ||
13 | This will set up defaults for GraphicsMaster support. | ||
14 | |||
15 | The kernel zImage is linked to be loaded and executed at 0xc0400000. | ||
16 | |||
17 | Linux can be used with the ADS BootLoader that ships with the | ||
18 | newer rev boards. See their documentation on how to load Linux. | ||
19 | |||
20 | Supported peripherals | ||
21 | ===================== | ||
22 | |||
23 | - SA1100 LCD frame buffer (8/16bpp...sort of) | ||
24 | - SA1111 USB Master | ||
25 | - on-board SMC 92C96 ethernet NIC | ||
26 | - SA1100 serial port | ||
27 | - flash memory access (MTD/JFFS) | ||
28 | - pcmcia, compact flash | ||
29 | - touchscreen(ucb1200) | ||
30 | - ps/2 keyboard | ||
31 | - console on LCD screen | ||
32 | - serial ports (ttyS[0-2]) | ||
33 | - ttyS0 is default for serial console | ||
34 | - Smart I/O (ADC, keypad, digital inputs, etc) | ||
35 | See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation | ||
36 | and example user space code. ps/2 keybd is multiplexed through this driver | ||
37 | |||
38 | To do | ||
39 | ===== | ||
40 | |||
41 | - everything else! :-) | ||
42 | |||
43 | Notes | ||
44 | ===== | ||
45 | |||
46 | - The flash on board is divided into 3 partitions. mtd0 is where | ||
47 | the zImage is stored. It's been marked as read-only to keep you | ||
48 | from blasting over the bootloader. :) mtd1 is | ||
49 | for the ramdisk.gz image. mtd2 is user flash space and can be | ||
50 | utilized for either JFFS or if you're feeling crazy, running ext2 | ||
51 | on top of it. If you're not using the ADS bootloader, you're | ||
52 | welcome to blast over the mtd1 partition also. | ||
53 | |||
54 | - 16bpp mode requires a different cable than what ships with the board. | ||
55 | Contact ADS or look through the manual to wire your own. Currently, | ||
56 | if you compile with 16bit mode support and switch into a lower bpp | ||
57 | mode, the timing is off so the image is corrupted. This will be | ||
58 | fixed soon. | ||
59 | |||
60 | Any contribution can be sent to nico@fluxnic.net and will be greatly welcome! | ||
diff --git a/Documentation/arm/sa1100/huw_webpanel.rst b/Documentation/arm/sa1100/huw_webpanel.rst deleted file mode 100644 index 1dc7ccb165f0..000000000000 --- a/Documentation/arm/sa1100/huw_webpanel.rst +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | ======================= | ||
2 | Hoeft & Wessel Webpanel | ||
3 | ======================= | ||
4 | |||
5 | The HUW_WEBPANEL is a product of the german company Hoeft & Wessel AG | ||
6 | |||
7 | If you want more information, please visit | ||
8 | http://www.hoeft-wessel.de | ||
9 | |||
10 | To build the kernel:: | ||
11 | |||
12 | make huw_webpanel_config | ||
13 | make oldconfig | ||
14 | [accept all defaults] | ||
15 | make zImage | ||
16 | |||
17 | Mostly of the work is done by: | ||
18 | Roman Jordan jor@hoeft-wessel.de | ||
19 | Christoph Schulz schu@hoeft-wessel.de | ||
20 | |||
21 | 2000/12/18/ | ||
diff --git a/Documentation/arm/sa1100/index.rst b/Documentation/arm/sa1100/index.rst index 68c2a280a745..c9aed43280ff 100644 --- a/Documentation/arm/sa1100/index.rst +++ b/Documentation/arm/sa1100/index.rst | |||
@@ -7,19 +7,7 @@ Intel StrongARM 1100 | |||
7 | .. toctree:: | 7 | .. toctree:: |
8 | :maxdepth: 1 | 8 | :maxdepth: 1 |
9 | 9 | ||
10 | adsbitsy | ||
11 | assabet | 10 | assabet |
12 | brutus | ||
13 | cerf | 11 | cerf |
14 | freebird | ||
15 | graphicsclient | ||
16 | graphicsmaster | ||
17 | huw_webpanel | ||
18 | itsy | ||
19 | lart | 12 | lart |
20 | nanoengine | ||
21 | pangolin | ||
22 | pleb | ||
23 | serial_uart | 13 | serial_uart |
24 | tifon | ||
25 | yopy | ||
diff --git a/Documentation/arm/sa1100/itsy.rst b/Documentation/arm/sa1100/itsy.rst deleted file mode 100644 index f49896ba3ef1..000000000000 --- a/Documentation/arm/sa1100/itsy.rst +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | ==== | ||
2 | Itsy | ||
3 | ==== | ||
4 | |||
5 | Itsy is a research project done by the Western Research Lab, and Systems | ||
6 | Research Center in Palo Alto, CA. The Itsy project is one of several | ||
7 | research projects at Compaq that are related to pocket computing. | ||
8 | |||
9 | For more information, see: | ||
10 | |||
11 | http://www.hpl.hp.com/downloads/crl/itsy/ | ||
12 | |||
13 | Notes on initial 2.4 Itsy support (8/27/2000) : | ||
14 | |||
15 | The port was done on an Itsy version 1.5 machine with a daughtercard with | ||
16 | 64 Meg of DRAM and 32 Meg of Flash. The initial work includes support for | ||
17 | serial console (to see what you're doing). No other devices have been | ||
18 | enabled. | ||
19 | |||
20 | To build, do a "make menuconfig" (or xmenuconfig) and select Itsy support. | ||
21 | Disable Flash and LCD support. and then do a make zImage. | ||
22 | Finally, you will need to cd to arch/arm/boot/tools and execute a make there | ||
23 | to build the params-itsy program used to boot the kernel. | ||
24 | |||
25 | In order to install the port of 2.4 to the itsy, You will need to set the | ||
26 | configuration parameters in the monitor as follows:: | ||
27 | |||
28 | Arg 1:0x08340000, Arg2: 0xC0000000, Arg3:18 (0x12), Arg4:0 | ||
29 | |||
30 | Make sure the start-routine address is set to 0x00060000. | ||
31 | |||
32 | Next, flash the params-itsy program to 0x00060000 ("p 1 0x00060000" in the | ||
33 | flash menu) Flash the kernel in arch/arm/boot/zImage into 0x08340000 | ||
34 | ("p 1 0x00340000"). Finally flash an initial ramdisk into 0xC8000000 | ||
35 | ("p 2 0x0") We used ramdisk-2-30.gz from the 0.11 version directory on | ||
36 | handhelds.org. | ||
37 | |||
38 | The serial connection we established was at: | ||
39 | |||
40 | 8-bit data, no parity, 1 stop bit(s), 115200.00 b/s. in the monitor, in the | ||
41 | params-itsy program, and in the kernel itself. This can be changed, but | ||
42 | not easily. The monitor parameters are easily changed, the params program | ||
43 | setup is assembly outl's, and the kernel is a configuration item specific to | ||
44 | the itsy. (i.e. grep for CONFIG_SA1100_ITSY and you'll find where it is.) | ||
45 | |||
46 | |||
47 | This should get you a properly booting 2.4 kernel on the itsy. | ||
diff --git a/Documentation/arm/sa1100/nanoengine.rst b/Documentation/arm/sa1100/nanoengine.rst deleted file mode 100644 index 47f1a14cf98a..000000000000 --- a/Documentation/arm/sa1100/nanoengine.rst +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | ========== | ||
2 | nanoEngine | ||
3 | ========== | ||
4 | |||
5 | "nanoEngine" is a SA1110 based single board computer from | ||
6 | Bright Star Engineering Inc. See www.brightstareng.com/arm | ||
7 | for more info. | ||
8 | (Ref: Stuart Adams <sja@brightstareng.com>) | ||
9 | |||
10 | Also visit Larry Doolittle's "Linux for the nanoEngine" site: | ||
11 | http://www.brightstareng.com/arm/nanoeng.htm | ||
diff --git a/Documentation/arm/sa1100/pangolin.rst b/Documentation/arm/sa1100/pangolin.rst deleted file mode 100644 index f0c5c1618553..000000000000 --- a/Documentation/arm/sa1100/pangolin.rst +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | ======== | ||
2 | Pangolin | ||
3 | ======== | ||
4 | |||
5 | Pangolin is a StrongARM 1110-based evaluation platform produced | ||
6 | by Dialogue Technology (http://www.dialogue.com.tw/). | ||
7 | It has EISA slots for ease of configuration with SDRAM/Flash | ||
8 | memory card, USB/Serial/Audio card, Compact Flash card, | ||
9 | PCMCIA/IDE card and TFT-LCD card. | ||
10 | |||
11 | To compile for Pangolin, you must issue the following commands:: | ||
12 | |||
13 | make pangolin_config | ||
14 | make oldconfig | ||
15 | make zImage | ||
16 | |||
17 | Supported peripherals | ||
18 | ===================== | ||
19 | |||
20 | - SA1110 serial port (UART1/UART2/UART3) | ||
21 | - flash memory access | ||
22 | - compact flash driver | ||
23 | - UDA1341 sound driver | ||
24 | - SA1100 LCD controller for 800x600 16bpp TFT-LCD | ||
25 | - MQ-200 driver for 800x600 16bpp TFT-LCD | ||
26 | - Penmount(touch panel) driver | ||
27 | - PCMCIA driver | ||
28 | - SMC91C94 LAN driver | ||
29 | - IDE driver (experimental) | ||
diff --git a/Documentation/arm/sa1100/pleb.rst b/Documentation/arm/sa1100/pleb.rst deleted file mode 100644 index d5b732967aa3..000000000000 --- a/Documentation/arm/sa1100/pleb.rst +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | ==== | ||
2 | PLEB | ||
3 | ==== | ||
4 | |||
5 | The PLEB project was started as a student initiative at the School of | ||
6 | Computer Science and Engineering, University of New South Wales to make a | ||
7 | pocket computer capable of running the Linux Kernel. | ||
8 | |||
9 | PLEB support has yet to be fully integrated. | ||
10 | |||
11 | For more information, see: | ||
12 | |||
13 | http://www.cse.unsw.edu.au | ||
diff --git a/Documentation/arm/sa1100/tifon.rst b/Documentation/arm/sa1100/tifon.rst deleted file mode 100644 index c26e910b9ea7..000000000000 --- a/Documentation/arm/sa1100/tifon.rst +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | ===== | ||
2 | Tifon | ||
3 | ===== | ||
4 | |||
5 | More info has to come... | ||
6 | |||
7 | Contact: Peter Danielsson <peter.danielsson@era-t.ericsson.se> | ||
diff --git a/Documentation/arm/sa1100/yopy.rst b/Documentation/arm/sa1100/yopy.rst deleted file mode 100644 index 5b35a5f61a44..000000000000 --- a/Documentation/arm/sa1100/yopy.rst +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | ==== | ||
2 | Yopy | ||
3 | ==== | ||
4 | |||
5 | See http://www.yopydeveloper.org for more. | ||
diff --git a/Documentation/arm/samsung-s3c24xx/index.rst b/Documentation/arm/samsung-s3c24xx/index.rst index 5b8a7f9398d8..ccb951a0bedb 100644 --- a/Documentation/arm/samsung-s3c24xx/index.rst +++ b/Documentation/arm/samsung-s3c24xx/index.rst | |||
@@ -1,6 +1,6 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | 1 | .. SPDX-License-Identifier: GPL-2.0 |
2 | 2 | ||
3 | ========================== | 3 | ========================== |
4 | Samsung S3C24XX SoC Family | 4 | Samsung S3C24XX SoC Family |
5 | ========================== | 5 | ========================== |
6 | 6 | ||
diff --git a/Documentation/arm/sh-mobile/.gitignore b/Documentation/arm/sh-mobile/.gitignore deleted file mode 100644 index c928dbf3cc88..000000000000 --- a/Documentation/arm/sh-mobile/.gitignore +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | vrl4 | ||
diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b deleted file mode 100644 index 12fd51b8de75..000000000000 --- a/Documentation/auxdisplay/cfag12864b +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | =================================== | ||
2 | cfag12864b LCD Driver Documentation | ||
3 | =================================== | ||
4 | |||
5 | License: GPLv2 | ||
6 | Author & Maintainer: Miguel Ojeda Sandonis | ||
7 | Date: 2006-10-27 | ||
8 | |||
9 | |||
10 | |||
11 | -------- | ||
12 | 0. INDEX | ||
13 | -------- | ||
14 | |||
15 | 1. DRIVER INFORMATION | ||
16 | 2. DEVICE INFORMATION | ||
17 | 3. WIRING | ||
18 | 4. USERSPACE PROGRAMMING | ||
19 | |||
20 | |||
21 | --------------------- | ||
22 | 1. DRIVER INFORMATION | ||
23 | --------------------- | ||
24 | |||
25 | This driver supports a cfag12864b LCD. | ||
26 | |||
27 | |||
28 | --------------------- | ||
29 | 2. DEVICE INFORMATION | ||
30 | --------------------- | ||
31 | |||
32 | Manufacturer: Crystalfontz | ||
33 | Device Name: Crystalfontz 12864b LCD Series | ||
34 | Device Code: cfag12864b | ||
35 | Webpage: http://www.crystalfontz.com | ||
36 | Device Webpage: http://www.crystalfontz.com/products/12864b/ | ||
37 | Type: LCD (Liquid Crystal Display) | ||
38 | Width: 128 | ||
39 | Height: 64 | ||
40 | Colors: 2 (B/N) | ||
41 | Controller: ks0108 | ||
42 | Controllers: 2 | ||
43 | Pages: 8 each controller | ||
44 | Addresses: 64 each page | ||
45 | Data size: 1 byte each address | ||
46 | Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte | ||
47 | |||
48 | |||
49 | --------- | ||
50 | 3. WIRING | ||
51 | --------- | ||
52 | |||
53 | The cfag12864b LCD Series don't have official wiring. | ||
54 | |||
55 | The common wiring is done to the parallel port as shown: | ||
56 | |||
57 | Parallel Port cfag12864b | ||
58 | |||
59 | Name Pin# Pin# Name | ||
60 | |||
61 | Strobe ( 1)------------------------------(17) Enable | ||
62 | Data 0 ( 2)------------------------------( 4) Data 0 | ||
63 | Data 1 ( 3)------------------------------( 5) Data 1 | ||
64 | Data 2 ( 4)------------------------------( 6) Data 2 | ||
65 | Data 3 ( 5)------------------------------( 7) Data 3 | ||
66 | Data 4 ( 6)------------------------------( 8) Data 4 | ||
67 | Data 5 ( 7)------------------------------( 9) Data 5 | ||
68 | Data 6 ( 8)------------------------------(10) Data 6 | ||
69 | Data 7 ( 9)------------------------------(11) Data 7 | ||
70 | (10) [+5v]---( 1) Vdd | ||
71 | (11) [GND]---( 2) Ground | ||
72 | (12) [+5v]---(14) Reset | ||
73 | (13) [GND]---(15) Read / Write | ||
74 | Line (14)------------------------------(13) Controller Select 1 | ||
75 | (15) | ||
76 | Init (16)------------------------------(12) Controller Select 2 | ||
77 | Select (17)------------------------------(16) Data / Instruction | ||
78 | Ground (18)---[GND] [+5v]---(19) LED + | ||
79 | Ground (19)---[GND] | ||
80 | Ground (20)---[GND] E A Values: | ||
81 | Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm | ||
82 | Ground (22)---[GND] | - P1 = Preset = 10 Kohm | ||
83 | Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm | ||
84 | Ground (24)---[GND] | | | ||
85 | Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - | ||
86 | |||
87 | |||
88 | ------------------------ | ||
89 | 4. USERSPACE PROGRAMMING | ||
90 | ------------------------ | ||
91 | |||
92 | The cfag12864bfb describes a framebuffer device (/dev/fbX). | ||
93 | |||
94 | It has a size of 1024 bytes = 1 Kbyte. | ||
95 | Each bit represents one pixel. If the bit is high, the pixel will | ||
96 | turn on. If the pixel is low, the pixel will turn off. | ||
97 | |||
98 | You can use the framebuffer as a file: fopen, fwrite, fclose... | ||
99 | Although the LCD won't get updated until the next refresh time arrives. | ||
100 | |||
101 | Also, you can mmap the framebuffer: open & mmap, munmap & close... | ||
102 | which is the best option for most uses. | ||
103 | |||
104 | Check samples/auxdisplay/cfag12864b-example.c | ||
105 | for a real working userspace complete program with usage examples. | ||
diff --git a/Documentation/auxdisplay/ks0108 b/Documentation/auxdisplay/ks0108 deleted file mode 100644 index 8ddda0c8ceef..000000000000 --- a/Documentation/auxdisplay/ks0108 +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | ========================================== | ||
2 | ks0108 LCD Controller Driver Documentation | ||
3 | ========================================== | ||
4 | |||
5 | License: GPLv2 | ||
6 | Author & Maintainer: Miguel Ojeda Sandonis | ||
7 | Date: 2006-10-27 | ||
8 | |||
9 | |||
10 | |||
11 | -------- | ||
12 | 0. INDEX | ||
13 | -------- | ||
14 | |||
15 | 1. DRIVER INFORMATION | ||
16 | 2. DEVICE INFORMATION | ||
17 | 3. WIRING | ||
18 | |||
19 | |||
20 | --------------------- | ||
21 | 1. DRIVER INFORMATION | ||
22 | --------------------- | ||
23 | |||
24 | This driver supports the ks0108 LCD controller. | ||
25 | |||
26 | |||
27 | --------------------- | ||
28 | 2. DEVICE INFORMATION | ||
29 | --------------------- | ||
30 | |||
31 | Manufacturer: Samsung | ||
32 | Device Name: KS0108 LCD Controller | ||
33 | Device Code: ks0108 | ||
34 | Webpage: - | ||
35 | Device Webpage: - | ||
36 | Type: LCD Controller (Liquid Crystal Display Controller) | ||
37 | Width: 64 | ||
38 | Height: 64 | ||
39 | Colors: 2 (B/N) | ||
40 | Pages: 8 | ||
41 | Addresses: 64 each page | ||
42 | Data size: 1 byte each address | ||
43 | Memory size: 8 * 64 * 1 = 512 bytes | ||
44 | |||
45 | |||
46 | --------- | ||
47 | 3. WIRING | ||
48 | --------- | ||
49 | |||
50 | The driver supports data parallel port wiring. | ||
51 | |||
52 | If you aren't building LCD related hardware, you should check | ||
53 | your LCD specific wiring information in the same folder. | ||
54 | |||
55 | For example, check Documentation/auxdisplay/cfag12864b. | ||
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst index da0ed972d224..fa16a0538dcb 100644 --- a/Documentation/core-api/index.rst +++ b/Documentation/core-api/index.rst | |||
@@ -25,6 +25,7 @@ Core utilities | |||
25 | librs | 25 | librs |
26 | genalloc | 26 | genalloc |
27 | errseq | 27 | errseq |
28 | packing | ||
28 | printk-formats | 29 | printk-formats |
29 | circular-buffers | 30 | circular-buffers |
30 | generic-radix-tree | 31 | generic-radix-tree |
@@ -48,7 +49,7 @@ Interfaces for kernel debugging | |||
48 | debug-objects | 49 | debug-objects |
49 | tracepoint | 50 | tracepoint |
50 | 51 | ||
51 | .. only:: subproject | 52 | .. only:: subproject and html |
52 | 53 | ||
53 | Indices | 54 | Indices |
54 | ======= | 55 | ======= |
diff --git a/Documentation/packing.txt b/Documentation/core-api/packing.rst index f830c98645f1..d8c341fe383e 100644 --- a/Documentation/packing.txt +++ b/Documentation/core-api/packing.rst | |||
@@ -30,6 +30,7 @@ The solution | |||
30 | ------------ | 30 | ------------ |
31 | 31 | ||
32 | This API deals with 2 basic operations: | 32 | This API deals with 2 basic operations: |
33 | |||
33 | - Packing a CPU-usable number into a memory buffer (with hardware | 34 | - Packing a CPU-usable number into a memory buffer (with hardware |
34 | constraints/quirks) | 35 | constraints/quirks) |
35 | - Unpacking a memory buffer (which has hardware constraints/quirks) | 36 | - Unpacking a memory buffer (which has hardware constraints/quirks) |
@@ -49,10 +50,12 @@ What the examples show is where the logical bytes and bits sit. | |||
49 | 50 | ||
50 | 1. Normally (no quirks), we would do it like this: | 51 | 1. Normally (no quirks), we would do it like this: |
51 | 52 | ||
52 | 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 | 53 | :: |
53 | 7 6 5 4 | 54 | |
54 | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 | 55 | 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 |
55 | 3 2 1 0 | 56 | 7 6 5 4 |
57 | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 | ||
58 | 3 2 1 0 | ||
56 | 59 | ||
57 | That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the | 60 | That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the |
58 | LSByte (0) of the u64 sits at memory offset 7. | 61 | LSByte (0) of the u64 sits at memory offset 7. |
@@ -63,10 +66,12 @@ comments as "logical" notation. | |||
63 | 66 | ||
64 | 2. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this: | 67 | 2. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this: |
65 | 68 | ||
66 | 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39 | 69 | :: |
67 | 7 6 5 4 | 70 | |
68 | 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 | 71 | 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39 |
69 | 3 2 1 0 | 72 | 7 6 5 4 |
73 | 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 | ||
74 | 3 2 1 0 | ||
70 | 75 | ||
71 | That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but | 76 | That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but |
72 | inverts bit offsets inside a byte. | 77 | inverts bit offsets inside a byte. |
@@ -74,10 +79,12 @@ inverts bit offsets inside a byte. | |||
74 | 79 | ||
75 | 3. If QUIRK_LITTLE_ENDIAN is set, we do it like this: | 80 | 3. If QUIRK_LITTLE_ENDIAN is set, we do it like this: |
76 | 81 | ||
77 | 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56 | 82 | :: |
78 | 4 5 6 7 | 83 | |
79 | 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 | 84 | 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56 |
80 | 0 1 2 3 | 85 | 4 5 6 7 |
86 | 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 | ||
87 | 0 1 2 3 | ||
81 | 88 | ||
82 | Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every | 89 | Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every |
83 | byte from each 4-byte word is placed at its mirrored position compared to | 90 | byte from each 4-byte word is placed at its mirrored position compared to |
@@ -86,18 +93,22 @@ the boundary of that word. | |||
86 | 4. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it | 93 | 4. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it |
87 | like this: | 94 | like this: |
88 | 95 | ||
89 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 96 | :: |
90 | 4 5 6 7 | 97 | |
91 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 98 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
92 | 0 1 2 3 | 99 | 4 5 6 7 |
100 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ||
101 | 0 1 2 3 | ||
93 | 102 | ||
94 | 103 | ||
95 | 5. If just QUIRK_LSW32_IS_FIRST is set, we do it like this: | 104 | 5. If just QUIRK_LSW32_IS_FIRST is set, we do it like this: |
96 | 105 | ||
97 | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 | 106 | :: |
98 | 3 2 1 0 | 107 | |
99 | 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 | 108 | 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 |
100 | 7 6 5 4 | 109 | 3 2 1 0 |
110 | 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 | ||
111 | 7 6 5 4 | ||
101 | 112 | ||
102 | In this case the 8 byte memory region is interpreted as follows: first | 113 | In this case the 8 byte memory region is interpreted as follows: first |
103 | 4 bytes correspond to the least significant 4-byte word, next 4 bytes to | 114 | 4 bytes correspond to the least significant 4-byte word, next 4 bytes to |
@@ -107,28 +118,34 @@ the more significant 4-byte word. | |||
107 | 6. If QUIRK_LSW32_IS_FIRST and QUIRK_MSB_ON_THE_RIGHT are set, we do it like | 118 | 6. If QUIRK_LSW32_IS_FIRST and QUIRK_MSB_ON_THE_RIGHT are set, we do it like |
108 | this: | 119 | this: |
109 | 120 | ||
110 | 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 | 121 | :: |
111 | 3 2 1 0 | 122 | |
112 | 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39 | 123 | 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 |
113 | 7 6 5 4 | 124 | 3 2 1 0 |
125 | 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39 | ||
126 | 7 6 5 4 | ||
114 | 127 | ||
115 | 128 | ||
116 | 7. If QUIRK_LSW32_IS_FIRST and QUIRK_LITTLE_ENDIAN are set, it looks like | 129 | 7. If QUIRK_LSW32_IS_FIRST and QUIRK_LITTLE_ENDIAN are set, it looks like |
117 | this: | 130 | this: |
118 | 131 | ||
119 | 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 | 132 | :: |
120 | 0 1 2 3 | 133 | |
121 | 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56 | 134 | 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24 |
122 | 4 5 6 7 | 135 | 0 1 2 3 |
136 | 39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56 | ||
137 | 4 5 6 7 | ||
123 | 138 | ||
124 | 139 | ||
125 | 8. If QUIRK_LSW32_IS_FIRST, QUIRK_LITTLE_ENDIAN and QUIRK_MSB_ON_THE_RIGHT | 140 | 8. If QUIRK_LSW32_IS_FIRST, QUIRK_LITTLE_ENDIAN and QUIRK_MSB_ON_THE_RIGHT |
126 | are set, it looks like this: | 141 | are set, it looks like this: |
127 | 142 | ||
128 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 143 | :: |
129 | 0 1 2 3 | 144 | |
130 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 145 | 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
131 | 4 5 6 7 | 146 | 0 1 2 3 |
147 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | ||
148 | 4 5 6 7 | ||
132 | 149 | ||
133 | 150 | ||
134 | We always think of our offsets as if there were no quirk, and we translate | 151 | We always think of our offsets as if there were no quirk, and we translate |
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index c6224d039bcb..ecbebf4ca8e7 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst | |||
@@ -13,10 +13,10 @@ Integer types | |||
13 | 13 | ||
14 | If variable is of Type, use printk format specifier: | 14 | If variable is of Type, use printk format specifier: |
15 | ------------------------------------------------------------ | 15 | ------------------------------------------------------------ |
16 | char %hhd or %hhx | 16 | char %d or %x |
17 | unsigned char %hhu or %hhx | 17 | unsigned char %u or %x |
18 | short int %hd or %hx | 18 | short int %d or %x |
19 | unsigned short int %hu or %hx | 19 | unsigned short int %u or %x |
20 | int %d or %x | 20 | int %d or %x |
21 | unsigned int %u or %x | 21 | unsigned int %u or %x |
22 | long %ld or %lx | 22 | long %ld or %lx |
@@ -25,10 +25,10 @@ Integer types | |||
25 | unsigned long long %llu or %llx | 25 | unsigned long long %llu or %llx |
26 | size_t %zu or %zx | 26 | size_t %zu or %zx |
27 | ssize_t %zd or %zx | 27 | ssize_t %zd or %zx |
28 | s8 %hhd or %hhx | 28 | s8 %d or %x |
29 | u8 %hhu or %hhx | 29 | u8 %u or %x |
30 | s16 %hd or %hx | 30 | s16 %d or %x |
31 | u16 %hu or %hx | 31 | u16 %u or %x |
32 | s32 %d or %x | 32 | s32 %d or %x |
33 | u32 %u or %x | 33 | u32 %u or %x |
34 | s64 %lld or %llx | 34 | s64 %lld or %llx |
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt index 2907dab56298..8b444b94e92f 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt | |||
@@ -42,7 +42,7 @@ Optional properties: | |||
42 | This means that no unrelated I2C transactions are allowed on the parent I2C | 42 | This means that no unrelated I2C transactions are allowed on the parent I2C |
43 | adapter for the complete multiplexed I2C transaction. | 43 | adapter for the complete multiplexed I2C transaction. |
44 | The properties of mux-locked and parent-locked multiplexers are discussed | 44 | The properties of mux-locked and parent-locked multiplexers are discussed |
45 | in more detail in Documentation/i2c/i2c-topology. | 45 | in more detail in Documentation/i2c/i2c-topology.rst. |
46 | 46 | ||
47 | For each i2c child node, an I2C child bus will be created. They will | 47 | For each i2c child node, an I2C child bus will be created. They will |
48 | be numbered based on their order in the device tree. | 48 | be numbered based on their order in the device tree. |
diff --git a/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt b/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt index 2ca3d138528e..7ecf6bd60d27 100644 --- a/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt | |||
@@ -4,7 +4,7 @@ Allwinner SUN8I audio codec | |||
4 | On Sun8i-A33 SoCs, the audio is separated in different parts: | 4 | On Sun8i-A33 SoCs, the audio is separated in different parts: |
5 | - A DAI driver. It uses the "sun4i-i2s" driver which is | 5 | - A DAI driver. It uses the "sun4i-i2s" driver which is |
6 | documented here: | 6 | documented here: |
7 | Documentation/devicetree/bindings/sound/sun4i-i2s.txt | 7 | Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml |
8 | - An analog part of the codec which is handled as PRCM registers. | 8 | - An analog part of the codec which is handled as PRCM registers. |
9 | See Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt | 9 | See Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt |
10 | - An digital part of the codec which is documented in this current | 10 | - An digital part of the codec which is documented in this current |
diff --git a/Documentation/devicetree/writing-schema.md b/Documentation/devicetree/writing-schema.md deleted file mode 100644 index dc032db36262..000000000000 --- a/Documentation/devicetree/writing-schema.md +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | # Writing DeviceTree Bindings in json-schema | ||
2 | |||
3 | Devicetree bindings are written using json-schema vocabulary. Schema files are | ||
4 | written in a JSON compatible subset of YAML. YAML is used instead of JSON as it | ||
5 | considered more human readable and has some advantages such as allowing | ||
6 | comments (Prefixed with '#'). | ||
7 | |||
8 | ## Schema Contents | ||
9 | |||
10 | Each schema doc is a structured json-schema which is defined by a set of | ||
11 | top-level properties. Generally, there is one binding defined per file. The | ||
12 | top-level json-schema properties used are: | ||
13 | |||
14 | - __$id__ - A json-schema unique identifier string. The string must be a valid | ||
15 | URI typically containing the binding's filename and path. For DT schema, it must | ||
16 | begin with "http://devicetree.org/schemas/". The URL is used in constructing | ||
17 | references to other files specified in schema "$ref" properties. A $ref values | ||
18 | with a leading '/' will have the hostname prepended. A $ref value a relative | ||
19 | path or filename only will be prepended with the hostname and path components | ||
20 | of the current schema file's '$id' value. A URL is used even for local files, | ||
21 | but there may not actually be files present at those locations. | ||
22 | |||
23 | - __$schema__ - Indicates the meta-schema the schema file adheres to. | ||
24 | |||
25 | - __title__ - A one line description on the contents of the binding schema. | ||
26 | |||
27 | - __maintainers__ - A DT specific property. Contains a list of email address(es) | ||
28 | for maintainers of this binding. | ||
29 | |||
30 | - __description__ - Optional. A multi-line text block containing any detailed | ||
31 | information about this binding. It should contain things such as what the block | ||
32 | or device does, standards the device conforms to, and links to datasheets for | ||
33 | more information. | ||
34 | |||
35 | - __select__ - Optional. A json-schema used to match nodes for applying the | ||
36 | schema. By default without 'select', nodes are matched against their possible | ||
37 | compatible string values or node name. Most bindings should not need select. | ||
38 | |||
39 | - __allOf__ - Optional. A list of other schemas to include. This is used to | ||
40 | include other schemas the binding conforms to. This may be schemas for a | ||
41 | particular class of devices such as I2C or SPI controllers. | ||
42 | |||
43 | - __properties__ - A set of sub-schema defining all the DT properties for the | ||
44 | binding. The exact schema syntax depends on whether properties are known, | ||
45 | common properties (e.g. 'interrupts') or are binding/vendor specific properties. | ||
46 | |||
47 | A property can also define a child DT node with child properties defined | ||
48 | under it. | ||
49 | |||
50 | For more details on properties sections, see 'Property Schema' section. | ||
51 | |||
52 | - __patternProperties__ - Optional. Similar to 'properties', but names are regex. | ||
53 | |||
54 | - __required__ - A list of DT properties from the 'properties' section that | ||
55 | must always be present. | ||
56 | |||
57 | - __examples__ - Optional. A list of one or more DTS hunks implementing the | ||
58 | binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead. | ||
59 | |||
60 | Unless noted otherwise, all properties are required. | ||
61 | |||
62 | ## Property Schema | ||
63 | |||
64 | The 'properties' section of the schema contains all the DT properties for a | ||
65 | binding. Each property contains a set of constraints using json-schema | ||
66 | vocabulary for that property. The properties schemas are what is used for | ||
67 | validation of DT files. | ||
68 | |||
69 | For common properties, only additional constraints not covered by the common | ||
70 | binding schema need to be defined such as how many values are valid or what | ||
71 | possible values are valid. | ||
72 | |||
73 | Vendor specific properties will typically need more detailed schema. With the | ||
74 | exception of boolean properties, they should have a reference to a type in | ||
75 | schemas/types.yaml. A "description" property is always required. | ||
76 | |||
77 | The Devicetree schemas don't exactly match the YAML encoded DT data produced by | ||
78 | dtc. They are simplified to make them more compact and avoid a bunch of | ||
79 | boilerplate. The tools process the schema files to produce the final schema for | ||
80 | validation. There are currently 2 transformations the tools perform. | ||
81 | |||
82 | The default for arrays in json-schema is they are variable sized and allow more | ||
83 | entries than explicitly defined. This can be restricted by defining 'minItems', | ||
84 | 'maxItems', and 'additionalItems'. However, for DeviceTree Schemas, a fixed | ||
85 | size is desired in most cases, so these properties are added based on the | ||
86 | number of entries in an 'items' list. | ||
87 | |||
88 | The YAML Devicetree format also makes all string values an array and scalar | ||
89 | values a matrix (in order to define groupings) even when only a single value | ||
90 | is present. Single entries in schemas are fixed up to match this encoding. | ||
91 | |||
92 | ## Testing | ||
93 | |||
94 | ### Dependencies | ||
95 | |||
96 | The DT schema project must be installed in order to validate the DT schema | ||
97 | binding documents and validate DTS files using the DT schema. The DT schema | ||
98 | project can be installed with pip: | ||
99 | |||
100 | `pip3 install git+https://github.com/devicetree-org/dt-schema.git@master` | ||
101 | |||
102 | dtc must also be built with YAML output support enabled. This requires that | ||
103 | libyaml and its headers be installed on the host system. | ||
104 | |||
105 | ### Running checks | ||
106 | |||
107 | The DT schema binding documents must be validated using the meta-schema (the | ||
108 | schema for the schema) to ensure they are both valid json-schema and valid | ||
109 | binding schema. All of the DT binding documents can be validated using the | ||
110 | `dt_binding_check` target: | ||
111 | |||
112 | `make dt_binding_check` | ||
113 | |||
114 | In order to perform validation of DT source files, use the `dtbs_check` target: | ||
115 | |||
116 | `make dtbs_check` | ||
117 | |||
118 | This will first run the `dt_binding_check` which generates the processed schema. | ||
119 | |||
120 | It is also possible to run checks with a single schema file by setting the | ||
121 | 'DT_SCHEMA_FILES' variable to a specific schema file. | ||
122 | |||
123 | `make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml` | ||
124 | |||
125 | |||
126 | ## json-schema Resources | ||
127 | |||
128 | [JSON-Schema Specifications](http://json-schema.org/) | ||
129 | |||
130 | [Using JSON Schema Book](http://usingjsonschema.com/) | ||
diff --git a/Documentation/devicetree/writing-schema.rst b/Documentation/devicetree/writing-schema.rst new file mode 100644 index 000000000000..8f71d1e2ac52 --- /dev/null +++ b/Documentation/devicetree/writing-schema.rst | |||
@@ -0,0 +1,153 @@ | |||
1 | :orphan: | ||
2 | |||
3 | Writing DeviceTree Bindings in json-schema | ||
4 | ========================================== | ||
5 | |||
6 | Devicetree bindings are written using json-schema vocabulary. Schema files are | ||
7 | written in a JSON compatible subset of YAML. YAML is used instead of JSON as it | ||
8 | considered more human readable and has some advantages such as allowing | ||
9 | comments (Prefixed with '#'). | ||
10 | |||
11 | Schema Contents | ||
12 | --------------- | ||
13 | |||
14 | Each schema doc is a structured json-schema which is defined by a set of | ||
15 | top-level properties. Generally, there is one binding defined per file. The | ||
16 | top-level json-schema properties used are: | ||
17 | |||
18 | $id | ||
19 | A json-schema unique identifier string. The string must be a valid | ||
20 | URI typically containing the binding's filename and path. For DT schema, it must | ||
21 | begin with "http://devicetree.org/schemas/". The URL is used in constructing | ||
22 | references to other files specified in schema "$ref" properties. A $ref values | ||
23 | with a leading '/' will have the hostname prepended. A $ref value a relative | ||
24 | path or filename only will be prepended with the hostname and path components | ||
25 | of the current schema file's '$id' value. A URL is used even for local files, | ||
26 | but there may not actually be files present at those locations. | ||
27 | |||
28 | $schema | ||
29 | Indicates the meta-schema the schema file adheres to. | ||
30 | |||
31 | title | ||
32 | A one line description on the contents of the binding schema. | ||
33 | |||
34 | maintainers | ||
35 | A DT specific property. Contains a list of email address(es) | ||
36 | for maintainers of this binding. | ||
37 | |||
38 | description | ||
39 | Optional. A multi-line text block containing any detailed | ||
40 | information about this binding. It should contain things such as what the block | ||
41 | or device does, standards the device conforms to, and links to datasheets for | ||
42 | more information. | ||
43 | |||
44 | select | ||
45 | Optional. A json-schema used to match nodes for applying the | ||
46 | schema. By default without 'select', nodes are matched against their possible | ||
47 | compatible string values or node name. Most bindings should not need select. | ||
48 | |||
49 | allOf | ||
50 | Optional. A list of other schemas to include. This is used to | ||
51 | include other schemas the binding conforms to. This may be schemas for a | ||
52 | particular class of devices such as I2C or SPI controllers. | ||
53 | |||
54 | properties | ||
55 | A set of sub-schema defining all the DT properties for the | ||
56 | binding. The exact schema syntax depends on whether properties are known, | ||
57 | common properties (e.g. 'interrupts') or are binding/vendor specific properties. | ||
58 | |||
59 | A property can also define a child DT node with child properties defined | ||
60 | under it. | ||
61 | |||
62 | For more details on properties sections, see 'Property Schema' section. | ||
63 | |||
64 | patternProperties | ||
65 | Optional. Similar to 'properties', but names are regex. | ||
66 | |||
67 | required | ||
68 | A list of DT properties from the 'properties' section that | ||
69 | must always be present. | ||
70 | |||
71 | examples | ||
72 | Optional. A list of one or more DTS hunks implementing the | ||
73 | binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead. | ||
74 | |||
75 | Unless noted otherwise, all properties are required. | ||
76 | |||
77 | Property Schema | ||
78 | --------------- | ||
79 | |||
80 | The 'properties' section of the schema contains all the DT properties for a | ||
81 | binding. Each property contains a set of constraints using json-schema | ||
82 | vocabulary for that property. The properties schemas are what is used for | ||
83 | validation of DT files. | ||
84 | |||
85 | For common properties, only additional constraints not covered by the common | ||
86 | binding schema need to be defined such as how many values are valid or what | ||
87 | possible values are valid. | ||
88 | |||
89 | Vendor specific properties will typically need more detailed schema. With the | ||
90 | exception of boolean properties, they should have a reference to a type in | ||
91 | schemas/types.yaml. A "description" property is always required. | ||
92 | |||
93 | The Devicetree schemas don't exactly match the YAML encoded DT data produced by | ||
94 | dtc. They are simplified to make them more compact and avoid a bunch of | ||
95 | boilerplate. The tools process the schema files to produce the final schema for | ||
96 | validation. There are currently 2 transformations the tools perform. | ||
97 | |||
98 | The default for arrays in json-schema is they are variable sized and allow more | ||
99 | entries than explicitly defined. This can be restricted by defining 'minItems', | ||
100 | 'maxItems', and 'additionalItems'. However, for DeviceTree Schemas, a fixed | ||
101 | size is desired in most cases, so these properties are added based on the | ||
102 | number of entries in an 'items' list. | ||
103 | |||
104 | The YAML Devicetree format also makes all string values an array and scalar | ||
105 | values a matrix (in order to define groupings) even when only a single value | ||
106 | is present. Single entries in schemas are fixed up to match this encoding. | ||
107 | |||
108 | Testing | ||
109 | ------- | ||
110 | |||
111 | Dependencies | ||
112 | ~~~~~~~~~~~~ | ||
113 | |||
114 | The DT schema project must be installed in order to validate the DT schema | ||
115 | binding documents and validate DTS files using the DT schema. The DT schema | ||
116 | project can be installed with pip:: | ||
117 | |||
118 | pip3 install git+https://github.com/devicetree-org/dt-schema.git@master | ||
119 | |||
120 | dtc must also be built with YAML output support enabled. This requires that | ||
121 | libyaml and its headers be installed on the host system. | ||
122 | |||
123 | Running checks | ||
124 | ~~~~~~~~~~~~~~ | ||
125 | |||
126 | The DT schema binding documents must be validated using the meta-schema (the | ||
127 | schema for the schema) to ensure they are both valid json-schema and valid | ||
128 | binding schema. All of the DT binding documents can be validated using the | ||
129 | ``dt_binding_check`` target:: | ||
130 | |||
131 | make dt_binding_check | ||
132 | |||
133 | In order to perform validation of DT source files, use the `dtbs_check` target:: | ||
134 | |||
135 | make dtbs_check | ||
136 | |||
137 | This will first run the `dt_binding_check` which generates the processed schema. | ||
138 | |||
139 | It is also possible to run checks with a single schema file by setting the | ||
140 | ``DT_SCHEMA_FILES`` variable to a specific schema file. | ||
141 | |||
142 | :: | ||
143 | |||
144 | make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml | ||
145 | |||
146 | |||
147 | json-schema Resources | ||
148 | --------------------- | ||
149 | |||
150 | |||
151 | `JSON-Schema Specifications <http://json-schema.org/>`_ | ||
152 | |||
153 | `Using JSON Schema Book <http://usingjsonschema.com/>`_ | ||
diff --git a/Documentation/driver-api/dmaengine/index.rst b/Documentation/driver-api/dmaengine/index.rst index 3026fa975937..b9df904d0a79 100644 --- a/Documentation/driver-api/dmaengine/index.rst +++ b/Documentation/driver-api/dmaengine/index.rst | |||
@@ -47,7 +47,7 @@ This book adds some notes about PXA DMA | |||
47 | 47 | ||
48 | pxa_dma | 48 | pxa_dma |
49 | 49 | ||
50 | .. only:: subproject | 50 | .. only:: subproject and html |
51 | 51 | ||
52 | Indices | 52 | Indices |
53 | ======= | 53 | ======= |
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst index d12a80f386a6..38e638abe3eb 100644 --- a/Documentation/driver-api/index.rst +++ b/Documentation/driver-api/index.rst | |||
@@ -65,6 +65,7 @@ available subsections can be seen below. | |||
65 | dmaengine/index | 65 | dmaengine/index |
66 | slimbus | 66 | slimbus |
67 | soundwire/index | 67 | soundwire/index |
68 | thermal/index | ||
68 | fpga/index | 69 | fpga/index |
69 | acpi/index | 70 | acpi/index |
70 | backlight/lp855x-driver.rst | 71 | backlight/lp855x-driver.rst |
@@ -75,6 +76,7 @@ available subsections can be seen below. | |||
75 | dell_rbu | 76 | dell_rbu |
76 | edid | 77 | edid |
77 | eisa | 78 | eisa |
79 | ipmb | ||
78 | isa | 80 | isa |
79 | isapnp | 81 | isapnp |
80 | generic-counter | 82 | generic-counter |
diff --git a/Documentation/driver-api/ipmb.rst b/Documentation/driver-api/ipmb.rst index 7e2265144157..3ec3baed84c4 100644 --- a/Documentation/driver-api/ipmb.rst +++ b/Documentation/driver-api/ipmb.rst | |||
@@ -83,7 +83,7 @@ Instantiate the device | |||
83 | ---------------------- | 83 | ---------------------- |
84 | 84 | ||
85 | After loading the driver, you can instantiate the device as | 85 | After loading the driver, you can instantiate the device as |
86 | described in 'Documentation/i2c/instantiating-devices'. | 86 | described in 'Documentation/i2c/instantiating-devices.rst'. |
87 | If you have multiple BMCs, each connected to your Satellite MC via | 87 | If you have multiple BMCs, each connected to your Satellite MC via |
88 | a different I2C bus, you can instantiate a device for each of | 88 | a different I2C bus, you can instantiate a device for each of |
89 | those BMCs. | 89 | those BMCs. |
diff --git a/Documentation/driver-api/mtd/spi-nor.rst b/Documentation/driver-api/mtd/spi-nor.rst index f5333e3bf486..1f0437676762 100644 --- a/Documentation/driver-api/mtd/spi-nor.rst +++ b/Documentation/driver-api/mtd/spi-nor.rst | |||
@@ -59,7 +59,7 @@ Part III - How can drivers use the framework? | |||
59 | 59 | ||
60 | The main API is spi_nor_scan(). Before you call the hook, a driver should | 60 | The main API is spi_nor_scan(). Before you call the hook, a driver should |
61 | initialize the necessary fields for spi_nor{}. Please see | 61 | initialize the necessary fields for spi_nor{}. Please see |
62 | drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to fsl-quadspi.c | 62 | drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to spi-fsl-qspi.c |
63 | when you want to write a new driver for a SPI NOR controller. | 63 | when you want to write a new driver for a SPI NOR controller. |
64 | Another API is spi_nor_restore(), this is used to restore the status of SPI | 64 | Another API is spi_nor_restore(), this is used to restore the status of SPI |
65 | flash chip such as addressing mode. Call it whenever detach the driver from | 65 | flash chip such as addressing mode. Call it whenever detach the driver from |
diff --git a/Documentation/driver-api/soundwire/index.rst b/Documentation/driver-api/soundwire/index.rst index 6db026028f27..234911a0db99 100644 --- a/Documentation/driver-api/soundwire/index.rst +++ b/Documentation/driver-api/soundwire/index.rst | |||
@@ -10,7 +10,7 @@ SoundWire Documentation | |||
10 | error_handling | 10 | error_handling |
11 | locking | 11 | locking |
12 | 12 | ||
13 | .. only:: subproject | 13 | .. only:: subproject and html |
14 | 14 | ||
15 | Indices | 15 | Indices |
16 | ======= | 16 | ======= |
diff --git a/Documentation/thermal/cpu-cooling-api.rst b/Documentation/driver-api/thermal/cpu-cooling-api.rst index 645d914c45a6..645d914c45a6 100644 --- a/Documentation/thermal/cpu-cooling-api.rst +++ b/Documentation/driver-api/thermal/cpu-cooling-api.rst | |||
diff --git a/Documentation/thermal/exynos_thermal.rst b/Documentation/driver-api/thermal/exynos_thermal.rst index 5bd556566c70..5bd556566c70 100644 --- a/Documentation/thermal/exynos_thermal.rst +++ b/Documentation/driver-api/thermal/exynos_thermal.rst | |||
diff --git a/Documentation/thermal/exynos_thermal_emulation.rst b/Documentation/driver-api/thermal/exynos_thermal_emulation.rst index c21d10838bc5..c21d10838bc5 100644 --- a/Documentation/thermal/exynos_thermal_emulation.rst +++ b/Documentation/driver-api/thermal/exynos_thermal_emulation.rst | |||
diff --git a/Documentation/thermal/index.rst b/Documentation/driver-api/thermal/index.rst index 8c1c00146cad..5ba61d19c6ae 100644 --- a/Documentation/thermal/index.rst +++ b/Documentation/driver-api/thermal/index.rst | |||
@@ -1,4 +1,4 @@ | |||
1 | :orphan: | 1 | .. SPDX-License-Identifier: GPL-2.0 |
2 | 2 | ||
3 | ======= | 3 | ======= |
4 | Thermal | 4 | Thermal |
diff --git a/Documentation/thermal/intel_powerclamp.rst b/Documentation/driver-api/thermal/intel_powerclamp.rst index 3f6dfb0b3ea6..3f6dfb0b3ea6 100644 --- a/Documentation/thermal/intel_powerclamp.rst +++ b/Documentation/driver-api/thermal/intel_powerclamp.rst | |||
diff --git a/Documentation/thermal/nouveau_thermal.rst b/Documentation/driver-api/thermal/nouveau_thermal.rst index 37255fd6735d..37255fd6735d 100644 --- a/Documentation/thermal/nouveau_thermal.rst +++ b/Documentation/driver-api/thermal/nouveau_thermal.rst | |||
diff --git a/Documentation/thermal/power_allocator.rst b/Documentation/driver-api/thermal/power_allocator.rst index 67b6a3297238..67b6a3297238 100644 --- a/Documentation/thermal/power_allocator.rst +++ b/Documentation/driver-api/thermal/power_allocator.rst | |||
diff --git a/Documentation/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst index e4930761d3e5..fab2c9b36d08 100644 --- a/Documentation/thermal/sysfs-api.rst +++ b/Documentation/driver-api/thermal/sysfs-api.rst | |||
@@ -552,7 +552,7 @@ emul_temp | |||
552 | sustainable_power | 552 | sustainable_power |
553 | An estimate of the sustained power that can be dissipated by | 553 | An estimate of the sustained power that can be dissipated by |
554 | the thermal zone. Used by the power allocator governor. For | 554 | the thermal zone. Used by the power allocator governor. For |
555 | more information see Documentation/thermal/power_allocator.rst | 555 | more information see Documentation/driver-api/thermal/power_allocator.rst |
556 | 556 | ||
557 | Unit: milliwatts | 557 | Unit: milliwatts |
558 | 558 | ||
@@ -563,7 +563,7 @@ k_po | |||
563 | controller during temperature overshoot. Temperature overshoot | 563 | controller during temperature overshoot. Temperature overshoot |
564 | is when the current temperature is above the "desired | 564 | is when the current temperature is above the "desired |
565 | temperature" trip point. For more information see | 565 | temperature" trip point. For more information see |
566 | Documentation/thermal/power_allocator.rst | 566 | Documentation/driver-api/thermal/power_allocator.rst |
567 | 567 | ||
568 | RW, Optional | 568 | RW, Optional |
569 | 569 | ||
@@ -572,7 +572,7 @@ k_pu | |||
572 | controller during temperature undershoot. Temperature undershoot | 572 | controller during temperature undershoot. Temperature undershoot |
573 | is when the current temperature is below the "desired | 573 | is when the current temperature is below the "desired |
574 | temperature" trip point. For more information see | 574 | temperature" trip point. For more information see |
575 | Documentation/thermal/power_allocator.rst | 575 | Documentation/driver-api/thermal/power_allocator.rst |
576 | 576 | ||
577 | RW, Optional | 577 | RW, Optional |
578 | 578 | ||
@@ -580,14 +580,14 @@ k_i | |||
580 | The integral term of the power allocator governor's PID | 580 | The integral term of the power allocator governor's PID |
581 | controller. This term allows the PID controller to compensate | 581 | controller. This term allows the PID controller to compensate |
582 | for long term drift. For more information see | 582 | for long term drift. For more information see |
583 | Documentation/thermal/power_allocator.rst | 583 | Documentation/driver-api/thermal/power_allocator.rst |
584 | 584 | ||
585 | RW, Optional | 585 | RW, Optional |
586 | 586 | ||
587 | k_d | 587 | k_d |
588 | The derivative term of the power allocator governor's PID | 588 | The derivative term of the power allocator governor's PID |
589 | controller. For more information see | 589 | controller. For more information see |
590 | Documentation/thermal/power_allocator.rst | 590 | Documentation/driver-api/thermal/power_allocator.rst |
591 | 591 | ||
592 | RW, Optional | 592 | RW, Optional |
593 | 593 | ||
@@ -598,7 +598,7 @@ integral_cutoff | |||
598 | example, if integral_cutoff is 0, then the integral term only | 598 | example, if integral_cutoff is 0, then the integral term only |
599 | accumulates error when temperature is above the desired | 599 | accumulates error when temperature is above the desired |
600 | temperature trip point. For more information see | 600 | temperature trip point. For more information see |
601 | Documentation/thermal/power_allocator.rst | 601 | Documentation/driver-api/thermal/power_allocator.rst |
602 | 602 | ||
603 | Unit: millidegree Celsius | 603 | Unit: millidegree Celsius |
604 | 604 | ||
diff --git a/Documentation/thermal/x86_pkg_temperature_thermal.rst b/Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst index f134dbd3f5a9..2ac42ccd236f 100644 --- a/Documentation/thermal/x86_pkg_temperature_thermal.rst +++ b/Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst | |||
@@ -40,7 +40,7 @@ This contains two trip points: | |||
40 | - trip_point_1_temp | 40 | - trip_point_1_temp |
41 | 41 | ||
42 | User can set any temperature between 0 to TJ-Max temperature. Temperature units | 42 | User can set any temperature between 0 to TJ-Max temperature. Temperature units |
43 | are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-api.rst" for | 43 | are in milli-degree Celsius. Refer to "Documentation/driver-api/thermal/sysfs-api.rst" for |
44 | thermal sys-fs details. | 44 | thermal sys-fs details. |
45 | 45 | ||
46 | Any value other than 0 in these trip points, can trigger thermal notifications. | 46 | Any value other than 0 in these trip points, can trigger thermal notifications. |
diff --git a/Documentation/features/locking/queued-rwlocks/arch-support.txt b/Documentation/features/locking/queued-rwlocks/arch-support.txt index c683da198f31..ee922746a64c 100644 --- a/Documentation/features/locking/queued-rwlocks/arch-support.txt +++ b/Documentation/features/locking/queued-rwlocks/arch-support.txt | |||
@@ -30,5 +30,5 @@ | |||
30 | | um: | TODO | | 30 | | um: | TODO | |
31 | | unicore32: | TODO | | 31 | | unicore32: | TODO | |
32 | | x86: | ok | | 32 | | x86: | ok | |
33 | | xtensa: | TODO | | 33 | | xtensa: | ok | |
34 | ----------------------- | 34 | ----------------------- |
diff --git a/Documentation/features/locking/queued-spinlocks/arch-support.txt b/Documentation/features/locking/queued-spinlocks/arch-support.txt index e3080b82aefd..c52116c1a049 100644 --- a/Documentation/features/locking/queued-spinlocks/arch-support.txt +++ b/Documentation/features/locking/queued-spinlocks/arch-support.txt | |||
@@ -9,7 +9,7 @@ | |||
9 | | alpha: | TODO | | 9 | | alpha: | TODO | |
10 | | arc: | TODO | | 10 | | arc: | TODO | |
11 | | arm: | TODO | | 11 | | arm: | TODO | |
12 | | arm64: | TODO | | 12 | | arm64: | ok | |
13 | | c6x: | TODO | | 13 | | c6x: | TODO | |
14 | | csky: | TODO | | 14 | | csky: | TODO | |
15 | | h8300: | TODO | | 15 | | h8300: | TODO | |
@@ -30,5 +30,5 @@ | |||
30 | | um: | TODO | | 30 | | um: | TODO | |
31 | | unicore32: | TODO | | 31 | | unicore32: | TODO | |
32 | | x86: | ok | | 32 | | x86: | ok | |
33 | | xtensa: | TODO | | 33 | | xtensa: | ok | |
34 | ----------------------- | 34 | ----------------------- |
diff --git a/Documentation/features/locking/rwsem-optimized/arch-support.txt b/Documentation/features/locking/rwsem-optimized/arch-support.txt deleted file mode 100644 index 7521d7500fbe..000000000000 --- a/Documentation/features/locking/rwsem-optimized/arch-support.txt +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | # | ||
2 | # Feature name: rwsem-optimized | ||
3 | # Kconfig: !RWSEM_GENERIC_SPINLOCK | ||
4 | # description: arch provides optimized rwsem APIs | ||
5 | # | ||
6 | ----------------------- | ||
7 | | arch |status| | ||
8 | ----------------------- | ||
9 | | alpha: | ok | | ||
10 | | arc: | TODO | | ||
11 | | arm: | ok | | ||
12 | | arm64: | ok | | ||
13 | | c6x: | TODO | | ||
14 | | csky: | TODO | | ||
15 | | h8300: | TODO | | ||
16 | | hexagon: | TODO | | ||
17 | | ia64: | ok | | ||
18 | | m68k: | TODO | | ||
19 | | microblaze: | TODO | | ||
20 | | mips: | TODO | | ||
21 | | nds32: | TODO | | ||
22 | | nios2: | TODO | | ||
23 | | openrisc: | TODO | | ||
24 | | parisc: | TODO | | ||
25 | | powerpc: | TODO | | ||
26 | | riscv: | TODO | | ||
27 | | s390: | ok | | ||
28 | | sh: | ok | | ||
29 | | sparc: | ok | | ||
30 | | um: | ok | | ||
31 | | unicore32: | TODO | | ||
32 | | x86: | ok | | ||
33 | | xtensa: | ok | | ||
34 | ----------------------- | ||
diff --git a/Documentation/filesystems/coda.txt b/Documentation/filesystems/coda.txt index 545262c167c3..1711ad48e38a 100644 --- a/Documentation/filesystems/coda.txt +++ b/Documentation/filesystems/coda.txt | |||
@@ -421,14 +421,14 @@ kernel support. | |||
421 | 421 | ||
422 | 422 | ||
423 | The CodaCred structure defines a variety of user and group ids as | 423 | The CodaCred structure defines a variety of user and group ids as |
424 | they are set for the calling process. The vuid_t and guid_t are 32 bit | 424 | they are set for the calling process. The vuid_t and vgid_t are 32 bit |
425 | unsigned integers. It also defines group membership in an array. On | 425 | unsigned integers. It also defines group membership in an array. On |
426 | Unix the CodaCred has proven sufficient to implement good security | 426 | Unix the CodaCred has proven sufficient to implement good security |
427 | semantics for Coda but the structure may have to undergo modification | 427 | semantics for Coda but the structure may have to undergo modification |
428 | for the Windows environment when these mature. | 428 | for the Windows environment when these mature. |
429 | 429 | ||
430 | struct CodaCred { | 430 | struct CodaCred { |
431 | vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, effective, set, fs uid*/ | 431 | vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, effective, set, fs uid */ |
432 | vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ | 432 | vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ |
433 | vgid_t cr_groups[NGROUPS]; /* Group membership for caller */ | 433 | vgid_t cr_groups[NGROUPS]; /* Group membership for caller */ |
434 | }; | 434 | }; |
diff --git a/Documentation/filesystems/directory-locking b/Documentation/filesystems/directory-locking.rst index 4e32cb961e5b..de12016ee419 100644 --- a/Documentation/filesystems/directory-locking +++ b/Documentation/filesystems/directory-locking.rst | |||
@@ -1,12 +1,17 @@ | |||
1 | Locking scheme used for directory operations is based on two | 1 | ================= |
2 | Directory Locking | ||
3 | ================= | ||
4 | |||
5 | |||
6 | Locking scheme used for directory operations is based on two | ||
2 | kinds of locks - per-inode (->i_rwsem) and per-filesystem | 7 | kinds of locks - per-inode (->i_rwsem) and per-filesystem |
3 | (->s_vfs_rename_mutex). | 8 | (->s_vfs_rename_mutex). |
4 | 9 | ||
5 | When taking the i_rwsem on multiple non-directory objects, we | 10 | When taking the i_rwsem on multiple non-directory objects, we |
6 | always acquire the locks in order by increasing address. We'll call | 11 | always acquire the locks in order by increasing address. We'll call |
7 | that "inode pointer" order in the following. | 12 | that "inode pointer" order in the following. |
8 | 13 | ||
9 | For our purposes all operations fall in 5 classes: | 14 | For our purposes all operations fall in 5 classes: |
10 | 15 | ||
11 | 1) read access. Locking rules: caller locks directory we are accessing. | 16 | 1) read access. Locking rules: caller locks directory we are accessing. |
12 | The lock is taken shared. | 17 | The lock is taken shared. |
@@ -27,25 +32,29 @@ NB: we might get away with locking the the source (and target in exchange | |||
27 | case) shared. | 32 | case) shared. |
28 | 33 | ||
29 | 5) link creation. Locking rules: | 34 | 5) link creation. Locking rules: |
35 | |||
30 | * lock parent | 36 | * lock parent |
31 | * check that source is not a directory | 37 | * check that source is not a directory |
32 | * lock source | 38 | * lock source |
33 | * call the method. | 39 | * call the method. |
40 | |||
34 | All locks are exclusive. | 41 | All locks are exclusive. |
35 | 42 | ||
36 | 6) cross-directory rename. The trickiest in the whole bunch. Locking | 43 | 6) cross-directory rename. The trickiest in the whole bunch. Locking |
37 | rules: | 44 | rules: |
45 | |||
38 | * lock the filesystem | 46 | * lock the filesystem |
39 | * lock parents in "ancestors first" order. | 47 | * lock parents in "ancestors first" order. |
40 | * find source and target. | 48 | * find source and target. |
41 | * if old parent is equal to or is a descendent of target | 49 | * if old parent is equal to or is a descendent of target |
42 | fail with -ENOTEMPTY | 50 | fail with -ENOTEMPTY |
43 | * if new parent is equal to or is a descendent of source | 51 | * if new parent is equal to or is a descendent of source |
44 | fail with -ELOOP | 52 | fail with -ELOOP |
45 | * If it's an exchange, lock both the source and the target. | 53 | * If it's an exchange, lock both the source and the target. |
46 | * If the target exists, lock it. If the source is a non-directory, | 54 | * If the target exists, lock it. If the source is a non-directory, |
47 | lock it. If we need to lock both, do so in inode pointer order. | 55 | lock it. If we need to lock both, do so in inode pointer order. |
48 | * call the method. | 56 | * call the method. |
57 | |||
49 | All ->i_rwsem are taken exclusive. Again, we might get away with locking | 58 | All ->i_rwsem are taken exclusive. Again, we might get away with locking |
50 | the the source (and target in exchange case) shared. | 59 | the the source (and target in exchange case) shared. |
51 | 60 | ||
@@ -54,10 +63,11 @@ read, modified or removed by method will be locked by caller. | |||
54 | 63 | ||
55 | 64 | ||
56 | If no directory is its own ancestor, the scheme above is deadlock-free. | 65 | If no directory is its own ancestor, the scheme above is deadlock-free. |
66 | |||
57 | Proof: | 67 | Proof: |
58 | 68 | ||
59 | First of all, at any moment we have a partial ordering of the | 69 | First of all, at any moment we have a partial ordering of the |
60 | objects - A < B iff A is an ancestor of B. | 70 | objects - A < B iff A is an ancestor of B. |
61 | 71 | ||
62 | That ordering can change. However, the following is true: | 72 | That ordering can change. However, the following is true: |
63 | 73 | ||
@@ -77,32 +87,32 @@ objects - A < B iff A is an ancestor of B. | |||
77 | non-directory object, except renames, which take locks on source and | 87 | non-directory object, except renames, which take locks on source and |
78 | target in inode pointer order in the case they are not directories.) | 88 | target in inode pointer order in the case they are not directories.) |
79 | 89 | ||
80 | Now consider the minimal deadlock. Each process is blocked on | 90 | Now consider the minimal deadlock. Each process is blocked on |
81 | attempt to acquire some lock and already holds at least one lock. Let's | 91 | attempt to acquire some lock and already holds at least one lock. Let's |
82 | consider the set of contended locks. First of all, filesystem lock is | 92 | consider the set of contended locks. First of all, filesystem lock is |
83 | not contended, since any process blocked on it is not holding any locks. | 93 | not contended, since any process blocked on it is not holding any locks. |
84 | Thus all processes are blocked on ->i_rwsem. | 94 | Thus all processes are blocked on ->i_rwsem. |
85 | 95 | ||
86 | By (3), any process holding a non-directory lock can only be | 96 | By (3), any process holding a non-directory lock can only be |
87 | waiting on another non-directory lock with a larger address. Therefore | 97 | waiting on another non-directory lock with a larger address. Therefore |
88 | the process holding the "largest" such lock can always make progress, and | 98 | the process holding the "largest" such lock can always make progress, and |
89 | non-directory objects are not included in the set of contended locks. | 99 | non-directory objects are not included in the set of contended locks. |
90 | 100 | ||
91 | Thus link creation can't be a part of deadlock - it can't be | 101 | Thus link creation can't be a part of deadlock - it can't be |
92 | blocked on source and it means that it doesn't hold any locks. | 102 | blocked on source and it means that it doesn't hold any locks. |
93 | 103 | ||
94 | Any contended object is either held by cross-directory rename or | 104 | Any contended object is either held by cross-directory rename or |
95 | has a child that is also contended. Indeed, suppose that it is held by | 105 | has a child that is also contended. Indeed, suppose that it is held by |
96 | operation other than cross-directory rename. Then the lock this operation | 106 | operation other than cross-directory rename. Then the lock this operation |
97 | is blocked on belongs to child of that object due to (1). | 107 | is blocked on belongs to child of that object due to (1). |
98 | 108 | ||
99 | It means that one of the operations is cross-directory rename. | 109 | It means that one of the operations is cross-directory rename. |
100 | Otherwise the set of contended objects would be infinite - each of them | 110 | Otherwise the set of contended objects would be infinite - each of them |
101 | would have a contended child and we had assumed that no object is its | 111 | would have a contended child and we had assumed that no object is its |
102 | own descendent. Moreover, there is exactly one cross-directory rename | 112 | own descendent. Moreover, there is exactly one cross-directory rename |
103 | (see above). | 113 | (see above). |
104 | 114 | ||
105 | Consider the object blocking the cross-directory rename. One | 115 | Consider the object blocking the cross-directory rename. One |
106 | of its descendents is locked by cross-directory rename (otherwise we | 116 | of its descendents is locked by cross-directory rename (otherwise we |
107 | would again have an infinite set of contended objects). But that | 117 | would again have an infinite set of contended objects). But that |
108 | means that cross-directory rename is taking locks out of order. Due | 118 | means that cross-directory rename is taking locks out of order. Due |
@@ -112,7 +122,7 @@ try to acquire lock on descendent before the lock on ancestor. | |||
112 | Contradiction. I.e. deadlock is impossible. Q.E.D. | 122 | Contradiction. I.e. deadlock is impossible. Q.E.D. |
113 | 123 | ||
114 | 124 | ||
115 | These operations are guaranteed to avoid loop creation. Indeed, | 125 | These operations are guaranteed to avoid loop creation. Indeed, |
116 | the only operation that could introduce loops is cross-directory rename. | 126 | the only operation that could introduce loops is cross-directory rename. |
117 | Since the only new (parent, child) pair added by rename() is (new parent, | 127 | Since the only new (parent, child) pair added by rename() is (new parent, |
118 | source), such loop would have to contain these objects and the rest of it | 128 | source), such loop would have to contain these objects and the rest of it |
@@ -123,13 +133,13 @@ new parent had been equal to or a descendent of source since the moment when | |||
123 | we had acquired filesystem lock and rename() would fail with -ELOOP in that | 133 | we had acquired filesystem lock and rename() would fail with -ELOOP in that |
124 | case. | 134 | case. |
125 | 135 | ||
126 | While this locking scheme works for arbitrary DAGs, it relies on | 136 | While this locking scheme works for arbitrary DAGs, it relies on |
127 | ability to check that directory is a descendent of another object. Current | 137 | ability to check that directory is a descendent of another object. Current |
128 | implementation assumes that directory graph is a tree. This assumption is | 138 | implementation assumes that directory graph is a tree. This assumption is |
129 | also preserved by all operations (cross-directory rename on a tree that would | 139 | also preserved by all operations (cross-directory rename on a tree that would |
130 | not introduce a cycle will leave it a tree and link() fails for directories). | 140 | not introduce a cycle will leave it a tree and link() fails for directories). |
131 | 141 | ||
132 | Notice that "directory" in the above == "anything that might have | 142 | Notice that "directory" in the above == "anything that might have |
133 | children", so if we are going to introduce hybrid objects we will need | 143 | children", so if we are going to introduce hybrid objects we will need |
134 | either to make sure that link(2) doesn't work for them or to make changes | 144 | either to make sure that link(2) doesn't work for them or to make changes |
135 | in is_subdir() that would make it work even in presence of such beasts. | 145 | in is_subdir() that would make it work even in presence of such beasts. |
diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index 2de2fe2ab078..96653ebefd7e 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst | |||
@@ -20,6 +20,10 @@ algorithms work. | |||
20 | path-lookup | 20 | path-lookup |
21 | api-summary | 21 | api-summary |
22 | splice | 22 | splice |
23 | locking | ||
24 | directory-locking | ||
25 | |||
26 | porting | ||
23 | 27 | ||
24 | Filesystem support layers | 28 | Filesystem support layers |
25 | ========================= | 29 | ========================= |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/locking.rst index 204dd3ea36bb..fc3a0704553c 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/locking.rst | |||
@@ -1,14 +1,22 @@ | |||
1 | The text below describes the locking rules for VFS-related methods. | 1 | ======= |
2 | Locking | ||
3 | ======= | ||
4 | |||
5 | The text below describes the locking rules for VFS-related methods. | ||
2 | It is (believed to be) up-to-date. *Please*, if you change anything in | 6 | It is (believed to be) up-to-date. *Please*, if you change anything in |
3 | prototypes or locking protocols - update this file. And update the relevant | 7 | prototypes or locking protocols - update this file. And update the relevant |
4 | instances in the tree, don't leave that to maintainers of filesystems/devices/ | 8 | instances in the tree, don't leave that to maintainers of filesystems/devices/ |
5 | etc. At the very least, put the list of dubious cases in the end of this file. | 9 | etc. At the very least, put the list of dubious cases in the end of this file. |
6 | Don't turn it into log - maintainers of out-of-the-tree code are supposed to | 10 | Don't turn it into log - maintainers of out-of-the-tree code are supposed to |
7 | be able to use diff(1). | 11 | be able to use diff(1). |
8 | Thing currently missing here: socket operations. Alexey? | ||
9 | 12 | ||
10 | --------------------------- dentry_operations -------------------------- | 13 | Thing currently missing here: socket operations. Alexey? |
11 | prototypes: | 14 | |
15 | dentry_operations | ||
16 | ================= | ||
17 | |||
18 | prototypes:: | ||
19 | |||
12 | int (*d_revalidate)(struct dentry *, unsigned int); | 20 | int (*d_revalidate)(struct dentry *, unsigned int); |
13 | int (*d_weak_revalidate)(struct dentry *, unsigned int); | 21 | int (*d_weak_revalidate)(struct dentry *, unsigned int); |
14 | int (*d_hash)(const struct dentry *, struct qstr *); | 22 | int (*d_hash)(const struct dentry *, struct qstr *); |
@@ -24,23 +32,30 @@ prototypes: | |||
24 | struct dentry *(*d_real)(struct dentry *, const struct inode *); | 32 | struct dentry *(*d_real)(struct dentry *, const struct inode *); |
25 | 33 | ||
26 | locking rules: | 34 | locking rules: |
27 | rename_lock ->d_lock may block rcu-walk | 35 | |
28 | d_revalidate: no no yes (ref-walk) maybe | 36 | ================== =========== ======== ============== ======== |
29 | d_weak_revalidate:no no yes no | 37 | ops rename_lock ->d_lock may block rcu-walk |
30 | d_hash no no no maybe | 38 | ================== =========== ======== ============== ======== |
31 | d_compare: yes no no maybe | 39 | d_revalidate: no no yes (ref-walk) maybe |
32 | d_delete: no yes no no | 40 | d_weak_revalidate: no no yes no |
33 | d_init: no no yes no | 41 | d_hash no no no maybe |
34 | d_release: no no yes no | 42 | d_compare: yes no no maybe |
35 | d_prune: no yes no no | 43 | d_delete: no yes no no |
36 | d_iput: no no yes no | 44 | d_init: no no yes no |
37 | d_dname: no no no no | 45 | d_release: no no yes no |
38 | d_automount: no no yes no | 46 | d_prune: no yes no no |
39 | d_manage: no no yes (ref-walk) maybe | 47 | d_iput: no no yes no |
40 | d_real no no yes no | 48 | d_dname: no no no no |
41 | 49 | d_automount: no no yes no | |
42 | --------------------------- inode_operations --------------------------- | 50 | d_manage: no no yes (ref-walk) maybe |
43 | prototypes: | 51 | d_real no no yes no |
52 | ================== =========== ======== ============== ======== | ||
53 | |||
54 | inode_operations | ||
55 | ================ | ||
56 | |||
57 | prototypes:: | ||
58 | |||
44 | int (*create) (struct inode *,struct dentry *,umode_t, bool); | 59 | int (*create) (struct inode *,struct dentry *,umode_t, bool); |
45 | struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); | 60 | struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); |
46 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 61 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
@@ -68,7 +83,10 @@ prototypes: | |||
68 | 83 | ||
69 | locking rules: | 84 | locking rules: |
70 | all may block | 85 | all may block |
71 | i_rwsem(inode) | 86 | |
87 | ============ ============================================= | ||
88 | ops i_rwsem(inode) | ||
89 | ============ ============================================= | ||
72 | lookup: shared | 90 | lookup: shared |
73 | create: exclusive | 91 | create: exclusive |
74 | link: exclusive (both) | 92 | link: exclusive (both) |
@@ -89,17 +107,21 @@ fiemap: no | |||
89 | update_time: no | 107 | update_time: no |
90 | atomic_open: exclusive | 108 | atomic_open: exclusive |
91 | tmpfile: no | 109 | tmpfile: no |
110 | ============ ============================================= | ||
92 | 111 | ||
93 | 112 | ||
94 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_rwsem | 113 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_rwsem |
95 | exclusive on victim. | 114 | exclusive on victim. |
96 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. | 115 | cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. |
97 | 116 | ||
98 | See Documentation/filesystems/directory-locking for more detailed discussion | 117 | See Documentation/filesystems/directory-locking.rst for more detailed discussion |
99 | of the locking scheme for directory operations. | 118 | of the locking scheme for directory operations. |
100 | 119 | ||
101 | ----------------------- xattr_handler operations ----------------------- | 120 | xattr_handler operations |
102 | prototypes: | 121 | ======================== |
122 | |||
123 | prototypes:: | ||
124 | |||
103 | bool (*list)(struct dentry *dentry); | 125 | bool (*list)(struct dentry *dentry); |
104 | int (*get)(const struct xattr_handler *handler, struct dentry *dentry, | 126 | int (*get)(const struct xattr_handler *handler, struct dentry *dentry, |
105 | struct inode *inode, const char *name, void *buffer, | 127 | struct inode *inode, const char *name, void *buffer, |
@@ -110,13 +132,20 @@ prototypes: | |||
110 | 132 | ||
111 | locking rules: | 133 | locking rules: |
112 | all may block | 134 | all may block |
113 | i_rwsem(inode) | 135 | |
136 | ===== ============== | ||
137 | ops i_rwsem(inode) | ||
138 | ===== ============== | ||
114 | list: no | 139 | list: no |
115 | get: no | 140 | get: no |
116 | set: exclusive | 141 | set: exclusive |
142 | ===== ============== | ||
143 | |||
144 | super_operations | ||
145 | ================ | ||
146 | |||
147 | prototypes:: | ||
117 | 148 | ||
118 | --------------------------- super_operations --------------------------- | ||
119 | prototypes: | ||
120 | struct inode *(*alloc_inode)(struct super_block *sb); | 149 | struct inode *(*alloc_inode)(struct super_block *sb); |
121 | void (*free_inode)(struct inode *); | 150 | void (*free_inode)(struct inode *); |
122 | void (*destroy_inode)(struct inode *); | 151 | void (*destroy_inode)(struct inode *); |
@@ -138,7 +167,10 @@ prototypes: | |||
138 | 167 | ||
139 | locking rules: | 168 | locking rules: |
140 | All may block [not true, see below] | 169 | All may block [not true, see below] |
141 | s_umount | 170 | |
171 | ====================== ============ ======================== | ||
172 | ops s_umount note | ||
173 | ====================== ============ ======================== | ||
142 | alloc_inode: | 174 | alloc_inode: |
143 | free_inode: called from RCU callback | 175 | free_inode: called from RCU callback |
144 | destroy_inode: | 176 | destroy_inode: |
@@ -157,6 +189,7 @@ show_options: no (namespace_sem) | |||
157 | quota_read: no (see below) | 189 | quota_read: no (see below) |
158 | quota_write: no (see below) | 190 | quota_write: no (see below) |
159 | bdev_try_to_free_page: no (see below) | 191 | bdev_try_to_free_page: no (see below) |
192 | ====================== ============ ======================== | ||
160 | 193 | ||
161 | ->statfs() has s_umount (shared) when called by ustat(2) (native or | 194 | ->statfs() has s_umount (shared) when called by ustat(2) (native or |
162 | compat), but that's an accident of bad API; s_umount is used to pin | 195 | compat), but that's an accident of bad API; s_umount is used to pin |
@@ -164,31 +197,44 @@ the superblock down when we only have dev_t given us by userland to | |||
164 | identify the superblock. Everything else (statfs(), fstatfs(), etc.) | 197 | identify the superblock. Everything else (statfs(), fstatfs(), etc.) |
165 | doesn't hold it when calling ->statfs() - superblock is pinned down | 198 | doesn't hold it when calling ->statfs() - superblock is pinned down |
166 | by resolving the pathname passed to syscall. | 199 | by resolving the pathname passed to syscall. |
200 | |||
167 | ->quota_read() and ->quota_write() functions are both guaranteed to | 201 | ->quota_read() and ->quota_write() functions are both guaranteed to |
168 | be the only ones operating on the quota file by the quota code (via | 202 | be the only ones operating on the quota file by the quota code (via |
169 | dqio_sem) (unless an admin really wants to screw up something and | 203 | dqio_sem) (unless an admin really wants to screw up something and |
170 | writes to quota files with quotas on). For other details about locking | 204 | writes to quota files with quotas on). For other details about locking |
171 | see also dquot_operations section. | 205 | see also dquot_operations section. |
206 | |||
172 | ->bdev_try_to_free_page is called from the ->releasepage handler of | 207 | ->bdev_try_to_free_page is called from the ->releasepage handler of |
173 | the block device inode. See there for more details. | 208 | the block device inode. See there for more details. |
174 | 209 | ||
175 | --------------------------- file_system_type --------------------------- | 210 | file_system_type |
176 | prototypes: | 211 | ================ |
212 | |||
213 | prototypes:: | ||
214 | |||
177 | struct dentry *(*mount) (struct file_system_type *, int, | 215 | struct dentry *(*mount) (struct file_system_type *, int, |
178 | const char *, void *); | 216 | const char *, void *); |
179 | void (*kill_sb) (struct super_block *); | 217 | void (*kill_sb) (struct super_block *); |
218 | |||
180 | locking rules: | 219 | locking rules: |
181 | may block | 220 | |
221 | ======= ========= | ||
222 | ops may block | ||
223 | ======= ========= | ||
182 | mount yes | 224 | mount yes |
183 | kill_sb yes | 225 | kill_sb yes |
226 | ======= ========= | ||
184 | 227 | ||
185 | ->mount() returns ERR_PTR or the root dentry; its superblock should be locked | 228 | ->mount() returns ERR_PTR or the root dentry; its superblock should be locked |
186 | on return. | 229 | on return. |
230 | |||
187 | ->kill_sb() takes a write-locked superblock, does all shutdown work on it, | 231 | ->kill_sb() takes a write-locked superblock, does all shutdown work on it, |
188 | unlocks and drops the reference. | 232 | unlocks and drops the reference. |
189 | 233 | ||
190 | --------------------------- address_space_operations -------------------------- | 234 | address_space_operations |
191 | prototypes: | 235 | ======================== |
236 | prototypes:: | ||
237 | |||
192 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 238 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
193 | int (*readpage)(struct file *, struct page *); | 239 | int (*readpage)(struct file *, struct page *); |
194 | int (*writepages)(struct address_space *, struct writeback_control *); | 240 | int (*writepages)(struct address_space *, struct writeback_control *); |
@@ -218,14 +264,16 @@ prototypes: | |||
218 | locking rules: | 264 | locking rules: |
219 | All except set_page_dirty and freepage may block | 265 | All except set_page_dirty and freepage may block |
220 | 266 | ||
221 | PageLocked(page) i_rwsem | 267 | ====================== ======================== ========= |
268 | ops PageLocked(page) i_rwsem | ||
269 | ====================== ======================== ========= | ||
222 | writepage: yes, unlocks (see below) | 270 | writepage: yes, unlocks (see below) |
223 | readpage: yes, unlocks | 271 | readpage: yes, unlocks |
224 | writepages: | 272 | writepages: |
225 | set_page_dirty no | 273 | set_page_dirty no |
226 | readpages: | 274 | readpages: |
227 | write_begin: locks the page exclusive | 275 | write_begin: locks the page exclusive |
228 | write_end: yes, unlocks exclusive | 276 | write_end: yes, unlocks exclusive |
229 | bmap: | 277 | bmap: |
230 | invalidatepage: yes | 278 | invalidatepage: yes |
231 | releasepage: yes | 279 | releasepage: yes |
@@ -239,17 +287,18 @@ is_partially_uptodate: yes | |||
239 | error_remove_page: yes | 287 | error_remove_page: yes |
240 | swap_activate: no | 288 | swap_activate: no |
241 | swap_deactivate: no | 289 | swap_deactivate: no |
290 | ====================== ======================== ========= | ||
242 | 291 | ||
243 | ->write_begin(), ->write_end() and ->readpage() may be called from | 292 | ->write_begin(), ->write_end() and ->readpage() may be called from |
244 | the request handler (/dev/loop). | 293 | the request handler (/dev/loop). |
245 | 294 | ||
246 | ->readpage() unlocks the page, either synchronously or via I/O | 295 | ->readpage() unlocks the page, either synchronously or via I/O |
247 | completion. | 296 | completion. |
248 | 297 | ||
249 | ->readpages() populates the pagecache with the passed pages and starts | 298 | ->readpages() populates the pagecache with the passed pages and starts |
250 | I/O against them. They come unlocked upon I/O completion. | 299 | I/O against them. They come unlocked upon I/O completion. |
251 | 300 | ||
252 | ->writepage() is used for two purposes: for "memory cleansing" and for | 301 | ->writepage() is used for two purposes: for "memory cleansing" and for |
253 | "sync". These are quite different operations and the behaviour may differ | 302 | "sync". These are quite different operations and the behaviour may differ |
254 | depending upon the mode. | 303 | depending upon the mode. |
255 | 304 | ||
@@ -297,70 +346,81 @@ will leave the page itself marked clean but it will be tagged as dirty in the | |||
297 | radix tree. This incoherency can lead to all sorts of hard-to-debug problems | 346 | radix tree. This incoherency can lead to all sorts of hard-to-debug problems |
298 | in the filesystem like having dirty inodes at umount and losing written data. | 347 | in the filesystem like having dirty inodes at umount and losing written data. |
299 | 348 | ||
300 | ->writepages() is used for periodic writeback and for syscall-initiated | 349 | ->writepages() is used for periodic writeback and for syscall-initiated |
301 | sync operations. The address_space should start I/O against at least | 350 | sync operations. The address_space should start I/O against at least |
302 | *nr_to_write pages. *nr_to_write must be decremented for each page which is | 351 | ``*nr_to_write`` pages. ``*nr_to_write`` must be decremented for each page |
303 | written. The address_space implementation may write more (or less) pages | 352 | which is written. The address_space implementation may write more (or less) |
304 | than *nr_to_write asks for, but it should try to be reasonably close. If | 353 | pages than ``*nr_to_write`` asks for, but it should try to be reasonably close. |
305 | nr_to_write is NULL, all dirty pages must be written. | 354 | If nr_to_write is NULL, all dirty pages must be written. |
306 | 355 | ||
307 | writepages should _only_ write pages which are present on | 356 | writepages should _only_ write pages which are present on |
308 | mapping->io_pages. | 357 | mapping->io_pages. |
309 | 358 | ||
310 | ->set_page_dirty() is called from various places in the kernel | 359 | ->set_page_dirty() is called from various places in the kernel |
311 | when the target page is marked as needing writeback. It may be called | 360 | when the target page is marked as needing writeback. It may be called |
312 | under spinlock (it cannot block) and is sometimes called with the page | 361 | under spinlock (it cannot block) and is sometimes called with the page |
313 | not locked. | 362 | not locked. |
314 | 363 | ||
315 | ->bmap() is currently used by legacy ioctl() (FIBMAP) provided by some | 364 | ->bmap() is currently used by legacy ioctl() (FIBMAP) provided by some |
316 | filesystems and by the swapper. The latter will eventually go away. Please, | 365 | filesystems and by the swapper. The latter will eventually go away. Please, |
317 | keep it that way and don't breed new callers. | 366 | keep it that way and don't breed new callers. |
318 | 367 | ||
319 | ->invalidatepage() is called when the filesystem must attempt to drop | 368 | ->invalidatepage() is called when the filesystem must attempt to drop |
320 | some or all of the buffers from the page when it is being truncated. It | 369 | some or all of the buffers from the page when it is being truncated. It |
321 | returns zero on success. If ->invalidatepage is zero, the kernel uses | 370 | returns zero on success. If ->invalidatepage is zero, the kernel uses |
322 | block_invalidatepage() instead. | 371 | block_invalidatepage() instead. |
323 | 372 | ||
324 | ->releasepage() is called when the kernel is about to try to drop the | 373 | ->releasepage() is called when the kernel is about to try to drop the |
325 | buffers from the page in preparation for freeing it. It returns zero to | 374 | buffers from the page in preparation for freeing it. It returns zero to |
326 | indicate that the buffers are (or may be) freeable. If ->releasepage is zero, | 375 | indicate that the buffers are (or may be) freeable. If ->releasepage is zero, |
327 | the kernel assumes that the fs has no private interest in the buffers. | 376 | the kernel assumes that the fs has no private interest in the buffers. |
328 | 377 | ||
329 | ->freepage() is called when the kernel is done dropping the page | 378 | ->freepage() is called when the kernel is done dropping the page |
330 | from the page cache. | 379 | from the page cache. |
331 | 380 | ||
332 | ->launder_page() may be called prior to releasing a page if | 381 | ->launder_page() may be called prior to releasing a page if |
333 | it is still found to be dirty. It returns zero if the page was successfully | 382 | it is still found to be dirty. It returns zero if the page was successfully |
334 | cleaned, or an error value if not. Note that in order to prevent the page | 383 | cleaned, or an error value if not. Note that in order to prevent the page |
335 | getting mapped back in and redirtied, it needs to be kept locked | 384 | getting mapped back in and redirtied, it needs to be kept locked |
336 | across the entire operation. | 385 | across the entire operation. |
337 | 386 | ||
338 | ->swap_activate will be called with a non-zero argument on | 387 | ->swap_activate will be called with a non-zero argument on |
339 | files backing (non block device backed) swapfiles. A return value | 388 | files backing (non block device backed) swapfiles. A return value |
340 | of zero indicates success, in which case this file can be used for | 389 | of zero indicates success, in which case this file can be used for |
341 | backing swapspace. The swapspace operations will be proxied to the | 390 | backing swapspace. The swapspace operations will be proxied to the |
342 | address space operations. | 391 | address space operations. |
343 | 392 | ||
344 | ->swap_deactivate() will be called in the sys_swapoff() | 393 | ->swap_deactivate() will be called in the sys_swapoff() |
345 | path after ->swap_activate() returned success. | 394 | path after ->swap_activate() returned success. |
346 | 395 | ||
347 | ----------------------- file_lock_operations ------------------------------ | 396 | file_lock_operations |
348 | prototypes: | 397 | ==================== |
398 | |||
399 | prototypes:: | ||
400 | |||
349 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 401 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
350 | void (*fl_release_private)(struct file_lock *); | 402 | void (*fl_release_private)(struct file_lock *); |
351 | 403 | ||
352 | 404 | ||
353 | locking rules: | 405 | locking rules: |
354 | inode->i_lock may block | 406 | |
407 | =================== ============= ========= | ||
408 | ops inode->i_lock may block | ||
409 | =================== ============= ========= | ||
355 | fl_copy_lock: yes no | 410 | fl_copy_lock: yes no |
356 | fl_release_private: maybe maybe[1] | 411 | fl_release_private: maybe maybe[1]_ |
412 | =================== ============= ========= | ||
413 | |||
414 | .. [1]: | ||
415 | ->fl_release_private for flock or POSIX locks is currently allowed | ||
416 | to block. Leases however can still be freed while the i_lock is held and | ||
417 | so fl_release_private called on a lease should not block. | ||
357 | 418 | ||
358 | [1]: ->fl_release_private for flock or POSIX locks is currently allowed | 419 | lock_manager_operations |
359 | to block. Leases however can still be freed while the i_lock is held and | 420 | ======================= |
360 | so fl_release_private called on a lease should not block. | 421 | |
422 | prototypes:: | ||
361 | 423 | ||
362 | ----------------------- lock_manager_operations --------------------------- | ||
363 | prototypes: | ||
364 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 424 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
365 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); | 425 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
366 | void (*lm_break)(struct file_lock *); /* break_lease callback */ | 426 | void (*lm_break)(struct file_lock *); /* break_lease callback */ |
@@ -368,24 +428,33 @@ prototypes: | |||
368 | 428 | ||
369 | locking rules: | 429 | locking rules: |
370 | 430 | ||
371 | inode->i_lock blocked_lock_lock may block | 431 | ========== ============= ================= ========= |
432 | ops inode->i_lock blocked_lock_lock may block | ||
433 | ========== ============= ================= ========= | ||
372 | lm_notify: yes yes no | 434 | lm_notify: yes yes no |
373 | lm_grant: no no no | 435 | lm_grant: no no no |
374 | lm_break: yes no no | 436 | lm_break: yes no no |
375 | lm_change yes no no | 437 | lm_change yes no no |
438 | ========== ============= ================= ========= | ||
439 | |||
440 | buffer_head | ||
441 | =========== | ||
442 | |||
443 | prototypes:: | ||
376 | 444 | ||
377 | --------------------------- buffer_head ----------------------------------- | ||
378 | prototypes: | ||
379 | void (*b_end_io)(struct buffer_head *bh, int uptodate); | 445 | void (*b_end_io)(struct buffer_head *bh, int uptodate); |
380 | 446 | ||
381 | locking rules: | 447 | locking rules: |
382 | called from interrupts. In other words, extreme care is needed here. | 448 | |
449 | called from interrupts. In other words, extreme care is needed here. | ||
383 | bh is locked, but that's all warranties we have here. Currently only RAID1, | 450 | bh is locked, but that's all warranties we have here. Currently only RAID1, |
384 | highmem, fs/buffer.c, and fs/ntfs/aops.c are providing these. Block devices | 451 | highmem, fs/buffer.c, and fs/ntfs/aops.c are providing these. Block devices |
385 | call this method upon the IO completion. | 452 | call this method upon the IO completion. |
386 | 453 | ||
387 | --------------------------- block_device_operations ----------------------- | 454 | block_device_operations |
388 | prototypes: | 455 | ======================= |
456 | prototypes:: | ||
457 | |||
389 | int (*open) (struct block_device *, fmode_t); | 458 | int (*open) (struct block_device *, fmode_t); |
390 | int (*release) (struct gendisk *, fmode_t); | 459 | int (*release) (struct gendisk *, fmode_t); |
391 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); | 460 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
@@ -399,7 +468,10 @@ prototypes: | |||
399 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); | 468 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); |
400 | 469 | ||
401 | locking rules: | 470 | locking rules: |
402 | bd_mutex | 471 | |
472 | ======================= =================== | ||
473 | ops bd_mutex | ||
474 | ======================= =================== | ||
403 | open: yes | 475 | open: yes |
404 | release: yes | 476 | release: yes |
405 | ioctl: no | 477 | ioctl: no |
@@ -410,6 +482,7 @@ unlock_native_capacity: no | |||
410 | revalidate_disk: no | 482 | revalidate_disk: no |
411 | getgeo: no | 483 | getgeo: no |
412 | swap_slot_free_notify: no (see below) | 484 | swap_slot_free_notify: no (see below) |
485 | ======================= =================== | ||
413 | 486 | ||
414 | media_changed, unlock_native_capacity and revalidate_disk are called only from | 487 | media_changed, unlock_native_capacity and revalidate_disk are called only from |
415 | check_disk_change(). | 488 | check_disk_change(). |
@@ -418,8 +491,11 @@ swap_slot_free_notify is called with swap_lock and sometimes the page lock | |||
418 | held. | 491 | held. |
419 | 492 | ||
420 | 493 | ||
421 | --------------------------- file_operations ------------------------------- | 494 | file_operations |
422 | prototypes: | 495 | =============== |
496 | |||
497 | prototypes:: | ||
498 | |||
423 | loff_t (*llseek) (struct file *, loff_t, int); | 499 | loff_t (*llseek) (struct file *, loff_t, int); |
424 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | 500 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); |
425 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 501 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
@@ -455,7 +531,6 @@ prototypes: | |||
455 | size_t, unsigned int); | 531 | size_t, unsigned int); |
456 | int (*setlease)(struct file *, long, struct file_lock **, void **); | 532 | int (*setlease)(struct file *, long, struct file_lock **, void **); |
457 | long (*fallocate)(struct file *, int, loff_t, loff_t); | 533 | long (*fallocate)(struct file *, int, loff_t, loff_t); |
458 | }; | ||
459 | 534 | ||
460 | locking rules: | 535 | locking rules: |
461 | All may block. | 536 | All may block. |
@@ -490,8 +565,11 @@ in sys_read() and friends. | |||
490 | the lease within the individual filesystem to record the result of the | 565 | the lease within the individual filesystem to record the result of the |
491 | operation | 566 | operation |
492 | 567 | ||
493 | --------------------------- dquot_operations ------------------------------- | 568 | dquot_operations |
494 | prototypes: | 569 | ================ |
570 | |||
571 | prototypes:: | ||
572 | |||
495 | int (*write_dquot) (struct dquot *); | 573 | int (*write_dquot) (struct dquot *); |
496 | int (*acquire_dquot) (struct dquot *); | 574 | int (*acquire_dquot) (struct dquot *); |
497 | int (*release_dquot) (struct dquot *); | 575 | int (*release_dquot) (struct dquot *); |
@@ -503,20 +581,26 @@ a proper locking wrt the filesystem and call the generic quota operations. | |||
503 | 581 | ||
504 | What filesystem should expect from the generic quota functions: | 582 | What filesystem should expect from the generic quota functions: |
505 | 583 | ||
506 | FS recursion Held locks when called | 584 | ============== ============ ========================= |
585 | ops FS recursion Held locks when called | ||
586 | ============== ============ ========================= | ||
507 | write_dquot: yes dqonoff_sem or dqptr_sem | 587 | write_dquot: yes dqonoff_sem or dqptr_sem |
508 | acquire_dquot: yes dqonoff_sem or dqptr_sem | 588 | acquire_dquot: yes dqonoff_sem or dqptr_sem |
509 | release_dquot: yes dqonoff_sem or dqptr_sem | 589 | release_dquot: yes dqonoff_sem or dqptr_sem |
510 | mark_dirty: no - | 590 | mark_dirty: no - |
511 | write_info: yes dqonoff_sem | 591 | write_info: yes dqonoff_sem |
592 | ============== ============ ========================= | ||
512 | 593 | ||
513 | FS recursion means calling ->quota_read() and ->quota_write() from superblock | 594 | FS recursion means calling ->quota_read() and ->quota_write() from superblock |
514 | operations. | 595 | operations. |
515 | 596 | ||
516 | More details about quota locking can be found in fs/dquot.c. | 597 | More details about quota locking can be found in fs/dquot.c. |
517 | 598 | ||
518 | --------------------------- vm_operations_struct ----------------------------- | 599 | vm_operations_struct |
519 | prototypes: | 600 | ==================== |
601 | |||
602 | prototypes:: | ||
603 | |||
520 | void (*open)(struct vm_area_struct*); | 604 | void (*open)(struct vm_area_struct*); |
521 | void (*close)(struct vm_area_struct*); | 605 | void (*close)(struct vm_area_struct*); |
522 | vm_fault_t (*fault)(struct vm_area_struct*, struct vm_fault *); | 606 | vm_fault_t (*fault)(struct vm_area_struct*, struct vm_fault *); |
@@ -525,7 +609,10 @@ prototypes: | |||
525 | int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); | 609 | int (*access)(struct vm_area_struct *, unsigned long, void*, int, int); |
526 | 610 | ||
527 | locking rules: | 611 | locking rules: |
528 | mmap_sem PageLocked(page) | 612 | |
613 | ============= ======== =========================== | ||
614 | ops mmap_sem PageLocked(page) | ||
615 | ============= ======== =========================== | ||
529 | open: yes | 616 | open: yes |
530 | close: yes | 617 | close: yes |
531 | fault: yes can return with page locked | 618 | fault: yes can return with page locked |
@@ -533,8 +620,9 @@ map_pages: yes | |||
533 | page_mkwrite: yes can return with page locked | 620 | page_mkwrite: yes can return with page locked |
534 | pfn_mkwrite: yes | 621 | pfn_mkwrite: yes |
535 | access: yes | 622 | access: yes |
623 | ============= ======== =========================== | ||
536 | 624 | ||
537 | ->fault() is called when a previously not present pte is about | 625 | ->fault() is called when a previously not present pte is about |
538 | to be faulted in. The filesystem must find and return the page associated | 626 | to be faulted in. The filesystem must find and return the page associated |
539 | with the passed in "pgoff" in the vm_fault structure. If it is possible that | 627 | with the passed in "pgoff" in the vm_fault structure. If it is possible that |
540 | the page may be truncated and/or invalidated, then the filesystem must lock | 628 | the page may be truncated and/or invalidated, then the filesystem must lock |
@@ -542,7 +630,7 @@ the page, then ensure it is not already truncated (the page lock will block | |||
542 | subsequent truncate), and then return with VM_FAULT_LOCKED, and the page | 630 | subsequent truncate), and then return with VM_FAULT_LOCKED, and the page |
543 | locked. The VM will unlock the page. | 631 | locked. The VM will unlock the page. |
544 | 632 | ||
545 | ->map_pages() is called when VM asks to map easy accessible pages. | 633 | ->map_pages() is called when VM asks to map easy accessible pages. |
546 | Filesystem should find and map pages associated with offsets from "start_pgoff" | 634 | Filesystem should find and map pages associated with offsets from "start_pgoff" |
547 | till "end_pgoff". ->map_pages() is called with page table locked and must | 635 | till "end_pgoff". ->map_pages() is called with page table locked and must |
548 | not block. If it's not possible to reach a page without blocking, | 636 | not block. If it's not possible to reach a page without blocking, |
@@ -551,25 +639,26 @@ page table entry. Pointer to entry associated with the page is passed in | |||
551 | "pte" field in vm_fault structure. Pointers to entries for other offsets | 639 | "pte" field in vm_fault structure. Pointers to entries for other offsets |
552 | should be calculated relative to "pte". | 640 | should be calculated relative to "pte". |
553 | 641 | ||
554 | ->page_mkwrite() is called when a previously read-only pte is | 642 | ->page_mkwrite() is called when a previously read-only pte is |
555 | about to become writeable. The filesystem again must ensure that there are | 643 | about to become writeable. The filesystem again must ensure that there are |
556 | no truncate/invalidate races, and then return with the page locked. If | 644 | no truncate/invalidate races, and then return with the page locked. If |
557 | the page has been truncated, the filesystem should not look up a new page | 645 | the page has been truncated, the filesystem should not look up a new page |
558 | like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which | 646 | like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which |
559 | will cause the VM to retry the fault. | 647 | will cause the VM to retry the fault. |
560 | 648 | ||
561 | ->pfn_mkwrite() is the same as page_mkwrite but when the pte is | 649 | ->pfn_mkwrite() is the same as page_mkwrite but when the pte is |
562 | VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is | 650 | VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is |
563 | VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior | 651 | VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior |
564 | after this call is to make the pte read-write, unless pfn_mkwrite returns | 652 | after this call is to make the pte read-write, unless pfn_mkwrite returns |
565 | an error. | 653 | an error. |
566 | 654 | ||
567 | ->access() is called when get_user_pages() fails in | 655 | ->access() is called when get_user_pages() fails in |
568 | access_process_vm(), typically used to debug a process through | 656 | access_process_vm(), typically used to debug a process through |
569 | /proc/pid/mem or ptrace. This function is needed only for | 657 | /proc/pid/mem or ptrace. This function is needed only for |
570 | VM_IO | VM_PFNMAP VMAs. | 658 | VM_IO | VM_PFNMAP VMAs. |
571 | 659 | ||
572 | ================================================================================ | 660 | -------------------------------------------------------------------------------- |
661 | |||
573 | Dubious stuff | 662 | Dubious stuff |
574 | 663 | ||
575 | (if you break something or notice that it is broken and do not fix it yourself | 664 | (if you break something or notice that it is broken and do not fix it yourself |
diff --git a/Documentation/filesystems/nfs/Exporting b/Documentation/filesystems/nfs/exporting.rst index 63889149f532..33d588a01ace 100644 --- a/Documentation/filesystems/nfs/Exporting +++ b/Documentation/filesystems/nfs/exporting.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | :orphan: | ||
1 | 2 | ||
2 | Making Filesystems Exportable | 3 | Making Filesystems Exportable |
3 | ============================= | 4 | ============================= |
@@ -42,9 +43,9 @@ filehandle fragment, there is no automatic creation of a path prefix | |||
42 | for the object. This leads to two related but distinct features of | 43 | for the object. This leads to two related but distinct features of |
43 | the dcache that are not needed for normal filesystem access. | 44 | the dcache that are not needed for normal filesystem access. |
44 | 45 | ||
45 | 1/ The dcache must sometimes contain objects that are not part of the | 46 | 1. The dcache must sometimes contain objects that are not part of the |
46 | proper prefix. i.e that are not connected to the root. | 47 | proper prefix. i.e that are not connected to the root. |
47 | 2/ The dcache must be prepared for a newly found (via ->lookup) directory | 48 | 2. The dcache must be prepared for a newly found (via ->lookup) directory |
48 | to already have a (non-connected) dentry, and must be able to move | 49 | to already have a (non-connected) dentry, and must be able to move |
49 | that dentry into place (based on the parent and name in the | 50 | that dentry into place (based on the parent and name in the |
50 | ->lookup). This is particularly needed for directories as | 51 | ->lookup). This is particularly needed for directories as |
@@ -52,7 +53,7 @@ the dcache that are not needed for normal filesystem access. | |||
52 | 53 | ||
53 | To implement these features, the dcache has: | 54 | To implement these features, the dcache has: |
54 | 55 | ||
55 | a/ A dentry flag DCACHE_DISCONNECTED which is set on | 56 | a. A dentry flag DCACHE_DISCONNECTED which is set on |
56 | any dentry that might not be part of the proper prefix. | 57 | any dentry that might not be part of the proper prefix. |
57 | This is set when anonymous dentries are created, and cleared when a | 58 | This is set when anonymous dentries are created, and cleared when a |
58 | dentry is noticed to be a child of a dentry which is in the proper | 59 | dentry is noticed to be a child of a dentry which is in the proper |
@@ -71,48 +72,52 @@ a/ A dentry flag DCACHE_DISCONNECTED which is set on | |||
71 | dentries. That guarantees that we won't need to hunt them down upon | 72 | dentries. That guarantees that we won't need to hunt them down upon |
72 | umount. | 73 | umount. |
73 | 74 | ||
74 | b/ A primitive for creation of secondary roots - d_obtain_root(inode). | 75 | b. A primitive for creation of secondary roots - d_obtain_root(inode). |
75 | Those do _not_ bear DCACHE_DISCONNECTED. They are placed on the | 76 | Those do _not_ bear DCACHE_DISCONNECTED. They are placed on the |
76 | per-superblock list (->s_roots), so they can be located at umount | 77 | per-superblock list (->s_roots), so they can be located at umount |
77 | time for eviction purposes. | 78 | time for eviction purposes. |
78 | 79 | ||
79 | c/ Helper routines to allocate anonymous dentries, and to help attach | 80 | c. Helper routines to allocate anonymous dentries, and to help attach |
80 | loose directory dentries at lookup time. They are: | 81 | loose directory dentries at lookup time. They are: |
82 | |||
81 | d_obtain_alias(inode) will return a dentry for the given inode. | 83 | d_obtain_alias(inode) will return a dentry for the given inode. |
82 | If the inode already has a dentry, one of those is returned. | 84 | If the inode already has a dentry, one of those is returned. |
85 | |||
83 | If it doesn't, a new anonymous (IS_ROOT and | 86 | If it doesn't, a new anonymous (IS_ROOT and |
84 | DCACHE_DISCONNECTED) dentry is allocated and attached. | 87 | DCACHE_DISCONNECTED) dentry is allocated and attached. |
88 | |||
85 | In the case of a directory, care is taken that only one dentry | 89 | In the case of a directory, care is taken that only one dentry |
86 | can ever be attached. | 90 | can ever be attached. |
91 | |||
87 | d_splice_alias(inode, dentry) will introduce a new dentry into the tree; | 92 | d_splice_alias(inode, dentry) will introduce a new dentry into the tree; |
88 | either the passed-in dentry or a preexisting alias for the given inode | 93 | either the passed-in dentry or a preexisting alias for the given inode |
89 | (such as an anonymous one created by d_obtain_alias), if appropriate. | 94 | (such as an anonymous one created by d_obtain_alias), if appropriate. |
90 | It returns NULL when the passed-in dentry is used, following the calling | 95 | It returns NULL when the passed-in dentry is used, following the calling |
91 | convention of ->lookup. | 96 | convention of ->lookup. |
92 | 97 | ||
93 | Filesystem Issues | 98 | Filesystem Issues |
94 | ----------------- | 99 | ----------------- |
95 | 100 | ||
96 | For a filesystem to be exportable it must: | 101 | For a filesystem to be exportable it must: |
97 | 102 | ||
98 | 1/ provide the filehandle fragment routines described below. | 103 | 1. provide the filehandle fragment routines described below. |
99 | 2/ make sure that d_splice_alias is used rather than d_add | 104 | 2. make sure that d_splice_alias is used rather than d_add |
100 | when ->lookup finds an inode for a given parent and name. | 105 | when ->lookup finds an inode for a given parent and name. |
101 | 106 | ||
102 | If inode is NULL, d_splice_alias(inode, dentry) is equivalent to | 107 | If inode is NULL, d_splice_alias(inode, dentry) is equivalent to:: |
103 | 108 | ||
104 | d_add(dentry, inode), NULL | 109 | d_add(dentry, inode), NULL |
105 | 110 | ||
106 | Similarly, d_splice_alias(ERR_PTR(err), dentry) = ERR_PTR(err) | 111 | Similarly, d_splice_alias(ERR_PTR(err), dentry) = ERR_PTR(err) |
107 | 112 | ||
108 | Typically the ->lookup routine will simply end with a: | 113 | Typically the ->lookup routine will simply end with a:: |
109 | 114 | ||
110 | return d_splice_alias(inode, dentry); | 115 | return d_splice_alias(inode, dentry); |
111 | } | 116 | } |
112 | 117 | ||
113 | 118 | ||
114 | 119 | ||
115 | A file system implementation declares that instances of the filesystem | 120 | A file system implementation declares that instances of the filesystem |
116 | are exportable by setting the s_export_op field in the struct | 121 | are exportable by setting the s_export_op field in the struct |
117 | super_block. This field must point to a "struct export_operations" | 122 | super_block. This field must point to a "struct export_operations" |
118 | struct which has the following members: | 123 | struct which has the following members: |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting deleted file mode 100644 index 6b7a41cfcaed..000000000000 --- a/Documentation/filesystems/porting +++ /dev/null | |||
@@ -1,686 +0,0 @@ | |||
1 | Changes since 2.5.0: | ||
2 | |||
3 | --- | ||
4 | [recommended] | ||
5 | |||
6 | New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(), | ||
7 | sb_set_blocksize() and sb_min_blocksize(). | ||
8 | |||
9 | Use them. | ||
10 | |||
11 | (sb_find_get_block() replaces 2.4's get_hash_table()) | ||
12 | |||
13 | --- | ||
14 | [recommended] | ||
15 | |||
16 | New methods: ->alloc_inode() and ->destroy_inode(). | ||
17 | |||
18 | Remove inode->u.foo_inode_i | ||
19 | Declare | ||
20 | struct foo_inode_info { | ||
21 | /* fs-private stuff */ | ||
22 | struct inode vfs_inode; | ||
23 | }; | ||
24 | static inline struct foo_inode_info *FOO_I(struct inode *inode) | ||
25 | { | ||
26 | return list_entry(inode, struct foo_inode_info, vfs_inode); | ||
27 | } | ||
28 | |||
29 | Use FOO_I(inode) instead of &inode->u.foo_inode_i; | ||
30 | |||
31 | Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate | ||
32 | foo_inode_info and return the address of ->vfs_inode, the latter should free | ||
33 | FOO_I(inode) (see in-tree filesystems for examples). | ||
34 | |||
35 | Make them ->alloc_inode and ->destroy_inode in your super_operations. | ||
36 | |||
37 | Keep in mind that now you need explicit initialization of private data | ||
38 | typically between calling iget_locked() and unlocking the inode. | ||
39 | |||
40 | At some point that will become mandatory. | ||
41 | |||
42 | --- | ||
43 | [mandatory] | ||
44 | |||
45 | Change of file_system_type method (->read_super to ->get_sb) | ||
46 | |||
47 | ->read_super() is no more. Ditto for DECLARE_FSTYPE and DECLARE_FSTYPE_DEV. | ||
48 | |||
49 | Turn your foo_read_super() into a function that would return 0 in case of | ||
50 | success and negative number in case of error (-EINVAL unless you have more | ||
51 | informative error value to report). Call it foo_fill_super(). Now declare | ||
52 | |||
53 | int foo_get_sb(struct file_system_type *fs_type, | ||
54 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | ||
55 | { | ||
56 | return get_sb_bdev(fs_type, flags, dev_name, data, foo_fill_super, | ||
57 | mnt); | ||
58 | } | ||
59 | |||
60 | (or similar with s/bdev/nodev/ or s/bdev/single/, depending on the kind of | ||
61 | filesystem). | ||
62 | |||
63 | Replace DECLARE_FSTYPE... with explicit initializer and have ->get_sb set as | ||
64 | foo_get_sb. | ||
65 | |||
66 | --- | ||
67 | [mandatory] | ||
68 | |||
69 | Locking change: ->s_vfs_rename_sem is taken only by cross-directory renames. | ||
70 | Most likely there is no need to change anything, but if you relied on | ||
71 | global exclusion between renames for some internal purpose - you need to | ||
72 | change your internal locking. Otherwise exclusion warranties remain the | ||
73 | same (i.e. parents and victim are locked, etc.). | ||
74 | |||
75 | --- | ||
76 | [informational] | ||
77 | |||
78 | Now we have the exclusion between ->lookup() and directory removal (by | ||
79 | ->rmdir() and ->rename()). If you used to need that exclusion and do | ||
80 | it by internal locking (most of filesystems couldn't care less) - you | ||
81 | can relax your locking. | ||
82 | |||
83 | --- | ||
84 | [mandatory] | ||
85 | |||
86 | ->lookup(), ->truncate(), ->create(), ->unlink(), ->mknod(), ->mkdir(), | ||
87 | ->rmdir(), ->link(), ->lseek(), ->symlink(), ->rename() | ||
88 | and ->readdir() are called without BKL now. Grab it on entry, drop upon return | ||
89 | - that will guarantee the same locking you used to have. If your method or its | ||
90 | parts do not need BKL - better yet, now you can shift lock_kernel() and | ||
91 | unlock_kernel() so that they would protect exactly what needs to be | ||
92 | protected. | ||
93 | |||
94 | --- | ||
95 | [mandatory] | ||
96 | |||
97 | BKL is also moved from around sb operations. BKL should have been shifted into | ||
98 | individual fs sb_op functions. If you don't need it, remove it. | ||
99 | |||
100 | --- | ||
101 | [informational] | ||
102 | |||
103 | check for ->link() target not being a directory is done by callers. Feel | ||
104 | free to drop it... | ||
105 | |||
106 | --- | ||
107 | [informational] | ||
108 | |||
109 | ->link() callers hold ->i_mutex on the object we are linking to. Some of your | ||
110 | problems might be over... | ||
111 | |||
112 | --- | ||
113 | [mandatory] | ||
114 | |||
115 | new file_system_type method - kill_sb(superblock). If you are converting | ||
116 | an existing filesystem, set it according to ->fs_flags: | ||
117 | FS_REQUIRES_DEV - kill_block_super | ||
118 | FS_LITTER - kill_litter_super | ||
119 | neither - kill_anon_super | ||
120 | FS_LITTER is gone - just remove it from fs_flags. | ||
121 | |||
122 | --- | ||
123 | [mandatory] | ||
124 | |||
125 | FS_SINGLE is gone (actually, that had happened back when ->get_sb() | ||
126 | went in - and hadn't been documented ;-/). Just remove it from fs_flags | ||
127 | (and see ->get_sb() entry for other actions). | ||
128 | |||
129 | --- | ||
130 | [mandatory] | ||
131 | |||
132 | ->setattr() is called without BKL now. Caller _always_ holds ->i_mutex, so | ||
133 | watch for ->i_mutex-grabbing code that might be used by your ->setattr(). | ||
134 | Callers of notify_change() need ->i_mutex now. | ||
135 | |||
136 | --- | ||
137 | [recommended] | ||
138 | |||
139 | New super_block field "struct export_operations *s_export_op" for | ||
140 | explicit support for exporting, e.g. via NFS. The structure is fully | ||
141 | documented at its declaration in include/linux/fs.h, and in | ||
142 | Documentation/filesystems/nfs/Exporting. | ||
143 | |||
144 | Briefly it allows for the definition of decode_fh and encode_fh operations | ||
145 | to encode and decode filehandles, and allows the filesystem to use | ||
146 | a standard helper function for decode_fh, and provide file-system specific | ||
147 | support for this helper, particularly get_parent. | ||
148 | |||
149 | It is planned that this will be required for exporting once the code | ||
150 | settles down a bit. | ||
151 | |||
152 | [mandatory] | ||
153 | |||
154 | s_export_op is now required for exporting a filesystem. | ||
155 | isofs, ext2, ext3, resierfs, fat | ||
156 | can be used as examples of very different filesystems. | ||
157 | |||
158 | --- | ||
159 | [mandatory] | ||
160 | |||
161 | iget4() and the read_inode2 callback have been superseded by iget5_locked() | ||
162 | which has the following prototype, | ||
163 | |||
164 | struct inode *iget5_locked(struct super_block *sb, unsigned long ino, | ||
165 | int (*test)(struct inode *, void *), | ||
166 | int (*set)(struct inode *, void *), | ||
167 | void *data); | ||
168 | |||
169 | 'test' is an additional function that can be used when the inode | ||
170 | number is not sufficient to identify the actual file object. 'set' | ||
171 | should be a non-blocking function that initializes those parts of a | ||
172 | newly created inode to allow the test function to succeed. 'data' is | ||
173 | passed as an opaque value to both test and set functions. | ||
174 | |||
175 | When the inode has been created by iget5_locked(), it will be returned with the | ||
176 | I_NEW flag set and will still be locked. The filesystem then needs to finalize | ||
177 | the initialization. Once the inode is initialized it must be unlocked by | ||
178 | calling unlock_new_inode(). | ||
179 | |||
180 | The filesystem is responsible for setting (and possibly testing) i_ino | ||
181 | when appropriate. There is also a simpler iget_locked function that | ||
182 | just takes the superblock and inode number as arguments and does the | ||
183 | test and set for you. | ||
184 | |||
185 | e.g. | ||
186 | inode = iget_locked(sb, ino); | ||
187 | if (inode->i_state & I_NEW) { | ||
188 | err = read_inode_from_disk(inode); | ||
189 | if (err < 0) { | ||
190 | iget_failed(inode); | ||
191 | return err; | ||
192 | } | ||
193 | unlock_new_inode(inode); | ||
194 | } | ||
195 | |||
196 | Note that if the process of setting up a new inode fails, then iget_failed() | ||
197 | should be called on the inode to render it dead, and an appropriate error | ||
198 | should be passed back to the caller. | ||
199 | |||
200 | --- | ||
201 | [recommended] | ||
202 | |||
203 | ->getattr() finally getting used. See instances in nfs, minix, etc. | ||
204 | |||
205 | --- | ||
206 | [mandatory] | ||
207 | |||
208 | ->revalidate() is gone. If your filesystem had it - provide ->getattr() | ||
209 | and let it call whatever you had as ->revlidate() + (for symlinks that | ||
210 | had ->revalidate()) add calls in ->follow_link()/->readlink(). | ||
211 | |||
212 | --- | ||
213 | [mandatory] | ||
214 | |||
215 | ->d_parent changes are not protected by BKL anymore. Read access is safe | ||
216 | if at least one of the following is true: | ||
217 | * filesystem has no cross-directory rename() | ||
218 | * we know that parent had been locked (e.g. we are looking at | ||
219 | ->d_parent of ->lookup() argument). | ||
220 | * we are called from ->rename(). | ||
221 | * the child's ->d_lock is held | ||
222 | Audit your code and add locking if needed. Notice that any place that is | ||
223 | not protected by the conditions above is risky even in the old tree - you | ||
224 | had been relying on BKL and that's prone to screwups. Old tree had quite | ||
225 | a few holes of that kind - unprotected access to ->d_parent leading to | ||
226 | anything from oops to silent memory corruption. | ||
227 | |||
228 | --- | ||
229 | [mandatory] | ||
230 | |||
231 | FS_NOMOUNT is gone. If you use it - just set SB_NOUSER in flags | ||
232 | (see rootfs for one kind of solution and bdev/socket/pipe for another). | ||
233 | |||
234 | --- | ||
235 | [recommended] | ||
236 | |||
237 | Use bdev_read_only(bdev) instead of is_read_only(kdev). The latter | ||
238 | is still alive, but only because of the mess in drivers/s390/block/dasd.c. | ||
239 | As soon as it gets fixed is_read_only() will die. | ||
240 | |||
241 | --- | ||
242 | [mandatory] | ||
243 | |||
244 | ->permission() is called without BKL now. Grab it on entry, drop upon | ||
245 | return - that will guarantee the same locking you used to have. If | ||
246 | your method or its parts do not need BKL - better yet, now you can | ||
247 | shift lock_kernel() and unlock_kernel() so that they would protect | ||
248 | exactly what needs to be protected. | ||
249 | |||
250 | --- | ||
251 | [mandatory] | ||
252 | |||
253 | ->statfs() is now called without BKL held. BKL should have been | ||
254 | shifted into individual fs sb_op functions where it's not clear that | ||
255 | it's safe to remove it. If you don't need it, remove it. | ||
256 | |||
257 | --- | ||
258 | [mandatory] | ||
259 | |||
260 | is_read_only() is gone; use bdev_read_only() instead. | ||
261 | |||
262 | --- | ||
263 | [mandatory] | ||
264 | |||
265 | destroy_buffers() is gone; use invalidate_bdev(). | ||
266 | |||
267 | --- | ||
268 | [mandatory] | ||
269 | |||
270 | fsync_dev() is gone; use fsync_bdev(). NOTE: lvm breakage is | ||
271 | deliberate; as soon as struct block_device * is propagated in a reasonable | ||
272 | way by that code fixing will become trivial; until then nothing can be | ||
273 | done. | ||
274 | |||
275 | [mandatory] | ||
276 | |||
277 | block truncatation on error exit from ->write_begin, and ->direct_IO | ||
278 | moved from generic methods (block_write_begin, cont_write_begin, | ||
279 | nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at | ||
280 | ext2_write_failed and callers for an example. | ||
281 | |||
282 | [mandatory] | ||
283 | |||
284 | ->truncate is gone. The whole truncate sequence needs to be | ||
285 | implemented in ->setattr, which is now mandatory for filesystems | ||
286 | implementing on-disk size changes. Start with a copy of the old inode_setattr | ||
287 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to | ||
288 | be in order of zeroing blocks using block_truncate_page or similar helpers, | ||
289 | size update and on finally on-disk truncation which should not fail. | ||
290 | setattr_prepare (which used to be inode_change_ok) now includes the size checks | ||
291 | for ATTR_SIZE and must be called in the beginning of ->setattr unconditionally. | ||
292 | |||
293 | [mandatory] | ||
294 | |||
295 | ->clear_inode() and ->delete_inode() are gone; ->evict_inode() should | ||
296 | be used instead. It gets called whenever the inode is evicted, whether it has | ||
297 | remaining links or not. Caller does *not* evict the pagecache or inode-associated | ||
298 | metadata buffers; the method has to use truncate_inode_pages_final() to get rid | ||
299 | of those. Caller makes sure async writeback cannot be running for the inode while | ||
300 | (or after) ->evict_inode() is called. | ||
301 | |||
302 | ->drop_inode() returns int now; it's called on final iput() with | ||
303 | inode->i_lock held and it returns true if filesystems wants the inode to be | ||
304 | dropped. As before, generic_drop_inode() is still the default and it's been | ||
305 | updated appropriately. generic_delete_inode() is also alive and it consists | ||
306 | simply of return 1. Note that all actual eviction work is done by caller after | ||
307 | ->drop_inode() returns. | ||
308 | |||
309 | As before, clear_inode() must be called exactly once on each call of | ||
310 | ->evict_inode() (as it used to be for each call of ->delete_inode()). Unlike | ||
311 | before, if you are using inode-associated metadata buffers (i.e. | ||
312 | mark_buffer_dirty_inode()), it's your responsibility to call | ||
313 | invalidate_inode_buffers() before clear_inode(). | ||
314 | |||
315 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out | ||
316 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() | ||
317 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly | ||
318 | free the on-disk inode, you may end up doing that while ->write_inode() is writing | ||
319 | to it. | ||
320 | |||
321 | --- | ||
322 | [mandatory] | ||
323 | |||
324 | .d_delete() now only advises the dcache as to whether or not to cache | ||
325 | unreferenced dentries, and is now only called when the dentry refcount goes to | ||
326 | 0. Even on 0 refcount transition, it must be able to tolerate being called 0, | ||
327 | 1, or more times (eg. constant, idempotent). | ||
328 | |||
329 | --- | ||
330 | [mandatory] | ||
331 | |||
332 | .d_compare() calling convention and locking rules are significantly | ||
333 | changed. Read updated documentation in Documentation/filesystems/vfs.rst (and | ||
334 | look at examples of other filesystems) for guidance. | ||
335 | |||
336 | --- | ||
337 | [mandatory] | ||
338 | |||
339 | .d_hash() calling convention and locking rules are significantly | ||
340 | changed. Read updated documentation in Documentation/filesystems/vfs.rst (and | ||
341 | look at examples of other filesystems) for guidance. | ||
342 | |||
343 | --- | ||
344 | [mandatory] | ||
345 | dcache_lock is gone, replaced by fine grained locks. See fs/dcache.c | ||
346 | for details of what locks to replace dcache_lock with in order to protect | ||
347 | particular things. Most of the time, a filesystem only needs ->d_lock, which | ||
348 | protects *all* the dcache state of a given dentry. | ||
349 | |||
350 | -- | ||
351 | [mandatory] | ||
352 | |||
353 | Filesystems must RCU-free their inodes, if they can have been accessed | ||
354 | via rcu-walk path walk (basically, if the file can have had a path name in the | ||
355 | vfs namespace). | ||
356 | |||
357 | Even though i_dentry and i_rcu share storage in a union, we will | ||
358 | initialize the former in inode_init_always(), so just leave it alone in | ||
359 | the callback. It used to be necessary to clean it there, but not anymore | ||
360 | (starting at 3.2). | ||
361 | |||
362 | -- | ||
363 | [recommended] | ||
364 | vfs now tries to do path walking in "rcu-walk mode", which avoids | ||
365 | atomic operations and scalability hazards on dentries and inodes (see | ||
366 | Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes | ||
367 | (above) are examples of the changes required to support this. For more complex | ||
368 | filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so | ||
369 | no changes are required to the filesystem. However, this is costly and loses | ||
370 | the benefits of rcu-walk mode. We will begin to add filesystem callbacks that | ||
371 | are rcu-walk aware, shown below. Filesystems should take advantage of this | ||
372 | where possible. | ||
373 | |||
374 | -- | ||
375 | [mandatory] | ||
376 | d_revalidate is a callback that is made on every path element (if | ||
377 | the filesystem provides it), which requires dropping out of rcu-walk mode. This | ||
378 | may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be | ||
379 | returned if the filesystem cannot handle rcu-walk. See | ||
380 | Documentation/filesystems/vfs.rst for more details. | ||
381 | |||
382 | permission is an inode permission check that is called on many or all | ||
383 | directory inodes on the way down a path walk (to check for exec permission). It | ||
384 | must now be rcu-walk aware (mask & MAY_NOT_BLOCK). See | ||
385 | Documentation/filesystems/vfs.rst for more details. | ||
386 | |||
387 | -- | ||
388 | [mandatory] | ||
389 | In ->fallocate() you must check the mode option passed in. If your | ||
390 | filesystem does not support hole punching (deallocating space in the middle of a | ||
391 | file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode. | ||
392 | Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set, | ||
393 | so the i_size should not change when hole punching, even when puching the end of | ||
394 | a file off. | ||
395 | |||
396 | -- | ||
397 | [mandatory] | ||
398 | ->get_sb() is gone. Switch to use of ->mount(). Typically it's just | ||
399 | a matter of switching from calling get_sb_... to mount_... and changing the | ||
400 | function type. If you were doing it manually, just switch from setting ->mnt_root | ||
401 | to some pointer to returning that pointer. On errors return ERR_PTR(...). | ||
402 | |||
403 | -- | ||
404 | [mandatory] | ||
405 | ->permission() and generic_permission()have lost flags | ||
406 | argument; instead of passing IPERM_FLAG_RCU we add MAY_NOT_BLOCK into mask. | ||
407 | generic_permission() has also lost the check_acl argument; ACL checking | ||
408 | has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl | ||
409 | to read an ACL from disk. | ||
410 | |||
411 | -- | ||
412 | [mandatory] | ||
413 | If you implement your own ->llseek() you must handle SEEK_HOLE and | ||
414 | SEEK_DATA. You can hanle this by returning -EINVAL, but it would be nicer to | ||
415 | support it in some way. The generic handler assumes that the entire file is | ||
416 | data and there is a virtual hole at the end of the file. So if the provided | ||
417 | offset is less than i_size and SEEK_DATA is specified, return the same offset. | ||
418 | If the above is true for the offset and you are given SEEK_HOLE, return the end | ||
419 | of the file. If the offset is i_size or greater return -ENXIO in either case. | ||
420 | |||
421 | [mandatory] | ||
422 | If you have your own ->fsync() you must make sure to call | ||
423 | filemap_write_and_wait_range() so that all dirty pages are synced out properly. | ||
424 | You must also keep in mind that ->fsync() is not called with i_mutex held | ||
425 | anymore, so if you require i_mutex locking you must make sure to take it and | ||
426 | release it yourself. | ||
427 | |||
428 | -- | ||
429 | [mandatory] | ||
430 | d_alloc_root() is gone, along with a lot of bugs caused by code | ||
431 | misusing it. Replacement: d_make_root(inode). On success d_make_root(inode) | ||
432 | allocates and returns a new dentry instantiated with the passed in inode. | ||
433 | On failure NULL is returned and the passed in inode is dropped so the reference | ||
434 | to inode is consumed in all cases and failure handling need not do any cleanup | ||
435 | for the inode. If d_make_root(inode) is passed a NULL inode it returns NULL | ||
436 | and also requires no further error handling. Typical usage is: | ||
437 | |||
438 | inode = foofs_new_inode(....); | ||
439 | s->s_root = d_make_root(inode); | ||
440 | if (!s->s_root) | ||
441 | /* Nothing needed for the inode cleanup */ | ||
442 | return -ENOMEM; | ||
443 | ... | ||
444 | |||
445 | -- | ||
446 | [mandatory] | ||
447 | The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and | ||
448 | ->lookup() do *not* take struct nameidata anymore; just the flags. | ||
449 | -- | ||
450 | [mandatory] | ||
451 | ->create() doesn't take struct nameidata *; unlike the previous | ||
452 | two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that | ||
453 | local filesystems can ignore tha argument - they are guaranteed that the | ||
454 | object doesn't exist. It's remote/distributed ones that might care... | ||
455 | -- | ||
456 | [mandatory] | ||
457 | FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate() | ||
458 | in your dentry operations instead. | ||
459 | -- | ||
460 | [mandatory] | ||
461 | vfs_readdir() is gone; switch to iterate_dir() instead | ||
462 | -- | ||
463 | [mandatory] | ||
464 | ->readdir() is gone now; switch to ->iterate() | ||
465 | [mandatory] | ||
466 | vfs_follow_link has been removed. Filesystems must use nd_set_link | ||
467 | from ->follow_link for normal symlinks, or nd_jump_link for magic | ||
468 | /proc/<pid> style links. | ||
469 | -- | ||
470 | [mandatory] | ||
471 | iget5_locked()/ilookup5()/ilookup5_nowait() test() callback used to be | ||
472 | called with both ->i_lock and inode_hash_lock held; the former is *not* | ||
473 | taken anymore, so verify that your callbacks do not rely on it (none | ||
474 | of the in-tree instances did). inode_hash_lock is still held, | ||
475 | of course, so they are still serialized wrt removal from inode hash, | ||
476 | as well as wrt set() callback of iget5_locked(). | ||
477 | -- | ||
478 | [mandatory] | ||
479 | d_materialise_unique() is gone; d_splice_alias() does everything you | ||
480 | need now. Remember that they have opposite orders of arguments ;-/ | ||
481 | -- | ||
482 | [mandatory] | ||
483 | f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid | ||
484 | it entirely. | ||
485 | -- | ||
486 | [mandatory] | ||
487 | never call ->read() and ->write() directly; use __vfs_{read,write} or | ||
488 | wrappers; instead of checking for ->write or ->read being NULL, look for | ||
489 | FMODE_CAN_{WRITE,READ} in file->f_mode. | ||
490 | -- | ||
491 | [mandatory] | ||
492 | do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL | ||
493 | instead. | ||
494 | -- | ||
495 | [mandatory] | ||
496 | ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter. | ||
497 | --- | ||
498 | [recommended] | ||
499 | for embedded ("fast") symlinks just set inode->i_link to wherever the | ||
500 | symlink body is and use simple_follow_link() as ->follow_link(). | ||
501 | -- | ||
502 | [mandatory] | ||
503 | calling conventions for ->follow_link() have changed. Instead of returning | ||
504 | cookie and using nd_set_link() to store the body to traverse, we return | ||
505 | the body to traverse and store the cookie using explicit void ** argument. | ||
506 | nameidata isn't passed at all - nd_jump_link() doesn't need it and | ||
507 | nd_[gs]et_link() is gone. | ||
508 | -- | ||
509 | [mandatory] | ||
510 | calling conventions for ->put_link() have changed. It gets inode instead of | ||
511 | dentry, it does not get nameidata at all and it gets called only when cookie | ||
512 | is non-NULL. Note that link body isn't available anymore, so if you need it, | ||
513 | store it as cookie. | ||
514 | -- | ||
515 | [mandatory] | ||
516 | any symlink that might use page_follow_link_light/page_put_link() must | ||
517 | have inode_nohighmem(inode) called before anything might start playing with | ||
518 | its pagecache. No highmem pages should end up in the pagecache of such | ||
519 | symlinks. That includes any preseeding that might be done during symlink | ||
520 | creation. __page_symlink() will honour the mapping gfp flags, so once | ||
521 | you've done inode_nohighmem() it's safe to use, but if you allocate and | ||
522 | insert the page manually, make sure to use the right gfp flags. | ||
523 | -- | ||
524 | [mandatory] | ||
525 | ->follow_link() is replaced with ->get_link(); same API, except that | ||
526 | * ->get_link() gets inode as a separate argument | ||
527 | * ->get_link() may be called in RCU mode - in that case NULL | ||
528 | dentry is passed | ||
529 | -- | ||
530 | [mandatory] | ||
531 | ->get_link() gets struct delayed_call *done now, and should do | ||
532 | set_delayed_call() where it used to set *cookie. | ||
533 | ->put_link() is gone - just give the destructor to set_delayed_call() | ||
534 | in ->get_link(). | ||
535 | -- | ||
536 | [mandatory] | ||
537 | ->getxattr() and xattr_handler.get() get dentry and inode passed separately. | ||
538 | dentry might be yet to be attached to inode, so do _not_ use its ->d_inode | ||
539 | in the instances. Rationale: !@#!@# security_d_instantiate() needs to be | ||
540 | called before we attach dentry to inode. | ||
541 | -- | ||
542 | [mandatory] | ||
543 | symlinks are no longer the only inodes that do *not* have i_bdev/i_cdev/ | ||
544 | i_pipe/i_link union zeroed out at inode eviction. As the result, you can't | ||
545 | assume that non-NULL value in ->i_nlink at ->destroy_inode() implies that | ||
546 | it's a symlink. Checking ->i_mode is really needed now. In-tree we had | ||
547 | to fix shmem_destroy_callback() that used to take that kind of shortcut; | ||
548 | watch out, since that shortcut is no longer valid. | ||
549 | -- | ||
550 | [mandatory] | ||
551 | ->i_mutex is replaced with ->i_rwsem now. inode_lock() et.al. work as | ||
552 | they used to - they just take it exclusive. However, ->lookup() may be | ||
553 | called with parent locked shared. Its instances must not | ||
554 | * use d_instantiate) and d_rehash() separately - use d_add() or | ||
555 | d_splice_alias() instead. | ||
556 | * use d_rehash() alone - call d_add(new_dentry, NULL) instead. | ||
557 | * in the unlikely case when (read-only) access to filesystem | ||
558 | data structures needs exclusion for some reason, arrange it | ||
559 | yourself. None of the in-tree filesystems needed that. | ||
560 | * rely on ->d_parent and ->d_name not changing after dentry has | ||
561 | been fed to d_add() or d_splice_alias(). Again, none of the | ||
562 | in-tree instances relied upon that. | ||
563 | We are guaranteed that lookups of the same name in the same directory | ||
564 | will not happen in parallel ("same" in the sense of your ->d_compare()). | ||
565 | Lookups on different names in the same directory can and do happen in | ||
566 | parallel now. | ||
567 | -- | ||
568 | [recommended] | ||
569 | ->iterate_shared() is added; it's a parallel variant of ->iterate(). | ||
570 | Exclusion on struct file level is still provided (as well as that | ||
571 | between it and lseek on the same struct file), but if your directory | ||
572 | has been opened several times, you can get these called in parallel. | ||
573 | Exclusion between that method and all directory-modifying ones is | ||
574 | still provided, of course. | ||
575 | |||
576 | Often enough ->iterate() can serve as ->iterate_shared() without any | ||
577 | changes - it is a read-only operation, after all. If you have any | ||
578 | per-inode or per-dentry in-core data structures modified by ->iterate(), | ||
579 | you might need something to serialize the access to them. If you | ||
580 | do dcache pre-seeding, you'll need to switch to d_alloc_parallel() for | ||
581 | that; look for in-tree examples. | ||
582 | |||
583 | Old method is only used if the new one is absent; eventually it will | ||
584 | be removed. Switch while you still can; the old one won't stay. | ||
585 | -- | ||
586 | [mandatory] | ||
587 | ->atomic_open() calls without O_CREAT may happen in parallel. | ||
588 | -- | ||
589 | [mandatory] | ||
590 | ->setxattr() and xattr_handler.set() get dentry and inode passed separately. | ||
591 | dentry might be yet to be attached to inode, so do _not_ use its ->d_inode | ||
592 | in the instances. Rationale: !@#!@# security_d_instantiate() needs to be | ||
593 | called before we attach dentry to inode and !@#!@##!@$!$#!@#$!@$!@$ smack | ||
594 | ->d_instantiate() uses not just ->getxattr() but ->setxattr() as well. | ||
595 | -- | ||
596 | [mandatory] | ||
597 | ->d_compare() doesn't get parent as a separate argument anymore. If you | ||
598 | used it for finding the struct super_block involved, dentry->d_sb will | ||
599 | work just as well; if it's something more complicated, use dentry->d_parent. | ||
600 | Just be careful not to assume that fetching it more than once will yield | ||
601 | the same value - in RCU mode it could change under you. | ||
602 | -- | ||
603 | [mandatory] | ||
604 | ->rename() has an added flags argument. Any flags not handled by the | ||
605 | filesystem should result in EINVAL being returned. | ||
606 | -- | ||
607 | [recommended] | ||
608 | ->readlink is optional for symlinks. Don't set, unless filesystem needs | ||
609 | to fake something for readlink(2). | ||
610 | -- | ||
611 | [mandatory] | ||
612 | ->getattr() is now passed a struct path rather than a vfsmount and | ||
613 | dentry separately, and it now has request_mask and query_flags arguments | ||
614 | to specify the fields and sync type requested by statx. Filesystems not | ||
615 | supporting any statx-specific features may ignore the new arguments. | ||
616 | -- | ||
617 | [mandatory] | ||
618 | ->atomic_open() calling conventions have changed. Gone is int *opened, | ||
619 | along with FILE_OPENED/FILE_CREATED. In place of those we have | ||
620 | FMODE_OPENED/FMODE_CREATED, set in file->f_mode. Additionally, return | ||
621 | value for 'called finish_no_open(), open it yourself' case has become | ||
622 | 0, not 1. Since finish_no_open() itself is returning 0 now, that part | ||
623 | does not need any changes in ->atomic_open() instances. | ||
624 | -- | ||
625 | [mandatory] | ||
626 | alloc_file() has become static now; two wrappers are to be used instead. | ||
627 | alloc_file_pseudo(inode, vfsmount, name, flags, ops) is for the cases | ||
628 | when dentry needs to be created; that's the majority of old alloc_file() | ||
629 | users. Calling conventions: on success a reference to new struct file | ||
630 | is returned and callers reference to inode is subsumed by that. On | ||
631 | failure, ERR_PTR() is returned and no caller's references are affected, | ||
632 | so the caller needs to drop the inode reference it held. | ||
633 | alloc_file_clone(file, flags, ops) does not affect any caller's references. | ||
634 | On success you get a new struct file sharing the mount/dentry with the | ||
635 | original, on failure - ERR_PTR(). | ||
636 | -- | ||
637 | [mandatory] | ||
638 | ->clone_file_range() and ->dedupe_file_range have been replaced with | ||
639 | ->remap_file_range(). See Documentation/filesystems/vfs.rst for more | ||
640 | information. | ||
641 | -- | ||
642 | [recommended] | ||
643 | ->lookup() instances doing an equivalent of | ||
644 | if (IS_ERR(inode)) | ||
645 | return ERR_CAST(inode); | ||
646 | return d_splice_alias(inode, dentry); | ||
647 | don't need to bother with the check - d_splice_alias() will do the | ||
648 | right thing when given ERR_PTR(...) as inode. Moreover, passing NULL | ||
649 | inode to d_splice_alias() will also do the right thing (equivalent of | ||
650 | d_add(dentry, NULL); return NULL;), so that kind of special cases | ||
651 | also doesn't need a separate treatment. | ||
652 | -- | ||
653 | [strongly recommended] | ||
654 | take the RCU-delayed parts of ->destroy_inode() into a new method - | ||
655 | ->free_inode(). If ->destroy_inode() becomes empty - all the better, | ||
656 | just get rid of it. Synchronous work (e.g. the stuff that can't | ||
657 | be done from an RCU callback, or any WARN_ON() where we want the | ||
658 | stack trace) *might* be movable to ->evict_inode(); however, | ||
659 | that goes only for the things that are not needed to balance something | ||
660 | done by ->alloc_inode(). IOW, if it's cleaning up the stuff that | ||
661 | might have accumulated over the life of in-core inode, ->evict_inode() | ||
662 | might be a fit. | ||
663 | |||
664 | Rules for inode destruction: | ||
665 | * if ->destroy_inode() is non-NULL, it gets called | ||
666 | * if ->free_inode() is non-NULL, it gets scheduled by call_rcu() | ||
667 | * combination of NULL ->destroy_inode and NULL ->free_inode is | ||
668 | treated as NULL/free_inode_nonrcu, to preserve the compatibility. | ||
669 | |||
670 | Note that the callback (be it via ->free_inode() or explicit call_rcu() | ||
671 | in ->destroy_inode()) is *NOT* ordered wrt superblock destruction; | ||
672 | as the matter of fact, the superblock and all associated structures | ||
673 | might be already gone. The filesystem driver is guaranteed to be still | ||
674 | there, but that's it. Freeing memory in the callback is fine; doing | ||
675 | more than that is possible, but requires a lot of care and is best | ||
676 | avoided. | ||
677 | -- | ||
678 | [mandatory] | ||
679 | DCACHE_RCUACCESS is gone; having an RCU delay on dentry freeing is the | ||
680 | default. DCACHE_NORCU opts out, and only d_alloc_pseudo() has any | ||
681 | business doing so. | ||
682 | -- | ||
683 | [mandatory] | ||
684 | d_alloc_pseudo() is internal-only; uses outside of alloc_file_pseudo() are | ||
685 | very suspect (and won't work in modules). Such uses are very likely to | ||
686 | be misspelled d_alloc_anon(). | ||
diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst new file mode 100644 index 000000000000..f18506083ced --- /dev/null +++ b/Documentation/filesystems/porting.rst | |||
@@ -0,0 +1,852 @@ | |||
1 | ==================== | ||
2 | Changes since 2.5.0: | ||
3 | ==================== | ||
4 | |||
5 | --- | ||
6 | |||
7 | **recommended** | ||
8 | |||
9 | New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(), | ||
10 | sb_set_blocksize() and sb_min_blocksize(). | ||
11 | |||
12 | Use them. | ||
13 | |||
14 | (sb_find_get_block() replaces 2.4's get_hash_table()) | ||
15 | |||
16 | --- | ||
17 | |||
18 | **recommended** | ||
19 | |||
20 | New methods: ->alloc_inode() and ->destroy_inode(). | ||
21 | |||
22 | Remove inode->u.foo_inode_i | ||
23 | |||
24 | Declare:: | ||
25 | |||
26 | struct foo_inode_info { | ||
27 | /* fs-private stuff */ | ||
28 | struct inode vfs_inode; | ||
29 | }; | ||
30 | static inline struct foo_inode_info *FOO_I(struct inode *inode) | ||
31 | { | ||
32 | return list_entry(inode, struct foo_inode_info, vfs_inode); | ||
33 | } | ||
34 | |||
35 | Use FOO_I(inode) instead of &inode->u.foo_inode_i; | ||
36 | |||
37 | Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate | ||
38 | foo_inode_info and return the address of ->vfs_inode, the latter should free | ||
39 | FOO_I(inode) (see in-tree filesystems for examples). | ||
40 | |||
41 | Make them ->alloc_inode and ->destroy_inode in your super_operations. | ||
42 | |||
43 | Keep in mind that now you need explicit initialization of private data | ||
44 | typically between calling iget_locked() and unlocking the inode. | ||
45 | |||
46 | At some point that will become mandatory. | ||
47 | |||
48 | --- | ||
49 | |||
50 | **mandatory** | ||
51 | |||
52 | Change of file_system_type method (->read_super to ->get_sb) | ||
53 | |||
54 | ->read_super() is no more. Ditto for DECLARE_FSTYPE and DECLARE_FSTYPE_DEV. | ||
55 | |||
56 | Turn your foo_read_super() into a function that would return 0 in case of | ||
57 | success and negative number in case of error (-EINVAL unless you have more | ||
58 | informative error value to report). Call it foo_fill_super(). Now declare:: | ||
59 | |||
60 | int foo_get_sb(struct file_system_type *fs_type, | ||
61 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | ||
62 | { | ||
63 | return get_sb_bdev(fs_type, flags, dev_name, data, foo_fill_super, | ||
64 | mnt); | ||
65 | } | ||
66 | |||
67 | (or similar with s/bdev/nodev/ or s/bdev/single/, depending on the kind of | ||
68 | filesystem). | ||
69 | |||
70 | Replace DECLARE_FSTYPE... with explicit initializer and have ->get_sb set as | ||
71 | foo_get_sb. | ||
72 | |||
73 | --- | ||
74 | |||
75 | **mandatory** | ||
76 | |||
77 | Locking change: ->s_vfs_rename_sem is taken only by cross-directory renames. | ||
78 | Most likely there is no need to change anything, but if you relied on | ||
79 | global exclusion between renames for some internal purpose - you need to | ||
80 | change your internal locking. Otherwise exclusion warranties remain the | ||
81 | same (i.e. parents and victim are locked, etc.). | ||
82 | |||
83 | --- | ||
84 | |||
85 | **informational** | ||
86 | |||
87 | Now we have the exclusion between ->lookup() and directory removal (by | ||
88 | ->rmdir() and ->rename()). If you used to need that exclusion and do | ||
89 | it by internal locking (most of filesystems couldn't care less) - you | ||
90 | can relax your locking. | ||
91 | |||
92 | --- | ||
93 | |||
94 | **mandatory** | ||
95 | |||
96 | ->lookup(), ->truncate(), ->create(), ->unlink(), ->mknod(), ->mkdir(), | ||
97 | ->rmdir(), ->link(), ->lseek(), ->symlink(), ->rename() | ||
98 | and ->readdir() are called without BKL now. Grab it on entry, drop upon return | ||
99 | - that will guarantee the same locking you used to have. If your method or its | ||
100 | parts do not need BKL - better yet, now you can shift lock_kernel() and | ||
101 | unlock_kernel() so that they would protect exactly what needs to be | ||
102 | protected. | ||
103 | |||
104 | --- | ||
105 | |||
106 | **mandatory** | ||
107 | |||
108 | BKL is also moved from around sb operations. BKL should have been shifted into | ||
109 | individual fs sb_op functions. If you don't need it, remove it. | ||
110 | |||
111 | --- | ||
112 | |||
113 | **informational** | ||
114 | |||
115 | check for ->link() target not being a directory is done by callers. Feel | ||
116 | free to drop it... | ||
117 | |||
118 | --- | ||
119 | |||
120 | **informational** | ||
121 | |||
122 | ->link() callers hold ->i_mutex on the object we are linking to. Some of your | ||
123 | problems might be over... | ||
124 | |||
125 | --- | ||
126 | |||
127 | **mandatory** | ||
128 | |||
129 | new file_system_type method - kill_sb(superblock). If you are converting | ||
130 | an existing filesystem, set it according to ->fs_flags:: | ||
131 | |||
132 | FS_REQUIRES_DEV - kill_block_super | ||
133 | FS_LITTER - kill_litter_super | ||
134 | neither - kill_anon_super | ||
135 | |||
136 | FS_LITTER is gone - just remove it from fs_flags. | ||
137 | |||
138 | --- | ||
139 | |||
140 | **mandatory** | ||
141 | |||
142 | FS_SINGLE is gone (actually, that had happened back when ->get_sb() | ||
143 | went in - and hadn't been documented ;-/). Just remove it from fs_flags | ||
144 | (and see ->get_sb() entry for other actions). | ||
145 | |||
146 | --- | ||
147 | |||
148 | **mandatory** | ||
149 | |||
150 | ->setattr() is called without BKL now. Caller _always_ holds ->i_mutex, so | ||
151 | watch for ->i_mutex-grabbing code that might be used by your ->setattr(). | ||
152 | Callers of notify_change() need ->i_mutex now. | ||
153 | |||
154 | --- | ||
155 | |||
156 | **recommended** | ||
157 | |||
158 | New super_block field ``struct export_operations *s_export_op`` for | ||
159 | explicit support for exporting, e.g. via NFS. The structure is fully | ||
160 | documented at its declaration in include/linux/fs.h, and in | ||
161 | Documentation/filesystems/nfs/exporting.rst. | ||
162 | |||
163 | Briefly it allows for the definition of decode_fh and encode_fh operations | ||
164 | to encode and decode filehandles, and allows the filesystem to use | ||
165 | a standard helper function for decode_fh, and provide file-system specific | ||
166 | support for this helper, particularly get_parent. | ||
167 | |||
168 | It is planned that this will be required for exporting once the code | ||
169 | settles down a bit. | ||
170 | |||
171 | **mandatory** | ||
172 | |||
173 | s_export_op is now required for exporting a filesystem. | ||
174 | isofs, ext2, ext3, resierfs, fat | ||
175 | can be used as examples of very different filesystems. | ||
176 | |||
177 | --- | ||
178 | |||
179 | **mandatory** | ||
180 | |||
181 | iget4() and the read_inode2 callback have been superseded by iget5_locked() | ||
182 | which has the following prototype:: | ||
183 | |||
184 | struct inode *iget5_locked(struct super_block *sb, unsigned long ino, | ||
185 | int (*test)(struct inode *, void *), | ||
186 | int (*set)(struct inode *, void *), | ||
187 | void *data); | ||
188 | |||
189 | 'test' is an additional function that can be used when the inode | ||
190 | number is not sufficient to identify the actual file object. 'set' | ||
191 | should be a non-blocking function that initializes those parts of a | ||
192 | newly created inode to allow the test function to succeed. 'data' is | ||
193 | passed as an opaque value to both test and set functions. | ||
194 | |||
195 | When the inode has been created by iget5_locked(), it will be returned with the | ||
196 | I_NEW flag set and will still be locked. The filesystem then needs to finalize | ||
197 | the initialization. Once the inode is initialized it must be unlocked by | ||
198 | calling unlock_new_inode(). | ||
199 | |||
200 | The filesystem is responsible for setting (and possibly testing) i_ino | ||
201 | when appropriate. There is also a simpler iget_locked function that | ||
202 | just takes the superblock and inode number as arguments and does the | ||
203 | test and set for you. | ||
204 | |||
205 | e.g.:: | ||
206 | |||
207 | inode = iget_locked(sb, ino); | ||
208 | if (inode->i_state & I_NEW) { | ||
209 | err = read_inode_from_disk(inode); | ||
210 | if (err < 0) { | ||
211 | iget_failed(inode); | ||
212 | return err; | ||
213 | } | ||
214 | unlock_new_inode(inode); | ||
215 | } | ||
216 | |||
217 | Note that if the process of setting up a new inode fails, then iget_failed() | ||
218 | should be called on the inode to render it dead, and an appropriate error | ||
219 | should be passed back to the caller. | ||
220 | |||
221 | --- | ||
222 | |||
223 | **recommended** | ||
224 | |||
225 | ->getattr() finally getting used. See instances in nfs, minix, etc. | ||
226 | |||
227 | --- | ||
228 | |||
229 | **mandatory** | ||
230 | |||
231 | ->revalidate() is gone. If your filesystem had it - provide ->getattr() | ||
232 | and let it call whatever you had as ->revlidate() + (for symlinks that | ||
233 | had ->revalidate()) add calls in ->follow_link()/->readlink(). | ||
234 | |||
235 | --- | ||
236 | |||
237 | **mandatory** | ||
238 | |||
239 | ->d_parent changes are not protected by BKL anymore. Read access is safe | ||
240 | if at least one of the following is true: | ||
241 | |||
242 | * filesystem has no cross-directory rename() | ||
243 | * we know that parent had been locked (e.g. we are looking at | ||
244 | ->d_parent of ->lookup() argument). | ||
245 | * we are called from ->rename(). | ||
246 | * the child's ->d_lock is held | ||
247 | |||
248 | Audit your code and add locking if needed. Notice that any place that is | ||
249 | not protected by the conditions above is risky even in the old tree - you | ||
250 | had been relying on BKL and that's prone to screwups. Old tree had quite | ||
251 | a few holes of that kind - unprotected access to ->d_parent leading to | ||
252 | anything from oops to silent memory corruption. | ||
253 | |||
254 | --- | ||
255 | |||
256 | **mandatory** | ||
257 | |||
258 | FS_NOMOUNT is gone. If you use it - just set SB_NOUSER in flags | ||
259 | (see rootfs for one kind of solution and bdev/socket/pipe for another). | ||
260 | |||
261 | --- | ||
262 | |||
263 | **recommended** | ||
264 | |||
265 | Use bdev_read_only(bdev) instead of is_read_only(kdev). The latter | ||
266 | is still alive, but only because of the mess in drivers/s390/block/dasd.c. | ||
267 | As soon as it gets fixed is_read_only() will die. | ||
268 | |||
269 | --- | ||
270 | |||
271 | **mandatory** | ||
272 | |||
273 | ->permission() is called without BKL now. Grab it on entry, drop upon | ||
274 | return - that will guarantee the same locking you used to have. If | ||
275 | your method or its parts do not need BKL - better yet, now you can | ||
276 | shift lock_kernel() and unlock_kernel() so that they would protect | ||
277 | exactly what needs to be protected. | ||
278 | |||
279 | --- | ||
280 | |||
281 | **mandatory** | ||
282 | |||
283 | ->statfs() is now called without BKL held. BKL should have been | ||
284 | shifted into individual fs sb_op functions where it's not clear that | ||
285 | it's safe to remove it. If you don't need it, remove it. | ||
286 | |||
287 | --- | ||
288 | |||
289 | **mandatory** | ||
290 | |||
291 | is_read_only() is gone; use bdev_read_only() instead. | ||
292 | |||
293 | --- | ||
294 | |||
295 | **mandatory** | ||
296 | |||
297 | destroy_buffers() is gone; use invalidate_bdev(). | ||
298 | |||
299 | --- | ||
300 | |||
301 | **mandatory** | ||
302 | |||
303 | fsync_dev() is gone; use fsync_bdev(). NOTE: lvm breakage is | ||
304 | deliberate; as soon as struct block_device * is propagated in a reasonable | ||
305 | way by that code fixing will become trivial; until then nothing can be | ||
306 | done. | ||
307 | |||
308 | **mandatory** | ||
309 | |||
310 | block truncatation on error exit from ->write_begin, and ->direct_IO | ||
311 | moved from generic methods (block_write_begin, cont_write_begin, | ||
312 | nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at | ||
313 | ext2_write_failed and callers for an example. | ||
314 | |||
315 | **mandatory** | ||
316 | |||
317 | ->truncate is gone. The whole truncate sequence needs to be | ||
318 | implemented in ->setattr, which is now mandatory for filesystems | ||
319 | implementing on-disk size changes. Start with a copy of the old inode_setattr | ||
320 | and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to | ||
321 | be in order of zeroing blocks using block_truncate_page or similar helpers, | ||
322 | size update and on finally on-disk truncation which should not fail. | ||
323 | setattr_prepare (which used to be inode_change_ok) now includes the size checks | ||
324 | for ATTR_SIZE and must be called in the beginning of ->setattr unconditionally. | ||
325 | |||
326 | **mandatory** | ||
327 | |||
328 | ->clear_inode() and ->delete_inode() are gone; ->evict_inode() should | ||
329 | be used instead. It gets called whenever the inode is evicted, whether it has | ||
330 | remaining links or not. Caller does *not* evict the pagecache or inode-associated | ||
331 | metadata buffers; the method has to use truncate_inode_pages_final() to get rid | ||
332 | of those. Caller makes sure async writeback cannot be running for the inode while | ||
333 | (or after) ->evict_inode() is called. | ||
334 | |||
335 | ->drop_inode() returns int now; it's called on final iput() with | ||
336 | inode->i_lock held and it returns true if filesystems wants the inode to be | ||
337 | dropped. As before, generic_drop_inode() is still the default and it's been | ||
338 | updated appropriately. generic_delete_inode() is also alive and it consists | ||
339 | simply of return 1. Note that all actual eviction work is done by caller after | ||
340 | ->drop_inode() returns. | ||
341 | |||
342 | As before, clear_inode() must be called exactly once on each call of | ||
343 | ->evict_inode() (as it used to be for each call of ->delete_inode()). Unlike | ||
344 | before, if you are using inode-associated metadata buffers (i.e. | ||
345 | mark_buffer_dirty_inode()), it's your responsibility to call | ||
346 | invalidate_inode_buffers() before clear_inode(). | ||
347 | |||
348 | NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out | ||
349 | if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput() | ||
350 | may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly | ||
351 | free the on-disk inode, you may end up doing that while ->write_inode() is writing | ||
352 | to it. | ||
353 | |||
354 | --- | ||
355 | |||
356 | **mandatory** | ||
357 | |||
358 | .d_delete() now only advises the dcache as to whether or not to cache | ||
359 | unreferenced dentries, and is now only called when the dentry refcount goes to | ||
360 | 0. Even on 0 refcount transition, it must be able to tolerate being called 0, | ||
361 | 1, or more times (eg. constant, idempotent). | ||
362 | |||
363 | --- | ||
364 | |||
365 | **mandatory** | ||
366 | |||
367 | .d_compare() calling convention and locking rules are significantly | ||
368 | changed. Read updated documentation in Documentation/filesystems/vfs.rst (and | ||
369 | look at examples of other filesystems) for guidance. | ||
370 | |||
371 | --- | ||
372 | |||
373 | **mandatory** | ||
374 | |||
375 | .d_hash() calling convention and locking rules are significantly | ||
376 | changed. Read updated documentation in Documentation/filesystems/vfs.rst (and | ||
377 | look at examples of other filesystems) for guidance. | ||
378 | |||
379 | --- | ||
380 | |||
381 | **mandatory** | ||
382 | |||
383 | dcache_lock is gone, replaced by fine grained locks. See fs/dcache.c | ||
384 | for details of what locks to replace dcache_lock with in order to protect | ||
385 | particular things. Most of the time, a filesystem only needs ->d_lock, which | ||
386 | protects *all* the dcache state of a given dentry. | ||
387 | |||
388 | --- | ||
389 | |||
390 | **mandatory** | ||
391 | |||
392 | Filesystems must RCU-free their inodes, if they can have been accessed | ||
393 | via rcu-walk path walk (basically, if the file can have had a path name in the | ||
394 | vfs namespace). | ||
395 | |||
396 | Even though i_dentry and i_rcu share storage in a union, we will | ||
397 | initialize the former in inode_init_always(), so just leave it alone in | ||
398 | the callback. It used to be necessary to clean it there, but not anymore | ||
399 | (starting at 3.2). | ||
400 | |||
401 | --- | ||
402 | |||
403 | **recommended** | ||
404 | |||
405 | vfs now tries to do path walking in "rcu-walk mode", which avoids | ||
406 | atomic operations and scalability hazards on dentries and inodes (see | ||
407 | Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes | ||
408 | (above) are examples of the changes required to support this. For more complex | ||
409 | filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so | ||
410 | no changes are required to the filesystem. However, this is costly and loses | ||
411 | the benefits of rcu-walk mode. We will begin to add filesystem callbacks that | ||
412 | are rcu-walk aware, shown below. Filesystems should take advantage of this | ||
413 | where possible. | ||
414 | |||
415 | --- | ||
416 | |||
417 | **mandatory** | ||
418 | |||
419 | d_revalidate is a callback that is made on every path element (if | ||
420 | the filesystem provides it), which requires dropping out of rcu-walk mode. This | ||
421 | may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be | ||
422 | returned if the filesystem cannot handle rcu-walk. See | ||
423 | Documentation/filesystems/vfs.rst for more details. | ||
424 | |||
425 | permission is an inode permission check that is called on many or all | ||
426 | directory inodes on the way down a path walk (to check for exec permission). It | ||
427 | must now be rcu-walk aware (mask & MAY_NOT_BLOCK). See | ||
428 | Documentation/filesystems/vfs.rst for more details. | ||
429 | |||
430 | --- | ||
431 | |||
432 | **mandatory** | ||
433 | |||
434 | In ->fallocate() you must check the mode option passed in. If your | ||
435 | filesystem does not support hole punching (deallocating space in the middle of a | ||
436 | file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode. | ||
437 | Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set, | ||
438 | so the i_size should not change when hole punching, even when puching the end of | ||
439 | a file off. | ||
440 | |||
441 | --- | ||
442 | |||
443 | **mandatory** | ||
444 | |||
445 | ->get_sb() is gone. Switch to use of ->mount(). Typically it's just | ||
446 | a matter of switching from calling ``get_sb_``... to ``mount_``... and changing | ||
447 | the function type. If you were doing it manually, just switch from setting | ||
448 | ->mnt_root to some pointer to returning that pointer. On errors return | ||
449 | ERR_PTR(...). | ||
450 | |||
451 | --- | ||
452 | |||
453 | **mandatory** | ||
454 | |||
455 | ->permission() and generic_permission()have lost flags | ||
456 | argument; instead of passing IPERM_FLAG_RCU we add MAY_NOT_BLOCK into mask. | ||
457 | |||
458 | generic_permission() has also lost the check_acl argument; ACL checking | ||
459 | has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl | ||
460 | to read an ACL from disk. | ||
461 | |||
462 | --- | ||
463 | |||
464 | **mandatory** | ||
465 | |||
466 | If you implement your own ->llseek() you must handle SEEK_HOLE and | ||
467 | SEEK_DATA. You can hanle this by returning -EINVAL, but it would be nicer to | ||
468 | support it in some way. The generic handler assumes that the entire file is | ||
469 | data and there is a virtual hole at the end of the file. So if the provided | ||
470 | offset is less than i_size and SEEK_DATA is specified, return the same offset. | ||
471 | If the above is true for the offset and you are given SEEK_HOLE, return the end | ||
472 | of the file. If the offset is i_size or greater return -ENXIO in either case. | ||
473 | |||
474 | **mandatory** | ||
475 | |||
476 | If you have your own ->fsync() you must make sure to call | ||
477 | filemap_write_and_wait_range() so that all dirty pages are synced out properly. | ||
478 | You must also keep in mind that ->fsync() is not called with i_mutex held | ||
479 | anymore, so if you require i_mutex locking you must make sure to take it and | ||
480 | release it yourself. | ||
481 | |||
482 | --- | ||
483 | |||
484 | **mandatory** | ||
485 | |||
486 | d_alloc_root() is gone, along with a lot of bugs caused by code | ||
487 | misusing it. Replacement: d_make_root(inode). On success d_make_root(inode) | ||
488 | allocates and returns a new dentry instantiated with the passed in inode. | ||
489 | On failure NULL is returned and the passed in inode is dropped so the reference | ||
490 | to inode is consumed in all cases and failure handling need not do any cleanup | ||
491 | for the inode. If d_make_root(inode) is passed a NULL inode it returns NULL | ||
492 | and also requires no further error handling. Typical usage is:: | ||
493 | |||
494 | inode = foofs_new_inode(....); | ||
495 | s->s_root = d_make_root(inode); | ||
496 | if (!s->s_root) | ||
497 | /* Nothing needed for the inode cleanup */ | ||
498 | return -ENOMEM; | ||
499 | ... | ||
500 | |||
501 | --- | ||
502 | |||
503 | **mandatory** | ||
504 | |||
505 | The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and | ||
506 | ->lookup() do *not* take struct nameidata anymore; just the flags. | ||
507 | |||
508 | --- | ||
509 | |||
510 | **mandatory** | ||
511 | |||
512 | ->create() doesn't take ``struct nameidata *``; unlike the previous | ||
513 | two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that | ||
514 | local filesystems can ignore tha argument - they are guaranteed that the | ||
515 | object doesn't exist. It's remote/distributed ones that might care... | ||
516 | |||
517 | --- | ||
518 | |||
519 | **mandatory** | ||
520 | |||
521 | FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate() | ||
522 | in your dentry operations instead. | ||
523 | |||
524 | --- | ||
525 | |||
526 | **mandatory** | ||
527 | |||
528 | vfs_readdir() is gone; switch to iterate_dir() instead | ||
529 | |||
530 | --- | ||
531 | |||
532 | **mandatory** | ||
533 | |||
534 | ->readdir() is gone now; switch to ->iterate() | ||
535 | |||
536 | **mandatory** | ||
537 | |||
538 | vfs_follow_link has been removed. Filesystems must use nd_set_link | ||
539 | from ->follow_link for normal symlinks, or nd_jump_link for magic | ||
540 | /proc/<pid> style links. | ||
541 | |||
542 | --- | ||
543 | |||
544 | **mandatory** | ||
545 | |||
546 | iget5_locked()/ilookup5()/ilookup5_nowait() test() callback used to be | ||
547 | called with both ->i_lock and inode_hash_lock held; the former is *not* | ||
548 | taken anymore, so verify that your callbacks do not rely on it (none | ||
549 | of the in-tree instances did). inode_hash_lock is still held, | ||
550 | of course, so they are still serialized wrt removal from inode hash, | ||
551 | as well as wrt set() callback of iget5_locked(). | ||
552 | |||
553 | --- | ||
554 | |||
555 | **mandatory** | ||
556 | |||
557 | d_materialise_unique() is gone; d_splice_alias() does everything you | ||
558 | need now. Remember that they have opposite orders of arguments ;-/ | ||
559 | |||
560 | --- | ||
561 | |||
562 | **mandatory** | ||
563 | |||
564 | f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid | ||
565 | it entirely. | ||
566 | |||
567 | --- | ||
568 | |||
569 | **mandatory** | ||
570 | |||
571 | never call ->read() and ->write() directly; use __vfs_{read,write} or | ||
572 | wrappers; instead of checking for ->write or ->read being NULL, look for | ||
573 | FMODE_CAN_{WRITE,READ} in file->f_mode. | ||
574 | |||
575 | --- | ||
576 | |||
577 | **mandatory** | ||
578 | |||
579 | do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL | ||
580 | instead. | ||
581 | |||
582 | --- | ||
583 | |||
584 | **mandatory** | ||
585 | ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter. | ||
586 | |||
587 | --- | ||
588 | |||
589 | **recommended** | ||
590 | |||
591 | for embedded ("fast") symlinks just set inode->i_link to wherever the | ||
592 | symlink body is and use simple_follow_link() as ->follow_link(). | ||
593 | |||
594 | --- | ||
595 | |||
596 | **mandatory** | ||
597 | |||
598 | calling conventions for ->follow_link() have changed. Instead of returning | ||
599 | cookie and using nd_set_link() to store the body to traverse, we return | ||
600 | the body to traverse and store the cookie using explicit void ** argument. | ||
601 | nameidata isn't passed at all - nd_jump_link() doesn't need it and | ||
602 | nd_[gs]et_link() is gone. | ||
603 | |||
604 | --- | ||
605 | |||
606 | **mandatory** | ||
607 | |||
608 | calling conventions for ->put_link() have changed. It gets inode instead of | ||
609 | dentry, it does not get nameidata at all and it gets called only when cookie | ||
610 | is non-NULL. Note that link body isn't available anymore, so if you need it, | ||
611 | store it as cookie. | ||
612 | |||
613 | --- | ||
614 | |||
615 | **mandatory** | ||
616 | |||
617 | any symlink that might use page_follow_link_light/page_put_link() must | ||
618 | have inode_nohighmem(inode) called before anything might start playing with | ||
619 | its pagecache. No highmem pages should end up in the pagecache of such | ||
620 | symlinks. That includes any preseeding that might be done during symlink | ||
621 | creation. __page_symlink() will honour the mapping gfp flags, so once | ||
622 | you've done inode_nohighmem() it's safe to use, but if you allocate and | ||
623 | insert the page manually, make sure to use the right gfp flags. | ||
624 | |||
625 | --- | ||
626 | |||
627 | **mandatory** | ||
628 | |||
629 | ->follow_link() is replaced with ->get_link(); same API, except that | ||
630 | |||
631 | * ->get_link() gets inode as a separate argument | ||
632 | * ->get_link() may be called in RCU mode - in that case NULL | ||
633 | dentry is passed | ||
634 | |||
635 | --- | ||
636 | |||
637 | **mandatory** | ||
638 | |||
639 | ->get_link() gets struct delayed_call ``*done`` now, and should do | ||
640 | set_delayed_call() where it used to set ``*cookie``. | ||
641 | |||
642 | ->put_link() is gone - just give the destructor to set_delayed_call() | ||
643 | in ->get_link(). | ||
644 | |||
645 | --- | ||
646 | |||
647 | **mandatory** | ||
648 | |||
649 | ->getxattr() and xattr_handler.get() get dentry and inode passed separately. | ||
650 | dentry might be yet to be attached to inode, so do _not_ use its ->d_inode | ||
651 | in the instances. Rationale: !@#!@# security_d_instantiate() needs to be | ||
652 | called before we attach dentry to inode. | ||
653 | |||
654 | --- | ||
655 | |||
656 | **mandatory** | ||
657 | |||
658 | symlinks are no longer the only inodes that do *not* have i_bdev/i_cdev/ | ||
659 | i_pipe/i_link union zeroed out at inode eviction. As the result, you can't | ||
660 | assume that non-NULL value in ->i_nlink at ->destroy_inode() implies that | ||
661 | it's a symlink. Checking ->i_mode is really needed now. In-tree we had | ||
662 | to fix shmem_destroy_callback() that used to take that kind of shortcut; | ||
663 | watch out, since that shortcut is no longer valid. | ||
664 | |||
665 | --- | ||
666 | |||
667 | **mandatory** | ||
668 | |||
669 | ->i_mutex is replaced with ->i_rwsem now. inode_lock() et.al. work as | ||
670 | they used to - they just take it exclusive. However, ->lookup() may be | ||
671 | called with parent locked shared. Its instances must not | ||
672 | |||
673 | * use d_instantiate) and d_rehash() separately - use d_add() or | ||
674 | d_splice_alias() instead. | ||
675 | * use d_rehash() alone - call d_add(new_dentry, NULL) instead. | ||
676 | * in the unlikely case when (read-only) access to filesystem | ||
677 | data structures needs exclusion for some reason, arrange it | ||
678 | yourself. None of the in-tree filesystems needed that. | ||
679 | * rely on ->d_parent and ->d_name not changing after dentry has | ||
680 | been fed to d_add() or d_splice_alias(). Again, none of the | ||
681 | in-tree instances relied upon that. | ||
682 | |||
683 | We are guaranteed that lookups of the same name in the same directory | ||
684 | will not happen in parallel ("same" in the sense of your ->d_compare()). | ||
685 | Lookups on different names in the same directory can and do happen in | ||
686 | parallel now. | ||
687 | |||
688 | --- | ||
689 | |||
690 | **recommended** | ||
691 | |||
692 | ->iterate_shared() is added; it's a parallel variant of ->iterate(). | ||
693 | Exclusion on struct file level is still provided (as well as that | ||
694 | between it and lseek on the same struct file), but if your directory | ||
695 | has been opened several times, you can get these called in parallel. | ||
696 | Exclusion between that method and all directory-modifying ones is | ||
697 | still provided, of course. | ||
698 | |||
699 | Often enough ->iterate() can serve as ->iterate_shared() without any | ||
700 | changes - it is a read-only operation, after all. If you have any | ||
701 | per-inode or per-dentry in-core data structures modified by ->iterate(), | ||
702 | you might need something to serialize the access to them. If you | ||
703 | do dcache pre-seeding, you'll need to switch to d_alloc_parallel() for | ||
704 | that; look for in-tree examples. | ||
705 | |||
706 | Old method is only used if the new one is absent; eventually it will | ||
707 | be removed. Switch while you still can; the old one won't stay. | ||
708 | |||
709 | --- | ||
710 | |||
711 | **mandatory** | ||
712 | |||
713 | ->atomic_open() calls without O_CREAT may happen in parallel. | ||
714 | |||
715 | --- | ||
716 | |||
717 | **mandatory** | ||
718 | |||
719 | ->setxattr() and xattr_handler.set() get dentry and inode passed separately. | ||
720 | dentry might be yet to be attached to inode, so do _not_ use its ->d_inode | ||
721 | in the instances. Rationale: !@#!@# security_d_instantiate() needs to be | ||
722 | called before we attach dentry to inode and !@#!@##!@$!$#!@#$!@$!@$ smack | ||
723 | ->d_instantiate() uses not just ->getxattr() but ->setxattr() as well. | ||
724 | |||
725 | --- | ||
726 | |||
727 | **mandatory** | ||
728 | |||
729 | ->d_compare() doesn't get parent as a separate argument anymore. If you | ||
730 | used it for finding the struct super_block involved, dentry->d_sb will | ||
731 | work just as well; if it's something more complicated, use dentry->d_parent. | ||
732 | Just be careful not to assume that fetching it more than once will yield | ||
733 | the same value - in RCU mode it could change under you. | ||
734 | |||
735 | --- | ||
736 | |||
737 | **mandatory** | ||
738 | |||
739 | ->rename() has an added flags argument. Any flags not handled by the | ||
740 | filesystem should result in EINVAL being returned. | ||
741 | |||
742 | --- | ||
743 | |||
744 | |||
745 | **recommended** | ||
746 | |||
747 | ->readlink is optional for symlinks. Don't set, unless filesystem needs | ||
748 | to fake something for readlink(2). | ||
749 | |||
750 | --- | ||
751 | |||
752 | **mandatory** | ||
753 | |||
754 | ->getattr() is now passed a struct path rather than a vfsmount and | ||
755 | dentry separately, and it now has request_mask and query_flags arguments | ||
756 | to specify the fields and sync type requested by statx. Filesystems not | ||
757 | supporting any statx-specific features may ignore the new arguments. | ||
758 | |||
759 | --- | ||
760 | |||
761 | **mandatory** | ||
762 | |||
763 | ->atomic_open() calling conventions have changed. Gone is ``int *opened``, | ||
764 | along with FILE_OPENED/FILE_CREATED. In place of those we have | ||
765 | FMODE_OPENED/FMODE_CREATED, set in file->f_mode. Additionally, return | ||
766 | value for 'called finish_no_open(), open it yourself' case has become | ||
767 | 0, not 1. Since finish_no_open() itself is returning 0 now, that part | ||
768 | does not need any changes in ->atomic_open() instances. | ||
769 | |||
770 | --- | ||
771 | |||
772 | **mandatory** | ||
773 | |||
774 | alloc_file() has become static now; two wrappers are to be used instead. | ||
775 | alloc_file_pseudo(inode, vfsmount, name, flags, ops) is for the cases | ||
776 | when dentry needs to be created; that's the majority of old alloc_file() | ||
777 | users. Calling conventions: on success a reference to new struct file | ||
778 | is returned and callers reference to inode is subsumed by that. On | ||
779 | failure, ERR_PTR() is returned and no caller's references are affected, | ||
780 | so the caller needs to drop the inode reference it held. | ||
781 | alloc_file_clone(file, flags, ops) does not affect any caller's references. | ||
782 | On success you get a new struct file sharing the mount/dentry with the | ||
783 | original, on failure - ERR_PTR(). | ||
784 | |||
785 | --- | ||
786 | |||
787 | **mandatory** | ||
788 | |||
789 | ->clone_file_range() and ->dedupe_file_range have been replaced with | ||
790 | ->remap_file_range(). See Documentation/filesystems/vfs.rst for more | ||
791 | information. | ||
792 | |||
793 | --- | ||
794 | |||
795 | **recommended** | ||
796 | |||
797 | ->lookup() instances doing an equivalent of:: | ||
798 | |||
799 | if (IS_ERR(inode)) | ||
800 | return ERR_CAST(inode); | ||
801 | return d_splice_alias(inode, dentry); | ||
802 | |||
803 | don't need to bother with the check - d_splice_alias() will do the | ||
804 | right thing when given ERR_PTR(...) as inode. Moreover, passing NULL | ||
805 | inode to d_splice_alias() will also do the right thing (equivalent of | ||
806 | d_add(dentry, NULL); return NULL;), so that kind of special cases | ||
807 | also doesn't need a separate treatment. | ||
808 | |||
809 | --- | ||
810 | |||
811 | **strongly recommended** | ||
812 | |||
813 | take the RCU-delayed parts of ->destroy_inode() into a new method - | ||
814 | ->free_inode(). If ->destroy_inode() becomes empty - all the better, | ||
815 | just get rid of it. Synchronous work (e.g. the stuff that can't | ||
816 | be done from an RCU callback, or any WARN_ON() where we want the | ||
817 | stack trace) *might* be movable to ->evict_inode(); however, | ||
818 | that goes only for the things that are not needed to balance something | ||
819 | done by ->alloc_inode(). IOW, if it's cleaning up the stuff that | ||
820 | might have accumulated over the life of in-core inode, ->evict_inode() | ||
821 | might be a fit. | ||
822 | |||
823 | Rules for inode destruction: | ||
824 | |||
825 | * if ->destroy_inode() is non-NULL, it gets called | ||
826 | * if ->free_inode() is non-NULL, it gets scheduled by call_rcu() | ||
827 | * combination of NULL ->destroy_inode and NULL ->free_inode is | ||
828 | treated as NULL/free_inode_nonrcu, to preserve the compatibility. | ||
829 | |||
830 | Note that the callback (be it via ->free_inode() or explicit call_rcu() | ||
831 | in ->destroy_inode()) is *NOT* ordered wrt superblock destruction; | ||
832 | as the matter of fact, the superblock and all associated structures | ||
833 | might be already gone. The filesystem driver is guaranteed to be still | ||
834 | there, but that's it. Freeing memory in the callback is fine; doing | ||
835 | more than that is possible, but requires a lot of care and is best | ||
836 | avoided. | ||
837 | |||
838 | --- | ||
839 | |||
840 | **mandatory** | ||
841 | |||
842 | DCACHE_RCUACCESS is gone; having an RCU delay on dentry freeing is the | ||
843 | default. DCACHE_NORCU opts out, and only d_alloc_pseudo() has any | ||
844 | business doing so. | ||
845 | |||
846 | --- | ||
847 | |||
848 | **mandatory** | ||
849 | |||
850 | d_alloc_pseudo() is internal-only; uses outside of alloc_file_pseudo() are | ||
851 | very suspect (and won't work in modules). Such uses are very likely to | ||
852 | be misspelled d_alloc_anon(). | ||
diff --git a/Documentation/filesystems/ubifs-authentication.md b/Documentation/filesystems/ubifs-authentication.rst index 23e698167141..6a9584f6ff46 100644 --- a/Documentation/filesystems/ubifs-authentication.md +++ b/Documentation/filesystems/ubifs-authentication.rst | |||
@@ -1,8 +1,11 @@ | |||
1 | % UBIFS Authentication | 1 | :orphan: |
2 | % sigma star gmbh | ||
3 | % 2018 | ||
4 | 2 | ||
5 | # Introduction | 3 | .. UBIFS Authentication |
4 | .. sigma star gmbh | ||
5 | .. 2018 | ||
6 | |||
7 | Introduction | ||
8 | ============ | ||
6 | 9 | ||
7 | UBIFS utilizes the fscrypt framework to provide confidentiality for file | 10 | UBIFS utilizes the fscrypt framework to provide confidentiality for file |
8 | contents and file names. This prevents attacks where an attacker is able to | 11 | contents and file names. This prevents attacks where an attacker is able to |
@@ -33,7 +36,8 @@ existing features like key derivation can be utilized. It should however also | |||
33 | be possible to use UBIFS authentication without using encryption. | 36 | be possible to use UBIFS authentication without using encryption. |
34 | 37 | ||
35 | 38 | ||
36 | ## MTD, UBI & UBIFS | 39 | MTD, UBI & UBIFS |
40 | ---------------- | ||
37 | 41 | ||
38 | On Linux, the MTD (Memory Technology Devices) subsystem provides a uniform | 42 | On Linux, the MTD (Memory Technology Devices) subsystem provides a uniform |
39 | interface to access raw flash devices. One of the more prominent subsystems that | 43 | interface to access raw flash devices. One of the more prominent subsystems that |
@@ -47,7 +51,7 @@ UBIFS is a filesystem for raw flash which operates on top of UBI. Thus, wear | |||
47 | leveling and some flash specifics are left to UBI, while UBIFS focuses on | 51 | leveling and some flash specifics are left to UBI, while UBIFS focuses on |
48 | scalability, performance and recoverability. | 52 | scalability, performance and recoverability. |
49 | 53 | ||
50 | 54 | :: | |
51 | 55 | ||
52 | +------------+ +*******+ +-----------+ +-----+ | 56 | +------------+ +*******+ +-----------+ +-----+ |
53 | | | * UBIFS * | UBI-BLOCK | | ... | | 57 | | | * UBIFS * | UBI-BLOCK | | ... | |
@@ -84,7 +88,8 @@ persisted onto the flash directly. More details on UBIFS can also be found in | |||
84 | [UBIFS-WP]. | 88 | [UBIFS-WP]. |
85 | 89 | ||
86 | 90 | ||
87 | ### UBIFS Index & Tree Node Cache | 91 | UBIFS Index & Tree Node Cache |
92 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
88 | 93 | ||
89 | Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types | 94 | Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types |
90 | of nodes. Eg. data nodes (`struct ubifs_data_node`) which store chunks of file | 95 | of nodes. Eg. data nodes (`struct ubifs_data_node`) which store chunks of file |
@@ -118,17 +123,18 @@ on-flash filesystem structures like the index. On every commit, the TNC nodes | |||
118 | marked as dirty are written to the flash to update the persisted index. | 123 | marked as dirty are written to the flash to update the persisted index. |
119 | 124 | ||
120 | 125 | ||
121 | ### Journal | 126 | Journal |
127 | ~~~~~~~ | ||
122 | 128 | ||
123 | To avoid wearing out the flash, the index is only persisted (*commited*) when | 129 | To avoid wearing out the flash, the index is only persisted (*commited*) when |
124 | certain conditions are met (eg. `fsync(2)`). The journal is used to record | 130 | certain conditions are met (eg. ``fsync(2)``). The journal is used to record |
125 | any changes (in form of inode nodes, data nodes etc.) between commits | 131 | any changes (in form of inode nodes, data nodes etc.) between commits |
126 | of the index. During mount, the journal is read from the flash and replayed | 132 | of the index. During mount, the journal is read from the flash and replayed |
127 | onto the TNC (which will be created on-demand from the on-flash index). | 133 | onto the TNC (which will be created on-demand from the on-flash index). |
128 | 134 | ||
129 | UBIFS reserves a bunch of LEBs just for the journal called *log area*. The | 135 | UBIFS reserves a bunch of LEBs just for the journal called *log area*. The |
130 | amount of log area LEBs is configured on filesystem creation (using | 136 | amount of log area LEBs is configured on filesystem creation (using |
131 | `mkfs.ubifs`) and stored in the superblock node. The log area contains only | 137 | ``mkfs.ubifs``) and stored in the superblock node. The log area contains only |
132 | two types of nodes: *reference nodes* and *commit start nodes*. A commit start | 138 | two types of nodes: *reference nodes* and *commit start nodes*. A commit start |
133 | node is written whenever an index commit is performed. Reference nodes are | 139 | node is written whenever an index commit is performed. Reference nodes are |
134 | written on every journal update. Each reference node points to the position of | 140 | written on every journal update. Each reference node points to the position of |
@@ -152,6 +158,7 @@ done for the last referenced LEB of the journal. Only this can become corrupt | |||
152 | because of a power cut. If the recovery fails, UBIFS will not mount. An error | 158 | because of a power cut. If the recovery fails, UBIFS will not mount. An error |
153 | for every other LEB will directly cause UBIFS to fail the mount operation. | 159 | for every other LEB will directly cause UBIFS to fail the mount operation. |
154 | 160 | ||
161 | :: | ||
155 | 162 | ||
156 | | ---- LOG AREA ---- | ---------- MAIN AREA ------------ | | 163 | | ---- LOG AREA ---- | ---------- MAIN AREA ------------ | |
157 | 164 | ||
@@ -172,10 +179,11 @@ for every other LEB will directly cause UBIFS to fail the mount operation. | |||
172 | containing their buds | 179 | containing their buds |
173 | 180 | ||
174 | 181 | ||
175 | ### LEB Property Tree/Table | 182 | LEB Property Tree/Table |
183 | ~~~~~~~~~~~~~~~~~~~~~~~ | ||
176 | 184 | ||
177 | The LEB property tree is used to store per-LEB information. This includes the | 185 | The LEB property tree is used to store per-LEB information. This includes the |
178 | LEB type and amount of free and *dirty* (old, obsolete content) space [1] on | 186 | LEB type and amount of free and *dirty* (old, obsolete content) space [1]_ on |
179 | the LEB. The type is important, because UBIFS never mixes index nodes with data | 187 | the LEB. The type is important, because UBIFS never mixes index nodes with data |
180 | nodes on a single LEB and thus each LEB has a specific purpose. This again is | 188 | nodes on a single LEB and thus each LEB has a specific purpose. This again is |
181 | useful for free space calculations. See [UBIFS-WP] for more details. | 189 | useful for free space calculations. See [UBIFS-WP] for more details. |
@@ -185,19 +193,21 @@ index. Due to its smaller size it is always written as one chunk on every | |||
185 | commit. Thus, saving the LPT is an atomic operation. | 193 | commit. Thus, saving the LPT is an atomic operation. |
186 | 194 | ||
187 | 195 | ||
188 | [1] Since LEBs can only be appended and never overwritten, there is a | 196 | .. [1] Since LEBs can only be appended and never overwritten, there is a |
189 | difference between free space ie. the remaining space left on the LEB to be | 197 | difference between free space ie. the remaining space left on the LEB to be |
190 | written to without erasing it and previously written content that is obsolete | 198 | written to without erasing it and previously written content that is obsolete |
191 | but can't be overwritten without erasing the full LEB. | 199 | but can't be overwritten without erasing the full LEB. |
192 | 200 | ||
193 | 201 | ||
194 | # UBIFS Authentication | 202 | UBIFS Authentication |
203 | ==================== | ||
195 | 204 | ||
196 | This chapter introduces UBIFS authentication which enables UBIFS to verify | 205 | This chapter introduces UBIFS authentication which enables UBIFS to verify |
197 | the authenticity and integrity of metadata and file contents stored on flash. | 206 | the authenticity and integrity of metadata and file contents stored on flash. |
198 | 207 | ||
199 | 208 | ||
200 | ## Threat Model | 209 | Threat Model |
210 | ------------ | ||
201 | 211 | ||
202 | UBIFS authentication enables detection of offline data modification. While it | 212 | UBIFS authentication enables detection of offline data modification. While it |
203 | does not prevent it, it enables (trusted) code to check the integrity and | 213 | does not prevent it, it enables (trusted) code to check the integrity and |
@@ -224,7 +234,8 @@ Additional measures like secure boot and trusted boot have to be taken to | |||
224 | ensure that only trusted code is executed on a device. | 234 | ensure that only trusted code is executed on a device. |
225 | 235 | ||
226 | 236 | ||
227 | ## Authentication | 237 | Authentication |
238 | -------------- | ||
228 | 239 | ||
229 | To be able to fully trust data read from flash, all UBIFS data structures | 240 | To be able to fully trust data read from flash, all UBIFS data structures |
230 | stored on flash are authenticated. That is: | 241 | stored on flash are authenticated. That is: |
@@ -236,7 +247,8 @@ stored on flash are authenticated. That is: | |||
236 | - The LPT which stores UBI LEB metadata which UBIFS uses for free space accounting | 247 | - The LPT which stores UBI LEB metadata which UBIFS uses for free space accounting |
237 | 248 | ||
238 | 249 | ||
239 | ### Index Authentication | 250 | Index Authentication |
251 | ~~~~~~~~~~~~~~~~~~~~ | ||
240 | 252 | ||
241 | Through UBIFS' concept of a wandering tree, it already takes care of only | 253 | Through UBIFS' concept of a wandering tree, it already takes care of only |
242 | updating and persisting changed parts from leaf node up to the root node | 254 | updating and persisting changed parts from leaf node up to the root node |
@@ -260,6 +272,7 @@ include a hash. All other types of nodes will remain unchanged. This reduces | |||
260 | the storage overhead which is precious for users of UBIFS (ie. embedded | 272 | the storage overhead which is precious for users of UBIFS (ie. embedded |
261 | devices). | 273 | devices). |
262 | 274 | ||
275 | :: | ||
263 | 276 | ||
264 | +---------------+ | 277 | +---------------+ |
265 | | Master Node | | 278 | | Master Node | |
@@ -303,7 +316,8 @@ hashes to index nodes does not change this since each hash will be persisted | |||
303 | atomically together with its respective node. | 316 | atomically together with its respective node. |
304 | 317 | ||
305 | 318 | ||
306 | ### Journal Authentication | 319 | Journal Authentication |
320 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
307 | 321 | ||
308 | The journal is authenticated too. Since the journal is continuously written | 322 | The journal is authenticated too. Since the journal is continuously written |
309 | it is necessary to also add authentication information frequently to the | 323 | it is necessary to also add authentication information frequently to the |
@@ -316,7 +330,7 @@ of the hash chain. That way a journal can be authenticated up to the last | |||
316 | authentication node. The tail of the journal which may not have a authentication | 330 | authentication node. The tail of the journal which may not have a authentication |
317 | node cannot be authenticated and is skipped during journal replay. | 331 | node cannot be authenticated and is skipped during journal replay. |
318 | 332 | ||
319 | We get this picture for journal authentication: | 333 | We get this picture for journal authentication:: |
320 | 334 | ||
321 | ,,,,,,,, | 335 | ,,,,,,,, |
322 | ,......,........................................... | 336 | ,......,........................................... |
@@ -352,7 +366,8 @@ the superblock struct. The superblock node is stored in LEB 0 and is only | |||
352 | modified on feature flag or similar changes, but never on file changes. | 366 | modified on feature flag or similar changes, but never on file changes. |
353 | 367 | ||
354 | 368 | ||
355 | ### LPT Authentication | 369 | LPT Authentication |
370 | ~~~~~~~~~~~~~~~~~~ | ||
356 | 371 | ||
357 | The location of the LPT root node on the flash is stored in the UBIFS master | 372 | The location of the LPT root node on the flash is stored in the UBIFS master |
358 | node. Since the LPT is written and read atomically on every commit, there is | 373 | node. Since the LPT is written and read atomically on every commit, there is |
@@ -363,7 +378,8 @@ be verified by verifying the authenticity of the master node and comparing the | |||
363 | LTP hash stored there with the hash computed from the read on-flash LPT. | 378 | LTP hash stored there with the hash computed from the read on-flash LPT. |
364 | 379 | ||
365 | 380 | ||
366 | ## Key Management | 381 | Key Management |
382 | -------------- | ||
367 | 383 | ||
368 | For simplicity, UBIFS authentication uses a single key to compute the HMACs | 384 | For simplicity, UBIFS authentication uses a single key to compute the HMACs |
369 | of superblock, master, commit start and reference nodes. This key has to be | 385 | of superblock, master, commit start and reference nodes. This key has to be |
@@ -399,7 +415,8 @@ approach is similar to the approach proposed for fscrypt encryption policy v2 | |||
399 | [FSCRYPT-POLICY2]. | 415 | [FSCRYPT-POLICY2]. |
400 | 416 | ||
401 | 417 | ||
402 | # Future Extensions | 418 | Future Extensions |
419 | ================= | ||
403 | 420 | ||
404 | In certain cases where a vendor wants to provide an authenticated filesystem | 421 | In certain cases where a vendor wants to provide an authenticated filesystem |
405 | image to customers, it should be possible to do so without sharing the secret | 422 | image to customers, it should be possible to do so without sharing the secret |
@@ -411,7 +428,8 @@ to the way the IMA/EVM subsystem deals with such situations. The HMAC key | |||
411 | will then have to be provided beforehand in the normal way. | 428 | will then have to be provided beforehand in the normal way. |
412 | 429 | ||
413 | 430 | ||
414 | # References | 431 | References |
432 | ========== | ||
415 | 433 | ||
416 | [CRYPTSETUP2] http://www.saout.de/pipermail/dm-crypt/2017-November/005745.html | 434 | [CRYPTSETUP2] http://www.saout.de/pipermail/dm-crypt/2017-November/005745.html |
417 | 435 | ||
diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index 0f85ab21c2ca..7d4d09dd5e6d 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst | |||
@@ -20,7 +20,7 @@ kernel which allows different filesystem implementations to coexist. | |||
20 | 20 | ||
21 | VFS system calls open(2), stat(2), read(2), write(2), chmod(2) and so on | 21 | VFS system calls open(2), stat(2), read(2), write(2), chmod(2) and so on |
22 | are called from a process context. Filesystem locking is described in | 22 | are called from a process context. Filesystem locking is described in |
23 | the document Documentation/filesystems/Locking. | 23 | the document Documentation/filesystems/locking.rst. |
24 | 24 | ||
25 | 25 | ||
26 | Directory Entry Cache (dcache) | 26 | Directory Entry Cache (dcache) |
diff --git a/Documentation/hwmon/adm1021.rst b/Documentation/hwmon/adm1021.rst index 6cbb0f75fe00..116fb2019956 100644 --- a/Documentation/hwmon/adm1021.rst +++ b/Documentation/hwmon/adm1021.rst | |||
@@ -142,7 +142,7 @@ loading the adm1021 module, then things are good. | |||
142 | If nothing happens when loading the adm1021 module, and you are certain | 142 | If nothing happens when loading the adm1021 module, and you are certain |
143 | that your specific Xeon processor model includes compatible sensors, you | 143 | that your specific Xeon processor model includes compatible sensors, you |
144 | will have to explicitly instantiate the sensor chips from user-space. See | 144 | will have to explicitly instantiate the sensor chips from user-space. See |
145 | method 4 in Documentation/i2c/instantiating-devices. Possible slave | 145 | method 4 in Documentation/i2c/instantiating-devices.rst. Possible slave |
146 | addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that | 146 | addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that |
147 | only temp2 will be correct and temp1 will have to be ignored. | 147 | only temp2 will be correct and temp1 will have to be ignored. |
148 | 148 | ||
diff --git a/Documentation/hwmon/adm1275.rst b/Documentation/hwmon/adm1275.rst index 9a1913e5b4d9..49966ed70ec6 100644 --- a/Documentation/hwmon/adm1275.rst +++ b/Documentation/hwmon/adm1275.rst | |||
@@ -75,7 +75,7 @@ Usage Notes | |||
75 | ----------- | 75 | ----------- |
76 | 76 | ||
77 | This driver does not auto-detect devices. You will have to instantiate the | 77 | This driver does not auto-detect devices. You will have to instantiate the |
78 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 78 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
79 | details. | 79 | details. |
80 | 80 | ||
81 | The ADM1075, unlike many other PMBus devices, does not support internal voltage | 81 | The ADM1075, unlike many other PMBus devices, does not support internal voltage |
diff --git a/Documentation/hwmon/hih6130.rst b/Documentation/hwmon/hih6130.rst index 649bd4be4fc2..e95d373eb693 100644 --- a/Documentation/hwmon/hih6130.rst +++ b/Documentation/hwmon/hih6130.rst | |||
@@ -27,7 +27,7 @@ The devices communicate with the I2C protocol. All sensors are set to the same | |||
27 | I2C address 0x27 by default, so an entry with I2C_BOARD_INFO("hih6130", 0x27) | 27 | I2C address 0x27 by default, so an entry with I2C_BOARD_INFO("hih6130", 0x27) |
28 | can be used in the board setup code. | 28 | can be used in the board setup code. |
29 | 29 | ||
30 | Please see Documentation/i2c/instantiating-devices for details on how to | 30 | Please see Documentation/i2c/instantiating-devices.rst for details on how to |
31 | instantiate I2C devices. | 31 | instantiate I2C devices. |
32 | 32 | ||
33 | sysfs-Interface | 33 | sysfs-Interface |
diff --git a/Documentation/hwmon/ibm-cffps.rst b/Documentation/hwmon/ibm-cffps.rst index 52e74e39463a..ef8f3f806968 100644 --- a/Documentation/hwmon/ibm-cffps.rst +++ b/Documentation/hwmon/ibm-cffps.rst | |||
@@ -17,7 +17,7 @@ Usage Notes | |||
17 | ----------- | 17 | ----------- |
18 | 18 | ||
19 | This driver does not auto-detect devices. You will have to instantiate the | 19 | This driver does not auto-detect devices. You will have to instantiate the |
20 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 20 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
21 | details. | 21 | details. |
22 | 22 | ||
23 | Sysfs entries | 23 | Sysfs entries |
diff --git a/Documentation/hwmon/lm25066.rst b/Documentation/hwmon/lm25066.rst index da15e3094c8c..30e6e77fb3c8 100644 --- a/Documentation/hwmon/lm25066.rst +++ b/Documentation/hwmon/lm25066.rst | |||
@@ -76,7 +76,7 @@ Usage Notes | |||
76 | ----------- | 76 | ----------- |
77 | 77 | ||
78 | This driver does not auto-detect devices. You will have to instantiate the | 78 | This driver does not auto-detect devices. You will have to instantiate the |
79 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 79 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
80 | details. | 80 | details. |
81 | 81 | ||
82 | 82 | ||
diff --git a/Documentation/hwmon/max16064.rst b/Documentation/hwmon/max16064.rst index 6d5e9538991f..c06249292557 100644 --- a/Documentation/hwmon/max16064.rst +++ b/Documentation/hwmon/max16064.rst | |||
@@ -28,7 +28,7 @@ Usage Notes | |||
28 | ----------- | 28 | ----------- |
29 | 29 | ||
30 | This driver does not auto-detect devices. You will have to instantiate the | 30 | This driver does not auto-detect devices. You will have to instantiate the |
31 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 31 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
32 | details. | 32 | details. |
33 | 33 | ||
34 | 34 | ||
diff --git a/Documentation/hwmon/max16065.rst b/Documentation/hwmon/max16065.rst index fa5c852a178c..45f69f334f25 100644 --- a/Documentation/hwmon/max16065.rst +++ b/Documentation/hwmon/max16065.rst | |||
@@ -79,7 +79,7 @@ Usage Notes | |||
79 | 79 | ||
80 | This driver does not probe for devices, since there is no register which | 80 | This driver does not probe for devices, since there is no register which |
81 | can be safely used to identify the chip. You will have to instantiate | 81 | can be safely used to identify the chip. You will have to instantiate |
82 | the devices explicitly. Please see Documentation/i2c/instantiating-devices for | 82 | the devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
83 | details. | 83 | details. |
84 | 84 | ||
85 | WARNING: Do not access chip registers using the i2cdump command, and do not use | 85 | WARNING: Do not access chip registers using the i2cdump command, and do not use |
diff --git a/Documentation/hwmon/max20751.rst b/Documentation/hwmon/max20751.rst index aa4469be6674..fe701e07eaf5 100644 --- a/Documentation/hwmon/max20751.rst +++ b/Documentation/hwmon/max20751.rst | |||
@@ -30,7 +30,7 @@ Usage Notes | |||
30 | ----------- | 30 | ----------- |
31 | 31 | ||
32 | This driver does not auto-detect devices. You will have to instantiate the | 32 | This driver does not auto-detect devices. You will have to instantiate the |
33 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 33 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
34 | details. | 34 | details. |
35 | 35 | ||
36 | 36 | ||
diff --git a/Documentation/hwmon/max34440.rst b/Documentation/hwmon/max34440.rst index 939138e12b02..5744df100a5d 100644 --- a/Documentation/hwmon/max34440.rst +++ b/Documentation/hwmon/max34440.rst | |||
@@ -83,7 +83,7 @@ Usage Notes | |||
83 | ----------- | 83 | ----------- |
84 | 84 | ||
85 | This driver does not auto-detect devices. You will have to instantiate the | 85 | This driver does not auto-detect devices. You will have to instantiate the |
86 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 86 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
87 | details. | 87 | details. |
88 | 88 | ||
89 | For MAX34446, the value of the currX_crit attribute determines if current or | 89 | For MAX34446, the value of the currX_crit attribute determines if current or |
diff --git a/Documentation/hwmon/max6650.rst b/Documentation/hwmon/max6650.rst index 253482add082..7952b6ecaa2d 100644 --- a/Documentation/hwmon/max6650.rst +++ b/Documentation/hwmon/max6650.rst | |||
@@ -55,7 +55,7 @@ Usage notes | |||
55 | ----------- | 55 | ----------- |
56 | 56 | ||
57 | This driver does not auto-detect devices. You will have to instantiate the | 57 | This driver does not auto-detect devices. You will have to instantiate the |
58 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 58 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
59 | details. | 59 | details. |
60 | 60 | ||
61 | Module parameters | 61 | Module parameters |
diff --git a/Documentation/hwmon/max8688.rst b/Documentation/hwmon/max8688.rst index 009487759c61..71e7f2cbe2e2 100644 --- a/Documentation/hwmon/max8688.rst +++ b/Documentation/hwmon/max8688.rst | |||
@@ -28,7 +28,7 @@ Usage Notes | |||
28 | ----------- | 28 | ----------- |
29 | 29 | ||
30 | This driver does not auto-detect devices. You will have to instantiate the | 30 | This driver does not auto-detect devices. You will have to instantiate the |
31 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 31 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
32 | details. | 32 | details. |
33 | 33 | ||
34 | 34 | ||
diff --git a/Documentation/hwmon/menf21bmc.rst b/Documentation/hwmon/menf21bmc.rst index 1f0c6b2235ab..978691d5956d 100644 --- a/Documentation/hwmon/menf21bmc.rst +++ b/Documentation/hwmon/menf21bmc.rst | |||
@@ -28,7 +28,7 @@ Usage Notes | |||
28 | This driver is part of the MFD driver named "menf21bmc" and does | 28 | This driver is part of the MFD driver named "menf21bmc" and does |
29 | not auto-detect devices. | 29 | not auto-detect devices. |
30 | You will have to instantiate the MFD driver explicitly. | 30 | You will have to instantiate the MFD driver explicitly. |
31 | Please see Documentation/i2c/instantiating-devices for | 31 | Please see Documentation/i2c/instantiating-devices.rst for |
32 | details. | 32 | details. |
33 | 33 | ||
34 | Sysfs entries | 34 | Sysfs entries |
diff --git a/Documentation/hwmon/pcf8591.rst b/Documentation/hwmon/pcf8591.rst index e98bd542a441..5c4e85f53177 100644 --- a/Documentation/hwmon/pcf8591.rst +++ b/Documentation/hwmon/pcf8591.rst | |||
@@ -68,7 +68,7 @@ Accessing PCF8591 via /sys interface | |||
68 | The PCF8591 is plainly impossible to detect! Thus the driver won't even | 68 | The PCF8591 is plainly impossible to detect! Thus the driver won't even |
69 | try. You have to explicitly instantiate the device at the relevant | 69 | try. You have to explicitly instantiate the device at the relevant |
70 | address (in the interval [0x48..0x4f]) either through platform data, or | 70 | address (in the interval [0x48..0x4f]) either through platform data, or |
71 | using the sysfs interface. See Documentation/i2c/instantiating-devices | 71 | using the sysfs interface. See Documentation/i2c/instantiating-devices.rst |
72 | for details. | 72 | for details. |
73 | 73 | ||
74 | Directories are being created for each instantiated PCF8591: | 74 | Directories are being created for each instantiated PCF8591: |
diff --git a/Documentation/hwmon/sht3x.rst b/Documentation/hwmon/sht3x.rst index 978a7117e4b2..95a850d5b2c1 100644 --- a/Documentation/hwmon/sht3x.rst +++ b/Documentation/hwmon/sht3x.rst | |||
@@ -26,7 +26,7 @@ scaled by 1000, i.e. the value for 31.5 degrees celsius is 31500. | |||
26 | 26 | ||
27 | The device communicates with the I2C protocol. Sensors can have the I2C | 27 | The device communicates with the I2C protocol. Sensors can have the I2C |
28 | addresses 0x44 or 0x45, depending on the wiring. See | 28 | addresses 0x44 or 0x45, depending on the wiring. See |
29 | Documentation/i2c/instantiating-devices for methods to instantiate the device. | 29 | Documentation/i2c/instantiating-devices.rst for methods to instantiate the device. |
30 | 30 | ||
31 | There are two options configurable by means of sht3x_platform_data: | 31 | There are two options configurable by means of sht3x_platform_data: |
32 | 32 | ||
diff --git a/Documentation/hwmon/shtc1.rst b/Documentation/hwmon/shtc1.rst index 9b0f1eee5bf2..08380f21ab6a 100644 --- a/Documentation/hwmon/shtc1.rst +++ b/Documentation/hwmon/shtc1.rst | |||
@@ -45,7 +45,7 @@ chips, a humidity and temperature sensor. Temperature is measured in degrees | |||
45 | celsius, relative humidity is expressed as a percentage. | 45 | celsius, relative humidity is expressed as a percentage. |
46 | 46 | ||
47 | The device communicates with the I2C protocol. All sensors are set to I2C | 47 | The device communicates with the I2C protocol. All sensors are set to I2C |
48 | address 0x70. See Documentation/i2c/instantiating-devices for methods to | 48 | address 0x70. See Documentation/i2c/instantiating-devices.rst for methods to |
49 | instantiate the device. | 49 | instantiate the device. |
50 | 50 | ||
51 | There are two options configurable by means of shtc1_platform_data: | 51 | There are two options configurable by means of shtc1_platform_data: |
diff --git a/Documentation/hwmon/tmp103.rst b/Documentation/hwmon/tmp103.rst index 15d25806d585..205de6148fcb 100644 --- a/Documentation/hwmon/tmp103.rst +++ b/Documentation/hwmon/tmp103.rst | |||
@@ -30,4 +30,4 @@ The driver provides the common sysfs-interface for temperatures (see | |||
30 | Documentation/hwmon/sysfs-interface.rst under Temperatures). | 30 | Documentation/hwmon/sysfs-interface.rst under Temperatures). |
31 | 31 | ||
32 | Please refer how to instantiate this driver: | 32 | Please refer how to instantiate this driver: |
33 | Documentation/i2c/instantiating-devices | 33 | Documentation/i2c/instantiating-devices.rst |
diff --git a/Documentation/hwmon/tps40422.rst b/Documentation/hwmon/tps40422.rst index b691e30479dd..8fe3e1c3572e 100644 --- a/Documentation/hwmon/tps40422.rst +++ b/Documentation/hwmon/tps40422.rst | |||
@@ -28,7 +28,7 @@ Usage Notes | |||
28 | ----------- | 28 | ----------- |
29 | 29 | ||
30 | This driver does not auto-detect devices. You will have to instantiate the | 30 | This driver does not auto-detect devices. You will have to instantiate the |
31 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 31 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
32 | details. | 32 | details. |
33 | 33 | ||
34 | 34 | ||
diff --git a/Documentation/hwmon/ucd9000.rst b/Documentation/hwmon/ucd9000.rst index ebc4f2b3bfea..746f21fcb48c 100644 --- a/Documentation/hwmon/ucd9000.rst +++ b/Documentation/hwmon/ucd9000.rst | |||
@@ -64,7 +64,7 @@ Usage Notes | |||
64 | ----------- | 64 | ----------- |
65 | 65 | ||
66 | This driver does not auto-detect devices. You will have to instantiate the | 66 | This driver does not auto-detect devices. You will have to instantiate the |
67 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 67 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
68 | details. | 68 | details. |
69 | 69 | ||
70 | 70 | ||
diff --git a/Documentation/hwmon/ucd9200.rst b/Documentation/hwmon/ucd9200.rst index b819dfd75f71..4f0e7c3ca6f4 100644 --- a/Documentation/hwmon/ucd9200.rst +++ b/Documentation/hwmon/ucd9200.rst | |||
@@ -40,7 +40,7 @@ Usage Notes | |||
40 | ----------- | 40 | ----------- |
41 | 41 | ||
42 | This driver does not auto-detect devices. You will have to instantiate the | 42 | This driver does not auto-detect devices. You will have to instantiate the |
43 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 43 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
44 | details. | 44 | details. |
45 | 45 | ||
46 | 46 | ||
diff --git a/Documentation/hwmon/via686a.rst b/Documentation/hwmon/via686a.rst index a343c35df740..7ab9ddebcf79 100644 --- a/Documentation/hwmon/via686a.rst +++ b/Documentation/hwmon/via686a.rst | |||
@@ -40,7 +40,7 @@ all as a 686A. | |||
40 | 40 | ||
41 | The Via 686a southbridge has integrated hardware monitor functionality. | 41 | The Via 686a southbridge has integrated hardware monitor functionality. |
42 | It also has an I2C bus, but this driver only supports the hardware monitor. | 42 | It also has an I2C bus, but this driver only supports the hardware monitor. |
43 | For the I2C bus driver, see <file:Documentation/i2c/busses/i2c-viapro> | 43 | For the I2C bus driver, see <file:Documentation/i2c/busses/i2c-viapro.rst> |
44 | 44 | ||
45 | The Via 686a implements three temperature sensors, two fan rotation speed | 45 | The Via 686a implements three temperature sensors, two fan rotation speed |
46 | sensors, five voltage sensors and alarms. | 46 | sensors, five voltage sensors and alarms. |
diff --git a/Documentation/hwmon/zl6100.rst b/Documentation/hwmon/zl6100.rst index 41513bb7fe51..968aff10ce0a 100644 --- a/Documentation/hwmon/zl6100.rst +++ b/Documentation/hwmon/zl6100.rst | |||
@@ -121,7 +121,7 @@ Usage Notes | |||
121 | ----------- | 121 | ----------- |
122 | 122 | ||
123 | This driver does not auto-detect devices. You will have to instantiate the | 123 | This driver does not auto-detect devices. You will have to instantiate the |
124 | devices explicitly. Please see Documentation/i2c/instantiating-devices for | 124 | devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for |
125 | details. | 125 | details. |
126 | 126 | ||
127 | .. warning:: | 127 | .. warning:: |
diff --git a/Documentation/i2c/busses/i2c-ali1535 b/Documentation/i2c/busses/i2c-ali1535.rst index 5d46342e486a..6941064730dc 100644 --- a/Documentation/i2c/busses/i2c-ali1535 +++ b/Documentation/i2c/busses/i2c-ali1535.rst | |||
@@ -1,16 +1,19 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-ali1535 | 2 | Kernel driver i2c-ali1535 |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * Acer Labs, Inc. ALI 1535 (south bridge) | 6 | * Acer Labs, Inc. ALI 1535 (south bridge) |
7 | |||
5 | Datasheet: Now under NDA | 8 | Datasheet: Now under NDA |
6 | http://www.ali.com.tw/ | 9 | http://www.ali.com.tw/ |
7 | 10 | ||
8 | Authors: | 11 | Authors: |
9 | Frodo Looijaard <frodol@dds.nl>, | 12 | - Frodo Looijaard <frodol@dds.nl>, |
10 | Philip Edelbrock <phil@netroedge.com>, | 13 | - Philip Edelbrock <phil@netroedge.com>, |
11 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 14 | - Mark D. Studebaker <mdsxyz123@yahoo.com>, |
12 | Dan Eaton <dan.eaton@rocketlogix.com>, | 15 | - Dan Eaton <dan.eaton@rocketlogix.com>, |
13 | Stephen Rousset<stephen.rousset@rocketlogix.com> | 16 | - Stephen Rousset<stephen.rousset@rocketlogix.com> |
14 | 17 | ||
15 | Description | 18 | Description |
16 | ----------- | 19 | ----------- |
diff --git a/Documentation/i2c/busses/i2c-ali1563 b/Documentation/i2c/busses/i2c-ali1563.rst index 41b1a077e4c7..eec32c3ba92a 100644 --- a/Documentation/i2c/busses/i2c-ali1563 +++ b/Documentation/i2c/busses/i2c-ali1563.rst | |||
@@ -1,7 +1,10 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-ali1563 | 2 | Kernel driver i2c-ali1563 |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * Acer Labs, Inc. ALI 1563 (south bridge) | 6 | * Acer Labs, Inc. ALI 1563 (south bridge) |
7 | |||
5 | Datasheet: Now under NDA | 8 | Datasheet: Now under NDA |
6 | http://www.ali.com.tw/ | 9 | http://www.ali.com.tw/ |
7 | 10 | ||
diff --git a/Documentation/i2c/busses/i2c-ali15x3 b/Documentation/i2c/busses/i2c-ali15x3.rst index 42888d8ac124..d4c1a2a419cb 100644 --- a/Documentation/i2c/busses/i2c-ali15x3 +++ b/Documentation/i2c/busses/i2c-ali15x3.rst | |||
@@ -1,20 +1,23 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-ali15x3 | 2 | Kernel driver i2c-ali15x3 |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * Acer Labs, Inc. ALI 1533 and 1543C (south bridge) | 6 | * Acer Labs, Inc. ALI 1533 and 1543C (south bridge) |
7 | |||
5 | Datasheet: Now under NDA | 8 | Datasheet: Now under NDA |
6 | http://www.ali.com.tw/ | 9 | http://www.ali.com.tw/ |
7 | 10 | ||
8 | Authors: | 11 | Authors: |
9 | Frodo Looijaard <frodol@dds.nl>, | 12 | - Frodo Looijaard <frodol@dds.nl>, |
10 | Philip Edelbrock <phil@netroedge.com>, | 13 | - Philip Edelbrock <phil@netroedge.com>, |
11 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 14 | - Mark D. Studebaker <mdsxyz123@yahoo.com> |
12 | 15 | ||
13 | Module Parameters | 16 | Module Parameters |
14 | ----------------- | 17 | ----------------- |
15 | 18 | ||
16 | * force_addr: int | 19 | * force_addr: int |
17 | Initialize the base address of the i2c controller | 20 | Initialize the base address of the i2c controller |
18 | 21 | ||
19 | 22 | ||
20 | Notes | 23 | Notes |
@@ -25,7 +28,9 @@ the BIOS. Does not do a PCI force; the device must still be present in | |||
25 | lspci. Don't use this unless the driver complains that the base address is | 28 | lspci. Don't use this unless the driver complains that the base address is |
26 | not set. | 29 | not set. |
27 | 30 | ||
28 | Example: 'modprobe i2c-ali15x3 force_addr=0xe800' | 31 | Example:: |
32 | |||
33 | modprobe i2c-ali15x3 force_addr=0xe800 | ||
29 | 34 | ||
30 | SMBus periodically hangs on ASUS P5A motherboards and can only be cleared | 35 | SMBus periodically hangs on ASUS P5A motherboards and can only be cleared |
31 | by a power cycle. Cause unknown (see Issues below). | 36 | by a power cycle. Cause unknown (see Issues below). |
@@ -38,47 +43,53 @@ This is the driver for the SMB Host controller on Acer Labs Inc. (ALI) | |||
38 | M1541 and M1543C South Bridges. | 43 | M1541 and M1543C South Bridges. |
39 | 44 | ||
40 | The M1543C is a South bridge for desktop systems. | 45 | The M1543C is a South bridge for desktop systems. |
46 | |||
41 | The M1541 is a South bridge for portable systems. | 47 | The M1541 is a South bridge for portable systems. |
48 | |||
42 | They are part of the following ALI chipsets: | 49 | They are part of the following ALI chipsets: |
43 | 50 | ||
44 | * "Aladdin Pro 2" includes the M1621 Slot 1 North bridge with AGP and | 51 | * "Aladdin Pro 2" includes the M1621 Slot 1 North bridge with AGP and |
45 | 100MHz CPU Front Side bus | 52 | 100MHz CPU Front Side bus |
46 | * "Aladdin V" includes the M1541 Socket 7 North bridge with AGP and 100MHz | 53 | * "Aladdin V" includes the M1541 Socket 7 North bridge with AGP and 100MHz |
47 | CPU Front Side bus | 54 | CPU Front Side bus |
55 | |||
48 | Some Aladdin V motherboards: | 56 | Some Aladdin V motherboards: |
49 | Asus P5A | 57 | - Asus P5A |
50 | Atrend ATC-5220 | 58 | - Atrend ATC-5220 |
51 | BCM/GVC VP1541 | 59 | - BCM/GVC VP1541 |
52 | Biostar M5ALA | 60 | - Biostar M5ALA |
53 | Gigabyte GA-5AX (** Generally doesn't work because the BIOS doesn't | 61 | - Gigabyte GA-5AX (Generally doesn't work because the BIOS doesn't |
54 | enable the 7101 device! **) | 62 | enable the 7101 device!) |
55 | Iwill XA100 Plus | 63 | - Iwill XA100 Plus |
56 | Micronics C200 | 64 | - Micronics C200 |
57 | Microstar (MSI) MS-5169 | 65 | - Microstar (MSI) MS-5169 |
58 | 66 | ||
59 | * "Aladdin IV" includes the M1541 Socket 7 North bridge | 67 | * "Aladdin IV" includes the M1541 Socket 7 North bridge |
60 | with host bus up to 83.3 MHz. | 68 | with host bus up to 83.3 MHz. |
61 | 69 | ||
62 | For an overview of these chips see http://www.acerlabs.com. At this time the | 70 | For an overview of these chips see http://www.acerlabs.com. At this time the |
63 | full data sheets on the web site are password protected, however if you | 71 | full data sheets on the web site are password protected, however if you |
64 | contact the ALI office in San Jose they may give you the password. | 72 | contact the ALI office in San Jose they may give you the password. |
65 | 73 | ||
66 | The M1533/M1543C devices appear as FOUR separate devices on the PCI bus. An | 74 | The M1533/M1543C devices appear as FOUR separate devices on the PCI bus. An |
67 | output of lspci will show something similar to the following: | 75 | output of lspci will show something similar to the following:: |
68 | 76 | ||
69 | 00:02.0 USB Controller: Acer Laboratories Inc. M5237 (rev 03) | 77 | 00:02.0 USB Controller: Acer Laboratories Inc. M5237 (rev 03) |
70 | 00:03.0 Bridge: Acer Laboratories Inc. M7101 <= THIS IS THE ONE WE NEED | 78 | 00:03.0 Bridge: Acer Laboratories Inc. M7101 <= THIS IS THE ONE WE NEED |
71 | 00:07.0 ISA bridge: Acer Laboratories Inc. M1533 (rev c3) | 79 | 00:07.0 ISA bridge: Acer Laboratories Inc. M1533 (rev c3) |
72 | 00:0f.0 IDE interface: Acer Laboratories Inc. M5229 (rev c1) | 80 | 00:0f.0 IDE interface: Acer Laboratories Inc. M5229 (rev c1) |
73 | 81 | ||
74 | ** IMPORTANT ** | 82 | .. important:: |
75 | ** If you have a M1533 or M1543C on the board and you get | 83 | |
76 | ** "ali15x3: Error: Can't detect ali15x3!" | 84 | If you have a M1533 or M1543C on the board and you get |
77 | ** then run lspci. | 85 | "ali15x3: Error: Can't detect ali15x3!" |
78 | ** If you see the 1533 and 5229 devices but NOT the 7101 device, | 86 | then run lspci. |
79 | ** then you must enable ACPI, the PMU, SMB, or something similar | 87 | |
80 | ** in the BIOS. | 88 | If you see the 1533 and 5229 devices but NOT the 7101 device, |
81 | ** The driver won't work if it can't find the M7101 device. | 89 | then you must enable ACPI, the PMU, SMB, or something similar |
90 | in the BIOS. | ||
91 | |||
92 | The driver won't work if it can't find the M7101 device. | ||
82 | 93 | ||
83 | The SMB controller is part of the M7101 device, which is an ACPI-compliant | 94 | The SMB controller is part of the M7101 device, which is an ACPI-compliant |
84 | Power Management Unit (PMU). | 95 | Power Management Unit (PMU). |
@@ -109,4 +120,3 @@ There may be electrical problems on this board. | |||
109 | On the P5A, the W83781D sensor chip is on both the ISA and | 120 | On the P5A, the W83781D sensor chip is on both the ISA and |
110 | SMBus. Therefore the SMBus hangs can generally be avoided | 121 | SMBus. Therefore the SMBus hangs can generally be avoided |
111 | by accessing the W83781D on the ISA bus only. | 122 | by accessing the W83781D on the ISA bus only. |
112 | |||
diff --git a/Documentation/i2c/busses/i2c-amd-mp2 b/Documentation/i2c/busses/i2c-amd-mp2 deleted file mode 100644 index 6571487171f4..000000000000 --- a/Documentation/i2c/busses/i2c-amd-mp2 +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | Kernel driver i2c-amd-mp2 | ||
2 | |||
3 | Supported adapters: | ||
4 | * AMD MP2 PCIe interface | ||
5 | |||
6 | Datasheet: not publicly available. | ||
7 | |||
8 | Authors: | ||
9 | Shyam Sundar S K <Shyam-sundar.S-k@amd.com> | ||
10 | Nehal Shah <nehal-bakulchandra.shah@amd.com> | ||
11 | Elie Morisse <syniurge@gmail.com> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | The MP2 is an ARM processor programmed as an I2C controller and communicating | ||
17 | with the x86 host through PCI. | ||
18 | |||
19 | If you see something like this: | ||
20 | |||
21 | 03:00.7 MP2 I2C controller: Advanced Micro Devices, Inc. [AMD] Device 15e6 | ||
22 | |||
23 | in your 'lspci -v', then this driver is for your device. | ||
diff --git a/Documentation/i2c/busses/i2c-amd-mp2.rst b/Documentation/i2c/busses/i2c-amd-mp2.rst new file mode 100644 index 000000000000..ebc2fa899325 --- /dev/null +++ b/Documentation/i2c/busses/i2c-amd-mp2.rst | |||
@@ -0,0 +1,25 @@ | |||
1 | ========================= | ||
2 | Kernel driver i2c-amd-mp2 | ||
3 | ========================= | ||
4 | |||
5 | Supported adapters: | ||
6 | * AMD MP2 PCIe interface | ||
7 | |||
8 | Datasheet: not publicly available. | ||
9 | |||
10 | Authors: | ||
11 | - Shyam Sundar S K <Shyam-sundar.S-k@amd.com> | ||
12 | - Nehal Shah <nehal-bakulchandra.shah@amd.com> | ||
13 | - Elie Morisse <syniurge@gmail.com> | ||
14 | |||
15 | Description | ||
16 | ----------- | ||
17 | |||
18 | The MP2 is an ARM processor programmed as an I2C controller and communicating | ||
19 | with the x86 host through PCI. | ||
20 | |||
21 | If you see something like this:: | ||
22 | |||
23 | 03:00.7 MP2 I2C controller: Advanced Micro Devices, Inc. [AMD] Device 15e6 | ||
24 | |||
25 | in your ``lspci -v``, then this driver is for your device. | ||
diff --git a/Documentation/i2c/busses/i2c-amd756 b/Documentation/i2c/busses/i2c-amd756.rst index 67f30874d0bf..bc93f392a4fc 100644 --- a/Documentation/i2c/busses/i2c-amd756 +++ b/Documentation/i2c/busses/i2c-amd756.rst | |||
@@ -1,18 +1,22 @@ | |||
1 | ======================== | ||
1 | Kernel driver i2c-amd756 | 2 | Kernel driver i2c-amd756 |
3 | ======================== | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * AMD 756 | 6 | * AMD 756 |
5 | * AMD 766 | 7 | * AMD 766 |
6 | * AMD 768 | 8 | * AMD 768 |
7 | * AMD 8111 | 9 | * AMD 8111 |
10 | |||
8 | Datasheets: Publicly available on AMD website | 11 | Datasheets: Publicly available on AMD website |
9 | 12 | ||
10 | * nVidia nForce | 13 | * nVidia nForce |
14 | |||
11 | Datasheet: Unavailable | 15 | Datasheet: Unavailable |
12 | 16 | ||
13 | Authors: | 17 | Authors: |
14 | Frodo Looijaard <frodol@dds.nl>, | 18 | - Frodo Looijaard <frodol@dds.nl>, |
15 | Philip Edelbrock <phil@netroedge.com> | 19 | - Philip Edelbrock <phil@netroedge.com> |
16 | 20 | ||
17 | Description | 21 | Description |
18 | ----------- | 22 | ----------- |
diff --git a/Documentation/i2c/busses/i2c-amd8111 b/Documentation/i2c/busses/i2c-amd8111.rst index 460dd6635fd2..d08bf0a7f0ac 100644 --- a/Documentation/i2c/busses/i2c-amd8111 +++ b/Documentation/i2c/busses/i2c-amd8111.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-adm8111 | 2 | Kernel driver i2c-adm8111 |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * AMD-8111 SMBus 2.0 PCI interface | 6 | * AMD-8111 SMBus 2.0 PCI interface |
@@ -13,14 +15,14 @@ Author: Vojtech Pavlik <vojtech@suse.cz> | |||
13 | Description | 15 | Description |
14 | ----------- | 16 | ----------- |
15 | 17 | ||
16 | If you see something like this: | 18 | If you see something like this:: |
17 | 19 | ||
18 | 00:07.2 SMBus: Advanced Micro Devices [AMD] AMD-8111 SMBus 2.0 (rev 02) | 20 | 00:07.2 SMBus: Advanced Micro Devices [AMD] AMD-8111 SMBus 2.0 (rev 02) |
19 | Subsystem: Advanced Micro Devices [AMD] AMD-8111 SMBus 2.0 | 21 | Subsystem: Advanced Micro Devices [AMD] AMD-8111 SMBus 2.0 |
20 | Flags: medium devsel, IRQ 19 | 22 | Flags: medium devsel, IRQ 19 |
21 | I/O ports at d400 [size=32] | 23 | I/O ports at d400 [size=32] |
22 | 24 | ||
23 | in your 'lspci -v', then this driver is for your chipset. | 25 | in your ``lspci -v``, then this driver is for your chipset. |
24 | 26 | ||
25 | Process Call Support | 27 | Process Call Support |
26 | -------------------- | 28 | -------------------- |
diff --git a/Documentation/i2c/busses/i2c-diolan-u2c b/Documentation/i2c/busses/i2c-diolan-u2c.rst index 0d6018c316c7..c18cbdcdf73c 100644 --- a/Documentation/i2c/busses/i2c-diolan-u2c +++ b/Documentation/i2c/busses/i2c-diolan-u2c.rst | |||
@@ -1,7 +1,10 @@ | |||
1 | ============================ | ||
1 | Kernel driver i2c-diolan-u2c | 2 | Kernel driver i2c-diolan-u2c |
3 | ============================ | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * Diolan U2C-12 I2C-USB adapter | 6 | * Diolan U2C-12 I2C-USB adapter |
7 | |||
5 | Documentation: | 8 | Documentation: |
6 | http://www.diolan.com/i2c/u2c12.html | 9 | http://www.diolan.com/i2c/u2c12.html |
7 | 10 | ||
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801.rst index f426c13c63a9..2a570c214880 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801.rst | |||
@@ -1,4 +1,7 @@ | |||
1 | ====================== | ||
1 | Kernel driver i2c-i801 | 2 | Kernel driver i2c-i801 |
3 | ====================== | ||
4 | |||
2 | 5 | ||
3 | Supported adapters: | 6 | Supported adapters: |
4 | * Intel 82801AA and 82801AB (ICH and ICH0 - part of the | 7 | * Intel 82801AA and 82801AB (ICH and ICH0 - part of the |
@@ -39,28 +42,33 @@ Supported adapters: | |||
39 | * Intel Comet Lake (PCH) | 42 | * Intel Comet Lake (PCH) |
40 | * Intel Elkhart Lake (PCH) | 43 | * Intel Elkhart Lake (PCH) |
41 | * Intel Tiger Lake (PCH) | 44 | * Intel Tiger Lake (PCH) |
45 | |||
42 | Datasheets: Publicly available at the Intel website | 46 | Datasheets: Publicly available at the Intel website |
43 | 47 | ||
44 | On Intel Patsburg and later chipsets, both the normal host SMBus controller | 48 | On Intel Patsburg and later chipsets, both the normal host SMBus controller |
45 | and the additional 'Integrated Device Function' controllers are supported. | 49 | and the additional 'Integrated Device Function' controllers are supported. |
46 | 50 | ||
47 | Authors: | 51 | Authors: |
48 | Mark Studebaker <mdsxyz123@yahoo.com> | 52 | - Mark Studebaker <mdsxyz123@yahoo.com> |
49 | Jean Delvare <jdelvare@suse.de> | 53 | - Jean Delvare <jdelvare@suse.de> |
50 | 54 | ||
51 | 55 | ||
52 | Module Parameters | 56 | Module Parameters |
53 | ----------------- | 57 | ----------------- |
54 | 58 | ||
55 | * disable_features (bit vector) | 59 | * disable_features (bit vector) |
60 | |||
56 | Disable selected features normally supported by the device. This makes it | 61 | Disable selected features normally supported by the device. This makes it |
57 | possible to work around possible driver or hardware bugs if the feature in | 62 | possible to work around possible driver or hardware bugs if the feature in |
58 | question doesn't work as intended for whatever reason. Bit values: | 63 | question doesn't work as intended for whatever reason. Bit values: |
64 | |||
65 | ==== ========================================= | ||
59 | 0x01 disable SMBus PEC | 66 | 0x01 disable SMBus PEC |
60 | 0x02 disable the block buffer | 67 | 0x02 disable the block buffer |
61 | 0x08 disable the I2C block read functionality | 68 | 0x08 disable the I2C block read functionality |
62 | 0x10 don't use interrupts | 69 | 0x10 don't use interrupts |
63 | 0x20 disable SMBus Host Notify | 70 | 0x20 disable SMBus Host Notify |
71 | ==== ========================================= | ||
64 | 72 | ||
65 | 73 | ||
66 | Description | 74 | Description |
@@ -73,7 +81,7 @@ Pentium-based PCs, '815E' chipset, and others. | |||
73 | 81 | ||
74 | The ICH chips contain at least SEVEN separate PCI functions in TWO logical | 82 | The ICH chips contain at least SEVEN separate PCI functions in TWO logical |
75 | PCI devices. An output of lspci will show something similar to the | 83 | PCI devices. An output of lspci will show something similar to the |
76 | following: | 84 | following:: |
77 | 85 | ||
78 | 00:1e.0 PCI bridge: Intel Corporation: Unknown device 2418 (rev 01) | 86 | 00:1e.0 PCI bridge: Intel Corporation: Unknown device 2418 (rev 01) |
79 | 00:1f.0 ISA bridge: Intel Corporation: Unknown device 2410 (rev 01) | 87 | 00:1f.0 ISA bridge: Intel Corporation: Unknown device 2410 (rev 01) |
@@ -139,14 +147,14 @@ and you think there's something interesting on the SMBus (e.g. a | |||
139 | hardware monitoring chip), you need to add your board to the list. | 147 | hardware monitoring chip), you need to add your board to the list. |
140 | 148 | ||
141 | The motherboard is identified using the subvendor and subdevice IDs of the | 149 | The motherboard is identified using the subvendor and subdevice IDs of the |
142 | host bridge PCI device. Get yours with "lspci -n -v -s 00:00.0": | 150 | host bridge PCI device. Get yours with ``lspci -n -v -s 00:00.0``:: |
143 | 151 | ||
144 | 00:00.0 Class 0600: 8086:2570 (rev 02) | 152 | 00:00.0 Class 0600: 8086:2570 (rev 02) |
145 | Subsystem: 1043:80f2 | 153 | Subsystem: 1043:80f2 |
146 | Flags: bus master, fast devsel, latency 0 | 154 | Flags: bus master, fast devsel, latency 0 |
147 | Memory at fc000000 (32-bit, prefetchable) [size=32M] | 155 | Memory at fc000000 (32-bit, prefetchable) [size=32M] |
148 | Capabilities: [e4] #09 [2106] | 156 | Capabilities: [e4] #09 [2106] |
149 | Capabilities: [a0] AGP version 3.0 | 157 | Capabilities: [a0] AGP version 3.0 |
150 | 158 | ||
151 | Here the host bridge ID is 2570 (82865G/PE/P), the subvendor ID is 1043 | 159 | Here the host bridge ID is 2570 (82865G/PE/P), the subvendor ID is 1043 |
152 | (Asus) and the subdevice ID is 80f2 (P4P800-X). You can find the symbolic | 160 | (Asus) and the subdevice ID is 80f2 (P4P800-X). You can find the symbolic |
@@ -165,7 +173,8 @@ kernel. It's very convenient if you just want to check if there's | |||
165 | anything interesting on your hidden ICH SMBus. | 173 | anything interesting on your hidden ICH SMBus. |
166 | 174 | ||
167 | 175 | ||
168 | ********************** | 176 | ---------------------------------------------------------------------------- |
177 | |||
169 | The lm_sensors project gratefully acknowledges the support of Texas | 178 | The lm_sensors project gratefully acknowledges the support of Texas |
170 | Instruments in the initial development of this driver. | 179 | Instruments in the initial development of this driver. |
171 | 180 | ||
diff --git a/Documentation/i2c/busses/i2c-ismt b/Documentation/i2c/busses/i2c-ismt.rst index 737355822c0b..8e74919a3fdf 100644 --- a/Documentation/i2c/busses/i2c-ismt +++ b/Documentation/i2c/busses/i2c-ismt.rst | |||
@@ -1,4 +1,7 @@ | |||
1 | ====================== | ||
1 | Kernel driver i2c-ismt | 2 | Kernel driver i2c-ismt |
3 | ====================== | ||
4 | |||
2 | 5 | ||
3 | Supported adapters: | 6 | Supported adapters: |
4 | * Intel S12xx series SOCs | 7 | * Intel S12xx series SOCs |
@@ -11,16 +14,21 @@ Module Parameters | |||
11 | ----------------- | 14 | ----------------- |
12 | 15 | ||
13 | * bus_speed (unsigned int) | 16 | * bus_speed (unsigned int) |
17 | |||
14 | Allows changing of the bus speed. Normally, the bus speed is set by the BIOS | 18 | Allows changing of the bus speed. Normally, the bus speed is set by the BIOS |
15 | and never needs to be changed. However, some SMBus analyzers are too slow for | 19 | and never needs to be changed. However, some SMBus analyzers are too slow for |
16 | monitoring the bus during debug, thus the need for this module parameter. | 20 | monitoring the bus during debug, thus the need for this module parameter. |
17 | Specify the bus speed in kHz. | 21 | Specify the bus speed in kHz. |
22 | |||
18 | Available bus frequency settings: | 23 | Available bus frequency settings: |
19 | 0 no change | 24 | |
20 | 80 kHz | 25 | ==== ========= |
21 | 100 kHz | 26 | 0 no change |
22 | 400 kHz | 27 | 80 kHz |
23 | 1000 kHz | 28 | 100 kHz |
29 | 400 kHz | ||
30 | 1000 kHz | ||
31 | ==== ========= | ||
24 | 32 | ||
25 | 33 | ||
26 | Description | 34 | Description |
@@ -30,7 +38,7 @@ The S12xx series of SOCs have a pair of integrated SMBus 2.0 controllers | |||
30 | targeted primarily at the microserver and storage markets. | 38 | targeted primarily at the microserver and storage markets. |
31 | 39 | ||
32 | The S12xx series contain a pair of PCI functions. An output of lspci will show | 40 | The S12xx series contain a pair of PCI functions. An output of lspci will show |
33 | something similar to the following: | 41 | something similar to the following:: |
34 | 42 | ||
35 | 00:13.0 System peripheral: Intel Corporation Centerton SMBus 2.0 Controller 0 | 43 | 00:13.0 System peripheral: Intel Corporation Centerton SMBus 2.0 Controller 0 |
36 | 00:13.1 System peripheral: Intel Corporation Centerton SMBus 2.0 Controller 1 | 44 | 00:13.1 System peripheral: Intel Corporation Centerton SMBus 2.0 Controller 1 |
diff --git a/Documentation/i2c/busses/i2c-mlxcpld b/Documentation/i2c/busses/i2c-mlxcpld.rst index 925904aa9b57..9a0b2916aa71 100644 --- a/Documentation/i2c/busses/i2c-mlxcpld +++ b/Documentation/i2c/busses/i2c-mlxcpld.rst | |||
@@ -1,9 +1,12 @@ | |||
1 | ================== | ||
1 | Driver i2c-mlxcpld | 2 | Driver i2c-mlxcpld |
3 | ================== | ||
2 | 4 | ||
3 | Author: Michael Shych <michaelsh@mellanox.com> | 5 | Author: Michael Shych <michaelsh@mellanox.com> |
4 | 6 | ||
5 | This is the Mellanox I2C controller logic, implemented in Lattice CPLD | 7 | This is the Mellanox I2C controller logic, implemented in Lattice CPLD |
6 | device. | 8 | device. |
9 | |||
7 | Device supports: | 10 | Device supports: |
8 | - Master mode. | 11 | - Master mode. |
9 | - One physical bus. | 12 | - One physical bus. |
@@ -20,6 +23,8 @@ The next transaction types are supported: | |||
20 | - Write Byte/Block. | 23 | - Write Byte/Block. |
21 | 24 | ||
22 | Registers: | 25 | Registers: |
26 | |||
27 | =============== === ======================================================================= | ||
23 | CPBLTY 0x0 - capability reg. | 28 | CPBLTY 0x0 - capability reg. |
24 | Bits [6:5] - transaction length. b01 - 72B is supported, | 29 | Bits [6:5] - transaction length. b01 - 72B is supported, |
25 | 36B in other case. | 30 | 36B in other case. |
@@ -49,3 +54,4 @@ DATAx 0xa - 0x54 - 68 bytes data buffer regs. | |||
49 | For read transactions address is sent in a separate transaction and | 54 | For read transactions address is sent in a separate transaction and |
50 | specified in the four first bytes (DATA0 - DATA3). Data is read | 55 | specified in the four first bytes (DATA0 - DATA3). Data is read |
51 | starting from DATA0. | 56 | starting from DATA0. |
57 | =============== === ======================================================================= | ||
diff --git a/Documentation/i2c/busses/i2c-nforce2 b/Documentation/i2c/busses/i2c-nforce2.rst index 9698c396b830..83181445268f 100644 --- a/Documentation/i2c/busses/i2c-nforce2 +++ b/Documentation/i2c/busses/i2c-nforce2.rst | |||
@@ -1,10 +1,12 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-nforce2 | 2 | Kernel driver i2c-nforce2 |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * nForce2 MCP 10de:0064 | 6 | * nForce2 MCP 10de:0064 |
5 | * nForce2 Ultra 400 MCP 10de:0084 | 7 | * nForce2 Ultra 400 MCP 10de:0084 |
6 | * nForce3 Pro150 MCP 10de:00D4 | 8 | * nForce3 Pro150 MCP 10de:00D4 |
7 | * nForce3 250Gb MCP 10de:00E4 | 9 | * nForce3 250Gb MCP 10de:00E4 |
8 | * nForce4 MCP 10de:0052 | 10 | * nForce4 MCP 10de:0052 |
9 | * nForce4 MCP-04 10de:0034 | 11 | * nForce4 MCP-04 10de:0034 |
10 | * nForce MCP51 10de:0264 | 12 | * nForce MCP51 10de:0264 |
@@ -16,26 +18,27 @@ Supported adapters: | |||
16 | * nForce MCP78S 10de:0752 | 18 | * nForce MCP78S 10de:0752 |
17 | * nForce MCP79 10de:0AA2 | 19 | * nForce MCP79 10de:0AA2 |
18 | 20 | ||
19 | Datasheet: not publicly available, but seems to be similar to the | 21 | Datasheet: |
22 | not publicly available, but seems to be similar to the | ||
20 | AMD-8111 SMBus 2.0 adapter. | 23 | AMD-8111 SMBus 2.0 adapter. |
21 | 24 | ||
22 | Authors: | 25 | Authors: |
23 | Hans-Frieder Vogt <hfvogt@gmx.net>, | 26 | - Hans-Frieder Vogt <hfvogt@gmx.net>, |
24 | Thomas Leibold <thomas@plx.com>, | 27 | - Thomas Leibold <thomas@plx.com>, |
25 | Patrick Dreker <patrick@dreker.de> | 28 | - Patrick Dreker <patrick@dreker.de> |
26 | 29 | ||
27 | Description | 30 | Description |
28 | ----------- | 31 | ----------- |
29 | 32 | ||
30 | i2c-nforce2 is a driver for the SMBuses included in the nVidia nForce2 MCP. | 33 | i2c-nforce2 is a driver for the SMBuses included in the nVidia nForce2 MCP. |
31 | 34 | ||
32 | If your 'lspci -v' listing shows something like the following, | 35 | If your ``lspci -v`` listing shows something like the following:: |
33 | 36 | ||
34 | 00:01.1 SMBus: nVidia Corporation: Unknown device 0064 (rev a2) | 37 | 00:01.1 SMBus: nVidia Corporation: Unknown device 0064 (rev a2) |
35 | Subsystem: Asustek Computer, Inc.: Unknown device 0c11 | 38 | Subsystem: Asustek Computer, Inc.: Unknown device 0c11 |
36 | Flags: 66Mhz, fast devsel, IRQ 5 | 39 | Flags: 66Mhz, fast devsel, IRQ 5 |
37 | I/O ports at c000 [size=32] | 40 | I/O ports at c000 [size=32] |
38 | Capabilities: <available only to root> | 41 | Capabilities: <available only to root> |
39 | 42 | ||
40 | then this driver should support the SMBuses of your motherboard. | 43 | then this driver should support the SMBuses of your motherboard. |
41 | 44 | ||
diff --git a/Documentation/i2c/busses/i2c-nvidia-gpu b/Documentation/i2c/busses/i2c-nvidia-gpu.rst index 31884d2b2eb5..38fb8a4c8756 100644 --- a/Documentation/i2c/busses/i2c-nvidia-gpu +++ b/Documentation/i2c/busses/i2c-nvidia-gpu.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ============================ | ||
1 | Kernel driver i2c-nvidia-gpu | 2 | Kernel driver i2c-nvidia-gpu |
3 | ============================ | ||
2 | 4 | ||
3 | Datasheet: not publicly available. | 5 | Datasheet: not publicly available. |
4 | 6 | ||
@@ -11,8 +13,8 @@ Description | |||
11 | i2c-nvidia-gpu is a driver for I2C controller included in NVIDIA Turing | 13 | i2c-nvidia-gpu is a driver for I2C controller included in NVIDIA Turing |
12 | and later GPUs and it is used to communicate with Type-C controller on GPUs. | 14 | and later GPUs and it is used to communicate with Type-C controller on GPUs. |
13 | 15 | ||
14 | If your 'lspci -v' listing shows something like the following, | 16 | If your ``lspci -v`` listing shows something like the following:: |
15 | 17 | ||
16 | 01:00.3 Serial bus controller [0c80]: NVIDIA Corporation Device 1ad9 (rev a1) | 18 | 01:00.3 Serial bus controller [0c80]: NVIDIA Corporation Device 1ad9 (rev a1) |
17 | 19 | ||
18 | then this driver should support the I2C controller of your GPU. | 20 | then this driver should support the I2C controller of your GPU. |
diff --git a/Documentation/i2c/busses/i2c-ocores b/Documentation/i2c/busses/i2c-ocores.rst index 9caaf7df1b2f..f5e175f2a2a6 100644 --- a/Documentation/i2c/busses/i2c-ocores +++ b/Documentation/i2c/busses/i2c-ocores.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ======================== | ||
1 | Kernel driver i2c-ocores | 2 | Kernel driver i2c-ocores |
3 | ======================== | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * OpenCores.org I2C controller by Richard Herveille (see datasheet link) | 6 | * OpenCores.org I2C controller by Richard Herveille (see datasheet link) |
@@ -23,9 +25,9 @@ distance between registers and the input clock speed. | |||
23 | There is also a possibility to attach a list of i2c_board_info which | 25 | There is also a possibility to attach a list of i2c_board_info which |
24 | the i2c-ocores driver will add to the bus upon creation. | 26 | the i2c-ocores driver will add to the bus upon creation. |
25 | 27 | ||
26 | E.G. something like: | 28 | E.G. something like:: |
27 | 29 | ||
28 | static struct resource ocores_resources[] = { | 30 | static struct resource ocores_resources[] = { |
29 | [0] = { | 31 | [0] = { |
30 | .start = MYI2C_BASEADDR, | 32 | .start = MYI2C_BASEADDR, |
31 | .end = MYI2C_BASEADDR + 8, | 33 | .end = MYI2C_BASEADDR + 8, |
@@ -36,10 +38,10 @@ static struct resource ocores_resources[] = { | |||
36 | .end = MYI2C_IRQ, | 38 | .end = MYI2C_IRQ, |
37 | .flags = IORESOURCE_IRQ, | 39 | .flags = IORESOURCE_IRQ, |
38 | }, | 40 | }, |
39 | }; | 41 | }; |
40 | 42 | ||
41 | /* optional board info */ | 43 | /* optional board info */ |
42 | struct i2c_board_info ocores_i2c_board_info[] = { | 44 | struct i2c_board_info ocores_i2c_board_info[] = { |
43 | { | 45 | { |
44 | I2C_BOARD_INFO("tsc2003", 0x48), | 46 | I2C_BOARD_INFO("tsc2003", 0x48), |
45 | .platform_data = &tsc2003_platform_data, | 47 | .platform_data = &tsc2003_platform_data, |
@@ -49,20 +51,20 @@ struct i2c_board_info ocores_i2c_board_info[] = { | |||
49 | I2C_BOARD_INFO("adv7180", 0x42 >> 1), | 51 | I2C_BOARD_INFO("adv7180", 0x42 >> 1), |
50 | .irq = ADV_IRQ | 52 | .irq = ADV_IRQ |
51 | } | 53 | } |
52 | }; | 54 | }; |
53 | 55 | ||
54 | static struct ocores_i2c_platform_data myi2c_data = { | 56 | static struct ocores_i2c_platform_data myi2c_data = { |
55 | .regstep = 2, /* two bytes between registers */ | 57 | .regstep = 2, /* two bytes between registers */ |
56 | .clock_khz = 50000, /* input clock of 50MHz */ | 58 | .clock_khz = 50000, /* input clock of 50MHz */ |
57 | .devices = ocores_i2c_board_info, /* optional table of devices */ | 59 | .devices = ocores_i2c_board_info, /* optional table of devices */ |
58 | .num_devices = ARRAY_SIZE(ocores_i2c_board_info), /* table size */ | 60 | .num_devices = ARRAY_SIZE(ocores_i2c_board_info), /* table size */ |
59 | }; | 61 | }; |
60 | 62 | ||
61 | static struct platform_device myi2c = { | 63 | static struct platform_device myi2c = { |
62 | .name = "ocores-i2c", | 64 | .name = "ocores-i2c", |
63 | .dev = { | 65 | .dev = { |
64 | .platform_data = &myi2c_data, | 66 | .platform_data = &myi2c_data, |
65 | }, | 67 | }, |
66 | .num_resources = ARRAY_SIZE(ocores_resources), | 68 | .num_resources = ARRAY_SIZE(ocores_resources), |
67 | .resource = ocores_resources, | 69 | .resource = ocores_resources, |
68 | }; | 70 | }; |
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport deleted file mode 100644 index c3dbb3bfd814..000000000000 --- a/Documentation/i2c/busses/i2c-parport +++ /dev/null | |||
@@ -1,178 +0,0 @@ | |||
1 | Kernel driver i2c-parport | ||
2 | |||
3 | Author: Jean Delvare <jdelvare@suse.de> | ||
4 | |||
5 | This is a unified driver for several i2c-over-parallel-port adapters, | ||
6 | such as the ones made by Philips, Velleman or ELV. This driver is | ||
7 | meant as a replacement for the older, individual drivers: | ||
8 | * i2c-philips-par | ||
9 | * i2c-elv | ||
10 | * i2c-velleman | ||
11 | * video/i2c-parport (NOT the same as this one, dedicated to home brew | ||
12 | teletext adapters) | ||
13 | |||
14 | It currently supports the following devices: | ||
15 | * (type=0) Philips adapter | ||
16 | * (type=1) home brew teletext adapter | ||
17 | * (type=2) Velleman K8000 adapter | ||
18 | * (type=3) ELV adapter | ||
19 | * (type=4) Analog Devices ADM1032 evaluation board | ||
20 | * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031 | ||
21 | * (type=6) Barco LPT->DVI (K5800236) adapter | ||
22 | * (type=7) One For All JP1 parallel port adapter | ||
23 | * (type=8) VCT-jig | ||
24 | |||
25 | These devices use different pinout configurations, so you have to tell | ||
26 | the driver what you have, using the type module parameter. There is no | ||
27 | way to autodetect the devices. Support for different pinout configurations | ||
28 | can be easily added when needed. | ||
29 | |||
30 | Earlier kernels defaulted to type=0 (Philips). But now, if the type | ||
31 | parameter is missing, the driver will simply fail to initialize. | ||
32 | |||
33 | SMBus alert support is available on adapters which have this line properly | ||
34 | connected to the parallel port's interrupt pin. | ||
35 | |||
36 | |||
37 | Building your own adapter | ||
38 | ------------------------- | ||
39 | |||
40 | If you want to build you own i2c-over-parallel-port adapter, here is | ||
41 | a sample electronics schema (credits go to Sylvain Munaut): | ||
42 | |||
43 | Device PC | ||
44 | Side ___________________Vdd (+) Side | ||
45 | | | | | ||
46 | --- --- --- | ||
47 | | | | | | | | ||
48 | |R| |R| |R| | ||
49 | | | | | | | | ||
50 | --- --- --- | ||
51 | | | | | ||
52 | | | /| | | ||
53 | SCL ----------x--------o |-----------x------------------- pin 2 | ||
54 | | \| | | | ||
55 | | | | | ||
56 | | |\ | | | ||
57 | SDA ----------x----x---| o---x--------------------------- pin 13 | ||
58 | | |/ | | ||
59 | | | | ||
60 | | /| | | ||
61 | ---------o |----------------x-------------- pin 3 | ||
62 | \| | | | ||
63 | | | | ||
64 | --- --- | ||
65 | | | | | | ||
66 | |R| |R| | ||
67 | | | | | | ||
68 | --- --- | ||
69 | | | | ||
70 | ### ### | ||
71 | GND GND | ||
72 | |||
73 | Remarks: | ||
74 | - This is the exact pinout and electronics used on the Analog Devices | ||
75 | evaluation boards. | ||
76 | /| | ||
77 | - All inverters -o |- must be 74HC05, they must be open collector output. | ||
78 | \| | ||
79 | - All resitors are 10k. | ||
80 | - Pins 18-25 of the parallel port connected to GND. | ||
81 | - Pins 4-9 (D2-D7) could be used as VDD is the driver drives them high. | ||
82 | The ADM1032 evaluation board uses D4-D7. Beware that the amount of | ||
83 | current you can draw from the parallel port is limited. Also note that | ||
84 | all connected lines MUST BE driven at the same state, else you'll short | ||
85 | circuit the output buffers! So plugging the I2C adapter after loading | ||
86 | the i2c-parport module might be a good safety since data line state | ||
87 | prior to init may be unknown. | ||
88 | - This is 5V! | ||
89 | - Obviously you cannot read SCL (so it's not really standard-compliant). | ||
90 | Pretty easy to add, just copy the SDA part and use another input pin. | ||
91 | That would give (ELV compatible pinout): | ||
92 | |||
93 | |||
94 | Device PC | ||
95 | Side ______________________________Vdd (+) Side | ||
96 | | | | | | ||
97 | --- --- --- --- | ||
98 | | | | | | | | | | ||
99 | |R| |R| |R| |R| | ||
100 | | | | | | | | | | ||
101 | --- --- --- --- | ||
102 | | | | | | ||
103 | | | |\ | | | ||
104 | SCL ----------x--------x--| o---x------------------------ pin 15 | ||
105 | | | |/ | | ||
106 | | | | | ||
107 | | | /| | | ||
108 | | ---o |-------------x-------------- pin 2 | ||
109 | | \| | | | ||
110 | | | | | ||
111 | | | | | ||
112 | | |\ | | | ||
113 | SDA ---------------x---x--| o--------x------------------- pin 10 | ||
114 | | |/ | | ||
115 | | | | ||
116 | | /| | | ||
117 | ---o |------------------x--------- pin 3 | ||
118 | \| | | | ||
119 | | | | ||
120 | --- --- | ||
121 | | | | | | ||
122 | |R| |R| | ||
123 | | | | | | ||
124 | --- --- | ||
125 | | | | ||
126 | ### ### | ||
127 | GND GND | ||
128 | |||
129 | |||
130 | If possible, you should use the same pinout configuration as existing | ||
131 | adapters do, so you won't even have to change the code. | ||
132 | |||
133 | |||
134 | Similar (but different) drivers | ||
135 | ------------------------------- | ||
136 | |||
137 | This driver is NOT the same as the i2c-pport driver found in the i2c | ||
138 | package. The i2c-pport driver makes use of modern parallel port features so | ||
139 | that you don't need additional electronics. It has other restrictions | ||
140 | however, and was not ported to Linux 2.6 (yet). | ||
141 | |||
142 | This driver is also NOT the same as the i2c-pcf-epp driver found in the | ||
143 | lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as | ||
144 | an I2C bus directly. Instead, it uses it to control an external I2C bus | ||
145 | master. That driver was not ported to Linux 2.6 (yet) either. | ||
146 | |||
147 | |||
148 | Legacy documentation for Velleman adapter | ||
149 | ----------------------------------------- | ||
150 | |||
151 | Useful links: | ||
152 | Velleman http://www.velleman.be/ | ||
153 | Velleman K8000 Howto http://howto.htlw16.ac.at/k8000-howto.html | ||
154 | |||
155 | The project has lead to new libs for the Velleman K8000 and K8005: | ||
156 | LIBK8000 v1.99.1 and LIBK8005 v0.21 | ||
157 | With these libs, you can control the K8000 interface card and the K8005 | ||
158 | stepper motor card with the simple commands which are in the original | ||
159 | Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and | ||
160 | many more, using /dev/velleman. | ||
161 | http://home.wanadoo.nl/hihihi/libk8000.htm | ||
162 | http://home.wanadoo.nl/hihihi/libk8005.htm | ||
163 | http://struyve.mine.nu:8080/index.php?block=k8000 | ||
164 | http://sourceforge.net/projects/libk8005/ | ||
165 | |||
166 | |||
167 | One For All JP1 parallel port adapter | ||
168 | ------------------------------------- | ||
169 | |||
170 | The JP1 project revolves around a set of remote controls which expose | ||
171 | the I2C bus their internal configuration EEPROM lives on via a 6 pin | ||
172 | jumper in the battery compartment. More details can be found at: | ||
173 | |||
174 | http://www.hifi-remote.com/jp1/ | ||
175 | |||
176 | Details of the simple parallel port hardware can be found at: | ||
177 | |||
178 | http://www.hifi-remote.com/jp1/hardware.shtml | ||
diff --git a/Documentation/i2c/busses/i2c-parport-light b/Documentation/i2c/busses/i2c-parport-light.rst index 7071b8ba0af4..e73af975d2c8 100644 --- a/Documentation/i2c/busses/i2c-parport-light +++ b/Documentation/i2c/busses/i2c-parport-light.rst | |||
@@ -1,13 +1,15 @@ | |||
1 | =============================== | ||
1 | Kernel driver i2c-parport-light | 2 | Kernel driver i2c-parport-light |
3 | =============================== | ||
2 | 4 | ||
3 | Author: Jean Delvare <jdelvare@suse.de> | 5 | Author: Jean Delvare <jdelvare@suse.de> |
4 | 6 | ||
5 | This driver is a light version of i2c-parport. It doesn't depend | 7 | This driver is a light version of i2c-parport. It doesn't depend |
6 | on the parport driver, and uses direct I/O access instead. This might be | 8 | on the parport driver, and uses direct I/O access instead. This might be |
7 | preferred on embedded systems where wasting memory for the clean but heavy | 9 | preferred on embedded systems where wasting memory for the clean but heavy |
8 | parport handling is not an option. The drawback is a reduced portability | 10 | parport handling is not an option. The drawback is a reduced portability |
9 | and the impossibility to daisy-chain other parallel port devices. | 11 | and the impossibility to daisy-chain other parallel port devices. |
10 | 12 | ||
11 | Please see i2c-parport for documentation. | 13 | Please see i2c-parport for documentation. |
12 | 14 | ||
13 | Module parameters: | 15 | Module parameters: |
diff --git a/Documentation/i2c/busses/i2c-parport.rst b/Documentation/i2c/busses/i2c-parport.rst new file mode 100644 index 000000000000..a9b4e8133700 --- /dev/null +++ b/Documentation/i2c/busses/i2c-parport.rst | |||
@@ -0,0 +1,190 @@ | |||
1 | ========================= | ||
2 | Kernel driver i2c-parport | ||
3 | ========================= | ||
4 | |||
5 | Author: Jean Delvare <jdelvare@suse.de> | ||
6 | |||
7 | This is a unified driver for several i2c-over-parallel-port adapters, | ||
8 | such as the ones made by Philips, Velleman or ELV. This driver is | ||
9 | meant as a replacement for the older, individual drivers: | ||
10 | |||
11 | * i2c-philips-par | ||
12 | * i2c-elv | ||
13 | * i2c-velleman | ||
14 | * video/i2c-parport | ||
15 | (NOT the same as this one, dedicated to home brew teletext adapters) | ||
16 | |||
17 | It currently supports the following devices: | ||
18 | |||
19 | * (type=0) Philips adapter | ||
20 | * (type=1) home brew teletext adapter | ||
21 | * (type=2) Velleman K8000 adapter | ||
22 | * (type=3) ELV adapter | ||
23 | * (type=4) Analog Devices ADM1032 evaluation board | ||
24 | * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031 | ||
25 | * (type=6) Barco LPT->DVI (K5800236) adapter | ||
26 | * (type=7) One For All JP1 parallel port adapter | ||
27 | * (type=8) VCT-jig | ||
28 | |||
29 | These devices use different pinout configurations, so you have to tell | ||
30 | the driver what you have, using the type module parameter. There is no | ||
31 | way to autodetect the devices. Support for different pinout configurations | ||
32 | can be easily added when needed. | ||
33 | |||
34 | Earlier kernels defaulted to type=0 (Philips). But now, if the type | ||
35 | parameter is missing, the driver will simply fail to initialize. | ||
36 | |||
37 | SMBus alert support is available on adapters which have this line properly | ||
38 | connected to the parallel port's interrupt pin. | ||
39 | |||
40 | |||
41 | Building your own adapter | ||
42 | ------------------------- | ||
43 | |||
44 | If you want to build you own i2c-over-parallel-port adapter, here is | ||
45 | a sample electronics schema (credits go to Sylvain Munaut):: | ||
46 | |||
47 | Device PC | ||
48 | Side ___________________Vdd (+) Side | ||
49 | | | | | ||
50 | --- --- --- | ||
51 | | | | | | | | ||
52 | |R| |R| |R| | ||
53 | | | | | | | | ||
54 | --- --- --- | ||
55 | | | | | ||
56 | | | /| | | ||
57 | SCL ----------x--------o |-----------x------------------- pin 2 | ||
58 | | \| | | | ||
59 | | | | | ||
60 | | |\ | | | ||
61 | SDA ----------x----x---| o---x--------------------------- pin 13 | ||
62 | | |/ | | ||
63 | | | | ||
64 | | /| | | ||
65 | ---------o |----------------x-------------- pin 3 | ||
66 | \| | | | ||
67 | | | | ||
68 | --- --- | ||
69 | | | | | | ||
70 | |R| |R| | ||
71 | | | | | | ||
72 | --- --- | ||
73 | | | | ||
74 | ### ### | ||
75 | GND GND | ||
76 | |||
77 | Remarks: | ||
78 | - This is the exact pinout and electronics used on the Analog Devices | ||
79 | evaluation boards. | ||
80 | - All inverters:: | ||
81 | |||
82 | /| | ||
83 | -o |- | ||
84 | \| | ||
85 | |||
86 | must be 74HC05, they must be open collector output. | ||
87 | - All resitors are 10k. | ||
88 | - Pins 18-25 of the parallel port connected to GND. | ||
89 | - Pins 4-9 (D2-D7) could be used as VDD is the driver drives them high. | ||
90 | The ADM1032 evaluation board uses D4-D7. Beware that the amount of | ||
91 | current you can draw from the parallel port is limited. Also note that | ||
92 | all connected lines MUST BE driven at the same state, else you'll short | ||
93 | circuit the output buffers! So plugging the I2C adapter after loading | ||
94 | the i2c-parport module might be a good safety since data line state | ||
95 | prior to init may be unknown. | ||
96 | - This is 5V! | ||
97 | - Obviously you cannot read SCL (so it's not really standard-compliant). | ||
98 | Pretty easy to add, just copy the SDA part and use another input pin. | ||
99 | That would give (ELV compatible pinout):: | ||
100 | |||
101 | |||
102 | Device PC | ||
103 | Side ______________________________Vdd (+) Side | ||
104 | | | | | | ||
105 | --- --- --- --- | ||
106 | | | | | | | | | | ||
107 | |R| |R| |R| |R| | ||
108 | | | | | | | | | | ||
109 | --- --- --- --- | ||
110 | | | | | | ||
111 | | | |\ | | | ||
112 | SCL ----------x--------x--| o---x------------------------ pin 15 | ||
113 | | | |/ | | ||
114 | | | | | ||
115 | | | /| | | ||
116 | | ---o |-------------x-------------- pin 2 | ||
117 | | \| | | | ||
118 | | | | | ||
119 | | | | | ||
120 | | |\ | | | ||
121 | SDA ---------------x---x--| o--------x------------------- pin 10 | ||
122 | | |/ | | ||
123 | | | | ||
124 | | /| | | ||
125 | ---o |------------------x--------- pin 3 | ||
126 | \| | | | ||
127 | | | | ||
128 | --- --- | ||
129 | | | | | | ||
130 | |R| |R| | ||
131 | | | | | | ||
132 | --- --- | ||
133 | | | | ||
134 | ### ### | ||
135 | GND GND | ||
136 | |||
137 | |||
138 | If possible, you should use the same pinout configuration as existing | ||
139 | adapters do, so you won't even have to change the code. | ||
140 | |||
141 | |||
142 | Similar (but different) drivers | ||
143 | ------------------------------- | ||
144 | |||
145 | This driver is NOT the same as the i2c-pport driver found in the i2c | ||
146 | package. The i2c-pport driver makes use of modern parallel port features so | ||
147 | that you don't need additional electronics. It has other restrictions | ||
148 | however, and was not ported to Linux 2.6 (yet). | ||
149 | |||
150 | This driver is also NOT the same as the i2c-pcf-epp driver found in the | ||
151 | lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as | ||
152 | an I2C bus directly. Instead, it uses it to control an external I2C bus | ||
153 | master. That driver was not ported to Linux 2.6 (yet) either. | ||
154 | |||
155 | |||
156 | Legacy documentation for Velleman adapter | ||
157 | ----------------------------------------- | ||
158 | |||
159 | Useful links: | ||
160 | |||
161 | - Velleman http://www.velleman.be/ | ||
162 | - Velleman K8000 Howto http://howto.htlw16.ac.at/k8000-howto.html | ||
163 | |||
164 | The project has lead to new libs for the Velleman K8000 and K8005: | ||
165 | |||
166 | LIBK8000 v1.99.1 and LIBK8005 v0.21 | ||
167 | |||
168 | With these libs, you can control the K8000 interface card and the K8005 | ||
169 | stepper motor card with the simple commands which are in the original | ||
170 | Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and | ||
171 | many more, using /dev/velleman. | ||
172 | |||
173 | - http://home.wanadoo.nl/hihihi/libk8000.htm | ||
174 | - http://home.wanadoo.nl/hihihi/libk8005.htm | ||
175 | - http://struyve.mine.nu:8080/index.php?block=k8000 | ||
176 | - http://sourceforge.net/projects/libk8005/ | ||
177 | |||
178 | |||
179 | One For All JP1 parallel port adapter | ||
180 | ------------------------------------- | ||
181 | |||
182 | The JP1 project revolves around a set of remote controls which expose | ||
183 | the I2C bus their internal configuration EEPROM lives on via a 6 pin | ||
184 | jumper in the battery compartment. More details can be found at: | ||
185 | |||
186 | http://www.hifi-remote.com/jp1/ | ||
187 | |||
188 | Details of the simple parallel port hardware can be found at: | ||
189 | |||
190 | http://www.hifi-remote.com/jp1/hardware.shtml | ||
diff --git a/Documentation/i2c/busses/i2c-pca-isa b/Documentation/i2c/busses/i2c-pca-isa.rst index b044e5265488..a254010c8055 100644 --- a/Documentation/i2c/busses/i2c-pca-isa +++ b/Documentation/i2c/busses/i2c-pca-isa.rst | |||
@@ -1,6 +1,9 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-pca-isa | 2 | Kernel driver i2c-pca-isa |
3 | ========================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
6 | |||
4 | This driver supports ISA boards using the Philips PCA 9564 | 7 | This driver supports ISA boards using the Philips PCA 9564 |
5 | Parallel bus to I2C bus controller | 8 | Parallel bus to I2C bus controller |
6 | 9 | ||
@@ -10,11 +13,11 @@ Module Parameters | |||
10 | ----------------- | 13 | ----------------- |
11 | 14 | ||
12 | * base int | 15 | * base int |
13 | I/O base address | 16 | I/O base address |
14 | * irq int | 17 | * irq int |
15 | IRQ interrupt | 18 | IRQ interrupt |
16 | * clock int | 19 | * clock int |
17 | Clock rate as described in table 1 of PCA9564 datasheet | 20 | Clock rate as described in table 1 of PCA9564 datasheet |
18 | 21 | ||
19 | Description | 22 | Description |
20 | ----------- | 23 | ----------- |
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4.rst index 2703bc3acad0..cc9000259223 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ======================= | ||
1 | Kernel driver i2c-piix4 | 2 | Kernel driver i2c-piix4 |
3 | ======================= | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * Intel 82371AB PIIX4 and PIIX4E | 6 | * Intel 82371AB PIIX4 and PIIX4E |
@@ -20,9 +22,9 @@ Supported adapters: | |||
20 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 22 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
21 | Datasheet: Publicly available at the SMSC website http://www.smsc.com | 23 | Datasheet: Publicly available at the SMSC website http://www.smsc.com |
22 | 24 | ||
23 | Authors: | 25 | Authors: |
24 | Frodo Looijaard <frodol@dds.nl> | 26 | - Frodo Looijaard <frodol@dds.nl> |
25 | Philip Edelbrock <phil@netroedge.com> | 27 | - Philip Edelbrock <phil@netroedge.com> |
26 | 28 | ||
27 | 29 | ||
28 | Module Parameters | 30 | Module Parameters |
@@ -39,16 +41,16 @@ Description | |||
39 | 41 | ||
40 | The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of | 42 | The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of |
41 | functionality. Among other things, it implements the PCI bus. One of its | 43 | functionality. Among other things, it implements the PCI bus. One of its |
42 | minor functions is implementing a System Management Bus. This is a true | 44 | minor functions is implementing a System Management Bus. This is a true |
43 | SMBus - you can not access it on I2C levels. The good news is that it | 45 | SMBus - you can not access it on I2C levels. The good news is that it |
44 | natively understands SMBus commands and you do not have to worry about | 46 | natively understands SMBus commands and you do not have to worry about |
45 | timing problems. The bad news is that non-SMBus devices connected to it can | 47 | timing problems. The bad news is that non-SMBus devices connected to it can |
46 | confuse it mightily. Yes, this is known to happen... | 48 | confuse it mightily. Yes, this is known to happen... |
47 | 49 | ||
48 | Do 'lspci -v' and see whether it contains an entry like this: | 50 | Do ``lspci -v`` and see whether it contains an entry like this:: |
49 | 51 | ||
50 | 0000:00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02) | 52 | 0000:00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02) |
51 | Flags: medium devsel, IRQ 9 | 53 | Flags: medium devsel, IRQ 9 |
52 | 54 | ||
53 | Bus and device numbers may differ, but the function number must be | 55 | Bus and device numbers may differ, but the function number must be |
54 | identical (like many PCI devices, the PIIX4 incorporates a number of | 56 | identical (like many PCI devices, the PIIX4 incorporates a number of |
@@ -91,7 +93,7 @@ the SMI mode. | |||
91 | device is located at 00:0f.0. | 93 | device is located at 00:0f.0. |
92 | 2) Now you just need to change the value in 0xD2 register. Get it first with | 94 | 2) Now you just need to change the value in 0xD2 register. Get it first with |
93 | command: lspci -xxx -s 00:0f.0 | 95 | command: lspci -xxx -s 00:0f.0 |
94 | If the value is 0x3 then you need to change it to 0x1 | 96 | If the value is 0x3 then you need to change it to 0x1: |
95 | setpci -s 00:0f.0 d2.b=1 | 97 | setpci -s 00:0f.0 d2.b=1 |
96 | 98 | ||
97 | Please note that you don't need to do that in all cases, just when the SMBus is | 99 | Please note that you don't need to do that in all cases, just when the SMBus is |
diff --git a/Documentation/i2c/busses/i2c-sis5595 b/Documentation/i2c/busses/i2c-sis5595.rst index ecd21fb49a8f..b85630c84a96 100644 --- a/Documentation/i2c/busses/i2c-sis5595 +++ b/Documentation/i2c/busses/i2c-sis5595.rst | |||
@@ -1,9 +1,11 @@ | |||
1 | ========================= | ||
1 | Kernel driver i2c-sis5595 | 2 | Kernel driver i2c-sis5595 |
3 | ========================= | ||
2 | 4 | ||
3 | Authors: | 5 | Authors: |
4 | Frodo Looijaard <frodol@dds.nl>, | 6 | - Frodo Looijaard <frodol@dds.nl>, |
5 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 7 | - Mark D. Studebaker <mdsxyz123@yahoo.com>, |
6 | Philip Edelbrock <phil@netroedge.com> | 8 | - Philip Edelbrock <phil@netroedge.com> |
7 | 9 | ||
8 | Supported adapters: | 10 | Supported adapters: |
9 | * Silicon Integrated Systems Corp. SiS5595 Southbridge | 11 | * Silicon Integrated Systems Corp. SiS5595 Southbridge |
@@ -11,14 +13,19 @@ Supported adapters: | |||
11 | 13 | ||
12 | Note: all have mfr. ID 0x1039. | 14 | Note: all have mfr. ID 0x1039. |
13 | 15 | ||
16 | ========= ====== | ||
14 | SUPPORTED PCI ID | 17 | SUPPORTED PCI ID |
18 | ========= ====== | ||
15 | 5595 0008 | 19 | 5595 0008 |
20 | ========= ====== | ||
16 | 21 | ||
17 | Note: these chips contain a 0008 device which is incompatible with the | 22 | Note: these chips contain a 0008 device which is incompatible with the |
18 | 5595. We recognize these by the presence of the listed | 23 | 5595. We recognize these by the presence of the listed |
19 | "blacklist" PCI ID and refuse to load. | 24 | "blacklist" PCI ID and refuse to load. |
20 | 25 | ||
26 | ============= ====== ================ | ||
21 | NOT SUPPORTED PCI ID BLACKLIST PCI ID | 27 | NOT SUPPORTED PCI ID BLACKLIST PCI ID |
28 | ============= ====== ================ | ||
22 | 540 0008 0540 | 29 | 540 0008 0540 |
23 | 550 0008 0550 | 30 | 550 0008 0550 |
24 | 5513 0008 5511 | 31 | 5513 0008 5511 |
@@ -36,15 +43,18 @@ Note: all have mfr. ID 0x1039. | |||
36 | 735 0008 0735 | 43 | 735 0008 0735 |
37 | 745 0008 0745 | 44 | 745 0008 0745 |
38 | 746 0008 0746 | 45 | 746 0008 0746 |
46 | ============= ====== ================ | ||
39 | 47 | ||
40 | Module Parameters | 48 | Module Parameters |
41 | ----------------- | 49 | ----------------- |
42 | 50 | ||
43 | * force_addr=0xaddr Set the I/O base address. Useful for boards | 51 | ================== ===================================================== |
52 | force_addr=0xaddr Set the I/O base address. Useful for boards | ||
44 | that don't set the address in the BIOS. Does not do a | 53 | that don't set the address in the BIOS. Does not do a |
45 | PCI force; the device must still be present in lspci. | 54 | PCI force; the device must still be present in lspci. |
46 | Don't use this unless the driver complains that the | 55 | Don't use this unless the driver complains that the |
47 | base address is not set. | 56 | base address is not set. |
57 | ================== ===================================================== | ||
48 | 58 | ||
49 | Description | 59 | Description |
50 | ----------- | 60 | ----------- |
@@ -56,4 +66,3 @@ WARNING: If you are trying to access the integrated sensors on the SiS5595 | |||
56 | chip, you want the sis5595 driver for those, not this driver. This driver | 66 | chip, you want the sis5595 driver for those, not this driver. This driver |
57 | is a BUS driver, not a CHIP driver. A BUS driver is used by other CHIP | 67 | is a BUS driver, not a CHIP driver. A BUS driver is used by other CHIP |
58 | drivers to access chips on the bus. | 68 | drivers to access chips on the bus. |
59 | |||
diff --git a/Documentation/i2c/busses/i2c-sis630 b/Documentation/i2c/busses/i2c-sis630 deleted file mode 100644 index ee7943631074..000000000000 --- a/Documentation/i2c/busses/i2c-sis630 +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | Kernel driver i2c-sis630 | ||
2 | |||
3 | Supported adapters: | ||
4 | * Silicon Integrated Systems Corp (SiS) | ||
5 | 630 chipset (Datasheet: available at http://www.sfr-fresh.com/linux) | ||
6 | 730 chipset | ||
7 | 964 chipset | ||
8 | * Possible other SiS chipsets ? | ||
9 | |||
10 | Author: Alexander Malysh <amalysh@web.de> | ||
11 | Amaury Decrême <amaury.decreme@gmail.com> - SiS964 support | ||
12 | |||
13 | Module Parameters | ||
14 | ----------------- | ||
15 | |||
16 | * force = [1|0] Forcibly enable the SIS630. DANGEROUS! | ||
17 | This can be interesting for chipsets not named | ||
18 | above to check if it works for you chipset, but DANGEROUS! | ||
19 | |||
20 | * high_clock = [1|0] Forcibly set Host Master Clock to 56KHz (default, | ||
21 | what your BIOS use). DANGEROUS! This should be a bit | ||
22 | faster, but freeze some systems (i.e. my Laptop). | ||
23 | SIS630/730 chip only. | ||
24 | |||
25 | |||
26 | Description | ||
27 | ----------- | ||
28 | |||
29 | This SMBus only driver is known to work on motherboards with the above | ||
30 | named chipsets. | ||
31 | |||
32 | If you see something like this: | ||
33 | |||
34 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 630 Host (rev 31) | ||
35 | 00:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 | ||
36 | |||
37 | or like this: | ||
38 | |||
39 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 730 Host (rev 02) | ||
40 | 00:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 | ||
41 | |||
42 | or like this: | ||
43 | |||
44 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 760/M760 Host (rev 02) | ||
45 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS964 [MuTIOL Media IO] | ||
46 | LPC Controller (rev 36) | ||
47 | |||
48 | in your 'lspci' output , then this driver is for your chipset. | ||
49 | |||
50 | Thank You | ||
51 | --------- | ||
52 | Philip Edelbrock <phil@netroedge.com> | ||
53 | - testing SiS730 support | ||
54 | Mark M. Hoffman <mhoffman@lightlink.com> | ||
55 | - bug fixes | ||
56 | |||
57 | To anyone else which I forgot here ;), thanks! | ||
58 | |||
diff --git a/Documentation/i2c/busses/i2c-sis630.rst b/Documentation/i2c/busses/i2c-sis630.rst new file mode 100644 index 000000000000..9fcd74b18781 --- /dev/null +++ b/Documentation/i2c/busses/i2c-sis630.rst | |||
@@ -0,0 +1,63 @@ | |||
1 | ======================== | ||
2 | Kernel driver i2c-sis630 | ||
3 | ======================== | ||
4 | |||
5 | Supported adapters: | ||
6 | * Silicon Integrated Systems Corp (SiS) | ||
7 | 630 chipset (Datasheet: available at http://www.sfr-fresh.com/linux) | ||
8 | 730 chipset | ||
9 | 964 chipset | ||
10 | * Possible other SiS chipsets ? | ||
11 | |||
12 | Author: | ||
13 | - Alexander Malysh <amalysh@web.de> | ||
14 | - Amaury Decrême <amaury.decreme@gmail.com> - SiS964 support | ||
15 | |||
16 | Module Parameters | ||
17 | ----------------- | ||
18 | |||
19 | ================== ===================================================== | ||
20 | force = [1|0] Forcibly enable the SIS630. DANGEROUS! | ||
21 | This can be interesting for chipsets not named | ||
22 | above to check if it works for you chipset, | ||
23 | but DANGEROUS! | ||
24 | |||
25 | high_clock = [1|0] Forcibly set Host Master Clock to 56KHz (default, | ||
26 | what your BIOS use). DANGEROUS! This should be a bit | ||
27 | faster, but freeze some systems (i.e. my Laptop). | ||
28 | SIS630/730 chip only. | ||
29 | ================== ===================================================== | ||
30 | |||
31 | |||
32 | Description | ||
33 | ----------- | ||
34 | |||
35 | This SMBus only driver is known to work on motherboards with the above | ||
36 | named chipsets. | ||
37 | |||
38 | If you see something like this:: | ||
39 | |||
40 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 630 Host (rev 31) | ||
41 | 00:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 | ||
42 | |||
43 | or like this:: | ||
44 | |||
45 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 730 Host (rev 02) | ||
46 | 00:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 | ||
47 | |||
48 | or like this:: | ||
49 | |||
50 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS] 760/M760 Host (rev 02) | ||
51 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS964 [MuTIOL Media IO] | ||
52 | LPC Controller (rev 36) | ||
53 | |||
54 | in your ``lspci`` output , then this driver is for your chipset. | ||
55 | |||
56 | Thank You | ||
57 | --------- | ||
58 | Philip Edelbrock <phil@netroedge.com> | ||
59 | - testing SiS730 support | ||
60 | Mark M. Hoffman <mhoffman@lightlink.com> | ||
61 | - bug fixes | ||
62 | |||
63 | To anyone else which I forgot here ;), thanks! | ||
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x.rst index 0b979f3252a4..437cc1d89588 100644 --- a/Documentation/i2c/busses/i2c-sis96x +++ b/Documentation/i2c/busses/i2c-sis96x.rst | |||
@@ -1,13 +1,18 @@ | |||
1 | ======================== | ||
1 | Kernel driver i2c-sis96x | 2 | Kernel driver i2c-sis96x |
3 | ======================== | ||
2 | 4 | ||
3 | Replaces 2.4.x i2c-sis645 | 5 | Replaces 2.4.x i2c-sis645 |
4 | 6 | ||
5 | Supported adapters: | 7 | Supported adapters: |
8 | |||
6 | * Silicon Integrated Systems Corp (SiS) | 9 | * Silicon Integrated Systems Corp (SiS) |
10 | |||
7 | Any combination of these host bridges: | 11 | Any combination of these host bridges: |
8 | 645, 645DX (aka 646), 648, 650, 651, 655, 735, 745, 746 | 12 | 645, 645DX (aka 646), 648, 650, 651, 655, 735, 745, 746 |
13 | |||
9 | and these south bridges: | 14 | and these south bridges: |
10 | 961, 962, 963(L) | 15 | 961, 962, 963(L) |
11 | 16 | ||
12 | Author: Mark M. Hoffman <mhoffman@lightlink.com> | 17 | Author: Mark M. Hoffman <mhoffman@lightlink.com> |
13 | 18 | ||
@@ -21,17 +26,17 @@ those of the SiS630, although they are located in a completely different | |||
21 | place. Thanks to Alexander Malysh <amalysh@web.de> for providing the | 26 | place. Thanks to Alexander Malysh <amalysh@web.de> for providing the |
22 | SiS630 datasheet (and driver). | 27 | SiS630 datasheet (and driver). |
23 | 28 | ||
24 | The command "lspci" as root should produce something like these lines: | 29 | The command ``lspci`` as root should produce something like these lines:: |
25 | 30 | ||
26 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 | 31 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 |
27 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 | 32 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 |
28 | 00:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016 | 33 | 00:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016 |
29 | 34 | ||
30 | or perhaps this... | 35 | or perhaps this:: |
31 | 36 | ||
32 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 | 37 | 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 |
33 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS]: Unknown device 0961 | 38 | 00:02.0 ISA bridge: Silicon Integrated Systems [SiS]: Unknown device 0961 |
34 | 00:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016 | 39 | 00:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016 |
35 | 40 | ||
36 | (kernel versions later than 2.4.18 may fill in the "Unknown"s) | 41 | (kernel versions later than 2.4.18 may fill in the "Unknown"s) |
37 | 42 | ||
@@ -50,7 +55,7 @@ TO DOs | |||
50 | ------ | 55 | ------ |
51 | 56 | ||
52 | * The driver does not support SMBus block reads/writes; I may add them if a | 57 | * The driver does not support SMBus block reads/writes; I may add them if a |
53 | scenario is found where they're needed. | 58 | scenario is found where they're needed. |
54 | 59 | ||
55 | 60 | ||
56 | Thank You | 61 | Thank You |
@@ -58,16 +63,20 @@ Thank You | |||
58 | 63 | ||
59 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 64 | Mark D. Studebaker <mdsxyz123@yahoo.com> |
60 | - design hints and bug fixes | 65 | - design hints and bug fixes |
66 | |||
61 | Alexander Maylsh <amalysh@web.de> | 67 | Alexander Maylsh <amalysh@web.de> |
62 | - ditto, plus an important datasheet... almost the one I really wanted | 68 | - ditto, plus an important datasheet... almost the one I really wanted |
69 | |||
63 | Hans-Günter Lütke Uphues <hg_lu@t-online.de> | 70 | Hans-Günter Lütke Uphues <hg_lu@t-online.de> |
64 | - patch for SiS735 | 71 | - patch for SiS735 |
72 | |||
65 | Robert Zwerus <arzie@dds.nl> | 73 | Robert Zwerus <arzie@dds.nl> |
66 | - testing for SiS645DX | 74 | - testing for SiS645DX |
75 | |||
67 | Kianusch Sayah Karadji <kianusch@sk-tech.net> | 76 | Kianusch Sayah Karadji <kianusch@sk-tech.net> |
68 | - patch for SiS645DX/962 | 77 | - patch for SiS645DX/962 |
78 | |||
69 | Ken Healy | 79 | Ken Healy |
70 | - patch for SiS655 | 80 | - patch for SiS655 |
71 | 81 | ||
72 | To anyone else who has written w/ feedback, thanks! | 82 | To anyone else who has written w/ feedback, thanks! |
73 | |||
diff --git a/Documentation/i2c/busses/i2c-taos-evm b/Documentation/i2c/busses/i2c-taos-evm.rst index 60299555dcf0..f342e313ee3d 100644 --- a/Documentation/i2c/busses/i2c-taos-evm +++ b/Documentation/i2c/busses/i2c-taos-evm.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ========================== | ||
1 | Kernel driver i2c-taos-evm | 2 | Kernel driver i2c-taos-evm |
3 | ========================== | ||
2 | 4 | ||
3 | Author: Jean Delvare <jdelvare@suse.de> | 5 | Author: Jean Delvare <jdelvare@suse.de> |
4 | 6 | ||
@@ -23,10 +25,10 @@ Using this driver | |||
23 | In order to use this driver, you'll need the serport driver, and the | 25 | In order to use this driver, you'll need the serport driver, and the |
24 | inputattach tool, which is part of the input-utils package. The following | 26 | inputattach tool, which is part of the input-utils package. The following |
25 | commands will tell the kernel that you have a TAOS EVM on the first | 27 | commands will tell the kernel that you have a TAOS EVM on the first |
26 | serial port: | 28 | serial port:: |
27 | 29 | ||
28 | # modprobe serport | 30 | # modprobe serport |
29 | # inputattach --taos-evm /dev/ttyS0 | 31 | # inputattach --taos-evm /dev/ttyS0 |
30 | 32 | ||
31 | 33 | ||
32 | Technical details | 34 | Technical details |
diff --git a/Documentation/i2c/busses/i2c-via b/Documentation/i2c/busses/i2c-via.rst index 343870661ac3..846aa17d80a2 100644 --- a/Documentation/i2c/busses/i2c-via +++ b/Documentation/i2c/busses/i2c-via.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ===================== | ||
1 | Kernel driver i2c-via | 2 | Kernel driver i2c-via |
3 | ===================== | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * VIA Technologies, InC. VT82C586B | 6 | * VIA Technologies, InC. VT82C586B |
@@ -12,23 +14,27 @@ Description | |||
12 | i2c-via is an i2c bus driver for motherboards with VIA chipset. | 14 | i2c-via is an i2c bus driver for motherboards with VIA chipset. |
13 | 15 | ||
14 | The following VIA pci chipsets are supported: | 16 | The following VIA pci chipsets are supported: |
15 | - MVP3, VP3, VP2/97, VPX/97 | 17 | - MVP3, VP3, VP2/97, VPX/97 |
16 | - others with South bridge VT82C586B | 18 | - others with South bridge VT82C586B |
17 | 19 | ||
18 | Your lspci listing must show this : | 20 | Your ``lspci`` listing must show this :: |
19 | 21 | ||
20 | Bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10) | 22 | Bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10) |
21 | 23 | ||
22 | Problems? | 24 | Problems? |
23 | 25 | --------- | |
24 | Q: You have VT82C586B on the motherboard, but not in the listing. | ||
25 | |||
26 | A: Go to your BIOS setup, section PCI devices or similar. | ||
27 | Turn USB support on, and try again. | ||
28 | 26 | ||
29 | Q: No error messages, but still i2c doesn't seem to work. | 27 | Q: |
28 | You have VT82C586B on the motherboard, but not in the listing. | ||
30 | 29 | ||
31 | A: This can happen. This driver uses the pins VIA recommends in their | 30 | A: |
31 | Go to your BIOS setup, section PCI devices or similar. | ||
32 | Turn USB support on, and try again. | ||
33 | |||
34 | Q: | ||
35 | No error messages, but still i2c doesn't seem to work. | ||
36 | |||
37 | A: | ||
38 | This can happen. This driver uses the pins VIA recommends in their | ||
32 | datasheets, but there are several ways the motherboard manufacturer | 39 | datasheets, but there are several ways the motherboard manufacturer |
33 | can actually wire the lines. | 40 | can actually wire the lines. |
34 | |||
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro.rst index ab64ce21c254..1762f0cf93d0 100644 --- a/Documentation/i2c/busses/i2c-viapro +++ b/Documentation/i2c/busses/i2c-viapro.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ======================== | ||
1 | Kernel driver i2c-viapro | 2 | Kernel driver i2c-viapro |
3 | ======================== | ||
2 | 4 | ||
3 | Supported adapters: | 5 | Supported adapters: |
4 | * VIA Technologies, Inc. VT82C596A/B | 6 | * VIA Technologies, Inc. VT82C596A/B |
@@ -26,9 +28,9 @@ Supported adapters: | |||
26 | Datasheet: available on http://linux.via.com.tw | 28 | Datasheet: available on http://linux.via.com.tw |
27 | 29 | ||
28 | Authors: | 30 | Authors: |
29 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 31 | - Kyösti Mälkki <kmalkki@cc.hut.fi>, |
30 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 32 | - Mark D. Studebaker <mdsxyz123@yahoo.com>, |
31 | Jean Delvare <jdelvare@suse.de> | 33 | - Jean Delvare <jdelvare@suse.de> |
32 | 34 | ||
33 | Module Parameters | 35 | Module Parameters |
34 | ----------------- | 36 | ----------------- |
@@ -44,8 +46,9 @@ Description | |||
44 | i2c-viapro is a true SMBus host driver for motherboards with one of the | 46 | i2c-viapro is a true SMBus host driver for motherboards with one of the |
45 | supported VIA south bridges. | 47 | supported VIA south bridges. |
46 | 48 | ||
47 | Your lspci -n listing must show one of these : | 49 | Your ``lspci -n`` listing must show one of these : |
48 | 50 | ||
51 | ================ ====================== | ||
49 | device 1106:3050 (VT82C596A function 3) | 52 | device 1106:3050 (VT82C596A function 3) |
50 | device 1106:3051 (VT82C596B function 3) | 53 | device 1106:3051 (VT82C596B function 3) |
51 | device 1106:3057 (VT82C686 function 4) | 54 | device 1106:3057 (VT82C686 function 4) |
@@ -61,6 +64,7 @@ Your lspci -n listing must show one of these : | |||
61 | device 1106:8353 (VX800/VX820) | 64 | device 1106:8353 (VX800/VX820) |
62 | device 1106:8409 (VX855/VX875) | 65 | device 1106:8409 (VX855/VX875) |
63 | device 1106:8410 (VX900) | 66 | device 1106:8410 (VX900) |
67 | ================ ====================== | ||
64 | 68 | ||
65 | If none of these show up, you should look in the BIOS for settings like | 69 | If none of these show up, you should look in the BIOS for settings like |
66 | enable ACPI / SMBus or even USB. | 70 | enable ACPI / SMBus or even USB. |
diff --git a/Documentation/i2c/busses/index.rst b/Documentation/i2c/busses/index.rst new file mode 100644 index 000000000000..97ca4d510816 --- /dev/null +++ b/Documentation/i2c/busses/index.rst | |||
@@ -0,0 +1,33 @@ | |||
1 | . SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | =============== | ||
4 | I2C Bus Drivers | ||
5 | =============== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | i2c-ali1535 | ||
11 | i2c-ali1563 | ||
12 | i2c-ali15x3 | ||
13 | i2c-amd756 | ||
14 | i2c-amd8111 | ||
15 | i2c-amd-mp2 | ||
16 | i2c-diolan-u2c | ||
17 | i2c-i801 | ||
18 | i2c-ismt | ||
19 | i2c-mlxcpld | ||
20 | i2c-nforce2 | ||
21 | i2c-nvidia-gpu | ||
22 | i2c-ocores | ||
23 | i2c-parport-light | ||
24 | i2c-parport | ||
25 | i2c-pca-isa | ||
26 | i2c-piix4 | ||
27 | i2c-sis5595 | ||
28 | i2c-sis630 | ||
29 | i2c-sis96x | ||
30 | i2c-taos-evm | ||
31 | i2c-viapro | ||
32 | i2c-via | ||
33 | scx200_acb | ||
diff --git a/Documentation/i2c/busses/scx200_acb b/Documentation/i2c/busses/scx200_acb.rst index ce83c871fe95..8dc7c352508c 100644 --- a/Documentation/i2c/busses/scx200_acb +++ b/Documentation/i2c/busses/scx200_acb.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ======================== | ||
1 | Kernel driver scx200_acb | 2 | Kernel driver scx200_acb |
3 | ======================== | ||
2 | 4 | ||
3 | Author: Christer Weinigel <wingel@nano-system.com> | 5 | Author: Christer Weinigel <wingel@nano-system.com> |
4 | 6 | ||
@@ -25,8 +27,11 @@ Device-specific notes | |||
25 | 27 | ||
26 | The SC1100 WRAP boards are known to use base addresses 0x810 and 0x820. | 28 | The SC1100 WRAP boards are known to use base addresses 0x810 and 0x820. |
27 | If the scx200_acb driver is built into the kernel, add the following | 29 | If the scx200_acb driver is built into the kernel, add the following |
28 | parameter to your boot command line: | 30 | parameter to your boot command line:: |
31 | |||
29 | scx200_acb.base=0x810,0x820 | 32 | scx200_acb.base=0x810,0x820 |
33 | |||
30 | If the scx200_acb driver is built as a module, add the following line to | 34 | If the scx200_acb driver is built as a module, add the following line to |
31 | a configuration file in /etc/modprobe.d/ instead: | 35 | a configuration file in /etc/modprobe.d/ instead:: |
36 | |||
32 | options scx200_acb base=0x810,0x820 | 37 | options scx200_acb base=0x810,0x820 |
diff --git a/Documentation/i2c/dev-interface b/Documentation/i2c/dev-interface.rst index fbed645ccd75..69c23a3c2b1b 100644 --- a/Documentation/i2c/dev-interface +++ b/Documentation/i2c/dev-interface.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ==================== | ||
2 | I2C Device Interface | ||
3 | ==================== | ||
4 | |||
1 | Usually, i2c devices are controlled by a kernel driver. But it is also | 5 | Usually, i2c devices are controlled by a kernel driver. But it is also |
2 | possible to access all devices on an adapter from userspace, through | 6 | possible to access all devices on an adapter from userspace, through |
3 | the /dev interface. You need to load module i2c-dev for this. | 7 | the /dev interface. You need to load module i2c-dev for this. |
@@ -18,7 +22,7 @@ C example | |||
18 | ========= | 22 | ========= |
19 | 23 | ||
20 | So let's say you want to access an i2c adapter from a C program. | 24 | So let's say you want to access an i2c adapter from a C program. |
21 | First, you need to include these two headers: | 25 | First, you need to include these two headers:: |
22 | 26 | ||
23 | #include <linux/i2c-dev.h> | 27 | #include <linux/i2c-dev.h> |
24 | #include <i2c/smbus.h> | 28 | #include <i2c/smbus.h> |
@@ -28,7 +32,7 @@ inspect /sys/class/i2c-dev/ or run "i2cdetect -l" to decide this. | |||
28 | Adapter numbers are assigned somewhat dynamically, so you can not | 32 | Adapter numbers are assigned somewhat dynamically, so you can not |
29 | assume much about them. They can even change from one boot to the next. | 33 | assume much about them. They can even change from one boot to the next. |
30 | 34 | ||
31 | Next thing, open the device file, as follows: | 35 | Next thing, open the device file, as follows:: |
32 | 36 | ||
33 | int file; | 37 | int file; |
34 | int adapter_nr = 2; /* probably dynamically determined */ | 38 | int adapter_nr = 2; /* probably dynamically determined */ |
@@ -42,7 +46,7 @@ Next thing, open the device file, as follows: | |||
42 | } | 46 | } |
43 | 47 | ||
44 | When you have opened the device, you must specify with what device | 48 | When you have opened the device, you must specify with what device |
45 | address you want to communicate: | 49 | address you want to communicate:: |
46 | 50 | ||
47 | int addr = 0x40; /* The I2C address */ | 51 | int addr = 0x40; /* The I2C address */ |
48 | 52 | ||
@@ -53,7 +57,7 @@ address you want to communicate: | |||
53 | 57 | ||
54 | Well, you are all set up now. You can now use SMBus commands or plain | 58 | Well, you are all set up now. You can now use SMBus commands or plain |
55 | I2C to communicate with your device. SMBus commands are preferred if | 59 | I2C to communicate with your device. SMBus commands are preferred if |
56 | the device supports them. Both are illustrated below. | 60 | the device supports them. Both are illustrated below:: |
57 | 61 | ||
58 | __u8 reg = 0x10; /* Device register to access */ | 62 | __u8 reg = 0x10; /* Device register to access */ |
59 | __s32 res; | 63 | __s32 res; |
@@ -100,35 +104,35 @@ Full interface description | |||
100 | 104 | ||
101 | The following IOCTLs are defined: | 105 | The following IOCTLs are defined: |
102 | 106 | ||
103 | ioctl(file, I2C_SLAVE, long addr) | 107 | ``ioctl(file, I2C_SLAVE, long addr)`` |
104 | Change slave address. The address is passed in the 7 lower bits of the | 108 | Change slave address. The address is passed in the 7 lower bits of the |
105 | argument (except for 10 bit addresses, passed in the 10 lower bits in this | 109 | argument (except for 10 bit addresses, passed in the 10 lower bits in this |
106 | case). | 110 | case). |
107 | 111 | ||
108 | ioctl(file, I2C_TENBIT, long select) | 112 | ``ioctl(file, I2C_TENBIT, long select)`` |
109 | Selects ten bit addresses if select not equals 0, selects normal 7 bit | 113 | Selects ten bit addresses if select not equals 0, selects normal 7 bit |
110 | addresses if select equals 0. Default 0. This request is only valid | 114 | addresses if select equals 0. Default 0. This request is only valid |
111 | if the adapter has I2C_FUNC_10BIT_ADDR. | 115 | if the adapter has I2C_FUNC_10BIT_ADDR. |
112 | 116 | ||
113 | ioctl(file, I2C_PEC, long select) | 117 | ``ioctl(file, I2C_PEC, long select)`` |
114 | Selects SMBus PEC (packet error checking) generation and verification | 118 | Selects SMBus PEC (packet error checking) generation and verification |
115 | if select not equals 0, disables if select equals 0. Default 0. | 119 | if select not equals 0, disables if select equals 0. Default 0. |
116 | Used only for SMBus transactions. This request only has an effect if the | 120 | Used only for SMBus transactions. This request only has an effect if the |
117 | the adapter has I2C_FUNC_SMBUS_PEC; it is still safe if not, it just | 121 | the adapter has I2C_FUNC_SMBUS_PEC; it is still safe if not, it just |
118 | doesn't have any effect. | 122 | doesn't have any effect. |
119 | 123 | ||
120 | ioctl(file, I2C_FUNCS, unsigned long *funcs) | 124 | ``ioctl(file, I2C_FUNCS, unsigned long *funcs)`` |
121 | Gets the adapter functionality and puts it in *funcs. | 125 | Gets the adapter functionality and puts it in ``*funcs``. |
122 | 126 | ||
123 | ioctl(file, I2C_RDWR, struct i2c_rdwr_ioctl_data *msgset) | 127 | ``ioctl(file, I2C_RDWR, struct i2c_rdwr_ioctl_data *msgset)`` |
124 | Do combined read/write transaction without stop in between. | 128 | Do combined read/write transaction without stop in between. |
125 | Only valid if the adapter has I2C_FUNC_I2C. The argument is | 129 | Only valid if the adapter has I2C_FUNC_I2C. The argument is |
126 | a pointer to a | 130 | a pointer to a:: |
127 | 131 | ||
128 | struct i2c_rdwr_ioctl_data { | 132 | struct i2c_rdwr_ioctl_data { |
129 | struct i2c_msg *msgs; /* ptr to array of simple messages */ | 133 | struct i2c_msg *msgs; /* ptr to array of simple messages */ |
130 | int nmsgs; /* number of messages to exchange */ | 134 | int nmsgs; /* number of messages to exchange */ |
131 | } | 135 | } |
132 | 136 | ||
133 | The msgs[] themselves contain further pointers into data buffers. | 137 | The msgs[] themselves contain further pointers into data buffers. |
134 | The function will write or read data to or from that buffers depending | 138 | The function will write or read data to or from that buffers depending |
@@ -136,8 +140,8 @@ ioctl(file, I2C_RDWR, struct i2c_rdwr_ioctl_data *msgset) | |||
136 | The slave address and whether to use ten bit address mode has to be | 140 | The slave address and whether to use ten bit address mode has to be |
137 | set in each message, overriding the values set with the above ioctl's. | 141 | set in each message, overriding the values set with the above ioctl's. |
138 | 142 | ||
139 | ioctl(file, I2C_SMBUS, struct i2c_smbus_ioctl_data *args) | 143 | ``ioctl(file, I2C_SMBUS, struct i2c_smbus_ioctl_data *args)`` |
140 | If possible, use the provided i2c_smbus_* methods described below instead | 144 | If possible, use the provided ``i2c_smbus_*`` methods described below instead |
141 | of issuing direct ioctls. | 145 | of issuing direct ioctls. |
142 | 146 | ||
143 | You can do plain i2c transactions by using read(2) and write(2) calls. | 147 | You can do plain i2c transactions by using read(2) and write(2) calls. |
@@ -145,7 +149,8 @@ You do not need to pass the address byte; instead, set it through | |||
145 | ioctl I2C_SLAVE before you try to access the device. | 149 | ioctl I2C_SLAVE before you try to access the device. |
146 | 150 | ||
147 | You can do SMBus level transactions (see documentation file smbus-protocol | 151 | You can do SMBus level transactions (see documentation file smbus-protocol |
148 | for details) through the following functions: | 152 | for details) through the following functions:: |
153 | |||
149 | __s32 i2c_smbus_write_quick(int file, __u8 value); | 154 | __s32 i2c_smbus_write_quick(int file, __u8 value); |
150 | __s32 i2c_smbus_read_byte(int file); | 155 | __s32 i2c_smbus_read_byte(int file); |
151 | __s32 i2c_smbus_write_byte(int file, __u8 value); | 156 | __s32 i2c_smbus_write_byte(int file, __u8 value); |
@@ -157,6 +162,7 @@ for details) through the following functions: | |||
157 | __s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 *values); | 162 | __s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 *values); |
158 | __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, | 163 | __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, |
159 | __u8 *values); | 164 | __u8 *values); |
165 | |||
160 | All these transactions return -1 on failure; you can read errno to see | 166 | All these transactions return -1 on failure; you can read errno to see |
161 | what happened. The 'write' transactions return 0 on success; the | 167 | what happened. The 'write' transactions return 0 on success; the |
162 | 'read' transactions return the read value, except for read_block, which | 168 | 'read' transactions return the read value, except for read_block, which |
@@ -174,39 +180,39 @@ Implementation details | |||
174 | For the interested, here's the code flow which happens inside the kernel | 180 | For the interested, here's the code flow which happens inside the kernel |
175 | when you use the /dev interface to I2C: | 181 | when you use the /dev interface to I2C: |
176 | 182 | ||
177 | 1* Your program opens /dev/i2c-N and calls ioctl() on it, as described in | 183 | 1) Your program opens /dev/i2c-N and calls ioctl() on it, as described in |
178 | section "C example" above. | 184 | section "C example" above. |
179 | 185 | ||
180 | 2* These open() and ioctl() calls are handled by the i2c-dev kernel | 186 | 2) These open() and ioctl() calls are handled by the i2c-dev kernel |
181 | driver: see i2c-dev.c:i2cdev_open() and i2c-dev.c:i2cdev_ioctl(), | 187 | driver: see i2c-dev.c:i2cdev_open() and i2c-dev.c:i2cdev_ioctl(), |
182 | respectively. You can think of i2c-dev as a generic I2C chip driver | 188 | respectively. You can think of i2c-dev as a generic I2C chip driver |
183 | that can be programmed from user-space. | 189 | that can be programmed from user-space. |
184 | 190 | ||
185 | 3* Some ioctl() calls are for administrative tasks and are handled by | 191 | 3) Some ioctl() calls are for administrative tasks and are handled by |
186 | i2c-dev directly. Examples include I2C_SLAVE (set the address of the | 192 | i2c-dev directly. Examples include I2C_SLAVE (set the address of the |
187 | device you want to access) and I2C_PEC (enable or disable SMBus error | 193 | device you want to access) and I2C_PEC (enable or disable SMBus error |
188 | checking on future transactions.) | 194 | checking on future transactions.) |
189 | 195 | ||
190 | 4* Other ioctl() calls are converted to in-kernel function calls by | 196 | 4) Other ioctl() calls are converted to in-kernel function calls by |
191 | i2c-dev. Examples include I2C_FUNCS, which queries the I2C adapter | 197 | i2c-dev. Examples include I2C_FUNCS, which queries the I2C adapter |
192 | functionality using i2c.h:i2c_get_functionality(), and I2C_SMBUS, which | 198 | functionality using i2c.h:i2c_get_functionality(), and I2C_SMBUS, which |
193 | performs an SMBus transaction using i2c-core-smbus.c:i2c_smbus_xfer(). | 199 | performs an SMBus transaction using i2c-core-smbus.c:i2c_smbus_xfer(). |
194 | 200 | ||
195 | The i2c-dev driver is responsible for checking all the parameters that | 201 | The i2c-dev driver is responsible for checking all the parameters that |
196 | come from user-space for validity. After this point, there is no | 202 | come from user-space for validity. After this point, there is no |
197 | difference between these calls that came from user-space through i2c-dev | 203 | difference between these calls that came from user-space through i2c-dev |
198 | and calls that would have been performed by kernel I2C chip drivers | 204 | and calls that would have been performed by kernel I2C chip drivers |
199 | directly. This means that I2C bus drivers don't need to implement | 205 | directly. This means that I2C bus drivers don't need to implement |
200 | anything special to support access from user-space. | 206 | anything special to support access from user-space. |
201 | 207 | ||
202 | 5* These i2c.h functions are wrappers to the actual implementation of | 208 | 5) These i2c.h functions are wrappers to the actual implementation of |
203 | your I2C bus driver. Each adapter must declare callback functions | 209 | your I2C bus driver. Each adapter must declare callback functions |
204 | implementing these standard calls. i2c.h:i2c_get_functionality() calls | 210 | implementing these standard calls. i2c.h:i2c_get_functionality() calls |
205 | i2c_adapter.algo->functionality(), while | 211 | i2c_adapter.algo->functionality(), while |
206 | i2c-core-smbus.c:i2c_smbus_xfer() calls either | 212 | i2c-core-smbus.c:i2c_smbus_xfer() calls either |
207 | adapter.algo->smbus_xfer() if it is implemented, or if not, | 213 | adapter.algo->smbus_xfer() if it is implemented, or if not, |
208 | i2c-core-smbus.c:i2c_smbus_xfer_emulated() which in turn calls | 214 | i2c-core-smbus.c:i2c_smbus_xfer_emulated() which in turn calls |
209 | i2c_adapter.algo->master_xfer(). | 215 | i2c_adapter.algo->master_xfer(). |
210 | 216 | ||
211 | After your I2C bus driver has processed these requests, execution runs | 217 | After your I2C bus driver has processed these requests, execution runs |
212 | up the call chain, with almost no processing done, except by i2c-dev to | 218 | up the call chain, with almost no processing done, except by i2c-dev to |
diff --git a/Documentation/i2c/DMA-considerations b/Documentation/i2c/dma-considerations.rst index 203002054120..203002054120 100644 --- a/Documentation/i2c/DMA-considerations +++ b/Documentation/i2c/dma-considerations.rst | |||
diff --git a/Documentation/i2c/fault-codes b/Documentation/i2c/fault-codes.rst index 0cee0fc545b4..80b14e718b52 100644 --- a/Documentation/i2c/fault-codes +++ b/Documentation/i2c/fault-codes.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ===================== | ||
2 | I2C/SMBUS Fault Codes | ||
3 | ===================== | ||
4 | |||
1 | This is a summary of the most important conventions for use of fault | 5 | This is a summary of the most important conventions for use of fault |
2 | codes in the I2C/SMBus stack. | 6 | codes in the I2C/SMBus stack. |
3 | 7 | ||
@@ -125,4 +129,3 @@ ETIMEDOUT | |||
125 | when a slave stretches clocks too far. I2C has no such | 129 | when a slave stretches clocks too far. I2C has no such |
126 | timeouts, but it's normal for I2C adapters to impose some | 130 | timeouts, but it's normal for I2C adapters to impose some |
127 | arbitrary limits (much longer than SMBus!) too. | 131 | arbitrary limits (much longer than SMBus!) too. |
128 | |||
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality.rst index 4aae8ed15873..377507c56162 100644 --- a/Documentation/i2c/functionality +++ b/Documentation/i2c/functionality.rst | |||
@@ -1,11 +1,15 @@ | |||
1 | ======================= | ||
2 | I2C/SMBus Functionality | ||
3 | ======================= | ||
4 | |||
1 | INTRODUCTION | 5 | INTRODUCTION |
2 | ------------ | 6 | ------------ |
3 | 7 | ||
4 | Because not every I2C or SMBus adapter implements everything in the | 8 | Because not every I2C or SMBus adapter implements everything in the |
5 | I2C specifications, a client can not trust that everything it needs | 9 | I2C specifications, a client can not trust that everything it needs |
6 | is implemented when it is given the option to attach to an adapter: | 10 | is implemented when it is given the option to attach to an adapter: |
7 | the client needs some way to check whether an adapter has the needed | 11 | the client needs some way to check whether an adapter has the needed |
8 | functionality. | 12 | functionality. |
9 | 13 | ||
10 | 14 | ||
11 | FUNCTIONALITY CONSTANTS | 15 | FUNCTIONALITY CONSTANTS |
@@ -14,6 +18,7 @@ FUNCTIONALITY CONSTANTS | |||
14 | For the most up-to-date list of functionality constants, please check | 18 | For the most up-to-date list of functionality constants, please check |
15 | <uapi/linux/i2c.h>! | 19 | <uapi/linux/i2c.h>! |
16 | 20 | ||
21 | =============================== ============================================== | ||
17 | I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus | 22 | I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus |
18 | adapters typically can not do these) | 23 | adapters typically can not do these) |
19 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions | 24 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions |
@@ -33,9 +38,11 @@ For the most up-to-date list of functionality constants, please check | |||
33 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA Handles the SMBus write_block_data command | 38 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA Handles the SMBus write_block_data command |
34 | I2C_FUNC_SMBUS_READ_I2C_BLOCK Handles the SMBus read_i2c_block_data command | 39 | I2C_FUNC_SMBUS_READ_I2C_BLOCK Handles the SMBus read_i2c_block_data command |
35 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK Handles the SMBus write_i2c_block_data command | 40 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK Handles the SMBus write_i2c_block_data command |
41 | =============================== ============================================== | ||
36 | 42 | ||
37 | A few combinations of the above flags are also defined for your convenience: | 43 | A few combinations of the above flags are also defined for your convenience: |
38 | 44 | ||
45 | ========================= ====================================== | ||
39 | I2C_FUNC_SMBUS_BYTE Handles the SMBus read_byte | 46 | I2C_FUNC_SMBUS_BYTE Handles the SMBus read_byte |
40 | and write_byte commands | 47 | and write_byte commands |
41 | I2C_FUNC_SMBUS_BYTE_DATA Handles the SMBus read_byte_data | 48 | I2C_FUNC_SMBUS_BYTE_DATA Handles the SMBus read_byte_data |
@@ -49,6 +56,7 @@ A few combinations of the above flags are also defined for your convenience: | |||
49 | I2C_FUNC_SMBUS_EMUL Handles all SMBus commands that can be | 56 | I2C_FUNC_SMBUS_EMUL Handles all SMBus commands that can be |
50 | emulated by a real I2C adapter (using | 57 | emulated by a real I2C adapter (using |
51 | the transparent emulation layer) | 58 | the transparent emulation layer) |
59 | ========================= ====================================== | ||
52 | 60 | ||
53 | In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as | 61 | In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as |
54 | part of I2C_FUNC_PROTOCOL_MANGLING. | 62 | part of I2C_FUNC_PROTOCOL_MANGLING. |
@@ -58,11 +66,11 @@ ADAPTER IMPLEMENTATION | |||
58 | ---------------------- | 66 | ---------------------- |
59 | 67 | ||
60 | When you write a new adapter driver, you will have to implement a | 68 | When you write a new adapter driver, you will have to implement a |
61 | function callback `functionality'. Typical implementations are given | 69 | function callback ``functionality``. Typical implementations are given |
62 | below. | 70 | below. |
63 | 71 | ||
64 | A typical SMBus-only adapter would list all the SMBus transactions it | 72 | A typical SMBus-only adapter would list all the SMBus transactions it |
65 | supports. This example comes from the i2c-piix4 driver: | 73 | supports. This example comes from the i2c-piix4 driver:: |
66 | 74 | ||
67 | static u32 piix4_func(struct i2c_adapter *adapter) | 75 | static u32 piix4_func(struct i2c_adapter *adapter) |
68 | { | 76 | { |
@@ -72,7 +80,7 @@ supports. This example comes from the i2c-piix4 driver: | |||
72 | } | 80 | } |
73 | 81 | ||
74 | A typical full-I2C adapter would use the following (from the i2c-pxa | 82 | A typical full-I2C adapter would use the following (from the i2c-pxa |
75 | driver): | 83 | driver):: |
76 | 84 | ||
77 | static u32 i2c_pxa_functionality(struct i2c_adapter *adap) | 85 | static u32 i2c_pxa_functionality(struct i2c_adapter *adap) |
78 | { | 86 | { |
@@ -94,7 +102,7 @@ CLIENT CHECKING | |||
94 | Before a client tries to attach to an adapter, or even do tests to check | 102 | Before a client tries to attach to an adapter, or even do tests to check |
95 | whether one of the devices it supports is present on an adapter, it should | 103 | whether one of the devices it supports is present on an adapter, it should |
96 | check whether the needed functionality is present. The typical way to do | 104 | check whether the needed functionality is present. The typical way to do |
97 | this is (from the lm75 driver): | 105 | this is (from the lm75 driver):: |
98 | 106 | ||
99 | static int lm75_detect(...) | 107 | static int lm75_detect(...) |
100 | { | 108 | { |
@@ -129,7 +137,7 @@ If you try to access an adapter from a userspace program, you will have | |||
129 | to use the /dev interface. You will still have to check whether the | 137 | to use the /dev interface. You will still have to check whether the |
130 | functionality you need is supported, of course. This is done using | 138 | functionality you need is supported, of course. This is done using |
131 | the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is | 139 | the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is |
132 | below: | 140 | below:: |
133 | 141 | ||
134 | int file; | 142 | int file; |
135 | if (file = open("/dev/i2c-0", O_RDWR) < 0) { | 143 | if (file = open("/dev/i2c-0", O_RDWR) < 0) { |
diff --git a/Documentation/i2c/gpio-fault-injection b/Documentation/i2c/gpio-fault-injection.rst index c87f416d53dd..9dca6ec7d266 100644 --- a/Documentation/i2c/gpio-fault-injection +++ b/Documentation/i2c/gpio-fault-injection.rst | |||
@@ -104,10 +104,10 @@ There doesn't need to be a device at this address because arbitration lost | |||
104 | should be detected beforehand. Also note, that SCL going down is monitored | 104 | should be detected beforehand. Also note, that SCL going down is monitored |
105 | using interrupts, so the interrupt latency might cause the first bits to be not | 105 | using interrupts, so the interrupt latency might cause the first bits to be not |
106 | corrupted. A good starting point for using this fault injector on an otherwise | 106 | corrupted. A good starting point for using this fault injector on an otherwise |
107 | idle bus is: | 107 | idle bus is:: |
108 | 108 | ||
109 | # echo 200 > lose_arbitration & | 109 | # echo 200 > lose_arbitration & |
110 | # i2cget -y <bus_to_test> 0x3f | 110 | # i2cget -y <bus_to_test> 0x3f |
111 | 111 | ||
112 | Panic during transfer | 112 | Panic during transfer |
113 | ===================== | 113 | ===================== |
@@ -127,10 +127,10 @@ The calling process will then sleep and wait for the next bus clock. The | |||
127 | process is interruptible, though. | 127 | process is interruptible, though. |
128 | 128 | ||
129 | Start of a transfer is detected by waiting for SCL going down by the master | 129 | Start of a transfer is detected by waiting for SCL going down by the master |
130 | under test. A good starting point for using this fault injector is: | 130 | under test. A good starting point for using this fault injector is:: |
131 | 131 | ||
132 | # echo 0 > inject_panic & | 132 | # echo 0 > inject_panic & |
133 | # i2cget -y <bus_to_test> <some_address> | 133 | # i2cget -y <bus_to_test> <some_address> |
134 | 134 | ||
135 | Note that there doesn't need to be a device listening to the address you are | 135 | Note that there doesn't need to be a device listening to the address you are |
136 | using. Results may vary depending on that, though. | 136 | using. Results may vary depending on that, though. |
diff --git a/Documentation/i2c/i2c-protocol b/Documentation/i2c/i2c-protocol.rst index ff6d6cee6c7e..2f8fcf671b2e 100644 --- a/Documentation/i2c/i2c-protocol +++ b/Documentation/i2c/i2c-protocol.rst | |||
@@ -1,8 +1,13 @@ | |||
1 | ============ | ||
2 | I2C Protocol | ||
3 | ============ | ||
4 | |||
1 | This document describes the i2c protocol. Or will, when it is finished :-) | 5 | This document describes the i2c protocol. Or will, when it is finished :-) |
2 | 6 | ||
3 | Key to symbols | 7 | Key to symbols |
4 | ============== | 8 | ============== |
5 | 9 | ||
10 | =============== ============================================================= | ||
6 | S (1 bit) : Start bit | 11 | S (1 bit) : Start bit |
7 | P (1 bit) : Stop bit | 12 | P (1 bit) : Stop bit |
8 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. | 13 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. |
@@ -15,33 +20,35 @@ Data (8 bits): A plain data byte. Sometimes, I write DataLow, DataHigh | |||
15 | for 16 bit data. | 20 | for 16 bit data. |
16 | Count (8 bits): A data byte containing the length of a block operation. | 21 | Count (8 bits): A data byte containing the length of a block operation. |
17 | 22 | ||
18 | [..]: Data sent by I2C device, as opposed to data sent by the host adapter. | 23 | [..]: Data sent by I2C device, as opposed to data sent by the |
24 | host adapter. | ||
25 | =============== ============================================================= | ||
19 | 26 | ||
20 | 27 | ||
21 | Simple send transaction | 28 | Simple send transaction |
22 | ====================== | 29 | ======================= |
23 | 30 | ||
24 | This corresponds to i2c_master_send. | 31 | This corresponds to i2c_master_send:: |
25 | 32 | ||
26 | S Addr Wr [A] Data [A] Data [A] ... [A] Data [A] P | 33 | S Addr Wr [A] Data [A] Data [A] ... [A] Data [A] P |
27 | 34 | ||
28 | 35 | ||
29 | Simple receive transaction | 36 | Simple receive transaction |
30 | =========================== | 37 | ========================== |
31 | 38 | ||
32 | This corresponds to i2c_master_recv | 39 | This corresponds to i2c_master_recv:: |
33 | 40 | ||
34 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | 41 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P |
35 | 42 | ||
36 | 43 | ||
37 | Combined transactions | 44 | Combined transactions |
38 | ==================== | 45 | ===================== |
39 | 46 | ||
40 | This corresponds to i2c_transfer | 47 | This corresponds to i2c_transfer |
41 | 48 | ||
42 | They are just like the above transactions, but instead of a stop bit P | 49 | They are just like the above transactions, but instead of a stop bit P |
43 | a start bit S is sent and the transaction continues. An example of | 50 | a start bit S is sent and the transaction continues. An example of |
44 | a byte read, followed by a byte write: | 51 | a byte read, followed by a byte write:: |
45 | 52 | ||
46 | S Addr Rd [A] [Data] NA S Addr Wr [A] Data [A] P | 53 | S Addr Rd [A] [Data] NA S Addr Wr [A] Data [A] P |
47 | 54 | ||
@@ -65,8 +72,10 @@ I2C_M_NO_RD_ACK: | |||
65 | I2C_M_NOSTART: | 72 | I2C_M_NOSTART: |
66 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some | 73 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some |
67 | point. For example, setting I2C_M_NOSTART on the second partial message | 74 | point. For example, setting I2C_M_NOSTART on the second partial message |
68 | generates something like: | 75 | generates something like:: |
76 | |||
69 | S Addr Rd [A] [Data] NA Data [A] P | 77 | S Addr Rd [A] [Data] NA Data [A] P |
78 | |||
70 | If you set the I2C_M_NOSTART variable for the first partial message, | 79 | If you set the I2C_M_NOSTART variable for the first partial message, |
71 | we do not generate Addr, but we do generate the startbit S. This will | 80 | we do not generate Addr, but we do generate the startbit S. This will |
72 | probably confuse all other clients on your bus, so don't try this. | 81 | probably confuse all other clients on your bus, so don't try this. |
@@ -79,7 +88,8 @@ I2C_M_NOSTART: | |||
79 | I2C_M_REV_DIR_ADDR: | 88 | I2C_M_REV_DIR_ADDR: |
80 | This toggles the Rd/Wr flag. That is, if you want to do a write, but | 89 | This toggles the Rd/Wr flag. That is, if you want to do a write, but |
81 | need to emit an Rd instead of a Wr, or vice versa, you set this | 90 | need to emit an Rd instead of a Wr, or vice versa, you set this |
82 | flag. For example: | 91 | flag. For example:: |
92 | |||
83 | S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P | 93 | S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P |
84 | 94 | ||
85 | I2C_M_STOP: | 95 | I2C_M_STOP: |
diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub.rst index a16924fbd289..a6fc6916d6bc 100644 --- a/Documentation/i2c/i2c-stub +++ b/Documentation/i2c/i2c-stub.rst | |||
@@ -1,6 +1,9 @@ | |||
1 | MODULE: i2c-stub | 1 | ======== |
2 | i2c-stub | ||
3 | ======== | ||
2 | 4 | ||
3 | DESCRIPTION: | 5 | Description |
6 | =========== | ||
4 | 7 | ||
5 | This module is a very simple fake I2C/SMBus driver. It implements six | 8 | This module is a very simple fake I2C/SMBus driver. It implements six |
6 | types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) | 9 | types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) |
@@ -28,6 +31,7 @@ SMBus block operations. Writes can be partial. Block read commands always | |||
28 | return the number of bytes selected with the largest write so far. | 31 | return the number of bytes selected with the largest write so far. |
29 | 32 | ||
30 | The typical use-case is like this: | 33 | The typical use-case is like this: |
34 | |||
31 | 1. load this module | 35 | 1. load this module |
32 | 2. use i2cset (from the i2c-tools project) to pre-load some data | 36 | 2. use i2cset (from the i2c-tools project) to pre-load some data |
33 | 3. load the target chip driver module | 37 | 3. load the target chip driver module |
@@ -36,7 +40,8 @@ The typical use-case is like this: | |||
36 | There's a script named i2c-stub-from-dump in the i2c-tools package which | 40 | There's a script named i2c-stub-from-dump in the i2c-tools package which |
37 | can load register values automatically from a chip dump. | 41 | can load register values automatically from a chip dump. |
38 | 42 | ||
39 | PARAMETERS: | 43 | Parameters |
44 | ========== | ||
40 | 45 | ||
41 | int chip_addr[10]: | 46 | int chip_addr[10]: |
42 | The SMBus addresses to emulate chips at. | 47 | The SMBus addresses to emulate chips at. |
@@ -47,18 +52,15 @@ unsigned long functionality: | |||
47 | value 0x1f0000 would only enable the quick, byte and byte data | 52 | value 0x1f0000 would only enable the quick, byte and byte data |
48 | commands. | 53 | commands. |
49 | 54 | ||
50 | u8 bank_reg[10] | 55 | u8 bank_reg[10], u8 bank_mask[10], u8 bank_start[10], u8 bank_end[10]: |
51 | u8 bank_mask[10] | ||
52 | u8 bank_start[10] | ||
53 | u8 bank_end[10]: | ||
54 | Optional bank settings. They tell which bits in which register | 56 | Optional bank settings. They tell which bits in which register |
55 | select the active bank, as well as the range of banked registers. | 57 | select the active bank, as well as the range of banked registers. |
56 | 58 | ||
57 | CAVEATS: | 59 | Caveats |
60 | ======= | ||
58 | 61 | ||
59 | If your target driver polls some byte or word waiting for it to change, the | 62 | If your target driver polls some byte or word waiting for it to change, the |
60 | stub could lock it up. Use i2cset to unlock it. | 63 | stub could lock it up. Use i2cset to unlock it. |
61 | 64 | ||
62 | If you spam it hard enough, printk can be lossy. This module really wants | 65 | If you spam it hard enough, printk can be lossy. This module really wants |
63 | something like relayfs. | 66 | something like relayfs. |
64 | |||
diff --git a/Documentation/i2c/i2c-topology b/Documentation/i2c/i2c-topology.rst index f74d78b53d4d..0c1ae95f6a97 100644 --- a/Documentation/i2c/i2c-topology +++ b/Documentation/i2c/i2c-topology.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============ | ||
1 | I2C topology | 2 | I2C topology |
2 | ============ | 3 | ============ |
3 | 4 | ||
@@ -14,6 +15,7 @@ than a straight-forward i2c bus with one adapter and one or more devices. | |||
14 | that has to be operated before the device can be accessed. | 15 | that has to be operated before the device can be accessed. |
15 | 16 | ||
16 | Etc | 17 | Etc |
18 | === | ||
17 | 19 | ||
18 | These constructs are represented as i2c adapter trees by Linux, where | 20 | These constructs are represented as i2c adapter trees by Linux, where |
19 | each adapter has a parent adapter (except the root adapter) and zero or | 21 | each adapter has a parent adapter (except the root adapter) and zero or |
@@ -37,7 +39,9 @@ mux-locked or parent-locked muxes. As is evident from below, it can be | |||
37 | useful to know if a mux is mux-locked or if it is parent-locked. The | 39 | useful to know if a mux is mux-locked or if it is parent-locked. The |
38 | following list was correct at the time of writing: | 40 | following list was correct at the time of writing: |
39 | 41 | ||
40 | In drivers/i2c/muxes/ | 42 | In drivers/i2c/muxes/: |
43 | |||
44 | ====================== ============================================= | ||
41 | i2c-arb-gpio-challenge Parent-locked | 45 | i2c-arb-gpio-challenge Parent-locked |
42 | i2c-mux-gpio Normally parent-locked, mux-locked iff | 46 | i2c-mux-gpio Normally parent-locked, mux-locked iff |
43 | all involved gpio pins are controlled by the | 47 | all involved gpio pins are controlled by the |
@@ -52,18 +56,25 @@ i2c-mux-pinctrl Normally parent-locked, mux-locked iff | |||
52 | all involved pinctrl devices are controlled | 56 | all involved pinctrl devices are controlled |
53 | by the same i2c root adapter that they mux. | 57 | by the same i2c root adapter that they mux. |
54 | i2c-mux-reg Parent-locked | 58 | i2c-mux-reg Parent-locked |
59 | ====================== ============================================= | ||
60 | |||
61 | In drivers/iio/: | ||
55 | 62 | ||
56 | In drivers/iio/ | 63 | ====================== ============================================= |
57 | gyro/mpu3050 Mux-locked | 64 | gyro/mpu3050 Mux-locked |
58 | imu/inv_mpu6050/ Mux-locked | 65 | imu/inv_mpu6050/ Mux-locked |
66 | ====================== ============================================= | ||
59 | 67 | ||
60 | In drivers/media/ | 68 | In drivers/media/: |
69 | |||
70 | ======================= ============================================= | ||
61 | dvb-frontends/lgdt3306a Mux-locked | 71 | dvb-frontends/lgdt3306a Mux-locked |
62 | dvb-frontends/m88ds3103 Parent-locked | 72 | dvb-frontends/m88ds3103 Parent-locked |
63 | dvb-frontends/rtl2830 Parent-locked | 73 | dvb-frontends/rtl2830 Parent-locked |
64 | dvb-frontends/rtl2832 Mux-locked | 74 | dvb-frontends/rtl2832 Mux-locked |
65 | dvb-frontends/si2168 Mux-locked | 75 | dvb-frontends/si2168 Mux-locked |
66 | usb/cx231xx/ Parent-locked | 76 | usb/cx231xx/ Parent-locked |
77 | ======================= ============================================= | ||
67 | 78 | ||
68 | 79 | ||
69 | Mux-locked muxes | 80 | Mux-locked muxes |
@@ -78,6 +89,7 @@ full transaction, unrelated i2c transfers may interleave the different | |||
78 | stages of the transaction. This has the benefit that the mux driver | 89 | stages of the transaction. This has the benefit that the mux driver |
79 | may be easier and cleaner to implement, but it has some caveats. | 90 | may be easier and cleaner to implement, but it has some caveats. |
80 | 91 | ||
92 | ==== ===================================================================== | ||
81 | ML1. If you build a topology with a mux-locked mux being the parent | 93 | ML1. If you build a topology with a mux-locked mux being the parent |
82 | of a parent-locked mux, this might break the expectation from the | 94 | of a parent-locked mux, this might break the expectation from the |
83 | parent-locked mux that the root adapter is locked during the | 95 | parent-locked mux that the root adapter is locked during the |
@@ -105,11 +117,15 @@ ML4. If any non-i2c operation in the mux driver changes the i2c mux state, | |||
105 | Otherwise garbage may appear on the bus as seen from devices | 117 | Otherwise garbage may appear on the bus as seen from devices |
106 | behind the mux, when an unrelated i2c transfer is in flight during | 118 | behind the mux, when an unrelated i2c transfer is in flight during |
107 | the non-i2c mux-changing operation. | 119 | the non-i2c mux-changing operation. |
120 | ==== ===================================================================== | ||
108 | 121 | ||
109 | 122 | ||
110 | Mux-locked Example | 123 | Mux-locked Example |
111 | ------------------ | 124 | ------------------ |
112 | 125 | ||
126 | |||
127 | :: | ||
128 | |||
113 | .----------. .--------. | 129 | .----------. .--------. |
114 | .--------. | mux- |-----| dev D1 | | 130 | .--------. | mux- |-----| dev D1 | |
115 | | root |--+--| locked | '--------' | 131 | | root |--+--| locked | '--------' |
@@ -148,6 +164,7 @@ adapter during the transaction are unlocked i2c transfers (using e.g. | |||
148 | __i2c_transfer), or a deadlock will follow. There are a couple of | 164 | __i2c_transfer), or a deadlock will follow. There are a couple of |
149 | caveats. | 165 | caveats. |
150 | 166 | ||
167 | ==== ==================================================================== | ||
151 | PL1. If you build a topology with a parent-locked mux being the child | 168 | PL1. If you build a topology with a parent-locked mux being the child |
152 | of another mux, this might break a possible assumption from the | 169 | of another mux, this might break a possible assumption from the |
153 | child mux that the root adapter is unused between its select op | 170 | child mux that the root adapter is unused between its select op |
@@ -161,11 +178,14 @@ PL2. If select/deselect calls out to other subsystems such as gpio, | |||
161 | caused by these subsystems are unlocked. This can be convoluted to | 178 | caused by these subsystems are unlocked. This can be convoluted to |
162 | accomplish, maybe even impossible if an acceptably clean solution | 179 | accomplish, maybe even impossible if an acceptably clean solution |
163 | is sought. | 180 | is sought. |
181 | ==== ==================================================================== | ||
164 | 182 | ||
165 | 183 | ||
166 | Parent-locked Example | 184 | Parent-locked Example |
167 | --------------------- | 185 | --------------------- |
168 | 186 | ||
187 | :: | ||
188 | |||
169 | .----------. .--------. | 189 | .----------. .--------. |
170 | .--------. | parent- |-----| dev D1 | | 190 | .--------. | parent- |-----| dev D1 | |
171 | | root |--+--| locked | '--------' | 191 | | root |--+--| locked | '--------' |
@@ -177,20 +197,20 @@ Parent-locked Example | |||
177 | 197 | ||
178 | When there is an access to D1, this happens: | 198 | When there is an access to D1, this happens: |
179 | 199 | ||
180 | 1. Someone issues an i2c-transfer to D1. | 200 | 1. Someone issues an i2c-transfer to D1. |
181 | 2. M1 locks muxes on its parent (the root adapter in this case). | 201 | 2. M1 locks muxes on its parent (the root adapter in this case). |
182 | 3. M1 locks its parent adapter. | 202 | 3. M1 locks its parent adapter. |
183 | 4. M1 calls ->select to ready the mux. | 203 | 4. M1 calls ->select to ready the mux. |
184 | 5. If M1 does any i2c-transfers (on this root adapter) as part of | 204 | 5. If M1 does any i2c-transfers (on this root adapter) as part of |
185 | its select, those transfers must be unlocked i2c-transfers so | 205 | its select, those transfers must be unlocked i2c-transfers so |
186 | that they do not deadlock the root adapter. | 206 | that they do not deadlock the root adapter. |
187 | 6. M1 feeds the i2c-transfer from step 1 to the root adapter as an | 207 | 6. M1 feeds the i2c-transfer from step 1 to the root adapter as an |
188 | unlocked i2c-transfer, so that it does not deadlock the parent | 208 | unlocked i2c-transfer, so that it does not deadlock the parent |
189 | adapter. | 209 | adapter. |
190 | 7. M1 calls ->deselect, if it has one. | 210 | 7. M1 calls ->deselect, if it has one. |
191 | 8. Same rules as in step 5, but for ->deselect. | 211 | 8. Same rules as in step 5, but for ->deselect. |
192 | 9. M1 unlocks its parent adapter. | 212 | 9. M1 unlocks its parent adapter. |
193 | 10. M1 unlocks muxes on its parent. | 213 | 10. M1 unlocks muxes on its parent. |
194 | 214 | ||
195 | 215 | ||
196 | This means that accesses to both D2 and D3 are locked out for the full | 216 | This means that accesses to both D2 and D3 are locked out for the full |
@@ -203,7 +223,7 @@ Complex Examples | |||
203 | Parent-locked mux as parent of parent-locked mux | 223 | Parent-locked mux as parent of parent-locked mux |
204 | ------------------------------------------------ | 224 | ------------------------------------------------ |
205 | 225 | ||
206 | This is a useful topology, but it can be bad. | 226 | This is a useful topology, but it can be bad:: |
207 | 227 | ||
208 | .----------. .----------. .--------. | 228 | .----------. .----------. .--------. |
209 | .--------. | parent- |-----| parent- |-----| dev D1 | | 229 | .--------. | parent- |-----| parent- |-----| dev D1 | |
@@ -227,7 +247,7 @@ through and be seen by the M2 adapter, thus closing M2 prematurely. | |||
227 | Mux-locked mux as parent of mux-locked mux | 247 | Mux-locked mux as parent of mux-locked mux |
228 | ------------------------------------------ | 248 | ------------------------------------------ |
229 | 249 | ||
230 | This is a good topology. | 250 | This is a good topology:: |
231 | 251 | ||
232 | .----------. .----------. .--------. | 252 | .----------. .----------. .--------. |
233 | .--------. | mux- |-----| mux- |-----| dev D1 | | 253 | .--------. | mux- |-----| mux- |-----| dev D1 | |
@@ -248,7 +268,7 @@ are still possibly interleaved. | |||
248 | Mux-locked mux as parent of parent-locked mux | 268 | Mux-locked mux as parent of parent-locked mux |
249 | --------------------------------------------- | 269 | --------------------------------------------- |
250 | 270 | ||
251 | This is probably a bad topology. | 271 | This is probably a bad topology:: |
252 | 272 | ||
253 | .----------. .----------. .--------. | 273 | .----------. .----------. .--------. |
254 | .--------. | mux- |-----| parent- |-----| dev D1 | | 274 | .--------. | mux- |-----| parent- |-----| dev D1 | |
@@ -282,7 +302,7 @@ auto-closing, the topology is fine. | |||
282 | Parent-locked mux as parent of mux-locked mux | 302 | Parent-locked mux as parent of mux-locked mux |
283 | --------------------------------------------- | 303 | --------------------------------------------- |
284 | 304 | ||
285 | This is a good topology. | 305 | This is a good topology:: |
286 | 306 | ||
287 | .----------. .----------. .--------. | 307 | .----------. .----------. .--------. |
288 | .--------. | parent- |-----| mux- |-----| dev D1 | | 308 | .--------. | parent- |-----| mux- |-----| dev D1 | |
@@ -306,7 +326,7 @@ adapter is locked directly. | |||
306 | Two mux-locked sibling muxes | 326 | Two mux-locked sibling muxes |
307 | ---------------------------- | 327 | ---------------------------- |
308 | 328 | ||
309 | This is a good topology. | 329 | This is a good topology:: |
310 | 330 | ||
311 | .--------. | 331 | .--------. |
312 | .----------. .--| dev D1 | | 332 | .----------. .--| dev D1 | |
@@ -330,7 +350,7 @@ accesses to D5 may be interleaved at any time. | |||
330 | Two parent-locked sibling muxes | 350 | Two parent-locked sibling muxes |
331 | ------------------------------- | 351 | ------------------------------- |
332 | 352 | ||
333 | This is a good topology. | 353 | This is a good topology:: |
334 | 354 | ||
335 | .--------. | 355 | .--------. |
336 | .----------. .--| dev D1 | | 356 | .----------. .--| dev D1 | |
@@ -354,7 +374,7 @@ out. | |||
354 | Mux-locked and parent-locked sibling muxes | 374 | Mux-locked and parent-locked sibling muxes |
355 | ------------------------------------------ | 375 | ------------------------------------------ |
356 | 376 | ||
357 | This is a good topology. | 377 | This is a good topology:: |
358 | 378 | ||
359 | .--------. | 379 | .--------. |
360 | .----------. .--| dev D1 | | 380 | .----------. .--| dev D1 | |
diff --git a/Documentation/i2c/index.rst b/Documentation/i2c/index.rst new file mode 100644 index 000000000000..cd8d020f7ac5 --- /dev/null +++ b/Documentation/i2c/index.rst | |||
@@ -0,0 +1,37 @@ | |||
1 | . SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | =================== | ||
4 | I2C/SMBus Subsystem | ||
5 | =================== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | dev-interface | ||
11 | dma-considerations | ||
12 | fault-codes | ||
13 | functionality | ||
14 | gpio-fault-injection | ||
15 | i2c-protocol | ||
16 | i2c-stub | ||
17 | i2c-topology | ||
18 | instantiating-devices | ||
19 | old-module-parameters | ||
20 | slave-eeprom-backend | ||
21 | slave-interface | ||
22 | smbus-protocol | ||
23 | summary | ||
24 | ten-bit-addresses | ||
25 | upgrading-clients | ||
26 | writing-clients | ||
27 | |||
28 | muxes/i2c-mux-gpio | ||
29 | |||
30 | busses/index | ||
31 | |||
32 | .. only:: subproject and html | ||
33 | |||
34 | Indices | ||
35 | ======= | ||
36 | |||
37 | * :ref:`genindex` | ||
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices.rst index 345e9ea8281a..1238f1fa3382 100644 --- a/Documentation/i2c/instantiating-devices +++ b/Documentation/i2c/instantiating-devices.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============================== | ||
1 | How to instantiate I2C devices | 2 | How to instantiate I2C devices |
2 | ============================== | 3 | ============================== |
3 | 4 | ||
@@ -17,9 +18,9 @@ which is known in advance. It is thus possible to pre-declare the I2C | |||
17 | devices which live on this bus. This is done with an array of struct | 18 | devices which live on this bus. This is done with an array of struct |
18 | i2c_board_info which is registered by calling i2c_register_board_info(). | 19 | i2c_board_info which is registered by calling i2c_register_board_info(). |
19 | 20 | ||
20 | Example (from omap2 h4): | 21 | Example (from omap2 h4):: |
21 | 22 | ||
22 | static struct i2c_board_info h4_i2c_board_info[] __initdata = { | 23 | static struct i2c_board_info h4_i2c_board_info[] __initdata = { |
23 | { | 24 | { |
24 | I2C_BOARD_INFO("isp1301_omap", 0x2d), | 25 | I2C_BOARD_INFO("isp1301_omap", 0x2d), |
25 | .irq = OMAP_GPIO_IRQ(125), | 26 | .irq = OMAP_GPIO_IRQ(125), |
@@ -32,15 +33,15 @@ static struct i2c_board_info h4_i2c_board_info[] __initdata = { | |||
32 | I2C_BOARD_INFO("24c01", 0x57), | 33 | I2C_BOARD_INFO("24c01", 0x57), |
33 | .platform_data = &m24c01, | 34 | .platform_data = &m24c01, |
34 | }, | 35 | }, |
35 | }; | 36 | }; |
36 | 37 | ||
37 | static void __init omap_h4_init(void) | 38 | static void __init omap_h4_init(void) |
38 | { | 39 | { |
39 | (...) | 40 | (...) |
40 | i2c_register_board_info(1, h4_i2c_board_info, | 41 | i2c_register_board_info(1, h4_i2c_board_info, |
41 | ARRAY_SIZE(h4_i2c_board_info)); | 42 | ARRAY_SIZE(h4_i2c_board_info)); |
42 | (...) | 43 | (...) |
43 | } | 44 | } |
44 | 45 | ||
45 | The above code declares 3 devices on I2C bus 1, including their respective | 46 | The above code declares 3 devices on I2C bus 1, including their respective |
46 | addresses and custom data needed by their drivers. When the I2C bus in | 47 | addresses and custom data needed by their drivers. When the I2C bus in |
@@ -57,7 +58,7 @@ Method 1b: Declare the I2C devices via devicetree | |||
57 | This method has the same implications as method 1a. The declaration of I2C | 58 | This method has the same implications as method 1a. The declaration of I2C |
58 | devices is here done via devicetree as subnodes of the master controller. | 59 | devices is here done via devicetree as subnodes of the master controller. |
59 | 60 | ||
60 | Example: | 61 | Example:: |
61 | 62 | ||
62 | i2c1: i2c@400a0000 { | 63 | i2c1: i2c@400a0000 { |
63 | /* ... master properties skipped ... */ | 64 | /* ... master properties skipped ... */ |
@@ -99,20 +100,20 @@ bus in advance, so the method 1 described above can't be used. Instead, | |||
99 | you can instantiate your I2C devices explicitly. This is done by filling | 100 | you can instantiate your I2C devices explicitly. This is done by filling |
100 | a struct i2c_board_info and calling i2c_new_device(). | 101 | a struct i2c_board_info and calling i2c_new_device(). |
101 | 102 | ||
102 | Example (from the sfe4001 network driver): | 103 | Example (from the sfe4001 network driver):: |
103 | 104 | ||
104 | static struct i2c_board_info sfe4001_hwmon_info = { | 105 | static struct i2c_board_info sfe4001_hwmon_info = { |
105 | I2C_BOARD_INFO("max6647", 0x4e), | 106 | I2C_BOARD_INFO("max6647", 0x4e), |
106 | }; | 107 | }; |
107 | 108 | ||
108 | int sfe4001_init(struct efx_nic *efx) | 109 | int sfe4001_init(struct efx_nic *efx) |
109 | { | 110 | { |
110 | (...) | 111 | (...) |
111 | efx->board_info.hwmon_client = | 112 | efx->board_info.hwmon_client = |
112 | i2c_new_device(&efx->i2c_adap, &sfe4001_hwmon_info); | 113 | i2c_new_device(&efx->i2c_adap, &sfe4001_hwmon_info); |
113 | 114 | ||
114 | (...) | 115 | (...) |
115 | } | 116 | } |
116 | 117 | ||
117 | The above code instantiates 1 I2C device on the I2C bus which is on the | 118 | The above code instantiates 1 I2C device on the I2C bus which is on the |
118 | network adapter in question. | 119 | network adapter in question. |
@@ -124,12 +125,12 @@ it may have different addresses from one board to the next (manufacturer | |||
124 | changing its design without notice). In this case, you can call | 125 | changing its design without notice). In this case, you can call |
125 | i2c_new_probed_device() instead of i2c_new_device(). | 126 | i2c_new_probed_device() instead of i2c_new_device(). |
126 | 127 | ||
127 | Example (from the nxp OHCI driver): | 128 | Example (from the nxp OHCI driver):: |
128 | 129 | ||
129 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 130 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
130 | 131 | ||
131 | static int usb_hcd_nxp_probe(struct platform_device *pdev) | 132 | static int usb_hcd_nxp_probe(struct platform_device *pdev) |
132 | { | 133 | { |
133 | (...) | 134 | (...) |
134 | struct i2c_adapter *i2c_adap; | 135 | struct i2c_adapter *i2c_adap; |
135 | struct i2c_board_info i2c_info; | 136 | struct i2c_board_info i2c_info; |
@@ -142,7 +143,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
142 | normal_i2c, NULL); | 143 | normal_i2c, NULL); |
143 | i2c_put_adapter(i2c_adap); | 144 | i2c_put_adapter(i2c_adap); |
144 | (...) | 145 | (...) |
145 | } | 146 | } |
146 | 147 | ||
147 | The above code instantiates up to 1 I2C device on the I2C bus which is on | 148 | The above code instantiates up to 1 I2C device on the I2C bus which is on |
148 | the OHCI adapter in question. It first tries at address 0x2c, if nothing | 149 | the OHCI adapter in question. It first tries at address 0x2c, if nothing |
@@ -172,6 +173,7 @@ explicitly. Instead, i2c-core will probe for such devices as soon as their | |||
172 | drivers are loaded, and if any is found, an I2C device will be | 173 | drivers are loaded, and if any is found, an I2C device will be |
173 | instantiated automatically. In order to prevent any misbehavior of this | 174 | instantiated automatically. In order to prevent any misbehavior of this |
174 | mechanism, the following restrictions apply: | 175 | mechanism, the following restrictions apply: |
176 | |||
175 | * The I2C device driver must implement the detect() method, which | 177 | * The I2C device driver must implement the detect() method, which |
176 | identifies a supported device by reading from arbitrary registers. | 178 | identifies a supported device by reading from arbitrary registers. |
177 | * Only buses which are likely to have a supported device and agree to be | 179 | * Only buses which are likely to have a supported device and agree to be |
@@ -189,6 +191,7 @@ first. | |||
189 | Those of you familiar with the i2c subsystem of 2.4 kernels and early 2.6 | 191 | Those of you familiar with the i2c subsystem of 2.4 kernels and early 2.6 |
190 | kernels will find out that this method 3 is essentially similar to what | 192 | kernels will find out that this method 3 is essentially similar to what |
191 | was done there. Two significant differences are: | 193 | was done there. Two significant differences are: |
194 | |||
192 | * Probing is only one way to instantiate I2C devices now, while it was the | 195 | * Probing is only one way to instantiate I2C devices now, while it was the |
193 | only way back then. Where possible, methods 1 and 2 should be preferred. | 196 | only way back then. Where possible, methods 1 and 2 should be preferred. |
194 | Method 3 should only be used when there is no other way, as it can have | 197 | Method 3 should only be used when there is no other way, as it can have |
@@ -224,11 +227,13 @@ device. As no two devices can live at the same address on a given I2C | |||
224 | segment, the address is sufficient to uniquely identify the device to be | 227 | segment, the address is sufficient to uniquely identify the device to be |
225 | deleted. | 228 | deleted. |
226 | 229 | ||
227 | Example: | 230 | Example:: |
228 | # echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device | 231 | |
232 | # echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device | ||
229 | 233 | ||
230 | While this interface should only be used when in-kernel device declaration | 234 | While this interface should only be used when in-kernel device declaration |
231 | can't be done, there is a variety of cases where it can be helpful: | 235 | can't be done, there is a variety of cases where it can be helpful: |
236 | |||
232 | * The I2C driver usually detects devices (method 3 above) but the bus | 237 | * The I2C driver usually detects devices (method 3 above) but the bus |
233 | segment your device lives on doesn't have the proper class bit set and | 238 | segment your device lives on doesn't have the proper class bit set and |
234 | thus detection doesn't trigger. | 239 | thus detection doesn't trigger. |
diff --git a/Documentation/i2c/muxes/i2c-mux-gpio b/Documentation/i2c/muxes/i2c-mux-gpio.rst index 893ecdfe6e43..7d27444035c3 100644 --- a/Documentation/i2c/muxes/i2c-mux-gpio +++ b/Documentation/i2c/muxes/i2c-mux-gpio.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | ========================== | ||
1 | Kernel driver i2c-mux-gpio | 2 | Kernel driver i2c-mux-gpio |
3 | ========================== | ||
2 | 4 | ||
3 | Author: Peter Korsgaard <peter.korsgaard@barco.com> | 5 | Author: Peter Korsgaard <peter.korsgaard@barco.com> |
4 | 6 | ||
@@ -8,7 +10,7 @@ Description | |||
8 | i2c-mux-gpio is an i2c mux driver providing access to I2C bus segments | 10 | i2c-mux-gpio is an i2c mux driver providing access to I2C bus segments |
9 | from a master I2C bus and a hardware MUX controlled through GPIO pins. | 11 | from a master I2C bus and a hardware MUX controlled through GPIO pins. |
10 | 12 | ||
11 | E.G.: | 13 | E.G.:: |
12 | 14 | ||
13 | ---------- ---------- Bus segment 1 - - - - - | 15 | ---------- ---------- Bus segment 1 - - - - - |
14 | | | SCL/SDA | |-------------- | | | 16 | | | SCL/SDA | |-------------- | | |
@@ -33,20 +35,20 @@ bus, the number of bus segments to create and the GPIO pins used | |||
33 | to control it. See include/linux/platform_data/i2c-mux-gpio.h for details. | 35 | to control it. See include/linux/platform_data/i2c-mux-gpio.h for details. |
34 | 36 | ||
35 | E.G. something like this for a MUX providing 4 bus segments | 37 | E.G. something like this for a MUX providing 4 bus segments |
36 | controlled through 3 GPIO pins: | 38 | controlled through 3 GPIO pins:: |
37 | 39 | ||
38 | #include <linux/platform_data/i2c-mux-gpio.h> | 40 | #include <linux/platform_data/i2c-mux-gpio.h> |
39 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
40 | 42 | ||
41 | static const unsigned myboard_gpiomux_gpios[] = { | 43 | static const unsigned myboard_gpiomux_gpios[] = { |
42 | AT91_PIN_PC26, AT91_PIN_PC25, AT91_PIN_PC24 | 44 | AT91_PIN_PC26, AT91_PIN_PC25, AT91_PIN_PC24 |
43 | }; | 45 | }; |
44 | 46 | ||
45 | static const unsigned myboard_gpiomux_values[] = { | 47 | static const unsigned myboard_gpiomux_values[] = { |
46 | 0, 1, 2, 3 | 48 | 0, 1, 2, 3 |
47 | }; | 49 | }; |
48 | 50 | ||
49 | static struct i2c_mux_gpio_platform_data myboard_i2cmux_data = { | 51 | static struct i2c_mux_gpio_platform_data myboard_i2cmux_data = { |
50 | .parent = 1, | 52 | .parent = 1, |
51 | .base_nr = 2, /* optional */ | 53 | .base_nr = 2, /* optional */ |
52 | .values = myboard_gpiomux_values, | 54 | .values = myboard_gpiomux_values, |
@@ -54,15 +56,15 @@ static struct i2c_mux_gpio_platform_data myboard_i2cmux_data = { | |||
54 | .gpios = myboard_gpiomux_gpios, | 56 | .gpios = myboard_gpiomux_gpios, |
55 | .n_gpios = ARRAY_SIZE(myboard_gpiomux_gpios), | 57 | .n_gpios = ARRAY_SIZE(myboard_gpiomux_gpios), |
56 | .idle = 4, /* optional */ | 58 | .idle = 4, /* optional */ |
57 | }; | 59 | }; |
58 | 60 | ||
59 | static struct platform_device myboard_i2cmux = { | 61 | static struct platform_device myboard_i2cmux = { |
60 | .name = "i2c-mux-gpio", | 62 | .name = "i2c-mux-gpio", |
61 | .id = 0, | 63 | .id = 0, |
62 | .dev = { | 64 | .dev = { |
63 | .platform_data = &myboard_i2cmux_data, | 65 | .platform_data = &myboard_i2cmux_data, |
64 | }, | 66 | }, |
65 | }; | 67 | }; |
66 | 68 | ||
67 | If you don't know the absolute GPIO pin numbers at registration time, | 69 | If you don't know the absolute GPIO pin numbers at registration time, |
68 | you can instead provide a chip name (.chip_name) and relative GPIO pin | 70 | you can instead provide a chip name (.chip_name) and relative GPIO pin |
diff --git a/Documentation/i2c/old-module-parameters b/Documentation/i2c/old-module-parameters.rst index 8e2b629d533c..a1939512ad66 100644 --- a/Documentation/i2c/old-module-parameters +++ b/Documentation/i2c/old-module-parameters.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ================================================= | ||
1 | I2C device driver binding control from user-space | 2 | I2C device driver binding control from user-space |
2 | ================================================= | 3 | ================================================= |
3 | 4 | ||
@@ -19,23 +20,27 @@ Below is a mapping from the old module parameters to the new interface. | |||
19 | Attaching a driver to an I2C device | 20 | Attaching a driver to an I2C device |
20 | ----------------------------------- | 21 | ----------------------------------- |
21 | 22 | ||
22 | Old method (module parameters): | 23 | Old method (module parameters):: |
23 | # modprobe <driver> probe=1,0x2d | 24 | |
24 | # modprobe <driver> force=1,0x2d | 25 | # modprobe <driver> probe=1,0x2d |
25 | # modprobe <driver> force_<device>=1,0x2d | 26 | # modprobe <driver> force=1,0x2d |
27 | # modprobe <driver> force_<device>=1,0x2d | ||
28 | |||
29 | New method (sysfs interface):: | ||
26 | 30 | ||
27 | New method (sysfs interface): | 31 | # echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device |
28 | # echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device | ||
29 | 32 | ||
30 | Preventing a driver from attaching to an I2C device | 33 | Preventing a driver from attaching to an I2C device |
31 | --------------------------------------------------- | 34 | --------------------------------------------------- |
32 | 35 | ||
33 | Old method (module parameters): | 36 | Old method (module parameters):: |
34 | # modprobe <driver> ignore=1,0x2f | 37 | |
38 | # modprobe <driver> ignore=1,0x2f | ||
39 | |||
40 | New method (sysfs interface):: | ||
35 | 41 | ||
36 | New method (sysfs interface): | 42 | # echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device |
37 | # echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device | 43 | # modprobe <driver> |
38 | # modprobe <driver> | ||
39 | 44 | ||
40 | Of course, it is important to instantiate the "dummy" device before loading | 45 | Of course, it is important to instantiate the "dummy" device before loading |
41 | the driver. The dummy device will be handled by i2c-core itself, preventing | 46 | the driver. The dummy device will be handled by i2c-core itself, preventing |
diff --git a/Documentation/i2c/slave-eeprom-backend b/Documentation/i2c/slave-eeprom-backend.rst index 04f8d8a9b817..0b8cd83698e0 100644 --- a/Documentation/i2c/slave-eeprom-backend +++ b/Documentation/i2c/slave-eeprom-backend.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============================== | ||
1 | Linux I2C slave eeprom backend | 2 | Linux I2C slave eeprom backend |
2 | ============================== | 3 | ============================== |
3 | 4 | ||
@@ -5,10 +6,9 @@ by Wolfram Sang <wsa@sang-engineering.com> in 2014-15 | |||
5 | 6 | ||
6 | This is a proof-of-concept backend which acts like an EEPROM on the connected | 7 | This is a proof-of-concept backend which acts like an EEPROM on the connected |
7 | I2C bus. The memory contents can be modified from userspace via this file | 8 | I2C bus. The memory contents can be modified from userspace via this file |
8 | located in sysfs: | 9 | located in sysfs:: |
9 | 10 | ||
10 | /sys/bus/i2c/devices/<device-directory>/slave-eeprom | 11 | /sys/bus/i2c/devices/<device-directory>/slave-eeprom |
11 | 12 | ||
12 | As of 2015, Linux doesn't support poll on binary sysfs files, so there is no | 13 | As of 2015, Linux doesn't support poll on binary sysfs files, so there is no |
13 | notification when another master changed the content. | 14 | notification when another master changed the content. |
14 | |||
diff --git a/Documentation/i2c/slave-interface b/Documentation/i2c/slave-interface.rst index 7e2a228f21bc..c769bd6a15bf 100644 --- a/Documentation/i2c/slave-interface +++ b/Documentation/i2c/slave-interface.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ===================================== | ||
1 | Linux I2C slave interface description | 2 | Linux I2C slave interface description |
2 | ===================================== | 3 | ===================================== |
3 | 4 | ||
@@ -12,7 +13,7 @@ EEPROM, the Linux I2C slave can access the content via sysfs and handle data as | |||
12 | needed. The backend driver and the I2C bus driver communicate via events. Here | 13 | needed. The backend driver and the I2C bus driver communicate via events. Here |
13 | is a small graph visualizing the data flow and the means by which data is | 14 | is a small graph visualizing the data flow and the means by which data is |
14 | transported. The dotted line marks only one example. The backend could also | 15 | transported. The dotted line marks only one example. The backend could also |
15 | use a character device, be in-kernel only, or something completely different: | 16 | use a character device, be in-kernel only, or something completely different:: |
16 | 17 | ||
17 | 18 | ||
18 | e.g. sysfs I2C slave events I/O registers | 19 | e.g. sysfs I2C slave events I/O registers |
@@ -35,7 +36,7 @@ them as described in the document 'instantiating-devices'. The only difference | |||
35 | is that i2c slave backends have their own address space. So, you have to add | 36 | is that i2c slave backends have their own address space. So, you have to add |
36 | 0x1000 to the address you would originally request. An example for | 37 | 0x1000 to the address you would originally request. An example for |
37 | instantiating the slave-eeprom driver from userspace at the 7 bit address 0x64 | 38 | instantiating the slave-eeprom driver from userspace at the 7 bit address 0x64 |
38 | on bus 1: | 39 | on bus 1:: |
39 | 40 | ||
40 | # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device | 41 | # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device |
41 | 42 | ||
@@ -54,7 +55,7 @@ drivers and writing backends will be given. | |||
54 | I2C slave events | 55 | I2C slave events |
55 | ---------------- | 56 | ---------------- |
56 | 57 | ||
57 | The bus driver sends an event to the backend using the following function: | 58 | The bus driver sends an event to the backend using the following function:: |
58 | 59 | ||
59 | ret = i2c_slave_event(client, event, &val) | 60 | ret = i2c_slave_event(client, event, &val) |
60 | 61 | ||
@@ -69,8 +70,9 @@ Event types: | |||
69 | 70 | ||
70 | * I2C_SLAVE_WRITE_REQUESTED (mandatory) | 71 | * I2C_SLAVE_WRITE_REQUESTED (mandatory) |
71 | 72 | ||
72 | 'val': unused | 73 | 'val': unused |
73 | 'ret': always 0 | 74 | |
75 | 'ret': always 0 | ||
74 | 76 | ||
75 | Another I2C master wants to write data to us. This event should be sent once | 77 | Another I2C master wants to write data to us. This event should be sent once |
76 | our own address and the write bit was detected. The data did not arrive yet, so | 78 | our own address and the write bit was detected. The data did not arrive yet, so |
@@ -79,8 +81,9 @@ to be done, though. | |||
79 | 81 | ||
80 | * I2C_SLAVE_READ_REQUESTED (mandatory) | 82 | * I2C_SLAVE_READ_REQUESTED (mandatory) |
81 | 83 | ||
82 | 'val': backend returns first byte to be sent | 84 | 'val': backend returns first byte to be sent |
83 | 'ret': always 0 | 85 | |
86 | 'ret': always 0 | ||
84 | 87 | ||
85 | Another I2C master wants to read data from us. This event should be sent once | 88 | Another I2C master wants to read data from us. This event should be sent once |
86 | our own address and the read bit was detected. After returning, the bus driver | 89 | our own address and the read bit was detected. After returning, the bus driver |
@@ -88,8 +91,9 @@ should transmit the first byte. | |||
88 | 91 | ||
89 | * I2C_SLAVE_WRITE_RECEIVED (mandatory) | 92 | * I2C_SLAVE_WRITE_RECEIVED (mandatory) |
90 | 93 | ||
91 | 'val': bus driver delivers received byte | 94 | 'val': bus driver delivers received byte |
92 | 'ret': 0 if the byte should be acked, some errno if the byte should be nacked | 95 | |
96 | 'ret': 0 if the byte should be acked, some errno if the byte should be nacked | ||
93 | 97 | ||
94 | Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret' | 98 | Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret' |
95 | is zero, the bus driver should ack this byte. If 'ret' is an errno, then the byte | 99 | is zero, the bus driver should ack this byte. If 'ret' is an errno, then the byte |
@@ -97,8 +101,9 @@ should be nacked. | |||
97 | 101 | ||
98 | * I2C_SLAVE_READ_PROCESSED (mandatory) | 102 | * I2C_SLAVE_READ_PROCESSED (mandatory) |
99 | 103 | ||
100 | 'val': backend returns next byte to be sent | 104 | 'val': backend returns next byte to be sent |
101 | 'ret': always 0 | 105 | |
106 | 'ret': always 0 | ||
102 | 107 | ||
103 | The bus driver requests the next byte to be sent to another I2C master in | 108 | The bus driver requests the next byte to be sent to another I2C master in |
104 | 'val'. Important: This does not mean that the previous byte has been acked, it | 109 | 'val'. Important: This does not mean that the previous byte has been acked, it |
@@ -111,8 +116,9 @@ your backend, though. | |||
111 | 116 | ||
112 | * I2C_SLAVE_STOP (mandatory) | 117 | * I2C_SLAVE_STOP (mandatory) |
113 | 118 | ||
114 | 'val': unused | 119 | 'val': unused |
115 | 'ret': always 0 | 120 | |
121 | 'ret': always 0 | ||
116 | 122 | ||
117 | A stop condition was received. This can happen anytime and the backend should | 123 | A stop condition was received. This can happen anytime and the backend should |
118 | reset its state machine for I2C transfers to be able to receive new requests. | 124 | reset its state machine for I2C transfers to be able to receive new requests. |
@@ -190,4 +196,3 @@ this time of writing. Some points to keep in mind when using buffers: | |||
190 | * A master can send STOP at any time. For partially transferred buffers, this | 196 | * A master can send STOP at any time. For partially transferred buffers, this |
191 | means additional code to handle this exception. Such code tends to be | 197 | means additional code to handle this exception. Such code tends to be |
192 | error-prone. | 198 | error-prone. |
193 | |||
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol.rst index 092d474f5843..e30eb1d274c6 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ====================== | ||
1 | SMBus Protocol Summary | 2 | SMBus Protocol Summary |
2 | ====================== | 3 | ====================== |
3 | 4 | ||
@@ -27,17 +28,18 @@ Each transaction type corresponds to a functionality flag. Before calling a | |||
27 | transaction function, a device driver should always check (just once) for | 28 | transaction function, a device driver should always check (just once) for |
28 | the corresponding functionality flag to ensure that the underlying I2C | 29 | the corresponding functionality flag to ensure that the underlying I2C |
29 | adapter supports the transaction in question. See | 30 | adapter supports the transaction in question. See |
30 | <file:Documentation/i2c/functionality> for the details. | 31 | <file:Documentation/i2c/functionality.rst> for the details. |
31 | 32 | ||
32 | 33 | ||
33 | Key to symbols | 34 | Key to symbols |
34 | ============== | 35 | ============== |
35 | 36 | ||
37 | =============== ============================================================= | ||
36 | S (1 bit) : Start bit | 38 | S (1 bit) : Start bit |
37 | P (1 bit) : Stop bit | 39 | P (1 bit) : Stop bit |
38 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. | 40 | Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. |
39 | A, NA (1 bit) : Accept and reverse accept bit. | 41 | A, NA (1 bit) : Accept and reverse accept bit. |
40 | Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to | 42 | Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to |
41 | get a 10 bit I2C address. | 43 | get a 10 bit I2C address. |
42 | Comm (8 bits): Command byte, a data byte which often selects a register on | 44 | Comm (8 bits): Command byte, a data byte which often selects a register on |
43 | the device. | 45 | the device. |
@@ -45,15 +47,17 @@ Data (8 bits): A plain data byte. Sometimes, I write DataLow, DataHigh | |||
45 | for 16 bit data. | 47 | for 16 bit data. |
46 | Count (8 bits): A data byte containing the length of a block operation. | 48 | Count (8 bits): A data byte containing the length of a block operation. |
47 | 49 | ||
48 | [..]: Data sent by I2C device, as opposed to data sent by the host adapter. | 50 | [..]: Data sent by I2C device, as opposed to data sent by the host |
51 | adapter. | ||
52 | =============== ============================================================= | ||
49 | 53 | ||
50 | 54 | ||
51 | SMBus Quick Command | 55 | SMBus Quick Command |
52 | =================== | 56 | =================== |
53 | 57 | ||
54 | This sends a single bit to the device, at the place of the Rd/Wr bit. | 58 | This sends a single bit to the device, at the place of the Rd/Wr bit:: |
55 | 59 | ||
56 | A Addr Rd/Wr [A] P | 60 | A Addr Rd/Wr [A] P |
57 | 61 | ||
58 | Functionality flag: I2C_FUNC_SMBUS_QUICK | 62 | Functionality flag: I2C_FUNC_SMBUS_QUICK |
59 | 63 | ||
@@ -64,9 +68,9 @@ SMBus Receive Byte: i2c_smbus_read_byte() | |||
64 | This reads a single byte from a device, without specifying a device | 68 | This reads a single byte from a device, without specifying a device |
65 | register. Some devices are so simple that this interface is enough; for | 69 | register. Some devices are so simple that this interface is enough; for |
66 | others, it is a shorthand if you want to read the same register as in | 70 | others, it is a shorthand if you want to read the same register as in |
67 | the previous SMBus command. | 71 | the previous SMBus command:: |
68 | 72 | ||
69 | S Addr Rd [A] [Data] NA P | 73 | S Addr Rd [A] [Data] NA P |
70 | 74 | ||
71 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE | 75 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE |
72 | 76 | ||
@@ -77,7 +81,9 @@ SMBus Send Byte: i2c_smbus_write_byte() | |||
77 | This operation is the reverse of Receive Byte: it sends a single byte | 81 | This operation is the reverse of Receive Byte: it sends a single byte |
78 | to a device. See Receive Byte for more information. | 82 | to a device. See Receive Byte for more information. |
79 | 83 | ||
80 | S Addr Wr [A] Data [A] P | 84 | :: |
85 | |||
86 | S Addr Wr [A] Data [A] P | ||
81 | 87 | ||
82 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE | 88 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE |
83 | 89 | ||
@@ -86,9 +92,9 @@ SMBus Read Byte: i2c_smbus_read_byte_data() | |||
86 | ============================================ | 92 | ============================================ |
87 | 93 | ||
88 | This reads a single byte from a device, from a designated register. | 94 | This reads a single byte from a device, from a designated register. |
89 | The register is specified through the Comm byte. | 95 | The register is specified through the Comm byte:: |
90 | 96 | ||
91 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P | 97 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P |
92 | 98 | ||
93 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA | 99 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA |
94 | 100 | ||
@@ -98,9 +104,9 @@ SMBus Read Word: i2c_smbus_read_word_data() | |||
98 | 104 | ||
99 | This operation is very like Read Byte; again, data is read from a | 105 | This operation is very like Read Byte; again, data is read from a |
100 | device, from a designated register that is specified through the Comm | 106 | device, from a designated register that is specified through the Comm |
101 | byte. But this time, the data is a complete word (16 bits). | 107 | byte. But this time, the data is a complete word (16 bits):: |
102 | 108 | ||
103 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P | 109 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P |
104 | 110 | ||
105 | Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA | 111 | Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA |
106 | 112 | ||
@@ -116,7 +122,9 @@ This writes a single byte to a device, to a designated register. The | |||
116 | register is specified through the Comm byte. This is the opposite of | 122 | register is specified through the Comm byte. This is the opposite of |
117 | the Read Byte operation. | 123 | the Read Byte operation. |
118 | 124 | ||
119 | S Addr Wr [A] Comm [A] Data [A] P | 125 | :: |
126 | |||
127 | S Addr Wr [A] Comm [A] Data [A] P | ||
120 | 128 | ||
121 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA | 129 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
122 | 130 | ||
@@ -126,9 +134,9 @@ SMBus Write Word: i2c_smbus_write_word_data() | |||
126 | 134 | ||
127 | This is the opposite of the Read Word operation. 16 bits | 135 | This is the opposite of the Read Word operation. 16 bits |
128 | of data is written to a device, to the designated register that is | 136 | of data is written to a device, to the designated register that is |
129 | specified through the Comm byte. | 137 | specified through the Comm byte.:: |
130 | 138 | ||
131 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P | 139 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
132 | 140 | ||
133 | Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA | 141 | Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA |
134 | 142 | ||
@@ -141,10 +149,10 @@ SMBus Process Call: | |||
141 | =================== | 149 | =================== |
142 | 150 | ||
143 | This command selects a device register (through the Comm byte), sends | 151 | This command selects a device register (through the Comm byte), sends |
144 | 16 bits of data to it, and reads 16 bits of data in return. | 152 | 16 bits of data to it, and reads 16 bits of data in return:: |
145 | 153 | ||
146 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] | 154 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] |
147 | S Addr Rd [A] [DataLow] A [DataHigh] NA P | 155 | S Addr Rd [A] [DataLow] A [DataHigh] NA P |
148 | 156 | ||
149 | Functionality flag: I2C_FUNC_SMBUS_PROC_CALL | 157 | Functionality flag: I2C_FUNC_SMBUS_PROC_CALL |
150 | 158 | ||
@@ -152,12 +160,14 @@ Functionality flag: I2C_FUNC_SMBUS_PROC_CALL | |||
152 | SMBus Block Read: i2c_smbus_read_block_data() | 160 | SMBus Block Read: i2c_smbus_read_block_data() |
153 | ============================================== | 161 | ============================================== |
154 | 162 | ||
155 | This command reads a block of up to 32 bytes from a device, from a | 163 | This command reads a block of up to 32 bytes from a device, from a |
156 | designated register that is specified through the Comm byte. The amount | 164 | designated register that is specified through the Comm byte. The amount |
157 | of data is specified by the device in the Count byte. | 165 | of data is specified by the device in the Count byte. |
158 | 166 | ||
159 | S Addr Wr [A] Comm [A] | 167 | :: |
160 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P | 168 | |
169 | S Addr Wr [A] Comm [A] | ||
170 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P | ||
161 | 171 | ||
162 | Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA | 172 | Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA |
163 | 173 | ||
@@ -165,11 +175,13 @@ Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA | |||
165 | SMBus Block Write: i2c_smbus_write_block_data() | 175 | SMBus Block Write: i2c_smbus_write_block_data() |
166 | ================================================ | 176 | ================================================ |
167 | 177 | ||
168 | The opposite of the Block Read command, this writes up to 32 bytes to | 178 | The opposite of the Block Read command, this writes up to 32 bytes to |
169 | a device, to a designated register that is specified through the | 179 | a device, to a designated register that is specified through the |
170 | Comm byte. The amount of data is specified in the Count byte. | 180 | Comm byte. The amount of data is specified in the Count byte. |
171 | 181 | ||
172 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P | 182 | :: |
183 | |||
184 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P | ||
173 | 185 | ||
174 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | 186 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA |
175 | 187 | ||
@@ -181,10 +193,10 @@ SMBus Block Write - Block Read Process Call was introduced in | |||
181 | Revision 2.0 of the specification. | 193 | Revision 2.0 of the specification. |
182 | 194 | ||
183 | This command selects a device register (through the Comm byte), sends | 195 | This command selects a device register (through the Comm byte), sends |
184 | 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return. | 196 | 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return:: |
185 | 197 | ||
186 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... | 198 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... |
187 | S Addr Rd [A] [Count] A [Data] ... A P | 199 | S Addr Rd [A] [Count] A [Data] ... A P |
188 | 200 | ||
189 | Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL | 201 | Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL |
190 | 202 | ||
@@ -197,9 +209,12 @@ SMBus host acting as a slave. | |||
197 | It is the same form as Write Word, with the command code replaced by the | 209 | It is the same form as Write Word, with the command code replaced by the |
198 | alerting device's address. | 210 | alerting device's address. |
199 | 211 | ||
200 | [S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P] | 212 | :: |
213 | |||
214 | [S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P] | ||
201 | 215 | ||
202 | This is implemented in the following way in the Linux kernel: | 216 | This is implemented in the following way in the Linux kernel: |
217 | |||
203 | * I2C bus drivers which support SMBus Host Notify should report | 218 | * I2C bus drivers which support SMBus Host Notify should report |
204 | I2C_FUNC_SMBUS_HOST_NOTIFY. | 219 | I2C_FUNC_SMBUS_HOST_NOTIFY. |
205 | * I2C bus drivers trigger SMBus Host Notify by a call to | 220 | * I2C bus drivers trigger SMBus Host Notify by a call to |
@@ -241,6 +256,7 @@ single interrupt pin on the SMBus master, while still allowing the master | |||
241 | to know which slave triggered the interrupt. | 256 | to know which slave triggered the interrupt. |
242 | 257 | ||
243 | This is implemented the following way in the Linux kernel: | 258 | This is implemented the following way in the Linux kernel: |
259 | |||
244 | * I2C bus drivers which support SMBus alert should call | 260 | * I2C bus drivers which support SMBus alert should call |
245 | i2c_setup_smbus_alert() to setup SMBus alert support. | 261 | i2c_setup_smbus_alert() to setup SMBus alert support. |
246 | * I2C drivers for devices which can trigger SMBus alerts should implement | 262 | * I2C drivers for devices which can trigger SMBus alerts should implement |
@@ -261,11 +277,11 @@ but the SMBus layer places a limit of 32 bytes. | |||
261 | I2C Block Read: i2c_smbus_read_i2c_block_data() | 277 | I2C Block Read: i2c_smbus_read_i2c_block_data() |
262 | ================================================ | 278 | ================================================ |
263 | 279 | ||
264 | This command reads a block of bytes from a device, from a | 280 | This command reads a block of bytes from a device, from a |
265 | designated register that is specified through the Comm byte. | 281 | designated register that is specified through the Comm byte:: |
266 | 282 | ||
267 | S Addr Wr [A] Comm [A] | 283 | S Addr Wr [A] Comm [A] |
268 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | 284 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P |
269 | 285 | ||
270 | Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK | 286 | Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK |
271 | 287 | ||
@@ -273,11 +289,13 @@ Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK | |||
273 | I2C Block Write: i2c_smbus_write_i2c_block_data() | 289 | I2C Block Write: i2c_smbus_write_i2c_block_data() |
274 | ================================================== | 290 | ================================================== |
275 | 291 | ||
276 | The opposite of the Block Read command, this writes bytes to | 292 | The opposite of the Block Read command, this writes bytes to |
277 | a device, to a designated register that is specified through the | 293 | a device, to a designated register that is specified through the |
278 | Comm byte. Note that command lengths of 0, 2, or more bytes are | 294 | Comm byte. Note that command lengths of 0, 2, or more bytes are |
279 | supported as they are indistinguishable from data. | 295 | supported as they are indistinguishable from data. |
280 | 296 | ||
281 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P | 297 | :: |
298 | |||
299 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P | ||
282 | 300 | ||
283 | Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK | 301 | Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK |
diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary.rst index 809541ab352f..3a24eac17375 100644 --- a/Documentation/i2c/summary +++ b/Documentation/i2c/summary.rst | |||
@@ -1,7 +1,8 @@ | |||
1 | ============= | ||
1 | I2C and SMBus | 2 | I2C and SMBus |
2 | ============= | 3 | ============= |
3 | 4 | ||
4 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a | 5 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a |
5 | slow two-wire protocol (variable speed, up to 400 kHz), with a high speed | 6 | slow two-wire protocol (variable speed, up to 400 kHz), with a high speed |
6 | extension (3.4 MHz). It provides an inexpensive bus for connecting many | 7 | extension (3.4 MHz). It provides an inexpensive bus for connecting many |
7 | types of devices with infrequent or low bandwidth communications needs. | 8 | types of devices with infrequent or low bandwidth communications needs. |
@@ -24,7 +25,8 @@ implement all the common SMBus protocol semantics or messages. | |||
24 | Terminology | 25 | Terminology |
25 | =========== | 26 | =========== |
26 | 27 | ||
27 | When we talk about I2C, we use the following terms: | 28 | When we talk about I2C, we use the following terms:: |
29 | |||
28 | Bus -> Algorithm | 30 | Bus -> Algorithm |
29 | Adapter | 31 | Adapter |
30 | Device -> Driver | 32 | Device -> Driver |
diff --git a/Documentation/i2c/ten-bit-addresses b/Documentation/i2c/ten-bit-addresses.rst index 7b2d11e53a49..5c765aff16d5 100644 --- a/Documentation/i2c/ten-bit-addresses +++ b/Documentation/i2c/ten-bit-addresses.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ===================== | ||
2 | I2C Ten-bit Addresses | ||
3 | ===================== | ||
4 | |||
1 | The I2C protocol knows about two kinds of device addresses: normal 7 bit | 5 | The I2C protocol knows about two kinds of device addresses: normal 7 bit |
2 | addresses, and an extended set of 10 bit addresses. The sets of addresses | 6 | addresses, and an extended set of 10 bit addresses. The sets of addresses |
3 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit | 7 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit |
@@ -12,6 +16,7 @@ See the I2C specification for the details. | |||
12 | 16 | ||
13 | The current 10 bit address support is minimal. It should work, however | 17 | The current 10 bit address support is minimal. It should work, however |
14 | you can expect some problems along the way: | 18 | you can expect some problems along the way: |
19 | |||
15 | * Not all bus drivers support 10-bit addresses. Some don't because the | 20 | * Not all bus drivers support 10-bit addresses. Some don't because the |
16 | hardware doesn't support them (SMBus doesn't require 10-bit address | 21 | hardware doesn't support them (SMBus doesn't require 10-bit address |
17 | support for example), some don't because nobody bothered adding the | 22 | support for example), some don't because nobody bothered adding the |
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients.rst index 96392cc5b5c7..27d29032c138 100644 --- a/Documentation/i2c/upgrading-clients +++ b/Documentation/i2c/upgrading-clients.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ================================================= | ||
1 | Upgrading I2C Drivers to the new 2.6 Driver Model | 2 | Upgrading I2C Drivers to the new 2.6 Driver Model |
2 | ================================================= | 3 | ================================================= |
3 | 4 | ||
@@ -13,21 +14,22 @@ the old to the new new binding methods. | |||
13 | Example old-style driver | 14 | Example old-style driver |
14 | ------------------------ | 15 | ------------------------ |
15 | 16 | ||
17 | :: | ||
16 | 18 | ||
17 | struct example_state { | 19 | struct example_state { |
18 | struct i2c_client client; | 20 | struct i2c_client client; |
19 | .... | 21 | .... |
20 | }; | 22 | }; |
21 | 23 | ||
22 | static struct i2c_driver example_driver; | 24 | static struct i2c_driver example_driver; |
23 | 25 | ||
24 | static unsigned short ignore[] = { I2C_CLIENT_END }; | 26 | static unsigned short ignore[] = { I2C_CLIENT_END }; |
25 | static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | 27 | static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; |
26 | 28 | ||
27 | I2C_CLIENT_INSMOD; | 29 | I2C_CLIENT_INSMOD; |
28 | 30 | ||
29 | static int example_attach(struct i2c_adapter *adap, int addr, int kind) | 31 | static int example_attach(struct i2c_adapter *adap, int addr, int kind) |
30 | { | 32 | { |
31 | struct example_state *state; | 33 | struct example_state *state; |
32 | struct device *dev = &adap->dev; /* to use for dev_ reports */ | 34 | struct device *dev = &adap->dev; /* to use for dev_ reports */ |
33 | int ret; | 35 | int ret; |
@@ -59,31 +61,31 @@ static int example_attach(struct i2c_adapter *adap, int addr, int kind) | |||
59 | dev_info(dev, "example client created\n"); | 61 | dev_info(dev, "example client created\n"); |
60 | 62 | ||
61 | return 0; | 63 | return 0; |
62 | } | 64 | } |
63 | 65 | ||
64 | static int example_detach(struct i2c_client *client) | 66 | static int example_detach(struct i2c_client *client) |
65 | { | 67 | { |
66 | struct example_state *state = i2c_get_clientdata(client); | 68 | struct example_state *state = i2c_get_clientdata(client); |
67 | 69 | ||
68 | i2c_detach_client(client); | 70 | i2c_detach_client(client); |
69 | kfree(state); | 71 | kfree(state); |
70 | return 0; | 72 | return 0; |
71 | } | 73 | } |
72 | 74 | ||
73 | static int example_attach_adapter(struct i2c_adapter *adap) | 75 | static int example_attach_adapter(struct i2c_adapter *adap) |
74 | { | 76 | { |
75 | return i2c_probe(adap, &addr_data, example_attach); | 77 | return i2c_probe(adap, &addr_data, example_attach); |
76 | } | 78 | } |
77 | 79 | ||
78 | static struct i2c_driver example_driver = { | 80 | static struct i2c_driver example_driver = { |
79 | .driver = { | 81 | .driver = { |
80 | .owner = THIS_MODULE, | 82 | .owner = THIS_MODULE, |
81 | .name = "example", | 83 | .name = "example", |
82 | .pm = &example_pm_ops, | 84 | .pm = &example_pm_ops, |
83 | }, | 85 | }, |
84 | .attach_adapter = example_attach_adapter, | 86 | .attach_adapter = example_attach_adapter, |
85 | .detach_client = example_detach, | 87 | .detach_client = example_detach, |
86 | }; | 88 | }; |
87 | 89 | ||
88 | 90 | ||
89 | Updating the client | 91 | Updating the client |
@@ -93,38 +95,38 @@ The new style binding model will check against a list of supported | |||
93 | devices and their associated address supplied by the code registering | 95 | devices and their associated address supplied by the code registering |
94 | the busses. This means that the driver .attach_adapter and | 96 | the busses. This means that the driver .attach_adapter and |
95 | .detach_client methods can be removed, along with the addr_data, | 97 | .detach_client methods can be removed, along with the addr_data, |
96 | as follows: | 98 | as follows:: |
97 | 99 | ||
98 | - static struct i2c_driver example_driver; | 100 | - static struct i2c_driver example_driver; |
99 | 101 | ||
100 | - static unsigned short ignore[] = { I2C_CLIENT_END }; | 102 | - static unsigned short ignore[] = { I2C_CLIENT_END }; |
101 | - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; | 103 | - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; |
102 | 104 | ||
103 | - I2C_CLIENT_INSMOD; | 105 | - I2C_CLIENT_INSMOD; |
104 | 106 | ||
105 | - static int example_attach_adapter(struct i2c_adapter *adap) | 107 | - static int example_attach_adapter(struct i2c_adapter *adap) |
106 | - { | 108 | - { |
107 | - return i2c_probe(adap, &addr_data, example_attach); | 109 | - return i2c_probe(adap, &addr_data, example_attach); |
108 | - } | 110 | - } |
109 | 111 | ||
110 | static struct i2c_driver example_driver = { | 112 | static struct i2c_driver example_driver = { |
111 | - .attach_adapter = example_attach_adapter, | 113 | - .attach_adapter = example_attach_adapter, |
112 | - .detach_client = example_detach, | 114 | - .detach_client = example_detach, |
113 | } | 115 | } |
114 | 116 | ||
115 | Add the probe and remove methods to the i2c_driver, as so: | 117 | Add the probe and remove methods to the i2c_driver, as so:: |
116 | 118 | ||
117 | static struct i2c_driver example_driver = { | 119 | static struct i2c_driver example_driver = { |
118 | + .probe = example_probe, | 120 | + .probe = example_probe, |
119 | + .remove = example_remove, | 121 | + .remove = example_remove, |
120 | } | 122 | } |
121 | 123 | ||
122 | Change the example_attach method to accept the new parameters | 124 | Change the example_attach method to accept the new parameters |
123 | which include the i2c_client that it will be working with: | 125 | which include the i2c_client that it will be working with:: |
124 | 126 | ||
125 | - static int example_attach(struct i2c_adapter *adap, int addr, int kind) | 127 | - static int example_attach(struct i2c_adapter *adap, int addr, int kind) |
126 | + static int example_probe(struct i2c_client *client, | 128 | + static int example_probe(struct i2c_client *client, |
127 | + const struct i2c_device_id *id) | 129 | + const struct i2c_device_id *id) |
128 | 130 | ||
129 | Change the name of example_attach to example_probe to align it with the | 131 | Change the name of example_attach to example_probe to align it with the |
130 | i2c_driver entry names. The rest of the probe routine will now need to be | 132 | i2c_driver entry names. The rest of the probe routine will now need to be |
@@ -132,57 +134,59 @@ changed as the i2c_client has already been setup for use. | |||
132 | 134 | ||
133 | The necessary client fields have already been setup before | 135 | The necessary client fields have already been setup before |
134 | the probe function is called, so the following client setup | 136 | the probe function is called, so the following client setup |
135 | can be removed: | 137 | can be removed:: |
136 | 138 | ||
137 | - example->client.addr = addr; | 139 | - example->client.addr = addr; |
138 | - example->client.flags = 0; | 140 | - example->client.flags = 0; |
139 | - example->client.adapter = adap; | 141 | - example->client.adapter = adap; |
140 | - | 142 | - |
141 | - strscpy(client->i2c_client.name, "example", sizeof(client->i2c_client.name)); | 143 | - strscpy(client->i2c_client.name, "example", sizeof(client->i2c_client.name)); |
142 | 144 | ||
143 | The i2c_set_clientdata is now: | 145 | The i2c_set_clientdata is now:: |
144 | 146 | ||
145 | - i2c_set_clientdata(&state->client, state); | 147 | - i2c_set_clientdata(&state->client, state); |
146 | + i2c_set_clientdata(client, state); | 148 | + i2c_set_clientdata(client, state); |
147 | 149 | ||
148 | The call to i2c_attach_client is no longer needed, if the probe | 150 | The call to i2c_attach_client is no longer needed, if the probe |
149 | routine exits successfully, then the driver will be automatically | 151 | routine exits successfully, then the driver will be automatically |
150 | attached by the core. Change the probe routine as so: | 152 | attached by the core. Change the probe routine as so:: |
151 | 153 | ||
152 | - ret = i2c_attach_client(&state->i2c_client); | 154 | - ret = i2c_attach_client(&state->i2c_client); |
153 | - if (ret < 0) { | 155 | - if (ret < 0) { |
154 | - dev_err(dev, "failed to attach client\n"); | 156 | - dev_err(dev, "failed to attach client\n"); |
155 | - kfree(state); | 157 | - kfree(state); |
156 | - return ret; | 158 | - return ret; |
157 | - } | 159 | - } |
158 | 160 | ||
159 | 161 | ||
160 | Remove the storage of 'struct i2c_client' from the 'struct example_state' | 162 | Remove the storage of 'struct i2c_client' from the 'struct example_state' |
161 | as we are provided with the i2c_client in our example_probe. Instead we | 163 | as we are provided with the i2c_client in our example_probe. Instead we |
162 | store a pointer to it for when it is needed. | 164 | store a pointer to it for when it is needed. |
163 | 165 | ||
164 | struct example_state { | 166 | :: |
165 | - struct i2c_client client; | 167 | |
166 | + struct i2c_client *client; | 168 | struct example_state { |
169 | - struct i2c_client client; | ||
170 | + struct i2c_client *client; | ||
167 | 171 | ||
168 | the new i2c client as so: | 172 | the new i2c client as so:: |
169 | 173 | ||
170 | - struct device *dev = &adap->dev; /* to use for dev_ reports */ | 174 | - struct device *dev = &adap->dev; /* to use for dev_ reports */ |
171 | + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ | 175 | + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ |
172 | 176 | ||
173 | And remove the change after our client is attached, as the driver no | 177 | And remove the change after our client is attached, as the driver no |
174 | longer needs to register a new client structure with the core: | 178 | longer needs to register a new client structure with the core:: |
175 | 179 | ||
176 | - dev = &state->i2c_client.dev; | 180 | - dev = &state->i2c_client.dev; |
177 | 181 | ||
178 | In the probe routine, ensure that the new state has the client stored | 182 | In the probe routine, ensure that the new state has the client stored |
179 | in it: | 183 | in it:: |
180 | 184 | ||
181 | static int example_probe(struct i2c_client *i2c_client, | 185 | static int example_probe(struct i2c_client *i2c_client, |
182 | const struct i2c_device_id *id) | 186 | const struct i2c_device_id *id) |
183 | { | 187 | { |
184 | struct example_state *state; | 188 | struct example_state *state; |
185 | struct device *dev = &i2c_client->dev; | 189 | struct device *dev = &i2c_client->dev; |
186 | int ret; | 190 | int ret; |
187 | 191 | ||
188 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); | 192 | state = kzalloc(sizeof(struct example_state), GFP_KERNEL); |
@@ -191,48 +195,50 @@ static int example_probe(struct i2c_client *i2c_client, | |||
191 | return -ENOMEM; | 195 | return -ENOMEM; |
192 | } | 196 | } |
193 | 197 | ||
194 | + state->client = i2c_client; | 198 | + state->client = i2c_client; |
195 | 199 | ||
196 | Update the detach method, by changing the name to _remove and | 200 | Update the detach method, by changing the name to _remove and |
197 | to delete the i2c_detach_client call. It is possible that you | 201 | to delete the i2c_detach_client call. It is possible that you |
198 | can also remove the ret variable as it is not needed for any | 202 | can also remove the ret variable as it is not needed for any |
199 | of the core functions. | 203 | of the core functions. |
200 | 204 | ||
201 | - static int example_detach(struct i2c_client *client) | 205 | :: |
202 | + static int example_remove(struct i2c_client *client) | 206 | |
203 | { | 207 | - static int example_detach(struct i2c_client *client) |
208 | + static int example_remove(struct i2c_client *client) | ||
209 | { | ||
204 | struct example_state *state = i2c_get_clientdata(client); | 210 | struct example_state *state = i2c_get_clientdata(client); |
205 | 211 | ||
206 | - i2c_detach_client(client); | 212 | - i2c_detach_client(client); |
207 | 213 | ||
208 | And finally ensure that we have the correct ID table for the i2c-core | 214 | And finally ensure that we have the correct ID table for the i2c-core |
209 | and other utilities: | 215 | and other utilities:: |
210 | 216 | ||
211 | + struct i2c_device_id example_idtable[] = { | 217 | + struct i2c_device_id example_idtable[] = { |
212 | + { "example", 0 }, | 218 | + { "example", 0 }, |
213 | + { } | 219 | + { } |
214 | +}; | 220 | +}; |
215 | + | 221 | + |
216 | +MODULE_DEVICE_TABLE(i2c, example_idtable); | 222 | +MODULE_DEVICE_TABLE(i2c, example_idtable); |
217 | 223 | ||
218 | static struct i2c_driver example_driver = { | 224 | static struct i2c_driver example_driver = { |
219 | .driver = { | 225 | .driver = { |
220 | .owner = THIS_MODULE, | 226 | .owner = THIS_MODULE, |
221 | .name = "example", | 227 | .name = "example", |
222 | }, | 228 | }, |
223 | + .id_table = example_ids, | 229 | + .id_table = example_ids, |
224 | 230 | ||
225 | 231 | ||
226 | Our driver should now look like this: | 232 | Our driver should now look like this:: |
227 | 233 | ||
228 | struct example_state { | 234 | struct example_state { |
229 | struct i2c_client *client; | 235 | struct i2c_client *client; |
230 | .... | 236 | .... |
231 | }; | 237 | }; |
232 | 238 | ||
233 | static int example_probe(struct i2c_client *client, | 239 | static int example_probe(struct i2c_client *client, |
234 | const struct i2c_device_id *id) | 240 | const struct i2c_device_id *id) |
235 | { | 241 | { |
236 | struct example_state *state; | 242 | struct example_state *state; |
237 | struct device *dev = &client->dev; | 243 | struct device *dev = &client->dev; |
238 | 244 | ||
@@ -250,25 +256,25 @@ static int example_probe(struct i2c_client *client, | |||
250 | dev_info(dev, "example client created\n"); | 256 | dev_info(dev, "example client created\n"); |
251 | 257 | ||
252 | return 0; | 258 | return 0; |
253 | } | 259 | } |
254 | 260 | ||
255 | static int example_remove(struct i2c_client *client) | 261 | static int example_remove(struct i2c_client *client) |
256 | { | 262 | { |
257 | struct example_state *state = i2c_get_clientdata(client); | 263 | struct example_state *state = i2c_get_clientdata(client); |
258 | 264 | ||
259 | kfree(state); | 265 | kfree(state); |
260 | return 0; | 266 | return 0; |
261 | } | 267 | } |
262 | 268 | ||
263 | static struct i2c_device_id example_idtable[] = { | 269 | static struct i2c_device_id example_idtable[] = { |
264 | { "example", 0 }, | 270 | { "example", 0 }, |
265 | { } | 271 | { } |
266 | }; | 272 | }; |
267 | 273 | ||
268 | MODULE_DEVICE_TABLE(i2c, example_idtable); | 274 | MODULE_DEVICE_TABLE(i2c, example_idtable); |
269 | 275 | ||
270 | static struct i2c_driver example_driver = { | 276 | static struct i2c_driver example_driver = { |
271 | .driver = { | 277 | .driver = { |
272 | .owner = THIS_MODULE, | 278 | .owner = THIS_MODULE, |
273 | .name = "example", | 279 | .name = "example", |
274 | .pm = &example_pm_ops, | 280 | .pm = &example_pm_ops, |
@@ -276,4 +282,4 @@ static struct i2c_driver example_driver = { | |||
276 | .id_table = example_idtable, | 282 | .id_table = example_idtable, |
277 | .probe = example_probe, | 283 | .probe = example_probe, |
278 | .remove = example_remove, | 284 | .remove = example_remove, |
279 | }; | 285 | }; |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients.rst index a755b141fa4a..dddf0a14ab7c 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | =================== | ||
2 | Writing I2C Clients | ||
3 | =================== | ||
4 | |||
1 | This is a small guide for those who want to write kernel drivers for I2C | 5 | This is a small guide for those who want to write kernel drivers for I2C |
2 | or SMBus devices, using Linux as the protocol host/master (not slave). | 6 | or SMBus devices, using Linux as the protocol host/master (not slave). |
3 | 7 | ||
@@ -12,7 +16,7 @@ General remarks | |||
12 | Try to keep the kernel namespace as clean as possible. The best way to | 16 | Try to keep the kernel namespace as clean as possible. The best way to |
13 | do this is to use a unique prefix for all global symbols. This is | 17 | do this is to use a unique prefix for all global symbols. This is |
14 | especially important for exported symbols, but it is a good idea to do | 18 | especially important for exported symbols, but it is a good idea to do |
15 | it for non-exported symbols too. We will use the prefix `foo_' in this | 19 | it for non-exported symbols too. We will use the prefix ``foo_`` in this |
16 | tutorial. | 20 | tutorial. |
17 | 21 | ||
18 | 22 | ||
@@ -25,15 +29,17 @@ routines, and should be zero-initialized except for fields with data you | |||
25 | provide. A client structure holds device-specific information like the | 29 | provide. A client structure holds device-specific information like the |
26 | driver model device node, and its I2C address. | 30 | driver model device node, and its I2C address. |
27 | 31 | ||
28 | static struct i2c_device_id foo_idtable[] = { | 32 | :: |
33 | |||
34 | static struct i2c_device_id foo_idtable[] = { | ||
29 | { "foo", my_id_for_foo }, | 35 | { "foo", my_id_for_foo }, |
30 | { "bar", my_id_for_bar }, | 36 | { "bar", my_id_for_bar }, |
31 | { } | 37 | { } |
32 | }; | 38 | }; |
33 | 39 | ||
34 | MODULE_DEVICE_TABLE(i2c, foo_idtable); | 40 | MODULE_DEVICE_TABLE(i2c, foo_idtable); |
35 | 41 | ||
36 | static struct i2c_driver foo_driver = { | 42 | static struct i2c_driver foo_driver = { |
37 | .driver = { | 43 | .driver = { |
38 | .name = "foo", | 44 | .name = "foo", |
39 | .pm = &foo_pm_ops, /* optional */ | 45 | .pm = &foo_pm_ops, /* optional */ |
@@ -49,7 +55,7 @@ static struct i2c_driver foo_driver = { | |||
49 | 55 | ||
50 | .shutdown = foo_shutdown, /* optional */ | 56 | .shutdown = foo_shutdown, /* optional */ |
51 | .command = foo_command, /* optional, deprecated */ | 57 | .command = foo_command, /* optional, deprecated */ |
52 | } | 58 | } |
53 | 59 | ||
54 | The name field is the driver name, and must not contain spaces. It | 60 | The name field is the driver name, and must not contain spaces. It |
55 | should match the module name (if the driver can be compiled as a module), | 61 | should match the module name (if the driver can be compiled as a module), |
@@ -64,16 +70,18 @@ below. | |||
64 | Extra client data | 70 | Extra client data |
65 | ================= | 71 | ================= |
66 | 72 | ||
67 | Each client structure has a special `data' field that can point to any | 73 | Each client structure has a special ``data`` field that can point to any |
68 | structure at all. You should use this to keep device-specific data. | 74 | structure at all. You should use this to keep device-specific data. |
69 | 75 | ||
76 | :: | ||
77 | |||
70 | /* store the value */ | 78 | /* store the value */ |
71 | void i2c_set_clientdata(struct i2c_client *client, void *data); | 79 | void i2c_set_clientdata(struct i2c_client *client, void *data); |
72 | 80 | ||
73 | /* retrieve the value */ | 81 | /* retrieve the value */ |
74 | void *i2c_get_clientdata(const struct i2c_client *client); | 82 | void *i2c_get_clientdata(const struct i2c_client *client); |
75 | 83 | ||
76 | Note that starting with kernel 2.6.34, you don't have to set the `data' field | 84 | Note that starting with kernel 2.6.34, you don't have to set the ``data`` field |
77 | to NULL in remove() or if probe() failed anymore. The i2c-core does this | 85 | to NULL in remove() or if probe() failed anymore. The i2c-core does this |
78 | automatically on these occasions. Those are also the only times the core will | 86 | automatically on these occasions. Those are also the only times the core will |
79 | touch this field. | 87 | touch this field. |
@@ -92,25 +100,25 @@ but many chips have some kind of register-value idea that can easily | |||
92 | be encapsulated. | 100 | be encapsulated. |
93 | 101 | ||
94 | The below functions are simple examples, and should not be copied | 102 | The below functions are simple examples, and should not be copied |
95 | literally. | 103 | literally:: |
96 | 104 | ||
97 | int foo_read_value(struct i2c_client *client, u8 reg) | 105 | int foo_read_value(struct i2c_client *client, u8 reg) |
98 | { | 106 | { |
99 | if (reg < 0x10) /* byte-sized register */ | 107 | if (reg < 0x10) /* byte-sized register */ |
100 | return i2c_smbus_read_byte_data(client, reg); | 108 | return i2c_smbus_read_byte_data(client, reg); |
101 | else /* word-sized register */ | 109 | else /* word-sized register */ |
102 | return i2c_smbus_read_word_data(client, reg); | 110 | return i2c_smbus_read_word_data(client, reg); |
103 | } | 111 | } |
104 | 112 | ||
105 | int foo_write_value(struct i2c_client *client, u8 reg, u16 value) | 113 | int foo_write_value(struct i2c_client *client, u8 reg, u16 value) |
106 | { | 114 | { |
107 | if (reg == 0x10) /* Impossible to write - driver error! */ | 115 | if (reg == 0x10) /* Impossible to write - driver error! */ |
108 | return -EINVAL; | 116 | return -EINVAL; |
109 | else if (reg < 0x10) /* byte-sized register */ | 117 | else if (reg < 0x10) /* byte-sized register */ |
110 | return i2c_smbus_write_byte_data(client, reg, value); | 118 | return i2c_smbus_write_byte_data(client, reg, value); |
111 | else /* word-sized register */ | 119 | else /* word-sized register */ |
112 | return i2c_smbus_write_word_data(client, reg, value); | 120 | return i2c_smbus_write_word_data(client, reg, value); |
113 | } | 121 | } |
114 | 122 | ||
115 | 123 | ||
116 | Probing and attaching | 124 | Probing and attaching |
@@ -145,6 +153,8 @@ I2C device drivers using this binding model work just like any other | |||
145 | kind of driver in Linux: they provide a probe() method to bind to | 153 | kind of driver in Linux: they provide a probe() method to bind to |
146 | those devices, and a remove() method to unbind. | 154 | those devices, and a remove() method to unbind. |
147 | 155 | ||
156 | :: | ||
157 | |||
148 | static int foo_probe(struct i2c_client *client, | 158 | static int foo_probe(struct i2c_client *client, |
149 | const struct i2c_device_id *id); | 159 | const struct i2c_device_id *id); |
150 | static int foo_remove(struct i2c_client *client); | 160 | static int foo_remove(struct i2c_client *client); |
@@ -240,37 +250,41 @@ When the kernel is booted, or when your foo driver module is inserted, | |||
240 | you have to do some initializing. Fortunately, just registering the | 250 | you have to do some initializing. Fortunately, just registering the |
241 | driver module is usually enough. | 251 | driver module is usually enough. |
242 | 252 | ||
243 | static int __init foo_init(void) | 253 | :: |
244 | { | 254 | |
255 | static int __init foo_init(void) | ||
256 | { | ||
245 | return i2c_add_driver(&foo_driver); | 257 | return i2c_add_driver(&foo_driver); |
246 | } | 258 | } |
247 | module_init(foo_init); | 259 | module_init(foo_init); |
248 | 260 | ||
249 | static void __exit foo_cleanup(void) | 261 | static void __exit foo_cleanup(void) |
250 | { | 262 | { |
251 | i2c_del_driver(&foo_driver); | 263 | i2c_del_driver(&foo_driver); |
252 | } | 264 | } |
253 | module_exit(foo_cleanup); | 265 | module_exit(foo_cleanup); |
254 | 266 | ||
255 | The module_i2c_driver() macro can be used to reduce above code. | 267 | The module_i2c_driver() macro can be used to reduce above code. |
256 | 268 | ||
257 | module_i2c_driver(foo_driver); | 269 | module_i2c_driver(foo_driver); |
258 | 270 | ||
259 | Note that some functions are marked by `__init'. These functions can | 271 | Note that some functions are marked by ``__init``. These functions can |
260 | be removed after kernel booting (or module loading) is completed. | 272 | be removed after kernel booting (or module loading) is completed. |
261 | Likewise, functions marked by `__exit' are dropped by the compiler when | 273 | Likewise, functions marked by ``__exit`` are dropped by the compiler when |
262 | the code is built into the kernel, as they would never be called. | 274 | the code is built into the kernel, as they would never be called. |
263 | 275 | ||
264 | 276 | ||
265 | Driver Information | 277 | Driver Information |
266 | ================== | 278 | ================== |
267 | 279 | ||
268 | /* Substitute your own name and email address */ | 280 | :: |
269 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | ||
270 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | ||
271 | 281 | ||
272 | /* a few non-GPL license types are also allowed */ | 282 | /* Substitute your own name and email address */ |
273 | MODULE_LICENSE("GPL"); | 283 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" |
284 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | ||
285 | |||
286 | /* a few non-GPL license types are also allowed */ | ||
287 | MODULE_LICENSE("GPL"); | ||
274 | 288 | ||
275 | 289 | ||
276 | Power Management | 290 | Power Management |
@@ -323,6 +337,8 @@ commands, but only some of them understand plain I2C! | |||
323 | Plain I2C communication | 337 | Plain I2C communication |
324 | ----------------------- | 338 | ----------------------- |
325 | 339 | ||
340 | :: | ||
341 | |||
326 | int i2c_master_send(struct i2c_client *client, const char *buf, | 342 | int i2c_master_send(struct i2c_client *client, const char *buf, |
327 | int count); | 343 | int count); |
328 | int i2c_master_recv(struct i2c_client *client, char *buf, int count); | 344 | int i2c_master_recv(struct i2c_client *client, char *buf, int count); |
@@ -334,6 +350,8 @@ to read/write (must be less than the length of the buffer, also should be | |||
334 | less than 64k since msg.len is u16.) Returned is the actual number of bytes | 350 | less than 64k since msg.len is u16.) Returned is the actual number of bytes |
335 | read/written. | 351 | read/written. |
336 | 352 | ||
353 | :: | ||
354 | |||
337 | int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, | 355 | int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, |
338 | int num); | 356 | int num); |
339 | 357 | ||
@@ -343,13 +361,15 @@ stop bit is sent between transaction. The i2c_msg structure contains | |||
343 | for each message the client address, the number of bytes of the message | 361 | for each message the client address, the number of bytes of the message |
344 | and the message data itself. | 362 | and the message data itself. |
345 | 363 | ||
346 | You can read the file `i2c-protocol' for more information about the | 364 | You can read the file ``i2c-protocol`` for more information about the |
347 | actual I2C protocol. | 365 | actual I2C protocol. |
348 | 366 | ||
349 | 367 | ||
350 | SMBus communication | 368 | SMBus communication |
351 | ------------------- | 369 | ------------------- |
352 | 370 | ||
371 | :: | ||
372 | |||
353 | s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, | 373 | s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, |
354 | unsigned short flags, char read_write, u8 command, | 374 | unsigned short flags, char read_write, u8 command, |
355 | int size, union i2c_smbus_data *data); | 375 | int size, union i2c_smbus_data *data); |
@@ -357,6 +377,8 @@ SMBus communication | |||
357 | This is the generic SMBus function. All functions below are implemented | 377 | This is the generic SMBus function. All functions below are implemented |
358 | in terms of it. Never use this function directly! | 378 | in terms of it. Never use this function directly! |
359 | 379 | ||
380 | :: | ||
381 | |||
360 | s32 i2c_smbus_read_byte(struct i2c_client *client); | 382 | s32 i2c_smbus_read_byte(struct i2c_client *client); |
361 | s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); | 383 | s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); |
362 | s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); | 384 | s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); |
@@ -376,7 +398,7 @@ in terms of it. Never use this function directly! | |||
376 | const u8 *values); | 398 | const u8 *values); |
377 | 399 | ||
378 | These ones were removed from i2c-core because they had no users, but could | 400 | These ones were removed from i2c-core because they had no users, but could |
379 | be added back later if needed: | 401 | be added back later if needed:: |
380 | 402 | ||
381 | s32 i2c_smbus_write_quick(struct i2c_client *client, u8 value); | 403 | s32 i2c_smbus_write_quick(struct i2c_client *client, u8 value); |
382 | s32 i2c_smbus_process_call(struct i2c_client *client, | 404 | s32 i2c_smbus_process_call(struct i2c_client *client, |
@@ -389,7 +411,7 @@ transactions return 0 on success; the 'read' transactions return the read | |||
389 | value, except for block transactions, which return the number of values | 411 | value, except for block transactions, which return the number of values |
390 | read. The block buffers need not be longer than 32 bytes. | 412 | read. The block buffers need not be longer than 32 bytes. |
391 | 413 | ||
392 | You can read the file `smbus-protocol' for more information about the | 414 | You can read the file ``smbus-protocol`` for more information about the |
393 | actual SMBus protocol. | 415 | actual SMBus protocol. |
394 | 416 | ||
395 | 417 | ||
@@ -397,7 +419,7 @@ General purpose routines | |||
397 | ======================== | 419 | ======================== |
398 | 420 | ||
399 | Below all general purpose routines are listed, that were not mentioned | 421 | Below all general purpose routines are listed, that were not mentioned |
400 | before. | 422 | before:: |
401 | 423 | ||
402 | /* Return the adapter number for a specific adapter */ | 424 | /* Return the adapter number for a specific adapter */ |
403 | int i2c_adapter_id(struct i2c_adapter *adap); | 425 | int i2c_adapter_id(struct i2c_adapter *adap); |
diff --git a/Documentation/index.rst b/Documentation/index.rst index 2df5a3da563c..b5fd87e7dbee 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst | |||
@@ -104,7 +104,9 @@ needed). | |||
104 | fb/index | 104 | fb/index |
105 | fpga/index | 105 | fpga/index |
106 | hid/index | 106 | hid/index |
107 | i2c/index | ||
107 | iio/index | 108 | iio/index |
109 | isdn/index | ||
108 | infiniband/index | 110 | infiniband/index |
109 | leds/index | 111 | leds/index |
110 | media/index | 112 | media/index |
@@ -114,8 +116,10 @@ needed). | |||
114 | power/index | 116 | power/index |
115 | target/index | 117 | target/index |
116 | timers/index | 118 | timers/index |
119 | spi/index | ||
120 | w1/index | ||
117 | watchdog/index | 121 | watchdog/index |
118 | virtual/index | 122 | virt/index |
119 | input/index | 123 | input/index |
120 | hwmon/index | 124 | hwmon/index |
121 | gpu/index | 125 | gpu/index |
@@ -146,6 +150,10 @@ implementation. | |||
146 | ia64/index | 150 | ia64/index |
147 | m68k/index | 151 | m68k/index |
148 | powerpc/index | 152 | powerpc/index |
153 | mips/index | ||
154 | nios2/nios2 | ||
155 | openrisc/index | ||
156 | parisc/index | ||
149 | riscv/index | 157 | riscv/index |
150 | s390/index | 158 | s390/index |
151 | sh/index | 159 | sh/index |
diff --git a/Documentation/input/multi-touch-protocol.rst b/Documentation/input/multi-touch-protocol.rst index 6be70342e709..307fe22d9668 100644 --- a/Documentation/input/multi-touch-protocol.rst +++ b/Documentation/input/multi-touch-protocol.rst | |||
@@ -23,7 +23,7 @@ devices capable of tracking identifiable contacts (type B), the protocol | |||
23 | describes how to send updates for individual contacts via event slots. | 23 | describes how to send updates for individual contacts via event slots. |
24 | 24 | ||
25 | .. note:: | 25 | .. note:: |
26 | MT potocol type A is obsolete, all kernel drivers have been | 26 | MT protocol type A is obsolete, all kernel drivers have been |
27 | converted to use type B. | 27 | converted to use type B. |
28 | 28 | ||
29 | Protocol Usage | 29 | Protocol Usage |
diff --git a/Documentation/isdn/README.avmb1 b/Documentation/isdn/avmb1.rst index 9e075484ef1e..de3961e67553 100644 --- a/Documentation/isdn/README.avmb1 +++ b/Documentation/isdn/avmb1.rst | |||
@@ -1,4 +1,6 @@ | |||
1 | Driver for active AVM Controller. | 1 | ================================ |
2 | Driver for active AVM Controller | ||
3 | ================================ | ||
2 | 4 | ||
3 | The driver provides a kernel capi2.0 Interface (kernelcapi) and | 5 | The driver provides a kernel capi2.0 Interface (kernelcapi) and |
4 | on top of this a User-Level-CAPI2.0-interface (capi) | 6 | on top of this a User-Level-CAPI2.0-interface (capi) |
@@ -11,25 +13,28 @@ The command avmcapictrl is part of the isdn4k-utils. | |||
11 | t4-files can be found at ftp://ftp.avm.de/cardware/b1/linux/firmware | 13 | t4-files can be found at ftp://ftp.avm.de/cardware/b1/linux/firmware |
12 | 14 | ||
13 | Currently supported cards: | 15 | Currently supported cards: |
14 | B1 ISA (all versions) | 16 | |
15 | B1 PCI | 17 | - B1 ISA (all versions) |
16 | T1/T1B (HEMA card) | 18 | - B1 PCI |
17 | M1 | 19 | - T1/T1B (HEMA card) |
18 | M2 | 20 | - M1 |
19 | B1 PCMCIA | 21 | - M2 |
22 | - B1 PCMCIA | ||
20 | 23 | ||
21 | Installing | 24 | Installing |
22 | ---------- | 25 | ---------- |
23 | 26 | ||
24 | You need at least /dev/capi20 to load the firmware. | 27 | You need at least /dev/capi20 to load the firmware. |
25 | 28 | ||
26 | mknod /dev/capi20 c 68 0 | 29 | :: |
27 | mknod /dev/capi20.00 c 68 1 | 30 | |
28 | mknod /dev/capi20.01 c 68 2 | 31 | mknod /dev/capi20 c 68 0 |
29 | . | 32 | mknod /dev/capi20.00 c 68 1 |
30 | . | 33 | mknod /dev/capi20.01 c 68 2 |
31 | . | 34 | . |
32 | mknod /dev/capi20.19 c 68 20 | 35 | . |
36 | . | ||
37 | mknod /dev/capi20.19 c 68 20 | ||
33 | 38 | ||
34 | Running | 39 | Running |
35 | ------- | 40 | ------- |
@@ -38,45 +43,58 @@ To use the card you need the t4-files to download the firmware. | |||
38 | AVM GmbH provides several t4-files for the different D-channel | 43 | AVM GmbH provides several t4-files for the different D-channel |
39 | protocols (b1.t4 for Euro-ISDN). Install these file in /lib/isdn. | 44 | protocols (b1.t4 for Euro-ISDN). Install these file in /lib/isdn. |
40 | 45 | ||
41 | if you configure as modules load the modules this way: | 46 | if you configure as modules load the modules this way:: |
47 | |||
48 | insmod /lib/modules/current/misc/capiutil.o | ||
49 | insmod /lib/modules/current/misc/b1.o | ||
50 | insmod /lib/modules/current/misc/kernelcapi.o | ||
51 | insmod /lib/modules/current/misc/capidrv.o | ||
52 | insmod /lib/modules/current/misc/capi.o | ||
42 | 53 | ||
43 | insmod /lib/modules/current/misc/capiutil.o | 54 | if you have an B1-PCI card load the module b1pci.o:: |
44 | insmod /lib/modules/current/misc/b1.o | ||
45 | insmod /lib/modules/current/misc/kernelcapi.o | ||
46 | insmod /lib/modules/current/misc/capidrv.o | ||
47 | insmod /lib/modules/current/misc/capi.o | ||
48 | 55 | ||
49 | if you have an B1-PCI card load the module b1pci.o | 56 | insmod /lib/modules/current/misc/b1pci.o |
50 | insmod /lib/modules/current/misc/b1pci.o | 57 | |
51 | and load the firmware with | 58 | and load the firmware with:: |
52 | avmcapictrl load /lib/isdn/b1.t4 1 | 59 | |
60 | avmcapictrl load /lib/isdn/b1.t4 1 | ||
53 | 61 | ||
54 | if you have an B1-ISA card load the module b1isa.o | 62 | if you have an B1-ISA card load the module b1isa.o |
55 | and add the card by calling | 63 | and add the card by calling:: |
56 | avmcapictrl add 0x150 15 | 64 | |
57 | and load the firmware by calling | 65 | avmcapictrl add 0x150 15 |
58 | avmcapictrl load /lib/isdn/b1.t4 1 | 66 | |
67 | and load the firmware by calling:: | ||
68 | |||
69 | avmcapictrl load /lib/isdn/b1.t4 1 | ||
59 | 70 | ||
60 | if you have an T1-ISA card load the module t1isa.o | 71 | if you have an T1-ISA card load the module t1isa.o |
61 | and add the card by calling | 72 | and add the card by calling:: |
62 | avmcapictrl add 0x450 15 T1 0 | 73 | |
63 | and load the firmware by calling | 74 | avmcapictrl add 0x450 15 T1 0 |
64 | avmcapictrl load /lib/isdn/t1.t4 1 | 75 | |
76 | and load the firmware by calling:: | ||
77 | |||
78 | avmcapictrl load /lib/isdn/t1.t4 1 | ||
65 | 79 | ||
66 | if you have an PCMCIA card (B1/M1/M2) load the module b1pcmcia.o | 80 | if you have an PCMCIA card (B1/M1/M2) load the module b1pcmcia.o |
67 | before you insert the card. | 81 | before you insert the card. |
68 | 82 | ||
69 | Leased Lines with B1 | 83 | Leased Lines with B1 |
70 | -------------------- | 84 | -------------------- |
85 | |||
71 | Init card and load firmware. | 86 | Init card and load firmware. |
87 | |||
72 | For an D64S use "FV: 1" as phone number | 88 | For an D64S use "FV: 1" as phone number |
89 | |||
73 | For an D64S2 use "FV: 1" and "FV: 2" for multilink | 90 | For an D64S2 use "FV: 1" and "FV: 2" for multilink |
74 | or "FV: 1,2" to use CAPI channel bundling. | 91 | or "FV: 1,2" to use CAPI channel bundling. |
75 | 92 | ||
76 | /proc-Interface | 93 | /proc-Interface |
77 | ----------------- | 94 | ----------------- |
78 | 95 | ||
79 | /proc/capi: | 96 | /proc/capi:: |
97 | |||
80 | dr-xr-xr-x 2 root root 0 Jul 1 14:03 . | 98 | dr-xr-xr-x 2 root root 0 Jul 1 14:03 . |
81 | dr-xr-xr-x 82 root root 0 Jun 30 19:08 .. | 99 | dr-xr-xr-x 82 root root 0 Jun 30 19:08 .. |
82 | -r--r--r-- 1 root root 0 Jul 1 14:03 applications | 100 | -r--r--r-- 1 root root 0 Jul 1 14:03 applications |
@@ -91,84 +109,124 @@ or "FV: 1,2" to use CAPI channel bundling. | |||
91 | 109 | ||
92 | /proc/capi/applications: | 110 | /proc/capi/applications: |
93 | applid level3cnt datablkcnt datablklen ncci-cnt recvqueuelen | 111 | applid level3cnt datablkcnt datablklen ncci-cnt recvqueuelen |
94 | level3cnt: capi_register parameter | 112 | level3cnt: |
95 | datablkcnt: capi_register parameter | 113 | capi_register parameter |
96 | ncci-cnt: current number of nccis (connections) | 114 | datablkcnt: |
97 | recvqueuelen: number of messages on receive queue | 115 | capi_register parameter |
98 | for example: | 116 | ncci-cnt: |
99 | 1 -2 16 2048 1 0 | 117 | current number of nccis (connections) |
100 | 2 2 7 2048 1 0 | 118 | recvqueuelen: |
119 | number of messages on receive queue | ||
120 | |||
121 | for example:: | ||
122 | |||
123 | 1 -2 16 2048 1 0 | ||
124 | 2 2 7 2048 1 0 | ||
101 | 125 | ||
102 | /proc/capi/applstats: | 126 | /proc/capi/applstats: |
103 | applid recvctlmsg nrecvdatamsg nsentctlmsg nsentdatamsg | 127 | applid recvctlmsg nrecvdatamsg nsentctlmsg nsentdatamsg |
104 | recvctlmsg: capi messages received without DATA_B3_IND | 128 | recvctlmsg: |
105 | recvdatamsg: capi DATA_B3_IND received | 129 | capi messages received without DATA_B3_IND |
106 | sentctlmsg: capi messages sent without DATA_B3_REQ | 130 | recvdatamsg: |
107 | sentdatamsg: capi DATA_B3_REQ sent | 131 | capi DATA_B3_IND received |
108 | for example: | 132 | sentctlmsg: |
109 | 1 2057 1699 1721 1699 | 133 | capi messages sent without DATA_B3_REQ |
134 | sentdatamsg: | ||
135 | capi DATA_B3_REQ sent | ||
136 | |||
137 | for example:: | ||
138 | |||
139 | 1 2057 1699 1721 1699 | ||
110 | 140 | ||
111 | /proc/capi/capi20: statistics of capi.o (/dev/capi20) | 141 | /proc/capi/capi20: statistics of capi.o (/dev/capi20) |
112 | minor nopen nrecvdropmsg nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg | 142 | minor nopen nrecvdropmsg nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg |
113 | minor: minor device number of capi device | 143 | minor: |
114 | nopen: number of calls to devices open | 144 | minor device number of capi device |
115 | nrecvdropmsg: capi messages dropped (messages in recvqueue in close) | 145 | nopen: |
116 | nrecvctlmsg: capi messages received without DATA_B3_IND | 146 | number of calls to devices open |
117 | nrecvdatamsg: capi DATA_B3_IND received | 147 | nrecvdropmsg: |
118 | nsentctlmsg: capi messages sent without DATA_B3_REQ | 148 | capi messages dropped (messages in recvqueue in close) |
119 | nsentdatamsg: capi DATA_B3_REQ sent | 149 | nrecvctlmsg: |
120 | 150 | capi messages received without DATA_B3_IND | |
121 | for example: | 151 | nrecvdatamsg: |
122 | 1 2 18 0 16 2 | 152 | capi DATA_B3_IND received |
153 | nsentctlmsg: | ||
154 | capi messages sent without DATA_B3_REQ | ||
155 | nsentdatamsg: | ||
156 | capi DATA_B3_REQ sent | ||
157 | |||
158 | for example:: | ||
159 | |||
160 | 1 2 18 0 16 2 | ||
123 | 161 | ||
124 | /proc/capi/capidrv: statistics of capidrv.o (capi messages) | 162 | /proc/capi/capidrv: statistics of capidrv.o (capi messages) |
125 | nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg | 163 | nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg |
126 | nrecvctlmsg: capi messages received without DATA_B3_IND | 164 | nrecvctlmsg: |
127 | nrecvdatamsg: capi DATA_B3_IND received | 165 | capi messages received without DATA_B3_IND |
128 | nsentctlmsg: capi messages sent without DATA_B3_REQ | 166 | nrecvdatamsg: |
129 | nsentdatamsg: capi DATA_B3_REQ sent | 167 | capi DATA_B3_IND received |
168 | nsentctlmsg: | ||
169 | capi messages sent without DATA_B3_REQ | ||
170 | nsentdatamsg: | ||
171 | capi DATA_B3_REQ sent | ||
172 | |||
130 | for example: | 173 | for example: |
131 | 2780 2226 2256 2226 | 174 | 2780 2226 2256 2226 |
132 | 175 | ||
133 | /proc/capi/controller: | 176 | /proc/capi/controller: |
134 | controller drivername state cardname controllerinfo | 177 | controller drivername state cardname controllerinfo |
135 | for example: | 178 | |
136 | 1 b1pci running b1pci-e000 B1 3.07-01 0xe000 19 | 179 | for example:: |
137 | 2 t1isa running t1isa-450 B1 3.07-01 0x450 11 0 | 180 | |
138 | 3 b1pcmcia running m2-150 B1 3.07-01 0x150 5 | 181 | 1 b1pci running b1pci-e000 B1 3.07-01 0xe000 19 |
182 | 2 t1isa running t1isa-450 B1 3.07-01 0x450 11 0 | ||
183 | 3 b1pcmcia running m2-150 B1 3.07-01 0x150 5 | ||
139 | 184 | ||
140 | /proc/capi/contrstats: | 185 | /proc/capi/contrstats: |
141 | controller nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg | 186 | controller nrecvctlmsg nrecvdatamsg sentctlmsg sentdatamsg |
142 | nrecvctlmsg: capi messages received without DATA_B3_IND | 187 | nrecvctlmsg: |
143 | nrecvdatamsg: capi DATA_B3_IND received | 188 | capi messages received without DATA_B3_IND |
144 | nsentctlmsg: capi messages sent without DATA_B3_REQ | 189 | nrecvdatamsg: |
145 | nsentdatamsg: capi DATA_B3_REQ sent | 190 | capi DATA_B3_IND received |
146 | for example: | 191 | nsentctlmsg: |
147 | 1 2845 2272 2310 2274 | 192 | capi messages sent without DATA_B3_REQ |
148 | 2 2 0 2 0 | 193 | nsentdatamsg: |
149 | 3 2 0 2 0 | 194 | capi DATA_B3_REQ sent |
195 | |||
196 | for example:: | ||
197 | |||
198 | 1 2845 2272 2310 2274 | ||
199 | 2 2 0 2 0 | ||
200 | 3 2 0 2 0 | ||
150 | 201 | ||
151 | /proc/capi/driver: | 202 | /proc/capi/driver: |
152 | drivername ncontroller | 203 | drivername ncontroller |
153 | for example: | 204 | |
154 | b1pci 1 | 205 | for example:: |
155 | t1isa 1 | 206 | |
156 | b1pcmcia 1 | 207 | b1pci 1 |
157 | b1isa 0 | 208 | t1isa 1 |
209 | b1pcmcia 1 | ||
210 | b1isa 0 | ||
158 | 211 | ||
159 | /proc/capi/ncci: | 212 | /proc/capi/ncci: |
160 | apllid ncci winsize sendwindow | 213 | apllid ncci winsize sendwindow |
161 | for example: | 214 | |
162 | 1 0x10101 8 0 | 215 | for example:: |
216 | |||
217 | 1 0x10101 8 0 | ||
163 | 218 | ||
164 | /proc/capi/users: kernelmodules that use the kernelcapi. | 219 | /proc/capi/users: kernelmodules that use the kernelcapi. |
165 | name | 220 | name |
166 | for example: | 221 | |
167 | capidrv | 222 | for example:: |
168 | capi20 | 223 | |
224 | capidrv | ||
225 | capi20 | ||
169 | 226 | ||
170 | Questions | 227 | Questions |
171 | --------- | 228 | --------- |
229 | |||
172 | Check out the FAQ (ftp.isdn4linux.de) or subscribe to the | 230 | Check out the FAQ (ftp.isdn4linux.de) or subscribe to the |
173 | linux-avmb1@calle.in-berlin.de mailing list by sending | 231 | linux-avmb1@calle.in-berlin.de mailing list by sending |
174 | a mail to majordomo@calle.in-berlin.de with | 232 | a mail to majordomo@calle.in-berlin.de with |
@@ -178,9 +236,10 @@ in the body. | |||
178 | German documentation and several scripts can be found at | 236 | German documentation and several scripts can be found at |
179 | ftp://ftp.avm.de/cardware/b1/linux/ | 237 | ftp://ftp.avm.de/cardware/b1/linux/ |
180 | 238 | ||
181 | Bugs | 239 | Bugs |
182 | ---- | 240 | ---- |
183 | If you find any please let me know. | 241 | |
242 | If you find any please let me know. | ||
184 | 243 | ||
185 | Enjoy, | 244 | Enjoy, |
186 | 245 | ||
diff --git a/Documentation/isdn/CREDITS b/Documentation/isdn/credits.rst index c1679e913fca..319323f2091f 100644 --- a/Documentation/isdn/CREDITS +++ b/Documentation/isdn/credits.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ======= | ||
2 | Credits | ||
3 | ======= | ||
4 | |||
1 | 5 | ||
2 | I want to thank all who contributed to this project and especially to: | 6 | I want to thank all who contributed to this project and especially to: |
3 | (in alphabetical order) | 7 | (in alphabetical order) |
@@ -19,7 +23,7 @@ Matthias Hessler (hessler@isdn4linux.de) | |||
19 | For creating and maintaining the FAQ. | 23 | For creating and maintaining the FAQ. |
20 | 24 | ||
21 | Bernhard Hailer (Bernhard.Hailer@lrz.uni-muenchen.de) | 25 | Bernhard Hailer (Bernhard.Hailer@lrz.uni-muenchen.de) |
22 | For creating the FAQ, and the leafsite HOWTO. | 26 | For creating the FAQ, and the leafsite HOWTO. |
23 | 27 | ||
24 | Michael 'Ghandi' Herold (michael@abadonna.franken.de) | 28 | Michael 'Ghandi' Herold (michael@abadonna.franken.de) |
25 | For contribution of the vbox answering machine. | 29 | For contribution of the vbox answering machine. |
@@ -67,4 +71,3 @@ Gerhard 'Fido' Schneider (fido@wuff.mayn.de) | |||
67 | Thomas Uhl (uhl@think.de) | 71 | Thomas Uhl (uhl@think.de) |
68 | For distributing the cards. | 72 | For distributing the cards. |
69 | For pushing me to work ;-) | 73 | For pushing me to work ;-) |
70 | |||
diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/gigaset.rst index f6184b637182..98b4ec521c51 100644 --- a/Documentation/isdn/README.gigaset +++ b/Documentation/isdn/gigaset.rst | |||
@@ -1,33 +1,36 @@ | |||
1 | ========================== | ||
1 | GigaSet 307x Device Driver | 2 | GigaSet 307x Device Driver |
2 | ========================== | 3 | ========================== |
3 | 4 | ||
4 | 1. Requirements | 5 | 1. Requirements |
5 | ------------ | 6 | ================= |
7 | |||
6 | 1.1. Hardware | 8 | 1.1. Hardware |
7 | -------- | 9 | ------------- |
10 | |||
8 | This driver supports the connection of the Gigaset 307x/417x family of | 11 | This driver supports the connection of the Gigaset 307x/417x family of |
9 | ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB | 12 | ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB |
10 | connection. The following devices are reported to be compatible: | 13 | connection. The following devices are reported to be compatible: |
11 | 14 | ||
12 | Bases: | 15 | Bases: |
13 | Siemens Gigaset 3070/3075 isdn | 16 | - Siemens Gigaset 3070/3075 isdn |
14 | Siemens Gigaset 4170/4175 isdn | 17 | - Siemens Gigaset 4170/4175 isdn |
15 | Siemens Gigaset SX205/255 | 18 | - Siemens Gigaset SX205/255 |
16 | Siemens Gigaset SX353 | 19 | - Siemens Gigaset SX353 |
17 | T-Com Sinus 45 [AB] isdn | 20 | - T-Com Sinus 45 [AB] isdn |
18 | T-Com Sinus 721X[A] [SE] | 21 | - T-Com Sinus 721X[A] [SE] |
19 | Vox Chicago 390 ISDN (KPN Telecom) | 22 | - Vox Chicago 390 ISDN (KPN Telecom) |
20 | 23 | ||
21 | RS232 data boxes: | 24 | RS232 data boxes: |
22 | Siemens Gigaset M101 Data | 25 | - Siemens Gigaset M101 Data |
23 | T-Com Sinus 45 Data 1 | 26 | - T-Com Sinus 45 Data 1 |
24 | 27 | ||
25 | USB data boxes: | 28 | USB data boxes: |
26 | Siemens Gigaset M105 Data | 29 | - Siemens Gigaset M105 Data |
27 | Siemens Gigaset USB Adapter DECT | 30 | - Siemens Gigaset USB Adapter DECT |
28 | T-Com Sinus 45 Data 2 | 31 | - T-Com Sinus 45 Data 2 |
29 | T-Com Sinus 721 data | 32 | - T-Com Sinus 721 data |
30 | Chicago 390 USB (KPN) | 33 | - Chicago 390 USB (KPN) |
31 | 34 | ||
32 | See also http://www.erbze.info/sinus_gigaset.htm | 35 | See also http://www.erbze.info/sinus_gigaset.htm |
33 | (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm ) and | 36 | (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm ) and |
@@ -37,17 +40,21 @@ GigaSet 307x Device Driver | |||
37 | with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.) | 40 | with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.) |
38 | If you have another device that works with our driver, please let us know. | 41 | If you have another device that works with our driver, please let us know. |
39 | 42 | ||
40 | Chances of getting an USB device to work are good if the output of | 43 | Chances of getting an USB device to work are good if the output of:: |
41 | lsusb | 44 | |
42 | at the command line contains one of the following: | 45 | lsusb |
43 | ID 0681:0001 | 46 | |
44 | ID 0681:0002 | 47 | at the command line contains one of the following:: |
45 | ID 0681:0009 | 48 | |
46 | ID 0681:0021 | 49 | ID 0681:0001 |
47 | ID 0681:0022 | 50 | ID 0681:0002 |
51 | ID 0681:0009 | ||
52 | ID 0681:0021 | ||
53 | ID 0681:0022 | ||
48 | 54 | ||
49 | 1.2. Software | 55 | 1.2. Software |
50 | -------- | 56 | ------------- |
57 | |||
51 | The driver works with the Kernel CAPI subsystem and can be used with any | 58 | The driver works with the Kernel CAPI subsystem and can be used with any |
52 | software which is able to use CAPI 2.0 for ISDN connections (voice or data). | 59 | software which is able to use CAPI 2.0 for ISDN connections (voice or data). |
53 | 60 | ||
@@ -58,9 +65,11 @@ GigaSet 307x Device Driver | |||
58 | 65 | ||
59 | 66 | ||
60 | 2. How to use the driver | 67 | 2. How to use the driver |
61 | --------------------- | 68 | ========================== |
69 | |||
62 | 2.1. Modules | 70 | 2.1. Modules |
63 | ------- | 71 | ------------ |
72 | |||
64 | For the devices to work, the proper kernel modules have to be loaded. | 73 | For the devices to work, the proper kernel modules have to be loaded. |
65 | This normally happens automatically when the system detects the USB | 74 | This normally happens automatically when the system detects the USB |
66 | device (base, M105) or when the line discipline is attached (M101). It | 75 | device (base, M105) or when the line discipline is attached (M101). It |
@@ -71,13 +80,17 @@ GigaSet 307x Device Driver | |||
71 | which uses the regular serial port driver to access the device, and must | 80 | which uses the regular serial port driver to access the device, and must |
72 | therefore be attached to the serial device to which the M101 is connected. | 81 | therefore be attached to the serial device to which the M101 is connected. |
73 | The ldattach(8) command (included in util-linux-ng release 2.14 or later) | 82 | The ldattach(8) command (included in util-linux-ng release 2.14 or later) |
74 | can be used for that purpose, for example: | 83 | can be used for that purpose, for example:: |
84 | |||
75 | ldattach GIGASET_M101 /dev/ttyS1 | 85 | ldattach GIGASET_M101 /dev/ttyS1 |
86 | |||
76 | This will open the device file, attach the line discipline to it, and | 87 | This will open the device file, attach the line discipline to it, and |
77 | then sleep in the background, keeping the device open so that the line | 88 | then sleep in the background, keeping the device open so that the line |
78 | discipline remains active. To deactivate it, kill the daemon, for example | 89 | discipline remains active. To deactivate it, kill the daemon, for example |
79 | with | 90 | with:: |
91 | |||
80 | killall ldattach | 92 | killall ldattach |
93 | |||
81 | before disconnecting the device. To have this happen automatically at | 94 | before disconnecting the device. To have this happen automatically at |
82 | system startup/shutdown on an LSB compatible system, create and activate | 95 | system startup/shutdown on an LSB compatible system, create and activate |
83 | an appropriate LSB startup script /etc/init.d/gigaset. (The init name | 96 | an appropriate LSB startup script /etc/init.d/gigaset. (The init name |
@@ -86,9 +99,10 @@ GigaSet 307x Device Driver | |||
86 | 99 | ||
87 | The modules accept the following parameters: | 100 | The modules accept the following parameters: |
88 | 101 | ||
89 | Module Parameter Meaning | 102 | =============== ========== ========================================== |
103 | Module Parameter Meaning | ||
90 | 104 | ||
91 | gigaset debug debug level (see section 3.2.) | 105 | gigaset debug debug level (see section 3.2.) |
92 | 106 | ||
93 | startmode initial operation mode (see section 2.5.): | 107 | startmode initial operation mode (see section 2.5.): |
94 | bas_gigaset ) 1=CAPI (default), 0=Unimodem | 108 | bas_gigaset ) 1=CAPI (default), 0=Unimodem |
@@ -96,11 +110,14 @@ GigaSet 307x Device Driver | |||
96 | usb_gigaset ) cidmode initial Call-ID mode setting (see section | 110 | usb_gigaset ) cidmode initial Call-ID mode setting (see section |
97 | 2.5.): 1=on (default), 0=off | 111 | 2.5.): 1=on (default), 0=off |
98 | 112 | ||
113 | =============== ========== ========================================== | ||
114 | |||
99 | Depending on your distribution you may want to create a separate module | 115 | Depending on your distribution you may want to create a separate module |
100 | configuration file like /etc/modprobe.d/gigaset.conf for these. | 116 | configuration file like /etc/modprobe.d/gigaset.conf for these. |
101 | 117 | ||
102 | 2.2. Device nodes for user space programs | 118 | 2.2. Device nodes for user space programs |
103 | ------------------------------------ | 119 | ----------------------------------------- |
120 | |||
104 | The device can be accessed from user space (eg. by the user space tools | 121 | The device can be accessed from user space (eg. by the user space tools |
105 | mentioned in 1.2.) through the device nodes: | 122 | mentioned in 1.2.) through the device nodes: |
106 | 123 | ||
@@ -113,46 +130,56 @@ GigaSet 307x Device Driver | |||
113 | 130 | ||
114 | You can also set a "default device" for the user space tools to use when | 131 | You can also set a "default device" for the user space tools to use when |
115 | no device node is given as parameter, by creating a symlink /dev/ttyG to | 132 | no device node is given as parameter, by creating a symlink /dev/ttyG to |
116 | one of them, eg.: | 133 | one of them, eg.:: |
117 | 134 | ||
118 | ln -s /dev/ttyGB0 /dev/ttyG | 135 | ln -s /dev/ttyGB0 /dev/ttyG |
119 | 136 | ||
120 | The devices accept the following device specific ioctl calls | 137 | The devices accept the following device specific ioctl calls |
121 | (defined in gigaset_dev.h): | 138 | (defined in gigaset_dev.h): |
122 | 139 | ||
123 | ioctl(int fd, GIGASET_REDIR, int *cmd); | 140 | ``ioctl(int fd, GIGASET_REDIR, int *cmd);`` |
141 | |||
124 | If cmd==1, the device is set to be controlled exclusively through the | 142 | If cmd==1, the device is set to be controlled exclusively through the |
125 | character device node; access from the ISDN subsystem is blocked. | 143 | character device node; access from the ISDN subsystem is blocked. |
144 | |||
126 | If cmd==0, the device is set to be used from the ISDN subsystem and does | 145 | If cmd==0, the device is set to be used from the ISDN subsystem and does |
127 | not communicate through the character device node. | 146 | not communicate through the character device node. |
128 | 147 | ||
129 | ioctl(int fd, GIGASET_CONFIG, int *cmd); | 148 | ``ioctl(int fd, GIGASET_CONFIG, int *cmd);`` |
149 | |||
130 | (ser_gigaset and usb_gigaset only) | 150 | (ser_gigaset and usb_gigaset only) |
151 | |||
131 | If cmd==1, the device is set to adapter configuration mode where commands | 152 | If cmd==1, the device is set to adapter configuration mode where commands |
132 | are interpreted by the M10x DECT adapter itself instead of being | 153 | are interpreted by the M10x DECT adapter itself instead of being |
133 | forwarded to the base station. In this mode, the device accepts the | 154 | forwarded to the base station. In this mode, the device accepts the |
134 | commands described in Siemens document "AT-Kommando Alignment M10x Data" | 155 | commands described in Siemens document "AT-Kommando Alignment M10x Data" |
135 | for setting the operation mode, associating with a base station and | 156 | for setting the operation mode, associating with a base station and |
136 | querying parameters like field strengh and signal quality. | 157 | querying parameters like field strengh and signal quality. |
158 | |||
137 | Note that there is no ioctl command for leaving adapter configuration | 159 | Note that there is no ioctl command for leaving adapter configuration |
138 | mode and returning to regular operation. In order to leave adapter | 160 | mode and returning to regular operation. In order to leave adapter |
139 | configuration mode, write the command ATO to the device. | 161 | configuration mode, write the command ATO to the device. |
140 | 162 | ||
141 | ioctl(int fd, GIGASET_BRKCHARS, unsigned char brkchars[6]); | 163 | ``ioctl(int fd, GIGASET_BRKCHARS, unsigned char brkchars[6]);`` |
164 | |||
142 | (usb_gigaset only) | 165 | (usb_gigaset only) |
166 | |||
143 | Set the break characters on an M105's internal serial adapter to the six | 167 | Set the break characters on an M105's internal serial adapter to the six |
144 | bytes stored in brkchars[]. Unused bytes should be set to zero. | 168 | bytes stored in brkchars[]. Unused bytes should be set to zero. |
145 | 169 | ||
146 | ioctl(int fd, GIGASET_VERSION, unsigned version[4]); | 170 | ioctl(int fd, GIGASET_VERSION, unsigned version[4]); |
147 | Retrieve version information from the driver. version[0] must be set to | 171 | Retrieve version information from the driver. version[0] must be set to |
148 | one of: | 172 | one of: |
173 | |||
149 | - GIGVER_DRIVER: retrieve driver version | 174 | - GIGVER_DRIVER: retrieve driver version |
150 | - GIGVER_COMPAT: retrieve interface compatibility version | 175 | - GIGVER_COMPAT: retrieve interface compatibility version |
151 | - GIGVER_FWBASE: retrieve the firmware version of the base | 176 | - GIGVER_FWBASE: retrieve the firmware version of the base |
177 | |||
152 | Upon return, version[] is filled with the requested version information. | 178 | Upon return, version[] is filled with the requested version information. |
153 | 179 | ||
154 | 2.3. CAPI | 180 | 2.3. CAPI |
155 | ---- | 181 | --------- |
182 | |||
156 | The devices will show up as CAPI controllers as soon as the | 183 | The devices will show up as CAPI controllers as soon as the |
157 | corresponding driver module is loaded, and can then be used with | 184 | corresponding driver module is loaded, and can then be used with |
158 | CAPI 2.0 kernel and user space applications. For user space access, | 185 | CAPI 2.0 kernel and user space applications. For user space access, |
@@ -165,21 +192,22 @@ GigaSet 307x Device Driver | |||
165 | driver. | 192 | driver. |
166 | 193 | ||
167 | 2.5. Unimodem mode | 194 | 2.5. Unimodem mode |
168 | ------------- | 195 | ------------------ |
196 | |||
169 | In this mode the device works like a modem connected to a serial port | 197 | In this mode the device works like a modem connected to a serial port |
170 | (the /dev/ttyGU0, ... mentioned above) which understands the commands | 198 | (the /dev/ttyGU0, ... mentioned above) which understands the commands:: |
171 | 199 | ||
172 | ATZ init, reset | 200 | ATZ init, reset |
173 | => OK or ERROR | 201 | => OK or ERROR |
174 | ATD | 202 | ATD |
175 | ATDT dial | 203 | ATDT dial |
176 | => OK, CONNECT, | 204 | => OK, CONNECT, |
177 | BUSY, | 205 | BUSY, |
178 | NO DIAL TONE, | 206 | NO DIAL TONE, |
179 | NO CARRIER, | 207 | NO CARRIER, |
180 | NO ANSWER | 208 | NO ANSWER |
181 | <pause>+++<pause> change to command mode when connected | 209 | <pause>+++<pause> change to command mode when connected |
182 | ATH hangup | 210 | ATH hangup |
183 | 211 | ||
184 | You can use some configuration tool of your distribution to configure this | 212 | You can use some configuration tool of your distribution to configure this |
185 | "modem" or configure pppd/wvdial manually. There are some example ppp | 213 | "modem" or configure pppd/wvdial manually. There are some example ppp |
@@ -189,40 +217,52 @@ GigaSet 307x Device Driver | |||
189 | control lines. This means you must use "Stupid Mode" if you are using | 217 | control lines. This means you must use "Stupid Mode" if you are using |
190 | wvdial or you should use the nocrtscts option of pppd. | 218 | wvdial or you should use the nocrtscts option of pppd. |
191 | You must also assure that the ppp_async module is loaded with the parameter | 219 | You must also assure that the ppp_async module is loaded with the parameter |
192 | flag_time=0. You can do this e.g. by adding a line like | 220 | flag_time=0. You can do this e.g. by adding a line like:: |
221 | |||
222 | options ppp_async flag_time=0 | ||
193 | 223 | ||
194 | options ppp_async flag_time=0 | 224 | to an appropriate module configuration file, like:: |
195 | 225 | ||
196 | to an appropriate module configuration file, like | 226 | /etc/modprobe.d/gigaset.conf. |
197 | /etc/modprobe.d/gigaset.conf. | ||
198 | 227 | ||
199 | Unimodem mode is needed for making some devices [e.g. SX100] work which | 228 | Unimodem mode is needed for making some devices [e.g. SX100] work which |
200 | do not support the regular Gigaset command set. If debug output (see | 229 | do not support the regular Gigaset command set. If debug output (see |
201 | section 3.2.) shows something like this when dialing: | 230 | section 3.2.) shows something like this when dialing:: |
202 | CMD Received: ERROR | 231 | |
203 | Available Params: 0 | 232 | CMD Received: ERROR |
204 | Connection State: 0, Response: -1 | 233 | Available Params: 0 |
205 | gigaset_process_response: resp_code -1 in ConState 0 ! | 234 | Connection State: 0, Response: -1 |
206 | Timeout occurred | 235 | gigaset_process_response: resp_code -1 in ConState 0 ! |
236 | Timeout occurred | ||
237 | |||
207 | then switching to unimodem mode may help. | 238 | then switching to unimodem mode may help. |
208 | 239 | ||
209 | If you have installed the command line tool gigacontr, you can enter | 240 | If you have installed the command line tool gigacontr, you can enter |
210 | unimodem mode using | 241 | unimodem mode using:: |
211 | gigacontr --mode unimodem | 242 | |
212 | You can switch back using | 243 | gigacontr --mode unimodem |
213 | gigacontr --mode isdn | 244 | |
245 | You can switch back using:: | ||
246 | |||
247 | gigacontr --mode isdn | ||
214 | 248 | ||
215 | You can also put the driver directly into Unimodem mode when it's loaded, | 249 | You can also put the driver directly into Unimodem mode when it's loaded, |
216 | by passing the module parameter startmode=0 to the hardware specific | 250 | by passing the module parameter startmode=0 to the hardware specific |
217 | module, e.g. | 251 | module, e.g.:: |
252 | |||
218 | modprobe usb_gigaset startmode=0 | 253 | modprobe usb_gigaset startmode=0 |
219 | or by adding a line like | 254 | |
255 | or by adding a line like:: | ||
256 | |||
220 | options usb_gigaset startmode=0 | 257 | options usb_gigaset startmode=0 |
221 | to an appropriate module configuration file, like | 258 | |
222 | /etc/modprobe.d/gigaset.conf | 259 | to an appropriate module configuration file, like:: |
260 | |||
261 | /etc/modprobe.d/gigaset.conf | ||
223 | 262 | ||
224 | 2.6. Call-ID (CID) mode | 263 | 2.6. Call-ID (CID) mode |
225 | ------------------ | 264 | ----------------------- |
265 | |||
226 | Call-IDs are numbers used to tag commands to, and responses from, the | 266 | Call-IDs are numbers used to tag commands to, and responses from, the |
227 | Gigaset base in order to support the simultaneous handling of multiple | 267 | Gigaset base in order to support the simultaneous handling of multiple |
228 | ISDN calls. Their use can be enabled ("CID mode") or disabled ("Unimodem | 268 | ISDN calls. Their use can be enabled ("CID mode") or disabled ("Unimodem |
@@ -238,6 +278,7 @@ GigaSet 307x Device Driver | |||
238 | During active operation, the driver switches to the necessary mode | 278 | During active operation, the driver switches to the necessary mode |
239 | automatically. However, for the reasons above, the mode chosen when | 279 | automatically. However, for the reasons above, the mode chosen when |
240 | the device is not in use (idle) can be selected by the user. | 280 | the device is not in use (idle) can be selected by the user. |
281 | |||
241 | - If you want to receive incoming calls, you can use the default | 282 | - If you want to receive incoming calls, you can use the default |
242 | settings (CID mode). | 283 | settings (CID mode). |
243 | - If you have several DECT data devices (M10x) which you want to use | 284 | - If you have several DECT data devices (M10x) which you want to use |
@@ -247,25 +288,27 @@ GigaSet 307x Device Driver | |||
247 | If you want both of these at once, you are out of luck. | 288 | If you want both of these at once, you are out of luck. |
248 | 289 | ||
249 | You can also use the tty class parameter "cidmode" of the device to | 290 | You can also use the tty class parameter "cidmode" of the device to |
250 | change its CID mode while the driver is loaded, eg. | 291 | change its CID mode while the driver is loaded, eg.:: |
251 | echo 0 > /sys/class/tty/ttyGU0/cidmode | 292 | |
293 | echo 0 > /sys/class/tty/ttyGU0/cidmode | ||
252 | 294 | ||
253 | 2.7. Dialing Numbers | 295 | 2.7. Dialing Numbers |
254 | --------------- | 296 | -------------------- |
255 | The called party number provided by an application for dialing out must | 297 | provided by an application for dialing out must |
256 | be a public network number according to the local dialing plan, without | 298 | be a public network number according to the local dialing plan, without |
257 | any dial prefix for getting an outside line. | 299 | any dial prefix for getting an outside line. |
258 | 300 | ||
259 | Internal calls can be made by providing an internal extension number | 301 | Internal calls can be made by providing an internal extension number |
260 | prefixed with "**" (two asterisks) as the called party number. So to dial | 302 | prefixed with ``**`` (two asterisks) as the called party number. So to dial |
261 | eg. the first registered DECT handset, give "**11" as the called party | 303 | eg. the first registered DECT handset, give ``**11`` as the called party |
262 | number. Dialing "***" (three asterisks) calls all extensions | 304 | number. Dialing ``***`` (three asterisks) calls all extensions |
263 | simultaneously (global call). | 305 | simultaneously (global call). |
264 | 306 | ||
265 | Unimodem mode does not support internal calls. | 307 | Unimodem mode does not support internal calls. |
266 | 308 | ||
267 | 2.8. Unregistered Wireless Devices (M101/M105) | 309 | 2.8. Unregistered Wireless Devices (M101/M105) |
268 | ----------------------------------------- | 310 | ---------------------------------------------- |
311 | |||
269 | The main purpose of the ser_gigaset and usb_gigaset drivers is to allow | 312 | The main purpose of the ser_gigaset and usb_gigaset drivers is to allow |
270 | the M101 and M105 wireless devices to be used as ISDN devices for ISDN | 313 | the M101 and M105 wireless devices to be used as ISDN devices for ISDN |
271 | connections through a Gigaset base. Therefore they assume that the device | 314 | connections through a Gigaset base. Therefore they assume that the device |
@@ -279,73 +322,91 @@ GigaSet 307x Device Driver | |||
279 | modes. See the gigacontr(8) manpage for details. | 322 | modes. See the gigacontr(8) manpage for details. |
280 | 323 | ||
281 | 3. Troubleshooting | 324 | 3. Troubleshooting |
282 | --------------- | 325 | ==================== |
326 | |||
283 | 3.1. Solutions to frequently reported problems | 327 | 3.1. Solutions to frequently reported problems |
284 | ----------------------------------------- | 328 | ---------------------------------------------- |
329 | |||
285 | Problem: | 330 | Problem: |
286 | You have a slow provider and isdn4linux gives up dialing too early. | 331 | You have a slow provider and isdn4linux gives up dialing too early. |
287 | Solution: | 332 | Solution: |
288 | Load the isdn module using the dialtimeout option. You can do this e.g. | 333 | Load the isdn module using the dialtimeout option. You can do this e.g. |
289 | by adding a line like | 334 | by adding a line like:: |
290 | 335 | ||
291 | options isdn dialtimeout=15 | 336 | options isdn dialtimeout=15 |
292 | 337 | ||
293 | to /etc/modprobe.d/gigaset.conf or a similar file. | 338 | to /etc/modprobe.d/gigaset.conf or a similar file. |
294 | 339 | ||
295 | Problem: | 340 | Problem: |
296 | The isdnlog program emits error messages or just doesn't work. | 341 | The isdnlog program emits error messages or just doesn't work. |
297 | Solution: | 342 | Solution: |
298 | Isdnlog supports only the HiSax driver. Do not attempt to use it with | 343 | Isdnlog supports only the HiSax driver. Do not attempt to use it with |
299 | other drivers such as Gigaset. | 344 | other drivers such as Gigaset. |
300 | 345 | ||
301 | Problem: | 346 | Problem: |
302 | You have two or more DECT data adapters (M101/M105) and only the | 347 | You have two or more DECT data adapters (M101/M105) and only the |
303 | first one you turn on works. | 348 | first one you turn on works. |
304 | Solution: | 349 | Solution: |
305 | Select Unimodem mode for all DECT data adapters. (see section 2.5.) | 350 | Select Unimodem mode for all DECT data adapters. (see section 2.5.) |
306 | 351 | ||
307 | Problem: | 352 | Problem: |
308 | Messages like this: | 353 | Messages like this:: |
354 | |||
309 | usb_gigaset 3-2:1.0: Could not initialize the device. | 355 | usb_gigaset 3-2:1.0: Could not initialize the device. |
356 | |||
310 | appear in your syslog. | 357 | appear in your syslog. |
311 | Solution: | 358 | Solution: |
312 | Check whether your M10x wireless device is correctly registered to the | 359 | Check whether your M10x wireless device is correctly registered to the |
313 | Gigaset base. (see section 2.7.) | 360 | Gigaset base. (see section 2.7.) |
314 | 361 | ||
315 | 3.2. Telling the driver to provide more information | 362 | 3.2. Telling the driver to provide more information |
316 | ---------------------------------------------- | 363 | --------------------------------------------------- |
317 | Building the driver with the "Gigaset debugging" kernel configuration | 364 | Building the driver with the "Gigaset debugging" kernel configuration |
318 | option (CONFIG_GIGASET_DEBUG) gives it the ability to produce additional | 365 | option (CONFIG_GIGASET_DEBUG) gives it the ability to produce additional |
319 | information useful for debugging. | 366 | information useful for debugging. |
320 | 367 | ||
321 | You can control the amount of debugging information the driver produces by | 368 | You can control the amount of debugging information the driver produces by |
322 | writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g. | 369 | writing an appropriate value to /sys/module/gigaset/parameters/debug, |
323 | echo 0 > /sys/module/gigaset/parameters/debug | 370 | e.g.:: |
371 | |||
372 | echo 0 > /sys/module/gigaset/parameters/debug | ||
373 | |||
324 | switches off debugging output completely, | 374 | switches off debugging output completely, |
325 | echo 0x302020 > /sys/module/gigaset/parameters/debug | 375 | |
376 | :: | ||
377 | |||
378 | echo 0x302020 > /sys/module/gigaset/parameters/debug | ||
379 | |||
326 | enables a reasonable set of debugging output messages. These values are | 380 | enables a reasonable set of debugging output messages. These values are |
327 | bit patterns where every bit controls a certain type of debugging output. | 381 | bit patterns where every bit controls a certain type of debugging output. |
328 | See the constants DEBUG_* in the source file gigaset.h for details. | 382 | See the constants DEBUG_* in the source file gigaset.h for details. |
329 | 383 | ||
330 | The initial value can be set using the debug parameter when loading the | 384 | The initial value can be set using the debug parameter when loading the |
331 | module "gigaset", e.g. by adding a line | 385 | module "gigaset", e.g. by adding a line:: |
332 | options gigaset debug=0 | 386 | |
387 | options gigaset debug=0 | ||
388 | |||
333 | to your module configuration file, eg. /etc/modprobe.d/gigaset.conf | 389 | to your module configuration file, eg. /etc/modprobe.d/gigaset.conf |
334 | 390 | ||
335 | Generated debugging information can be found | 391 | Generated debugging information can be found |
336 | - as output of the command | 392 | - as output of the command:: |
337 | dmesg | 393 | |
394 | dmesg | ||
395 | |||
338 | - in system log files written by your syslog daemon, usually | 396 | - in system log files written by your syslog daemon, usually |
339 | in /var/log/, e.g. /var/log/messages. | 397 | in /var/log/, e.g. /var/log/messages. |
340 | 398 | ||
341 | 3.3. Reporting problems and bugs | 399 | 3.3. Reporting problems and bugs |
342 | --------------------------- | 400 | -------------------------------- |
343 | If you can't solve problems with the driver on your own, feel free to | 401 | If you can't solve problems with the driver on your own, feel free to |
344 | use one of the forums, bug trackers, or mailing lists on | 402 | use one of the forums, bug trackers, or mailing lists on |
345 | https://sourceforge.net/projects/gigaset307x | 403 | |
404 | https://sourceforge.net/projects/gigaset307x | ||
405 | |||
346 | or write an electronic mail to the maintainers. | 406 | or write an electronic mail to the maintainers. |
347 | 407 | ||
348 | Try to provide as much information as possible, such as | 408 | Try to provide as much information as possible, such as |
409 | |||
349 | - distribution | 410 | - distribution |
350 | - kernel version (uname -r) | 411 | - kernel version (uname -r) |
351 | - gcc version (gcc --version) | 412 | - gcc version (gcc --version) |
@@ -362,7 +423,7 @@ GigaSet 307x Device Driver | |||
362 | appropriate forums and newsgroups. | 423 | appropriate forums and newsgroups. |
363 | 424 | ||
364 | 3.4. Reporting problem solutions | 425 | 3.4. Reporting problem solutions |
365 | --------------------------- | 426 | -------------------------------- |
366 | If you solved a problem with our drivers, wrote startup scripts for your | 427 | If you solved a problem with our drivers, wrote startup scripts for your |
367 | distribution, ... feel free to contact us (using one of the places | 428 | distribution, ... feel free to contact us (using one of the places |
368 | mentioned in 3.3.). We'd like to add scripts, hints, documentation | 429 | mentioned in 3.3.). We'd like to add scripts, hints, documentation |
@@ -370,34 +431,35 @@ GigaSet 307x Device Driver | |||
370 | 431 | ||
371 | 432 | ||
372 | 4. Links, other software | 433 | 4. Links, other software |
373 | --------------------- | 434 | ========================== |
435 | |||
374 | - Sourceforge project developing this driver and associated tools | 436 | - Sourceforge project developing this driver and associated tools |
375 | https://sourceforge.net/projects/gigaset307x | 437 | https://sourceforge.net/projects/gigaset307x |
376 | - Yahoo! Group on the Siemens Gigaset family of devices | 438 | - Yahoo! Group on the Siemens Gigaset family of devices |
377 | https://de.groups.yahoo.com/group/Siemens-Gigaset | 439 | https://de.groups.yahoo.com/group/Siemens-Gigaset |
378 | - Siemens Gigaset/T-Sinus compatibility table | 440 | - Siemens Gigaset/T-Sinus compatibility table |
379 | http://www.erbze.info/sinus_gigaset.htm | 441 | http://www.erbze.info/sinus_gigaset.htm |
380 | (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm ) | 442 | (archived at https://web.archive.org/web/20100717020421/http://www.erbze.info:80/sinus_gigaset.htm ) |
381 | 443 | ||
382 | 444 | ||
383 | 5. Credits | 445 | 5. Credits |
384 | ------- | 446 | ============ |
447 | |||
385 | Thanks to | 448 | Thanks to |
386 | 449 | ||
387 | Karsten Keil | 450 | Karsten Keil |
388 | for his help with isdn4linux | 451 | for his help with isdn4linux |
389 | Deti Fliegl | 452 | Deti Fliegl |
390 | for his base driver code | 453 | for his base driver code |
391 | Dennis Dietrich | 454 | Dennis Dietrich |
392 | for his kernel 2.6 patches | 455 | for his kernel 2.6 patches |
393 | Andreas Rummel | 456 | Andreas Rummel |
394 | for his work and logs to get unimodem mode working | 457 | for his work and logs to get unimodem mode working |
395 | Andreas Degert | 458 | Andreas Degert |
396 | for his logs and patches to get cx 100 working | 459 | for his logs and patches to get cx 100 working |
397 | Dietrich Feist | 460 | Dietrich Feist |
398 | for his generous donation of one M105 and two M101 cordless adapters | 461 | for his generous donation of one M105 and two M101 cordless adapters |
399 | Christoph Schweers | 462 | Christoph Schweers |
400 | for his generous donation of a M34 device | 463 | for his generous donation of a M34 device |
401 | 464 | ||
402 | and all the other people who sent logs and other information. | 465 | and all the other people who sent logs and other information. |
403 | |||
diff --git a/Documentation/isdn/README.hysdn b/Documentation/isdn/hysdn.rst index eeca11f00ccd..0a168d1cbffc 100644 --- a/Documentation/isdn/README.hysdn +++ b/Documentation/isdn/hysdn.rst | |||
@@ -1,4 +1,7 @@ | |||
1 | $Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $ | 1 | ============ |
2 | Hysdn Driver | ||
3 | ============ | ||
4 | |||
2 | The hysdn driver has been written by | 5 | The hysdn driver has been written by |
3 | Werner Cornelius (werner@isdn4linux.de or werner@titro.de) | 6 | Werner Cornelius (werner@isdn4linux.de or werner@titro.de) |
4 | for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver | 7 | for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver |
@@ -22,28 +25,28 @@ for Hypercope GmbH Aachen, Germany. | |||
22 | along with this program; if not, write to the Free Software | 25 | along with this program; if not, write to the Free Software |
23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | 27 | ||
25 | Table of contents | 28 | .. Table of contents |
26 | ================= | ||
27 | 29 | ||
28 | 1. About the driver | 30 | 1. About the driver |
29 | 31 | ||
30 | 2. Loading/Unloading the driver | 32 | 2. Loading/Unloading the driver |
31 | 33 | ||
32 | 3. Entries in the /proc filesystem | 34 | 3. Entries in the /proc filesystem |
33 | 35 | ||
34 | 4. The /proc/net/hysdn/cardconfX file | 36 | 4. The /proc/net/hysdn/cardconfX file |
35 | 37 | ||
36 | 5. The /proc/net/hysdn/cardlogX file | 38 | 5. The /proc/net/hysdn/cardlogX file |
37 | 39 | ||
38 | 6. Where to get additional info and help | 40 | 6. Where to get additional info and help |
39 | 41 | ||
40 | 42 | ||
41 | 1. About the driver | 43 | 1. About the driver |
44 | =================== | ||
42 | 45 | ||
43 | The drivers/isdn/hysdn subdir contains a driver for HYPERCOPEs active | 46 | The drivers/isdn/hysdn subdir contains a driver for HYPERCOPEs active |
44 | PCI isdn cards Champ, Ergo and Metro. To enable support for this cards | 47 | PCI isdn cards Champ, Ergo and Metro. To enable support for this cards |
45 | enable ISDN support in the kernel config and support for HYSDN cards in | 48 | enable ISDN support in the kernel config and support for HYSDN cards in |
46 | the active cards submenu. The driver may only be compiled and used if | 49 | the active cards submenu. The driver may only be compiled and used if |
47 | support for loadable modules and the process filesystem have been enabled. | 50 | support for loadable modules and the process filesystem have been enabled. |
48 | 51 | ||
49 | These cards provide two different interfaces to the kernel. Without the | 52 | These cards provide two different interfaces to the kernel. Without the |
@@ -52,22 +55,23 @@ Table of contents | |||
52 | handlers for various protocols like ppp and others as well as config info | 55 | handlers for various protocols like ppp and others as well as config info |
53 | and firmware may be fetched from Hypercopes WWW-Site www.hypercope.de. | 56 | and firmware may be fetched from Hypercopes WWW-Site www.hypercope.de. |
54 | 57 | ||
55 | With CAPI 2.0 support enabled, the card can also be used as a CAPI 2.0 | 58 | With CAPI 2.0 support enabled, the card can also be used as a CAPI 2.0 |
56 | compliant devices with either CAPI 2.0 applications | 59 | compliant devices with either CAPI 2.0 applications |
57 | (check isdn4k-utils) or -using the capidrv module- as a regular | 60 | (check isdn4k-utils) or -using the capidrv module- as a regular |
58 | isdn4linux device. This is done via the same mechanism as with the | 61 | isdn4linux device. This is done via the same mechanism as with the |
59 | active AVM cards and in fact uses the same module. | 62 | active AVM cards and in fact uses the same module. |
60 | 63 | ||
61 | 64 | ||
62 | 2. Loading/Unloading the driver | 65 | 2. Loading/Unloading the driver |
66 | =============================== | ||
63 | 67 | ||
64 | The module has no command line parameters and auto detects up to 10 cards | 68 | The module has no command line parameters and auto detects up to 10 cards |
65 | in the id-range 0-9. | 69 | in the id-range 0-9. |
66 | If a loaded driver shall be unloaded all open files in the /proc/net/hysdn | 70 | If a loaded driver shall be unloaded all open files in the /proc/net/hysdn |
67 | subdir need to be closed and all ethernet interfaces allocated by this | 71 | subdir need to be closed and all ethernet interfaces allocated by this |
68 | driver must be shut down. Otherwise the module counter will avoid a module | 72 | driver must be shut down. Otherwise the module counter will avoid a module |
69 | unload. | 73 | unload. |
70 | 74 | ||
71 | If you are using the CAPI 2.0-interface, make sure to load/modprobe the | 75 | If you are using the CAPI 2.0-interface, make sure to load/modprobe the |
72 | kernelcapi-module first. | 76 | kernelcapi-module first. |
73 | 77 | ||
@@ -76,52 +80,57 @@ Table of contents | |||
76 | any avm-specific modules). | 80 | any avm-specific modules). |
77 | 81 | ||
78 | 3. Entries in the /proc filesystem | 82 | 3. Entries in the /proc filesystem |
83 | ================================== | ||
79 | 84 | ||
80 | When the module has been loaded it adds the directory hysdn in the | 85 | When the module has been loaded it adds the directory hysdn in the |
81 | /proc/net tree. This directory contains exactly 2 file entries for each | 86 | /proc/net tree. This directory contains exactly 2 file entries for each |
82 | card. One is called cardconfX and the other cardlogX, where X is the | 87 | card. One is called cardconfX and the other cardlogX, where X is the |
83 | card id number from 0 to 9. | 88 | card id number from 0 to 9. |
84 | The cards are numbered in the order found in the PCI config data. | 89 | The cards are numbered in the order found in the PCI config data. |
85 | 90 | ||
86 | 4. The /proc/net/hysdn/cardconfX file | 91 | 4. The /proc/net/hysdn/cardconfX file |
92 | ===================================== | ||
87 | 93 | ||
88 | This file may be read to get by everyone to get info about the cards type, | 94 | This file may be read to get by everyone to get info about the cards type, |
89 | actual state, available features and used resources. | 95 | actual state, available features and used resources. |
90 | The first 3 entries (id, bus and slot) are PCI info fields, the following | 96 | The first 3 entries (id, bus and slot) are PCI info fields, the following |
91 | type field gives the information about the cards type: | 97 | type field gives the information about the cards type: |
92 | 98 | ||
93 | 4 -> Ergo card (server card with 2 b-chans) | 99 | - 4 -> Ergo card (server card with 2 b-chans) |
94 | 5 -> Metro card (server card with 4 or 8 b-chans) | 100 | - 5 -> Metro card (server card with 4 or 8 b-chans) |
95 | 6 -> Champ card (client card with 2 b-chans) | 101 | - 6 -> Champ card (client card with 2 b-chans) |
96 | 102 | ||
97 | The following 3 fields show the hardware assignments for irq, iobase and the | 103 | The following 3 fields show the hardware assignments for irq, iobase and the |
98 | dual ported memory (dp-mem). | 104 | dual ported memory (dp-mem). |
105 | |||
99 | The fields b-chans and fax-chans announce the available card resources of | 106 | The fields b-chans and fax-chans announce the available card resources of |
100 | this types for the user. | 107 | this types for the user. |
108 | |||
101 | The state variable indicates the actual drivers state for this card with the | 109 | The state variable indicates the actual drivers state for this card with the |
102 | following assignments. | 110 | following assignments. |
103 | 111 | ||
104 | 0 -> card has not been booted since driver load | 112 | - 0 -> card has not been booted since driver load |
105 | 1 -> card booting is actually in progess | 113 | - 1 -> card booting is actually in progess |
106 | 2 -> card is in an error state due to a previous boot failure | 114 | - 2 -> card is in an error state due to a previous boot failure |
107 | 3 -> card is booted and active | 115 | - 3 -> card is booted and active |
108 | 116 | ||
109 | And the last field (device) shows the name of the ethernet device assigned | 117 | And the last field (device) shows the name of the ethernet device assigned |
110 | to this card. Up to the first successful boot this field only shows a - | 118 | to this card. Up to the first successful boot this field only shows a - |
111 | to tell that no net device has been allocated up to now. Once a net device | 119 | to tell that no net device has been allocated up to now. Once a net device |
112 | has been allocated it remains assigned to this card, even if a card is | 120 | has been allocated it remains assigned to this card, even if a card is |
113 | rebooted and an boot error occurs. | 121 | rebooted and an boot error occurs. |
114 | 122 | ||
115 | Writing to the cardconfX file boots the card or transfers config lines to | 123 | Writing to the cardconfX file boots the card or transfers config lines to |
116 | the cards firmware. The type of data is automatically detected when the | 124 | the cards firmware. The type of data is automatically detected when the |
117 | first data is written. Only root has write access to this file. | 125 | first data is written. Only root has write access to this file. |
118 | The firmware boot files are normally called hyclient.pof for client cards | 126 | The firmware boot files are normally called hyclient.pof for client cards |
119 | and hyserver.pof for server cards. | 127 | and hyserver.pof for server cards. |
120 | After successfully writing the boot file, complete config files or single | 128 | After successfully writing the boot file, complete config files or single |
121 | config lines may be copied to this file. | 129 | config lines may be copied to this file. |
122 | If an error occurs the return value given to the writing process has the | 130 | If an error occurs the return value given to the writing process has the |
123 | following additional codes (decimal): | 131 | following additional codes (decimal): |
124 | 132 | ||
133 | ==== ============================================ | ||
125 | 1000 Another process is currently bootng the card | 134 | 1000 Another process is currently bootng the card |
126 | 1001 Invalid firmware header | 135 | 1001 Invalid firmware header |
127 | 1002 Boards dual-port RAM test failed | 136 | 1002 Boards dual-port RAM test failed |
@@ -131,34 +140,39 @@ Table of contents | |||
131 | 1006 Second boot stage failure | 140 | 1006 Second boot stage failure |
132 | 1007 Timeout waiting for card ready during boot | 141 | 1007 Timeout waiting for card ready during boot |
133 | 1008 Operation only allowed in booted state | 142 | 1008 Operation only allowed in booted state |
134 | 1009 Config line too long | 143 | 1009 Config line too long |
135 | 1010 Invalid channel number | 144 | 1010 Invalid channel number |
136 | 1011 Timeout sending config data | 145 | 1011 Timeout sending config data |
146 | ==== ============================================ | ||
137 | 147 | ||
138 | Additional info about error reasons may be fetched from the log output. | 148 | Additional info about error reasons may be fetched from the log output. |
139 | 149 | ||
140 | 5. The /proc/net/hysdn/cardlogX file | 150 | 5. The /proc/net/hysdn/cardlogX file |
141 | 151 | ==================================== | |
142 | The cardlogX file entry may be opened multiple for reading by everyone to | 152 | |
153 | The cardlogX file entry may be opened multiple for reading by everyone to | ||
143 | get the cards and drivers log data. Card messages always start with the | 154 | get the cards and drivers log data. Card messages always start with the |
144 | keyword LOG. All other lines are output from the driver. | 155 | keyword LOG. All other lines are output from the driver. |
145 | The driver log data may be redirected to the syslog by selecting the | 156 | The driver log data may be redirected to the syslog by selecting the |
146 | appropriate bitmask. The cards log messages will always be send to this | 157 | appropriate bitmask. The cards log messages will always be send to this |
147 | interface but never to the syslog. | 158 | interface but never to the syslog. |
148 | 159 | ||
149 | A root user may write a decimal or hex (with 0x) value t this file to select | 160 | A root user may write a decimal or hex (with 0x) value t this file to select |
150 | desired output options. As mentioned above the cards log dat is always | 161 | desired output options. As mentioned above the cards log dat is always |
151 | written to the cardlog file independent of the following options only used | 162 | written to the cardlog file independent of the following options only used |
152 | to check and debug the driver itself: | 163 | to check and debug the driver itself: |
153 | 164 | ||
154 | For example: | 165 | For example:: |
155 | echo "0x34560078" > /proc/net/hysdn/cardlog0 | 166 | |
167 | echo "0x34560078" > /proc/net/hysdn/cardlog0 | ||
168 | |||
156 | to output the hex log mask 34560078 for card 0. | 169 | to output the hex log mask 34560078 for card 0. |
157 | 170 | ||
158 | The written value is regarded as an unsigned 32-Bit value, bit ored for | 171 | The written value is regarded as an unsigned 32-Bit value, bit ored for |
159 | desired output. The following bits are already assigned: | 172 | desired output. The following bits are already assigned: |
160 | 173 | ||
161 | 0x80000000 All driver log data is alternatively via syslog | 174 | ========== ============================================================ |
175 | 0x80000000 All driver log data is alternatively via syslog | ||
162 | 0x00000001 Log memory allocation errors | 176 | 0x00000001 Log memory allocation errors |
163 | 0x00000010 Firmware load start and close are logged | 177 | 0x00000010 Firmware load start and close are logged |
164 | 0x00000020 Log firmware record parser | 178 | 0x00000020 Log firmware record parser |
@@ -171,25 +185,12 @@ Table of contents | |||
171 | 0x00100000 Log all open and close actions to /proc/net/hysdn/card files | 185 | 0x00100000 Log all open and close actions to /proc/net/hysdn/card files |
172 | 0x00200000 Log all actions from /proc file entries | 186 | 0x00200000 Log all actions from /proc file entries |
173 | 0x00010000 Log network interface init and deinit | 187 | 0x00010000 Log network interface init and deinit |
174 | 188 | ========== ============================================================ | |
189 | |||
175 | 6. Where to get additional info and help | 190 | 6. Where to get additional info and help |
191 | ======================================== | ||
176 | 192 | ||
177 | If you have any problems concerning the driver or configuration contact | 193 | If you have any problems concerning the driver or configuration contact |
178 | the Hypercope support team (support@hypercope.de) and or the authors | 194 | the Hypercope support team (support@hypercope.de) and or the authors |
179 | Werner Cornelius (werner@isdn4linux or cornelius@titro.de) or | 195 | Werner Cornelius (werner@isdn4linux or cornelius@titro.de) or |
180 | Ulrich Albrecht (ualbrecht@hypercope.de). | 196 | Ulrich Albrecht (ualbrecht@hypercope.de). |
181 | |||
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | |||
189 | |||
190 | |||
191 | |||
192 | |||
193 | |||
194 | |||
195 | |||
diff --git a/Documentation/isdn/index.rst b/Documentation/isdn/index.rst new file mode 100644 index 000000000000..407e74b78372 --- /dev/null +++ b/Documentation/isdn/index.rst | |||
@@ -0,0 +1,24 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ==== | ||
4 | ISDN | ||
5 | ==== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | interface_capi | ||
11 | |||
12 | avmb1 | ||
13 | gigaset | ||
14 | hysdn | ||
15 | m_isdn | ||
16 | |||
17 | credits | ||
18 | |||
19 | .. only:: subproject and html | ||
20 | |||
21 | Indices | ||
22 | ======= | ||
23 | |||
24 | * :ref:`genindex` | ||
diff --git a/Documentation/isdn/INTERFACE.CAPI b/Documentation/isdn/interface_capi.rst index 021aa9cf139d..01a4b5ade9a4 100644 --- a/Documentation/isdn/INTERFACE.CAPI +++ b/Documentation/isdn/interface_capi.rst | |||
@@ -1,7 +1,9 @@ | |||
1 | ========================================= | ||
1 | Kernel CAPI Interface to Hardware Drivers | 2 | Kernel CAPI Interface to Hardware Drivers |
2 | ----------------------------------------- | 3 | ========================================= |
3 | 4 | ||
4 | 1. Overview | 5 | 1. Overview |
6 | =========== | ||
5 | 7 | ||
6 | From the CAPI 2.0 specification: | 8 | From the CAPI 2.0 specification: |
7 | COMMON-ISDN-API (CAPI) is an application programming interface standard used | 9 | COMMON-ISDN-API (CAPI) is an application programming interface standard used |
@@ -22,6 +24,7 @@ This standard is freely available from https://www.capi.org. | |||
22 | 24 | ||
23 | 25 | ||
24 | 2. Driver and Device Registration | 26 | 2. Driver and Device Registration |
27 | ================================= | ||
25 | 28 | ||
26 | CAPI drivers optionally register themselves with Kernel CAPI by calling the | 29 | CAPI drivers optionally register themselves with Kernel CAPI by calling the |
27 | Kernel CAPI function register_capi_driver() with a pointer to a struct | 30 | Kernel CAPI function register_capi_driver() with a pointer to a struct |
@@ -50,6 +53,7 @@ callback functions by Kernel CAPI. | |||
50 | 53 | ||
51 | 54 | ||
52 | 3. Application Registration and Communication | 55 | 3. Application Registration and Communication |
56 | ============================================= | ||
53 | 57 | ||
54 | Kernel CAPI forwards registration requests from applications (calls to CAPI | 58 | Kernel CAPI forwards registration requests from applications (calls to CAPI |
55 | operation CAPI_REGISTER) to an appropriate hardware driver by calling its | 59 | operation CAPI_REGISTER) to an appropriate hardware driver by calling its |
@@ -71,23 +75,26 @@ messages for that application may be passed to or from the device anymore. | |||
71 | 75 | ||
72 | 76 | ||
73 | 4. Data Structures | 77 | 4. Data Structures |
78 | ================== | ||
74 | 79 | ||
75 | 4.1 struct capi_driver | 80 | 4.1 struct capi_driver |
81 | ---------------------- | ||
76 | 82 | ||
77 | This structure describes a Kernel CAPI driver itself. It is used in the | 83 | This structure describes a Kernel CAPI driver itself. It is used in the |
78 | register_capi_driver() and unregister_capi_driver() functions, and contains | 84 | register_capi_driver() and unregister_capi_driver() functions, and contains |
79 | the following non-private fields, all to be set by the driver before calling | 85 | the following non-private fields, all to be set by the driver before calling |
80 | register_capi_driver(): | 86 | register_capi_driver(): |
81 | 87 | ||
82 | char name[32] | 88 | ``char name[32]`` |
83 | the name of the driver, as a zero-terminated ASCII string | 89 | the name of the driver, as a zero-terminated ASCII string |
84 | char revision[32] | 90 | ``char revision[32]`` |
85 | the revision number of the driver, as a zero-terminated ASCII string | 91 | the revision number of the driver, as a zero-terminated ASCII string |
86 | int (*add_card)(struct capi_driver *driver, capicardparams *data) | 92 | ``int (*add_card)(struct capi_driver *driver, capicardparams *data)`` |
87 | a callback function pointer (may be NULL) | 93 | a callback function pointer (may be NULL) |
88 | 94 | ||
89 | 95 | ||
90 | 4.2 struct capi_ctr | 96 | 4.2 struct capi_ctr |
97 | ------------------- | ||
91 | 98 | ||
92 | This structure describes an ISDN device (controller) handled by a Kernel CAPI | 99 | This structure describes an ISDN device (controller) handled by a Kernel CAPI |
93 | driver. After registration via the attach_capi_ctr() function it is passed to | 100 | driver. After registration via the attach_capi_ctr() function it is passed to |
@@ -96,88 +103,109 @@ identify the controller to operate on. | |||
96 | 103 | ||
97 | It contains the following non-private fields: | 104 | It contains the following non-private fields: |
98 | 105 | ||
99 | - to be set by the driver before calling attach_capi_ctr(): | 106 | to be set by the driver before calling attach_capi_ctr(): |
107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
100 | 108 | ||
101 | struct module *owner | 109 | ``struct module *owner`` |
102 | pointer to the driver module owning the device | 110 | pointer to the driver module owning the device |
103 | 111 | ||
104 | void *driverdata | 112 | ``void *driverdata`` |
105 | an opaque pointer to driver specific data, not touched by Kernel CAPI | 113 | an opaque pointer to driver specific data, not touched by Kernel CAPI |
106 | 114 | ||
107 | char name[32] | 115 | ``char name[32]`` |
108 | the name of the controller, as a zero-terminated ASCII string | 116 | the name of the controller, as a zero-terminated ASCII string |
109 | 117 | ||
110 | char *driver_name | 118 | ``char *driver_name`` |
111 | the name of the driver, as a zero-terminated ASCII string | 119 | the name of the driver, as a zero-terminated ASCII string |
112 | 120 | ||
113 | int (*load_firmware)(struct capi_ctr *ctrlr, capiloaddata *ldata) | 121 | ``int (*load_firmware)(struct capi_ctr *ctrlr, capiloaddata *ldata)`` |
114 | (optional) pointer to a callback function for sending firmware and | 122 | (optional) pointer to a callback function for sending firmware and |
115 | configuration data to the device | 123 | configuration data to the device |
124 | |||
116 | The function may return before the operation has completed. | 125 | The function may return before the operation has completed. |
126 | |||
117 | Completion must be signalled by a call to capi_ctr_ready(). | 127 | Completion must be signalled by a call to capi_ctr_ready(). |
128 | |||
118 | Return value: 0 on success, error code on error | 129 | Return value: 0 on success, error code on error |
119 | Called in process context. | 130 | Called in process context. |
120 | 131 | ||
121 | void (*reset_ctr)(struct capi_ctr *ctrlr) | 132 | ``void (*reset_ctr)(struct capi_ctr *ctrlr)`` |
122 | (optional) pointer to a callback function for stopping the device, | 133 | (optional) pointer to a callback function for stopping the device, |
123 | releasing all registered applications | 134 | releasing all registered applications |
135 | |||
124 | The function may return before the operation has completed. | 136 | The function may return before the operation has completed. |
137 | |||
125 | Completion must be signalled by a call to capi_ctr_down(). | 138 | Completion must be signalled by a call to capi_ctr_down(). |
139 | |||
126 | Called in process context. | 140 | Called in process context. |
127 | 141 | ||
128 | void (*register_appl)(struct capi_ctr *ctrlr, u16 applid, | 142 | ``void (*register_appl)(struct capi_ctr *ctrlr, u16 applid, capi_register_params *rparam)`` |
129 | capi_register_params *rparam) | 143 | pointers to callback function for registration of |
130 | void (*release_appl)(struct capi_ctr *ctrlr, u16 applid) | ||
131 | pointers to callback functions for registration and deregistration of | ||
132 | applications with the device | 144 | applications with the device |
145 | |||
133 | Calls to these functions are serialized by Kernel CAPI so that only | 146 | Calls to these functions are serialized by Kernel CAPI so that only |
134 | one call to any of them is active at any time. | 147 | one call to any of them is active at any time. |
135 | 148 | ||
136 | u16 (*send_message)(struct capi_ctr *ctrlr, struct sk_buff *skb) | 149 | ``void (*release_appl)(struct capi_ctr *ctrlr, u16 applid)`` |
150 | pointers to callback functions deregistration of | ||
151 | applications with the device | ||
152 | |||
153 | Calls to these functions are serialized by Kernel CAPI so that only | ||
154 | one call to any of them is active at any time. | ||
155 | |||
156 | ``u16 (*send_message)(struct capi_ctr *ctrlr, struct sk_buff *skb)`` | ||
137 | pointer to a callback function for sending a CAPI message to the | 157 | pointer to a callback function for sending a CAPI message to the |
138 | device | 158 | device |
159 | |||
139 | Return value: CAPI error code | 160 | Return value: CAPI error code |
161 | |||
140 | If the method returns 0 (CAPI_NOERROR) the driver has taken ownership | 162 | If the method returns 0 (CAPI_NOERROR) the driver has taken ownership |
141 | of the skb and the caller may no longer access it. If it returns a | 163 | of the skb and the caller may no longer access it. If it returns a |
142 | non-zero (error) value then ownership of the skb returns to the caller | 164 | non-zero (error) value then ownership of the skb returns to the caller |
143 | who may reuse or free it. | 165 | who may reuse or free it. |
166 | |||
144 | The return value should only be used to signal problems with respect | 167 | The return value should only be used to signal problems with respect |
145 | to accepting or queueing the message. Errors occurring during the | 168 | to accepting or queueing the message. Errors occurring during the |
146 | actual processing of the message should be signaled with an | 169 | actual processing of the message should be signaled with an |
147 | appropriate reply message. | 170 | appropriate reply message. |
171 | |||
148 | May be called in process or interrupt context. | 172 | May be called in process or interrupt context. |
173 | |||
149 | Calls to this function are not serialized by Kernel CAPI, ie. it must | 174 | Calls to this function are not serialized by Kernel CAPI, ie. it must |
150 | be prepared to be re-entered. | 175 | be prepared to be re-entered. |
151 | 176 | ||
152 | char *(*procinfo)(struct capi_ctr *ctrlr) | 177 | ``char *(*procinfo)(struct capi_ctr *ctrlr)`` |
153 | pointer to a callback function returning the entry for the device in | 178 | pointer to a callback function returning the entry for the device in |
154 | the CAPI controller info table, /proc/capi/controller | 179 | the CAPI controller info table, /proc/capi/controller |
155 | 180 | ||
156 | const struct file_operations *proc_fops | 181 | ``const struct file_operations *proc_fops`` |
157 | pointers to callback functions for the device's proc file | 182 | pointers to callback functions for the device's proc file |
158 | system entry, /proc/capi/controllers/<n>; pointer to the device's | 183 | system entry, /proc/capi/controllers/<n>; pointer to the device's |
159 | capi_ctr structure is available from struct proc_dir_entry::data | 184 | capi_ctr structure is available from struct proc_dir_entry::data |
160 | which is available from struct inode. | 185 | which is available from struct inode. |
161 | 186 | ||
162 | Note: Callback functions except send_message() are never called in interrupt | 187 | Note: |
163 | context. | 188 | Callback functions except send_message() are never called in interrupt |
189 | context. | ||
164 | 190 | ||
165 | - to be filled in before calling capi_ctr_ready(): | 191 | to be filled in before calling capi_ctr_ready(): |
192 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
166 | 193 | ||
167 | u8 manu[CAPI_MANUFACTURER_LEN] | 194 | ``u8 manu[CAPI_MANUFACTURER_LEN]`` |
168 | value to return for CAPI_GET_MANUFACTURER | 195 | value to return for CAPI_GET_MANUFACTURER |
169 | 196 | ||
170 | capi_version version | 197 | ``capi_version version`` |
171 | value to return for CAPI_GET_VERSION | 198 | value to return for CAPI_GET_VERSION |
172 | 199 | ||
173 | capi_profile profile | 200 | ``capi_profile profile`` |
174 | value to return for CAPI_GET_PROFILE | 201 | value to return for CAPI_GET_PROFILE |
175 | 202 | ||
176 | u8 serial[CAPI_SERIAL_LEN] | 203 | ``u8 serial[CAPI_SERIAL_LEN]`` |
177 | value to return for CAPI_GET_SERIAL | 204 | value to return for CAPI_GET_SERIAL |
178 | 205 | ||
179 | 206 | ||
180 | 4.3 SKBs | 207 | 4.3 SKBs |
208 | -------- | ||
181 | 209 | ||
182 | CAPI messages are passed between Kernel CAPI and the driver via send_message() | 210 | CAPI messages are passed between Kernel CAPI and the driver via send_message() |
183 | and capi_ctr_handle_message(), stored in the data portion of a socket buffer | 211 | and capi_ctr_handle_message(), stored in the data portion of a socket buffer |
@@ -192,6 +220,7 @@ instead of 30. | |||
192 | 220 | ||
193 | 221 | ||
194 | 4.4 The _cmsg Structure | 222 | 4.4 The _cmsg Structure |
223 | ----------------------- | ||
195 | 224 | ||
196 | (declared in <linux/isdn/capiutil.h>) | 225 | (declared in <linux/isdn/capiutil.h>) |
197 | 226 | ||
@@ -216,6 +245,7 @@ Members are named after the CAPI 2.0 standard names of the parameters they | |||
216 | represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data | 245 | represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data |
217 | types are: | 246 | types are: |
218 | 247 | ||
248 | =========== ================================================================= | ||
219 | u8 for CAPI parameters of type 'byte' | 249 | u8 for CAPI parameters of type 'byte' |
220 | 250 | ||
221 | u16 for CAPI parameters of type 'word' | 251 | u16 for CAPI parameters of type 'word' |
@@ -235,6 +265,7 @@ _cmstruct alternative representation for CAPI parameters of type 'struct' | |||
235 | CAPI_COMPOSE: The parameter is present. | 265 | CAPI_COMPOSE: The parameter is present. |
236 | Subparameter values are stored individually in the corresponding | 266 | Subparameter values are stored individually in the corresponding |
237 | _cmsg structure members. | 267 | _cmsg structure members. |
268 | =========== ================================================================= | ||
238 | 269 | ||
239 | Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert | 270 | Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert |
240 | messages between their transport encoding described in the CAPI 2.0 standard | 271 | messages between their transport encoding described in the CAPI 2.0 standard |
@@ -244,51 +275,71 @@ sure it is big enough to accommodate the resulting CAPI message. | |||
244 | 275 | ||
245 | 276 | ||
246 | 5. Lower Layer Interface Functions | 277 | 5. Lower Layer Interface Functions |
278 | ================================== | ||
247 | 279 | ||
248 | (declared in <linux/isdn/capilli.h>) | 280 | (declared in <linux/isdn/capilli.h>) |
249 | 281 | ||
250 | void register_capi_driver(struct capi_driver *drvr) | 282 | :: |
251 | void unregister_capi_driver(struct capi_driver *drvr) | 283 | |
252 | register/unregister a driver with Kernel CAPI | 284 | void register_capi_driver(struct capi_driver *drvr) |
285 | void unregister_capi_driver(struct capi_driver *drvr) | ||
286 | |||
287 | register/unregister a driver with Kernel CAPI | ||
288 | |||
289 | :: | ||
290 | |||
291 | int attach_capi_ctr(struct capi_ctr *ctrlr) | ||
292 | int detach_capi_ctr(struct capi_ctr *ctrlr) | ||
293 | |||
294 | register/unregister a device (controller) with Kernel CAPI | ||
253 | 295 | ||
254 | int attach_capi_ctr(struct capi_ctr *ctrlr) | 296 | :: |
255 | int detach_capi_ctr(struct capi_ctr *ctrlr) | ||
256 | register/unregister a device (controller) with Kernel CAPI | ||
257 | 297 | ||
258 | void capi_ctr_ready(struct capi_ctr *ctrlr) | 298 | void capi_ctr_ready(struct capi_ctr *ctrlr) |
259 | void capi_ctr_down(struct capi_ctr *ctrlr) | 299 | void capi_ctr_down(struct capi_ctr *ctrlr) |
260 | signal controller ready/not ready | ||
261 | 300 | ||
262 | void capi_ctr_suspend_output(struct capi_ctr *ctrlr) | 301 | signal controller ready/not ready |
263 | void capi_ctr_resume_output(struct capi_ctr *ctrlr) | ||
264 | signal suspend/resume | ||
265 | 302 | ||
266 | void capi_ctr_handle_message(struct capi_ctr * ctrlr, u16 applid, | 303 | :: |
267 | struct sk_buff *skb) | 304 | |
268 | pass a received CAPI message to Kernel CAPI | 305 | void capi_ctr_suspend_output(struct capi_ctr *ctrlr) |
269 | for forwarding to the specified application | 306 | void capi_ctr_resume_output(struct capi_ctr *ctrlr) |
307 | |||
308 | signal suspend/resume | ||
309 | |||
310 | :: | ||
311 | |||
312 | void capi_ctr_handle_message(struct capi_ctr * ctrlr, u16 applid, | ||
313 | struct sk_buff *skb) | ||
314 | |||
315 | pass a received CAPI message to Kernel CAPI | ||
316 | for forwarding to the specified application | ||
270 | 317 | ||
271 | 318 | ||
272 | 6. Helper Functions and Macros | 319 | 6. Helper Functions and Macros |
320 | ============================== | ||
273 | 321 | ||
274 | Library functions (from <linux/isdn/capilli.h>): | 322 | Library functions (from <linux/isdn/capilli.h>): |
275 | 323 | ||
276 | void capilib_new_ncci(struct list_head *head, u16 applid, | 324 | :: |
325 | |||
326 | void capilib_new_ncci(struct list_head *head, u16 applid, | ||
277 | u32 ncci, u32 winsize) | 327 | u32 ncci, u32 winsize) |
278 | void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci) | 328 | void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci) |
279 | void capilib_release_appl(struct list_head *head, u16 applid) | 329 | void capilib_release_appl(struct list_head *head, u16 applid) |
280 | void capilib_release(struct list_head *head) | 330 | void capilib_release(struct list_head *head) |
281 | void capilib_data_b3_conf(struct list_head *head, u16 applid, | 331 | void capilib_data_b3_conf(struct list_head *head, u16 applid, |
282 | u32 ncci, u16 msgid) | 332 | u32 ncci, u16 msgid) |
283 | u16 capilib_data_b3_req(struct list_head *head, u16 applid, | 333 | u16 capilib_data_b3_req(struct list_head *head, u16 applid, |
284 | u32 ncci, u16 msgid) | 334 | u32 ncci, u16 msgid) |
285 | 335 | ||
286 | 336 | ||
287 | Macros to extract/set element values from/in a CAPI message header | 337 | Macros to extract/set element values from/in a CAPI message header |
288 | (from <linux/isdn/capiutil.h>): | 338 | (from <linux/isdn/capiutil.h>): |
289 | 339 | ||
340 | ====================== ============================= ==================== | ||
290 | Get Macro Set Macro Element (Type) | 341 | Get Macro Set Macro Element (Type) |
291 | 342 | ====================== ============================= ==================== | |
292 | CAPIMSG_LEN(m) CAPIMSG_SETLEN(m, len) Total Length (u16) | 343 | CAPIMSG_LEN(m) CAPIMSG_SETLEN(m, len) Total Length (u16) |
293 | CAPIMSG_APPID(m) CAPIMSG_SETAPPID(m, applid) ApplID (u16) | 344 | CAPIMSG_APPID(m) CAPIMSG_SETAPPID(m, applid) ApplID (u16) |
294 | CAPIMSG_COMMAND(m) CAPIMSG_SETCOMMAND(m,cmd) Command (u8) | 345 | CAPIMSG_COMMAND(m) CAPIMSG_SETCOMMAND(m,cmd) Command (u8) |
@@ -300,31 +351,31 @@ CAPIMSG_MSGID(m) CAPIMSG_SETMSGID(m, msgid) Message Number (u16) | |||
300 | CAPIMSG_CONTROL(m) CAPIMSG_SETCONTROL(m, contr) Controller/PLCI/NCCI | 351 | CAPIMSG_CONTROL(m) CAPIMSG_SETCONTROL(m, contr) Controller/PLCI/NCCI |
301 | (u32) | 352 | (u32) |
302 | CAPIMSG_DATALEN(m) CAPIMSG_SETDATALEN(m, len) Data Length (u16) | 353 | CAPIMSG_DATALEN(m) CAPIMSG_SETDATALEN(m, len) Data Length (u16) |
354 | ====================== ============================= ==================== | ||
303 | 355 | ||
304 | 356 | ||
305 | Library functions for working with _cmsg structures | 357 | Library functions for working with _cmsg structures |
306 | (from <linux/isdn/capiutil.h>): | 358 | (from <linux/isdn/capiutil.h>): |
307 | 359 | ||
308 | unsigned capi_cmsg2message(_cmsg *cmsg, u8 *msg) | 360 | ``unsigned capi_cmsg2message(_cmsg *cmsg, u8 *msg)`` |
309 | Assembles a CAPI 2.0 message from the parameters in *cmsg, storing the | 361 | Assembles a CAPI 2.0 message from the parameters in ``*cmsg``, |
310 | result in *msg. | 362 | storing the result in ``*msg``. |
311 | 363 | ||
312 | unsigned capi_message2cmsg(_cmsg *cmsg, u8 *msg) | 364 | ``unsigned capi_message2cmsg(_cmsg *cmsg, u8 *msg)`` |
313 | Disassembles the CAPI 2.0 message in *msg, storing the parameters in | 365 | Disassembles the CAPI 2.0 message in ``*msg``, storing the parameters |
314 | *cmsg. | 366 | in ``*cmsg``. |
315 | 367 | ||
316 | unsigned capi_cmsg_header(_cmsg *cmsg, u16 ApplId, u8 Command, u8 Subcommand, | 368 | ``unsigned capi_cmsg_header(_cmsg *cmsg, u16 ApplId, u8 Command, u8 Subcommand, u16 Messagenumber, u32 Controller)`` |
317 | u16 Messagenumber, u32 Controller) | 369 | Fills the header part and address field of the _cmsg structure ``*cmsg`` |
318 | Fills the header part and address field of the _cmsg structure *cmsg | ||
319 | with the given values, zeroing the remainder of the structure so only | 370 | with the given values, zeroing the remainder of the structure so only |
320 | parameters with non-default values need to be changed before sending | 371 | parameters with non-default values need to be changed before sending |
321 | the message. | 372 | the message. |
322 | 373 | ||
323 | void capi_cmsg_answer(_cmsg *cmsg) | 374 | ``void capi_cmsg_answer(_cmsg *cmsg)`` |
324 | Sets the low bit of the Subcommand field in *cmsg, thereby converting | 375 | Sets the low bit of the Subcommand field in ``*cmsg``, thereby |
325 | _REQ to _CONF and _IND to _RESP. | 376 | converting ``_REQ`` to ``_CONF`` and ``_IND`` to ``_RESP``. |
326 | 377 | ||
327 | char *capi_cmd2str(u8 Command, u8 Subcommand) | 378 | ``char *capi_cmd2str(u8 Command, u8 Subcommand)`` |
328 | Returns the CAPI 2.0 message name corresponding to the given command | 379 | Returns the CAPI 2.0 message name corresponding to the given command |
329 | and subcommand values, as a static ASCII string. The return value may | 380 | and subcommand values, as a static ASCII string. The return value may |
330 | be NULL if the command/subcommand is not one of those defined in the | 381 | be NULL if the command/subcommand is not one of those defined in the |
@@ -332,6 +383,7 @@ char *capi_cmd2str(u8 Command, u8 Subcommand) | |||
332 | 383 | ||
333 | 384 | ||
334 | 7. Debugging | 385 | 7. Debugging |
386 | ============ | ||
335 | 387 | ||
336 | The module kernelcapi has a module parameter showcapimsgs controlling some | 388 | The module kernelcapi has a module parameter showcapimsgs controlling some |
337 | debugging output produced by the module. It can only be set when the module is | 389 | debugging output produced by the module. It can only be set when the module is |
diff --git a/Documentation/isdn/README.mISDN b/Documentation/isdn/m_isdn.rst index cd8bf920e77b..9957de349e69 100644 --- a/Documentation/isdn/README.mISDN +++ b/Documentation/isdn/m_isdn.rst | |||
@@ -1,6 +1,9 @@ | |||
1 | ============ | ||
2 | mISDN Driver | ||
3 | ============ | ||
4 | |||
1 | mISDN is a new modular ISDN driver, in the long term it should replace | 5 | mISDN is a new modular ISDN driver, in the long term it should replace |
2 | the old I4L driver architecture for passiv ISDN cards. | 6 | the old I4L driver architecture for passiv ISDN cards. |
3 | It was designed to allow a broad range of applications and interfaces | 7 | It was designed to allow a broad range of applications and interfaces |
4 | but only have the basic function in kernel, the interface to the user | 8 | but only have the basic function in kernel, the interface to the user |
5 | space is based on sockets with a own address family AF_ISDN. | 9 | space is based on sockets with a own address family AF_ISDN. |
6 | |||
diff --git a/Documentation/kbuild/index.rst b/Documentation/kbuild/index.rst index e323a3f2cc81..0f144fad99a6 100644 --- a/Documentation/kbuild/index.rst +++ b/Documentation/kbuild/index.rst | |||
@@ -18,6 +18,7 @@ Kernel Build System | |||
18 | headers_install | 18 | headers_install |
19 | 19 | ||
20 | issues | 20 | issues |
21 | reproducible-builds | ||
21 | 22 | ||
22 | .. only:: subproject and html | 23 | .. only:: subproject and html |
23 | 24 | ||
diff --git a/Documentation/kbuild/reproducible-builds.rst b/Documentation/kbuild/reproducible-builds.rst new file mode 100644 index 000000000000..ab92e98c89c8 --- /dev/null +++ b/Documentation/kbuild/reproducible-builds.rst | |||
@@ -0,0 +1,122 @@ | |||
1 | =================== | ||
2 | Reproducible builds | ||
3 | =================== | ||
4 | |||
5 | It is generally desirable that building the same source code with | ||
6 | the same set of tools is reproducible, i.e. the output is always | ||
7 | exactly the same. This makes it possible to verify that the build | ||
8 | infrastructure for a binary distribution or embedded system has not | ||
9 | been subverted. This can also make it easier to verify that a source | ||
10 | or tool change does not make any difference to the resulting binaries. | ||
11 | |||
12 | The `Reproducible Builds project`_ has more information about this | ||
13 | general topic. This document covers the various reasons why building | ||
14 | the kernel may be unreproducible, and how to avoid them. | ||
15 | |||
16 | Timestamps | ||
17 | ---------- | ||
18 | |||
19 | The kernel embeds a timestamp in two places: | ||
20 | |||
21 | * The version string exposed by ``uname()`` and included in | ||
22 | ``/proc/version`` | ||
23 | |||
24 | * File timestamps in the embedded initramfs | ||
25 | |||
26 | By default the timestamp is the current time. This must be overridden | ||
27 | using the `KBUILD_BUILD_TIMESTAMP`_ variable. If you are building | ||
28 | from a git commit, you could use its commit date. | ||
29 | |||
30 | The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, | ||
31 | and enables warnings if they are used. If you incorporate external | ||
32 | code that does use these, you must override the timestamp they | ||
33 | correspond to by setting the `SOURCE_DATE_EPOCH`_ environment | ||
34 | variable. | ||
35 | |||
36 | User, host | ||
37 | ---------- | ||
38 | |||
39 | The kernel embeds the building user and host names in | ||
40 | ``/proc/version``. These must be overridden using the | ||
41 | `KBUILD_BUILD_USER and KBUILD_BUILD_HOST`_ variables. If you are | ||
42 | building from a git commit, you could use its committer address. | ||
43 | |||
44 | Absolute filenames | ||
45 | ------------------ | ||
46 | |||
47 | When the kernel is built out-of-tree, debug information may include | ||
48 | absolute filenames for the source files. This must be overridden by | ||
49 | including the ``-fdebug-prefix-map`` option in the `KCFLAGS`_ variable. | ||
50 | |||
51 | Depending on the compiler used, the ``__FILE__`` macro may also expand | ||
52 | to an absolute filename in an out-of-tree build. Kbuild automatically | ||
53 | uses the ``-fmacro-prefix-map`` option to prevent this, if it is | ||
54 | supported. | ||
55 | |||
56 | The Reproducible Builds web site has more information about these | ||
57 | `prefix-map options`_. | ||
58 | |||
59 | Generated files in source packages | ||
60 | ---------------------------------- | ||
61 | |||
62 | The build processes for some programs under the ``tools/`` | ||
63 | subdirectory do not completely support out-of-tree builds. This may | ||
64 | cause a later source package build using e.g. ``make rpm-pkg`` to | ||
65 | include generated files. You should ensure the source tree is | ||
66 | pristine by running ``make mrproper`` or ``git clean -d -f -x`` before | ||
67 | building a source package. | ||
68 | |||
69 | Module signing | ||
70 | -------------- | ||
71 | |||
72 | If you enable ``CONFIG_MODULE_SIG_ALL``, the default behaviour is to | ||
73 | generate a different temporary key for each build, resulting in the | ||
74 | modules being unreproducible. However, including a signing key with | ||
75 | your source would presumably defeat the purpose of signing modules. | ||
76 | |||
77 | One approach to this is to divide up the build process so that the | ||
78 | unreproducible parts can be treated as sources: | ||
79 | |||
80 | 1. Generate a persistent signing key. Add the certificate for the key | ||
81 | to the kernel source. | ||
82 | |||
83 | 2. Set the ``CONFIG_SYSTEM_TRUSTED_KEYS`` symbol to include the | ||
84 | signing key's certificate, set ``CONFIG_MODULE_SIG_KEY`` to an | ||
85 | empty string, and disable ``CONFIG_MODULE_SIG_ALL``. | ||
86 | Build the kernel and modules. | ||
87 | |||
88 | 3. Create detached signatures for the modules, and publish them as | ||
89 | sources. | ||
90 | |||
91 | 4. Perform a second build that attaches the module signatures. It | ||
92 | can either rebuild the modules or use the output of step 2. | ||
93 | |||
94 | Structure randomisation | ||
95 | ----------------------- | ||
96 | |||
97 | If you enable ``CONFIG_GCC_PLUGIN_RANDSTRUCT``, you will need to | ||
98 | pre-generate the random seed in | ||
99 | ``scripts/gcc-plgins/randomize_layout_seed.h`` so the same value | ||
100 | is used in rebuilds. | ||
101 | |||
102 | Debug info conflicts | ||
103 | -------------------- | ||
104 | |||
105 | This is not a problem of unreproducibility, but of generated files | ||
106 | being *too* reproducible. | ||
107 | |||
108 | Once you set all the necessary variables for a reproducible build, a | ||
109 | vDSO's debug information may be identical even for different kernel | ||
110 | versions. This can result in file conflicts between debug information | ||
111 | packages for the different kernel versions. | ||
112 | |||
113 | To avoid this, you can make the vDSO different for different | ||
114 | kernel versions by including an arbitrary string of "salt" in it. | ||
115 | This is specified by the Kconfig symbol ``CONFIG_BUILD_SALT``. | ||
116 | |||
117 | .. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp | ||
118 | .. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST: kbuild.html#kbuild-build-user-kbuild-build-host | ||
119 | .. _KCFLAGS: kbuild.html#kcflags | ||
120 | .. _prefix-map options: https://reproducible-builds.org/docs/build-path/ | ||
121 | .. _Reproducible Builds project: https://reproducible-builds.org/ | ||
122 | .. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-epoch/ | ||
diff --git a/Documentation/locking/spinlocks.rst b/Documentation/locking/spinlocks.rst index e93ec6645238..66e3792f8a36 100644 --- a/Documentation/locking/spinlocks.rst +++ b/Documentation/locking/spinlocks.rst | |||
@@ -139,18 +139,6 @@ on other CPU's, because an interrupt on another CPU doesn't interrupt the | |||
139 | CPU that holds the lock, so the lock-holder can continue and eventually | 139 | CPU that holds the lock, so the lock-holder can continue and eventually |
140 | releases the lock). | 140 | releases the lock). |
141 | 141 | ||
142 | Note that you can be clever with read-write locks and interrupts. For | ||
143 | example, if you know that the interrupt only ever gets a read-lock, then | ||
144 | you can use a non-irq version of read locks everywhere - because they | ||
145 | don't block on each other (and thus there is no dead-lock wrt interrupts. | ||
146 | But when you do the write-lock, you have to use the irq-safe version. | ||
147 | |||
148 | For an example of being clever with rw-locks, see the "waitqueue_lock" | ||
149 | handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from | ||
150 | within an interrupt, they only read the queue in order to know whom to | ||
151 | wake up. So read-locks are safe (which is good: they are very common | ||
152 | indeed), while write-locks need to protect themselves against interrupts. | ||
153 | |||
154 | Linus | 142 | Linus |
155 | 143 | ||
156 | ---- | 144 | ---- |
diff --git a/Documentation/m68k/README.buddha b/Documentation/m68k/buddha-driver.rst index 3ea9827ba3c7..20e401413991 100644 --- a/Documentation/m68k/README.buddha +++ b/Documentation/m68k/buddha-driver.rst | |||
@@ -1,3 +1,6 @@ | |||
1 | ===================================== | ||
2 | Amiga Buddha and Catweasel IDE Driver | ||
3 | ===================================== | ||
1 | 4 | ||
2 | The Amiga Buddha and Catweasel IDE Driver (part of ide.c) was written by | 5 | The Amiga Buddha and Catweasel IDE Driver (part of ide.c) was written by |
3 | Geert Uytterhoeven based on the following specifications: | 6 | Geert Uytterhoeven based on the following specifications: |
@@ -12,12 +15,12 @@ described in their manuals, no tricks have been used (for | |||
12 | example leaving some address lines out of the equations...). | 15 | example leaving some address lines out of the equations...). |
13 | If you want to configure the board yourself (for example let | 16 | If you want to configure the board yourself (for example let |
14 | a Linux kernel configure the card), look at the Commodore | 17 | a Linux kernel configure the card), look at the Commodore |
15 | Docs. Reading the nibbles should give this information: | 18 | Docs. Reading the nibbles should give this information:: |
16 | 19 | ||
17 | Vendor number: 4626 ($1212) | 20 | Vendor number: 4626 ($1212) |
18 | product number: 0 (42 for Catweasel Z-II) | 21 | product number: 0 (42 for Catweasel Z-II) |
19 | Serial number: 0 | 22 | Serial number: 0 |
20 | Rom-vector: $1000 | 23 | Rom-vector: $1000 |
21 | 24 | ||
22 | The card should be a Z-II board, size 64K, not for freemem | 25 | The card should be a Z-II board, size 64K, not for freemem |
23 | list, Rom-Vektor is valid, no second Autoconfig-board on the | 26 | list, Rom-Vektor is valid, no second Autoconfig-board on the |
@@ -34,6 +37,7 @@ otherwise your chance is only 1:16 to find the board :-). | |||
34 | 37 | ||
35 | The local memory-map is even active when mapped to $e8: | 38 | The local memory-map is even active when mapped to $e8: |
36 | 39 | ||
40 | ============== =========================================== | ||
37 | $0-$7e Autokonfig-space, see Z-II docs. | 41 | $0-$7e Autokonfig-space, see Z-II docs. |
38 | 42 | ||
39 | $80-$7fd reserved | 43 | $80-$7fd reserved |
@@ -50,50 +54,51 @@ $a00-$aff IDE-Select 2 (Port 1, Register set 0) | |||
50 | $b00-$bff IDE-Select 3 (Port 1, Register set 1) | 54 | $b00-$bff IDE-Select 3 (Port 1, Register set 1) |
51 | 55 | ||
52 | $c00-$cff IDE-Select 4 (Port 2, Register set 0, | 56 | $c00-$cff IDE-Select 4 (Port 2, Register set 0, |
53 | Catweasel only!) | 57 | Catweasel only!) |
54 | 58 | ||
55 | $d00-$dff IDE-Select 5 (Port 3, Register set 1, | 59 | $d00-$dff IDE-Select 5 (Port 3, Register set 1, |
56 | Catweasel only!) | 60 | Catweasel only!) |
57 | 61 | ||
58 | $e00-$eff local expansion port, on Catweasel Z-II the | 62 | $e00-$eff local expansion port, on Catweasel Z-II the |
59 | Catweasel registers are also mapped here. | 63 | Catweasel registers are also mapped here. |
60 | Never touch, use multidisk.device! | 64 | Never touch, use multidisk.device! |
61 | 65 | ||
62 | $f00 read only, Byte-access: Bit 7 shows the | 66 | $f00 read only, Byte-access: Bit 7 shows the |
63 | level of the IRQ-line of IDE port 0. | 67 | level of the IRQ-line of IDE port 0. |
64 | 68 | ||
65 | $f01-$f3f mirror of $f00 | 69 | $f01-$f3f mirror of $f00 |
66 | 70 | ||
67 | $f40 read only, Byte-access: Bit 7 shows the | 71 | $f40 read only, Byte-access: Bit 7 shows the |
68 | level of the IRQ-line of IDE port 1. | 72 | level of the IRQ-line of IDE port 1. |
69 | 73 | ||
70 | $f41-$f7f mirror of $f40 | 74 | $f41-$f7f mirror of $f40 |
71 | 75 | ||
72 | $f80 read only, Byte-access: Bit 7 shows the | 76 | $f80 read only, Byte-access: Bit 7 shows the |
73 | level of the IRQ-line of IDE port 2. | 77 | level of the IRQ-line of IDE port 2. |
74 | (Catweasel only!) | 78 | (Catweasel only!) |
75 | 79 | ||
76 | $f81-$fbf mirror of $f80 | 80 | $f81-$fbf mirror of $f80 |
77 | 81 | ||
78 | $fc0 write-only: Writing any value to this | 82 | $fc0 write-only: Writing any value to this |
79 | register enables IRQs to be passed from the | 83 | register enables IRQs to be passed from the |
80 | IDE ports to the Zorro bus. This mechanism | 84 | IDE ports to the Zorro bus. This mechanism |
81 | has been implemented to be compatible with | 85 | has been implemented to be compatible with |
82 | harddisks that are either defective or have | 86 | harddisks that are either defective or have |
83 | a buggy firmware and pull the IRQ line up | 87 | a buggy firmware and pull the IRQ line up |
84 | while starting up. If interrupts would | 88 | while starting up. If interrupts would |
85 | always be passed to the bus, the computer | 89 | always be passed to the bus, the computer |
86 | might not start up. Once enabled, this flag | 90 | might not start up. Once enabled, this flag |
87 | can not be disabled again. The level of the | 91 | can not be disabled again. The level of the |
88 | flag can not be determined by software | 92 | flag can not be determined by software |
89 | (what for? Write to me if it's necessary!). | 93 | (what for? Write to me if it's necessary!). |
90 | 94 | ||
91 | $fc1-$fff mirror of $fc0 | 95 | $fc1-$fff mirror of $fc0 |
92 | 96 | ||
93 | $1000-$ffff Buddha-Rom with offset $1000 in the rom | 97 | $1000-$ffff Buddha-Rom with offset $1000 in the rom |
94 | chip. The addresses $0 to $fff of the rom | 98 | chip. The addresses $0 to $fff of the rom |
95 | chip cannot be read. Rom is Byte-wide and | 99 | chip cannot be read. Rom is Byte-wide and |
96 | mapped to even addresses. | 100 | mapped to even addresses. |
101 | ============== =========================================== | ||
97 | 102 | ||
98 | The IDE ports issue an INT2. You can read the level of the | 103 | The IDE ports issue an INT2. You can read the level of the |
99 | IRQ-lines of the IDE-ports by reading from the three (two | 104 | IRQ-lines of the IDE-ports by reading from the three (two |
@@ -128,7 +133,8 @@ must always be set to 1 to be compatible with later Buddha | |||
128 | versions (if I'll ever update this one). I presume that | 133 | versions (if I'll ever update this one). I presume that |
129 | I'll never use the lower four bits, but they have to be set | 134 | I'll never use the lower four bits, but they have to be set |
130 | to 1 by definition. | 135 | to 1 by definition. |
131 | The values in this table have to be shifted 5 bits to the | 136 | |
137 | The values in this table have to be shifted 5 bits to the | ||
132 | left and or'd with $1f (this sets the lower 5 bits). | 138 | left and or'd with $1f (this sets the lower 5 bits). |
133 | 139 | ||
134 | All the timings have in common: Select and IOR/IOW rise at | 140 | All the timings have in common: Select and IOR/IOW rise at |
@@ -138,44 +144,36 @@ values are no multiple of 71. One clock-cycle is 71ns long | |||
138 | (exactly 70,5 at 14,18 Mhz on PAL systems). | 144 | (exactly 70,5 at 14,18 Mhz on PAL systems). |
139 | 145 | ||
140 | value 0 (Default after reset) | 146 | value 0 (Default after reset) |
141 | 147 | 497ns Select (7 clock cycles) , IOR/IOW after 172ns (2 clock cycles) | |
142 | 497ns Select (7 clock cycles) , IOR/IOW after 172ns (2 clock cycles) | 148 | (same timing as the Amiga 1200 does on it's IDE port without |
143 | (same timing as the Amiga 1200 does on it's IDE port without | 149 | accelerator card) |
144 | accelerator card) | ||
145 | 150 | ||
146 | value 1 | 151 | value 1 |
147 | 152 | 639ns Select (9 clock cycles), IOR/IOW after 243ns (3 clock cycles) | |
148 | 639ns Select (9 clock cycles), IOR/IOW after 243ns (3 clock cycles) | ||
149 | 153 | ||
150 | value 2 | 154 | value 2 |
151 | 155 | 781ns Select (11 clock cycles), IOR/IOW after 314ns (4 clock cycles) | |
152 | 781ns Select (11 clock cycles), IOR/IOW after 314ns (4 clock cycles) | ||
153 | 156 | ||
154 | value 3 | 157 | value 3 |
155 | 158 | 355ns Select (5 clock cycles), IOR/IOW after 101ns (1 clock cycle) | |
156 | 355ns Select (5 clock cycles), IOR/IOW after 101ns (1 clock cycle) | ||
157 | 159 | ||
158 | value 4 | 160 | value 4 |
159 | 161 | 355ns Select (5 clock cycles), IOR/IOW after 172ns (2 clock cycles) | |
160 | 355ns Select (5 clock cycles), IOR/IOW after 172ns (2 clock cycles) | ||
161 | 162 | ||
162 | value 5 | 163 | value 5 |
163 | 164 | 355ns Select (5 clock cycles), IOR/IOW after 243ns (3 clock cycles) | |
164 | 355ns Select (5 clock cycles), IOR/IOW after 243ns (3 clock cycles) | ||
165 | 165 | ||
166 | value 6 | 166 | value 6 |
167 | 167 | 1065ns Select (15 clock cycles), IOR/IOW after 314ns (4 clock cycles) | |
168 | 1065ns Select (15 clock cycles), IOR/IOW after 314ns (4 clock cycles) | ||
169 | 168 | ||
170 | value 7 | 169 | value 7 |
171 | 170 | 355ns Select, (5 clock cycles), IOR/IOW after 101ns (1 clock cycle) | |
172 | 355ns Select, (5 clock cycles), IOR/IOW after 101ns (1 clock cycle) | ||
173 | 171 | ||
174 | When accessing IDE registers with A6=1 (for example $84x), | 172 | When accessing IDE registers with A6=1 (for example $84x), |
175 | the timing will always be mode 0 8-bit compatible, no matter | 173 | the timing will always be mode 0 8-bit compatible, no matter |
176 | what you have selected in the speed register: | 174 | what you have selected in the speed register: |
177 | 175 | ||
178 | 781ns select, IOR/IOW after 4 clock cycles (=314ns) aktive. | 176 | 781ns select, IOR/IOW after 4 clock cycles (=314ns) aktive. |
179 | 177 | ||
180 | All the timings with a very short select-signal (the 355ns | 178 | All the timings with a very short select-signal (the 355ns |
181 | fast accesses) depend on the accelerator card used in the | 179 | fast accesses) depend on the accelerator card used in the |
@@ -204,7 +202,8 @@ 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 | 202 | the third IDE port are going into data's Nirwana on the |
205 | Buddha. | 203 | Buddha. |
206 | 204 | ||
207 | Jens Schönfeld february 19th, 1997 | 205 | Jens Schönfeld february 19th, 1997 |
208 | updated may 27th, 1997 | 206 | |
209 | eMail: sysop@nostlgic.tng.oche.de | 207 | updated may 27th, 1997 |
210 | 208 | ||
209 | eMail: sysop@nostlgic.tng.oche.de | ||
diff --git a/Documentation/m68k/index.rst b/Documentation/m68k/index.rst index 3a5ba7fe1703..b89cb6a86d9b 100644 --- a/Documentation/m68k/index.rst +++ b/Documentation/m68k/index.rst | |||
@@ -8,6 +8,7 @@ m68k Architecture | |||
8 | :maxdepth: 2 | 8 | :maxdepth: 2 |
9 | 9 | ||
10 | kernel-options | 10 | kernel-options |
11 | buddha-driver | ||
11 | 12 | ||
12 | .. only:: subproject and html | 13 | .. only:: subproject and html |
13 | 14 | ||
diff --git a/Documentation/maintainer/pull-requests.rst b/Documentation/maintainer/pull-requests.rst index 22b271de0304..1a2f99b67d25 100644 --- a/Documentation/maintainer/pull-requests.rst +++ b/Documentation/maintainer/pull-requests.rst | |||
@@ -29,7 +29,7 @@ request to. | |||
29 | In order to create the pull request you must first tag the branch that you | 29 | In order to create the pull request you must first tag the branch that you |
30 | have just created. It is recommended that you choose a meaningful tag name, | 30 | have just created. It is recommended that you choose a meaningful tag name, |
31 | in a way that you and others can understand, even after some time. A good | 31 | in a way that you and others can understand, even after some time. A good |
32 | practice is to include in the name an indicator of the sybsystem of origin | 32 | practice is to include in the name an indicator of the subsystem of origin |
33 | and the target kernel version. | 33 | and the target kernel version. |
34 | 34 | ||
35 | Greg offers the following. A pull request with miscellaneous stuff for | 35 | Greg offers the following. A pull request with miscellaneous stuff for |
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/au1xxx_ide.rst index ff675a1b1422..2f9c2cff6738 100644 --- a/Documentation/mips/AU1xxx_IDE.README +++ b/Documentation/mips/au1xxx_ide.rst | |||
@@ -1,7 +1,14 @@ | |||
1 | README for MIPS AU1XXX IDE driver - Released 2005-07-15 | 1 | .. include:: <isonum.txt> |
2 | |||
3 | ====================== | ||
4 | MIPS AU1XXX IDE driver | ||
5 | ====================== | ||
6 | |||
7 | Released 2005-07-15 | ||
8 | |||
9 | About | ||
10 | ===== | ||
2 | 11 | ||
3 | ABOUT | ||
4 | ----- | ||
5 | This file describes the 'drivers/ide/au1xxx-ide.c', related files and the | 12 | This file describes the 'drivers/ide/au1xxx-ide.c', related files and the |
6 | services they provide. | 13 | services they provide. |
7 | 14 | ||
@@ -10,17 +17,17 @@ the white or black list, go to the 'ADD NEW HARD DISC TO WHITE OR BLACK LIST' | |||
10 | section. | 17 | section. |
11 | 18 | ||
12 | 19 | ||
13 | LICENSE | 20 | License |
14 | ------- | 21 | ======= |
15 | 22 | ||
16 | Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions | 23 | :Copyright: |copy| 2003-2005 AMD, Personal Connectivity Solutions |
17 | 24 | ||
18 | This program is free software; you can redistribute it and/or modify it under | 25 | This program is free software; you can redistribute it and/or modify it under |
19 | the terms of the GNU General Public License as published by the Free Software | 26 | the terms of the GNU General Public License as published by the Free Software |
20 | Foundation; either version 2 of the License, or (at your option) any later | 27 | Foundation; either version 2 of the License, or (at your option) any later |
21 | version. | 28 | version. |
22 | 29 | ||
23 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | 30 | THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, |
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | 31 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
25 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | 32 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR |
26 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 33 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
@@ -35,31 +42,35 @@ You should have received a copy of the GNU General Public License along with | |||
35 | this program; if not, write to the Free Software Foundation, Inc., | 42 | this program; if not, write to the Free Software Foundation, Inc., |
36 | 675 Mass Ave, Cambridge, MA 02139, USA. | 43 | 675 Mass Ave, Cambridge, MA 02139, USA. |
37 | 44 | ||
38 | Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE | 45 | Note: |
46 | for more information, please refer "AMD Alchemy Au1200/Au1550 IDE | ||
39 | Interface and Linux Device Driver" Application Note. | 47 | Interface and Linux Device Driver" Application Note. |
40 | 48 | ||
41 | 49 | ||
42 | FILES, CONFIGS AND COMPATIBILITY | 50 | Files, Configs and Compatibility |
43 | -------------------------------- | 51 | ================================ |
44 | 52 | ||
45 | Two files are introduced: | 53 | Two files are introduced: |
46 | 54 | ||
47 | a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h' | 55 | a) 'arch/mips/include/asm/mach-au1x00/au1xxx_ide.h' |
48 | contains : struct _auide_hwif | 56 | contains : struct _auide_hwif |
49 | timing parameters for PIO mode 0/1/2/3/4 | 57 | |
50 | timing parameters for MWDMA 0/1/2 | 58 | - timing parameters for PIO mode 0/1/2/3/4 |
59 | - timing parameters for MWDMA 0/1/2 | ||
51 | 60 | ||
52 | b) 'drivers/ide/mips/au1xxx-ide.c' | 61 | b) 'drivers/ide/mips/au1xxx-ide.c' |
53 | contains the functionality of the AU1XXX IDE driver | 62 | contains the functionality of the AU1XXX IDE driver |
54 | 63 | ||
55 | Following extra configs variables are introduced: | 64 | Following extra configs variables are introduced: |
56 | 65 | ||
57 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA - enable the PIO+DBDMA mode | 66 | CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA |
58 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA - enable the MWDMA mode | 67 | - enable the PIO+DBDMA mode |
68 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
69 | - enable the MWDMA mode | ||
59 | 70 | ||
60 | 71 | ||
61 | SUPPORTED IDE MODES | 72 | Supported IDE Modes |
62 | ------------------- | 73 | =================== |
63 | 74 | ||
64 | The AU1XXX IDE driver supported all PIO modes - PIO mode 0/1/2/3/4 - and all | 75 | The AU1XXX IDE driver supported all PIO modes - PIO mode 0/1/2/3/4 - and all |
65 | MWDMA modes - MWDMA 0/1/2 -. There is no support for SWDMA and UDMA mode. | 76 | MWDMA modes - MWDMA 0/1/2 -. There is no support for SWDMA and UDMA mode. |
@@ -69,20 +80,21 @@ To change the PIO mode use the program hdparm with option -p, e.g. | |||
69 | -X, e.g. 'hdparm -X32 [device]' for MWDMA mode 0. | 80 | -X, e.g. 'hdparm -X32 [device]' for MWDMA mode 0. |
70 | 81 | ||
71 | 82 | ||
72 | PERFORMANCE CONFIGURATIONS | 83 | Performance Configurations |
73 | -------------------------- | 84 | ========================== |
74 | 85 | ||
75 | If the used system doesn't need USB support enable the following kernel configs: | 86 | If the used system doesn't need USB support enable the following kernel |
87 | configs:: | ||
76 | 88 | ||
77 | CONFIG_IDE=y | 89 | CONFIG_IDE=y |
78 | CONFIG_BLK_DEV_IDE=y | 90 | CONFIG_BLK_DEV_IDE=y |
79 | CONFIG_IDE_GENERIC=y | 91 | CONFIG_IDE_GENERIC=y |
80 | CONFIG_BLK_DEV_IDEPCI=y | 92 | CONFIG_BLK_DEV_IDEPCI=y |
81 | CONFIG_BLK_DEV_GENERIC=y | 93 | CONFIG_BLK_DEV_GENERIC=y |
82 | CONFIG_BLK_DEV_IDEDMA_PCI=y | 94 | CONFIG_BLK_DEV_IDEDMA_PCI=y |
83 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 95 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
84 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 96 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y |
85 | CONFIG_BLK_DEV_IDEDMA=y | 97 | CONFIG_BLK_DEV_IDEDMA=y |
86 | 98 | ||
87 | Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable | 99 | Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable |
88 | the burst support on DBDMA controller. | 100 | the burst support on DBDMA controller. |
@@ -90,20 +102,22 @@ the burst support on DBDMA controller. | |||
90 | If the used system need the USB support enable the following kernel configs for | 102 | If the used system need the USB support enable the following kernel configs for |
91 | high IDE to USB throughput. | 103 | high IDE to USB throughput. |
92 | 104 | ||
93 | CONFIG_IDE_GENERIC=y | 105 | :: |
94 | CONFIG_BLK_DEV_IDEPCI=y | 106 | |
95 | CONFIG_BLK_DEV_GENERIC=y | 107 | CONFIG_IDE_GENERIC=y |
96 | CONFIG_BLK_DEV_IDEDMA_PCI=y | 108 | CONFIG_BLK_DEV_IDEPCI=y |
97 | CONFIG_BLK_DEV_IDE_AU1XXX=y | 109 | CONFIG_BLK_DEV_GENERIC=y |
98 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | 110 | CONFIG_BLK_DEV_IDEDMA_PCI=y |
99 | CONFIG_BLK_DEV_IDEDMA=y | 111 | CONFIG_BLK_DEV_IDE_AU1XXX=y |
112 | CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y | ||
113 | CONFIG_BLK_DEV_IDEDMA=y | ||
100 | 114 | ||
101 | Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to | 115 | Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to |
102 | disable the burst support on DBDMA controller. | 116 | disable the burst support on DBDMA controller. |
103 | 117 | ||
104 | 118 | ||
105 | ACKNOWLEDGMENTS | 119 | Acknowledgments |
106 | --------------- | 120 | =============== |
107 | 121 | ||
108 | These drivers wouldn't have been done without the base of kernel 2.4.x AU1XXX | 122 | These drivers wouldn't have been done without the base of kernel 2.4.x AU1XXX |
109 | IDE driver from AMD. | 123 | IDE driver from AMD. |
@@ -112,4 +126,5 @@ Additional input also from: | |||
112 | Matthias Lenk <matthias.lenk@amd.com> | 126 | Matthias Lenk <matthias.lenk@amd.com> |
113 | 127 | ||
114 | Happy hacking! | 128 | Happy hacking! |
129 | |||
115 | Enrico Walther <enrico.walther@amd.com> | 130 | Enrico Walther <enrico.walther@amd.com> |
diff --git a/Documentation/mips/index.rst b/Documentation/mips/index.rst new file mode 100644 index 000000000000..fd9023c8a89f --- /dev/null +++ b/Documentation/mips/index.rst | |||
@@ -0,0 +1,17 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ================= | ||
4 | MIPS architecture | ||
5 | ================= | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | au1xxx_ide | ||
11 | |||
12 | .. only:: subproject and html | ||
13 | |||
14 | Indices | ||
15 | ======= | ||
16 | |||
17 | * :ref:`genindex` | ||
diff --git a/Documentation/networking/caif/README b/Documentation/networking/caif/caif.rst index 757ccfaa1385..07afc8063d4d 100644 --- a/Documentation/networking/caif/README +++ b/Documentation/networking/caif/caif.rst | |||
@@ -1,18 +1,31 @@ | |||
1 | Copyright (C) ST-Ericsson AB 2010 | 1 | :orphan: |
2 | Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
3 | License terms: GNU General Public License (GPL) version 2 | ||
4 | --------------------------------------------------------- | ||
5 | 2 | ||
6 | === Start === | 3 | .. SPDX-License-Identifier: GPL-2.0 |
7 | If you have compiled CAIF for modules do: | 4 | .. include:: <isonum.txt> |
8 | 5 | ||
9 | $modprobe crc_ccitt | ||
10 | $modprobe caif | ||
11 | $modprobe caif_socket | ||
12 | $modprobe chnl_net | ||
13 | 6 | ||
7 | ================ | ||
8 | Using Linux CAIF | ||
9 | ================ | ||
14 | 10 | ||
15 | === Preparing the setup with a STE modem === | 11 | |
12 | :Copyright: |copy| ST-Ericsson AB 2010 | ||
13 | |||
14 | :Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
15 | |||
16 | Start | ||
17 | ===== | ||
18 | |||
19 | If you have compiled CAIF for modules do:: | ||
20 | |||
21 | $modprobe crc_ccitt | ||
22 | $modprobe caif | ||
23 | $modprobe caif_socket | ||
24 | $modprobe chnl_net | ||
25 | |||
26 | |||
27 | Preparing the setup with a STE modem | ||
28 | ==================================== | ||
16 | 29 | ||
17 | If you are working on integration of CAIF you should make sure | 30 | If you are working on integration of CAIF you should make sure |
18 | that the kernel is built with module support. | 31 | that the kernel is built with module support. |
@@ -32,24 +45,30 @@ module parameter "ser_use_stx". | |||
32 | Normally Frame Checksum is always used on UART, but this is also provided as a | 45 | Normally Frame Checksum is always used on UART, but this is also provided as a |
33 | module parameter "ser_use_fcs". | 46 | module parameter "ser_use_fcs". |
34 | 47 | ||
35 | $ modprobe caif_serial ser_ttyname=/dev/ttyS0 ser_use_stx=yes | 48 | :: |
36 | $ ifconfig caif_ttyS0 up | 49 | |
50 | $ modprobe caif_serial ser_ttyname=/dev/ttyS0 ser_use_stx=yes | ||
51 | $ ifconfig caif_ttyS0 up | ||
37 | 52 | ||
38 | PLEASE NOTE: There is a limitation in Android shell. | 53 | PLEASE NOTE: |
54 | There is a limitation in Android shell. | ||
39 | It only accepts one argument to insmod/modprobe! | 55 | It only accepts one argument to insmod/modprobe! |
40 | 56 | ||
41 | === Trouble shooting === | 57 | Trouble shooting |
58 | ================ | ||
42 | 59 | ||
43 | There are debugfs parameters provided for serial communication. | 60 | There are debugfs parameters provided for serial communication. |
44 | /sys/kernel/debug/caif_serial/<tty-name>/ | 61 | /sys/kernel/debug/caif_serial/<tty-name>/ |
45 | 62 | ||
46 | * ser_state: Prints the bit-mask status where | 63 | * ser_state: Prints the bit-mask status where |
64 | |||
47 | - 0x02 means SENDING, this is a transient state. | 65 | - 0x02 means SENDING, this is a transient state. |
48 | - 0x10 means FLOW_OFF_SENT, i.e. the previous frame has not been sent | 66 | - 0x10 means FLOW_OFF_SENT, i.e. the previous frame has not been sent |
49 | and is blocking further send operation. Flow OFF has been propagated | 67 | and is blocking further send operation. Flow OFF has been propagated |
50 | to all CAIF Channels using this TTY. | 68 | to all CAIF Channels using this TTY. |
51 | 69 | ||
52 | * tty_status: Prints the bit-mask tty status information | 70 | * tty_status: Prints the bit-mask tty status information |
71 | |||
53 | - 0x01 - tty->warned is on. | 72 | - 0x01 - tty->warned is on. |
54 | - 0x02 - tty->low_latency is on. | 73 | - 0x02 - tty->low_latency is on. |
55 | - 0x04 - tty->packed is on. | 74 | - 0x04 - tty->packed is on. |
@@ -58,13 +77,17 @@ There are debugfs parameters provided for serial communication. | |||
58 | - 0x20 - tty->stopped is on. | 77 | - 0x20 - tty->stopped is on. |
59 | 78 | ||
60 | * last_tx_msg: Binary blob Prints the last transmitted frame. | 79 | * last_tx_msg: Binary blob Prints the last transmitted frame. |
61 | This can be printed with | 80 | |
81 | This can be printed with:: | ||
82 | |||
62 | $od --format=x1 /sys/kernel/debug/caif_serial/<tty>/last_rx_msg. | 83 | $od --format=x1 /sys/kernel/debug/caif_serial/<tty>/last_rx_msg. |
63 | The first two tx messages sent look like this. Note: The initial | ||
64 | byte 02 is start of frame extension (STX) used for re-syncing | ||
65 | upon errors. | ||
66 | 84 | ||
67 | - Enumeration: | 85 | The first two tx messages sent look like this. Note: The initial |
86 | byte 02 is start of frame extension (STX) used for re-syncing | ||
87 | upon errors. | ||
88 | |||
89 | - Enumeration:: | ||
90 | |||
68 | 0000000 02 05 00 00 03 01 d2 02 | 91 | 0000000 02 05 00 00 03 01 d2 02 |
69 | | | | | | | | 92 | | | | | | | |
70 | STX(1) | | | | | 93 | STX(1) | | | | |
@@ -73,7 +96,9 @@ There are debugfs parameters provided for serial communication. | |||
73 | Command:Enumeration(1) | 96 | Command:Enumeration(1) |
74 | Link-ID(1) | 97 | Link-ID(1) |
75 | Checksum(2) | 98 | Checksum(2) |
76 | - Channel Setup: | 99 | |
100 | - Channel Setup:: | ||
101 | |||
77 | 0000000 02 07 00 00 00 21 a1 00 48 df | 102 | 0000000 02 07 00 00 00 21 a1 00 48 df |
78 | | | | | | | | | | 103 | | | | | | | | | |
79 | STX(1) | | | | | | | 104 | STX(1) | | | | | | |
@@ -86,13 +111,18 @@ There are debugfs parameters provided for serial communication. | |||
86 | Checksum(2) | 111 | Checksum(2) |
87 | 112 | ||
88 | * last_rx_msg: Prints the last transmitted frame. | 113 | * last_rx_msg: Prints the last transmitted frame. |
89 | The RX messages for LinkSetup look almost identical but they have the | 114 | |
90 | bit 0x20 set in the command bit, and Channel Setup has added one byte | 115 | The RX messages for LinkSetup look almost identical but they have the |
91 | before Checksum containing Channel ID. | 116 | bit 0x20 set in the command bit, and Channel Setup has added one byte |
92 | NOTE: Several CAIF Messages might be concatenated. The maximum debug | 117 | before Checksum containing Channel ID. |
118 | |||
119 | NOTE: | ||
120 | Several CAIF Messages might be concatenated. The maximum debug | ||
93 | buffer size is 128 bytes. | 121 | buffer size is 128 bytes. |
94 | 122 | ||
95 | == Error Scenarios: | 123 | Error Scenarios |
124 | =============== | ||
125 | |||
96 | - last_tx_msg contains channel setup message and last_rx_msg is empty -> | 126 | - last_tx_msg contains channel setup message and last_rx_msg is empty -> |
97 | The host seems to be able to send over the UART, at least the CAIF ldisc get | 127 | The host seems to be able to send over the UART, at least the CAIF ldisc get |
98 | notified that sending is completed. | 128 | notified that sending is completed. |
@@ -103,7 +133,9 @@ There are debugfs parameters provided for serial communication. | |||
103 | 133 | ||
104 | - if /sys/kernel/debug/caif_serial/<tty>/tty_status is non-zero there | 134 | - if /sys/kernel/debug/caif_serial/<tty>/tty_status is non-zero there |
105 | might be problems transmitting over UART. | 135 | might be problems transmitting over UART. |
136 | |||
106 | E.g. host and modem wiring is not correct you will typically see | 137 | E.g. host and modem wiring is not correct you will typically see |
107 | tty_status = 0x10 (hw_stopped) and ser_state = 0x10 (FLOW_OFF_SENT). | 138 | tty_status = 0x10 (hw_stopped) and ser_state = 0x10 (FLOW_OFF_SENT). |
139 | |||
108 | You will probably see the enumeration message in last_tx_message | 140 | You will probably see the enumeration message in last_tx_message |
109 | and empty last_rx_message. | 141 | and empty last_rx_message. |
diff --git a/Documentation/networking/device_drivers/index.rst b/Documentation/networking/device_drivers/index.rst index 2b7fefe72351..f724b7c69b9e 100644 --- a/Documentation/networking/device_drivers/index.rst +++ b/Documentation/networking/device_drivers/index.rst | |||
@@ -24,7 +24,7 @@ Contents: | |||
24 | google/gve | 24 | google/gve |
25 | mellanox/mlx5 | 25 | mellanox/mlx5 |
26 | 26 | ||
27 | .. only:: subproject | 27 | .. only:: subproject and html |
28 | 28 | ||
29 | Indices | 29 | Indices |
30 | ======= | 30 | ======= |
diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index a46fca264bee..6739066acadb 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst | |||
@@ -31,7 +31,7 @@ Contents: | |||
31 | tls | 31 | tls |
32 | tls-offload | 32 | tls-offload |
33 | 33 | ||
34 | .. only:: subproject | 34 | .. only:: subproject and html |
35 | 35 | ||
36 | Indices | 36 | Indices |
37 | ======= | 37 | ======= |
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst index 3566a725d19c..d2266ce5534e 100644 --- a/Documentation/networking/mac80211_hwsim/README +++ b/Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst | |||
@@ -1,5 +1,13 @@ | |||
1 | :orphan: | ||
2 | |||
3 | .. SPDX-License-Identifier: GPL-2.0 | ||
4 | .. include:: <isonum.txt> | ||
5 | |||
6 | =================================================================== | ||
1 | mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 | 7 | mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 |
2 | Copyright (c) 2008, Jouni Malinen <j@w1.fi> | 8 | =================================================================== |
9 | |||
10 | :Copyright: |copy| 2008, Jouni Malinen <j@w1.fi> | ||
3 | 11 | ||
4 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License version 2 as | 13 | it under the terms of the GNU General Public License version 2 as |
@@ -7,6 +15,7 @@ published by the Free Software Foundation. | |||
7 | 15 | ||
8 | 16 | ||
9 | Introduction | 17 | Introduction |
18 | ============ | ||
10 | 19 | ||
11 | mac80211_hwsim is a Linux kernel module that can be used to simulate | 20 | mac80211_hwsim is a Linux kernel module that can be used to simulate |
12 | arbitrary number of IEEE 802.11 radios for mac80211. It can be used to | 21 | arbitrary number of IEEE 802.11 radios for mac80211. It can be used to |
@@ -43,6 +52,7 @@ regardless of channel. | |||
43 | 52 | ||
44 | 53 | ||
45 | Simple example | 54 | Simple example |
55 | ============== | ||
46 | 56 | ||
47 | This example shows how to use mac80211_hwsim to simulate two radios: | 57 | This example shows how to use mac80211_hwsim to simulate two radios: |
48 | one to act as an access point and the other as a station that | 58 | one to act as an access point and the other as a station that |
@@ -50,17 +60,19 @@ associates with the AP. hostapd and wpa_supplicant are used to take | |||
50 | care of WPA2-PSK authentication. In addition, hostapd is also | 60 | care of WPA2-PSK authentication. In addition, hostapd is also |
51 | processing access point side of association. | 61 | processing access point side of association. |
52 | 62 | ||
63 | :: | ||
64 | |||
53 | 65 | ||
54 | # Build mac80211_hwsim as part of kernel configuration | 66 | # Build mac80211_hwsim as part of kernel configuration |
55 | 67 | ||
56 | # Load the module | 68 | # Load the module |
57 | modprobe mac80211_hwsim | 69 | modprobe mac80211_hwsim |
58 | 70 | ||
59 | # Run hostapd (AP) for wlan0 | 71 | # Run hostapd (AP) for wlan0 |
60 | hostapd hostapd.conf | 72 | hostapd hostapd.conf |
61 | 73 | ||
62 | # Run wpa_supplicant (station) for wlan1 | 74 | # Run wpa_supplicant (station) for wlan1 |
63 | wpa_supplicant -Dnl80211 -iwlan1 -c wpa_supplicant.conf | 75 | wpa_supplicant -Dnl80211 -iwlan1 -c wpa_supplicant.conf |
64 | 76 | ||
65 | 77 | ||
66 | More test cases are available in hostap.git: | 78 | More test cases are available in hostap.git: |
diff --git a/Documentation/nios2/README b/Documentation/nios2/nios2.rst index 054a67d55563..43da3f7cee76 100644 --- a/Documentation/nios2/README +++ b/Documentation/nios2/nios2.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ================================= | ||
1 | Linux on the Nios II architecture | 2 | Linux on the Nios II architecture |
2 | ================================= | 3 | ================================= |
3 | 4 | ||
diff --git a/Documentation/openrisc/index.rst b/Documentation/openrisc/index.rst new file mode 100644 index 000000000000..748b3eea1707 --- /dev/null +++ b/Documentation/openrisc/index.rst | |||
@@ -0,0 +1,18 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ===================== | ||
4 | OpenRISC Architecture | ||
5 | ===================== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | openrisc_port | ||
11 | todo | ||
12 | |||
13 | .. only:: subproject and html | ||
14 | |||
15 | Indices | ||
16 | ======= | ||
17 | |||
18 | * :ref:`genindex` | ||
diff --git a/Documentation/openrisc/README b/Documentation/openrisc/openrisc_port.rst index 777a893d533d..a18747a8d191 100644 --- a/Documentation/openrisc/README +++ b/Documentation/openrisc/openrisc_port.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============== | ||
1 | OpenRISC Linux | 2 | OpenRISC Linux |
2 | ============== | 3 | ============== |
3 | 4 | ||
@@ -6,8 +7,10 @@ target architecture, specifically, is the 32-bit OpenRISC 1000 family (or1k). | |||
6 | 7 | ||
7 | For information about OpenRISC processors and ongoing development: | 8 | For information about OpenRISC processors and ongoing development: |
8 | 9 | ||
10 | ======= ============================= | ||
9 | website http://openrisc.io | 11 | website http://openrisc.io |
10 | email openrisc@lists.librecores.org | 12 | email openrisc@lists.librecores.org |
13 | ======= ============================= | ||
11 | 14 | ||
12 | --------------------------------------------------------------------- | 15 | --------------------------------------------------------------------- |
13 | 16 | ||
@@ -24,13 +27,15 @@ Toolchain binaries can be obtained from openrisc.io or our github releases page. | |||
24 | Instructions for building the different toolchains can be found on openrisc.io | 27 | Instructions for building the different toolchains can be found on openrisc.io |
25 | or Stafford's toolchain build and release scripts. | 28 | or Stafford's toolchain build and release scripts. |
26 | 29 | ||
30 | ========== ================================================= | ||
27 | binaries https://github.com/openrisc/or1k-gcc/releases | 31 | binaries https://github.com/openrisc/or1k-gcc/releases |
28 | toolchains https://openrisc.io/software | 32 | toolchains https://openrisc.io/software |
29 | building https://github.com/stffrdhrn/or1k-toolchain-build | 33 | building https://github.com/stffrdhrn/or1k-toolchain-build |
34 | ========== ================================================= | ||
30 | 35 | ||
31 | 2) Building | 36 | 2) Building |
32 | 37 | ||
33 | Build the Linux kernel as usual | 38 | Build the Linux kernel as usual:: |
34 | 39 | ||
35 | make ARCH=openrisc defconfig | 40 | make ARCH=openrisc defconfig |
36 | make ARCH=openrisc | 41 | make ARCH=openrisc |
@@ -43,6 +48,8 @@ development board with the OpenRISC SoC. During the build FPGA RTL is code | |||
43 | downloaded from the FuseSoC IP cores repository and built using the FPGA vendor | 48 | downloaded from the FuseSoC IP cores repository and built using the FPGA vendor |
44 | tools. Binaries are loaded onto the board with openocd. | 49 | tools. Binaries are loaded onto the board with openocd. |
45 | 50 | ||
51 | :: | ||
52 | |||
46 | git clone https://github.com/olofk/fusesoc | 53 | git clone https://github.com/olofk/fusesoc |
47 | cd fusesoc | 54 | cd fusesoc |
48 | sudo pip install -e . | 55 | sudo pip install -e . |
@@ -65,7 +72,9 @@ platform. Please follow the OpenRISC instructions on the QEMU website to get | |||
65 | Linux running on QEMU. You can build QEMU yourself, but your Linux distribution | 72 | Linux running on QEMU. You can build QEMU yourself, but your Linux distribution |
66 | likely provides binary packages to support OpenRISC. | 73 | likely provides binary packages to support OpenRISC. |
67 | 74 | ||
75 | ============= ====================================================== | ||
68 | qemu openrisc https://wiki.qemu.org/Documentation/Platforms/OpenRISC | 76 | qemu openrisc https://wiki.qemu.org/Documentation/Platforms/OpenRISC |
77 | ============= ====================================================== | ||
69 | 78 | ||
70 | --------------------------------------------------------------------- | 79 | --------------------------------------------------------------------- |
71 | 80 | ||
@@ -75,36 +84,38 @@ Terminology | |||
75 | In the code, the following particles are used on symbols to limit the scope | 84 | In the code, the following particles are used on symbols to limit the scope |
76 | to more or less specific processor implementations: | 85 | to more or less specific processor implementations: |
77 | 86 | ||
87 | ========= ======================================= | ||
78 | openrisc: the OpenRISC class of processors | 88 | openrisc: the OpenRISC class of processors |
79 | or1k: the OpenRISC 1000 family of processors | 89 | or1k: the OpenRISC 1000 family of processors |
80 | or1200: the OpenRISC 1200 processor | 90 | or1200: the OpenRISC 1200 processor |
91 | ========= ======================================= | ||
81 | 92 | ||
82 | --------------------------------------------------------------------- | 93 | --------------------------------------------------------------------- |
83 | 94 | ||
84 | History | 95 | History |
85 | ======== | 96 | ======== |
86 | 97 | ||
87 | 18. 11. 2003 Matjaz Breskvar (phoenix@bsemi.com) | 98 | 18-11-2003 Matjaz Breskvar (phoenix@bsemi.com) |
88 | initial port of linux to OpenRISC/or32 architecture. | 99 | initial port of linux to OpenRISC/or32 architecture. |
89 | all the core stuff is implemented and seams usable. | 100 | all the core stuff is implemented and seams usable. |
90 | 101 | ||
91 | 08. 12. 2003 Matjaz Breskvar (phoenix@bsemi.com) | 102 | 08-12-2003 Matjaz Breskvar (phoenix@bsemi.com) |
92 | complete change of TLB miss handling. | 103 | complete change of TLB miss handling. |
93 | rewrite of exceptions handling. | 104 | rewrite of exceptions handling. |
94 | fully functional sash-3.6 in default initrd. | 105 | fully functional sash-3.6 in default initrd. |
95 | a much improved version with changes all around. | 106 | a much improved version with changes all around. |
96 | 107 | ||
97 | 10. 04. 2004 Matjaz Breskvar (phoenix@bsemi.com) | 108 | 10-04-2004 Matjaz Breskvar (phoenix@bsemi.com) |
98 | alot of bugfixes all over. | 109 | alot of bugfixes all over. |
99 | ethernet support, functional http and telnet servers. | 110 | ethernet support, functional http and telnet servers. |
100 | running many standard linux apps. | 111 | running many standard linux apps. |
101 | 112 | ||
102 | 26. 06. 2004 Matjaz Breskvar (phoenix@bsemi.com) | 113 | 26-06-2004 Matjaz Breskvar (phoenix@bsemi.com) |
103 | port to 2.6.x | 114 | port to 2.6.x |
104 | 115 | ||
105 | 30. 11. 2004 Matjaz Breskvar (phoenix@bsemi.com) | 116 | 30-11-2004 Matjaz Breskvar (phoenix@bsemi.com) |
106 | lots of bugfixes and enhancments. | 117 | lots of bugfixes and enhancments. |
107 | added opencores framebuffer driver. | 118 | added opencores framebuffer driver. |
108 | 119 | ||
109 | 09. 10. 2010 Jonas Bonn (jonas@southpole.se) | 120 | 09-10-2010 Jonas Bonn (jonas@southpole.se) |
110 | major rewrite to bring up to par with upstream Linux 2.6.36 | 121 | major rewrite to bring up to par with upstream Linux 2.6.36 |
diff --git a/Documentation/openrisc/TODO b/Documentation/openrisc/todo.rst index c43d4e1d14eb..420b18b87eda 100644 --- a/Documentation/openrisc/TODO +++ b/Documentation/openrisc/todo.rst | |||
@@ -1,12 +1,15 @@ | |||
1 | ==== | ||
2 | TODO | ||
3 | ==== | ||
4 | |||
1 | The OpenRISC Linux port is fully functional and has been tracking upstream | 5 | The OpenRISC Linux port is fully functional and has been tracking upstream |
2 | since 2.6.35. There are, however, remaining items to be completed within | 6 | since 2.6.35. There are, however, remaining items to be completed within |
3 | the coming months. Here's a list of known-to-be-less-than-stellar items | 7 | the coming months. Here's a list of known-to-be-less-than-stellar items |
4 | that are due for investigation shortly, i.e. our TODO list: | 8 | that are due for investigation shortly, i.e. our TODO list: |
5 | 9 | ||
6 | -- Implement the rest of the DMA API... dma_map_sg, etc. | 10 | - Implement the rest of the DMA API... dma_map_sg, etc. |
7 | 11 | ||
8 | -- Finish the renaming cleanup... there are references to or32 in the code | 12 | - Finish the renaming cleanup... there are references to or32 in the code |
9 | which was an older name for the architecture. The name we've settled on is | 13 | which was an older name for the architecture. The name we've settled on is |
10 | or1k and this change is slowly trickling through the stack. For the time | 14 | or1k and this change is slowly trickling through the stack. For the time |
11 | being, or32 is equivalent to or1k. | 15 | being, or32 is equivalent to or1k. |
12 | |||
diff --git a/Documentation/parisc/debugging b/Documentation/parisc/debugging.rst index 7d75223fa18d..de1b60402c5b 100644 --- a/Documentation/parisc/debugging +++ b/Documentation/parisc/debugging.rst | |||
@@ -1,8 +1,13 @@ | |||
1 | ================= | ||
2 | PA-RISC Debugging | ||
3 | ================= | ||
4 | |||
1 | okay, here are some hints for debugging the lower-level parts of | 5 | okay, here are some hints for debugging the lower-level parts of |
2 | linux/parisc. | 6 | linux/parisc. |
3 | 7 | ||
4 | 8 | ||
5 | 1. Absolute addresses | 9 | 1. Absolute addresses |
10 | ===================== | ||
6 | 11 | ||
7 | A lot of the assembly code currently runs in real mode, which means | 12 | A lot of the assembly code currently runs in real mode, which means |
8 | absolute addresses are used instead of virtual addresses as in the | 13 | absolute addresses are used instead of virtual addresses as in the |
@@ -12,6 +17,7 @@ currently). | |||
12 | 17 | ||
13 | 18 | ||
14 | 2. HPMCs | 19 | 2. HPMCs |
20 | ======== | ||
15 | 21 | ||
16 | When real-mode code tries to access non-existent memory, you'll get | 22 | When real-mode code tries to access non-existent memory, you'll get |
17 | an HPMC instead of a kernel oops. To debug an HPMC, try to find | 23 | an HPMC instead of a kernel oops. To debug an HPMC, try to find |
@@ -27,6 +33,7 @@ access it. | |||
27 | 33 | ||
28 | 34 | ||
29 | 3. Q bit fun | 35 | 3. Q bit fun |
36 | ============ | ||
30 | 37 | ||
31 | Certain, very critical code has to clear the Q bit in the PSW. What | 38 | Certain, very critical code has to clear the Q bit in the PSW. What |
32 | happens when the Q bit is cleared is the CPU does not update the | 39 | happens when the Q bit is cleared is the CPU does not update the |
diff --git a/Documentation/parisc/index.rst b/Documentation/parisc/index.rst new file mode 100644 index 000000000000..aa3ee0470425 --- /dev/null +++ b/Documentation/parisc/index.rst | |||
@@ -0,0 +1,18 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ==================== | ||
4 | PA-RISC Architecture | ||
5 | ==================== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | debugging | ||
11 | registers | ||
12 | |||
13 | .. only:: subproject and html | ||
14 | |||
15 | Indices | ||
16 | ======= | ||
17 | |||
18 | * :ref:`genindex` | ||
diff --git a/Documentation/parisc/registers b/Documentation/parisc/registers.rst index 10c7d1730f5d..59c8ecf3e856 100644 --- a/Documentation/parisc/registers +++ b/Documentation/parisc/registers.rst | |||
@@ -1,11 +1,16 @@ | |||
1 | ================================ | ||
1 | Register Usage for Linux/PA-RISC | 2 | Register Usage for Linux/PA-RISC |
3 | ================================ | ||
2 | 4 | ||
3 | [ an asterisk is used for planned usage which is currently unimplemented ] | 5 | [ an asterisk is used for planned usage which is currently unimplemented ] |
4 | 6 | ||
5 | General Registers as specified by ABI | 7 | General Registers as specified by ABI |
8 | ===================================== | ||
6 | 9 | ||
7 | Control Registers | 10 | Control Registers |
11 | ----------------- | ||
8 | 12 | ||
13 | =============================== =============================================== | ||
9 | CR 0 (Recovery Counter) used for ptrace | 14 | CR 0 (Recovery Counter) used for ptrace |
10 | CR 1-CR 7(undefined) unused | 15 | CR 1-CR 7(undefined) unused |
11 | CR 8 (Protection ID) per-process value* | 16 | CR 8 (Protection ID) per-process value* |
@@ -29,26 +34,35 @@ CR28 (TR 4) not used | |||
29 | CR29 (TR 5) not used | 34 | CR29 (TR 5) not used |
30 | CR30 (TR 6) current / 0 | 35 | CR30 (TR 6) current / 0 |
31 | CR31 (TR 7) Temporary register, used in various places | 36 | CR31 (TR 7) Temporary register, used in various places |
37 | =============================== =============================================== | ||
32 | 38 | ||
33 | Space Registers (kernel mode) | 39 | Space Registers (kernel mode) |
40 | ----------------------------- | ||
34 | 41 | ||
42 | =============================== =============================================== | ||
35 | SR0 temporary space register | 43 | SR0 temporary space register |
36 | SR4-SR7 set to 0 | 44 | SR4-SR7 set to 0 |
37 | SR1 temporary space register | 45 | SR1 temporary space register |
38 | SR2 kernel should not clobber this | 46 | SR2 kernel should not clobber this |
39 | SR3 used for userspace accesses (current process) | 47 | SR3 used for userspace accesses (current process) |
48 | =============================== =============================================== | ||
40 | 49 | ||
41 | Space Registers (user mode) | 50 | Space Registers (user mode) |
51 | --------------------------- | ||
42 | 52 | ||
53 | =============================== =============================================== | ||
43 | SR0 temporary space register | 54 | SR0 temporary space register |
44 | SR1 temporary space register | 55 | SR1 temporary space register |
45 | SR2 holds space of linux gateway page | 56 | SR2 holds space of linux gateway page |
46 | SR3 holds user address space value while in kernel | 57 | SR3 holds user address space value while in kernel |
47 | SR4-SR7 Defines short address space for user/kernel | 58 | SR4-SR7 Defines short address space for user/kernel |
59 | =============================== =============================================== | ||
48 | 60 | ||
49 | 61 | ||
50 | Processor Status Word | 62 | Processor Status Word |
63 | --------------------- | ||
51 | 64 | ||
65 | =============================== =============================================== | ||
52 | W (64-bit addresses) 0 | 66 | W (64-bit addresses) 0 |
53 | E (Little-endian) 0 | 67 | E (Little-endian) 0 |
54 | S (Secure Interval Timer) 0 | 68 | S (Secure Interval Timer) 0 |
@@ -69,15 +83,19 @@ Q (collect interruption state) 1 (0 in code directly preceding an rfi) | |||
69 | P (Protection Identifiers) 1* | 83 | P (Protection Identifiers) 1* |
70 | D (Data address translation) 1, 0 while executing real-mode code | 84 | D (Data address translation) 1, 0 while executing real-mode code |
71 | I (external interrupt mask) used by cli()/sti() macros | 85 | I (external interrupt mask) used by cli()/sti() macros |
86 | =============================== =============================================== | ||
72 | 87 | ||
73 | "Invisible" Registers | 88 | "Invisible" Registers |
89 | --------------------- | ||
74 | 90 | ||
91 | =============================== =============================================== | ||
75 | PSW default W value 0 | 92 | PSW default W value 0 |
76 | PSW default E value 0 | 93 | PSW default E value 0 |
77 | Shadow Registers used by interruption handler code | 94 | Shadow Registers used by interruption handler code |
78 | TOC enable bit 1 | 95 | TOC enable bit 1 |
96 | =============================== =============================================== | ||
79 | 97 | ||
80 | ========================================================================= | 98 | ------------------------------------------------------------------------- |
81 | 99 | ||
82 | The PA-RISC architecture defines 7 registers as "shadow registers". | 100 | The PA-RISC architecture defines 7 registers as "shadow registers". |
83 | Those are used in RETURN FROM INTERRUPTION AND RESTORE instruction to reduce | 101 | Those are used in RETURN FROM INTERRUPTION AND RESTORE instruction to reduce |
@@ -85,7 +103,8 @@ the state save and restore time by eliminating the need for general register | |||
85 | (GR) saves and restores in interruption handlers. | 103 | (GR) saves and restores in interruption handlers. |
86 | Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25. | 104 | Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25. |
87 | 105 | ||
88 | ========================================================================= | 106 | ------------------------------------------------------------------------- |
107 | |||
89 | Register usage notes, originally from John Marvin, with some additional | 108 | Register usage notes, originally from John Marvin, with some additional |
90 | notes from Randolph Chung. | 109 | notes from Randolph Chung. |
91 | 110 | ||
@@ -96,10 +115,12 @@ course, you need to save them if you care about them, before calling | |||
96 | another procedure. Some of the above registers do have special meanings | 115 | another procedure. Some of the above registers do have special meanings |
97 | that you should be aware of: | 116 | that you should be aware of: |
98 | 117 | ||
99 | r1: The addil instruction is hardwired to place its result in r1, | 118 | r1: |
119 | The addil instruction is hardwired to place its result in r1, | ||
100 | so if you use that instruction be aware of that. | 120 | so if you use that instruction be aware of that. |
101 | 121 | ||
102 | r2: This is the return pointer. In general you don't want to | 122 | r2: |
123 | This is the return pointer. In general you don't want to | ||
103 | use this, since you need the pointer to get back to your | 124 | use this, since you need the pointer to get back to your |
104 | caller. However, it is grouped with this set of registers | 125 | caller. However, it is grouped with this set of registers |
105 | since the caller can't rely on the value being the same | 126 | since the caller can't rely on the value being the same |
@@ -107,23 +128,27 @@ that you should be aware of: | |||
107 | and return through that register after trashing r2, and | 128 | and return through that register after trashing r2, and |
108 | that should not cause a problem for the calling routine. | 129 | that should not cause a problem for the calling routine. |
109 | 130 | ||
110 | r19-r22: these are generally regarded as temporary registers. | 131 | r19-r22: |
132 | these are generally regarded as temporary registers. | ||
111 | Note that in 64 bit they are arg7-arg4. | 133 | Note that in 64 bit they are arg7-arg4. |
112 | 134 | ||
113 | r23-r26: these are arg3-arg0, i.e. you can use them if you | 135 | r23-r26: |
136 | these are arg3-arg0, i.e. you can use them if you | ||
114 | don't care about the values that were passed in anymore. | 137 | don't care about the values that were passed in anymore. |
115 | 138 | ||
116 | r28,r29: are ret0 and ret1. They are what you pass return values | 139 | r28,r29: |
140 | are ret0 and ret1. They are what you pass return values | ||
117 | in. r28 is the primary return. When returning small structures | 141 | in. r28 is the primary return. When returning small structures |
118 | r29 may also be used to pass data back to the caller. | 142 | r29 may also be used to pass data back to the caller. |
119 | 143 | ||
120 | r30: stack pointer | 144 | r30: |
145 | stack pointer | ||
121 | 146 | ||
122 | r31: the ble instruction puts the return pointer in here. | 147 | r31: |
148 | the ble instruction puts the return pointer in here. | ||
123 | 149 | ||
124 | 150 | ||
125 | r3-r18,r27,r30 need to be saved and restored. r3-r18 are just | 151 | r3-r18,r27,r30 need to be saved and restored. r3-r18 are just |
126 | general purpose registers. r27 is the data pointer, and is | 152 | general purpose registers. r27 is the data pointer, and is |
127 | used to make references to global variables easier. r30 is | 153 | used to make references to global variables easier. r30 is |
128 | the stack pointer. | 154 | the stack pointer. |
129 | |||
diff --git a/Documentation/process/email-clients.rst b/Documentation/process/email-clients.rst index 07faa5457bcb..5273d06c8ff6 100644 --- a/Documentation/process/email-clients.rst +++ b/Documentation/process/email-clients.rst | |||
@@ -40,7 +40,7 @@ Emailed patches should be in ASCII or UTF-8 encoding only. | |||
40 | If you configure your email client to send emails with UTF-8 encoding, | 40 | If you configure your email client to send emails with UTF-8 encoding, |
41 | you avoid some possible charset problems. | 41 | you avoid some possible charset problems. |
42 | 42 | ||
43 | Email clients should generate and maintain References: or In-Reply-To: | 43 | Email clients should generate and maintain "References:" or "In-Reply-To:" |
44 | headers so that mail threading is not broken. | 44 | headers so that mail threading is not broken. |
45 | 45 | ||
46 | Copy-and-paste (or cut-and-paste) usually does not work for patches | 46 | Copy-and-paste (or cut-and-paste) usually does not work for patches |
@@ -89,7 +89,7 @@ Claws Mail (GUI) | |||
89 | 89 | ||
90 | Works. Some people use this successfully for patches. | 90 | Works. Some people use this successfully for patches. |
91 | 91 | ||
92 | To insert a patch use :menuselection:`Message-->Insert` File (:kbd:`CTRL-I`) | 92 | To insert a patch use :menuselection:`Message-->Insert File` (:kbd:`CTRL-I`) |
93 | or an external editor. | 93 | or an external editor. |
94 | 94 | ||
95 | If the inserted patch has to be edited in the Claws composition window | 95 | If the inserted patch has to be edited in the Claws composition window |
@@ -132,8 +132,8 @@ wrapping. | |||
132 | At the bottom of your email, put the commonly-used patch delimiter before | 132 | At the bottom of your email, put the commonly-used patch delimiter before |
133 | inserting your patch: three hyphens (``---``). | 133 | inserting your patch: three hyphens (``---``). |
134 | 134 | ||
135 | Then from the :menuselection:`Message` menu item, select insert file and | 135 | Then from the :menuselection:`Message` menu item, select |
136 | choose your patch. | 136 | :menuselection:`insert file` and choose your patch. |
137 | As an added bonus you can customise the message creation toolbar menu | 137 | As an added bonus you can customise the message creation toolbar menu |
138 | and put the :menuselection:`insert file` icon there. | 138 | and put the :menuselection:`insert file` icon there. |
139 | 139 | ||
@@ -149,18 +149,16 @@ patches so do not GPG sign them. Signing patches that have been inserted | |||
149 | as inlined text will make them tricky to extract from their 7-bit encoding. | 149 | as inlined text will make them tricky to extract from their 7-bit encoding. |
150 | 150 | ||
151 | If you absolutely must send patches as attachments instead of inlining | 151 | If you absolutely must send patches as attachments instead of inlining |
152 | them as text, right click on the attachment and select properties, and | 152 | them as text, right click on the attachment and select :menuselection:`properties`, |
153 | highlight :menuselection:`Suggest automatic display` to make the attachment | 153 | and highlight :menuselection:`Suggest automatic display` to make the attachment |
154 | inlined to make it more viewable. | 154 | inlined to make it more viewable. |
155 | 155 | ||
156 | When saving patches that are sent as inlined text, select the email that | 156 | When saving patches that are sent as inlined text, select the email that |
157 | contains the patch from the message list pane, right click and select | 157 | contains the patch from the message list pane, right click and select |
158 | :menuselection:`save as`. You can use the whole email unmodified as a patch | 158 | :menuselection:`save as`. You can use the whole email unmodified as a patch |
159 | if it was properly composed. There is no option currently to save the email | 159 | if it was properly composed. Emails are saved as read-write for user only so |
160 | when you are actually viewing it in its own window -- there has been a request | 160 | you will have to chmod them to make them group and world readable if you copy |
161 | filed at kmail's bugzilla and hopefully this will be addressed. Emails are | 161 | them elsewhere. |
162 | saved as read-write for user only so you will have to chmod them to make them | ||
163 | group and world readable if you copy them elsewhere. | ||
164 | 162 | ||
165 | Lotus Notes (GUI) | 163 | Lotus Notes (GUI) |
166 | ***************** | 164 | ***************** |
diff --git a/Documentation/process/howto.rst b/Documentation/process/howto.rst index 6ab75c11d2c3..b6f5a379ad6c 100644 --- a/Documentation/process/howto.rst +++ b/Documentation/process/howto.rst | |||
@@ -123,7 +123,7 @@ required reading: | |||
123 | https://www.ozlabs.org/~akpm/stuff/tpp.txt | 123 | https://www.ozlabs.org/~akpm/stuff/tpp.txt |
124 | 124 | ||
125 | "Linux kernel patch submission format" | 125 | "Linux kernel patch submission format" |
126 | http://linux.yyz.us/patch-format.html | 126 | https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html |
127 | 127 | ||
128 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` | 128 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` |
129 | This file describes the rationale behind the conscious decision to | 129 | This file describes the rationale behind the conscious decision to |
diff --git a/Documentation/process/submitting-patches.rst b/Documentation/process/submitting-patches.rst index 9c4299293c72..fb56297f70dc 100644 --- a/Documentation/process/submitting-patches.rst +++ b/Documentation/process/submitting-patches.rst | |||
@@ -844,7 +844,7 @@ Andrew Morton, "The perfect patch" (tpp). | |||
844 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> | 844 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> |
845 | 845 | ||
846 | Jeff Garzik, "Linux kernel patch submission format". | 846 | Jeff Garzik, "Linux kernel patch submission format". |
847 | <http://linux.yyz.us/patch-format.html> | 847 | <https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html> |
848 | 848 | ||
849 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". | 849 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". |
850 | <http://www.kroah.com/log/linux/maintainer.html> | 850 | <http://www.kroah.com/log/linux/maintainer.html> |
diff --git a/Documentation/riscv/boot-image-header.txt b/Documentation/riscv/boot-image-header.rst index 14b1492f689b..7b4d1d747585 100644 --- a/Documentation/riscv/boot-image-header.txt +++ b/Documentation/riscv/boot-image-header.rst | |||
@@ -1,22 +1,25 @@ | |||
1 | Boot image header in RISC-V Linux | 1 | ================================= |
2 | ============================================= | 2 | Boot image header in RISC-V Linux |
3 | ================================= | ||
3 | 4 | ||
4 | Author: Atish Patra <atish.patra@wdc.com> | 5 | :Author: Atish Patra <atish.patra@wdc.com> |
5 | Date : 20 May 2019 | 6 | :Date: 20 May 2019 |
6 | 7 | ||
7 | This document only describes the boot image header details for RISC-V Linux. | 8 | This document only describes the boot image header details for RISC-V Linux. |
8 | The complete booting guide will be available at Documentation/riscv/booting.txt. | ||
9 | 9 | ||
10 | The following 64-byte header is present in decompressed Linux kernel image. | 10 | TODO: |
11 | Write a complete booting guide. | ||
12 | |||
13 | The following 64-byte header is present in decompressed Linux kernel image:: | ||
11 | 14 | ||
12 | u32 code0; /* Executable code */ | 15 | u32 code0; /* Executable code */ |
13 | u32 code1; /* Executable code */ | 16 | u32 code1; /* Executable code */ |
14 | u64 text_offset; /* Image load offset, little endian */ | 17 | u64 text_offset; /* Image load offset, little endian */ |
15 | u64 image_size; /* Effective Image size, little endian */ | 18 | u64 image_size; /* Effective Image size, little endian */ |
16 | u64 flags; /* kernel flags, little endian */ | 19 | u64 flags; /* kernel flags, little endian */ |
17 | u32 version; /* Version of this header */ | 20 | u32 version; /* Version of this header */ |
18 | u32 res1 = 0; /* Reserved */ | 21 | u32 res1 = 0; /* Reserved */ |
19 | u64 res2 = 0; /* Reserved */ | 22 | u64 res2 = 0; /* Reserved */ |
20 | u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */ | 23 | u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */ |
21 | u32 magic2 = 0x56534905; /* Magic number 2, little endian, "RSC\x05" */ | 24 | u32 magic2 = 0x56534905; /* Magic number 2, little endian, "RSC\x05" */ |
22 | u32 res4; /* Reserved for PE COFF offset */ | 25 | u32 res4; /* Reserved for PE COFF offset */ |
@@ -25,16 +28,21 @@ This header format is compliant with PE/COFF header and largely inspired from | |||
25 | ARM64 header. Thus, both ARM64 & RISC-V header can be combined into one common | 28 | ARM64 header. Thus, both ARM64 & RISC-V header can be combined into one common |
26 | header in future. | 29 | header in future. |
27 | 30 | ||
28 | Notes: | 31 | Notes |
32 | ===== | ||
33 | |||
29 | - This header can also be reused to support EFI stub for RISC-V in future. EFI | 34 | - This header can also be reused to support EFI stub for RISC-V in future. EFI |
30 | specification needs PE/COFF image header in the beginning of the kernel image | 35 | specification needs PE/COFF image header in the beginning of the kernel image |
31 | in order to load it as an EFI application. In order to support EFI stub, | 36 | in order to load it as an EFI application. In order to support EFI stub, |
32 | code0 should be replaced with "MZ" magic string and res5(at offset 0x3c) should | 37 | code0 should be replaced with "MZ" magic string and res5(at offset 0x3c) should |
33 | point to the rest of the PE/COFF header. | 38 | point to the rest of the PE/COFF header. |
34 | 39 | ||
35 | - version field indicate header version number. | 40 | - version field indicate header version number |
36 | Bits 0:15 - Minor version | 41 | |
37 | Bits 16:31 - Major version | 42 | ========== ============= |
43 | Bits 0:15 Minor version | ||
44 | Bits 16:31 Major version | ||
45 | ========== ============= | ||
38 | 46 | ||
39 | This preserves compatibility across newer and older version of the header. | 47 | This preserves compatibility across newer and older version of the header. |
40 | The current version is defined as 0.2. | 48 | The current version is defined as 0.2. |
@@ -45,7 +53,10 @@ Notes: | |||
45 | The "magic2" field replaces it, matching up with the ARM64 header. | 53 | The "magic2" field replaces it, matching up with the ARM64 header. |
46 | 54 | ||
47 | - In current header, the flags field has only one field. | 55 | - In current header, the flags field has only one field. |
48 | Bit 0: Kernel endianness. 1 if BE, 0 if LE. | 56 | |
57 | ===== ==================================== | ||
58 | Bit 0 Kernel endianness. 1 if BE, 0 if LE. | ||
59 | ===== ==================================== | ||
49 | 60 | ||
50 | - Image size is mandatory for boot loader to load kernel image. Booting will | 61 | - Image size is mandatory for boot loader to load kernel image. Booting will |
51 | fail otherwise. | 62 | fail otherwise. |
diff --git a/Documentation/riscv/index.rst b/Documentation/riscv/index.rst index e3ca0922a8c2..215fd3c1f2d5 100644 --- a/Documentation/riscv/index.rst +++ b/Documentation/riscv/index.rst | |||
@@ -5,6 +5,7 @@ RISC-V architecture | |||
5 | .. toctree:: | 5 | .. toctree:: |
6 | :maxdepth: 1 | 6 | :maxdepth: 1 |
7 | 7 | ||
8 | boot-image-header | ||
8 | pmu | 9 | pmu |
9 | 10 | ||
10 | .. only:: subproject and html | 11 | .. only:: subproject and html |
diff --git a/Documentation/security/tpm/index.rst b/Documentation/security/tpm/index.rst index 487852fda33e..fc40e9f23c85 100644 --- a/Documentation/security/tpm/index.rst +++ b/Documentation/security/tpm/index.rst | |||
@@ -4,6 +4,7 @@ Trusted Platform Module documentation | |||
4 | 4 | ||
5 | .. toctree:: | 5 | .. toctree:: |
6 | 6 | ||
7 | tpm_event_log | ||
7 | tpm_vtpm_proxy | 8 | tpm_vtpm_proxy |
8 | xen-tpmfront | 9 | xen-tpmfront |
9 | tpm_ftpm_tee | 10 | tpm_ftpm_tee |
diff --git a/Documentation/security/tpm/tpm_event_log.rst b/Documentation/security/tpm/tpm_event_log.rst new file mode 100644 index 000000000000..f00f7a1d5e92 --- /dev/null +++ b/Documentation/security/tpm/tpm_event_log.rst | |||
@@ -0,0 +1,55 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ============= | ||
4 | TPM Event Log | ||
5 | ============= | ||
6 | |||
7 | This document briefly describes what TPM log is and how it is handed | ||
8 | over from the preboot firmware to the operating system. | ||
9 | |||
10 | Introduction | ||
11 | ============ | ||
12 | |||
13 | The preboot firmware maintains an event log that gets new entries every | ||
14 | time something gets hashed by it to any of the PCR registers. The events | ||
15 | are segregated by their type and contain the value of the hashed PCR | ||
16 | register. Typically, the preboot firmware will hash the components to | ||
17 | who execution is to be handed over or actions relevant to the boot | ||
18 | process. | ||
19 | |||
20 | The main application for this is remote attestation and the reason why | ||
21 | it is useful is nicely put in the very first section of [1]: | ||
22 | |||
23 | "Attestation is used to provide information about the platform’s state | ||
24 | to a challenger. However, PCR contents are difficult to interpret; | ||
25 | therefore, attestation is typically more useful when the PCR contents | ||
26 | are accompanied by a measurement log. While not trusted on their own, | ||
27 | the measurement log contains a richer set of information than do the PCR | ||
28 | contents. The PCR contents are used to provide the validation of the | ||
29 | measurement log." | ||
30 | |||
31 | UEFI event log | ||
32 | ============== | ||
33 | |||
34 | UEFI provided event log has a few somewhat weird quirks. | ||
35 | |||
36 | Before calling ExitBootServices() Linux EFI stub copies the event log to | ||
37 | a custom configuration table defined by the stub itself. Unfortunately, | ||
38 | the events generated by ExitBootServices() don't end up in the table. | ||
39 | |||
40 | The firmware provides so called final events configuration table to sort | ||
41 | out this issue. Events gets mirrored to this table after the first time | ||
42 | EFI_TCG2_PROTOCOL.GetEventLog() gets called. | ||
43 | |||
44 | This introduces another problem: nothing guarantees that it is not called | ||
45 | before the Linux EFI stub gets to run. Thus, it needs to calculate and save the | ||
46 | final events table size while the stub is still running to the custom | ||
47 | configuration table so that the TPM driver can later on skip these events when | ||
48 | concatenating two halves of the event log from the custom configuration table | ||
49 | and the final events table. | ||
50 | |||
51 | References | ||
52 | ========== | ||
53 | |||
54 | - [1] https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/ | ||
55 | - [2] The final concatenation is done in drivers/char/tpm/eventlog/efi.c | ||
diff --git a/Documentation/sound/index.rst b/Documentation/sound/index.rst index 47b89f014e69..4d7d42acf6df 100644 --- a/Documentation/sound/index.rst +++ b/Documentation/sound/index.rst | |||
@@ -12,7 +12,7 @@ Linux Sound Subsystem Documentation | |||
12 | hd-audio/index | 12 | hd-audio/index |
13 | cards/index | 13 | cards/index |
14 | 14 | ||
15 | .. only:: subproject | 15 | .. only:: subproject and html |
16 | 16 | ||
17 | Indices | 17 | Indices |
18 | ======= | 18 | ======= |
diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py index 77e89c1956d7..5b6119ff69f4 100644 --- a/Documentation/sphinx/automarkup.py +++ b/Documentation/sphinx/automarkup.py | |||
@@ -25,8 +25,9 @@ RE_function = re.compile(r'([\w_][\w\d_]+\(\))') | |||
25 | # to the creation of incorrect and confusing cross references. So | 25 | # to the creation of incorrect and confusing cross references. So |
26 | # just don't even try with these names. | 26 | # just don't even try with these names. |
27 | # | 27 | # |
28 | Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap' | 28 | Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap', |
29 | 'select', 'poll', 'fork', 'execve', 'clone', 'ioctl'] | 29 | 'select', 'poll', 'fork', 'execve', 'clone', 'ioctl', |
30 | 'socket' ] | ||
30 | 31 | ||
31 | # | 32 | # |
32 | # Find all occurrences of function() and try to replace them with | 33 | # Find all occurrences of function() and try to replace them with |
diff --git a/Documentation/spi/butterfly b/Documentation/spi/butterfly.rst index 9927af7a629c..e614a589547c 100644 --- a/Documentation/spi/butterfly +++ b/Documentation/spi/butterfly.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | =================================================== | ||
1 | spi_butterfly - parport-to-butterfly adapter driver | 2 | spi_butterfly - parport-to-butterfly adapter driver |
2 | =================================================== | 3 | =================================================== |
3 | 4 | ||
@@ -27,25 +28,29 @@ need to reflash the firmware, and the pins are the standard Atmel "ISP" | |||
27 | connector pins (used also on non-Butterfly AVR boards). On the parport | 28 | connector pins (used also on non-Butterfly AVR boards). On the parport |
28 | side this is like "sp12" programming cables. | 29 | side this is like "sp12" programming cables. |
29 | 30 | ||
31 | ====== ============= =================== | ||
30 | Signal Butterfly Parport (DB-25) | 32 | Signal Butterfly Parport (DB-25) |
31 | ------ --------- --------------- | 33 | ====== ============= =================== |
32 | SCK = J403.PB1/SCK = pin 2/D0 | 34 | SCK J403.PB1/SCK pin 2/D0 |
33 | RESET = J403.nRST = pin 3/D1 | 35 | RESET J403.nRST pin 3/D1 |
34 | VCC = J403.VCC_EXT = pin 8/D6 | 36 | VCC J403.VCC_EXT pin 8/D6 |
35 | MOSI = J403.PB2/MOSI = pin 9/D7 | 37 | MOSI J403.PB2/MOSI pin 9/D7 |
36 | MISO = J403.PB3/MISO = pin 11/S7,nBUSY | 38 | MISO J403.PB3/MISO pin 11/S7,nBUSY |
37 | GND = J403.GND = pin 23/GND | 39 | GND J403.GND pin 23/GND |
40 | ====== ============= =================== | ||
38 | 41 | ||
39 | Then to let Linux master that bus to talk to the DataFlash chip, you must | 42 | Then to let Linux master that bus to talk to the DataFlash chip, you must |
40 | (a) flash new firmware that disables SPI (set PRR.2, and disable pullups | 43 | (a) flash new firmware that disables SPI (set PRR.2, and disable pullups |
41 | by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and | 44 | by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and |
42 | (c) cable in the chipselect. | 45 | (c) cable in the chipselect. |
43 | 46 | ||
47 | ====== ============ =================== | ||
44 | Signal Butterfly Parport (DB-25) | 48 | Signal Butterfly Parport (DB-25) |
45 | ------ --------- --------------- | 49 | ====== ============ =================== |
46 | VCC = J400.VCC_EXT = pin 7/D5 | 50 | VCC J400.VCC_EXT pin 7/D5 |
47 | SELECT = J400.PB0/nSS = pin 17/C3,nSELECT | 51 | SELECT J400.PB0/nSS pin 17/C3,nSELECT |
48 | GND = J400.GND = pin 24/GND | 52 | GND J400.GND pin 24/GND |
53 | ====== ============ =================== | ||
49 | 54 | ||
50 | Or you could flash firmware making the AVR into an SPI slave (keeping the | 55 | Or you could flash firmware making the AVR into an SPI slave (keeping the |
51 | DataFlash in reset) and tweak the spi_butterfly driver to make it bind to | 56 | DataFlash in reset) and tweak the spi_butterfly driver to make it bind to |
@@ -56,13 +61,14 @@ That would let you talk to the AVR using custom SPI-with-USI firmware, | |||
56 | while letting either Linux or the AVR use the DataFlash. There are plenty | 61 | while letting either Linux or the AVR use the DataFlash. There are plenty |
57 | of spare parport pins to wire this one up, such as: | 62 | of spare parport pins to wire this one up, such as: |
58 | 63 | ||
64 | ====== ============= =================== | ||
59 | Signal Butterfly Parport (DB-25) | 65 | Signal Butterfly Parport (DB-25) |
60 | ------ --------- --------------- | 66 | ====== ============= =================== |
61 | SCK = J403.PE4/USCK = pin 5/D3 | 67 | SCK J403.PE4/USCK pin 5/D3 |
62 | MOSI = J403.PE5/DI = pin 6/D4 | 68 | MOSI J403.PE5/DI pin 6/D4 |
63 | MISO = J403.PE6/DO = pin 12/S5,nPAPEROUT | 69 | MISO J403.PE6/DO pin 12/S5,nPAPEROUT |
64 | GND = J403.GND = pin 22/GND | 70 | GND J403.GND pin 22/GND |
65 | |||
66 | IRQ = J402.PF4 = pin 10/S6,ACK | ||
67 | GND = J402.GND(P2) = pin 25/GND | ||
68 | 71 | ||
72 | IRQ J402.PF4 pin 10/S6,ACK | ||
73 | GND J402.GND(P2) pin 25/GND | ||
74 | ====== ============= =================== | ||
diff --git a/Documentation/spi/index.rst b/Documentation/spi/index.rst new file mode 100644 index 000000000000..06c34ea11bcf --- /dev/null +++ b/Documentation/spi/index.rst | |||
@@ -0,0 +1,22 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ================================= | ||
4 | Serial Peripheral Interface (SPI) | ||
5 | ================================= | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | spi-summary | ||
11 | spidev | ||
12 | butterfly | ||
13 | pxa2xx | ||
14 | spi-lm70llp | ||
15 | spi-sc18is602 | ||
16 | |||
17 | .. only:: subproject and html | ||
18 | |||
19 | Indices | ||
20 | ======= | ||
21 | |||
22 | * :ref:`genindex` | ||
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx.rst index 551325b66b23..882d3cc72cc2 100644 --- a/Documentation/spi/pxa2xx +++ b/Documentation/spi/pxa2xx.rst | |||
@@ -1,8 +1,10 @@ | |||
1 | ============================== | ||
1 | PXA2xx SPI on SSP driver HOWTO | 2 | PXA2xx SPI on SSP driver HOWTO |
2 | =================================================== | 3 | ============================== |
4 | |||
3 | This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx | 5 | This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx |
4 | synchronous serial port into a SPI master controller | 6 | synchronous serial port into a SPI master controller |
5 | (see Documentation/spi/spi-summary). The driver has the following features | 7 | (see Documentation/spi/spi-summary.rst). The driver has the following features |
6 | 8 | ||
7 | - Support for any PXA2xx SSP | 9 | - Support for any PXA2xx SSP |
8 | - SSP PIO and SSP DMA data transfers. | 10 | - SSP PIO and SSP DMA data transfers. |
@@ -19,12 +21,12 @@ Declaring PXA2xx Master Controllers | |||
19 | ----------------------------------- | 21 | ----------------------------------- |
20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a | 22 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a |
21 | "platform device". The master configuration is passed to the driver via a table | 23 | "platform device". The master configuration is passed to the driver via a table |
22 | found in include/linux/spi/pxa2xx_spi.h: | 24 | found in include/linux/spi/pxa2xx_spi.h:: |
23 | 25 | ||
24 | struct pxa2xx_spi_controller { | 26 | struct pxa2xx_spi_controller { |
25 | u16 num_chipselect; | 27 | u16 num_chipselect; |
26 | u8 enable_dma; | 28 | u8 enable_dma; |
27 | }; | 29 | }; |
28 | 30 | ||
29 | The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of | 31 | The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of |
30 | slave device (chips) attached to this SPI master. | 32 | slave device (chips) attached to this SPI master. |
@@ -36,9 +38,9 @@ See the "PXA2xx Developer Manual" section "DMA Controller". | |||
36 | 38 | ||
37 | NSSP MASTER SAMPLE | 39 | NSSP MASTER SAMPLE |
38 | ------------------ | 40 | ------------------ |
39 | Below is a sample configuration using the PXA255 NSSP. | 41 | Below is a sample configuration using the PXA255 NSSP:: |
40 | 42 | ||
41 | static struct resource pxa_spi_nssp_resources[] = { | 43 | static struct resource pxa_spi_nssp_resources[] = { |
42 | [0] = { | 44 | [0] = { |
43 | .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */ | 45 | .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */ |
44 | .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */ | 46 | .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */ |
@@ -49,14 +51,14 @@ static struct resource pxa_spi_nssp_resources[] = { | |||
49 | .end = IRQ_NSSP, | 51 | .end = IRQ_NSSP, |
50 | .flags = IORESOURCE_IRQ, | 52 | .flags = IORESOURCE_IRQ, |
51 | }, | 53 | }, |
52 | }; | 54 | }; |
53 | 55 | ||
54 | static struct pxa2xx_spi_controller pxa_nssp_master_info = { | 56 | static struct pxa2xx_spi_controller pxa_nssp_master_info = { |
55 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ | 57 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ |
56 | .enable_dma = 1, /* Enables NSSP DMA */ | 58 | .enable_dma = 1, /* Enables NSSP DMA */ |
57 | }; | 59 | }; |
58 | 60 | ||
59 | static struct platform_device pxa_spi_nssp = { | 61 | static struct platform_device pxa_spi_nssp = { |
60 | .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */ | 62 | .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */ |
61 | .id = 2, /* Bus number, MUST MATCH SSP number 1..n */ | 63 | .id = 2, /* Bus number, MUST MATCH SSP number 1..n */ |
62 | .resource = pxa_spi_nssp_resources, | 64 | .resource = pxa_spi_nssp_resources, |
@@ -64,22 +66,22 @@ static struct platform_device pxa_spi_nssp = { | |||
64 | .dev = { | 66 | .dev = { |
65 | .platform_data = &pxa_nssp_master_info, /* Passed to driver */ | 67 | .platform_data = &pxa_nssp_master_info, /* Passed to driver */ |
66 | }, | 68 | }, |
67 | }; | 69 | }; |
68 | 70 | ||
69 | static struct platform_device *devices[] __initdata = { | 71 | static struct platform_device *devices[] __initdata = { |
70 | &pxa_spi_nssp, | 72 | &pxa_spi_nssp, |
71 | }; | 73 | }; |
72 | 74 | ||
73 | static void __init board_init(void) | 75 | static void __init board_init(void) |
74 | { | 76 | { |
75 | (void)platform_add_device(devices, ARRAY_SIZE(devices)); | 77 | (void)platform_add_device(devices, ARRAY_SIZE(devices)); |
76 | } | 78 | } |
77 | 79 | ||
78 | Declaring Slave Devices | 80 | Declaring Slave Devices |
79 | ----------------------- | 81 | ----------------------- |
80 | Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c | 82 | Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c |
81 | using the "spi_board_info" structure found in "linux/spi/spi.h". See | 83 | using the "spi_board_info" structure found in "linux/spi/spi.h". See |
82 | "Documentation/spi/spi-summary" for additional information. | 84 | "Documentation/spi/spi-summary.rst" for additional information. |
83 | 85 | ||
84 | Each slave device attached to the PXA must provide slave specific configuration | 86 | Each slave device attached to the PXA must provide slave specific configuration |
85 | information via the structure "pxa2xx_spi_chip" found in | 87 | information via the structure "pxa2xx_spi_chip" found in |
@@ -87,19 +89,21 @@ information via the structure "pxa2xx_spi_chip" found in | |||
87 | will uses the configuration whenever the driver communicates with the slave | 89 | will uses the configuration whenever the driver communicates with the slave |
88 | device. All fields are optional. | 90 | device. All fields are optional. |
89 | 91 | ||
90 | struct pxa2xx_spi_chip { | 92 | :: |
93 | |||
94 | struct pxa2xx_spi_chip { | ||
91 | u8 tx_threshold; | 95 | u8 tx_threshold; |
92 | u8 rx_threshold; | 96 | u8 rx_threshold; |
93 | u8 dma_burst_size; | 97 | u8 dma_burst_size; |
94 | u32 timeout; | 98 | u32 timeout; |
95 | u8 enable_loopback; | 99 | u8 enable_loopback; |
96 | void (*cs_control)(u32 command); | 100 | void (*cs_control)(u32 command); |
97 | }; | 101 | }; |
98 | 102 | ||
99 | The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are | 103 | The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are |
100 | used to configure the SSP hardware fifo. These fields are critical to the | 104 | used to configure the SSP hardware fifo. These fields are critical to the |
101 | performance of pxa2xx_spi driver and misconfiguration will result in rx | 105 | performance of pxa2xx_spi driver and misconfiguration will result in rx |
102 | fifo overruns (especially in PIO mode transfers). Good default values are | 106 | fifo overruns (especially in PIO mode transfers). Good default values are:: |
103 | 107 | ||
104 | .tx_threshold = 8, | 108 | .tx_threshold = 8, |
105 | .rx_threshold = 8, | 109 | .rx_threshold = 8, |
@@ -141,41 +145,43 @@ The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the | |||
141 | "spi_board_info.controller_data" field. Below is a sample configuration using | 145 | "spi_board_info.controller_data" field. Below is a sample configuration using |
142 | the PXA255 NSSP. | 146 | the PXA255 NSSP. |
143 | 147 | ||
144 | /* Chip Select control for the CS8415A SPI slave device */ | 148 | :: |
145 | static void cs8415a_cs_control(u32 command) | 149 | |
146 | { | 150 | /* Chip Select control for the CS8415A SPI slave device */ |
151 | static void cs8415a_cs_control(u32 command) | ||
152 | { | ||
147 | if (command & PXA2XX_CS_ASSERT) | 153 | if (command & PXA2XX_CS_ASSERT) |
148 | GPCR(2) = GPIO_bit(2); | 154 | GPCR(2) = GPIO_bit(2); |
149 | else | 155 | else |
150 | GPSR(2) = GPIO_bit(2); | 156 | GPSR(2) = GPIO_bit(2); |
151 | } | 157 | } |
152 | 158 | ||
153 | /* Chip Select control for the CS8405A SPI slave device */ | 159 | /* Chip Select control for the CS8405A SPI slave device */ |
154 | static void cs8405a_cs_control(u32 command) | 160 | static void cs8405a_cs_control(u32 command) |
155 | { | 161 | { |
156 | if (command & PXA2XX_CS_ASSERT) | 162 | if (command & PXA2XX_CS_ASSERT) |
157 | GPCR(3) = GPIO_bit(3); | 163 | GPCR(3) = GPIO_bit(3); |
158 | else | 164 | else |
159 | GPSR(3) = GPIO_bit(3); | 165 | GPSR(3) = GPIO_bit(3); |
160 | } | 166 | } |
161 | 167 | ||
162 | static struct pxa2xx_spi_chip cs8415a_chip_info = { | 168 | static struct pxa2xx_spi_chip cs8415a_chip_info = { |
163 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ | 169 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ |
164 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ | 170 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ |
165 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | 171 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ |
166 | .timeout = 235, /* See Intel documentation */ | 172 | .timeout = 235, /* See Intel documentation */ |
167 | .cs_control = cs8415a_cs_control, /* Use external chip select */ | 173 | .cs_control = cs8415a_cs_control, /* Use external chip select */ |
168 | }; | 174 | }; |
169 | 175 | ||
170 | static struct pxa2xx_spi_chip cs8405a_chip_info = { | 176 | static struct pxa2xx_spi_chip cs8405a_chip_info = { |
171 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ | 177 | .tx_threshold = 8, /* SSP hardward FIFO threshold */ |
172 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ | 178 | .rx_threshold = 8, /* SSP hardward FIFO threshold */ |
173 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | 179 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ |
174 | .timeout = 235, /* See Intel documentation */ | 180 | .timeout = 235, /* See Intel documentation */ |
175 | .cs_control = cs8405a_cs_control, /* Use external chip select */ | 181 | .cs_control = cs8405a_cs_control, /* Use external chip select */ |
176 | }; | 182 | }; |
177 | 183 | ||
178 | static struct spi_board_info streetracer_spi_board_info[] __initdata = { | 184 | static struct spi_board_info streetracer_spi_board_info[] __initdata = { |
179 | { | 185 | { |
180 | .modalias = "cs8415a", /* Name of spi_driver for this device */ | 186 | .modalias = "cs8415a", /* Name of spi_driver for this device */ |
181 | .max_speed_hz = 3686400, /* Run SSP as fast a possbile */ | 187 | .max_speed_hz = 3686400, /* Run SSP as fast a possbile */ |
@@ -193,13 +199,13 @@ static struct spi_board_info streetracer_spi_board_info[] __initdata = { | |||
193 | .controller_data = &cs8405a_chip_info, /* Master chip config */ | 199 | .controller_data = &cs8405a_chip_info, /* Master chip config */ |
194 | .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */ | 200 | .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */ |
195 | }, | 201 | }, |
196 | }; | 202 | }; |
197 | 203 | ||
198 | static void __init streetracer_init(void) | 204 | static void __init streetracer_init(void) |
199 | { | 205 | { |
200 | spi_register_board_info(streetracer_spi_board_info, | 206 | spi_register_board_info(streetracer_spi_board_info, |
201 | ARRAY_SIZE(streetracer_spi_board_info)); | 207 | ARRAY_SIZE(streetracer_spi_board_info)); |
202 | } | 208 | } |
203 | 209 | ||
204 | 210 | ||
205 | DMA and PIO I/O Support | 211 | DMA and PIO I/O Support |
@@ -210,26 +216,25 @@ by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure. The | |||
210 | mode supports both coherent and stream based DMA mappings. | 216 | mode supports both coherent and stream based DMA mappings. |
211 | 217 | ||
212 | The following logic is used to determine the type of I/O to be used on | 218 | The following logic is used to determine the type of I/O to be used on |
213 | a per "spi_transfer" basis: | 219 | a per "spi_transfer" basis:: |
214 | 220 | ||
215 | if !enable_dma then | 221 | if !enable_dma then |
216 | always use PIO transfers | 222 | always use PIO transfers |
217 | 223 | ||
218 | if spi_message.len > 8191 then | 224 | if spi_message.len > 8191 then |
219 | print "rate limited" warning | 225 | print "rate limited" warning |
220 | use PIO transfers | 226 | use PIO transfers |
221 | 227 | ||
222 | if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then | 228 | if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then |
223 | use coherent DMA mode | 229 | use coherent DMA mode |
224 | 230 | ||
225 | if rx_buf and tx_buf are aligned on 8 byte boundary then | 231 | if rx_buf and tx_buf are aligned on 8 byte boundary then |
226 | use streaming DMA mode | 232 | use streaming DMA mode |
227 | 233 | ||
228 | otherwise | 234 | otherwise |
229 | use PIO transfer | 235 | use PIO transfer |
230 | 236 | ||
231 | THANKS TO | 237 | THANKS TO |
232 | --------- | 238 | --------- |
233 | 239 | ||
234 | David Brownell and others for mentoring the development of this driver. | 240 | David Brownell and others for mentoring the development of this driver. |
235 | |||
diff --git a/Documentation/spi/spi-lm70llp b/Documentation/spi/spi-lm70llp.rst index 463f6d01fa15..07631aef4343 100644 --- a/Documentation/spi/spi-lm70llp +++ b/Documentation/spi/spi-lm70llp.rst | |||
@@ -1,8 +1,11 @@ | |||
1 | ============================================== | ||
1 | spi_lm70llp : LM70-LLP parport-to-SPI adapter | 2 | spi_lm70llp : LM70-LLP parport-to-SPI adapter |
2 | ============================================== | 3 | ============================================== |
3 | 4 | ||
4 | Supported board/chip: | 5 | Supported board/chip: |
6 | |||
5 | * National Semiconductor LM70 LLP evaluation board | 7 | * National Semiconductor LM70 LLP evaluation board |
8 | |||
6 | Datasheet: http://www.national.com/pf/LM/LM70.html | 9 | Datasheet: http://www.national.com/pf/LM/LM70.html |
7 | 10 | ||
8 | Author: | 11 | Author: |
@@ -29,9 +32,10 @@ available (on page 4) here: | |||
29 | 32 | ||
30 | The hardware interfacing on the LM70 LLP eval board is as follows: | 33 | The hardware interfacing on the LM70 LLP eval board is as follows: |
31 | 34 | ||
35 | ======== == ========= ========== | ||
32 | Parallel LM70 LLP | 36 | Parallel LM70 LLP |
33 | Port Direction JP2 Header | 37 | Port . Direction JP2 Header |
34 | ----------- --------- ---------------- | 38 | ======== == ========= ========== |
35 | D0 2 - - | 39 | D0 2 - - |
36 | D1 3 --> V+ 5 | 40 | D1 3 --> V+ 5 |
37 | D2 4 --> V+ 5 | 41 | D2 4 --> V+ 5 |
@@ -42,7 +46,7 @@ The hardware interfacing on the LM70 LLP eval board is as follows: | |||
42 | D7 9 --> SI/O 5 | 46 | D7 9 --> SI/O 5 |
43 | GND 25 - GND 7 | 47 | GND 25 - GND 7 |
44 | Select 13 <-- SI/O 1 | 48 | Select 13 <-- SI/O 1 |
45 | ----------- --------- ---------------- | 49 | ======== == ========= ========== |
46 | 50 | ||
47 | Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin | 51 | Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin |
48 | is connected to both pin D7 (as Master Out) and Select (as Master In) | 52 | is connected to both pin D7 (as Master Out) and Select (as Master In) |
@@ -74,6 +78,7 @@ inverting the value read at pin 13. | |||
74 | 78 | ||
75 | Thanks to | 79 | Thanks to |
76 | --------- | 80 | --------- |
77 | o David Brownell for mentoring the SPI-side driver development. | 81 | |
78 | o Dr.Craig Hollabaugh for the (early) "manual" bitbanging driver version. | 82 | - David Brownell for mentoring the SPI-side driver development. |
79 | o Nadir Billimoria for help interpreting the circuit schematic. | 83 | - Dr.Craig Hollabaugh for the (early) "manual" bitbanging driver version. |
84 | - Nadir Billimoria for help interpreting the circuit schematic. | ||
diff --git a/Documentation/spi/spi-sc18is602 b/Documentation/spi/spi-sc18is602.rst index a45702865a38..2a31dc722321 100644 --- a/Documentation/spi/spi-sc18is602 +++ b/Documentation/spi/spi-sc18is602.rst | |||
@@ -1,8 +1,11 @@ | |||
1 | =========================== | ||
1 | Kernel driver spi-sc18is602 | 2 | Kernel driver spi-sc18is602 |
2 | =========================== | 3 | =========================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * NXP SI18IS602/602B/603 | 7 | * NXP SI18IS602/602B/603 |
8 | |||
6 | Datasheet: http://www.nxp.com/documents/data_sheet/SC18IS602_602B_603.pdf | 9 | Datasheet: http://www.nxp.com/documents/data_sheet/SC18IS602_602B_603.pdf |
7 | 10 | ||
8 | Author: | 11 | Author: |
@@ -17,7 +20,7 @@ kernel's SPI core subsystem. | |||
17 | 20 | ||
18 | The driver does not probe for supported chips, since the SI18IS602/603 does not | 21 | The driver does not probe for supported chips, since the SI18IS602/603 does not |
19 | support Chip ID registers. You will have to instantiate the devices explicitly. | 22 | support Chip ID registers. You will have to instantiate the devices explicitly. |
20 | Please see Documentation/i2c/instantiating-devices for details. | 23 | Please see Documentation/i2c/instantiating-devices.rst for details. |
21 | 24 | ||
22 | 25 | ||
23 | Usage Notes | 26 | Usage Notes |
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary.rst index 1a63194b74d7..f1daffe10d78 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ==================================== | ||
1 | Overview of Linux kernel SPI support | 2 | Overview of Linux kernel SPI support |
2 | ==================================== | 3 | ==================================== |
3 | 4 | ||
@@ -139,12 +140,14 @@ a command and then reading its response. | |||
139 | 140 | ||
140 | There are two types of SPI driver, here called: | 141 | There are two types of SPI driver, here called: |
141 | 142 | ||
142 | Controller drivers ... controllers may be built into System-On-Chip | 143 | Controller drivers ... |
144 | controllers may be built into System-On-Chip | ||
143 | processors, and often support both Master and Slave roles. | 145 | processors, and often support both Master and Slave roles. |
144 | These drivers touch hardware registers and may use DMA. | 146 | These drivers touch hardware registers and may use DMA. |
145 | Or they can be PIO bitbangers, needing just GPIO pins. | 147 | Or they can be PIO bitbangers, needing just GPIO pins. |
146 | 148 | ||
147 | Protocol drivers ... these pass messages through the controller | 149 | Protocol drivers ... |
150 | these pass messages through the controller | ||
148 | driver to communicate with a Slave or Master device on the | 151 | driver to communicate with a Slave or Master device on the |
149 | other side of an SPI link. | 152 | other side of an SPI link. |
150 | 153 | ||
@@ -160,7 +163,7 @@ those two types of drivers. | |||
160 | There is a minimal core of SPI programming interfaces, focussing on | 163 | There is a minimal core of SPI programming interfaces, focussing on |
161 | using the driver model to connect controller and protocol drivers using | 164 | using the driver model to connect controller and protocol drivers using |
162 | device tables provided by board specific initialization code. SPI | 165 | device tables provided by board specific initialization code. SPI |
163 | shows up in sysfs in several locations: | 166 | shows up in sysfs in several locations:: |
164 | 167 | ||
165 | /sys/devices/.../CTLR ... physical node for a given SPI controller | 168 | /sys/devices/.../CTLR ... physical node for a given SPI controller |
166 | 169 | ||
@@ -168,7 +171,7 @@ shows up in sysfs in several locations: | |||
168 | chipselect C, accessed through CTLR. | 171 | chipselect C, accessed through CTLR. |
169 | 172 | ||
170 | /sys/bus/spi/devices/spiB.C ... symlink to that physical | 173 | /sys/bus/spi/devices/spiB.C ... symlink to that physical |
171 | .../CTLR/spiB.C device | 174 | .../CTLR/spiB.C device |
172 | 175 | ||
173 | /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver | 176 | /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver |
174 | that should be used with this device (for hotplug/coldplug) | 177 | that should be used with this device (for hotplug/coldplug) |
@@ -206,7 +209,8 @@ Linux needs several kinds of information to properly configure SPI devices. | |||
206 | That information is normally provided by board-specific code, even for | 209 | That information is normally provided by board-specific code, even for |
207 | chips that do support some of automated discovery/enumeration. | 210 | chips that do support some of automated discovery/enumeration. |
208 | 211 | ||
209 | DECLARE CONTROLLERS | 212 | Declare Controllers |
213 | ^^^^^^^^^^^^^^^^^^^ | ||
210 | 214 | ||
211 | The first kind of information is a list of what SPI controllers exist. | 215 | The first kind of information is a list of what SPI controllers exist. |
212 | For System-on-Chip (SOC) based boards, these will usually be platform | 216 | For System-on-Chip (SOC) based boards, these will usually be platform |
@@ -221,7 +225,7 @@ same basic controller setup code. This is because most SOCs have several | |||
221 | SPI-capable controllers, and only the ones actually usable on a given | 225 | SPI-capable controllers, and only the ones actually usable on a given |
222 | board should normally be set up and registered. | 226 | board should normally be set up and registered. |
223 | 227 | ||
224 | So for example arch/.../mach-*/board-*.c files might have code like: | 228 | So for example arch/.../mach-*/board-*.c files might have code like:: |
225 | 229 | ||
226 | #include <mach/spi.h> /* for mysoc_spi_data */ | 230 | #include <mach/spi.h> /* for mysoc_spi_data */ |
227 | 231 | ||
@@ -238,7 +242,7 @@ So for example arch/.../mach-*/board-*.c files might have code like: | |||
238 | ... | 242 | ... |
239 | } | 243 | } |
240 | 244 | ||
241 | And SOC-specific utility code might look something like: | 245 | And SOC-specific utility code might look something like:: |
242 | 246 | ||
243 | #include <mach/spi.h> | 247 | #include <mach/spi.h> |
244 | 248 | ||
@@ -269,8 +273,8 @@ same SOC controller is used. For example, on one board SPI might use | |||
269 | an external clock, where another derives the SPI clock from current | 273 | an external clock, where another derives the SPI clock from current |
270 | settings of some master clock. | 274 | settings of some master clock. |
271 | 275 | ||
272 | 276 | Declare Slave Devices | |
273 | DECLARE SLAVE DEVICES | 277 | ^^^^^^^^^^^^^^^^^^^^^ |
274 | 278 | ||
275 | The second kind of information is a list of what SPI slave devices exist | 279 | The second kind of information is a list of what SPI slave devices exist |
276 | on the target board, often with some board-specific data needed for the | 280 | on the target board, often with some board-specific data needed for the |
@@ -278,7 +282,7 @@ driver to work correctly. | |||
278 | 282 | ||
279 | Normally your arch/.../mach-*/board-*.c files would provide a small table | 283 | Normally your arch/.../mach-*/board-*.c files would provide a small table |
280 | listing the SPI devices on each board. (This would typically be only a | 284 | listing the SPI devices on each board. (This would typically be only a |
281 | small handful.) That might look like: | 285 | small handful.) That might look like:: |
282 | 286 | ||
283 | static struct ads7846_platform_data ads_info = { | 287 | static struct ads7846_platform_data ads_info = { |
284 | .vref_delay_usecs = 100, | 288 | .vref_delay_usecs = 100, |
@@ -316,7 +320,7 @@ not possible until the infrastructure knows how to deselect it. | |||
316 | 320 | ||
317 | Then your board initialization code would register that table with the SPI | 321 | Then your board initialization code would register that table with the SPI |
318 | infrastructure, so that it's available later when the SPI master controller | 322 | infrastructure, so that it's available later when the SPI master controller |
319 | driver is registered: | 323 | driver is registered:: |
320 | 324 | ||
321 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); | 325 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
322 | 326 | ||
@@ -324,12 +328,13 @@ Like with other static board-specific setup, you won't unregister those. | |||
324 | 328 | ||
325 | The widely used "card" style computers bundle memory, cpu, and little else | 329 | The widely used "card" style computers bundle memory, cpu, and little else |
326 | onto a card that's maybe just thirty square centimeters. On such systems, | 330 | onto a card that's maybe just thirty square centimeters. On such systems, |
327 | your arch/.../mach-.../board-*.c file would primarily provide information | 331 | your ``arch/.../mach-.../board-*.c`` file would primarily provide information |
328 | about the devices on the mainboard into which such a card is plugged. That | 332 | about the devices on the mainboard into which such a card is plugged. That |
329 | certainly includes SPI devices hooked up through the card connectors! | 333 | certainly includes SPI devices hooked up through the card connectors! |
330 | 334 | ||
331 | 335 | ||
332 | NON-STATIC CONFIGURATIONS | 336 | Non-static Configurations |
337 | ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
333 | 338 | ||
334 | Developer boards often play by different rules than product boards, and one | 339 | Developer boards often play by different rules than product boards, and one |
335 | example is the potential need to hotplug SPI devices and/or controllers. | 340 | example is the potential need to hotplug SPI devices and/or controllers. |
@@ -349,7 +354,7 @@ How do I write an "SPI Protocol Driver"? | |||
349 | Most SPI drivers are currently kernel drivers, but there's also support | 354 | Most SPI drivers are currently kernel drivers, but there's also support |
350 | for userspace drivers. Here we talk only about kernel drivers. | 355 | for userspace drivers. Here we talk only about kernel drivers. |
351 | 356 | ||
352 | SPI protocol drivers somewhat resemble platform device drivers: | 357 | SPI protocol drivers somewhat resemble platform device drivers:: |
353 | 358 | ||
354 | static struct spi_driver CHIP_driver = { | 359 | static struct spi_driver CHIP_driver = { |
355 | .driver = { | 360 | .driver = { |
@@ -367,6 +372,8 @@ device whose board_info gave a modalias of "CHIP". Your probe() code | |||
367 | might look like this unless you're creating a device which is managing | 372 | might look like this unless you're creating a device which is managing |
368 | a bus (appearing under /sys/class/spi_master). | 373 | a bus (appearing under /sys/class/spi_master). |
369 | 374 | ||
375 | :: | ||
376 | |||
370 | static int CHIP_probe(struct spi_device *spi) | 377 | static int CHIP_probe(struct spi_device *spi) |
371 | { | 378 | { |
372 | struct CHIP *chip; | 379 | struct CHIP *chip; |
@@ -479,6 +486,8 @@ The main task of this type of driver is to provide an "spi_master". | |||
479 | Use spi_alloc_master() to allocate the master, and spi_master_get_devdata() | 486 | Use spi_alloc_master() to allocate the master, and spi_master_get_devdata() |
480 | to get the driver-private data allocated for that device. | 487 | to get the driver-private data allocated for that device. |
481 | 488 | ||
489 | :: | ||
490 | |||
482 | struct spi_master *master; | 491 | struct spi_master *master; |
483 | struct CONTROLLER *c; | 492 | struct CONTROLLER *c; |
484 | 493 | ||
@@ -503,7 +512,8 @@ If you need to remove your SPI controller driver, spi_unregister_master() | |||
503 | will reverse the effect of spi_register_master(). | 512 | will reverse the effect of spi_register_master(). |
504 | 513 | ||
505 | 514 | ||
506 | BUS NUMBERING | 515 | Bus Numbering |
516 | ^^^^^^^^^^^^^ | ||
507 | 517 | ||
508 | Bus numbering is important, since that's how Linux identifies a given | 518 | Bus numbering is important, since that's how Linux identifies a given |
509 | SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On | 519 | SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On |
@@ -517,9 +527,10 @@ then be replaced by a dynamically assigned number. You'd then need to treat | |||
517 | this as a non-static configuration (see above). | 527 | this as a non-static configuration (see above). |
518 | 528 | ||
519 | 529 | ||
520 | SPI MASTER METHODS | 530 | SPI Master Methods |
531 | ^^^^^^^^^^^^^^^^^^ | ||
521 | 532 | ||
522 | master->setup(struct spi_device *spi) | 533 | ``master->setup(struct spi_device *spi)`` |
523 | This sets up the device clock rate, SPI mode, and word sizes. | 534 | This sets up the device clock rate, SPI mode, and word sizes. |
524 | Drivers may change the defaults provided by board_info, and then | 535 | Drivers may change the defaults provided by board_info, and then |
525 | call spi_setup(spi) to invoke this routine. It may sleep. | 536 | call spi_setup(spi) to invoke this routine. It may sleep. |
@@ -528,37 +539,37 @@ SPI MASTER METHODS | |||
528 | change them right away ... otherwise drivers could corrupt I/O | 539 | change them right away ... otherwise drivers could corrupt I/O |
529 | that's in progress for other SPI devices. | 540 | that's in progress for other SPI devices. |
530 | 541 | ||
531 | ** BUG ALERT: for some reason the first version of | 542 | .. note:: |
532 | ** many spi_master drivers seems to get this wrong. | 543 | |
533 | ** When you code setup(), ASSUME that the controller | 544 | BUG ALERT: for some reason the first version of |
534 | ** is actively processing transfers for another device. | 545 | many spi_master drivers seems to get this wrong. |
546 | When you code setup(), ASSUME that the controller | ||
547 | is actively processing transfers for another device. | ||
535 | 548 | ||
536 | master->cleanup(struct spi_device *spi) | 549 | ``master->cleanup(struct spi_device *spi)`` |
537 | Your controller driver may use spi_device.controller_state to hold | 550 | Your controller driver may use spi_device.controller_state to hold |
538 | state it dynamically associates with that device. If you do that, | 551 | state it dynamically associates with that device. If you do that, |
539 | be sure to provide the cleanup() method to free that state. | 552 | be sure to provide the cleanup() method to free that state. |
540 | 553 | ||
541 | master->prepare_transfer_hardware(struct spi_master *master) | 554 | ``master->prepare_transfer_hardware(struct spi_master *master)`` |
542 | This will be called by the queue mechanism to signal to the driver | 555 | This will be called by the queue mechanism to signal to the driver |
543 | that a message is coming in soon, so the subsystem requests the | 556 | that a message is coming in soon, so the subsystem requests the |
544 | driver to prepare the transfer hardware by issuing this call. | 557 | driver to prepare the transfer hardware by issuing this call. |
545 | This may sleep. | 558 | This may sleep. |
546 | 559 | ||
547 | master->unprepare_transfer_hardware(struct spi_master *master) | 560 | ``master->unprepare_transfer_hardware(struct spi_master *master)`` |
548 | This will be called by the queue mechanism to signal to the driver | 561 | This will be called by the queue mechanism to signal to the driver |
549 | that there are no more messages pending in the queue and it may | 562 | that there are no more messages pending in the queue and it may |
550 | relax the hardware (e.g. by power management calls). This may sleep. | 563 | relax the hardware (e.g. by power management calls). This may sleep. |
551 | 564 | ||
552 | master->transfer_one_message(struct spi_master *master, | 565 | ``master->transfer_one_message(struct spi_master *master, struct spi_message *mesg)`` |
553 | struct spi_message *mesg) | ||
554 | The subsystem calls the driver to transfer a single message while | 566 | The subsystem calls the driver to transfer a single message while |
555 | queuing transfers that arrive in the meantime. When the driver is | 567 | queuing transfers that arrive in the meantime. When the driver is |
556 | finished with this message, it must call | 568 | finished with this message, it must call |
557 | spi_finalize_current_message() so the subsystem can issue the next | 569 | spi_finalize_current_message() so the subsystem can issue the next |
558 | message. This may sleep. | 570 | message. This may sleep. |
559 | 571 | ||
560 | master->transfer_one(struct spi_master *master, struct spi_device *spi, | 572 | ``master->transfer_one(struct spi_master *master, struct spi_device *spi, struct spi_transfer *transfer)`` |
561 | struct spi_transfer *transfer) | ||
562 | The subsystem calls the driver to transfer a single transfer while | 573 | The subsystem calls the driver to transfer a single transfer while |
563 | queuing transfers that arrive in the meantime. When the driver is | 574 | queuing transfers that arrive in the meantime. When the driver is |
564 | finished with this transfer, it must call | 575 | finished with this transfer, it must call |
@@ -568,19 +579,20 @@ SPI MASTER METHODS | |||
568 | not call your transfer_one callback. | 579 | not call your transfer_one callback. |
569 | 580 | ||
570 | Return values: | 581 | Return values: |
571 | negative errno: error | ||
572 | 0: transfer is finished | ||
573 | 1: transfer is still in progress | ||
574 | 582 | ||
575 | master->set_cs_timing(struct spi_device *spi, u8 setup_clk_cycles, | 583 | * negative errno: error |
576 | u8 hold_clk_cycles, u8 inactive_clk_cycles) | 584 | * 0: transfer is finished |
585 | * 1: transfer is still in progress | ||
586 | |||
587 | ``master->set_cs_timing(struct spi_device *spi, u8 setup_clk_cycles, u8 hold_clk_cycles, u8 inactive_clk_cycles)`` | ||
577 | This method allows SPI client drivers to request SPI master controller | 588 | This method allows SPI client drivers to request SPI master controller |
578 | for configuring device specific CS setup, hold and inactive timing | 589 | for configuring device specific CS setup, hold and inactive timing |
579 | requirements. | 590 | requirements. |
580 | 591 | ||
581 | DEPRECATED METHODS | 592 | Deprecated Methods |
593 | ^^^^^^^^^^^^^^^^^^ | ||
582 | 594 | ||
583 | master->transfer(struct spi_device *spi, struct spi_message *message) | 595 | ``master->transfer(struct spi_device *spi, struct spi_message *message)`` |
584 | This must not sleep. Its responsibility is to arrange that the | 596 | This must not sleep. Its responsibility is to arrange that the |
585 | transfer happens and its complete() callback is issued. The two | 597 | transfer happens and its complete() callback is issued. The two |
586 | will normally happen later, after other transfers complete, and | 598 | will normally happen later, after other transfers complete, and |
@@ -590,7 +602,8 @@ SPI MASTER METHODS | |||
590 | implemented. | 602 | implemented. |
591 | 603 | ||
592 | 604 | ||
593 | SPI MESSAGE QUEUE | 605 | SPI Message Queue |
606 | ^^^^^^^^^^^^^^^^^ | ||
594 | 607 | ||
595 | If you are happy with the standard queueing mechanism provided by the | 608 | If you are happy with the standard queueing mechanism provided by the |
596 | SPI subsystem, just implement the queued methods specified above. Using | 609 | SPI subsystem, just implement the queued methods specified above. Using |
@@ -619,13 +632,13 @@ THANKS TO | |||
619 | Contributors to Linux-SPI discussions include (in alphabetical order, | 632 | Contributors to Linux-SPI discussions include (in alphabetical order, |
620 | by last name): | 633 | by last name): |
621 | 634 | ||
622 | Mark Brown | 635 | - Mark Brown |
623 | David Brownell | 636 | - David Brownell |
624 | Russell King | 637 | - Russell King |
625 | Grant Likely | 638 | - Grant Likely |
626 | Dmitry Pervushin | 639 | - Dmitry Pervushin |
627 | Stephen Street | 640 | - Stephen Street |
628 | Mark Underwood | 641 | - Mark Underwood |
629 | Andrew Victor | 642 | - Andrew Victor |
630 | Linus Walleij | 643 | - Linus Walleij |
631 | Vitaly Wool | 644 | - Vitaly Wool |
diff --git a/Documentation/spi/spidev b/Documentation/spi/spidev.rst index 3d14035b1766..f05dbc5ccdbc 100644 --- a/Documentation/spi/spidev +++ b/Documentation/spi/spidev.rst | |||
@@ -1,7 +1,13 @@ | |||
1 | ================= | ||
2 | SPI userspace API | ||
3 | ================= | ||
4 | |||
1 | SPI devices have a limited userspace API, supporting basic half-duplex | 5 | SPI devices have a limited userspace API, supporting basic half-duplex |
2 | read() and write() access to SPI slave devices. Using ioctl() requests, | 6 | read() and write() access to SPI slave devices. Using ioctl() requests, |
3 | full duplex transfers and device I/O configuration are also available. | 7 | full duplex transfers and device I/O configuration are also available. |
4 | 8 | ||
9 | :: | ||
10 | |||
5 | #include <fcntl.h> | 11 | #include <fcntl.h> |
6 | #include <unistd.h> | 12 | #include <unistd.h> |
7 | #include <sys/ioctl.h> | 13 | #include <sys/ioctl.h> |
@@ -39,14 +45,17 @@ device node with a "dev" attribute that will be understood by udev or mdev. | |||
39 | busybox; it's less featureful, but often enough.) For a SPI device with | 45 | busybox; it's less featureful, but often enough.) For a SPI device with |
40 | chipselect C on bus B, you should see: | 46 | chipselect C on bus B, you should see: |
41 | 47 | ||
42 | /dev/spidevB.C ... character special device, major number 153 with | 48 | /dev/spidevB.C ... |
49 | character special device, major number 153 with | ||
43 | a dynamically chosen minor device number. This is the node | 50 | a dynamically chosen minor device number. This is the node |
44 | that userspace programs will open, created by "udev" or "mdev". | 51 | that userspace programs will open, created by "udev" or "mdev". |
45 | 52 | ||
46 | /sys/devices/.../spiB.C ... as usual, the SPI device node will | 53 | /sys/devices/.../spiB.C ... |
54 | as usual, the SPI device node will | ||
47 | be a child of its SPI master controller. | 55 | be a child of its SPI master controller. |
48 | 56 | ||
49 | /sys/class/spidev/spidevB.C ... created when the "spidev" driver | 57 | /sys/class/spidev/spidevB.C ... |
58 | created when the "spidev" driver | ||
50 | binds to that device. (Directory or symlink, based on whether | 59 | binds to that device. (Directory or symlink, based on whether |
51 | or not you enabled the "deprecated sysfs files" Kconfig option.) | 60 | or not you enabled the "deprecated sysfs files" Kconfig option.) |
52 | 61 | ||
@@ -80,7 +89,8 @@ the SPI_IOC_MESSAGE(N) request. | |||
80 | Several ioctl() requests let your driver read or override the device's current | 89 | Several ioctl() requests let your driver read or override the device's current |
81 | settings for data transfer parameters: | 90 | settings for data transfer parameters: |
82 | 91 | ||
83 | SPI_IOC_RD_MODE, SPI_IOC_WR_MODE ... pass a pointer to a byte which will | 92 | SPI_IOC_RD_MODE, SPI_IOC_WR_MODE ... |
93 | pass a pointer to a byte which will | ||
84 | return (RD) or assign (WR) the SPI transfer mode. Use the constants | 94 | 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 | 95 | 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, | 96 | (clock polarity, idle high iff this is set) or SPI_CPHA (clock phase, |
@@ -88,22 +98,26 @@ settings for data transfer parameters: | |||
88 | Note that this request is limited to SPI mode flags that fit in a | 98 | Note that this request is limited to SPI mode flags that fit in a |
89 | single byte. | 99 | single byte. |
90 | 100 | ||
91 | SPI_IOC_RD_MODE32, SPI_IOC_WR_MODE32 ... pass a pointer to a uin32_t | 101 | SPI_IOC_RD_MODE32, SPI_IOC_WR_MODE32 ... |
102 | pass a pointer to a uin32_t | ||
92 | which will return (RD) or assign (WR) the full SPI transfer mode, | 103 | which will return (RD) or assign (WR) the full SPI transfer mode, |
93 | not limited to the bits that fit in one byte. | 104 | not limited to the bits that fit in one byte. |
94 | 105 | ||
95 | SPI_IOC_RD_LSB_FIRST, SPI_IOC_WR_LSB_FIRST ... pass a pointer to a byte | 106 | SPI_IOC_RD_LSB_FIRST, SPI_IOC_WR_LSB_FIRST ... |
107 | pass a pointer to a byte | ||
96 | which will return (RD) or assign (WR) the bit justification used to | 108 | which will return (RD) or assign (WR) the bit justification used to |
97 | transfer SPI words. Zero indicates MSB-first; other values indicate | 109 | transfer SPI words. Zero indicates MSB-first; other values indicate |
98 | the less common LSB-first encoding. In both cases the specified value | 110 | the less common LSB-first encoding. In both cases the specified value |
99 | is right-justified in each word, so that unused (TX) or undefined (RX) | 111 | is right-justified in each word, so that unused (TX) or undefined (RX) |
100 | bits are in the MSBs. | 112 | bits are in the MSBs. |
101 | 113 | ||
102 | SPI_IOC_RD_BITS_PER_WORD, SPI_IOC_WR_BITS_PER_WORD ... pass a pointer to | 114 | SPI_IOC_RD_BITS_PER_WORD, SPI_IOC_WR_BITS_PER_WORD ... |
115 | pass a pointer to | ||
103 | a byte which will return (RD) or assign (WR) the number of bits in | 116 | a byte which will return (RD) or assign (WR) the number of bits in |
104 | each SPI transfer word. The value zero signifies eight bits. | 117 | each SPI transfer word. The value zero signifies eight bits. |
105 | 118 | ||
106 | SPI_IOC_RD_MAX_SPEED_HZ, SPI_IOC_WR_MAX_SPEED_HZ ... pass a pointer to a | 119 | SPI_IOC_RD_MAX_SPEED_HZ, SPI_IOC_WR_MAX_SPEED_HZ ... |
120 | pass a pointer to a | ||
107 | u32 which will return (RD) or assign (WR) the maximum SPI transfer | 121 | u32 which will return (RD) or assign (WR) the maximum SPI transfer |
108 | speed, in Hz. The controller can't necessarily assign that specific | 122 | speed, in Hz. The controller can't necessarily assign that specific |
109 | clock speed. | 123 | clock speed. |
diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.rst index 1a660a39e3c0..993dd294b81b 100644 --- a/Documentation/trace/coresight-cpu-debug.txt +++ b/Documentation/trace/coresight-cpu-debug.rst | |||
@@ -1,8 +1,9 @@ | |||
1 | Coresight CPU Debug Module | 1 | ========================== |
2 | ========================== | 2 | Coresight CPU Debug Module |
3 | ========================== | ||
3 | 4 | ||
4 | Author: Leo Yan <leo.yan@linaro.org> | 5 | :Author: Leo Yan <leo.yan@linaro.org> |
5 | Date: April 5th, 2017 | 6 | :Date: April 5th, 2017 |
6 | 7 | ||
7 | Introduction | 8 | Introduction |
8 | ------------ | 9 | ------------ |
@@ -69,6 +70,7 @@ Before accessing debug registers, we should ensure the clock and power domain | |||
69 | have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1 | 70 | have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1 |
70 | Debug registers', the debug registers are spread into two domains: the debug | 71 | Debug registers', the debug registers are spread into two domains: the debug |
71 | domain and the CPU domain. | 72 | domain and the CPU domain. |
73 | :: | ||
72 | 74 | ||
73 | +---------------+ | 75 | +---------------+ |
74 | | | | 76 | | | |
@@ -125,18 +127,21 @@ If you want to enable debugging functionality at boot time, you can add | |||
125 | "coresight_cpu_debug.enable=1" to the kernel command line parameter. | 127 | "coresight_cpu_debug.enable=1" to the kernel command line parameter. |
126 | 128 | ||
127 | The driver also can work as module, so can enable the debugging when insmod | 129 | The driver also can work as module, so can enable the debugging when insmod |
128 | module: | 130 | module:: |
129 | # insmod coresight_cpu_debug.ko debug=1 | 131 | |
132 | # insmod coresight_cpu_debug.ko debug=1 | ||
130 | 133 | ||
131 | When boot time or insmod module you have not enabled the debugging, the driver | 134 | When boot time or insmod module you have not enabled the debugging, the driver |
132 | uses the debugfs file system to provide a knob to dynamically enable or disable | 135 | uses the debugfs file system to provide a knob to dynamically enable or disable |
133 | debugging: | 136 | debugging: |
134 | 137 | ||
135 | To enable it, write a '1' into /sys/kernel/debug/coresight_cpu_debug/enable: | 138 | To enable it, write a '1' into /sys/kernel/debug/coresight_cpu_debug/enable:: |
136 | # echo 1 > /sys/kernel/debug/coresight_cpu_debug/enable | 139 | |
140 | # echo 1 > /sys/kernel/debug/coresight_cpu_debug/enable | ||
141 | |||
142 | To disable it, write a '0' into /sys/kernel/debug/coresight_cpu_debug/enable:: | ||
137 | 143 | ||
138 | To disable it, write a '0' into /sys/kernel/debug/coresight_cpu_debug/enable: | 144 | # echo 0 > /sys/kernel/debug/coresight_cpu_debug/enable |
139 | # echo 0 > /sys/kernel/debug/coresight_cpu_debug/enable | ||
140 | 145 | ||
141 | As explained in chapter "Clock and power domain", if you are working on one | 146 | As explained in chapter "Clock and power domain", if you are working on one |
142 | platform which has idle states to power off debug logic and the power | 147 | platform which has idle states to power off debug logic and the power |
@@ -154,34 +159,34 @@ subsystem, more specifically by using the "/dev/cpu_dma_latency" | |||
154 | interface (see Documentation/power/pm_qos_interface.rst for more | 159 | interface (see Documentation/power/pm_qos_interface.rst for more |
155 | details). As specified in the PM QoS documentation the requested | 160 | details). As specified in the PM QoS documentation the requested |
156 | parameter will stay in effect until the file descriptor is released. | 161 | parameter will stay in effect until the file descriptor is released. |
157 | For example: | 162 | For example:: |
158 | 163 | ||
159 | # exec 3<> /dev/cpu_dma_latency; echo 0 >&3 | 164 | # exec 3<> /dev/cpu_dma_latency; echo 0 >&3 |
160 | ... | 165 | ... |
161 | Do some work... | 166 | Do some work... |
162 | ... | 167 | ... |
163 | # exec 3<>- | 168 | # exec 3<>- |
164 | 169 | ||
165 | The same can also be done from an application program. | 170 | The same can also be done from an application program. |
166 | 171 | ||
167 | Disable specific CPU's specific idle state from cpuidle sysfs (see | 172 | Disable specific CPU's specific idle state from cpuidle sysfs (see |
168 | Documentation/admin-guide/pm/cpuidle.rst): | 173 | Documentation/admin-guide/pm/cpuidle.rst):: |
169 | # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable | ||
170 | 174 | ||
175 | # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable | ||
171 | 176 | ||
172 | Output format | 177 | Output format |
173 | ------------- | 178 | ------------- |
174 | 179 | ||
175 | Here is an example of the debugging output format: | 180 | Here is an example of the debugging output format:: |
176 | 181 | ||
177 | ARM external debug module: | 182 | ARM external debug module: |
178 | coresight-cpu-debug 850000.debug: CPU[0]: | 183 | coresight-cpu-debug 850000.debug: CPU[0]: |
179 | coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) | 184 | coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) |
180 | coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 | 185 | coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 |
181 | coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 | 186 | coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 |
182 | coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) | 187 | coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) |
183 | coresight-cpu-debug 852000.debug: CPU[1]: | 188 | coresight-cpu-debug 852000.debug: CPU[1]: |
184 | coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) | 189 | coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) |
185 | coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 | 190 | coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 |
186 | coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 | 191 | coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 |
187 | coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) | 192 | coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) |
diff --git a/Documentation/trace/coresight.txt b/Documentation/trace/coresight.rst index b027d61b27a6..72f4b7ef1bad 100644 --- a/Documentation/trace/coresight.txt +++ b/Documentation/trace/coresight.rst | |||
@@ -1,8 +1,9 @@ | |||
1 | Coresight - HW Assisted Tracing on ARM | 1 | ====================================== |
2 | ====================================== | 2 | Coresight - HW Assisted Tracing on ARM |
3 | ====================================== | ||
3 | 4 | ||
4 | Author: Mathieu Poirier <mathieu.poirier@linaro.org> | 5 | :Author: Mathieu Poirier <mathieu.poirier@linaro.org> |
5 | Date: September 11th, 2014 | 6 | :Date: September 11th, 2014 |
6 | 7 | ||
7 | Introduction | 8 | Introduction |
8 | ------------ | 9 | ------------ |
@@ -26,7 +27,7 @@ implementation, either storing the compressed stream in a memory buffer or | |||
26 | creating an interface to the outside world where data can be transferred to a | 27 | creating an interface to the outside world where data can be transferred to a |
27 | host without fear of filling up the onboard coresight memory buffer. | 28 | host without fear of filling up the onboard coresight memory buffer. |
28 | 29 | ||
29 | At typical coresight system would look like this: | 30 | At typical coresight system would look like this:: |
30 | 31 | ||
31 | ***************************************************************** | 32 | ***************************************************************** |
32 | **************************** AMBA AXI ****************************===|| | 33 | **************************** AMBA AXI ****************************===|| |
@@ -95,15 +96,24 @@ Acronyms and Classification | |||
95 | 96 | ||
96 | Acronyms: | 97 | Acronyms: |
97 | 98 | ||
98 | PTM: Program Trace Macrocell | 99 | PTM: |
99 | ETM: Embedded Trace Macrocell | 100 | Program Trace Macrocell |
100 | STM: System trace Macrocell | 101 | ETM: |
101 | ETB: Embedded Trace Buffer | 102 | Embedded Trace Macrocell |
102 | ITM: Instrumentation Trace Macrocell | 103 | STM: |
103 | TPIU: Trace Port Interface Unit | 104 | System trace Macrocell |
104 | TMC-ETR: Trace Memory Controller, configured as Embedded Trace Router | 105 | ETB: |
105 | TMC-ETF: Trace Memory Controller, configured as Embedded Trace FIFO | 106 | Embedded Trace Buffer |
106 | CTI: Cross Trigger Interface | 107 | ITM: |
108 | Instrumentation Trace Macrocell | ||
109 | TPIU: | ||
110 | Trace Port Interface Unit | ||
111 | TMC-ETR: | ||
112 | Trace Memory Controller, configured as Embedded Trace Router | ||
113 | TMC-ETF: | ||
114 | Trace Memory Controller, configured as Embedded Trace FIFO | ||
115 | CTI: | ||
116 | Cross Trigger Interface | ||
107 | 117 | ||
108 | Classification: | 118 | Classification: |
109 | 119 | ||
@@ -118,7 +128,7 @@ Misc: | |||
118 | 128 | ||
119 | 129 | ||
120 | Device Tree Bindings | 130 | Device Tree Bindings |
121 | ---------------------- | 131 | -------------------- |
122 | 132 | ||
123 | See Documentation/devicetree/bindings/arm/coresight.txt for details. | 133 | See Documentation/devicetree/bindings/arm/coresight.txt for details. |
124 | 134 | ||
@@ -133,79 +143,79 @@ The coresight framework provides a central point to represent, configure and | |||
133 | manage coresight devices on a platform. Any coresight compliant device can | 143 | manage coresight devices on a platform. Any coresight compliant device can |
134 | register with the framework for as long as they use the right APIs: | 144 | register with the framework for as long as they use the right APIs: |
135 | 145 | ||
136 | struct coresight_device *coresight_register(struct coresight_desc *desc); | 146 | .. c:function:: struct coresight_device *coresight_register(struct coresight_desc *desc); |
137 | void coresight_unregister(struct coresight_device *csdev); | 147 | .. c:function:: void coresight_unregister(struct coresight_device *csdev); |
138 | 148 | ||
139 | The registering function is taking a "struct coresight_device *csdev" and | 149 | The registering function is taking a ``struct coresight_desc *desc`` and |
140 | register the device with the core framework. The unregister function takes | 150 | register the device with the core framework. The unregister function takes |
141 | a reference to a "struct coresight_device", obtained at registration time. | 151 | a reference to a ``struct coresight_device *csdev`` obtained at registration time. |
142 | 152 | ||
143 | If everything goes well during the registration process the new devices will | 153 | If everything goes well during the registration process the new devices will |
144 | show up under /sys/bus/coresight/devices, as showns here for a TC2 platform: | 154 | show up under /sys/bus/coresight/devices, as showns here for a TC2 platform:: |
145 | 155 | ||
146 | root:~# ls /sys/bus/coresight/devices/ | 156 | root:~# ls /sys/bus/coresight/devices/ |
147 | replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm | 157 | replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm |
148 | 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm | 158 | 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm |
149 | root:~# | 159 | root:~# |
150 | 160 | ||
151 | The functions take a "struct coresight_device", which looks like this: | 161 | The functions take a ``struct coresight_device``, which looks like this:: |
152 | 162 | ||
153 | struct coresight_desc { | 163 | struct coresight_desc { |
154 | enum coresight_dev_type type; | 164 | enum coresight_dev_type type; |
155 | struct coresight_dev_subtype subtype; | 165 | struct coresight_dev_subtype subtype; |
156 | const struct coresight_ops *ops; | 166 | const struct coresight_ops *ops; |
157 | struct coresight_platform_data *pdata; | 167 | struct coresight_platform_data *pdata; |
158 | struct device *dev; | 168 | struct device *dev; |
159 | const struct attribute_group **groups; | 169 | const struct attribute_group **groups; |
160 | }; | 170 | }; |
161 | 171 | ||
162 | 172 | ||
163 | The "coresight_dev_type" identifies what the device is, i.e, source link or | 173 | The "coresight_dev_type" identifies what the device is, i.e, source link or |
164 | sink while the "coresight_dev_subtype" will characterise that type further. | 174 | sink while the "coresight_dev_subtype" will characterise that type further. |
165 | 175 | ||
166 | The "struct coresight_ops" is mandatory and will tell the framework how to | 176 | The ``struct coresight_ops`` is mandatory and will tell the framework how to |
167 | perform base operations related to the components, each component having | 177 | perform base operations related to the components, each component having |
168 | a different set of requirement. For that "struct coresight_ops_sink", | 178 | a different set of requirement. For that ``struct coresight_ops_sink``, |
169 | "struct coresight_ops_link" and "struct coresight_ops_source" have been | 179 | ``struct coresight_ops_link`` and ``struct coresight_ops_source`` have been |
170 | provided. | 180 | provided. |
171 | 181 | ||
172 | The next field, "struct coresight_platform_data *pdata" is acquired by calling | 182 | The next field ``struct coresight_platform_data *pdata`` is acquired by calling |
173 | "of_get_coresight_platform_data()", as part of the driver's _probe routine and | 183 | ``of_get_coresight_platform_data()``, as part of the driver's _probe routine and |
174 | "struct device *dev" gets the device reference embedded in the "amba_device": | 184 | ``struct device *dev`` gets the device reference embedded in the ``amba_device``:: |
175 | 185 | ||
176 | static int etm_probe(struct amba_device *adev, const struct amba_id *id) | 186 | static int etm_probe(struct amba_device *adev, const struct amba_id *id) |
177 | { | 187 | { |
178 | ... | 188 | ... |
179 | ... | 189 | ... |
180 | drvdata->dev = &adev->dev; | 190 | drvdata->dev = &adev->dev; |
181 | ... | 191 | ... |
182 | } | 192 | } |
183 | 193 | ||
184 | Specific class of device (source, link, or sink) have generic operations | 194 | Specific class of device (source, link, or sink) have generic operations |
185 | that can be performed on them (see "struct coresight_ops"). The | 195 | that can be performed on them (see ``struct coresight_ops``). The ``**groups`` |
186 | "**groups" is a list of sysfs entries pertaining to operations | 196 | is a list of sysfs entries pertaining to operations |
187 | specific to that component only. "Implementation defined" customisations are | 197 | specific to that component only. "Implementation defined" customisations are |
188 | expected to be accessed and controlled using those entries. | 198 | expected to be accessed and controlled using those entries. |
189 | 199 | ||
190 | |||
191 | Device Naming scheme | 200 | Device Naming scheme |
192 | ------------------------ | 201 | -------------------- |
202 | |||
193 | The devices that appear on the "coresight" bus were named the same as their | 203 | The devices that appear on the "coresight" bus were named the same as their |
194 | parent devices, i.e, the real devices that appears on AMBA bus or the platform bus. | 204 | parent devices, i.e, the real devices that appears on AMBA bus or the platform bus. |
195 | Thus the names were based on the Linux Open Firmware layer naming convention, | 205 | Thus the names were based on the Linux Open Firmware layer naming convention, |
196 | which follows the base physical address of the device followed by the device | 206 | which follows the base physical address of the device followed by the device |
197 | type. e.g: | 207 | type. e.g:: |
198 | 208 | ||
199 | root:~# ls /sys/bus/coresight/devices/ | 209 | root:~# ls /sys/bus/coresight/devices/ |
200 | 20010000.etf 20040000.funnel 20100000.stm 22040000.etm | 210 | 20010000.etf 20040000.funnel 20100000.stm 22040000.etm |
201 | 22140000.etm 230c0000.funnel 23240000.etm 20030000.tpiu | 211 | 22140000.etm 230c0000.funnel 23240000.etm 20030000.tpiu |
202 | 20070000.etr 20120000.replicator 220c0000.funnel | 212 | 20070000.etr 20120000.replicator 220c0000.funnel |
203 | 23040000.etm 23140000.etm 23340000.etm | 213 | 23040000.etm 23140000.etm 23340000.etm |
204 | 214 | ||
205 | However, with the introduction of ACPI support, the names of the real | 215 | However, with the introduction of ACPI support, the names of the real |
206 | devices are a bit cryptic and non-obvious. Thus, a new naming scheme was | 216 | devices are a bit cryptic and non-obvious. Thus, a new naming scheme was |
207 | introduced to use more generic names based on the type of the device. The | 217 | introduced to use more generic names based on the type of the device. The |
208 | following rules apply: | 218 | following rules apply:: |
209 | 219 | ||
210 | 1) Devices that are bound to CPUs, are named based on the CPU logical | 220 | 1) Devices that are bound to CPUs, are named based on the CPU logical |
211 | number. | 221 | number. |
@@ -220,11 +230,11 @@ following rules apply: | |||
220 | 230 | ||
221 | e.g, tmc_etf0, tmc_etr0, funnel0, funnel1 | 231 | e.g, tmc_etf0, tmc_etr0, funnel0, funnel1 |
222 | 232 | ||
223 | Thus, with the new scheme the devices could appear as : | 233 | Thus, with the new scheme the devices could appear as :: |
224 | 234 | ||
225 | root:~# ls /sys/bus/coresight/devices/ | 235 | root:~# ls /sys/bus/coresight/devices/ |
226 | etm0 etm1 etm2 etm3 etm4 etm5 funnel0 | 236 | etm0 etm1 etm2 etm3 etm4 etm5 funnel0 |
227 | funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0 | 237 | funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0 |
228 | 238 | ||
229 | Some of the examples below might refer to old naming scheme and some | 239 | Some of the examples below might refer to old naming scheme and some |
230 | to the newer scheme, to give a confirmation that what you see on your | 240 | to the newer scheme, to give a confirmation that what you see on your |
@@ -234,9 +244,12 @@ the system under specified locations. | |||
234 | How to use the tracer modules | 244 | How to use the tracer modules |
235 | ----------------------------- | 245 | ----------------------------- |
236 | 246 | ||
237 | There are two ways to use the Coresight framework: 1) using the perf cmd line | 247 | There are two ways to use the Coresight framework: |
238 | tools and 2) interacting directly with the Coresight devices using the sysFS | 248 | |
239 | interface. Preference is given to the former as using the sysFS interface | 249 | 1. using the perf cmd line tools. |
250 | 2. interacting directly with the Coresight devices using the sysFS interface. | ||
251 | |||
252 | Preference is given to the former as using the sysFS interface | ||
240 | requires a deep understanding of the Coresight HW. The following sections | 253 | requires a deep understanding of the Coresight HW. The following sections |
241 | provide details on using both methods. | 254 | provide details on using both methods. |
242 | 255 | ||
@@ -245,107 +258,107 @@ provide details on using both methods. | |||
245 | Before trace collection can start, a coresight sink needs to be identified. | 258 | Before trace collection can start, a coresight sink needs to be identified. |
246 | There is no limit on the amount of sinks (nor sources) that can be enabled at | 259 | There is no limit on the amount of sinks (nor sources) that can be enabled at |
247 | any given moment. As a generic operation, all device pertaining to the sink | 260 | any given moment. As a generic operation, all device pertaining to the sink |
248 | class will have an "active" entry in sysfs: | 261 | class will have an "active" entry in sysfs:: |
249 | 262 | ||
250 | root:/sys/bus/coresight/devices# ls | 263 | root:/sys/bus/coresight/devices# ls |
251 | replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm | 264 | replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm |
252 | 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm | 265 | 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm |
253 | root:/sys/bus/coresight/devices# ls 20010000.etb | 266 | root:/sys/bus/coresight/devices# ls 20010000.etb |
254 | enable_sink status trigger_cntr | 267 | enable_sink status trigger_cntr |
255 | root:/sys/bus/coresight/devices# echo 1 > 20010000.etb/enable_sink | 268 | root:/sys/bus/coresight/devices# echo 1 > 20010000.etb/enable_sink |
256 | root:/sys/bus/coresight/devices# cat 20010000.etb/enable_sink | 269 | root:/sys/bus/coresight/devices# cat 20010000.etb/enable_sink |
257 | 1 | 270 | 1 |
258 | root:/sys/bus/coresight/devices# | 271 | root:/sys/bus/coresight/devices# |
259 | 272 | ||
260 | At boot time the current etm3x driver will configure the first address | 273 | At boot time the current etm3x driver will configure the first address |
261 | comparator with "_stext" and "_etext", essentially tracing any instruction | 274 | comparator with "_stext" and "_etext", essentially tracing any instruction |
262 | that falls within that range. As such "enabling" a source will immediately | 275 | that falls within that range. As such "enabling" a source will immediately |
263 | trigger a trace capture: | 276 | trigger a trace capture:: |
264 | 277 | ||
265 | root:/sys/bus/coresight/devices# echo 1 > 2201c000.ptm/enable_source | 278 | root:/sys/bus/coresight/devices# echo 1 > 2201c000.ptm/enable_source |
266 | root:/sys/bus/coresight/devices# cat 2201c000.ptm/enable_source | 279 | root:/sys/bus/coresight/devices# cat 2201c000.ptm/enable_source |
267 | 1 | 280 | 1 |
268 | root:/sys/bus/coresight/devices# cat 20010000.etb/status | 281 | root:/sys/bus/coresight/devices# cat 20010000.etb/status |
269 | Depth: 0x2000 | 282 | Depth: 0x2000 |
270 | Status: 0x1 | 283 | Status: 0x1 |
271 | RAM read ptr: 0x0 | 284 | RAM read ptr: 0x0 |
272 | RAM wrt ptr: 0x19d3 <----- The write pointer is moving | 285 | RAM wrt ptr: 0x19d3 <----- The write pointer is moving |
273 | Trigger cnt: 0x0 | 286 | Trigger cnt: 0x0 |
274 | Control: 0x1 | 287 | Control: 0x1 |
275 | Flush status: 0x0 | 288 | Flush status: 0x0 |
276 | Flush ctrl: 0x2001 | 289 | Flush ctrl: 0x2001 |
277 | root:/sys/bus/coresight/devices# | 290 | root:/sys/bus/coresight/devices# |
278 | 291 | ||
279 | Trace collection is stopped the same way: | 292 | Trace collection is stopped the same way:: |
280 | 293 | ||
281 | root:/sys/bus/coresight/devices# echo 0 > 2201c000.ptm/enable_source | 294 | root:/sys/bus/coresight/devices# echo 0 > 2201c000.ptm/enable_source |
282 | root:/sys/bus/coresight/devices# | 295 | root:/sys/bus/coresight/devices# |
283 | 296 | ||
284 | The content of the ETB buffer can be harvested directly from /dev: | 297 | The content of the ETB buffer can be harvested directly from /dev:: |
285 | 298 | ||
286 | root:/sys/bus/coresight/devices# dd if=/dev/20010000.etb \ | 299 | root:/sys/bus/coresight/devices# dd if=/dev/20010000.etb \ |
287 | of=~/cstrace.bin | 300 | of=~/cstrace.bin |
288 | 301 | 64+0 records in | |
289 | 64+0 records in | 302 | 64+0 records out |
290 | 64+0 records out | 303 | 32768 bytes (33 kB) copied, 0.00125258 s, 26.2 MB/s |
291 | 32768 bytes (33 kB) copied, 0.00125258 s, 26.2 MB/s | 304 | root:/sys/bus/coresight/devices# |
292 | root:/sys/bus/coresight/devices# | ||
293 | 305 | ||
294 | The file cstrace.bin can be decompressed using "ptm2human", DS-5 or Trace32. | 306 | The file cstrace.bin can be decompressed using "ptm2human", DS-5 or Trace32. |
295 | 307 | ||
296 | Following is a DS-5 output of an experimental loop that increments a variable up | 308 | Following is a DS-5 output of an experimental loop that increments a variable up |
297 | to a certain value. The example is simple and yet provides a glimpse of the | 309 | to a certain value. The example is simple and yet provides a glimpse of the |
298 | wealth of possibilities that coresight provides. | 310 | wealth of possibilities that coresight provides. |
299 | 311 | :: | |
300 | Info Tracing enabled | 312 | |
301 | Instruction 106378866 0x8026B53C E52DE004 false PUSH {lr} | 313 | Info Tracing enabled |
302 | Instruction 0 0x8026B540 E24DD00C false SUB sp,sp,#0xc | 314 | Instruction 106378866 0x8026B53C E52DE004 false PUSH {lr} |
303 | Instruction 0 0x8026B544 E3A03000 false MOV r3,#0 | 315 | Instruction 0 0x8026B540 E24DD00C false SUB sp,sp,#0xc |
304 | Instruction 0 0x8026B548 E58D3004 false STR r3,[sp,#4] | 316 | Instruction 0 0x8026B544 E3A03000 false MOV r3,#0 |
305 | Instruction 0 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 317 | Instruction 0 0x8026B548 E58D3004 false STR r3,[sp,#4] |
306 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 318 | Instruction 0 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
307 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 319 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
308 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 320 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
309 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 321 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
310 | Timestamp Timestamp: 17106715833 | 322 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
311 | Instruction 319 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 323 | Timestamp Timestamp: 17106715833 |
312 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 324 | Instruction 319 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
313 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 325 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
314 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 326 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
315 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 327 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
316 | Instruction 9 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 328 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
317 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 329 | Instruction 9 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
318 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 330 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
319 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 331 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
320 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 332 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
321 | Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 333 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
322 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 334 | Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
323 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 335 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
324 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 336 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
325 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 337 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
326 | Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 338 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
327 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 339 | Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
328 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 340 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
329 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 341 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
330 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 342 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
331 | Instruction 10 0x8026B54C E59D3004 false LDR r3,[sp,#4] | 343 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
332 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 | 344 | Instruction 10 0x8026B54C E59D3004 false LDR r3,[sp,#4] |
333 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 | 345 | Instruction 0 0x8026B550 E3530004 false CMP r3,#4 |
334 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] | 346 | Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 |
335 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c | 347 | Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] |
336 | Instruction 6 0x8026B560 EE1D3F30 false MRC p15,#0x0,r3,c13,c0,#1 | 348 | Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c |
337 | Instruction 0 0x8026B564 E1A0100D false MOV r1,sp | 349 | Instruction 6 0x8026B560 EE1D3F30 false MRC p15,#0x0,r3,c13,c0,#1 |
338 | Instruction 0 0x8026B568 E3C12D7F false BIC r2,r1,#0x1fc0 | 350 | Instruction 0 0x8026B564 E1A0100D false MOV r1,sp |
339 | Instruction 0 0x8026B56C E3C2203F false BIC r2,r2,#0x3f | 351 | Instruction 0 0x8026B568 E3C12D7F false BIC r2,r1,#0x1fc0 |
340 | Instruction 0 0x8026B570 E59D1004 false LDR r1,[sp,#4] | 352 | Instruction 0 0x8026B56C E3C2203F false BIC r2,r2,#0x3f |
341 | Instruction 0 0x8026B574 E59F0010 false LDR r0,[pc,#16] ; [0x8026B58C] = 0x80550368 | 353 | Instruction 0 0x8026B570 E59D1004 false LDR r1,[sp,#4] |
342 | Instruction 0 0x8026B578 E592200C false LDR r2,[r2,#0xc] | 354 | Instruction 0 0x8026B574 E59F0010 false LDR r0,[pc,#16] ; [0x8026B58C] = 0x80550368 |
343 | Instruction 0 0x8026B57C E59221D0 false LDR r2,[r2,#0x1d0] | 355 | Instruction 0 0x8026B578 E592200C false LDR r2,[r2,#0xc] |
344 | Instruction 0 0x8026B580 EB07A4CF true BL {pc}+0x1e9344 ; 0x804548c4 | 356 | Instruction 0 0x8026B57C E59221D0 false LDR r2,[r2,#0x1d0] |
345 | Info Tracing enabled | 357 | Instruction 0 0x8026B580 EB07A4CF true BL {pc}+0x1e9344 ; 0x804548c4 |
346 | Instruction 13570831 0x8026B584 E28DD00C false ADD sp,sp,#0xc | 358 | Info Tracing enabled |
347 | Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc} | 359 | Instruction 13570831 0x8026B584 E28DD00C false ADD sp,sp,#0xc |
348 | Timestamp Timestamp: 17107041535 | 360 | Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc} |
361 | Timestamp Timestamp: 17107041535 | ||
349 | 362 | ||
350 | 2) Using perf framework: | 363 | 2) Using perf framework: |
351 | 364 | ||
@@ -370,19 +383,18 @@ A Coresight PMU works the same way as any other PMU, i.e the name of the PMU is | |||
370 | listed along with configuration options within forward slashes '/'. Since a | 383 | listed along with configuration options within forward slashes '/'. Since a |
371 | Coresight system will typically have more than one sink, the name of the sink to | 384 | Coresight system will typically have more than one sink, the name of the sink to |
372 | work with needs to be specified as an event option. | 385 | work with needs to be specified as an event option. |
373 | On newer kernels the available sinks are listed in sysFS under: | 386 | On newer kernels the available sinks are listed in sysFS under |
374 | ($SYSFS)/bus/event_source/devices/cs_etm/sinks/ | 387 | ($SYSFS)/bus/event_source/devices/cs_etm/sinks/:: |
375 | 388 | ||
376 | root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls | 389 | root@localhost:/sys/bus/event_source/devices/cs_etm/sinks# ls |
377 | tmc_etf0 tmc_etr0 tpiu0 | 390 | tmc_etf0 tmc_etr0 tpiu0 |
378 | 391 | ||
379 | On older kernels, this may need to be found from the list of coresight devices, | 392 | On older kernels, this may need to be found from the list of coresight devices, |
380 | available under ($SYSFS)/bus/coresight/devices/: | 393 | available under ($SYSFS)/bus/coresight/devices/:: |
381 | 394 | ||
382 | root:~# ls /sys/bus/coresight/devices/ | 395 | root:~# ls /sys/bus/coresight/devices/ |
383 | etm0 etm1 etm2 etm3 etm4 etm5 funnel0 | 396 | etm0 etm1 etm2 etm3 etm4 etm5 funnel0 |
384 | funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0 | 397 | funnel1 funnel2 replicator0 stm0 tmc_etf0 tmc_etr0 tpiu0 |
385 | |||
386 | root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program | 398 | root@linaro-nano:~# perf record -e cs_etm/@tmc_etr0/u --per-thread program |
387 | 399 | ||
388 | As mentioned above in section "Device Naming scheme", the names of the devices could | 400 | As mentioned above in section "Device Naming scheme", the names of the devices could |
@@ -395,14 +407,14 @@ to use for the trace session. | |||
395 | 407 | ||
396 | More information on the above and other example on how to use Coresight with | 408 | More information on the above and other example on how to use Coresight with |
397 | the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub | 409 | the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub |
398 | repository [3]. | 410 | repository [#third]_. |
399 | 411 | ||
400 | 2.1) AutoFDO analysis using the perf tools: | 412 | 2.1) AutoFDO analysis using the perf tools: |
401 | 413 | ||
402 | perf can be used to record and analyze trace of programs. | 414 | perf can be used to record and analyze trace of programs. |
403 | 415 | ||
404 | Execution can be recorded using 'perf record' with the cs_etm event, | 416 | Execution can be recorded using 'perf record' with the cs_etm event, |
405 | specifying the name of the sink to record to, e.g: | 417 | specifying the name of the sink to record to, e.g:: |
406 | 418 | ||
407 | perf record -e cs_etm/@tmc_etr0/u --per-thread | 419 | perf record -e cs_etm/@tmc_etr0/u --per-thread |
408 | 420 | ||
@@ -421,12 +433,14 @@ Generating coverage files for Feedback Directed Optimization: AutoFDO | |||
421 | 433 | ||
422 | 'perf inject' accepts the --itrace option in which case tracing data is | 434 | 'perf inject' accepts the --itrace option in which case tracing data is |
423 | removed and replaced with the synthesized events. e.g. | 435 | removed and replaced with the synthesized events. e.g. |
436 | :: | ||
424 | 437 | ||
425 | perf inject --itrace --strip -i perf.data -o perf.data.new | 438 | perf inject --itrace --strip -i perf.data -o perf.data.new |
426 | 439 | ||
427 | Below is an example of using ARM ETM for autoFDO. It requires autofdo | 440 | Below is an example of using ARM ETM for autoFDO. It requires autofdo |
428 | (https://github.com/google/autofdo) and gcc version 5. The bubble | 441 | (https://github.com/google/autofdo) and gcc version 5. The bubble |
429 | sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial). | 442 | sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial). |
443 | :: | ||
430 | 444 | ||
431 | $ gcc-5 -O3 sort.c -o sort | 445 | $ gcc-5 -O3 sort.c -o sort |
432 | $ taskset -c 2 ./sort | 446 | $ taskset -c 2 ./sort |
@@ -455,28 +469,30 @@ difference is that clients are driving the trace capture rather | |||
455 | than the program flow through the code. | 469 | than the program flow through the code. |
456 | 470 | ||
457 | As with any other CoreSight component, specifics about the STM tracer can be | 471 | As with any other CoreSight component, specifics about the STM tracer can be |
458 | found in sysfs with more information on each entry being found in [1]: | 472 | found in sysfs with more information on each entry being found in [#first]_:: |
459 | 473 | ||
460 | root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0 | 474 | root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0 |
461 | enable_source hwevent_select port_enable subsystem uevent | 475 | enable_source hwevent_select port_enable subsystem uevent |
462 | hwevent_enable mgmt port_select traceid | 476 | hwevent_enable mgmt port_select traceid |
463 | root@genericarmv8:~# | 477 | root@genericarmv8:~# |
464 | 478 | ||
465 | Like any other source a sink needs to be identified and the STM enabled before | 479 | Like any other source a sink needs to be identified and the STM enabled before |
466 | being used: | 480 | being used:: |
467 | 481 | ||
468 | root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink | 482 | root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink |
469 | root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source | 483 | root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source |
470 | 484 | ||
471 | From there user space applications can request and use channels using the devfs | 485 | From there user space applications can request and use channels using the devfs |
472 | interface provided for that purpose by the generic STM API: | 486 | interface provided for that purpose by the generic STM API:: |
487 | |||
488 | root@genericarmv8:~# ls -l /dev/stm0 | ||
489 | crw------- 1 root root 10, 61 Jan 3 18:11 /dev/stm0 | ||
490 | root@genericarmv8:~# | ||
491 | |||
492 | Details on how to use the generic STM API can be found here [#second]_. | ||
473 | 493 | ||
474 | root@genericarmv8:~# ls -l /dev/stm0 | 494 | .. [#first] Documentation/ABI/testing/sysfs-bus-coresight-devices-stm |
475 | crw------- 1 root root 10, 61 Jan 3 18:11 /dev/stm0 | ||
476 | root@genericarmv8:~# | ||
477 | 495 | ||
478 | Details on how to use the generic STM API can be found here [2]. | 496 | .. [#second] Documentation/trace/stm.rst |
479 | 497 | ||
480 | [1]. Documentation/ABI/testing/sysfs-bus-coresight-devices-stm | 498 | .. [#third] https://github.com/Linaro/perf-opencsd |
481 | [2]. Documentation/trace/stm.rst | ||
482 | [3]. https://github.com/Linaro/perf-opencsd | ||
diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index f60079259669..e3060eedb22d 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst | |||
@@ -125,7 +125,8 @@ of ftrace. Here is a list of some of the key files: | |||
125 | 125 | ||
126 | This file holds the output of the trace in a human | 126 | This file holds the output of the trace in a human |
127 | readable format (described below). Note, tracing is temporarily | 127 | readable format (described below). Note, tracing is temporarily |
128 | disabled while this file is being read (opened). | 128 | disabled when the file is open for reading. Once all readers |
129 | are closed, tracing is re-enabled. | ||
129 | 130 | ||
130 | trace_pipe: | 131 | trace_pipe: |
131 | 132 | ||
@@ -139,8 +140,9 @@ of ftrace. Here is a list of some of the key files: | |||
139 | will not be read again with a sequential read. The | 140 | will not be read again with a sequential read. The |
140 | "trace" file is static, and if the tracer is not | 141 | "trace" file is static, and if the tracer is not |
141 | adding more data, it will display the same | 142 | adding more data, it will display the same |
142 | information every time it is read. This file will not | 143 | information every time it is read. Unlike the |
143 | disable tracing while being read. | 144 | "trace" file, opening this file for reading will not |
145 | temporarily disable tracing. | ||
144 | 146 | ||
145 | trace_options: | 147 | trace_options: |
146 | 148 | ||
@@ -3153,7 +3155,10 @@ different. The trace is live. | |||
3153 | 3155 | ||
3154 | 3156 | ||
3155 | Note, reading the trace_pipe file will block until more input is | 3157 | Note, reading the trace_pipe file will block until more input is |
3156 | added. | 3158 | added. This is contrary to the trace file. If any process opened |
3159 | the trace file for reading, it will actually disable tracing and | ||
3160 | prevent new entries from being added. The trace_pipe file does | ||
3161 | not have this limitation. | ||
3157 | 3162 | ||
3158 | trace entries | 3163 | trace entries |
3159 | ------------- | 3164 | ------------- |
diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst index 6b4107cf4b98..b7891cb1ab4d 100644 --- a/Documentation/trace/index.rst +++ b/Documentation/trace/index.rst | |||
@@ -23,3 +23,5 @@ Linux Tracing Technologies | |||
23 | intel_th | 23 | intel_th |
24 | stm | 24 | stm |
25 | sys-t | 25 | sys-t |
26 | coresight | ||
27 | coresight-cpu-debug | ||
diff --git a/Documentation/translations/it_IT/process/changes.rst b/Documentation/translations/it_IT/process/changes.rst index d0874327f301..94a6499742ac 100644 --- a/Documentation/translations/it_IT/process/changes.rst +++ b/Documentation/translations/it_IT/process/changes.rst | |||
@@ -26,16 +26,15 @@ Prima di pensare d'avere trovato un baco, aggiornate i seguenti programmi | |||
26 | usando, il comando indicato dovrebbe dirvelo. | 26 | usando, il comando indicato dovrebbe dirvelo. |
27 | 27 | ||
28 | Questa lista presume che abbiate già un kernel Linux funzionante. In aggiunta, | 28 | Questa lista presume che abbiate già un kernel Linux funzionante. In aggiunta, |
29 | non tutti gli strumenti sono necessari ovunque; ovviamente, se non avete un | 29 | non tutti gli strumenti sono necessari ovunque; ovviamente, se non avete una |
30 | modem ISDN, per esempio, probabilmente non dovreste preoccuparvi di | 30 | PC Card, per esempio, probabilmente non dovreste preoccuparvi di pcmciautils. |
31 | isdn4k-utils. | ||
32 | 31 | ||
33 | ====================== ================= ======================================== | 32 | ====================== ================= ======================================== |
34 | Programma Versione minima Comando per verificare la versione | 33 | Programma Versione minima Comando per verificare la versione |
35 | ====================== ================= ======================================== | 34 | ====================== ================= ======================================== |
36 | GNU C 4.6 gcc --version | 35 | GNU C 4.6 gcc --version |
37 | GNU make 3.81 make --version | 36 | GNU make 3.81 make --version |
38 | binutils 2.20 ld -v | 37 | binutils 2.21 ld -v |
39 | flex 2.5.35 flex --version | 38 | flex 2.5.35 flex --version |
40 | bison 2.0 bison --version | 39 | bison 2.0 bison --version |
41 | util-linux 2.10o fdformat --version | 40 | util-linux 2.10o fdformat --version |
@@ -49,7 +48,6 @@ btrfs-progs 0.18 btrfsck | |||
49 | pcmciautils 004 pccardctl -V | 48 | pcmciautils 004 pccardctl -V |
50 | quota-tools 3.09 quota -V | 49 | quota-tools 3.09 quota -V |
51 | PPP 2.4.0 pppd --version | 50 | PPP 2.4.0 pppd --version |
52 | isdn4k-utils 3.1pre1 isdnctrl 2>&1|grep version | ||
53 | nfs-utils 1.0.5 showmount --version | 51 | nfs-utils 1.0.5 showmount --version |
54 | procps 3.2.0 ps --version | 52 | procps 3.2.0 ps --version |
55 | oprofile 0.9 oprofiled --version | 53 | oprofile 0.9 oprofiled --version |
@@ -81,10 +79,7 @@ Per compilare il kernel vi servirà GNU make 3.81 o successivo. | |||
81 | Binutils | 79 | Binutils |
82 | -------- | 80 | -------- |
83 | 81 | ||
84 | Il sistema di compilazione, dalla versione 4.13, per la produzione dei passi | 82 | Per generare il kernel è necessario avere Binutils 2.21 o superiore. |
85 | intermedi, si è convertito all'uso di *thin archive* (`ar T`) piuttosto che | ||
86 | all'uso del *linking* incrementale (`ld -r`). Questo richiede binutils 2.20 o | ||
87 | successivo. | ||
88 | 83 | ||
89 | pkg-config | 84 | pkg-config |
90 | ---------- | 85 | ---------- |
@@ -286,11 +281,6 @@ col seguente comando:: | |||
286 | 281 | ||
287 | mknod /dev/ppp c 108 0 | 282 | mknod /dev/ppp c 108 0 |
288 | 283 | ||
289 | Isdn4k-utils | ||
290 | ------------ | ||
291 | |||
292 | Per via della modifica del campo per il numero di telefono, il pacchetto | ||
293 | isdn4k-utils dev'essere ricompilato o (preferibilmente) aggiornato. | ||
294 | 284 | ||
295 | NFS-utils | 285 | NFS-utils |
296 | --------- | 286 | --------- |
@@ -456,10 +446,6 @@ PPP | |||
456 | 446 | ||
457 | - <ftp://ftp.samba.org/pub/ppp/> | 447 | - <ftp://ftp.samba.org/pub/ppp/> |
458 | 448 | ||
459 | Isdn4k-utils | ||
460 | ------------ | ||
461 | |||
462 | - <ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/> | ||
463 | 449 | ||
464 | NFS-utils | 450 | NFS-utils |
465 | --------- | 451 | --------- |
diff --git a/Documentation/translations/it_IT/process/howto.rst b/Documentation/translations/it_IT/process/howto.rst index 44e6077730e8..1db5a1082389 100644 --- a/Documentation/translations/it_IT/process/howto.rst +++ b/Documentation/translations/it_IT/process/howto.rst | |||
@@ -129,7 +129,7 @@ Di seguito una lista di file che sono presenti nei sorgente del kernel e che | |||
129 | https://www.ozlabs.org/~akpm/stuff/tpp.txt | 129 | https://www.ozlabs.org/~akpm/stuff/tpp.txt |
130 | 130 | ||
131 | "Linux kernel patch submission format" | 131 | "Linux kernel patch submission format" |
132 | http://linux.yyz.us/patch-format.html | 132 | https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html |
133 | 133 | ||
134 | :ref:`Documentation/translations/it_IT/process/stable-api-nonsense.rst <it_stable_api_nonsense>` | 134 | :ref:`Documentation/translations/it_IT/process/stable-api-nonsense.rst <it_stable_api_nonsense>` |
135 | 135 | ||
diff --git a/Documentation/translations/it_IT/process/submitting-patches.rst b/Documentation/translations/it_IT/process/submitting-patches.rst index 7d7ea92c5c5a..cba1f8cb61ed 100644 --- a/Documentation/translations/it_IT/process/submitting-patches.rst +++ b/Documentation/translations/it_IT/process/submitting-patches.rst | |||
@@ -868,7 +868,7 @@ Andrew Morton, "La patch perfetta" (tpp). | |||
868 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> | 868 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> |
869 | 869 | ||
870 | Jeff Garzik, "Formato per la sottomissione di patch per il kernel Linux" | 870 | Jeff Garzik, "Formato per la sottomissione di patch per il kernel Linux" |
871 | <http://linux.yyz.us/patch-format.html> | 871 | <https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html> |
872 | 872 | ||
873 | Greg Kroah-Hartman, "Come scocciare un manutentore di un sottosistema" | 873 | Greg Kroah-Hartman, "Come scocciare un manutentore di un sottosistema" |
874 | <http://www.kroah.com/log/linux/maintainer.html> | 874 | <http://www.kroah.com/log/linux/maintainer.html> |
diff --git a/Documentation/translations/ja_JP/SubmittingPatches b/Documentation/translations/ja_JP/SubmittingPatches index ad979c3c06a6..dd0c3280ba5a 100644 --- a/Documentation/translations/ja_JP/SubmittingPatches +++ b/Documentation/translations/ja_JP/SubmittingPatches | |||
@@ -693,7 +693,7 @@ Andrew Morton, "The perfect patch" (tpp). | |||
693 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> | 693 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> |
694 | 694 | ||
695 | Jeff Garzik, "Linux kernel patch submission format". | 695 | Jeff Garzik, "Linux kernel patch submission format". |
696 | <http://linux.yyz.us/patch-format.html> | 696 | <https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html> |
697 | 697 | ||
698 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". | 698 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". |
699 | <http://www.kroah.com/log/2005/03/31/> | 699 | <http://www.kroah.com/log/2005/03/31/> |
diff --git a/Documentation/translations/ja_JP/howto.rst b/Documentation/translations/ja_JP/howto.rst index 2621b770a745..73ebdab4ced7 100644 --- a/Documentation/translations/ja_JP/howto.rst +++ b/Documentation/translations/ja_JP/howto.rst | |||
@@ -139,7 +139,7 @@ linux-api@vger.kernel.org ã«é€ã‚‹ã“ã¨ã‚’å‹§ã‚ã¾ã™ã€‚ | |||
139 | "The Perfect Patch" | 139 | "The Perfect Patch" |
140 | http://www.ozlabs.org/~akpm/stuff/tpp.txt | 140 | http://www.ozlabs.org/~akpm/stuff/tpp.txt |
141 | "Linux kernel patch submission format" | 141 | "Linux kernel patch submission format" |
142 | http://linux.yyz.us/patch-format.html | 142 | https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html |
143 | 143 | ||
144 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` | 144 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` |
145 | ã“ã®ãƒ•ァイルã¯ã‚«ãƒ¼ãƒãƒ«ã®ä¸ã«ä¸å¤‰ã® API ã‚’æŒãŸãªã„ã“ã¨ã«ã—ãŸæ„è˜çš„ | 145 | ã“ã®ãƒ•ァイルã¯ã‚«ãƒ¼ãƒãƒ«ã®ä¸ã«ä¸å¤‰ã® API ã‚’æŒãŸãªã„ã“ã¨ã«ã—ãŸæ„è˜çš„ |
diff --git a/Documentation/translations/ko_KR/howto.rst b/Documentation/translations/ko_KR/howto.rst index bcd63731b80a..b3f51b19de7c 100644 --- a/Documentation/translations/ko_KR/howto.rst +++ b/Documentation/translations/ko_KR/howto.rst | |||
@@ -135,7 +135,7 @@ mtk.manpages@gmail.comì˜ ë©”ì¸í…Œì´ë„ˆì—게 보낼 ê²ƒì„ ê¶Œìž¥í•œë‹¤. | |||
135 | https://www.ozlabs.org/~akpm/stuff/tpp.txt | 135 | https://www.ozlabs.org/~akpm/stuff/tpp.txt |
136 | 136 | ||
137 | "Linux kernel patch submission format" | 137 | "Linux kernel patch submission format" |
138 | http://linux.yyz.us/patch-format.html | 138 | https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html |
139 | 139 | ||
140 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` | 140 | :ref:`Documentation/process/stable-api-nonsense.rst <stable_api_nonsense>` |
141 | ì´ ë¬¸ì„œëŠ” ì˜ë„ì 으로 커ë„ì´ ë¶ˆë³€í•˜ëŠ” API를 ê°–ì§€ 않ë„ë¡ ê²°ì •í•œ | 141 | ì´ ë¬¸ì„œëŠ” ì˜ë„ì 으로 커ë„ì´ ë¶ˆë³€í•˜ëŠ” API를 ê°–ì§€ 않ë„ë¡ ê²°ì •í•œ |
diff --git a/Documentation/translations/zh_CN/arm64/booting.txt b/Documentation/translations/zh_CN/arm64/booting.txt index 4e373d128d98..5b0164132c71 100644 --- a/Documentation/translations/zh_CN/arm64/booting.txt +++ b/Documentation/translations/zh_CN/arm64/booting.txt | |||
@@ -67,8 +67,8 @@ RAM,或å¯èƒ½ä½¿ç”¨å¯¹è¿™ä¸ªè®¾å¤‡å·²çŸ¥çš„ RAM ä¿¡æ¯ï¼Œè¿˜å¯èƒ½æ˜¯å¼•导装 | |||
67 | å¿…è¦æ€§: 强制 | 67 | å¿…è¦æ€§: 强制 |
68 | 68 | ||
69 | è®¾å¤‡æ ‘æ•°æ®å—(dtb)必须 8 å—节对é½ï¼Œä¸”大å°ä¸èƒ½è¶…过 2MBã€‚ç”±äºŽè®¾å¤‡æ ‘ | 69 | è®¾å¤‡æ ‘æ•°æ®å—(dtb)必须 8 å—节对é½ï¼Œä¸”大å°ä¸èƒ½è¶…过 2MBã€‚ç”±äºŽè®¾å¤‡æ ‘ |
70 | æ•°æ®å—将在使能缓å˜çš„æƒ…况下以 2MB ç²’åº¦è¢«æ˜ å°„ï¼Œæ•…å…¶ä¸èƒ½è¢«ç½®äºŽå¸¦ä»»æ„ | 70 | æ•°æ®å—将在使能缓å˜çš„æƒ…况下以 2MB ç²’åº¦è¢«æ˜ å°„ï¼Œæ•…å…¶ä¸èƒ½è¢«ç½®äºŽå¿…须以特定 |
71 | ç‰¹å®šå±žæ€§è¢«æ˜ å°„çš„ 2MB 区域内。 | 71 | å±žæ€§æ˜ å°„çš„2M区域内。 |
72 | 72 | ||
73 | 注: v4.2 之å‰çš„ç‰ˆæœ¬åŒæ—¶è¦æ±‚è®¾å¤‡æ ‘æ•°æ®å—è¢«ç½®äºŽä»Žå†…æ ¸æ˜ åƒä»¥ä¸‹ | 73 | 注: v4.2 之å‰çš„ç‰ˆæœ¬åŒæ—¶è¦æ±‚è®¾å¤‡æ ‘æ•°æ®å—è¢«ç½®äºŽä»Žå†…æ ¸æ˜ åƒä»¥ä¸‹ |
74 | text_offset å—节处算起第一个 512MB 内。 | 74 | text_offset å—节处算起第一个 512MB 内。 |
diff --git a/Documentation/translations/zh_CN/process/howto.rst b/Documentation/translations/zh_CN/process/howto.rst index 5b671178b17b..a8e6ab818983 100644 --- a/Documentation/translations/zh_CN/process/howto.rst +++ b/Documentation/translations/zh_CN/process/howto.rst | |||
@@ -113,7 +113,7 @@ Linuxå†…æ ¸ä»£ç ä¸åŒ…嫿œ‰å¤§é‡çš„æ–‡æ¡£ã€‚这些文档对于å¦ä¹ 如何与 | |||
113 | 113 | ||
114 | "Linux kernel patch submission format" | 114 | "Linux kernel patch submission format" |
115 | 115 | ||
116 | http://linux.yyz.us/patch-format.html | 116 | https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html |
117 | 117 | ||
118 | :ref:`Documentation/translations/zh_CN/process/stable-api-nonsense.rst <cn_stable_api_nonsense>` | 118 | :ref:`Documentation/translations/zh_CN/process/stable-api-nonsense.rst <cn_stable_api_nonsense>` |
119 | 论è¯å†…æ ¸ä¸ºä»€ä¹ˆç‰¹æ„ä¸åŒ…æ‹¬ç¨³å®šçš„å†…æ ¸å†…éƒ¨API,也就是说ä¸åŒ…括åƒè¿™æ ·çš„特 | 119 | 论è¯å†…æ ¸ä¸ºä»€ä¹ˆç‰¹æ„ä¸åŒ…æ‹¬ç¨³å®šçš„å†…æ ¸å†…éƒ¨API,也就是说ä¸åŒ…括åƒè¿™æ ·çš„特 |
@@ -146,14 +146,18 @@ Linuxå†…æ ¸ä»£ç ä¸åŒ…嫿œ‰å¤§é‡çš„æ–‡æ¡£ã€‚这些文档对于å¦ä¹ 如何与 | |||
146 | :ref:`Documentation/process/applying-patches.rst <applying_patches>` | 146 | :ref:`Documentation/process/applying-patches.rst <applying_patches>` |
147 | å…³äºŽè¡¥ä¸æ˜¯ä»€ä¹ˆä»¥åŠå¦‚何将它打在ä¸åŒå†…æ ¸å¼€å‘åˆ†æ”¯ä¸Šçš„å¥½ä»‹ç» | 147 | å…³äºŽè¡¥ä¸æ˜¯ä»€ä¹ˆä»¥åŠå¦‚何将它打在ä¸åŒå†…æ ¸å¼€å‘åˆ†æ”¯ä¸Šçš„å¥½ä»‹ç» |
148 | 148 | ||
149 | å†…æ ¸è¿˜æ‹¥æœ‰å¤§é‡ä»Žä»£ç 自动生æˆçš„æ–‡æ¡£ã€‚它包å«å†…æ ¸å†…éƒ¨API的全é¢ä»‹ç»ä»¥åŠå¦‚何 | 149 | å†…æ ¸è¿˜æ‹¥æœ‰å¤§é‡ä»Žä»£ç è‡ªåŠ¨ç”Ÿæˆæˆ–者从 ReStructuredText(ReST) æ ‡è®°ç”Ÿæˆçš„æ–‡æ¡£ï¼Œ |
150 | 妥善处ç†åŠ é”的规则。生æˆçš„æ–‡æ¡£ä¼šæ”¾åœ¨ Documentation/DocBook/目录下。在内 | 150 | 比如这个文档,它包å«å†…æ ¸å†…éƒ¨API的全é¢ä»‹ç»ä»¥åŠå¦‚何妥善处ç†åŠ é”的规则。所有 |
151 | æ ¸æºç 的主目录ä¸ä½¿ç”¨ä»¥ä¸‹ä¸åŒå‘½ä»¤å°†ä¼šåˆ†åˆ«ç”ŸæˆPDFã€Postscriptã€HTML和手册 | 151 | 这些文档都å¯ä»¥é€šè¿‡è¿è¡Œä»¥ä¸‹å‘½ä»¤ä»Žå†…æ ¸ä»£ç ä¸ç”Ÿæˆä¸ºPDF或HTML文档:: |
152 | 页ç‰ä¸åŒæ ¼å¼çš„æ–‡æ¡£:: | ||
153 | 152 | ||
154 | make pdfdocs | 153 | make pdfdocs |
155 | make htmldocs | 154 | make htmldocs |
156 | 155 | ||
156 | ReSTæ ¼å¼çš„æ–‡æ¡£ä¼šç”Ÿæˆåœ¨ Documentation/output. 目录ä¸ã€‚ | ||
157 | 它们也å¯ä»¥ç”¨ä¸‹åˆ—å‘½ä»¤ç”Ÿæˆ LaTeX å’Œ ePub æ ¼å¼æ–‡æ¡£:: | ||
158 | |||
159 | make latexdocs | ||
160 | make epubdocs | ||
157 | 161 | ||
158 | 如何æˆä¸ºå†…æ ¸å¼€å‘者 | 162 | 如何æˆä¸ºå†…æ ¸å¼€å‘者 |
159 | ------------------ | 163 | ------------------ |
diff --git a/Documentation/translations/zh_CN/process/submitting-patches.rst b/Documentation/translations/zh_CN/process/submitting-patches.rst index 437c23b367bb..1bb4271ab420 100644 --- a/Documentation/translations/zh_CN/process/submitting-patches.rst +++ b/Documentation/translations/zh_CN/process/submitting-patches.rst | |||
@@ -652,7 +652,7 @@ Andrew Morton, "The perfect patch" (tpp). | |||
652 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> | 652 | <http://www.ozlabs.org/~akpm/stuff/tpp.txt> |
653 | 653 | ||
654 | Jeff Garzik, "Linux kernel patch submission format". | 654 | Jeff Garzik, "Linux kernel patch submission format". |
655 | <http://linux.yyz.us/patch-format.html> | 655 | <https://web.archive.org/web/20180829112450/http://linux.yyz.us/patch-format.html> |
656 | 656 | ||
657 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". | 657 | Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". |
658 | <http://www.kroah.com/log/linux/maintainer.html> | 658 | <http://www.kroah.com/log/linux/maintainer.html> |
diff --git a/Documentation/w1/index.rst b/Documentation/w1/index.rst new file mode 100644 index 000000000000..57cba81865e2 --- /dev/null +++ b/Documentation/w1/index.rst | |||
@@ -0,0 +1,21 @@ | |||
1 | . SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ================ | ||
4 | 1-Wire Subsystem | ||
5 | ================ | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | |||
11 | w1-generic.rst | ||
12 | w1-netlink.rst | ||
13 | masters/index | ||
14 | slaves/index | ||
15 | |||
16 | .. only:: subproject and html | ||
17 | |||
18 | Indices | ||
19 | ======= | ||
20 | |||
21 | * :ref:`genindex` | ||
diff --git a/Documentation/w1/masters/ds2482 b/Documentation/w1/masters/ds2482.rst index 56f8edace6ac..17ebe8f660cd 100644 --- a/Documentation/w1/masters/ds2482 +++ b/Documentation/w1/masters/ds2482.rst | |||
@@ -1,13 +1,19 @@ | |||
1 | ==================== | ||
1 | Kernel driver ds2482 | 2 | Kernel driver ds2482 |
2 | ==================== | 3 | ==================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS2482-100, Maxim DS2482-800 | 7 | * Maxim DS2482-100, Maxim DS2482-800 |
8 | |||
6 | Prefix: 'ds2482' | 9 | Prefix: 'ds2482' |
10 | |||
7 | Addresses scanned: None | 11 | Addresses scanned: None |
12 | |||
8 | Datasheets: | 13 | Datasheets: |
9 | http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf | 14 | |
10 | http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf | 15 | - http://datasheets.maxim-ic.com/en/ds/DS2482-100.pdf |
16 | - http://datasheets.maxim-ic.com/en/ds/DS2482-800.pdf | ||
11 | 17 | ||
12 | Author: Ben Gardner <bgardner@wabtec.com> | 18 | Author: Ben Gardner <bgardner@wabtec.com> |
13 | 19 | ||
@@ -23,9 +29,11 @@ General Remarks | |||
23 | --------------- | 29 | --------------- |
24 | 30 | ||
25 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. | 31 | Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. |
32 | |||
26 | However, the device cannot be detected without writing to the i2c bus, so no | 33 | However, the device cannot be detected without writing to the i2c bus, so no |
27 | detection is done. You should instantiate the device explicitly. | 34 | detection is done. You should instantiate the device explicitly. |
28 | 35 | ||
29 | $ modprobe ds2482 | 36 | :: |
30 | $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device | ||
31 | 37 | ||
38 | $ modprobe ds2482 | ||
39 | $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device | ||
diff --git a/Documentation/w1/masters/ds2490 b/Documentation/w1/masters/ds2490.rst index 3e091151dd80..7e5b50f9c0f5 100644 --- a/Documentation/w1/masters/ds2490 +++ b/Documentation/w1/masters/ds2490.rst | |||
@@ -1,7 +1,9 @@ | |||
1 | ==================== | ||
1 | Kernel driver ds2490 | 2 | Kernel driver ds2490 |
2 | ==================== | 3 | ==================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS2490 based | 7 | * Maxim DS2490 based |
6 | 8 | ||
7 | Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 9 | Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> |
@@ -18,6 +20,7 @@ which has 0x81 family ID integrated chip and DS2490 | |||
18 | low-level operational chip. | 20 | low-level operational chip. |
19 | 21 | ||
20 | Notes and limitations. | 22 | Notes and limitations. |
23 | |||
21 | - The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA. | 24 | - The weak pullup current is a minimum of 0.9mA and maximum of 6.0mA. |
22 | - The 5V strong pullup is supported with a minimum of 5.9mA and a | 25 | - The 5V strong pullup is supported with a minimum of 5.9mA and a |
23 | maximum of 30.4 mA. (From DS2490.pdf) | 26 | maximum of 30.4 mA. (From DS2490.pdf) |
@@ -65,4 +68,5 @@ Notes and limitations. | |||
65 | reattaching would clear the problem. usbmon output in the guest and | 68 | reattaching would clear the problem. usbmon output in the guest and |
66 | host did not explain the problem. My guess is a bug in either qemu | 69 | host did not explain the problem. My guess is a bug in either qemu |
67 | or the host OS and more likely the host OS. | 70 | or the host OS and more likely the host OS. |
68 | -- 03-06-2008 David Fries <David@Fries.net> | 71 | |
72 | 03-06-2008 David Fries <David@Fries.net> | ||
diff --git a/Documentation/w1/masters/index.rst b/Documentation/w1/masters/index.rst new file mode 100644 index 000000000000..4442a98850ad --- /dev/null +++ b/Documentation/w1/masters/index.rst | |||
@@ -0,0 +1,14 @@ | |||
1 | . SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ===================== | ||
4 | 1-wire Master Drivers | ||
5 | ===================== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | ds2482 | ||
11 | ds2490 | ||
12 | mxc-w1 | ||
13 | omap-hdq | ||
14 | w1-gpio | ||
diff --git a/Documentation/w1/masters/mxc-w1 b/Documentation/w1/masters/mxc-w1 deleted file mode 100644 index 38be1ad65532..000000000000 --- a/Documentation/w1/masters/mxc-w1 +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | Kernel driver mxc_w1 | ||
2 | ==================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Freescale MX27, MX31 and probably other i.MX SoCs | ||
6 | Datasheets: | ||
7 | http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1 | ||
8 | http://cache.freescale.com/files/dsp/doc/archive/MCIMX27.pdf?fsrch=1&WT_TYPE= | ||
9 | Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation | ||
10 | |||
11 | Author: Originally based on Freescale code, prepared for mainline by | ||
12 | Sascha Hauer <s.hauer@pengutronix.de> | ||
diff --git a/Documentation/w1/masters/mxc-w1.rst b/Documentation/w1/masters/mxc-w1.rst new file mode 100644 index 000000000000..334f9893103f --- /dev/null +++ b/Documentation/w1/masters/mxc-w1.rst | |||
@@ -0,0 +1,17 @@ | |||
1 | ==================== | ||
2 | Kernel driver mxc_w1 | ||
3 | ==================== | ||
4 | |||
5 | Supported chips: | ||
6 | |||
7 | * Freescale MX27, MX31 and probably other i.MX SoCs | ||
8 | |||
9 | Datasheets: | ||
10 | |||
11 | - http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1 | ||
12 | - http://cache.freescale.com/files/dsp/doc/archive/MCIMX27.pdf?fsrch=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation | ||
13 | |||
14 | Author: | ||
15 | |||
16 | Originally based on Freescale code, prepared for mainline by | ||
17 | Sascha Hauer <s.hauer@pengutronix.de> | ||
diff --git a/Documentation/w1/masters/omap-hdq b/Documentation/w1/masters/omap-hdq.rst index 234522709a5f..345298a59e50 100644 --- a/Documentation/w1/masters/omap-hdq +++ b/Documentation/w1/masters/omap-hdq.rst | |||
@@ -1,9 +1,10 @@ | |||
1 | Kernel driver for omap HDQ/1-wire module. | 1 | ======================================== |
2 | Kernel driver for omap HDQ/1-wire module | ||
2 | ======================================== | 3 | ======================================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
5 | ================ | 6 | ================ |
6 | HDQ/1-wire controller on the TI OMAP 2430/3430 platforms. | 7 | HDQ/1-wire controller on the TI OMAP 2430/3430 platforms. |
7 | 8 | ||
8 | A useful link about HDQ basics: | 9 | A useful link about HDQ basics: |
9 | =============================== | 10 | =============================== |
@@ -40,9 +41,10 @@ driver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1. | |||
40 | Please note to load both the modules with a different ID if required, but note | 41 | Please note to load both the modules with a different ID if required, but note |
41 | that the ID used should be same for both master and slave driver loading. | 42 | that the ID used should be same for both master and slave driver loading. |
42 | 43 | ||
43 | e.g: | 44 | e.g:: |
44 | insmod omap_hdq.ko W1_ID=2 | 45 | |
45 | inamod w1_bq27000.ko F_ID=2 | 46 | insmod omap_hdq.ko W1_ID=2 |
47 | inamod w1_bq27000.ko F_ID=2 | ||
46 | 48 | ||
47 | The driver also supports 1-wire mode. In this mode, there is no need to | 49 | The driver also supports 1-wire mode. In this mode, there is no need to |
48 | pass slave ID as parameter. The driver will auto-detect slaves connected | 50 | pass slave ID as parameter. The driver will auto-detect slaves connected |
diff --git a/Documentation/w1/masters/w1-gpio b/Documentation/w1/masters/w1-gpio.rst index 623961d9e83f..18fdb7366372 100644 --- a/Documentation/w1/masters/w1-gpio +++ b/Documentation/w1/masters/w1-gpio.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ===================== | ||
1 | Kernel driver w1-gpio | 2 | Kernel driver w1-gpio |
2 | ===================== | 3 | ===================== |
3 | 4 | ||
@@ -16,28 +17,30 @@ Documentation/devicetree/bindings/w1/w1-gpio.txt | |||
16 | Example (mach-at91) | 17 | Example (mach-at91) |
17 | ------------------- | 18 | ------------------- |
18 | 19 | ||
19 | #include <linux/gpio/machine.h> | 20 | :: |
20 | #include <linux/w1-gpio.h> | 21 | |
22 | #include <linux/gpio/machine.h> | ||
23 | #include <linux/w1-gpio.h> | ||
21 | 24 | ||
22 | static struct gpiod_lookup_table foo_w1_gpiod_table = { | 25 | static struct gpiod_lookup_table foo_w1_gpiod_table = { |
23 | .dev_id = "w1-gpio", | 26 | .dev_id = "w1-gpio", |
24 | .table = { | 27 | .table = { |
25 | GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0, | 28 | GPIO_LOOKUP_IDX("at91-gpio", AT91_PIN_PB20, NULL, 0, |
26 | GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN), | 29 | GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN), |
27 | }, | 30 | }, |
28 | }; | 31 | }; |
29 | 32 | ||
30 | static struct w1_gpio_platform_data foo_w1_gpio_pdata = { | 33 | static struct w1_gpio_platform_data foo_w1_gpio_pdata = { |
31 | .ext_pullup_enable_pin = -EINVAL, | 34 | .ext_pullup_enable_pin = -EINVAL, |
32 | }; | 35 | }; |
33 | 36 | ||
34 | static struct platform_device foo_w1_device = { | 37 | static struct platform_device foo_w1_device = { |
35 | .name = "w1-gpio", | 38 | .name = "w1-gpio", |
36 | .id = -1, | 39 | .id = -1, |
37 | .dev.platform_data = &foo_w1_gpio_pdata, | 40 | .dev.platform_data = &foo_w1_gpio_pdata, |
38 | }; | 41 | }; |
39 | 42 | ||
40 | ... | 43 | ... |
41 | at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1); | 44 | at91_set_GPIO_periph(foo_w1_gpio_pdata.pin, 1); |
42 | at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1); | 45 | at91_set_multi_drive(foo_w1_gpio_pdata.pin, 1); |
43 | gpiod_add_lookup_table(&foo_w1_gpiod_table); | 46 | gpiod_add_lookup_table(&foo_w1_gpiod_table); |
diff --git a/Documentation/w1/slaves/index.rst b/Documentation/w1/slaves/index.rst new file mode 100644 index 000000000000..d0697b202f09 --- /dev/null +++ b/Documentation/w1/slaves/index.rst | |||
@@ -0,0 +1,16 @@ | |||
1 | . SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ==================== | ||
4 | 1-wire Slave Drivers | ||
5 | ==================== | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 1 | ||
9 | |||
10 | w1_ds2406 | ||
11 | w1_ds2413 | ||
12 | w1_ds2423 | ||
13 | w1_ds2438 | ||
14 | w1_ds28e04 | ||
15 | w1_ds28e17 | ||
16 | w1_therm | ||
diff --git a/Documentation/w1/slaves/w1_ds2406 b/Documentation/w1/slaves/w1_ds2406.rst index 8137fe6f6c3d..d3e68266084f 100644 --- a/Documentation/w1/slaves/w1_ds2406 +++ b/Documentation/w1/slaves/w1_ds2406.rst | |||
@@ -1,7 +1,9 @@ | |||
1 | ======================= | ||
1 | w1_ds2406 kernel driver | 2 | w1_ds2406 kernel driver |
2 | ======================= | 3 | ======================= |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS2406 (and other family 0x12) addressable switches | 7 | * Maxim DS2406 (and other family 0x12) addressable switches |
6 | 8 | ||
7 | Author: Scott Alfter <scott@alfter.us> | 9 | Author: Scott Alfter <scott@alfter.us> |
@@ -9,7 +11,7 @@ Author: Scott Alfter <scott@alfter.us> | |||
9 | Description | 11 | Description |
10 | ----------- | 12 | ----------- |
11 | 13 | ||
12 | The w1_ds2406 driver allows connected devices to be switched on and off. | 14 | The w1_ds2406 driver allows connected devices to be switched on and off. |
13 | These chips also provide 128 bytes of OTP EPROM, but reading/writing it is | 15 | These chips also provide 128 bytes of OTP EPROM, but reading/writing it is |
14 | not supported. In TSOC-6 form, the DS2406 provides two switch outputs and | 16 | not supported. In TSOC-6 form, the DS2406 provides two switch outputs and |
15 | can be provided with power on a dedicated input. In TO-92 form, it provides | 17 | can be provided with power on a dedicated input. In TO-92 form, it provides |
diff --git a/Documentation/w1/slaves/w1_ds2413 b/Documentation/w1/slaves/w1_ds2413.rst index 936263a8ccb4..c15bb5b919b7 100644 --- a/Documentation/w1/slaves/w1_ds2413 +++ b/Documentation/w1/slaves/w1_ds2413.rst | |||
@@ -1,11 +1,16 @@ | |||
1 | ======================= | ||
1 | Kernel driver w1_ds2413 | 2 | Kernel driver w1_ds2413 |
2 | ======================= | 3 | ======================= |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS2413 1-Wire Dual Channel Addressable Switch | 7 | * Maxim DS2413 1-Wire Dual Channel Addressable Switch |
6 | 8 | ||
7 | supported family codes: | 9 | supported family codes: |
10 | |||
11 | ================ ==== | ||
8 | W1_FAMILY_DS2413 0x3A | 12 | W1_FAMILY_DS2413 0x3A |
13 | ================ ==== | ||
9 | 14 | ||
10 | Author: Mariusz Bialonczyk <manio@skyboo.net> | 15 | Author: Mariusz Bialonczyk <manio@skyboo.net> |
11 | 16 | ||
@@ -20,11 +25,13 @@ Reading state | |||
20 | The "state" file provides one-byte value which is in the same format as for | 25 | The "state" file provides one-byte value which is in the same format as for |
21 | the chip PIO_ACCESS_READ command (refer the datasheet for details): | 26 | the chip PIO_ACCESS_READ command (refer the datasheet for details): |
22 | 27 | ||
28 | ======== ============================================================= | ||
23 | Bit 0: PIOA Pin State | 29 | Bit 0: PIOA Pin State |
24 | Bit 1: PIOA Output Latch State | 30 | Bit 1: PIOA Output Latch State |
25 | Bit 2: PIOB Pin State | 31 | Bit 2: PIOB Pin State |
26 | Bit 3: PIOB Output Latch State | 32 | Bit 3: PIOB Output Latch State |
27 | Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) | 33 | Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) |
34 | ======== ============================================================= | ||
28 | 35 | ||
29 | This file is readonly. | 36 | This file is readonly. |
30 | 37 | ||
@@ -34,9 +41,11 @@ You can set the PIO pins using the "output" file. | |||
34 | It is writable, you can write one-byte value to this sysfs file. | 41 | It is writable, you can write one-byte value to this sysfs file. |
35 | Similarly the byte format is the same as for the PIO_ACCESS_WRITE command: | 42 | Similarly the byte format is the same as for the PIO_ACCESS_WRITE command: |
36 | 43 | ||
44 | ======== ====================================== | ||
37 | Bit 0: PIOA | 45 | Bit 0: PIOA |
38 | Bit 1: PIOB | 46 | Bit 1: PIOB |
39 | Bit 2-7: No matter (driver will set it to "1"s) | 47 | Bit 2-7: No matter (driver will set it to "1"s) |
48 | ======== ====================================== | ||
40 | 49 | ||
41 | 50 | ||
42 | The chip has some kind of basic protection against transmission errors. | 51 | The chip has some kind of basic protection against transmission errors. |
diff --git a/Documentation/w1/slaves/w1_ds2423 b/Documentation/w1/slaves/w1_ds2423 deleted file mode 100644 index 3f98b505a0ee..000000000000 --- a/Documentation/w1/slaves/w1_ds2423 +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | Kernel driver w1_ds2423 | ||
2 | ======================= | ||
3 | |||
4 | Supported chips: | ||
5 | * Maxim DS2423 based counter devices. | ||
6 | |||
7 | supported family codes: | ||
8 | W1_THERM_DS2423 0x1D | ||
9 | |||
10 | Author: Mika Laitio <lamikr@pilppa.org> | ||
11 | |||
12 | Description | ||
13 | ----------- | ||
14 | |||
15 | Support is provided through the sysfs w1_slave file. Each opening and | ||
16 | read sequence of w1_slave file initiates the read of counters and ram | ||
17 | available in DS2423 pages 12 - 15. | ||
18 | |||
19 | Result of each page is provided as an ASCII output where each counter | ||
20 | value and associated ram buffer is outpputed to own line. | ||
21 | |||
22 | Each lines will contain the values of 42 bytes read from the counter and | ||
23 | memory page along the crc=YES or NO for indicating whether the read operation | ||
24 | was successful and CRC matched. | ||
25 | If the operation was successful, there is also in the end of each line | ||
26 | a counter value expressed as an integer after c= | ||
27 | |||
28 | Meaning of 42 bytes represented is following: | ||
29 | - 1 byte from ram page | ||
30 | - 4 bytes for the counter value | ||
31 | - 4 zero bytes | ||
32 | - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes | ||
33 | - 31 remaining bytes from the ram page | ||
34 | - crc=YES/NO indicating whether read was ok and crc matched | ||
35 | - c=<int> current counter value | ||
36 | |||
37 | example from the successful read: | ||
38 | 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
39 | 00 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
40 | 00 29 c6 5d 18 00 00 00 00 04 37 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761 | ||
41 | 00 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5 | ||
42 | |||
43 | example from the read with crc errors: | ||
44 | 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
45 | 00 02 00 00 22 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO | ||
46 | 00 e1 61 5d 19 00 00 00 00 df 0b 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO | ||
47 | 00 05 00 00 20 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=NO | ||
diff --git a/Documentation/w1/slaves/w1_ds2423.rst b/Documentation/w1/slaves/w1_ds2423.rst new file mode 100644 index 000000000000..755d659ad997 --- /dev/null +++ b/Documentation/w1/slaves/w1_ds2423.rst | |||
@@ -0,0 +1,54 @@ | |||
1 | Kernel driver w1_ds2423 | ||
2 | ======================= | ||
3 | |||
4 | Supported chips: | ||
5 | |||
6 | * Maxim DS2423 based counter devices. | ||
7 | |||
8 | supported family codes: | ||
9 | |||
10 | =============== ==== | ||
11 | W1_THERM_DS2423 0x1D | ||
12 | =============== ==== | ||
13 | |||
14 | Author: Mika Laitio <lamikr@pilppa.org> | ||
15 | |||
16 | Description | ||
17 | ----------- | ||
18 | |||
19 | Support is provided through the sysfs w1_slave file. Each opening and | ||
20 | read sequence of w1_slave file initiates the read of counters and ram | ||
21 | available in DS2423 pages 12 - 15. | ||
22 | |||
23 | Result of each page is provided as an ASCII output where each counter | ||
24 | value and associated ram buffer is outpputed to own line. | ||
25 | |||
26 | Each lines will contain the values of 42 bytes read from the counter and | ||
27 | memory page along the crc=YES or NO for indicating whether the read operation | ||
28 | was successful and CRC matched. | ||
29 | If the operation was successful, there is also in the end of each line | ||
30 | a counter value expressed as an integer after c= | ||
31 | |||
32 | Meaning of 42 bytes represented is following: | ||
33 | |||
34 | - 1 byte from ram page | ||
35 | - 4 bytes for the counter value | ||
36 | - 4 zero bytes | ||
37 | - 2 bytes for crc16 which was calculated from the data read since the previous crc bytes | ||
38 | - 31 remaining bytes from the ram page | ||
39 | - crc=YES/NO indicating whether read was ok and crc matched | ||
40 | - c=<int> current counter value | ||
41 | |||
42 | example from the successful read:: | ||
43 | |||
44 | 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
45 | 00 02 00 00 00 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
46 | 00 29 c6 5d 18 00 00 00 00 04 37 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=408798761 | ||
47 | 00 05 00 00 00 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=YES c=5 | ||
48 | |||
49 | example from the read with crc errors:: | ||
50 | |||
51 | 00 02 00 00 00 00 00 00 00 6d 38 00 ff ff 00 00 fe ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=YES c=2 | ||
52 | 00 02 00 00 22 00 00 00 00 e0 1f 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO | ||
53 | 00 e1 61 5d 19 00 00 00 00 df 0b 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 ff ff crc=NO | ||
54 | 00 05 00 00 20 00 00 00 00 8d 39 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff crc=NO | ||
diff --git a/Documentation/w1/slaves/w1_ds2438 b/Documentation/w1/slaves/w1_ds2438.rst index e64f65a09387..a29309a3f8e5 100644 --- a/Documentation/w1/slaves/w1_ds2438 +++ b/Documentation/w1/slaves/w1_ds2438.rst | |||
@@ -2,10 +2,13 @@ Kernel driver w1_ds2438 | |||
2 | ======================= | 2 | ======================= |
3 | 3 | ||
4 | Supported chips: | 4 | Supported chips: |
5 | |||
5 | * Maxim DS2438 Smart Battery Monitor | 6 | * Maxim DS2438 Smart Battery Monitor |
6 | 7 | ||
7 | supported family codes: | 8 | supported family codes: |
9 | ================ ==== | ||
8 | W1_FAMILY_DS2438 0x26 | 10 | W1_FAMILY_DS2438 0x26 |
11 | ================ ==== | ||
9 | 12 | ||
10 | Author: Mariusz Bialonczyk <manio@skyboo.net> | 13 | Author: Mariusz Bialonczyk <manio@skyboo.net> |
11 | 14 | ||
@@ -56,8 +59,11 @@ Opening and reading this file initiates the CONVERT_V (voltage conversion) | |||
56 | command of the chip. | 59 | command of the chip. |
57 | 60 | ||
58 | Depending on a sysfs filename a different input for the A/D will be selected: | 61 | Depending on a sysfs filename a different input for the A/D will be selected: |
59 | vad: general purpose A/D input (VAD) | 62 | |
60 | vdd: battery input (VDD) | 63 | vad: |
64 | general purpose A/D input (VAD) | ||
65 | vdd: | ||
66 | battery input (VDD) | ||
61 | 67 | ||
62 | After the voltage conversion the value is returned as decimal ASCII. | 68 | After the voltage conversion the value is returned as decimal ASCII. |
63 | Note: To get a volts the value has to be divided by 100. | 69 | Note: To get a volts the value has to be divided by 100. |
diff --git a/Documentation/w1/slaves/w1_ds28e04 b/Documentation/w1/slaves/w1_ds28e04.rst index 7819b65cfa48..b12b118890d3 100644 --- a/Documentation/w1/slaves/w1_ds28e04 +++ b/Documentation/w1/slaves/w1_ds28e04.rst | |||
@@ -1,11 +1,16 @@ | |||
1 | ======================== | ||
1 | Kernel driver w1_ds28e04 | 2 | Kernel driver w1_ds28e04 |
2 | ======================== | 3 | ======================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO | 7 | * Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO |
6 | 8 | ||
7 | supported family codes: | 9 | supported family codes: |
10 | |||
11 | ================= ==== | ||
8 | W1_FAMILY_DS28E04 0x1C | 12 | W1_FAMILY_DS28E04 0x1C |
13 | ================= ==== | ||
9 | 14 | ||
10 | Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de> | 15 | Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de> |
11 | 16 | ||
diff --git a/Documentation/w1/slaves/w1_ds28e17 b/Documentation/w1/slaves/w1_ds28e17.rst index 7fcfad5b4a37..e2d9f96d8f2c 100644 --- a/Documentation/w1/slaves/w1_ds28e17 +++ b/Documentation/w1/slaves/w1_ds28e17.rst | |||
@@ -1,11 +1,16 @@ | |||
1 | ======================== | ||
1 | Kernel driver w1_ds28e17 | 2 | Kernel driver w1_ds28e17 |
2 | ======================== | 3 | ======================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim DS28E17 1-Wire-to-I2C Master Bridge | 7 | * Maxim DS28E17 1-Wire-to-I2C Master Bridge |
6 | 8 | ||
7 | supported family codes: | 9 | supported family codes: |
10 | |||
11 | ================= ==== | ||
8 | W1_FAMILY_DS28E17 0x19 | 12 | W1_FAMILY_DS28E17 0x19 |
13 | ================= ==== | ||
9 | 14 | ||
10 | Author: Jan Kandziora <jjj@gmx.de> | 15 | Author: Jan Kandziora <jjj@gmx.de> |
11 | 16 | ||
@@ -20,11 +25,11 @@ a DS28E17 can be accessed by the kernel or userspace tools as if they were | |||
20 | connected to a "native" I2C bus master. | 25 | connected to a "native" I2C bus master. |
21 | 26 | ||
22 | 27 | ||
23 | An udev rule like the following | 28 | An udev rule like the following:: |
24 | ------------------------------------------------------------------------------- | 29 | |
25 | SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \ | 30 | SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", ATTRS{name}=="w1-19-*", \ |
26 | SYMLINK+="i2c-$attr{name}" | 31 | SYMLINK+="i2c-$attr{name}" |
27 | ------------------------------------------------------------------------------- | 32 | |
28 | may be used to create stable /dev/i2c- entries based on the unique id of the | 33 | may be used to create stable /dev/i2c- entries based on the unique id of the |
29 | DS28E17 chip. | 34 | DS28E17 chip. |
30 | 35 | ||
@@ -65,4 +70,3 @@ structure is created. | |||
65 | 70 | ||
66 | 71 | ||
67 | See https://github.com/ianka/w1_ds28e17 for even more information. | 72 | See https://github.com/ianka/w1_ds28e17 for even more information. |
68 | |||
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm.rst index d1f93af36f38..90531c340a07 100644 --- a/Documentation/w1/slaves/w1_therm +++ b/Documentation/w1/slaves/w1_therm.rst | |||
@@ -1,7 +1,9 @@ | |||
1 | ====================== | ||
1 | Kernel driver w1_therm | 2 | Kernel driver w1_therm |
2 | ==================== | 3 | ====================== |
3 | 4 | ||
4 | Supported chips: | 5 | Supported chips: |
6 | |||
5 | * Maxim ds18*20 based temperature sensors. | 7 | * Maxim ds18*20 based temperature sensors. |
6 | * Maxim ds1825 based temperature sensors. | 8 | * Maxim ds1825 based temperature sensors. |
7 | 9 | ||
@@ -13,12 +15,16 @@ Description | |||
13 | 15 | ||
14 | w1_therm provides basic temperature conversion for ds18*20 devices, and the | 16 | w1_therm provides basic temperature conversion for ds18*20 devices, and the |
15 | ds28ea00 device. | 17 | ds28ea00 device. |
16 | supported family codes: | 18 | |
19 | Supported family codes: | ||
20 | |||
21 | ==================== ==== | ||
17 | W1_THERM_DS18S20 0x10 | 22 | W1_THERM_DS18S20 0x10 |
18 | W1_THERM_DS1822 0x22 | 23 | W1_THERM_DS1822 0x22 |
19 | W1_THERM_DS18B20 0x28 | 24 | W1_THERM_DS18B20 0x28 |
20 | W1_THERM_DS1825 0x3B | 25 | W1_THERM_DS1825 0x3B |
21 | W1_THERM_DS28EA00 0x42 | 26 | W1_THERM_DS28EA00 0x42 |
27 | ==================== ==== | ||
22 | 28 | ||
23 | Support is provided through the sysfs w1_slave file. Each open and | 29 | Support is provided through the sysfs w1_slave file. Each open and |
24 | read sequence will initiate a temperature conversion then provide two | 30 | read sequence will initiate a temperature conversion then provide two |
@@ -51,6 +57,7 @@ If so, it will activate the master's strong pullup. | |||
51 | In case the detection of parasite devices using this command fails | 57 | In case the detection of parasite devices using this command fails |
52 | (seems to be the case with some DS18S20) the strong pullup can | 58 | (seems to be the case with some DS18S20) the strong pullup can |
53 | be force-enabled. | 59 | be force-enabled. |
60 | |||
54 | If the strong pullup is enabled, the master's strong pullup will be | 61 | If the strong pullup is enabled, the master's strong pullup will be |
55 | driven when the conversion is taking place, provided the master driver | 62 | driven when the conversion is taking place, provided the master driver |
56 | does support the strong pullup (or it falls back to a pullup | 63 | does support the strong pullup (or it falls back to a pullup |
diff --git a/Documentation/w1/w1.generic b/Documentation/w1/w1-generic.rst index c51b1ab012d0..da4e8b4e9b01 100644 --- a/Documentation/w1/w1.generic +++ b/Documentation/w1/w1-generic.rst | |||
@@ -1,5 +1,7 @@ | |||
1 | The 1-wire (w1) subsystem | 1 | ========================================= |
2 | ------------------------------------------------------------------ | 2 | Introduction to the 1-wire (w1) subsystem |
3 | ========================================= | ||
4 | |||
3 | The 1-wire bus is a simple master-slave bus that communicates via a single | 5 | The 1-wire bus is a simple master-slave bus that communicates via a single |
4 | signal wire (plus ground, so two wires). | 6 | signal wire (plus ground, so two wires). |
5 | 7 | ||
@@ -12,14 +14,16 @@ communication with slaves. | |||
12 | All w1 slave devices must be connected to a w1 bus master device. | 14 | All w1 slave devices must be connected to a w1 bus master device. |
13 | 15 | ||
14 | Example w1 master devices: | 16 | Example w1 master devices: |
15 | DS9490 usb device | 17 | |
16 | W1-over-GPIO | 18 | - DS9490 usb device |
17 | DS2482 (i2c to w1 bridge) | 19 | - W1-over-GPIO |
18 | Emulated devices, such as a RS232 converter, parallel port adapter, etc | 20 | - DS2482 (i2c to w1 bridge) |
21 | - Emulated devices, such as a RS232 converter, parallel port adapter, etc | ||
19 | 22 | ||
20 | 23 | ||
21 | What does the w1 subsystem do? | 24 | What does the w1 subsystem do? |
22 | ------------------------------------------------------------------ | 25 | ------------------------------ |
26 | |||
23 | When a w1 master driver registers with the w1 subsystem, the following occurs: | 27 | When a w1 master driver registers with the w1 subsystem, the following occurs: |
24 | 28 | ||
25 | - sysfs entries for that w1 master are created | 29 | - sysfs entries for that w1 master are created |
@@ -43,24 +47,28 @@ be read, since no device was selected. | |||
43 | 47 | ||
44 | 48 | ||
45 | W1 device families | 49 | W1 device families |
46 | ------------------------------------------------------------------ | 50 | ------------------ |
51 | |||
47 | Slave devices are handled by a driver written for a family of w1 devices. | 52 | Slave devices are handled by a driver written for a family of w1 devices. |
48 | 53 | ||
49 | A family driver populates a struct w1_family_ops (see w1_family.h) and | 54 | A family driver populates a struct w1_family_ops (see w1_family.h) and |
50 | registers with the w1 subsystem. | 55 | registers with the w1 subsystem. |
51 | 56 | ||
52 | Current family drivers: | 57 | Current family drivers: |
53 | w1_therm - (ds18?20 thermal sensor family driver) | 58 | |
59 | w1_therm | ||
60 | - (ds18?20 thermal sensor family driver) | ||
54 | provides temperature reading function which is bound to ->rbin() method | 61 | provides temperature reading function which is bound to ->rbin() method |
55 | of the above w1_family_ops structure. | 62 | of the above w1_family_ops structure. |
56 | 63 | ||
57 | w1_smem - driver for simple 64bit memory cell provides ID reading method. | 64 | w1_smem |
65 | - driver for simple 64bit memory cell provides ID reading method. | ||
58 | 66 | ||
59 | You can call above methods by reading appropriate sysfs files. | 67 | You can call above methods by reading appropriate sysfs files. |
60 | 68 | ||
61 | 69 | ||
62 | What does a w1 master driver need to implement? | 70 | What does a w1 master driver need to implement? |
63 | ------------------------------------------------------------------ | 71 | ----------------------------------------------- |
64 | 72 | ||
65 | The driver for w1 bus master must provide at minimum two functions. | 73 | The driver for w1 bus master must provide at minimum two functions. |
66 | 74 | ||
@@ -75,25 +83,26 @@ See struct w1_bus_master definition in w1.h for details. | |||
75 | 83 | ||
76 | 84 | ||
77 | w1 master sysfs interface | 85 | w1 master sysfs interface |
78 | ------------------------------------------------------------------ | 86 | ------------------------- |
79 | <xx-xxxxxxxxxxxx> - A directory for a found device. The format is family-serial | 87 | |
80 | bus - (standard) symlink to the w1 bus | 88 | ========================= ===================================================== |
81 | driver - (standard) symlink to the w1 driver | 89 | <xx-xxxxxxxxxxxx> A directory for a found device. The format is |
82 | w1_master_add - (rw) manually register a slave device | 90 | family-serial |
83 | w1_master_attempts - (ro) the number of times a search was attempted | 91 | bus (standard) symlink to the w1 bus |
84 | w1_master_max_slave_count | 92 | driver (standard) symlink to the w1 driver |
85 | - (rw) maximum number of slaves to search for at a time | 93 | w1_master_add (rw) manually register a slave device |
86 | w1_master_name - (ro) the name of the device (w1_bus_masterX) | 94 | w1_master_attempts (ro) the number of times a search was attempted |
87 | w1_master_pullup - (rw) 5V strong pullup 0 enabled, 1 disabled | 95 | w1_master_max_slave_count (rw) maximum number of slaves to search for at a time |
88 | w1_master_remove - (rw) manually remove a slave device | 96 | w1_master_name (ro) the name of the device (w1_bus_masterX) |
89 | w1_master_search - (rw) the number of searches left to do, | 97 | w1_master_pullup (rw) 5V strong pullup 0 enabled, 1 disabled |
90 | -1=continual (default) | 98 | w1_master_remove (rw) manually remove a slave device |
91 | w1_master_slave_count | 99 | w1_master_search (rw) the number of searches left to do, |
92 | - (ro) the number of slaves found | 100 | -1=continual (default) |
93 | w1_master_slaves - (ro) the names of the slaves, one per line | 101 | w1_master_slave_count (ro) the number of slaves found |
94 | w1_master_timeout - (ro) the delay in seconds between searches | 102 | w1_master_slaves (ro) the names of the slaves, one per line |
95 | w1_master_timeout_us | 103 | w1_master_timeout (ro) the delay in seconds between searches |
96 | - (ro) the delay in microseconds beetwen searches | 104 | w1_master_timeout_us (ro) the delay in microseconds beetwen searches |
105 | ========================= ===================================================== | ||
97 | 106 | ||
98 | If you have a w1 bus that never changes (you don't add or remove devices), | 107 | If you have a w1 bus that never changes (you don't add or remove devices), |
99 | you can set the module parameter search_count to a small positive number | 108 | you can set the module parameter search_count to a small positive number |
@@ -111,11 +120,14 @@ decrements w1_master_search by 1 (down to 0) and increments | |||
111 | w1_master_attempts by 1. | 120 | w1_master_attempts by 1. |
112 | 121 | ||
113 | w1 slave sysfs interface | 122 | w1 slave sysfs interface |
114 | ------------------------------------------------------------------ | 123 | ------------------------ |
115 | bus - (standard) symlink to the w1 bus | 124 | |
116 | driver - (standard) symlink to the w1 driver | 125 | =================== ============================================================ |
117 | name - the device name, usually the same as the directory name | 126 | bus (standard) symlink to the w1 bus |
118 | w1_slave - (optional) a binary file whose meaning depends on the | 127 | driver (standard) symlink to the w1 driver |
119 | family driver | 128 | name the device name, usually the same as the directory name |
120 | rw - (optional) created for slave devices which do not have | 129 | w1_slave (optional) a binary file whose meaning depends on the |
121 | appropriate family driver. Allows to read/write binary data. | 130 | family driver |
131 | rw (optional) created for slave devices which do not have | ||
132 | appropriate family driver. Allows to read/write binary data. | ||
133 | =================== ============================================================ | ||
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1-netlink.rst index 94ad4c420828..aaa13243a5e4 100644 --- a/Documentation/w1/w1.netlink +++ b/Documentation/w1/w1-netlink.rst | |||
@@ -1,22 +1,26 @@ | |||
1 | Userspace communication protocol over connector [1]. | 1 | =============================================== |
2 | Userspace communication protocol over connector | ||
3 | =============================================== | ||
2 | 4 | ||
3 | 5 | Message types | |
4 | Message types. | ||
5 | ============= | 6 | ============= |
6 | 7 | ||
7 | There are three types of messages between w1 core and userspace: | 8 | There are three types of messages between w1 core and userspace: |
9 | |||
8 | 1. Events. They are generated each time a new master or slave device | 10 | 1. Events. They are generated each time a new master or slave device |
9 | is found either due to automatic or requested search. | 11 | is found either due to automatic or requested search. |
10 | 2. Userspace commands. | 12 | 2. Userspace commands. |
11 | 3. Replies to userspace commands. | 13 | 3. Replies to userspace commands. |
12 | 14 | ||
13 | 15 | ||
14 | Protocol. | 16 | Protocol |
15 | ======== | 17 | ======== |
16 | 18 | ||
17 | [struct cn_msg] - connector header. | 19 | :: |
20 | |||
21 | [struct cn_msg] - connector header. | ||
18 | Its length field is equal to size of the attached data | 22 | Its length field is equal to size of the attached data |
19 | [struct w1_netlink_msg] - w1 netlink header. | 23 | [struct w1_netlink_msg] - w1 netlink header. |
20 | __u8 type - message type. | 24 | __u8 type - message type. |
21 | W1_LIST_MASTERS | 25 | W1_LIST_MASTERS |
22 | list current bus masters | 26 | list current bus masters |
@@ -40,7 +44,7 @@ Protocol. | |||
40 | } mst; | 44 | } mst; |
41 | } id; | 45 | } id; |
42 | 46 | ||
43 | [struct w1_netlink_cmd] - command for given master or slave device. | 47 | [struct w1_netlink_cmd] - command for given master or slave device. |
44 | __u8 cmd - command opcode. | 48 | __u8 cmd - command opcode. |
45 | W1_CMD_READ - read command | 49 | W1_CMD_READ - read command |
46 | W1_CMD_WRITE - write command | 50 | W1_CMD_WRITE - write command |
@@ -71,18 +75,18 @@ when it is added to w1 core. | |||
71 | Currently replies to userspace commands are only generated for read | 75 | Currently replies to userspace commands are only generated for read |
72 | command request. One reply is generated exactly for one w1_netlink_cmd | 76 | command request. One reply is generated exactly for one w1_netlink_cmd |
73 | read request. Replies are not combined when sent - i.e. typical reply | 77 | read request. Replies are not combined when sent - i.e. typical reply |
74 | messages looks like the following: | 78 | messages looks like the following:: |
75 | 79 | ||
76 | [cn_msg][w1_netlink_msg][w1_netlink_cmd] | 80 | [cn_msg][w1_netlink_msg][w1_netlink_cmd] |
77 | cn_msg.len = sizeof(struct w1_netlink_msg) + | 81 | cn_msg.len = sizeof(struct w1_netlink_msg) + |
78 | sizeof(struct w1_netlink_cmd) + | 82 | sizeof(struct w1_netlink_cmd) + |
79 | cmd->len; | 83 | cmd->len; |
80 | w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; | 84 | w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; |
81 | w1_netlink_cmd.len = cmd->len; | 85 | w1_netlink_cmd.len = cmd->len; |
82 | 86 | ||
83 | Replies to W1_LIST_MASTERS should send a message back to the userspace | 87 | Replies to W1_LIST_MASTERS should send a message back to the userspace |
84 | which will contain list of all registered master ids in the following | 88 | which will contain list of all registered master ids in the following |
85 | format: | 89 | format:: |
86 | 90 | ||
87 | cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct | 91 | cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct |
88 | w1_netlink_msg) plus number of masters multiplied by 4) | 92 | w1_netlink_msg) plus number of masters multiplied by 4) |
@@ -90,39 +94,47 @@ format: | |||
90 | number of masters multiplied by 4 (u32 size)) | 94 | number of masters multiplied by 4 (u32 size)) |
91 | id0 ... idN | 95 | id0 ... idN |
92 | 96 | ||
93 | Each message is at most 4k in size, so if number of master devices | 97 | Each message is at most 4k in size, so if number of master devices |
94 | exceeds this, it will be split into several messages. | 98 | exceeds this, it will be split into several messages. |
95 | 99 | ||
96 | W1 search and alarm search commands. | 100 | W1 search and alarm search commands. |
97 | request: | ||
98 | [cn_msg] | ||
99 | [w1_netlink_msg type = W1_MASTER_CMD | ||
100 | id is equal to the bus master id to use for searching] | ||
101 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH] | ||
102 | 101 | ||
103 | reply: | 102 | request:: |
103 | |||
104 | [cn_msg] | ||
105 | [w1_netlink_msg type = W1_MASTER_CMD | ||
106 | id is equal to the bus master id to use for searching] | ||
107 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH] | ||
108 | |||
109 | reply:: | ||
110 | |||
104 | [cn_msg, ack = 1 and increasing, 0 means the last message, | 111 | [cn_msg, ack = 1 and increasing, 0 means the last message, |
105 | seq is equal to the request seq] | 112 | seq is equal to the request seq] |
106 | [w1_netlink_msg type = W1_MASTER_CMD] | 113 | [w1_netlink_msg type = W1_MASTER_CMD] |
107 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH | 114 | [w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH |
108 | len is equal to number of IDs multiplied by 8] | 115 | len is equal to number of IDs multiplied by 8] |
109 | [64bit-id0 ... 64bit-idN] | 116 | [64bit-id0 ... 64bit-idN] |
117 | |||
110 | Length in each header corresponds to the size of the data behind it, so | 118 | Length in each header corresponds to the size of the data behind it, so |
111 | w1_netlink_cmd->len = N * 8; where N is number of IDs in this message. | 119 | w1_netlink_cmd->len = N * 8; where N is number of IDs in this message. |
112 | Can be zero. | 120 | Can be zero. |
113 | w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8; | 121 | |
114 | cn_msg->len = sizeof(struct w1_netlink_msg) + | 122 | :: |
123 | |||
124 | w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8; | ||
125 | cn_msg->len = sizeof(struct w1_netlink_msg) + | ||
115 | sizeof(struct w1_netlink_cmd) + | 126 | sizeof(struct w1_netlink_cmd) + |
116 | N*8; | 127 | N*8; |
117 | 128 | ||
118 | W1 reset command. | 129 | W1 reset command:: |
119 | [cn_msg] | ||
120 | [w1_netlink_msg type = W1_MASTER_CMD | ||
121 | id is equal to the bus master id to use for searching] | ||
122 | [w1_netlink_cmd cmd = W1_CMD_RESET] | ||
123 | 130 | ||
131 | [cn_msg] | ||
132 | [w1_netlink_msg type = W1_MASTER_CMD | ||
133 | id is equal to the bus master id to use for searching] | ||
134 | [w1_netlink_cmd cmd = W1_CMD_RESET] | ||
124 | 135 | ||
125 | Command status replies. | 136 | |
137 | Command status replies | ||
126 | ====================== | 138 | ====================== |
127 | 139 | ||
128 | Each command (either root, master or slave with or without w1_netlink_cmd | 140 | Each command (either root, master or slave with or without w1_netlink_cmd |
@@ -150,7 +162,7 @@ All w1_netlink_cmd command structures are handled in every w1_netlink_msg, | |||
150 | even if there were errors, only length mismatch interrupts message processing. | 162 | even if there were errors, only length mismatch interrupts message processing. |
151 | 163 | ||
152 | 164 | ||
153 | Operation steps in w1 core when new command is received. | 165 | Operation steps in w1 core when new command is received |
154 | ======================================================= | 166 | ======================================================= |
155 | 167 | ||
156 | When new message (w1_netlink_msg) is received w1 core detects if it is | 168 | When new message (w1_netlink_msg) is received w1 core detects if it is |
@@ -167,7 +179,7 @@ When all commands (w1_netlink_cmd) are processed master device is unlocked | |||
167 | and next w1_netlink_msg header processing started. | 179 | and next w1_netlink_msg header processing started. |
168 | 180 | ||
169 | 181 | ||
170 | Connector [1] specific documentation. | 182 | Connector [1] specific documentation |
171 | ==================================== | 183 | ==================================== |
172 | 184 | ||
173 | Each connector message includes two u32 fields as "address". | 185 | Each connector message includes two u32 fields as "address". |
@@ -180,10 +192,11 @@ Sequence number for reply is the same as was in request, and | |||
180 | acknowledge number is set to seq+1. | 192 | acknowledge number is set to seq+1. |
181 | 193 | ||
182 | 194 | ||
183 | Additional documantion, source code examples. | 195 | Additional documentation, source code examples |
184 | ============================================ | 196 | ============================================== |
185 | 197 | ||
186 | 1. Documentation/driver-api/connector.rst | 198 | 1. Documentation/driver-api/connector.rst |
187 | 2. http://www.ioremap.net/archive/w1 | 199 | 2. http://www.ioremap.net/archive/w1 |
188 | This archive includes userspace application w1d.c which uses | 200 | |
189 | read/write/search commands for all master/slave devices found on the bus. | 201 | This archive includes userspace application w1d.c which uses |
202 | read/write/search commands for all master/slave devices found on the bus. | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 8147615da48c..1c735e5e2702 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -658,7 +658,7 @@ ALI1563 I2C DRIVER | |||
658 | M: Rudolf Marek <r.marek@assembler.cz> | 658 | M: Rudolf Marek <r.marek@assembler.cz> |
659 | L: linux-i2c@vger.kernel.org | 659 | L: linux-i2c@vger.kernel.org |
660 | S: Maintained | 660 | S: Maintained |
661 | F: Documentation/i2c/busses/i2c-ali1563 | 661 | F: Documentation/i2c/busses/i2c-ali1563.rst |
662 | F: drivers/i2c/busses/i2c-ali1563.c | 662 | F: drivers/i2c/busses/i2c-ali1563.c |
663 | 663 | ||
664 | ALLEGRO DVT VIDEO IP CORE DRIVER | 664 | ALLEGRO DVT VIDEO IP CORE DRIVER |
@@ -1573,8 +1573,8 @@ R: Suzuki K Poulose <suzuki.poulose@arm.com> | |||
1573 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1573 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1574 | S: Maintained | 1574 | S: Maintained |
1575 | F: drivers/hwtracing/coresight/* | 1575 | F: drivers/hwtracing/coresight/* |
1576 | F: Documentation/trace/coresight.txt | 1576 | F: Documentation/trace/coresight.rst |
1577 | F: Documentation/trace/coresight-cpu-debug.txt | 1577 | F: Documentation/trace/coresight-cpu-debug.rst |
1578 | F: Documentation/devicetree/bindings/arm/coresight.txt | 1578 | F: Documentation/devicetree/bindings/arm/coresight.txt |
1579 | F: Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt | 1579 | F: Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt |
1580 | F: Documentation/ABI/testing/sysfs-bus-coresight-devices-* | 1580 | F: Documentation/ABI/testing/sysfs-bus-coresight-devices-* |
@@ -4080,7 +4080,7 @@ L: samba-technical@lists.samba.org (moderated for non-subscribers) | |||
4080 | W: http://linux-cifs.samba.org/ | 4080 | W: http://linux-cifs.samba.org/ |
4081 | T: git git://git.samba.org/sfrench/cifs-2.6.git | 4081 | T: git git://git.samba.org/sfrench/cifs-2.6.git |
4082 | S: Supported | 4082 | S: Supported |
4083 | F: Documentation/filesystems/cifs/ | 4083 | F: Documentation/admin-guide/cifs/ |
4084 | F: fs/cifs/ | 4084 | F: fs/cifs/ |
4085 | 4085 | ||
4086 | COMPACTPCI HOTPLUG CORE | 4086 | COMPACTPCI HOTPLUG CORE |
@@ -4936,7 +4936,9 @@ M: Jonathan Corbet <corbet@lwn.net> | |||
4936 | L: linux-doc@vger.kernel.org | 4936 | L: linux-doc@vger.kernel.org |
4937 | S: Maintained | 4937 | S: Maintained |
4938 | F: Documentation/ | 4938 | F: Documentation/ |
4939 | F: scripts/documentation-file-ref-check | ||
4939 | F: scripts/kernel-doc | 4940 | F: scripts/kernel-doc |
4941 | F: scripts/sphinx-pre-install | ||
4940 | X: Documentation/ABI/ | 4942 | X: Documentation/ABI/ |
4941 | X: Documentation/firmware-guide/acpi/ | 4943 | X: Documentation/firmware-guide/acpi/ |
4942 | X: Documentation/devicetree/ | 4944 | X: Documentation/devicetree/ |
@@ -4952,6 +4954,14 @@ L: linux-doc@vger.kernel.org | |||
4952 | S: Maintained | 4954 | S: Maintained |
4953 | F: Documentation/translations/it_IT | 4955 | F: Documentation/translations/it_IT |
4954 | 4956 | ||
4957 | DOCUMENTATION SCRIPTS | ||
4958 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | ||
4959 | L: linux-doc@vger.kernel.org | ||
4960 | S: Maintained | ||
4961 | F: scripts/documentation-file-ref-check | ||
4962 | F: scripts/sphinx-pre-install | ||
4963 | F: Documentation/sphinx/parse-headers.pl | ||
4964 | |||
4955 | DONGWOON DW9714 LENS VOICE COIL DRIVER | 4965 | DONGWOON DW9714 LENS VOICE COIL DRIVER |
4956 | M: Sakari Ailus <sakari.ailus@linux.intel.com> | 4966 | M: Sakari Ailus <sakari.ailus@linux.intel.com> |
4957 | L: linux-media@vger.kernel.org | 4967 | L: linux-media@vger.kernel.org |
@@ -6312,7 +6322,7 @@ FLEXTIMER FTM-QUADDEC DRIVER | |||
6312 | M: Patrick Havelange <patrick.havelange@essensium.com> | 6322 | M: Patrick Havelange <patrick.havelange@essensium.com> |
6313 | L: linux-iio@vger.kernel.org | 6323 | L: linux-iio@vger.kernel.org |
6314 | S: Maintained | 6324 | S: Maintained |
6315 | F: Documentation/ABI/testing/sysfs-bus-counter-ftm-quadddec | 6325 | F: Documentation/ABI/testing/sysfs-bus-counter-ftm-quaddec |
6316 | F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt | 6326 | F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt |
6317 | F: drivers/counter/ftm-quaddec.c | 6327 | F: drivers/counter/ftm-quaddec.c |
6318 | 6328 | ||
@@ -6734,7 +6744,7 @@ L: linux-i2c@vger.kernel.org | |||
6734 | S: Supported | 6744 | S: Supported |
6735 | F: drivers/i2c/muxes/i2c-mux-gpio.c | 6745 | F: drivers/i2c/muxes/i2c-mux-gpio.c |
6736 | F: include/linux/platform_data/i2c-mux-gpio.h | 6746 | F: include/linux/platform_data/i2c-mux-gpio.h |
6737 | F: Documentation/i2c/muxes/i2c-mux-gpio | 6747 | F: Documentation/i2c/muxes/i2c-mux-gpio.rst |
6738 | 6748 | ||
6739 | GENERIC HDLC (WAN) DRIVERS | 6749 | GENERIC HDLC (WAN) DRIVERS |
6740 | M: Krzysztof Halasa <khc@pm.waw.pl> | 6750 | M: Krzysztof Halasa <khc@pm.waw.pl> |
@@ -7483,14 +7493,14 @@ I2C CONTROLLER DRIVER FOR NVIDIA GPU | |||
7483 | M: Ajay Gupta <ajayg@nvidia.com> | 7493 | M: Ajay Gupta <ajayg@nvidia.com> |
7484 | L: linux-i2c@vger.kernel.org | 7494 | L: linux-i2c@vger.kernel.org |
7485 | S: Maintained | 7495 | S: Maintained |
7486 | F: Documentation/i2c/busses/i2c-nvidia-gpu | 7496 | F: Documentation/i2c/busses/i2c-nvidia-gpu.rst |
7487 | F: drivers/i2c/busses/i2c-nvidia-gpu.c | 7497 | F: drivers/i2c/busses/i2c-nvidia-gpu.c |
7488 | 7498 | ||
7489 | I2C MUXES | 7499 | I2C MUXES |
7490 | M: Peter Rosin <peda@axentia.se> | 7500 | M: Peter Rosin <peda@axentia.se> |
7491 | L: linux-i2c@vger.kernel.org | 7501 | L: linux-i2c@vger.kernel.org |
7492 | S: Maintained | 7502 | S: Maintained |
7493 | F: Documentation/i2c/i2c-topology | 7503 | F: Documentation/i2c/i2c-topology.rst |
7494 | F: Documentation/i2c/muxes/ | 7504 | F: Documentation/i2c/muxes/ |
7495 | F: Documentation/devicetree/bindings/i2c/i2c-mux* | 7505 | F: Documentation/devicetree/bindings/i2c/i2c-mux* |
7496 | F: Documentation/devicetree/bindings/i2c/i2c-arb* | 7506 | F: Documentation/devicetree/bindings/i2c/i2c-arb* |
@@ -7510,8 +7520,8 @@ I2C OVER PARALLEL PORT | |||
7510 | M: Jean Delvare <jdelvare@suse.com> | 7520 | M: Jean Delvare <jdelvare@suse.com> |
7511 | L: linux-i2c@vger.kernel.org | 7521 | L: linux-i2c@vger.kernel.org |
7512 | S: Maintained | 7522 | S: Maintained |
7513 | F: Documentation/i2c/busses/i2c-parport | 7523 | F: Documentation/i2c/busses/i2c-parport.rst |
7514 | F: Documentation/i2c/busses/i2c-parport-light | 7524 | F: Documentation/i2c/busses/i2c-parport-light.rst |
7515 | F: drivers/i2c/busses/i2c-parport.c | 7525 | F: drivers/i2c/busses/i2c-parport.c |
7516 | F: drivers/i2c/busses/i2c-parport-light.c | 7526 | F: drivers/i2c/busses/i2c-parport-light.c |
7517 | 7527 | ||
@@ -7545,7 +7555,7 @@ I2C-TAOS-EVM DRIVER | |||
7545 | M: Jean Delvare <jdelvare@suse.com> | 7555 | M: Jean Delvare <jdelvare@suse.com> |
7546 | L: linux-i2c@vger.kernel.org | 7556 | L: linux-i2c@vger.kernel.org |
7547 | S: Maintained | 7557 | S: Maintained |
7548 | F: Documentation/i2c/busses/i2c-taos-evm | 7558 | F: Documentation/i2c/busses/i2c-taos-evm.rst |
7549 | F: drivers/i2c/busses/i2c-taos-evm.c | 7559 | F: drivers/i2c/busses/i2c-taos-evm.c |
7550 | 7560 | ||
7551 | I2C-TINY-USB DRIVER | 7561 | I2C-TINY-USB DRIVER |
@@ -7559,19 +7569,19 @@ I2C/SMBUS CONTROLLER DRIVERS FOR PC | |||
7559 | M: Jean Delvare <jdelvare@suse.com> | 7569 | M: Jean Delvare <jdelvare@suse.com> |
7560 | L: linux-i2c@vger.kernel.org | 7570 | L: linux-i2c@vger.kernel.org |
7561 | S: Maintained | 7571 | S: Maintained |
7562 | F: Documentation/i2c/busses/i2c-ali1535 | 7572 | F: Documentation/i2c/busses/i2c-ali1535.rst |
7563 | F: Documentation/i2c/busses/i2c-ali1563 | 7573 | F: Documentation/i2c/busses/i2c-ali1563.rst |
7564 | F: Documentation/i2c/busses/i2c-ali15x3 | 7574 | F: Documentation/i2c/busses/i2c-ali15x3.rst |
7565 | F: Documentation/i2c/busses/i2c-amd756 | 7575 | F: Documentation/i2c/busses/i2c-amd756.rst |
7566 | F: Documentation/i2c/busses/i2c-amd8111 | 7576 | F: Documentation/i2c/busses/i2c-amd8111.rst |
7567 | F: Documentation/i2c/busses/i2c-i801 | 7577 | F: Documentation/i2c/busses/i2c-i801.rst |
7568 | F: Documentation/i2c/busses/i2c-nforce2 | 7578 | F: Documentation/i2c/busses/i2c-nforce2.rst |
7569 | F: Documentation/i2c/busses/i2c-piix4 | 7579 | F: Documentation/i2c/busses/i2c-piix4.rst |
7570 | F: Documentation/i2c/busses/i2c-sis5595 | 7580 | F: Documentation/i2c/busses/i2c-sis5595.rst |
7571 | F: Documentation/i2c/busses/i2c-sis630 | 7581 | F: Documentation/i2c/busses/i2c-sis630.rst |
7572 | F: Documentation/i2c/busses/i2c-sis96x | 7582 | F: Documentation/i2c/busses/i2c-sis96x.rst |
7573 | F: Documentation/i2c/busses/i2c-via | 7583 | F: Documentation/i2c/busses/i2c-via.rst |
7574 | F: Documentation/i2c/busses/i2c-viapro | 7584 | F: Documentation/i2c/busses/i2c-viapro.rst |
7575 | F: drivers/i2c/busses/i2c-ali1535.c | 7585 | F: drivers/i2c/busses/i2c-ali1535.c |
7576 | F: drivers/i2c/busses/i2c-ali1563.c | 7586 | F: drivers/i2c/busses/i2c-ali1563.c |
7577 | F: drivers/i2c/busses/i2c-ali15x3.c | 7587 | F: drivers/i2c/busses/i2c-ali15x3.c |
@@ -7600,7 +7610,7 @@ M: Seth Heasley <seth.heasley@intel.com> | |||
7600 | M: Neil Horman <nhorman@tuxdriver.com> | 7610 | M: Neil Horman <nhorman@tuxdriver.com> |
7601 | L: linux-i2c@vger.kernel.org | 7611 | L: linux-i2c@vger.kernel.org |
7602 | F: drivers/i2c/busses/i2c-ismt.c | 7612 | F: drivers/i2c/busses/i2c-ismt.c |
7603 | F: Documentation/i2c/busses/i2c-ismt | 7613 | F: Documentation/i2c/busses/i2c-ismt.rst |
7604 | 7614 | ||
7605 | I2C/SMBUS STUB DRIVER | 7615 | I2C/SMBUS STUB DRIVER |
7606 | M: Jean Delvare <jdelvare@suse.com> | 7616 | M: Jean Delvare <jdelvare@suse.com> |
@@ -8350,7 +8360,7 @@ M: linux-wimax@intel.com | |||
8350 | L: wimax@linuxwimax.org (subscribers-only) | 8360 | L: wimax@linuxwimax.org (subscribers-only) |
8351 | S: Supported | 8361 | S: Supported |
8352 | W: http://linuxwimax.org | 8362 | W: http://linuxwimax.org |
8353 | F: Documentation/wimax/README.i2400m | 8363 | F: Documentation/admin-guide/wimax/i2400m.rst |
8354 | F: drivers/net/wimax/i2400m/ | 8364 | F: drivers/net/wimax/i2400m/ |
8355 | F: include/uapi/linux/wimax/i2400m.h | 8365 | F: include/uapi/linux/wimax/i2400m.h |
8356 | 8366 | ||
@@ -8635,7 +8645,7 @@ L: jfs-discussion@lists.sourceforge.net | |||
8635 | W: http://jfs.sourceforge.net/ | 8645 | W: http://jfs.sourceforge.net/ |
8636 | T: git git://github.com/kleikamp/linux-shaggy.git | 8646 | T: git git://github.com/kleikamp/linux-shaggy.git |
8637 | S: Maintained | 8647 | S: Maintained |
8638 | F: Documentation/filesystems/jfs.txt | 8648 | F: Documentation/admin-guide/jfs.rst |
8639 | F: fs/jfs/ | 8649 | F: fs/jfs/ |
8640 | 8650 | ||
8641 | JME NETWORK DRIVER | 8651 | JME NETWORK DRIVER |
@@ -8978,7 +8988,7 @@ F: kernel/kprobes.c | |||
8978 | KS0108 LCD CONTROLLER DRIVER | 8988 | KS0108 LCD CONTROLLER DRIVER |
8979 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> | 8989 | M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> |
8980 | S: Maintained | 8990 | S: Maintained |
8981 | F: Documentation/auxdisplay/ks0108 | 8991 | F: Documentation/admin-guide/auxdisplay/ks0108.rst |
8982 | F: drivers/auxdisplay/ks0108.c | 8992 | F: drivers/auxdisplay/ks0108.c |
8983 | F: include/linux/ks0108.h | 8993 | F: include/linux/ks0108.h |
8984 | 8994 | ||
@@ -9567,7 +9577,7 @@ F: Documentation/networking/mac80211-injection.txt | |||
9567 | F: include/net/mac80211.h | 9577 | F: include/net/mac80211.h |
9568 | F: net/mac80211/ | 9578 | F: net/mac80211/ |
9569 | F: drivers/net/wireless/mac80211_hwsim.[ch] | 9579 | F: drivers/net/wireless/mac80211_hwsim.[ch] |
9570 | F: Documentation/networking/mac80211_hwsim/README | 9580 | F: Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst |
9571 | 9581 | ||
9572 | MAILBOX API | 9582 | MAILBOX API |
9573 | M: Jassi Brar <jassisinghbrar@gmail.com> | 9583 | M: Jassi Brar <jassisinghbrar@gmail.com> |
@@ -10344,7 +10354,7 @@ L: linux-i2c@vger.kernel.org | |||
10344 | S: Supported | 10354 | S: Supported |
10345 | F: drivers/i2c/busses/i2c-mlxcpld.c | 10355 | F: drivers/i2c/busses/i2c-mlxcpld.c |
10346 | F: drivers/i2c/muxes/i2c-mux-mlxcpld.c | 10356 | F: drivers/i2c/muxes/i2c-mux-mlxcpld.c |
10347 | F: Documentation/i2c/busses/i2c-mlxcpld | 10357 | F: Documentation/i2c/busses/i2c-mlxcpld.rst |
10348 | 10358 | ||
10349 | MELLANOX MLXCPLD LED DRIVER | 10359 | MELLANOX MLXCPLD LED DRIVER |
10350 | M: Vadim Pasternak <vadimp@mellanox.com> | 10360 | M: Vadim Pasternak <vadimp@mellanox.com> |
@@ -11954,7 +11964,7 @@ M: Andrew Lunn <andrew@lunn.ch> | |||
11954 | L: linux-i2c@vger.kernel.org | 11964 | L: linux-i2c@vger.kernel.org |
11955 | S: Maintained | 11965 | S: Maintained |
11956 | F: Documentation/devicetree/bindings/i2c/i2c-ocores.txt | 11966 | F: Documentation/devicetree/bindings/i2c/i2c-ocores.txt |
11957 | F: Documentation/i2c/busses/i2c-ocores | 11967 | F: Documentation/i2c/busses/i2c-ocores.rst |
11958 | F: drivers/i2c/busses/i2c-ocores.c | 11968 | F: drivers/i2c/busses/i2c-ocores.c |
11959 | F: include/linux/platform_data/i2c-ocores.h | 11969 | F: include/linux/platform_data/i2c-ocores.h |
11960 | 11970 | ||
@@ -12077,7 +12087,7 @@ L: netdev@vger.kernel.org | |||
12077 | S: Supported | 12087 | S: Supported |
12078 | F: lib/packing.c | 12088 | F: lib/packing.c |
12079 | F: include/linux/packing.h | 12089 | F: include/linux/packing.h |
12080 | F: Documentation/packing.txt | 12090 | F: Documentation/core-api/packing.rst |
12081 | 12091 | ||
12082 | PADATA PARALLEL EXECUTION MECHANISM | 12092 | PADATA PARALLEL EXECUTION MECHANISM |
12083 | M: Steffen Klassert <steffen.klassert@secunet.com> | 12093 | M: Steffen Klassert <steffen.klassert@secunet.com> |
@@ -14276,7 +14286,7 @@ F: net/sctp/ | |||
14276 | SCx200 CPU SUPPORT | 14286 | SCx200 CPU SUPPORT |
14277 | M: Jim Cromie <jim.cromie@gmail.com> | 14287 | M: Jim Cromie <jim.cromie@gmail.com> |
14278 | S: Odd Fixes | 14288 | S: Odd Fixes |
14279 | F: Documentation/i2c/busses/scx200_acb | 14289 | F: Documentation/i2c/busses/scx200_acb.rst |
14280 | F: arch/x86/platform/scx200/ | 14290 | F: arch/x86/platform/scx200/ |
14281 | F: drivers/watchdog/scx200_wdt.c | 14291 | F: drivers/watchdog/scx200_wdt.c |
14282 | F: drivers/i2c/busses/scx200* | 14292 | F: drivers/i2c/busses/scx200* |
@@ -15915,7 +15925,7 @@ M: Viresh Kumar <viresh.kumar@linaro.org> | |||
15915 | M: Javi Merino <javi.merino@kernel.org> | 15925 | M: Javi Merino <javi.merino@kernel.org> |
15916 | L: linux-pm@vger.kernel.org | 15926 | L: linux-pm@vger.kernel.org |
15917 | S: Supported | 15927 | S: Supported |
15918 | F: Documentation/thermal/cpu-cooling-api.rst | 15928 | F: Documentation/driver-api/thermal/cpu-cooling-api.rst |
15919 | F: drivers/thermal/cpu_cooling.c | 15929 | F: drivers/thermal/cpu_cooling.c |
15920 | F: include/linux/cpu_cooling.h | 15930 | F: include/linux/cpu_cooling.h |
15921 | 15931 | ||
@@ -16438,7 +16448,7 @@ F: drivers/hid/hid-udraw-ps3.c | |||
16438 | UFS FILESYSTEM | 16448 | UFS FILESYSTEM |
16439 | M: Evgeniy Dushistov <dushistov@mail.ru> | 16449 | M: Evgeniy Dushistov <dushistov@mail.ru> |
16440 | S: Maintained | 16450 | S: Maintained |
16441 | F: Documentation/filesystems/ufs.txt | 16451 | F: Documentation/admin-guide/ufs.rst |
16442 | F: fs/ufs/ | 16452 | F: fs/ufs/ |
16443 | 16453 | ||
16444 | UHID USERSPACE HID IO DRIVER: | 16454 | UHID USERSPACE HID IO DRIVER: |
@@ -17358,7 +17368,7 @@ M: linux-wimax@intel.com | |||
17358 | L: wimax@linuxwimax.org (subscribers-only) | 17368 | L: wimax@linuxwimax.org (subscribers-only) |
17359 | S: Supported | 17369 | S: Supported |
17360 | W: http://linuxwimax.org | 17370 | W: http://linuxwimax.org |
17361 | F: Documentation/wimax/README.wimax | 17371 | F: Documentation/admin-guide/wimax/wimax.rst |
17362 | F: include/linux/wimax/debug.h | 17372 | F: include/linux/wimax/debug.h |
17363 | F: include/net/wimax.h | 17373 | F: include/net/wimax.h |
17364 | F: include/uapi/linux/wimax.h | 17374 | F: include/uapi/linux/wimax.h |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 68489d1f00bb..b8313a04422d 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -97,7 +97,7 @@ config CFAG12864B | |||
97 | say Y. You also need the ks0108 LCD Controller driver. | 97 | say Y. You also need the ks0108 LCD Controller driver. |
98 | 98 | ||
99 | For help about how to wire your LCD to the parallel port, | 99 | For help about how to wire your LCD to the parallel port, |
100 | check Documentation/auxdisplay/cfag12864b | 100 | check Documentation/admin-guide/auxdisplay/cfag12864b.rst |
101 | 101 | ||
102 | Depends on the x86 arch and the framebuffer support. | 102 | Depends on the x86 arch and the framebuffer support. |
103 | 103 | ||
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index e232fa948833..79b8df258371 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * The ATXP1 can reside on I2C addresses 0x37 or 0x4e. The chip is | 6 | * The ATXP1 can reside on I2C addresses 0x37 or 0x4e. The chip is |
7 | * not auto-detected by the driver and must be instantiated explicitly. | 7 | * not auto-detected by the driver and must be instantiated explicitly. |
8 | * See Documentation/i2c/instantiating-devices for more information. | 8 | * See Documentation/i2c/instantiating-devices.rst for more information. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
diff --git a/drivers/hwmon/smm665.c b/drivers/hwmon/smm665.c index 6eff14fe395d..af01f763f7d1 100644 --- a/drivers/hwmon/smm665.c +++ b/drivers/hwmon/smm665.c | |||
@@ -197,7 +197,7 @@ static int smm665_read_adc(struct smm665_data *data, int adc) | |||
197 | if (rv != -ENXIO) { | 197 | if (rv != -ENXIO) { |
198 | /* | 198 | /* |
199 | * We expect ENXIO to reflect NACK | 199 | * We expect ENXIO to reflect NACK |
200 | * (per Documentation/i2c/fault-codes). | 200 | * (per Documentation/i2c/fault-codes.rst). |
201 | * Everything else is an error. | 201 | * Everything else is an error. |
202 | */ | 202 | */ |
203 | dev_dbg(&client->dev, | 203 | dev_dbg(&client->dev, |
diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig index 14638db4991d..7a9f5fb08330 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig | |||
@@ -106,7 +106,7 @@ config CORESIGHT_CPU_DEBUG | |||
106 | can quickly get to know program counter (PC), secure state, | 106 | can quickly get to know program counter (PC), secure state, |
107 | exception level, etc. Before use debugging functionality, platform | 107 | exception level, etc. Before use debugging functionality, platform |
108 | needs to ensure the clock domain and power domain are enabled | 108 | needs to ensure the clock domain and power domain are enabled |
109 | properly, please refer Documentation/trace/coresight-cpu-debug.txt | 109 | properly, please refer Documentation/trace/coresight-cpu-debug.rst |
110 | for detailed description and the example for usage. | 110 | for detailed description and the example for usage. |
111 | 111 | ||
112 | endif | 112 | endif |
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index abedd55a1264..1474e57ecafc 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig | |||
@@ -54,7 +54,7 @@ config I2C_CHARDEV | |||
54 | Say Y here to use i2c-* device files, usually found in the /dev | 54 | Say Y here to use i2c-* device files, usually found in the /dev |
55 | directory on your system. They make it possible to have user-space | 55 | directory on your system. They make it possible to have user-space |
56 | programs use the I2C bus. Information on how to do this is | 56 | programs use the I2C bus. Information on how to do this is |
57 | contained in the file <file:Documentation/i2c/dev-interface>. | 57 | contained in the file <file:Documentation/i2c/dev-interface.rst>. |
58 | 58 | ||
59 | This support is also available as a module. If so, the module | 59 | This support is also available as a module. If so, the module |
60 | will be called i2c-dev. | 60 | will be called i2c-dev. |
@@ -107,7 +107,7 @@ config I2C_STUB | |||
107 | especially for certain kinds of sensor chips. | 107 | especially for certain kinds of sensor chips. |
108 | 108 | ||
109 | If you do build this module, be sure to read the notes and warnings | 109 | If you do build this module, be sure to read the notes and warnings |
110 | in <file:Documentation/i2c/i2c-stub>. | 110 | in <file:Documentation/i2c/i2c-stub.rst>. |
111 | 111 | ||
112 | If you don't know what to do here, definitely say N. | 112 | If you don't know what to do here, definitely say N. |
113 | 113 | ||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index f8c77edf70d0..a362245cc558 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -1206,7 +1206,7 @@ config I2C_PARPORT | |||
1206 | and makes it easier to add support for new devices. | 1206 | and makes it easier to add support for new devices. |
1207 | 1207 | ||
1208 | An adapter type parameter is now mandatory. Please read the file | 1208 | An adapter type parameter is now mandatory. Please read the file |
1209 | Documentation/i2c/busses/i2c-parport for details. | 1209 | Documentation/i2c/busses/i2c-parport.rst for details. |
1210 | 1210 | ||
1211 | Another driver exists, named i2c-parport-light, which doesn't depend | 1211 | Another driver exists, named i2c-parport-light, which doesn't depend |
1212 | on the parport driver. This is meant for embedded systems. Don't say | 1212 | on the parport driver. This is meant for embedded systems. Don't say |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 2e08b4722dc4..36e9559f880c 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -77,7 +77,7 @@ | |||
77 | * SMBus Host Notify yes | 77 | * SMBus Host Notify yes |
78 | * Interrupt processing yes | 78 | * Interrupt processing yes |
79 | * | 79 | * |
80 | * See the file Documentation/i2c/busses/i2c-i801 for details. | 80 | * See the file Documentation/i2c/busses/i2c-i801.rst for details. |
81 | */ | 81 | */ |
82 | 82 | ||
83 | #include <linux/interrupt.h> | 83 | #include <linux/interrupt.h> |
diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c index c82e78f57386..37347c93e8e0 100644 --- a/drivers/i2c/busses/i2c-taos-evm.c +++ b/drivers/i2c/busses/i2c-taos-evm.c | |||
@@ -125,7 +125,7 @@ static int taos_smbus_xfer(struct i2c_adapter *adapter, u16 addr, | |||
125 | /* | 125 | /* |
126 | * Voluntarily dropping error code of kstrtou8 since all | 126 | * Voluntarily dropping error code of kstrtou8 since all |
127 | * error code that it could return are invalid according | 127 | * error code that it could return are invalid according |
128 | * to Documentation/i2c/fault-codes. | 128 | * to Documentation/i2c/fault-codes.rst. |
129 | */ | 129 | */ |
130 | if (kstrtou8(p + 1, 16, &data->byte)) | 130 | if (kstrtou8(p + 1, 16, &data->byte)) |
131 | return -EPROTO; | 131 | return -EPROTO; |
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9c440fa6a3dd..72b300174cb8 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c | |||
@@ -2206,7 +2206,7 @@ static int i2c_detect_address(struct i2c_client *temp_client, | |||
2206 | dev_warn(&adapter->dev, | 2206 | dev_warn(&adapter->dev, |
2207 | "This adapter will soon drop class based instantiation of devices. " | 2207 | "This adapter will soon drop class based instantiation of devices. " |
2208 | "Please make sure client 0x%02x gets instantiated by other means. " | 2208 | "Please make sure client 0x%02x gets instantiated by other means. " |
2209 | "Check 'Documentation/i2c/instantiating-devices' for details.\n", | 2209 | "Check 'Documentation/i2c/instantiating-devices.rst' for details.\n", |
2210 | info.addr); | 2210 | info.addr); |
2211 | 2211 | ||
2212 | dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n", | 2212 | dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n", |
@@ -2236,7 +2236,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) | |||
2236 | if (adapter->class == I2C_CLASS_DEPRECATED) { | 2236 | if (adapter->class == I2C_CLASS_DEPRECATED) { |
2237 | dev_dbg(&adapter->dev, | 2237 | dev_dbg(&adapter->dev, |
2238 | "This adapter dropped support for I2C classes and won't auto-detect %s devices anymore. " | 2238 | "This adapter dropped support for I2C classes and won't auto-detect %s devices anymore. " |
2239 | "If you need it, check 'Documentation/i2c/instantiating-devices' for alternatives.\n", | 2239 | "If you need it, check 'Documentation/i2c/instantiating-devices.rst' for alternatives.\n", |
2240 | driver->driver.name); | 2240 | driver->driver.name); |
2241 | return 0; | 2241 | return 0; |
2242 | } | 2242 | } |
diff --git a/drivers/iio/dummy/iio_simple_dummy.c b/drivers/iio/dummy/iio_simple_dummy.c index 8f99c005458a..6cb02299a215 100644 --- a/drivers/iio/dummy/iio_simple_dummy.c +++ b/drivers/iio/dummy/iio_simple_dummy.c | |||
@@ -693,9 +693,9 @@ static int iio_dummy_remove(struct iio_sw_device *swd) | |||
693 | * Varies depending on bus type of the device. As there is no device | 693 | * Varies depending on bus type of the device. As there is no device |
694 | * here, call probe directly. For information on device registration | 694 | * here, call probe directly. For information on device registration |
695 | * i2c: | 695 | * i2c: |
696 | * Documentation/i2c/writing-clients | 696 | * Documentation/i2c/writing-clients.rst |
697 | * spi: | 697 | * spi: |
698 | * Documentation/spi/spi-summary | 698 | * Documentation/spi/spi-summary.rst |
699 | */ | 699 | */ |
700 | static const struct iio_sw_device_ops iio_dummy_device_ops = { | 700 | static const struct iio_sw_device_ops iio_dummy_device_ops = { |
701 | .probe = iio_dummy_probe, | 701 | .probe = iio_dummy_probe, |
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index 225a8df1d4e9..367497914c10 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | /* | 15 | /* |
16 | * It would be more efficient to use i2c msgs/i2c_transfer directly but, as | 16 | * It would be more efficient to use i2c msgs/i2c_transfer directly but, as |
17 | * recommened in .../Documentation/i2c/writing-clients section | 17 | * recommended in .../Documentation/i2c/writing-clients.rst section |
18 | * "Sending and receiving", using SMBus level communication is preferred. | 18 | * "Sending and receiving", using SMBus level communication is preferred. |
19 | */ | 19 | */ |
20 | 20 | ||
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 0f0fdb57198f..6f7fdcbb9151 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig | |||
@@ -546,7 +546,7 @@ config SPI_PXA2XX | |||
546 | help | 546 | help |
547 | This enables using a PXA2xx or Sodaville SSP port as a SPI master | 547 | This enables using a PXA2xx or Sodaville SSP port as a SPI master |
548 | controller. The driver can be configured to use any SSP port and | 548 | controller. The driver can be configured to use any SSP port and |
549 | additional documentation can be found a Documentation/spi/pxa2xx. | 549 | additional documentation can be found a Documentation/spi/pxa2xx.rst. |
550 | 550 | ||
551 | config SPI_PXA2XX_PCI | 551 | config SPI_PXA2XX_PCI |
552 | def_tristate SPI_PXA2XX && PCI && COMMON_CLK | 552 | def_tristate SPI_PXA2XX && PCI && COMMON_CLK |
diff --git a/drivers/spi/spi-butterfly.c b/drivers/spi/spi-butterfly.c index 8c77d1114ad3..7e71a351f3b7 100644 --- a/drivers/spi/spi-butterfly.c +++ b/drivers/spi/spi-butterfly.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * with a battery powered AVR microcontroller and lots of goodies. You | 23 | * with a battery powered AVR microcontroller and lots of goodies. You |
24 | * can use GCC to develop firmware for this. | 24 | * can use GCC to develop firmware for this. |
25 | * | 25 | * |
26 | * See Documentation/spi/butterfly for information about how to build | 26 | * See Documentation/spi/butterfly.rst for information about how to build |
27 | * and use this custom parallel port cable. | 27 | * and use this custom parallel port cable. |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c index f18f912c9dea..174dba29b1dd 100644 --- a/drivers/spi/spi-lm70llp.c +++ b/drivers/spi/spi-lm70llp.c | |||
@@ -34,7 +34,7 @@ | |||
34 | * available (on page 4) here: | 34 | * available (on page 4) here: |
35 | * http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf | 35 | * http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf |
36 | * | 36 | * |
37 | * Also see Documentation/spi/spi-lm70llp. The SPI<->parport code here is | 37 | * Also see Documentation/spi/spi-lm70llp.rst. The SPI<->parport code here is |
38 | * (heavily) based on spi-butterfly by David Brownell. | 38 | * (heavily) based on spi-butterfly by David Brownell. |
39 | * | 39 | * |
40 | * The LM70 LLP connects to the PC parallel port in the following manner: | 40 | * The LM70 LLP connects to the PC parallel port in the following manner: |
diff --git a/drivers/staging/isdn/hysdn/Kconfig b/drivers/staging/isdn/hysdn/Kconfig index 1971ef850c9a..4c8a9283b9dd 100644 --- a/drivers/staging/isdn/hysdn/Kconfig +++ b/drivers/staging/isdn/hysdn/Kconfig | |||
@@ -5,7 +5,7 @@ config HYSDN | |||
5 | help | 5 | help |
6 | Say Y here if you have one of Hypercope's active PCI ISDN cards | 6 | Say Y here if you have one of Hypercope's active PCI ISDN cards |
7 | Champ, Ergo and Metro. You will then get a module called hysdn. | 7 | Champ, Ergo and Metro. You will then get a module called hysdn. |
8 | Please read the file <file:Documentation/isdn/README.hysdn> for more | 8 | Please read the file <file:Documentation/isdn/hysdn.rst> for more |
9 | information. | 9 | information. |
10 | 10 | ||
11 | config HYSDN_CAPI | 11 | config HYSDN_CAPI |
diff --git a/fs/cifs/export.c b/fs/cifs/export.c index ce8b7f677c58..eb0bb8ca8e63 100644 --- a/fs/cifs/export.c +++ b/fs/cifs/export.c | |||
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * See Documentation/filesystems/nfs/Exporting | 27 | * See Documentation/filesystems/nfs/exporting.rst |
28 | * and examples in fs/exportfs | 28 | * and examples in fs/exportfs |
29 | * | 29 | * |
30 | * Since cifs is a network file system, an "fsid" must be included for | 30 | * Since cifs is a network file system, an "fsid" must be included for |
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index f0e549783caf..09bc68708d28 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * and for mapping back from file handles to dentries. | 7 | * and for mapping back from file handles to dentries. |
8 | * | 8 | * |
9 | * For details on why we do all the strange and hairy things in here | 9 | * For details on why we do all the strange and hairy things in here |
10 | * take a look at Documentation/filesystems/nfs/Exporting. | 10 | * take a look at Documentation/filesystems/nfs/exporting.rst. |
11 | */ | 11 | */ |
12 | #include <linux/exportfs.h> | 12 | #include <linux/exportfs.h> |
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
diff --git a/fs/isofs/export.c b/fs/isofs/export.c index 85a9093769a9..35768a63fb1d 100644 --- a/fs/isofs/export.c +++ b/fs/isofs/export.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * | 10 | * |
11 | * The following files are helpful: | 11 | * The following files are helpful: |
12 | * | 12 | * |
13 | * Documentation/filesystems/nfs/Exporting | 13 | * Documentation/filesystems/nfs/exporting.rst |
14 | * fs/exportfs/expfs.c. | 14 | * fs/exportfs/expfs.c. |
15 | */ | 15 | */ |
16 | 16 | ||
diff --git a/fs/jfs/Kconfig b/fs/jfs/Kconfig index 22a273bd4648..05cb0e8e4382 100644 --- a/fs/jfs/Kconfig +++ b/fs/jfs/Kconfig | |||
@@ -5,7 +5,7 @@ config JFS_FS | |||
5 | select CRC32 | 5 | select CRC32 |
6 | help | 6 | help |
7 | This is a port of IBM's Journaled Filesystem . More information is | 7 | This is a port of IBM's Journaled Filesystem . More information is |
8 | available in the file <file:Documentation/filesystems/jfs.txt>. | 8 | available in the file <file:Documentation/admin-guide/jfs.rst>. |
9 | 9 | ||
10 | If you do not intend to use the JFS filesystem, say N. | 10 | If you do not intend to use the JFS filesystem, say N. |
11 | 11 | ||
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 960f9a3c012d..a5612abc0936 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c | |||
@@ -555,7 +555,7 @@ static int orangefs_fsync(struct file *file, | |||
555 | * Change the file pointer position for an instance of an open file. | 555 | * Change the file pointer position for an instance of an open file. |
556 | * | 556 | * |
557 | * \note If .llseek is overriden, we must acquire lock as described in | 557 | * \note If .llseek is overriden, we must acquire lock as described in |
558 | * Documentation/filesystems/Locking. | 558 | * Documentation/filesystems/locking.rst. |
559 | * | 559 | * |
560 | * Future upgrade could support SEEK_DATA and SEEK_HOLE but would | 560 | * Future upgrade could support SEEK_DATA and SEEK_HOLE but would |
561 | * require much changes to the FS | 561 | * require much changes to the FS |
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 572dd29fbd54..34a6c99fa29b 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h | |||
@@ -246,7 +246,7 @@ struct orangefs_read_options { | |||
246 | extern struct orangefs_stats orangefs_stats; | 246 | extern struct orangefs_stats orangefs_stats; |
247 | 247 | ||
248 | /* | 248 | /* |
249 | * NOTE: See Documentation/filesystems/porting for information | 249 | * NOTE: See Documentation/filesystems/porting.rst for information |
250 | * on implementing FOO_I and properly accessing fs private data | 250 | * on implementing FOO_I and properly accessing fs private data |
251 | */ | 251 | */ |
252 | static inline struct orangefs_inode_s *ORANGEFS_I(struct inode *inode) | 252 | static inline struct orangefs_inode_s *ORANGEFS_I(struct inode *inode) |
diff --git a/fs/ufs/Kconfig b/fs/ufs/Kconfig index fcb41516ea59..6d30adb6b890 100644 --- a/fs/ufs/Kconfig +++ b/fs/ufs/Kconfig | |||
@@ -9,7 +9,7 @@ config UFS_FS | |||
9 | this file system as well. Saying Y here will allow you to read from | 9 | this file system as well. Saying Y here will allow you to read from |
10 | these partitions; if you also want to write to them, say Y to the | 10 | these partitions; if you also want to write to them, say Y to the |
11 | experimental "UFS file system write support", below. Please read the | 11 | experimental "UFS file system write support", below. Please read the |
12 | file <file:Documentation/filesystems/ufs.txt> for more information. | 12 | file <file:Documentation/admin-guide/ufs.rst> for more information. |
13 | 13 | ||
14 | The recently released UFS2 variant (used in FreeBSD 5.x) is | 14 | The recently released UFS2 variant (used in FreeBSD 5.x) is |
15 | READ-ONLY supported. | 15 | READ-ONLY supported. |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 9451011ac014..10090f11ab95 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -151,7 +151,7 @@ struct dentry_operations { | |||
151 | 151 | ||
152 | /* | 152 | /* |
153 | * Locking rules for dentry_operations callbacks are to be found in | 153 | * Locking rules for dentry_operations callbacks are to be found in |
154 | * Documentation/filesystems/Locking. Keep it updated! | 154 | * Documentation/filesystems/locking.rst. Keep it updated! |
155 | * | 155 | * |
156 | * FUrther descriptions are found in Documentation/filesystems/vfs.rst. | 156 | * FUrther descriptions are found in Documentation/filesystems/vfs.rst. |
157 | * Keep it updated too! | 157 | * Keep it updated too! |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 0d3037419bc7..cf6571fc9c01 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -139,7 +139,7 @@ struct fid { | |||
139 | * @get_parent: find the parent of a given directory | 139 | * @get_parent: find the parent of a given directory |
140 | * @commit_metadata: commit metadata changes to stable storage | 140 | * @commit_metadata: commit metadata changes to stable storage |
141 | * | 141 | * |
142 | * See Documentation/filesystems/nfs/Exporting for details on how to use | 142 | * See Documentation/filesystems/nfs/exporting.rst for details on how to use |
143 | * this interface correctly. | 143 | * this interface correctly. |
144 | * | 144 | * |
145 | * encode_fh: | 145 | * encode_fh: |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index fa5552c2307b..c0a78c069117 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -521,7 +521,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, | |||
521 | * | 521 | * |
522 | * The return codes from the @master_xfer{_atomic} fields should indicate the | 522 | * The return codes from the @master_xfer{_atomic} fields should indicate the |
523 | * type of error code that occurred during the transfer, as documented in the | 523 | * type of error code that occurred during the transfer, as documented in the |
524 | * Kernel Documentation file Documentation/i2c/fault-codes. | 524 | * Kernel Documentation file Documentation/i2c/fault-codes.rst. |
525 | */ | 525 | */ |
526 | struct i2c_algorithm { | 526 | struct i2c_algorithm { |
527 | /* | 527 | /* |
diff --git a/include/linux/platform_data/sc18is602.h b/include/linux/platform_data/sc18is602.h index e066d3b0d6d8..0e91489edfe6 100644 --- a/include/linux/platform_data/sc18is602.h +++ b/include/linux/platform_data/sc18is602.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net> | 5 | * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net> |
6 | * | 6 | * |
7 | * For further information, see the Documentation/spi/spi-sc18is602 file. | 7 | * For further information, see the Documentation/spi/spi-sc18is602.rst file. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /** | 10 | /** |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 681047f8cc05..e45659c75920 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -251,7 +251,7 @@ struct thermal_bind_params { | |||
251 | * platform characterization. This value is relative to the | 251 | * platform characterization. This value is relative to the |
252 | * rest of the weights so a cooling device whose weight is | 252 | * rest of the weights so a cooling device whose weight is |
253 | * double that of another cooling device is twice as | 253 | * double that of another cooling device is twice as |
254 | * effective. See Documentation/thermal/sysfs-api.rst for more | 254 | * effective. See Documentation/driver-api/thermal/sysfs-api.rst for more |
255 | * information. | 255 | * information. |
256 | */ | 256 | */ |
257 | int weight; | 257 | int weight; |
@@ -259,7 +259,7 @@ struct thermal_bind_params { | |||
259 | /* | 259 | /* |
260 | * This is a bit mask that gives the binding relation between this | 260 | * This is a bit mask that gives the binding relation between this |
261 | * thermal zone and cdev, for a particular trip point. | 261 | * thermal zone and cdev, for a particular trip point. |
262 | * See Documentation/thermal/sysfs-api.rst for more information. | 262 | * See Documentation/driver-api/thermal/sysfs-api.rst for more information. |
263 | */ | 263 | */ |
264 | int trip_mask; | 264 | int trip_mask; |
265 | 265 | ||
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 6b03012750da..81dc91760b23 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1245,7 +1245,7 @@ sub dump_enum($$) { | |||
1245 | # strip #define macros inside enums | 1245 | # strip #define macros inside enums |
1246 | $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; | 1246 | $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; |
1247 | 1247 | ||
1248 | if ($x =~ /enum\s+(\w+)\s*\{(.*)\}/) { | 1248 | if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) { |
1249 | $declaration_name = $1; | 1249 | $declaration_name = $1; |
1250 | my $members = $2; | 1250 | my $members = $2; |
1251 | my %_members; | 1251 | my %_members; |
@@ -1580,6 +1580,7 @@ sub dump_function($$) { | |||
1580 | $prototype =~ s/__must_check +//; | 1580 | $prototype =~ s/__must_check +//; |
1581 | $prototype =~ s/__weak +//; | 1581 | $prototype =~ s/__weak +//; |
1582 | $prototype =~ s/__sched +//; | 1582 | $prototype =~ s/__sched +//; |
1583 | $prototype =~ s/__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +//; | ||
1583 | my $define = $prototype =~ s/^#\s*define\s+//; #ak added | 1584 | my $define = $prototype =~ s/^#\s*define\s+//; #ak added |
1584 | $prototype =~ s/__attribute__\s*\(\( | 1585 | $prototype =~ s/__attribute__\s*\(\( |
1585 | (?: | 1586 | (?: |