summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-17 19:22:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-17 19:22:26 -0400
commit7c672abc120a55f678e5571ae2ee93f06ca4d7f9 (patch)
tree7beebc09f9626ca8d5f7df4dded0a553de479323
parent1902314157b19754e0ff25b44527654847cfd127 (diff)
parentfe013f8bc160d79c6e33bb66d9bb0cd24949274c (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 ...
-rw-r--r--.mailmap19
-rw-r--r--Documentation/ABI/stable/sysfs-bus-w12
-rw-r--r--Documentation/ABI/stable/sysfs-driver-w1_ds28e044
-rw-r--r--Documentation/ABI/stable/sysfs-driver-w1_ds28ea002
-rw-r--r--Documentation/admin-guide/auxdisplay/cfag12864b.rst98
-rw-r--r--Documentation/admin-guide/auxdisplay/index.rst16
-rw-r--r--Documentation/admin-guide/auxdisplay/ks0108.rst50
-rw-r--r--Documentation/admin-guide/cgroup-v1/blkio-controller.rst6
-rw-r--r--Documentation/admin-guide/cifs/authors.rst (renamed from Documentation/filesystems/cifs/AUTHORS)64
-rw-r--r--Documentation/admin-guide/cifs/changes.rst (renamed from Documentation/filesystems/cifs/CHANGES)4
-rw-r--r--Documentation/admin-guide/cifs/index.rst21
-rw-r--r--Documentation/admin-guide/cifs/introduction.rst (renamed from Documentation/filesystems/cifs/cifs.txt)8
-rw-r--r--Documentation/admin-guide/cifs/todo.rst (renamed from Documentation/filesystems/cifs/TODO)96
-rw-r--r--Documentation/admin-guide/cifs/usage.rst (renamed from Documentation/filesystems/cifs/README)562
-rwxr-xr-xDocumentation/admin-guide/cifs/winucase_convert.pl (renamed from Documentation/filesystems/cifs/winucase_convert.pl)0
-rw-r--r--Documentation/admin-guide/devices.txt11
-rw-r--r--Documentation/admin-guide/index.rst5
-rw-r--r--Documentation/admin-guide/jfs.rst (renamed from Documentation/filesystems/jfs.txt)44
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt4
-rw-r--r--Documentation/admin-guide/sysrq.rst20
-rw-r--r--Documentation/admin-guide/ufs.rst (renamed from Documentation/filesystems/ufs.txt)36
-rw-r--r--Documentation/admin-guide/wimax/i2400m.rst (renamed from Documentation/wimax/README.i2400m)145
-rw-r--r--Documentation/admin-guide/wimax/index.rst19
-rw-r--r--Documentation/admin-guide/wimax/wimax.rst (renamed from Documentation/wimax/README.wimax)38
-rw-r--r--Documentation/admin-guide/xfs.rst5
-rw-r--r--Documentation/arm/sa1100/adsbitsy.rst51
-rw-r--r--Documentation/arm/sa1100/assabet.rst2
-rw-r--r--Documentation/arm/sa1100/brutus.rst69
-rw-r--r--Documentation/arm/sa1100/freebird.rst25
-rw-r--r--Documentation/arm/sa1100/graphicsclient.rst102
-rw-r--r--Documentation/arm/sa1100/graphicsmaster.rst60
-rw-r--r--Documentation/arm/sa1100/huw_webpanel.rst21
-rw-r--r--Documentation/arm/sa1100/index.rst12
-rw-r--r--Documentation/arm/sa1100/itsy.rst47
-rw-r--r--Documentation/arm/sa1100/nanoengine.rst11
-rw-r--r--Documentation/arm/sa1100/pangolin.rst29
-rw-r--r--Documentation/arm/sa1100/pleb.rst13
-rw-r--r--Documentation/arm/sa1100/tifon.rst7
-rw-r--r--Documentation/arm/sa1100/yopy.rst5
-rw-r--r--Documentation/arm/samsung-s3c24xx/index.rst2
-rw-r--r--Documentation/arm/sh-mobile/.gitignore1
-rw-r--r--Documentation/auxdisplay/cfag12864b105
-rw-r--r--Documentation/auxdisplay/ks010855
-rw-r--r--Documentation/core-api/index.rst3
-rw-r--r--Documentation/core-api/packing.rst (renamed from Documentation/packing.txt)81
-rw-r--r--Documentation/core-api/printk-formats.rst16
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt2
-rw-r--r--Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt2
-rw-r--r--Documentation/devicetree/writing-schema.md130
-rw-r--r--Documentation/devicetree/writing-schema.rst153
-rw-r--r--Documentation/driver-api/dmaengine/index.rst2
-rw-r--r--Documentation/driver-api/index.rst2
-rw-r--r--Documentation/driver-api/ipmb.rst2
-rw-r--r--Documentation/driver-api/mtd/spi-nor.rst2
-rw-r--r--Documentation/driver-api/soundwire/index.rst2
-rw-r--r--Documentation/driver-api/thermal/cpu-cooling-api.rst (renamed from Documentation/thermal/cpu-cooling-api.rst)0
-rw-r--r--Documentation/driver-api/thermal/exynos_thermal.rst (renamed from Documentation/thermal/exynos_thermal.rst)0
-rw-r--r--Documentation/driver-api/thermal/exynos_thermal_emulation.rst (renamed from Documentation/thermal/exynos_thermal_emulation.rst)0
-rw-r--r--Documentation/driver-api/thermal/index.rst (renamed from Documentation/thermal/index.rst)2
-rw-r--r--Documentation/driver-api/thermal/intel_powerclamp.rst (renamed from Documentation/thermal/intel_powerclamp.rst)0
-rw-r--r--Documentation/driver-api/thermal/nouveau_thermal.rst (renamed from Documentation/thermal/nouveau_thermal.rst)0
-rw-r--r--Documentation/driver-api/thermal/power_allocator.rst (renamed from Documentation/thermal/power_allocator.rst)0
-rw-r--r--Documentation/driver-api/thermal/sysfs-api.rst (renamed from Documentation/thermal/sysfs-api.rst)12
-rw-r--r--Documentation/driver-api/thermal/x86_pkg_temperature_thermal.rst (renamed from Documentation/thermal/x86_pkg_temperature_thermal.rst)2
-rw-r--r--Documentation/features/locking/queued-rwlocks/arch-support.txt2
-rw-r--r--Documentation/features/locking/queued-spinlocks/arch-support.txt4
-rw-r--r--Documentation/features/locking/rwsem-optimized/arch-support.txt34
-rw-r--r--Documentation/filesystems/coda.txt4
-rw-r--r--Documentation/filesystems/directory-locking.rst (renamed from Documentation/filesystems/directory-locking)40
-rw-r--r--Documentation/filesystems/index.rst4
-rw-r--r--Documentation/filesystems/locking.rst (renamed from Documentation/filesystems/Locking)259
-rw-r--r--Documentation/filesystems/nfs/exporting.rst (renamed from Documentation/filesystems/nfs/Exporting)31
-rw-r--r--Documentation/filesystems/porting686
-rw-r--r--Documentation/filesystems/porting.rst852
-rw-r--r--Documentation/filesystems/ubifs-authentication.rst (renamed from Documentation/filesystems/ubifs-authentication.md)70
-rw-r--r--Documentation/filesystems/vfs.rst2
-rw-r--r--Documentation/hwmon/adm1021.rst2
-rw-r--r--Documentation/hwmon/adm1275.rst2
-rw-r--r--Documentation/hwmon/hih6130.rst2
-rw-r--r--Documentation/hwmon/ibm-cffps.rst2
-rw-r--r--Documentation/hwmon/lm25066.rst2
-rw-r--r--Documentation/hwmon/max16064.rst2
-rw-r--r--Documentation/hwmon/max16065.rst2
-rw-r--r--Documentation/hwmon/max20751.rst2
-rw-r--r--Documentation/hwmon/max34440.rst2
-rw-r--r--Documentation/hwmon/max6650.rst2
-rw-r--r--Documentation/hwmon/max8688.rst2
-rw-r--r--Documentation/hwmon/menf21bmc.rst2
-rw-r--r--Documentation/hwmon/pcf8591.rst2
-rw-r--r--Documentation/hwmon/sht3x.rst2
-rw-r--r--Documentation/hwmon/shtc1.rst2
-rw-r--r--Documentation/hwmon/tmp103.rst2
-rw-r--r--Documentation/hwmon/tps40422.rst2
-rw-r--r--Documentation/hwmon/ucd9000.rst2
-rw-r--r--Documentation/hwmon/ucd9200.rst2
-rw-r--r--Documentation/hwmon/via686a.rst2
-rw-r--r--Documentation/hwmon/zl6100.rst2
-rw-r--r--Documentation/i2c/busses/i2c-ali1535.rst (renamed from Documentation/i2c/busses/i2c-ali1535)13
-rw-r--r--Documentation/i2c/busses/i2c-ali1563.rst (renamed from Documentation/i2c/busses/i2c-ali1563)3
-rw-r--r--Documentation/i2c/busses/i2c-ali15x3.rst (renamed from Documentation/i2c/busses/i2c-ali15x3)64
-rw-r--r--Documentation/i2c/busses/i2c-amd-mp223
-rw-r--r--Documentation/i2c/busses/i2c-amd-mp2.rst25
-rw-r--r--Documentation/i2c/busses/i2c-amd756.rst (renamed from Documentation/i2c/busses/i2c-amd756)8
-rw-r--r--Documentation/i2c/busses/i2c-amd8111.rst (renamed from Documentation/i2c/busses/i2c-amd8111)14
-rw-r--r--Documentation/i2c/busses/i2c-diolan-u2c.rst (renamed from Documentation/i2c/busses/i2c-diolan-u2c)3
-rw-r--r--Documentation/i2c/busses/i2c-i801.rst (renamed from Documentation/i2c/busses/i2c-i801)33
-rw-r--r--Documentation/i2c/busses/i2c-ismt.rst (renamed from Documentation/i2c/busses/i2c-ismt)20
-rw-r--r--Documentation/i2c/busses/i2c-mlxcpld.rst (renamed from Documentation/i2c/busses/i2c-mlxcpld)6
-rw-r--r--Documentation/i2c/busses/i2c-nforce2.rst (renamed from Documentation/i2c/busses/i2c-nforce2)33
-rw-r--r--Documentation/i2c/busses/i2c-nvidia-gpu.rst (renamed from Documentation/i2c/busses/i2c-nvidia-gpu)6
-rw-r--r--Documentation/i2c/busses/i2c-ocores.rst (renamed from Documentation/i2c/busses/i2c-ocores)22
-rw-r--r--Documentation/i2c/busses/i2c-parport178
-rw-r--r--Documentation/i2c/busses/i2c-parport-light.rst (renamed from Documentation/i2c/busses/i2c-parport-light)8
-rw-r--r--Documentation/i2c/busses/i2c-parport.rst190
-rw-r--r--Documentation/i2c/busses/i2c-pca-isa.rst (renamed from Documentation/i2c/busses/i2c-pca-isa)9
-rw-r--r--Documentation/i2c/busses/i2c-piix4.rst (renamed from Documentation/i2c/busses/i2c-piix4)18
-rw-r--r--Documentation/i2c/busses/i2c-sis5595.rst (renamed from Documentation/i2c/busses/i2c-sis5595)19
-rw-r--r--Documentation/i2c/busses/i2c-sis63058
-rw-r--r--Documentation/i2c/busses/i2c-sis630.rst63
-rw-r--r--Documentation/i2c/busses/i2c-sis96x.rst (renamed from Documentation/i2c/busses/i2c-sis96x)31
-rw-r--r--Documentation/i2c/busses/i2c-taos-evm.rst (renamed from Documentation/i2c/busses/i2c-taos-evm)8
-rw-r--r--Documentation/i2c/busses/i2c-via.rst (renamed from Documentation/i2c/busses/i2c-via)28
-rw-r--r--Documentation/i2c/busses/i2c-viapro.rst (renamed from Documentation/i2c/busses/i2c-viapro)12
-rw-r--r--Documentation/i2c/busses/index.rst33
-rw-r--r--Documentation/i2c/busses/scx200_acb.rst (renamed from Documentation/i2c/busses/scx200_acb)9
-rw-r--r--Documentation/i2c/dev-interface.rst (renamed from Documentation/i2c/dev-interface)104
-rw-r--r--Documentation/i2c/dma-considerations.rst (renamed from Documentation/i2c/DMA-considerations)0
-rw-r--r--Documentation/i2c/fault-codes.rst (renamed from Documentation/i2c/fault-codes)5
-rw-r--r--Documentation/i2c/functionality.rst (renamed from Documentation/i2c/functionality)22
-rw-r--r--Documentation/i2c/gpio-fault-injection.rst (renamed from Documentation/i2c/gpio-fault-injection)12
-rw-r--r--Documentation/i2c/i2c-protocol.rst (renamed from Documentation/i2c/i2c-protocol)28
-rw-r--r--Documentation/i2c/i2c-stub.rst (renamed from Documentation/i2c/i2c-stub)20
-rw-r--r--Documentation/i2c/i2c-topology.rst (renamed from Documentation/i2c/i2c-topology)68
-rw-r--r--Documentation/i2c/index.rst37
-rw-r--r--Documentation/i2c/instantiating-devices.rst (renamed from Documentation/i2c/instantiating-devices)45
-rw-r--r--Documentation/i2c/muxes/i2c-mux-gpio.rst (renamed from Documentation/i2c/muxes/i2c-mux-gpio)26
-rw-r--r--Documentation/i2c/old-module-parameters.rst (renamed from Documentation/i2c/old-module-parameters)27
-rw-r--r--Documentation/i2c/slave-eeprom-backend.rst (renamed from Documentation/i2c/slave-eeprom-backend)4
-rw-r--r--Documentation/i2c/slave-interface.rst (renamed from Documentation/i2c/slave-interface)33
-rw-r--r--Documentation/i2c/smbus-protocol.rst (renamed from Documentation/i2c/smbus-protocol)86
-rw-r--r--Documentation/i2c/summary.rst (renamed from Documentation/i2c/summary)6
-rw-r--r--Documentation/i2c/ten-bit-addresses.rst (renamed from Documentation/i2c/ten-bit-addresses)5
-rw-r--r--Documentation/i2c/upgrading-clients.rst (renamed from Documentation/i2c/upgrading-clients)204
-rw-r--r--Documentation/i2c/writing-clients.rst (renamed from Documentation/i2c/writing-clients)94
-rw-r--r--Documentation/index.rst10
-rw-r--r--Documentation/input/multi-touch-protocol.rst2
-rw-r--r--Documentation/isdn/avmb1.rst (renamed from Documentation/isdn/README.avmb1)229
-rw-r--r--Documentation/isdn/credits.rst (renamed from Documentation/isdn/CREDITS)7
-rw-r--r--Documentation/isdn/gigaset.rst (renamed from Documentation/isdn/README.gigaset)292
-rw-r--r--Documentation/isdn/hysdn.rst (renamed from Documentation/isdn/README.hysdn)125
-rw-r--r--Documentation/isdn/index.rst24
-rw-r--r--Documentation/isdn/interface_capi.rst (renamed from Documentation/isdn/INTERFACE.CAPI)174
-rw-r--r--Documentation/isdn/m_isdn.rst (renamed from Documentation/isdn/README.mISDN)5
-rw-r--r--Documentation/kbuild/index.rst1
-rw-r--r--Documentation/kbuild/reproducible-builds.rst122
-rw-r--r--Documentation/locking/spinlocks.rst12
-rw-r--r--Documentation/m68k/buddha-driver.rst (renamed from Documentation/m68k/README.buddha)95
-rw-r--r--Documentation/m68k/index.rst1
-rw-r--r--Documentation/maintainer/pull-requests.rst2
-rw-r--r--Documentation/mips/au1xxx_ide.rst (renamed from Documentation/mips/AU1xxx_IDE.README)89
-rw-r--r--Documentation/mips/index.rst17
-rw-r--r--Documentation/networking/caif/caif.rst (renamed from Documentation/networking/caif/README)88
-rw-r--r--Documentation/networking/device_drivers/index.rst2
-rw-r--r--Documentation/networking/index.rst2
-rw-r--r--Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst (renamed from Documentation/networking/mac80211_hwsim/README)28
-rw-r--r--Documentation/nios2/nios2.rst (renamed from Documentation/nios2/README)1
-rw-r--r--Documentation/openrisc/index.rst18
-rw-r--r--Documentation/openrisc/openrisc_port.rst (renamed from Documentation/openrisc/README)25
-rw-r--r--Documentation/openrisc/todo.rst (renamed from Documentation/openrisc/TODO)9
-rw-r--r--Documentation/parisc/debugging.rst (renamed from Documentation/parisc/debugging)7
-rw-r--r--Documentation/parisc/index.rst18
-rw-r--r--Documentation/parisc/registers.rst (renamed from Documentation/parisc/registers)59
-rw-r--r--Documentation/process/email-clients.rst20
-rw-r--r--Documentation/process/howto.rst2
-rw-r--r--Documentation/process/submitting-patches.rst2
-rw-r--r--Documentation/riscv/boot-image-header.rst (renamed from Documentation/riscv/boot-image-header.txt)39
-rw-r--r--Documentation/riscv/index.rst1
-rw-r--r--Documentation/security/tpm/index.rst1
-rw-r--r--Documentation/security/tpm/tpm_event_log.rst55
-rw-r--r--Documentation/sound/index.rst2
-rw-r--r--Documentation/sphinx/automarkup.py5
-rw-r--r--Documentation/spi/butterfly.rst (renamed from Documentation/spi/butterfly)44
-rw-r--r--Documentation/spi/index.rst22
-rw-r--r--Documentation/spi/pxa2xx.rst (renamed from Documentation/spi/pxa2xx)95
-rw-r--r--Documentation/spi/spi-lm70llp.rst (renamed from Documentation/spi/spi-lm70llp)17
-rw-r--r--Documentation/spi/spi-sc18is602.rst (renamed from Documentation/spi/spi-sc18is602)5
-rw-r--r--Documentation/spi/spi-summary.rst (renamed from Documentation/spi/spi-summary)105
-rw-r--r--Documentation/spi/spidev.rst (renamed from Documentation/spi/spidev)30
-rw-r--r--Documentation/trace/coresight-cpu-debug.rst (renamed from Documentation/trace/coresight-cpu-debug.txt)67
-rw-r--r--Documentation/trace/coresight.rst (renamed from Documentation/trace/coresight.txt)372
-rw-r--r--Documentation/trace/ftrace.rst13
-rw-r--r--Documentation/trace/index.rst2
-rw-r--r--Documentation/translations/it_IT/process/changes.rst22
-rw-r--r--Documentation/translations/it_IT/process/howto.rst2
-rw-r--r--Documentation/translations/it_IT/process/submitting-patches.rst2
-rw-r--r--Documentation/translations/ja_JP/SubmittingPatches2
-rw-r--r--Documentation/translations/ja_JP/howto.rst2
-rw-r--r--Documentation/translations/ko_KR/howto.rst2
-rw-r--r--Documentation/translations/zh_CN/arm64/booting.txt4
-rw-r--r--Documentation/translations/zh_CN/process/howto.rst14
-rw-r--r--Documentation/translations/zh_CN/process/submitting-patches.rst2
-rw-r--r--Documentation/w1/index.rst21
-rw-r--r--Documentation/w1/masters/ds2482.rst (renamed from Documentation/w1/masters/ds2482)16
-rw-r--r--Documentation/w1/masters/ds2490.rst (renamed from Documentation/w1/masters/ds2490)6
-rw-r--r--Documentation/w1/masters/index.rst14
-rw-r--r--Documentation/w1/masters/mxc-w112
-rw-r--r--Documentation/w1/masters/mxc-w1.rst17
-rw-r--r--Documentation/w1/masters/omap-hdq.rst (renamed from Documentation/w1/masters/omap-hdq)12
-rw-r--r--Documentation/w1/masters/w1-gpio.rst (renamed from Documentation/w1/masters/w1-gpio)21
-rw-r--r--Documentation/w1/slaves/index.rst16
-rw-r--r--Documentation/w1/slaves/w1_ds2406.rst (renamed from Documentation/w1/slaves/w1_ds2406)4
-rw-r--r--Documentation/w1/slaves/w1_ds2413.rst (renamed from Documentation/w1/slaves/w1_ds2413)9
-rw-r--r--Documentation/w1/slaves/w1_ds242347
-rw-r--r--Documentation/w1/slaves/w1_ds2423.rst54
-rw-r--r--Documentation/w1/slaves/w1_ds2438.rst (renamed from Documentation/w1/slaves/w1_ds2438)10
-rw-r--r--Documentation/w1/slaves/w1_ds28e04.rst (renamed from Documentation/w1/slaves/w1_ds28e04)5
-rw-r--r--Documentation/w1/slaves/w1_ds28e17.rst (renamed from Documentation/w1/slaves/w1_ds28e17)16
-rw-r--r--Documentation/w1/slaves/w1_therm.rst (renamed from Documentation/w1/slaves/w1_therm)11
-rw-r--r--Documentation/w1/w1-generic.rst (renamed from Documentation/w1/w1.generic)88
-rw-r--r--Documentation/w1/w1-netlink.rst (renamed from Documentation/w1/w1.netlink)89
-rw-r--r--MAINTAINERS82
-rw-r--r--drivers/auxdisplay/Kconfig2
-rw-r--r--drivers/hwmon/atxp1.c2
-rw-r--r--drivers/hwmon/smm665.c2
-rw-r--r--drivers/hwtracing/coresight/Kconfig2
-rw-r--r--drivers/i2c/Kconfig4
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-i801.c2
-rw-r--r--drivers/i2c/busses/i2c-taos-evm.c2
-rw-r--r--drivers/i2c/i2c-core-base.c4
-rw-r--r--drivers/iio/dummy/iio_simple_dummy.c4
-rw-r--r--drivers/rtc/rtc-ds1374.c2
-rw-r--r--drivers/spi/Kconfig2
-rw-r--r--drivers/spi/spi-butterfly.c2
-rw-r--r--drivers/spi/spi-lm70llp.c2
-rw-r--r--drivers/staging/isdn/hysdn/Kconfig2
-rw-r--r--fs/cifs/export.c2
-rw-r--r--fs/exportfs/expfs.c2
-rw-r--r--fs/isofs/export.c2
-rw-r--r--fs/jfs/Kconfig2
-rw-r--r--fs/orangefs/file.c2
-rw-r--r--fs/orangefs/orangefs-kernel.h2
-rw-r--r--fs/ufs/Kconfig2
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/exportfs.h2
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/platform_data/sc18is602.h2
-rw-r--r--include/linux/thermal.h4
-rwxr-xr-xscripts/kernel-doc3
249 files changed, 5169 insertions, 3963 deletions
diff --git a/.mailmap b/.mailmap
index 1ad4fd655619..62bf76cb9972 100644
--- a/.mailmap
+++ b/.mailmap
@@ -47,6 +47,8 @@ Boris Brezillon <bbrezillon@kernel.org> <b.brezillon.dev@gmail.com>
47Boris Brezillon <bbrezillon@kernel.org> <b.brezillon@overkiz.com> 47Boris Brezillon <bbrezillon@kernel.org> <b.brezillon@overkiz.com>
48Brian Avery <b.avery@hp.com> 48Brian Avery <b.avery@hp.com>
49Brian King <brking@us.ibm.com> 49Brian King <brking@us.ibm.com>
50Chao Yu <chao@kernel.org> <chao2.yu@samsung.com>
51Chao Yu <chao@kernel.org> <yuchao0@huawei.com>
50Christoph Hellwig <hch@lst.de> 52Christoph Hellwig <hch@lst.de>
51Christophe Ricard <christophe.ricard@gmail.com> 53Christophe Ricard <christophe.ricard@gmail.com>
52Corey Minyard <minyard@acm.org> 54Corey Minyard <minyard@acm.org>
@@ -80,6 +82,8 @@ Frank Rowand <frowand.list@gmail.com> <frowand@mvista.com>
80Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com> 82Frank Rowand <frowand.list@gmail.com> <frank.rowand@am.sony.com>
81Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com> 83Frank Rowand <frowand.list@gmail.com> <frank.rowand@sonymobile.com>
82Frank Zago <fzago@systemfabricworks.com> 84Frank Zago <fzago@systemfabricworks.com>
85Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com>
86Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
83Greg Kroah-Hartman <greg@echidna.(none)> 87Greg Kroah-Hartman <greg@echidna.(none)>
84Greg Kroah-Hartman <gregkh@suse.de> 88Greg Kroah-Hartman <gregkh@suse.de>
85Greg Kroah-Hartman <greg@kroah.com> 89Greg Kroah-Hartman <greg@kroah.com>
@@ -90,6 +94,9 @@ Henrik Kretzschmar <henne@nachtwindheim.de>
90Henrik Rydberg <rydberg@bitmath.org> 94Henrik Rydberg <rydberg@bitmath.org>
91Herbert Xu <herbert@gondor.apana.org.au> 95Herbert Xu <herbert@gondor.apana.org.au>
92Jacob Shin <Jacob.Shin@amd.com> 96Jacob Shin <Jacob.Shin@amd.com>
97Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com>
98Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com>
99Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com>
93James Bottomley <jejb@mulgrave.(none)> 100James Bottomley <jejb@mulgrave.(none)>
94James Bottomley <jejb@titanic.il.steeleye.com> 101James Bottomley <jejb@titanic.il.steeleye.com>
95James E Wilson <wilson@specifix.com> 102James E Wilson <wilson@specifix.com>
@@ -181,6 +188,11 @@ Nguyen Anh Quynh <aquynh@gmail.com>
181Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> 188Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com>
182Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> 189Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org>
183Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> 190Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org>
191Oleksij Rempel <linux@rempel-privat.de> <bug-track@fisher-privat.net>
192Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com>
193Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com>
194Oleksij Rempel <linux@rempel-privat.de> <o.rempel@pengutronix.de>
195Oleksij Rempel <linux@rempel-privat.de> <ore@pengutronix.de>
184Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> 196Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
185Patrick Mochel <mochel@digitalimplant.org> 197Patrick Mochel <mochel@digitalimplant.org>
186Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com> 198Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com>
@@ -191,11 +203,7 @@ Pratyush Anand <pratyush.anand@gmail.com> <pratyush.anand@st.com>
191Praveen BP <praveenbp@ti.com> 203Praveen BP <praveenbp@ti.com>
192Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com> 204Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com>
193Qais Yousef <qsyousef@gmail.com> <qais.yousef@imgtec.com> 205Qais Yousef <qsyousef@gmail.com> <qais.yousef@imgtec.com>
194Oleksij Rempel <linux@rempel-privat.de> <bug-track@fisher-privat.net> 206Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com>
195Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com>
196Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com>
197Oleksij Rempel <linux@rempel-privat.de> <o.rempel@pengutronix.de>
198Oleksij Rempel <linux@rempel-privat.de> <ore@pengutronix.de>
199Rajesh Shah <rajesh.shah@intel.com> 207Rajesh Shah <rajesh.shah@intel.com>
200Ralf Baechle <ralf@linux-mips.org> 208Ralf Baechle <ralf@linux-mips.org>
201Ralf Wildenhues <Ralf.Wildenhues@gmx.de> 209Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
@@ -230,6 +238,7 @@ Sumit Semwal <sumit.semwal@ti.com>
230Tejun Heo <htejun@gmail.com> 238Tejun Heo <htejun@gmail.com>
231Thomas Graf <tgraf@suug.ch> 239Thomas Graf <tgraf@suug.ch>
232Thomas Pedersen <twp@codeaurora.org> 240Thomas Pedersen <twp@codeaurora.org>
241Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org>
233Tony Luck <tony.luck@intel.com> 242Tony Luck <tony.luck@intel.com>
234TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn> 243TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn>
235TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org> 244TripleX 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.
10Users: any user space application which wants to know bus scanning 10Users: 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
2Date: May 2012 2Date: May 2012
3Contact: Markus Franke <franm@hrz.tu-chemnitz.de> 3Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
4Description: read/write the contents of the two PIO's of the DS28E04-100 4Description: 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
6Users: any user space application which wants to communicate with DS28E04-100 6Users: 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
11Date: May 2012 11Date: May 2012
12Contact: Markus Franke <franm@hrz.tu-chemnitz.de> 12Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
13Description: read/write the contents of the EEPROM memory of the DS28E04-100 13Description: 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
15Users: any user space application which wants to communicate with DS28E04-100 15Users: 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
2Date: Apr 2015 2Date: Apr 2015
3Contact: Matt Campbell <mattrcampbell@gmail.com> 3Contact: Matt Campbell <mattrcampbell@gmail.com>
4Description: Support for the DS28EA00 chain sequence function 4Description: 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
6Users: any user space application which wants to communicate with DS28EA00 6Users: 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===================================
2cfag12864b 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
181. Driver Information
19---------------------
20
21This driver supports a cfag12864b LCD.
22
23
242. 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
443. Wiring
45---------
46
47The cfag12864b LCD Series don't have official wiring.
48
49The 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
824. Userspace Programming
83------------------------
84
85The cfag12864bfb describes a framebuffer device (/dev/fbX).
86
87It has a size of 1024 bytes = 1 Kbyte.
88Each bit represents one pixel. If the bit is high, the pixel will
89turn on. If the pixel is low, the pixel will turn off.
90
91You can use the framebuffer as a file: fopen, fwrite, fclose...
92Although the LCD won't get updated until the next refresh time arrives.
93
94Also, you can mmap the framebuffer: open & mmap, munmap & close...
95which is the best option for most uses.
96
97Check samples/auxdisplay/cfag12864b-example.c
98for 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=========================
2Auxiliary 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==========================================
2ks0108 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
181. Driver Information
19---------------------
20
21This driver supports the ks0108 LCD controller.
22
23
242. 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
423. Wiring
43---------
44
45The driver supports data parallel port wiring.
46
47If you aren't building LCD related hardware, you should check
48your LCD specific wiring information in the same folder.
49
50For 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=======
2Authors
3=======
4
1Original Author 5Original Author
2=============== 6---------------
7
3Steve French (sfrench@samba.org) 8Steve French (sfrench@samba.org)
4 9
5The author wishes to express his appreciation and thanks to: 10The author wishes to express his appreciation and thanks to:
@@ -12,7 +17,7 @@ side of the original CIFS Unix extensions and reviewing and implementing
12portions of the newer CIFS POSIX extensions into the Samba 3 file server. Thank 17portions of the newer CIFS POSIX extensions into the Samba 3 file server. Thank
13Dave Boutcher of IBM Rochester (author of the OS/400 smb/cifs filesystem client) 18Dave Boutcher of IBM Rochester (author of the OS/400 smb/cifs filesystem client)
14for proving years ago that very good smb/cifs clients could be done on Unix-like 19for proving years ago that very good smb/cifs clients could be done on Unix-like
15operating systems. Volker Lendecke, Andrew Tridgell, Urban Widmark, John 20operating systems. Volker Lendecke, Andrew Tridgell, Urban Widmark, John
16Newbigin and others for their work on the Linux smbfs module. Thanks to 21Newbigin and others for their work on the Linux smbfs module. Thanks to
17the other members of the Storage Network Industry Association CIFS Technical 22the other members of the Storage Network Industry Association CIFS Technical
18Workgroup for their work specifying this highly complex protocol and finally 23Workgroup 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
21Patch Contributors 26Patch Contributors
22------------------ 27------------------
23Zwane Mwaikambo 28
24Andi Kleen 29- Zwane Mwaikambo
25Amrut Joshi 30- Andi Kleen
26Shobhit Dayal 31- Amrut Joshi
27Sergey Vlasov 32- Shobhit Dayal
28Richard Hughes 33- Sergey Vlasov
29Yury Umanets 34- Richard Hughes
30Mark Hamzy (for some of the early cifs IPv6 work) 35- Yury Umanets
31Domen Puncer 36- Mark Hamzy (for some of the early cifs IPv6 work)
32Jesper Juhl (in particular for lots of whitespace/formatting cleanup) 37- Domen Puncer
33Vince Negri and Dave Stahl (for finding an important caching bug) 38- Jesper Juhl (in particular for lots of whitespace/formatting cleanup)
34Adrian Bunk (kcalloc cleanups) 39- Vince Negri and Dave Stahl (for finding an important caching bug)
35Miklos Szeredi 40- Adrian Bunk (kcalloc cleanups)
36Kazeon team for various fixes especially for 2.4 version. 41- Miklos Szeredi
37Asser Ferno (Change Notify support) 42- Kazeon team for various fixes especially for 2.4 version.
38Shaggy (Dave Kleikamp) for innumerable small fs suggestions and some good cleanup 43- Asser Ferno (Change Notify support)
39Gunter Kukkukk (testing and suggestions for support of old servers) 44- Shaggy (Dave Kleikamp) for innumerable small fs suggestions and some good cleanup
40Igor Mammedov (DFS support) 45- Gunter Kukkukk (testing and suggestions for support of old servers)
41Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) 46- Igor Mammedov (DFS support)
42Scott Lovenberg 47- Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code)
43Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) 48- Scott Lovenberg
44Aurelien Aptel (for DFS SMB3 work and some key bug fixes) 49- Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features)
45Ronnie 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)
46Shirish Pargaonkar (for many ACL patches over the years) 51- Ronnie Sahlberg (for SMB3 xattr work, bug fixes, and lots of great work on compounding)
47Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security) 52- Shirish Pargaonkar (for many ACL patches over the years)
48Paulo Alcantara 53- Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security)
49Long 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
52Test case and Bug Report contributors 58Test 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=======
2Changes
3=======
4
1See https://wiki.samba.org/index.php/LinuxCIFSKernel for summary 5See https://wiki.samba.org/index.php/LinuxCIFSKernel for summary
2information (that may be easier to read than parsing the output of 6information (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====
4CIFS
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============
2Introduction
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====
2TODO
3====
4
1Version 2.14 December 21, 2018 5Version 2.14 December 21, 2018
2 6
3A Partial List of Missing Features 7A Partial List of Missing Features
@@ -8,55 +12,58 @@ for visible, important contributions to this module. Here
8is a partial list of the known problems and missing features: 12is a partial list of the known problems and missing features:
9 13
10a) SMB3 (and SMB3.1.1) missing optional features: 14a) 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
16b) improved sparse file support (fiemap and SEEK_HOLE are implemented 21b) improved sparse file support (fiemap and SEEK_HOLE are implemented
17but additional features would be supportable by the protocol). 22 but additional features would be supportable by the protocol).
18 23
19c) Directory entry caching relies on a 1 second timer, rather than 24c) Directory entry caching relies on a 1 second timer, rather than
20using 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
22d) quota support (needs minor kernel change since quota calls 27d) quota support (needs minor kernel change since quota calls
23to make it to network filesystems or deviceless filesystems) 28 to make it to network filesystems or deviceless filesystems)
24 29
25e) Additional use cases can be optimized to use "compounding" 30e) 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
27of 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
29using compounding but more can be done. In addition we could significantly 34 using compounding but more can be done. In addition we could
30reduce redundant opens by using deferred close (with handle caching leases) 35 significantly reduce redundant opens by using deferred close (with
31and better using reference counters on file handles. 36 handle caching leases) and better using reference counters on file
37 handles.
32 38
33f) Finish inotify support so kde and gnome file list windows 39f) Finish inotify support so kde and gnome file list windows
34will autorefresh (partially complete by Asser). Needs minor kernel 40 will autorefresh (partially complete by Asser). Needs minor kernel
35vfs change to support removing D_NOTIFY on a file. 41 vfs change to support removing D_NOTIFY on a file.
36 42
37g) Add GUI tool to configure /proc/fs/cifs settings and for display of 43g) Add GUI tool to configure /proc/fs/cifs settings and for display of
38the CIFS statistics (started) 44 the CIFS statistics (started)
39 45
40h) implement support for security and trusted categories of xattrs 46h) 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
43i) Add support for tree connect contexts (see MS-SMB2) a new SMB3.1.1 protocol 49i) 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
46j) Create UID mapping facility so server UIDs can be mapped on a per 52j) Create UID mapping facility so server UIDs can be mapped on a per
47mount 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
48exists. Also better integration with winbind for resolving SID owners 54 exists. Also better integration with winbind for resolving SID owners
49 55
50k) Add tools to take advantage of more smb3 specific ioctls and features 56k) 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
52various 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
53Add tools to make setting various non-POSIX metadata attributes easier 59 directly from user space) Add tools to make setting various non-POSIX
54from 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
56l) encrypted file support 63l) encrypted file support
57 64
58m) improved stats gathering tools (perhaps integration with nfsometer?) 65m) improved stats gathering tools (perhaps integration with nfsometer?)
59to 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
61n) Add support for claims based ACLs ("DAC") 68n) 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
71q) Allow mount.cifs to be more verbose in reporting errors with dialect 78q) Allow mount.cifs to be more verbose in reporting errors with dialect
72or unsupported feature errors. 79 or unsupported feature errors.
73 80
74r) updating cifs documentation, and user guide. 81r) updating cifs documentation, and user guide.
75 82
76s) Addressing bugs found by running a broader set of xfstests in standard 83s) Addressing bugs found by running a broader set of xfstests in standard
77file system xfstest suite. 84 file system xfstest suite.
78 85
79t) split cifs and smb3 support into separate modules so legacy (and less 86t) split cifs and smb3 support into separate modules so legacy (and less
80secure) 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
81and simplify the code. 88 and simplify the code.
82 89
83v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added 90v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added
84so far). 91 so far).
85 92
86w) Add support for additional strong encryption types, and additional spnego 93w) Add support for additional strong encryption types, and additional spnego
87authentication mechanisms (see MS-SMB2) 94 authentication mechanisms (see MS-SMB2)
88 95
89x) Finish support for SMB3.1.1 compression 96x) Finish support for SMB3.1.1 compression
90 97
91KNOWN BUGS 98Known Bugs
92==================================== 99==========
100
93See http://bugzilla.samba.org - search on product "CifsVFS" for 101See http://bugzilla.samba.org - search on product "CifsVFS" for
94current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS) 102current bug list. Also check http://bugzilla.kernel.org (Product = File System, Component = CIFS)
95 103
961) existing symbolic links (Windows reparse points) are recognized but 1041) existing symbolic links (Windows reparse points) are recognized but
97can 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
98support the CIFS Unix extensions, although earlier versions of Samba 106 support the CIFS Unix extensions, although earlier versions of Samba
99overly restrict the pathnames. 107 overly restrict the pathnames.
1002) follow_link and readdir code does not follow dfs junctions 1082) follow_link and readdir code does not follow dfs junctions
101but recognizes them 109 but recognizes them
102 110
103Misc testing to do 111Misc testing to do
104================== 112==================
1051) check out max path names and max path name components against various server 1131) check out max path names and max path name components against various server
106types. 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
1082) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test 1162) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test
109cifs/smb3 better 117 cifs/smb3 better
110 118
1113) Additional performance testing and optimization using iozone and similar - 1193) Additional performance testing and optimization using iozone and similar -
112there 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,
113and when signing is disabled to request larger read sizes (larger than 121 and when signing is disabled to request larger read sizes (larger than
114negotiated size) and send larger write sizes to modern servers. 122 negotiated size) and send larger write sizes to modern servers.
115 123
1164) More exhaustively test against less common servers 1244) More exhaustively test against less common servers
117 125
1185) Continue to extend the smb3 "buildbot" which does automated xfstesting 1265) Continue to extend the smb3 "buildbot" which does automated xfstesting
119against Windows, Samba and Azure currently - to add additional tests and 127 against Windows, Samba and Azure currently - to add additional tests and
120to 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
121buildbot is: http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com 129 buildbot is: http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com
122 130
1236) Address various coverity warnings (most are not bugs per-se, but 1316) Address various coverity warnings (most are not bugs per-se, but
124the more warnings are addressed, the easier it is to spot real 132 the more warnings are addressed, the easier it is to spot real
125problems 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=====
2Usage
3=====
4
1This module supports the SMB3 family of advanced network protocols (as well 5This module supports the SMB3 family of advanced network protocols (as well
2as older dialects, originally called "CIFS" or SMB1). 6as older dialects, originally called "CIFS" or SMB1).
3 7
4The CIFS VFS module for Linux supports many advanced network filesystem 8The CIFS VFS module for Linux supports many advanced network filesystem
5features such as hierarchical DFS like namespace, hardlinks, locking and more. 9features such as hierarchical DFS like namespace, hardlinks, locking and more.
6It was designed to comply with the SNIA CIFS Technical Reference (which 10It was designed to comply with the SNIA CIFS Technical Reference (which
7supersedes the 1992 X/Open SMB Standard) as well as to perform best practice 11supersedes the 1992 X/Open SMB Standard) as well as to perform best practice
8practical interoperability with Windows 2000, Windows XP, Samba and equivalent 12practical interoperability with Windows 2000, Windows XP, Samba and equivalent
9servers. This code was developed in participation with the Protocol Freedom 13servers. This code was developed in participation with the Protocol Freedom
10Information Foundation. CIFS and now SMB3 has now become a defacto 14Information Foundation. CIFS and now SMB3 has now become a defacto
11standard for interoperating between Macs and Windows and major NAS appliances. 15standard for interoperating between Macs and Windows and major NAS appliances.
12 16
13Please see 17Please see
14 MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification) 18MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification)
15 http://protocolfreedom.org/ and 19http://protocolfreedom.org/ and
16 http://samba.org/samba/PFIF/ 20http://samba.org/samba/PFIF/
17for more details. 21for more details.
18 22
19 23
20For questions or bug reports please contact: 24For questions or bug reports please contact:
25
21 smfrench@gmail.com 26 smfrench@gmail.com
22 27
23See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils 28See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils
24 29
25Build instructions: 30Build instructions
26================== 31==================
32
27For Linux: 33For Linux:
34
281) Download the kernel (e.g. from http://www.kernel.org) 351) Download the kernel (e.g. from http://www.kernel.org)
29and 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)
312) make menuconfig (or make xconfig) 382) make menuconfig (or make xconfig)
323) select cifs from within the network filesystem choices 393) select cifs from within the network filesystem choices
334) save and exit 404) save and exit
345) make 415) make
35 42
36 43
37Installation instructions: 44Installation instructions
38========================= 45=========================
46
39If you have built the CIFS vfs as module (successfully) simply 47If you have built the CIFS vfs as module (successfully) simply
40type "make modules_install" (or if you prefer, manually copy the file to 48type ``make modules_install`` (or if you prefer, manually copy the file to
41the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko). 49the modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko).
42 50
43If you have built the CIFS vfs into the kernel itself, follow the instructions 51If you have built the CIFS vfs into the kernel itself, follow the instructions
44for your distribution on how to install a new kernel (usually you 52for your distribution on how to install a new kernel (usually you
45would simply type "make install"). 53would simply type ``make install``).
46 54
47If you do not have the utility mount.cifs (in the Samba 4.x source tree and on 55If you do not have the utility mount.cifs (in the Samba 4.x source tree and on
48the CIFS VFS web site) copy it to the same directory in which mount helpers 56the CIFS VFS web site) copy it to the same directory in which mount helpers
49reside (usually /sbin). Although the helper software is not 57reside (usually /sbin). Although the helper software is not
50required, mount.cifs is recommended. Most distros include a "cifs-utils" 58required, mount.cifs is recommended. Most distros include a ``cifs-utils``
51package that includes this utility so it is recommended to install this. 59package that includes this utility so it is recommended to install this.
52 60
53Note that running the Winbind pam/nss module (logon service) on all of your 61Note 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
58If cifs is built as a module, then the size and number of network buffers 66If cifs is built as a module, then the size and number of network buffers
59and maximum number of simultaneous requests to one server can be configured. 67and maximum number of simultaneous requests to one server can be configured.
60Changing these from their defaults is not recommended. By executing modinfo 68Changing 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
62on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made 72on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made
63at module initialization time (by running insmod cifs.ko) can be seen. 73at module initialization time (by running insmod cifs.ko) can be seen.
64 74
65Recommendations 75Recommendations
66=============== 76===============
77
67To improve security the SMB2.1 dialect or later (usually will get SMB3) is now 78To improve security the SMB2.1 dialect or later (usually will get SMB3) is now
68the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" 79the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0"
69on mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is 80on 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
72and encrypted shares and stronger signing and authentication algorithms. 83and encrypted shares and stronger signing and authentication algorithms.
73There are additional mount options that may be helpful for SMB3 to get 84There are additional mount options that may be helpful for SMB3 to get
74improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1): 85improved 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
77Allowing User Mounts 89Allowing User Mounts
78==================== 90====================
91
79To permit users to mount and unmount over directories they own is possible 92To permit users to mount and unmount over directories they own is possible
80with the cifs vfs. A way to enable such mounting is to mark the mount.cifs 93with the cifs vfs. A way to enable such mounting is to mark the mount.cifs
81utility as suid (e.g. "chmod +s /sbin/mount.cifs). To enable users to 94utility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to
82umount shares they mount requires 95umount shares they mount requires
96
831) mount.cifs version 1.4 or later 971) mount.cifs version 1.4 or later
842) an entry for the share in /etc/fstab indicating that a user may 982) an entry for the share in /etc/fstab indicating that a user may
85unmount 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
88Note that when the mount.cifs utility is run suid (allowing user mounts), 103Note that when the mount.cifs utility is run suid (allowing user mounts),
89in order to reduce risks, the "nosuid" mount flag is passed in on mount to 104in order to reduce risks, the ``nosuid`` mount flag is passed in on mount to
90disallow execution of an suid program mounted on the remote target. 105disallow execution of an suid program mounted on the remote target.
91When mount is executed as root, nosuid is not passed in by default, 106When mount is executed as root, nosuid is not passed in by default,
92and execution of suid programs on the remote target would be enabled 107and execution of suid programs on the remote target would be enabled
93by default. This can be changed, as with nfs and other filesystems, 108by default. This can be changed, as with nfs and other filesystems,
94by simply specifying "nosuid" among the mount options. For user mounts 109by simply specifying ``nosuid`` among the mount options. For user mounts
95though to be able to pass the suid flag to mount requires rebuilding 110though to be able to pass the suid flag to mount requires rebuilding
96mount.cifs with the following flag: CIFS_ALLOW_USR_SUID 111mount.cifs with the following flag: CIFS_ALLOW_USR_SUID
97 112
98There is a corresponding manual page for cifs mounting in the Samba 3.0 and 113There is a corresponding manual page for cifs mounting in the Samba 3.0 and
99later source tree in docs/manpages/mount.cifs.8 114later source tree in docs/manpages/mount.cifs.8
100 115
101Allowing User Unmounts 116Allowing User Unmounts
102====================== 117======================
118
103To permit users to ummount directories that they have user mounted (see above), 119To permit users to ummount directories that they have user mounted (see above),
104the utility umount.cifs may be used. It may be invoked directly, or if 120the utility umount.cifs may be used. It may be invoked directly, or if
105umount.cifs is placed in /sbin, umount can invoke the cifs umount helper 121umount.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
107mounts, unless umount is invoked with -i (which will avoid invoking a umount 123mounts, unless umount is invoked with -i (which will avoid invoking a umount
108helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked 124helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked
109as suid (e.g. "chmod +s /sbin/umount.cifs") or equivalent (some distributions 125as suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions
110allow adding entries to a file to the /etc/permissions file to achieve the 126allow adding entries to a file to the /etc/permissions file to achieve the
111equivalent suid effect). For this utility to succeed the target path 127equivalent suid effect). For this utility to succeed the target path
112must be a cifs mount, and the uid of the current user must match the uid 128must be a cifs mount, and the uid of the current user must match the uid
113of the user who mounted the resource. 129of the user who mounted the resource.
114 130
115Also note that the customary way of allowing user mounts and unmounts is 131Also 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
117to the file /etc/fstab for each //server/share you wish to mount, but 133to the file /etc/fstab for each //server/share you wish to mount, but
118this can become unwieldy when potential mount targets include many 134this can become unwieldy when potential mount targets include many
119or unpredictable UNC names. 135or unpredictable UNC names.
120 136
121Samba Considerations 137Samba Considerations
122==================== 138====================
139
123Most current servers support SMB2.1 and SMB3 which are more secure, 140Most current servers support SMB2.1 and SMB3 which are more secure,
124but there are useful protocol extensions for the older less secure CIFS 141but there are useful protocol extensions for the older less secure CIFS
125dialect, so to get the maximum benefit if mounting using the older dialect 142dialect, 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
127Unix Extensions standard (e.g. almost any version of Samba ie version 144Unix Extensions standard (e.g. almost any version of Samba ie version
1282.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers. 1452.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers.
129Note that uid, gid and file permissions will display default values if you do 146Note that uid, gid and file permissions will display default values if you do
130not have a server that supports the Unix extensions for CIFS (such as Samba 147not have a server that supports the Unix extensions for CIFS (such as Samba
1312.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add 1482.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add
132the line: 149the line::
133 150
134 unix extensions = yes 151 unix extensions = yes
135 152
136to your smb.conf file on the server. Note that the following smb.conf settings 153to your smb.conf file on the server. Note that the following smb.conf settings
137are also useful (on the Samba server) when the majority of clients are Unix or 154are also useful (on the Samba server) when the majority of clients are Unix or
138Linux: 155Linux::
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
144Note that server ea support is required for supporting xattrs from the Linux 161Note that server ea support is required for supporting xattrs from the Linux
145cifs client, and that EA support is present in later versions of Samba (e.g. 162cifs client, and that EA support is present in later versions of Samba (e.g.
1463.0.6 and later (also EA support works in all versions of Windows, at least to 1633.0.6 and later (also EA support works in all versions of Windows, at least to
147shares on NTFS filesystems). Extended Attribute (xattr) support is an optional 164shares on NTFS filesystems). Extended Attribute (xattr) support is an optional
148feature of most Linux filesystems which may require enabling via 165feature of most Linux filesystems which may require enabling via
149make menuconfig. Client support for extended attributes (user xattr) can be 166make menuconfig. Client support for extended attributes (user xattr) can be
150disabled on a per-mount basis by specifying "nouser_xattr" on mount. 167disabled on a per-mount basis by specifying ``nouser_xattr`` on mount.
151 168
152The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers 169The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
153version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and 170version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and
154then POSIX support in the CIFS configuration options when building the cifs 171then POSIX support in the CIFS configuration options when building the cifs
155module. POSIX ACL support can be disabled on a per mount basic by specifying 172module. POSIX ACL support can be disabled on a per mount basic by specifying
156"noacl" on mount. 173``noacl`` on mount.
157 174
158Some administrators may want to change Samba's smb.conf "map archive" and 175Some 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
160newly created files can end up with an unnecessarily restrictive default mode, 177newly created files can end up with an unnecessarily restrictive default mode,
161which may not be what you want, although if the CIFS Unix extensions are 178which may not be what you want, although if the CIFS Unix extensions are
162enabled on the server and client, subsequent setattr calls (e.g. chmod) can 179enabled on the server and client, subsequent setattr calls (e.g. chmod) can
163fix the mode. Note that creating special devices (mknod) remotely 180fix the mode. Note that creating special devices (mknod) remotely
164may require specifying a mkdev function to Samba if you are not using 181may require specifying a mkdev function to Samba if you are not using
165Samba 3.0.6 or later. For more information on these see the manual pages 182Samba 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,
167unlike the smbfs vfs, does not read the smb.conf on the client system 184unlike 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).
169Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete 186Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete
170open files (required for strict POSIX compliance). Windows Servers already 187open files (required for strict POSIX compliance). Windows Servers already
171supported this feature. Samba server does not allow symlinks that refer to files 188supported this feature. Samba server does not allow symlinks that refer to files
172outside of the share, so in Samba versions prior to 3.0.6, most symlinks to 189outside of the share, so in Samba versions prior to 3.0.6, most symlinks to
173files with absolute paths (ie beginning with slash) such as: 190files with absolute paths (ie beginning with slash) such as::
191
174 ln -s /mnt/foo bar 192 ln -s /mnt/foo bar
175would be forbidden. Samba 3.0.6 server or later includes the ability to create 193
176such symlinks safely by converting unsafe symlinks (ie symlinks to server 194would be forbidden. Samba 3.0.6 server or later includes the ability to create
195such symlinks safely by converting unsafe symlinks (ie symlinks to server
177files that are outside of the share) to a samba specific format on the server 196files that are outside of the share) to a samba specific format on the server
178that is ignored by local server applications and non-cifs clients and that will 197that is ignored by local server applications and non-cifs clients and that will
179not be traversed by the Samba server). This is opaque to the Linux client 198not be traversed by the Samba server). This is opaque to the Linux client
180application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or 199application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or
181later, but only for remote clients using the CIFS Unix extensions, and will 200later, but only for remote clients using the CIFS Unix extensions, and will
182be invisbile to Windows clients and typically will not affect local 201be invisbile to Windows clients and typically will not affect local
183applications running on the same server as Samba. 202applications running on the same server as Samba.
184 203
185Use instructions: 204Use instructions
186================ 205================
187Once the CIFS VFS support is built into the kernel or installed as a module 206
207Once 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
189Mac or Windows servers: 209Mac 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
193Before -o the option -v may be specified to make the mount.cifs 213Before -o the option -v may be specified to make the mount.cifs
194mount helper display the mount steps more verbosely. 214mount helper display the mount steps more verbosely.
195After -o the following commonly used cifs vfs specific options 215After -o the following commonly used cifs vfs specific options
196are supported: 216are 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
202Other cifs mount options are described below. Use of TCP names (in addition to 222Other cifs mount options are described below. Use of TCP names (in addition to
203ip addresses) is available if the mount helper (mount.cifs) is installed. If 223ip addresses) is available if the mount helper (mount.cifs) is installed. If
204you do not trust the server to which are mounted, or if you do not have 224you do not trust the server to which are mounted, or if you do not have
205cifs signing enabled (and the physical network is insecure), consider use 225cifs signing enabled (and the physical network is insecure), consider use
206of the standard mount options "noexec" and "nosuid" to reduce the risk of 226of the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of
207running an altered binary on your local system (downloaded from a hostile server 227running an altered binary on your local system (downloaded from a hostile server
208or altered by a hostile router). 228or altered by a hostile router).
209 229
210Although mounting using format corresponding to the CIFS URL specification is 230Although mounting using format corresponding to the CIFS URL specification is
211not possible in mount.cifs yet, it is possible to use an alternate format 231not possible in mount.cifs yet, it is possible to use an alternate format
212for the server and sharename (which is somewhat similar to NFS style mount 232for the server and sharename (which is somewhat similar to NFS style mount
213syntax) instead of the more widely used UNC format (i.e. \\server\share): 233syntax) 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
216When using the mount helper mount.cifs, passwords may be specified via alternate 237When using the mount helper mount.cifs, passwords may be specified via alternate
217mechanisms, instead of specifying it after -o using the normal "pass=" syntax 238mechanisms, instead of specifying it after -o using the normal ``pass=`` syntax
218on the command line: 239on the command line:
2191) By including it in a credential file. Specify credentials=filename as one 2401) By including it in a credential file. Specify credentials=filename as one
220of the mount options. Credential files contain two lines 241of the mount options. Credential files contain two lines::
221 username=someuser 242
222 password=your_password 243 username=someuser
244 password=your_password
245
2232) By specifying the password in the PASSWD environment variable (similarly 2462) By specifying the password in the PASSWD environment variable (similarly
224the user name can be taken from the USER environment variable). 247 the user name can be taken from the USER environment variable).
2253) By specifying the password in a file by name via PASSWD_FILE 2483) By specifying the password in a file by name via PASSWD_FILE
2264) By specifying the password in a file by file descriptor via PASSWD_FD 2494) 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
230Restrictions 253Restrictions
231============ 254============
232Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 255
2331001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a 256Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC
2571001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a
234problem as most servers support this. 258problem as most servers support this.
235 259
236Valid filenames differ between Windows and Linux. Windows typically restricts 260Valid filenames differ between Windows and Linux. Windows typically restricts
237filenames which contain certain reserved characters (e.g.the character : 261filenames which contain certain reserved characters (e.g.the character :
238which is used to delimit the beginning of a stream name by Windows), while 262which is used to delimit the beginning of a stream name by Windows), while
239Linux allows a slightly wider set of valid characters in filenames. Windows 263Linux allows a slightly wider set of valid characters in filenames. Windows
240servers can remap such characters when an explicit mapping is specified in 264servers can remap such characters when an explicit mapping is specified in
241the Server's registry. Samba starting with version 3.10 will allow such 265the Server's registry. Samba starting with version 3.10 will allow such
242filenames (ie those which contain valid Linux characters, which normally 266filenames (ie those which contain valid Linux characters, which normally
243would be forbidden for Windows/CIFS semantics) as long as the server is 267would be forbidden for Windows/CIFS semantics) as long as the server is
244configured for Unix Extensions (and the client has not disabled 268configured 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
247illegal Windows/NTFS/SMB characters to a remap range (this mount parm 271illegal Windows/NTFS/SMB characters to a remap range (this mount parm
248is the default for SMB3). This remap ("mapposix") range is also 272is the default for SMB3). This remap (``mapposix``) range is also
249compatible with Mac (and "Services for Mac" on some older Windows). 273compatible with Mac (and "Services for Mac" on some older Windows).
250 274
251CIFS VFS Mount Options 275CIFS VFS Mount Options
252====================== 276======================
253A partial list of the supported mount options follows: 277A 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
584hard Retry file operations if server is not responding 688 hard
585soft 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
588The mount.cifs mount helper also accepts a few mount options before -o 694The mount.cifs mount helper also accepts a few mount options before -o
589including: 695including:
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
596With most 2.6 kernel versions of modutils, the version of the cifs kernel 704With most 2.6 kernel versions of modutils, the version of the cifs kernel
597module can be displayed via modinfo. 705module can be displayed via modinfo.
598 706
599Misc /proc/fs/cifs Flags and Debug Info 707Misc /proc/fs/cifs Flags and Debug Info
600======================================= 708=======================================
709
601Informational pseudo-files: 710Informational pseudo-files:
711
712======================= =======================================================
602DebugData Displays information about active CIFS sessions and 713DebugData 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.
605Stats Lists summary resource usage information as well as per 716Stats Lists summary resource usage information as well as per
606 share statistics. 717 share statistics.
718======================= =======================================================
607 719
608Configuration pseudo-files: 720Configuration pseudo-files:
721
722======================= =======================================================
609SecurityFlags Flags which control security negotiation and 723SecurityFlags 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
645cifsFYI If set to non-zero value, additional debug information 761cifsFYI 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
661traceSMB If set to one, debug information is logged to the 782traceSMB 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
678These experimental features and tracing can be enabled by changing flags in 800These 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
680kernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable 802kernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable
681tracing to the kernel message log type: 803tracing to the kernel message log type::
682 804
683 echo 7 > /proc/fs/cifs/cifsFYI 805 echo 7 > /proc/fs/cifs/cifsFYI
684 806
685cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel 807cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel
686logging of various informational messages. 2 enables logging of non-zero 808logging of various informational messages. 2 enables logging of non-zero
687SMB return codes while 4 enables logging of requests that take longer 809SMB return codes while 4 enables logging of requests that take longer
688than one second to complete (except for byte range lock requests). 810than one second to complete (except for byte range lock requests).
689Setting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration 811Setting 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
691the start of smb requests and responses can be enabled via: 813the 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.
700Also recorded is the total bytes read and bytes written to the server for 822Also recorded is the total bytes read and bytes written to the server for
701that share. Note that due to client caching effects this can be less than the 823that share. Note that due to client caching effects this can be less than the
702number of bytes read and written by the application running on the client. 824number of bytes read and written by the application running on the client.
703Statistics can be reset to zero by "echo 0 > /proc/fs/cifs/Stats" which may be 825Statistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be
704useful if comparing performance of two different scenarios. 826useful if comparing performance of two different scenarios.
705 827
706Also note that "cat /proc/fs/cifs/DebugData" will display information about 828Also note that ``cat /proc/fs/cifs/DebugData`` will display information about
707the active sessions and the shares that are mounted. 829the active sessions and the shares that are mounted.
708 830
709Enabling Kerberos (extended security) works but requires version 1.2 or later 831Enabling 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
726To use cifs Kerberos and DFS support, the Linux keyutils package should be 848To use cifs Kerberos and DFS support, the Linux keyutils package should be
727installed and something like the following lines should be added to the 849installed 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
730create cifs.spnego * * /usr/local/sbin/cifs.upcall %k 852 create cifs.spnego * * /usr/local/sbin/cifs.upcall %k
731create dns_resolver * * /usr/local/sbin/cifs.upcall %k 853 create dns_resolver * * /usr/local/sbin/cifs.upcall %k
732 854
733CIFS kernel module parameters 855CIFS kernel module parameters
734============================= 856=============================
735These module parameters can be specified or modified either during the time of 857These module parameters can be specified or modified either during the time of
736module loading or during the runtime by using the interface 858module loading or during the runtime by using the interface::
859
737 /proc/module/cifs/parameters/<param> 860 /proc/module/cifs/parameters/<param>
738 861
739i.e. echo "value" > /sys/module/cifs/parameters/<param> 862i.e.::
740 863
7411. 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================= ==========================================================
8671. 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===========================================
1IBM's Journaled File System (JFS) for Linux 2IBM's Journaled File System (JFS) for Linux
3===========================================
2 4
3JFS Homepage: http://jfs.sourceforge.net/ 5JFS Homepage: http://jfs.sourceforge.net/
4 6
5The following mount options are supported: 7The following mount options are supported:
8
6(*) == default 9(*) == default
7 10
8iocharset=name Character set to use for converting from Unicode to 11iocharset=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
14resize=value Resize the volume to <value> blocks. JFS only supports 18resize=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
20nointegrity Do not write to the journal. The primary use of this option 25nointegrity
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
25integrity(*) Commit metadata changes to the journal. Use this option to 31integrity(*)
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
29errors=continue Keep going on a filesystem error. 36errors=continue
30errors=remount-ro(*) Remount the filesystem read-only on an error. 37 Keep going on a filesystem error.
31errors=panic Panic and halt the machine if an error occurs. 38errors=remount-ro(*)
39 Remount the filesystem read-only on an error.
40errors=panic
41 Panic and halt the machine if an error occurs.
32 42
33uid=value Override on-disk uid with specified value 43uid=value
34gid=value Override on-disk gid with specified value 44 Override on-disk uid with specified value
35umask=value Override on-disk umask with specified octal value. For 45gid=value
36 directories, the execute bit will be set if the corresponding 46 Override on-disk gid with specified value
47umask=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
39discard=minlen This enables/disables the use of discard/TRIM commands. 52discard=minlen, discard/nodiscard(*)
40discard The discard/TRIM commands are sent to the underlying 53 This enables/disables the use of discard/TRIM commands.
41nodiscard(*) 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
171useful when you want to exit a program that will not let you switch consoles. 171useful 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. 175of 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.
178Note that this just triggers a crash if there is no dump mechanism available. 178Note 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
181disks and will certainly lessen the chance of data loss and fscking. Note 181shell that provides no graceful shutdown -- it will ensure your data is
182that the sync hasn't taken place until you see the "OK" and "Done" appear 182safely written to the disk. Note that the sync hasn't taken place until you see
183on the screen. (If the kernel is really in strife, you may not ever get the 183the "OK" and "Done" appear on the screen.
184OK 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 186running system's point of view, they will be remounted read-only. The remount
188me many a fsck. Again, the unmount (remount read-only) hasn't taken place until 187isn't complete until you see the "OK" and "Done" message appear on the screen.
189you see the "OK" and "Done" message appear on the screen.
190 188
191The loglevels ``0``-``9`` are useful when your console is being flooded with 189The loglevels ``0``-``9`` are useful when your console is being flooded with
192kernel messages you do not want to see. Selecting ``0`` will prevent all but 190kernel 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 @@
1USING UFS 1=========
2Using UFS
2========= 3=========
3 4
4mount -t ufs -o ufstype=type_of_ufs device dir 5mount -t ufs -o ufstype=type_of_ufs device dir
5 6
6 7
7UFS OPTIONS 8UFS Options
8=========== 9===========
9 10
10ufstype=type_of_ufs 11ufstype=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
50POSSIBLE PROBLEMS 58Possible Problems
51================= 59-----------------
52 60
53See next section, if you have any. 61See next section, if you have any.
54 62
55 63
56BUG REPORTS 64Bug Reports
57=========== 65-----------
58 66
59Any ufs bug report you can send to daniel.pirkl@email.cz or 67Any ufs bug report you can send to daniel.pirkl@email.cz or
60to dushistov@mail.ru (do not send partition tables bug reports). 68to 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====================================================
4Driver 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
91. Requirements 121. 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
242. Compilation and installation 292. Compilation and installation
30===============================
25 31
262.1. Compilation of the drivers included in the kernel 322.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
382.2. Compilation of the drivers distributed as an standalone module 452.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
623. Installing the firmware 703. 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
784. Design 874. 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
1045. Usage 1145. 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 ...
113i2400m_usb 5-4:1.0: firmware interface version 8.0.0 124 i2400m_usb 5-4:1.0: firmware interface version 8.0.0
114i2400m_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
1225.1. Module parameters 1335.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
132options 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
141i2400m.PARAMETER=VALUE 153 i2400m.PARAMETER=VALUE
142 154
1435.1.1. i2400m: idle_mode_disabled 1555.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
1495.2. Debug operations: debugfs entries 1625.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
1655.2.1. Increasing debug output 1805.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
2035.2.2. RX and TX statistics 2195.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
20945 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
2295.2.3. Tracing messages received from user space 2475.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
2375.2.4. Performing a device reset 2565.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
2445.2.5. Asking the device to enter power saving mode 2645.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
2496. Troubleshooting 2706. Troubleshooting
271==================
250 272
2516.1. Driver complains about 'i2400m-fw-usb-1.2.sbcf: request failed' 2736.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
256i2400m_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===============
4WiMAX 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========================
4Linux 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
91. Design 121. 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
332. Usage 372. 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
422.1. Obtaining debug information: debugfs entries 472.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
542.1.1. Increasing debug output 602.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.
337Removed Sysctls 337Removed 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
346Error handling 347Error 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===============================
2ADS Bitsy Single Board Computer
3===============================
4
5(It is different from Bitsy(iPAQ) of Compaq)
6
7For more details, contact Applied Data Systems or see
8http://www.applieddata.net/products.html
9
10The Linux support for this product has been provided by
11Woojung Huh <whuh@applieddata.net>
12
13Use 'make adsbitsy_config' before any 'make config'.
14This will set up defaults for ADS Bitsy support.
15
16The kernel zImage is linked to be loaded and executed at 0xc0400000.
17
18Linux can be used with the ADS BootLoader that ships with the
19newer rev boards. See their documentation on how to load Linux.
20
21Supported 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
33To do
34=====
35
36- everything else! :-)
37
38Notes
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
51Any 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
15To build the kernel with current defaults:: 15To 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======
2Brutus
3======
4
5Brutus is an evaluation platform for the SA1100 manufactured by Intel.
6For more details, see:
7
8http://developer.intel.com
9
10To 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
17The resulting kernel will end up in linux/arch/arm/boot/zImage. This file
18must be loaded at 0xc0008000 in Brutus's memory and execution started at
190xc0008000 as well with the value of registers r0 = 0 and r1 = 16 upon
20entry.
21
22But prior to execute the kernel, a ramdisk image must also be loaded in
23memory. Use memory address 0xd8000000 for this. Note that the file
24containing the (compressed) ramdisk image must not exceed 4 MB.
25
26Typically, you'll need angelboot to load the kernel.
27The 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
39Then load the kernel and ramdisk with::
40
41 angelboot -f angelboot.opt zImage
42
43The first Brutus serial port (assumed to be linked to /dev/ttyS0 on your
44host PC) is used by angel to load the kernel and ramdisk image. The serial
45console is provided through the second Brutus serial port. To access it,
46you may use minicom configured with /dev/ttyS1, 9600 baud, 8N1, no flow
47control.
48
49Currently supported
50===================
51
52 - RS232 serial ports
53 - audio output
54 - LCD screen
55 - keyboard
56
57The actual Brutus support may not be complete without extra patches.
58If such patches exist, they should be found from
59ftp.netwinder.org/users/n/nico.
60
61A full PCMCIA support is still missing, although it's possible to hack
62some drivers in order to drive already inserted cards at boot time with
63little modifications.
64
65Any contribution is welcome.
66
67Please send patches to nico@fluxnic.net
68
69Have 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========
2Freebird
3========
4
5Freebird-1.1 is produced by Legend(C), Inc.
6`http://web.archive.org/web/*/http://www.legend.com.cn`
7and software/linux maintained by Coventive(C), Inc.
8(http://www.coventive.com)
9
10Based on the Nicolas's strongarm kernel tree.
11
12Maintainer:
13
14Chester Kuo
15 - <chester@coventive.com>
16 - <chester@linux.org.tw>
17
18Author:
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=============================================
2ADS GraphicsClient Plus Single Board Computer
3=============================================
4
5For more details, contact Applied Data Systems or see
6http://www.applieddata.net/products.html
7
8The original Linux support for this product has been provided by
9Nicolas Pitre <nico@fluxnic.net>. Continued development work by
10Woojung Huh <whuh@applieddata.net>
11
12It's currently possible to mount a root filesystem via NFS providing a
13complete Linux environment. Otherwise a ramdisk image may be used. The
14board supports MTD/JFFS, so you could also mount something on there.
15
16Use 'make graphicsclient_config' before any 'make config'. This will set up
17defaults for GraphicsClient Plus support.
18
19The kernel zImage is linked to be loaded and executed at 0xc0200000.
20Also the following registers should have the specified values upon entry::
21
22 r0 = 0
23 r1 = 29 (this is the GraphicsClient architecture number)
24
25Linux can be used with the ADS BootLoader that ships with the
26newer rev boards. See their documentation on how to load Linux.
27Angel is not available for the GraphicsClient Plus AFAIK.
28
29There is a board known as just the GraphicsClient that ADS used to
30produce but has end of lifed. This code will not work on the older
31board with the ADS bootloader, but should still work with Angel,
32as outlined below. In any case, if you're planning on deploying
33something en masse, you should probably get the newer board.
34
35If using Angel on the older boards, here is a typical angel.opt option file
36if 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
49Then the kernel (and ramdisk if otherfile/otherbase lines above are
50uncommented) would be loaded with::
51
52 angelboot -f angelboot.opt zImage
53
54Here it is assumed that the board is connected to ttyS1 on your PC
55and that minicom is preconfigured with /dev/ttyS1, 38400 baud, 8N1, no flow
56control by default.
57
58If any other bootloader is used, ensure it accomplish the same, especially
59for r0/r1 register values before jumping into the kernel.
60
61
62Supported 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
79To do
80=====
81
82- UCB1200 audio with new ucb_generic layer
83- everything else! :-)
84
85Notes
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
102Any 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========================================
2ADS GraphicsMaster Single Board Computer
3========================================
4
5For more details, contact Applied Data Systems or see
6http://www.applieddata.net/products.html
7
8The original Linux support for this product has been provided by
9Nicolas Pitre <nico@fluxnic.net>. Continued development work by
10Woojung Huh <whuh@applieddata.net>
11
12Use 'make graphicsmaster_config' before any 'make config'.
13This will set up defaults for GraphicsMaster support.
14
15The kernel zImage is linked to be loaded and executed at 0xc0400000.
16
17Linux can be used with the ADS BootLoader that ships with the
18newer rev boards. See their documentation on how to load Linux.
19
20Supported 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
38To do
39=====
40
41- everything else! :-)
42
43Notes
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
60Any 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=======================
2Hoeft & Wessel Webpanel
3=======================
4
5The HUW_WEBPANEL is a product of the german company Hoeft & Wessel AG
6
7If you want more information, please visit
8http://www.hoeft-wessel.de
9
10To build the kernel::
11
12 make huw_webpanel_config
13 make oldconfig
14 [accept all defaults]
15 make zImage
16
17Mostly of the work is done by:
18Roman Jordan jor@hoeft-wessel.de
19Christoph Schulz schu@hoeft-wessel.de
20
212000/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====
2Itsy
3====
4
5Itsy is a research project done by the Western Research Lab, and Systems
6Research Center in Palo Alto, CA. The Itsy project is one of several
7research projects at Compaq that are related to pocket computing.
8
9For more information, see:
10
11 http://www.hpl.hp.com/downloads/crl/itsy/
12
13Notes on initial 2.4 Itsy support (8/27/2000) :
14
15The port was done on an Itsy version 1.5 machine with a daughtercard with
1664 Meg of DRAM and 32 Meg of Flash. The initial work includes support for
17serial console (to see what you're doing). No other devices have been
18enabled.
19
20To build, do a "make menuconfig" (or xmenuconfig) and select Itsy support.
21Disable Flash and LCD support. and then do a make zImage.
22Finally, you will need to cd to arch/arm/boot/tools and execute a make there
23to build the params-itsy program used to boot the kernel.
24
25In order to install the port of 2.4 to the itsy, You will need to set the
26configuration parameters in the monitor as follows::
27
28 Arg 1:0x08340000, Arg2: 0xC0000000, Arg3:18 (0x12), Arg4:0
29
30Make sure the start-routine address is set to 0x00060000.
31
32Next, flash the params-itsy program to 0x00060000 ("p 1 0x00060000" in the
33flash 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
36handhelds.org.
37
38The serial connection we established was at:
39
408-bit data, no parity, 1 stop bit(s), 115200.00 b/s. in the monitor, in the
41params-itsy program, and in the kernel itself. This can be changed, but
42not easily. The monitor parameters are easily changed, the params program
43setup is assembly outl's, and the kernel is a configuration item specific to
44the itsy. (i.e. grep for CONFIG_SA1100_ITSY and you'll find where it is.)
45
46
47This 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==========
2nanoEngine
3==========
4
5"nanoEngine" is a SA1110 based single board computer from
6Bright Star Engineering Inc. See www.brightstareng.com/arm
7for more info.
8(Ref: Stuart Adams <sja@brightstareng.com>)
9
10Also visit Larry Doolittle's "Linux for the nanoEngine" site:
11http://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========
2Pangolin
3========
4
5Pangolin is a StrongARM 1110-based evaluation platform produced
6by Dialogue Technology (http://www.dialogue.com.tw/).
7It has EISA slots for ease of configuration with SDRAM/Flash
8memory card, USB/Serial/Audio card, Compact Flash card,
9PCMCIA/IDE card and TFT-LCD card.
10
11To compile for Pangolin, you must issue the following commands::
12
13 make pangolin_config
14 make oldconfig
15 make zImage
16
17Supported 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====
2PLEB
3====
4
5The PLEB project was started as a student initiative at the School of
6Computer Science and Engineering, University of New South Wales to make a
7pocket computer capable of running the Linux Kernel.
8
9PLEB support has yet to be fully integrated.
10
11For 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=====
2Tifon
3=====
4
5More info has to come...
6
7Contact: 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====
2Yopy
3====
4
5See 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==========================
4Samsung S3C24XX SoC Family 4Samsung 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 @@
1vrl4
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
5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27
8
9
10
11--------
120. INDEX
13--------
14
15 1. DRIVER INFORMATION
16 2. DEVICE INFORMATION
17 3. WIRING
18 4. USERSPACE PROGRAMMING
19
20
21---------------------
221. DRIVER INFORMATION
23---------------------
24
25This driver supports a cfag12864b LCD.
26
27
28---------------------
292. DEVICE INFORMATION
30---------------------
31
32Manufacturer: Crystalfontz
33Device Name: Crystalfontz 12864b LCD Series
34Device Code: cfag12864b
35Webpage: http://www.crystalfontz.com
36Device Webpage: http://www.crystalfontz.com/products/12864b/
37Type: LCD (Liquid Crystal Display)
38Width: 128
39Height: 64
40Colors: 2 (B/N)
41Controller: ks0108
42Controllers: 2
43Pages: 8 each controller
44Addresses: 64 each page
45Data size: 1 byte each address
46Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte
47
48
49---------
503. WIRING
51---------
52
53The cfag12864b LCD Series don't have official wiring.
54
55The common wiring is done to the parallel port as shown:
56
57Parallel Port cfag12864b
58
59 Name Pin# Pin# Name
60
61Strobe ( 1)------------------------------(17) Enable
62Data 0 ( 2)------------------------------( 4) Data 0
63Data 1 ( 3)------------------------------( 5) Data 1
64Data 2 ( 4)------------------------------( 6) Data 2
65Data 3 ( 5)------------------------------( 7) Data 3
66Data 4 ( 6)------------------------------( 8) Data 4
67Data 5 ( 7)------------------------------( 9) Data 5
68Data 6 ( 8)------------------------------(10) Data 6
69Data 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
77Select (17)------------------------------(16) Data / Instruction
78Ground (18)---[GND] [+5v]---(19) LED +
79Ground (19)---[GND]
80Ground (20)---[GND] E A Values:
81Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm
82Ground (22)---[GND] | - P1 = Preset = 10 Kohm
83Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm
84Ground (24)---[GND] | |
85Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED -
86
87
88------------------------
894. USERSPACE PROGRAMMING
90------------------------
91
92The cfag12864bfb describes a framebuffer device (/dev/fbX).
93
94It has a size of 1024 bytes = 1 Kbyte.
95Each bit represents one pixel. If the bit is high, the pixel will
96turn on. If the pixel is low, the pixel will turn off.
97
98You can use the framebuffer as a file: fopen, fwrite, fclose...
99Although the LCD won't get updated until the next refresh time arrives.
100
101Also, you can mmap the framebuffer: open & mmap, munmap & close...
102which is the best option for most uses.
103
104Check samples/auxdisplay/cfag12864b-example.c
105for 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
5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27
8
9
10
11--------
120. INDEX
13--------
14
15 1. DRIVER INFORMATION
16 2. DEVICE INFORMATION
17 3. WIRING
18
19
20---------------------
211. DRIVER INFORMATION
22---------------------
23
24This driver supports the ks0108 LCD controller.
25
26
27---------------------
282. DEVICE INFORMATION
29---------------------
30
31Manufacturer: Samsung
32Device Name: KS0108 LCD Controller
33Device Code: ks0108
34Webpage: -
35Device Webpage: -
36Type: LCD Controller (Liquid Crystal Display Controller)
37Width: 64
38Height: 64
39Colors: 2 (B/N)
40Pages: 8
41Addresses: 64 each page
42Data size: 1 byte each address
43Memory size: 8 * 64 * 1 = 512 bytes
44
45
46---------
473. WIRING
48---------
49
50The driver supports data parallel port wiring.
51
52If you aren't building LCD related hardware, you should check
53your LCD specific wiring information in the same folder.
54
55For 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
32This API deals with 2 basic operations: 32This 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
501. Normally (no quirks), we would do it like this: 511. Normally (no quirks), we would do it like this:
51 52
5263 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::
537 6 5 4 54
5431 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
553 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
57That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the 60That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the
58LSByte (0) of the u64 sits at memory offset 7. 61LSByte (0) of the u64 sits at memory offset 7.
@@ -63,10 +66,12 @@ comments as "logical" notation.
63 66
642. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this: 672. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this:
65 68
6656 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::
677 6 5 4 70
6824 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
693 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
71That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but 76That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but
72inverts bit offsets inside a byte. 77inverts bit offsets inside a byte.
@@ -74,10 +79,12 @@ inverts bit offsets inside a byte.
74 79
753. If QUIRK_LITTLE_ENDIAN is set, we do it like this: 803. If QUIRK_LITTLE_ENDIAN is set, we do it like this:
76 81
7739 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::
784 5 6 7 83
797 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
800 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
82Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every 89Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every
83byte from each 4-byte word is placed at its mirrored position compared to 90byte from each 4-byte word is placed at its mirrored position compared to
@@ -86,18 +93,22 @@ the boundary of that word.
864. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it 934. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it
87 like this: 94 like this:
88 95
8932 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::
904 5 6 7 97
910 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
920 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
955. If just QUIRK_LSW32_IS_FIRST is set, we do it like this: 1045. If just QUIRK_LSW32_IS_FIRST is set, we do it like this:
96 105
9731 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::
983 2 1 0 107
9963 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
1007 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
102In this case the 8 byte memory region is interpreted as follows: first 113In this case the 8 byte memory region is interpreted as follows: first
1034 bytes correspond to the least significant 4-byte word, next 4 bytes to 1144 bytes correspond to the least significant 4-byte word, next 4 bytes to
@@ -107,28 +118,34 @@ the more significant 4-byte word.
1076. If QUIRK_LSW32_IS_FIRST and QUIRK_MSB_ON_THE_RIGHT are set, we do it like 1186. If QUIRK_LSW32_IS_FIRST and QUIRK_MSB_ON_THE_RIGHT are set, we do it like
108 this: 119 this:
109 120
11024 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::
1113 2 1 0 122
11256 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
1137 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
1167. If QUIRK_LSW32_IS_FIRST and QUIRK_LITTLE_ENDIAN are set, it looks like 1297. If QUIRK_LSW32_IS_FIRST and QUIRK_LITTLE_ENDIAN are set, it looks like
117 this: 130 this:
118 131
1197 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::
1200 1 2 3 133
12139 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
1224 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
1258. If QUIRK_LSW32_IS_FIRST, QUIRK_LITTLE_ENDIAN and QUIRK_MSB_ON_THE_RIGHT 1408. 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
1280 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::
1290 1 2 3 144
13032 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
1314 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
134We always think of our offsets as if there were no quirk, and we translate 151We 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
47For each i2c child node, an I2C child bus will be created. They will 47For each i2c child node, an I2C child bus will be created. They will
48be numbered based on their order in the device tree. 48be 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
4On Sun8i-A33 SoCs, the audio is separated in different parts: 4On 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
3Devicetree bindings are written using json-schema vocabulary. Schema files are
4written in a JSON compatible subset of YAML. YAML is used instead of JSON as it
5considered more human readable and has some advantages such as allowing
6comments (Prefixed with '#').
7
8## Schema Contents
9
10Each schema doc is a structured json-schema which is defined by a set of
11top-level properties. Generally, there is one binding defined per file. The
12top-level json-schema properties used are:
13
14- __$id__ - A json-schema unique identifier string. The string must be a valid
15URI typically containing the binding's filename and path. For DT schema, it must
16begin with "http://devicetree.org/schemas/". The URL is used in constructing
17references to other files specified in schema "$ref" properties. A $ref values
18with a leading '/' will have the hostname prepended. A $ref value a relative
19path or filename only will be prepended with the hostname and path components
20of the current schema file's '$id' value. A URL is used even for local files,
21but 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)
28for maintainers of this binding.
29
30- __description__ - Optional. A multi-line text block containing any detailed
31information about this binding. It should contain things such as what the block
32or device does, standards the device conforms to, and links to datasheets for
33more information.
34
35- __select__ - Optional. A json-schema used to match nodes for applying the
36schema. By default without 'select', nodes are matched against their possible
37compatible 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
40include other schemas the binding conforms to. This may be schemas for a
41particular class of devices such as I2C or SPI controllers.
42
43- __properties__ - A set of sub-schema defining all the DT properties for the
44binding. The exact schema syntax depends on whether properties are known,
45common 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
48under 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
55must always be present.
56
57- __examples__ - Optional. A list of one or more DTS hunks implementing the
58binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead.
59
60Unless noted otherwise, all properties are required.
61
62## Property Schema
63
64The 'properties' section of the schema contains all the DT properties for a
65binding. Each property contains a set of constraints using json-schema
66vocabulary for that property. The properties schemas are what is used for
67validation of DT files.
68
69For common properties, only additional constraints not covered by the common
70binding schema need to be defined such as how many values are valid or what
71possible values are valid.
72
73Vendor specific properties will typically need more detailed schema. With the
74exception of boolean properties, they should have a reference to a type in
75schemas/types.yaml. A "description" property is always required.
76
77The Devicetree schemas don't exactly match the YAML encoded DT data produced by
78dtc. They are simplified to make them more compact and avoid a bunch of
79boilerplate. The tools process the schema files to produce the final schema for
80validation. There are currently 2 transformations the tools perform.
81
82The default for arrays in json-schema is they are variable sized and allow more
83entries than explicitly defined. This can be restricted by defining 'minItems',
84'maxItems', and 'additionalItems'. However, for DeviceTree Schemas, a fixed
85size is desired in most cases, so these properties are added based on the
86number of entries in an 'items' list.
87
88The YAML Devicetree format also makes all string values an array and scalar
89values a matrix (in order to define groupings) even when only a single value
90is present. Single entries in schemas are fixed up to match this encoding.
91
92## Testing
93
94### Dependencies
95
96The DT schema project must be installed in order to validate the DT schema
97binding documents and validate DTS files using the DT schema. The DT schema
98project can be installed with pip:
99
100`pip3 install git+https://github.com/devicetree-org/dt-schema.git@master`
101
102dtc must also be built with YAML output support enabled. This requires that
103libyaml and its headers be installed on the host system.
104
105### Running checks
106
107The DT schema binding documents must be validated using the meta-schema (the
108schema for the schema) to ensure they are both valid json-schema and valid
109binding schema. All of the DT binding documents can be validated using the
110`dt_binding_check` target:
111
112`make dt_binding_check`
113
114In order to perform validation of DT source files, use the `dtbs_check` target:
115
116`make dtbs_check`
117
118This will first run the `dt_binding_check` which generates the processed schema.
119
120It 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
3Writing DeviceTree Bindings in json-schema
4==========================================
5
6Devicetree bindings are written using json-schema vocabulary. Schema files are
7written in a JSON compatible subset of YAML. YAML is used instead of JSON as it
8considered more human readable and has some advantages such as allowing
9comments (Prefixed with '#').
10
11Schema Contents
12---------------
13
14Each schema doc is a structured json-schema which is defined by a set of
15top-level properties. Generally, there is one binding defined per file. The
16top-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
31title
32 A one line description on the contents of the binding schema.
33
34maintainers
35 A DT specific property. Contains a list of email address(es)
36 for maintainers of this binding.
37
38description
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
44select
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
59A property can also define a child DT node with child properties defined
60under it.
61
62For more details on properties sections, see 'Property Schema' section.
63
64patternProperties
65 Optional. Similar to 'properties', but names are regex.
66
67required
68 A list of DT properties from the 'properties' section that
69 must always be present.
70
71examples
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
75Unless noted otherwise, all properties are required.
76
77Property Schema
78---------------
79
80The 'properties' section of the schema contains all the DT properties for a
81binding. Each property contains a set of constraints using json-schema
82vocabulary for that property. The properties schemas are what is used for
83validation of DT files.
84
85For common properties, only additional constraints not covered by the common
86binding schema need to be defined such as how many values are valid or what
87possible values are valid.
88
89Vendor specific properties will typically need more detailed schema. With the
90exception of boolean properties, they should have a reference to a type in
91schemas/types.yaml. A "description" property is always required.
92
93The Devicetree schemas don't exactly match the YAML encoded DT data produced by
94dtc. They are simplified to make them more compact and avoid a bunch of
95boilerplate. The tools process the schema files to produce the final schema for
96validation. There are currently 2 transformations the tools perform.
97
98The default for arrays in json-schema is they are variable sized and allow more
99entries than explicitly defined. This can be restricted by defining 'minItems',
100'maxItems', and 'additionalItems'. However, for DeviceTree Schemas, a fixed
101size is desired in most cases, so these properties are added based on the
102number of entries in an 'items' list.
103
104The YAML Devicetree format also makes all string values an array and scalar
105values a matrix (in order to define groupings) even when only a single value
106is present. Single entries in schemas are fixed up to match this encoding.
107
108Testing
109-------
110
111Dependencies
112~~~~~~~~~~~~
113
114The DT schema project must be installed in order to validate the DT schema
115binding documents and validate DTS files using the DT schema. The DT schema
116project can be installed with pip::
117
118 pip3 install git+https://github.com/devicetree-org/dt-schema.git@master
119
120dtc must also be built with YAML output support enabled. This requires that
121libyaml and its headers be installed on the host system.
122
123Running checks
124~~~~~~~~~~~~~~
125
126The DT schema binding documents must be validated using the meta-schema (the
127schema for the schema) to ensure they are both valid json-schema and valid
128binding schema. All of the DT binding documents can be validated using the
129``dt_binding_check`` target::
130
131 make dt_binding_check
132
133In order to perform validation of DT source files, use the `dtbs_check` target::
134
135 make dtbs_check
136
137This will first run the `dt_binding_check` which generates the processed schema.
138
139It 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
147json-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
85After loading the driver, you can instantiate the device as 85After loading the driver, you can instantiate the device as
86described in 'Documentation/i2c/instantiating-devices'. 86described in 'Documentation/i2c/instantiating-devices.rst'.
87If you have multiple BMCs, each connected to your Satellite MC via 87If you have multiple BMCs, each connected to your Satellite MC via
88a different I2C bus, you can instantiate a device for each of 88a different I2C bus, you can instantiate a device for each of
89those BMCs. 89those 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
60The main API is spi_nor_scan(). Before you call the hook, a driver should 60The main API is spi_nor_scan(). Before you call the hook, a driver should
61initialize the necessary fields for spi_nor{}. Please see 61initialize the necessary fields for spi_nor{}. Please see
62drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to fsl-quadspi.c 62drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to spi-fsl-qspi.c
63when you want to write a new driver for a SPI NOR controller. 63when you want to write a new driver for a SPI NOR controller.
64Another API is spi_nor_restore(), this is used to restore the status of SPI 64Another API is spi_nor_restore(), this is used to restore the status of SPI
65flash chip such as addressing mode. Call it whenever detach the driver from 65flash 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=======
4Thermal 4Thermal
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
552sustainable_power 552sustainable_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
587k_d 587k_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
42User can set any temperature between 0 to TJ-Max temperature. Temperature units 42User can set any temperature between 0 to TJ-Max temperature. Temperature units
43are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-api.rst" for 43are in milli-degree Celsius. Refer to "Documentation/driver-api/thermal/sysfs-api.rst" for
44thermal sys-fs details. 44thermal sys-fs details.
45 45
46Any value other than 0 in these trip points, can trigger thermal notifications. 46Any 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=================
2Directory Locking
3=================
4
5
6Locking scheme used for directory operations is based on two
2kinds of locks - per-inode (->i_rwsem) and per-filesystem 7kinds 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 10When taking the i_rwsem on multiple non-directory objects, we
6always acquire the locks in order by increasing address. We'll call 11always acquire the locks in order by increasing address. We'll call
7that "inode pointer" order in the following. 12that "inode pointer" order in the following.
8 13
9 For our purposes all operations fall in 5 classes: 14For our purposes all operations fall in 5 classes:
10 15
111) read access. Locking rules: caller locks directory we are accessing. 161) read access. Locking rules: caller locks directory we are accessing.
12The lock is taken shared. 17The lock is taken shared.
@@ -27,25 +32,29 @@ NB: we might get away with locking the the source (and target in exchange
27case) shared. 32case) shared.
28 33
295) link creation. Locking rules: 345) 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
34All locks are exclusive. 41All locks are exclusive.
35 42
366) cross-directory rename. The trickiest in the whole bunch. Locking 436) cross-directory rename. The trickiest in the whole bunch. Locking
37rules: 44rules:
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
49All ->i_rwsem are taken exclusive. Again, we might get away with locking 58All ->i_rwsem are taken exclusive. Again, we might get away with locking
50the the source (and target in exchange case) shared. 59the 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
56If no directory is its own ancestor, the scheme above is deadlock-free. 65If no directory is its own ancestor, the scheme above is deadlock-free.
66
57Proof: 67Proof:
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
60objects - 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 90Now consider the minimal deadlock. Each process is blocked on
81attempt to acquire some lock and already holds at least one lock. Let's 91attempt to acquire some lock and already holds at least one lock. Let's
82consider the set of contended locks. First of all, filesystem lock is 92consider the set of contended locks. First of all, filesystem lock is
83not contended, since any process blocked on it is not holding any locks. 93not contended, since any process blocked on it is not holding any locks.
84Thus all processes are blocked on ->i_rwsem. 94Thus all processes are blocked on ->i_rwsem.
85 95
86 By (3), any process holding a non-directory lock can only be 96By (3), any process holding a non-directory lock can only be
87waiting on another non-directory lock with a larger address. Therefore 97waiting on another non-directory lock with a larger address. Therefore
88the process holding the "largest" such lock can always make progress, and 98the process holding the "largest" such lock can always make progress, and
89non-directory objects are not included in the set of contended locks. 99non-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 101Thus link creation can't be a part of deadlock - it can't be
92blocked on source and it means that it doesn't hold any locks. 102blocked 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 104Any contended object is either held by cross-directory rename or
95has a child that is also contended. Indeed, suppose that it is held by 105has a child that is also contended. Indeed, suppose that it is held by
96operation other than cross-directory rename. Then the lock this operation 106operation other than cross-directory rename. Then the lock this operation
97is blocked on belongs to child of that object due to (1). 107is 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. 109It means that one of the operations is cross-directory rename.
100Otherwise the set of contended objects would be infinite - each of them 110Otherwise the set of contended objects would be infinite - each of them
101would have a contended child and we had assumed that no object is its 111would have a contended child and we had assumed that no object is its
102own descendent. Moreover, there is exactly one cross-directory rename 112own 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 115Consider the object blocking the cross-directory rename. One
106of its descendents is locked by cross-directory rename (otherwise we 116of its descendents is locked by cross-directory rename (otherwise we
107would again have an infinite set of contended objects). But that 117would again have an infinite set of contended objects). But that
108means that cross-directory rename is taking locks out of order. Due 118means 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.
112Contradiction. I.e. deadlock is impossible. Q.E.D. 122Contradiction. I.e. deadlock is impossible. Q.E.D.
113 123
114 124
115 These operations are guaranteed to avoid loop creation. Indeed, 125These operations are guaranteed to avoid loop creation. Indeed,
116the only operation that could introduce loops is cross-directory rename. 126the only operation that could introduce loops is cross-directory rename.
117Since the only new (parent, child) pair added by rename() is (new parent, 127Since the only new (parent, child) pair added by rename() is (new parent,
118source), such loop would have to contain these objects and the rest of it 128source), 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
123we had acquired filesystem lock and rename() would fail with -ELOOP in that 133we had acquired filesystem lock and rename() would fail with -ELOOP in that
124case. 134case.
125 135
126 While this locking scheme works for arbitrary DAGs, it relies on 136While this locking scheme works for arbitrary DAGs, it relies on
127ability to check that directory is a descendent of another object. Current 137ability to check that directory is a descendent of another object. Current
128implementation assumes that directory graph is a tree. This assumption is 138implementation assumes that directory graph is a tree. This assumption is
129also preserved by all operations (cross-directory rename on a tree that would 139also preserved by all operations (cross-directory rename on a tree that would
130not introduce a cycle will leave it a tree and link() fails for directories). 140not 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 142Notice that "directory" in the above == "anything that might have
133children", so if we are going to introduce hybrid objects we will need 143children", so if we are going to introduce hybrid objects we will need
134either to make sure that link(2) doesn't work for them or to make changes 144either to make sure that link(2) doesn't work for them or to make changes
135in is_subdir() that would make it work even in presence of such beasts. 145in 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
24Filesystem support layers 28Filesystem 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=======
2Locking
3=======
4
5The text below describes the locking rules for VFS-related methods.
2It is (believed to be) up-to-date. *Please*, if you change anything in 6It is (believed to be) up-to-date. *Please*, if you change anything in
3prototypes or locking protocols - update this file. And update the relevant 7prototypes or locking protocols - update this file. And update the relevant
4instances in the tree, don't leave that to maintainers of filesystems/devices/ 8instances in the tree, don't leave that to maintainers of filesystems/devices/
5etc. At the very least, put the list of dubious cases in the end of this file. 9etc. At the very least, put the list of dubious cases in the end of this file.
6Don't turn it into log - maintainers of out-of-the-tree code are supposed to 10Don't turn it into log - maintainers of out-of-the-tree code are supposed to
7be able to use diff(1). 11be able to use diff(1).
8 Thing currently missing here: socket operations. Alexey?
9 12
10--------------------------- dentry_operations -------------------------- 13Thing currently missing here: socket operations. Alexey?
11prototypes: 14
15dentry_operations
16=================
17
18prototypes::
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
26locking rules: 34locking rules:
27 rename_lock ->d_lock may block rcu-walk 35
28d_revalidate: no no yes (ref-walk) maybe 36================== =========== ======== ============== ========
29d_weak_revalidate:no no yes no 37ops rename_lock ->d_lock may block rcu-walk
30d_hash no no no maybe 38================== =========== ======== ============== ========
31d_compare: yes no no maybe 39d_revalidate: no no yes (ref-walk) maybe
32d_delete: no yes no no 40d_weak_revalidate: no no yes no
33d_init: no no yes no 41d_hash no no no maybe
34d_release: no no yes no 42d_compare: yes no no maybe
35d_prune: no yes no no 43d_delete: no yes no no
36d_iput: no no yes no 44d_init: no no yes no
37d_dname: no no no no 45d_release: no no yes no
38d_automount: no no yes no 46d_prune: no yes no no
39d_manage: no no yes (ref-walk) maybe 47d_iput: no no yes no
40d_real no no yes no 48d_dname: no no no no
41 49d_automount: no no yes no
42--------------------------- inode_operations --------------------------- 50d_manage: no no yes (ref-walk) maybe
43prototypes: 51d_real no no yes no
52================== =========== ======== ============== ========
53
54inode_operations
55================
56
57prototypes::
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
69locking rules: 84locking rules:
70 all may block 85 all may block
71 i_rwsem(inode) 86
87============ =============================================
88ops i_rwsem(inode)
89============ =============================================
72lookup: shared 90lookup: shared
73create: exclusive 91create: exclusive
74link: exclusive (both) 92link: exclusive (both)
@@ -89,17 +107,21 @@ fiemap: no
89update_time: no 107update_time: no
90atomic_open: exclusive 108atomic_open: exclusive
91tmpfile: no 109tmpfile: 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
98See Documentation/filesystems/directory-locking for more detailed discussion 117See Documentation/filesystems/directory-locking.rst for more detailed discussion
99of the locking scheme for directory operations. 118of the locking scheme for directory operations.
100 119
101----------------------- xattr_handler operations ----------------------- 120xattr_handler operations
102prototypes: 121========================
122
123prototypes::
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
111locking rules: 133locking rules:
112 all may block 134 all may block
113 i_rwsem(inode) 135
136===== ==============
137ops i_rwsem(inode)
138===== ==============
114list: no 139list: no
115get: no 140get: no
116set: exclusive 141set: exclusive
142===== ==============
143
144super_operations
145================
146
147prototypes::
117 148
118--------------------------- super_operations ---------------------------
119prototypes:
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
139locking rules: 168locking rules:
140 All may block [not true, see below] 169 All may block [not true, see below]
141 s_umount 170
171====================== ============ ========================
172ops s_umount note
173====================== ============ ========================
142alloc_inode: 174alloc_inode:
143free_inode: called from RCU callback 175free_inode: called from RCU callback
144destroy_inode: 176destroy_inode:
@@ -157,6 +189,7 @@ show_options: no (namespace_sem)
157quota_read: no (see below) 189quota_read: no (see below)
158quota_write: no (see below) 190quota_write: no (see below)
159bdev_try_to_free_page: no (see below) 191bdev_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
162compat), but that's an accident of bad API; s_umount is used to pin 195compat), 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
164identify the superblock. Everything else (statfs(), fstatfs(), etc.) 197identify the superblock. Everything else (statfs(), fstatfs(), etc.)
165doesn't hold it when calling ->statfs() - superblock is pinned down 198doesn't hold it when calling ->statfs() - superblock is pinned down
166by resolving the pathname passed to syscall. 199by 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
168be the only ones operating on the quota file by the quota code (via 202be the only ones operating on the quota file by the quota code (via
169dqio_sem) (unless an admin really wants to screw up something and 203dqio_sem) (unless an admin really wants to screw up something and
170writes to quota files with quotas on). For other details about locking 204writes to quota files with quotas on). For other details about locking
171see also dquot_operations section. 205see 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
173the block device inode. See there for more details. 208the block device inode. See there for more details.
174 209
175--------------------------- file_system_type --------------------------- 210file_system_type
176prototypes: 211================
212
213prototypes::
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
180locking rules: 219locking rules:
181 may block 220
221======= =========
222ops may block
223======= =========
182mount yes 224mount yes
183kill_sb yes 225kill_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
186on return. 229on 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,
188unlocks and drops the reference. 232unlocks and drops the reference.
189 233
190--------------------------- address_space_operations -------------------------- 234address_space_operations
191prototypes: 235========================
236prototypes::
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:
218locking rules: 264locking 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====================== ======================== =========
268ops PageLocked(page) i_rwsem
269====================== ======================== =========
222writepage: yes, unlocks (see below) 270writepage: yes, unlocks (see below)
223readpage: yes, unlocks 271readpage: yes, unlocks
224writepages: 272writepages:
225set_page_dirty no 273set_page_dirty no
226readpages: 274readpages:
227write_begin: locks the page exclusive 275write_begin: locks the page exclusive
228write_end: yes, unlocks exclusive 276write_end: yes, unlocks exclusive
229bmap: 277bmap:
230invalidatepage: yes 278invalidatepage: yes
231releasepage: yes 279releasepage: yes
@@ -239,17 +287,18 @@ is_partially_uptodate: yes
239error_remove_page: yes 287error_remove_page: yes
240swap_activate: no 288swap_activate: no
241swap_deactivate: no 289swap_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
244the request handler (/dev/loop). 293the 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
247completion. 296completion.
248 297
249 ->readpages() populates the pagecache with the passed pages and starts 298->readpages() populates the pagecache with the passed pages and starts
250I/O against them. They come unlocked upon I/O completion. 299I/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
254depending upon the mode. 303depending 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
297radix tree. This incoherency can lead to all sorts of hard-to-debug problems 346radix tree. This incoherency can lead to all sorts of hard-to-debug problems
298in the filesystem like having dirty inodes at umount and losing written data. 347in 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
301sync operations. The address_space should start I/O against at least 350sync 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
303written. The address_space implementation may write more (or less) pages 352which is written. The address_space implementation may write more (or less)
304than *nr_to_write asks for, but it should try to be reasonably close. If 353pages than ``*nr_to_write`` asks for, but it should try to be reasonably close.
305nr_to_write is NULL, all dirty pages must be written. 354If nr_to_write is NULL, all dirty pages must be written.
306 355
307writepages should _only_ write pages which are present on 356writepages should _only_ write pages which are present on
308mapping->io_pages. 357mapping->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
311when the target page is marked as needing writeback. It may be called 360when the target page is marked as needing writeback. It may be called
312under spinlock (it cannot block) and is sometimes called with the page 361under spinlock (it cannot block) and is sometimes called with the page
313not locked. 362not 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
316filesystems and by the swapper. The latter will eventually go away. Please, 365filesystems and by the swapper. The latter will eventually go away. Please,
317keep it that way and don't breed new callers. 366keep 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
320some or all of the buffers from the page when it is being truncated. It 369some or all of the buffers from the page when it is being truncated. It
321returns zero on success. If ->invalidatepage is zero, the kernel uses 370returns zero on success. If ->invalidatepage is zero, the kernel uses
322block_invalidatepage() instead. 371block_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
325buffers from the page in preparation for freeing it. It returns zero to 374buffers from the page in preparation for freeing it. It returns zero to
326indicate that the buffers are (or may be) freeable. If ->releasepage is zero, 375indicate that the buffers are (or may be) freeable. If ->releasepage is zero,
327the kernel assumes that the fs has no private interest in the buffers. 376the 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
330from the page cache. 379from 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
333it is still found to be dirty. It returns zero if the page was successfully 382it is still found to be dirty. It returns zero if the page was successfully
334cleaned, or an error value if not. Note that in order to prevent the page 383cleaned, or an error value if not. Note that in order to prevent the page
335getting mapped back in and redirtied, it needs to be kept locked 384getting mapped back in and redirtied, it needs to be kept locked
336across the entire operation. 385across 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
339files backing (non block device backed) swapfiles. A return value 388files backing (non block device backed) swapfiles. A return value
340of zero indicates success, in which case this file can be used for 389of zero indicates success, in which case this file can be used for
341backing swapspace. The swapspace operations will be proxied to the 390backing swapspace. The swapspace operations will be proxied to the
342address space operations. 391address space operations.
343 392
344 ->swap_deactivate() will be called in the sys_swapoff() 393->swap_deactivate() will be called in the sys_swapoff()
345path after ->swap_activate() returned success. 394path after ->swap_activate() returned success.
346 395
347----------------------- file_lock_operations ------------------------------ 396file_lock_operations
348prototypes: 397====================
398
399prototypes::
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
353locking rules: 405locking rules:
354 inode->i_lock may block 406
407=================== ============= =========
408ops inode->i_lock may block
409=================== ============= =========
355fl_copy_lock: yes no 410fl_copy_lock: yes no
356fl_release_private: maybe maybe[1] 411fl_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 419lock_manager_operations
359to block. Leases however can still be freed while the i_lock is held and 420=======================
360so fl_release_private called on a lease should not block. 421
422prototypes::
361 423
362----------------------- lock_manager_operations ---------------------------
363prototypes:
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
369locking rules: 429locking rules:
370 430
371 inode->i_lock blocked_lock_lock may block 431========== ============= ================= =========
432ops inode->i_lock blocked_lock_lock may block
433========== ============= ================= =========
372lm_notify: yes yes no 434lm_notify: yes yes no
373lm_grant: no no no 435lm_grant: no no no
374lm_break: yes no no 436lm_break: yes no no
375lm_change yes no no 437lm_change yes no no
438========== ============= ================= =========
439
440buffer_head
441===========
442
443prototypes::
376 444
377--------------------------- buffer_head -----------------------------------
378prototypes:
379 void (*b_end_io)(struct buffer_head *bh, int uptodate); 445 void (*b_end_io)(struct buffer_head *bh, int uptodate);
380 446
381locking rules: 447locking rules:
382 called from interrupts. In other words, extreme care is needed here. 448
449called from interrupts. In other words, extreme care is needed here.
383bh is locked, but that's all warranties we have here. Currently only RAID1, 450bh is locked, but that's all warranties we have here. Currently only RAID1,
384highmem, fs/buffer.c, and fs/ntfs/aops.c are providing these. Block devices 451highmem, fs/buffer.c, and fs/ntfs/aops.c are providing these. Block devices
385call this method upon the IO completion. 452call this method upon the IO completion.
386 453
387--------------------------- block_device_operations ----------------------- 454block_device_operations
388prototypes: 455=======================
456prototypes::
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
401locking rules: 470locking rules:
402 bd_mutex 471
472======================= ===================
473ops bd_mutex
474======================= ===================
403open: yes 475open: yes
404release: yes 476release: yes
405ioctl: no 477ioctl: no
@@ -410,6 +482,7 @@ unlock_native_capacity: no
410revalidate_disk: no 482revalidate_disk: no
411getgeo: no 483getgeo: no
412swap_slot_free_notify: no (see below) 484swap_slot_free_notify: no (see below)
485======================= ===================
413 486
414media_changed, unlock_native_capacity and revalidate_disk are called only from 487media_changed, unlock_native_capacity and revalidate_disk are called only from
415check_disk_change(). 488check_disk_change().
@@ -418,8 +491,11 @@ swap_slot_free_notify is called with swap_lock and sometimes the page lock
418held. 491held.
419 492
420 493
421--------------------------- file_operations ------------------------------- 494file_operations
422prototypes: 495===============
496
497prototypes::
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
460locking rules: 535locking rules:
461 All may block. 536 All may block.
@@ -490,8 +565,11 @@ in sys_read() and friends.
490the lease within the individual filesystem to record the result of the 565the lease within the individual filesystem to record the result of the
491operation 566operation
492 567
493--------------------------- dquot_operations ------------------------------- 568dquot_operations
494prototypes: 569================
570
571prototypes::
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
504What filesystem should expect from the generic quota functions: 582What filesystem should expect from the generic quota functions:
505 583
506 FS recursion Held locks when called 584============== ============ =========================
585ops FS recursion Held locks when called
586============== ============ =========================
507write_dquot: yes dqonoff_sem or dqptr_sem 587write_dquot: yes dqonoff_sem or dqptr_sem
508acquire_dquot: yes dqonoff_sem or dqptr_sem 588acquire_dquot: yes dqonoff_sem or dqptr_sem
509release_dquot: yes dqonoff_sem or dqptr_sem 589release_dquot: yes dqonoff_sem or dqptr_sem
510mark_dirty: no - 590mark_dirty: no -
511write_info: yes dqonoff_sem 591write_info: yes dqonoff_sem
592============== ============ =========================
512 593
513FS recursion means calling ->quota_read() and ->quota_write() from superblock 594FS recursion means calling ->quota_read() and ->quota_write() from superblock
514operations. 595operations.
515 596
516More details about quota locking can be found in fs/dquot.c. 597More details about quota locking can be found in fs/dquot.c.
517 598
518--------------------------- vm_operations_struct ----------------------------- 599vm_operations_struct
519prototypes: 600====================
601
602prototypes::
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
527locking rules: 611locking rules:
528 mmap_sem PageLocked(page) 612
613============= ======== ===========================
614ops mmap_sem PageLocked(page)
615============= ======== ===========================
529open: yes 616open: yes
530close: yes 617close: yes
531fault: yes can return with page locked 618fault: yes can return with page locked
@@ -533,8 +620,9 @@ map_pages: yes
533page_mkwrite: yes can return with page locked 620page_mkwrite: yes can return with page locked
534pfn_mkwrite: yes 621pfn_mkwrite: yes
535access: yes 622access: 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
538to be faulted in. The filesystem must find and return the page associated 626to be faulted in. The filesystem must find and return the page associated
539with the passed in "pgoff" in the vm_fault structure. If it is possible that 627with the passed in "pgoff" in the vm_fault structure. If it is possible that
540the page may be truncated and/or invalidated, then the filesystem must lock 628the 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
542subsequent truncate), and then return with VM_FAULT_LOCKED, and the page 630subsequent truncate), and then return with VM_FAULT_LOCKED, and the page
543locked. The VM will unlock the page. 631locked. 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.
546Filesystem should find and map pages associated with offsets from "start_pgoff" 634Filesystem should find and map pages associated with offsets from "start_pgoff"
547till "end_pgoff". ->map_pages() is called with page table locked and must 635till "end_pgoff". ->map_pages() is called with page table locked and must
548not block. If it's not possible to reach a page without blocking, 636not 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
552should be calculated relative to "pte". 640should 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
555about to become writeable. The filesystem again must ensure that there are 643about to become writeable. The filesystem again must ensure that there are
556no truncate/invalidate races, and then return with the page locked. If 644no truncate/invalidate races, and then return with the page locked. If
557the page has been truncated, the filesystem should not look up a new page 645the page has been truncated, the filesystem should not look up a new page
558like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which 646like the ->fault() handler, but simply return with VM_FAULT_NOPAGE, which
559will cause the VM to retry the fault. 647will 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
562VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is 650VM_PFNMAP or VM_MIXEDMAP with a page-less entry. Expected return is
563VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior 651VM_FAULT_NOPAGE. Or one of the VM_FAULT_ERROR types. The default behavior
564after this call is to make the pte read-write, unless pfn_mkwrite returns 652after this call is to make the pte read-write, unless pfn_mkwrite returns
565an error. 653an error.
566 654
567 ->access() is called when get_user_pages() fails in 655->access() is called when get_user_pages() fails in
568access_process_vm(), typically used to debug a process through 656access_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
570VM_IO | VM_PFNMAP VMAs. 658VM_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
2Making Filesystems Exportable 3Making Filesystems Exportable
3============================= 4=============================
@@ -42,9 +43,9 @@ filehandle fragment, there is no automatic creation of a path prefix
42for the object. This leads to two related but distinct features of 43for the object. This leads to two related but distinct features of
43the dcache that are not needed for normal filesystem access. 44the dcache that are not needed for normal filesystem access.
44 45
451/ The dcache must sometimes contain objects that are not part of the 461. 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.
472/ The dcache must be prepared for a newly found (via ->lookup) directory 482. 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
53To implement these features, the dcache has: 54To implement these features, the dcache has:
54 55
55a/ A dentry flag DCACHE_DISCONNECTED which is set on 56a. 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
74b/ A primitive for creation of secondary roots - d_obtain_root(inode). 75b. 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
79c/ Helper routines to allocate anonymous dentries, and to help attach 80c. 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
93Filesystem Issues 98Filesystem Issues
94----------------- 99-----------------
95 100
96For a filesystem to be exportable it must: 101For 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 120A file system implementation declares that instances of the filesystem
116are exportable by setting the s_export_op field in the struct 121are exportable by setting the s_export_op field in the struct
117super_block. This field must point to a "struct export_operations" 122super_block. This field must point to a "struct export_operations"
118struct which has the following members: 123struct 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 @@
1Changes since 2.5.0:
2
3---
4[recommended]
5
6New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(),
7 sb_set_blocksize() and sb_min_blocksize().
8
9Use them.
10
11(sb_find_get_block() replaces 2.4's get_hash_table())
12
13---
14[recommended]
15
16New methods: ->alloc_inode() and ->destroy_inode().
17
18Remove inode->u.foo_inode_i
19Declare
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
29Use FOO_I(inode) instead of &inode->u.foo_inode_i;
30
31Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate
32foo_inode_info and return the address of ->vfs_inode, the latter should free
33FOO_I(inode) (see in-tree filesystems for examples).
34
35Make them ->alloc_inode and ->destroy_inode in your super_operations.
36
37Keep in mind that now you need explicit initialization of private data
38typically between calling iget_locked() and unlocking the inode.
39
40At some point that will become mandatory.
41
42---
43[mandatory]
44
45Change 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
49Turn your foo_read_super() into a function that would return 0 in case of
50success and negative number in case of error (-EINVAL unless you have more
51informative error value to report). Call it foo_fill_super(). Now declare
52
53int 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
61filesystem).
62
63Replace DECLARE_FSTYPE... with explicit initializer and have ->get_sb set as
64foo_get_sb.
65
66---
67[mandatory]
68
69Locking change: ->s_vfs_rename_sem is taken only by cross-directory renames.
70Most likely there is no need to change anything, but if you relied on
71global exclusion between renames for some internal purpose - you need to
72change your internal locking. Otherwise exclusion warranties remain the
73same (i.e. parents and victim are locked, etc.).
74
75---
76[informational]
77
78Now we have the exclusion between ->lookup() and directory removal (by
79->rmdir() and ->rename()). If you used to need that exclusion and do
80it by internal locking (most of filesystems couldn't care less) - you
81can relax your locking.
82
83---
84[mandatory]
85
86->lookup(), ->truncate(), ->create(), ->unlink(), ->mknod(), ->mkdir(),
87->rmdir(), ->link(), ->lseek(), ->symlink(), ->rename()
88and ->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
90parts do not need BKL - better yet, now you can shift lock_kernel() and
91unlock_kernel() so that they would protect exactly what needs to be
92protected.
93
94---
95[mandatory]
96
97BKL is also moved from around sb operations. BKL should have been shifted into
98individual fs sb_op functions. If you don't need it, remove it.
99
100---
101[informational]
102
103check for ->link() target not being a directory is done by callers. Feel
104free to drop it...
105
106---
107[informational]
108
109->link() callers hold ->i_mutex on the object we are linking to. Some of your
110problems might be over...
111
112---
113[mandatory]
114
115new file_system_type method - kill_sb(superblock). If you are converting
116an 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
120FS_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()
126went 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
133watch for ->i_mutex-grabbing code that might be used by your ->setattr().
134Callers of notify_change() need ->i_mutex now.
135
136---
137[recommended]
138
139New super_block field "struct export_operations *s_export_op" for
140explicit support for exporting, e.g. via NFS. The structure is fully
141documented at its declaration in include/linux/fs.h, and in
142Documentation/filesystems/nfs/Exporting.
143
144Briefly it allows for the definition of decode_fh and encode_fh operations
145to encode and decode filehandles, and allows the filesystem to use
146a standard helper function for decode_fh, and provide file-system specific
147support for this helper, particularly get_parent.
148
149It is planned that this will be required for exporting once the code
150settles down a bit.
151
152[mandatory]
153
154s_export_op is now required for exporting a filesystem.
155isofs, ext2, ext3, resierfs, fat
156can be used as examples of very different filesystems.
157
158---
159[mandatory]
160
161iget4() and the read_inode2 callback have been superseded by iget5_locked()
162which 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
170number is not sufficient to identify the actual file object. 'set'
171should be a non-blocking function that initializes those parts of a
172newly created inode to allow the test function to succeed. 'data' is
173passed as an opaque value to both test and set functions.
174
175When the inode has been created by iget5_locked(), it will be returned with the
176I_NEW flag set and will still be locked. The filesystem then needs to finalize
177the initialization. Once the inode is initialized it must be unlocked by
178calling unlock_new_inode().
179
180The filesystem is responsible for setting (and possibly testing) i_ino
181when appropriate. There is also a simpler iget_locked function that
182just takes the superblock and inode number as arguments and does the
183test and set for you.
184
185e.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
196Note that if the process of setting up a new inode fails, then iget_failed()
197should be called on the inode to render it dead, and an appropriate error
198should 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()
209and let it call whatever you had as ->revlidate() + (for symlinks that
210had ->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
216if 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
222Audit your code and add locking if needed. Notice that any place that is
223not protected by the conditions above is risky even in the old tree - you
224had been relying on BKL and that's prone to screwups. Old tree had quite
225a few holes of that kind - unprotected access to ->d_parent leading to
226anything 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
238is still alive, but only because of the mess in drivers/s390/block/dasd.c.
239As 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
245return - that will guarantee the same locking you used to have. If
246your method or its parts do not need BKL - better yet, now you can
247shift lock_kernel() and unlock_kernel() so that they would protect
248exactly what needs to be protected.
249
250---
251[mandatory]
252
253->statfs() is now called without BKL held. BKL should have been
254shifted into individual fs sb_op functions where it's not clear that
255it'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
271deliberate; as soon as struct block_device * is propagated in a reasonable
272way by that code fixing will become trivial; until then nothing can be
273done.
274
275[mandatory]
276
277 block truncatation on error exit from ->write_begin, and ->direct_IO
278moved from generic methods (block_write_begin, cont_write_begin,
279nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at
280ext2_write_failed and callers for an example.
281
282[mandatory]
283
284 ->truncate is gone. The whole truncate sequence needs to be
285implemented in ->setattr, which is now mandatory for filesystems
286implementing on-disk size changes. Start with a copy of the old inode_setattr
287and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to
288be in order of zeroing blocks using block_truncate_page or similar helpers,
289size update and on finally on-disk truncation which should not fail.
290setattr_prepare (which used to be inode_change_ok) now includes the size checks
291for 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
296be used instead. It gets called whenever the inode is evicted, whether it has
297remaining links or not. Caller does *not* evict the pagecache or inode-associated
298metadata buffers; the method has to use truncate_inode_pages_final() to get rid
299of 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
303inode->i_lock held and it returns true if filesystems wants the inode to be
304dropped. As before, generic_drop_inode() is still the default and it's been
305updated appropriately. generic_delete_inode() is also alive and it consists
306simply 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
311before, if you are using inode-associated metadata buffers (i.e.
312mark_buffer_dirty_inode()), it's your responsibility to call
313invalidate_inode_buffers() before clear_inode().
314
315 NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
316if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput()
317may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly
318free the on-disk inode, you may end up doing that while ->write_inode() is writing
319to it.
320
321---
322[mandatory]
323
324 .d_delete() now only advises the dcache as to whether or not to cache
325unreferenced dentries, and is now only called when the dentry refcount goes to
3260. Even on 0 refcount transition, it must be able to tolerate being called 0,
3271, or more times (eg. constant, idempotent).
328
329---
330[mandatory]
331
332 .d_compare() calling convention and locking rules are significantly
333changed. Read updated documentation in Documentation/filesystems/vfs.rst (and
334look at examples of other filesystems) for guidance.
335
336---
337[mandatory]
338
339 .d_hash() calling convention and locking rules are significantly
340changed. Read updated documentation in Documentation/filesystems/vfs.rst (and
341look 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
346for details of what locks to replace dcache_lock with in order to protect
347particular things. Most of the time, a filesystem only needs ->d_lock, which
348protects *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
354via rcu-walk path walk (basically, if the file can have had a path name in the
355vfs namespace).
356
357 Even though i_dentry and i_rcu share storage in a union, we will
358initialize the former in inode_init_always(), so just leave it alone in
359the 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
365atomic operations and scalability hazards on dentries and inodes (see
366Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes
367(above) are examples of the changes required to support this. For more complex
368filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so
369no changes are required to the filesystem. However, this is costly and loses
370the benefits of rcu-walk mode. We will begin to add filesystem callbacks that
371are rcu-walk aware, shown below. Filesystems should take advantage of this
372where possible.
373
374--
375[mandatory]
376 d_revalidate is a callback that is made on every path element (if
377the filesystem provides it), which requires dropping out of rcu-walk mode. This
378may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be
379returned if the filesystem cannot handle rcu-walk. See
380Documentation/filesystems/vfs.rst for more details.
381
382 permission is an inode permission check that is called on many or all
383directory inodes on the way down a path walk (to check for exec permission). It
384must now be rcu-walk aware (mask & MAY_NOT_BLOCK). See
385Documentation/filesystems/vfs.rst for more details.
386
387--
388[mandatory]
389 In ->fallocate() you must check the mode option passed in. If your
390filesystem does not support hole punching (deallocating space in the middle of a
391file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode.
392Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set,
393so the i_size should not change when hole punching, even when puching the end of
394a file off.
395
396--
397[mandatory]
398 ->get_sb() is gone. Switch to use of ->mount(). Typically it's just
399a matter of switching from calling get_sb_... to mount_... and changing the
400function type. If you were doing it manually, just switch from setting ->mnt_root
401to some pointer to returning that pointer. On errors return ERR_PTR(...).
402
403--
404[mandatory]
405 ->permission() and generic_permission()have lost flags
406argument; 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
408has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl
409to read an ACL from disk.
410
411--
412[mandatory]
413 If you implement your own ->llseek() you must handle SEEK_HOLE and
414SEEK_DATA. You can hanle this by returning -EINVAL, but it would be nicer to
415support it in some way. The generic handler assumes that the entire file is
416data and there is a virtual hole at the end of the file. So if the provided
417offset is less than i_size and SEEK_DATA is specified, return the same offset.
418If the above is true for the offset and you are given SEEK_HOLE, return the end
419of 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
423filemap_write_and_wait_range() so that all dirty pages are synced out properly.
424You must also keep in mind that ->fsync() is not called with i_mutex held
425anymore, so if you require i_mutex locking you must make sure to take it and
426release it yourself.
427
428--
429[mandatory]
430 d_alloc_root() is gone, along with a lot of bugs caused by code
431misusing it. Replacement: d_make_root(inode). On success d_make_root(inode)
432allocates and returns a new dentry instantiated with the passed in inode.
433On failure NULL is returned and the passed in inode is dropped so the reference
434to inode is consumed in all cases and failure handling need not do any cleanup
435for the inode. If d_make_root(inode) is passed a NULL inode it returns NULL
436and 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
452two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that
453local filesystems can ignore tha argument - they are guaranteed that the
454object 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()
458in 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====================
2Changes since 2.5.0:
3====================
4
5---
6
7**recommended**
8
9New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(),
10sb_set_blocksize() and sb_min_blocksize().
11
12Use them.
13
14(sb_find_get_block() replaces 2.4's get_hash_table())
15
16---
17
18**recommended**
19
20New methods: ->alloc_inode() and ->destroy_inode().
21
22Remove inode->u.foo_inode_i
23
24Declare::
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
35Use FOO_I(inode) instead of &inode->u.foo_inode_i;
36
37Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate
38foo_inode_info and return the address of ->vfs_inode, the latter should free
39FOO_I(inode) (see in-tree filesystems for examples).
40
41Make them ->alloc_inode and ->destroy_inode in your super_operations.
42
43Keep in mind that now you need explicit initialization of private data
44typically between calling iget_locked() and unlocking the inode.
45
46At some point that will become mandatory.
47
48---
49
50**mandatory**
51
52Change 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
56Turn your foo_read_super() into a function that would return 0 in case of
57success and negative number in case of error (-EINVAL unless you have more
58informative 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
68filesystem).
69
70Replace DECLARE_FSTYPE... with explicit initializer and have ->get_sb set as
71foo_get_sb.
72
73---
74
75**mandatory**
76
77Locking change: ->s_vfs_rename_sem is taken only by cross-directory renames.
78Most likely there is no need to change anything, but if you relied on
79global exclusion between renames for some internal purpose - you need to
80change your internal locking. Otherwise exclusion warranties remain the
81same (i.e. parents and victim are locked, etc.).
82
83---
84
85**informational**
86
87Now we have the exclusion between ->lookup() and directory removal (by
88->rmdir() and ->rename()). If you used to need that exclusion and do
89it by internal locking (most of filesystems couldn't care less) - you
90can relax your locking.
91
92---
93
94**mandatory**
95
96->lookup(), ->truncate(), ->create(), ->unlink(), ->mknod(), ->mkdir(),
97->rmdir(), ->link(), ->lseek(), ->symlink(), ->rename()
98and ->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
100parts do not need BKL - better yet, now you can shift lock_kernel() and
101unlock_kernel() so that they would protect exactly what needs to be
102protected.
103
104---
105
106**mandatory**
107
108BKL is also moved from around sb operations. BKL should have been shifted into
109individual fs sb_op functions. If you don't need it, remove it.
110
111---
112
113**informational**
114
115check for ->link() target not being a directory is done by callers. Feel
116free 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
123problems might be over...
124
125---
126
127**mandatory**
128
129new file_system_type method - kill_sb(superblock). If you are converting
130an 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
136FS_LITTER is gone - just remove it from fs_flags.
137
138---
139
140**mandatory**
141
142FS_SINGLE is gone (actually, that had happened back when ->get_sb()
143went 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
151watch for ->i_mutex-grabbing code that might be used by your ->setattr().
152Callers of notify_change() need ->i_mutex now.
153
154---
155
156**recommended**
157
158New super_block field ``struct export_operations *s_export_op`` for
159explicit support for exporting, e.g. via NFS. The structure is fully
160documented at its declaration in include/linux/fs.h, and in
161Documentation/filesystems/nfs/exporting.rst.
162
163Briefly it allows for the definition of decode_fh and encode_fh operations
164to encode and decode filehandles, and allows the filesystem to use
165a standard helper function for decode_fh, and provide file-system specific
166support for this helper, particularly get_parent.
167
168It is planned that this will be required for exporting once the code
169settles down a bit.
170
171**mandatory**
172
173s_export_op is now required for exporting a filesystem.
174isofs, ext2, ext3, resierfs, fat
175can be used as examples of very different filesystems.
176
177---
178
179**mandatory**
180
181iget4() and the read_inode2 callback have been superseded by iget5_locked()
182which 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
190number is not sufficient to identify the actual file object. 'set'
191should be a non-blocking function that initializes those parts of a
192newly created inode to allow the test function to succeed. 'data' is
193passed as an opaque value to both test and set functions.
194
195When the inode has been created by iget5_locked(), it will be returned with the
196I_NEW flag set and will still be locked. The filesystem then needs to finalize
197the initialization. Once the inode is initialized it must be unlocked by
198calling unlock_new_inode().
199
200The filesystem is responsible for setting (and possibly testing) i_ino
201when appropriate. There is also a simpler iget_locked function that
202just takes the superblock and inode number as arguments and does the
203test and set for you.
204
205e.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
217Note that if the process of setting up a new inode fails, then iget_failed()
218should be called on the inode to render it dead, and an appropriate error
219should 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()
232and let it call whatever you had as ->revlidate() + (for symlinks that
233had ->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
240if 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
248Audit your code and add locking if needed. Notice that any place that is
249not protected by the conditions above is risky even in the old tree - you
250had been relying on BKL and that's prone to screwups. Old tree had quite
251a few holes of that kind - unprotected access to ->d_parent leading to
252anything from oops to silent memory corruption.
253
254---
255
256**mandatory**
257
258FS_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
265Use bdev_read_only(bdev) instead of is_read_only(kdev). The latter
266is still alive, but only because of the mess in drivers/s390/block/dasd.c.
267As 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
274return - that will guarantee the same locking you used to have. If
275your method or its parts do not need BKL - better yet, now you can
276shift lock_kernel() and unlock_kernel() so that they would protect
277exactly what needs to be protected.
278
279---
280
281**mandatory**
282
283->statfs() is now called without BKL held. BKL should have been
284shifted into individual fs sb_op functions where it's not clear that
285it's safe to remove it. If you don't need it, remove it.
286
287---
288
289**mandatory**
290
291is_read_only() is gone; use bdev_read_only() instead.
292
293---
294
295**mandatory**
296
297destroy_buffers() is gone; use invalidate_bdev().
298
299---
300
301**mandatory**
302
303fsync_dev() is gone; use fsync_bdev(). NOTE: lvm breakage is
304deliberate; as soon as struct block_device * is propagated in a reasonable
305way by that code fixing will become trivial; until then nothing can be
306done.
307
308**mandatory**
309
310block truncatation on error exit from ->write_begin, and ->direct_IO
311moved from generic methods (block_write_begin, cont_write_begin,
312nobh_write_begin, blockdev_direct_IO*) to callers. Take a look at
313ext2_write_failed and callers for an example.
314
315**mandatory**
316
317->truncate is gone. The whole truncate sequence needs to be
318implemented in ->setattr, which is now mandatory for filesystems
319implementing on-disk size changes. Start with a copy of the old inode_setattr
320and vmtruncate, and the reorder the vmtruncate + foofs_vmtruncate sequence to
321be in order of zeroing blocks using block_truncate_page or similar helpers,
322size update and on finally on-disk truncation which should not fail.
323setattr_prepare (which used to be inode_change_ok) now includes the size checks
324for 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
329be used instead. It gets called whenever the inode is evicted, whether it has
330remaining links or not. Caller does *not* evict the pagecache or inode-associated
331metadata buffers; the method has to use truncate_inode_pages_final() to get rid
332of 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
336inode->i_lock held and it returns true if filesystems wants the inode to be
337dropped. As before, generic_drop_inode() is still the default and it's been
338updated appropriately. generic_delete_inode() is also alive and it consists
339simply of return 1. Note that all actual eviction work is done by caller after
340->drop_inode() returns.
341
342As 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
344before, if you are using inode-associated metadata buffers (i.e.
345mark_buffer_dirty_inode()), it's your responsibility to call
346invalidate_inode_buffers() before clear_inode().
347
348NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
349if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput()
350may happen while the inode is in the middle of ->write_inode(); e.g. if you blindly
351free the on-disk inode, you may end up doing that while ->write_inode() is writing
352to it.
353
354---
355
356**mandatory**
357
358.d_delete() now only advises the dcache as to whether or not to cache
359unreferenced dentries, and is now only called when the dentry refcount goes to
3600. Even on 0 refcount transition, it must be able to tolerate being called 0,
3611, or more times (eg. constant, idempotent).
362
363---
364
365**mandatory**
366
367.d_compare() calling convention and locking rules are significantly
368changed. Read updated documentation in Documentation/filesystems/vfs.rst (and
369look at examples of other filesystems) for guidance.
370
371---
372
373**mandatory**
374
375.d_hash() calling convention and locking rules are significantly
376changed. Read updated documentation in Documentation/filesystems/vfs.rst (and
377look at examples of other filesystems) for guidance.
378
379---
380
381**mandatory**
382
383dcache_lock is gone, replaced by fine grained locks. See fs/dcache.c
384for details of what locks to replace dcache_lock with in order to protect
385particular things. Most of the time, a filesystem only needs ->d_lock, which
386protects *all* the dcache state of a given dentry.
387
388---
389
390**mandatory**
391
392Filesystems must RCU-free their inodes, if they can have been accessed
393via rcu-walk path walk (basically, if the file can have had a path name in the
394vfs namespace).
395
396Even though i_dentry and i_rcu share storage in a union, we will
397initialize the former in inode_init_always(), so just leave it alone in
398the callback. It used to be necessary to clean it there, but not anymore
399(starting at 3.2).
400
401---
402
403**recommended**
404
405vfs now tries to do path walking in "rcu-walk mode", which avoids
406atomic operations and scalability hazards on dentries and inodes (see
407Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes
408(above) are examples of the changes required to support this. For more complex
409filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so
410no changes are required to the filesystem. However, this is costly and loses
411the benefits of rcu-walk mode. We will begin to add filesystem callbacks that
412are rcu-walk aware, shown below. Filesystems should take advantage of this
413where possible.
414
415---
416
417**mandatory**
418
419d_revalidate is a callback that is made on every path element (if
420the filesystem provides it), which requires dropping out of rcu-walk mode. This
421may now be called in rcu-walk mode (nd->flags & LOOKUP_RCU). -ECHILD should be
422returned if the filesystem cannot handle rcu-walk. See
423Documentation/filesystems/vfs.rst for more details.
424
425permission is an inode permission check that is called on many or all
426directory inodes on the way down a path walk (to check for exec permission). It
427must now be rcu-walk aware (mask & MAY_NOT_BLOCK). See
428Documentation/filesystems/vfs.rst for more details.
429
430---
431
432**mandatory**
433
434In ->fallocate() you must check the mode option passed in. If your
435filesystem does not support hole punching (deallocating space in the middle of a
436file) you must return -EOPNOTSUPP if FALLOC_FL_PUNCH_HOLE is set in mode.
437Currently you can only have FALLOC_FL_PUNCH_HOLE with FALLOC_FL_KEEP_SIZE set,
438so the i_size should not change when hole punching, even when puching the end of
439a file off.
440
441---
442
443**mandatory**
444
445->get_sb() is gone. Switch to use of ->mount(). Typically it's just
446a matter of switching from calling ``get_sb_``... to ``mount_``... and changing
447the 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
449ERR_PTR(...).
450
451---
452
453**mandatory**
454
455->permission() and generic_permission()have lost flags
456argument; instead of passing IPERM_FLAG_RCU we add MAY_NOT_BLOCK into mask.
457
458generic_permission() has also lost the check_acl argument; ACL checking
459has been taken to VFS and filesystems need to provide a non-NULL ->i_op->get_acl
460to read an ACL from disk.
461
462---
463
464**mandatory**
465
466If you implement your own ->llseek() you must handle SEEK_HOLE and
467SEEK_DATA. You can hanle this by returning -EINVAL, but it would be nicer to
468support it in some way. The generic handler assumes that the entire file is
469data and there is a virtual hole at the end of the file. So if the provided
470offset is less than i_size and SEEK_DATA is specified, return the same offset.
471If the above is true for the offset and you are given SEEK_HOLE, return the end
472of the file. If the offset is i_size or greater return -ENXIO in either case.
473
474**mandatory**
475
476If you have your own ->fsync() you must make sure to call
477filemap_write_and_wait_range() so that all dirty pages are synced out properly.
478You must also keep in mind that ->fsync() is not called with i_mutex held
479anymore, so if you require i_mutex locking you must make sure to take it and
480release it yourself.
481
482---
483
484**mandatory**
485
486d_alloc_root() is gone, along with a lot of bugs caused by code
487misusing it. Replacement: d_make_root(inode). On success d_make_root(inode)
488allocates and returns a new dentry instantiated with the passed in inode.
489On failure NULL is returned and the passed in inode is dropped so the reference
490to inode is consumed in all cases and failure handling need not do any cleanup
491for the inode. If d_make_root(inode) is passed a NULL inode it returns NULL
492and 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
505The 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
513two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that
514local filesystems can ignore tha argument - they are guaranteed that the
515object doesn't exist. It's remote/distributed ones that might care...
516
517---
518
519**mandatory**
520
521FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate()
522in your dentry operations instead.
523
524---
525
526**mandatory**
527
528vfs_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
538vfs_follow_link has been removed. Filesystems must use nd_set_link
539from ->follow_link for normal symlinks, or nd_jump_link for magic
540/proc/<pid> style links.
541
542---
543
544**mandatory**
545
546iget5_locked()/ilookup5()/ilookup5_nowait() test() callback used to be
547called with both ->i_lock and inode_hash_lock held; the former is *not*
548taken anymore, so verify that your callbacks do not rely on it (none
549of the in-tree instances did). inode_hash_lock is still held,
550of course, so they are still serialized wrt removal from inode hash,
551as well as wrt set() callback of iget5_locked().
552
553---
554
555**mandatory**
556
557d_materialise_unique() is gone; d_splice_alias() does everything you
558need now. Remember that they have opposite orders of arguments ;-/
559
560---
561
562**mandatory**
563
564f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid
565it entirely.
566
567---
568
569**mandatory**
570
571never call ->read() and ->write() directly; use __vfs_{read,write} or
572wrappers; instead of checking for ->write or ->read being NULL, look for
573FMODE_CAN_{WRITE,READ} in file->f_mode.
574
575---
576
577**mandatory**
578
579do _not_ use new_sync_{read,write} for ->read/->write; leave it NULL
580instead.
581
582---
583
584**mandatory**
585 ->aio_read/->aio_write are gone. Use ->read_iter/->write_iter.
586
587---
588
589**recommended**
590
591for embedded ("fast") symlinks just set inode->i_link to wherever the
592symlink body is and use simple_follow_link() as ->follow_link().
593
594---
595
596**mandatory**
597
598calling conventions for ->follow_link() have changed. Instead of returning
599cookie and using nd_set_link() to store the body to traverse, we return
600the body to traverse and store the cookie using explicit void ** argument.
601nameidata isn't passed at all - nd_jump_link() doesn't need it and
602nd_[gs]et_link() is gone.
603
604---
605
606**mandatory**
607
608calling conventions for ->put_link() have changed. It gets inode instead of
609dentry, it does not get nameidata at all and it gets called only when cookie
610is non-NULL. Note that link body isn't available anymore, so if you need it,
611store it as cookie.
612
613---
614
615**mandatory**
616
617any symlink that might use page_follow_link_light/page_put_link() must
618have inode_nohighmem(inode) called before anything might start playing with
619its pagecache. No highmem pages should end up in the pagecache of such
620symlinks. That includes any preseeding that might be done during symlink
621creation. __page_symlink() will honour the mapping gfp flags, so once
622you've done inode_nohighmem() it's safe to use, but if you allocate and
623insert 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
640set_delayed_call() where it used to set ``*cookie``.
641
642->put_link() is gone - just give the destructor to set_delayed_call()
643in ->get_link().
644
645---
646
647**mandatory**
648
649->getxattr() and xattr_handler.get() get dentry and inode passed separately.
650dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
651in the instances. Rationale: !@#!@# security_d_instantiate() needs to be
652called before we attach dentry to inode.
653
654---
655
656**mandatory**
657
658symlinks are no longer the only inodes that do *not* have i_bdev/i_cdev/
659i_pipe/i_link union zeroed out at inode eviction. As the result, you can't
660assume that non-NULL value in ->i_nlink at ->destroy_inode() implies that
661it's a symlink. Checking ->i_mode is really needed now. In-tree we had
662to fix shmem_destroy_callback() that used to take that kind of shortcut;
663watch 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
670they used to - they just take it exclusive. However, ->lookup() may be
671called 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
683We are guaranteed that lookups of the same name in the same directory
684will not happen in parallel ("same" in the sense of your ->d_compare()).
685Lookups on different names in the same directory can and do happen in
686parallel now.
687
688---
689
690**recommended**
691
692->iterate_shared() is added; it's a parallel variant of ->iterate().
693Exclusion on struct file level is still provided (as well as that
694between it and lseek on the same struct file), but if your directory
695has been opened several times, you can get these called in parallel.
696Exclusion between that method and all directory-modifying ones is
697still provided, of course.
698
699Often enough ->iterate() can serve as ->iterate_shared() without any
700changes - it is a read-only operation, after all. If you have any
701per-inode or per-dentry in-core data structures modified by ->iterate(),
702you might need something to serialize the access to them. If you
703do dcache pre-seeding, you'll need to switch to d_alloc_parallel() for
704that; look for in-tree examples.
705
706Old method is only used if the new one is absent; eventually it will
707be 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.
720dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
721in the instances. Rationale: !@#!@# security_d_instantiate() needs to be
722called 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
730used it for finding the struct super_block involved, dentry->d_sb will
731work just as well; if it's something more complicated, use dentry->d_parent.
732Just be careful not to assume that fetching it more than once will yield
733the 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
740filesystem 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
748to fake something for readlink(2).
749
750---
751
752**mandatory**
753
754->getattr() is now passed a struct path rather than a vfsmount and
755dentry separately, and it now has request_mask and query_flags arguments
756to specify the fields and sync type requested by statx. Filesystems not
757supporting 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``,
764along with FILE_OPENED/FILE_CREATED. In place of those we have
765FMODE_OPENED/FMODE_CREATED, set in file->f_mode. Additionally, return
766value for 'called finish_no_open(), open it yourself' case has become
7670, not 1. Since finish_no_open() itself is returning 0 now, that part
768does not need any changes in ->atomic_open() instances.
769
770---
771
772**mandatory**
773
774alloc_file() has become static now; two wrappers are to be used instead.
775alloc_file_pseudo(inode, vfsmount, name, flags, ops) is for the cases
776when dentry needs to be created; that's the majority of old alloc_file()
777users. Calling conventions: on success a reference to new struct file
778is returned and callers reference to inode is subsumed by that. On
779failure, ERR_PTR() is returned and no caller's references are affected,
780so the caller needs to drop the inode reference it held.
781alloc_file_clone(file, flags, ops) does not affect any caller's references.
782On success you get a new struct file sharing the mount/dentry with the
783original, 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
791information.
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
803don't need to bother with the check - d_splice_alias() will do the
804right thing when given ERR_PTR(...) as inode. Moreover, passing NULL
805inode to d_splice_alias() will also do the right thing (equivalent of
806d_add(dentry, NULL); return NULL;), so that kind of special cases
807also doesn't need a separate treatment.
808
809---
810
811**strongly recommended**
812
813take the RCU-delayed parts of ->destroy_inode() into a new method -
814->free_inode(). If ->destroy_inode() becomes empty - all the better,
815just get rid of it. Synchronous work (e.g. the stuff that can't
816be done from an RCU callback, or any WARN_ON() where we want the
817stack trace) *might* be movable to ->evict_inode(); however,
818that goes only for the things that are not needed to balance something
819done by ->alloc_inode(). IOW, if it's cleaning up the stuff that
820might have accumulated over the life of in-core inode, ->evict_inode()
821might be a fit.
822
823Rules 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
830Note that the callback (be it via ->free_inode() or explicit call_rcu()
831in ->destroy_inode()) is *NOT* ordered wrt superblock destruction;
832as the matter of fact, the superblock and all associated structures
833might be already gone. The filesystem driver is guaranteed to be still
834there, but that's it. Freeing memory in the callback is fine; doing
835more than that is possible, but requires a lot of care and is best
836avoided.
837
838---
839
840**mandatory**
841
842DCACHE_RCUACCESS is gone; having an RCU delay on dentry freeing is the
843default. DCACHE_NORCU opts out, and only d_alloc_pseudo() has any
844business doing so.
845
846---
847
848**mandatory**
849
850d_alloc_pseudo() is internal-only; uses outside of alloc_file_pseudo() are
851very suspect (and won't work in modules). Such uses are very likely to
852be 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
7Introduction
8============
6 9
7UBIFS utilizes the fscrypt framework to provide confidentiality for file 10UBIFS utilizes the fscrypt framework to provide confidentiality for file
8contents and file names. This prevents attacks where an attacker is able to 11contents 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
33be possible to use UBIFS authentication without using encryption. 36be possible to use UBIFS authentication without using encryption.
34 37
35 38
36## MTD, UBI & UBIFS 39MTD, UBI & UBIFS
40----------------
37 41
38On Linux, the MTD (Memory Technology Devices) subsystem provides a uniform 42On Linux, the MTD (Memory Technology Devices) subsystem provides a uniform
39interface to access raw flash devices. One of the more prominent subsystems that 43interface 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
47leveling and some flash specifics are left to UBI, while UBIFS focuses on 51leveling and some flash specifics are left to UBI, while UBIFS focuses on
48scalability, performance and recoverability. 52scalability, 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 91UBIFS Index & Tree Node Cache
92~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88 93
89Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types 94Basic on-flash UBIFS entities are called *nodes*. UBIFS knows different types
90of nodes. Eg. data nodes (`struct ubifs_data_node`) which store chunks of file 95of 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
118marked as dirty are written to the flash to update the persisted index. 123marked as dirty are written to the flash to update the persisted index.
119 124
120 125
121### Journal 126Journal
127~~~~~~~
122 128
123To avoid wearing out the flash, the index is only persisted (*commited*) when 129To avoid wearing out the flash, the index is only persisted (*commited*) when
124certain conditions are met (eg. `fsync(2)`). The journal is used to record 130certain conditions are met (eg. ``fsync(2)``). The journal is used to record
125any changes (in form of inode nodes, data nodes etc.) between commits 131any changes (in form of inode nodes, data nodes etc.) between commits
126of the index. During mount, the journal is read from the flash and replayed 132of the index. During mount, the journal is read from the flash and replayed
127onto the TNC (which will be created on-demand from the on-flash index). 133onto the TNC (which will be created on-demand from the on-flash index).
128 134
129UBIFS reserves a bunch of LEBs just for the journal called *log area*. The 135UBIFS reserves a bunch of LEBs just for the journal called *log area*. The
130amount of log area LEBs is configured on filesystem creation (using 136amount 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
132two types of nodes: *reference nodes* and *commit start nodes*. A commit start 138two types of nodes: *reference nodes* and *commit start nodes*. A commit start
133node is written whenever an index commit is performed. Reference nodes are 139node is written whenever an index commit is performed. Reference nodes are
134written on every journal update. Each reference node points to the position of 140written 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
152because of a power cut. If the recovery fails, UBIFS will not mount. An error 158because of a power cut. If the recovery fails, UBIFS will not mount. An error
153for every other LEB will directly cause UBIFS to fail the mount operation. 159for 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 182LEB Property Tree/Table
183~~~~~~~~~~~~~~~~~~~~~~~
176 184
177The LEB property tree is used to store per-LEB information. This includes the 185The LEB property tree is used to store per-LEB information. This includes the
178LEB type and amount of free and *dirty* (old, obsolete content) space [1] on 186LEB type and amount of free and *dirty* (old, obsolete content) space [1]_ on
179the LEB. The type is important, because UBIFS never mixes index nodes with data 187the LEB. The type is important, because UBIFS never mixes index nodes with data
180nodes on a single LEB and thus each LEB has a specific purpose. This again is 188nodes on a single LEB and thus each LEB has a specific purpose. This again is
181useful for free space calculations. See [UBIFS-WP] for more details. 189useful 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
185commit. Thus, saving the LPT is an atomic operation. 193commit. 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
189difference 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
190written to without erasing it and previously written content that is obsolete 198 written to without erasing it and previously written content that is obsolete
191but 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 202UBIFS Authentication
203====================
195 204
196This chapter introduces UBIFS authentication which enables UBIFS to verify 205This chapter introduces UBIFS authentication which enables UBIFS to verify
197the authenticity and integrity of metadata and file contents stored on flash. 206the authenticity and integrity of metadata and file contents stored on flash.
198 207
199 208
200## Threat Model 209Threat Model
210------------
201 211
202UBIFS authentication enables detection of offline data modification. While it 212UBIFS authentication enables detection of offline data modification. While it
203does not prevent it, it enables (trusted) code to check the integrity and 213does 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
224ensure that only trusted code is executed on a device. 234ensure that only trusted code is executed on a device.
225 235
226 236
227## Authentication 237Authentication
238--------------
228 239
229To be able to fully trust data read from flash, all UBIFS data structures 240To be able to fully trust data read from flash, all UBIFS data structures
230stored on flash are authenticated. That is: 241stored 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 250Index Authentication
251~~~~~~~~~~~~~~~~~~~~
240 252
241Through UBIFS' concept of a wandering tree, it already takes care of only 253Through UBIFS' concept of a wandering tree, it already takes care of only
242updating and persisting changed parts from leaf node up to the root node 254updating 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
260the storage overhead which is precious for users of UBIFS (ie. embedded 272the storage overhead which is precious for users of UBIFS (ie. embedded
261devices). 273devices).
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
303atomically together with its respective node. 316atomically together with its respective node.
304 317
305 318
306### Journal Authentication 319Journal Authentication
320~~~~~~~~~~~~~~~~~~~~~~
307 321
308The journal is authenticated too. Since the journal is continuously written 322The journal is authenticated too. Since the journal is continuously written
309it is necessary to also add authentication information frequently to the 323it 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
316authentication node. The tail of the journal which may not have a authentication 330authentication node. The tail of the journal which may not have a authentication
317node cannot be authenticated and is skipped during journal replay. 331node cannot be authenticated and is skipped during journal replay.
318 332
319We get this picture for journal authentication: 333We 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
352modified on feature flag or similar changes, but never on file changes. 366modified on feature flag or similar changes, but never on file changes.
353 367
354 368
355### LPT Authentication 369LPT Authentication
370~~~~~~~~~~~~~~~~~~
356 371
357The location of the LPT root node on the flash is stored in the UBIFS master 372The location of the LPT root node on the flash is stored in the UBIFS master
358node. Since the LPT is written and read atomically on every commit, there is 373node. 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
363LTP hash stored there with the hash computed from the read on-flash LPT. 378LTP hash stored there with the hash computed from the read on-flash LPT.
364 379
365 380
366## Key Management 381Key Management
382--------------
367 383
368For simplicity, UBIFS authentication uses a single key to compute the HMACs 384For simplicity, UBIFS authentication uses a single key to compute the HMACs
369of superblock, master, commit start and reference nodes. This key has to be 385of 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 418Future Extensions
419=================
403 420
404In certain cases where a vendor wants to provide an authenticated filesystem 421In certain cases where a vendor wants to provide an authenticated filesystem
405image to customers, it should be possible to do so without sharing the secret 422image 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
411will then have to be provided beforehand in the normal way. 428will then have to be provided beforehand in the normal way.
412 429
413 430
414# References 431References
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
21VFS system calls open(2), stat(2), read(2), write(2), chmod(2) and so on 21VFS system calls open(2), stat(2), read(2), write(2), chmod(2) and so on
22are called from a process context. Filesystem locking is described in 22are called from a process context. Filesystem locking is described in
23the document Documentation/filesystems/Locking. 23the document Documentation/filesystems/locking.rst.
24 24
25 25
26Directory Entry Cache (dcache) 26Directory 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.
142If nothing happens when loading the adm1021 module, and you are certain 142If nothing happens when loading the adm1021 module, and you are certain
143that your specific Xeon processor model includes compatible sensors, you 143that your specific Xeon processor model includes compatible sensors, you
144will have to explicitly instantiate the sensor chips from user-space. See 144will have to explicitly instantiate the sensor chips from user-space. See
145method 4 in Documentation/i2c/instantiating-devices. Possible slave 145method 4 in Documentation/i2c/instantiating-devices.rst. Possible slave
146addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that 146addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that
147only temp2 will be correct and temp1 will have to be ignored. 147only 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
77This driver does not auto-detect devices. You will have to instantiate the 77This driver does not auto-detect devices. You will have to instantiate the
78devices explicitly. Please see Documentation/i2c/instantiating-devices for 78devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
79details. 79details.
80 80
81The ADM1075, unlike many other PMBus devices, does not support internal voltage 81The 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
27I2C address 0x27 by default, so an entry with I2C_BOARD_INFO("hih6130", 0x27) 27I2C address 0x27 by default, so an entry with I2C_BOARD_INFO("hih6130", 0x27)
28can be used in the board setup code. 28can be used in the board setup code.
29 29
30Please see Documentation/i2c/instantiating-devices for details on how to 30Please see Documentation/i2c/instantiating-devices.rst for details on how to
31instantiate I2C devices. 31instantiate I2C devices.
32 32
33sysfs-Interface 33sysfs-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
19This driver does not auto-detect devices. You will have to instantiate the 19This driver does not auto-detect devices. You will have to instantiate the
20devices explicitly. Please see Documentation/i2c/instantiating-devices for 20devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
21details. 21details.
22 22
23Sysfs entries 23Sysfs 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
78This driver does not auto-detect devices. You will have to instantiate the 78This driver does not auto-detect devices. You will have to instantiate the
79devices explicitly. Please see Documentation/i2c/instantiating-devices for 79devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
80details. 80details.
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
30This driver does not auto-detect devices. You will have to instantiate the 30This driver does not auto-detect devices. You will have to instantiate the
31devices explicitly. Please see Documentation/i2c/instantiating-devices for 31devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
32details. 32details.
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
80This driver does not probe for devices, since there is no register which 80This driver does not probe for devices, since there is no register which
81can be safely used to identify the chip. You will have to instantiate 81can be safely used to identify the chip. You will have to instantiate
82the devices explicitly. Please see Documentation/i2c/instantiating-devices for 82the devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
83details. 83details.
84 84
85WARNING: Do not access chip registers using the i2cdump command, and do not use 85WARNING: 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
32This driver does not auto-detect devices. You will have to instantiate the 32This driver does not auto-detect devices. You will have to instantiate the
33devices explicitly. Please see Documentation/i2c/instantiating-devices for 33devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
34details. 34details.
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
85This driver does not auto-detect devices. You will have to instantiate the 85This driver does not auto-detect devices. You will have to instantiate the
86devices explicitly. Please see Documentation/i2c/instantiating-devices for 86devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
87details. 87details.
88 88
89For MAX34446, the value of the currX_crit attribute determines if current or 89For 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
57This driver does not auto-detect devices. You will have to instantiate the 57This driver does not auto-detect devices. You will have to instantiate the
58devices explicitly. Please see Documentation/i2c/instantiating-devices for 58devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
59details. 59details.
60 60
61Module parameters 61Module 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
30This driver does not auto-detect devices. You will have to instantiate the 30This driver does not auto-detect devices. You will have to instantiate the
31devices explicitly. Please see Documentation/i2c/instantiating-devices for 31devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
32details. 32details.
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
28This driver is part of the MFD driver named "menf21bmc" and does 28This driver is part of the MFD driver named "menf21bmc" and does
29not auto-detect devices. 29not auto-detect devices.
30You will have to instantiate the MFD driver explicitly. 30You will have to instantiate the MFD driver explicitly.
31Please see Documentation/i2c/instantiating-devices for 31Please see Documentation/i2c/instantiating-devices.rst for
32details. 32details.
33 33
34Sysfs entries 34Sysfs 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
68The PCF8591 is plainly impossible to detect! Thus the driver won't even 68The PCF8591 is plainly impossible to detect! Thus the driver won't even
69try. You have to explicitly instantiate the device at the relevant 69try. You have to explicitly instantiate the device at the relevant
70address (in the interval [0x48..0x4f]) either through platform data, or 70address (in the interval [0x48..0x4f]) either through platform data, or
71using the sysfs interface. See Documentation/i2c/instantiating-devices 71using the sysfs interface. See Documentation/i2c/instantiating-devices.rst
72for details. 72for details.
73 73
74Directories are being created for each instantiated PCF8591: 74Directories 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
27The device communicates with the I2C protocol. Sensors can have the I2C 27The device communicates with the I2C protocol. Sensors can have the I2C
28addresses 0x44 or 0x45, depending on the wiring. See 28addresses 0x44 or 0x45, depending on the wiring. See
29Documentation/i2c/instantiating-devices for methods to instantiate the device. 29Documentation/i2c/instantiating-devices.rst for methods to instantiate the device.
30 30
31There are two options configurable by means of sht3x_platform_data: 31There 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
45celsius, relative humidity is expressed as a percentage. 45celsius, relative humidity is expressed as a percentage.
46 46
47The device communicates with the I2C protocol. All sensors are set to I2C 47The device communicates with the I2C protocol. All sensors are set to I2C
48address 0x70. See Documentation/i2c/instantiating-devices for methods to 48address 0x70. See Documentation/i2c/instantiating-devices.rst for methods to
49instantiate the device. 49instantiate the device.
50 50
51There are two options configurable by means of shtc1_platform_data: 51There 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
30Documentation/hwmon/sysfs-interface.rst under Temperatures). 30Documentation/hwmon/sysfs-interface.rst under Temperatures).
31 31
32Please refer how to instantiate this driver: 32Please refer how to instantiate this driver:
33Documentation/i2c/instantiating-devices 33Documentation/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
30This driver does not auto-detect devices. You will have to instantiate the 30This driver does not auto-detect devices. You will have to instantiate the
31devices explicitly. Please see Documentation/i2c/instantiating-devices for 31devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
32details. 32details.
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
66This driver does not auto-detect devices. You will have to instantiate the 66This driver does not auto-detect devices. You will have to instantiate the
67devices explicitly. Please see Documentation/i2c/instantiating-devices for 67devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
68details. 68details.
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
42This driver does not auto-detect devices. You will have to instantiate the 42This driver does not auto-detect devices. You will have to instantiate the
43devices explicitly. Please see Documentation/i2c/instantiating-devices for 43devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
44details. 44details.
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
41The Via 686a southbridge has integrated hardware monitor functionality. 41The Via 686a southbridge has integrated hardware monitor functionality.
42It also has an I2C bus, but this driver only supports the hardware monitor. 42It also has an I2C bus, but this driver only supports the hardware monitor.
43For the I2C bus driver, see <file:Documentation/i2c/busses/i2c-viapro> 43For the I2C bus driver, see <file:Documentation/i2c/busses/i2c-viapro.rst>
44 44
45The Via 686a implements three temperature sensors, two fan rotation speed 45The Via 686a implements three temperature sensors, two fan rotation speed
46sensors, five voltage sensors and alarms. 46sensors, 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
123This driver does not auto-detect devices. You will have to instantiate the 123This driver does not auto-detect devices. You will have to instantiate the
124devices explicitly. Please see Documentation/i2c/instantiating-devices for 124devices explicitly. Please see Documentation/i2c/instantiating-devices.rst for
125details. 125details.
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=========================
1Kernel driver i2c-ali1535 2Kernel driver i2c-ali1535
3=========================
2 4
3Supported adapters: 5Supported 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
8Authors: 11Authors:
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
15Description 18Description
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=========================
1Kernel driver i2c-ali1563 2Kernel driver i2c-ali1563
3=========================
2 4
3Supported adapters: 5Supported 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=========================
1Kernel driver i2c-ali15x3 2Kernel driver i2c-ali15x3
3=========================
2 4
3Supported adapters: 5Supported 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
8Authors: 11Authors:
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
13Module Parameters 16Module 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
20Notes 23Notes
@@ -25,7 +28,9 @@ the BIOS. Does not do a PCI force; the device must still be present in
25lspci. Don't use this unless the driver complains that the base address is 28lspci. Don't use this unless the driver complains that the base address is
26not set. 29not set.
27 30
28Example: 'modprobe i2c-ali15x3 force_addr=0xe800' 31Example::
32
33 modprobe i2c-ali15x3 force_addr=0xe800
29 34
30SMBus periodically hangs on ASUS P5A motherboards and can only be cleared 35SMBus periodically hangs on ASUS P5A motherboards and can only be cleared
31by a power cycle. Cause unknown (see Issues below). 36by 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)
38M1541 and M1543C South Bridges. 43M1541 and M1543C South Bridges.
39 44
40The M1543C is a South bridge for desktop systems. 45The M1543C is a South bridge for desktop systems.
46
41The M1541 is a South bridge for portable systems. 47The M1541 is a South bridge for portable systems.
48
42They are part of the following ALI chipsets: 49They 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
62For an overview of these chips see http://www.acerlabs.com. At this time the 70For an overview of these chips see http://www.acerlabs.com. At this time the
63full data sheets on the web site are password protected, however if you 71full data sheets on the web site are password protected, however if you
64contact the ALI office in San Jose they may give you the password. 72contact the ALI office in San Jose they may give you the password.
65 73
66The M1533/M1543C devices appear as FOUR separate devices on the PCI bus. An 74The M1533/M1543C devices appear as FOUR separate devices on the PCI bus. An
67output of lspci will show something similar to the following: 75output 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
83The SMB controller is part of the M7101 device, which is an ACPI-compliant 94The SMB controller is part of the M7101 device, which is an ACPI-compliant
84Power Management Unit (PMU). 95Power Management Unit (PMU).
@@ -109,4 +120,3 @@ There may be electrical problems on this board.
109On the P5A, the W83781D sensor chip is on both the ISA and 120On the P5A, the W83781D sensor chip is on both the ISA and
110SMBus. Therefore the SMBus hangs can generally be avoided 121SMBus. Therefore the SMBus hangs can generally be avoided
111by accessing the W83781D on the ISA bus only. 122by 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 @@
1Kernel driver i2c-amd-mp2
2
3Supported adapters:
4 * AMD MP2 PCIe interface
5
6Datasheet: not publicly available.
7
8Authors:
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
13Description
14-----------
15
16The MP2 is an ARM processor programmed as an I2C controller and communicating
17with the x86 host through PCI.
18
19If you see something like this:
20
2103:00.7 MP2 I2C controller: Advanced Micro Devices, Inc. [AMD] Device 15e6
22
23in 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=========================
2Kernel driver i2c-amd-mp2
3=========================
4
5Supported adapters:
6 * AMD MP2 PCIe interface
7
8Datasheet: not publicly available.
9
10Authors:
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
15Description
16-----------
17
18The MP2 is an ARM processor programmed as an I2C controller and communicating
19with the x86 host through PCI.
20
21If you see something like this::
22
23 03:00.7 MP2 I2C controller: Advanced Micro Devices, Inc. [AMD] Device 15e6
24
25in 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========================
1Kernel driver i2c-amd756 2Kernel driver i2c-amd756
3========================
2 4
3Supported adapters: 5Supported 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
13Authors: 17Authors:
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
17Description 21Description
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=========================
1Kernel driver i2c-adm8111 2Kernel driver i2c-adm8111
3=========================
2 4
3Supported adapters: 5Supported 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>
13Description 15Description
14----------- 16-----------
15 17
16If you see something like this: 18If you see something like this::
17 19
1800: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
23in your 'lspci -v', then this driver is for your chipset. 25in your ``lspci -v``, then this driver is for your chipset.
24 26
25Process Call Support 27Process 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============================
1Kernel driver i2c-diolan-u2c 2Kernel driver i2c-diolan-u2c
3============================
2 4
3Supported adapters: 5Supported 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======================
1Kernel driver i2c-i801 2Kernel driver i2c-i801
3======================
4
2 5
3Supported adapters: 6Supported 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
44On Intel Patsburg and later chipsets, both the normal host SMBus controller 48On Intel Patsburg and later chipsets, both the normal host SMBus controller
45and the additional 'Integrated Device Function' controllers are supported. 49and the additional 'Integrated Device Function' controllers are supported.
46 50
47Authors: 51Authors:
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
52Module Parameters 56Module Parameters
53----------------- 57-----------------
54 58
55* disable_features (bit vector) 59* disable_features (bit vector)
60
56Disable selected features normally supported by the device. This makes it 61Disable selected features normally supported by the device. This makes it
57possible to work around possible driver or hardware bugs if the feature in 62possible to work around possible driver or hardware bugs if the feature in
58question doesn't work as intended for whatever reason. Bit values: 63question 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
66Description 74Description
@@ -73,7 +81,7 @@ Pentium-based PCs, '815E' chipset, and others.
73 81
74The ICH chips contain at least SEVEN separate PCI functions in TWO logical 82The ICH chips contain at least SEVEN separate PCI functions in TWO logical
75PCI devices. An output of lspci will show something similar to the 83PCI devices. An output of lspci will show something similar to the
76following: 84following::
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
139hardware monitoring chip), you need to add your board to the list. 147hardware monitoring chip), you need to add your board to the list.
140 148
141The motherboard is identified using the subvendor and subdevice IDs of the 149The motherboard is identified using the subvendor and subdevice IDs of the
142host bridge PCI device. Get yours with "lspci -n -v -s 00:00.0": 150host bridge PCI device. Get yours with ``lspci -n -v -s 00:00.0``::
143 151
14400: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
151Here the host bridge ID is 2570 (82865G/PE/P), the subvendor ID is 1043 159Here 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
165anything interesting on your hidden ICH SMBus. 173anything interesting on your hidden ICH SMBus.
166 174
167 175
168********************** 176----------------------------------------------------------------------------
177
169The lm_sensors project gratefully acknowledges the support of Texas 178The lm_sensors project gratefully acknowledges the support of Texas
170Instruments in the initial development of this driver. 179Instruments 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======================
1Kernel driver i2c-ismt 2Kernel driver i2c-ismt
3======================
4
2 5
3Supported adapters: 6Supported 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
14Allows changing of the bus speed. Normally, the bus speed is set by the BIOS 18Allows changing of the bus speed. Normally, the bus speed is set by the BIOS
15and never needs to be changed. However, some SMBus analyzers are too slow for 19and never needs to be changed. However, some SMBus analyzers are too slow for
16monitoring the bus during debug, thus the need for this module parameter. 20monitoring the bus during debug, thus the need for this module parameter.
17Specify the bus speed in kHz. 21Specify the bus speed in kHz.
22
18Available bus frequency settings: 23Available 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
26Description 34Description
@@ -30,7 +38,7 @@ The S12xx series of SOCs have a pair of integrated SMBus 2.0 controllers
30targeted primarily at the microserver and storage markets. 38targeted primarily at the microserver and storage markets.
31 39
32The S12xx series contain a pair of PCI functions. An output of lspci will show 40The S12xx series contain a pair of PCI functions. An output of lspci will show
33something similar to the following: 41something 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==================
1Driver i2c-mlxcpld 2Driver i2c-mlxcpld
3==================
2 4
3Author: Michael Shych <michaelsh@mellanox.com> 5Author: Michael Shych <michaelsh@mellanox.com>
4 6
5This is the Mellanox I2C controller logic, implemented in Lattice CPLD 7This is the Mellanox I2C controller logic, implemented in Lattice CPLD
6device. 8device.
9
7Device supports: 10Device 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
22Registers: 25Registers:
26
27=============== === =======================================================================
23CPBLTY 0x0 - capability reg. 28CPBLTY 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=========================
1Kernel driver i2c-nforce2 2Kernel driver i2c-nforce2
3=========================
2 4
3Supported adapters: 5Supported 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
19Datasheet: not publicly available, but seems to be similar to the 21Datasheet:
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
22Authors: 25Authors:
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
27Description 30Description
28----------- 31-----------
29 32
30i2c-nforce2 is a driver for the SMBuses included in the nVidia nForce2 MCP. 33i2c-nforce2 is a driver for the SMBuses included in the nVidia nForce2 MCP.
31 34
32If your 'lspci -v' listing shows something like the following, 35If your ``lspci -v`` listing shows something like the following::
33 36
3400: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
40then this driver should support the SMBuses of your motherboard. 43then 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============================
1Kernel driver i2c-nvidia-gpu 2Kernel driver i2c-nvidia-gpu
3============================
2 4
3Datasheet: not publicly available. 5Datasheet: not publicly available.
4 6
@@ -11,8 +13,8 @@ Description
11i2c-nvidia-gpu is a driver for I2C controller included in NVIDIA Turing 13i2c-nvidia-gpu is a driver for I2C controller included in NVIDIA Turing
12and later GPUs and it is used to communicate with Type-C controller on GPUs. 14and later GPUs and it is used to communicate with Type-C controller on GPUs.
13 15
14If your 'lspci -v' listing shows something like the following, 16If your ``lspci -v`` listing shows something like the following::
15 17
1601: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
18then this driver should support the I2C controller of your GPU. 20then 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========================
1Kernel driver i2c-ocores 2Kernel driver i2c-ocores
3========================
2 4
3Supported adapters: 5Supported 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.
23There is also a possibility to attach a list of i2c_board_info which 25There is also a possibility to attach a list of i2c_board_info which
24the i2c-ocores driver will add to the bus upon creation. 26the i2c-ocores driver will add to the bus upon creation.
25 27
26E.G. something like: 28E.G. something like::
27 29
28static 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 */
42struct 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
54static 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
61static 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 @@
1Kernel driver i2c-parport
2
3Author: Jean Delvare <jdelvare@suse.de>
4
5This is a unified driver for several i2c-over-parallel-port adapters,
6such as the ones made by Philips, Velleman or ELV. This driver is
7meant 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
14It 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
25These devices use different pinout configurations, so you have to tell
26the driver what you have, using the type module parameter. There is no
27way to autodetect the devices. Support for different pinout configurations
28can be easily added when needed.
29
30Earlier kernels defaulted to type=0 (Philips). But now, if the type
31parameter is missing, the driver will simply fail to initialize.
32
33SMBus alert support is available on adapters which have this line properly
34connected to the parallel port's interrupt pin.
35
36
37Building your own adapter
38-------------------------
39
40If you want to build you own i2c-over-parallel-port adapter, here is
41a sample electronics schema (credits go to Sylvain Munaut):
42
43Device PC
44Side ___________________Vdd (+) Side
45 | | |
46 --- --- ---
47 | | | | | |
48 |R| |R| |R|
49 | | | | | |
50 --- --- ---
51 | | |
52 | | /| |
53SCL ----------x--------o |-----------x------------------- pin 2
54 | \| | |
55 | | |
56 | |\ | |
57SDA ----------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
73Remarks:
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
94Device PC
95Side ______________________________Vdd (+) Side
96 | | | |
97 --- --- --- ---
98 | | | | | | | |
99 |R| |R| |R| |R|
100 | | | | | | | |
101 --- --- --- ---
102 | | | |
103 | | |\ | |
104SCL ----------x--------x--| o---x------------------------ pin 15
105 | | |/ |
106 | | |
107 | | /| |
108 | ---o |-------------x-------------- pin 2
109 | \| | |
110 | | |
111 | | |
112 | |\ | |
113SDA ---------------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
130If possible, you should use the same pinout configuration as existing
131adapters do, so you won't even have to change the code.
132
133
134Similar (but different) drivers
135-------------------------------
136
137This driver is NOT the same as the i2c-pport driver found in the i2c
138package. The i2c-pport driver makes use of modern parallel port features so
139that you don't need additional electronics. It has other restrictions
140however, and was not ported to Linux 2.6 (yet).
141
142This driver is also NOT the same as the i2c-pcf-epp driver found in the
143lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as
144an I2C bus directly. Instead, it uses it to control an external I2C bus
145master. That driver was not ported to Linux 2.6 (yet) either.
146
147
148Legacy documentation for Velleman adapter
149-----------------------------------------
150
151Useful links:
152Velleman http://www.velleman.be/
153Velleman K8000 Howto http://howto.htlw16.ac.at/k8000-howto.html
154
155The project has lead to new libs for the Velleman K8000 and K8005:
156 LIBK8000 v1.99.1 and LIBK8005 v0.21
157With these libs, you can control the K8000 interface card and the K8005
158stepper motor card with the simple commands which are in the original
159Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and
160many 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
167One For All JP1 parallel port adapter
168-------------------------------------
169
170The JP1 project revolves around a set of remote controls which expose
171the I2C bus their internal configuration EEPROM lives on via a 6 pin
172jumper in the battery compartment. More details can be found at:
173
174http://www.hifi-remote.com/jp1/
175
176Details of the simple parallel port hardware can be found at:
177
178http://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===============================
1Kernel driver i2c-parport-light 2Kernel driver i2c-parport-light
3===============================
2 4
3Author: Jean Delvare <jdelvare@suse.de> 5Author: Jean Delvare <jdelvare@suse.de>
4 6
5This driver is a light version of i2c-parport. It doesn't depend 7This driver is a light version of i2c-parport. It doesn't depend
6on the parport driver, and uses direct I/O access instead. This might be 8on the parport driver, and uses direct I/O access instead. This might be
7preferred on embedded systems where wasting memory for the clean but heavy 9preferred on embedded systems where wasting memory for the clean but heavy
8parport handling is not an option. The drawback is a reduced portability 10parport handling is not an option. The drawback is a reduced portability
9and the impossibility to daisy-chain other parallel port devices. 11and the impossibility to daisy-chain other parallel port devices.
10 12
11Please see i2c-parport for documentation. 13Please see i2c-parport for documentation.
12 14
13Module parameters: 15Module 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=========================
2Kernel driver i2c-parport
3=========================
4
5Author: Jean Delvare <jdelvare@suse.de>
6
7This is a unified driver for several i2c-over-parallel-port adapters,
8such as the ones made by Philips, Velleman or ELV. This driver is
9meant 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
17It 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
29These devices use different pinout configurations, so you have to tell
30the driver what you have, using the type module parameter. There is no
31way to autodetect the devices. Support for different pinout configurations
32can be easily added when needed.
33
34Earlier kernels defaulted to type=0 (Philips). But now, if the type
35parameter is missing, the driver will simply fail to initialize.
36
37SMBus alert support is available on adapters which have this line properly
38connected to the parallel port's interrupt pin.
39
40
41Building your own adapter
42-------------------------
43
44If you want to build you own i2c-over-parallel-port adapter, here is
45a 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
77Remarks:
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
138If possible, you should use the same pinout configuration as existing
139adapters do, so you won't even have to change the code.
140
141
142Similar (but different) drivers
143-------------------------------
144
145This driver is NOT the same as the i2c-pport driver found in the i2c
146package. The i2c-pport driver makes use of modern parallel port features so
147that you don't need additional electronics. It has other restrictions
148however, and was not ported to Linux 2.6 (yet).
149
150This driver is also NOT the same as the i2c-pcf-epp driver found in the
151lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as
152an I2C bus directly. Instead, it uses it to control an external I2C bus
153master. That driver was not ported to Linux 2.6 (yet) either.
154
155
156Legacy documentation for Velleman adapter
157-----------------------------------------
158
159Useful links:
160
161- Velleman http://www.velleman.be/
162- Velleman K8000 Howto http://howto.htlw16.ac.at/k8000-howto.html
163
164The project has lead to new libs for the Velleman K8000 and K8005:
165
166 LIBK8000 v1.99.1 and LIBK8005 v0.21
167
168With these libs, you can control the K8000 interface card and the K8005
169stepper motor card with the simple commands which are in the original
170Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and
171many 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
179One For All JP1 parallel port adapter
180-------------------------------------
181
182The JP1 project revolves around a set of remote controls which expose
183the I2C bus their internal configuration EEPROM lives on via a 6 pin
184jumper in the battery compartment. More details can be found at:
185
186http://www.hifi-remote.com/jp1/
187
188Details of the simple parallel port hardware can be found at:
189
190http://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=========================
1Kernel driver i2c-pca-isa 2Kernel driver i2c-pca-isa
3=========================
2 4
3Supported adapters: 5Supported adapters:
6
4This driver supports ISA boards using the Philips PCA 9564 7This driver supports ISA boards using the Philips PCA 9564
5Parallel bus to I2C bus controller 8Parallel 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
19Description 22Description
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=======================
1Kernel driver i2c-piix4 2Kernel driver i2c-piix4
3=======================
2 4
3Supported adapters: 5Supported 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
23Authors: 25Authors:
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
28Module Parameters 30Module Parameters
@@ -39,16 +41,16 @@ Description
39 41
40The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of 42The PIIX4 (properly known as the 82371AB) is an Intel chip with a lot of
41functionality. Among other things, it implements the PCI bus. One of its 43functionality. Among other things, it implements the PCI bus. One of its
42minor functions is implementing a System Management Bus. This is a true 44minor functions is implementing a System Management Bus. This is a true
43SMBus - you can not access it on I2C levels. The good news is that it 45SMBus - you can not access it on I2C levels. The good news is that it
44natively understands SMBus commands and you do not have to worry about 46natively understands SMBus commands and you do not have to worry about
45timing problems. The bad news is that non-SMBus devices connected to it can 47timing problems. The bad news is that non-SMBus devices connected to it can
46confuse it mightily. Yes, this is known to happen... 48confuse it mightily. Yes, this is known to happen...
47 49
48Do 'lspci -v' and see whether it contains an entry like this: 50Do ``lspci -v`` and see whether it contains an entry like this::
49 51
500000: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
53Bus and device numbers may differ, but the function number must be 55Bus and device numbers may differ, but the function number must be
54identical (like many PCI devices, the PIIX4 incorporates a number of 56identical (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.
922) Now you just need to change the value in 0xD2 register. Get it first with 942) 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
97Please note that you don't need to do that in all cases, just when the SMBus is 99Please 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=========================
1Kernel driver i2c-sis5595 2Kernel driver i2c-sis5595
3=========================
2 4
3Authors: 5Authors:
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
8Supported adapters: 10Supported adapters:
9 * Silicon Integrated Systems Corp. SiS5595 Southbridge 11 * Silicon Integrated Systems Corp. SiS5595 Southbridge
@@ -11,14 +13,19 @@ Supported adapters:
11 13
12Note: all have mfr. ID 0x1039. 14Note: 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
40Module Parameters 48Module Parameters
41----------------- 49-----------------
42 50
43* force_addr=0xaddr Set the I/O base address. Useful for boards 51================== =====================================================
52force_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
49Description 59Description
50----------- 60-----------
@@ -56,4 +66,3 @@ WARNING: If you are trying to access the integrated sensors on the SiS5595
56chip, you want the sis5595 driver for those, not this driver. This driver 66chip, you want the sis5595 driver for those, not this driver. This driver
57is a BUS driver, not a CHIP driver. A BUS driver is used by other CHIP 67is a BUS driver, not a CHIP driver. A BUS driver is used by other CHIP
58drivers to access chips on the bus. 68drivers 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 @@
1Kernel driver i2c-sis630
2
3Supported 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
10Author: Alexander Malysh <amalysh@web.de>
11 Amaury Decrême <amaury.decreme@gmail.com> - SiS964 support
12
13Module 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
26Description
27-----------
28
29This SMBus only driver is known to work on motherboards with the above
30named chipsets.
31
32If you see something like this:
33
3400:00.0 Host bridge: Silicon Integrated Systems [SiS] 630 Host (rev 31)
3500:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513
36
37or like this:
38
3900:00.0 Host bridge: Silicon Integrated Systems [SiS] 730 Host (rev 02)
4000:01.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513
41
42or like this:
43
4400:00.0 Host bridge: Silicon Integrated Systems [SiS] 760/M760 Host (rev 02)
4500:02.0 ISA bridge: Silicon Integrated Systems [SiS] SiS964 [MuTIOL Media IO]
46 LPC Controller (rev 36)
47
48in your 'lspci' output , then this driver is for your chipset.
49
50Thank You
51---------
52Philip Edelbrock <phil@netroedge.com>
53- testing SiS730 support
54Mark M. Hoffman <mhoffman@lightlink.com>
55- bug fixes
56
57To 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========================
2Kernel driver i2c-sis630
3========================
4
5Supported 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
12Author:
13 - Alexander Malysh <amalysh@web.de>
14 - Amaury Decrême <amaury.decreme@gmail.com> - SiS964 support
15
16Module Parameters
17-----------------
18
19================== =====================================================
20force = [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
25high_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
32Description
33-----------
34
35This SMBus only driver is known to work on motherboards with the above
36named chipsets.
37
38If 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
43or 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
48or 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
54in your ``lspci`` output , then this driver is for your chipset.
55
56Thank You
57---------
58Philip Edelbrock <phil@netroedge.com>
59- testing SiS730 support
60Mark M. Hoffman <mhoffman@lightlink.com>
61- bug fixes
62
63To 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========================
1Kernel driver i2c-sis96x 2Kernel driver i2c-sis96x
3========================
2 4
3Replaces 2.4.x i2c-sis645 5Replaces 2.4.x i2c-sis645
4 6
5Supported adapters: 7Supported 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
12Author: Mark M. Hoffman <mhoffman@lightlink.com> 17Author: Mark M. Hoffman <mhoffman@lightlink.com>
13 18
@@ -21,17 +26,17 @@ those of the SiS630, although they are located in a completely different
21place. Thanks to Alexander Malysh <amalysh@web.de> for providing the 26place. Thanks to Alexander Malysh <amalysh@web.de> for providing the
22SiS630 datasheet (and driver). 27SiS630 datasheet (and driver).
23 28
24The command "lspci" as root should produce something like these lines: 29The command ``lspci`` as root should produce something like these lines::
25 30
2600:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 31 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645
2700:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 32 00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513
2800:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016 33 00:02.1 SMBus: Silicon Integrated Systems [SiS]: Unknown device 0016
29 34
30or perhaps this... 35or perhaps this::
31 36
3200:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645 37 00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0645
3300:02.0 ISA bridge: Silicon Integrated Systems [SiS]: Unknown device 0961 38 00:02.0 ISA bridge: Silicon Integrated Systems [SiS]: Unknown device 0961
3400: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
53scenario is found where they're needed. 58 scenario is found where they're needed.
54 59
55 60
56Thank You 61Thank You
@@ -58,16 +63,20 @@ Thank You
58 63
59Mark D. Studebaker <mdsxyz123@yahoo.com> 64Mark D. Studebaker <mdsxyz123@yahoo.com>
60 - design hints and bug fixes 65 - design hints and bug fixes
66
61Alexander Maylsh <amalysh@web.de> 67Alexander 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
63Hans-Günter Lütke Uphues <hg_lu@t-online.de> 70Hans-Günter Lütke Uphues <hg_lu@t-online.de>
64 - patch for SiS735 71 - patch for SiS735
72
65Robert Zwerus <arzie@dds.nl> 73Robert Zwerus <arzie@dds.nl>
66 - testing for SiS645DX 74 - testing for SiS645DX
75
67Kianusch Sayah Karadji <kianusch@sk-tech.net> 76Kianusch Sayah Karadji <kianusch@sk-tech.net>
68 - patch for SiS645DX/962 77 - patch for SiS645DX/962
78
69Ken Healy 79Ken Healy
70 - patch for SiS655 80 - patch for SiS655
71 81
72To anyone else who has written w/ feedback, thanks! 82To 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==========================
1Kernel driver i2c-taos-evm 2Kernel driver i2c-taos-evm
3==========================
2 4
3Author: Jean Delvare <jdelvare@suse.de> 5Author: Jean Delvare <jdelvare@suse.de>
4 6
@@ -23,10 +25,10 @@ Using this driver
23In order to use this driver, you'll need the serport driver, and the 25In order to use this driver, you'll need the serport driver, and the
24inputattach tool, which is part of the input-utils package. The following 26inputattach tool, which is part of the input-utils package. The following
25commands will tell the kernel that you have a TAOS EVM on the first 27commands will tell the kernel that you have a TAOS EVM on the first
26serial port: 28serial 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
32Technical details 34Technical 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=====================
1Kernel driver i2c-via 2Kernel driver i2c-via
3=====================
2 4
3Supported adapters: 5Supported adapters:
4 * VIA Technologies, InC. VT82C586B 6 * VIA Technologies, InC. VT82C586B
@@ -12,23 +14,27 @@ Description
12i2c-via is an i2c bus driver for motherboards with VIA chipset. 14i2c-via is an i2c bus driver for motherboards with VIA chipset.
13 15
14The following VIA pci chipsets are supported: 16The 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
18Your lspci listing must show this : 20Your ``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? 24Problems?
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========================
1Kernel driver i2c-viapro 2Kernel driver i2c-viapro
3========================
2 4
3Supported adapters: 5Supported 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
28Authors: 30Authors:
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
33Module Parameters 35Module Parameters
34----------------- 36-----------------
@@ -44,8 +46,9 @@ Description
44i2c-viapro is a true SMBus host driver for motherboards with one of the 46i2c-viapro is a true SMBus host driver for motherboards with one of the
45supported VIA south bridges. 47supported VIA south bridges.
46 48
47Your lspci -n listing must show one of these : 49Your ``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
65If none of these show up, you should look in the BIOS for settings like 69If none of these show up, you should look in the BIOS for settings like
66enable ACPI / SMBus or even USB. 70enable 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===============
4I2C 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========================
1Kernel driver scx200_acb 2Kernel driver scx200_acb
3========================
2 4
3Author: Christer Weinigel <wingel@nano-system.com> 5Author: Christer Weinigel <wingel@nano-system.com>
4 6
@@ -25,8 +27,11 @@ Device-specific notes
25 27
26The SC1100 WRAP boards are known to use base addresses 0x810 and 0x820. 28The SC1100 WRAP boards are known to use base addresses 0x810 and 0x820.
27If the scx200_acb driver is built into the kernel, add the following 29If the scx200_acb driver is built into the kernel, add the following
28parameter to your boot command line: 30parameter to your boot command line::
31
29 scx200_acb.base=0x810,0x820 32 scx200_acb.base=0x810,0x820
33
30If the scx200_acb driver is built as a module, add the following line to 34If the scx200_acb driver is built as a module, add the following line to
31a configuration file in /etc/modprobe.d/ instead: 35a 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====================
2I2C Device Interface
3====================
4
1Usually, i2c devices are controlled by a kernel driver. But it is also 5Usually, i2c devices are controlled by a kernel driver. But it is also
2possible to access all devices on an adapter from userspace, through 6possible to access all devices on an adapter from userspace, through
3the /dev interface. You need to load module i2c-dev for this. 7the /dev interface. You need to load module i2c-dev for this.
@@ -18,7 +22,7 @@ C example
18========= 22=========
19 23
20So let's say you want to access an i2c adapter from a C program. 24So let's say you want to access an i2c adapter from a C program.
21First, you need to include these two headers: 25First, 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.
28Adapter numbers are assigned somewhat dynamically, so you can not 32Adapter numbers are assigned somewhat dynamically, so you can not
29assume much about them. They can even change from one boot to the next. 33assume much about them. They can even change from one boot to the next.
30 34
31Next thing, open the device file, as follows: 35Next 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
44When you have opened the device, you must specify with what device 48When you have opened the device, you must specify with what device
45address you want to communicate: 49address 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
54Well, you are all set up now. You can now use SMBus commands or plain 58Well, you are all set up now. You can now use SMBus commands or plain
55I2C to communicate with your device. SMBus commands are preferred if 59I2C to communicate with your device. SMBus commands are preferred if
56the device supports them. Both are illustrated below. 60the 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
101The following IOCTLs are defined: 105The following IOCTLs are defined:
102 106
103ioctl(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
108ioctl(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
113ioctl(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
120ioctl(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
123ioctl(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
139ioctl(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
143You can do plain i2c transactions by using read(2) and write(2) calls. 147You 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
145ioctl I2C_SLAVE before you try to access the device. 149ioctl I2C_SLAVE before you try to access the device.
146 150
147You can do SMBus level transactions (see documentation file smbus-protocol 151You can do SMBus level transactions (see documentation file smbus-protocol
148for details) through the following functions: 152for 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
160All these transactions return -1 on failure; you can read errno to see 166All these transactions return -1 on failure; you can read errno to see
161what happened. The 'write' transactions return 0 on success; the 167what 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
174For the interested, here's the code flow which happens inside the kernel 180For the interested, here's the code flow which happens inside the kernel
175when you use the /dev interface to I2C: 181when you use the /dev interface to I2C:
176 182
1771* Your program opens /dev/i2c-N and calls ioctl() on it, as described in 1831) Your program opens /dev/i2c-N and calls ioctl() on it, as described in
178section "C example" above. 184 section "C example" above.
179 185
1802* These open() and ioctl() calls are handled by the i2c-dev kernel 1862) These open() and ioctl() calls are handled by the i2c-dev kernel
181driver: 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(),
182respectively. 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
183that can be programmed from user-space. 189 that can be programmed from user-space.
184 190
1853* Some ioctl() calls are for administrative tasks and are handled by 1913) Some ioctl() calls are for administrative tasks and are handled by
186i2c-dev directly. Examples include I2C_SLAVE (set the address of the 192 i2c-dev directly. Examples include I2C_SLAVE (set the address of the
187device 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
188checking on future transactions.) 194 checking on future transactions.)
189 195
1904* Other ioctl() calls are converted to in-kernel function calls by 1964) Other ioctl() calls are converted to in-kernel function calls by
191i2c-dev. Examples include I2C_FUNCS, which queries the I2C adapter 197 i2c-dev. Examples include I2C_FUNCS, which queries the I2C adapter
192functionality using i2c.h:i2c_get_functionality(), and I2C_SMBUS, which 198 functionality using i2c.h:i2c_get_functionality(), and I2C_SMBUS, which
193performs 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
195The i2c-dev driver is responsible for checking all the parameters that 201 The i2c-dev driver is responsible for checking all the parameters that
196come from user-space for validity. After this point, there is no 202 come from user-space for validity. After this point, there is no
197difference between these calls that came from user-space through i2c-dev 203 difference between these calls that came from user-space through i2c-dev
198and calls that would have been performed by kernel I2C chip drivers 204 and calls that would have been performed by kernel I2C chip drivers
199directly. This means that I2C bus drivers don't need to implement 205 directly. This means that I2C bus drivers don't need to implement
200anything special to support access from user-space. 206 anything special to support access from user-space.
201 207
2025* These i2c.h functions are wrappers to the actual implementation of 2085) These i2c.h functions are wrappers to the actual implementation of
203your I2C bus driver. Each adapter must declare callback functions 209 your I2C bus driver. Each adapter must declare callback functions
204implementing these standard calls. i2c.h:i2c_get_functionality() calls 210 implementing these standard calls. i2c.h:i2c_get_functionality() calls
205i2c_adapter.algo->functionality(), while 211 i2c_adapter.algo->functionality(), while
206i2c-core-smbus.c:i2c_smbus_xfer() calls either 212 i2c-core-smbus.c:i2c_smbus_xfer() calls either
207adapter.algo->smbus_xfer() if it is implemented, or if not, 213 adapter.algo->smbus_xfer() if it is implemented, or if not,
208i2c-core-smbus.c:i2c_smbus_xfer_emulated() which in turn calls 214 i2c-core-smbus.c:i2c_smbus_xfer_emulated() which in turn calls
209i2c_adapter.algo->master_xfer(). 215 i2c_adapter.algo->master_xfer().
210 216
211After your I2C bus driver has processed these requests, execution runs 217After your I2C bus driver has processed these requests, execution runs
212up the call chain, with almost no processing done, except by i2c-dev to 218up 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=====================
2I2C/SMBUS Fault Codes
3=====================
4
1This is a summary of the most important conventions for use of fault 5This is a summary of the most important conventions for use of fault
2codes in the I2C/SMBus stack. 6codes 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=======================
2I2C/SMBus Functionality
3=======================
4
1INTRODUCTION 5INTRODUCTION
2------------ 6------------
3 7
4Because not every I2C or SMBus adapter implements everything in the 8Because not every I2C or SMBus adapter implements everything in the
5I2C specifications, a client can not trust that everything it needs 9I2C specifications, a client can not trust that everything it needs
6is implemented when it is given the option to attach to an adapter: 10is implemented when it is given the option to attach to an adapter:
7the client needs some way to check whether an adapter has the needed 11the client needs some way to check whether an adapter has the needed
8functionality. 12functionality.
9 13
10 14
11FUNCTIONALITY CONSTANTS 15FUNCTIONALITY CONSTANTS
@@ -14,6 +18,7 @@ FUNCTIONALITY CONSTANTS
14For the most up-to-date list of functionality constants, please check 18For 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
37A few combinations of the above flags are also defined for your convenience: 43A 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
53In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as 61In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as
54part of I2C_FUNC_PROTOCOL_MANGLING. 62part of I2C_FUNC_PROTOCOL_MANGLING.
@@ -58,11 +66,11 @@ ADAPTER IMPLEMENTATION
58---------------------- 66----------------------
59 67
60When you write a new adapter driver, you will have to implement a 68When you write a new adapter driver, you will have to implement a
61function callback `functionality'. Typical implementations are given 69function callback ``functionality``. Typical implementations are given
62below. 70below.
63 71
64A typical SMBus-only adapter would list all the SMBus transactions it 72A typical SMBus-only adapter would list all the SMBus transactions it
65supports. This example comes from the i2c-piix4 driver: 73supports. 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
74A typical full-I2C adapter would use the following (from the i2c-pxa 82A typical full-I2C adapter would use the following (from the i2c-pxa
75driver): 83driver)::
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
94Before a client tries to attach to an adapter, or even do tests to check 102Before a client tries to attach to an adapter, or even do tests to check
95whether one of the devices it supports is present on an adapter, it should 103whether one of the devices it supports is present on an adapter, it should
96check whether the needed functionality is present. The typical way to do 104check whether the needed functionality is present. The typical way to do
97this is (from the lm75 driver): 105this 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
129to use the /dev interface. You will still have to check whether the 137to use the /dev interface. You will still have to check whether the
130functionality you need is supported, of course. This is done using 138functionality you need is supported, of course. This is done using
131the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is 139the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is
132below: 140below::
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
104should be detected beforehand. Also note, that SCL going down is monitored 104should be detected beforehand. Also note, that SCL going down is monitored
105using interrupts, so the interrupt latency might cause the first bits to be not 105using interrupts, so the interrupt latency might cause the first bits to be not
106corrupted. A good starting point for using this fault injector on an otherwise 106corrupted. A good starting point for using this fault injector on an otherwise
107idle bus is: 107idle 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
112Panic during transfer 112Panic during transfer
113===================== 113=====================
@@ -127,10 +127,10 @@ The calling process will then sleep and wait for the next bus clock. The
127process is interruptible, though. 127process is interruptible, though.
128 128
129Start of a transfer is detected by waiting for SCL going down by the master 129Start of a transfer is detected by waiting for SCL going down by the master
130under test. A good starting point for using this fault injector is: 130under 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
135Note that there doesn't need to be a device listening to the address you are 135Note that there doesn't need to be a device listening to the address you are
136using. Results may vary depending on that, though. 136using. 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============
2I2C Protocol
3============
4
1This document describes the i2c protocol. Or will, when it is finished :-) 5This document describes the i2c protocol. Or will, when it is finished :-)
2 6
3Key to symbols 7Key to symbols
4============== 8==============
5 9
10=============== =============================================================
6S (1 bit) : Start bit 11S (1 bit) : Start bit
7P (1 bit) : Stop bit 12P (1 bit) : Stop bit
8Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. 13Rd/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.
16Count (8 bits): A data byte containing the length of a block operation. 21Count (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
21Simple send transaction 28Simple send transaction
22====================== 29=======================
23 30
24This corresponds to i2c_master_send. 31This 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
29Simple receive transaction 36Simple receive transaction
30=========================== 37==========================
31 38
32This corresponds to i2c_master_recv 39This 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
37Combined transactions 44Combined transactions
38==================== 45=====================
39 46
40This corresponds to i2c_transfer 47This corresponds to i2c_transfer
41 48
42They are just like the above transactions, but instead of a stop bit P 49They are just like the above transactions, but instead of a stop bit P
43a start bit S is sent and the transaction continues. An example of 50a start bit S is sent and the transaction continues. An example of
44a byte read, followed by a byte write: 51a 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:
65I2C_M_NOSTART: 72I2C_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:
79I2C_M_REV_DIR_ADDR: 88I2C_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
85I2C_M_STOP: 95I2C_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 @@
1MODULE: i2c-stub 1========
2i2c-stub
3========
2 4
3DESCRIPTION: 5Description
6===========
4 7
5This module is a very simple fake I2C/SMBus driver. It implements six 8This module is a very simple fake I2C/SMBus driver. It implements six
6types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w) 9types 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
28return the number of bytes selected with the largest write so far. 31return the number of bytes selected with the largest write so far.
29 32
30The typical use-case is like this: 33The 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:
36There's a script named i2c-stub-from-dump in the i2c-tools package which 40There's a script named i2c-stub-from-dump in the i2c-tools package which
37can load register values automatically from a chip dump. 41can load register values automatically from a chip dump.
38 42
39PARAMETERS: 43Parameters
44==========
40 45
41int chip_addr[10]: 46int 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
50u8 bank_reg[10] 55u8 bank_reg[10], u8 bank_mask[10], u8 bank_start[10], u8 bank_end[10]:
51u8 bank_mask[10]
52u8 bank_start[10]
53u8 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
57CAVEATS: 59Caveats
60=======
58 61
59If your target driver polls some byte or word waiting for it to change, the 62If your target driver polls some byte or word waiting for it to change, the
60stub could lock it up. Use i2cset to unlock it. 63stub could lock it up. Use i2cset to unlock it.
61 64
62If you spam it hard enough, printk can be lossy. This module really wants 65If you spam it hard enough, printk can be lossy. This module really wants
63something like relayfs. 66something 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============
1I2C topology 2I2C 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
16Etc 17Etc
18===
17 19
18These constructs are represented as i2c adapter trees by Linux, where 20These constructs are represented as i2c adapter trees by Linux, where
19each adapter has a parent adapter (except the root adapter) and zero or 21each 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
37useful to know if a mux is mux-locked or if it is parent-locked. The 39useful to know if a mux is mux-locked or if it is parent-locked. The
38following list was correct at the time of writing: 40following list was correct at the time of writing:
39 41
40In drivers/i2c/muxes/ 42In drivers/i2c/muxes/:
43
44====================== =============================================
41i2c-arb-gpio-challenge Parent-locked 45i2c-arb-gpio-challenge Parent-locked
42i2c-mux-gpio Normally parent-locked, mux-locked iff 46i2c-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.
54i2c-mux-reg Parent-locked 58i2c-mux-reg Parent-locked
59====================== =============================================
60
61In drivers/iio/:
55 62
56In drivers/iio/ 63====================== =============================================
57gyro/mpu3050 Mux-locked 64gyro/mpu3050 Mux-locked
58imu/inv_mpu6050/ Mux-locked 65imu/inv_mpu6050/ Mux-locked
66====================== =============================================
59 67
60In drivers/media/ 68In drivers/media/:
69
70======================= =============================================
61dvb-frontends/lgdt3306a Mux-locked 71dvb-frontends/lgdt3306a Mux-locked
62dvb-frontends/m88ds3103 Parent-locked 72dvb-frontends/m88ds3103 Parent-locked
63dvb-frontends/rtl2830 Parent-locked 73dvb-frontends/rtl2830 Parent-locked
64dvb-frontends/rtl2832 Mux-locked 74dvb-frontends/rtl2832 Mux-locked
65dvb-frontends/si2168 Mux-locked 75dvb-frontends/si2168 Mux-locked
66usb/cx231xx/ Parent-locked 76usb/cx231xx/ Parent-locked
77======================= =============================================
67 78
68 79
69Mux-locked muxes 80Mux-locked muxes
@@ -78,6 +89,7 @@ full transaction, unrelated i2c transfers may interleave the different
78stages of the transaction. This has the benefit that the mux driver 89stages of the transaction. This has the benefit that the mux driver
79may be easier and cleaner to implement, but it has some caveats. 90may be easier and cleaner to implement, but it has some caveats.
80 91
92==== =====================================================================
81ML1. If you build a topology with a mux-locked mux being the parent 93ML1. 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
110Mux-locked Example 123Mux-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
149caveats. 165caveats.
150 166
167==== ====================================================================
151PL1. If you build a topology with a parent-locked mux being the child 168PL1. 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
166Parent-locked Example 184Parent-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
178When there is an access to D1, this happens: 198When 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.
19310. M1 unlocks muxes on its parent. 213 10. M1 unlocks muxes on its parent.
194 214
195 215
196This means that accesses to both D2 and D3 are locked out for the full 216This means that accesses to both D2 and D3 are locked out for the full
@@ -203,7 +223,7 @@ Complex Examples
203Parent-locked mux as parent of parent-locked mux 223Parent-locked mux as parent of parent-locked mux
204------------------------------------------------ 224------------------------------------------------
205 225
206This is a useful topology, but it can be bad. 226This 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.
227Mux-locked mux as parent of mux-locked mux 247Mux-locked mux as parent of mux-locked mux
228------------------------------------------ 248------------------------------------------
229 249
230This is a good topology. 250This 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.
248Mux-locked mux as parent of parent-locked mux 268Mux-locked mux as parent of parent-locked mux
249--------------------------------------------- 269---------------------------------------------
250 270
251This is probably a bad topology. 271This 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.
282Parent-locked mux as parent of mux-locked mux 302Parent-locked mux as parent of mux-locked mux
283--------------------------------------------- 303---------------------------------------------
284 304
285This is a good topology. 305This 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.
306Two mux-locked sibling muxes 326Two mux-locked sibling muxes
307---------------------------- 327----------------------------
308 328
309This is a good topology. 329This 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.
330Two parent-locked sibling muxes 350Two parent-locked sibling muxes
331------------------------------- 351-------------------------------
332 352
333This is a good topology. 353This is a good topology::
334 354
335 .--------. 355 .--------.
336 .----------. .--| dev D1 | 356 .----------. .--| dev D1 |
@@ -354,7 +374,7 @@ out.
354Mux-locked and parent-locked sibling muxes 374Mux-locked and parent-locked sibling muxes
355------------------------------------------ 375------------------------------------------
356 376
357This is a good topology. 377This 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===================
4I2C/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==============================
1How to instantiate I2C devices 2How 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
17devices which live on this bus. This is done with an array of struct 18devices which live on this bus. This is done with an array of struct
18i2c_board_info which is registered by calling i2c_register_board_info(). 19i2c_board_info which is registered by calling i2c_register_board_info().
19 20
20Example (from omap2 h4): 21Example (from omap2 h4)::
21 22
22static 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
37static 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
45The above code declares 3 devices on I2C bus 1, including their respective 46The above code declares 3 devices on I2C bus 1, including their respective
46addresses and custom data needed by their drivers. When the I2C bus in 47addresses and custom data needed by their drivers. When the I2C bus in
@@ -57,7 +58,7 @@ Method 1b: Declare the I2C devices via devicetree
57This method has the same implications as method 1a. The declaration of I2C 58This method has the same implications as method 1a. The declaration of I2C
58devices is here done via devicetree as subnodes of the master controller. 59devices is here done via devicetree as subnodes of the master controller.
59 60
60Example: 61Example::
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,
99you can instantiate your I2C devices explicitly. This is done by filling 100you can instantiate your I2C devices explicitly. This is done by filling
100a struct i2c_board_info and calling i2c_new_device(). 101a struct i2c_board_info and calling i2c_new_device().
101 102
102Example (from the sfe4001 network driver): 103Example (from the sfe4001 network driver)::
103 104
104static 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
108int 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
117The above code instantiates 1 I2C device on the I2C bus which is on the 118The above code instantiates 1 I2C device on the I2C bus which is on the
118network adapter in question. 119network adapter in question.
@@ -124,12 +125,12 @@ it may have different addresses from one board to the next (manufacturer
124changing its design without notice). In this case, you can call 125changing its design without notice). In this case, you can call
125i2c_new_probed_device() instead of i2c_new_device(). 126i2c_new_probed_device() instead of i2c_new_device().
126 127
127Example (from the nxp OHCI driver): 128Example (from the nxp OHCI driver)::
128 129
129static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; 130 static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END };
130 131
131static 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
147The above code instantiates up to 1 I2C device on the I2C bus which is on 148The above code instantiates up to 1 I2C device on the I2C bus which is on
148the OHCI adapter in question. It first tries at address 0x2c, if nothing 149the 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
172drivers are loaded, and if any is found, an I2C device will be 173drivers are loaded, and if any is found, an I2C device will be
173instantiated automatically. In order to prevent any misbehavior of this 174instantiated automatically. In order to prevent any misbehavior of this
174mechanism, the following restrictions apply: 175mechanism, 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.
189Those of you familiar with the i2c subsystem of 2.4 kernels and early 2.6 191Those of you familiar with the i2c subsystem of 2.4 kernels and early 2.6
190kernels will find out that this method 3 is essentially similar to what 192kernels will find out that this method 3 is essentially similar to what
191was done there. Two significant differences are: 193was 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
224segment, the address is sufficient to uniquely identify the device to be 227segment, the address is sufficient to uniquely identify the device to be
225deleted. 228deleted.
226 229
227Example: 230Example::
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
230While this interface should only be used when in-kernel device declaration 234While this interface should only be used when in-kernel device declaration
231can't be done, there is a variety of cases where it can be helpful: 235can'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==========================
1Kernel driver i2c-mux-gpio 2Kernel driver i2c-mux-gpio
3==========================
2 4
3Author: Peter Korsgaard <peter.korsgaard@barco.com> 5Author: Peter Korsgaard <peter.korsgaard@barco.com>
4 6
@@ -8,7 +10,7 @@ Description
8i2c-mux-gpio is an i2c mux driver providing access to I2C bus segments 10i2c-mux-gpio is an i2c mux driver providing access to I2C bus segments
9from a master I2C bus and a hardware MUX controlled through GPIO pins. 11from a master I2C bus and a hardware MUX controlled through GPIO pins.
10 12
11E.G.: 13E.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
33to control it. See include/linux/platform_data/i2c-mux-gpio.h for details. 35to control it. See include/linux/platform_data/i2c-mux-gpio.h for details.
34 36
35E.G. something like this for a MUX providing 4 bus segments 37E.G. something like this for a MUX providing 4 bus segments
36controlled through 3 GPIO pins: 38controlled 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
41static 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
45static 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
49static 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
59static 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
67If you don't know the absolute GPIO pin numbers at registration time, 69If you don't know the absolute GPIO pin numbers at registration time,
68you can instead provide a chip name (.chip_name) and relative GPIO pin 70you 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=================================================
1I2C device driver binding control from user-space 2I2C 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.
19Attaching a driver to an I2C device 20Attaching a driver to an I2C device
20----------------------------------- 21-----------------------------------
21 22
22Old method (module parameters): 23Old 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
29New method (sysfs interface)::
26 30
27New 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
30Preventing a driver from attaching to an I2C device 33Preventing a driver from attaching to an I2C device
31--------------------------------------------------- 34---------------------------------------------------
32 35
33Old method (module parameters): 36Old method (module parameters)::
34# modprobe <driver> ignore=1,0x2f 37
38 # modprobe <driver> ignore=1,0x2f
39
40New method (sysfs interface)::
35 41
36New 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
40Of course, it is important to instantiate the "dummy" device before loading 45Of course, it is important to instantiate the "dummy" device before loading
41the driver. The dummy device will be handled by i2c-core itself, preventing 46the 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==============================
1Linux I2C slave eeprom backend 2Linux I2C slave eeprom backend
2============================== 3==============================
3 4
@@ -5,10 +6,9 @@ by Wolfram Sang <wsa@sang-engineering.com> in 2014-15
5 6
6This is a proof-of-concept backend which acts like an EEPROM on the connected 7This is a proof-of-concept backend which acts like an EEPROM on the connected
7I2C bus. The memory contents can be modified from userspace via this file 8I2C bus. The memory contents can be modified from userspace via this file
8located in sysfs: 9located in sysfs::
9 10
10 /sys/bus/i2c/devices/<device-directory>/slave-eeprom 11 /sys/bus/i2c/devices/<device-directory>/slave-eeprom
11 12
12As of 2015, Linux doesn't support poll on binary sysfs files, so there is no 13As of 2015, Linux doesn't support poll on binary sysfs files, so there is no
13notification when another master changed the content. 14notification 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=====================================
1Linux I2C slave interface description 2Linux 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
12needed. The backend driver and the I2C bus driver communicate via events. Here 13needed. The backend driver and the I2C bus driver communicate via events. Here
13is a small graph visualizing the data flow and the means by which data is 14is a small graph visualizing the data flow and the means by which data is
14transported. The dotted line marks only one example. The backend could also 15transported. The dotted line marks only one example. The backend could also
15use a character device, be in-kernel only, or something completely different: 16use 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
35is that i2c slave backends have their own address space. So, you have to add 36is that i2c slave backends have their own address space. So, you have to add
360x1000 to the address you would originally request. An example for 370x1000 to the address you would originally request. An example for
37instantiating the slave-eeprom driver from userspace at the 7 bit address 0x64 38instantiating the slave-eeprom driver from userspace at the 7 bit address 0x64
38on bus 1: 39on 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.
54I2C slave events 55I2C slave events
55---------------- 56----------------
56 57
57The bus driver sends an event to the backend using the following function: 58The 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
75Another I2C master wants to write data to us. This event should be sent once 77Another I2C master wants to write data to us. This event should be sent once
76our own address and the write bit was detected. The data did not arrive yet, so 78our 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
85Another I2C master wants to read data from us. This event should be sent once 88Another I2C master wants to read data from us. This event should be sent once
86our own address and the read bit was detected. After returning, the bus driver 89our 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
94Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret' 98Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret'
95is zero, the bus driver should ack this byte. If 'ret' is an errno, then the byte 99is 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
103The bus driver requests the next byte to be sent to another I2C master in 108The 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
117A stop condition was received. This can happen anytime and the backend should 123A stop condition was received. This can happen anytime and the backend should
118reset its state machine for I2C transfers to be able to receive new requests. 124reset 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======================
1SMBus Protocol Summary 2SMBus Protocol Summary
2====================== 3======================
3 4
@@ -27,17 +28,18 @@ Each transaction type corresponds to a functionality flag. Before calling a
27transaction function, a device driver should always check (just once) for 28transaction function, a device driver should always check (just once) for
28the corresponding functionality flag to ensure that the underlying I2C 29the corresponding functionality flag to ensure that the underlying I2C
29adapter supports the transaction in question. See 30adapter 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
33Key to symbols 34Key to symbols
34============== 35==============
35 36
37=============== =============================================================
36S (1 bit) : Start bit 38S (1 bit) : Start bit
37P (1 bit) : Stop bit 39P (1 bit) : Stop bit
38Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0. 40Rd/Wr (1 bit) : Read/Write bit. Rd equals 1, Wr equals 0.
39A, NA (1 bit) : Accept and reverse accept bit. 41A, NA (1 bit) : Accept and reverse accept bit.
40Addr (7 bits): I2C 7 bit address. Note that this can be expanded as usual to 42Addr (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.
42Comm (8 bits): Command byte, a data byte which often selects a register on 44Comm (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.
46Count (8 bits): A data byte containing the length of a block operation. 48Count (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
51SMBus Quick Command 55SMBus Quick Command
52=================== 56===================
53 57
54This sends a single bit to the device, at the place of the Rd/Wr bit. 58This sends a single bit to the device, at the place of the Rd/Wr bit::
55 59
56A Addr Rd/Wr [A] P 60 A Addr Rd/Wr [A] P
57 61
58Functionality flag: I2C_FUNC_SMBUS_QUICK 62Functionality flag: I2C_FUNC_SMBUS_QUICK
59 63
@@ -64,9 +68,9 @@ SMBus Receive Byte: i2c_smbus_read_byte()
64This reads a single byte from a device, without specifying a device 68This reads a single byte from a device, without specifying a device
65register. Some devices are so simple that this interface is enough; for 69register. Some devices are so simple that this interface is enough; for
66others, it is a shorthand if you want to read the same register as in 70others, it is a shorthand if you want to read the same register as in
67the previous SMBus command. 71the previous SMBus command::
68 72
69S Addr Rd [A] [Data] NA P 73 S Addr Rd [A] [Data] NA P
70 74
71Functionality flag: I2C_FUNC_SMBUS_READ_BYTE 75Functionality flag: I2C_FUNC_SMBUS_READ_BYTE
72 76
@@ -77,7 +81,9 @@ SMBus Send Byte: i2c_smbus_write_byte()
77This operation is the reverse of Receive Byte: it sends a single byte 81This operation is the reverse of Receive Byte: it sends a single byte
78to a device. See Receive Byte for more information. 82to a device. See Receive Byte for more information.
79 83
80S Addr Wr [A] Data [A] P 84::
85
86 S Addr Wr [A] Data [A] P
81 87
82Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE 88Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE
83 89
@@ -86,9 +92,9 @@ SMBus Read Byte: i2c_smbus_read_byte_data()
86============================================ 92============================================
87 93
88This reads a single byte from a device, from a designated register. 94This reads a single byte from a device, from a designated register.
89The register is specified through the Comm byte. 95The register is specified through the Comm byte::
90 96
91S 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
93Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA 99Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA
94 100
@@ -98,9 +104,9 @@ SMBus Read Word: i2c_smbus_read_word_data()
98 104
99This operation is very like Read Byte; again, data is read from a 105This operation is very like Read Byte; again, data is read from a
100device, from a designated register that is specified through the Comm 106device, from a designated register that is specified through the Comm
101byte. But this time, the data is a complete word (16 bits). 107byte. But this time, the data is a complete word (16 bits)::
102 108
103S 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
105Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA 111Functionality 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
116register is specified through the Comm byte. This is the opposite of 122register is specified through the Comm byte. This is the opposite of
117the Read Byte operation. 123the Read Byte operation.
118 124
119S Addr Wr [A] Comm [A] Data [A] P 125::
126
127 S Addr Wr [A] Comm [A] Data [A] P
120 128
121Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA 129Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA
122 130
@@ -126,9 +134,9 @@ SMBus Write Word: i2c_smbus_write_word_data()
126 134
127This is the opposite of the Read Word operation. 16 bits 135This is the opposite of the Read Word operation. 16 bits
128of data is written to a device, to the designated register that is 136of data is written to a device, to the designated register that is
129specified through the Comm byte. 137specified through the Comm byte.::
130 138
131S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P 139 S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P
132 140
133Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA 141Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA
134 142
@@ -141,10 +149,10 @@ SMBus Process Call:
141=================== 149===================
142 150
143This command selects a device register (through the Comm byte), sends 151This command selects a device register (through the Comm byte), sends
14416 bits of data to it, and reads 16 bits of data in return. 15216 bits of data to it, and reads 16 bits of data in return::
145 153
146S 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
149Functionality flag: I2C_FUNC_SMBUS_PROC_CALL 157Functionality flag: I2C_FUNC_SMBUS_PROC_CALL
150 158
@@ -152,12 +160,14 @@ Functionality flag: I2C_FUNC_SMBUS_PROC_CALL
152SMBus Block Read: i2c_smbus_read_block_data() 160SMBus Block Read: i2c_smbus_read_block_data()
153============================================== 161==============================================
154 162
155This command reads a block of up to 32 bytes from a device, from a 163This command reads a block of up to 32 bytes from a device, from a
156designated register that is specified through the Comm byte. The amount 164designated register that is specified through the Comm byte. The amount
157of data is specified by the device in the Count byte. 165of data is specified by the device in the Count byte.
158 166
159S 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
162Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA 172Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA
163 173
@@ -165,11 +175,13 @@ Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA
165SMBus Block Write: i2c_smbus_write_block_data() 175SMBus Block Write: i2c_smbus_write_block_data()
166================================================ 176================================================
167 177
168The opposite of the Block Read command, this writes up to 32 bytes to 178The opposite of the Block Read command, this writes up to 32 bytes to
169a device, to a designated register that is specified through the 179a device, to a designated register that is specified through the
170Comm byte. The amount of data is specified in the Count byte. 180Comm byte. The amount of data is specified in the Count byte.
171 181
172S 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
174Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 186Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA
175 187
@@ -181,10 +193,10 @@ SMBus Block Write - Block Read Process Call was introduced in
181Revision 2.0 of the specification. 193Revision 2.0 of the specification.
182 194
183This command selects a device register (through the Comm byte), sends 195This command selects a device register (through the Comm byte), sends
1841 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return. 1961 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return::
185 197
186S 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
189Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL 201Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL
190 202
@@ -197,9 +209,12 @@ SMBus host acting as a slave.
197It is the same form as Write Word, with the command code replaced by the 209It is the same form as Write Word, with the command code replaced by the
198alerting device's address. 210alerting 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
202This is implemented in the following way in the Linux kernel: 216This 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
241to know which slave triggered the interrupt. 256to know which slave triggered the interrupt.
242 257
243This is implemented the following way in the Linux kernel: 258This 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.
261I2C Block Read: i2c_smbus_read_i2c_block_data() 277I2C Block Read: i2c_smbus_read_i2c_block_data()
262================================================ 278================================================
263 279
264This command reads a block of bytes from a device, from a 280This command reads a block of bytes from a device, from a
265designated register that is specified through the Comm byte. 281designated register that is specified through the Comm byte::
266 282
267S 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
270Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK 286Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK
271 287
@@ -273,11 +289,13 @@ Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK
273I2C Block Write: i2c_smbus_write_i2c_block_data() 289I2C Block Write: i2c_smbus_write_i2c_block_data()
274================================================== 290==================================================
275 291
276The opposite of the Block Read command, this writes bytes to 292The opposite of the Block Read command, this writes bytes to
277a device, to a designated register that is specified through the 293a device, to a designated register that is specified through the
278Comm byte. Note that command lengths of 0, 2, or more bytes are 294Comm byte. Note that command lengths of 0, 2, or more bytes are
279supported as they are indistinguishable from data. 295supported as they are indistinguishable from data.
280 296
281S 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
283Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 301Functionality 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=============
1I2C and SMBus 2I2C and SMBus
2============= 3=============
3 4
4I2C (pronounce: I squared C) is a protocol developed by Philips. It is a 5I2C (pronounce: I squared C) is a protocol developed by Philips. It is a
5slow two-wire protocol (variable speed, up to 400 kHz), with a high speed 6slow two-wire protocol (variable speed, up to 400 kHz), with a high speed
6extension (3.4 MHz). It provides an inexpensive bus for connecting many 7extension (3.4 MHz). It provides an inexpensive bus for connecting many
7types of devices with infrequent or low bandwidth communications needs. 8types of devices with infrequent or low bandwidth communications needs.
@@ -24,7 +25,8 @@ implement all the common SMBus protocol semantics or messages.
24Terminology 25Terminology
25=========== 26===========
26 27
27When we talk about I2C, we use the following terms: 28When 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=====================
2I2C Ten-bit Addresses
3=====================
4
1The I2C protocol knows about two kinds of device addresses: normal 7 bit 5The I2C protocol knows about two kinds of device addresses: normal 7 bit
2addresses, and an extended set of 10 bit addresses. The sets of addresses 6addresses, and an extended set of 10 bit addresses. The sets of addresses
3do not intersect: the 7 bit address 0x10 is not the same as the 10 bit 7do 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
13The current 10 bit address support is minimal. It should work, however 17The current 10 bit address support is minimal. It should work, however
14you can expect some problems along the way: 18you 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=================================================
1Upgrading I2C Drivers to the new 2.6 Driver Model 2Upgrading 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.
13Example old-style driver 14Example old-style driver
14------------------------ 15------------------------
15 16
17::
16 18
17struct example_state { 19 struct example_state {
18 struct i2c_client client; 20 struct i2c_client client;
19 .... 21 ....
20}; 22 };
21 23
22static struct i2c_driver example_driver; 24 static struct i2c_driver example_driver;
23 25
24static unsigned short ignore[] = { I2C_CLIENT_END }; 26 static unsigned short ignore[] = { I2C_CLIENT_END };
25static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; 27 static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END };
26 28
27I2C_CLIENT_INSMOD; 29 I2C_CLIENT_INSMOD;
28 30
29static 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
64static 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
73static 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
78static 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
89Updating the client 91Updating the client
@@ -93,38 +95,38 @@ The new style binding model will check against a list of supported
93devices and their associated address supplied by the code registering 95devices and their associated address supplied by the code registering
94the busses. This means that the driver .attach_adapter and 96the 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,
96as follows: 98as 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
115Add the probe and remove methods to the i2c_driver, as so: 117Add 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
122Change the example_attach method to accept the new parameters 124Change the example_attach method to accept the new parameters
123which include the i2c_client that it will be working with: 125which 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
129Change the name of example_attach to example_probe to align it with the 131Change the name of example_attach to example_probe to align it with the
130i2c_driver entry names. The rest of the probe routine will now need to be 132i2c_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
133The necessary client fields have already been setup before 135The necessary client fields have already been setup before
134the probe function is called, so the following client setup 136the probe function is called, so the following client setup
135can be removed: 137can 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
143The i2c_set_clientdata is now: 145The 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
148The call to i2c_attach_client is no longer needed, if the probe 150The call to i2c_attach_client is no longer needed, if the probe
149routine exits successfully, then the driver will be automatically 151routine exits successfully, then the driver will be automatically
150attached by the core. Change the probe routine as so: 152attached 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
160Remove the storage of 'struct i2c_client' from the 'struct example_state' 162Remove the storage of 'struct i2c_client' from the 'struct example_state'
161as we are provided with the i2c_client in our example_probe. Instead we 163as we are provided with the i2c_client in our example_probe. Instead we
162store a pointer to it for when it is needed. 164store a pointer to it for when it is needed.
163 165
164struct 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
168the new i2c client as so: 172the 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
173And remove the change after our client is attached, as the driver no 177And remove the change after our client is attached, as the driver no
174longer needs to register a new client structure with the core: 178longer 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
178In the probe routine, ensure that the new state has the client stored 182In the probe routine, ensure that the new state has the client stored
179in it: 183in it::
180 184
181static 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
196Update the detach method, by changing the name to _remove and 200Update the detach method, by changing the name to _remove and
197to delete the i2c_detach_client call. It is possible that you 201to delete the i2c_detach_client call. It is possible that you
198can also remove the ret variable as it is not needed for any 202can also remove the ret variable as it is not needed for any
199of the core functions. 203of 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
208And finally ensure that we have the correct ID table for the i2c-core 214And finally ensure that we have the correct ID table for the i2c-core
209and other utilities: 215and 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
218static 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
226Our driver should now look like this: 232Our driver should now look like this::
227 233
228struct example_state { 234 struct example_state {
229 struct i2c_client *client; 235 struct i2c_client *client;
230 .... 236 ....
231}; 237 };
232 238
233static 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
255static 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
263static 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
268MODULE_DEVICE_TABLE(i2c, example_idtable); 274 MODULE_DEVICE_TABLE(i2c, example_idtable);
269 275
270static 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===================
2Writing I2C Clients
3===================
4
1This is a small guide for those who want to write kernel drivers for I2C 5This is a small guide for those who want to write kernel drivers for I2C
2or SMBus devices, using Linux as the protocol host/master (not slave). 6or SMBus devices, using Linux as the protocol host/master (not slave).
3 7
@@ -12,7 +16,7 @@ General remarks
12Try to keep the kernel namespace as clean as possible. The best way to 16Try to keep the kernel namespace as clean as possible. The best way to
13do this is to use a unique prefix for all global symbols. This is 17do this is to use a unique prefix for all global symbols. This is
14especially important for exported symbols, but it is a good idea to do 18especially important for exported symbols, but it is a good idea to do
15it for non-exported symbols too. We will use the prefix `foo_' in this 19it for non-exported symbols too. We will use the prefix ``foo_`` in this
16tutorial. 20tutorial.
17 21
18 22
@@ -25,15 +29,17 @@ routines, and should be zero-initialized except for fields with data you
25provide. A client structure holds device-specific information like the 29provide. A client structure holds device-specific information like the
26driver model device node, and its I2C address. 30driver model device node, and its I2C address.
27 31
28static 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
34MODULE_DEVICE_TABLE(i2c, foo_idtable); 40 MODULE_DEVICE_TABLE(i2c, foo_idtable);
35 41
36static 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
54The name field is the driver name, and must not contain spaces. It 60The name field is the driver name, and must not contain spaces. It
55should match the module name (if the driver can be compiled as a module), 61should match the module name (if the driver can be compiled as a module),
@@ -64,16 +70,18 @@ below.
64Extra client data 70Extra client data
65================= 71=================
66 72
67Each client structure has a special `data' field that can point to any 73Each client structure has a special ``data`` field that can point to any
68structure at all. You should use this to keep device-specific data. 74structure 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
76Note that starting with kernel 2.6.34, you don't have to set the `data' field 84Note that starting with kernel 2.6.34, you don't have to set the ``data`` field
77to NULL in remove() or if probe() failed anymore. The i2c-core does this 85to NULL in remove() or if probe() failed anymore. The i2c-core does this
78automatically on these occasions. Those are also the only times the core will 86automatically on these occasions. Those are also the only times the core will
79touch this field. 87touch this field.
@@ -92,25 +100,25 @@ but many chips have some kind of register-value idea that can easily
92be encapsulated. 100be encapsulated.
93 101
94The below functions are simple examples, and should not be copied 102The below functions are simple examples, and should not be copied
95literally. 103literally::
96 104
97int 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
105int 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
116Probing and attaching 124Probing and attaching
@@ -145,6 +153,8 @@ I2C device drivers using this binding model work just like any other
145kind of driver in Linux: they provide a probe() method to bind to 153kind of driver in Linux: they provide a probe() method to bind to
146those devices, and a remove() method to unbind. 154those 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,
240you have to do some initializing. Fortunately, just registering the 250you have to do some initializing. Fortunately, just registering the
241driver module is usually enough. 251driver module is usually enough.
242 252
243static 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 }
247module_init(foo_init); 259 module_init(foo_init);
248 260
249static 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 }
253module_exit(foo_cleanup); 265 module_exit(foo_cleanup);
254 266
255The 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
257module_i2c_driver(foo_driver); 269 module_i2c_driver(foo_driver);
258 270
259Note that some functions are marked by `__init'. These functions can 271Note that some functions are marked by ``__init``. These functions can
260be removed after kernel booting (or module loading) is completed. 272be removed after kernel booting (or module loading) is completed.
261Likewise, functions marked by `__exit' are dropped by the compiler when 273Likewise, functions marked by ``__exit`` are dropped by the compiler when
262the code is built into the kernel, as they would never be called. 274the code is built into the kernel, as they would never be called.
263 275
264 276
265Driver Information 277Driver Information
266================== 278==================
267 279
268/* Substitute your own name and email address */ 280::
269MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>"
270MODULE_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 */
273MODULE_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
276Power Management 290Power Management
@@ -323,6 +337,8 @@ commands, but only some of them understand plain I2C!
323Plain I2C communication 337Plain 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
334less than 64k since msg.len is u16.) Returned is the actual number of bytes 350less than 64k since msg.len is u16.) Returned is the actual number of bytes
335read/written. 351read/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
343for each message the client address, the number of bytes of the message 361for each message the client address, the number of bytes of the message
344and the message data itself. 362and the message data itself.
345 363
346You can read the file `i2c-protocol' for more information about the 364You can read the file ``i2c-protocol`` for more information about the
347actual I2C protocol. 365actual I2C protocol.
348 366
349 367
350SMBus communication 368SMBus 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
357This is the generic SMBus function. All functions below are implemented 377This is the generic SMBus function. All functions below are implemented
358in terms of it. Never use this function directly! 378in 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
378These ones were removed from i2c-core because they had no users, but could 400These ones were removed from i2c-core because they had no users, but could
379be added back later if needed: 401be 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
389value, except for block transactions, which return the number of values 411value, except for block transactions, which return the number of values
390read. The block buffers need not be longer than 32 bytes. 412read. The block buffers need not be longer than 32 bytes.
391 413
392You can read the file `smbus-protocol' for more information about the 414You can read the file ``smbus-protocol`` for more information about the
393actual SMBus protocol. 415actual SMBus protocol.
394 416
395 417
@@ -397,7 +419,7 @@ General purpose routines
397======================== 419========================
398 420
399Below all general purpose routines are listed, that were not mentioned 421Below all general purpose routines are listed, that were not mentioned
400before. 422before::
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
23describes how to send updates for individual contacts via event slots. 23describes 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
29Protocol Usage 29Protocol 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 @@
1Driver for active AVM Controller. 1================================
2Driver for active AVM Controller
3================================
2 4
3The driver provides a kernel capi2.0 Interface (kernelcapi) and 5The driver provides a kernel capi2.0 Interface (kernelcapi) and
4on top of this a User-Level-CAPI2.0-interface (capi) 6on top of this a User-Level-CAPI2.0-interface (capi)
@@ -11,25 +13,28 @@ The command avmcapictrl is part of the isdn4k-utils.
11t4-files can be found at ftp://ftp.avm.de/cardware/b1/linux/firmware 13t4-files can be found at ftp://ftp.avm.de/cardware/b1/linux/firmware
12 14
13Currently supported cards: 15Currently 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
21Installing 24Installing
22---------- 25----------
23 26
24You need at least /dev/capi20 to load the firmware. 27You need at least /dev/capi20 to load the firmware.
25 28
26mknod /dev/capi20 c 68 0 29::
27mknod /dev/capi20.00 c 68 1 30
28mknod /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 .
32mknod /dev/capi20.19 c 68 20 35 .
36 .
37 mknod /dev/capi20.19 c 68 20
33 38
34Running 39Running
35------- 40-------
@@ -38,45 +43,58 @@ To use the card you need the t4-files to download the firmware.
38AVM GmbH provides several t4-files for the different D-channel 43AVM GmbH provides several t4-files for the different D-channel
39protocols (b1.t4 for Euro-ISDN). Install these file in /lib/isdn. 44protocols (b1.t4 for Euro-ISDN). Install these file in /lib/isdn.
40 45
41if you configure as modules load the modules this way: 46if 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
43insmod /lib/modules/current/misc/capiutil.o 54if you have an B1-PCI card load the module b1pci.o::
44insmod /lib/modules/current/misc/b1.o
45insmod /lib/modules/current/misc/kernelcapi.o
46insmod /lib/modules/current/misc/capidrv.o
47insmod /lib/modules/current/misc/capi.o
48 55
49if you have an B1-PCI card load the module b1pci.o 56 insmod /lib/modules/current/misc/b1pci.o
50insmod /lib/modules/current/misc/b1pci.o 57
51and load the firmware with 58and load the firmware with::
52avmcapictrl load /lib/isdn/b1.t4 1 59
60 avmcapictrl load /lib/isdn/b1.t4 1
53 61
54if you have an B1-ISA card load the module b1isa.o 62if you have an B1-ISA card load the module b1isa.o
55and add the card by calling 63and add the card by calling::
56avmcapictrl add 0x150 15 64
57and load the firmware by calling 65 avmcapictrl add 0x150 15
58avmcapictrl load /lib/isdn/b1.t4 1 66
67and load the firmware by calling::
68
69 avmcapictrl load /lib/isdn/b1.t4 1
59 70
60if you have an T1-ISA card load the module t1isa.o 71if you have an T1-ISA card load the module t1isa.o
61and add the card by calling 72and add the card by calling::
62avmcapictrl add 0x450 15 T1 0 73
63and load the firmware by calling 74 avmcapictrl add 0x450 15 T1 0
64avmcapictrl load /lib/isdn/t1.t4 1 75
76and load the firmware by calling::
77
78 avmcapictrl load /lib/isdn/t1.t4 1
65 79
66if you have an PCMCIA card (B1/M1/M2) load the module b1pcmcia.o 80if you have an PCMCIA card (B1/M1/M2) load the module b1pcmcia.o
67before you insert the card. 81before you insert the card.
68 82
69Leased Lines with B1 83Leased Lines with B1
70-------------------- 84--------------------
85
71Init card and load firmware. 86Init card and load firmware.
87
72For an D64S use "FV: 1" as phone number 88For an D64S use "FV: 1" as phone number
89
73For an D64S2 use "FV: 1" and "FV: 2" for multilink 90For an D64S2 use "FV: 1" and "FV: 2" for multilink
74or "FV: 1,2" to use CAPI channel bundling. 91or "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:
991 -2 16 2048 1 0 117 current number of nccis (connections)
1002 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:
1091 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:
1221 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:
1312780 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
1361 b1pci running b1pci-e000 B1 3.07-01 0xe000 19 179 for example::
1372 t1isa running t1isa-450 B1 3.07-01 0x450 11 0 180
1383 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:
1471 2845 2272 2310 2274 192 capi messages sent without DATA_B3_REQ
1482 2 0 2 0 193 nsentdatamsg:
1493 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
154b1pci 1 205 for example::
155t1isa 1 206
156b1pcmcia 1 207 b1pci 1
157b1isa 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
1621 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
167capidrv 222 for example::
168capi20 223
224 capidrv
225 capi20
169 226
170Questions 227Questions
171--------- 228---------
229
172Check out the FAQ (ftp.isdn4linux.de) or subscribe to the 230Check out the FAQ (ftp.isdn4linux.de) or subscribe to the
173linux-avmb1@calle.in-berlin.de mailing list by sending 231linux-avmb1@calle.in-berlin.de mailing list by sending
174a mail to majordomo@calle.in-berlin.de with 232a mail to majordomo@calle.in-berlin.de with
@@ -178,9 +236,10 @@ in the body.
178German documentation and several scripts can be found at 236German documentation and several scripts can be found at
179ftp://ftp.avm.de/cardware/b1/linux/ 237ftp://ftp.avm.de/cardware/b1/linux/
180 238
181Bugs 239Bugs
182---- 240----
183If you find any please let me know. 241
242If you find any please let me know.
184 243
185Enjoy, 244Enjoy,
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=======
2Credits
3=======
4
1 5
2I want to thank all who contributed to this project and especially to: 6I 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
21Bernhard Hailer (Bernhard.Hailer@lrz.uni-muenchen.de) 25Bernhard 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
24Michael 'Ghandi' Herold (michael@abadonna.franken.de) 28Michael '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)
67Thomas Uhl (uhl@think.de) 71Thomas 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==========================
1GigaSet 307x Device Driver 2GigaSet 307x Device Driver
2========================== 3==========================
3 4
41. Requirements 51. Requirements
5 ------------ 6=================
7
61.1. Hardware 81.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
491.2. Software 551.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
602. How to use the driver 672. How to use the driver
61 --------------------- 68==========================
69
622.1. Modules 702.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
1022.2. Device nodes for user space programs 1182.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
1542.3. CAPI 1802.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
1672.5. Unimodem mode 1942.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
2242.6. Call-ID (CID) mode 2632.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
2532.7. Dialing Numbers 2952.7. Dialing Numbers
254 --------------- 296--------------------
255 The called party number provided by an application for dialing out must 297provided 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
2672.8. Unregistered Wireless Devices (M101/M105) 3092.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
2813. Troubleshooting 3243. Troubleshooting
282 --------------- 325====================
326
2833.1. Solutions to frequently reported problems 3273.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
3153.2. Telling the driver to provide more information 3623.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
3413.3. Reporting problems and bugs 3993.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
3643.4. Reporting problem solutions 4253.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
3724. Links, other software 4334. 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
3835. Credits 4455. 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============
2Hysdn Driver
3============
4
2The hysdn driver has been written by 5The hysdn driver has been written by
3Werner Cornelius (werner@isdn4linux.de or werner@titro.de) 6Werner Cornelius (werner@isdn4linux.de or werner@titro.de)
4for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver 7for 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
25Table of contents 28.. Table of contents
26=================
27 29
281. About the driver 30 1. About the driver
29 31
302. Loading/Unloading the driver 32 2. Loading/Unloading the driver
31 33
323. Entries in the /proc filesystem 34 3. Entries in the /proc filesystem
33 35
344. The /proc/net/hysdn/cardconfX file 36 4. The /proc/net/hysdn/cardconfX file
35 37
365. The /proc/net/hysdn/cardlogX file 38 5. The /proc/net/hysdn/cardlogX file
37 39
386. Where to get additional info and help 40 6. Where to get additional info and help
39 41
40 42
411. About the driver 431. 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
622. Loading/Unloading the driver 652. 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
783. Entries in the /proc filesystem 823. 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
864. The /proc/net/hysdn/cardconfX file 914. 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
1405. The /proc/net/hysdn/cardlogX file 1505. 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
1756. Where to get additional info and help 1906. 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====
4ISDN
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=========================================
1Kernel CAPI Interface to Hardware Drivers 2Kernel CAPI Interface to Hardware Drivers
2----------------------------------------- 3=========================================
3 4
41. Overview 51. Overview
6===========
5 7
6From the CAPI 2.0 specification: 8From the CAPI 2.0 specification:
7COMMON-ISDN-API (CAPI) is an application programming interface standard used 9COMMON-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
242. Driver and Device Registration 262. Driver and Device Registration
27=================================
25 28
26CAPI drivers optionally register themselves with Kernel CAPI by calling the 29CAPI drivers optionally register themselves with Kernel CAPI by calling the
27Kernel CAPI function register_capi_driver() with a pointer to a struct 30Kernel CAPI function register_capi_driver() with a pointer to a struct
@@ -50,6 +53,7 @@ callback functions by Kernel CAPI.
50 53
51 54
523. Application Registration and Communication 553. Application Registration and Communication
56=============================================
53 57
54Kernel CAPI forwards registration requests from applications (calls to CAPI 58Kernel CAPI forwards registration requests from applications (calls to CAPI
55operation CAPI_REGISTER) to an appropriate hardware driver by calling its 59operation 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
734. Data Structures 774. Data Structures
78==================
74 79
754.1 struct capi_driver 804.1 struct capi_driver
81----------------------
76 82
77This structure describes a Kernel CAPI driver itself. It is used in the 83This structure describes a Kernel CAPI driver itself. It is used in the
78register_capi_driver() and unregister_capi_driver() functions, and contains 84register_capi_driver() and unregister_capi_driver() functions, and contains
79the following non-private fields, all to be set by the driver before calling 85the following non-private fields, all to be set by the driver before calling
80register_capi_driver(): 86register_capi_driver():
81 87
82char 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
84char 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
86int (*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
904.2 struct capi_ctr 964.2 struct capi_ctr
97-------------------
91 98
92This structure describes an ISDN device (controller) handled by a Kernel CAPI 99This structure describes an ISDN device (controller) handled by a Kernel CAPI
93driver. After registration via the attach_capi_ctr() function it is passed to 100driver. After registration via the attach_capi_ctr() function it is passed to
@@ -96,88 +103,109 @@ identify the controller to operate on.
96 103
97It contains the following non-private fields: 104It contains the following non-private fields:
98 105
99- to be set by the driver before calling attach_capi_ctr(): 106to be set by the driver before calling attach_capi_ctr():
107^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 108
101struct 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
104void *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
107char 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
110char *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
113int (*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
121void (*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
128void (*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
130void (*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
136u16 (*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
152char *(*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
156const 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
162Note: Callback functions except send_message() are never called in interrupt 187Note:
163context. 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(): 191to be filled in before calling capi_ctr_ready():
192^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166 193
167u8 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
170capi_version version 197``capi_version version``
171 value to return for CAPI_GET_VERSION 198 value to return for CAPI_GET_VERSION
172 199
173capi_profile profile 200``capi_profile profile``
174 value to return for CAPI_GET_PROFILE 201 value to return for CAPI_GET_PROFILE
175 202
176u8 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
1804.3 SKBs 2074.3 SKBs
208--------
181 209
182CAPI messages are passed between Kernel CAPI and the driver via send_message() 210CAPI messages are passed between Kernel CAPI and the driver via send_message()
183and capi_ctr_handle_message(), stored in the data portion of a socket buffer 211and capi_ctr_handle_message(), stored in the data portion of a socket buffer
@@ -192,6 +220,7 @@ instead of 30.
192 220
193 221
1944.4 The _cmsg Structure 2224.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
216represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data 245represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data
217types are: 246types are:
218 247
248=========== =================================================================
219u8 for CAPI parameters of type 'byte' 249u8 for CAPI parameters of type 'byte'
220 250
221u16 for CAPI parameters of type 'word' 251u16 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
239Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert 270Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert
240messages between their transport encoding described in the CAPI 2.0 standard 271messages 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
2465. Lower Layer Interface Functions 2775. Lower Layer Interface Functions
278==================================
247 279
248(declared in <linux/isdn/capilli.h>) 280(declared in <linux/isdn/capilli.h>)
249 281
250void register_capi_driver(struct capi_driver *drvr) 282::
251void 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
287register/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
294register/unregister a device (controller) with Kernel CAPI
253 295
254int attach_capi_ctr(struct capi_ctr *ctrlr) 296::
255int detach_capi_ctr(struct capi_ctr *ctrlr)
256 register/unregister a device (controller) with Kernel CAPI
257 297
258void capi_ctr_ready(struct capi_ctr *ctrlr) 298 void capi_ctr_ready(struct capi_ctr *ctrlr)
259void capi_ctr_down(struct capi_ctr *ctrlr) 299 void capi_ctr_down(struct capi_ctr *ctrlr)
260 signal controller ready/not ready
261 300
262void capi_ctr_suspend_output(struct capi_ctr *ctrlr) 301signal controller ready/not ready
263void capi_ctr_resume_output(struct capi_ctr *ctrlr)
264 signal suspend/resume
265 302
266void 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
308signal suspend/resume
309
310::
311
312 void capi_ctr_handle_message(struct capi_ctr * ctrlr, u16 applid,
313 struct sk_buff *skb)
314
315pass a received CAPI message to Kernel CAPI
316for forwarding to the specified application
270 317
271 318
2726. Helper Functions and Macros 3196. Helper Functions and Macros
320==============================
273 321
274Library functions (from <linux/isdn/capilli.h>): 322Library functions (from <linux/isdn/capilli.h>):
275 323
276void 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)
278void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci) 328 void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci)
279void capilib_release_appl(struct list_head *head, u16 applid) 329 void capilib_release_appl(struct list_head *head, u16 applid)
280void capilib_release(struct list_head *head) 330 void capilib_release(struct list_head *head)
281void 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)
283u16 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
287Macros to extract/set element values from/in a CAPI message header 337Macros 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====================== ============================= ====================
290Get Macro Set Macro Element (Type) 341Get Macro Set Macro Element (Type)
291 342====================== ============================= ====================
292CAPIMSG_LEN(m) CAPIMSG_SETLEN(m, len) Total Length (u16) 343CAPIMSG_LEN(m) CAPIMSG_SETLEN(m, len) Total Length (u16)
293CAPIMSG_APPID(m) CAPIMSG_SETAPPID(m, applid) ApplID (u16) 344CAPIMSG_APPID(m) CAPIMSG_SETAPPID(m, applid) ApplID (u16)
294CAPIMSG_COMMAND(m) CAPIMSG_SETCOMMAND(m,cmd) Command (u8) 345CAPIMSG_COMMAND(m) CAPIMSG_SETCOMMAND(m,cmd) Command (u8)
@@ -300,31 +351,31 @@ CAPIMSG_MSGID(m) CAPIMSG_SETMSGID(m, msgid) Message Number (u16)
300CAPIMSG_CONTROL(m) CAPIMSG_SETCONTROL(m, contr) Controller/PLCI/NCCI 351CAPIMSG_CONTROL(m) CAPIMSG_SETCONTROL(m, contr) Controller/PLCI/NCCI
301 (u32) 352 (u32)
302CAPIMSG_DATALEN(m) CAPIMSG_SETDATALEN(m, len) Data Length (u16) 353CAPIMSG_DATALEN(m) CAPIMSG_SETDATALEN(m, len) Data Length (u16)
354====================== ============================= ====================
303 355
304 356
305Library functions for working with _cmsg structures 357Library functions for working with _cmsg structures
306(from <linux/isdn/capiutil.h>): 358(from <linux/isdn/capiutil.h>):
307 359
308unsigned 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
312unsigned 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
316unsigned 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
323void 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
327char *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
3347. Debugging 3857. Debugging
386============
335 387
336The module kernelcapi has a module parameter showcapimsgs controlling some 388The module kernelcapi has a module parameter showcapimsgs controlling some
337debugging output produced by the module. It can only be set when the module is 389debugging 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============
2mISDN Driver
3============
4
1mISDN is a new modular ISDN driver, in the long term it should replace 5mISDN is a new modular ISDN driver, in the long term it should replace
2the old I4L driver architecture for passiv ISDN cards. 6the old I4L driver architecture for passiv ISDN cards.
3It was designed to allow a broad range of applications and interfaces 7It was designed to allow a broad range of applications and interfaces
4but only have the basic function in kernel, the interface to the user 8but only have the basic function in kernel, the interface to the user
5space is based on sockets with a own address family AF_ISDN. 9space 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===================
2Reproducible builds
3===================
4
5It is generally desirable that building the same source code with
6the same set of tools is reproducible, i.e. the output is always
7exactly the same. This makes it possible to verify that the build
8infrastructure for a binary distribution or embedded system has not
9been subverted. This can also make it easier to verify that a source
10or tool change does not make any difference to the resulting binaries.
11
12The `Reproducible Builds project`_ has more information about this
13general topic. This document covers the various reasons why building
14the kernel may be unreproducible, and how to avoid them.
15
16Timestamps
17----------
18
19The 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
26By default the timestamp is the current time. This must be overridden
27using the `KBUILD_BUILD_TIMESTAMP`_ variable. If you are building
28from a git commit, you could use its commit date.
29
30The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros,
31and enables warnings if they are used. If you incorporate external
32code that does use these, you must override the timestamp they
33correspond to by setting the `SOURCE_DATE_EPOCH`_ environment
34variable.
35
36User, host
37----------
38
39The 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
42building from a git commit, you could use its committer address.
43
44Absolute filenames
45------------------
46
47When the kernel is built out-of-tree, debug information may include
48absolute filenames for the source files. This must be overridden by
49including the ``-fdebug-prefix-map`` option in the `KCFLAGS`_ variable.
50
51Depending on the compiler used, the ``__FILE__`` macro may also expand
52to an absolute filename in an out-of-tree build. Kbuild automatically
53uses the ``-fmacro-prefix-map`` option to prevent this, if it is
54supported.
55
56The Reproducible Builds web site has more information about these
57`prefix-map options`_.
58
59Generated files in source packages
60----------------------------------
61
62The build processes for some programs under the ``tools/``
63subdirectory do not completely support out-of-tree builds. This may
64cause a later source package build using e.g. ``make rpm-pkg`` to
65include generated files. You should ensure the source tree is
66pristine by running ``make mrproper`` or ``git clean -d -f -x`` before
67building a source package.
68
69Module signing
70--------------
71
72If you enable ``CONFIG_MODULE_SIG_ALL``, the default behaviour is to
73generate a different temporary key for each build, resulting in the
74modules being unreproducible. However, including a signing key with
75your source would presumably defeat the purpose of signing modules.
76
77One approach to this is to divide up the build process so that the
78unreproducible parts can be treated as sources:
79
801. Generate a persistent signing key. Add the certificate for the key
81 to the kernel source.
82
832. 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
883. Create detached signatures for the modules, and publish them as
89 sources.
90
914. Perform a second build that attaches the module signatures. It
92 can either rebuild the modules or use the output of step 2.
93
94Structure randomisation
95-----------------------
96
97If you enable ``CONFIG_GCC_PLUGIN_RANDSTRUCT``, you will need to
98pre-generate the random seed in
99``scripts/gcc-plgins/randomize_layout_seed.h`` so the same value
100is used in rebuilds.
101
102Debug info conflicts
103--------------------
104
105This is not a problem of unreproducibility, but of generated files
106being *too* reproducible.
107
108Once you set all the necessary variables for a reproducible build, a
109vDSO's debug information may be identical even for different kernel
110versions. This can result in file conflicts between debug information
111packages for the different kernel versions.
112
113To avoid this, you can make the vDSO different for different
114kernel versions by including an arbitrary string of "salt" in it.
115This 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
139CPU that holds the lock, so the lock-holder can continue and eventually 139CPU that holds the lock, so the lock-holder can continue and eventually
140releases the lock). 140releases the lock).
141 141
142Note that you can be clever with read-write locks and interrupts. For
143example, if you know that the interrupt only ever gets a read-lock, then
144you can use a non-irq version of read locks everywhere - because they
145don't block on each other (and thus there is no dead-lock wrt interrupts.
146But when you do the write-lock, you have to use the irq-safe version.
147
148For an example of being clever with rw-locks, see the "waitqueue_lock"
149handling in kernel/sched/core.c - nothing ever _changes_ a wait-queue from
150within an interrupt, they only read the queue in order to know whom to
151wake up. So read-locks are safe (which is good: they are very common
152indeed), 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=====================================
2Amiga Buddha and Catweasel IDE Driver
3=====================================
1 4
2The Amiga Buddha and Catweasel IDE Driver (part of ide.c) was written by 5The Amiga Buddha and Catweasel IDE Driver (part of ide.c) was written by
3Geert Uytterhoeven based on the following specifications: 6Geert Uytterhoeven based on the following specifications:
@@ -12,12 +15,12 @@ described in their manuals, no tricks have been used (for
12example leaving some address lines out of the equations...). 15example leaving some address lines out of the equations...).
13If you want to configure the board yourself (for example let 16If you want to configure the board yourself (for example let
14a Linux kernel configure the card), look at the Commodore 17a Linux kernel configure the card), look at the Commodore
15Docs. Reading the nibbles should give this information: 18Docs. Reading the nibbles should give this information::
16 19
17Vendor number: 4626 ($1212) 20 Vendor number: 4626 ($1212)
18product number: 0 (42 for Catweasel Z-II) 21 product number: 0 (42 for Catweasel Z-II)
19Serial number: 0 22 Serial number: 0
20Rom-vector: $1000 23 Rom-vector: $1000
21 24
22The card should be a Z-II board, size 64K, not for freemem 25The card should be a Z-II board, size 64K, not for freemem
23list, Rom-Vektor is valid, no second Autoconfig-board on the 26list, 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
35The local memory-map is even active when mapped to $e8: 38The 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
98The IDE ports issue an INT2. You can read the level of the 103The IDE ports issue an INT2. You can read the level of the
99IRQ-lines of the IDE-ports by reading from the three (two 104IRQ-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
128versions (if I'll ever update this one). I presume that 133versions (if I'll ever update this one). I presume that
129I'll never use the lower four bits, but they have to be set 134I'll never use the lower four bits, but they have to be set
130to 1 by definition. 135to 1 by definition.
131 The values in this table have to be shifted 5 bits to the 136
137The values in this table have to be shifted 5 bits to the
132left and or'd with $1f (this sets the lower 5 bits). 138left and or'd with $1f (this sets the lower 5 bits).
133 139
134All the timings have in common: Select and IOR/IOW rise at 140All 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
140value 0 (Default after reset) 146value 0 (Default after reset)
141 147 497ns Select (7 clock cycles) , IOR/IOW after 172ns (2 clock cycles)
142497ns 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)
144accelerator card)
145 150
146value 1 151value 1
147 152 639ns Select (9 clock cycles), IOR/IOW after 243ns (3 clock cycles)
148639ns Select (9 clock cycles), IOR/IOW after 243ns (3 clock cycles)
149 153
150value 2 154value 2
151 155 781ns Select (11 clock cycles), IOR/IOW after 314ns (4 clock cycles)
152781ns Select (11 clock cycles), IOR/IOW after 314ns (4 clock cycles)
153 156
154value 3 157value 3
155 158 355ns Select (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
156355ns Select (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
157 159
158value 4 160value 4
159 161 355ns Select (5 clock cycles), IOR/IOW after 172ns (2 clock cycles)
160355ns Select (5 clock cycles), IOR/IOW after 172ns (2 clock cycles)
161 162
162value 5 163value 5
163 164 355ns Select (5 clock cycles), IOR/IOW after 243ns (3 clock cycles)
164355ns Select (5 clock cycles), IOR/IOW after 243ns (3 clock cycles)
165 165
166value 6 166value 6
167 167 1065ns Select (15 clock cycles), IOR/IOW after 314ns (4 clock cycles)
1681065ns Select (15 clock cycles), IOR/IOW after 314ns (4 clock cycles)
169 168
170value 7 169value 7
171 170 355ns Select, (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
172355ns Select, (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
173 171
174When accessing IDE registers with A6=1 (for example $84x), 172When accessing IDE registers with A6=1 (for example $84x),
175the timing will always be mode 0 8-bit compatible, no matter 173the timing will always be mode 0 8-bit compatible, no matter
176what you have selected in the speed register: 174what you have selected in the speed register:
177 175
178781ns select, IOR/IOW after 4 clock cycles (=314ns) aktive. 176781ns select, IOR/IOW after 4 clock cycles (=314ns) aktive.
179 177
180All the timings with a very short select-signal (the 355ns 178All the timings with a very short select-signal (the 355ns
181fast accesses) depend on the accelerator card used in the 179fast 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
204the third IDE port are going into data's Nirwana on the 202the third IDE port are going into data's Nirwana on the
205Buddha. 203Buddha.
206 204
207 Jens Schönfeld february 19th, 1997 205Jens Schönfeld february 19th, 1997
208 updated may 27th, 1997 206
209 eMail: sysop@nostlgic.tng.oche.de 207updated may 27th, 1997
210 208
209eMail: 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.
29In order to create the pull request you must first tag the branch that you 29In order to create the pull request you must first tag the branch that you
30have just created. It is recommended that you choose a meaningful tag name, 30have just created. It is recommended that you choose a meaningful tag name,
31in a way that you and others can understand, even after some time. A good 31in a way that you and others can understand, even after some time. A good
32practice is to include in the name an indicator of the sybsystem of origin 32practice is to include in the name an indicator of the subsystem of origin
33and the target kernel version. 33and the target kernel version.
34 34
35Greg offers the following. A pull request with miscellaneous stuff for 35Greg 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 @@
1README for MIPS AU1XXX IDE driver - Released 2005-07-15 1.. include:: <isonum.txt>
2
3======================
4MIPS AU1XXX IDE driver
5======================
6
7Released 2005-07-15
8
9About
10=====
2 11
3ABOUT
4-----
5This file describes the 'drivers/ide/au1xxx-ide.c', related files and the 12This file describes the 'drivers/ide/au1xxx-ide.c', related files and the
6services they provide. 13services 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'
10section. 17section.
11 18
12 19
13LICENSE 20License
14------- 21=======
15 22
16Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions 23:Copyright: |copy| 2003-2005 AMD, Personal Connectivity Solutions
17 24
18This program is free software; you can redistribute it and/or modify it under 25This program is free software; you can redistribute it and/or modify it under
19the terms of the GNU General Public License as published by the Free Software 26the terms of the GNU General Public License as published by the Free Software
20Foundation; either version 2 of the License, or (at your option) any later 27Foundation; either version 2 of the License, or (at your option) any later
21version. 28version.
22 29
23THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 30THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES,
24INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 31INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 32FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
26BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 33BE 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
35this program; if not, write to the Free Software Foundation, Inc., 42this program; if not, write to the Free Software Foundation, Inc.,
36675 Mass Ave, Cambridge, MA 02139, USA. 43675 Mass Ave, Cambridge, MA 02139, USA.
37 44
38Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 45Note:
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
42FILES, CONFIGS AND COMPATIBILITY 50Files, Configs and Compatibility
43-------------------------------- 51================================
44 52
45Two files are introduced: 53Two 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
55Following extra configs variables are introduced: 64Following 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
61SUPPORTED IDE MODES 72Supported IDE Modes
62------------------- 73===================
63 74
64The AU1XXX IDE driver supported all PIO modes - PIO mode 0/1/2/3/4 - and all 75The AU1XXX IDE driver supported all PIO modes - PIO mode 0/1/2/3/4 - and all
65MWDMA modes - MWDMA 0/1/2 -. There is no support for SWDMA and UDMA mode. 76MWDMA 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
72PERFORMANCE CONFIGURATIONS 83Performance Configurations
73-------------------------- 84==========================
74 85
75If the used system doesn't need USB support enable the following kernel configs: 86If the used system doesn't need USB support enable the following kernel
87configs::
76 88
77CONFIG_IDE=y 89 CONFIG_IDE=y
78CONFIG_BLK_DEV_IDE=y 90 CONFIG_BLK_DEV_IDE=y
79CONFIG_IDE_GENERIC=y 91 CONFIG_IDE_GENERIC=y
80CONFIG_BLK_DEV_IDEPCI=y 92 CONFIG_BLK_DEV_IDEPCI=y
81CONFIG_BLK_DEV_GENERIC=y 93 CONFIG_BLK_DEV_GENERIC=y
82CONFIG_BLK_DEV_IDEDMA_PCI=y 94 CONFIG_BLK_DEV_IDEDMA_PCI=y
83CONFIG_BLK_DEV_IDE_AU1XXX=y 95 CONFIG_BLK_DEV_IDE_AU1XXX=y
84CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y 96 CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
85CONFIG_BLK_DEV_IDEDMA=y 97 CONFIG_BLK_DEV_IDEDMA=y
86 98
87Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable 99Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable
88the burst support on DBDMA controller. 100the burst support on DBDMA controller.
@@ -90,20 +102,22 @@ the burst support on DBDMA controller.
90If the used system need the USB support enable the following kernel configs for 102If the used system need the USB support enable the following kernel configs for
91high IDE to USB throughput. 103high IDE to USB throughput.
92 104
93CONFIG_IDE_GENERIC=y 105::
94CONFIG_BLK_DEV_IDEPCI=y 106
95CONFIG_BLK_DEV_GENERIC=y 107 CONFIG_IDE_GENERIC=y
96CONFIG_BLK_DEV_IDEDMA_PCI=y 108 CONFIG_BLK_DEV_IDEPCI=y
97CONFIG_BLK_DEV_IDE_AU1XXX=y 109 CONFIG_BLK_DEV_GENERIC=y
98CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y 110 CONFIG_BLK_DEV_IDEDMA_PCI=y
99CONFIG_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
101Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to 115Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to
102disable the burst support on DBDMA controller. 116disable the burst support on DBDMA controller.
103 117
104 118
105ACKNOWLEDGMENTS 119Acknowledgments
106--------------- 120===============
107 121
108These drivers wouldn't have been done without the base of kernel 2.4.x AU1XXX 122These drivers wouldn't have been done without the base of kernel 2.4.x AU1XXX
109IDE driver from AMD. 123IDE driver from AMD.
@@ -112,4 +126,5 @@ Additional input also from:
112Matthias Lenk <matthias.lenk@amd.com> 126Matthias Lenk <matthias.lenk@amd.com>
113 127
114Happy hacking! 128Happy hacking!
129
115Enrico Walther <enrico.walther@amd.com> 130Enrico 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=================
4MIPS 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 @@
1Copyright (C) ST-Ericsson AB 2010 1:orphan:
2Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
3License terms: GNU General Public License (GPL) version 2
4---------------------------------------------------------
5 2
6=== Start === 3.. SPDX-License-Identifier: GPL-2.0
7If 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================
8Using 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
16Start
17=====
18
19If 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
27Preparing the setup with a STE modem
28====================================
16 29
17If you are working on integration of CAIF you should make sure 30If you are working on integration of CAIF you should make sure
18that the kernel is built with module support. 31that the kernel is built with module support.
@@ -32,24 +45,30 @@ module parameter "ser_use_stx".
32Normally Frame Checksum is always used on UART, but this is also provided as a 45Normally Frame Checksum is always used on UART, but this is also provided as a
33module parameter "ser_use_fcs". 46module 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
38PLEASE NOTE: There is a limitation in Android shell. 53PLEASE 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 === 57Trouble shooting
58================
42 59
43There are debugfs parameters provided for serial communication. 60There 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: 123Error 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===================================================================
1mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211 7mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
2Copyright (c) 2008, Jouni Malinen <j@w1.fi> 8===================================================================
9
10:Copyright: |copy| 2008, Jouni Malinen <j@w1.fi>
3 11
4This program is free software; you can redistribute it and/or modify 12This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License version 2 as 13it 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
9Introduction 17Introduction
18============
10 19
11mac80211_hwsim is a Linux kernel module that can be used to simulate 20mac80211_hwsim is a Linux kernel module that can be used to simulate
12arbitrary number of IEEE 802.11 radios for mac80211. It can be used to 21arbitrary number of IEEE 802.11 radios for mac80211. It can be used to
@@ -43,6 +52,7 @@ regardless of channel.
43 52
44 53
45Simple example 54Simple example
55==============
46 56
47This example shows how to use mac80211_hwsim to simulate two radios: 57This example shows how to use mac80211_hwsim to simulate two radios:
48one to act as an access point and the other as a station that 58one 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
50care of WPA2-PSK authentication. In addition, hostapd is also 60care of WPA2-PSK authentication. In addition, hostapd is also
51processing access point side of association. 61processing 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
57modprobe mac80211_hwsim 69 modprobe mac80211_hwsim
58 70
59# Run hostapd (AP) for wlan0 71 # Run hostapd (AP) for wlan0
60hostapd hostapd.conf 72 hostapd hostapd.conf
61 73
62# Run wpa_supplicant (station) for wlan1 74 # Run wpa_supplicant (station) for wlan1
63wpa_supplicant -Dnl80211 -iwlan1 -c wpa_supplicant.conf 75 wpa_supplicant -Dnl80211 -iwlan1 -c wpa_supplicant.conf
64 76
65 77
66More test cases are available in hostap.git: 78More 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=================================
1Linux on the Nios II architecture 2Linux 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=====================
4OpenRISC 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==============
1OpenRISC Linux 2OpenRISC Linux
2============== 3==============
3 4
@@ -6,8 +7,10 @@ target architecture, specifically, is the 32-bit OpenRISC 1000 family (or1k).
6 7
7For information about OpenRISC processors and ongoing development: 8For 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.
24Instructions for building the different toolchains can be found on openrisc.io 27Instructions for building the different toolchains can be found on openrisc.io
25or Stafford's toolchain build and release scripts. 28or 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
312) Building 362) Building
32 37
33Build the Linux kernel as usual 38Build 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
43downloaded from the FuseSoC IP cores repository and built using the FPGA vendor 48downloaded from the FuseSoC IP cores repository and built using the FPGA vendor
44tools. Binaries are loaded onto the board with openocd. 49tools. 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
65Linux running on QEMU. You can build QEMU yourself, but your Linux distribution 72Linux running on QEMU. You can build QEMU yourself, but your Linux distribution
66likely provides binary packages to support OpenRISC. 73likely 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
75In the code, the following particles are used on symbols to limit the scope 84In the code, the following particles are used on symbols to limit the scope
76to more or less specific processor implementations: 85to more or less specific processor implementations:
77 86
87========= =======================================
78openrisc: the OpenRISC class of processors 88openrisc: the OpenRISC class of processors
79or1k: the OpenRISC 1000 family of processors 89or1k: the OpenRISC 1000 family of processors
80or1200: the OpenRISC 1200 processor 90or1200: the OpenRISC 1200 processor
91========= =======================================
81 92
82--------------------------------------------------------------------- 93---------------------------------------------------------------------
83 94
84History 95History
85======== 96========
86 97
8718. 11. 2003 Matjaz Breskvar (phoenix@bsemi.com) 9818-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
9108. 12. 2003 Matjaz Breskvar (phoenix@bsemi.com) 10208-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
9710. 04. 2004 Matjaz Breskvar (phoenix@bsemi.com) 10810-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
10226. 06. 2004 Matjaz Breskvar (phoenix@bsemi.com) 11326-06-2004 Matjaz Breskvar (phoenix@bsemi.com)
103 port to 2.6.x 114 port to 2.6.x
104 115
10530. 11. 2004 Matjaz Breskvar (phoenix@bsemi.com) 11630-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
10909. 10. 2010 Jonas Bonn (jonas@southpole.se) 12009-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====
2TODO
3====
4
1The OpenRISC Linux port is fully functional and has been tracking upstream 5The OpenRISC Linux port is fully functional and has been tracking upstream
2since 2.6.35. There are, however, remaining items to be completed within 6since 2.6.35. There are, however, remaining items to be completed within
3the coming months. Here's a list of known-to-be-less-than-stellar items 7the coming months. Here's a list of known-to-be-less-than-stellar items
4that are due for investigation shortly, i.e. our TODO list: 8that 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=================
2PA-RISC Debugging
3=================
4
1okay, here are some hints for debugging the lower-level parts of 5okay, here are some hints for debugging the lower-level parts of
2linux/parisc. 6linux/parisc.
3 7
4 8
51. Absolute addresses 91. Absolute addresses
10=====================
6 11
7A lot of the assembly code currently runs in real mode, which means 12A lot of the assembly code currently runs in real mode, which means
8absolute addresses are used instead of virtual addresses as in the 13absolute addresses are used instead of virtual addresses as in the
@@ -12,6 +17,7 @@ currently).
12 17
13 18
142. HPMCs 192. HPMCs
20========
15 21
16When real-mode code tries to access non-existent memory, you'll get 22When real-mode code tries to access non-existent memory, you'll get
17an HPMC instead of a kernel oops. To debug an HPMC, try to find 23an HPMC instead of a kernel oops. To debug an HPMC, try to find
@@ -27,6 +33,7 @@ access it.
27 33
28 34
293. Q bit fun 353. Q bit fun
36============
30 37
31Certain, very critical code has to clear the Q bit in the PSW. What 38Certain, very critical code has to clear the Q bit in the PSW. What
32happens when the Q bit is cleared is the CPU does not update the 39happens 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====================
4PA-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================================
1Register Usage for Linux/PA-RISC 2Register 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 7General Registers as specified by ABI
8=====================================
6 9
7 Control Registers 10Control Registers
11-----------------
8 12
13=============================== ===============================================
9CR 0 (Recovery Counter) used for ptrace 14CR 0 (Recovery Counter) used for ptrace
10CR 1-CR 7(undefined) unused 15CR 1-CR 7(undefined) unused
11CR 8 (Protection ID) per-process value* 16CR 8 (Protection ID) per-process value*
@@ -29,26 +34,35 @@ CR28 (TR 4) not used
29CR29 (TR 5) not used 34CR29 (TR 5) not used
30CR30 (TR 6) current / 0 35CR30 (TR 6) current / 0
31CR31 (TR 7) Temporary register, used in various places 36CR31 (TR 7) Temporary register, used in various places
37=============================== ===============================================
32 38
33 Space Registers (kernel mode) 39Space Registers (kernel mode)
40-----------------------------
34 41
42=============================== ===============================================
35SR0 temporary space register 43SR0 temporary space register
36SR4-SR7 set to 0 44SR4-SR7 set to 0
37SR1 temporary space register 45SR1 temporary space register
38SR2 kernel should not clobber this 46SR2 kernel should not clobber this
39SR3 used for userspace accesses (current process) 47SR3 used for userspace accesses (current process)
48=============================== ===============================================
40 49
41 Space Registers (user mode) 50Space Registers (user mode)
51---------------------------
42 52
53=============================== ===============================================
43SR0 temporary space register 54SR0 temporary space register
44SR1 temporary space register 55SR1 temporary space register
45SR2 holds space of linux gateway page 56SR2 holds space of linux gateway page
46SR3 holds user address space value while in kernel 57SR3 holds user address space value while in kernel
47SR4-SR7 Defines short address space for user/kernel 58SR4-SR7 Defines short address space for user/kernel
59=============================== ===============================================
48 60
49 61
50 Processor Status Word 62Processor Status Word
63---------------------
51 64
65=============================== ===============================================
52W (64-bit addresses) 0 66W (64-bit addresses) 0
53E (Little-endian) 0 67E (Little-endian) 0
54S (Secure Interval Timer) 0 68S (Secure Interval Timer) 0
@@ -69,15 +83,19 @@ Q (collect interruption state) 1 (0 in code directly preceding an rfi)
69P (Protection Identifiers) 1* 83P (Protection Identifiers) 1*
70D (Data address translation) 1, 0 while executing real-mode code 84D (Data address translation) 1, 0 while executing real-mode code
71I (external interrupt mask) used by cli()/sti() macros 85I (external interrupt mask) used by cli()/sti() macros
86=============================== ===============================================
72 87
73 "Invisible" Registers 88"Invisible" Registers
89---------------------
74 90
91=============================== ===============================================
75PSW default W value 0 92PSW default W value 0
76PSW default E value 0 93PSW default E value 0
77Shadow Registers used by interruption handler code 94Shadow Registers used by interruption handler code
78TOC enable bit 1 95TOC enable bit 1
96=============================== ===============================================
79 97
80========================================================================= 98-------------------------------------------------------------------------
81 99
82The PA-RISC architecture defines 7 registers as "shadow registers". 100The PA-RISC architecture defines 7 registers as "shadow registers".
83Those are used in RETURN FROM INTERRUPTION AND RESTORE instruction to reduce 101Those 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.
86Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25. 104Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25.
87 105
88========================================================================= 106-------------------------------------------------------------------------
107
89Register usage notes, originally from John Marvin, with some additional 108Register usage notes, originally from John Marvin, with some additional
90notes from Randolph Chung. 109notes from Randolph Chung.
91 110
@@ -96,10 +115,12 @@ course, you need to save them if you care about them, before calling
96another procedure. Some of the above registers do have special meanings 115another procedure. Some of the above registers do have special meanings
97that you should be aware of: 116that 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
125r3-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.
40If you configure your email client to send emails with UTF-8 encoding, 40If you configure your email client to send emails with UTF-8 encoding,
41you avoid some possible charset problems. 41you avoid some possible charset problems.
42 42
43Email clients should generate and maintain References: or In-Reply-To: 43Email clients should generate and maintain "References:" or "In-Reply-To:"
44headers so that mail threading is not broken. 44headers so that mail threading is not broken.
45 45
46Copy-and-paste (or cut-and-paste) usually does not work for patches 46Copy-and-paste (or cut-and-paste) usually does not work for patches
@@ -89,7 +89,7 @@ Claws Mail (GUI)
89 89
90Works. Some people use this successfully for patches. 90Works. Some people use this successfully for patches.
91 91
92To insert a patch use :menuselection:`Message-->Insert` File (:kbd:`CTRL-I`) 92To insert a patch use :menuselection:`Message-->Insert File` (:kbd:`CTRL-I`)
93or an external editor. 93or an external editor.
94 94
95If the inserted patch has to be edited in the Claws composition window 95If the inserted patch has to be edited in the Claws composition window
@@ -132,8 +132,8 @@ wrapping.
132At the bottom of your email, put the commonly-used patch delimiter before 132At the bottom of your email, put the commonly-used patch delimiter before
133inserting your patch: three hyphens (``---``). 133inserting your patch: three hyphens (``---``).
134 134
135Then from the :menuselection:`Message` menu item, select insert file and 135Then from the :menuselection:`Message` menu item, select
136choose your patch. 136:menuselection:`insert file` and choose your patch.
137As an added bonus you can customise the message creation toolbar menu 137As an added bonus you can customise the message creation toolbar menu
138and put the :menuselection:`insert file` icon there. 138and 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
149as inlined text will make them tricky to extract from their 7-bit encoding. 149as inlined text will make them tricky to extract from their 7-bit encoding.
150 150
151If you absolutely must send patches as attachments instead of inlining 151If you absolutely must send patches as attachments instead of inlining
152them as text, right click on the attachment and select properties, and 152them as text, right click on the attachment and select :menuselection:`properties`,
153highlight :menuselection:`Suggest automatic display` to make the attachment 153and highlight :menuselection:`Suggest automatic display` to make the attachment
154inlined to make it more viewable. 154inlined to make it more viewable.
155 155
156When saving patches that are sent as inlined text, select the email that 156When saving patches that are sent as inlined text, select the email that
157contains the patch from the message list pane, right click and select 157contains 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
159if it was properly composed. There is no option currently to save the email 159if it was properly composed. Emails are saved as read-write for user only so
160when you are actually viewing it in its own window -- there has been a request 160you will have to chmod them to make them group and world readable if you copy
161filed at kmail's bugzilla and hopefully this will be addressed. Emails are 161them elsewhere.
162saved as read-write for user only so you will have to chmod them to make them
163group and world readable if you copy them elsewhere.
164 162
165Lotus Notes (GUI) 163Lotus 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
846Jeff Garzik, "Linux kernel patch submission format". 846Jeff 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
849Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". 849Greg 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 ============================================= 2Boot image header in RISC-V Linux
3=================================
3 4
4Author: Atish Patra <atish.patra@wdc.com> 5:Author: Atish Patra <atish.patra@wdc.com>
5Date : 20 May 2019 6:Date: 20 May 2019
6 7
7This document only describes the boot image header details for RISC-V Linux. 8This document only describes the boot image header details for RISC-V Linux.
8The complete booting guide will be available at Documentation/riscv/booting.txt.
9 9
10The following 64-byte header is present in decompressed Linux kernel image. 10TODO:
11 Write a complete booting guide.
12
13The 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
25ARM64 header. Thus, both ARM64 & RISC-V header can be combined into one common 28ARM64 header. Thus, both ARM64 & RISC-V header can be combined into one common
26header in future. 29header in future.
27 30
28Notes: 31Notes
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=============
4TPM Event Log
5=============
6
7This document briefly describes what TPM log is and how it is handed
8over from the preboot firmware to the operating system.
9
10Introduction
11============
12
13The preboot firmware maintains an event log that gets new entries every
14time something gets hashed by it to any of the PCR registers. The events
15are segregated by their type and contain the value of the hashed PCR
16register. Typically, the preboot firmware will hash the components to
17who execution is to be handed over or actions relevant to the boot
18process.
19
20The main application for this is remote attestation and the reason why
21it 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
24to a challenger. However, PCR contents are difficult to interpret;
25therefore, attestation is typically more useful when the PCR contents
26are accompanied by a measurement log. While not trusted on their own,
27the measurement log contains a richer set of information than do the PCR
28contents. The PCR contents are used to provide the validation of the
29measurement log."
30
31UEFI event log
32==============
33
34UEFI provided event log has a few somewhat weird quirks.
35
36Before calling ExitBootServices() Linux EFI stub copies the event log to
37a custom configuration table defined by the stub itself. Unfortunately,
38the events generated by ExitBootServices() don't end up in the table.
39
40The firmware provides so called final events configuration table to sort
41out this issue. Events gets mirrored to this table after the first time
42EFI_TCG2_PROTOCOL.GetEventLog() gets called.
43
44This introduces another problem: nothing guarantees that it is not called
45before the Linux EFI stub gets to run. Thus, it needs to calculate and save the
46final events table size while the stub is still running to the custom
47configuration table so that the TPM driver can later on skip these events when
48concatenating two halves of the event log from the custom configuration table
49and the final events table.
50
51References
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#
28Skipfuncs = [ 'open', 'close', 'read', 'write', 'fcntl', 'mmap' 28Skipfuncs = [ '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===================================================
1spi_butterfly - parport-to-butterfly adapter driver 2spi_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"
27connector pins (used also on non-Butterfly AVR boards). On the parport 28connector pins (used also on non-Butterfly AVR boards). On the parport
28side this is like "sp12" programming cables. 29side 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
39Then to let Linux master that bus to talk to the DataFlash chip, you must 42Then 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
41by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and 44by 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
50Or you could flash firmware making the AVR into an SPI slave (keeping the 55Or you could flash firmware making the AVR into an SPI slave (keeping the
51DataFlash in reset) and tweak the spi_butterfly driver to make it bind to 56DataFlash 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,
56while letting either Linux or the AVR use the DataFlash. There are plenty 61while letting either Linux or the AVR use the DataFlash. There are plenty
57of spare parport pins to wire this one up, such as: 62of 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=================================
4Serial 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==============================
1PXA2xx SPI on SSP driver HOWTO 2PXA2xx SPI on SSP driver HOWTO
2=================================================== 3==============================
4
3This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx 5This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx
4synchronous serial port into a SPI master controller 6synchronous 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-----------------------------------
20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a 22Typically 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
22found in include/linux/spi/pxa2xx_spi.h: 24found in include/linux/spi/pxa2xx_spi.h::
23 25
24struct 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
29The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of 31The "pxa2xx_spi_controller.num_chipselect" field is used to determine the number of
30slave device (chips) attached to this SPI master. 32slave device (chips) attached to this SPI master.
@@ -36,9 +38,9 @@ See the "PXA2xx Developer Manual" section "DMA Controller".
36 38
37NSSP MASTER SAMPLE 39NSSP MASTER SAMPLE
38------------------ 40------------------
39Below is a sample configuration using the PXA255 NSSP. 41Below is a sample configuration using the PXA255 NSSP::
40 42
41static 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
54static 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
59static 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
69static struct platform_device *devices[] __initdata = { 71 static struct platform_device *devices[] __initdata = {
70 &pxa_spi_nssp, 72 &pxa_spi_nssp,
71}; 73 };
72 74
73static 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
78Declaring Slave Devices 80Declaring Slave Devices
79----------------------- 81-----------------------
80Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c 82Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c
81using the "spi_board_info" structure found in "linux/spi/spi.h". See 83using 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
84Each slave device attached to the PXA must provide slave specific configuration 86Each slave device attached to the PXA must provide slave specific configuration
85information via the structure "pxa2xx_spi_chip" found in 87information via the structure "pxa2xx_spi_chip" found in
@@ -87,19 +89,21 @@ information via the structure "pxa2xx_spi_chip" found in
87will uses the configuration whenever the driver communicates with the slave 89will uses the configuration whenever the driver communicates with the slave
88device. All fields are optional. 90device. All fields are optional.
89 91
90struct 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
99The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are 103The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are
100used to configure the SSP hardware fifo. These fields are critical to the 104used to configure the SSP hardware fifo. These fields are critical to the
101performance of pxa2xx_spi driver and misconfiguration will result in rx 105performance of pxa2xx_spi driver and misconfiguration will result in rx
102fifo overruns (especially in PIO mode transfers). Good default values are 106fifo 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
142the PXA255 NSSP. 146the PXA255 NSSP.
143 147
144/* Chip Select control for the CS8415A SPI slave device */ 148::
145static 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 */
154static 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
162static 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
170static 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
178static 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
198static 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
205DMA and PIO I/O Support 211DMA and PIO I/O Support
@@ -210,26 +216,25 @@ by setting the "enable_dma" flag in the "pxa2xx_spi_controller" structure. The
210mode supports both coherent and stream based DMA mappings. 216mode supports both coherent and stream based DMA mappings.
211 217
212The following logic is used to determine the type of I/O to be used on 218The following logic is used to determine the type of I/O to be used on
213a per "spi_transfer" basis: 219a per "spi_transfer" basis::
214 220
215if !enable_dma then 221 if !enable_dma then
216 always use PIO transfers 222 always use PIO transfers
217 223
218if 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
222if 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
225if 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
228otherwise 234 otherwise
229 use PIO transfer 235 use PIO transfer
230 236
231THANKS TO 237THANKS TO
232--------- 238---------
233 239
234David Brownell and others for mentoring the development of this driver. 240David 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==============================================
1spi_lm70llp : LM70-LLP parport-to-SPI adapter 2spi_lm70llp : LM70-LLP parport-to-SPI adapter
2============================================== 3==============================================
3 4
4Supported board/chip: 5Supported 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
8Author: 11Author:
@@ -29,9 +32,10 @@ available (on page 4) here:
29 32
30The hardware interfacing on the LM70 LLP eval board is as follows: 33The 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
47Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin 51Note that since the LM70 uses a "3-wire" variant of SPI, the SI/SO pin
48is connected to both pin D7 (as Master Out) and Select (as Master In) 52is 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
75Thanks to 79Thanks to
76--------- 80---------
77o David Brownell for mentoring the SPI-side driver development. 81
78o Dr.Craig Hollabaugh for the (early) "manual" bitbanging driver version. 82- David Brownell for mentoring the SPI-side driver development.
79o 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===========================
1Kernel driver spi-sc18is602 2Kernel driver spi-sc18is602
2=========================== 3===========================
3 4
4Supported chips: 5Supported 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
8Author: 11Author:
@@ -17,7 +20,7 @@ kernel's SPI core subsystem.
17 20
18The driver does not probe for supported chips, since the SI18IS602/603 does not 21The driver does not probe for supported chips, since the SI18IS602/603 does not
19support Chip ID registers. You will have to instantiate the devices explicitly. 22support Chip ID registers. You will have to instantiate the devices explicitly.
20Please see Documentation/i2c/instantiating-devices for details. 23Please see Documentation/i2c/instantiating-devices.rst for details.
21 24
22 25
23Usage Notes 26Usage 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====================================
1Overview of Linux kernel SPI support 2Overview of Linux kernel SPI support
2==================================== 3====================================
3 4
@@ -139,12 +140,14 @@ a command and then reading its response.
139 140
140There are two types of SPI driver, here called: 141There 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.
160There is a minimal core of SPI programming interfaces, focussing on 163There is a minimal core of SPI programming interfaces, focussing on
161using the driver model to connect controller and protocol drivers using 164using the driver model to connect controller and protocol drivers using
162device tables provided by board specific initialization code. SPI 165device tables provided by board specific initialization code. SPI
163shows up in sysfs in several locations: 166shows 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.
206That information is normally provided by board-specific code, even for 209That information is normally provided by board-specific code, even for
207chips that do support some of automated discovery/enumeration. 210chips that do support some of automated discovery/enumeration.
208 211
209DECLARE CONTROLLERS 212Declare Controllers
213^^^^^^^^^^^^^^^^^^^
210 214
211The first kind of information is a list of what SPI controllers exist. 215The first kind of information is a list of what SPI controllers exist.
212For System-on-Chip (SOC) based boards, these will usually be platform 216For 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
221SPI-capable controllers, and only the ones actually usable on a given 225SPI-capable controllers, and only the ones actually usable on a given
222board should normally be set up and registered. 226board should normally be set up and registered.
223 227
224So for example arch/.../mach-*/board-*.c files might have code like: 228So 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
241And SOC-specific utility code might look something like: 245And 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
269an external clock, where another derives the SPI clock from current 273an external clock, where another derives the SPI clock from current
270settings of some master clock. 274settings of some master clock.
271 275
272 276Declare Slave Devices
273DECLARE SLAVE DEVICES 277^^^^^^^^^^^^^^^^^^^^^
274 278
275The second kind of information is a list of what SPI slave devices exist 279The second kind of information is a list of what SPI slave devices exist
276on the target board, often with some board-specific data needed for the 280on the target board, often with some board-specific data needed for the
@@ -278,7 +282,7 @@ driver to work correctly.
278 282
279Normally your arch/.../mach-*/board-*.c files would provide a small table 283Normally your arch/.../mach-*/board-*.c files would provide a small table
280listing the SPI devices on each board. (This would typically be only a 284listing the SPI devices on each board. (This would typically be only a
281small handful.) That might look like: 285small 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
317Then your board initialization code would register that table with the SPI 321Then your board initialization code would register that table with the SPI
318infrastructure, so that it's available later when the SPI master controller 322infrastructure, so that it's available later when the SPI master controller
319driver is registered: 323driver 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
325The widely used "card" style computers bundle memory, cpu, and little else 329The widely used "card" style computers bundle memory, cpu, and little else
326onto a card that's maybe just thirty square centimeters. On such systems, 330onto a card that's maybe just thirty square centimeters. On such systems,
327your arch/.../mach-.../board-*.c file would primarily provide information 331your ``arch/.../mach-.../board-*.c`` file would primarily provide information
328about the devices on the mainboard into which such a card is plugged. That 332about the devices on the mainboard into which such a card is plugged. That
329certainly includes SPI devices hooked up through the card connectors! 333certainly includes SPI devices hooked up through the card connectors!
330 334
331 335
332NON-STATIC CONFIGURATIONS 336Non-static Configurations
337^^^^^^^^^^^^^^^^^^^^^^^^^
333 338
334Developer boards often play by different rules than product boards, and one 339Developer boards often play by different rules than product boards, and one
335example is the potential need to hotplug SPI devices and/or controllers. 340example is the potential need to hotplug SPI devices and/or controllers.
@@ -349,7 +354,7 @@ How do I write an "SPI Protocol Driver"?
349Most SPI drivers are currently kernel drivers, but there's also support 354Most SPI drivers are currently kernel drivers, but there's also support
350for userspace drivers. Here we talk only about kernel drivers. 355for userspace drivers. Here we talk only about kernel drivers.
351 356
352SPI protocol drivers somewhat resemble platform device drivers: 357SPI 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
367might look like this unless you're creating a device which is managing 372might look like this unless you're creating a device which is managing
368a bus (appearing under /sys/class/spi_master). 373a 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".
479Use spi_alloc_master() to allocate the master, and spi_master_get_devdata() 486Use spi_alloc_master() to allocate the master, and spi_master_get_devdata()
480to get the driver-private data allocated for that device. 487to 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()
503will reverse the effect of spi_register_master(). 512will reverse the effect of spi_register_master().
504 513
505 514
506BUS NUMBERING 515Bus Numbering
516^^^^^^^^^^^^^
507 517
508Bus numbering is important, since that's how Linux identifies a given 518Bus numbering is important, since that's how Linux identifies a given
509SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On 519SPI 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
517this as a non-static configuration (see above). 527this as a non-static configuration (see above).
518 528
519 529
520SPI MASTER METHODS 530SPI 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 592Deprecated 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
593SPI MESSAGE QUEUE 605SPI Message Queue
606^^^^^^^^^^^^^^^^^
594 607
595If you are happy with the standard queueing mechanism provided by the 608If you are happy with the standard queueing mechanism provided by the
596SPI subsystem, just implement the queued methods specified above. Using 609SPI subsystem, just implement the queued methods specified above. Using
@@ -619,13 +632,13 @@ THANKS TO
619Contributors to Linux-SPI discussions include (in alphabetical order, 632Contributors to Linux-SPI discussions include (in alphabetical order,
620by last name): 633by last name):
621 634
622Mark Brown 635- Mark Brown
623David Brownell 636- David Brownell
624Russell King 637- Russell King
625Grant Likely 638- Grant Likely
626Dmitry Pervushin 639- Dmitry Pervushin
627Stephen Street 640- Stephen Street
628Mark Underwood 641- Mark Underwood
629Andrew Victor 642- Andrew Victor
630Linus Walleij 643- Linus Walleij
631Vitaly 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=================
2SPI userspace API
3=================
4
1SPI devices have a limited userspace API, supporting basic half-duplex 5SPI devices have a limited userspace API, supporting basic half-duplex
2read() and write() access to SPI slave devices. Using ioctl() requests, 6read() and write() access to SPI slave devices. Using ioctl() requests,
3full duplex transfers and device I/O configuration are also available. 7full 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.
39busybox; it's less featureful, but often enough.) For a SPI device with 45busybox; it's less featureful, but often enough.) For a SPI device with
40chipselect C on bus B, you should see: 46chipselect 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.
80Several ioctl() requests let your driver read or override the device's current 89Several ioctl() requests let your driver read or override the device's current
81settings for data transfer parameters: 90settings 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 ========================== 2Coresight 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
7Introduction 8Introduction
8------------ 9------------
@@ -69,6 +70,7 @@ Before accessing debug registers, we should ensure the clock and power domain
69have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1 70have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1
70Debug registers', the debug registers are spread into two domains: the debug 71Debug registers', the debug registers are spread into two domains: the debug
71domain and the CPU domain. 72domain 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
127The driver also can work as module, so can enable the debugging when insmod 129The driver also can work as module, so can enable the debugging when insmod
128module: 130module::
129# insmod coresight_cpu_debug.ko debug=1 131
132 # insmod coresight_cpu_debug.ko debug=1
130 133
131When boot time or insmod module you have not enabled the debugging, the driver 134When boot time or insmod module you have not enabled the debugging, the driver
132uses the debugfs file system to provide a knob to dynamically enable or disable 135uses the debugfs file system to provide a knob to dynamically enable or disable
133debugging: 136debugging:
134 137
135To enable it, write a '1' into /sys/kernel/debug/coresight_cpu_debug/enable: 138To 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
142To disable it, write a '0' into /sys/kernel/debug/coresight_cpu_debug/enable::
137 143
138To 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
141As explained in chapter "Clock and power domain", if you are working on one 146As explained in chapter "Clock and power domain", if you are working on one
142platform which has idle states to power off debug logic and the power 147platform 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"
154interface (see Documentation/power/pm_qos_interface.rst for more 159interface (see Documentation/power/pm_qos_interface.rst for more
155details). As specified in the PM QoS documentation the requested 160details). As specified in the PM QoS documentation the requested
156parameter will stay in effect until the file descriptor is released. 161parameter will stay in effect until the file descriptor is released.
157For example: 162For 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 ...
161Do some work... 166 Do some work...
162... 167 ...
163# exec 3<>- 168 # exec 3<>-
164 169
165The same can also be done from an application program. 170The same can also be done from an application program.
166 171
167Disable specific CPU's specific idle state from cpuidle sysfs (see 172Disable specific CPU's specific idle state from cpuidle sysfs (see
168Documentation/admin-guide/pm/cpuidle.rst): 173Documentation/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
172Output format 177Output format
173------------- 178-------------
174 179
175Here is an example of the debugging output format: 180Here is an example of the debugging output format::
176 181
177ARM external debug module: 182 ARM external debug module:
178coresight-cpu-debug 850000.debug: CPU[0]: 183 coresight-cpu-debug 850000.debug: CPU[0]:
179coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) 184 coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock)
180coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 185 coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8
181coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 186 coresight-cpu-debug 850000.debug: EDCIDSR: 00000000
182coresight-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)
183coresight-cpu-debug 852000.debug: CPU[1]: 188 coresight-cpu-debug 852000.debug: CPU[1]:
184coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) 189 coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock)
185coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 190 coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358
186coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 191 coresight-cpu-debug 852000.debug: EDCIDSR: 00000000
187coresight-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 ====================================== 2Coresight - 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
7Introduction 8Introduction
8------------ 9------------
@@ -26,7 +27,7 @@ implementation, either storing the compressed stream in a memory buffer or
26creating an interface to the outside world where data can be transferred to a 27creating an interface to the outside world where data can be transferred to a
27host without fear of filling up the onboard coresight memory buffer. 28host without fear of filling up the onboard coresight memory buffer.
28 29
29At typical coresight system would look like this: 30At 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
96Acronyms: 97Acronyms:
97 98
98PTM: Program Trace Macrocell 99PTM:
99ETM: Embedded Trace Macrocell 100 Program Trace Macrocell
100STM: System trace Macrocell 101ETM:
101ETB: Embedded Trace Buffer 102 Embedded Trace Macrocell
102ITM: Instrumentation Trace Macrocell 103STM:
103TPIU: Trace Port Interface Unit 104 System trace Macrocell
104TMC-ETR: Trace Memory Controller, configured as Embedded Trace Router 105ETB:
105TMC-ETF: Trace Memory Controller, configured as Embedded Trace FIFO 106 Embedded Trace Buffer
106CTI: Cross Trigger Interface 107ITM:
108 Instrumentation Trace Macrocell
109TPIU:
110 Trace Port Interface Unit
111TMC-ETR:
112 Trace Memory Controller, configured as Embedded Trace Router
113TMC-ETF:
114 Trace Memory Controller, configured as Embedded Trace FIFO
115CTI:
116 Cross Trigger Interface
107 117
108Classification: 118Classification:
109 119
@@ -118,7 +128,7 @@ Misc:
118 128
119 129
120Device Tree Bindings 130Device Tree Bindings
121---------------------- 131--------------------
122 132
123See Documentation/devicetree/bindings/arm/coresight.txt for details. 133See 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
133manage coresight devices on a platform. Any coresight compliant device can 143manage coresight devices on a platform. Any coresight compliant device can
134register with the framework for as long as they use the right APIs: 144register with the framework for as long as they use the right APIs:
135 145
136struct coresight_device *coresight_register(struct coresight_desc *desc); 146.. c:function:: struct coresight_device *coresight_register(struct coresight_desc *desc);
137void coresight_unregister(struct coresight_device *csdev); 147.. c:function:: void coresight_unregister(struct coresight_device *csdev);
138 148
139The registering function is taking a "struct coresight_device *csdev" and 149The registering function is taking a ``struct coresight_desc *desc`` and
140register the device with the core framework. The unregister function takes 150register the device with the core framework. The unregister function takes
141a reference to a "struct coresight_device", obtained at registration time. 151a reference to a ``struct coresight_device *csdev`` obtained at registration time.
142 152
143If everything goes well during the registration process the new devices will 153If everything goes well during the registration process the new devices will
144show up under /sys/bus/coresight/devices, as showns here for a TC2 platform: 154show up under /sys/bus/coresight/devices, as showns here for a TC2 platform::
145 155
146root:~# ls /sys/bus/coresight/devices/ 156 root:~# ls /sys/bus/coresight/devices/
147replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm 157 replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm
14820010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm 158 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm
149root:~# 159 root:~#
150 160
151The functions take a "struct coresight_device", which looks like this: 161The functions take a ``struct coresight_device``, which looks like this::
152 162
153struct 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
163The "coresight_dev_type" identifies what the device is, i.e, source link or 173The "coresight_dev_type" identifies what the device is, i.e, source link or
164sink while the "coresight_dev_subtype" will characterise that type further. 174sink while the "coresight_dev_subtype" will characterise that type further.
165 175
166The "struct coresight_ops" is mandatory and will tell the framework how to 176The ``struct coresight_ops`` is mandatory and will tell the framework how to
167perform base operations related to the components, each component having 177perform base operations related to the components, each component having
168a different set of requirement. For that "struct coresight_ops_sink", 178a 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
170provided. 180provided.
171 181
172The next field, "struct coresight_platform_data *pdata" is acquired by calling 182The 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
176static 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
184Specific class of device (source, link, or sink) have generic operations 194Specific class of device (source, link, or sink) have generic operations
185that can be performed on them (see "struct coresight_ops"). The 195that can be performed on them (see ``struct coresight_ops``). The ``**groups``
186"**groups" is a list of sysfs entries pertaining to operations 196is a list of sysfs entries pertaining to operations
187specific to that component only. "Implementation defined" customisations are 197specific to that component only. "Implementation defined" customisations are
188expected to be accessed and controlled using those entries. 198expected to be accessed and controlled using those entries.
189 199
190
191Device Naming scheme 200Device Naming scheme
192------------------------ 201--------------------
202
193The devices that appear on the "coresight" bus were named the same as their 203The devices that appear on the "coresight" bus were named the same as their
194parent devices, i.e, the real devices that appears on AMBA bus or the platform bus. 204parent devices, i.e, the real devices that appears on AMBA bus or the platform bus.
195Thus the names were based on the Linux Open Firmware layer naming convention, 205Thus the names were based on the Linux Open Firmware layer naming convention,
196which follows the base physical address of the device followed by the device 206which follows the base physical address of the device followed by the device
197type. e.g: 207type. e.g::
198 208
199root:~# 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
205However, with the introduction of ACPI support, the names of the real 215However, with the introduction of ACPI support, the names of the real
206devices are a bit cryptic and non-obvious. Thus, a new naming scheme was 216devices are a bit cryptic and non-obvious. Thus, a new naming scheme was
207introduced to use more generic names based on the type of the device. The 217introduced to use more generic names based on the type of the device. The
208following rules apply: 218following 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
223Thus, with the new scheme the devices could appear as : 233Thus, with the new scheme the devices could appear as ::
224 234
225root:~# 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
229Some of the examples below might refer to old naming scheme and some 239Some of the examples below might refer to old naming scheme and some
230to the newer scheme, to give a confirmation that what you see on your 240to the newer scheme, to give a confirmation that what you see on your
@@ -234,9 +244,12 @@ the system under specified locations.
234How to use the tracer modules 244How to use the tracer modules
235----------------------------- 245-----------------------------
236 246
237There are two ways to use the Coresight framework: 1) using the perf cmd line 247There are two ways to use the Coresight framework:
238tools and 2) interacting directly with the Coresight devices using the sysFS 248
239interface. Preference is given to the former as using the sysFS interface 2491. using the perf cmd line tools.
2502. interacting directly with the Coresight devices using the sysFS interface.
251
252Preference is given to the former as using the sysFS interface
240requires a deep understanding of the Coresight HW. The following sections 253requires a deep understanding of the Coresight HW. The following sections
241provide details on using both methods. 254provide details on using both methods.
242 255
@@ -245,107 +258,107 @@ provide details on using both methods.
245Before trace collection can start, a coresight sink needs to be identified. 258Before trace collection can start, a coresight sink needs to be identified.
246There is no limit on the amount of sinks (nor sources) that can be enabled at 259There is no limit on the amount of sinks (nor sources) that can be enabled at
247any given moment. As a generic operation, all device pertaining to the sink 260any given moment. As a generic operation, all device pertaining to the sink
248class will have an "active" entry in sysfs: 261class will have an "active" entry in sysfs::
249 262
250root:/sys/bus/coresight/devices# ls 263 root:/sys/bus/coresight/devices# ls
251replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm 264 replicator 20030000.tpiu 2201c000.ptm 2203c000.etm 2203e000.etm
25220010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm 265 20010000.etb 20040000.funnel 2201d000.ptm 2203d000.etm
253root:/sys/bus/coresight/devices# ls 20010000.etb 266 root:/sys/bus/coresight/devices# ls 20010000.etb
254enable_sink status trigger_cntr 267 enable_sink status trigger_cntr
255root:/sys/bus/coresight/devices# echo 1 > 20010000.etb/enable_sink 268 root:/sys/bus/coresight/devices# echo 1 > 20010000.etb/enable_sink
256root:/sys/bus/coresight/devices# cat 20010000.etb/enable_sink 269 root:/sys/bus/coresight/devices# cat 20010000.etb/enable_sink
2571 270 1
258root:/sys/bus/coresight/devices# 271 root:/sys/bus/coresight/devices#
259 272
260At boot time the current etm3x driver will configure the first address 273At boot time the current etm3x driver will configure the first address
261comparator with "_stext" and "_etext", essentially tracing any instruction 274comparator with "_stext" and "_etext", essentially tracing any instruction
262that falls within that range. As such "enabling" a source will immediately 275that falls within that range. As such "enabling" a source will immediately
263trigger a trace capture: 276trigger a trace capture::
264 277
265root:/sys/bus/coresight/devices# echo 1 > 2201c000.ptm/enable_source 278 root:/sys/bus/coresight/devices# echo 1 > 2201c000.ptm/enable_source
266root:/sys/bus/coresight/devices# cat 2201c000.ptm/enable_source 279 root:/sys/bus/coresight/devices# cat 2201c000.ptm/enable_source
2671 280 1
268root:/sys/bus/coresight/devices# cat 20010000.etb/status 281 root:/sys/bus/coresight/devices# cat 20010000.etb/status
269Depth: 0x2000 282 Depth: 0x2000
270Status: 0x1 283 Status: 0x1
271RAM read ptr: 0x0 284 RAM read ptr: 0x0
272RAM wrt ptr: 0x19d3 <----- The write pointer is moving 285 RAM wrt ptr: 0x19d3 <----- The write pointer is moving
273Trigger cnt: 0x0 286 Trigger cnt: 0x0
274Control: 0x1 287 Control: 0x1
275Flush status: 0x0 288 Flush status: 0x0
276Flush ctrl: 0x2001 289 Flush ctrl: 0x2001
277root:/sys/bus/coresight/devices# 290 root:/sys/bus/coresight/devices#
278 291
279Trace collection is stopped the same way: 292Trace collection is stopped the same way::
280 293
281root:/sys/bus/coresight/devices# echo 0 > 2201c000.ptm/enable_source 294 root:/sys/bus/coresight/devices# echo 0 > 2201c000.ptm/enable_source
282root:/sys/bus/coresight/devices# 295 root:/sys/bus/coresight/devices#
283 296
284The content of the ETB buffer can be harvested directly from /dev: 297The content of the ETB buffer can be harvested directly from /dev::
285 298
286root:/sys/bus/coresight/devices# dd if=/dev/20010000.etb \ 299 root:/sys/bus/coresight/devices# dd if=/dev/20010000.etb \
287of=~/cstrace.bin 300 of=~/cstrace.bin
288 301 64+0 records in
28964+0 records in 302 64+0 records out
29064+0 records out 303 32768 bytes (33 kB) copied, 0.00125258 s, 26.2 MB/s
29132768 bytes (33 kB) copied, 0.00125258 s, 26.2 MB/s 304 root:/sys/bus/coresight/devices#
292root:/sys/bus/coresight/devices#
293 305
294The file cstrace.bin can be decompressed using "ptm2human", DS-5 or Trace32. 306The file cstrace.bin can be decompressed using "ptm2human", DS-5 or Trace32.
295 307
296Following is a DS-5 output of an experimental loop that increments a variable up 308Following is a DS-5 output of an experimental loop that increments a variable up
297to a certain value. The example is simple and yet provides a glimpse of the 309to a certain value. The example is simple and yet provides a glimpse of the
298wealth of possibilities that coresight provides. 310wealth of possibilities that coresight provides.
299 311::
300Info Tracing enabled 312
301Instruction 106378866 0x8026B53C E52DE004 false PUSH {lr} 313 Info Tracing enabled
302Instruction 0 0x8026B540 E24DD00C false SUB sp,sp,#0xc 314 Instruction 106378866 0x8026B53C E52DE004 false PUSH {lr}
303Instruction 0 0x8026B544 E3A03000 false MOV r3,#0 315 Instruction 0 0x8026B540 E24DD00C false SUB sp,sp,#0xc
304Instruction 0 0x8026B548 E58D3004 false STR r3,[sp,#4] 316 Instruction 0 0x8026B544 E3A03000 false MOV r3,#0
305Instruction 0 0x8026B54C E59D3004 false LDR r3,[sp,#4] 317 Instruction 0 0x8026B548 E58D3004 false STR r3,[sp,#4]
306Instruction 0 0x8026B550 E3530004 false CMP r3,#4 318 Instruction 0 0x8026B54C E59D3004 false LDR r3,[sp,#4]
307Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 319 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
308Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 320 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
309Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 321 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
310Timestamp Timestamp: 17106715833 322 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
311Instruction 319 0x8026B54C E59D3004 false LDR r3,[sp,#4] 323 Timestamp Timestamp: 17106715833
312Instruction 0 0x8026B550 E3530004 false CMP r3,#4 324 Instruction 319 0x8026B54C E59D3004 false LDR r3,[sp,#4]
313Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 325 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
314Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 326 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
315Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 327 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
316Instruction 9 0x8026B54C E59D3004 false LDR r3,[sp,#4] 328 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
317Instruction 0 0x8026B550 E3530004 false CMP r3,#4 329 Instruction 9 0x8026B54C E59D3004 false LDR r3,[sp,#4]
318Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 330 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
319Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 331 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
320Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 332 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
321Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] 333 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
322Instruction 0 0x8026B550 E3530004 false CMP r3,#4 334 Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4]
323Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 335 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
324Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 336 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
325Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 337 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
326Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4] 338 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
327Instruction 0 0x8026B550 E3530004 false CMP r3,#4 339 Instruction 7 0x8026B54C E59D3004 false LDR r3,[sp,#4]
328Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 340 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
329Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 341 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
330Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 342 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
331Instruction 10 0x8026B54C E59D3004 false LDR r3,[sp,#4] 343 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
332Instruction 0 0x8026B550 E3530004 false CMP r3,#4 344 Instruction 10 0x8026B54C E59D3004 false LDR r3,[sp,#4]
333Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1 345 Instruction 0 0x8026B550 E3530004 false CMP r3,#4
334Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4] 346 Instruction 0 0x8026B554 E2833001 false ADD r3,r3,#1
335Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c 347 Instruction 0 0x8026B558 E58D3004 false STR r3,[sp,#4]
336Instruction 6 0x8026B560 EE1D3F30 false MRC p15,#0x0,r3,c13,c0,#1 348 Instruction 0 0x8026B55C DAFFFFFA true BLE {pc}-0x10 ; 0x8026b54c
337Instruction 0 0x8026B564 E1A0100D false MOV r1,sp 349 Instruction 6 0x8026B560 EE1D3F30 false MRC p15,#0x0,r3,c13,c0,#1
338Instruction 0 0x8026B568 E3C12D7F false BIC r2,r1,#0x1fc0 350 Instruction 0 0x8026B564 E1A0100D false MOV r1,sp
339Instruction 0 0x8026B56C E3C2203F false BIC r2,r2,#0x3f 351 Instruction 0 0x8026B568 E3C12D7F false BIC r2,r1,#0x1fc0
340Instruction 0 0x8026B570 E59D1004 false LDR r1,[sp,#4] 352 Instruction 0 0x8026B56C E3C2203F false BIC r2,r2,#0x3f
341Instruction 0 0x8026B574 E59F0010 false LDR r0,[pc,#16] ; [0x8026B58C] = 0x80550368 353 Instruction 0 0x8026B570 E59D1004 false LDR r1,[sp,#4]
342Instruction 0 0x8026B578 E592200C false LDR r2,[r2,#0xc] 354 Instruction 0 0x8026B574 E59F0010 false LDR r0,[pc,#16] ; [0x8026B58C] = 0x80550368
343Instruction 0 0x8026B57C E59221D0 false LDR r2,[r2,#0x1d0] 355 Instruction 0 0x8026B578 E592200C false LDR r2,[r2,#0xc]
344Instruction 0 0x8026B580 EB07A4CF true BL {pc}+0x1e9344 ; 0x804548c4 356 Instruction 0 0x8026B57C E59221D0 false LDR r2,[r2,#0x1d0]
345Info Tracing enabled 357 Instruction 0 0x8026B580 EB07A4CF true BL {pc}+0x1e9344 ; 0x804548c4
346Instruction 13570831 0x8026B584 E28DD00C false ADD sp,sp,#0xc 358 Info Tracing enabled
347Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc} 359 Instruction 13570831 0x8026B584 E28DD00C false ADD sp,sp,#0xc
348Timestamp Timestamp: 17107041535 360 Instruction 0 0x8026B588 E8BD8000 true LDM sp!,{pc}
361 Timestamp Timestamp: 17107041535
349 362
3502) Using perf framework: 3632) 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
370listed along with configuration options within forward slashes '/'. Since a 383listed along with configuration options within forward slashes '/'. Since a
371Coresight system will typically have more than one sink, the name of the sink to 384Coresight system will typically have more than one sink, the name of the sink to
372work with needs to be specified as an event option. 385work with needs to be specified as an event option.
373On newer kernels the available sinks are listed in sysFS under: 386On 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
379On older kernels, this may need to be found from the list of coresight devices, 392On older kernels, this may need to be found from the list of coresight devices,
380available under ($SYSFS)/bus/coresight/devices/: 393available 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
388As mentioned above in section "Device Naming scheme", the names of the devices could 400As 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
396More information on the above and other example on how to use Coresight with 408More information on the above and other example on how to use Coresight with
397the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub 409the perf tools can be found in the "HOWTO.md" file of the openCSD gitHub
398repository [3]. 410repository [#third]_.
399 411
4002.1) AutoFDO analysis using the perf tools: 4122.1) AutoFDO analysis using the perf tools:
401 413
402perf can be used to record and analyze trace of programs. 414perf can be used to record and analyze trace of programs.
403 415
404Execution can be recorded using 'perf record' with the cs_etm event, 416Execution can be recorded using 'perf record' with the cs_etm event,
405specifying the name of the sink to record to, e.g: 417specifying 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
423removed and replaced with the synthesized events. e.g. 435removed 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
427Below is an example of using ARM ETM for autoFDO. It requires autofdo 440Below 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
429sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial). 442sort 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
455than the program flow through the code. 469than the program flow through the code.
456 470
457As with any other CoreSight component, specifics about the STM tracer can be 471As with any other CoreSight component, specifics about the STM tracer can be
458found in sysfs with more information on each entry being found in [1]: 472found in sysfs with more information on each entry being found in [#first]_::
459 473
460root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0 474 root@genericarmv8:~# ls /sys/bus/coresight/devices/stm0
461enable_source hwevent_select port_enable subsystem uevent 475 enable_source hwevent_select port_enable subsystem uevent
462hwevent_enable mgmt port_select traceid 476 hwevent_enable mgmt port_select traceid
463root@genericarmv8:~# 477 root@genericarmv8:~#
464 478
465Like any other source a sink needs to be identified and the STM enabled before 479Like any other source a sink needs to be identified and the STM enabled before
466being used: 480being used::
467 481
468root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink 482 root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink
469root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source 483 root@genericarmv8:~# echo 1 > /sys/bus/coresight/devices/stm0/enable_source
470 484
471From there user space applications can request and use channels using the devfs 485From there user space applications can request and use channels using the devfs
472interface provided for that purpose by the generic STM API: 486interface 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
492Details on how to use the generic STM API can be found here [#second]_.
473 493
474root@genericarmv8:~# ls -l /dev/stm0 494.. [#first] Documentation/ABI/testing/sysfs-bus-coresight-devices-stm
475crw------- 1 root root 10, 61 Jan 3 18:11 /dev/stm0
476root@genericarmv8:~#
477 495
478Details 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
3155Note, reading the trace_pipe file will block until more input is 3157Note, reading the trace_pipe file will block until more input is
3156added. 3158added. This is contrary to the trace file. If any process opened
3159the trace file for reading, it will actually disable tracing and
3160prevent new entries from being added. The trace_pipe file does
3161not have this limitation.
3157 3162
3158trace entries 3163trace 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
26usando, il comando indicato dovrebbe dirvelo. 26usando, il comando indicato dovrebbe dirvelo.
27 27
28Questa lista presume che abbiate già un kernel Linux funzionante. In aggiunta, 28Questa lista presume che abbiate già un kernel Linux funzionante. In aggiunta,
29non tutti gli strumenti sono necessari ovunque; ovviamente, se non avete un 29non tutti gli strumenti sono necessari ovunque; ovviamente, se non avete una
30modem ISDN, per esempio, probabilmente non dovreste preoccuparvi di 30PC Card, per esempio, probabilmente non dovreste preoccuparvi di pcmciautils.
31isdn4k-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====================== ================= ========================================
36GNU C 4.6 gcc --version 35GNU C 4.6 gcc --version
37GNU make 3.81 make --version 36GNU make 3.81 make --version
38binutils 2.20 ld -v 37binutils 2.21 ld -v
39flex 2.5.35 flex --version 38flex 2.5.35 flex --version
40bison 2.0 bison --version 39bison 2.0 bison --version
41util-linux 2.10o fdformat --version 40util-linux 2.10o fdformat --version
@@ -49,7 +48,6 @@ btrfs-progs 0.18 btrfsck
49pcmciautils 004 pccardctl -V 48pcmciautils 004 pccardctl -V
50quota-tools 3.09 quota -V 49quota-tools 3.09 quota -V
51PPP 2.4.0 pppd --version 50PPP 2.4.0 pppd --version
52isdn4k-utils 3.1pre1 isdnctrl 2>&1|grep version
53nfs-utils 1.0.5 showmount --version 51nfs-utils 1.0.5 showmount --version
54procps 3.2.0 ps --version 52procps 3.2.0 ps --version
55oprofile 0.9 oprofiled --version 53oprofile 0.9 oprofiled --version
@@ -81,10 +79,7 @@ Per compilare il kernel vi servirà GNU make 3.81 o successivo.
81Binutils 79Binutils
82-------- 80--------
83 81
84Il sistema di compilazione, dalla versione 4.13, per la produzione dei passi 82Per generare il kernel è necessario avere Binutils 2.21 o superiore.
85intermedi, si è convertito all'uso di *thin archive* (`ar T`) piuttosto che
86all'uso del *linking* incrementale (`ld -r`). Questo richiede binutils 2.20 o
87successivo.
88 83
89pkg-config 84pkg-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
289Isdn4k-utils
290------------
291
292Per via della modifica del campo per il numero di telefono, il pacchetto
293isdn4k-utils dev'essere ricompilato o (preferibilmente) aggiornato.
294 284
295NFS-utils 285NFS-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
459Isdn4k-utils
460------------
461
462- <ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/>
463 449
464NFS-utils 450NFS-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
870Jeff Garzik, "Formato per la sottomissione di patch per il kernel Linux" 870Jeff 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
873Greg Kroah-Hartman, "Come scocciare un manutentore di un sottosistema" 873Greg 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
695Jeff Garzik, "Linux kernel patch submission format". 695Jeff 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
698Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". 698Greg 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 之å‰çš„ç‰ˆæœ¬åŒæ—¶è¦æ±‚设备树数æ®å—被置于从内核映åƒä»¥ä¸‹
74text_offset 字节处算起第一个 512MB 内。 74text_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
156ReSTæ ¼å¼çš„æ–‡æ¡£ä¼šç”Ÿæˆåœ¨ 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
654Jeff Garzik, "Linux kernel patch submission format". 654Jeff 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
657Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer". 657Greg 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================
41-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====================
1Kernel driver ds2482 2Kernel driver ds2482
2==================== 3====================
3 4
4Supported chips: 5Supported 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
12Author: Ben Gardner <bgardner@wabtec.com> 18Author: Ben Gardner <bgardner@wabtec.com>
13 19
@@ -23,9 +29,11 @@ General Remarks
23--------------- 29---------------
24 30
25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. 31Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.
32
26However, the device cannot be detected without writing to the i2c bus, so no 33However, the device cannot be detected without writing to the i2c bus, so no
27detection is done. You should instantiate the device explicitly. 34detection 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====================
1Kernel driver ds2490 2Kernel driver ds2490
2==================== 3====================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2490 based 7 * Maxim DS2490 based
6 8
7Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru> 9Author: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
@@ -18,6 +20,7 @@ which has 0x81 family ID integrated chip and DS2490
18low-level operational chip. 20low-level operational chip.
19 21
20Notes and limitations. 22Notes 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
7203-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=====================
41-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 @@
1Kernel driver mxc_w1
2====================
3
4Supported 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
11Author: 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====================
2Kernel driver mxc_w1
3====================
4
5Supported 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
14Author:
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 @@
1Kernel driver for omap HDQ/1-wire module. 1========================================
2Kernel driver for omap HDQ/1-wire module
2======================================== 3========================================
3 4
4Supported chips: 5Supported chips:
5================ 6================
6 HDQ/1-wire controller on the TI OMAP 2430/3430 platforms. 7HDQ/1-wire controller on the TI OMAP 2430/3430 platforms.
7 8
8A useful link about HDQ basics: 9A useful link about HDQ basics:
9=============================== 10===============================
@@ -40,9 +41,10 @@ driver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1.
40Please note to load both the modules with a different ID if required, but note 41Please note to load both the modules with a different ID if required, but note
41that the ID used should be same for both master and slave driver loading. 42that the ID used should be same for both master and slave driver loading.
42 43
43e.g: 44e.g::
44insmod omap_hdq.ko W1_ID=2 45
45inamod w1_bq27000.ko F_ID=2 46 insmod omap_hdq.ko W1_ID=2
47 inamod w1_bq27000.ko F_ID=2
46 48
47The driver also supports 1-wire mode. In this mode, there is no need to 49The driver also supports 1-wire mode. In this mode, there is no need to
48pass slave ID as parameter. The driver will auto-detect slaves connected 50pass 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=====================
1Kernel driver w1-gpio 2Kernel driver w1-gpio
2===================== 3=====================
3 4
@@ -16,28 +17,30 @@ Documentation/devicetree/bindings/w1/w1-gpio.txt
16Example (mach-at91) 17Example (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
22static 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
30static 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
34static 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====================
41-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=======================
1w1_ds2406 kernel driver 2w1_ds2406 kernel driver
2======================= 3=======================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2406 (and other family 0x12) addressable switches 7 * Maxim DS2406 (and other family 0x12) addressable switches
6 8
7Author: Scott Alfter <scott@alfter.us> 9Author: Scott Alfter <scott@alfter.us>
@@ -9,7 +11,7 @@ Author: Scott Alfter <scott@alfter.us>
9Description 11Description
10----------- 12-----------
11 13
12The w1_ds2406 driver allows connected devices to be switched on and off. 14The w1_ds2406 driver allows connected devices to be switched on and off.
13These chips also provide 128 bytes of OTP EPROM, but reading/writing it is 15These chips also provide 128 bytes of OTP EPROM, but reading/writing it is
14not supported. In TSOC-6 form, the DS2406 provides two switch outputs and 16not supported. In TSOC-6 form, the DS2406 provides two switch outputs and
15can be provided with power on a dedicated input. In TO-92 form, it provides 17can 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=======================
1Kernel driver w1_ds2413 2Kernel driver w1_ds2413
2======================= 3=======================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS2413 1-Wire Dual Channel Addressable Switch 7 * Maxim DS2413 1-Wire Dual Channel Addressable Switch
6 8
7supported family codes: 9supported family codes:
10
11 ================ ====
8 W1_FAMILY_DS2413 0x3A 12 W1_FAMILY_DS2413 0x3A
13 ================ ====
9 14
10Author: Mariusz Bialonczyk <manio@skyboo.net> 15Author: Mariusz Bialonczyk <manio@skyboo.net>
11 16
@@ -20,11 +25,13 @@ Reading state
20The "state" file provides one-byte value which is in the same format as for 25The "state" file provides one-byte value which is in the same format as for
21the chip PIO_ACCESS_READ command (refer the datasheet for details): 26the chip PIO_ACCESS_READ command (refer the datasheet for details):
22 27
28======== =============================================================
23Bit 0: PIOA Pin State 29Bit 0: PIOA Pin State
24Bit 1: PIOA Output Latch State 30Bit 1: PIOA Output Latch State
25Bit 2: PIOB Pin State 31Bit 2: PIOB Pin State
26Bit 3: PIOB Output Latch State 32Bit 3: PIOB Output Latch State
27Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module) 33Bit 4-7: Complement of Bit 3 to Bit 0 (verified by the kernel module)
34======== =============================================================
28 35
29This file is readonly. 36This file is readonly.
30 37
@@ -34,9 +41,11 @@ You can set the PIO pins using the "output" file.
34It is writable, you can write one-byte value to this sysfs file. 41It is writable, you can write one-byte value to this sysfs file.
35Similarly the byte format is the same as for the PIO_ACCESS_WRITE command: 42Similarly the byte format is the same as for the PIO_ACCESS_WRITE command:
36 43
44======== ======================================
37Bit 0: PIOA 45Bit 0: PIOA
38Bit 1: PIOB 46Bit 1: PIOB
39Bit 2-7: No matter (driver will set it to "1"s) 47Bit 2-7: No matter (driver will set it to "1"s)
48======== ======================================
40 49
41 50
42The chip has some kind of basic protection against transmission errors. 51The 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 @@
1Kernel driver w1_ds2423
2=======================
3
4Supported chips:
5 * Maxim DS2423 based counter devices.
6
7supported family codes:
8 W1_THERM_DS2423 0x1D
9
10Author: Mika Laitio <lamikr@pilppa.org>
11
12Description
13-----------
14
15Support is provided through the sysfs w1_slave file. Each opening and
16read sequence of w1_slave file initiates the read of counters and ram
17available in DS2423 pages 12 - 15.
18
19Result of each page is provided as an ASCII output where each counter
20value and associated ram buffer is outpputed to own line.
21
22Each lines will contain the values of 42 bytes read from the counter and
23memory page along the crc=YES or NO for indicating whether the read operation
24was successful and CRC matched.
25If the operation was successful, there is also in the end of each line
26a counter value expressed as an integer after c=
27
28Meaning 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
37example from the successful read:
3800 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
3900 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
4000 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
4100 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
43example from the read with crc errors:
4400 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
4500 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
4600 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
4700 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 @@
1Kernel driver w1_ds2423
2=======================
3
4Supported chips:
5
6 * Maxim DS2423 based counter devices.
7
8supported family codes:
9
10 =============== ====
11 W1_THERM_DS2423 0x1D
12 =============== ====
13
14Author: Mika Laitio <lamikr@pilppa.org>
15
16Description
17-----------
18
19Support is provided through the sysfs w1_slave file. Each opening and
20read sequence of w1_slave file initiates the read of counters and ram
21available in DS2423 pages 12 - 15.
22
23Result of each page is provided as an ASCII output where each counter
24value and associated ram buffer is outpputed to own line.
25
26Each lines will contain the values of 42 bytes read from the counter and
27memory page along the crc=YES or NO for indicating whether the read operation
28was successful and CRC matched.
29If the operation was successful, there is also in the end of each line
30a counter value expressed as an integer after c=
31
32Meaning 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
42example 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
49example 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
4Supported chips: 4Supported chips:
5
5 * Maxim DS2438 Smart Battery Monitor 6 * Maxim DS2438 Smart Battery Monitor
6 7
7supported family codes: 8supported family codes:
9 ================ ====
8 W1_FAMILY_DS2438 0x26 10 W1_FAMILY_DS2438 0x26
11 ================ ====
9 12
10Author: Mariusz Bialonczyk <manio@skyboo.net> 13Author: Mariusz Bialonczyk <manio@skyboo.net>
11 14
@@ -56,8 +59,11 @@ Opening and reading this file initiates the CONVERT_V (voltage conversion)
56command of the chip. 59command of the chip.
57 60
58Depending on a sysfs filename a different input for the A/D will be selected: 61Depending on a sysfs filename a different input for the A/D will be selected:
59vad: general purpose A/D input (VAD) 62
60vdd: battery input (VDD) 63vad:
64 general purpose A/D input (VAD)
65vdd:
66 battery input (VDD)
61 67
62After the voltage conversion the value is returned as decimal ASCII. 68After the voltage conversion the value is returned as decimal ASCII.
63Note: To get a volts the value has to be divided by 100. 69Note: 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========================
1Kernel driver w1_ds28e04 2Kernel driver w1_ds28e04
2======================== 3========================
3 4
4Supported chips: 5Supported 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
7supported family codes: 9supported family codes:
10
11 ================= ====
8 W1_FAMILY_DS28E04 0x1C 12 W1_FAMILY_DS28E04 0x1C
13 ================= ====
9 14
10Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de> 15Author: 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========================
1Kernel driver w1_ds28e17 2Kernel driver w1_ds28e17
2======================== 3========================
3 4
4Supported chips: 5Supported chips:
6
5 * Maxim DS28E17 1-Wire-to-I2C Master Bridge 7 * Maxim DS28E17 1-Wire-to-I2C Master Bridge
6 8
7supported family codes: 9supported family codes:
10
11 ================= ====
8 W1_FAMILY_DS28E17 0x19 12 W1_FAMILY_DS28E17 0x19
13 ================= ====
9 14
10Author: Jan Kandziora <jjj@gmx.de> 15Author: 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
20connected to a "native" I2C bus master. 25connected to a "native" I2C bus master.
21 26
22 27
23An udev rule like the following 28An udev rule like the following::
24------------------------------------------------------------------------------- 29
25SUBSYSTEM=="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
28may be used to create stable /dev/i2c- entries based on the unique id of the 33may be used to create stable /dev/i2c- entries based on the unique id of the
29DS28E17 chip. 34DS28E17 chip.
30 35
@@ -65,4 +70,3 @@ structure is created.
65 70
66 71
67See https://github.com/ianka/w1_ds28e17 for even more information. 72See 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======================
1Kernel driver w1_therm 2Kernel driver w1_therm
2==================== 3======================
3 4
4Supported chips: 5Supported 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
14w1_therm provides basic temperature conversion for ds18*20 devices, and the 16w1_therm provides basic temperature conversion for ds18*20 devices, and the
15ds28ea00 device. 17ds28ea00 device.
16supported family codes: 18
19Supported family codes:
20
21==================== ====
17W1_THERM_DS18S20 0x10 22W1_THERM_DS18S20 0x10
18W1_THERM_DS1822 0x22 23W1_THERM_DS1822 0x22
19W1_THERM_DS18B20 0x28 24W1_THERM_DS18B20 0x28
20W1_THERM_DS1825 0x3B 25W1_THERM_DS1825 0x3B
21W1_THERM_DS28EA00 0x42 26W1_THERM_DS28EA00 0x42
27==================== ====
22 28
23Support is provided through the sysfs w1_slave file. Each open and 29Support is provided through the sysfs w1_slave file. Each open and
24read sequence will initiate a temperature conversion then provide two 30read sequence will initiate a temperature conversion then provide two
@@ -51,6 +57,7 @@ If so, it will activate the master's strong pullup.
51In case the detection of parasite devices using this command fails 57In 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
53be force-enabled. 59be force-enabled.
60
54If the strong pullup is enabled, the master's strong pullup will be 61If the strong pullup is enabled, the master's strong pullup will be
55driven when the conversion is taking place, provided the master driver 62driven when the conversion is taking place, provided the master driver
56does support the strong pullup (or it falls back to a pullup 63does 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 @@
1The 1-wire (w1) subsystem 1=========================================
2------------------------------------------------------------------ 2Introduction to the 1-wire (w1) subsystem
3=========================================
4
3The 1-wire bus is a simple master-slave bus that communicates via a single 5The 1-wire bus is a simple master-slave bus that communicates via a single
4signal wire (plus ground, so two wires). 6signal wire (plus ground, so two wires).
5 7
@@ -12,14 +14,16 @@ communication with slaves.
12All w1 slave devices must be connected to a w1 bus master device. 14All w1 slave devices must be connected to a w1 bus master device.
13 15
14Example w1 master devices: 16Example 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
21What does the w1 subsystem do? 24What does the w1 subsystem do?
22------------------------------------------------------------------ 25------------------------------
26
23When a w1 master driver registers with the w1 subsystem, the following occurs: 27When 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
45W1 device families 49W1 device families
46------------------------------------------------------------------ 50------------------
51
47Slave devices are handled by a driver written for a family of w1 devices. 52Slave devices are handled by a driver written for a family of w1 devices.
48 53
49A family driver populates a struct w1_family_ops (see w1_family.h) and 54A family driver populates a struct w1_family_ops (see w1_family.h) and
50registers with the w1 subsystem. 55registers with the w1 subsystem.
51 56
52Current family drivers: 57Current family drivers:
53w1_therm - (ds18?20 thermal sensor family driver) 58
59w1_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
57w1_smem - driver for simple 64bit memory cell provides ID reading method. 64w1_smem
65 - driver for simple 64bit memory cell provides ID reading method.
58 66
59You can call above methods by reading appropriate sysfs files. 67You can call above methods by reading appropriate sysfs files.
60 68
61 69
62What does a w1 master driver need to implement? 70What does a w1 master driver need to implement?
63------------------------------------------------------------------ 71-----------------------------------------------
64 72
65The driver for w1 bus master must provide at minimum two functions. 73The 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
77w1 master sysfs interface 85w1 master sysfs interface
78------------------------------------------------------------------ 86-------------------------
79<xx-xxxxxxxxxxxx> - A directory for a found device. The format is family-serial 87
80bus - (standard) symlink to the w1 bus 88========================= =====================================================
81driver - (standard) symlink to the w1 driver 89<xx-xxxxxxxxxxxx> A directory for a found device. The format is
82w1_master_add - (rw) manually register a slave device 90 family-serial
83w1_master_attempts - (ro) the number of times a search was attempted 91bus (standard) symlink to the w1 bus
84w1_master_max_slave_count 92driver (standard) symlink to the w1 driver
85 - (rw) maximum number of slaves to search for at a time 93w1_master_add (rw) manually register a slave device
86w1_master_name - (ro) the name of the device (w1_bus_masterX) 94w1_master_attempts (ro) the number of times a search was attempted
87w1_master_pullup - (rw) 5V strong pullup 0 enabled, 1 disabled 95w1_master_max_slave_count (rw) maximum number of slaves to search for at a time
88w1_master_remove - (rw) manually remove a slave device 96w1_master_name (ro) the name of the device (w1_bus_masterX)
89w1_master_search - (rw) the number of searches left to do, 97w1_master_pullup (rw) 5V strong pullup 0 enabled, 1 disabled
90 -1=continual (default) 98w1_master_remove (rw) manually remove a slave device
91w1_master_slave_count 99w1_master_search (rw) the number of searches left to do,
92 - (ro) the number of slaves found 100 -1=continual (default)
93w1_master_slaves - (ro) the names of the slaves, one per line 101w1_master_slave_count (ro) the number of slaves found
94w1_master_timeout - (ro) the delay in seconds between searches 102w1_master_slaves (ro) the names of the slaves, one per line
95w1_master_timeout_us 103w1_master_timeout (ro) the delay in seconds between searches
96 - (ro) the delay in microseconds beetwen searches 104w1_master_timeout_us (ro) the delay in microseconds beetwen searches
105========================= =====================================================
97 106
98If you have a w1 bus that never changes (you don't add or remove devices), 107If you have a w1 bus that never changes (you don't add or remove devices),
99you can set the module parameter search_count to a small positive number 108you 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
111w1_master_attempts by 1. 120w1_master_attempts by 1.
112 121
113w1 slave sysfs interface 122w1 slave sysfs interface
114------------------------------------------------------------------ 123------------------------
115bus - (standard) symlink to the w1 bus 124
116driver - (standard) symlink to the w1 driver 125=================== ============================================================
117name - the device name, usually the same as the directory name 126bus (standard) symlink to the w1 bus
118w1_slave - (optional) a binary file whose meaning depends on the 127driver (standard) symlink to the w1 driver
119 family driver 128name the device name, usually the same as the directory name
120rw - (optional) created for slave devices which do not have 129w1_slave (optional) a binary file whose meaning depends on the
121 appropriate family driver. Allows to read/write binary data. 130 family driver
131rw (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 @@
1Userspace communication protocol over connector [1]. 1===============================================
2Userspace communication protocol over connector
3===============================================
2 4
3 5Message types
4Message types.
5============= 6=============
6 7
7There are three types of messages between w1 core and userspace: 8There are three types of messages between w1 core and userspace:
9
81. Events. They are generated each time a new master or slave device 101. 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.
102. Userspace commands. 122. Userspace commands.
113. Replies to userspace commands. 133. Replies to userspace commands.
12 14
13 15
14Protocol. 16Protocol
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.
71Currently replies to userspace commands are only generated for read 75Currently replies to userspace commands are only generated for read
72command request. One reply is generated exactly for one w1_netlink_cmd 76command request. One reply is generated exactly for one w1_netlink_cmd
73read request. Replies are not combined when sent - i.e. typical reply 77read request. Replies are not combined when sent - i.e. typical reply
74messages looks like the following: 78messages looks like the following::
75 79
76[cn_msg][w1_netlink_msg][w1_netlink_cmd] 80 [cn_msg][w1_netlink_msg][w1_netlink_cmd]
77cn_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;
80w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len; 84 w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
81w1_netlink_cmd.len = cmd->len; 85 w1_netlink_cmd.len = cmd->len;
82 86
83Replies to W1_LIST_MASTERS should send a message back to the userspace 87Replies to W1_LIST_MASTERS should send a message back to the userspace
84which will contain list of all registered master ids in the following 88which will contain list of all registered master ids in the following
85format: 89format::
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 97Each message is at most 4k in size, so if number of master devices
94 exceeds this, it will be split into several messages. 98exceeds this, it will be split into several messages.
95 99
96W1 search and alarm search commands. 100W1 search and alarm search commands.
97request:
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
103reply: 102request::
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
109reply::
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
110Length in each header corresponds to the size of the data behind it, so 118Length in each header corresponds to the size of the data behind it, so
111w1_netlink_cmd->len = N * 8; where N is number of IDs in this message. 119w1_netlink_cmd->len = N * 8; where N is number of IDs in this message.
112 Can be zero. 120Can be zero.
113w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8; 121
114cn_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
118W1 reset command. 129W1 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
125Command status replies. 136
137Command status replies
126====================== 138======================
127 139
128Each command (either root, master or slave with or without w1_netlink_cmd 140Each 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,
150even if there were errors, only length mismatch interrupts message processing. 162even if there were errors, only length mismatch interrupts message processing.
151 163
152 164
153Operation steps in w1 core when new command is received. 165Operation steps in w1 core when new command is received
154======================================================= 166=======================================================
155 167
156When new message (w1_netlink_msg) is received w1 core detects if it is 168When 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
167and next w1_netlink_msg header processing started. 179and next w1_netlink_msg header processing started.
168 180
169 181
170Connector [1] specific documentation. 182Connector [1] specific documentation
171==================================== 183====================================
172 184
173Each connector message includes two u32 fields as "address". 185Each connector message includes two u32 fields as "address".
@@ -180,10 +192,11 @@ Sequence number for reply is the same as was in request, and
180acknowledge number is set to seq+1. 192acknowledge number is set to seq+1.
181 193
182 194
183Additional documantion, source code examples. 195Additional documentation, source code examples
184============================================ 196==============================================
185 197
1861. Documentation/driver-api/connector.rst 1981. Documentation/driver-api/connector.rst
1872. http://www.ioremap.net/archive/w1 1992. http://www.ioremap.net/archive/w1
188This archive includes userspace application w1d.c which uses 200
189read/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
658M: Rudolf Marek <r.marek@assembler.cz> 658M: Rudolf Marek <r.marek@assembler.cz>
659L: linux-i2c@vger.kernel.org 659L: linux-i2c@vger.kernel.org
660S: Maintained 660S: Maintained
661F: Documentation/i2c/busses/i2c-ali1563 661F: Documentation/i2c/busses/i2c-ali1563.rst
662F: drivers/i2c/busses/i2c-ali1563.c 662F: drivers/i2c/busses/i2c-ali1563.c
663 663
664ALLEGRO DVT VIDEO IP CORE DRIVER 664ALLEGRO DVT VIDEO IP CORE DRIVER
@@ -1573,8 +1573,8 @@ R: Suzuki K Poulose <suzuki.poulose@arm.com>
1573L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1573L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1574S: Maintained 1574S: Maintained
1575F: drivers/hwtracing/coresight/* 1575F: drivers/hwtracing/coresight/*
1576F: Documentation/trace/coresight.txt 1576F: Documentation/trace/coresight.rst
1577F: Documentation/trace/coresight-cpu-debug.txt 1577F: Documentation/trace/coresight-cpu-debug.rst
1578F: Documentation/devicetree/bindings/arm/coresight.txt 1578F: Documentation/devicetree/bindings/arm/coresight.txt
1579F: Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt 1579F: Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt
1580F: Documentation/ABI/testing/sysfs-bus-coresight-devices-* 1580F: Documentation/ABI/testing/sysfs-bus-coresight-devices-*
@@ -4080,7 +4080,7 @@ L: samba-technical@lists.samba.org (moderated for non-subscribers)
4080W: http://linux-cifs.samba.org/ 4080W: http://linux-cifs.samba.org/
4081T: git git://git.samba.org/sfrench/cifs-2.6.git 4081T: git git://git.samba.org/sfrench/cifs-2.6.git
4082S: Supported 4082S: Supported
4083F: Documentation/filesystems/cifs/ 4083F: Documentation/admin-guide/cifs/
4084F: fs/cifs/ 4084F: fs/cifs/
4085 4085
4086COMPACTPCI HOTPLUG CORE 4086COMPACTPCI HOTPLUG CORE
@@ -4936,7 +4936,9 @@ M: Jonathan Corbet <corbet@lwn.net>
4936L: linux-doc@vger.kernel.org 4936L: linux-doc@vger.kernel.org
4937S: Maintained 4937S: Maintained
4938F: Documentation/ 4938F: Documentation/
4939F: scripts/documentation-file-ref-check
4939F: scripts/kernel-doc 4940F: scripts/kernel-doc
4941F: scripts/sphinx-pre-install
4940X: Documentation/ABI/ 4942X: Documentation/ABI/
4941X: Documentation/firmware-guide/acpi/ 4943X: Documentation/firmware-guide/acpi/
4942X: Documentation/devicetree/ 4944X: Documentation/devicetree/
@@ -4952,6 +4954,14 @@ L: linux-doc@vger.kernel.org
4952S: Maintained 4954S: Maintained
4953F: Documentation/translations/it_IT 4955F: Documentation/translations/it_IT
4954 4956
4957DOCUMENTATION SCRIPTS
4958M: Mauro Carvalho Chehab <mchehab@kernel.org>
4959L: linux-doc@vger.kernel.org
4960S: Maintained
4961F: scripts/documentation-file-ref-check
4962F: scripts/sphinx-pre-install
4963F: Documentation/sphinx/parse-headers.pl
4964
4955DONGWOON DW9714 LENS VOICE COIL DRIVER 4965DONGWOON DW9714 LENS VOICE COIL DRIVER
4956M: Sakari Ailus <sakari.ailus@linux.intel.com> 4966M: Sakari Ailus <sakari.ailus@linux.intel.com>
4957L: linux-media@vger.kernel.org 4967L: linux-media@vger.kernel.org
@@ -6312,7 +6322,7 @@ FLEXTIMER FTM-QUADDEC DRIVER
6312M: Patrick Havelange <patrick.havelange@essensium.com> 6322M: Patrick Havelange <patrick.havelange@essensium.com>
6313L: linux-iio@vger.kernel.org 6323L: linux-iio@vger.kernel.org
6314S: Maintained 6324S: Maintained
6315F: Documentation/ABI/testing/sysfs-bus-counter-ftm-quadddec 6325F: Documentation/ABI/testing/sysfs-bus-counter-ftm-quaddec
6316F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt 6326F: Documentation/devicetree/bindings/counter/ftm-quaddec.txt
6317F: drivers/counter/ftm-quaddec.c 6327F: drivers/counter/ftm-quaddec.c
6318 6328
@@ -6734,7 +6744,7 @@ L: linux-i2c@vger.kernel.org
6734S: Supported 6744S: Supported
6735F: drivers/i2c/muxes/i2c-mux-gpio.c 6745F: drivers/i2c/muxes/i2c-mux-gpio.c
6736F: include/linux/platform_data/i2c-mux-gpio.h 6746F: include/linux/platform_data/i2c-mux-gpio.h
6737F: Documentation/i2c/muxes/i2c-mux-gpio 6747F: Documentation/i2c/muxes/i2c-mux-gpio.rst
6738 6748
6739GENERIC HDLC (WAN) DRIVERS 6749GENERIC HDLC (WAN) DRIVERS
6740M: Krzysztof Halasa <khc@pm.waw.pl> 6750M: Krzysztof Halasa <khc@pm.waw.pl>
@@ -7483,14 +7493,14 @@ I2C CONTROLLER DRIVER FOR NVIDIA GPU
7483M: Ajay Gupta <ajayg@nvidia.com> 7493M: Ajay Gupta <ajayg@nvidia.com>
7484L: linux-i2c@vger.kernel.org 7494L: linux-i2c@vger.kernel.org
7485S: Maintained 7495S: Maintained
7486F: Documentation/i2c/busses/i2c-nvidia-gpu 7496F: Documentation/i2c/busses/i2c-nvidia-gpu.rst
7487F: drivers/i2c/busses/i2c-nvidia-gpu.c 7497F: drivers/i2c/busses/i2c-nvidia-gpu.c
7488 7498
7489I2C MUXES 7499I2C MUXES
7490M: Peter Rosin <peda@axentia.se> 7500M: Peter Rosin <peda@axentia.se>
7491L: linux-i2c@vger.kernel.org 7501L: linux-i2c@vger.kernel.org
7492S: Maintained 7502S: Maintained
7493F: Documentation/i2c/i2c-topology 7503F: Documentation/i2c/i2c-topology.rst
7494F: Documentation/i2c/muxes/ 7504F: Documentation/i2c/muxes/
7495F: Documentation/devicetree/bindings/i2c/i2c-mux* 7505F: Documentation/devicetree/bindings/i2c/i2c-mux*
7496F: Documentation/devicetree/bindings/i2c/i2c-arb* 7506F: Documentation/devicetree/bindings/i2c/i2c-arb*
@@ -7510,8 +7520,8 @@ I2C OVER PARALLEL PORT
7510M: Jean Delvare <jdelvare@suse.com> 7520M: Jean Delvare <jdelvare@suse.com>
7511L: linux-i2c@vger.kernel.org 7521L: linux-i2c@vger.kernel.org
7512S: Maintained 7522S: Maintained
7513F: Documentation/i2c/busses/i2c-parport 7523F: Documentation/i2c/busses/i2c-parport.rst
7514F: Documentation/i2c/busses/i2c-parport-light 7524F: Documentation/i2c/busses/i2c-parport-light.rst
7515F: drivers/i2c/busses/i2c-parport.c 7525F: drivers/i2c/busses/i2c-parport.c
7516F: drivers/i2c/busses/i2c-parport-light.c 7526F: drivers/i2c/busses/i2c-parport-light.c
7517 7527
@@ -7545,7 +7555,7 @@ I2C-TAOS-EVM DRIVER
7545M: Jean Delvare <jdelvare@suse.com> 7555M: Jean Delvare <jdelvare@suse.com>
7546L: linux-i2c@vger.kernel.org 7556L: linux-i2c@vger.kernel.org
7547S: Maintained 7557S: Maintained
7548F: Documentation/i2c/busses/i2c-taos-evm 7558F: Documentation/i2c/busses/i2c-taos-evm.rst
7549F: drivers/i2c/busses/i2c-taos-evm.c 7559F: drivers/i2c/busses/i2c-taos-evm.c
7550 7560
7551I2C-TINY-USB DRIVER 7561I2C-TINY-USB DRIVER
@@ -7559,19 +7569,19 @@ I2C/SMBUS CONTROLLER DRIVERS FOR PC
7559M: Jean Delvare <jdelvare@suse.com> 7569M: Jean Delvare <jdelvare@suse.com>
7560L: linux-i2c@vger.kernel.org 7570L: linux-i2c@vger.kernel.org
7561S: Maintained 7571S: Maintained
7562F: Documentation/i2c/busses/i2c-ali1535 7572F: Documentation/i2c/busses/i2c-ali1535.rst
7563F: Documentation/i2c/busses/i2c-ali1563 7573F: Documentation/i2c/busses/i2c-ali1563.rst
7564F: Documentation/i2c/busses/i2c-ali15x3 7574F: Documentation/i2c/busses/i2c-ali15x3.rst
7565F: Documentation/i2c/busses/i2c-amd756 7575F: Documentation/i2c/busses/i2c-amd756.rst
7566F: Documentation/i2c/busses/i2c-amd8111 7576F: Documentation/i2c/busses/i2c-amd8111.rst
7567F: Documentation/i2c/busses/i2c-i801 7577F: Documentation/i2c/busses/i2c-i801.rst
7568F: Documentation/i2c/busses/i2c-nforce2 7578F: Documentation/i2c/busses/i2c-nforce2.rst
7569F: Documentation/i2c/busses/i2c-piix4 7579F: Documentation/i2c/busses/i2c-piix4.rst
7570F: Documentation/i2c/busses/i2c-sis5595 7580F: Documentation/i2c/busses/i2c-sis5595.rst
7571F: Documentation/i2c/busses/i2c-sis630 7581F: Documentation/i2c/busses/i2c-sis630.rst
7572F: Documentation/i2c/busses/i2c-sis96x 7582F: Documentation/i2c/busses/i2c-sis96x.rst
7573F: Documentation/i2c/busses/i2c-via 7583F: Documentation/i2c/busses/i2c-via.rst
7574F: Documentation/i2c/busses/i2c-viapro 7584F: Documentation/i2c/busses/i2c-viapro.rst
7575F: drivers/i2c/busses/i2c-ali1535.c 7585F: drivers/i2c/busses/i2c-ali1535.c
7576F: drivers/i2c/busses/i2c-ali1563.c 7586F: drivers/i2c/busses/i2c-ali1563.c
7577F: drivers/i2c/busses/i2c-ali15x3.c 7587F: drivers/i2c/busses/i2c-ali15x3.c
@@ -7600,7 +7610,7 @@ M: Seth Heasley <seth.heasley@intel.com>
7600M: Neil Horman <nhorman@tuxdriver.com> 7610M: Neil Horman <nhorman@tuxdriver.com>
7601L: linux-i2c@vger.kernel.org 7611L: linux-i2c@vger.kernel.org
7602F: drivers/i2c/busses/i2c-ismt.c 7612F: drivers/i2c/busses/i2c-ismt.c
7603F: Documentation/i2c/busses/i2c-ismt 7613F: Documentation/i2c/busses/i2c-ismt.rst
7604 7614
7605I2C/SMBUS STUB DRIVER 7615I2C/SMBUS STUB DRIVER
7606M: Jean Delvare <jdelvare@suse.com> 7616M: Jean Delvare <jdelvare@suse.com>
@@ -8350,7 +8360,7 @@ M: linux-wimax@intel.com
8350L: wimax@linuxwimax.org (subscribers-only) 8360L: wimax@linuxwimax.org (subscribers-only)
8351S: Supported 8361S: Supported
8352W: http://linuxwimax.org 8362W: http://linuxwimax.org
8353F: Documentation/wimax/README.i2400m 8363F: Documentation/admin-guide/wimax/i2400m.rst
8354F: drivers/net/wimax/i2400m/ 8364F: drivers/net/wimax/i2400m/
8355F: include/uapi/linux/wimax/i2400m.h 8365F: include/uapi/linux/wimax/i2400m.h
8356 8366
@@ -8635,7 +8645,7 @@ L: jfs-discussion@lists.sourceforge.net
8635W: http://jfs.sourceforge.net/ 8645W: http://jfs.sourceforge.net/
8636T: git git://github.com/kleikamp/linux-shaggy.git 8646T: git git://github.com/kleikamp/linux-shaggy.git
8637S: Maintained 8647S: Maintained
8638F: Documentation/filesystems/jfs.txt 8648F: Documentation/admin-guide/jfs.rst
8639F: fs/jfs/ 8649F: fs/jfs/
8640 8650
8641JME NETWORK DRIVER 8651JME NETWORK DRIVER
@@ -8978,7 +8988,7 @@ F: kernel/kprobes.c
8978KS0108 LCD CONTROLLER DRIVER 8988KS0108 LCD CONTROLLER DRIVER
8979M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> 8989M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
8980S: Maintained 8990S: Maintained
8981F: Documentation/auxdisplay/ks0108 8991F: Documentation/admin-guide/auxdisplay/ks0108.rst
8982F: drivers/auxdisplay/ks0108.c 8992F: drivers/auxdisplay/ks0108.c
8983F: include/linux/ks0108.h 8993F: include/linux/ks0108.h
8984 8994
@@ -9567,7 +9577,7 @@ F: Documentation/networking/mac80211-injection.txt
9567F: include/net/mac80211.h 9577F: include/net/mac80211.h
9568F: net/mac80211/ 9578F: net/mac80211/
9569F: drivers/net/wireless/mac80211_hwsim.[ch] 9579F: drivers/net/wireless/mac80211_hwsim.[ch]
9570F: Documentation/networking/mac80211_hwsim/README 9580F: Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst
9571 9581
9572MAILBOX API 9582MAILBOX API
9573M: Jassi Brar <jassisinghbrar@gmail.com> 9583M: Jassi Brar <jassisinghbrar@gmail.com>
@@ -10344,7 +10354,7 @@ L: linux-i2c@vger.kernel.org
10344S: Supported 10354S: Supported
10345F: drivers/i2c/busses/i2c-mlxcpld.c 10355F: drivers/i2c/busses/i2c-mlxcpld.c
10346F: drivers/i2c/muxes/i2c-mux-mlxcpld.c 10356F: drivers/i2c/muxes/i2c-mux-mlxcpld.c
10347F: Documentation/i2c/busses/i2c-mlxcpld 10357F: Documentation/i2c/busses/i2c-mlxcpld.rst
10348 10358
10349MELLANOX MLXCPLD LED DRIVER 10359MELLANOX MLXCPLD LED DRIVER
10350M: Vadim Pasternak <vadimp@mellanox.com> 10360M: Vadim Pasternak <vadimp@mellanox.com>
@@ -11954,7 +11964,7 @@ M: Andrew Lunn <andrew@lunn.ch>
11954L: linux-i2c@vger.kernel.org 11964L: linux-i2c@vger.kernel.org
11955S: Maintained 11965S: Maintained
11956F: Documentation/devicetree/bindings/i2c/i2c-ocores.txt 11966F: Documentation/devicetree/bindings/i2c/i2c-ocores.txt
11957F: Documentation/i2c/busses/i2c-ocores 11967F: Documentation/i2c/busses/i2c-ocores.rst
11958F: drivers/i2c/busses/i2c-ocores.c 11968F: drivers/i2c/busses/i2c-ocores.c
11959F: include/linux/platform_data/i2c-ocores.h 11969F: include/linux/platform_data/i2c-ocores.h
11960 11970
@@ -12077,7 +12087,7 @@ L: netdev@vger.kernel.org
12077S: Supported 12087S: Supported
12078F: lib/packing.c 12088F: lib/packing.c
12079F: include/linux/packing.h 12089F: include/linux/packing.h
12080F: Documentation/packing.txt 12090F: Documentation/core-api/packing.rst
12081 12091
12082PADATA PARALLEL EXECUTION MECHANISM 12092PADATA PARALLEL EXECUTION MECHANISM
12083M: Steffen Klassert <steffen.klassert@secunet.com> 12093M: Steffen Klassert <steffen.klassert@secunet.com>
@@ -14276,7 +14286,7 @@ F: net/sctp/
14276SCx200 CPU SUPPORT 14286SCx200 CPU SUPPORT
14277M: Jim Cromie <jim.cromie@gmail.com> 14287M: Jim Cromie <jim.cromie@gmail.com>
14278S: Odd Fixes 14288S: Odd Fixes
14279F: Documentation/i2c/busses/scx200_acb 14289F: Documentation/i2c/busses/scx200_acb.rst
14280F: arch/x86/platform/scx200/ 14290F: arch/x86/platform/scx200/
14281F: drivers/watchdog/scx200_wdt.c 14291F: drivers/watchdog/scx200_wdt.c
14282F: drivers/i2c/busses/scx200* 14292F: drivers/i2c/busses/scx200*
@@ -15915,7 +15925,7 @@ M: Viresh Kumar <viresh.kumar@linaro.org>
15915M: Javi Merino <javi.merino@kernel.org> 15925M: Javi Merino <javi.merino@kernel.org>
15916L: linux-pm@vger.kernel.org 15926L: linux-pm@vger.kernel.org
15917S: Supported 15927S: Supported
15918F: Documentation/thermal/cpu-cooling-api.rst 15928F: Documentation/driver-api/thermal/cpu-cooling-api.rst
15919F: drivers/thermal/cpu_cooling.c 15929F: drivers/thermal/cpu_cooling.c
15920F: include/linux/cpu_cooling.h 15930F: include/linux/cpu_cooling.h
15921 15931
@@ -16438,7 +16448,7 @@ F: drivers/hid/hid-udraw-ps3.c
16438UFS FILESYSTEM 16448UFS FILESYSTEM
16439M: Evgeniy Dushistov <dushistov@mail.ru> 16449M: Evgeniy Dushistov <dushistov@mail.ru>
16440S: Maintained 16450S: Maintained
16441F: Documentation/filesystems/ufs.txt 16451F: Documentation/admin-guide/ufs.rst
16442F: fs/ufs/ 16452F: fs/ufs/
16443 16453
16444UHID USERSPACE HID IO DRIVER: 16454UHID USERSPACE HID IO DRIVER:
@@ -17358,7 +17368,7 @@ M: linux-wimax@intel.com
17358L: wimax@linuxwimax.org (subscribers-only) 17368L: wimax@linuxwimax.org (subscribers-only)
17359S: Supported 17369S: Supported
17360W: http://linuxwimax.org 17370W: http://linuxwimax.org
17361F: Documentation/wimax/README.wimax 17371F: Documentation/admin-guide/wimax/wimax.rst
17362F: include/linux/wimax/debug.h 17372F: include/linux/wimax/debug.h
17363F: include/net/wimax.h 17373F: include/net/wimax.h
17364F: include/uapi/linux/wimax.h 17374F: 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
112endif 112endif
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 */
700static const struct iio_sw_device_ops iio_dummy_device_ops = { 700static 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
551config SPI_PXA2XX_PCI 551config 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
11config HYSDN_CAPI 11config 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 {
246extern struct orangefs_stats orangefs_stats; 246extern 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 */
252static inline struct orangefs_inode_s *ORANGEFS_I(struct inode *inode) 252static 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 */
526struct i2c_algorithm { 526struct 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 (?: