summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/obsolete/sysfs-gpio2
-rw-r--r--Documentation/ABI/removed/sysfs-class-rfkill2
-rw-r--r--Documentation/ABI/stable/sysfs-class-rfkill2
-rw-r--r--Documentation/ABI/stable/sysfs-devices-node2
-rw-r--r--Documentation/ABI/testing/procfs-diskstats2
-rw-r--r--Documentation/ABI/testing/sysfs-block2
-rw-r--r--Documentation/ABI/testing/sysfs-block-device2
-rw-r--r--Documentation/ABI/testing/sysfs-class-switchtec2
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu4
-rw-r--r--Documentation/ABI/testing/sysfs-platform-asus-laptop2
-rw-r--r--Documentation/COPYING-logo (renamed from Documentation/logo.txt)0
-rw-r--r--Documentation/DMA-API-HOWTO.txt2
-rw-r--r--Documentation/accounting/cgroupstats.rst (renamed from Documentation/accounting/cgroupstats.txt)14
-rw-r--r--Documentation/accounting/delay-accounting.rst (renamed from Documentation/accounting/delay-accounting.txt)61
-rw-r--r--Documentation/accounting/index.rst14
-rw-r--r--Documentation/accounting/psi.rst (renamed from Documentation/accounting/psi.txt)42
-rw-r--r--Documentation/accounting/taskstats-struct.rst (renamed from Documentation/accounting/taskstats-struct.txt)79
-rw-r--r--Documentation/accounting/taskstats.rst (renamed from Documentation/accounting/taskstats.txt)15
-rw-r--r--Documentation/admin-guide/aoe/aoe.rst (renamed from Documentation/aoe/aoe.rst)4
-rw-r--r--Documentation/admin-guide/aoe/autoload.sh (renamed from Documentation/aoe/autoload.sh)0
-rw-r--r--Documentation/admin-guide/aoe/examples.rst (renamed from Documentation/aoe/examples.rst)0
-rw-r--r--Documentation/admin-guide/aoe/index.rst (renamed from Documentation/aoe/index.rst)2
-rw-r--r--Documentation/admin-guide/aoe/status.sh (renamed from Documentation/aoe/status.sh)0
-rw-r--r--Documentation/admin-guide/aoe/todo.rst (renamed from Documentation/aoe/todo.rst)0
-rw-r--r--Documentation/admin-guide/aoe/udev-install.sh (renamed from Documentation/aoe/udev-install.sh)0
-rw-r--r--Documentation/admin-guide/aoe/udev.txt (renamed from Documentation/aoe/udev.txt)2
-rw-r--r--Documentation/admin-guide/blockdev/drbd/DRBD-8.3-data-packets.svg (renamed from Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg)0
-rw-r--r--Documentation/admin-guide/blockdev/drbd/DRBD-data-packets.svg (renamed from Documentation/blockdev/drbd/DRBD-data-packets.svg)0
-rw-r--r--Documentation/admin-guide/blockdev/drbd/conn-states-8.dot (renamed from Documentation/blockdev/drbd/conn-states-8.dot)0
-rw-r--r--Documentation/admin-guide/blockdev/drbd/data-structure-v9.rst (renamed from Documentation/blockdev/drbd/data-structure-v9.txt)6
-rw-r--r--Documentation/admin-guide/blockdev/drbd/disk-states-8.dot (renamed from Documentation/blockdev/drbd/disk-states-8.dot)0
-rw-r--r--Documentation/admin-guide/blockdev/drbd/drbd-connection-state-overview.dot (renamed from Documentation/blockdev/drbd/drbd-connection-state-overview.dot)0
-rw-r--r--Documentation/admin-guide/blockdev/drbd/figures.rst30
-rw-r--r--Documentation/admin-guide/blockdev/drbd/index.rst (renamed from Documentation/blockdev/drbd/README.txt)15
-rw-r--r--Documentation/admin-guide/blockdev/drbd/node-states-8.dot (renamed from Documentation/blockdev/drbd/node-states-8.dot)1
-rw-r--r--Documentation/admin-guide/blockdev/floppy.rst (renamed from Documentation/blockdev/floppy.txt)88
-rw-r--r--Documentation/admin-guide/blockdev/index.rst16
-rw-r--r--Documentation/admin-guide/blockdev/nbd.rst (renamed from Documentation/blockdev/nbd.txt)2
-rw-r--r--Documentation/admin-guide/blockdev/paride.rst (renamed from Documentation/blockdev/paride.txt)196
-rw-r--r--Documentation/admin-guide/blockdev/ramdisk.rst (renamed from Documentation/blockdev/ramdisk.txt)55
-rw-r--r--Documentation/admin-guide/blockdev/zram.rst (renamed from Documentation/blockdev/zram.txt)197
-rw-r--r--Documentation/admin-guide/btmrvl.rst (renamed from Documentation/btmrvl.txt)0
-rw-r--r--Documentation/admin-guide/bug-hunting.rst4
-rw-r--r--Documentation/admin-guide/cgroup-v1/blkio-controller.rst (renamed from Documentation/cgroup-v1/blkio-controller.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/cgroups.rst (renamed from Documentation/cgroup-v1/cgroups.rst)4
-rw-r--r--Documentation/admin-guide/cgroup-v1/cpuacct.rst (renamed from Documentation/cgroup-v1/cpuacct.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/cpusets.rst (renamed from Documentation/cgroup-v1/cpusets.rst)2
-rw-r--r--Documentation/admin-guide/cgroup-v1/devices.rst (renamed from Documentation/cgroup-v1/devices.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst (renamed from Documentation/cgroup-v1/freezer-subsystem.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/hugetlb.rst (renamed from Documentation/cgroup-v1/hugetlb.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/index.rst (renamed from Documentation/cgroup-v1/index.rst)2
-rw-r--r--Documentation/admin-guide/cgroup-v1/memcg_test.rst (renamed from Documentation/cgroup-v1/memcg_test.rst)4
-rw-r--r--Documentation/admin-guide/cgroup-v1/memory.rst (renamed from Documentation/cgroup-v1/memory.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/net_cls.rst (renamed from Documentation/cgroup-v1/net_cls.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/net_prio.rst (renamed from Documentation/cgroup-v1/net_prio.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/pids.rst (renamed from Documentation/cgroup-v1/pids.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v1/rdma.rst (renamed from Documentation/cgroup-v1/rdma.rst)0
-rw-r--r--Documentation/admin-guide/cgroup-v2.rst8
-rw-r--r--Documentation/admin-guide/clearing-warn-once.rst (renamed from Documentation/clearing-warn-once.txt)0
-rw-r--r--Documentation/admin-guide/cpu-load.rst (renamed from Documentation/cpu-load.txt)0
-rw-r--r--Documentation/admin-guide/cputopology.rst (renamed from Documentation/cputopology.txt)0
-rw-r--r--Documentation/admin-guide/device-mapper/cache-policies.rst (renamed from Documentation/device-mapper/cache-policies.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/cache.rst (renamed from Documentation/device-mapper/cache.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/delay.rst (renamed from Documentation/device-mapper/delay.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-crypt.rst (renamed from Documentation/device-mapper/dm-crypt.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-dust.txt (renamed from Documentation/device-mapper/dm-dust.txt)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-flakey.rst (renamed from Documentation/device-mapper/dm-flakey.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-init.rst (renamed from Documentation/device-mapper/dm-init.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-integrity.rst (renamed from Documentation/device-mapper/dm-integrity.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-io.rst (renamed from Documentation/device-mapper/dm-io.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-log.rst (renamed from Documentation/device-mapper/dm-log.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-queue-length.rst (renamed from Documentation/device-mapper/dm-queue-length.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-raid.rst (renamed from Documentation/device-mapper/dm-raid.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-service-time.rst (renamed from Documentation/device-mapper/dm-service-time.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-uevent.rst (renamed from Documentation/device-mapper/dm-uevent.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/dm-zoned.rst (renamed from Documentation/device-mapper/dm-zoned.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/era.rst (renamed from Documentation/device-mapper/era.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/index.rst (renamed from Documentation/device-mapper/index.rst)2
-rw-r--r--Documentation/admin-guide/device-mapper/kcopyd.rst (renamed from Documentation/device-mapper/kcopyd.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/linear.rst (renamed from Documentation/device-mapper/linear.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/log-writes.rst (renamed from Documentation/device-mapper/log-writes.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/persistent-data.rst (renamed from Documentation/device-mapper/persistent-data.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/snapshot.rst (renamed from Documentation/device-mapper/snapshot.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/statistics.rst (renamed from Documentation/device-mapper/statistics.rst)4
-rw-r--r--Documentation/admin-guide/device-mapper/striped.rst (renamed from Documentation/device-mapper/striped.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/switch.rst (renamed from Documentation/device-mapper/switch.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/thin-provisioning.rst (renamed from Documentation/device-mapper/thin-provisioning.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/unstriped.rst (renamed from Documentation/device-mapper/unstriped.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/verity.rst (renamed from Documentation/device-mapper/verity.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/writecache.rst (renamed from Documentation/device-mapper/writecache.rst)0
-rw-r--r--Documentation/admin-guide/device-mapper/zero.rst (renamed from Documentation/device-mapper/zero.rst)0
-rw-r--r--Documentation/admin-guide/efi-stub.rst (renamed from Documentation/efi-stub.txt)0
-rw-r--r--Documentation/admin-guide/gpio/index.rst (renamed from Documentation/gpio/index.rst)2
-rw-r--r--Documentation/admin-guide/gpio/sysfs.rst (renamed from Documentation/gpio/sysfs.rst)0
-rw-r--r--Documentation/admin-guide/highuid.rst (renamed from Documentation/highuid.txt)0
-rw-r--r--Documentation/admin-guide/hw-vuln/l1tf.rst2
-rw-r--r--Documentation/admin-guide/hw_random.rst (renamed from Documentation/hw_random.txt)0
-rw-r--r--Documentation/admin-guide/index.rst28
-rw-r--r--Documentation/admin-guide/iostats.rst (renamed from Documentation/iostats.txt)0
-rw-r--r--Documentation/admin-guide/kdump/gdbmacros.txt (renamed from Documentation/kdump/gdbmacros.txt)0
-rw-r--r--Documentation/admin-guide/kdump/index.rst (renamed from Documentation/kdump/index.rst)1
-rw-r--r--Documentation/admin-guide/kdump/kdump.rst (renamed from Documentation/kdump/kdump.rst)0
-rw-r--r--Documentation/admin-guide/kdump/vmcoreinfo.rst (renamed from Documentation/kdump/vmcoreinfo.rst)0
-rw-r--r--Documentation/admin-guide/kernel-parameters.rst2
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt44
-rw-r--r--Documentation/admin-guide/kernel-per-CPU-kthreads.rst (renamed from Documentation/kernel-per-CPU-kthreads.txt)2
-rw-r--r--Documentation/admin-guide/laptops/asus-laptop.rst (renamed from Documentation/laptops/asus-laptop.txt)92
-rw-r--r--Documentation/admin-guide/laptops/disk-shock-protection.rst (renamed from Documentation/laptops/disk-shock-protection.txt)32
-rw-r--r--Documentation/admin-guide/laptops/index.rst17
-rw-r--r--Documentation/admin-guide/laptops/laptop-mode.rst (renamed from Documentation/laptops/laptop-mode.txt)579
-rw-r--r--Documentation/admin-guide/laptops/lg-laptop.rst (renamed from Documentation/laptops/lg-laptop.rst)1
-rw-r--r--Documentation/admin-guide/laptops/sony-laptop.rst (renamed from Documentation/laptops/sony-laptop.txt)58
-rw-r--r--Documentation/admin-guide/laptops/sonypi.rst (renamed from Documentation/laptops/sonypi.txt)50
-rw-r--r--Documentation/admin-guide/laptops/thinkpad-acpi.rst (renamed from Documentation/laptops/thinkpad-acpi.txt)369
-rw-r--r--Documentation/admin-guide/laptops/toshiba_haps.rst (renamed from Documentation/laptops/toshiba_haps.txt)49
-rw-r--r--Documentation/admin-guide/lcd-panel-cgram.rst (renamed from Documentation/auxdisplay/lcd-panel-cgram.txt)7
-rw-r--r--Documentation/admin-guide/ldm.rst (renamed from Documentation/ldm.txt)0
-rw-r--r--Documentation/admin-guide/lockup-watchdogs.rst (renamed from Documentation/lockup-watchdogs.txt)0
-rw-r--r--Documentation/admin-guide/mm/cma_debugfs.rst (renamed from Documentation/cma/debugfs.txt)6
-rw-r--r--Documentation/admin-guide/mm/index.rst3
-rw-r--r--Documentation/admin-guide/mm/ksm.rst2
-rw-r--r--Documentation/admin-guide/mm/numa_memory_policy.rst2
-rw-r--r--Documentation/admin-guide/namespaces/compatibility-list.rst (renamed from Documentation/namespaces/compatibility-list.txt)10
-rw-r--r--Documentation/admin-guide/namespaces/index.rst11
-rw-r--r--Documentation/admin-guide/namespaces/resource-control.rst (renamed from Documentation/namespaces/resource-control.txt)4
-rw-r--r--Documentation/admin-guide/numastat.rst (renamed from Documentation/numastat.txt)0
-rw-r--r--Documentation/admin-guide/perf/arm-ccn.rst (renamed from Documentation/perf/arm-ccn.txt)18
-rw-r--r--Documentation/admin-guide/perf/arm_dsu_pmu.rst (renamed from Documentation/perf/arm_dsu_pmu.txt)5
-rw-r--r--Documentation/admin-guide/perf/hisi-pmu.rst (renamed from Documentation/perf/hisi-pmu.txt)37
-rw-r--r--Documentation/admin-guide/perf/index.rst16
-rw-r--r--Documentation/admin-guide/perf/qcom_l2_pmu.rst (renamed from Documentation/perf/qcom_l2_pmu.txt)3
-rw-r--r--Documentation/admin-guide/perf/qcom_l3_pmu.rst (renamed from Documentation/perf/qcom_l3_pmu.txt)3
-rw-r--r--Documentation/admin-guide/perf/thunderx2-pmu.rst (renamed from Documentation/perf/thunderx2-pmu.txt)25
-rw-r--r--Documentation/admin-guide/perf/xgene-pmu.rst (renamed from Documentation/perf/xgene-pmu.txt)3
-rw-r--r--Documentation/admin-guide/pnp.rst (renamed from Documentation/pnp.txt)0
-rw-r--r--Documentation/admin-guide/rapidio.rst (renamed from Documentation/driver-api/rapidio.rst)0
-rw-r--r--Documentation/admin-guide/rtc.rst (renamed from Documentation/rtc.txt)0
-rw-r--r--Documentation/admin-guide/svga.rst (renamed from Documentation/svga.txt)0
-rw-r--r--Documentation/admin-guide/sysctl/abi.rst67
-rw-r--r--Documentation/admin-guide/sysctl/fs.rst (renamed from Documentation/sysctl/fs.txt)146
-rw-r--r--Documentation/admin-guide/sysctl/index.rst (renamed from Documentation/sysctl/README)34
-rw-r--r--Documentation/admin-guide/sysctl/kernel.rst (renamed from Documentation/sysctl/kernel.txt)374
-rw-r--r--Documentation/admin-guide/sysctl/net.rst (renamed from Documentation/sysctl/net.txt)141
-rw-r--r--Documentation/admin-guide/sysctl/sunrpc.rst (renamed from Documentation/sysctl/sunrpc.txt)13
-rw-r--r--Documentation/admin-guide/sysctl/user.rst (renamed from Documentation/sysctl/user.txt)32
-rw-r--r--Documentation/admin-guide/sysctl/vm.rst (renamed from Documentation/sysctl/vm.txt)264
-rw-r--r--Documentation/admin-guide/video-output.rst (renamed from Documentation/video-output.txt)0
-rw-r--r--Documentation/arm/Marvell/README395
-rw-r--r--Documentation/arm/Netwinder78
-rw-r--r--Documentation/arm/SA1100/FreeBird21
-rw-r--r--Documentation/arm/SA1100/empeg2
-rw-r--r--Documentation/arm/SA1100/serial_UART47
-rw-r--r--Documentation/arm/arm.rst (renamed from Documentation/arm/README)50
-rw-r--r--Documentation/arm/booting.rst (renamed from Documentation/arm/Booting)71
-rw-r--r--Documentation/arm/cluster-pm-race-avoidance.rst (renamed from Documentation/arm/cluster-pm-race-avoidance.txt)177
-rw-r--r--Documentation/arm/firmware.rst (renamed from Documentation/arm/firmware.txt)14
-rw-r--r--Documentation/arm/index.rst80
-rw-r--r--Documentation/arm/interrupts.rst (renamed from Documentation/arm/Interrupts)90
-rw-r--r--Documentation/arm/ixp4xx.rst (renamed from Documentation/arm/IXP4xx)61
-rw-r--r--Documentation/arm/kernel_mode_neon.rst (renamed from Documentation/arm/kernel_mode_neon.txt)3
-rw-r--r--Documentation/arm/kernel_user_helpers.rst (renamed from Documentation/arm/kernel_user_helpers.txt)79
-rw-r--r--Documentation/arm/keystone/knav-qmss.rst (renamed from Documentation/arm/keystone/knav-qmss.txt)6
-rw-r--r--Documentation/arm/keystone/overview.rst (renamed from Documentation/arm/keystone/Overview.txt)47
-rw-r--r--Documentation/arm/marvel.rst488
-rw-r--r--Documentation/arm/mem_alignment.rst (renamed from Documentation/arm/mem_alignment)11
-rw-r--r--Documentation/arm/memory.rst (renamed from Documentation/arm/memory.txt)9
-rw-r--r--Documentation/arm/microchip.rst (renamed from Documentation/arm/Microchip/README)63
-rw-r--r--Documentation/arm/netwinder.rst85
-rw-r--r--Documentation/arm/nwfpe/index.rst13
-rw-r--r--Documentation/arm/nwfpe/netwinder-fpe.rst (renamed from Documentation/arm/nwfpe/README.FPE)24
-rw-r--r--Documentation/arm/nwfpe/notes.rst (renamed from Documentation/arm/nwfpe/NOTES)3
-rw-r--r--Documentation/arm/nwfpe/nwfpe.rst (renamed from Documentation/arm/nwfpe/README)10
-rw-r--r--Documentation/arm/nwfpe/todo.rst (renamed from Documentation/arm/nwfpe/TODO)47
-rw-r--r--Documentation/arm/omap/dss.rst (renamed from Documentation/arm/OMAP/DSS)102
-rw-r--r--Documentation/arm/omap/index.rst12
-rw-r--r--Documentation/arm/omap/omap.rst (renamed from Documentation/arm/OMAP/README)7
-rw-r--r--Documentation/arm/omap/omap_pm.rst (renamed from Documentation/arm/OMAP/omap_pm)55
-rw-r--r--Documentation/arm/porting.rst (renamed from Documentation/arm/Porting)14
-rw-r--r--Documentation/arm/pxa/mfp.rst (renamed from Documentation/arm/pxa/mfp.txt)110
-rw-r--r--Documentation/arm/sa1100/adsbitsy.rst (renamed from Documentation/arm/SA1100/ADSBitsy)14
-rw-r--r--Documentation/arm/sa1100/assabet.rst (renamed from Documentation/arm/SA1100/Assabet)193
-rw-r--r--Documentation/arm/sa1100/brutus.rst (renamed from Documentation/arm/SA1100/Brutus)49
-rw-r--r--Documentation/arm/sa1100/cerf.rst (renamed from Documentation/arm/SA1100/CERF)10
-rw-r--r--Documentation/arm/sa1100/freebird.rst25
-rw-r--r--Documentation/arm/sa1100/graphicsclient.rst (renamed from Documentation/arm/SA1100/GraphicsClient)48
-rw-r--r--Documentation/arm/sa1100/graphicsmaster.rst (renamed from Documentation/arm/SA1100/GraphicsMaster)13
-rw-r--r--Documentation/arm/sa1100/huw_webpanel.rst (renamed from Documentation/arm/SA1100/HUW_WEBPANEL)8
-rw-r--r--Documentation/arm/sa1100/index.rst25
-rw-r--r--Documentation/arm/sa1100/itsy.rst (renamed from Documentation/arm/SA1100/Itsy)14
-rw-r--r--Documentation/arm/sa1100/lart.rst (renamed from Documentation/arm/SA1100/LART)3
-rw-r--r--Documentation/arm/sa1100/nanoengine.rst (renamed from Documentation/arm/SA1100/nanoEngine)6
-rw-r--r--Documentation/arm/sa1100/pangolin.rst (renamed from Documentation/arm/SA1100/Pangolin)10
-rw-r--r--Documentation/arm/sa1100/pleb.rst (renamed from Documentation/arm/SA1100/PLEB)6
-rw-r--r--Documentation/arm/sa1100/serial_uart.rst51
-rw-r--r--Documentation/arm/sa1100/tifon.rst (renamed from Documentation/arm/SA1100/Tifon)4
-rw-r--r--Documentation/arm/sa1100/yopy.rst (renamed from Documentation/arm/SA1100/Yopy)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/cpufreq.rst (renamed from Documentation/arm/Samsung-S3C24XX/CPUfreq.txt)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/eb2410itx.rst (renamed from Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/gpio.rst (renamed from Documentation/arm/Samsung-S3C24XX/GPIO.txt)23
-rw-r--r--Documentation/arm/samsung-s3c24xx/h1940.rst (renamed from Documentation/arm/Samsung-S3C24XX/H1940.txt)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/index.rst20
-rw-r--r--Documentation/arm/samsung-s3c24xx/nand.rst (renamed from Documentation/arm/Samsung-S3C24XX/NAND.txt)6
-rw-r--r--Documentation/arm/samsung-s3c24xx/overview.rst (renamed from Documentation/arm/Samsung-S3C24XX/Overview.txt)21
-rw-r--r--Documentation/arm/samsung-s3c24xx/s3c2412.rst (renamed from Documentation/arm/Samsung-S3C24XX/S3C2412.txt)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/s3c2413.rst (renamed from Documentation/arm/Samsung-S3C24XX/S3C2413.txt)7
-rw-r--r--Documentation/arm/samsung-s3c24xx/smdk2440.rst (renamed from Documentation/arm/Samsung-S3C24XX/SMDK2440.txt)5
-rw-r--r--Documentation/arm/samsung-s3c24xx/suspend.rst (renamed from Documentation/arm/Samsung-S3C24XX/Suspend.txt)20
-rw-r--r--Documentation/arm/samsung-s3c24xx/usb-host.rst (renamed from Documentation/arm/Samsung-S3C24XX/USB-Host.txt)16
-rw-r--r--Documentation/arm/samsung/bootloader-interface.rst (renamed from Documentation/arm/Samsung/Bootloader-interface.txt)27
-rwxr-xr-xDocumentation/arm/samsung/clksrc-change-registers.awk (renamed from Documentation/arm/Samsung/clksrc-change-registers.awk)0
-rw-r--r--Documentation/arm/samsung/gpio.rst (renamed from Documentation/arm/Samsung/GPIO.txt)7
-rw-r--r--Documentation/arm/samsung/index.rst12
-rw-r--r--Documentation/arm/samsung/overview.rst (renamed from Documentation/arm/Samsung/Overview.txt)15
-rw-r--r--Documentation/arm/setup.rst (renamed from Documentation/arm/Setup)49
-rw-r--r--Documentation/arm/sh-mobile/.gitignore (renamed from Documentation/arm/SH-Mobile/.gitignore)0
-rw-r--r--Documentation/arm/spear/overview.rst (renamed from Documentation/arm/SPEAr/overview.txt)21
-rw-r--r--Documentation/arm/sti/overview.rst (renamed from Documentation/arm/sti/overview.txt)21
-rw-r--r--Documentation/arm/sti/stih407-overview.rst (renamed from Documentation/arm/sti/stih407-overview.txt)9
-rw-r--r--Documentation/arm/sti/stih415-overview.rst (renamed from Documentation/arm/sti/stih415-overview.txt)8
-rw-r--r--Documentation/arm/sti/stih416-overview.rst (renamed from Documentation/arm/sti/stih416-overview.txt)5
-rw-r--r--Documentation/arm/sti/stih418-overview.rst (renamed from Documentation/arm/sti/stih418-overview.txt)9
-rw-r--r--Documentation/arm/stm32/overview.rst2
-rw-r--r--Documentation/arm/stm32/stm32f429-overview.rst7
-rw-r--r--Documentation/arm/stm32/stm32f746-overview.rst7
-rw-r--r--Documentation/arm/stm32/stm32f769-overview.rst7
-rw-r--r--Documentation/arm/stm32/stm32h743-overview.rst7
-rw-r--r--Documentation/arm/stm32/stm32mp157-overview.rst3
-rw-r--r--Documentation/arm/sunxi.rst (renamed from Documentation/arm/sunxi/README)98
-rw-r--r--Documentation/arm/sunxi/clocks.rst (renamed from Documentation/arm/sunxi/clocks.txt)7
-rw-r--r--Documentation/arm/swp_emulation.rst (renamed from Documentation/arm/swp_emulation)24
-rw-r--r--Documentation/arm/tcm.rst (renamed from Documentation/arm/tcm.txt)54
-rw-r--r--Documentation/arm/uefi.rst (renamed from Documentation/arm/uefi.txt)39
-rw-r--r--Documentation/arm/vfp/release-notes.rst (renamed from Documentation/arm/VFP/release-notes.txt)4
-rw-r--r--Documentation/arm/vlocks.rst (renamed from Documentation/arm/vlocks.txt)9
-rw-r--r--Documentation/arm64/index.rst2
-rw-r--r--Documentation/backlight/lp855x-driver.txt66
-rw-r--r--Documentation/block/bfq-iosched.rst (renamed from Documentation/block/bfq-iosched.txt)68
-rw-r--r--Documentation/block/biodoc.rst (renamed from Documentation/block/biodoc.txt)335
-rw-r--r--Documentation/block/biovecs.rst (renamed from Documentation/block/biovecs.txt)20
-rw-r--r--Documentation/block/capability.rst18
-rw-r--r--Documentation/block/capability.txt15
-rw-r--r--Documentation/block/cmdline-partition.rst (renamed from Documentation/block/cmdline-partition.txt)13
-rw-r--r--Documentation/block/data-integrity.rst (renamed from Documentation/block/data-integrity.txt)60
-rw-r--r--Documentation/block/deadline-iosched.rst (renamed from Documentation/block/deadline-iosched.txt)21
-rw-r--r--Documentation/block/index.rst25
-rw-r--r--Documentation/block/ioprio.rst (renamed from Documentation/block/ioprio.txt)103
-rw-r--r--Documentation/block/kyber-iosched.rst (renamed from Documentation/block/kyber-iosched.txt)3
-rw-r--r--Documentation/block/null_blk.rst (renamed from Documentation/block/null_blk.txt)65
-rw-r--r--Documentation/block/pr.rst (renamed from Documentation/block/pr.txt)18
-rw-r--r--Documentation/block/queue-sysfs.rst (renamed from Documentation/block/queue-sysfs.txt)7
-rw-r--r--Documentation/block/request.rst (renamed from Documentation/block/request.txt)47
-rw-r--r--Documentation/block/stat.rst (renamed from Documentation/block/stat.txt)13
-rw-r--r--Documentation/block/switching-sched.rst (renamed from Documentation/block/switching-sched.txt)28
-rw-r--r--Documentation/block/writeback_cache_control.rst (renamed from Documentation/block/writeback_cache_control.txt)12
-rw-r--r--Documentation/cdrom/index.rst2
-rw-r--r--Documentation/core-api/gcc-plugins.rst (renamed from Documentation/gcc-plugins.txt)0
-rw-r--r--Documentation/core-api/index.rst1
-rw-r--r--Documentation/core-api/printk-formats.rst2
-rw-r--r--Documentation/devicetree/bindings/arm/xen.txt2
-rw-r--r--Documentation/devicetree/bindings/phy/phy-bindings.txt2
-rw-r--r--Documentation/devicetree/bindings/phy/phy-pxa-usb.txt2
-rw-r--r--Documentation/devicetree/booting-without-of.txt4
-rw-r--r--Documentation/driver-api/backlight/lp855x-driver.rst81
-rw-r--r--Documentation/driver-api/bt8xxgpio.rst (renamed from Documentation/bt8xxgpio.txt)0
-rw-r--r--Documentation/driver-api/connector.rst (renamed from Documentation/connector/connector.txt)130
-rw-r--r--Documentation/driver-api/console.rst (renamed from Documentation/console/console.txt)63
-rw-r--r--Documentation/driver-api/dcdbas.rst (renamed from Documentation/dcdbas.txt)0
-rw-r--r--Documentation/driver-api/dell_rbu.rst (renamed from Documentation/dell_rbu.txt)0
-rw-r--r--Documentation/driver-api/driver-model/binding.rst (renamed from Documentation/driver-model/binding.rst)0
-rw-r--r--Documentation/driver-api/driver-model/bus.rst (renamed from Documentation/driver-model/bus.rst)0
-rw-r--r--Documentation/driver-api/driver-model/class.rst (renamed from Documentation/driver-model/class.rst)0
-rw-r--r--Documentation/driver-api/driver-model/design-patterns.rst (renamed from Documentation/driver-model/design-patterns.rst)0
-rw-r--r--Documentation/driver-api/driver-model/device.rst (renamed from Documentation/driver-model/device.rst)0
-rw-r--r--Documentation/driver-api/driver-model/devres.rst (renamed from Documentation/driver-model/devres.rst)0
-rw-r--r--Documentation/driver-api/driver-model/driver.rst (renamed from Documentation/driver-model/driver.rst)0
-rw-r--r--Documentation/driver-api/driver-model/index.rst (renamed from Documentation/driver-model/index.rst)2
-rw-r--r--Documentation/driver-api/driver-model/overview.rst (renamed from Documentation/driver-model/overview.rst)0
-rw-r--r--Documentation/driver-api/driver-model/platform.rst (renamed from Documentation/driver-model/platform.rst)0
-rw-r--r--Documentation/driver-api/driver-model/porting.rst (renamed from Documentation/driver-model/porting.rst)2
-rw-r--r--Documentation/driver-api/early-userspace/buffer-format.rst (renamed from Documentation/early-userspace/buffer-format.txt)19
-rw-r--r--Documentation/driver-api/early-userspace/early_userspace_support.rst (renamed from Documentation/early-userspace/README)3
-rw-r--r--Documentation/driver-api/early-userspace/index.rst18
-rw-r--r--Documentation/driver-api/edid.rst (renamed from Documentation/EDID/howto.rst)2
-rw-r--r--Documentation/driver-api/eisa.rst (renamed from Documentation/eisa.txt)4
-rw-r--r--Documentation/driver-api/gpio/driver.rst2
-rw-r--r--Documentation/driver-api/index.rst43
-rw-r--r--Documentation/driver-api/interconnect.rst (renamed from Documentation/interconnect/interconnect.rst)2
-rw-r--r--Documentation/driver-api/isa.rst (renamed from Documentation/isa.txt)0
-rw-r--r--Documentation/driver-api/isapnp.rst (renamed from Documentation/isapnp.txt)0
-rw-r--r--Documentation/driver-api/lightnvm-pblk.rst (renamed from Documentation/lightnvm/pblk.txt)0
-rw-r--r--Documentation/driver-api/md/index.rst12
-rw-r--r--Documentation/driver-api/md/md-cluster.rst (renamed from Documentation/md/md-cluster.txt)184
-rw-r--r--Documentation/driver-api/md/raid5-cache.rst (renamed from Documentation/md/raid5-cache.txt)28
-rw-r--r--Documentation/driver-api/md/raid5-ppl.rst (renamed from Documentation/md/raid5-ppl.txt)2
-rw-r--r--Documentation/driver-api/memory-devices/index.rst18
-rw-r--r--Documentation/driver-api/memory-devices/ti-emif.rst (renamed from Documentation/memory-devices/ti-emif.txt)27
-rw-r--r--Documentation/driver-api/memory-devices/ti-gpmc.rst (renamed from Documentation/bus-devices/ti-gpmc.txt)163
-rw-r--r--Documentation/driver-api/men-chameleon-bus.rst (renamed from Documentation/men-chameleon-bus.txt)0
-rw-r--r--Documentation/driver-api/mmc/index.rst13
-rw-r--r--Documentation/driver-api/mmc/mmc-async-req.rst (renamed from Documentation/mmc/mmc-async-req.txt)59
-rw-r--r--Documentation/driver-api/mmc/mmc-dev-attrs.rst (renamed from Documentation/mmc/mmc-dev-attrs.txt)32
-rw-r--r--Documentation/driver-api/mmc/mmc-dev-parts.rst (renamed from Documentation/mmc/mmc-dev-parts.txt)13
-rw-r--r--Documentation/driver-api/mmc/mmc-tools.rst (renamed from Documentation/mmc/mmc-tools.txt)5
-rw-r--r--Documentation/driver-api/mtd/index.rst12
-rw-r--r--Documentation/driver-api/mtd/intel-spi.rst (renamed from Documentation/mtd/intel-spi.txt)46
-rw-r--r--Documentation/driver-api/mtd/nand_ecc.rst (renamed from Documentation/mtd/nand_ecc.txt)497
-rw-r--r--Documentation/driver-api/mtd/spi-nor.rst (renamed from Documentation/mtd/spi-nor.txt)7
-rw-r--r--Documentation/driver-api/nfc/index.rst11
-rw-r--r--Documentation/driver-api/nfc/nfc-hci.rst (renamed from Documentation/nfc/nfc-hci.txt)167
-rw-r--r--Documentation/driver-api/nfc/nfc-pn544.rst (renamed from Documentation/nfc/nfc-pn544.txt)6
-rw-r--r--Documentation/driver-api/ntb.rst (renamed from Documentation/ntb.txt)0
-rw-r--r--Documentation/driver-api/nvdimm/btt.rst (renamed from Documentation/nvdimm/btt.txt)144
-rw-r--r--Documentation/driver-api/nvdimm/index.rst12
-rw-r--r--Documentation/driver-api/nvdimm/nvdimm.rst (renamed from Documentation/nvdimm/nvdimm.txt)526
-rw-r--r--Documentation/driver-api/nvdimm/security.rst (renamed from Documentation/nvdimm/security.txt)4
-rw-r--r--Documentation/driver-api/nvmem.rst (renamed from Documentation/nvmem/nvmem.txt)112
-rw-r--r--Documentation/driver-api/parport-lowlevel.rst (renamed from Documentation/parport-lowlevel.txt)0
-rw-r--r--Documentation/driver-api/phy/index.rst18
-rw-r--r--Documentation/driver-api/phy/phy.rst (renamed from Documentation/phy.txt)0
-rw-r--r--Documentation/driver-api/phy/samsung-usb2.rst (renamed from Documentation/phy/samsung-usb2.txt)60
-rw-r--r--Documentation/driver-api/pps.rst2
-rw-r--r--Documentation/driver-api/pti_intel_mid.rst106
-rw-r--r--Documentation/driver-api/ptp.rst2
-rw-r--r--Documentation/driver-api/pwm.rst (renamed from Documentation/pwm.txt)0
-rw-r--r--Documentation/driver-api/rapidio/index.rst15
-rw-r--r--Documentation/driver-api/rapidio/mport_cdev.rst (renamed from Documentation/rapidio/mport_cdev.txt)47
-rw-r--r--Documentation/driver-api/rapidio/rapidio.rst (renamed from Documentation/rapidio/rapidio.txt)39
-rw-r--r--Documentation/driver-api/rapidio/rio_cm.rst (renamed from Documentation/rapidio/rio_cm.txt)66
-rw-r--r--Documentation/driver-api/rapidio/sysfs.rst (renamed from Documentation/rapidio/sysfs.txt)4
-rw-r--r--Documentation/driver-api/rapidio/tsi721.rst (renamed from Documentation/rapidio/tsi721.txt)45
-rw-r--r--Documentation/driver-api/rfkill.rst (renamed from Documentation/rfkill.txt)0
-rw-r--r--Documentation/driver-api/serial/cyclades_z.rst (renamed from Documentation/serial/cyclades_z.rst)0
-rw-r--r--Documentation/driver-api/serial/driver.rst (renamed from Documentation/serial/driver.rst)2
-rw-r--r--Documentation/driver-api/serial/index.rst (renamed from Documentation/serial/index.rst)2
-rw-r--r--Documentation/driver-api/serial/moxa-smartio.rst (renamed from Documentation/serial/moxa-smartio.rst)0
-rw-r--r--Documentation/driver-api/serial/n_gsm.rst (renamed from Documentation/serial/n_gsm.rst)0
-rw-r--r--Documentation/driver-api/serial/rocket.rst (renamed from Documentation/serial/rocket.rst)0
-rw-r--r--Documentation/driver-api/serial/serial-iso7816.rst (renamed from Documentation/serial/serial-iso7816.rst)0
-rw-r--r--Documentation/driver-api/serial/serial-rs485.rst (renamed from Documentation/serial/serial-rs485.rst)0
-rw-r--r--Documentation/driver-api/serial/tty.rst (renamed from Documentation/serial/tty.rst)0
-rw-r--r--Documentation/driver-api/sgi-ioc4.rst (renamed from Documentation/sgi-ioc4.txt)0
-rw-r--r--Documentation/driver-api/sm501.rst (renamed from Documentation/SM501.txt)0
-rw-r--r--Documentation/driver-api/smsc_ece1099.rst (renamed from Documentation/smsc_ece1099.txt)0
-rw-r--r--Documentation/driver-api/switchtec.rst (renamed from Documentation/switchtec.txt)2
-rw-r--r--Documentation/driver-api/sync_file.rst (renamed from Documentation/sync_file.txt)0
-rw-r--r--Documentation/driver-api/vfio-mediated-device.rst (renamed from Documentation/vfio-mediated-device.txt)2
-rw-r--r--Documentation/driver-api/vfio.rst (renamed from Documentation/vfio.txt)0
-rw-r--r--Documentation/driver-api/xilinx/eemi.rst (renamed from Documentation/xilinx/eemi.rst)0
-rw-r--r--Documentation/driver-api/xilinx/index.rst (renamed from Documentation/xilinx/index.rst)1
-rw-r--r--Documentation/driver-api/xillybus.rst (renamed from Documentation/xillybus.txt)0
-rw-r--r--Documentation/driver-api/zorro.rst (renamed from Documentation/zorro.txt)0
-rw-r--r--Documentation/fault-injection/index.rst2
-rw-r--r--Documentation/fb/fbcon.rst4
-rw-r--r--Documentation/fb/index.rst2
-rw-r--r--Documentation/fb/vesafb.rst2
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt2
-rw-r--r--Documentation/filesystems/proc.txt2
-rw-r--r--Documentation/filesystems/ramfs-rootfs-initramfs.txt4
-rw-r--r--Documentation/filesystems/sysfs.txt2
-rw-r--r--Documentation/filesystems/tmpfs.txt2
-rw-r--r--Documentation/firmware-guide/acpi/enumeration.rst2
-rw-r--r--Documentation/fpga/index.rst2
-rw-r--r--Documentation/hid/index.rst2
-rw-r--r--Documentation/hwmon/submitting-patches.rst2
-rw-r--r--Documentation/ia64/aliasing.rst (renamed from Documentation/ia64/aliasing.txt)73
-rw-r--r--Documentation/ia64/efirtc.rst (renamed from Documentation/ia64/efirtc.txt)120
-rw-r--r--Documentation/ia64/err_inject.rst (renamed from Documentation/ia64/err_inject.txt)359
-rw-r--r--Documentation/ia64/fsys.rst (renamed from Documentation/ia64/fsys.txt)133
-rw-r--r--Documentation/ia64/ia64.rst (renamed from Documentation/ia64/README)26
-rw-r--r--Documentation/ia64/index.rst18
-rw-r--r--Documentation/ia64/irq-redir.rst (renamed from Documentation/ia64/IRQ-redir.txt)31
-rw-r--r--Documentation/ia64/mca.rst (renamed from Documentation/ia64/mca.txt)10
-rw-r--r--Documentation/ia64/serial.rst (renamed from Documentation/ia64/serial.txt)36
-rw-r--r--Documentation/ia64/xen.rst206
-rw-r--r--Documentation/ia64/xen.txt183
-rw-r--r--Documentation/ide/index.rst2
-rw-r--r--Documentation/iio/index.rst2
-rw-r--r--Documentation/index.rst32
-rw-r--r--Documentation/ioctl/botching-up-ioctls.rst (renamed from Documentation/ioctl/botching-up-ioctls.txt)1
-rw-r--r--Documentation/ioctl/cdrom.rst1233
-rw-r--r--Documentation/ioctl/cdrom.txt967
-rw-r--r--Documentation/ioctl/hdio.rst (renamed from Documentation/ioctl/hdio.txt)835
-rw-r--r--Documentation/ioctl/index.rst16
-rw-r--r--Documentation/ioctl/ioctl-decoding.rst (renamed from Documentation/ioctl/ioctl-decoding.txt)13
-rw-r--r--Documentation/ioctl/ioctl-number.rst361
-rw-r--r--Documentation/ioctl/ioctl-number.txt351
-rw-r--r--Documentation/kbuild/index.rst2
-rw-r--r--Documentation/kbuild/issues.rst20
-rw-r--r--Documentation/kbuild/kbuild.rst3
-rw-r--r--Documentation/kbuild/kconfig-language.rst12
-rw-r--r--Documentation/kbuild/kconfig.rst8
-rw-r--r--Documentation/kbuild/makefiles.rst1
-rw-r--r--Documentation/kernel-hacking/locking.rst2
-rw-r--r--Documentation/leds/index.rst2
-rw-r--r--Documentation/livepatch/index.rst2
-rw-r--r--Documentation/locking/index.rst24
-rw-r--r--Documentation/locking/lockdep-design.rst (renamed from Documentation/locking/lockdep-design.txt)51
-rw-r--r--Documentation/locking/lockstat.rst204
-rw-r--r--Documentation/locking/lockstat.txt183
-rw-r--r--Documentation/locking/locktorture.rst (renamed from Documentation/locking/locktorture.txt)105
-rw-r--r--Documentation/locking/mutex-design.rst (renamed from Documentation/locking/mutex-design.txt)26
-rw-r--r--Documentation/locking/rt-mutex-design.rst (renamed from Documentation/locking/rt-mutex-design.txt)139
-rw-r--r--Documentation/locking/rt-mutex.rst (renamed from Documentation/locking/rt-mutex.txt)30
-rw-r--r--Documentation/locking/spinlocks.rst (renamed from Documentation/locking/spinlocks.txt)32
-rw-r--r--Documentation/locking/ww-mutex-design.rst (renamed from Documentation/locking/ww-mutex-design.txt)82
-rw-r--r--Documentation/m68k/index.rst17
-rw-r--r--Documentation/m68k/kernel-options.rst (renamed from Documentation/m68k/kernel-options.txt)319
-rw-r--r--Documentation/mic/index.rst2
-rw-r--r--Documentation/netlabel/index.rst2
-rw-r--r--Documentation/networking/ip-sysctl.txt2
-rw-r--r--Documentation/pcmcia/index.rst2
-rw-r--r--Documentation/pi-futex.txt2
-rw-r--r--Documentation/powerpc/firmware-assisted-dump.txt2
-rw-r--r--Documentation/process/submit-checklist.rst2
-rw-r--r--Documentation/pti/pti_intel_mid.txt99
-rw-r--r--Documentation/rbtree.txt6
-rw-r--r--Documentation/riscv/index.rst2
-rw-r--r--Documentation/s390/debugging390.rst2
-rw-r--r--Documentation/s390/index.rst2
-rw-r--r--Documentation/s390/vfio-ccw.rst6
-rw-r--r--Documentation/scheduler/index.rst2
-rw-r--r--Documentation/scheduler/sched-deadline.rst2
-rw-r--r--Documentation/scheduler/sched-design-CFS.rst2
-rw-r--r--Documentation/scheduler/sched-rt-group.rst2
-rw-r--r--Documentation/security/index.rst5
-rw-r--r--Documentation/security/lsm-development.rst (renamed from Documentation/security/LSM.rst)0
-rw-r--r--Documentation/security/lsm.rst (renamed from Documentation/lsm.txt)0
-rw-r--r--Documentation/security/sak.rst (renamed from Documentation/SAK.txt)0
-rw-r--r--Documentation/security/siphash.rst (renamed from Documentation/siphash.txt)0
-rw-r--r--Documentation/security/tpm/index.rst1
-rw-r--r--Documentation/security/tpm/xen-tpmfront.rst (renamed from Documentation/security/tpm/xen-tpmfront.txt)105
-rw-r--r--Documentation/sparc/index.rst2
-rw-r--r--Documentation/sysctl/abi.txt54
-rw-r--r--Documentation/target/index.rst2
-rw-r--r--Documentation/timers/index.rst2
-rw-r--r--Documentation/translations/it_IT/kernel-hacking/locking.rst2
-rw-r--r--Documentation/translations/it_IT/process/submit-checklist.rst2
-rw-r--r--Documentation/translations/zh_CN/arm/Booting4
-rw-r--r--Documentation/translations/zh_CN/arm/kernel_user_helpers.txt4
-rw-r--r--Documentation/translations/zh_CN/filesystems/sysfs.txt2
-rw-r--r--Documentation/translations/zh_CN/gpio.txt4
-rw-r--r--Documentation/translations/zh_CN/oops-tracing.txt4
-rw-r--r--Documentation/translations/zh_CN/process/submit-checklist.rst2
-rw-r--r--Documentation/userspace-api/accelerators/ocxl.rst (renamed from Documentation/accelerators/ocxl.rst)2
-rw-r--r--Documentation/userspace-api/index.rst1
-rw-r--r--Documentation/vm/numa.rst4
-rw-r--r--Documentation/vm/page_migration.rst2
-rw-r--r--Documentation/vm/unevictable-lru.rst4
-rw-r--r--Documentation/w1/w1.netlink2
-rw-r--r--Documentation/watchdog/index.rst2
-rw-r--r--Documentation/x86/index.rst2
-rw-r--r--Documentation/x86/intel-iommu.rst (renamed from Documentation/Intel-IOMMU.txt)0
-rw-r--r--Documentation/x86/intel_txt.rst (renamed from Documentation/intel_txt.txt)0
-rw-r--r--Documentation/x86/topology.rst2
-rw-r--r--Documentation/x86/x86_64/fake-numa-for-cpusets.rst4
-rw-r--r--Documentation/xtensa/atomctl.rst (renamed from Documentation/xtensa/atomctl.txt)13
-rw-r--r--Documentation/xtensa/booting.rst (renamed from Documentation/xtensa/booting.txt)5
-rw-r--r--Documentation/xtensa/index.rst12
-rw-r--r--Documentation/xtensa/mmu.rst195
-rw-r--r--Documentation/xtensa/mmu.txt189
460 files changed, 10290 insertions, 7417 deletions
diff --git a/Documentation/ABI/obsolete/sysfs-gpio b/Documentation/ABI/obsolete/sysfs-gpio
index 40d41ea1a3f5..e0d4e5e2dd90 100644
--- a/Documentation/ABI/obsolete/sysfs-gpio
+++ b/Documentation/ABI/obsolete/sysfs-gpio
@@ -11,7 +11,7 @@ Description:
11 Kernel code may export it for complete or partial access. 11 Kernel code may export it for complete or partial access.
12 12
13 GPIOs are identified as they are inside the kernel, using integers in 13 GPIOs are identified as they are inside the kernel, using integers in
14 the range 0..INT_MAX. See Documentation/gpio for more information. 14 the range 0..INT_MAX. See Documentation/admin-guide/gpio for more information.
15 15
16 /sys/class/gpio 16 /sys/class/gpio
17 /export ... asks the kernel to export a GPIO to userspace 17 /export ... asks the kernel to export a GPIO to userspace
diff --git a/Documentation/ABI/removed/sysfs-class-rfkill b/Documentation/ABI/removed/sysfs-class-rfkill
index 3ce6231f20b2..9c08c7f98ffb 100644
--- a/Documentation/ABI/removed/sysfs-class-rfkill
+++ b/Documentation/ABI/removed/sysfs-class-rfkill
@@ -1,6 +1,6 @@
1rfkill - radio frequency (RF) connector kill switch support 1rfkill - radio frequency (RF) connector kill switch support
2 2
3For details to this subsystem look at Documentation/rfkill.txt. 3For details to this subsystem look at Documentation/driver-api/rfkill.rst.
4 4
5What: /sys/class/rfkill/rfkill[0-9]+/claim 5What: /sys/class/rfkill/rfkill[0-9]+/claim
6Date: 09-Jul-2007 6Date: 09-Jul-2007
diff --git a/Documentation/ABI/stable/sysfs-class-rfkill b/Documentation/ABI/stable/sysfs-class-rfkill
index 80151a409d67..5b154f922643 100644
--- a/Documentation/ABI/stable/sysfs-class-rfkill
+++ b/Documentation/ABI/stable/sysfs-class-rfkill
@@ -1,6 +1,6 @@
1rfkill - radio frequency (RF) connector kill switch support 1rfkill - radio frequency (RF) connector kill switch support
2 2
3For details to this subsystem look at Documentation/rfkill.txt. 3For details to this subsystem look at Documentation/driver-api/rfkill.rst.
4 4
5For the deprecated /sys/class/rfkill/*/claim knobs of this interface look in 5For the deprecated /sys/class/rfkill/*/claim knobs of this interface look in
6Documentation/ABI/removed/sysfs-class-rfkill. 6Documentation/ABI/removed/sysfs-class-rfkill.
diff --git a/Documentation/ABI/stable/sysfs-devices-node b/Documentation/ABI/stable/sysfs-devices-node
index f7ce68fbd4b9..df8413cf1468 100644
--- a/Documentation/ABI/stable/sysfs-devices-node
+++ b/Documentation/ABI/stable/sysfs-devices-node
@@ -61,7 +61,7 @@ Date: October 2002
61Contact: Linux Memory Management list <linux-mm@kvack.org> 61Contact: Linux Memory Management list <linux-mm@kvack.org>
62Description: 62Description:
63 The node's hit/miss statistics, in units of pages. 63 The node's hit/miss statistics, in units of pages.
64 See Documentation/numastat.txt 64 See Documentation/admin-guide/numastat.rst
65 65
66What: /sys/devices/system/node/nodeX/distance 66What: /sys/devices/system/node/nodeX/distance
67Date: October 2002 67Date: October 2002
diff --git a/Documentation/ABI/testing/procfs-diskstats b/Documentation/ABI/testing/procfs-diskstats
index abac31d216de..2c44b4f1b060 100644
--- a/Documentation/ABI/testing/procfs-diskstats
+++ b/Documentation/ABI/testing/procfs-diskstats
@@ -29,4 +29,4 @@ Description:
29 17 - sectors discarded 29 17 - sectors discarded
30 18 - time spent discarding 30 18 - time spent discarding
31 31
32 For more details refer to Documentation/iostats.txt 32 For more details refer to Documentation/admin-guide/iostats.rst
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index dfad7427817c..f8c7c7126bb1 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -15,7 +15,7 @@ Description:
15 9 - I/Os currently in progress 15 9 - I/Os currently in progress
16 10 - time spent doing I/Os (ms) 16 10 - time spent doing I/Os (ms)
17 11 - weighted time spent doing I/Os (ms) 17 11 - weighted time spent doing I/Os (ms)
18 For more details refer Documentation/iostats.txt 18 For more details refer Documentation/admin-guide/iostats.rst
19 19
20 20
21What: /sys/block/<disk>/<part>/stat 21What: /sys/block/<disk>/<part>/stat
diff --git a/Documentation/ABI/testing/sysfs-block-device b/Documentation/ABI/testing/sysfs-block-device
index 82ef6eab042d..17f2bc7dd261 100644
--- a/Documentation/ABI/testing/sysfs-block-device
+++ b/Documentation/ABI/testing/sysfs-block-device
@@ -45,7 +45,7 @@ Description:
45 - Values below -2 are rejected with -EINVAL 45 - Values below -2 are rejected with -EINVAL
46 46
47 For more information, see 47 For more information, see
48 Documentation/laptops/disk-shock-protection.txt 48 Documentation/admin-guide/laptops/disk-shock-protection.rst
49 49
50 50
51What: /sys/block/*/device/ncq_prio_enable 51What: /sys/block/*/device/ncq_prio_enable
diff --git a/Documentation/ABI/testing/sysfs-class-switchtec b/Documentation/ABI/testing/sysfs-class-switchtec
index 48cb4c15e430..76c7a661a595 100644
--- a/Documentation/ABI/testing/sysfs-class-switchtec
+++ b/Documentation/ABI/testing/sysfs-class-switchtec
@@ -1,6 +1,6 @@
1switchtec - Microsemi Switchtec PCI Switch Management Endpoint 1switchtec - Microsemi Switchtec PCI Switch Management Endpoint
2 2
3For details on this subsystem look at Documentation/switchtec.txt. 3For details on this subsystem look at Documentation/driver-api/switchtec.rst.
4 4
5What: /sys/class/switchtec 5What: /sys/class/switchtec
6Date: 05-Jan-2017 6Date: 05-Jan-2017
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
index d404603c6b52..5f7d7b14fa44 100644
--- a/Documentation/ABI/testing/sysfs-devices-system-cpu
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -34,7 +34,7 @@ Description: CPU topology files that describe kernel limits related to
34 present: cpus that have been identified as being present in 34 present: cpus that have been identified as being present in
35 the system. 35 the system.
36 36
37 See Documentation/cputopology.txt for more information. 37 See Documentation/admin-guide/cputopology.rst for more information.
38 38
39 39
40What: /sys/devices/system/cpu/probe 40What: /sys/devices/system/cpu/probe
@@ -103,7 +103,7 @@ Description: CPU topology files that describe a logical CPU's relationship
103 thread_siblings_list: human-readable list of cpu#'s hardware 103 thread_siblings_list: human-readable list of cpu#'s hardware
104 threads within the same core as cpu# 104 threads within the same core as cpu#
105 105
106 See Documentation/cputopology.txt for more information. 106 See Documentation/admin-guide/cputopology.rst for more information.
107 107
108 108
109What: /sys/devices/system/cpu/cpuidle/current_driver 109What: /sys/devices/system/cpu/cpuidle/current_driver
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop
index cd9d667c3da2..8b0e8205a6a2 100644
--- a/Documentation/ABI/testing/sysfs-platform-asus-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop
@@ -31,7 +31,7 @@ Description:
31 To control the LED display, use the following : 31 To control the LED display, use the following :
32 echo 0x0T000DDD > /sys/devices/platform/asus_laptop/ 32 echo 0x0T000DDD > /sys/devices/platform/asus_laptop/
33 where T control the 3 letters display, and DDD the 3 digits display. 33 where T control the 3 letters display, and DDD the 3 digits display.
34 The DDD table can be found in Documentation/laptops/asus-laptop.txt 34 The DDD table can be found in Documentation/admin-guide/laptops/asus-laptop.rst
35 35
36What: /sys/devices/platform/asus_laptop/bluetooth 36What: /sys/devices/platform/asus_laptop/bluetooth
37Date: January 2007 37Date: January 2007
diff --git a/Documentation/logo.txt b/Documentation/COPYING-logo
index 296f0f7f67eb..296f0f7f67eb 100644
--- a/Documentation/logo.txt
+++ b/Documentation/COPYING-logo
diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt
index cb712a02f59f..358d495456d1 100644
--- a/Documentation/DMA-API-HOWTO.txt
+++ b/Documentation/DMA-API-HOWTO.txt
@@ -212,7 +212,7 @@ The standard 64-bit addressing device would do something like this::
212 212
213If the device only supports 32-bit addressing for descriptors in the 213If the device only supports 32-bit addressing for descriptors in the
214coherent allocations, but supports full 64-bits for streaming mappings 214coherent allocations, but supports full 64-bits for streaming mappings
215it would look like this: 215it would look like this::
216 216
217 if (dma_set_mask(dev, DMA_BIT_MASK(64))) { 217 if (dma_set_mask(dev, DMA_BIT_MASK(64))) {
218 dev_warn(dev, "mydev: No suitable DMA available\n"); 218 dev_warn(dev, "mydev: No suitable DMA available\n");
diff --git a/Documentation/accounting/cgroupstats.txt b/Documentation/accounting/cgroupstats.rst
index d16a9849e60e..b9afc48f4ea2 100644
--- a/Documentation/accounting/cgroupstats.txt
+++ b/Documentation/accounting/cgroupstats.rst
@@ -1,3 +1,7 @@
1==================
2Control Groupstats
3==================
4
1Control Groupstats is inspired by the discussion at 5Control Groupstats is inspired by the discussion at
2http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as 6http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as
3suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263. 7suggested by Andrew Morton in http://lkml.org/lkml/2007/4/11/263.
@@ -19,9 +23,9 @@ about tasks blocked on I/O. If CONFIG_TASK_DELAY_ACCT is disabled, this
19information will not be available. 23information will not be available.
20 24
21To extract cgroup statistics a utility very similar to getdelays.c 25To extract cgroup statistics a utility very similar to getdelays.c
22has been developed, the sample output of the utility is shown below 26has been developed, the sample output of the utility is shown below::
23 27
24~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" 28 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a"
25sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 29 sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0
26~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" 30 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup"
27sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 31 sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.rst
index 042ea59b5853..7cc7f5852da0 100644
--- a/Documentation/accounting/delay-accounting.txt
+++ b/Documentation/accounting/delay-accounting.rst
@@ -1,5 +1,6 @@
1================
1Delay accounting 2Delay accounting
2---------------- 3================
3 4
4Tasks encounter delays in execution when they wait 5Tasks encounter delays in execution when they wait
5for some kernel resource to become available e.g. a 6for some kernel resource to become available e.g. a
@@ -39,7 +40,9 @@ in detail in a separate document in this directory. Taskstats returns a
39generic data structure to userspace corresponding to per-pid and per-tgid 40generic data structure to userspace corresponding to per-pid and per-tgid
40statistics. The delay accounting functionality populates specific fields of 41statistics. The delay accounting functionality populates specific fields of
41this structure. See 42this structure. See
43
42 include/linux/taskstats.h 44 include/linux/taskstats.h
45
43for a description of the fields pertaining to delay accounting. 46for a description of the fields pertaining to delay accounting.
44It will generally be in the form of counters returning the cumulative 47It will generally be in the form of counters returning the cumulative
45delay seen for cpu, sync block I/O, swapin, memory reclaim etc. 48delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
@@ -61,13 +64,16 @@ also serves as an example of using the taskstats interface.
61Usage 64Usage
62----- 65-----
63 66
64Compile the kernel with 67Compile the kernel with::
68
65 CONFIG_TASK_DELAY_ACCT=y 69 CONFIG_TASK_DELAY_ACCT=y
66 CONFIG_TASKSTATS=y 70 CONFIG_TASKSTATS=y
67 71
68Delay accounting is enabled by default at boot up. 72Delay accounting is enabled by default at boot up.
69To disable, add 73To disable, add::
74
70 nodelayacct 75 nodelayacct
76
71to the kernel boot options. The rest of the instructions 77to the kernel boot options. The rest of the instructions
72below assume this has not been done. 78below assume this has not been done.
73 79
@@ -78,40 +84,43 @@ The utility also allows a given command to be
78executed and the corresponding delays to be 84executed and the corresponding delays to be
79seen. 85seen.
80 86
81General format of the getdelays command 87General format of the getdelays command::
82 88
83getdelays [-t tgid] [-p pid] [-c cmd...] 89 getdelays [-t tgid] [-p pid] [-c cmd...]
84 90
85 91
86Get delays, since system boot, for pid 10 92Get delays, since system boot, for pid 10::
87# ./getdelays -p 10
88(output similar to next case)
89 93
90Get sum of delays, since system boot, for all pids with tgid 5 94 # ./getdelays -p 10
91# ./getdelays -t 5 95 (output similar to next case)
92 96
97Get sum of delays, since system boot, for all pids with tgid 5::
93 98
94CPU count real total virtual total delay total 99 # ./getdelays -t 5
95 7876 92005750 100000000 24001500 100
96IO count delay total 101
97 0 0 102 CPU count real total virtual total delay total
98SWAP count delay total 103 7876 92005750 100000000 24001500
99 0 0 104 IO count delay total
100RECLAIM count delay total 105 0 0
101 0 0 106 SWAP count delay total
107 0 0
108 RECLAIM count delay total
109 0 0
110
111Get delays seen in executing a given simple command::
102 112
103Get delays seen in executing a given simple command 113 # ./getdelays -c ls /
104# ./getdelays -c ls /
105 114
106bin data1 data3 data5 dev home media opt root srv sys usr 115 bin data1 data3 data5 dev home media opt root srv sys usr
107boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var 116 boot data2 data4 data6 etc lib mnt proc sbin subdomain tmp var
108 117
109 118
110CPU count real total virtual total delay total 119 CPU count real total virtual total delay total
111 6 4000250 4000000 0 120 6 4000250 4000000 0
112IO count delay total 121 IO count delay total
113 0 0 122 0 0
114SWAP count delay total 123 SWAP count delay total
115 0 0 124 0 0
116RECLAIM count delay total 125 RECLAIM count delay total
117 0 0 126 0 0
diff --git a/Documentation/accounting/index.rst b/Documentation/accounting/index.rst
new file mode 100644
index 000000000000..9369d8bf32be
--- /dev/null
+++ b/Documentation/accounting/index.rst
@@ -0,0 +1,14 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==========
4Accounting
5==========
6
7.. toctree::
8 :maxdepth: 1
9
10 cgroupstats
11 delay-accounting
12 psi
13 taskstats
14 taskstats-struct
diff --git a/Documentation/accounting/psi.txt b/Documentation/accounting/psi.rst
index 5cbe5659e3b7..621111ce5740 100644
--- a/Documentation/accounting/psi.txt
+++ b/Documentation/accounting/psi.rst
@@ -35,14 +35,14 @@ Pressure interface
35Pressure information for each resource is exported through the 35Pressure information for each resource is exported through the
36respective file in /proc/pressure/ -- cpu, memory, and io. 36respective file in /proc/pressure/ -- cpu, memory, and io.
37 37
38The format for CPU is as such: 38The format for CPU is as such::
39 39
40some avg10=0.00 avg60=0.00 avg300=0.00 total=0 40 some avg10=0.00 avg60=0.00 avg300=0.00 total=0
41 41
42and for memory and IO: 42and for memory and IO::
43 43
44some avg10=0.00 avg60=0.00 avg300=0.00 total=0 44 some avg10=0.00 avg60=0.00 avg300=0.00 total=0
45full avg10=0.00 avg60=0.00 avg300=0.00 total=0 45 full avg10=0.00 avg60=0.00 avg300=0.00 total=0
46 46
47The "some" line indicates the share of time in which at least some 47The "some" line indicates the share of time in which at least some
48tasks are stalled on a given resource. 48tasks are stalled on a given resource.
@@ -77,9 +77,9 @@ To register a trigger user has to open psi interface file under
77/proc/pressure/ representing the resource to be monitored and write the 77/proc/pressure/ representing the resource to be monitored and write the
78desired threshold and time window. The open file descriptor should be 78desired threshold and time window. The open file descriptor should be
79used to wait for trigger events using select(), poll() or epoll(). 79used to wait for trigger events using select(), poll() or epoll().
80The following format is used: 80The following format is used::
81 81
82<some|full> <stall amount in us> <time window in us> 82 <some|full> <stall amount in us> <time window in us>
83 83
84For example writing "some 150000 1000000" into /proc/pressure/memory 84For example writing "some 150000 1000000" into /proc/pressure/memory
85would add 150ms threshold for partial memory stall measured within 85would add 150ms threshold for partial memory stall measured within
@@ -115,18 +115,20 @@ trigger is closed.
115Userspace monitor usage example 115Userspace monitor usage example
116=============================== 116===============================
117 117
118#include <errno.h> 118::
119#include <fcntl.h> 119
120#include <stdio.h> 120 #include <errno.h>
121#include <poll.h> 121 #include <fcntl.h>
122#include <string.h> 122 #include <stdio.h>
123#include <unistd.h> 123 #include <poll.h>
124 124 #include <string.h>
125/* 125 #include <unistd.h>
126 * Monitor memory partial stall with 1s tracking window size 126
127 * and 150ms threshold. 127 /*
128 */ 128 * Monitor memory partial stall with 1s tracking window size
129int main() { 129 * and 150ms threshold.
130 */
131 int main() {
130 const char trig[] = "some 150000 1000000"; 132 const char trig[] = "some 150000 1000000";
131 struct pollfd fds; 133 struct pollfd fds;
132 int n; 134 int n;
@@ -165,7 +167,7 @@ int main() {
165 } 167 }
166 168
167 return 0; 169 return 0;
168} 170 }
169 171
170Cgroup2 interface 172Cgroup2 interface
171================= 173=================
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.rst
index e7512c061c15..ca90fd489c9a 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.rst
@@ -1,5 +1,6 @@
1====================
1The struct taskstats 2The struct taskstats
2-------------------- 3====================
3 4
4This document contains an explanation of the struct taskstats fields. 5This document contains an explanation of the struct taskstats fields.
5 6
@@ -10,16 +11,24 @@ There are three different groups of fields in the struct taskstats:
10 the common fields and basic accounting fields are collected for 11 the common fields and basic accounting fields are collected for
11 delivery at do_exit() of a task. 12 delivery at do_exit() of a task.
122) Delay accounting fields 132) Delay accounting fields
13 These fields are placed between 14 These fields are placed between::
14 /* Delay accounting fields start */ 15
15 and 16 /* Delay accounting fields start */
16 /* Delay accounting fields end */ 17
18 and::
19
20 /* Delay accounting fields end */
21
17 Their values are collected if CONFIG_TASK_DELAY_ACCT is set. 22 Their values are collected if CONFIG_TASK_DELAY_ACCT is set.
183) Extended accounting fields 233) Extended accounting fields
19 These fields are placed between 24 These fields are placed between::
20 /* Extended accounting fields start */ 25
21 and 26 /* Extended accounting fields start */
22 /* Extended accounting fields end */ 27
28 and::
29
30 /* Extended accounting fields end */
31
23 Their values are collected if CONFIG_TASK_XACCT is set. 32 Their values are collected if CONFIG_TASK_XACCT is set.
24 33
254) Per-task and per-thread context switch count statistics 344) Per-task and per-thread context switch count statistics
@@ -31,31 +40,33 @@ There are three different groups of fields in the struct taskstats:
31Future extension should add fields to the end of the taskstats struct, and 40Future extension should add fields to the end of the taskstats struct, and
32should not change the relative position of each field within the struct. 41should not change the relative position of each field within the struct.
33 42
43::
34 44
35struct taskstats { 45 struct taskstats {
46
471) Common and basic accounting fields::
36 48
371) Common and basic accounting fields:
38 /* The version number of this struct. This field is always set to 49 /* The version number of this struct. This field is always set to
39 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. 50 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
40 * Each time the struct is changed, the value should be incremented. 51 * Each time the struct is changed, the value should be incremented.
41 */ 52 */
42 __u16 version; 53 __u16 version;
43 54
44 /* The exit code of a task. */ 55 /* The exit code of a task. */
45 __u32 ac_exitcode; /* Exit status */ 56 __u32 ac_exitcode; /* Exit status */
46 57
47 /* The accounting flags of a task as defined in <linux/acct.h> 58 /* The accounting flags of a task as defined in <linux/acct.h>
48 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG. 59 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
49 */ 60 */
50 __u8 ac_flag; /* Record flags */ 61 __u8 ac_flag; /* Record flags */
51 62
52 /* The value of task_nice() of a task. */ 63 /* The value of task_nice() of a task. */
53 __u8 ac_nice; /* task_nice */ 64 __u8 ac_nice; /* task_nice */
54 65
55 /* The name of the command that started this task. */ 66 /* The name of the command that started this task. */
56 char ac_comm[TS_COMM_LEN]; /* Command name */ 67 char ac_comm[TS_COMM_LEN]; /* Command name */
57 68
58 /* The scheduling discipline as set in task->policy field. */ 69 /* The scheduling discipline as set in task->policy field. */
59 __u8 ac_sched; /* Scheduling discipline */ 70 __u8 ac_sched; /* Scheduling discipline */
60 71
61 __u8 ac_pad[3]; 72 __u8 ac_pad[3];
@@ -64,26 +75,27 @@ struct taskstats {
64 __u32 ac_pid; /* Process ID */ 75 __u32 ac_pid; /* Process ID */
65 __u32 ac_ppid; /* Parent process ID */ 76 __u32 ac_ppid; /* Parent process ID */
66 77
67 /* The time when a task begins, in [secs] since 1970. */ 78 /* The time when a task begins, in [secs] since 1970. */
68 __u32 ac_btime; /* Begin time [sec since 1970] */ 79 __u32 ac_btime; /* Begin time [sec since 1970] */
69 80
70 /* The elapsed time of a task, in [usec]. */ 81 /* The elapsed time of a task, in [usec]. */
71 __u64 ac_etime; /* Elapsed time [usec] */ 82 __u64 ac_etime; /* Elapsed time [usec] */
72 83
73 /* The user CPU time of a task, in [usec]. */ 84 /* The user CPU time of a task, in [usec]. */
74 __u64 ac_utime; /* User CPU time [usec] */ 85 __u64 ac_utime; /* User CPU time [usec] */
75 86
76 /* The system CPU time of a task, in [usec]. */ 87 /* The system CPU time of a task, in [usec]. */
77 __u64 ac_stime; /* System CPU time [usec] */ 88 __u64 ac_stime; /* System CPU time [usec] */
78 89
79 /* The minor page fault count of a task, as set in task->min_flt. */ 90 /* The minor page fault count of a task, as set in task->min_flt. */
80 __u64 ac_minflt; /* Minor Page Fault Count */ 91 __u64 ac_minflt; /* Minor Page Fault Count */
81 92
82 /* The major page fault count of a task, as set in task->maj_flt. */ 93 /* The major page fault count of a task, as set in task->maj_flt. */
83 __u64 ac_majflt; /* Major Page Fault Count */ 94 __u64 ac_majflt; /* Major Page Fault Count */
84 95
85 96
862) Delay accounting fields: 972) Delay accounting fields::
98
87 /* Delay accounting fields start 99 /* Delay accounting fields start
88 * 100 *
89 * All values, until the comment "Delay accounting fields end" are 101 * All values, until the comment "Delay accounting fields end" are
@@ -134,7 +146,8 @@ struct taskstats {
134 /* version 1 ends here */ 146 /* version 1 ends here */
135 147
136 148
1373) Extended accounting fields 1493) Extended accounting fields::
150
138 /* Extended accounting fields start */ 151 /* Extended accounting fields start */
139 152
140 /* Accumulated RSS usage in duration of a task, in MBytes-usecs. 153 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
@@ -145,15 +158,15 @@ struct taskstats {
145 */ 158 */
146 __u64 coremem; /* accumulated RSS usage in MB-usec */ 159 __u64 coremem; /* accumulated RSS usage in MB-usec */
147 160
148 /* Accumulated virtual memory usage in duration of a task. 161 /* Accumulated virtual memory usage in duration of a task.
149 * Same as acct_rss_mem1 above except that we keep track of VM usage. 162 * Same as acct_rss_mem1 above except that we keep track of VM usage.
150 */ 163 */
151 __u64 virtmem; /* accumulated VM usage in MB-usec */ 164 __u64 virtmem; /* accumulated VM usage in MB-usec */
152 165
153 /* High watermark of RSS usage in duration of a task, in KBytes. */ 166 /* High watermark of RSS usage in duration of a task, in KBytes. */
154 __u64 hiwater_rss; /* High-watermark of RSS usage */ 167 __u64 hiwater_rss; /* High-watermark of RSS usage */
155 168
156 /* High watermark of VM usage in duration of a task, in KBytes. */ 169 /* High watermark of VM usage in duration of a task, in KBytes. */
157 __u64 hiwater_vm; /* High-water virtual memory usage */ 170 __u64 hiwater_vm; /* High-water virtual memory usage */
158 171
159 /* The following four fields are I/O statistics of a task. */ 172 /* The following four fields are I/O statistics of a task. */
@@ -164,17 +177,23 @@ struct taskstats {
164 177
165 /* Extended accounting fields end */ 178 /* Extended accounting fields end */
166 179
1674) Per-task and per-thread statistics 1804) Per-task and per-thread statistics::
181
168 __u64 nvcsw; /* Context voluntary switch counter */ 182 __u64 nvcsw; /* Context voluntary switch counter */
169 __u64 nivcsw; /* Context involuntary switch counter */ 183 __u64 nivcsw; /* Context involuntary switch counter */
170 184
1715) Time accounting for SMT machines 1855) Time accounting for SMT machines::
186
172 __u64 ac_utimescaled; /* utime scaled on frequency etc */ 187 __u64 ac_utimescaled; /* utime scaled on frequency etc */
173 __u64 ac_stimescaled; /* stime scaled on frequency etc */ 188 __u64 ac_stimescaled; /* stime scaled on frequency etc */
174 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ 189 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
175 190
1766) Extended delay accounting fields for memory reclaim 1916) Extended delay accounting fields for memory reclaim::
192
177 /* Delay waiting for memory reclaim */ 193 /* Delay waiting for memory reclaim */
178 __u64 freepages_count; 194 __u64 freepages_count;
179 __u64 freepages_delay_total; 195 __u64 freepages_delay_total;
180} 196
197::
198
199 }
diff --git a/Documentation/accounting/taskstats.txt b/Documentation/accounting/taskstats.rst
index ff06b738bb88..2a28b7f55c10 100644
--- a/Documentation/accounting/taskstats.txt
+++ b/Documentation/accounting/taskstats.rst
@@ -1,5 +1,6 @@
1=============================
1Per-task statistics interface 2Per-task statistics interface
2----------------------------- 3=============================
3 4
4 5
5Taskstats is a netlink-based interface for sending per-task and 6Taskstats is a netlink-based interface for sending per-task and
@@ -65,7 +66,7 @@ taskstats.h file.
65 66
66The data exchanged between user and kernel space is a netlink message belonging 67The data exchanged between user and kernel space is a netlink message belonging
67to the NETLINK_GENERIC family and using the netlink attributes interface. 68to the NETLINK_GENERIC family and using the netlink attributes interface.
68The messages are in the format 69The messages are in the format::
69 70
70 +----------+- - -+-------------+-------------------+ 71 +----------+- - -+-------------+-------------------+
71 | nlmsghdr | Pad | genlmsghdr | taskstats payload | 72 | nlmsghdr | Pad | genlmsghdr | taskstats payload |
@@ -167,15 +168,13 @@ extended and the number of cpus grows large.
167To avoid losing statistics, userspace should do one or more of the following: 168To avoid losing statistics, userspace should do one or more of the following:
168 169
169- increase the receive buffer sizes for the netlink sockets opened by 170- increase the receive buffer sizes for the netlink sockets opened by
170listeners to receive exit data. 171 listeners to receive exit data.
171 172
172- create more listeners and reduce the number of cpus being listened to by 173- create more listeners and reduce the number of cpus being listened to by
173each listener. In the extreme case, there could be one listener for each cpu. 174 each listener. In the extreme case, there could be one listener for each cpu.
174Users may also consider setting the cpu affinity of the listener to the subset 175 Users may also consider setting the cpu affinity of the listener to the subset
175of cpus to which it listens, especially if they are listening to just one cpu. 176 of cpus to which it listens, especially if they are listening to just one cpu.
176 177
177Despite these measures, if the userspace receives ENOBUFS error messages 178Despite these measures, if the userspace receives ENOBUFS error messages
178indicated overflow of receive buffers, it should take measures to handle the 179indicated overflow of receive buffers, it should take measures to handle the
179loss of data. 180loss of data.
180
181----
diff --git a/Documentation/aoe/aoe.rst b/Documentation/admin-guide/aoe/aoe.rst
index 58747ecec71d..a05e751363a0 100644
--- a/Documentation/aoe/aoe.rst
+++ b/Documentation/admin-guide/aoe/aoe.rst
@@ -20,7 +20,7 @@ driver. The aoetools are on sourceforge.
20 20
21 http://aoetools.sourceforge.net/ 21 http://aoetools.sourceforge.net/
22 22
23The scripts in this Documentation/aoe directory are intended to 23The scripts in this Documentation/admin-guide/aoe directory are intended to
24document the use of the driver and are not necessary if you install 24document the use of the driver and are not necessary if you install
25the aoetools. 25the aoetools.
26 26
@@ -86,7 +86,7 @@ Using sysfs
86 a convenient way. Users with aoetools should use the aoe-stat 86 a convenient way. Users with aoetools should use the aoe-stat
87 command:: 87 command::
88 88
89 root@makki root# sh Documentation/aoe/status.sh 89 root@makki root# sh Documentation/admin-guide/aoe/status.sh
90 e10.0 eth3 up 90 e10.0 eth3 up
91 e10.1 eth3 up 91 e10.1 eth3 up
92 e10.2 eth3 up 92 e10.2 eth3 up
diff --git a/Documentation/aoe/autoload.sh b/Documentation/admin-guide/aoe/autoload.sh
index 815dff4691c9..815dff4691c9 100644
--- a/Documentation/aoe/autoload.sh
+++ b/Documentation/admin-guide/aoe/autoload.sh
diff --git a/Documentation/aoe/examples.rst b/Documentation/admin-guide/aoe/examples.rst
index 91f3198e52c1..91f3198e52c1 100644
--- a/Documentation/aoe/examples.rst
+++ b/Documentation/admin-guide/aoe/examples.rst
diff --git a/Documentation/aoe/index.rst b/Documentation/admin-guide/aoe/index.rst
index 4394b9b7913c..d71c5df15922 100644
--- a/Documentation/aoe/index.rst
+++ b/Documentation/admin-guide/aoe/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3======================= 1=======================
4ATA over Ethernet (AoE) 2ATA over Ethernet (AoE)
5======================= 3=======================
diff --git a/Documentation/aoe/status.sh b/Documentation/admin-guide/aoe/status.sh
index eeec7baae57a..eeec7baae57a 100644
--- a/Documentation/aoe/status.sh
+++ b/Documentation/admin-guide/aoe/status.sh
diff --git a/Documentation/aoe/todo.rst b/Documentation/admin-guide/aoe/todo.rst
index dea8db5a33e1..dea8db5a33e1 100644
--- a/Documentation/aoe/todo.rst
+++ b/Documentation/admin-guide/aoe/todo.rst
diff --git a/Documentation/aoe/udev-install.sh b/Documentation/admin-guide/aoe/udev-install.sh
index 15e86f58c036..15e86f58c036 100644
--- a/Documentation/aoe/udev-install.sh
+++ b/Documentation/admin-guide/aoe/udev-install.sh
diff --git a/Documentation/aoe/udev.txt b/Documentation/admin-guide/aoe/udev.txt
index 54feda5a0772..5fb756466bc7 100644
--- a/Documentation/aoe/udev.txt
+++ b/Documentation/admin-guide/aoe/udev.txt
@@ -11,7 +11,7 @@
11# udev_rules="/etc/udev/rules.d/" 11# udev_rules="/etc/udev/rules.d/"
12# bash# ls /etc/udev/rules.d/ 12# bash# ls /etc/udev/rules.d/
13# 10-wacom.rules 50-udev.rules 13# 10-wacom.rules 50-udev.rules
14# bash# cp /path/to/linux/Documentation/aoe/udev.txt \ 14# bash# cp /path/to/linux/Documentation/admin-guide/aoe/udev.txt \
15# /etc/udev/rules.d/60-aoe.rules 15# /etc/udev/rules.d/60-aoe.rules
16# 16#
17 17
diff --git a/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg b/Documentation/admin-guide/blockdev/drbd/DRBD-8.3-data-packets.svg
index f87cfa0dc2fb..f87cfa0dc2fb 100644
--- a/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg
+++ b/Documentation/admin-guide/blockdev/drbd/DRBD-8.3-data-packets.svg
diff --git a/Documentation/blockdev/drbd/DRBD-data-packets.svg b/Documentation/admin-guide/blockdev/drbd/DRBD-data-packets.svg
index 48a1e2165fec..48a1e2165fec 100644
--- a/Documentation/blockdev/drbd/DRBD-data-packets.svg
+++ b/Documentation/admin-guide/blockdev/drbd/DRBD-data-packets.svg
diff --git a/Documentation/blockdev/drbd/conn-states-8.dot b/Documentation/admin-guide/blockdev/drbd/conn-states-8.dot
index 025e8cf5e64a..025e8cf5e64a 100644
--- a/Documentation/blockdev/drbd/conn-states-8.dot
+++ b/Documentation/admin-guide/blockdev/drbd/conn-states-8.dot
diff --git a/Documentation/blockdev/drbd/data-structure-v9.txt b/Documentation/admin-guide/blockdev/drbd/data-structure-v9.rst
index 1e52a0e32624..66036b901644 100644
--- a/Documentation/blockdev/drbd/data-structure-v9.txt
+++ b/Documentation/admin-guide/blockdev/drbd/data-structure-v9.rst
@@ -1,3 +1,7 @@
1================================
2kernel data structure for DRBD-9
3================================
4
1This describes the in kernel data structure for DRBD-9. Starting with 5This describes the in kernel data structure for DRBD-9. Starting with
2Linux v3.14 we are reorganizing DRBD to use this data structure. 6Linux v3.14 we are reorganizing DRBD to use this data structure.
3 7
@@ -10,7 +14,7 @@ device is represented by a block device locally.
10 14
11The DRBD objects are interconnected to form a matrix as depicted below; a 15The DRBD objects are interconnected to form a matrix as depicted below; a
12drbd_peer_device object sits at each intersection between a drbd_device and a 16drbd_peer_device object sits at each intersection between a drbd_device and a
13drbd_connection: 17drbd_connection::
14 18
15 /--------------+---------------+.....+---------------\ 19 /--------------+---------------+.....+---------------\
16 | resource | device | | device | 20 | resource | device | | device |
diff --git a/Documentation/blockdev/drbd/disk-states-8.dot b/Documentation/admin-guide/blockdev/drbd/disk-states-8.dot
index d06cfb46fb98..d06cfb46fb98 100644
--- a/Documentation/blockdev/drbd/disk-states-8.dot
+++ b/Documentation/admin-guide/blockdev/drbd/disk-states-8.dot
diff --git a/Documentation/blockdev/drbd/drbd-connection-state-overview.dot b/Documentation/admin-guide/blockdev/drbd/drbd-connection-state-overview.dot
index 6d9cf0a7b11d..6d9cf0a7b11d 100644
--- a/Documentation/blockdev/drbd/drbd-connection-state-overview.dot
+++ b/Documentation/admin-guide/blockdev/drbd/drbd-connection-state-overview.dot
diff --git a/Documentation/admin-guide/blockdev/drbd/figures.rst b/Documentation/admin-guide/blockdev/drbd/figures.rst
new file mode 100644
index 000000000000..bd9a4901fe46
--- /dev/null
+++ b/Documentation/admin-guide/blockdev/drbd/figures.rst
@@ -0,0 +1,30 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3.. The here included files are intended to help understand the implementation
4
5Data flows that Relate some functions, and write packets
6========================================================
7
8.. kernel-figure:: DRBD-8.3-data-packets.svg
9 :alt: DRBD-8.3-data-packets.svg
10 :align: center
11
12.. kernel-figure:: DRBD-data-packets.svg
13 :alt: DRBD-data-packets.svg
14 :align: center
15
16
17Sub graphs of DRBD's state transitions
18======================================
19
20.. kernel-figure:: conn-states-8.dot
21 :alt: conn-states-8.dot
22 :align: center
23
24.. kernel-figure:: disk-states-8.dot
25 :alt: disk-states-8.dot
26 :align: center
27
28.. kernel-figure:: node-states-8.dot
29 :alt: node-states-8.dot
30 :align: center
diff --git a/Documentation/blockdev/drbd/README.txt b/Documentation/admin-guide/blockdev/drbd/index.rst
index 627b0a1bf35e..68ecd5c113e9 100644
--- a/Documentation/blockdev/drbd/README.txt
+++ b/Documentation/admin-guide/blockdev/drbd/index.rst
@@ -1,4 +1,9 @@
1==========================================
2Distributed Replicated Block Device - DRBD
3==========================================
4
1Description 5Description
6===========
2 7
3 DRBD is a shared-nothing, synchronously replicated block device. It 8 DRBD is a shared-nothing, synchronously replicated block device. It
4 is designed to serve as a building block for high availability 9 is designed to serve as a building block for high availability
@@ -7,10 +12,8 @@ Description
7 12
8 Please visit http://www.drbd.org to find out more. 13 Please visit http://www.drbd.org to find out more.
9 14
10The here included files are intended to help understand the implementation 15.. toctree::
11 16 :maxdepth: 1
12DRBD-8.3-data-packets.svg, DRBD-data-packets.svg
13 relates some functions, and write packets.
14 17
15conn-states-8.dot, disk-states-8.dot, node-states-8.dot 18 data-structure-v9
16 The sub graphs of DRBD's state transitions 19 figures
diff --git a/Documentation/blockdev/drbd/node-states-8.dot b/Documentation/admin-guide/blockdev/drbd/node-states-8.dot
index 4a2b00c23547..bfa54e1f8016 100644
--- a/Documentation/blockdev/drbd/node-states-8.dot
+++ b/Documentation/admin-guide/blockdev/drbd/node-states-8.dot
@@ -11,4 +11,3 @@ digraph peer_states {
11 Unknown -> Primary [ label = "connected" ] 11 Unknown -> Primary [ label = "connected" ]
12 Unknown -> Secondary [ label = "connected" ] 12 Unknown -> Secondary [ label = "connected" ]
13} 13}
14
diff --git a/Documentation/blockdev/floppy.txt b/Documentation/admin-guide/blockdev/floppy.rst
index e2240f5ab64d..4a8f31cf4139 100644
--- a/Documentation/blockdev/floppy.txt
+++ b/Documentation/admin-guide/blockdev/floppy.rst
@@ -1,35 +1,37 @@
1This file describes the floppy driver. 1=============
2Floppy Driver
3=============
2 4
3FAQ list: 5FAQ list:
4========= 6=========
5 7
6 A FAQ list may be found in the fdutils package (see below), and also 8A FAQ list may be found in the fdutils package (see below), and also
7at <http://fdutils.linux.lu/faq.html>. 9at <http://fdutils.linux.lu/faq.html>.
8 10
9 11
10LILO configuration options (Thinkpad users, read this) 12LILO configuration options (Thinkpad users, read this)
11====================================================== 13======================================================
12 14
13 The floppy driver is configured using the 'floppy=' option in 15The floppy driver is configured using the 'floppy=' option in
14lilo. This option can be typed at the boot prompt, or entered in the 16lilo. This option can be typed at the boot prompt, or entered in the
15lilo configuration file. 17lilo configuration file.
16 18
17 Example: If your kernel is called linux-2.6.9, type the following line 19Example: If your kernel is called linux-2.6.9, type the following line
18at the lilo boot prompt (if you have a thinkpad): 20at the lilo boot prompt (if you have a thinkpad)::
19 21
20 linux-2.6.9 floppy=thinkpad 22 linux-2.6.9 floppy=thinkpad
21 23
22You may also enter the following line in /etc/lilo.conf, in the description 24You may also enter the following line in /etc/lilo.conf, in the description
23of linux-2.6.9: 25of linux-2.6.9::
24 26
25 append = "floppy=thinkpad" 27 append = "floppy=thinkpad"
26 28
27 Several floppy related options may be given, example: 29Several floppy related options may be given, example::
28 30
29 linux-2.6.9 floppy=daring floppy=two_fdc 31 linux-2.6.9 floppy=daring floppy=two_fdc
30 append = "floppy=daring floppy=two_fdc" 32 append = "floppy=daring floppy=two_fdc"
31 33
32 If you give options both in the lilo config file and on the boot 34If you give options both in the lilo config file and on the boot
33prompt, the option strings of both places are concatenated, the boot 35prompt, the option strings of both places are concatenated, the boot
34prompt options coming last. That's why there are also options to 36prompt options coming last. That's why there are also options to
35restore the default behavior. 37restore the default behavior.
@@ -38,21 +40,23 @@ restore the default behavior.
38Module configuration options 40Module configuration options
39============================ 41============================
40 42
41 If you use the floppy driver as a module, use the following syntax: 43If you use the floppy driver as a module, use the following syntax::
42modprobe floppy floppy="<options>"
43 44
44Example: 45 modprobe floppy floppy="<options>"
45 modprobe floppy floppy="omnibook messages"
46 46
47 If you need certain options enabled every time you load the floppy driver, 47Example::
48you can put:
49 48
50 options floppy floppy="omnibook messages" 49 modprobe floppy floppy="omnibook messages"
50
51If you need certain options enabled every time you load the floppy driver,
52you can put::
53
54 options floppy floppy="omnibook messages"
51 55
52in a configuration file in /etc/modprobe.d/. 56in a configuration file in /etc/modprobe.d/.
53 57
54 58
55 The floppy driver related options are: 59The floppy driver related options are:
56 60
57 floppy=asus_pci 61 floppy=asus_pci
58 Sets the bit mask to allow only units 0 and 1. (default) 62 Sets the bit mask to allow only units 0 and 1. (default)
@@ -70,8 +74,7 @@ in a configuration file in /etc/modprobe.d/.
70 Tells the floppy driver that you have only one floppy controller. 74 Tells the floppy driver that you have only one floppy controller.
71 (default) 75 (default)
72 76
73 floppy=two_fdc 77 floppy=two_fdc / floppy=<address>,two_fdc
74 floppy=<address>,two_fdc
75 Tells the floppy driver that you have two floppy controllers. 78 Tells the floppy driver that you have two floppy controllers.
76 The second floppy controller is assumed to be at <address>. 79 The second floppy controller is assumed to be at <address>.
77 This option is not needed if the second controller is at address 80 This option is not needed if the second controller is at address
@@ -84,8 +87,7 @@ in a configuration file in /etc/modprobe.d/.
84 floppy=0,thinkpad 87 floppy=0,thinkpad
85 Tells the floppy driver that you don't have a Thinkpad. 88 Tells the floppy driver that you don't have a Thinkpad.
86 89
87 floppy=omnibook 90 floppy=omnibook / floppy=nodma
88 floppy=nodma
89 Tells the floppy driver not to use Dma for data transfers. 91 Tells the floppy driver not to use Dma for data transfers.
90 This is needed on HP Omnibooks, which don't have a workable 92 This is needed on HP Omnibooks, which don't have a workable
91 DMA channel for the floppy driver. This option is also useful 93 DMA channel for the floppy driver. This option is also useful
@@ -144,14 +146,16 @@ in a configuration file in /etc/modprobe.d/.
144 described in the physical CMOS), or if your BIOS uses 146 described in the physical CMOS), or if your BIOS uses
145 non-standard CMOS types. The CMOS types are: 147 non-standard CMOS types. The CMOS types are:
146 148
147 0 - Use the value of the physical CMOS 149 == ==================================
148 1 - 5 1/4 DD 150 0 Use the value of the physical CMOS
149 2 - 5 1/4 HD 151 1 5 1/4 DD
150 3 - 3 1/2 DD 152 2 5 1/4 HD
151 4 - 3 1/2 HD 153 3 3 1/2 DD
152 5 - 3 1/2 ED 154 4 3 1/2 HD
153 6 - 3 1/2 ED 155 5 3 1/2 ED
154 16 - unknown or not installed 156 6 3 1/2 ED
157 16 unknown or not installed
158 == ==================================
155 159
156 (Note: there are two valid types for ED drives. This is because 5 was 160 (Note: there are two valid types for ED drives. This is because 5 was
157 initially chosen to represent floppy *tapes*, and 6 for ED drives. 161 initially chosen to represent floppy *tapes*, and 6 for ED drives.
@@ -162,8 +166,7 @@ in a configuration file in /etc/modprobe.d/.
162 Print a warning message when an unexpected interrupt is received. 166 Print a warning message when an unexpected interrupt is received.
163 (default) 167 (default)
164 168
165 floppy=no_unexpected_interrupts 169 floppy=no_unexpected_interrupts / floppy=L40SX
166 floppy=L40SX
167 Don't print a message when an unexpected interrupt is received. This 170 Don't print a message when an unexpected interrupt is received. This
168 is needed on IBM L40SX laptops in certain video modes. (There seems 171 is needed on IBM L40SX laptops in certain video modes. (There seems
169 to be an interaction between video and floppy. The unexpected 172 to be an interaction between video and floppy. The unexpected
@@ -199,47 +202,54 @@ in a configuration file in /etc/modprobe.d/.
199 Sets the floppy DMA channel to <nr> instead of 2. 202 Sets the floppy DMA channel to <nr> instead of 2.
200 203
201 floppy=slow 204 floppy=slow
202 Use PS/2 stepping rate: 205 Use PS/2 stepping rate::
203 " PS/2 floppies have much slower step rates than regular floppies. 206
207 PS/2 floppies have much slower step rates than regular floppies.
204 It's been recommended that take about 1/4 of the default speed 208 It's been recommended that take about 1/4 of the default speed
205 in some more extreme cases." 209 in some more extreme cases.
206 210
207 211
208Supporting utilities and additional documentation: 212Supporting utilities and additional documentation:
209================================================== 213==================================================
210 214
211 Additional parameters of the floppy driver can be configured at 215Additional parameters of the floppy driver can be configured at
212runtime. Utilities which do this can be found in the fdutils package. 216runtime. Utilities which do this can be found in the fdutils package.
213This package also contains a new version of mtools which allows to 217This package also contains a new version of mtools which allows to
214access high capacity disks (up to 1992K on a high density 3 1/2 disk!). 218access high capacity disks (up to 1992K on a high density 3 1/2 disk!).
215It also contains additional documentation about the floppy driver. 219It also contains additional documentation about the floppy driver.
216 220
217The latest version can be found at fdutils homepage: 221The latest version can be found at fdutils homepage:
222
218 http://fdutils.linux.lu 223 http://fdutils.linux.lu
219 224
220The fdutils releases can be found at: 225The fdutils releases can be found at:
226
221 http://fdutils.linux.lu/download.html 227 http://fdutils.linux.lu/download.html
228
222 http://www.tux.org/pub/knaff/fdutils/ 229 http://www.tux.org/pub/knaff/fdutils/
230
223 ftp://metalab.unc.edu/pub/Linux/utils/disk-management/ 231 ftp://metalab.unc.edu/pub/Linux/utils/disk-management/
224 232
225Reporting problems about the floppy driver 233Reporting problems about the floppy driver
226========================================== 234==========================================
227 235
228 If you have a question or a bug report about the floppy driver, mail 236If you have a question or a bug report about the floppy driver, mail
229me at Alain.Knaff@poboxes.com . If you post to Usenet, preferably use 237me at Alain.Knaff@poboxes.com . If you post to Usenet, preferably use
230comp.os.linux.hardware. As the volume in these groups is rather high, 238comp.os.linux.hardware. As the volume in these groups is rather high,
231be sure to include the word "floppy" (or "FLOPPY") in the subject 239be sure to include the word "floppy" (or "FLOPPY") in the subject
232line. If the reported problem happens when mounting floppy disks, be 240line. If the reported problem happens when mounting floppy disks, be
233sure to mention also the type of the filesystem in the subject line. 241sure to mention also the type of the filesystem in the subject line.
234 242
235 Be sure to read the FAQ before mailing/posting any bug reports! 243Be sure to read the FAQ before mailing/posting any bug reports!
236 244
237 Alain 245Alain
238 246
239Changelog 247Changelog
240========= 248=========
241 249
24210-30-2004 : Cleanup, updating, add reference to module configuration. 25010-30-2004 :
251 Cleanup, updating, add reference to module configuration.
243 James Nelson <james4765@gmail.com> 252 James Nelson <james4765@gmail.com>
244 253
2456-3-2000 : Original Document 2546-3-2000 :
255 Original Document
diff --git a/Documentation/admin-guide/blockdev/index.rst b/Documentation/admin-guide/blockdev/index.rst
new file mode 100644
index 000000000000..b903cf152091
--- /dev/null
+++ b/Documentation/admin-guide/blockdev/index.rst
@@ -0,0 +1,16 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===========================
4The Linux RapidIO Subsystem
5===========================
6
7.. toctree::
8 :maxdepth: 1
9
10 floppy
11 nbd
12 paride
13 ramdisk
14 zram
15
16 drbd/index
diff --git a/Documentation/blockdev/nbd.txt b/Documentation/admin-guide/blockdev/nbd.rst
index db242ea2bce8..d78dfe559dcf 100644
--- a/Documentation/blockdev/nbd.txt
+++ b/Documentation/admin-guide/blockdev/nbd.rst
@@ -1,3 +1,4 @@
1==================================
1Network Block Device (TCP version) 2Network Block Device (TCP version)
2================================== 3==================================
3 4
@@ -28,4 +29,3 @@ max_part
28 29
29nbds_max 30nbds_max
30 Number of block devices that should be initialized (default: 16). 31 Number of block devices that should be initialized (default: 16).
31
diff --git a/Documentation/blockdev/paride.txt b/Documentation/admin-guide/blockdev/paride.rst
index ee6717e3771d..87b4278bf314 100644
--- a/Documentation/blockdev/paride.txt
+++ b/Documentation/admin-guide/blockdev/paride.rst
@@ -1,15 +1,17 @@
1 1===================================
2 Linux and parallel port IDE devices 2Linux and parallel port IDE devices
3===================================
3 4
4PARIDE v1.03 (c) 1997-8 Grant Guenther <grant@torque.net> 5PARIDE v1.03 (c) 1997-8 Grant Guenther <grant@torque.net>
5 6
61. Introduction 71. Introduction
8===============
7 9
8Owing to the simplicity and near universality of the parallel port interface 10Owing to the simplicity and near universality of the parallel port interface
9to personal computers, many external devices such as portable hard-disk, 11to personal computers, many external devices such as portable hard-disk,
10CD-ROM, LS-120 and tape drives use the parallel port to connect to their 12CD-ROM, LS-120 and tape drives use the parallel port to connect to their
11host computer. While some devices (notably scanners) use ad-hoc methods 13host computer. While some devices (notably scanners) use ad-hoc methods
12to pass commands and data through the parallel port interface, most 14to pass commands and data through the parallel port interface, most
13external devices are actually identical to an internal model, but with 15external devices are actually identical to an internal model, but with
14a parallel-port adapter chip added in. Some of the original parallel port 16a parallel-port adapter chip added in. Some of the original parallel port
15adapters were little more than mechanisms for multiplexing a SCSI bus. 17adapters were little more than mechanisms for multiplexing a SCSI bus.
@@ -28,47 +30,50 @@ were to open up a parallel port CD-ROM drive, for instance, one would
28find a standard ATAPI CD-ROM drive, a power supply, and a single adapter 30find a standard ATAPI CD-ROM drive, a power supply, and a single adapter
29that interconnected a standard PC parallel port cable and a standard 31that interconnected a standard PC parallel port cable and a standard
30IDE cable. It is usually possible to exchange the CD-ROM device with 32IDE cable. It is usually possible to exchange the CD-ROM device with
31any other device using the IDE interface. 33any other device using the IDE interface.
32 34
33The document describes the support in Linux for parallel port IDE 35The document describes the support in Linux for parallel port IDE
34devices. It does not cover parallel port SCSI devices, "ditto" tape 36devices. It does not cover parallel port SCSI devices, "ditto" tape
35drives or scanners. Many different devices are supported by the 37drives or scanners. Many different devices are supported by the
36parallel port IDE subsystem, including: 38parallel port IDE subsystem, including:
37 39
38 MicroSolutions backpack CD-ROM 40 - MicroSolutions backpack CD-ROM
39 MicroSolutions backpack PD/CD 41 - MicroSolutions backpack PD/CD
40 MicroSolutions backpack hard-drives 42 - MicroSolutions backpack hard-drives
41 MicroSolutions backpack 8000t tape drive 43 - MicroSolutions backpack 8000t tape drive
42 SyQuest EZ-135, EZ-230 & SparQ drives 44 - SyQuest EZ-135, EZ-230 & SparQ drives
43 Avatar Shark 45 - Avatar Shark
44 Imation Superdisk LS-120 46 - Imation Superdisk LS-120
45 Maxell Superdisk LS-120 47 - Maxell Superdisk LS-120
46 FreeCom Power CD 48 - FreeCom Power CD
47 Hewlett-Packard 5GB and 8GB tape drives 49 - Hewlett-Packard 5GB and 8GB tape drives
48 Hewlett-Packard 7100 and 7200 CD-RW drives 50 - Hewlett-Packard 7100 and 7200 CD-RW drives
49 51
50as well as most of the clone and no-name products on the market. 52as well as most of the clone and no-name products on the market.
51 53
52To support such a wide range of devices, PARIDE, the parallel port IDE 54To support such a wide range of devices, PARIDE, the parallel port IDE
53subsystem, is actually structured in three parts. There is a base 55subsystem, is actually structured in three parts. There is a base
54paride module which provides a registry and some common methods for 56paride module which provides a registry and some common methods for
55accessing the parallel ports. The second component is a set of 57accessing the parallel ports. The second component is a set of
56high-level drivers for each of the different types of supported devices: 58high-level drivers for each of the different types of supported devices:
57 59
60 === =============
58 pd IDE disk 61 pd IDE disk
59 pcd ATAPI CD-ROM 62 pcd ATAPI CD-ROM
60 pf ATAPI disk 63 pf ATAPI disk
61 pt ATAPI tape 64 pt ATAPI tape
62 pg ATAPI generic 65 pg ATAPI generic
66 === =============
63 67
64(Currently, the pg driver is only used with CD-R drives). 68(Currently, the pg driver is only used with CD-R drives).
65 69
66The high-level drivers function according to the relevant standards. 70The high-level drivers function according to the relevant standards.
67The third component of PARIDE is a set of low-level protocol drivers 71The third component of PARIDE is a set of low-level protocol drivers
68for each of the parallel port IDE adapter chips. Thanks to the interest 72for each of the parallel port IDE adapter chips. Thanks to the interest
69and encouragement of Linux users from many parts of the world, 73and encouragement of Linux users from many parts of the world,
70support is available for almost all known adapter protocols: 74support is available for almost all known adapter protocols:
71 75
76 ==== ====================================== ====
72 aten ATEN EH-100 (HK) 77 aten ATEN EH-100 (HK)
73 bpck Microsolutions backpack (US) 78 bpck Microsolutions backpack (US)
74 comm DataStor (old-type) "commuter" adapter (TW) 79 comm DataStor (old-type) "commuter" adapter (TW)
@@ -83,9 +88,11 @@ support is available for almost all known adapter protocols:
83 ktti KT Technology PHd adapter (SG) 88 ktti KT Technology PHd adapter (SG)
84 on20 OnSpec 90c20 (US) 89 on20 OnSpec 90c20 (US)
85 on26 OnSpec 90c26 (US) 90 on26 OnSpec 90c26 (US)
91 ==== ====================================== ====
86 92
87 93
882. Using the PARIDE subsystem 942. Using the PARIDE subsystem
95=============================
89 96
90While configuring the Linux kernel, you may choose either to build 97While configuring the Linux kernel, you may choose either to build
91the PARIDE drivers into your kernel, or to build them as modules. 98the PARIDE drivers into your kernel, or to build them as modules.
@@ -94,10 +101,10 @@ In either case, you will need to select "Parallel port IDE device support"
94as well as at least one of the high-level drivers and at least one 101as well as at least one of the high-level drivers and at least one
95of the parallel port communication protocols. If you do not know 102of the parallel port communication protocols. If you do not know
96what kind of parallel port adapter is used in your drive, you could 103what kind of parallel port adapter is used in your drive, you could
97begin by checking the file names and any text files on your DOS 104begin by checking the file names and any text files on your DOS
98installation floppy. Alternatively, you can look at the markings on 105installation floppy. Alternatively, you can look at the markings on
99the adapter chip itself. That's usually sufficient to identify the 106the adapter chip itself. That's usually sufficient to identify the
100correct device. 107correct device.
101 108
102You can actually select all the protocol modules, and allow the PARIDE 109You can actually select all the protocol modules, and allow the PARIDE
103subsystem to try them all for you. 110subsystem to try them all for you.
@@ -105,8 +112,9 @@ subsystem to try them all for you.
105For the "brand-name" products listed above, here are the protocol 112For the "brand-name" products listed above, here are the protocol
106and high-level drivers that you would use: 113and high-level drivers that you would use:
107 114
115 ================ ============ ====== ========
108 Manufacturer Model Driver Protocol 116 Manufacturer Model Driver Protocol
109 117 ================ ============ ====== ========
110 MicroSolutions CD-ROM pcd bpck 118 MicroSolutions CD-ROM pcd bpck
111 MicroSolutions PD drive pf bpck 119 MicroSolutions PD drive pf bpck
112 MicroSolutions hard-drive pd bpck 120 MicroSolutions hard-drive pd bpck
@@ -119,8 +127,10 @@ and high-level drivers that you would use:
119 Hewlett-Packard 5GB Tape pt epat 127 Hewlett-Packard 5GB Tape pt epat
120 Hewlett-Packard 7200e (CD) pcd epat 128 Hewlett-Packard 7200e (CD) pcd epat
121 Hewlett-Packard 7200e (CD-R) pg epat 129 Hewlett-Packard 7200e (CD-R) pg epat
130 ================ ============ ====== ========
122 131
1232.1 Configuring built-in drivers 1322.1 Configuring built-in drivers
133---------------------------------
124 134
125We recommend that you get to know how the drivers work and how to 135We recommend that you get to know how the drivers work and how to
126configure them as loadable modules, before attempting to compile a 136configure them as loadable modules, before attempting to compile a
@@ -143,7 +153,7 @@ protocol identification number and, for some devices, the drive's
143chain ID. While your system is booting, a number of messages are 153chain ID. While your system is booting, a number of messages are
144displayed on the console. Like all such messages, they can be 154displayed on the console. Like all such messages, they can be
145reviewed with the 'dmesg' command. Among those messages will be 155reviewed with the 'dmesg' command. Among those messages will be
146some lines like: 156some lines like::
147 157
148 paride: bpck registered as protocol 0 158 paride: bpck registered as protocol 0
149 paride: epat registered as protocol 1 159 paride: epat registered as protocol 1
@@ -158,10 +168,10 @@ the last two digits of the drive's serial number (but read MicroSolutions'
158documentation about this). 168documentation about this).
159 169
160As an example, let's assume that you have a MicroSolutions PD/CD drive 170As an example, let's assume that you have a MicroSolutions PD/CD drive
161with unit ID number 36 connected to the parallel port at 0x378, a SyQuest 171with unit ID number 36 connected to the parallel port at 0x378, a SyQuest
162EZ-135 connected to the chained port on the PD/CD drive and also an 172EZ-135 connected to the chained port on the PD/CD drive and also an
163Imation Superdisk connected to port 0x278. You could give the following 173Imation Superdisk connected to port 0x278. You could give the following
164options on your boot command: 174options on your boot command::
165 175
166 pd.drive0=0x378,1 pf.drive0=0x278,1 pf.drive1=0x378,0,36 176 pd.drive0=0x378,1 pf.drive0=0x278,1 pf.drive1=0x378,0,36
167 177
@@ -169,24 +179,27 @@ In the last option, pf.drive1 configures device /dev/pf1, the 0x378
169is the parallel port base address, the 0 is the protocol registration 179is the parallel port base address, the 0 is the protocol registration
170number and 36 is the chain ID. 180number and 36 is the chain ID.
171 181
172Please note: while PARIDE will work both with and without the 182Please note: while PARIDE will work both with and without the
173PARPORT parallel port sharing system that is included by the 183PARPORT parallel port sharing system that is included by the
174"Parallel port support" option, PARPORT must be included and enabled 184"Parallel port support" option, PARPORT must be included and enabled
175if you want to use chains of devices on the same parallel port. 185if you want to use chains of devices on the same parallel port.
176 186
1772.2 Loading and configuring PARIDE as modules 1872.2 Loading and configuring PARIDE as modules
188----------------------------------------------
178 189
179It is much faster and simpler to get to understand the PARIDE drivers 190It is much faster and simpler to get to understand the PARIDE drivers
180if you use them as loadable kernel modules. 191if you use them as loadable kernel modules.
181 192
182Note 1: using these drivers with the "kerneld" automatic module loading 193Note 1:
183system is not recommended for beginners, and is not documented here. 194 using these drivers with the "kerneld" automatic module loading
195 system is not recommended for beginners, and is not documented here.
184 196
185Note 2: if you build PARPORT support as a loadable module, PARIDE must 197Note 2:
186also be built as loadable modules, and PARPORT must be loaded before the 198 if you build PARPORT support as a loadable module, PARIDE must
187PARIDE modules. 199 also be built as loadable modules, and PARPORT must be loaded before
200 the PARIDE modules.
188 201
189To use PARIDE, you must begin by 202To use PARIDE, you must begin by::
190 203
191 insmod paride 204 insmod paride
192 205
@@ -195,8 +208,8 @@ among other tasks.
195 208
196Then, load as many of the protocol modules as you think you might need. 209Then, load as many of the protocol modules as you think you might need.
197As you load each module, it will register the protocols that it supports, 210As you load each module, it will register the protocols that it supports,
198and print a log message to your kernel log file and your console. For 211and print a log message to your kernel log file and your console. For
199example: 212example::
200 213
201 # insmod epat 214 # insmod epat
202 paride: epat registered as protocol 0 215 paride: epat registered as protocol 0
@@ -205,22 +218,22 @@ example:
205 paride: k971 registered as protocol 2 218 paride: k971 registered as protocol 2
206 219
207Finally, you can load high-level drivers for each kind of device that 220Finally, you can load high-level drivers for each kind of device that
208you have connected. By default, each driver will autoprobe for a single 221you have connected. By default, each driver will autoprobe for a single
209device, but you can support up to four similar devices by giving their 222device, but you can support up to four similar devices by giving their
210individual co-ordinates when you load the driver. 223individual co-ordinates when you load the driver.
211 224
212For example, if you had two no-name CD-ROM drives both using the 225For example, if you had two no-name CD-ROM drives both using the
213KingByte KBIC-951A adapter, one on port 0x378 and the other on 0x3bc 226KingByte KBIC-951A adapter, one on port 0x378 and the other on 0x3bc
214you could give the following command: 227you could give the following command::
215 228
216 # insmod pcd drive0=0x378,1 drive1=0x3bc,1 229 # insmod pcd drive0=0x378,1 drive1=0x3bc,1
217 230
218For most adapters, giving a port address and protocol number is sufficient, 231For most adapters, giving a port address and protocol number is sufficient,
219but check the source files in linux/drivers/block/paride for more 232but check the source files in linux/drivers/block/paride for more
220information. (Hopefully someone will write some man pages one day !). 233information. (Hopefully someone will write some man pages one day !).
221 234
222As another example, here's what happens when PARPORT is installed, and 235As another example, here's what happens when PARPORT is installed, and
223a SyQuest EZ-135 is attached to port 0x378: 236a SyQuest EZ-135 is attached to port 0x378::
224 237
225 # insmod paride 238 # insmod paride
226 paride: version 1.0 installed 239 paride: version 1.0 installed
@@ -237,46 +250,47 @@ Note that the last line is the output from the generic partition table
237scanner - in this case it reports that it has found a disk with one partition. 250scanner - in this case it reports that it has found a disk with one partition.
238 251
2392.3 Using a PARIDE device 2522.3 Using a PARIDE device
253--------------------------
240 254
241Once the drivers have been loaded, you can access PARIDE devices in the 255Once the drivers have been loaded, you can access PARIDE devices in the
242same way as their traditional counterparts. You will probably need to 256same way as their traditional counterparts. You will probably need to
243create the device "special files". Here is a simple script that you can 257create the device "special files". Here is a simple script that you can
244cut to a file and execute: 258cut to a file and execute::
245 259
246#!/bin/bash 260 #!/bin/bash
247# 261 #
248# mkd -- a script to create the device special files for the PARIDE subsystem 262 # mkd -- a script to create the device special files for the PARIDE subsystem
249# 263 #
250function mkdev { 264 function mkdev {
251 mknod $1 $2 $3 $4 ; chmod 0660 $1 ; chown root:disk $1 265 mknod $1 $2 $3 $4 ; chmod 0660 $1 ; chown root:disk $1
252} 266 }
253# 267 #
254function pd { 268 function pd {
255 D=$( printf \\$( printf "x%03x" $[ $1 + 97 ] ) ) 269 D=$( printf \\$( printf "x%03x" $[ $1 + 97 ] ) )
256 mkdev pd$D b 45 $[ $1 * 16 ] 270 mkdev pd$D b 45 $[ $1 * 16 ]
257 for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 271 for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
258 do mkdev pd$D$P b 45 $[ $1 * 16 + $P ] 272 do mkdev pd$D$P b 45 $[ $1 * 16 + $P ]
259 done 273 done
260} 274 }
261# 275 #
262cd /dev 276 cd /dev
263# 277 #
264for u in 0 1 2 3 ; do pd $u ; done 278 for u in 0 1 2 3 ; do pd $u ; done
265for u in 0 1 2 3 ; do mkdev pcd$u b 46 $u ; done 279 for u in 0 1 2 3 ; do mkdev pcd$u b 46 $u ; done
266for u in 0 1 2 3 ; do mkdev pf$u b 47 $u ; done 280 for u in 0 1 2 3 ; do mkdev pf$u b 47 $u ; done
267for u in 0 1 2 3 ; do mkdev pt$u c 96 $u ; done 281 for u in 0 1 2 3 ; do mkdev pt$u c 96 $u ; done
268for u in 0 1 2 3 ; do mkdev npt$u c 96 $[ $u + 128 ] ; done 282 for u in 0 1 2 3 ; do mkdev npt$u c 96 $[ $u + 128 ] ; done
269for u in 0 1 2 3 ; do mkdev pg$u c 97 $u ; done 283 for u in 0 1 2 3 ; do mkdev pg$u c 97 $u ; done
270# 284 #
271# end of mkd 285 # end of mkd
272 286
273With the device files and drivers in place, you can access PARIDE devices 287With the device files and drivers in place, you can access PARIDE devices
274like any other Linux device. For example, to mount a CD-ROM in pcd0, use: 288like any other Linux device. For example, to mount a CD-ROM in pcd0, use::
275 289
276 mount /dev/pcd0 /cdrom 290 mount /dev/pcd0 /cdrom
277 291
278If you have a fresh Avatar Shark cartridge, and the drive is pda, you 292If you have a fresh Avatar Shark cartridge, and the drive is pda, you
279might do something like: 293might do something like::
280 294
281 fdisk /dev/pda -- make a new partition table with 295 fdisk /dev/pda -- make a new partition table with
282 partition 1 of type 83 296 partition 1 of type 83
@@ -289,41 +303,46 @@ might do something like:
289 303
290Devices like the Imation superdisk work in the same way, except that 304Devices like the Imation superdisk work in the same way, except that
291they do not have a partition table. For example to make a 120MB 305they do not have a partition table. For example to make a 120MB
292floppy that you could share with a DOS system: 306floppy that you could share with a DOS system::
293 307
294 mkdosfs /dev/pf0 308 mkdosfs /dev/pf0
295 mount /dev/pf0 /mnt 309 mount /dev/pf0 /mnt
296 310
297 311
2982.4 The pf driver 3122.4 The pf driver
313------------------
299 314
300The pf driver is intended for use with parallel port ATAPI disk 315The pf driver is intended for use with parallel port ATAPI disk
301devices. The most common devices in this category are PD drives 316devices. The most common devices in this category are PD drives
302and LS-120 drives. Traditionally, media for these devices are not 317and LS-120 drives. Traditionally, media for these devices are not
303partitioned. Consequently, the pf driver does not support partitioned 318partitioned. Consequently, the pf driver does not support partitioned
304media. This may be changed in a future version of the driver. 319media. This may be changed in a future version of the driver.
305 320
3062.5 Using the pt driver 3212.5 Using the pt driver
322------------------------
307 323
308The pt driver for parallel port ATAPI tape drives is a minimal driver. 324The pt driver for parallel port ATAPI tape drives is a minimal driver.
309It does not yet support many of the standard tape ioctl operations. 325It does not yet support many of the standard tape ioctl operations.
310For best performance, a block size of 32KB should be used. You will 326For best performance, a block size of 32KB should be used. You will
311probably want to set the parallel port delay to 0, if you can. 327probably want to set the parallel port delay to 0, if you can.
312 328
3132.6 Using the pg driver 3292.6 Using the pg driver
330------------------------
314 331
315The pg driver can be used in conjunction with the cdrecord program 332The pg driver can be used in conjunction with the cdrecord program
316to create CD-ROMs. Please get cdrecord version 1.6.1 or later 333to create CD-ROMs. Please get cdrecord version 1.6.1 or later
317from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ . To record CD-R media 334from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ . To record CD-R media
318your parallel port should ideally be set to EPP mode, and the "port delay" 335your parallel port should ideally be set to EPP mode, and the "port delay"
319should be set to 0. With those settings it is possible to record at 2x 336should be set to 0. With those settings it is possible to record at 2x
320speed without any buffer underruns. If you cannot get the driver to work 337speed without any buffer underruns. If you cannot get the driver to work
321in EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only. 338in EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only.
322 339
323 340
3243. Troubleshooting 3413. Troubleshooting
342==================
325 343
3263.1 Use EPP mode if you can 3443.1 Use EPP mode if you can
345----------------------------
327 346
328The most common problems that people report with the PARIDE drivers 347The most common problems that people report with the PARIDE drivers
329concern the parallel port CMOS settings. At this time, none of the 348concern the parallel port CMOS settings. At this time, none of the
@@ -332,6 +351,7 @@ If you are able to do so, please set your parallel port into EPP mode
332using your CMOS setup procedure. 351using your CMOS setup procedure.
333 352
3343.2 Check the port delay 3533.2 Check the port delay
354-------------------------
335 355
336Some parallel ports cannot reliably transfer data at full speed. To 356Some parallel ports cannot reliably transfer data at full speed. To
337offset the errors, the PARIDE protocol modules introduce a "port 357offset the errors, the PARIDE protocol modules introduce a "port
@@ -347,23 +367,25 @@ read the comments at the beginning of the driver source files in
347linux/drivers/block/paride. 367linux/drivers/block/paride.
348 368
3493.3 Some drives need a printer reset 3693.3 Some drives need a printer reset
370-------------------------------------
350 371
351There appear to be a number of "noname" external drives on the market 372There appear to be a number of "noname" external drives on the market
352that do not always power up correctly. We have noticed this with some 373that do not always power up correctly. We have noticed this with some
353drives based on OnSpec and older Freecom adapters. In these rare cases, 374drives based on OnSpec and older Freecom adapters. In these rare cases,
354the adapter can often be reinitialised by issuing a "printer reset" on 375the adapter can often be reinitialised by issuing a "printer reset" on
355the parallel port. As the reset operation is potentially disruptive in 376the parallel port. As the reset operation is potentially disruptive in
356multiple device environments, the PARIDE drivers will not do it 377multiple device environments, the PARIDE drivers will not do it
357automatically. You can however, force a printer reset by doing: 378automatically. You can however, force a printer reset by doing::
358 379
359 insmod lp reset=1 380 insmod lp reset=1
360 rmmod lp 381 rmmod lp
361 382
362If you have one of these marginal cases, you should probably build 383If you have one of these marginal cases, you should probably build
363your paride drivers as modules, and arrange to do the printer reset 384your paride drivers as modules, and arrange to do the printer reset
364before loading the PARIDE drivers. 385before loading the PARIDE drivers.
365 386
3663.4 Use the verbose option and dmesg if you need help 3873.4 Use the verbose option and dmesg if you need help
388------------------------------------------------------
367 389
368While a lot of testing has gone into these drivers to make them work 390While a lot of testing has gone into these drivers to make them work
369as smoothly as possible, problems will arise. If you do have problems, 391as smoothly as possible, problems will arise. If you do have problems,
@@ -373,7 +395,7 @@ clues, then please make sure that only one drive is hooked to your system,
373and that either (a) PARPORT is enabled or (b) no other device driver 395and that either (a) PARPORT is enabled or (b) no other device driver
374is using your parallel port (check in /proc/ioports). Then, load the 396is using your parallel port (check in /proc/ioports). Then, load the
375appropriate drivers (you can load several protocol modules if you want) 397appropriate drivers (you can load several protocol modules if you want)
376as in: 398as in::
377 399
378 # insmod paride 400 # insmod paride
379 # insmod epat 401 # insmod epat
@@ -394,12 +416,14 @@ by e-mail to grant@torque.net, or join the linux-parport mailing list
394and post your report there. 416and post your report there.
395 417
3963.5 For more information or help 4183.5 For more information or help
419---------------------------------
397 420
398You can join the linux-parport mailing list by sending a mail message 421You can join the linux-parport mailing list by sending a mail message
399to 422to:
423
400 linux-parport-request@torque.net 424 linux-parport-request@torque.net
401 425
402with the single word 426with the single word::
403 427
404 subscribe 428 subscribe
405 429
@@ -412,6 +436,4 @@ have in your mail headers, when sending mail to the list server.
412You might also find some useful information on the linux-parport 436You might also find some useful information on the linux-parport
413web pages (although they are not always up to date) at 437web pages (although they are not always up to date) at
414 438
415 http://web.archive.org/web/*/http://www.torque.net/parport/ 439 http://web.archive.org/web/%2E/http://www.torque.net/parport/
416
417
diff --git a/Documentation/blockdev/ramdisk.txt b/Documentation/admin-guide/blockdev/ramdisk.rst
index 501e12e0323e..b7c2268f8dec 100644
--- a/Documentation/blockdev/ramdisk.txt
+++ b/Documentation/admin-guide/blockdev/ramdisk.rst
@@ -1,7 +1,8 @@
1==========================================
1Using the RAM disk block device with Linux 2Using the RAM disk block device with Linux
2------------------------------------------ 3==========================================
3 4
4Contents: 5.. Contents:
5 6
6 1) Overview 7 1) Overview
7 2) Kernel Command Line Parameters 8 2) Kernel Command Line Parameters
@@ -42,7 +43,7 @@ rescue floppy disk.
422a) Kernel Command Line Parameters 432a) Kernel Command Line Parameters
43 44
44 ramdisk_size=N 45 ramdisk_size=N
45 ============== 46 Size of the ramdisk.
46 47
47This parameter tells the RAM disk driver to set up RAM disks of N k size. The 48This parameter tells the RAM disk driver to set up RAM disks of N k size. The
48default is 4096 (4 MB). 49default is 4096 (4 MB).
@@ -50,16 +51,13 @@ default is 4096 (4 MB).
502b) Module parameters 512b) Module parameters
51 52
52 rd_nr 53 rd_nr
53 ===== 54 /dev/ramX devices created.
54 /dev/ramX devices created.
55 55
56 max_part 56 max_part
57 ======== 57 Maximum partition number.
58 Maximum partition number.
59 58
60 rd_size 59 rd_size
61 ======= 60 See ramdisk_size.
62 See ramdisk_size.
63 61
643) Using "rdev -r" 623) Using "rdev -r"
65------------------ 63------------------
@@ -71,11 +69,11 @@ to 2 MB (2^11) of where to find the RAM disk (this used to be the size). Bit
71prompt/wait sequence is to be given before trying to read the RAM disk. Since 69prompt/wait sequence is to be given before trying to read the RAM disk. Since
72the RAM disk dynamically grows as data is being written into it, a size field 70the RAM disk dynamically grows as data is being written into it, a size field
73is not required. Bits 11 to 13 are not currently used and may as well be zero. 71is not required. Bits 11 to 13 are not currently used and may as well be zero.
74These numbers are no magical secrets, as seen below: 72These numbers are no magical secrets, as seen below::
75 73
76./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF 74 ./arch/x86/kernel/setup.c:#define RAMDISK_IMAGE_START_MASK 0x07FF
77./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000 75 ./arch/x86/kernel/setup.c:#define RAMDISK_PROMPT_FLAG 0x8000
78./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000 76 ./arch/x86/kernel/setup.c:#define RAMDISK_LOAD_FLAG 0x4000
79 77
80Consider a typical two floppy disk setup, where you will have the 78Consider a typical two floppy disk setup, where you will have the
81kernel on disk one, and have already put a RAM disk image onto disk #2. 79kernel on disk one, and have already put a RAM disk image onto disk #2.
@@ -92,20 +90,23 @@ sequence so that you have a chance to switch floppy disks.
92The command line equivalent is: "prompt_ramdisk=1" 90The command line equivalent is: "prompt_ramdisk=1"
93 91
94Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word. 92Putting that together gives 2^15 + 2^14 + 0 = 49152 for an rdev word.
95So to create disk one of the set, you would do: 93So to create disk one of the set, you would do::
96 94
97 /usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0 95 /usr/src/linux# cat arch/x86/boot/zImage > /dev/fd0
98 /usr/src/linux# rdev /dev/fd0 /dev/fd0 96 /usr/src/linux# rdev /dev/fd0 /dev/fd0
99 /usr/src/linux# rdev -r /dev/fd0 49152 97 /usr/src/linux# rdev -r /dev/fd0 49152
100 98
101If you make a boot disk that has LILO, then for the above, you would use: 99If you make a boot disk that has LILO, then for the above, you would use::
100
102 append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1" 101 append = "ramdisk_start=0 load_ramdisk=1 prompt_ramdisk=1"
103Since the default start = 0 and the default prompt = 1, you could use: 102
103Since the default start = 0 and the default prompt = 1, you could use::
104
104 append = "load_ramdisk=1" 105 append = "load_ramdisk=1"
105 106
106 107
1074) An Example of Creating a Compressed RAM Disk 1084) An Example of Creating a Compressed RAM Disk
108---------------------------------------------- 109-----------------------------------------------
109 110
110To create a RAM disk image, you will need a spare block device to 111To create a RAM disk image, you will need a spare block device to
111construct it on. This can be the RAM disk device itself, or an 112construct it on. This can be the RAM disk device itself, or an
@@ -120,11 +121,11 @@ a) Decide on the RAM disk size that you want. Say 2 MB for this example.
120 Create it by writing to the RAM disk device. (This step is not currently 121 Create it by writing to the RAM disk device. (This step is not currently
121 required, but may be in the future.) It is wise to zero out the 122 required, but may be in the future.) It is wise to zero out the
122 area (esp. for disks) so that maximal compression is achieved for 123 area (esp. for disks) so that maximal compression is achieved for
123 the unused blocks of the image that you are about to create. 124 the unused blocks of the image that you are about to create::
124 125
125 dd if=/dev/zero of=/dev/ram0 bs=1k count=2048 126 dd if=/dev/zero of=/dev/ram0 bs=1k count=2048
126 127
127b) Make a filesystem on it. Say ext2fs for this example. 128b) Make a filesystem on it. Say ext2fs for this example::
128 129
129 mke2fs -vm0 /dev/ram0 2048 130 mke2fs -vm0 /dev/ram0 2048
130 131
@@ -133,11 +134,11 @@ c) Mount it, copy the files you want to it (eg: /etc/* /dev/* ...)
133 134
134d) Compress the contents of the RAM disk. The level of compression 135d) Compress the contents of the RAM disk. The level of compression
135 will be approximately 50% of the space used by the files. Unused 136 will be approximately 50% of the space used by the files. Unused
136 space on the RAM disk will compress to almost nothing. 137 space on the RAM disk will compress to almost nothing::
137 138
138 dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz 139 dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz
139 140
140e) Put the kernel onto the floppy 141e) Put the kernel onto the floppy::
141 142
142 dd if=zImage of=/dev/fd0 bs=1k 143 dd if=zImage of=/dev/fd0 bs=1k
143 144
@@ -146,13 +147,13 @@ f) Put the RAM disk image onto the floppy, after the kernel. Use an offset
146 (possibly larger) kernel onto the same floppy later without overlapping 147 (possibly larger) kernel onto the same floppy later without overlapping
147 the RAM disk image. An offset of 400 kB for kernels about 350 kB in 148 the RAM disk image. An offset of 400 kB for kernels about 350 kB in
148 size would be reasonable. Make sure offset+size of ram_image.gz is 149 size would be reasonable. Make sure offset+size of ram_image.gz is
149 not larger than the total space on your floppy (usually 1440 kB). 150 not larger than the total space on your floppy (usually 1440 kB)::
150 151
151 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 152 dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400
152 153
153g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc. 154g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc.
154 For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would 155 For prompt_ramdisk=1, load_ramdisk=1, ramdisk_start=400, one would
155 have 2^15 + 2^14 + 400 = 49552. 156 have 2^15 + 2^14 + 400 = 49552::
156 157
157 rdev /dev/fd0 /dev/fd0 158 rdev /dev/fd0 /dev/fd0
158 rdev -r /dev/fd0 49552 159 rdev -r /dev/fd0 49552
@@ -160,15 +161,17 @@ g) Use "rdev" to set the boot device, RAM disk offset, prompt flag, etc.
160That is it. You now have your boot/root compressed RAM disk floppy. Some 161That is it. You now have your boot/root compressed RAM disk floppy. Some
161users may wish to combine steps (d) and (f) by using a pipe. 162users may wish to combine steps (d) and (f) by using a pipe.
162 163
163-------------------------------------------------------------------------- 164
164 Paul Gortmaker 12/95 165 Paul Gortmaker 12/95
165 166
166Changelog: 167Changelog:
167---------- 168----------
168 169
16910-22-04 : Updated to reflect changes in command line options, remove 17010-22-04 :
171 Updated to reflect changes in command line options, remove
170 obsolete references, general cleanup. 172 obsolete references, general cleanup.
171 James Nelson (james4765@gmail.com) 173 James Nelson (james4765@gmail.com)
172 174
173 175
17412-95 : Original Document 17612-95 :
177 Original Document
diff --git a/Documentation/blockdev/zram.txt b/Documentation/admin-guide/blockdev/zram.rst
index 4df0ce271085..6eccf13219ff 100644
--- a/Documentation/blockdev/zram.txt
+++ b/Documentation/admin-guide/blockdev/zram.rst
@@ -1,7 +1,9 @@
1========================================
1zram: Compressed RAM based block devices 2zram: Compressed RAM based block devices
2---------------------------------------- 3========================================
3 4
4* Introduction 5Introduction
6============
5 7
6The zram module creates RAM based block devices named /dev/zram<id> 8The zram module creates RAM based block devices named /dev/zram<id>
7(<id> = 0, 1, ...). Pages written to these disks are compressed and stored 9(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
@@ -12,9 +14,11 @@ use as swap disks, various caches under /var and maybe many more :)
12Statistics for individual zram devices are exported through sysfs nodes at 14Statistics for individual zram devices are exported through sysfs nodes at
13/sys/block/zram<id>/ 15/sys/block/zram<id>/
14 16
15* Usage 17Usage
18=====
16 19
17There are several ways to configure and manage zram device(-s): 20There are several ways to configure and manage zram device(-s):
21
18a) using zram and zram_control sysfs attributes 22a) using zram and zram_control sysfs attributes
19b) using zramctl utility, provided by util-linux (util-linux@vger.kernel.org). 23b) using zramctl utility, provided by util-linux (util-linux@vger.kernel.org).
20 24
@@ -22,7 +26,7 @@ In this document we will describe only 'manual' zram configuration steps,
22IOW, zram and zram_control sysfs attributes. 26IOW, zram and zram_control sysfs attributes.
23 27
24In order to get a better idea about zramctl please consult util-linux 28In order to get a better idea about zramctl please consult util-linux
25documentation, zramctl man-page or `zramctl --help'. Please be informed 29documentation, zramctl man-page or `zramctl --help`. Please be informed
26that zram maintainers do not develop/maintain util-linux or zramctl, should 30that zram maintainers do not develop/maintain util-linux or zramctl, should
27you have any questions please contact util-linux@vger.kernel.org 31you have any questions please contact util-linux@vger.kernel.org
28 32
@@ -30,19 +34,23 @@ Following shows a typical sequence of steps for using zram.
30 34
31WARNING 35WARNING
32======= 36=======
37
33For the sake of simplicity we skip error checking parts in most of the 38For the sake of simplicity we skip error checking parts in most of the
34examples below. However, it is your sole responsibility to handle errors. 39examples below. However, it is your sole responsibility to handle errors.
35 40
36zram sysfs attributes always return negative values in case of errors. 41zram sysfs attributes always return negative values in case of errors.
37The list of possible return codes: 42The list of possible return codes:
38-EBUSY -- an attempt to modify an attribute that cannot be changed once 43
39the device has been initialised. Please reset device first; 44======== =============================================================
40-ENOMEM -- zram was not able to allocate enough memory to fulfil your 45-EBUSY an attempt to modify an attribute that cannot be changed once
41needs; 46 the device has been initialised. Please reset device first;
42-EINVAL -- invalid input has been provided. 47-ENOMEM zram was not able to allocate enough memory to fulfil your
48 needs;
49-EINVAL invalid input has been provided.
50======== =============================================================
43 51
44If you use 'echo', the returned value that is changed by 'echo' utility, 52If you use 'echo', the returned value that is changed by 'echo' utility,
45and, in general case, something like: 53and, in general case, something like::
46 54
47 echo 3 > /sys/block/zram0/max_comp_streams 55 echo 3 > /sys/block/zram0/max_comp_streams
48 if [ $? -ne 0 ]; 56 if [ $? -ne 0 ];
@@ -51,7 +59,11 @@ and, in general case, something like:
51 59
52should suffice. 60should suffice.
53 61
541) Load Module: 621) Load Module
63==============
64
65::
66
55 modprobe zram num_devices=4 67 modprobe zram num_devices=4
56 This creates 4 devices: /dev/zram{0,1,2,3} 68 This creates 4 devices: /dev/zram{0,1,2,3}
57 69
@@ -59,6 +71,8 @@ num_devices parameter is optional and tells zram how many devices should be
59pre-created. Default: 1. 71pre-created. Default: 1.
60 72
612) Set max number of compression streams 732) Set max number of compression streams
74========================================
75
62Regardless the value passed to this attribute, ZRAM will always 76Regardless the value passed to this attribute, ZRAM will always
63allocate multiple compression streams - one per online CPUs - thus 77allocate multiple compression streams - one per online CPUs - thus
64allowing several concurrent compression operations. The number of 78allowing several concurrent compression operations. The number of
@@ -66,16 +80,20 @@ allocated compression streams goes down when some of the CPUs
66become offline. There is no single-compression-stream mode anymore, 80become offline. There is no single-compression-stream mode anymore,
67unless you are running a UP system or has only 1 CPU online. 81unless you are running a UP system or has only 1 CPU online.
68 82
69To find out how many streams are currently available: 83To find out how many streams are currently available::
84
70 cat /sys/block/zram0/max_comp_streams 85 cat /sys/block/zram0/max_comp_streams
71 86
723) Select compression algorithm 873) Select compression algorithm
88===============================
89
73Using comp_algorithm device attribute one can see available and 90Using comp_algorithm device attribute one can see available and
74currently selected (shown in square brackets) compression algorithms, 91currently selected (shown in square brackets) compression algorithms,
75change selected compression algorithm (once the device is initialised 92change selected compression algorithm (once the device is initialised
76there is no way to change compression algorithm). 93there is no way to change compression algorithm).
77 94
78Examples: 95Examples::
96
79 #show supported compression algorithms 97 #show supported compression algorithms
80 cat /sys/block/zram0/comp_algorithm 98 cat /sys/block/zram0/comp_algorithm
81 lzo [lz4] 99 lzo [lz4]
@@ -83,20 +101,23 @@ Examples:
83 #select lzo compression algorithm 101 #select lzo compression algorithm
84 echo lzo > /sys/block/zram0/comp_algorithm 102 echo lzo > /sys/block/zram0/comp_algorithm
85 103
86For the time being, the `comp_algorithm' content does not necessarily 104For the time being, the `comp_algorithm` content does not necessarily
87show every compression algorithm supported by the kernel. We keep this 105show every compression algorithm supported by the kernel. We keep this
88list primarily to simplify device configuration and one can configure 106list primarily to simplify device configuration and one can configure
89a new device with a compression algorithm that is not listed in 107a new device with a compression algorithm that is not listed in
90`comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API 108`comp_algorithm`. The thing is that, internally, ZRAM uses Crypto API
91and, if some of the algorithms were built as modules, it's impossible 109and, if some of the algorithms were built as modules, it's impossible
92to list all of them using, for instance, /proc/crypto or any other 110to list all of them using, for instance, /proc/crypto or any other
93method. This, however, has an advantage of permitting the usage of 111method. This, however, has an advantage of permitting the usage of
94custom crypto compression modules (implementing S/W or H/W compression). 112custom crypto compression modules (implementing S/W or H/W compression).
95 113
964) Set Disksize 1144) Set Disksize
115===============
116
97Set disk size by writing the value to sysfs node 'disksize'. 117Set disk size by writing the value to sysfs node 'disksize'.
98The value can be either in bytes or you can use mem suffixes. 118The value can be either in bytes or you can use mem suffixes.
99Examples: 119Examples::
120
100 # Initialize /dev/zram0 with 50MB disksize 121 # Initialize /dev/zram0 with 50MB disksize
101 echo $((50*1024*1024)) > /sys/block/zram0/disksize 122 echo $((50*1024*1024)) > /sys/block/zram0/disksize
102 123
@@ -111,10 +132,13 @@ since we expect a 2:1 compression ratio. Note that zram uses about 0.1% of the
111size of the disk when not in use so a huge zram is wasteful. 132size of the disk when not in use so a huge zram is wasteful.
112 133
1135) Set memory limit: Optional 1345) Set memory limit: Optional
135=============================
136
114Set memory limit by writing the value to sysfs node 'mem_limit'. 137Set memory limit by writing the value to sysfs node 'mem_limit'.
115The value can be either in bytes or you can use mem suffixes. 138The value can be either in bytes or you can use mem suffixes.
116In addition, you could change the value in runtime. 139In addition, you could change the value in runtime.
117Examples: 140Examples::
141
118 # limit /dev/zram0 with 50MB memory 142 # limit /dev/zram0 with 50MB memory
119 echo $((50*1024*1024)) > /sys/block/zram0/mem_limit 143 echo $((50*1024*1024)) > /sys/block/zram0/mem_limit
120 144
@@ -126,7 +150,11 @@ Examples:
126 # To disable memory limit 150 # To disable memory limit
127 echo 0 > /sys/block/zram0/mem_limit 151 echo 0 > /sys/block/zram0/mem_limit
128 152
1296) Activate: 1536) Activate
154===========
155
156::
157
130 mkswap /dev/zram0 158 mkswap /dev/zram0
131 swapon /dev/zram0 159 swapon /dev/zram0
132 160
@@ -134,6 +162,7 @@ Examples:
134 mount /dev/zram1 /tmp 162 mount /dev/zram1 /tmp
135 163
1367) Add/remove zram devices 1647) Add/remove zram devices
165==========================
137 166
138zram provides a control interface, which enables dynamic (on-demand) device 167zram provides a control interface, which enables dynamic (on-demand) device
139addition and removal. 168addition and removal.
@@ -142,44 +171,51 @@ In order to add a new /dev/zramX device, perform read operation on hot_add
142attribute. This will return either new device's device id (meaning that you 171attribute. This will return either new device's device id (meaning that you
143can use /dev/zram<id>) or error code. 172can use /dev/zram<id>) or error code.
144 173
145Example: 174Example::
175
146 cat /sys/class/zram-control/hot_add 176 cat /sys/class/zram-control/hot_add
147 1 177 1
148 178
149To remove the existing /dev/zramX device (where X is a device id) 179To remove the existing /dev/zramX device (where X is a device id)
150execute 180execute::
181
151 echo X > /sys/class/zram-control/hot_remove 182 echo X > /sys/class/zram-control/hot_remove
152 183
1538) Stats: 1848) Stats
185========
186
154Per-device statistics are exported as various nodes under /sys/block/zram<id>/ 187Per-device statistics are exported as various nodes under /sys/block/zram<id>/
155 188
156A brief description of exported device attributes. For more details please 189A brief description of exported device attributes. For more details please
157read Documentation/ABI/testing/sysfs-block-zram. 190read Documentation/ABI/testing/sysfs-block-zram.
158 191
192====================== ====== ===============================================
159Name access description 193Name access description
160---- ------ ----------- 194====================== ====== ===============================================
161disksize RW show and set the device's disk size 195disksize RW show and set the device's disk size
162initstate RO shows the initialization state of the device 196initstate RO shows the initialization state of the device
163reset WO trigger device reset 197reset WO trigger device reset
164mem_used_max WO reset the `mem_used_max' counter (see later) 198mem_used_max WO reset the `mem_used_max` counter (see later)
165mem_limit WO specifies the maximum amount of memory ZRAM can use 199mem_limit WO specifies the maximum amount of memory ZRAM can
166 to store the compressed data 200 use to store the compressed data
167writeback_limit WO specifies the maximum amount of write IO zram can 201writeback_limit WO specifies the maximum amount of write IO zram
168 write out to backing device as 4KB unit 202 can write out to backing device as 4KB unit
169writeback_limit_enable RW show and set writeback_limit feature 203writeback_limit_enable RW show and set writeback_limit feature
170max_comp_streams RW the number of possible concurrent compress operations 204max_comp_streams RW the number of possible concurrent compress
205 operations
171comp_algorithm RW show and change the compression algorithm 206comp_algorithm RW show and change the compression algorithm
172compact WO trigger memory compaction 207compact WO trigger memory compaction
173debug_stat RO this file is used for zram debugging purposes 208debug_stat RO this file is used for zram debugging purposes
174backing_dev RW set up backend storage for zram to write out 209backing_dev RW set up backend storage for zram to write out
175idle WO mark allocated slot as idle 210idle WO mark allocated slot as idle
211====================== ====== ===============================================
176 212
177 213
178User space is advised to use the following files to read the device statistics. 214User space is advised to use the following files to read the device statistics.
179 215
180File /sys/block/zram<id>/stat 216File /sys/block/zram<id>/stat
181 217
182Represents block layer statistics. Read Documentation/block/stat.txt for 218Represents block layer statistics. Read Documentation/block/stat.rst for
183details. 219details.
184 220
185File /sys/block/zram<id>/io_stat 221File /sys/block/zram<id>/io_stat
@@ -188,23 +224,31 @@ The stat file represents device's I/O statistics not accounted by block
188layer and, thus, not available in zram<id>/stat file. It consists of a 224layer and, thus, not available in zram<id>/stat file. It consists of a
189single line of text and contains the following stats separated by 225single line of text and contains the following stats separated by
190whitespace: 226whitespace:
191 failed_reads the number of failed reads 227
192 failed_writes the number of failed writes 228 ============= =============================================================
193 invalid_io the number of non-page-size-aligned I/O requests 229 failed_reads The number of failed reads
230 failed_writes The number of failed writes
231 invalid_io The number of non-page-size-aligned I/O requests
194 notify_free Depending on device usage scenario it may account 232 notify_free Depending on device usage scenario it may account
233
195 a) the number of pages freed because of swap slot free 234 a) the number of pages freed because of swap slot free
196 notifications or b) the number of pages freed because of 235 notifications
197 REQ_OP_DISCARD requests sent by bio. The former ones are 236 b) the number of pages freed because of
198 sent to a swap block device when a swap slot is freed, 237 REQ_OP_DISCARD requests sent by bio. The former ones are
199 which implies that this disk is being used as a swap disk. 238 sent to a swap block device when a swap slot is freed,
239 which implies that this disk is being used as a swap disk.
240
200 The latter ones are sent by filesystem mounted with 241 The latter ones are sent by filesystem mounted with
201 discard option, whenever some data blocks are getting 242 discard option, whenever some data blocks are getting
202 discarded. 243 discarded.
244 ============= =============================================================
203 245
204File /sys/block/zram<id>/mm_stat 246File /sys/block/zram<id>/mm_stat
205 247
206The stat file represents device's mm statistics. It consists of a single 248The stat file represents device's mm statistics. It consists of a single
207line of text and contains the following stats separated by whitespace: 249line of text and contains the following stats separated by whitespace:
250
251 ================ =============================================================
208 orig_data_size uncompressed size of data stored in this disk. 252 orig_data_size uncompressed size of data stored in this disk.
209 This excludes same-element-filled pages (same_pages) since 253 This excludes same-element-filled pages (same_pages) since
210 no memory is allocated for them. 254 no memory is allocated for them.
@@ -223,58 +267,71 @@ line of text and contains the following stats separated by whitespace:
223 No memory is allocated for such pages. 267 No memory is allocated for such pages.
224 pages_compacted the number of pages freed during compaction 268 pages_compacted the number of pages freed during compaction
225 huge_pages the number of incompressible pages 269 huge_pages the number of incompressible pages
270 ================ =============================================================
226 271
227File /sys/block/zram<id>/bd_stat 272File /sys/block/zram<id>/bd_stat
228 273
229The stat file represents device's backing device statistics. It consists of 274The stat file represents device's backing device statistics. It consists of
230a single line of text and contains the following stats separated by whitespace: 275a single line of text and contains the following stats separated by whitespace:
276
277 ============== =============================================================
231 bd_count size of data written in backing device. 278 bd_count size of data written in backing device.
232 Unit: 4K bytes 279 Unit: 4K bytes
233 bd_reads the number of reads from backing device 280 bd_reads the number of reads from backing device
234 Unit: 4K bytes 281 Unit: 4K bytes
235 bd_writes the number of writes to backing device 282 bd_writes the number of writes to backing device
236 Unit: 4K bytes 283 Unit: 4K bytes
284 ============== =============================================================
285
2869) Deactivate
287=============
288
289::
237 290
2389) Deactivate:
239 swapoff /dev/zram0 291 swapoff /dev/zram0
240 umount /dev/zram1 292 umount /dev/zram1
241 293
24210) Reset: 29410) Reset
243 Write any positive value to 'reset' sysfs node 295=========
244 echo 1 > /sys/block/zram0/reset 296
245 echo 1 > /sys/block/zram1/reset 297 Write any positive value to 'reset' sysfs node::
298
299 echo 1 > /sys/block/zram0/reset
300 echo 1 > /sys/block/zram1/reset
246 301
247 This frees all the memory allocated for the given device and 302 This frees all the memory allocated for the given device and
248 resets the disksize to zero. You must set the disksize again 303 resets the disksize to zero. You must set the disksize again
249 before reusing the device. 304 before reusing the device.
250 305
251* Optional Feature 306Optional Feature
307================
252 308
253= writeback 309writeback
310---------
254 311
255With CONFIG_ZRAM_WRITEBACK, zram can write idle/incompressible page 312With CONFIG_ZRAM_WRITEBACK, zram can write idle/incompressible page
256to backing storage rather than keeping it in memory. 313to backing storage rather than keeping it in memory.
257To use the feature, admin should set up backing device via 314To use the feature, admin should set up backing device via::
258 315
259 "echo /dev/sda5 > /sys/block/zramX/backing_dev" 316 echo /dev/sda5 > /sys/block/zramX/backing_dev
260 317
261before disksize setting. It supports only partition at this moment. 318before disksize setting. It supports only partition at this moment.
262If admin want to use incompressible page writeback, they could do via 319If admin want to use incompressible page writeback, they could do via::
263 320
264 "echo huge > /sys/block/zramX/write" 321 echo huge > /sys/block/zramX/write
265 322
266To use idle page writeback, first, user need to declare zram pages 323To use idle page writeback, first, user need to declare zram pages
267as idle. 324as idle::
268 325
269 "echo all > /sys/block/zramX/idle" 326 echo all > /sys/block/zramX/idle
270 327
271From now on, any pages on zram are idle pages. The idle mark 328From now on, any pages on zram are idle pages. The idle mark
272will be removed until someone request access of the block. 329will be removed until someone request access of the block.
273IOW, unless there is access request, those pages are still idle pages. 330IOW, unless there is access request, those pages are still idle pages.
274 331
275Admin can request writeback of those idle pages at right timing via 332Admin can request writeback of those idle pages at right timing via::
276 333
277 "echo idle > /sys/block/zramX/writeback" 334 echo idle > /sys/block/zramX/writeback
278 335
279With the command, zram writeback idle pages from memory to the storage. 336With the command, zram writeback idle pages from memory to the storage.
280 337
@@ -285,7 +342,7 @@ to guarantee storage health for entire product life.
285To overcome the concern, zram supports "writeback_limit" feature. 342To overcome the concern, zram supports "writeback_limit" feature.
286The "writeback_limit_enable"'s default value is 0 so that it doesn't limit 343The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
287any writeback. IOW, if admin want to apply writeback budget, he should 344any writeback. IOW, if admin want to apply writeback budget, he should
288enable writeback_limit_enable via 345enable writeback_limit_enable via::
289 346
290 $ echo 1 > /sys/block/zramX/writeback_limit_enable 347 $ echo 1 > /sys/block/zramX/writeback_limit_enable
291 348
@@ -296,7 +353,7 @@ until admin set the budget via /sys/block/zramX/writeback_limit.
296assigned via /sys/block/zramX/writeback_limit is meaninless.) 353assigned via /sys/block/zramX/writeback_limit is meaninless.)
297 354
298If admin want to limit writeback as per-day 400M, he could do it 355If admin want to limit writeback as per-day 400M, he could do it
299like below. 356like below::
300 357
301 $ MB_SHIFT=20 358 $ MB_SHIFT=20
302 $ 4K_SHIFT=12 359 $ 4K_SHIFT=12
@@ -305,16 +362,16 @@ like below.
305 $ echo 1 > /sys/block/zram0/writeback_limit_enable 362 $ echo 1 > /sys/block/zram0/writeback_limit_enable
306 363
307If admin want to allow further write again once the bugdet is exausted, 364If admin want to allow further write again once the bugdet is exausted,
308he could do it like below 365he could do it like below::
309 366
310 $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \ 367 $ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
311 /sys/block/zram0/writeback_limit 368 /sys/block/zram0/writeback_limit
312 369
313If admin want to see remaining writeback budget since he set, 370If admin want to see remaining writeback budget since he set::
314 371
315 $ cat /sys/block/zramX/writeback_limit 372 $ cat /sys/block/zramX/writeback_limit
316 373
317If admin want to disable writeback limit, he could do 374If admin want to disable writeback limit, he could do::
318 375
319 $ echo 0 > /sys/block/zramX/writeback_limit_enable 376 $ echo 0 > /sys/block/zramX/writeback_limit_enable
320 377
@@ -326,25 +383,35 @@ budget in next setting is user's job.
326If admin want to measure writeback count in a certain period, he could 383If admin want to measure writeback count in a certain period, he could
327know it via /sys/block/zram0/bd_stat's 3rd column. 384know it via /sys/block/zram0/bd_stat's 3rd column.
328 385
329= memory tracking 386memory tracking
387===============
330 388
331With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the 389With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the
332zram block. It could be useful to catch cold or incompressible 390zram block. It could be useful to catch cold or incompressible
333pages of the process with*pagemap. 391pages of the process with*pagemap.
392
334If you enable the feature, you could see block state via 393If you enable the feature, you could see block state via
335/sys/kernel/debug/zram/zram0/block_state". The output is as follows, 394/sys/kernel/debug/zram/zram0/block_state". The output is as follows::
336 395
337 300 75.033841 .wh. 396 300 75.033841 .wh.
338 301 63.806904 s... 397 301 63.806904 s...
339 302 63.806919 ..hi 398 302 63.806919 ..hi
340 399
341First column is zram's block index. 400First column
342Second column is access time since the system was booted 401 zram's block index.
343Third column is state of the block. 402Second column
344(s: same page 403 access time since the system was booted
345w: written page to backing store 404Third column
346h: huge page 405 state of the block:
347i: idle page) 406
407 s:
408 same page
409 w:
410 written page to backing store
411 h:
412 huge page
413 i:
414 idle page
348 415
349First line of above example says 300th block is accessed at 75.033841sec 416First line of above example says 300th block is accessed at 75.033841sec
350and the block's state is huge so it is written back to the backing 417and the block's state is huge so it is written back to the backing
diff --git a/Documentation/btmrvl.txt b/Documentation/admin-guide/btmrvl.rst
index ec57740ead0c..ec57740ead0c 100644
--- a/Documentation/btmrvl.txt
+++ b/Documentation/admin-guide/btmrvl.rst
diff --git a/Documentation/admin-guide/bug-hunting.rst b/Documentation/admin-guide/bug-hunting.rst
index b761aa2a51d2..44b8a4edd348 100644
--- a/Documentation/admin-guide/bug-hunting.rst
+++ b/Documentation/admin-guide/bug-hunting.rst
@@ -90,9 +90,9 @@ the disk is not available then you have three options:
90 run a null modem to a second machine and capture the output there 90 run a null modem to a second machine and capture the output there
91 using your favourite communication program. Minicom works well. 91 using your favourite communication program. Minicom works well.
92 92
93(3) Use Kdump (see Documentation/kdump/kdump.rst), 93(3) Use Kdump (see Documentation/admin-guide/kdump/kdump.rst),
94 extract the kernel ring buffer from old memory with using dmesg 94 extract the kernel ring buffer from old memory with using dmesg
95 gdbmacro in Documentation/kdump/gdbmacros.txt. 95 gdbmacro in Documentation/admin-guide/kdump/gdbmacros.txt.
96 96
97Finding the bug's location 97Finding the bug's location
98-------------------------- 98--------------------------
diff --git a/Documentation/cgroup-v1/blkio-controller.rst b/Documentation/admin-guide/cgroup-v1/blkio-controller.rst
index 1d7d962933be..1d7d962933be 100644
--- a/Documentation/cgroup-v1/blkio-controller.rst
+++ b/Documentation/admin-guide/cgroup-v1/blkio-controller.rst
diff --git a/Documentation/cgroup-v1/cgroups.rst b/Documentation/admin-guide/cgroup-v1/cgroups.rst
index 46bbe7e022d4..b0688011ed06 100644
--- a/Documentation/cgroup-v1/cgroups.rst
+++ b/Documentation/admin-guide/cgroup-v1/cgroups.rst
@@ -3,7 +3,7 @@ Control Groups
3============== 3==============
4 4
5Written by Paul Menage <menage@google.com> based on 5Written by Paul Menage <menage@google.com> based on
6Documentation/cgroup-v1/cpusets.rst 6Documentation/admin-guide/cgroup-v1/cpusets.rst
7 7
8Original copyright statements from cpusets.txt: 8Original copyright statements from cpusets.txt:
9 9
@@ -76,7 +76,7 @@ On their own, the only use for cgroups is for simple job
76tracking. The intention is that other subsystems hook into the generic 76tracking. The intention is that other subsystems hook into the generic
77cgroup support to provide new attributes for cgroups, such as 77cgroup support to provide new attributes for cgroups, such as
78accounting/limiting the resources which processes in a cgroup can 78accounting/limiting the resources which processes in a cgroup can
79access. For example, cpusets (see Documentation/cgroup-v1/cpusets.rst) allow 79access. For example, cpusets (see Documentation/admin-guide/cgroup-v1/cpusets.rst) allow
80you to associate a set of CPUs and a set of memory nodes with the 80you to associate a set of CPUs and a set of memory nodes with the
81tasks in each cgroup. 81tasks in each cgroup.
82 82
diff --git a/Documentation/cgroup-v1/cpuacct.rst b/Documentation/admin-guide/cgroup-v1/cpuacct.rst
index d30ed81d2ad7..d30ed81d2ad7 100644
--- a/Documentation/cgroup-v1/cpuacct.rst
+++ b/Documentation/admin-guide/cgroup-v1/cpuacct.rst
diff --git a/Documentation/cgroup-v1/cpusets.rst b/Documentation/admin-guide/cgroup-v1/cpusets.rst
index b6a42cdea72b..86a6ae995d54 100644
--- a/Documentation/cgroup-v1/cpusets.rst
+++ b/Documentation/admin-guide/cgroup-v1/cpusets.rst
@@ -49,7 +49,7 @@ hooks, beyond what is already present, required to manage dynamic
49job placement on large systems. 49job placement on large systems.
50 50
51Cpusets use the generic cgroup subsystem described in 51Cpusets use the generic cgroup subsystem described in
52Documentation/cgroup-v1/cgroups.rst. 52Documentation/admin-guide/cgroup-v1/cgroups.rst.
53 53
54Requests by a task, using the sched_setaffinity(2) system call to 54Requests by a task, using the sched_setaffinity(2) system call to
55include CPUs in its CPU affinity mask, and using the mbind(2) and 55include CPUs in its CPU affinity mask, and using the mbind(2) and
diff --git a/Documentation/cgroup-v1/devices.rst b/Documentation/admin-guide/cgroup-v1/devices.rst
index e1886783961e..e1886783961e 100644
--- a/Documentation/cgroup-v1/devices.rst
+++ b/Documentation/admin-guide/cgroup-v1/devices.rst
diff --git a/Documentation/cgroup-v1/freezer-subsystem.rst b/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst
index 582d3427de3f..582d3427de3f 100644
--- a/Documentation/cgroup-v1/freezer-subsystem.rst
+++ b/Documentation/admin-guide/cgroup-v1/freezer-subsystem.rst
diff --git a/Documentation/cgroup-v1/hugetlb.rst b/Documentation/admin-guide/cgroup-v1/hugetlb.rst
index a3902aa253a9..a3902aa253a9 100644
--- a/Documentation/cgroup-v1/hugetlb.rst
+++ b/Documentation/admin-guide/cgroup-v1/hugetlb.rst
diff --git a/Documentation/cgroup-v1/index.rst b/Documentation/admin-guide/cgroup-v1/index.rst
index fe76d42edc11..10bf48bae0b0 100644
--- a/Documentation/cgroup-v1/index.rst
+++ b/Documentation/admin-guide/cgroup-v1/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3======================== 1========================
4Control Groups version 1 2Control Groups version 1
5======================== 3========================
diff --git a/Documentation/cgroup-v1/memcg_test.rst b/Documentation/admin-guide/cgroup-v1/memcg_test.rst
index 91bd18c6a514..3f7115e07b5d 100644
--- a/Documentation/cgroup-v1/memcg_test.rst
+++ b/Documentation/admin-guide/cgroup-v1/memcg_test.rst
@@ -10,7 +10,7 @@ Because VM is getting complex (one of reasons is memcg...), memcg's behavior
10is complex. This is a document for memcg's internal behavior. 10is complex. This is a document for memcg's internal behavior.
11Please note that implementation details can be changed. 11Please note that implementation details can be changed.
12 12
13(*) Topics on API should be in Documentation/cgroup-v1/memory.rst) 13(*) Topics on API should be in Documentation/admin-guide/cgroup-v1/memory.rst)
14 14
150. How to record usage ? 150. How to record usage ?
16======================== 16========================
@@ -327,7 +327,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
327 You can see charges have been moved by reading ``*.usage_in_bytes`` or 327 You can see charges have been moved by reading ``*.usage_in_bytes`` or
328 memory.stat of both A and B. 328 memory.stat of both A and B.
329 329
330 See 8.2 of Documentation/cgroup-v1/memory.rst to see what value should 330 See 8.2 of Documentation/admin-guide/cgroup-v1/memory.rst to see what value should
331 be written to move_charge_at_immigrate. 331 be written to move_charge_at_immigrate.
332 332
3339.10 Memory thresholds 3339.10 Memory thresholds
diff --git a/Documentation/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst
index 41bdc038dad9..41bdc038dad9 100644
--- a/Documentation/cgroup-v1/memory.rst
+++ b/Documentation/admin-guide/cgroup-v1/memory.rst
diff --git a/Documentation/cgroup-v1/net_cls.rst b/Documentation/admin-guide/cgroup-v1/net_cls.rst
index a2cf272af7a0..a2cf272af7a0 100644
--- a/Documentation/cgroup-v1/net_cls.rst
+++ b/Documentation/admin-guide/cgroup-v1/net_cls.rst
diff --git a/Documentation/cgroup-v1/net_prio.rst b/Documentation/admin-guide/cgroup-v1/net_prio.rst
index b40905871c64..b40905871c64 100644
--- a/Documentation/cgroup-v1/net_prio.rst
+++ b/Documentation/admin-guide/cgroup-v1/net_prio.rst
diff --git a/Documentation/cgroup-v1/pids.rst b/Documentation/admin-guide/cgroup-v1/pids.rst
index 6acebd9e72c8..6acebd9e72c8 100644
--- a/Documentation/cgroup-v1/pids.rst
+++ b/Documentation/admin-guide/cgroup-v1/pids.rst
diff --git a/Documentation/cgroup-v1/rdma.rst b/Documentation/admin-guide/cgroup-v1/rdma.rst
index 2fcb0a9bf790..2fcb0a9bf790 100644
--- a/Documentation/cgroup-v1/rdma.rst
+++ b/Documentation/admin-guide/cgroup-v1/rdma.rst
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 8269e869cb1e..3b29005aa981 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -9,7 +9,7 @@ This is the authoritative documentation on the design, interface and
9conventions of cgroup v2. It describes all userland-visible aspects 9conventions of cgroup v2. It describes all userland-visible aspects
10of cgroup including core and specific controller behaviors. All 10of cgroup including core and specific controller behaviors. All
11future changes must be reflected in this document. Documentation for 11future changes must be reflected in this document. Documentation for
12v1 is available under Documentation/cgroup-v1/. 12v1 is available under Documentation/admin-guide/cgroup-v1/.
13 13
14.. CONTENTS 14.. CONTENTS
15 15
@@ -1014,7 +1014,7 @@ All time durations are in microseconds.
1014 A read-only nested-key file which exists on non-root cgroups. 1014 A read-only nested-key file which exists on non-root cgroups.
1015 1015
1016 Shows pressure stall information for CPU. See 1016 Shows pressure stall information for CPU. See
1017 Documentation/accounting/psi.txt for details. 1017 Documentation/accounting/psi.rst for details.
1018 1018
1019 1019
1020Memory 1020Memory
@@ -1355,7 +1355,7 @@ PAGE_SIZE multiple when read back.
1355 A read-only nested-key file which exists on non-root cgroups. 1355 A read-only nested-key file which exists on non-root cgroups.
1356 1356
1357 Shows pressure stall information for memory. See 1357 Shows pressure stall information for memory. See
1358 Documentation/accounting/psi.txt for details. 1358 Documentation/accounting/psi.rst for details.
1359 1359
1360 1360
1361Usage Guidelines 1361Usage Guidelines
@@ -1498,7 +1498,7 @@ IO Interface Files
1498 A read-only nested-key file which exists on non-root cgroups. 1498 A read-only nested-key file which exists on non-root cgroups.
1499 1499
1500 Shows pressure stall information for IO. See 1500 Shows pressure stall information for IO. See
1501 Documentation/accounting/psi.txt for details. 1501 Documentation/accounting/psi.rst for details.
1502 1502
1503 1503
1504Writeback 1504Writeback
diff --git a/Documentation/clearing-warn-once.txt b/Documentation/admin-guide/clearing-warn-once.rst
index 211fd926cf00..211fd926cf00 100644
--- a/Documentation/clearing-warn-once.txt
+++ b/Documentation/admin-guide/clearing-warn-once.rst
diff --git a/Documentation/cpu-load.txt b/Documentation/admin-guide/cpu-load.rst
index 2d01ce43d2a2..2d01ce43d2a2 100644
--- a/Documentation/cpu-load.txt
+++ b/Documentation/admin-guide/cpu-load.rst
diff --git a/Documentation/cputopology.txt b/Documentation/admin-guide/cputopology.rst
index b90dafcc8237..b90dafcc8237 100644
--- a/Documentation/cputopology.txt
+++ b/Documentation/admin-guide/cputopology.rst
diff --git a/Documentation/device-mapper/cache-policies.rst b/Documentation/admin-guide/device-mapper/cache-policies.rst
index b17fe352fc41..b17fe352fc41 100644
--- a/Documentation/device-mapper/cache-policies.rst
+++ b/Documentation/admin-guide/device-mapper/cache-policies.rst
diff --git a/Documentation/device-mapper/cache.rst b/Documentation/admin-guide/device-mapper/cache.rst
index f15e5254d05b..f15e5254d05b 100644
--- a/Documentation/device-mapper/cache.rst
+++ b/Documentation/admin-guide/device-mapper/cache.rst
diff --git a/Documentation/device-mapper/delay.rst b/Documentation/admin-guide/device-mapper/delay.rst
index 917ba8c33359..917ba8c33359 100644
--- a/Documentation/device-mapper/delay.rst
+++ b/Documentation/admin-guide/device-mapper/delay.rst
diff --git a/Documentation/device-mapper/dm-crypt.rst b/Documentation/admin-guide/device-mapper/dm-crypt.rst
index 8f4a3f889d43..8f4a3f889d43 100644
--- a/Documentation/device-mapper/dm-crypt.rst
+++ b/Documentation/admin-guide/device-mapper/dm-crypt.rst
diff --git a/Documentation/device-mapper/dm-dust.txt b/Documentation/admin-guide/device-mapper/dm-dust.txt
index 954d402a1f6a..954d402a1f6a 100644
--- a/Documentation/device-mapper/dm-dust.txt
+++ b/Documentation/admin-guide/device-mapper/dm-dust.txt
diff --git a/Documentation/device-mapper/dm-flakey.rst b/Documentation/admin-guide/device-mapper/dm-flakey.rst
index 86138735879d..86138735879d 100644
--- a/Documentation/device-mapper/dm-flakey.rst
+++ b/Documentation/admin-guide/device-mapper/dm-flakey.rst
diff --git a/Documentation/device-mapper/dm-init.rst b/Documentation/admin-guide/device-mapper/dm-init.rst
index e5242ff17e9b..e5242ff17e9b 100644
--- a/Documentation/device-mapper/dm-init.rst
+++ b/Documentation/admin-guide/device-mapper/dm-init.rst
diff --git a/Documentation/device-mapper/dm-integrity.rst b/Documentation/admin-guide/device-mapper/dm-integrity.rst
index a30aa91b5fbe..a30aa91b5fbe 100644
--- a/Documentation/device-mapper/dm-integrity.rst
+++ b/Documentation/admin-guide/device-mapper/dm-integrity.rst
diff --git a/Documentation/device-mapper/dm-io.rst b/Documentation/admin-guide/device-mapper/dm-io.rst
index d2492917a1f5..d2492917a1f5 100644
--- a/Documentation/device-mapper/dm-io.rst
+++ b/Documentation/admin-guide/device-mapper/dm-io.rst
diff --git a/Documentation/device-mapper/dm-log.rst b/Documentation/admin-guide/device-mapper/dm-log.rst
index ba4fce39bc27..ba4fce39bc27 100644
--- a/Documentation/device-mapper/dm-log.rst
+++ b/Documentation/admin-guide/device-mapper/dm-log.rst
diff --git a/Documentation/device-mapper/dm-queue-length.rst b/Documentation/admin-guide/device-mapper/dm-queue-length.rst
index d8e381c1cb02..d8e381c1cb02 100644
--- a/Documentation/device-mapper/dm-queue-length.rst
+++ b/Documentation/admin-guide/device-mapper/dm-queue-length.rst
diff --git a/Documentation/device-mapper/dm-raid.rst b/Documentation/admin-guide/device-mapper/dm-raid.rst
index 2fe255b130fb..2fe255b130fb 100644
--- a/Documentation/device-mapper/dm-raid.rst
+++ b/Documentation/admin-guide/device-mapper/dm-raid.rst
diff --git a/Documentation/device-mapper/dm-service-time.rst b/Documentation/admin-guide/device-mapper/dm-service-time.rst
index facf277fc13c..facf277fc13c 100644
--- a/Documentation/device-mapper/dm-service-time.rst
+++ b/Documentation/admin-guide/device-mapper/dm-service-time.rst
diff --git a/Documentation/device-mapper/dm-uevent.rst b/Documentation/admin-guide/device-mapper/dm-uevent.rst
index 4a8ee8d069c9..4a8ee8d069c9 100644
--- a/Documentation/device-mapper/dm-uevent.rst
+++ b/Documentation/admin-guide/device-mapper/dm-uevent.rst
diff --git a/Documentation/device-mapper/dm-zoned.rst b/Documentation/admin-guide/device-mapper/dm-zoned.rst
index 07f56ebc1730..07f56ebc1730 100644
--- a/Documentation/device-mapper/dm-zoned.rst
+++ b/Documentation/admin-guide/device-mapper/dm-zoned.rst
diff --git a/Documentation/device-mapper/era.rst b/Documentation/admin-guide/device-mapper/era.rst
index 90dd5c670b9f..90dd5c670b9f 100644
--- a/Documentation/device-mapper/era.rst
+++ b/Documentation/admin-guide/device-mapper/era.rst
diff --git a/Documentation/device-mapper/index.rst b/Documentation/admin-guide/device-mapper/index.rst
index 105e253bc231..c77c58b8f67b 100644
--- a/Documentation/device-mapper/index.rst
+++ b/Documentation/admin-guide/device-mapper/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3============= 1=============
4Device Mapper 2Device Mapper
5============= 3=============
diff --git a/Documentation/device-mapper/kcopyd.rst b/Documentation/admin-guide/device-mapper/kcopyd.rst
index 7651d395127f..7651d395127f 100644
--- a/Documentation/device-mapper/kcopyd.rst
+++ b/Documentation/admin-guide/device-mapper/kcopyd.rst
diff --git a/Documentation/device-mapper/linear.rst b/Documentation/admin-guide/device-mapper/linear.rst
index 9d17fc6e64a9..9d17fc6e64a9 100644
--- a/Documentation/device-mapper/linear.rst
+++ b/Documentation/admin-guide/device-mapper/linear.rst
diff --git a/Documentation/device-mapper/log-writes.rst b/Documentation/admin-guide/device-mapper/log-writes.rst
index 23141f2ffb7c..23141f2ffb7c 100644
--- a/Documentation/device-mapper/log-writes.rst
+++ b/Documentation/admin-guide/device-mapper/log-writes.rst
diff --git a/Documentation/device-mapper/persistent-data.rst b/Documentation/admin-guide/device-mapper/persistent-data.rst
index 2065c3c5a091..2065c3c5a091 100644
--- a/Documentation/device-mapper/persistent-data.rst
+++ b/Documentation/admin-guide/device-mapper/persistent-data.rst
diff --git a/Documentation/device-mapper/snapshot.rst b/Documentation/admin-guide/device-mapper/snapshot.rst
index ccdd8b587a74..ccdd8b587a74 100644
--- a/Documentation/device-mapper/snapshot.rst
+++ b/Documentation/admin-guide/device-mapper/snapshot.rst
diff --git a/Documentation/device-mapper/statistics.rst b/Documentation/admin-guide/device-mapper/statistics.rst
index 3d80a9f850cc..41ded0bc5933 100644
--- a/Documentation/device-mapper/statistics.rst
+++ b/Documentation/admin-guide/device-mapper/statistics.rst
@@ -13,7 +13,7 @@ the range specified.
13 13
14The I/O statistics counters for each step-sized area of a region are 14The I/O statistics counters for each step-sized area of a region are
15in the same format as `/sys/block/*/stat` or `/proc/diskstats` (see: 15in the same format as `/sys/block/*/stat` or `/proc/diskstats` (see:
16Documentation/iostats.txt). But two extra counters (12 and 13) are 16Documentation/admin-guide/iostats.rst). But two extra counters (12 and 13) are
17provided: total time spent reading and writing. When the histogram 17provided: total time spent reading and writing. When the histogram
18argument is used, the 14th parameter is reported that represents the 18argument is used, the 14th parameter is reported that represents the
19histogram of latencies. All these counters may be accessed by sending 19histogram of latencies. All these counters may be accessed by sending
@@ -151,7 +151,7 @@ Messages
151 The first 11 counters have the same meaning as 151 The first 11 counters have the same meaning as
152 `/sys/block/*/stat or /proc/diskstats`. 152 `/sys/block/*/stat or /proc/diskstats`.
153 153
154 Please refer to Documentation/iostats.txt for details. 154 Please refer to Documentation/admin-guide/iostats.rst for details.
155 155
156 1. the number of reads completed 156 1. the number of reads completed
157 2. the number of reads merged 157 2. the number of reads merged
diff --git a/Documentation/device-mapper/striped.rst b/Documentation/admin-guide/device-mapper/striped.rst
index e9a8da192ae1..e9a8da192ae1 100644
--- a/Documentation/device-mapper/striped.rst
+++ b/Documentation/admin-guide/device-mapper/striped.rst
diff --git a/Documentation/device-mapper/switch.rst b/Documentation/admin-guide/device-mapper/switch.rst
index 7dde06be1a4f..7dde06be1a4f 100644
--- a/Documentation/device-mapper/switch.rst
+++ b/Documentation/admin-guide/device-mapper/switch.rst
diff --git a/Documentation/device-mapper/thin-provisioning.rst b/Documentation/admin-guide/device-mapper/thin-provisioning.rst
index bafebf79da4b..bafebf79da4b 100644
--- a/Documentation/device-mapper/thin-provisioning.rst
+++ b/Documentation/admin-guide/device-mapper/thin-provisioning.rst
diff --git a/Documentation/device-mapper/unstriped.rst b/Documentation/admin-guide/device-mapper/unstriped.rst
index 0a8d3eb3f072..0a8d3eb3f072 100644
--- a/Documentation/device-mapper/unstriped.rst
+++ b/Documentation/admin-guide/device-mapper/unstriped.rst
diff --git a/Documentation/device-mapper/verity.rst b/Documentation/admin-guide/device-mapper/verity.rst
index a4d1c1476d72..a4d1c1476d72 100644
--- a/Documentation/device-mapper/verity.rst
+++ b/Documentation/admin-guide/device-mapper/verity.rst
diff --git a/Documentation/device-mapper/writecache.rst b/Documentation/admin-guide/device-mapper/writecache.rst
index d3d7690f5e8d..d3d7690f5e8d 100644
--- a/Documentation/device-mapper/writecache.rst
+++ b/Documentation/admin-guide/device-mapper/writecache.rst
diff --git a/Documentation/device-mapper/zero.rst b/Documentation/admin-guide/device-mapper/zero.rst
index 11fb5cf4597c..11fb5cf4597c 100644
--- a/Documentation/device-mapper/zero.rst
+++ b/Documentation/admin-guide/device-mapper/zero.rst
diff --git a/Documentation/efi-stub.txt b/Documentation/admin-guide/efi-stub.rst
index 833edb0d0bc4..833edb0d0bc4 100644
--- a/Documentation/efi-stub.txt
+++ b/Documentation/admin-guide/efi-stub.rst
diff --git a/Documentation/gpio/index.rst b/Documentation/admin-guide/gpio/index.rst
index 09a4a553f434..a244ba4e87d5 100644
--- a/Documentation/gpio/index.rst
+++ b/Documentation/admin-guide/gpio/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3==== 3====
4gpio 4gpio
diff --git a/Documentation/gpio/sysfs.rst b/Documentation/admin-guide/gpio/sysfs.rst
index ec09ffd983e7..ec09ffd983e7 100644
--- a/Documentation/gpio/sysfs.rst
+++ b/Documentation/admin-guide/gpio/sysfs.rst
diff --git a/Documentation/highuid.txt b/Documentation/admin-guide/highuid.rst
index 6ee70465c0ea..6ee70465c0ea 100644
--- a/Documentation/highuid.txt
+++ b/Documentation/admin-guide/highuid.rst
diff --git a/Documentation/admin-guide/hw-vuln/l1tf.rst b/Documentation/admin-guide/hw-vuln/l1tf.rst
index 656aee262e23..f83212fae4d5 100644
--- a/Documentation/admin-guide/hw-vuln/l1tf.rst
+++ b/Documentation/admin-guide/hw-vuln/l1tf.rst
@@ -241,7 +241,7 @@ Guest mitigation mechanisms
241 For further information about confining guests to a single or to a group 241 For further information about confining guests to a single or to a group
242 of cores consult the cpusets documentation: 242 of cores consult the cpusets documentation:
243 243
244 https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.rst 244 https://www.kernel.org/doc/Documentation/admin-guide/cgroup-v1/cpusets.rst
245 245
246.. _interrupt_isolation: 246.. _interrupt_isolation:
247 247
diff --git a/Documentation/hw_random.txt b/Documentation/admin-guide/hw_random.rst
index 121de96e395e..121de96e395e 100644
--- a/Documentation/hw_random.txt
+++ b/Documentation/admin-guide/hw_random.rst
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst
index 24fbe0568eff..280355d08af5 100644
--- a/Documentation/admin-guide/index.rst
+++ b/Documentation/admin-guide/index.rst
@@ -16,6 +16,7 @@ etc.
16 README 16 README
17 kernel-parameters 17 kernel-parameters
18 devices 18 devices
19 sysctl/index
19 20
20This section describes CPU vulnerabilities and their mitigations. 21This section describes CPU vulnerabilities and their mitigations.
21 22
@@ -38,6 +39,8 @@ problems and bugs in particular.
38 ramoops 39 ramoops
39 dynamic-debug-howto 40 dynamic-debug-howto
40 init 41 init
42 kdump/index
43 perf/index
41 44
42This is the beginning of a section with information of interest to 45This is the beginning of a section with information of interest to
43application developers. Documents covering various aspects of the kernel 46application developers. Documents covering various aspects of the kernel
@@ -56,11 +59,13 @@ configure specific aspects of kernel behavior to your liking.
56 59
57 initrd 60 initrd
58 cgroup-v2 61 cgroup-v2
62 cgroup-v1/index
59 serial-console 63 serial-console
60 braille-console 64 braille-console
61 parport 65 parport
62 md 66 md
63 module-signing 67 module-signing
68 rapidio
64 sysrq 69 sysrq
65 unicode 70 unicode
66 vga-softcursor 71 vga-softcursor
@@ -69,14 +74,37 @@ configure specific aspects of kernel behavior to your liking.
69 java 74 java
70 ras 75 ras
71 bcache 76 bcache
77 blockdev/index
72 ext4 78 ext4
73 binderfs 79 binderfs
74 pm/index 80 pm/index
75 thunderbolt 81 thunderbolt
76 LSM/index 82 LSM/index
77 mm/index 83 mm/index
84 namespaces/index
78 perf-security 85 perf-security
79 acpi/index 86 acpi/index
87 aoe/index
88 btmrvl
89 clearing-warn-once
90 cpu-load
91 cputopology
92 device-mapper/index
93 efi-stub
94 gpio/index
95 highuid
96 hw_random
97 iostats
98 kernel-per-CPU-kthreads
99 laptops/index
100 lcd-panel-cgram
101 ldm
102 lockup-watchdogs
103 numastat
104 pnp
105 rtc
106 svga
107 video-output
80 108
81.. only:: subproject and html 109.. only:: subproject and html
82 110
diff --git a/Documentation/iostats.txt b/Documentation/admin-guide/iostats.rst
index 5d63b18bd6d1..5d63b18bd6d1 100644
--- a/Documentation/iostats.txt
+++ b/Documentation/admin-guide/iostats.rst
diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/admin-guide/kdump/gdbmacros.txt
index 220d0a80ca2c..220d0a80ca2c 100644
--- a/Documentation/kdump/gdbmacros.txt
+++ b/Documentation/admin-guide/kdump/gdbmacros.txt
diff --git a/Documentation/kdump/index.rst b/Documentation/admin-guide/kdump/index.rst
index 2b17fcf6867a..8e2ebd0383cd 100644
--- a/Documentation/kdump/index.rst
+++ b/Documentation/admin-guide/kdump/index.rst
@@ -1,4 +1,3 @@
1:orphan:
2 1
3================================================================ 2================================================================
4Documentation for Kdump - The kexec-based Crash Dumping Solution 3Documentation for Kdump - The kexec-based Crash Dumping Solution
diff --git a/Documentation/kdump/kdump.rst b/Documentation/admin-guide/kdump/kdump.rst
index ac7e131d2935..ac7e131d2935 100644
--- a/Documentation/kdump/kdump.rst
+++ b/Documentation/admin-guide/kdump/kdump.rst
diff --git a/Documentation/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst
index 007a6b86e0ee..007a6b86e0ee 100644
--- a/Documentation/kdump/vmcoreinfo.rst
+++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst
diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst
index 5d29ba5ad88c..d05d531b4ec9 100644
--- a/Documentation/admin-guide/kernel-parameters.rst
+++ b/Documentation/admin-guide/kernel-parameters.rst
@@ -118,7 +118,7 @@ parameter is applicable::
118 LOOP Loopback device support is enabled. 118 LOOP Loopback device support is enabled.
119 M68k M68k architecture is enabled. 119 M68k M68k architecture is enabled.
120 These options have more detailed description inside of 120 These options have more detailed description inside of
121 Documentation/m68k/kernel-options.txt. 121 Documentation/m68k/kernel-options.rst.
122 MDA MDA console support is enabled. 122 MDA MDA console support is enabled.
123 MIPS MIPS architecture is enabled. 123 MIPS MIPS architecture is enabled.
124 MOUSE Appropriate mouse support is enabled. 124 MOUSE Appropriate mouse support is enabled.
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index f8b62360b18c..34a363f91b46 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -430,7 +430,7 @@
430 430
431 blkdevparts= Manual partition parsing of block device(s) for 431 blkdevparts= Manual partition parsing of block device(s) for
432 embedded devices based on command line input. 432 embedded devices based on command line input.
433 See Documentation/block/cmdline-partition.txt 433 See Documentation/block/cmdline-partition.rst
434 434
435 boot_delay= Milliseconds to delay each printk during boot. 435 boot_delay= Milliseconds to delay each printk during boot.
436 Values larger than 10 seconds (10000) are changed to 436 Values larger than 10 seconds (10000) are changed to
@@ -708,14 +708,14 @@
708 [KNL, x86_64] select a region under 4G first, and 708 [KNL, x86_64] select a region under 4G first, and
709 fall back to reserve region above 4G when '@offset' 709 fall back to reserve region above 4G when '@offset'
710 hasn't been specified. 710 hasn't been specified.
711 See Documentation/kdump/kdump.rst for further details. 711 See Documentation/admin-guide/kdump/kdump.rst for further details.
712 712
713 crashkernel=range1:size1[,range2:size2,...][@offset] 713 crashkernel=range1:size1[,range2:size2,...][@offset]
714 [KNL] Same as above, but depends on the memory 714 [KNL] Same as above, but depends on the memory
715 in the running system. The syntax of range is 715 in the running system. The syntax of range is
716 start-[end] where start and end are both 716 start-[end] where start and end are both
717 a memory unit (amount[KMG]). See also 717 a memory unit (amount[KMG]). See also
718 Documentation/kdump/kdump.rst for an example. 718 Documentation/admin-guide/kdump/kdump.rst for an example.
719 719
720 crashkernel=size[KMG],high 720 crashkernel=size[KMG],high
721 [KNL, x86_64] range could be above 4G. Allow kernel 721 [KNL, x86_64] range could be above 4G. Allow kernel
@@ -930,7 +930,7 @@
930 edid/1680x1050.bin, or edid/1920x1080.bin is given 930 edid/1680x1050.bin, or edid/1920x1080.bin is given
931 and no file with the same name exists. Details and 931 and no file with the same name exists. Details and
932 instructions how to build your own EDID data are 932 instructions how to build your own EDID data are
933 available in Documentation/EDID/howto.rst. An EDID 933 available in Documentation/driver-api/edid.rst. An EDID
934 data set will only be used for a particular connector, 934 data set will only be used for a particular connector,
935 if its name and a colon are prepended to the EDID 935 if its name and a colon are prepended to the EDID
936 name. Each connector may use a unique EDID data 936 name. Each connector may use a unique EDID data
@@ -1199,15 +1199,15 @@
1199 1199
1200 elevator= [IOSCHED] 1200 elevator= [IOSCHED]
1201 Format: { "mq-deadline" | "kyber" | "bfq" } 1201 Format: { "mq-deadline" | "kyber" | "bfq" }
1202 See Documentation/block/deadline-iosched.txt, 1202 See Documentation/block/deadline-iosched.rst,
1203 Documentation/block/kyber-iosched.txt and 1203 Documentation/block/kyber-iosched.rst and
1204 Documentation/block/bfq-iosched.txt for details. 1204 Documentation/block/bfq-iosched.rst for details.
1205 1205
1206 elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390] 1206 elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390]
1207 Specifies physical address of start of kernel core 1207 Specifies physical address of start of kernel core
1208 image elf header and optionally the size. Generally 1208 image elf header and optionally the size. Generally
1209 kexec loader will pass this option to capture kernel. 1209 kexec loader will pass this option to capture kernel.
1210 See Documentation/kdump/kdump.rst for details. 1210 See Documentation/admin-guide/kdump/kdump.rst for details.
1211 1211
1212 enable_mtrr_cleanup [X86] 1212 enable_mtrr_cleanup [X86]
1213 The kernel tries to adjust MTRR layout from continuous 1213 The kernel tries to adjust MTRR layout from continuous
@@ -1249,7 +1249,7 @@
1249 See also Documentation/fault-injection/. 1249 See also Documentation/fault-injection/.
1250 1250
1251 floppy= [HW] 1251 floppy= [HW]
1252 See Documentation/blockdev/floppy.txt. 1252 See Documentation/admin-guide/blockdev/floppy.rst.
1253 1253
1254 force_pal_cache_flush 1254 force_pal_cache_flush
1255 [IA-64] Avoid check_sal_cache_flush which may hang on 1255 [IA-64] Avoid check_sal_cache_flush which may hang on
@@ -2234,7 +2234,7 @@
2234 memblock=debug [KNL] Enable memblock debug messages. 2234 memblock=debug [KNL] Enable memblock debug messages.
2235 2235
2236 load_ramdisk= [RAM] List of ramdisks to load from floppy 2236 load_ramdisk= [RAM] List of ramdisks to load from floppy
2237 See Documentation/blockdev/ramdisk.txt. 2237 See Documentation/admin-guide/blockdev/ramdisk.rst.
2238 2238
2239 lockd.nlm_grace_period=P [NFS] Assign grace period. 2239 lockd.nlm_grace_period=P [NFS] Assign grace period.
2240 Format: <integer> 2240 Format: <integer>
@@ -3144,7 +3144,7 @@
3144 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. 3144 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
3145 'node', 'default' can be specified 3145 'node', 'default' can be specified
3146 This can be set from sysctl after boot. 3146 This can be set from sysctl after boot.
3147 See Documentation/sysctl/vm.txt for details. 3147 See Documentation/admin-guide/sysctl/vm.rst for details.
3148 3148
3149 ohci1394_dma=early [HW] enable debugging via the ohci1394 driver. 3149 ohci1394_dma=early [HW] enable debugging via the ohci1394 driver.
3150 See Documentation/debugging-via-ohci1394.txt for more 3150 See Documentation/debugging-via-ohci1394.txt for more
@@ -3268,7 +3268,7 @@
3268 3268
3269 pcd. [PARIDE] 3269 pcd. [PARIDE]
3270 See header of drivers/block/paride/pcd.c. 3270 See header of drivers/block/paride/pcd.c.
3271 See also Documentation/blockdev/paride.txt. 3271 See also Documentation/admin-guide/blockdev/paride.rst.
3272 3272
3273 pci=option[,option...] [PCI] various PCI subsystem options. 3273 pci=option[,option...] [PCI] various PCI subsystem options.
3274 3274
@@ -3512,7 +3512,7 @@
3512 needed on a platform with proper driver support. 3512 needed on a platform with proper driver support.
3513 3513
3514 pd. [PARIDE] 3514 pd. [PARIDE]
3515 See Documentation/blockdev/paride.txt. 3515 See Documentation/admin-guide/blockdev/paride.rst.
3516 3516
3517 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at 3517 pdcchassis= [PARISC,HW] Disable/Enable PDC Chassis Status codes at
3518 boot time. 3518 boot time.
@@ -3527,10 +3527,10 @@
3527 and performance comparison. 3527 and performance comparison.
3528 3528
3529 pf. [PARIDE] 3529 pf. [PARIDE]
3530 See Documentation/blockdev/paride.txt. 3530 See Documentation/admin-guide/blockdev/paride.rst.
3531 3531
3532 pg. [PARIDE] 3532 pg. [PARIDE]
3533 See Documentation/blockdev/paride.txt. 3533 See Documentation/admin-guide/blockdev/paride.rst.
3534 3534
3535 pirq= [SMP,APIC] Manual mp-table setup 3535 pirq= [SMP,APIC] Manual mp-table setup
3536 See Documentation/x86/i386/IO-APIC.rst. 3536 See Documentation/x86/i386/IO-APIC.rst.
@@ -3642,7 +3642,7 @@
3642 3642
3643 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk 3643 prompt_ramdisk= [RAM] List of RAM disks to prompt for floppy disk
3644 before loading. 3644 before loading.
3645 See Documentation/blockdev/ramdisk.txt. 3645 See Documentation/admin-guide/blockdev/ramdisk.rst.
3646 3646
3647 psi= [KNL] Enable or disable pressure stall information 3647 psi= [KNL] Enable or disable pressure stall information
3648 tracking. 3648 tracking.
@@ -3664,7 +3664,7 @@
3664 pstore.backend= Specify the name of the pstore backend to use 3664 pstore.backend= Specify the name of the pstore backend to use
3665 3665
3666 pt. [PARIDE] 3666 pt. [PARIDE]
3667 See Documentation/blockdev/paride.txt. 3667 See Documentation/admin-guide/blockdev/paride.rst.
3668 3668
3669 pti= [X86_64] Control Page Table Isolation of user and 3669 pti= [X86_64] Control Page Table Isolation of user and
3670 kernel address spaces. Disabling this feature 3670 kernel address spaces. Disabling this feature
@@ -3693,7 +3693,7 @@
3693 See Documentation/admin-guide/md.rst. 3693 See Documentation/admin-guide/md.rst.
3694 3694
3695 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes 3695 ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
3696 See Documentation/blockdev/ramdisk.txt. 3696 See Documentation/admin-guide/blockdev/ramdisk.rst.
3697 3697
3698 random.trust_cpu={on,off} 3698 random.trust_cpu={on,off}
3699 [KNL] Enable or disable trusting the use of the 3699 [KNL] Enable or disable trusting the use of the
@@ -4089,7 +4089,7 @@
4089 4089
4090 relax_domain_level= 4090 relax_domain_level=
4091 [KNL, SMP] Set scheduler's default relax_domain_level. 4091 [KNL, SMP] Set scheduler's default relax_domain_level.
4092 See Documentation/cgroup-v1/cpusets.rst. 4092 See Documentation/admin-guide/cgroup-v1/cpusets.rst.
4093 4093
4094 reserve= [KNL,BUGS] Force kernel to ignore I/O ports or memory 4094 reserve= [KNL,BUGS] Force kernel to ignore I/O ports or memory
4095 Format: <base1>,<size1>[,<base2>,<size2>,...] 4095 Format: <base1>,<size1>[,<base2>,<size2>,...]
@@ -4347,7 +4347,7 @@
4347 Format: <integer> 4347 Format: <integer>
4348 4348
4349 sonypi.*= [HW] Sony Programmable I/O Control Device driver 4349 sonypi.*= [HW] Sony Programmable I/O Control Device driver
4350 See Documentation/laptops/sonypi.txt 4350 See Documentation/admin-guide/laptops/sonypi.rst
4351 4351
4352 spectre_v2= [X86] Control mitigation of Spectre variant 2 4352 spectre_v2= [X86] Control mitigation of Spectre variant 2
4353 (indirect branch speculation) vulnerability. 4353 (indirect branch speculation) vulnerability.
@@ -4599,7 +4599,7 @@
4599 swapaccount=[0|1] 4599 swapaccount=[0|1]
4600 [KNL] Enable accounting of swap in memory resource 4600 [KNL] Enable accounting of swap in memory resource
4601 controller if no parameter or 1 is given or disable 4601 controller if no parameter or 1 is given or disable
4602 it if 0 is given (See Documentation/cgroup-v1/memory.rst) 4602 it if 0 is given (See Documentation/admin-guide/cgroup-v1/memory.rst)
4603 4603
4604 swiotlb= [ARM,IA-64,PPC,MIPS,X86] 4604 swiotlb= [ARM,IA-64,PPC,MIPS,X86]
4605 Format: { <int> | force | noforce } 4605 Format: { <int> | force | noforce }
@@ -5066,7 +5066,7 @@
5066 5066
5067 vga= [BOOT,X86-32] Select a particular video mode 5067 vga= [BOOT,X86-32] Select a particular video mode
5068 See Documentation/x86/boot.rst and 5068 See Documentation/x86/boot.rst and
5069 Documentation/svga.txt. 5069 Documentation/admin-guide/svga.rst.
5070 Use vga=ask for menu. 5070 Use vga=ask for menu.
5071 This is actually a boot loader parameter; the value is 5071 This is actually a boot loader parameter; the value is
5072 passed to the kernel using a special protocol. 5072 passed to the kernel using a special protocol.
diff --git a/Documentation/kernel-per-CPU-kthreads.txt b/Documentation/admin-guide/kernel-per-CPU-kthreads.rst
index 5623b9916411..4f18456dd3b1 100644
--- a/Documentation/kernel-per-CPU-kthreads.txt
+++ b/Documentation/admin-guide/kernel-per-CPU-kthreads.rst
@@ -12,7 +12,7 @@ References
12 12
13- Documentation/IRQ-affinity.txt: Binding interrupts to sets of CPUs. 13- Documentation/IRQ-affinity.txt: Binding interrupts to sets of CPUs.
14 14
15- Documentation/cgroup-v1: Using cgroups to bind tasks to sets of CPUs. 15- Documentation/admin-guide/cgroup-v1: Using cgroups to bind tasks to sets of CPUs.
16 16
17- man taskset: Using the taskset command to bind tasks to sets 17- man taskset: Using the taskset command to bind tasks to sets
18 of CPUs. 18 of CPUs.
diff --git a/Documentation/laptops/asus-laptop.txt b/Documentation/admin-guide/laptops/asus-laptop.rst
index 5f2858712aa0..95176321a25a 100644
--- a/Documentation/laptops/asus-laptop.txt
+++ b/Documentation/admin-guide/laptops/asus-laptop.rst
@@ -1,6 +1,9 @@
1==================
1Asus Laptop Extras 2Asus Laptop Extras
3==================
2 4
3Version 0.1 5Version 0.1
6
4August 6, 2009 7August 6, 2009
5 8
6Corentin Chary <corentincj@iksaif.net> 9Corentin Chary <corentincj@iksaif.net>
@@ -10,11 +13,12 @@ http://acpi4asus.sf.net/
10 It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or 13 It may also support some MEDION, JVC or VICTOR laptops (such as MEDION 9675 or
11 VICTOR XP7210 for example). It makes all the extra buttons generate input 14 VICTOR XP7210 for example). It makes all the extra buttons generate input
12 events (like keyboards). 15 events (like keyboards).
16
13 On some models adds support for changing the display brightness and output, 17 On some models adds support for changing the display brightness and output,
14 switching the LCD backlight on and off, and most importantly, allows you to 18 switching the LCD backlight on and off, and most importantly, allows you to
15 blink those fancy LEDs intended for reporting mail and wireless status. 19 blink those fancy LEDs intended for reporting mail and wireless status.
16 20
17This driver supercedes the old asus_acpi driver. 21This driver supersedes the old asus_acpi driver.
18 22
19Requirements 23Requirements
20------------ 24------------
@@ -49,7 +53,7 @@ Usage
49 see some lines like this : 53 see some lines like this :
50 54
51 Asus Laptop Extras version 0.42 55 Asus Laptop Extras version 0.42
52 L2D model detected. 56 - L2D model detected.
53 57
54 If it is not the output you have on your laptop, send it (and the laptop's 58 If it is not the output you have on your laptop, send it (and the laptop's
55 DSDT) to me. 59 DSDT) to me.
@@ -68,9 +72,12 @@ Usage
68LEDs 72LEDs
69---- 73----
70 74
71 You can modify LEDs be echoing values to /sys/class/leds/asus::*/brightness : 75 You can modify LEDs be echoing values to `/sys/class/leds/asus/*/brightness`::
76
72 echo 1 > /sys/class/leds/asus::mail/brightness 77 echo 1 > /sys/class/leds/asus::mail/brightness
78
73 will switch the mail LED on. 79 will switch the mail LED on.
80
74 You can also know if they are on/off by reading their content and use 81 You can also know if they are on/off by reading their content and use
75 kernel triggers like disk-activity or heartbeat. 82 kernel triggers like disk-activity or heartbeat.
76 83
@@ -81,7 +88,7 @@ Backlight
81 /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15. 88 /sys/class/backlight/asus-laptop/. Brightness Values are between 0 and 15.
82 89
83Wireless devices 90Wireless devices
84--------------- 91----------------
85 92
86 You can turn the internal Bluetooth adapter on/off with the bluetooth entry 93 You can turn the internal Bluetooth adapter on/off with the bluetooth entry
87 (only on models with Bluetooth). This usually controls the associated LED. 94 (only on models with Bluetooth). This usually controls the associated LED.
@@ -93,18 +100,20 @@ Display switching
93 Note: the display switching code is currently considered EXPERIMENTAL. 100 Note: the display switching code is currently considered EXPERIMENTAL.
94 101
95 Switching works for the following models: 102 Switching works for the following models:
96 L3800C 103
97 A2500H 104 - L3800C
98 L5800C 105 - A2500H
99 M5200N 106 - L5800C
100 W1000N (albeit with some glitches) 107 - M5200N
101 M6700R 108 - W1000N (albeit with some glitches)
102 A6JC 109 - M6700R
103 F3J 110 - A6JC
111 - F3J
104 112
105 Switching doesn't work for the following: 113 Switching doesn't work for the following:
106 M3700N 114
107 L2X00D (locks the laptop under certain conditions) 115 - M3700N
116 - L2X00D (locks the laptop under certain conditions)
108 117
109 To switch the displays, echo values from 0 to 15 to 118 To switch the displays, echo values from 0 to 15 to
110 /sys/devices/platform/asus-laptop/display. The significance of those values 119 /sys/devices/platform/asus-laptop/display. The significance of those values
@@ -113,48 +122,51 @@ Display switching
113 +-------+-----+-----+-----+-----+-----+ 122 +-------+-----+-----+-----+-----+-----+
114 | Bin | Val | DVI | TV | CRT | LCD | 123 | Bin | Val | DVI | TV | CRT | LCD |
115 +-------+-----+-----+-----+-----+-----+ 124 +-------+-----+-----+-----+-----+-----+
116 + 0000 + 0 + + + + + 125 | 0000 | 0 | | | | |
117 +-------+-----+-----+-----+-----+-----+ 126 +-------+-----+-----+-----+-----+-----+
118 + 0001 + 1 + + + + X + 127 | 0001 | 1 | | | | X |
119 +-------+-----+-----+-----+-----+-----+ 128 +-------+-----+-----+-----+-----+-----+
120 + 0010 + 2 + + + X + + 129 | 0010 | 2 | | | X | |
121 +-------+-----+-----+-----+-----+-----+ 130 +-------+-----+-----+-----+-----+-----+
122 + 0011 + 3 + + + X + X + 131 | 0011 | 3 | | | X | X |
123 +-------+-----+-----+-----+-----+-----+ 132 +-------+-----+-----+-----+-----+-----+
124 + 0100 + 4 + + X + + + 133 | 0100 | 4 | | X | | |
125 +-------+-----+-----+-----+-----+-----+ 134 +-------+-----+-----+-----+-----+-----+
126 + 0101 + 5 + + X + + X + 135 | 0101 | 5 | | X | | X |
127 +-------+-----+-----+-----+-----+-----+ 136 +-------+-----+-----+-----+-----+-----+
128 + 0110 + 6 + + X + X + + 137 | 0110 | 6 | | X | X | |
129 +-------+-----+-----+-----+-----+-----+ 138 +-------+-----+-----+-----+-----+-----+
130 + 0111 + 7 + + X + X + X + 139 | 0111 | 7 | | X | X | X |
131 +-------+-----+-----+-----+-----+-----+ 140 +-------+-----+-----+-----+-----+-----+
132 + 1000 + 8 + X + + + + 141 | 1000 | 8 | X | | | |
133 +-------+-----+-----+-----+-----+-----+ 142 +-------+-----+-----+-----+-----+-----+
134 + 1001 + 9 + X + + + X + 143 | 1001 | 9 | X | | | X |
135 +-------+-----+-----+-----+-----+-----+ 144 +-------+-----+-----+-----+-----+-----+
136 + 1010 + 10 + X + + X + + 145 | 1010 | 10 | X | | X | |
137 +-------+-----+-----+-----+-----+-----+ 146 +-------+-----+-----+-----+-----+-----+
138 + 1011 + 11 + X + + X + X + 147 | 1011 | 11 | X | | X | X |
139 +-------+-----+-----+-----+-----+-----+ 148 +-------+-----+-----+-----+-----+-----+
140 + 1100 + 12 + X + X + + + 149 | 1100 | 12 | X | X | | |
141 +-------+-----+-----+-----+-----+-----+ 150 +-------+-----+-----+-----+-----+-----+
142 + 1101 + 13 + X + X + + X + 151 | 1101 | 13 | X | X | | X |
143 +-------+-----+-----+-----+-----+-----+ 152 +-------+-----+-----+-----+-----+-----+
144 + 1110 + 14 + X + X + X + + 153 | 1110 | 14 | X | X | X | |
145 +-------+-----+-----+-----+-----+-----+ 154 +-------+-----+-----+-----+-----+-----+
146 + 1111 + 15 + X + X + X + X + 155 | 1111 | 15 | X | X | X | X |
147 +-------+-----+-----+-----+-----+-----+ 156 +-------+-----+-----+-----+-----+-----+
148 157
149 In most cases, the appropriate displays must be plugged in for the above 158 In most cases, the appropriate displays must be plugged in for the above
150 combinations to work. TV-Out may need to be initialized at boot time. 159 combinations to work. TV-Out may need to be initialized at boot time.
151 160
152 Debugging: 161 Debugging:
162
153 1) Check whether the Fn+F8 key: 163 1) Check whether the Fn+F8 key:
164
154 a) does not lock the laptop (try a boot with noapic / nolapic if it does) 165 a) does not lock the laptop (try a boot with noapic / nolapic if it does)
155 b) generates events (0x6n, where n is the value corresponding to the 166 b) generates events (0x6n, where n is the value corresponding to the
156 configuration above) 167 configuration above)
157 c) actually works 168 c) actually works
169
158 Record the disp value at every configuration. 170 Record the disp value at every configuration.
159 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display. 171 2) Echo values from 0 to 15 to /sys/devices/platform/asus-laptop/display.
160 Record its value, note any change. If nothing changes, try a broader range, 172 Record its value, note any change. If nothing changes, try a broader range,
@@ -164,7 +176,7 @@ Display switching
164 176
165 Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n 177 Note: on some machines (e.g. L3C), after the module has been loaded, only 0x6n
166 events are generated and no actual switching occurs. In such a case, a line 178 events are generated and no actual switching occurs. In such a case, a line
167 like: 179 like::
168 180
169 echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display 181 echo $((10#$arg-60)) > /sys/devices/platform/asus-laptop/display
170 182
@@ -180,15 +192,16 @@ LED display
180 several items of information. 192 several items of information.
181 193
182 LED display works for the following models: 194 LED display works for the following models:
183 W1000N
184 W1J
185 195
186 To control the LED display, use the following : 196 - W1000N
197 - W1J
198
199 To control the LED display, use the following::
187 200
188 echo 0x0T000DDD > /sys/devices/platform/asus-laptop/ 201 echo 0x0T000DDD > /sys/devices/platform/asus-laptop/
189 202
190 where T control the 3 letters display, and DDD the 3 digits display, 203 where T control the 3 letters display, and DDD the 3 digits display,
191 according to the tables below. 204 according to the tables below::
192 205
193 DDD (digits) 206 DDD (digits)
194 000 to 999 = display digits 207 000 to 999 = display digits
@@ -208,8 +221,8 @@ LED display
208 For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd" 221 For example "echo 0x01000001 >/sys/devices/platform/asus-laptop/ledd"
209 would display "DVD001". 222 would display "DVD001".
210 223
211Driver options: 224Driver options
212--------------- 225--------------
213 226
214 Options can be passed to the asus-laptop driver using the standard 227 Options can be passed to the asus-laptop driver using the standard
215 module argument syntax (<param>=<value> when passing the option to the 228 module argument syntax (<param>=<value> when passing the option to the
@@ -219,6 +232,7 @@ Driver options:
219 wapf: WAPF defines the behavior of the Fn+Fx wlan key 232 wapf: WAPF defines the behavior of the Fn+Fx wlan key
220 The significance of values is yet to be found, but 233 The significance of values is yet to be found, but
221 most of the time: 234 most of the time:
235
222 - 0x0 should do nothing 236 - 0x0 should do nothing
223 - 0x1 should allow to control the device with Fn+Fx key. 237 - 0x1 should allow to control the device with Fn+Fx key.
224 - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key 238 - 0x4 should send an ACPI event (0x88) while pressing the Fn+Fx key
@@ -237,7 +251,7 @@ Unsupported models
237 - ASUS L7300G 251 - ASUS L7300G
238 - ASUS L8400 252 - ASUS L8400
239 253
240Patches, Errors, Questions: 254Patches, Errors, Questions
241-------------------------- 255--------------------------
242 256
243 I appreciate any success or failure 257 I appreciate any success or failure
@@ -253,5 +267,5 @@ Patches, Errors, Questions:
253 Any other comments or patches are also more than welcome. 267 Any other comments or patches are also more than welcome.
254 268
255 acpi4asus-user@lists.sourceforge.net 269 acpi4asus-user@lists.sourceforge.net
256 http://sourceforge.net/projects/acpi4asus
257 270
271 http://sourceforge.net/projects/acpi4asus
diff --git a/Documentation/laptops/disk-shock-protection.txt b/Documentation/admin-guide/laptops/disk-shock-protection.rst
index 0e6ba2663834..e97c5f78d8c3 100644
--- a/Documentation/laptops/disk-shock-protection.txt
+++ b/Documentation/admin-guide/laptops/disk-shock-protection.rst
@@ -1,17 +1,18 @@
1==========================
1Hard disk shock protection 2Hard disk shock protection
2========================== 3==========================
3 4
4Author: Elias Oltmanns <eo@nebensachen.de> 5Author: Elias Oltmanns <eo@nebensachen.de>
6
5Last modified: 2008-10-03 7Last modified: 2008-10-03
6 8
7 9
80. Contents 10.. 0. Contents
9-----------
10 11
111. Intro 12 1. Intro
122. The interface 13 2. The interface
133. References 14 3. References
144. CREDITS 15 4. CREDITS
15 16
16 17
171. Intro 181. Intro
@@ -36,8 +37,8 @@ that).
36---------------- 37----------------
37 38
38For each ATA device, the kernel exports the file 39For each ATA device, the kernel exports the file
39block/*/device/unload_heads in sysfs (here assumed to be mounted under 40`block/*/device/unload_heads` in sysfs (here assumed to be mounted under
40/sys). Access to /sys/block/*/device/unload_heads is denied with 41/sys). Access to `/sys/block/*/device/unload_heads` is denied with
41-EOPNOTSUPP if the device does not support the unload feature. 42-EOPNOTSUPP if the device does not support the unload feature.
42Otherwise, writing an integer value to this file will take the heads 43Otherwise, writing an integer value to this file will take the heads
43of the respective drive off the platter and block all I/O operations 44of the respective drive off the platter and block all I/O operations
@@ -54,18 +55,18 @@ cancel a previously set timeout and resume normal operation
54immediately by specifying a timeout of 0. Values below -2 are rejected 55immediately by specifying a timeout of 0. Values below -2 are rejected
55with -EINVAL (see below for the special meaning of -1 and -2). If the 56with -EINVAL (see below for the special meaning of -1 and -2). If the
56timeout specified for a recent head park request has not yet expired, 57timeout specified for a recent head park request has not yet expired,
57reading from /sys/block/*/device/unload_heads will report the number 58reading from `/sys/block/*/device/unload_heads` will report the number
58of milliseconds remaining until normal operation will be resumed; 59of milliseconds remaining until normal operation will be resumed;
59otherwise, reading the unload_heads attribute will return 0. 60otherwise, reading the unload_heads attribute will return 0.
60 61
61For example, do the following in order to park the heads of drive 62For example, do the following in order to park the heads of drive
62/dev/sda and stop all I/O operations for five seconds: 63/dev/sda and stop all I/O operations for five seconds::
63 64
64# echo 5000 > /sys/block/sda/device/unload_heads 65 # echo 5000 > /sys/block/sda/device/unload_heads
65 66
66A simple 67A simple::
67 68
68# cat /sys/block/sda/device/unload_heads 69 # cat /sys/block/sda/device/unload_heads
69 70
70will show you how many milliseconds are left before normal operation 71will show you how many milliseconds are left before normal operation
71will be resumed. 72will be resumed.
@@ -112,9 +113,9 @@ unload_heads attribute. If you know that your device really does
112support the unload feature (for instance, because the vendor of your 113support the unload feature (for instance, because the vendor of your
113laptop or the hard drive itself told you so), then you can tell the 114laptop or the hard drive itself told you so), then you can tell the
114kernel to enable the usage of this feature for that drive by writing 115kernel to enable the usage of this feature for that drive by writing
115the special value -1 to the unload_heads attribute: 116the special value -1 to the unload_heads attribute::
116 117
117# echo -1 > /sys/block/sda/device/unload_heads 118 # echo -1 > /sys/block/sda/device/unload_heads
118 119
119will enable the feature for /dev/sda, and giving -2 instead of -1 will 120will enable the feature for /dev/sda, and giving -2 instead of -1 will
120disable it again. 121disable it again.
@@ -135,6 +136,7 @@ for use. Please feel free to add projects that have been the victims
135of my ignorance. 136of my ignorance.
136 137
137- http://www.thinkwiki.org/wiki/HDAPS 138- http://www.thinkwiki.org/wiki/HDAPS
139
138 See this page for information about Linux support of the hard disk 140 See this page for information about Linux support of the hard disk
139 active protection system as implemented in IBM/Lenovo Thinkpads. 141 active protection system as implemented in IBM/Lenovo Thinkpads.
140 142
diff --git a/Documentation/admin-guide/laptops/index.rst b/Documentation/admin-guide/laptops/index.rst
new file mode 100644
index 000000000000..cd9a1c2695fd
--- /dev/null
+++ b/Documentation/admin-guide/laptops/index.rst
@@ -0,0 +1,17 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==============
4Laptop Drivers
5==============
6
7.. toctree::
8 :maxdepth: 1
9
10 asus-laptop
11 disk-shock-protection
12 laptop-mode
13 lg-laptop
14 sony-laptop
15 sonypi
16 thinkpad-acpi
17 toshiba_haps
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/admin-guide/laptops/laptop-mode.rst
index 1c707fc9b141..c984c4262f2e 100644
--- a/Documentation/laptops/laptop-mode.txt
+++ b/Documentation/admin-guide/laptops/laptop-mode.rst
@@ -1,8 +1,11 @@
1===============================================
1How to conserve battery power using laptop-mode 2How to conserve battery power using laptop-mode
2----------------------------------------------- 3===============================================
3 4
4Document Author: Bart Samwel (bart@samwel.tk) 5Document Author: Bart Samwel (bart@samwel.tk)
6
5Date created: January 2, 2004 7Date created: January 2, 2004
8
6Last modified: December 06, 2004 9Last modified: December 06, 2004
7 10
8Introduction 11Introduction
@@ -12,17 +15,16 @@ Laptop mode is used to minimize the time that the hard disk needs to be spun up,
12to conserve battery power on laptops. It has been reported to cause significant 15to conserve battery power on laptops. It has been reported to cause significant
13power savings. 16power savings.
14 17
15Contents 18.. Contents
16--------
17 19
18* Introduction 20 * Introduction
19* Installation 21 * Installation
20* Caveats 22 * Caveats
21* The Details 23 * The Details
22* Tips & Tricks 24 * Tips & Tricks
23* Control script 25 * Control script
24* ACPI integration 26 * ACPI integration
25* Monitoring tool 27 * Monitoring tool
26 28
27 29
28Installation 30Installation
@@ -33,7 +35,7 @@ or anything. Simply install all the files included in this document, and
33laptop mode will automatically be started when you're on battery. For 35laptop mode will automatically be started when you're on battery. For
34your convenience, a tarball containing an installer can be downloaded at: 36your convenience, a tarball containing an installer can be downloaded at:
35 37
36http://www.samwel.tk/laptop_mode/laptop_mode/ 38 http://www.samwel.tk/laptop_mode/laptop_mode/
37 39
38To configure laptop mode, you need to edit the configuration file, which is 40To configure laptop mode, you need to edit the configuration file, which is
39located in /etc/default/laptop-mode on Debian-based systems, or in 41located in /etc/default/laptop-mode on Debian-based systems, or in
@@ -209,7 +211,7 @@ Tips & Tricks
209 this on powerbooks too. I hope that this is a piece of information that 211 this on powerbooks too. I hope that this is a piece of information that
210 might be useful to the Laptop Mode patch or its users." 212 might be useful to the Laptop Mode patch or its users."
211 213
212* In syslog.conf, you can prefix entries with a dash ``-'' to omit syncing the 214* In syslog.conf, you can prefix entries with a dash `-` to omit syncing the
213 file after every logging. When you're using laptop-mode and your disk doesn't 215 file after every logging. When you're using laptop-mode and your disk doesn't
214 spin down, this is a likely culprit. 216 spin down, this is a likely culprit.
215 217
@@ -233,83 +235,82 @@ configuration file
233It should be installed as /etc/default/laptop-mode on Debian, and as 235It should be installed as /etc/default/laptop-mode on Debian, and as
234/etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes. 236/etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes.
235 237
236--------------------CONFIG FILE BEGIN------------------------------------------- 238Config file::
237# Maximum time, in seconds, of hard drive spindown time that you are 239
238# comfortable with. Worst case, it's possible that you could lose this 240 # Maximum time, in seconds, of hard drive spindown time that you are
239# amount of work if your battery fails you while in laptop mode. 241 # comfortable with. Worst case, it's possible that you could lose this
240#MAX_AGE=600 242 # amount of work if your battery fails you while in laptop mode.
241 243 #MAX_AGE=600
242# Automatically disable laptop mode when the number of minutes of battery 244
243# that you have left goes below this threshold. 245 # Automatically disable laptop mode when the number of minutes of battery
244MINIMUM_BATTERY_MINUTES=10 246 # that you have left goes below this threshold.
245 247 MINIMUM_BATTERY_MINUTES=10
246# Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG 248
247# by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk 249 # Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG
248# will read a complete MP3 at once, and will then spin down while the MP3/OGG is 250 # by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk
249# playing. 251 # will read a complete MP3 at once, and will then spin down while the MP3/OGG is
250#READAHEAD=4096 252 # playing.
251 253 #READAHEAD=4096
252# Shall we remount journaled fs. with appropriate commit interval? (1=yes) 254
253#DO_REMOUNTS=1 255 # Shall we remount journaled fs. with appropriate commit interval? (1=yes)
254 256 #DO_REMOUNTS=1
255# And shall we add the "noatime" option to that as well? (1=yes) 257
256#DO_REMOUNT_NOATIME=1 258 # And shall we add the "noatime" option to that as well? (1=yes)
257 259 #DO_REMOUNT_NOATIME=1
258# Dirty synchronous ratio. At this percentage of dirty pages the process 260
259# which 261 # Dirty synchronous ratio. At this percentage of dirty pages the process
260# calls write() does its own writeback 262 # which
261#DIRTY_RATIO=40 263 # calls write() does its own writeback
262 264 #DIRTY_RATIO=40
263# 265
264# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been 266 #
265# exceeded, the kernel will wake flusher threads which will then reduce the 267 # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
266# amount of dirty memory to dirty_background_ratio. Set this nice and low, 268 # exceeded, the kernel will wake flusher threads which will then reduce the
267# so once some writeout has commenced, we do a lot of it. 269 # amount of dirty memory to dirty_background_ratio. Set this nice and low,
268# 270 # so once some writeout has commenced, we do a lot of it.
269#DIRTY_BACKGROUND_RATIO=5 271 #
270 272 #DIRTY_BACKGROUND_RATIO=5
271# kernel default dirty buffer age 273
272#DEF_AGE=30 274 # kernel default dirty buffer age
273#DEF_UPDATE=5 275 #DEF_AGE=30
274#DEF_DIRTY_BACKGROUND_RATIO=10 276 #DEF_UPDATE=5
275#DEF_DIRTY_RATIO=40 277 #DEF_DIRTY_BACKGROUND_RATIO=10
276#DEF_XFS_AGE_BUFFER=15 278 #DEF_DIRTY_RATIO=40
277#DEF_XFS_SYNC_INTERVAL=30 279 #DEF_XFS_AGE_BUFFER=15
278#DEF_XFS_BUFD_INTERVAL=1 280 #DEF_XFS_SYNC_INTERVAL=30
279 281 #DEF_XFS_BUFD_INTERVAL=1
280# This must be adjusted manually to the value of HZ in the running kernel 282
281# on 2.4, until the XFS people change their 2.4 external interfaces to work in 283 # This must be adjusted manually to the value of HZ in the running kernel
282# centisecs. This can be automated, but it's a work in progress that still 284 # on 2.4, until the XFS people change their 2.4 external interfaces to work in
283# needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for 285 # centisecs. This can be automated, but it's a work in progress that still
284# external interfaces, and that is currently always set to 100. So you don't 286 # needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
285# need to change this on 2.6. 287 # external interfaces, and that is currently always set to 100. So you don't
286#XFS_HZ=100 288 # need to change this on 2.6.
287 289 #XFS_HZ=100
288# Should the maximum CPU frequency be adjusted down while on battery? 290
289# Requires CPUFreq to be setup. 291 # Should the maximum CPU frequency be adjusted down while on battery?
290# See Documentation/admin-guide/pm/cpufreq.rst for more info 292 # Requires CPUFreq to be setup.
291#DO_CPU=0 293 # See Documentation/admin-guide/pm/cpufreq.rst for more info
292 294 #DO_CPU=0
293# When on battery what is the maximum CPU speed that the system should 295
294# use? Legal values are "slowest" for the slowest speed that your 296 # When on battery what is the maximum CPU speed that the system should
295# CPU is able to operate at, or a value listed in: 297 # use? Legal values are "slowest" for the slowest speed that your
296# /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 298 # CPU is able to operate at, or a value listed in:
297# Only applicable if DO_CPU=1. 299 # /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
298#CPU_MAXFREQ=slowest 300 # Only applicable if DO_CPU=1.
299 301 #CPU_MAXFREQ=slowest
300# Idle timeout for your hard drive (man hdparm for valid values, -S option) 302
301# Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4). 303 # Idle timeout for your hard drive (man hdparm for valid values, -S option)
302#AC_HD=244 304 # Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4).
303#BATT_HD=4 305 #AC_HD=244
304 306 #BATT_HD=4
305# The drives for which to adjust the idle timeout. Separate them by a space, 307
306# e.g. HD="/dev/hda /dev/hdb". 308 # The drives for which to adjust the idle timeout. Separate them by a space,
307#HD="/dev/hda" 309 # e.g. HD="/dev/hda /dev/hdb".
308 310 #HD="/dev/hda"
309# Set the spindown timeout on a hard drive? 311
310#DO_HD=1 312 # Set the spindown timeout on a hard drive?
311 313 #DO_HD=1
312--------------------CONFIG FILE END---------------------------------------------
313 314
314 315
315Control script 316Control script
@@ -318,125 +319,126 @@ Control script
318Please note that this control script works for the Linux 2.4 and 2.6 series (thanks 319Please note that this control script works for the Linux 2.4 and 2.6 series (thanks
319to Kiko Piris). 320to Kiko Piris).
320 321
321--------------------CONTROL SCRIPT BEGIN---------------------------------------- 322Control script::
322#!/bin/bash 323
323 324 #!/bin/bash
324# start or stop laptop_mode, best run by a power management daemon when 325
325# ac gets connected/disconnected from a laptop 326 # start or stop laptop_mode, best run by a power management daemon when
326# 327 # ac gets connected/disconnected from a laptop
327# install as /sbin/laptop_mode 328 #
328# 329 # install as /sbin/laptop_mode
329# Contributors to this script: Kiko Piris 330 #
330# Bart Samwel 331 # Contributors to this script: Kiko Piris
331# Micha Feigin 332 # Bart Samwel
332# Andrew Morton 333 # Micha Feigin
333# Herve Eychenne 334 # Andrew Morton
334# Dax Kelson 335 # Herve Eychenne
335# 336 # Dax Kelson
336# Original Linux 2.4 version by: Jens Axboe 337 #
337 338 # Original Linux 2.4 version by: Jens Axboe
338############################################################################# 339
339 340 #############################################################################
340# Source config 341
341if [ -f /etc/default/laptop-mode ] ; then 342 # Source config
343 if [ -f /etc/default/laptop-mode ] ; then
342 # Debian 344 # Debian
343 . /etc/default/laptop-mode 345 . /etc/default/laptop-mode
344elif [ -f /etc/sysconfig/laptop-mode ] ; then 346 elif [ -f /etc/sysconfig/laptop-mode ] ; then
345 # Others 347 # Others
346 . /etc/sysconfig/laptop-mode 348 . /etc/sysconfig/laptop-mode
347fi 349 fi
348 350
349# Don't raise an error if the config file is incomplete 351 # Don't raise an error if the config file is incomplete
350# set defaults instead: 352 # set defaults instead:
351 353
352# Maximum time, in seconds, of hard drive spindown time that you are 354 # Maximum time, in seconds, of hard drive spindown time that you are
353# comfortable with. Worst case, it's possible that you could lose this 355 # comfortable with. Worst case, it's possible that you could lose this
354# amount of work if your battery fails you while in laptop mode. 356 # amount of work if your battery fails you while in laptop mode.
355MAX_AGE=${MAX_AGE:-'600'} 357 MAX_AGE=${MAX_AGE:-'600'}
356 358
357# Read-ahead, in kilobytes 359 # Read-ahead, in kilobytes
358READAHEAD=${READAHEAD:-'4096'} 360 READAHEAD=${READAHEAD:-'4096'}
359 361
360# Shall we remount journaled fs. with appropriate commit interval? (1=yes) 362 # Shall we remount journaled fs. with appropriate commit interval? (1=yes)
361DO_REMOUNTS=${DO_REMOUNTS:-'1'} 363 DO_REMOUNTS=${DO_REMOUNTS:-'1'}
362 364
363# And shall we add the "noatime" option to that as well? (1=yes) 365 # And shall we add the "noatime" option to that as well? (1=yes)
364DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'} 366 DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'}
365 367
366# Shall we adjust the idle timeout on a hard drive? 368 # Shall we adjust the idle timeout on a hard drive?
367DO_HD=${DO_HD:-'1'} 369 DO_HD=${DO_HD:-'1'}
368 370
369# Adjust idle timeout on which hard drive? 371 # Adjust idle timeout on which hard drive?
370HD="${HD:-'/dev/hda'}" 372 HD="${HD:-'/dev/hda'}"
371 373
372# spindown time for HD (hdparm -S values) 374 # spindown time for HD (hdparm -S values)
373AC_HD=${AC_HD:-'244'} 375 AC_HD=${AC_HD:-'244'}
374BATT_HD=${BATT_HD:-'4'} 376 BATT_HD=${BATT_HD:-'4'}
375 377
376# Dirty synchronous ratio. At this percentage of dirty pages the process which 378 # Dirty synchronous ratio. At this percentage of dirty pages the process which
377# calls write() does its own writeback 379 # calls write() does its own writeback
378DIRTY_RATIO=${DIRTY_RATIO:-'40'} 380 DIRTY_RATIO=${DIRTY_RATIO:-'40'}
379 381
380# cpu frequency scaling 382 # cpu frequency scaling
381# See Documentation/admin-guide/pm/cpufreq.rst for more info 383 # See Documentation/admin-guide/pm/cpufreq.rst for more info
382DO_CPU=${CPU_MANAGE:-'0'} 384 DO_CPU=${CPU_MANAGE:-'0'}
383CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} 385 CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'}
384 386
385# 387 #
386# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been 388 # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
387# exceeded, the kernel will wake flusher threads which will then reduce the 389 # exceeded, the kernel will wake flusher threads which will then reduce the
388# amount of dirty memory to dirty_background_ratio. Set this nice and low, 390 # amount of dirty memory to dirty_background_ratio. Set this nice and low,
389# so once some writeout has commenced, we do a lot of it. 391 # so once some writeout has commenced, we do a lot of it.
390# 392 #
391DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} 393 DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'}
392 394
393# kernel default dirty buffer age 395 # kernel default dirty buffer age
394DEF_AGE=${DEF_AGE:-'30'} 396 DEF_AGE=${DEF_AGE:-'30'}
395DEF_UPDATE=${DEF_UPDATE:-'5'} 397 DEF_UPDATE=${DEF_UPDATE:-'5'}
396DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'} 398 DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'}
397DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'} 399 DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'}
398DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'} 400 DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'}
399DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'} 401 DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'}
400DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'} 402 DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'}
401 403
402# This must be adjusted manually to the value of HZ in the running kernel 404 # This must be adjusted manually to the value of HZ in the running kernel
403# on 2.4, until the XFS people change their 2.4 external interfaces to work in 405 # on 2.4, until the XFS people change their 2.4 external interfaces to work in
404# centisecs. This can be automated, but it's a work in progress that still needs 406 # centisecs. This can be automated, but it's a work in progress that still needs
405# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external 407 # some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external
406# interfaces, and that is currently always set to 100. So you don't need to 408 # interfaces, and that is currently always set to 100. So you don't need to
407# change this on 2.6. 409 # change this on 2.6.
408XFS_HZ=${XFS_HZ:-'100'} 410 XFS_HZ=${XFS_HZ:-'100'}
409 411
410############################################################################# 412 #############################################################################
411 413
412KLEVEL="$(uname -r | 414 KLEVEL="$(uname -r |
413 { 415 {
414 IFS='.' read a b c 416 IFS='.' read a b c
415 echo $a.$b 417 echo $a.$b
416 } 418 }
417)" 419 )"
418case "$KLEVEL" in 420 case "$KLEVEL" in
419 "2.4"|"2.6") 421 "2.4"|"2.6")
420 ;; 422 ;;
421 *) 423 *)
422 echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2 424 echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2
423 exit 1 425 exit 1
424 ;; 426 ;;
425esac 427 esac
426 428
427if [ ! -e /proc/sys/vm/laptop_mode ] ; then 429 if [ ! -e /proc/sys/vm/laptop_mode ] ; then
428 echo "Kernel is not patched with laptop_mode patch." >&2 430 echo "Kernel is not patched with laptop_mode patch." >&2
429 exit 1 431 exit 1
430fi 432 fi
431 433
432if [ ! -w /proc/sys/vm/laptop_mode ] ; then 434 if [ ! -w /proc/sys/vm/laptop_mode ] ; then
433 echo "You do not have enough privileges to enable laptop_mode." >&2 435 echo "You do not have enough privileges to enable laptop_mode." >&2
434 exit 1 436 exit 1
435fi 437 fi
436 438
437# Remove an option (the first parameter) of the form option=<number> from 439 # Remove an option (the first parameter) of the form option=<number> from
438# a mount options string (the rest of the parameters). 440 # a mount options string (the rest of the parameters).
439parse_mount_opts () { 441 parse_mount_opts () {
440 OPT="$1" 442 OPT="$1"
441 shift 443 shift
442 echo ",$*," | sed \ 444 echo ",$*," | sed \
@@ -444,11 +446,11 @@ parse_mount_opts () {
444 -e 's/,,*/,/g' \ 446 -e 's/,,*/,/g' \
445 -e 's/^,//' \ 447 -e 's/^,//' \
446 -e 's/,$//' 448 -e 's/,$//'
447} 449 }
448 450
449# Remove an option (the first parameter) without any arguments from 451 # Remove an option (the first parameter) without any arguments from
450# a mount option string (the rest of the parameters). 452 # a mount option string (the rest of the parameters).
451parse_nonumber_mount_opts () { 453 parse_nonumber_mount_opts () {
452 OPT="$1" 454 OPT="$1"
453 shift 455 shift
454 echo ",$*," | sed \ 456 echo ",$*," | sed \
@@ -456,20 +458,20 @@ parse_nonumber_mount_opts () {
456 -e 's/,,*/,/g' \ 458 -e 's/,,*/,/g' \
457 -e 's/^,//' \ 459 -e 's/^,//' \
458 -e 's/,$//' 460 -e 's/,$//'
459} 461 }
460 462
461# Find out the state of a yes/no option (e.g. "atime"/"noatime") in 463 # Find out the state of a yes/no option (e.g. "atime"/"noatime") in
462# fstab for a given filesystem, and use this state to replace the 464 # fstab for a given filesystem, and use this state to replace the
463# value of the option in another mount options string. The device 465 # value of the option in another mount options string. The device
464# is the first argument, the option name the second, and the default 466 # is the first argument, the option name the second, and the default
465# value the third. The remainder is the mount options string. 467 # value the third. The remainder is the mount options string.
466# 468 #
467# Example: 469 # Example:
468# parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime 470 # parse_yesno_opts_wfstab /dev/hda1 atime atime defaults,noatime
469# 471 #
470# If fstab contains, say, "rw" for this filesystem, then the result 472 # If fstab contains, say, "rw" for this filesystem, then the result
471# will be "defaults,atime". 473 # will be "defaults,atime".
472parse_yesno_opts_wfstab () { 474 parse_yesno_opts_wfstab () {
473 L_DEV="$1" 475 L_DEV="$1"
474 OPT="$2" 476 OPT="$2"
475 DEF_OPT="$3" 477 DEF_OPT="$3"
@@ -491,21 +493,21 @@ parse_yesno_opts_wfstab () {
491 # option not specified in fstab -- choose the default. 493 # option not specified in fstab -- choose the default.
492 echo "$PARSEDOPTS1,$DEF_OPT" 494 echo "$PARSEDOPTS1,$DEF_OPT"
493 fi 495 fi
494} 496 }
495 497
496# Find out the state of a numbered option (e.g. "commit=NNN") in 498 # Find out the state of a numbered option (e.g. "commit=NNN") in
497# fstab for a given filesystem, and use this state to replace the 499 # fstab for a given filesystem, and use this state to replace the
498# value of the option in another mount options string. The device 500 # value of the option in another mount options string. The device
499# is the first argument, and the option name the second. The 501 # is the first argument, and the option name the second. The
500# remainder is the mount options string in which the replacement 502 # remainder is the mount options string in which the replacement
501# must be done. 503 # must be done.
502# 504 #
503# Example: 505 # Example:
504# parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7 506 # parse_mount_opts_wfstab /dev/hda1 commit defaults,commit=7
505# 507 #
506# If fstab contains, say, "commit=3,rw" for this filesystem, then the 508 # If fstab contains, say, "commit=3,rw" for this filesystem, then the
507# result will be "rw,commit=3". 509 # result will be "rw,commit=3".
508parse_mount_opts_wfstab () { 510 parse_mount_opts_wfstab () {
509 L_DEV="$1" 511 L_DEV="$1"
510 OPT="$2" 512 OPT="$2"
511 shift 2 513 shift 2
@@ -523,9 +525,9 @@ parse_mount_opts_wfstab () {
523 # option not specified in fstab: set it to 0 525 # option not specified in fstab: set it to 0
524 echo "$PARSEDOPTS1,$OPT=0" 526 echo "$PARSEDOPTS1,$OPT=0"
525 fi 527 fi
526} 528 }
527 529
528deduce_fstype () { 530 deduce_fstype () {
529 MP="$1" 531 MP="$1"
530 # My root filesystem unfortunately has 532 # My root filesystem unfortunately has
531 # type "unknown" in /etc/mtab. If we encounter 533 # type "unknown" in /etc/mtab. If we encounter
@@ -538,13 +540,13 @@ deduce_fstype () {
538 exit 0 540 exit 0
539 fi 541 fi
540 done 542 done
541} 543 }
542 544
543if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then 545 if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then
544 NOATIME_OPT=",noatime" 546 NOATIME_OPT=",noatime"
545fi 547 fi
546 548
547case "$1" in 549 case "$1" in
548 start) 550 start)
549 AGE=$((100*$MAX_AGE)) 551 AGE=$((100*$MAX_AGE))
550 XFS_AGE=$(($XFS_HZ*$MAX_AGE)) 552 XFS_AGE=$(($XFS_HZ*$MAX_AGE))
@@ -687,10 +689,9 @@ case "$1" in
687 exit 1 689 exit 1
688 ;; 690 ;;
689 691
690esac 692 esac
691 693
692exit 0 694 exit 0
693--------------------CONTROL SCRIPT END------------------------------------------
694 695
695 696
696ACPI integration 697ACPI integration
@@ -701,78 +702,76 @@ kick off the laptop_mode script and run hdparm. The part that
701automatically disables laptop mode when the battery is low was 702automatically disables laptop mode when the battery is low was
702written by Jan Topinski. 703written by Jan Topinski.
703 704
704-----------------/etc/acpi/events/ac_adapter BEGIN------------------------------ 705/etc/acpi/events/ac_adapter::
705event=ac_adapter 706
706action=/etc/acpi/actions/ac.sh %e 707 event=ac_adapter
707----------------/etc/acpi/events/ac_adapter END--------------------------------- 708 action=/etc/acpi/actions/ac.sh %e
709
710/etc/acpi/events/battery::
708 711
712 event=battery.*
713 action=/etc/acpi/actions/battery.sh %e
709 714
710-----------------/etc/acpi/events/battery BEGIN--------------------------------- 715/etc/acpi/actions/ac.sh::
711event=battery.*
712action=/etc/acpi/actions/battery.sh %e
713----------------/etc/acpi/events/battery END------------------------------------
714 716
717 #!/bin/bash
715 718
716----------------/etc/acpi/actions/ac.sh BEGIN----------------------------------- 719 # ac on/offline event handler
717#!/bin/bash
718 720
719# ac on/offline event handler 721 status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state`
720 722
721status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state` 723 case $status in
724 "on-line")
725 /sbin/laptop_mode stop
726 exit 0
727 ;;
728 "off-line")
729 /sbin/laptop_mode start
730 exit 0
731 ;;
732 esac
722 733
723case $status in
724 "on-line")
725 /sbin/laptop_mode stop
726 exit 0
727 ;;
728 "off-line")
729 /sbin/laptop_mode start
730 exit 0
731 ;;
732esac
733---------------------------/etc/acpi/actions/ac.sh END--------------------------
734 734
735/etc/acpi/actions/battery.sh::
735 736
736---------------------------/etc/acpi/actions/battery.sh BEGIN------------------- 737 #! /bin/bash
737#! /bin/bash
738 738
739# Automatically disable laptop mode when the battery almost runs out. 739 # Automatically disable laptop mode when the battery almost runs out.
740 740
741BATT_INFO=/proc/acpi/battery/$2/state 741 BATT_INFO=/proc/acpi/battery/$2/state
742 742
743if [[ -f /proc/sys/vm/laptop_mode ]] 743 if [[ -f /proc/sys/vm/laptop_mode ]]
744then 744 then
745 LM=`cat /proc/sys/vm/laptop_mode` 745 LM=`cat /proc/sys/vm/laptop_mode`
746 if [[ $LM -gt 0 ]] 746 if [[ $LM -gt 0 ]]
747 then
748 if [[ -f $BATT_INFO ]]
749 then 747 then
750 # Source the config file only now that we know we need 748 if [[ -f $BATT_INFO ]]
751 if [ -f /etc/default/laptop-mode ] ; then 749 then
752 # Debian 750 # Source the config file only now that we know we need
753 . /etc/default/laptop-mode 751 if [ -f /etc/default/laptop-mode ] ; then
754 elif [ -f /etc/sysconfig/laptop-mode ] ; then 752 # Debian
755 # Others 753 . /etc/default/laptop-mode
756 . /etc/sysconfig/laptop-mode 754 elif [ -f /etc/sysconfig/laptop-mode ] ; then
757 fi 755 # Others
758 MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'} 756 . /etc/sysconfig/laptop-mode
759 757 fi
760 ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`" 758 MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'}
761 if [[ ACTION -eq "discharging" ]] 759
762 then 760 ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`"
763 PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` 761 if [[ ACTION -eq "discharging" ]]
764 REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" ` 762 then
765 fi 763 PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed "s/.* \([0-9][0-9]* \).*/\1/" `
766 if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES)) 764 REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" `
767 then 765 fi
768 /sbin/laptop_mode stop 766 if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES))
769 fi 767 then
770 else 768 /sbin/laptop_mode stop
771 logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path." 769 fi
770 else
771 logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path."
772 fi
772 fi 773 fi
773 fi 774 fi
774fi
775---------------------------/etc/acpi/actions/battery.sh END--------------------
776 775
777 776
778Monitoring tool 777Monitoring tool
diff --git a/Documentation/laptops/lg-laptop.rst b/Documentation/admin-guide/laptops/lg-laptop.rst
index f2c2ffe31101..ce9b14671cb9 100644
--- a/Documentation/laptops/lg-laptop.rst
+++ b/Documentation/admin-guide/laptops/lg-laptop.rst
@@ -1,6 +1,5 @@
1.. SPDX-License-Identifier: GPL-2.0+ 1.. SPDX-License-Identifier: GPL-2.0+
2 2
3:orphan:
4 3
5LG Gram laptop extra features 4LG Gram laptop extra features
6============================= 5=============================
diff --git a/Documentation/laptops/sony-laptop.txt b/Documentation/admin-guide/laptops/sony-laptop.rst
index 978b1e615155..9edcc7f6612f 100644
--- a/Documentation/laptops/sony-laptop.txt
+++ b/Documentation/admin-guide/laptops/sony-laptop.rst
@@ -1,7 +1,9 @@
1=========================================
1Sony Notebook Control Driver (SNC) Readme 2Sony Notebook Control Driver (SNC) Readme
2----------------------------------------- 3=========================================
3 Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net> 4
4 Copyright (C) 2007 Mattia Dongili <malattia@linux.it> 5 - Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net>
6 - Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
5 7
6This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the 8This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the
7Sony Vaio laptops. This driver mixes both devices functions under the same 9Sony Vaio laptops. This driver mixes both devices functions under the same
@@ -10,6 +12,7 @@ obsoleted by sony-laptop now.
10 12
11Fn keys (hotkeys): 13Fn keys (hotkeys):
12------------------ 14------------------
15
13Some models report hotkeys through the SNC or SPIC devices, such events are 16Some models report hotkeys through the SNC or SPIC devices, such events are
14reported both through the ACPI subsystem as acpi events and through the INPUT 17reported both through the ACPI subsystem as acpi events and through the INPUT
15subsystem. See the logs of /proc/bus/input/devices to find out what those 18subsystem. See the logs of /proc/bus/input/devices to find out what those
@@ -28,11 +31,14 @@ If your laptop model supports it, you will find sysfs files in the
28/sys/class/backlight/sony/ 31/sys/class/backlight/sony/
29directory. You will be able to query and set the current screen 32directory. You will be able to query and set the current screen
30brightness: 33brightness:
34
35 ====================== =========================================
31 brightness get/set screen brightness (an integer 36 brightness get/set screen brightness (an integer
32 between 0 and 7) 37 between 0 and 7)
33 actual_brightness reading from this file will query the HW 38 actual_brightness reading from this file will query the HW
34 to get real brightness value 39 to get real brightness value
35 max_brightness the maximum brightness value 40 max_brightness the maximum brightness value
41 ====================== =========================================
36 42
37 43
38Platform specific: 44Platform specific:
@@ -45,6 +51,8 @@ You then read/write integer values from/to those files by using
45standard UNIX tools. 51standard UNIX tools.
46 52
47The files are: 53The files are:
54
55 ====================== ==========================================
48 brightness_default screen brightness which will be set 56 brightness_default screen brightness which will be set
49 when the laptop will be rebooted 57 when the laptop will be rebooted
50 cdpower power on/off the internal CD drive 58 cdpower power on/off the internal CD drive
@@ -53,21 +61,39 @@ The files are:
53 (only in debug mode) 61 (only in debug mode)
54 bluetoothpower power on/off the internal bluetooth device 62 bluetoothpower power on/off the internal bluetooth device
55 fanspeed get/set the fan speed 63 fanspeed get/set the fan speed
64 ====================== ==========================================
56 65
57Note that some files may be missing if they are not supported 66Note that some files may be missing if they are not supported
58by your particular laptop model. 67by your particular laptop model.
59 68
60Example usage: 69Example usage::
70
61 # echo "1" > /sys/devices/platform/sony-laptop/brightness_default 71 # echo "1" > /sys/devices/platform/sony-laptop/brightness_default
62sets the lowest screen brightness for the next and later reboots, 72
73sets the lowest screen brightness for the next and later reboots
74
75::
76
63 # echo "8" > /sys/devices/platform/sony-laptop/brightness_default 77 # echo "8" > /sys/devices/platform/sony-laptop/brightness_default
64sets the highest screen brightness for the next and later reboots, 78
79sets the highest screen brightness for the next and later reboots
80
81::
82
65 # cat /sys/devices/platform/sony-laptop/brightness_default 83 # cat /sys/devices/platform/sony-laptop/brightness_default
66retrieves the value. 84
85retrieves the value
86
87::
67 88
68 # echo "0" > /sys/devices/platform/sony-laptop/audiopower 89 # echo "0" > /sys/devices/platform/sony-laptop/audiopower
69powers off the sound card, 90
91powers off the sound card
92
93::
94
70 # echo "1" > /sys/devices/platform/sony-laptop/audiopower 95 # echo "1" > /sys/devices/platform/sony-laptop/audiopower
96
71powers on the sound card. 97powers on the sound card.
72 98
73 99
@@ -76,7 +102,8 @@ RFkill control:
76More recent Vaio models expose a consistent set of ACPI methods to 102More recent Vaio models expose a consistent set of ACPI methods to
77control radio frequency emitting devices. If you are a lucky owner of 103control radio frequency emitting devices. If you are a lucky owner of
78such a laptop you will find the necessary rfkill devices under 104such a laptop you will find the necessary rfkill devices under
79/sys/class/rfkill. Check those starting with sony-* in 105/sys/class/rfkill. Check those starting with sony-* in::
106
80 # grep . /sys/class/rfkill/*/{state,name} 107 # grep . /sys/class/rfkill/*/{state,name}
81 108
82 109
@@ -88,26 +115,29 @@ you are not afraid of any side effects doing strange things with
88your ACPI BIOS could have on your laptop), load the driver and 115your ACPI BIOS could have on your laptop), load the driver and
89pass the option 'debug=1'. 116pass the option 'debug=1'.
90 117
91REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS. 118REPEAT:
119 **DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.**
92 120
93In your kernel logs you will find the list of all ACPI methods 121In your kernel logs you will find the list of all ACPI methods
94the SNC device has on your laptop. 122the SNC device has on your laptop.
95 123
96* For new models you will see a long list of meaningless method names, 124* For new models you will see a long list of meaningless method names,
97reading the DSDT table source should reveal that: 125 reading the DSDT table source should reveal that:
126
98(1) the SNC device uses an internal capability lookup table 127(1) the SNC device uses an internal capability lookup table
99(2) SN00 is used to find values in the lookup table 128(2) SN00 is used to find values in the lookup table
100(3) SN06 and SN07 are used to call into the real methods based on 129(3) SN06 and SN07 are used to call into the real methods based on
101 offsets you can obtain iterating the table using SN00 130 offsets you can obtain iterating the table using SN00
102(4) SN02 used to enable events. 131(4) SN02 used to enable events.
132
103Some values in the capability lookup table are more or less known, see 133Some values in the capability lookup table are more or less known, see
104the code for all sony_call_snc_handle calls, others are more obscure. 134the code for all sony_call_snc_handle calls, others are more obscure.
105 135
106* For old models you can see the GCDP/GCDP methods used to pwer on/off 136* For old models you can see the GCDP/GCDP methods used to pwer on/off
107the CD drive, but there are others and they are usually different from 137 the CD drive, but there are others and they are usually different from
108model to model. 138 model to model.
109 139
110I HAVE NO IDEA WHAT THOSE METHODS DO. 140**I HAVE NO IDEA WHAT THOSE METHODS DO.**
111 141
112The sony-laptop driver creates, for some of those methods (the most 142The sony-laptop driver creates, for some of those methods (the most
113current ones found on several Vaio models), an entry under 143current ones found on several Vaio models), an entry under
diff --git a/Documentation/laptops/sonypi.txt b/Documentation/admin-guide/laptops/sonypi.rst
index 606bdb9ce036..c6eaaf48f7c1 100644
--- a/Documentation/laptops/sonypi.txt
+++ b/Documentation/admin-guide/laptops/sonypi.rst
@@ -1,11 +1,13 @@
1==================================================
1Sony Programmable I/O Control Device Driver Readme 2Sony Programmable I/O Control Device Driver Readme
2-------------------------------------------------- 3==================================================
3 Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net> 4
4 Copyright (C) 2001-2002 Alcôve <www.alcove.com> 5 - Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
5 Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au> 6 - Copyright (C) 2001-2002 Alcôve <www.alcove.com>
6 Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp> 7 - Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
7 Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp> 8 - Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
8 Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> 9 - Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
10 - Copyright (C) 2000 Andrew Tridgell <tridge@samba.org>
9 11
10This driver enables access to the Sony Programmable I/O Control Device which 12This driver enables access to the Sony Programmable I/O Control Device which
11can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be 13can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
@@ -14,6 +16,7 @@ sonypi device and are not supported at all by this driver.
14 16
15It will give access (through a user space utility) to some events those laptops 17It will give access (through a user space utility) to some events those laptops
16generate, like: 18generate, like:
19
17 - jogdial events (the small wheel on the side of Vaios) 20 - jogdial events (the small wheel on the side of Vaios)
18 - capture button events (only on Vaio Picturebook series) 21 - capture button events (only on Vaio Picturebook series)
19 - Fn keys 22 - Fn keys
@@ -49,7 +52,8 @@ module argument syntax (<param>=<value> when passing the option to the
49module or sonypi.<param>=<value> on the kernel boot line when sonypi is 52module or sonypi.<param>=<value> on the kernel boot line when sonypi is
50statically linked into the kernel). Those options are: 53statically linked into the kernel). Those options are:
51 54
52 minor: minor number of the misc device /dev/sonypi, 55 =============== =======================================================
56 minor: minor number of the misc device /dev/sonypi,
53 default is -1 (automatic allocation, see /proc/misc 57 default is -1 (automatic allocation, see /proc/misc
54 or kernel logs) 58 or kernel logs)
55 59
@@ -85,17 +89,18 @@ statically linked into the kernel). Those options are:
85 set to 0xffffffff, meaning that all possible events 89 set to 0xffffffff, meaning that all possible events
86 will be tried. You can use the following bits to 90 will be tried. You can use the following bits to
87 construct your own event mask (from 91 construct your own event mask (from
88 drivers/char/sonypi.h): 92 drivers/char/sonypi.h)::
89 SONYPI_JOGGER_MASK 0x0001 93
90 SONYPI_CAPTURE_MASK 0x0002 94 SONYPI_JOGGER_MASK 0x0001
91 SONYPI_FNKEY_MASK 0x0004 95 SONYPI_CAPTURE_MASK 0x0002
92 SONYPI_BLUETOOTH_MASK 0x0008 96 SONYPI_FNKEY_MASK 0x0004
93 SONYPI_PKEY_MASK 0x0010 97 SONYPI_BLUETOOTH_MASK 0x0008
94 SONYPI_BACK_MASK 0x0020 98 SONYPI_PKEY_MASK 0x0010
95 SONYPI_HELP_MASK 0x0040 99 SONYPI_BACK_MASK 0x0020
96 SONYPI_LID_MASK 0x0080 100 SONYPI_HELP_MASK 0x0040
97 SONYPI_ZOOM_MASK 0x0100 101 SONYPI_LID_MASK 0x0080
98 SONYPI_THUMBPHRASE_MASK 0x0200 102 SONYPI_ZOOM_MASK 0x0100
103 SONYPI_THUMBPHRASE_MASK 0x0200
99 SONYPI_MEYE_MASK 0x0400 104 SONYPI_MEYE_MASK 0x0400
100 SONYPI_MEMORYSTICK_MASK 0x0800 105 SONYPI_MEMORYSTICK_MASK 0x0800
101 SONYPI_BATTERY_MASK 0x1000 106 SONYPI_BATTERY_MASK 0x1000
@@ -105,17 +110,18 @@ statically linked into the kernel). Those options are:
105 created, one which interprets the jogdial events as 110 created, one which interprets the jogdial events as
106 mouse events, the other one which acts like a 111 mouse events, the other one which acts like a
107 keyboard reporting the pressing of the special keys. 112 keyboard reporting the pressing of the special keys.
113 =============== =======================================================
108 114
109Module use: 115Module use:
110----------- 116-----------
111 117
112In order to automatically load the sonypi module on use, you can put those 118In order to automatically load the sonypi module on use, you can put those
113lines a configuration file in /etc/modprobe.d/: 119lines a configuration file in /etc/modprobe.d/::
114 120
115 alias char-major-10-250 sonypi 121 alias char-major-10-250 sonypi
116 options sonypi minor=250 122 options sonypi minor=250
117 123
118This supposes the use of minor 250 for the sonypi device: 124This supposes the use of minor 250 for the sonypi device::
119 125
120 # mknod /dev/sonypi c 10 250 126 # mknod /dev/sonypi c 10 250
121 127
@@ -148,5 +154,5 @@ Bugs:
148 http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 154 http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2
149 155
150 - since all development was done by reverse engineering, there is 156 - since all development was done by reverse engineering, there is
151 _absolutely no guarantee_ that this driver will not crash your 157 *absolutely no guarantee* that this driver will not crash your
152 laptop. Permanently. 158 laptop. Permanently.
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
index 75ef063622d2..adea0bf2acc5 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
@@ -1,12 +1,15 @@
1 ThinkPad ACPI Extras Driver 1===========================
2ThinkPad ACPI Extras Driver
3===========================
2 4
3 Version 0.25 5Version 0.25
4 October 16th, 2013
5 6
6 Borislav Deianov <borislav@users.sf.net> 7October 16th, 2013
7 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
8 http://ibm-acpi.sf.net/
9 8
9- Borislav Deianov <borislav@users.sf.net>
10- Henrique de Moraes Holschuh <hmh@hmh.eng.br>
11
12http://ibm-acpi.sf.net/
10 13
11This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It 14This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It
12supports various features of these laptops which are accessible 15supports various features of these laptops which are accessible
@@ -91,7 +94,8 @@ yet ready or stabilized, it is expected that this interface will change,
91and any and all userspace programs must deal with it. 94and any and all userspace programs must deal with it.
92 95
93 96
94Notes about the sysfs interface: 97Notes about the sysfs interface
98^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
95 99
96Unlike what was done with the procfs interface, correctness when talking 100Unlike what was done with the procfs interface, correctness when talking
97to the sysfs interfaces will be enforced, as will correctness in the 101to the sysfs interfaces will be enforced, as will correctness in the
@@ -129,6 +133,7 @@ Driver version
129-------------- 133--------------
130 134
131procfs: /proc/acpi/ibm/driver 135procfs: /proc/acpi/ibm/driver
136
132sysfs driver attribute: version 137sysfs driver attribute: version
133 138
134The driver name and version. No commands can be written to this file. 139The driver name and version. No commands can be written to this file.
@@ -141,9 +146,13 @@ sysfs driver attribute: interface_version
141 146
142Version of the thinkpad-acpi sysfs interface, as an unsigned long 147Version of the thinkpad-acpi sysfs interface, as an unsigned long
143(output in hex format: 0xAAAABBCC), where: 148(output in hex format: 0xAAAABBCC), where:
144 AAAA - major revision 149
145 BB - minor revision 150 AAAA
146 CC - bugfix revision 151 - major revision
152 BB
153 - minor revision
154 CC
155 - bugfix revision
147 156
148The sysfs interface version changelog for the driver can be found at the 157The sysfs interface version changelog for the driver can be found at the
149end of this document. Changes to the sysfs interface done by the kernel 158end of this document. Changes to the sysfs interface done by the kernel
@@ -170,6 +179,7 @@ Hot keys
170-------- 179--------
171 180
172procfs: /proc/acpi/ibm/hotkey 181procfs: /proc/acpi/ibm/hotkey
182
173sysfs device attribute: hotkey_* 183sysfs device attribute: hotkey_*
174 184
175In a ThinkPad, the ACPI HKEY handler is responsible for communicating 185In a ThinkPad, the ACPI HKEY handler is responsible for communicating
@@ -181,7 +191,7 @@ firmware will behave in many situations.
181The driver enables the HKEY ("hot key") event reporting automatically 191The driver enables the HKEY ("hot key") event reporting automatically
182when loaded, and disables it when it is removed. 192when loaded, and disables it when it is removed.
183 193
184The driver will report HKEY events in the following format: 194The driver will report HKEY events in the following format::
185 195
186 ibm/hotkey HKEY 00000080 0000xxxx 196 ibm/hotkey HKEY 00000080 0000xxxx
187 197
@@ -217,9 +227,10 @@ ThinkPads, it is still possible to support some extra hotkeys by
217polling the "CMOS NVRAM" at least 10 times per second. The driver 227polling the "CMOS NVRAM" at least 10 times per second. The driver
218attempts to enables this functionality automatically when required. 228attempts to enables this functionality automatically when required.
219 229
220procfs notes: 230procfs notes
231^^^^^^^^^^^^
221 232
222The following commands can be written to the /proc/acpi/ibm/hotkey file: 233The following commands can be written to the /proc/acpi/ibm/hotkey file::
223 234
224 echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys 235 echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys
225 echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys 236 echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
@@ -227,7 +238,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:
227 echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask 238 echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask
228 239
229The following commands have been deprecated and will cause the kernel 240The following commands have been deprecated and will cause the kernel
230to log a warning: 241to log a warning::
231 242
232 echo enable > /proc/acpi/ibm/hotkey -- does nothing 243 echo enable > /proc/acpi/ibm/hotkey -- does nothing
233 echo disable > /proc/acpi/ibm/hotkey -- returns an error 244 echo disable > /proc/acpi/ibm/hotkey -- returns an error
@@ -237,7 +248,8 @@ maintain maximum bug-to-bug compatibility, it does not report any masks,
237nor does it allow one to manipulate the hot key mask when the firmware 248nor does it allow one to manipulate the hot key mask when the firmware
238does not support masks at all, even if NVRAM polling is in use. 249does not support masks at all, even if NVRAM polling is in use.
239 250
240sysfs notes: 251sysfs notes
252^^^^^^^^^^^
241 253
242 hotkey_bios_enabled: 254 hotkey_bios_enabled:
243 DEPRECATED, WILL BE REMOVED SOON. 255 DEPRECATED, WILL BE REMOVED SOON.
@@ -349,7 +361,8 @@ sysfs notes:
349 361
350 This attribute has poll()/select() support. 362 This attribute has poll()/select() support.
351 363
352input layer notes: 364input layer notes
365^^^^^^^^^^^^^^^^^
353 366
354A Hot key is mapped to a single input layer EV_KEY event, possibly 367A Hot key is mapped to a single input layer EV_KEY event, possibly
355followed by an EV_MSC MSC_SCAN event that shall contain that key's scan 368followed by an EV_MSC MSC_SCAN event that shall contain that key's scan
@@ -362,11 +375,13 @@ remapping KEY_UNKNOWN keys.
362 375
363The events are available in an input device, with the following id: 376The events are available in an input device, with the following id:
364 377
365 Bus: BUS_HOST 378 ============== ==============================
366 vendor: 0x1014 (PCI_VENDOR_ID_IBM) or 379 Bus BUS_HOST
380 vendor 0x1014 (PCI_VENDOR_ID_IBM) or
367 0x17aa (PCI_VENDOR_ID_LENOVO) 381 0x17aa (PCI_VENDOR_ID_LENOVO)
368 product: 0x5054 ("TP") 382 product 0x5054 ("TP")
369 version: 0x4101 383 version 0x4101
384 ============== ==============================
370 385
371The version will have its LSB incremented if the keymap changes in a 386The version will have its LSB incremented if the keymap changes in a
372backwards-compatible way. The MSB shall always be 0x41 for this input 387backwards-compatible way. The MSB shall always be 0x41 for this input
@@ -380,9 +395,10 @@ backwards-compatible change for this input device.
380 395
381Thinkpad-acpi Hot Key event map (version 0x4101): 396Thinkpad-acpi Hot Key event map (version 0x4101):
382 397
398======= ======= ============== ==============================================
383ACPI Scan 399ACPI Scan
384event code Key Notes 400event code Key Notes
385 401======= ======= ============== ==============================================
3860x1001 0x00 FN+F1 - 4020x1001 0x00 FN+F1 -
387 403
3880x1002 0x01 FN+F2 IBM: battery (rare) 4040x1002 0x01 FN+F2 IBM: battery (rare)
@@ -426,7 +442,9 @@ event code Key Notes
426 or toggle screen expand 442 or toggle screen expand
427 443
4280x1009 0x08 FN+F9 - 4440x1009 0x08 FN+F9 -
429 .. .. .. 445
446... ... ... ...
447
4300x100B 0x0A FN+F11 - 4480x100B 0x0A FN+F11 -
431 449
4320x100C 0x0B FN+F12 Sleep to disk. You are always 4500x100C 0x0B FN+F12 Sleep to disk. You are always
@@ -480,8 +498,11 @@ event code Key Notes
4800x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key 4980x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key
481 499
4820x1019 0x18 unknown 5000x1019 0x18 unknown
483.. .. .. 501
502... ... ...
503
4840x1020 0x1F unknown 5040x1020 0x1F unknown
505======= ======= ============== ==============================================
485 506
486The ThinkPad firmware does not allow one to differentiate when most hot 507The ThinkPad firmware does not allow one to differentiate when most hot
487keys are pressed or released (either that, or we don't know how to, yet). 508keys are pressed or released (either that, or we don't know how to, yet).
@@ -499,14 +520,17 @@ generate input device EV_KEY events.
499In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW 520In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW
500events for switches: 521events for switches:
501 522
523============== ==============================================
502SW_RFKILL_ALL T60 and later hardware rfkill rocker switch 524SW_RFKILL_ALL T60 and later hardware rfkill rocker switch
503SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A 525SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A
526============== ==============================================
504 527
505Non hotkey ACPI HKEY event map: 528Non hotkey ACPI HKEY event map
506------------------------------- 529------------------------------
507 530
508Events that are never propagated by the driver: 531Events that are never propagated by the driver:
509 532
533====== ==================================================
5100x2304 System is waking up from suspend to undock 5340x2304 System is waking up from suspend to undock
5110x2305 System is waking up from suspend to eject bay 5350x2305 System is waking up from suspend to eject bay
5120x2404 System is waking up from hibernation to undock 5360x2404 System is waking up from hibernation to undock
@@ -519,10 +543,12 @@ Events that are never propagated by the driver:
5190x6000 KEYBOARD: Numlock key pressed 5430x6000 KEYBOARD: Numlock key pressed
5200x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED) 5440x6005 KEYBOARD: Fn key pressed (TO BE VERIFIED)
5210x7000 Radio Switch may have changed state 5450x7000 Radio Switch may have changed state
546====== ==================================================
522 547
523 548
524Events that are propagated by the driver to userspace: 549Events that are propagated by the driver to userspace:
525 550
551====== =====================================================
5260x2313 ALARM: System is waking up from suspend because 5520x2313 ALARM: System is waking up from suspend because
527 the battery is nearly empty 553 the battery is nearly empty
5280x2413 ALARM: System is waking up from hibernation because 5540x2413 ALARM: System is waking up from hibernation because
@@ -544,6 +570,7 @@ Events that are propagated by the driver to userspace:
5440x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED) 5700x6040 Nvidia Optimus/AC adapter related (TO BE VERIFIED)
5450x60C0 X1 Yoga 2016, Tablet mode status changed 5710x60C0 X1 Yoga 2016, Tablet mode status changed
5460x60F0 Thermal Transformation changed (GMTS, Windows) 5720x60F0 Thermal Transformation changed (GMTS, Windows)
573====== =====================================================
547 574
548Battery nearly empty alarms are a last resort attempt to get the 575Battery nearly empty alarms are a last resort attempt to get the
549operating system to hibernate or shutdown cleanly (0x2313), or shutdown 576operating system to hibernate or shutdown cleanly (0x2313), or shutdown
@@ -562,7 +589,8 @@ cycle, or a system shutdown. Obviously, something is very wrong if this
562happens. 589happens.
563 590
564 591
565Brightness hotkey notes: 592Brightness hotkey notes
593^^^^^^^^^^^^^^^^^^^^^^^
566 594
567Don't mess with the brightness hotkeys in a Thinkpad. If you want 595Don't mess with the brightness hotkeys in a Thinkpad. If you want
568notifications for OSD, use the sysfs backlight class event support. 596notifications for OSD, use the sysfs backlight class event support.
@@ -579,7 +607,9 @@ Bluetooth
579--------- 607---------
580 608
581procfs: /proc/acpi/ibm/bluetooth 609procfs: /proc/acpi/ibm/bluetooth
610
582sysfs device attribute: bluetooth_enable (deprecated) 611sysfs device attribute: bluetooth_enable (deprecated)
612
583sysfs rfkill class: switch "tpacpi_bluetooth_sw" 613sysfs rfkill class: switch "tpacpi_bluetooth_sw"
584 614
585This feature shows the presence and current state of a ThinkPad 615This feature shows the presence and current state of a ThinkPad
@@ -588,36 +618,39 @@ Bluetooth device in the internal ThinkPad CDC slot.
588If the ThinkPad supports it, the Bluetooth state is stored in NVRAM, 618If the ThinkPad supports it, the Bluetooth state is stored in NVRAM,
589so it is kept across reboots and power-off. 619so it is kept across reboots and power-off.
590 620
591Procfs notes: 621Procfs notes
622^^^^^^^^^^^^
592 623
593If Bluetooth is installed, the following commands can be used: 624If Bluetooth is installed, the following commands can be used::
594 625
595 echo enable > /proc/acpi/ibm/bluetooth 626 echo enable > /proc/acpi/ibm/bluetooth
596 echo disable > /proc/acpi/ibm/bluetooth 627 echo disable > /proc/acpi/ibm/bluetooth
597 628
598Sysfs notes: 629Sysfs notes
630^^^^^^^^^^^
599 631
600 If the Bluetooth CDC card is installed, it can be enabled / 632 If the Bluetooth CDC card is installed, it can be enabled /
601 disabled through the "bluetooth_enable" thinkpad-acpi device 633 disabled through the "bluetooth_enable" thinkpad-acpi device
602 attribute, and its current status can also be queried. 634 attribute, and its current status can also be queried.
603 635
604 enable: 636 enable:
605 0: disables Bluetooth / Bluetooth is disabled 637
606 1: enables Bluetooth / Bluetooth is enabled. 638 - 0: disables Bluetooth / Bluetooth is disabled
639 - 1: enables Bluetooth / Bluetooth is enabled.
607 640
608 Note: this interface has been superseded by the generic rfkill 641 Note: this interface has been superseded by the generic rfkill
609 class. It has been deprecated, and it will be removed in year 642 class. It has been deprecated, and it will be removed in year
610 2010. 643 2010.
611 644
612 rfkill controller switch "tpacpi_bluetooth_sw": refer to 645 rfkill controller switch "tpacpi_bluetooth_sw": refer to
613 Documentation/rfkill.txt for details. 646 Documentation/driver-api/rfkill.rst for details.
614 647
615 648
616Video output control -- /proc/acpi/ibm/video 649Video output control -- /proc/acpi/ibm/video
617-------------------------------------------- 650--------------------------------------------
618 651
619This feature allows control over the devices used for video output - 652This feature allows control over the devices used for video output -
620LCD, CRT or DVI (if available). The following commands are available: 653LCD, CRT or DVI (if available). The following commands are available::
621 654
622 echo lcd_enable > /proc/acpi/ibm/video 655 echo lcd_enable > /proc/acpi/ibm/video
623 echo lcd_disable > /proc/acpi/ibm/video 656 echo lcd_disable > /proc/acpi/ibm/video
@@ -630,9 +663,10 @@ LCD, CRT or DVI (if available). The following commands are available:
630 echo expand_toggle > /proc/acpi/ibm/video 663 echo expand_toggle > /proc/acpi/ibm/video
631 echo video_switch > /proc/acpi/ibm/video 664 echo video_switch > /proc/acpi/ibm/video
632 665
633NOTE: Access to this feature is restricted to processes owning the 666NOTE:
634CAP_SYS_ADMIN capability for safety reasons, as it can interact badly 667 Access to this feature is restricted to processes owning the
635enough with some versions of X.org to crash it. 668 CAP_SYS_ADMIN capability for safety reasons, as it can interact badly
669 enough with some versions of X.org to crash it.
636 670
637Each video output device can be enabled or disabled individually. 671Each video output device can be enabled or disabled individually.
638Reading /proc/acpi/ibm/video shows the status of each device. 672Reading /proc/acpi/ibm/video shows the status of each device.
@@ -665,18 +699,21 @@ ThinkLight control
665------------------ 699------------------
666 700
667procfs: /proc/acpi/ibm/light 701procfs: /proc/acpi/ibm/light
702
668sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED 703sysfs attributes: as per LED class, for the "tpacpi::thinklight" LED
669 704
670procfs notes: 705procfs notes
706^^^^^^^^^^^^
671 707
672The ThinkLight status can be read and set through the procfs interface. A 708The ThinkLight status can be read and set through the procfs interface. A
673few models which do not make the status available will show the ThinkLight 709few models which do not make the status available will show the ThinkLight
674status as "unknown". The available commands are: 710status as "unknown". The available commands are::
675 711
676 echo on > /proc/acpi/ibm/light 712 echo on > /proc/acpi/ibm/light
677 echo off > /proc/acpi/ibm/light 713 echo off > /proc/acpi/ibm/light
678 714
679sysfs notes: 715sysfs notes
716^^^^^^^^^^^
680 717
681The ThinkLight sysfs interface is documented by the LED class 718The ThinkLight sysfs interface is documented by the LED class
682documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name 719documentation, in Documentation/leds/leds-class.rst. The ThinkLight LED name
@@ -691,6 +728,7 @@ CMOS/UCMS control
691----------------- 728-----------------
692 729
693procfs: /proc/acpi/ibm/cmos 730procfs: /proc/acpi/ibm/cmos
731
694sysfs device attribute: cmos_command 732sysfs device attribute: cmos_command
695 733
696This feature is mostly used internally by the ACPI firmware to keep the legacy 734This feature is mostly used internally by the ACPI firmware to keep the legacy
@@ -707,16 +745,16 @@ The range of valid cmos command numbers is 0 to 21, but not all have an
707effect and the behavior varies from model to model. Here is the behavior 745effect and the behavior varies from model to model. Here is the behavior
708on the X40 (tpb is the ThinkPad Buttons utility): 746on the X40 (tpb is the ThinkPad Buttons utility):
709 747
710 0 - Related to "Volume down" key press 748 - 0 - Related to "Volume down" key press
711 1 - Related to "Volume up" key press 749 - 1 - Related to "Volume up" key press
712 2 - Related to "Mute on" key press 750 - 2 - Related to "Mute on" key press
713 3 - Related to "Access IBM" key press 751 - 3 - Related to "Access IBM" key press
714 4 - Related to "LCD brightness up" key press 752 - 4 - Related to "LCD brightness up" key press
715 5 - Related to "LCD brightness down" key press 753 - 5 - Related to "LCD brightness down" key press
716 11 - Related to "toggle screen expansion" key press/function 754 - 11 - Related to "toggle screen expansion" key press/function
717 12 - Related to "ThinkLight on" 755 - 12 - Related to "ThinkLight on"
718 13 - Related to "ThinkLight off" 756 - 13 - Related to "ThinkLight off"
719 14 - Related to "ThinkLight" key press (toggle ThinkLight) 757 - 14 - Related to "ThinkLight" key press (toggle ThinkLight)
720 758
721The cmos command interface is prone to firmware split-brain problems, as 759The cmos command interface is prone to firmware split-brain problems, as
722in newer ThinkPads it is just a compatibility layer. Do not use it, it is 760in newer ThinkPads it is just a compatibility layer. Do not use it, it is
@@ -748,9 +786,10 @@ are aware of the consequences are welcome to enabling it.
748Audio mute and microphone mute LEDs are supported, but currently not 786Audio mute and microphone mute LEDs are supported, but currently not
749visible to userspace. They are used by the snd-hda-intel audio driver. 787visible to userspace. They are used by the snd-hda-intel audio driver.
750 788
751procfs notes: 789procfs notes
790^^^^^^^^^^^^
752 791
753The available commands are: 792The available commands are::
754 793
755 echo '<LED number> on' >/proc/acpi/ibm/led 794 echo '<LED number> on' >/proc/acpi/ibm/led
756 echo '<LED number> off' >/proc/acpi/ibm/led 795 echo '<LED number> off' >/proc/acpi/ibm/led
@@ -760,23 +799,24 @@ The <LED number> range is 0 to 15. The set of LEDs that can be
760controlled varies from model to model. Here is the common ThinkPad 799controlled varies from model to model. Here is the common ThinkPad
761mapping: 800mapping:
762 801
763 0 - power 802 - 0 - power
764 1 - battery (orange) 803 - 1 - battery (orange)
765 2 - battery (green) 804 - 2 - battery (green)
766 3 - UltraBase/dock 805 - 3 - UltraBase/dock
767 4 - UltraBay 806 - 4 - UltraBay
768 5 - UltraBase battery slot 807 - 5 - UltraBase battery slot
769 6 - (unknown) 808 - 6 - (unknown)
770 7 - standby 809 - 7 - standby
771 8 - dock status 1 810 - 8 - dock status 1
772 9 - dock status 2 811 - 9 - dock status 2
773 10, 11 - (unknown) 812 - 10, 11 - (unknown)
774 12 - thinkvantage 813 - 12 - thinkvantage
775 13, 14, 15 - (unknown) 814 - 13, 14, 15 - (unknown)
776 815
777All of the above can be turned on and off and can be made to blink. 816All of the above can be turned on and off and can be made to blink.
778 817
779sysfs notes: 818sysfs notes
819^^^^^^^^^^^
780 820
781The ThinkPad LED sysfs interface is described in detail by the LED class 821The ThinkPad LED sysfs interface is described in detail by the LED class
782documentation, in Documentation/leds/leds-class.rst. 822documentation, in Documentation/leds/leds-class.rst.
@@ -815,7 +855,7 @@ The BEEP method is used internally by the ACPI firmware to provide
815audible alerts in various situations. This feature allows the same 855audible alerts in various situations. This feature allows the same
816sounds to be triggered manually. 856sounds to be triggered manually.
817 857
818The commands are non-negative integer numbers: 858The commands are non-negative integer numbers::
819 859
820 echo <number> >/proc/acpi/ibm/beep 860 echo <number> >/proc/acpi/ibm/beep
821 861
@@ -823,25 +863,26 @@ The valid <number> range is 0 to 17. Not all numbers trigger sounds
823and the sounds vary from model to model. Here is the behavior on the 863and the sounds vary from model to model. Here is the behavior on the
824X40: 864X40:
825 865
826 0 - stop a sound in progress (but use 17 to stop 16) 866 - 0 - stop a sound in progress (but use 17 to stop 16)
827 2 - two beeps, pause, third beep ("low battery") 867 - 2 - two beeps, pause, third beep ("low battery")
828 3 - single beep 868 - 3 - single beep
829 4 - high, followed by low-pitched beep ("unable") 869 - 4 - high, followed by low-pitched beep ("unable")
830 5 - single beep 870 - 5 - single beep
831 6 - very high, followed by high-pitched beep ("AC/DC") 871 - 6 - very high, followed by high-pitched beep ("AC/DC")
832 7 - high-pitched beep 872 - 7 - high-pitched beep
833 9 - three short beeps 873 - 9 - three short beeps
834 10 - very long beep 874 - 10 - very long beep
835 12 - low-pitched beep 875 - 12 - low-pitched beep
836 15 - three high-pitched beeps repeating constantly, stop with 0 876 - 15 - three high-pitched beeps repeating constantly, stop with 0
837 16 - one medium-pitched beep repeating constantly, stop with 17 877 - 16 - one medium-pitched beep repeating constantly, stop with 17
838 17 - stop 16 878 - 17 - stop 16
839 879
840 880
841Temperature sensors 881Temperature sensors
842------------------- 882-------------------
843 883
844procfs: /proc/acpi/ibm/thermal 884procfs: /proc/acpi/ibm/thermal
885
845sysfs device attributes: (hwmon "thinkpad") temp*_input 886sysfs device attributes: (hwmon "thinkpad") temp*_input
846 887
847Most ThinkPads include six or more separate temperature sensors but only 888Most ThinkPads include six or more separate temperature sensors but only
@@ -850,10 +891,14 @@ feature shows readings from up to eight different sensors on older
850ThinkPads, and up to sixteen different sensors on newer ThinkPads. 891ThinkPads, and up to sixteen different sensors on newer ThinkPads.
851 892
852For example, on the X40, a typical output may be: 893For example, on the X40, a typical output may be:
853temperatures: 42 42 45 41 36 -128 33 -128 894
895temperatures:
896 42 42 45 41 36 -128 33 -128
854 897
855On the T43/p, a typical output may be: 898On the T43/p, a typical output may be:
856temperatures: 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128 899
900temperatures:
901 48 48 36 52 38 -128 31 -128 48 52 48 -128 -128 -128 -128 -128
857 902
858The mapping of thermal sensors to physical locations varies depending on 903The mapping of thermal sensors to physical locations varies depending on
859system-board model (and thus, on ThinkPad model). 904system-board model (and thus, on ThinkPad model).
@@ -863,46 +908,53 @@ tries to track down these locations for various models.
863 908
864Most (newer?) models seem to follow this pattern: 909Most (newer?) models seem to follow this pattern:
865 910
8661: CPU 911- 1: CPU
8672: (depends on model) 912- 2: (depends on model)
8683: (depends on model) 913- 3: (depends on model)
8694: GPU 914- 4: GPU
8705: Main battery: main sensor 915- 5: Main battery: main sensor
8716: Bay battery: main sensor 916- 6: Bay battery: main sensor
8727: Main battery: secondary sensor 917- 7: Main battery: secondary sensor
8738: Bay battery: secondary sensor 918- 8: Bay battery: secondary sensor
8749-15: (depends on model) 919- 9-15: (depends on model)
875 920
876For the R51 (source: Thomas Gruber): 921For the R51 (source: Thomas Gruber):
8772: Mini-PCI 922
8783: Internal HDD 923- 2: Mini-PCI
924- 3: Internal HDD
879 925
880For the T43, T43/p (source: Shmidoax/Thinkwiki.org) 926For the T43, T43/p (source: Shmidoax/Thinkwiki.org)
881http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p 927http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_T43.2C_T43p
8822: System board, left side (near PCMCIA slot), reported as HDAPS temp 928
8833: PCMCIA slot 929- 2: System board, left side (near PCMCIA slot), reported as HDAPS temp
8849: MCH (northbridge) to DRAM Bus 930- 3: PCMCIA slot
88510: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI 931- 9: MCH (northbridge) to DRAM Bus
886 card, under touchpad 932- 10: Clock-generator, mini-pci card and ICH (southbridge), under Mini-PCI
88711: Power regulator, underside of system board, below F2 key 933 card, under touchpad
934- 11: Power regulator, underside of system board, below F2 key
888 935
889The A31 has a very atypical layout for the thermal sensors 936The A31 has a very atypical layout for the thermal sensors
890(source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31) 937(source: Milos Popovic, http://thinkwiki.org/wiki/Thermal_Sensors#ThinkPad_A31)
8911: CPU
8922: Main Battery: main sensor
8933: Power Converter
8944: Bay Battery: main sensor
8955: MCH (northbridge)
8966: PCMCIA/ambient
8977: Main Battery: secondary sensor
8988: Bay Battery: secondary sensor
899 938
939- 1: CPU
940- 2: Main Battery: main sensor
941- 3: Power Converter
942- 4: Bay Battery: main sensor
943- 5: MCH (northbridge)
944- 6: PCMCIA/ambient
945- 7: Main Battery: secondary sensor
946- 8: Bay Battery: secondary sensor
947
948
949Procfs notes
950^^^^^^^^^^^^
900 951
901Procfs notes:
902 Readings from sensors that are not available return -128. 952 Readings from sensors that are not available return -128.
903 No commands can be written to this file. 953 No commands can be written to this file.
904 954
905Sysfs notes: 955Sysfs notes
956^^^^^^^^^^^
957
906 Sensors that are not available return the ENXIO error. This 958 Sensors that are not available return the ENXIO error. This
907 status may change at runtime, as there are hotplug thermal 959 status may change at runtime, as there are hotplug thermal
908 sensors, like those inside the batteries and docks. 960 sensors, like those inside the batteries and docks.
@@ -921,6 +973,7 @@ ftp://ftp.suse.com/pub/people/trenn/sources/ec
921 973
922Use it to determine the register holding the fan 974Use it to determine the register holding the fan
923speed on some models. To do that, do the following: 975speed on some models. To do that, do the following:
976
924 - make sure the battery is fully charged 977 - make sure the battery is fully charged
925 - make sure the fan is running 978 - make sure the fan is running
926 - use above mentioned tool to read out the EC 979 - use above mentioned tool to read out the EC
@@ -941,6 +994,7 @@ LCD brightness control
941---------------------- 994----------------------
942 995
943procfs: /proc/acpi/ibm/brightness 996procfs: /proc/acpi/ibm/brightness
997
944sysfs backlight device "thinkpad_screen" 998sysfs backlight device "thinkpad_screen"
945 999
946This feature allows software control of the LCD brightness on ThinkPad 1000This feature allows software control of the LCD brightness on ThinkPad
@@ -985,15 +1039,17 @@ brightness_enable=0 forces it to be disabled. brightness_enable=1
985forces it to be enabled when available, even if the standard ACPI 1039forces it to be enabled when available, even if the standard ACPI
986interface is also available. 1040interface is also available.
987 1041
988Procfs notes: 1042Procfs notes
1043^^^^^^^^^^^^
989 1044
990 The available commands are: 1045The available commands are::
991 1046
992 echo up >/proc/acpi/ibm/brightness 1047 echo up >/proc/acpi/ibm/brightness
993 echo down >/proc/acpi/ibm/brightness 1048 echo down >/proc/acpi/ibm/brightness
994 echo 'level <level>' >/proc/acpi/ibm/brightness 1049 echo 'level <level>' >/proc/acpi/ibm/brightness
995 1050
996Sysfs notes: 1051Sysfs notes
1052^^^^^^^^^^^
997 1053
998The interface is implemented through the backlight sysfs class, which is 1054The interface is implemented through the backlight sysfs class, which is
999poorly documented at this time. 1055poorly documented at this time.
@@ -1038,6 +1094,7 @@ Volume control (Console Audio control)
1038-------------------------------------- 1094--------------------------------------
1039 1095
1040procfs: /proc/acpi/ibm/volume 1096procfs: /proc/acpi/ibm/volume
1097
1041ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC" 1098ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC"
1042 1099
1043NOTE: by default, the volume control interface operates in read-only 1100NOTE: by default, the volume control interface operates in read-only
@@ -1053,7 +1110,8 @@ Software volume control should be done only in the main AC97/HDA
1053mixer. 1110mixer.
1054 1111
1055 1112
1056About the ThinkPad Console Audio control: 1113About the ThinkPad Console Audio control
1114^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1057 1115
1058ThinkPads have a built-in amplifier and muting circuit that drives the 1116ThinkPads have a built-in amplifier and muting circuit that drives the
1059console headphone and speakers. This circuit is after the main AC97 1117console headphone and speakers. This circuit is after the main AC97
@@ -1092,13 +1150,14 @@ normal key presses to the operating system (thinkpad-acpi is not
1092involved). 1150involved).
1093 1151
1094 1152
1095The ThinkPad-ACPI volume control: 1153The ThinkPad-ACPI volume control
1154^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1096 1155
1097The preferred way to interact with the Console Audio control is the 1156The preferred way to interact with the Console Audio control is the
1098ALSA interface. 1157ALSA interface.
1099 1158
1100The legacy procfs interface allows one to read the current state, 1159The legacy procfs interface allows one to read the current state,
1101and if volume control is enabled, accepts the following commands: 1160and if volume control is enabled, accepts the following commands::
1102 1161
1103 echo up >/proc/acpi/ibm/volume 1162 echo up >/proc/acpi/ibm/volume
1104 echo down >/proc/acpi/ibm/volume 1163 echo down >/proc/acpi/ibm/volume
@@ -1137,13 +1196,15 @@ Fan control and monitoring: fan speed, fan enable/disable
1137--------------------------------------------------------- 1196---------------------------------------------------------
1138 1197
1139procfs: /proc/acpi/ibm/fan 1198procfs: /proc/acpi/ibm/fan
1140sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, 1199
1141 pwm1_enable, fan2_input 1200sysfs device attributes: (hwmon "thinkpad") fan1_input, pwm1, pwm1_enable, fan2_input
1201
1142sysfs hwmon driver attributes: fan_watchdog 1202sysfs hwmon driver attributes: fan_watchdog
1143 1203
1144NOTE NOTE NOTE: fan control operations are disabled by default for 1204NOTE NOTE NOTE:
1145safety reasons. To enable them, the module parameter "fan_control=1" 1205 fan control operations are disabled by default for
1146must be given to thinkpad-acpi. 1206 safety reasons. To enable them, the module parameter "fan_control=1"
1207 must be given to thinkpad-acpi.
1147 1208
1148This feature attempts to show the current fan speed, control mode and 1209This feature attempts to show the current fan speed, control mode and
1149other fan data that might be available. The speed is read directly 1210other fan data that might be available. The speed is read directly
@@ -1154,7 +1215,8 @@ value on other models.
1154Some Lenovo ThinkPads support a secondary fan. This fan cannot be 1215Some Lenovo ThinkPads support a secondary fan. This fan cannot be
1155controlled separately, it shares the main fan control. 1216controlled separately, it shares the main fan control.
1156 1217
1157Fan levels: 1218Fan levels
1219^^^^^^^^^^
1158 1220
1159Most ThinkPad fans work in "levels" at the firmware interface. Level 0 1221Most ThinkPad fans work in "levels" at the firmware interface. Level 0
1160stops the fan. The higher the level, the higher the fan speed, although 1222stops the fan. The higher the level, the higher the fan speed, although
@@ -1209,9 +1271,10 @@ therefore, not suitable to protect against fan mode changes made through
1209means other than the "enable", "disable", and "level" procfs fan 1271means other than the "enable", "disable", and "level" procfs fan
1210commands, or the hwmon fan control sysfs interface. 1272commands, or the hwmon fan control sysfs interface.
1211 1273
1212Procfs notes: 1274Procfs notes
1275^^^^^^^^^^^^
1213 1276
1214The fan may be enabled or disabled with the following commands: 1277The fan may be enabled or disabled with the following commands::
1215 1278
1216 echo enable >/proc/acpi/ibm/fan 1279 echo enable >/proc/acpi/ibm/fan
1217 echo disable >/proc/acpi/ibm/fan 1280 echo disable >/proc/acpi/ibm/fan
@@ -1219,7 +1282,7 @@ The fan may be enabled or disabled with the following commands:
1219Placing a fan on level 0 is the same as disabling it. Enabling a fan 1282Placing a fan on level 0 is the same as disabling it. Enabling a fan
1220will try to place it in a safe level if it is too slow or disabled. 1283will try to place it in a safe level if it is too slow or disabled.
1221 1284
1222The fan level can be controlled with the command: 1285The fan level can be controlled with the command::
1223 1286
1224 echo 'level <level>' > /proc/acpi/ibm/fan 1287 echo 'level <level>' > /proc/acpi/ibm/fan
1225 1288
@@ -1231,7 +1294,7 @@ compatibility.
1231 1294
1232On the X31 and X40 (and ONLY on those models), the fan speed can be 1295On the X31 and X40 (and ONLY on those models), the fan speed can be
1233controlled to a certain degree. Once the fan is running, it can be 1296controlled to a certain degree. Once the fan is running, it can be
1234forced to run faster or slower with the following command: 1297forced to run faster or slower with the following command::
1235 1298
1236 echo 'speed <speed>' > /proc/acpi/ibm/fan 1299 echo 'speed <speed>' > /proc/acpi/ibm/fan
1237 1300
@@ -1241,13 +1304,14 @@ effect or the fan speed eventually settles somewhere in that range. The
1241fan cannot be stopped or started with this command. This functionality 1304fan cannot be stopped or started with this command. This functionality
1242is incomplete, and not available through the sysfs interface. 1305is incomplete, and not available through the sysfs interface.
1243 1306
1244To program the safety watchdog, use the "watchdog" command. 1307To program the safety watchdog, use the "watchdog" command::
1245 1308
1246 echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan 1309 echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan
1247 1310
1248If you want to disable the watchdog, use 0 as the interval. 1311If you want to disable the watchdog, use 0 as the interval.
1249 1312
1250Sysfs notes: 1313Sysfs notes
1314^^^^^^^^^^^
1251 1315
1252The sysfs interface follows the hwmon subsystem guidelines for the most 1316The sysfs interface follows the hwmon subsystem guidelines for the most
1253part, and the exception is the fan safety watchdog. 1317part, and the exception is the fan safety watchdog.
@@ -1261,10 +1325,10 @@ to the firmware).
1261Features not yet implemented by the driver return ENOSYS. 1325Features not yet implemented by the driver return ENOSYS.
1262 1326
1263hwmon device attribute pwm1_enable: 1327hwmon device attribute pwm1_enable:
1264 0: PWM offline (fan is set to full-speed mode) 1328 - 0: PWM offline (fan is set to full-speed mode)
1265 1: Manual PWM control (use pwm1 to set fan level) 1329 - 1: Manual PWM control (use pwm1 to set fan level)
1266 2: Hardware PWM control (EC "auto" mode) 1330 - 2: Hardware PWM control (EC "auto" mode)
1267 3: reserved (Software PWM control, not implemented yet) 1331 - 3: reserved (Software PWM control, not implemented yet)
1268 1332
1269 Modes 0 and 2 are not supported by all ThinkPads, and the 1333 Modes 0 and 2 are not supported by all ThinkPads, and the
1270 driver is not always able to detect this. If it does know a 1334 driver is not always able to detect this. If it does know a
@@ -1304,7 +1368,9 @@ WAN
1304--- 1368---
1305 1369
1306procfs: /proc/acpi/ibm/wan 1370procfs: /proc/acpi/ibm/wan
1371
1307sysfs device attribute: wwan_enable (deprecated) 1372sysfs device attribute: wwan_enable (deprecated)
1373
1308sysfs rfkill class: switch "tpacpi_wwan_sw" 1374sysfs rfkill class: switch "tpacpi_wwan_sw"
1309 1375
1310This feature shows the presence and current state of the built-in 1376This feature shows the presence and current state of the built-in
@@ -1316,29 +1382,31 @@ so it is kept across reboots and power-off.
1316It was tested on a Lenovo ThinkPad X60. It should probably work on other 1382It was tested on a Lenovo ThinkPad X60. It should probably work on other
1317ThinkPad models which come with this module installed. 1383ThinkPad models which come with this module installed.
1318 1384
1319Procfs notes: 1385Procfs notes
1386^^^^^^^^^^^^
1320 1387
1321If the W-WAN card is installed, the following commands can be used: 1388If the W-WAN card is installed, the following commands can be used::
1322 1389
1323 echo enable > /proc/acpi/ibm/wan 1390 echo enable > /proc/acpi/ibm/wan
1324 echo disable > /proc/acpi/ibm/wan 1391 echo disable > /proc/acpi/ibm/wan
1325 1392
1326Sysfs notes: 1393Sysfs notes
1394^^^^^^^^^^^
1327 1395
1328 If the W-WAN card is installed, it can be enabled / 1396 If the W-WAN card is installed, it can be enabled /
1329 disabled through the "wwan_enable" thinkpad-acpi device 1397 disabled through the "wwan_enable" thinkpad-acpi device
1330 attribute, and its current status can also be queried. 1398 attribute, and its current status can also be queried.
1331 1399
1332 enable: 1400 enable:
1333 0: disables WWAN card / WWAN card is disabled 1401 - 0: disables WWAN card / WWAN card is disabled
1334 1: enables WWAN card / WWAN card is enabled. 1402 - 1: enables WWAN card / WWAN card is enabled.
1335 1403
1336 Note: this interface has been superseded by the generic rfkill 1404 Note: this interface has been superseded by the generic rfkill
1337 class. It has been deprecated, and it will be removed in year 1405 class. It has been deprecated, and it will be removed in year
1338 2010. 1406 2010.
1339 1407
1340 rfkill controller switch "tpacpi_wwan_sw": refer to 1408 rfkill controller switch "tpacpi_wwan_sw": refer to
1341 Documentation/rfkill.txt for details. 1409 Documentation/driver-api/rfkill.rst for details.
1342 1410
1343 1411
1344EXPERIMENTAL: UWB 1412EXPERIMENTAL: UWB
@@ -1354,10 +1422,11 @@ sysfs rfkill class: switch "tpacpi_uwb_sw"
1354This feature exports an rfkill controller for the UWB device, if one is 1422This feature exports an rfkill controller for the UWB device, if one is
1355present and enabled in the BIOS. 1423present and enabled in the BIOS.
1356 1424
1357Sysfs notes: 1425Sysfs notes
1426^^^^^^^^^^^
1358 1427
1359 rfkill controller switch "tpacpi_uwb_sw": refer to 1428 rfkill controller switch "tpacpi_uwb_sw": refer to
1360 Documentation/rfkill.txt for details. 1429 Documentation/driver-api/rfkill.rst for details.
1361 1430
1362Adaptive keyboard 1431Adaptive keyboard
1363----------------- 1432-----------------
@@ -1368,11 +1437,11 @@ This sysfs attribute controls the keyboard "face" that will be shown on the
1368Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read 1437Lenovo X1 Carbon 2nd gen (2014)'s adaptive keyboard. The value can be read
1369and set. 1438and set.
1370 1439
13711 = Home mode 1440- 1 = Home mode
13722 = Web-browser mode 1441- 2 = Web-browser mode
13733 = Web-conference mode 1442- 3 = Web-conference mode
13744 = Function mode 1443- 4 = Function mode
13755 = Layflat mode 1444- 5 = Layflat mode
1376 1445
1377For more details about which buttons will appear depending on the mode, please 1446For more details about which buttons will appear depending on the mode, please
1378review the laptop's user guide: 1447review the laptop's user guide:
@@ -1382,13 +1451,13 @@ Multiple Commands, Module Parameters
1382------------------------------------ 1451------------------------------------
1383 1452
1384Multiple commands can be written to the proc files in one shot by 1453Multiple commands can be written to the proc files in one shot by
1385separating them with commas, for example: 1454separating them with commas, for example::
1386 1455
1387 echo enable,0xffff > /proc/acpi/ibm/hotkey 1456 echo enable,0xffff > /proc/acpi/ibm/hotkey
1388 echo lcd_disable,crt_enable > /proc/acpi/ibm/video 1457 echo lcd_disable,crt_enable > /proc/acpi/ibm/video
1389 1458
1390Commands can also be specified when loading the thinkpad-acpi module, 1459Commands can also be specified when loading the thinkpad-acpi module,
1391for example: 1460for example::
1392 1461
1393 modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable 1462 modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable
1394 1463
@@ -1397,14 +1466,16 @@ Enabling debugging output
1397------------------------- 1466-------------------------
1398 1467
1399The module takes a debug parameter which can be used to selectively 1468The module takes a debug parameter which can be used to selectively
1400enable various classes of debugging output, for example: 1469enable various classes of debugging output, for example::
1401 1470
1402 modprobe thinkpad_acpi debug=0xffff 1471 modprobe thinkpad_acpi debug=0xffff
1403 1472
1404will enable all debugging output classes. It takes a bitmask, so 1473will enable all debugging output classes. It takes a bitmask, so
1405to enable more than one output class, just add their values. 1474to enable more than one output class, just add their values.
1406 1475
1476 ============= ======================================
1407 Debug bitmask Description 1477 Debug bitmask Description
1478 ============= ======================================
1408 0x8000 Disclose PID of userspace programs 1479 0x8000 Disclose PID of userspace programs
1409 accessing some functions of the driver 1480 accessing some functions of the driver
1410 0x0001 Initialization and probing 1481 0x0001 Initialization and probing
@@ -1415,6 +1486,7 @@ to enable more than one output class, just add their values.
1415 0x0010 Fan control 1486 0x0010 Fan control
1416 0x0020 Backlight brightness 1487 0x0020 Backlight brightness
1417 0x0040 Audio mixer/volume control 1488 0x0040 Audio mixer/volume control
1489 ============= ======================================
1418 1490
1419There is also a kernel build option to enable more debugging 1491There is also a kernel build option to enable more debugging
1420information, which may be necessary to debug driver problems. 1492information, which may be necessary to debug driver problems.
@@ -1432,8 +1504,10 @@ the module parameter force_load=1. Regardless of whether this works or
1432not, please contact ibm-acpi-devel@lists.sourceforge.net with a report. 1504not, please contact ibm-acpi-devel@lists.sourceforge.net with a report.
1433 1505
1434 1506
1435Sysfs interface changelog: 1507Sysfs interface changelog
1508^^^^^^^^^^^^^^^^^^^^^^^^^
1436 1509
1510========= ===============================================================
14370x000100: Initial sysfs support, as a single platform driver and 15110x000100: Initial sysfs support, as a single platform driver and
1438 device. 1512 device.
14390x000200: Hot key support for 32 hot keys, and radio slider switch 15130x000200: Hot key support for 32 hot keys, and radio slider switch
@@ -1485,3 +1559,4 @@ Sysfs interface changelog:
14850x030000: Thermal and fan sysfs attributes were moved to the hwmon 15590x030000: Thermal and fan sysfs attributes were moved to the hwmon
1486 device instead of being attached to the backing platform 1560 device instead of being attached to the backing platform
1487 device. 1561 device.
1562========= ===============================================================
diff --git a/Documentation/laptops/toshiba_haps.txt b/Documentation/admin-guide/laptops/toshiba_haps.rst
index 0c1d88dedbde..d28b6c3f2849 100644
--- a/Documentation/laptops/toshiba_haps.txt
+++ b/Documentation/admin-guide/laptops/toshiba_haps.rst
@@ -1,18 +1,19 @@
1Kernel driver toshiba_haps 1====================================
2Toshiba HDD Active Protection Sensor 2Toshiba HDD Active Protection Sensor
3==================================== 3====================================
4 4
5Kernel driver: toshiba_haps
6
5Author: Azael Avalos <coproscefalo@gmail.com> 7Author: Azael Avalos <coproscefalo@gmail.com>
6 8
7 9
80. Contents 10.. 0. Contents
9-----------
10 11
111. Description 12 1. Description
122. Interface 13 2. Interface
133. Accelerometer axes 14 3. Accelerometer axes
144. Supported devices 15 4. Supported devices
155. Usage 16 5. Usage
16 17
17 18
181. Description 191. Description
@@ -32,17 +33,20 @@ file to set the desired protection level or sensor sensibility.
32------------ 33------------
33 34
34This device comes with 3 methods: 35This device comes with 3 methods:
35_STA - Checks existence of the device, returning Zero if the device does not 36
37==== =====================================================================
38_STA Checks existence of the device, returning Zero if the device does not
36 exists or is not supported. 39 exists or is not supported.
37PTLV - Sets the desired protection level. 40PTLV Sets the desired protection level.
38RSSS - Shuts down the HDD protection interface for a few seconds, 41RSSS Shuts down the HDD protection interface for a few seconds,
39 then restores normal operation. 42 then restores normal operation.
43==== =====================================================================
40 44
41Note: 45Note:
42The presence of Solid State Drives (SSD) can make this driver to fail loading, 46 The presence of Solid State Drives (SSD) can make this driver to fail loading,
43given the fact that such drives have no movable parts, and thus, not requiring 47 given the fact that such drives have no movable parts, and thus, not requiring
44any "protection" as well as failing during the evaluation of the _STA method 48 any "protection" as well as failing during the evaluation of the _STA method
45found under this device. 49 found under this device.
46 50
47 51
483. Accelerometer axes 523. Accelerometer axes
@@ -66,11 +70,18 @@ conventional HDD and not only SSD, or a combination of both HDD and SSD.
66-------- 70--------
67 71
68The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are: 72The sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are:
69protection_level - The protection_level is readable and writeable, and 73
74================ ============================================================
75protection_level The protection_level is readable and writeable, and
70 provides a way to let userspace query the current protection 76 provides a way to let userspace query the current protection
71 level, as well as set the desired protection level, the 77 level, as well as set the desired protection level, the
72 available protection levels are: 78 available protection levels are::
73 0 - Disabled | 1 - Low | 2 - Medium | 3 - High 79
74reset_protection - The reset_protection entry is writeable only, being "1" 80 ============ ======= ========== ========
81 0 - Disabled 1 - Low 2 - Medium 3 - High
82 ============ ======= ========== ========
83
84reset_protection The reset_protection entry is writeable only, being "1"
75 the only parameter it accepts, it is used to trigger 85 the only parameter it accepts, it is used to trigger
76 a reset of the protection interface. 86 a reset of the protection interface.
87================ ============================================================
diff --git a/Documentation/auxdisplay/lcd-panel-cgram.txt b/Documentation/admin-guide/lcd-panel-cgram.rst
index 7f82c905763d..a3eb00c62f53 100644
--- a/Documentation/auxdisplay/lcd-panel-cgram.txt
+++ b/Documentation/admin-guide/lcd-panel-cgram.rst
@@ -1,3 +1,7 @@
1======================================
2Parallel port LCD/Keypad Panel support
3======================================
4
1Some LCDs allow you to define up to 8 characters, mapped to ASCII 5Some LCDs allow you to define up to 8 characters, mapped to ASCII
2characters 0 to 7. The escape code to define a new character is 6characters 0 to 7. The escape code to define a new character is
3'\e[LG' followed by one digit from 0 to 7, representing the character 7'\e[LG' followed by one digit from 0 to 7, representing the character
@@ -7,7 +11,7 @@ illuminated pixel with LSB on the right. Lines are numbered from the
7top of the character to the bottom. On a 5x7 matrix, only the 5 lower 11top of the character to the bottom. On a 5x7 matrix, only the 5 lower
8bits of the 7 first bytes are used for each character. If the string 12bits of the 7 first bytes are used for each character. If the string
9is incomplete, only complete lines will be redefined. Here are some 13is incomplete, only complete lines will be redefined. Here are some
10examples : 14examples::
11 15
12 printf "\e[LG0010101050D1F0C04;" => 0 = [enter] 16 printf "\e[LG0010101050D1F0C04;" => 0 = [enter]
13 printf "\e[LG1040E1F0000000000;" => 1 = [up] 17 printf "\e[LG1040E1F0000000000;" => 1 = [up]
@@ -21,4 +25,3 @@ examples :
21 printf "\e[LG00002061E1E060200;" => small speaker 25 printf "\e[LG00002061E1E060200;" => small speaker
22 26
23Willy 27Willy
24
diff --git a/Documentation/ldm.txt b/Documentation/admin-guide/ldm.rst
index 12c571368e73..12c571368e73 100644
--- a/Documentation/ldm.txt
+++ b/Documentation/admin-guide/ldm.rst
diff --git a/Documentation/lockup-watchdogs.txt b/Documentation/admin-guide/lockup-watchdogs.rst
index 290840c160af..290840c160af 100644
--- a/Documentation/lockup-watchdogs.txt
+++ b/Documentation/admin-guide/lockup-watchdogs.rst
diff --git a/Documentation/cma/debugfs.txt b/Documentation/admin-guide/mm/cma_debugfs.rst
index 6cef20a8cedc..4e06ffabd78a 100644
--- a/Documentation/cma/debugfs.txt
+++ b/Documentation/admin-guide/mm/cma_debugfs.rst
@@ -1,3 +1,7 @@
1=====================
2CMA Debugfs Interface
3=====================
4
1The CMA debugfs interface is useful to retrieve basic information out of the 5The CMA debugfs interface is useful to retrieve basic information out of the
2different CMA areas and to test allocation/release in each of the areas. 6different CMA areas and to test allocation/release in each of the areas.
3 7
@@ -12,7 +16,7 @@ The structure of the files created under that directory is as follows:
12 - [RO] count: Amount of memory in the CMA area. 16 - [RO] count: Amount of memory in the CMA area.
13 - [RO] order_per_bit: Order of pages represented by one bit. 17 - [RO] order_per_bit: Order of pages represented by one bit.
14 - [RO] bitmap: The bitmap of page states in the zone. 18 - [RO] bitmap: The bitmap of page states in the zone.
15 - [WO] alloc: Allocate N pages from that CMA area. For example: 19 - [WO] alloc: Allocate N pages from that CMA area. For example::
16 20
17 echo 5 > <debugfs>/cma/cma-2/alloc 21 echo 5 > <debugfs>/cma/cma-2/alloc
18 22
diff --git a/Documentation/admin-guide/mm/index.rst b/Documentation/admin-guide/mm/index.rst
index ddf8d8d33377..11db46448354 100644
--- a/Documentation/admin-guide/mm/index.rst
+++ b/Documentation/admin-guide/mm/index.rst
@@ -11,7 +11,7 @@ processes address space and many other cool things.
11Linux memory management is a complex system with many configurable 11Linux memory management is a complex system with many configurable
12settings. Most of these settings are available via ``/proc`` 12settings. Most of these settings are available via ``/proc``
13filesystem and can be quired and adjusted using ``sysctl``. These APIs 13filesystem and can be quired and adjusted using ``sysctl``. These APIs
14are described in Documentation/sysctl/vm.txt and in `man 5 proc`_. 14are described in Documentation/admin-guide/sysctl/vm.rst and in `man 5 proc`_.
15 15
16.. _man 5 proc: http://man7.org/linux/man-pages/man5/proc.5.html 16.. _man 5 proc: http://man7.org/linux/man-pages/man5/proc.5.html
17 17
@@ -26,6 +26,7 @@ the Linux memory management.
26 :maxdepth: 1 26 :maxdepth: 1
27 27
28 concepts 28 concepts
29 cma_debugfs
29 hugetlbpage 30 hugetlbpage
30 idle_page_tracking 31 idle_page_tracking
31 ksm 32 ksm
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 9303786632d1..874eb0c77d34 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -59,7 +59,7 @@ MADV_UNMERGEABLE is applied to a range which was never MADV_MERGEABLE.
59 59
60If a region of memory must be split into at least one new MADV_MERGEABLE 60If a region of memory must be split into at least one new MADV_MERGEABLE
61or MADV_UNMERGEABLE region, the madvise may return ENOMEM if the process 61or MADV_UNMERGEABLE region, the madvise may return ENOMEM if the process
62will exceed ``vm.max_map_count`` (see Documentation/sysctl/vm.txt). 62will exceed ``vm.max_map_count`` (see Documentation/admin-guide/sysctl/vm.rst).
63 63
64Like other madvise calls, they are intended for use on mapped areas of 64Like other madvise calls, they are intended for use on mapped areas of
65the user address space: they will report ENOMEM if the specified range 65the user address space: they will report ENOMEM if the specified range
diff --git a/Documentation/admin-guide/mm/numa_memory_policy.rst b/Documentation/admin-guide/mm/numa_memory_policy.rst
index 546f174e5d6a..8463f5538fda 100644
--- a/Documentation/admin-guide/mm/numa_memory_policy.rst
+++ b/Documentation/admin-guide/mm/numa_memory_policy.rst
@@ -15,7 +15,7 @@ document attempts to describe the concepts and APIs of the 2.6 memory policy
15support. 15support.
16 16
17Memory policies should not be confused with cpusets 17Memory policies should not be confused with cpusets
18(``Documentation/cgroup-v1/cpusets.rst``) 18(``Documentation/admin-guide/cgroup-v1/cpusets.rst``)
19which is an administrative mechanism for restricting the nodes from which 19which is an administrative mechanism for restricting the nodes from which
20memory may be allocated by a set of processes. Memory policies are a 20memory may be allocated by a set of processes. Memory policies are a
21programming interface that a NUMA-aware application can take advantage of. When 21programming interface that a NUMA-aware application can take advantage of. When
diff --git a/Documentation/namespaces/compatibility-list.txt b/Documentation/admin-guide/namespaces/compatibility-list.rst
index defc5589bfcd..318800b2a943 100644
--- a/Documentation/namespaces/compatibility-list.txt
+++ b/Documentation/admin-guide/namespaces/compatibility-list.rst
@@ -1,4 +1,6 @@
1 Namespaces compatibility list 1=============================
2Namespaces compatibility list
3=============================
2 4
3This document contains the information about the problems user 5This document contains the information about the problems user
4may have when creating tasks living in different namespaces. 6may have when creating tasks living in different namespaces.
@@ -7,13 +9,16 @@ Here's the summary. This matrix shows the known problems, that
7occur when tasks share some namespace (the columns) while living 9occur when tasks share some namespace (the columns) while living
8in different other namespaces (the rows): 10in different other namespaces (the rows):
9 11
10 UTS IPC VFS PID User Net 12==== === === === === ==== ===
13- UTS IPC VFS PID User Net
14==== === === === === ==== ===
11UTS X 15UTS X
12IPC X 1 16IPC X 1
13VFS X 17VFS X
14PID 1 1 X 18PID 1 1 X
15User 2 2 X 19User 2 2 X
16Net X 20Net X
21==== === === === === ==== ===
17 22
181. Both the IPC and the PID namespaces provide IDs to address 231. Both the IPC and the PID namespaces provide IDs to address
19 object inside the kernel. E.g. semaphore with IPCID or 24 object inside the kernel. E.g. semaphore with IPCID or
@@ -36,4 +41,3 @@ Net X
36 even having equal UIDs. 41 even having equal UIDs.
37 42
38 But currently this is not so. 43 But currently this is not so.
39
diff --git a/Documentation/admin-guide/namespaces/index.rst b/Documentation/admin-guide/namespaces/index.rst
new file mode 100644
index 000000000000..384f2e0f33d2
--- /dev/null
+++ b/Documentation/admin-guide/namespaces/index.rst
@@ -0,0 +1,11 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==========
4Namespaces
5==========
6
7.. toctree::
8 :maxdepth: 1
9
10 compatibility-list
11 resource-control
diff --git a/Documentation/namespaces/resource-control.txt b/Documentation/admin-guide/namespaces/resource-control.rst
index abc13c394738..369556e00f0c 100644
--- a/Documentation/namespaces/resource-control.txt
+++ b/Documentation/admin-guide/namespaces/resource-control.rst
@@ -1,3 +1,7 @@
1===========================
2Namespaces research control
3===========================
4
1There are a lot of kinds of objects in the kernel that don't have 5There are a lot of kinds of objects in the kernel that don't have
2individual limits or that have limits that are ineffective when a set 6individual limits or that have limits that are ineffective when a set
3of processes is allowed to switch user ids. With user namespaces 7of processes is allowed to switch user ids. With user namespaces
diff --git a/Documentation/numastat.txt b/Documentation/admin-guide/numastat.rst
index aaf1667489f8..aaf1667489f8 100644
--- a/Documentation/numastat.txt
+++ b/Documentation/admin-guide/numastat.rst
diff --git a/Documentation/perf/arm-ccn.txt b/Documentation/admin-guide/perf/arm-ccn.rst
index 15cdb7bc57c3..832b0c64023a 100644
--- a/Documentation/perf/arm-ccn.txt
+++ b/Documentation/admin-guide/perf/arm-ccn.rst
@@ -1,3 +1,4 @@
1==========================
1ARM Cache Coherent Network 2ARM Cache Coherent Network
2========================== 3==========================
3 4
@@ -29,6 +30,7 @@ Crosspoint watchpoint-based events (special "event" value 0xfe)
29require "xp" and "vc" as as above plus "port" (device port index), 30require "xp" and "vc" as as above plus "port" (device port index),
30"dir" (transmit/receive direction), comparator values ("cmp_l" 31"dir" (transmit/receive direction), comparator values ("cmp_l"
31and "cmp_h") and "mask", being index of the comparator mask. 32and "cmp_h") and "mask", being index of the comparator mask.
33
32Masks are defined separately from the event description 34Masks are defined separately from the event description
33(due to limited number of the config values) in the "cmp_mask" 35(due to limited number of the config values) in the "cmp_mask"
34directory, with first 8 configurable by user and additional 36directory, with first 8 configurable by user and additional
@@ -44,16 +46,16 @@ request the events on this processor (if not, the perf_event->cpu value
44will be overwritten anyway). In case of this processor being offlined, 46will be overwritten anyway). In case of this processor being offlined,
45the events are migrated to another one and the attribute is updated. 47the events are migrated to another one and the attribute is updated.
46 48
47Example of perf tool use: 49Example of perf tool use::
48 50
49/ # perf list | grep ccn 51 / # perf list | grep ccn
50 ccn/cycles/ [Kernel PMU event] 52 ccn/cycles/ [Kernel PMU event]
51<...> 53 <...>
52 ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event] 54 ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
53<...> 55 <...>
54 56
55/ # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \ 57 / # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
56 sleep 1 58 sleep 1
57 59
58The driver does not support sampling, therefore "perf record" will 60The driver does not support sampling, therefore "perf record" will
59not work. Per-task (without "-a") perf sessions are not supported. 61not work. Per-task (without "-a") perf sessions are not supported.
diff --git a/Documentation/perf/arm_dsu_pmu.txt b/Documentation/admin-guide/perf/arm_dsu_pmu.rst
index d611e15f5add..7fd34db75d13 100644
--- a/Documentation/perf/arm_dsu_pmu.txt
+++ b/Documentation/admin-guide/perf/arm_dsu_pmu.rst
@@ -1,3 +1,4 @@
1==================================
1ARM DynamIQ Shared Unit (DSU) PMU 2ARM DynamIQ Shared Unit (DSU) PMU
2================================== 3==================================
3 4
@@ -13,7 +14,7 @@ PMU doesn't support process specific events and cannot be used in sampling mode.
13The DSU provides a bitmap for a subset of implemented events via hardware 14The DSU provides a bitmap for a subset of implemented events via hardware
14registers. There is no way for the driver to determine if the other events 15registers. There is no way for the driver to determine if the other events
15are available or not. Hence the driver exposes only those events advertised 16are available or not. Hence the driver exposes only those events advertised
16by the DSU, in "events" directory under : 17by the DSU, in "events" directory under::
17 18
18 /sys/bus/event_sources/devices/arm_dsu_<N>/ 19 /sys/bus/event_sources/devices/arm_dsu_<N>/
19 20
@@ -23,6 +24,6 @@ and use the raw event code for the unlisted events.
23The driver also exposes the CPUs connected to the DSU instance in "associated_cpus". 24The driver also exposes the CPUs connected to the DSU instance in "associated_cpus".
24 25
25 26
26e.g usage : 27e.g usage::
27 28
28 perf stat -a -e arm_dsu_0/cycles/ 29 perf stat -a -e arm_dsu_0/cycles/
diff --git a/Documentation/perf/hisi-pmu.txt b/Documentation/admin-guide/perf/hisi-pmu.rst
index 267a028b2741..404a5c3d9d00 100644
--- a/Documentation/perf/hisi-pmu.txt
+++ b/Documentation/admin-guide/perf/hisi-pmu.rst
@@ -1,5 +1,7 @@
1======================================================
1HiSilicon SoC uncore Performance Monitoring Unit (PMU) 2HiSilicon SoC uncore Performance Monitoring Unit (PMU)
2====================================================== 3======================================================
4
3The HiSilicon SoC chip includes various independent system device PMUs 5The HiSilicon SoC chip includes various independent system device PMUs
4such as L3 cache (L3C), Hydra Home Agent (HHA) and DDRC. These PMUs are 6such as L3 cache (L3C), Hydra Home Agent (HHA) and DDRC. These PMUs are
5independent and have hardware logic to gather statistics and performance 7independent and have hardware logic to gather statistics and performance
@@ -11,11 +13,13 @@ called Super CPU cluster (SCCL) and is made up of 6 CCLs. Each SCCL has
11two HHAs (0 - 1) and four DDRCs (0 - 3), respectively. 13two HHAs (0 - 1) and four DDRCs (0 - 3), respectively.
12 14
13HiSilicon SoC uncore PMU driver 15HiSilicon SoC uncore PMU driver
14--------------------------------------- 16-------------------------------
17
15Each device PMU has separate registers for event counting, control and 18Each device PMU has separate registers for event counting, control and
16interrupt, and the PMU driver shall register perf PMU drivers like L3C, 19interrupt, and the PMU driver shall register perf PMU drivers like L3C,
17HHA and DDRC etc. The available events and configuration options shall 20HHA and DDRC etc. The available events and configuration options shall
18be described in the sysfs, see : 21be described in the sysfs, see:
22
19/sys/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>/, or 23/sys/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>/, or
20/sys/bus/event_source/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>. 24/sys/bus/event_source/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>.
21The "perf list" command shall list the available events from sysfs. 25The "perf list" command shall list the available events from sysfs.
@@ -24,27 +28,30 @@ Each L3C, HHA and DDRC is registered as a separate PMU with perf. The PMU
24name will appear in event listing as hisi_sccl<sccl-id>_module<index-id>. 28name will appear in event listing as hisi_sccl<sccl-id>_module<index-id>.
25where "sccl-id" is the identifier of the SCCL and "index-id" is the index of 29where "sccl-id" is the identifier of the SCCL and "index-id" is the index of
26module. 30module.
31
27e.g. hisi_sccl3_l3c0/rd_hit_cpipe is READ_HIT_CPIPE event of L3C index #0 in 32e.g. hisi_sccl3_l3c0/rd_hit_cpipe is READ_HIT_CPIPE event of L3C index #0 in
28SCCL ID #3. 33SCCL ID #3.
34
29e.g. hisi_sccl1_hha0/rx_operations is RX_OPERATIONS event of HHA index #0 in 35e.g. hisi_sccl1_hha0/rx_operations is RX_OPERATIONS event of HHA index #0 in
30SCCL ID #1. 36SCCL ID #1.
31 37
32The driver also provides a "cpumask" sysfs attribute, which shows the CPU core 38The driver also provides a "cpumask" sysfs attribute, which shows the CPU core
33ID used to count the uncore PMU event. 39ID used to count the uncore PMU event.
34 40
35Example usage of perf: 41Example usage of perf::
36$# perf list 42
37hisi_sccl3_l3c0/rd_hit_cpipe/ [kernel PMU event] 43 $# perf list
38------------------------------------------ 44 hisi_sccl3_l3c0/rd_hit_cpipe/ [kernel PMU event]
39hisi_sccl3_l3c0/wr_hit_cpipe/ [kernel PMU event] 45 ------------------------------------------
40------------------------------------------ 46 hisi_sccl3_l3c0/wr_hit_cpipe/ [kernel PMU event]
41hisi_sccl1_l3c0/rd_hit_cpipe/ [kernel PMU event] 47 ------------------------------------------
42------------------------------------------ 48 hisi_sccl1_l3c0/rd_hit_cpipe/ [kernel PMU event]
43hisi_sccl1_l3c0/wr_hit_cpipe/ [kernel PMU event] 49 ------------------------------------------
44------------------------------------------ 50 hisi_sccl1_l3c0/wr_hit_cpipe/ [kernel PMU event]
45 51 ------------------------------------------
46$# perf stat -a -e hisi_sccl3_l3c0/rd_hit_cpipe/ sleep 5 52
47$# perf stat -a -e hisi_sccl3_l3c0/config=0x02/ sleep 5 53 $# perf stat -a -e hisi_sccl3_l3c0/rd_hit_cpipe/ sleep 5
54 $# perf stat -a -e hisi_sccl3_l3c0/config=0x02/ sleep 5
48 55
49The current driver does not support sampling. So "perf record" is unsupported. 56The current driver does not support sampling. So "perf record" is unsupported.
50Also attach to a task is unsupported as the events are all uncore. 57Also attach to a task is unsupported as the events are all uncore.
diff --git a/Documentation/admin-guide/perf/index.rst b/Documentation/admin-guide/perf/index.rst
new file mode 100644
index 000000000000..ee4bfd2a740f
--- /dev/null
+++ b/Documentation/admin-guide/perf/index.rst
@@ -0,0 +1,16 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===========================
4Performance monitor support
5===========================
6
7.. toctree::
8 :maxdepth: 1
9
10 hisi-pmu
11 qcom_l2_pmu
12 qcom_l3_pmu
13 arm-ccn
14 xgene-pmu
15 arm_dsu_pmu
16 thunderx2-pmu
diff --git a/Documentation/perf/qcom_l2_pmu.txt b/Documentation/admin-guide/perf/qcom_l2_pmu.rst
index b25b97659ab9..c130178a4a55 100644
--- a/Documentation/perf/qcom_l2_pmu.txt
+++ b/Documentation/admin-guide/perf/qcom_l2_pmu.rst
@@ -1,3 +1,4 @@
1=====================================================================
1Qualcomm Technologies Level-2 Cache Performance Monitoring Unit (PMU) 2Qualcomm Technologies Level-2 Cache Performance Monitoring Unit (PMU)
2===================================================================== 3=====================================================================
3 4
@@ -28,7 +29,7 @@ The driver provides a "cpumask" sysfs attribute which contains a mask
28consisting of one CPU per cluster which will be used to handle all the PMU 29consisting of one CPU per cluster which will be used to handle all the PMU
29events on that cluster. 30events on that cluster.
30 31
31Examples for use with perf: 32Examples for use with perf::
32 33
33 perf stat -e l2cache_0/config=0x001/,l2cache_0/config=0x042/ -a sleep 1 34 perf stat -e l2cache_0/config=0x001/,l2cache_0/config=0x042/ -a sleep 1
34 35
diff --git a/Documentation/perf/qcom_l3_pmu.txt b/Documentation/admin-guide/perf/qcom_l3_pmu.rst
index 96b3a9444a0d..a3d014a46bfd 100644
--- a/Documentation/perf/qcom_l3_pmu.txt
+++ b/Documentation/admin-guide/perf/qcom_l3_pmu.rst
@@ -1,3 +1,4 @@
1===========================================================================
1Qualcomm Datacenter Technologies L3 Cache Performance Monitoring Unit (PMU) 2Qualcomm Datacenter Technologies L3 Cache Performance Monitoring Unit (PMU)
2=========================================================================== 3===========================================================================
3 4
@@ -17,7 +18,7 @@ The hardware implements 32bit event counters and has a flat 8bit event space
17exposed via the "event" format attribute. In addition to the 32bit physical 18exposed via the "event" format attribute. In addition to the 32bit physical
18counters the driver supports virtual 64bit hardware counters by using hardware 19counters the driver supports virtual 64bit hardware counters by using hardware
19counter chaining. This feature is exposed via the "lc" (long counter) format 20counter chaining. This feature is exposed via the "lc" (long counter) format
20flag. E.g.: 21flag. E.g.::
21 22
22 perf stat -e l3cache_0_0/read-miss,lc/ 23 perf stat -e l3cache_0_0/read-miss,lc/
23 24
diff --git a/Documentation/perf/thunderx2-pmu.txt b/Documentation/admin-guide/perf/thunderx2-pmu.rst
index dffc57143736..08e33675853a 100644
--- a/Documentation/perf/thunderx2-pmu.txt
+++ b/Documentation/admin-guide/perf/thunderx2-pmu.rst
@@ -1,3 +1,4 @@
1=============================================================
1Cavium ThunderX2 SoC Performance Monitoring Unit (PMU UNCORE) 2Cavium ThunderX2 SoC Performance Monitoring Unit (PMU UNCORE)
2============================================================= 3=============================================================
3 4
@@ -24,18 +25,18 @@ and configuration options under sysfs, see
24The driver does not support sampling, therefore "perf record" will not 25The driver does not support sampling, therefore "perf record" will not
25work. Per-task perf sessions are also not supported. 26work. Per-task perf sessions are also not supported.
26 27
27Examples: 28Examples::
28 29
29# perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1 30 # perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1
30 31
31# perf stat -a -e \ 32 # perf stat -a -e \
32uncore_dmc_0/cnt_cycles/,\ 33 uncore_dmc_0/cnt_cycles/,\
33uncore_dmc_0/data_transfers/,\ 34 uncore_dmc_0/data_transfers/,\
34uncore_dmc_0/read_txns/,\ 35 uncore_dmc_0/read_txns/,\
35uncore_dmc_0/write_txns/ sleep 1 36 uncore_dmc_0/write_txns/ sleep 1
36 37
37# perf stat -a -e \ 38 # perf stat -a -e \
38uncore_l3c_0/read_request/,\ 39 uncore_l3c_0/read_request/,\
39uncore_l3c_0/read_hit/,\ 40 uncore_l3c_0/read_hit/,\
40uncore_l3c_0/inv_request/,\ 41 uncore_l3c_0/inv_request/,\
41uncore_l3c_0/inv_hit/ sleep 1 42 uncore_l3c_0/inv_hit/ sleep 1
diff --git a/Documentation/perf/xgene-pmu.txt b/Documentation/admin-guide/perf/xgene-pmu.rst
index d7cff4454e5b..644f8ed89152 100644
--- a/Documentation/perf/xgene-pmu.txt
+++ b/Documentation/admin-guide/perf/xgene-pmu.rst
@@ -1,3 +1,4 @@
1================================================
1APM X-Gene SoC Performance Monitoring Unit (PMU) 2APM X-Gene SoC Performance Monitoring Unit (PMU)
2================================================ 3================================================
3 4
@@ -33,7 +34,7 @@ each PMU, please refer to APM X-Gene User Manual.
33Each perf driver also provides a "cpumask" sysfs attribute, which contains a 34Each perf driver also provides a "cpumask" sysfs attribute, which contains a
34single CPU ID of the processor which will be used to handle all the PMU events. 35single CPU ID of the processor which will be used to handle all the PMU events.
35 36
36Example for perf tool use: 37Example for perf tool use::
37 38
38 / # perf list | grep -e l3c -e iob -e mcb -e mc 39 / # perf list | grep -e l3c -e iob -e mcb -e mc
39 l3c0/ackq-full/ [Kernel PMU event] 40 l3c0/ackq-full/ [Kernel PMU event]
diff --git a/Documentation/pnp.txt b/Documentation/admin-guide/pnp.rst
index bab2d10631f0..bab2d10631f0 100644
--- a/Documentation/pnp.txt
+++ b/Documentation/admin-guide/pnp.rst
diff --git a/Documentation/driver-api/rapidio.rst b/Documentation/admin-guide/rapidio.rst
index 71ff658ab78e..71ff658ab78e 100644
--- a/Documentation/driver-api/rapidio.rst
+++ b/Documentation/admin-guide/rapidio.rst
diff --git a/Documentation/rtc.txt b/Documentation/admin-guide/rtc.rst
index 688c95b11919..688c95b11919 100644
--- a/Documentation/rtc.txt
+++ b/Documentation/admin-guide/rtc.rst
diff --git a/Documentation/svga.txt b/Documentation/admin-guide/svga.rst
index b6c2f9acca92..b6c2f9acca92 100644
--- a/Documentation/svga.txt
+++ b/Documentation/admin-guide/svga.rst
diff --git a/Documentation/admin-guide/sysctl/abi.rst b/Documentation/admin-guide/sysctl/abi.rst
new file mode 100644
index 000000000000..599bcde7f0b7
--- /dev/null
+++ b/Documentation/admin-guide/sysctl/abi.rst
@@ -0,0 +1,67 @@
1================================
2Documentation for /proc/sys/abi/
3================================
4
5kernel version 2.6.0.test2
6
7Copyright (c) 2003, Fabian Frederick <ffrederick@users.sourceforge.net>
8
9For general info: index.rst.
10
11------------------------------------------------------------------------------
12
13This path is binary emulation relevant aka personality types aka abi.
14When a process is executed, it's linked to an exec_domain whose
15personality is defined using values available from /proc/sys/abi.
16You can find further details about abi in include/linux/personality.h.
17
18Here are the files featuring in 2.6 kernel:
19
20- defhandler_coff
21- defhandler_elf
22- defhandler_lcall7
23- defhandler_libcso
24- fake_utsname
25- trace
26
27defhandler_coff
28---------------
29
30defined value:
31 PER_SCOSVR3::
32
33 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE
34
35defhandler_elf
36--------------
37
38defined value:
39 PER_LINUX::
40
41 0
42
43defhandler_lcall7
44-----------------
45
46defined value :
47 PER_SVR4::
48
49 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
50
51defhandler_libsco
52-----------------
53
54defined value:
55 PER_SVR4::
56
57 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
58
59fake_utsname
60------------
61
62Unused
63
64trace
65-----
66
67Unused
diff --git a/Documentation/sysctl/fs.txt b/Documentation/admin-guide/sysctl/fs.rst
index ebc679bcb2dc..2a45119e3331 100644
--- a/Documentation/sysctl/fs.txt
+++ b/Documentation/admin-guide/sysctl/fs.rst
@@ -1,10 +1,16 @@
1Documentation for /proc/sys/fs/* kernel version 2.2.10 1===============================
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> 2Documentation for /proc/sys/fs/
3 (c) 2009, Shen Feng<shen@cn.fujitsu.com> 3===============================
4 4
5For general info and legal blurb, please look in README. 5kernel version 2.2.10
6 6
7============================================================== 7Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
8
9Copyright (c) 2009, Shen Feng<shen@cn.fujitsu.com>
10
11For general info and legal blurb, please look in intro.rst.
12
13------------------------------------------------------------------------------
8 14
9This file contains documentation for the sysctl files in 15This file contains documentation for the sysctl files in
10/proc/sys/fs/ and is valid for Linux kernel version 2.2. 16/proc/sys/fs/ and is valid for Linux kernel version 2.2.
@@ -16,9 +22,10 @@ system, it is advisable to read both documentation and source
16before actually making adjustments. 22before actually making adjustments.
17 23
181. /proc/sys/fs 241. /proc/sys/fs
19---------------------------------------------------------- 25===============
20 26
21Currently, these files are in /proc/sys/fs: 27Currently, these files are in /proc/sys/fs:
28
22- aio-max-nr 29- aio-max-nr
23- aio-nr 30- aio-nr
24- dentry-state 31- dentry-state
@@ -42,9 +49,9 @@ Currently, these files are in /proc/sys/fs:
42- super-max 49- super-max
43- super-nr 50- super-nr
44 51
45==============================================================
46 52
47aio-nr & aio-max-nr: 53aio-nr & aio-max-nr
54-------------------
48 55
49aio-nr is the running total of the number of events specified on the 56aio-nr is the running total of the number of events specified on the
50io_setup system call for all currently active aio contexts. If aio-nr 57io_setup system call for all currently active aio contexts. If aio-nr
@@ -52,21 +59,20 @@ reaches aio-max-nr then io_setup will fail with EAGAIN. Note that
52raising aio-max-nr does not result in the pre-allocation or re-sizing 59raising aio-max-nr does not result in the pre-allocation or re-sizing
53of any kernel data structures. 60of any kernel data structures.
54 61
55==============================================================
56 62
57dentry-state: 63dentry-state
64------------
58 65
59From linux/include/linux/dcache.h: 66From linux/include/linux/dcache.h::
60-------------------------------------------------------------- 67
61struct dentry_stat_t dentry_stat { 68 struct dentry_stat_t dentry_stat {
62 int nr_dentry; 69 int nr_dentry;
63 int nr_unused; 70 int nr_unused;
64 int age_limit; /* age in seconds */ 71 int age_limit; /* age in seconds */
65 int want_pages; /* pages requested by system */ 72 int want_pages; /* pages requested by system */
66 int nr_negative; /* # of unused negative dentries */ 73 int nr_negative; /* # of unused negative dentries */
67 int dummy; /* Reserved for future use */ 74 int dummy; /* Reserved for future use */
68}; 75 };
69--------------------------------------------------------------
70 76
71Dentries are dynamically allocated and deallocated. 77Dentries are dynamically allocated and deallocated.
72 78
@@ -84,9 +90,9 @@ negative dentries which do not map to any files. Instead,
84they help speeding up rejection of non-existing files provided 90they help speeding up rejection of non-existing files provided
85by the users. 91by the users.
86 92
87==============================================================
88 93
89dquot-max & dquot-nr: 94dquot-max & dquot-nr
95--------------------
90 96
91The file dquot-max shows the maximum number of cached disk 97The file dquot-max shows the maximum number of cached disk
92quota entries. 98quota entries.
@@ -98,9 +104,9 @@ If the number of free cached disk quotas is very low and
98you have some awesome number of simultaneous system users, 104you have some awesome number of simultaneous system users,
99you might want to raise the limit. 105you might want to raise the limit.
100 106
101==============================================================
102 107
103file-max & file-nr: 108file-max & file-nr
109------------------
104 110
105The value in file-max denotes the maximum number of file- 111The value in file-max denotes the maximum number of file-
106handles that the Linux kernel will allocate. When you get lots 112handles that the Linux kernel will allocate. When you get lots
@@ -119,18 +125,19 @@ used file handles.
119Attempts to allocate more file descriptors than file-max are 125Attempts to allocate more file descriptors than file-max are
120reported with printk, look for "VFS: file-max limit <number> 126reported with printk, look for "VFS: file-max limit <number>
121reached". 127reached".
122==============================================================
123 128
124nr_open: 129
130nr_open
131-------
125 132
126This denotes the maximum number of file-handles a process can 133This denotes the maximum number of file-handles a process can
127allocate. Default value is 1024*1024 (1048576) which should be 134allocate. Default value is 1024*1024 (1048576) which should be
128enough for most machines. Actual limit depends on RLIMIT_NOFILE 135enough for most machines. Actual limit depends on RLIMIT_NOFILE
129resource limit. 136resource limit.
130 137
131==============================================================
132 138
133inode-max, inode-nr & inode-state: 139inode-max, inode-nr & inode-state
140---------------------------------
134 141
135As with file handles, the kernel allocates the inode structures 142As with file handles, the kernel allocates the inode structures
136dynamically, but can't free them yet. 143dynamically, but can't free them yet.
@@ -157,9 +164,9 @@ preshrink is nonzero when the nr_inodes > inode-max and the
157system needs to prune the inode list instead of allocating 164system needs to prune the inode list instead of allocating
158more. 165more.
159 166
160==============================================================
161 167
162overflowgid & overflowuid: 168overflowgid & overflowuid
169-------------------------
163 170
164Some filesystems only support 16-bit UIDs and GIDs, although in Linux 171Some filesystems only support 16-bit UIDs and GIDs, although in Linux
165UIDs and GIDs are 32 bits. When one of these filesystems is mounted 172UIDs and GIDs are 32 bits. When one of these filesystems is mounted
@@ -169,18 +176,18 @@ to a fixed value before being written to disk.
169These sysctls allow you to change the value of the fixed UID and GID. 176These sysctls allow you to change the value of the fixed UID and GID.
170The default is 65534. 177The default is 65534.
171 178
172==============================================================
173 179
174pipe-user-pages-hard: 180pipe-user-pages-hard
181--------------------
175 182
176Maximum total number of pages a non-privileged user may allocate for pipes. 183Maximum total number of pages a non-privileged user may allocate for pipes.
177Once this limit is reached, no new pipes may be allocated until usage goes 184Once this limit is reached, no new pipes may be allocated until usage goes
178below the limit again. When set to 0, no limit is applied, which is the default 185below the limit again. When set to 0, no limit is applied, which is the default
179setting. 186setting.
180 187
181==============================================================
182 188
183pipe-user-pages-soft: 189pipe-user-pages-soft
190--------------------
184 191
185Maximum total number of pages a non-privileged user may allocate for pipes 192Maximum total number of pages a non-privileged user may allocate for pipes
186before the pipe size gets limited to a single page. Once this limit is reached, 193before the pipe size gets limited to a single page. Once this limit is reached,
@@ -190,9 +197,9 @@ denied until usage goes below the limit again. The default value allows to
190allocate up to 1024 pipes at their default size. When set to 0, no limit is 197allocate up to 1024 pipes at their default size. When set to 0, no limit is
191applied. 198applied.
192 199
193==============================================================
194 200
195protected_fifos: 201protected_fifos
202---------------
196 203
197The intent of this protection is to avoid unintentional writes to 204The intent of this protection is to avoid unintentional writes to
198an attacker-controlled FIFO, where a program expected to create a regular 205an attacker-controlled FIFO, where a program expected to create a regular
@@ -208,9 +215,9 @@ When set to "2" it also applies to group writable sticky directories.
208 215
209This protection is based on the restrictions in Openwall. 216This protection is based on the restrictions in Openwall.
210 217
211==============================================================
212 218
213protected_hardlinks: 219protected_hardlinks
220--------------------
214 221
215A long-standing class of security issues is the hardlink-based 222A long-standing class of security issues is the hardlink-based
216time-of-check-time-of-use race, most commonly seen in world-writable 223time-of-check-time-of-use race, most commonly seen in world-writable
@@ -228,9 +235,9 @@ already own the source file, or do not have read/write access to it.
228 235
229This protection is based on the restrictions in Openwall and grsecurity. 236This protection is based on the restrictions in Openwall and grsecurity.
230 237
231==============================================================
232 238
233protected_regular: 239protected_regular
240-----------------
234 241
235This protection is similar to protected_fifos, but it 242This protection is similar to protected_fifos, but it
236avoids writes to an attacker-controlled regular file, where a program 243avoids writes to an attacker-controlled regular file, where a program
@@ -244,9 +251,9 @@ owned by the owner of the directory.
244 251
245When set to "2" it also applies to group writable sticky directories. 252When set to "2" it also applies to group writable sticky directories.
246 253
247==============================================================
248 254
249protected_symlinks: 255protected_symlinks
256------------------
250 257
251A long-standing class of security issues is the symlink-based 258A long-standing class of security issues is the symlink-based
252time-of-check-time-of-use race, most commonly seen in world-writable 259time-of-check-time-of-use race, most commonly seen in world-writable
@@ -264,34 +271,38 @@ follower match, or when the directory owner matches the symlink's owner.
264 271
265This protection is based on the restrictions in Openwall and grsecurity. 272This protection is based on the restrictions in Openwall and grsecurity.
266 273
267==============================================================
268 274
269suid_dumpable: 275suid_dumpable:
276--------------
270 277
271This value can be used to query and set the core dump mode for setuid 278This value can be used to query and set the core dump mode for setuid
272or otherwise protected/tainted binaries. The modes are 279or otherwise protected/tainted binaries. The modes are
273 280
2740 - (default) - traditional behaviour. Any process which has changed 281= ========== ===============================================================
275 privilege levels or is execute only will not be dumped. 2820 (default) traditional behaviour. Any process which has changed
2761 - (debug) - all processes dump core when possible. The core dump is 283 privilege levels or is execute only will not be dumped.
277 owned by the current user and no security is applied. This is 2841 (debug) all processes dump core when possible. The core dump is
278 intended for system debugging situations only. Ptrace is unchecked. 285 owned by the current user and no security is applied. This is
279 This is insecure as it allows regular users to examine the memory 286 intended for system debugging situations only.
280 contents of privileged processes. 287 Ptrace is unchecked.
2812 - (suidsafe) - any binary which normally would not be dumped is dumped 288 This is insecure as it allows regular users to examine the
282 anyway, but only if the "core_pattern" kernel sysctl is set to 289 memory contents of privileged processes.
283 either a pipe handler or a fully qualified path. (For more details 2902 (suidsafe) any binary which normally would not be dumped is dumped
284 on this limitation, see CVE-2006-2451.) This mode is appropriate 291 anyway, but only if the "core_pattern" kernel sysctl is set to
285 when administrators are attempting to debug problems in a normal 292 either a pipe handler or a fully qualified path. (For more
286 environment, and either have a core dump pipe handler that knows 293 details on this limitation, see CVE-2006-2451.) This mode is
287 to treat privileged core dumps with care, or specific directory 294 appropriate when administrators are attempting to debug
288 defined for catching core dumps. If a core dump happens without 295 problems in a normal environment, and either have a core dump
289 a pipe handler or fully qualifid path, a message will be emitted 296 pipe handler that knows to treat privileged core dumps with
290 to syslog warning about the lack of a correct setting. 297 care, or specific directory defined for catching core dumps.
291 298 If a core dump happens without a pipe handler or fully
292============================================================== 299 qualified path, a message will be emitted to syslog warning
293 300 about the lack of a correct setting.
294super-max & super-nr: 301= ========== ===============================================================
302
303
304super-max & super-nr
305--------------------
295 306
296These numbers control the maximum number of superblocks, and 307These numbers control the maximum number of superblocks, and
297thus the maximum number of mounted filesystems the kernel 308thus the maximum number of mounted filesystems the kernel
@@ -299,33 +310,33 @@ can have. You only need to increase super-max if you need to
299mount more filesystems than the current value in super-max 310mount more filesystems than the current value in super-max
300allows you to. 311allows you to.
301 312
302==============================================================
303 313
304aio-nr & aio-max-nr: 314aio-nr & aio-max-nr
315-------------------
305 316
306aio-nr shows the current system-wide number of asynchronous io 317aio-nr shows the current system-wide number of asynchronous io
307requests. aio-max-nr allows you to change the maximum value 318requests. aio-max-nr allows you to change the maximum value
308aio-nr can grow to. 319aio-nr can grow to.
309 320
310==============================================================
311 321
312mount-max: 322mount-max
323---------
313 324
314This denotes the maximum number of mounts that may exist 325This denotes the maximum number of mounts that may exist
315in a mount namespace. 326in a mount namespace.
316 327
317==============================================================
318 328
319 329
3202. /proc/sys/fs/binfmt_misc 3302. /proc/sys/fs/binfmt_misc
321---------------------------------------------------------- 331===========================
322 332
323Documentation for the files in /proc/sys/fs/binfmt_misc is 333Documentation for the files in /proc/sys/fs/binfmt_misc is
324in Documentation/admin-guide/binfmt-misc.rst. 334in Documentation/admin-guide/binfmt-misc.rst.
325 335
326 336
3273. /proc/sys/fs/mqueue - POSIX message queues filesystem 3373. /proc/sys/fs/mqueue - POSIX message queues filesystem
328---------------------------------------------------------- 338========================================================
339
329 340
330The "mqueue" filesystem provides the necessary kernel features to enable the 341The "mqueue" filesystem provides the necessary kernel features to enable the
331creation of a user space library that implements the POSIX message queues 342creation of a user space library that implements the POSIX message queues
@@ -356,7 +367,7 @@ the default message size value if attr parameter of mq_open(2) is NULL. If it
356exceed msgsize_max, the default value is initialized msgsize_max. 367exceed msgsize_max, the default value is initialized msgsize_max.
357 368
3584. /proc/sys/fs/epoll - Configuration options for the epoll interface 3694. /proc/sys/fs/epoll - Configuration options for the epoll interface
359-------------------------------------------------------- 370=====================================================================
360 371
361This directory contains configuration options for the epoll(7) interface. 372This directory contains configuration options for the epoll(7) interface.
362 373
@@ -371,4 +382,3 @@ Each "watch" costs roughly 90 bytes on a 32bit kernel, and roughly 160 bytes
371on a 64bit one. 382on a 64bit one.
372The current default value for max_user_watches is the 1/32 of the available 383The current default value for max_user_watches is the 1/32 of the available
373low memory, divided for the "watch" cost in bytes. 384low memory, divided for the "watch" cost in bytes.
374
diff --git a/Documentation/sysctl/README b/Documentation/admin-guide/sysctl/index.rst
index d5f24ab0ecc3..03346f98c7b9 100644
--- a/Documentation/sysctl/README
+++ b/Documentation/admin-guide/sysctl/index.rst
@@ -1,5 +1,10 @@
1Documentation for /proc/sys/ kernel version 2.2.10 1===========================
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> 2Documentation for /proc/sys
3===========================
4
5Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
6
7------------------------------------------------------------------------------
3 8
4'Why', I hear you ask, 'would anyone even _want_ documentation 9'Why', I hear you ask, 'would anyone even _want_ documentation
5for them sysctl files? If anybody really needs it, it's all in 10for them sysctl files? If anybody really needs it, it's all in
@@ -12,11 +17,12 @@ have the time or knowledge to read the source code.
12Furthermore, the programmers who built sysctl have built it to 17Furthermore, the programmers who built sysctl have built it to
13be actually used, not just for the fun of programming it :-) 18be actually used, not just for the fun of programming it :-)
14 19
15============================================================== 20------------------------------------------------------------------------------
16 21
17Legal blurb: 22Legal blurb:
18 23
19As usual, there are two main things to consider: 24As usual, there are two main things to consider:
25
201. you get what you pay for 261. you get what you pay for
212. it's free 272. it's free
22 28
@@ -35,15 +41,17 @@ stories to: <riel@nl.linux.org>
35 41
36Rik van Riel. 42Rik van Riel.
37 43
38============================================================== 44--------------------------------------------------------------
39 45
40Introduction: 46Introduction
47============
41 48
42Sysctl is a means of configuring certain aspects of the kernel 49Sysctl is a means of configuring certain aspects of the kernel
43at run-time, and the /proc/sys/ directory is there so that you 50at run-time, and the /proc/sys/ directory is there so that you
44don't even need special tools to do it! 51don't even need special tools to do it!
45In fact, there are only four things needed to use these config 52In fact, there are only four things needed to use these config
46facilities: 53facilities:
54
47- a running Linux system 55- a running Linux system
48- root access 56- root access
49- common sense (this is especially hard to come by these days) 57- common sense (this is especially hard to come by these days)
@@ -54,7 +62,9 @@ several (arch-dependent?) subdirs. Each subdir is mainly about
54one part of the kernel, so you can do configuration on a piece 62one part of the kernel, so you can do configuration on a piece
55by piece basis, or just some 'thematic frobbing'. 63by piece basis, or just some 'thematic frobbing'.
56 64
57The subdirs are about: 65This documentation is about:
66
67=============== ===============================================================
58abi/ execution domains & personalities 68abi/ execution domains & personalities
59debug/ <empty> 69debug/ <empty>
60dev/ device specific information (eg dev/cdrom/info) 70dev/ device specific information (eg dev/cdrom/info)
@@ -70,7 +80,19 @@ sunrpc/ SUN Remote Procedure Call (NFS)
70vm/ memory management tuning 80vm/ memory management tuning
71 buffer and cache management 81 buffer and cache management
72user/ Per user per user namespace limits 82user/ Per user per user namespace limits
83=============== ===============================================================
73 84
74These are the subdirs I have on my system. There might be more 85These are the subdirs I have on my system. There might be more
75or other subdirs in another setup. If you see another dir, I'd 86or other subdirs in another setup. If you see another dir, I'd
76really like to hear about it :-) 87really like to hear about it :-)
88
89.. toctree::
90 :maxdepth: 1
91
92 abi
93 fs
94 kernel
95 net
96 sunrpc
97 user
98 vm
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/admin-guide/sysctl/kernel.rst
index 1b2fe17cd2fa..032c7cd3cede 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1,10 +1,16 @@
1Documentation for /proc/sys/kernel/* kernel version 2.2.10 1===================================
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> 2Documentation for /proc/sys/kernel/
3 (c) 2009, Shen Feng<shen@cn.fujitsu.com> 3===================================
4 4
5For general info and legal blurb, please look in README. 5kernel version 2.2.10
6 6
7============================================================== 7Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
8
9Copyright (c) 2009, Shen Feng<shen@cn.fujitsu.com>
10
11For general info and legal blurb, please look in index.rst.
12
13------------------------------------------------------------------------------
8 14
9This file contains documentation for the sysctl files in 15This file contains documentation for the sysctl files in
10/proc/sys/kernel/ and is valid for Linux kernel version 2.2. 16/proc/sys/kernel/ and is valid for Linux kernel version 2.2.
@@ -101,9 +107,9 @@ show up in /proc/sys/kernel:
101- watchdog_thresh 107- watchdog_thresh
102- version 108- version
103 109
104==============================================================
105 110
106acct: 111acct:
112=====
107 113
108highwater lowwater frequency 114highwater lowwater frequency
109 115
@@ -118,18 +124,18 @@ That is, suspend accounting if there left <= 2% free; resume it
118if we got >=4%; consider information about amount of free space 124if we got >=4%; consider information about amount of free space
119valid for 30 seconds. 125valid for 30 seconds.
120 126
121==============================================================
122 127
123acpi_video_flags: 128acpi_video_flags:
129=================
124 130
125flags 131flags
126 132
127See Doc*/kernel/power/video.txt, it allows mode of video boot to be 133See Doc*/kernel/power/video.txt, it allows mode of video boot to be
128set during run time. 134set during run time.
129 135
130==============================================================
131 136
132auto_msgmni: 137auto_msgmni:
138============
133 139
134This variable has no effect and may be removed in future kernel 140This variable has no effect and may be removed in future kernel
135releases. Reading it always returns 0. 141releases. Reading it always returns 0.
@@ -139,9 +145,8 @@ Echoing "1" into this file enabled msgmni automatic recomputing.
139Echoing "0" turned it off. auto_msgmni default value was 1. 145Echoing "0" turned it off. auto_msgmni default value was 1.
140 146
141 147
142==============================================================
143
144bootloader_type: 148bootloader_type:
149================
145 150
146x86 bootloader identification 151x86 bootloader identification
147 152
@@ -156,9 +161,9 @@ the value 340 = 0x154.
156See the type_of_loader and ext_loader_type fields in 161See the type_of_loader and ext_loader_type fields in
157Documentation/x86/boot.rst for additional information. 162Documentation/x86/boot.rst for additional information.
158 163
159==============================================================
160 164
161bootloader_version: 165bootloader_version:
166===================
162 167
163x86 bootloader version 168x86 bootloader version
164 169
@@ -168,27 +173,31 @@ file will contain the value 564 = 0x234.
168See the type_of_loader and ext_loader_ver fields in 173See the type_of_loader and ext_loader_ver fields in
169Documentation/x86/boot.rst for additional information. 174Documentation/x86/boot.rst for additional information.
170 175
171==============================================================
172 176
173cap_last_cap 177cap_last_cap:
178=============
174 179
175Highest valid capability of the running kernel. Exports 180Highest valid capability of the running kernel. Exports
176CAP_LAST_CAP from the kernel. 181CAP_LAST_CAP from the kernel.
177 182
178==============================================================
179 183
180core_pattern: 184core_pattern:
185=============
181 186
182core_pattern is used to specify a core dumpfile pattern name. 187core_pattern is used to specify a core dumpfile pattern name.
183. max length 127 characters; default value is "core" 188
184. core_pattern is used as a pattern template for the output filename; 189* max length 127 characters; default value is "core"
190* core_pattern is used as a pattern template for the output filename;
185 certain string patterns (beginning with '%') are substituted with 191 certain string patterns (beginning with '%') are substituted with
186 their actual values. 192 their actual values.
187. backward compatibility with core_uses_pid: 193* backward compatibility with core_uses_pid:
194
188 If core_pattern does not include "%p" (default does not) 195 If core_pattern does not include "%p" (default does not)
189 and core_uses_pid is set, then .PID will be appended to 196 and core_uses_pid is set, then .PID will be appended to
190 the filename. 197 the filename.
191. corename format specifiers: 198
199* corename format specifiers::
200
192 %<NUL> '%' is dropped 201 %<NUL> '%' is dropped
193 %% output one '%' 202 %% output one '%'
194 %p pid 203 %p pid
@@ -205,13 +214,14 @@ core_pattern is used to specify a core dumpfile pattern name.
205 %e executable filename (may be shortened) 214 %e executable filename (may be shortened)
206 %E executable path 215 %E executable path
207 %<OTHER> both are dropped 216 %<OTHER> both are dropped
208. If the first character of the pattern is a '|', the kernel will treat 217
218* If the first character of the pattern is a '|', the kernel will treat
209 the rest of the pattern as a command to run. The core dump will be 219 the rest of the pattern as a command to run. The core dump will be
210 written to the standard input of that program instead of to a file. 220 written to the standard input of that program instead of to a file.
211 221
212==============================================================
213 222
214core_pipe_limit: 223core_pipe_limit:
224================
215 225
216This sysctl is only applicable when core_pattern is configured to pipe 226This sysctl is only applicable when core_pattern is configured to pipe
217core files to a user space helper (when the first character of 227core files to a user space helper (when the first character of
@@ -232,9 +242,9 @@ parallel, but that no waiting will take place (i.e. the collecting
232process is not guaranteed access to /proc/<crashing pid>/). This 242process is not guaranteed access to /proc/<crashing pid>/). This
233value defaults to 0. 243value defaults to 0.
234 244
235==============================================================
236 245
237core_uses_pid: 246core_uses_pid:
247==============
238 248
239The default coredump filename is "core". By setting 249The default coredump filename is "core". By setting
240core_uses_pid to 1, the coredump filename becomes core.PID. 250core_uses_pid to 1, the coredump filename becomes core.PID.
@@ -242,9 +252,9 @@ If core_pattern does not include "%p" (default does not)
242and core_uses_pid is set, then .PID will be appended to 252and core_uses_pid is set, then .PID will be appended to
243the filename. 253the filename.
244 254
245==============================================================
246 255
247ctrl-alt-del: 256ctrl-alt-del:
257=============
248 258
249When the value in this file is 0, ctrl-alt-del is trapped and 259When the value in this file is 0, ctrl-alt-del is trapped and
250sent to the init(1) program to handle a graceful restart. 260sent to the init(1) program to handle a graceful restart.
@@ -252,14 +262,15 @@ When, however, the value is > 0, Linux's reaction to a Vulcan
252Nerve Pinch (tm) will be an immediate reboot, without even 262Nerve Pinch (tm) will be an immediate reboot, without even
253syncing its dirty buffers. 263syncing its dirty buffers.
254 264
255Note: when a program (like dosemu) has the keyboard in 'raw' 265Note:
256mode, the ctrl-alt-del is intercepted by the program before it 266 when a program (like dosemu) has the keyboard in 'raw'
257ever reaches the kernel tty layer, and it's up to the program 267 mode, the ctrl-alt-del is intercepted by the program before it
258to decide what to do with it. 268 ever reaches the kernel tty layer, and it's up to the program
269 to decide what to do with it.
259 270
260==============================================================
261 271
262dmesg_restrict: 272dmesg_restrict:
273===============
263 274
264This toggle indicates whether unprivileged users are prevented 275This toggle indicates whether unprivileged users are prevented
265from using dmesg(8) to view messages from the kernel's log buffer. 276from using dmesg(8) to view messages from the kernel's log buffer.
@@ -270,18 +281,21 @@ dmesg(8).
270The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets the 281The kernel config option CONFIG_SECURITY_DMESG_RESTRICT sets the
271default value of dmesg_restrict. 282default value of dmesg_restrict.
272 283
273==============================================================
274 284
275domainname & hostname: 285domainname & hostname:
286======================
276 287
277These files can be used to set the NIS/YP domainname and the 288These files can be used to set the NIS/YP domainname and the
278hostname of your box in exactly the same way as the commands 289hostname of your box in exactly the same way as the commands
279domainname and hostname, i.e.: 290domainname and hostname, i.e.::
280# echo "darkstar" > /proc/sys/kernel/hostname 291
281# echo "mydomain" > /proc/sys/kernel/domainname 292 # echo "darkstar" > /proc/sys/kernel/hostname
282has the same effect as 293 # echo "mydomain" > /proc/sys/kernel/domainname
283# hostname "darkstar" 294
284# domainname "mydomain" 295has the same effect as::
296
297 # hostname "darkstar"
298 # domainname "mydomain"
285 299
286Note, however, that the classic darkstar.frop.org has the 300Note, however, that the classic darkstar.frop.org has the
287hostname "darkstar" and DNS (Internet Domain Name Server) 301hostname "darkstar" and DNS (Internet Domain Name Server)
@@ -290,8 +304,9 @@ Information Service) or YP (Yellow Pages) domainname. These two
290domain names are in general different. For a detailed discussion 304domain names are in general different. For a detailed discussion
291see the hostname(1) man page. 305see the hostname(1) man page.
292 306
293============================================================== 307
294hardlockup_all_cpu_backtrace: 308hardlockup_all_cpu_backtrace:
309=============================
295 310
296This value controls the hard lockup detector behavior when a hard 311This value controls the hard lockup detector behavior when a hard
297lockup condition is detected as to whether or not to gather further 312lockup condition is detected as to whether or not to gather further
@@ -301,9 +316,10 @@ will be initiated.
3010: do nothing. This is the default behavior. 3160: do nothing. This is the default behavior.
302 317
3031: on detection capture more debug information. 3181: on detection capture more debug information.
304============================================================== 319
305 320
306hardlockup_panic: 321hardlockup_panic:
322=================
307 323
308This parameter can be used to control whether the kernel panics 324This parameter can be used to control whether the kernel panics
309when a hard lockup is detected. 325when a hard lockup is detected.
@@ -311,19 +327,19 @@ when a hard lockup is detected.
311 0 - don't panic on hard lockup 327 0 - don't panic on hard lockup
312 1 - panic on hard lockup 328 1 - panic on hard lockup
313 329
314See Documentation/lockup-watchdogs.txt for more information. This can 330See Documentation/admin-guide/lockup-watchdogs.rst for more information. This can
315also be set using the nmi_watchdog kernel parameter. 331also be set using the nmi_watchdog kernel parameter.
316 332
317==============================================================
318 333
319hotplug: 334hotplug:
335========
320 336
321Path for the hotplug policy agent. 337Path for the hotplug policy agent.
322Default value is "/sbin/hotplug". 338Default value is "/sbin/hotplug".
323 339
324==============================================================
325 340
326hung_task_panic: 341hung_task_panic:
342================
327 343
328Controls the kernel's behavior when a hung task is detected. 344Controls the kernel's behavior when a hung task is detected.
329This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. 345This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
@@ -332,27 +348,28 @@ This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
332 348
3331: panic immediately. 3491: panic immediately.
334 350
335==============================================================
336 351
337hung_task_check_count: 352hung_task_check_count:
353======================
338 354
339The upper bound on the number of tasks that are checked. 355The upper bound on the number of tasks that are checked.
340This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. 356This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
341 357
342==============================================================
343 358
344hung_task_timeout_secs: 359hung_task_timeout_secs:
360=======================
345 361
346When a task in D state did not get scheduled 362When a task in D state did not get scheduled
347for more than this value report a warning. 363for more than this value report a warning.
348This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. 364This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
349 365
3500: means infinite timeout - no checking done. 3660: means infinite timeout - no checking done.
367
351Possible values to set are in range {0..LONG_MAX/HZ}. 368Possible values to set are in range {0..LONG_MAX/HZ}.
352 369
353==============================================================
354 370
355hung_task_check_interval_secs: 371hung_task_check_interval_secs:
372==============================
356 373
357Hung task check interval. If hung task checking is enabled 374Hung task check interval. If hung task checking is enabled
358(see hung_task_timeout_secs), the check is done every 375(see hung_task_timeout_secs), the check is done every
@@ -362,9 +379,9 @@ This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
3620 (default): means use hung_task_timeout_secs as checking interval. 3790 (default): means use hung_task_timeout_secs as checking interval.
363Possible values to set are in range {0..LONG_MAX/HZ}. 380Possible values to set are in range {0..LONG_MAX/HZ}.
364 381
365==============================================================
366 382
367hung_task_warnings: 383hung_task_warnings:
384===================
368 385
369The maximum number of warnings to report. During a check interval 386The maximum number of warnings to report. During a check interval
370if a hung task is detected, this value is decreased by 1. 387if a hung task is detected, this value is decreased by 1.
@@ -373,9 +390,9 @@ This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
373 390
374-1: report an infinite number of warnings. 391-1: report an infinite number of warnings.
375 392
376==============================================================
377 393
378hyperv_record_panic_msg: 394hyperv_record_panic_msg:
395========================
379 396
380Controls whether the panic kmsg data should be reported to Hyper-V. 397Controls whether the panic kmsg data should be reported to Hyper-V.
381 398
@@ -383,9 +400,9 @@ Controls whether the panic kmsg data should be reported to Hyper-V.
383 400
3841: report the panic kmsg data. This is the default behavior. 4011: report the panic kmsg data. This is the default behavior.
385 402
386==============================================================
387 403
388kexec_load_disabled: 404kexec_load_disabled:
405====================
389 406
390A toggle indicating if the kexec_load syscall has been disabled. This 407A toggle indicating if the kexec_load syscall has been disabled. This
391value defaults to 0 (false: kexec_load enabled), but can be set to 1 408value defaults to 0 (false: kexec_load enabled), but can be set to 1
@@ -395,9 +412,9 @@ loaded before disabling the syscall, allowing a system to set up (and
395later use) an image without it being altered. Generally used together 412later use) an image without it being altered. Generally used together
396with the "modules_disabled" sysctl. 413with the "modules_disabled" sysctl.
397 414
398==============================================================
399 415
400kptr_restrict: 416kptr_restrict:
417==============
401 418
402This toggle indicates whether restrictions are placed on 419This toggle indicates whether restrictions are placed on
403exposing kernel addresses via /proc and other interfaces. 420exposing kernel addresses via /proc and other interfaces.
@@ -420,16 +437,16 @@ values to unprivileged users is a concern.
420When kptr_restrict is set to (2), kernel pointers printed using 437When kptr_restrict is set to (2), kernel pointers printed using
421%pK will be replaced with 0's regardless of privileges. 438%pK will be replaced with 0's regardless of privileges.
422 439
423==============================================================
424 440
425l2cr: (PPC only) 441l2cr: (PPC only)
442================
426 443
427This flag controls the L2 cache of G3 processor boards. If 444This flag controls the L2 cache of G3 processor boards. If
4280, the cache is disabled. Enabled if nonzero. 4450, the cache is disabled. Enabled if nonzero.
429 446
430==============================================================
431 447
432modules_disabled: 448modules_disabled:
449=================
433 450
434A toggle value indicating if modules are allowed to be loaded 451A toggle value indicating if modules are allowed to be loaded
435in an otherwise modular kernel. This toggle defaults to off 452in an otherwise modular kernel. This toggle defaults to off
@@ -437,9 +454,9 @@ in an otherwise modular kernel. This toggle defaults to off
437neither loaded nor unloaded, and the toggle cannot be set back 454neither loaded nor unloaded, and the toggle cannot be set back
438to false. Generally used with the "kexec_load_disabled" toggle. 455to false. Generally used with the "kexec_load_disabled" toggle.
439 456
440==============================================================
441 457
442msg_next_id, sem_next_id, and shm_next_id: 458msg_next_id, sem_next_id, and shm_next_id:
459==========================================
443 460
444These three toggles allows to specify desired id for next allocated IPC 461These three toggles allows to specify desired id for next allocated IPC
445object: message, semaphore or shared memory respectively. 462object: message, semaphore or shared memory respectively.
@@ -448,21 +465,22 @@ By default they are equal to -1, which means generic allocation logic.
448Possible values to set are in range {0..INT_MAX}. 465Possible values to set are in range {0..INT_MAX}.
449 466
450Notes: 467Notes:
4511) kernel doesn't guarantee, that new object will have desired id. So, 468 1) kernel doesn't guarantee, that new object will have desired id. So,
452it's up to userspace, how to handle an object with "wrong" id. 469 it's up to userspace, how to handle an object with "wrong" id.
4532) Toggle with non-default value will be set back to -1 by kernel after 470 2) Toggle with non-default value will be set back to -1 by kernel after
454successful IPC object allocation. If an IPC object allocation syscall 471 successful IPC object allocation. If an IPC object allocation syscall
455fails, it is undefined if the value remains unmodified or is reset to -1. 472 fails, it is undefined if the value remains unmodified or is reset to -1.
456 473
457==============================================================
458 474
459nmi_watchdog: 475nmi_watchdog:
476=============
460 477
461This parameter can be used to control the NMI watchdog 478This parameter can be used to control the NMI watchdog
462(i.e. the hard lockup detector) on x86 systems. 479(i.e. the hard lockup detector) on x86 systems.
463 480
464 0 - disable the hard lockup detector 4810 - disable the hard lockup detector
465 1 - enable the hard lockup detector 482
4831 - enable the hard lockup detector
466 484
467The hard lockup detector monitors each CPU for its ability to respond to 485The hard lockup detector monitors each CPU for its ability to respond to
468timer interrupts. The mechanism utilizes CPU performance counter registers 486timer interrupts. The mechanism utilizes CPU performance counter registers
@@ -470,15 +488,15 @@ that are programmed to generate Non-Maskable Interrupts (NMIs) periodically
470while a CPU is busy. Hence, the alternative name 'NMI watchdog'. 488while a CPU is busy. Hence, the alternative name 'NMI watchdog'.
471 489
472The NMI watchdog is disabled by default if the kernel is running as a guest 490The NMI watchdog is disabled by default if the kernel is running as a guest
473in a KVM virtual machine. This default can be overridden by adding 491in a KVM virtual machine. This default can be overridden by adding::
474 492
475 nmi_watchdog=1 493 nmi_watchdog=1
476 494
477to the guest kernel command line (see Documentation/admin-guide/kernel-parameters.rst). 495to the guest kernel command line (see Documentation/admin-guide/kernel-parameters.rst).
478 496
479==============================================================
480 497
481numa_balancing 498numa_balancing:
499===============
482 500
483Enables/disables automatic page fault based NUMA memory 501Enables/disables automatic page fault based NUMA memory
484balancing. Memory is moved automatically to nodes 502balancing. Memory is moved automatically to nodes
@@ -500,10 +518,9 @@ faults may be controlled by the numa_balancing_scan_period_min_ms,
500numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms, 518numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
501numa_balancing_scan_size_mb, and numa_balancing_settle_count sysctls. 519numa_balancing_scan_size_mb, and numa_balancing_settle_count sysctls.
502 520
503============================================================== 521numa_balancing_scan_period_min_ms, numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms, numa_balancing_scan_size_mb
522===============================================================================================================================
504 523
505numa_balancing_scan_period_min_ms, numa_balancing_scan_delay_ms,
506numa_balancing_scan_period_max_ms, numa_balancing_scan_size_mb
507 524
508Automatic NUMA balancing scans tasks address space and unmaps pages to 525Automatic NUMA balancing scans tasks address space and unmaps pages to
509detect if pages are properly placed or if the data should be migrated to a 526detect if pages are properly placed or if the data should be migrated to a
@@ -539,16 +556,18 @@ rate for each task.
539numa_balancing_scan_size_mb is how many megabytes worth of pages are 556numa_balancing_scan_size_mb is how many megabytes worth of pages are
540scanned for a given scan. 557scanned for a given scan.
541 558
542==============================================================
543 559
544osrelease, ostype & version: 560osrelease, ostype & version:
561============================
562
563::
545 564
546# cat osrelease 565 # cat osrelease
5472.1.88 566 2.1.88
548# cat ostype 567 # cat ostype
549Linux 568 Linux
550# cat version 569 # cat version
551#5 Wed Feb 25 21:49:24 MET 1998 570 #5 Wed Feb 25 21:49:24 MET 1998
552 571
553The files osrelease and ostype should be clear enough. Version 572The files osrelease and ostype should be clear enough. Version
554needs a little more clarification however. The '#5' means that 573needs a little more clarification however. The '#5' means that
@@ -556,9 +575,9 @@ this is the fifth kernel built from this source base and the
556date behind it indicates the time the kernel was built. 575date behind it indicates the time the kernel was built.
557The only way to tune these values is to rebuild the kernel :-) 576The only way to tune these values is to rebuild the kernel :-)
558 577
559==============================================================
560 578
561overflowgid & overflowuid: 579overflowgid & overflowuid:
580==========================
562 581
563if your architecture did not always support 32-bit UIDs (i.e. arm, 582if your architecture did not always support 32-bit UIDs (i.e. arm,
564i386, m68k, sh, and sparc32), a fixed UID and GID will be returned to 583i386, m68k, sh, and sparc32), a fixed UID and GID will be returned to
@@ -568,17 +587,17 @@ actual UID or GID would exceed 65535.
568These sysctls allow you to change the value of the fixed UID and GID. 587These sysctls allow you to change the value of the fixed UID and GID.
569The default is 65534. 588The default is 65534.
570 589
571==============================================================
572 590
573panic: 591panic:
592======
574 593
575The value in this file represents the number of seconds the kernel 594The value in this file represents the number of seconds the kernel
576waits before rebooting on a panic. When you use the software watchdog, 595waits before rebooting on a panic. When you use the software watchdog,
577the recommended setting is 60. 596the recommended setting is 60.
578 597
579==============================================================
580 598
581panic_on_io_nmi: 599panic_on_io_nmi:
600================
582 601
583Controls the kernel's behavior when a CPU receives an NMI caused by 602Controls the kernel's behavior when a CPU receives an NMI caused by
584an IO error. 603an IO error.
@@ -591,20 +610,20 @@ an IO error.
591 servers issue this sort of NMI when the dump button is pushed, 610 servers issue this sort of NMI when the dump button is pushed,
592 and you can use this option to take a crash dump. 611 and you can use this option to take a crash dump.
593 612
594==============================================================
595 613
596panic_on_oops: 614panic_on_oops:
615==============
597 616
598Controls the kernel's behaviour when an oops or BUG is encountered. 617Controls the kernel's behaviour when an oops or BUG is encountered.
599 618
6000: try to continue operation 6190: try to continue operation
601 620
6021: panic immediately. If the `panic' sysctl is also non-zero then the 6211: panic immediately. If the `panic` sysctl is also non-zero then the
603 machine will be rebooted. 622 machine will be rebooted.
604 623
605==============================================================
606 624
607panic_on_stackoverflow: 625panic_on_stackoverflow:
626=======================
608 627
609Controls the kernel's behavior when detecting the overflows of 628Controls the kernel's behavior when detecting the overflows of
610kernel, IRQ and exception stacks except a user stack. 629kernel, IRQ and exception stacks except a user stack.
@@ -614,9 +633,9 @@ This file shows up if CONFIG_DEBUG_STACKOVERFLOW is enabled.
614 633
6151: panic immediately. 6341: panic immediately.
616 635
617==============================================================
618 636
619panic_on_unrecovered_nmi: 637panic_on_unrecovered_nmi:
638=========================
620 639
621The default Linux behaviour on an NMI of either memory or unknown is 640The default Linux behaviour on an NMI of either memory or unknown is
622to continue operation. For many environments such as scientific 641to continue operation. For many environments such as scientific
@@ -627,9 +646,9 @@ A small number of systems do generate NMI's for bizarre random reasons
627such as power management so the default is off. That sysctl works like 646such as power management so the default is off. That sysctl works like
628the existing panic controls already in that directory. 647the existing panic controls already in that directory.
629 648
630==============================================================
631 649
632panic_on_warn: 650panic_on_warn:
651==============
633 652
634Calls panic() in the WARN() path when set to 1. This is useful to avoid 653Calls panic() in the WARN() path when set to 1. This is useful to avoid
635a kernel rebuild when attempting to kdump at the location of a WARN(). 654a kernel rebuild when attempting to kdump at the location of a WARN().
@@ -638,25 +657,28 @@ a kernel rebuild when attempting to kdump at the location of a WARN().
638 657
6391: call panic() after printing out WARN() location. 6581: call panic() after printing out WARN() location.
640 659
641==============================================================
642 660
643panic_print: 661panic_print:
662============
644 663
645Bitmask for printing system info when panic happens. User can chose 664Bitmask for printing system info when panic happens. User can chose
646combination of the following bits: 665combination of the following bits:
647 666
648bit 0: print all tasks info 667===== ========================================
649bit 1: print system memory info 668bit 0 print all tasks info
650bit 2: print timer info 669bit 1 print system memory info
651bit 3: print locks info if CONFIG_LOCKDEP is on 670bit 2 print timer info
652bit 4: print ftrace buffer 671bit 3 print locks info if CONFIG_LOCKDEP is on
672bit 4 print ftrace buffer
673===== ========================================
674
675So for example to print tasks and memory info on panic, user can::
653 676
654So for example to print tasks and memory info on panic, user can:
655 echo 3 > /proc/sys/kernel/panic_print 677 echo 3 > /proc/sys/kernel/panic_print
656 678
657==============================================================
658 679
659panic_on_rcu_stall: 680panic_on_rcu_stall:
681===================
660 682
661When set to 1, calls panic() after RCU stall detection messages. This 683When set to 1, calls panic() after RCU stall detection messages. This
662is useful to define the root cause of RCU stalls using a vmcore. 684is useful to define the root cause of RCU stalls using a vmcore.
@@ -665,9 +687,9 @@ is useful to define the root cause of RCU stalls using a vmcore.
665 687
6661: panic() after printing RCU stall messages. 6881: panic() after printing RCU stall messages.
667 689
668==============================================================
669 690
670perf_cpu_time_max_percent: 691perf_cpu_time_max_percent:
692==========================
671 693
672Hints to the kernel how much CPU time it should be allowed to 694Hints to the kernel how much CPU time it should be allowed to
673use to handle perf sampling events. If the perf subsystem 695use to handle perf sampling events. If the perf subsystem
@@ -680,10 +702,12 @@ unexpectedly take too long to execute, the NMIs can become
680stacked up next to each other so much that nothing else is 702stacked up next to each other so much that nothing else is
681allowed to execute. 703allowed to execute.
682 704
6830: disable the mechanism. Do not monitor or correct perf's 7050:
706 disable the mechanism. Do not monitor or correct perf's
684 sampling rate no matter how CPU time it takes. 707 sampling rate no matter how CPU time it takes.
685 708
6861-100: attempt to throttle perf's sample rate to this 7091-100:
710 attempt to throttle perf's sample rate to this
687 percentage of CPU. Note: the kernel calculates an 711 percentage of CPU. Note: the kernel calculates an
688 "expected" length of each sample event. 100 here means 712 "expected" length of each sample event. 100 here means
689 100% of that expected length. Even if this is set to 713 100% of that expected length. Even if this is set to
@@ -691,23 +715,30 @@ allowed to execute.
691 length is exceeded. Set to 0 if you truly do not care 715 length is exceeded. Set to 0 if you truly do not care
692 how much CPU is consumed. 716 how much CPU is consumed.
693 717
694==============================================================
695 718
696perf_event_paranoid: 719perf_event_paranoid:
720====================
697 721
698Controls use of the performance events system by unprivileged 722Controls use of the performance events system by unprivileged
699users (without CAP_SYS_ADMIN). The default value is 2. 723users (without CAP_SYS_ADMIN). The default value is 2.
700 724
701 -1: Allow use of (almost) all events by all users 725=== ==================================================================
726 -1 Allow use of (almost) all events by all users
727
702 Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK 728 Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
703>=0: Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN 729
730>=0 Disallow ftrace function tracepoint by users without CAP_SYS_ADMIN
731
704 Disallow raw tracepoint access by users without CAP_SYS_ADMIN 732 Disallow raw tracepoint access by users without CAP_SYS_ADMIN
705>=1: Disallow CPU event access by users without CAP_SYS_ADMIN
706>=2: Disallow kernel profiling by users without CAP_SYS_ADMIN
707 733
708============================================================== 734>=1 Disallow CPU event access by users without CAP_SYS_ADMIN
735
736>=2 Disallow kernel profiling by users without CAP_SYS_ADMIN
737=== ==================================================================
738
709 739
710perf_event_max_stack: 740perf_event_max_stack:
741=====================
711 742
712Controls maximum number of stack frames to copy for (attr.sample_type & 743Controls maximum number of stack frames to copy for (attr.sample_type &
713PERF_SAMPLE_CALLCHAIN) configured events, for instance, when using 744PERF_SAMPLE_CALLCHAIN) configured events, for instance, when using
@@ -718,17 +749,17 @@ enabled, otherwise writing to this file will return -EBUSY.
718 749
719The default value is 127. 750The default value is 127.
720 751
721==============================================================
722 752
723perf_event_mlock_kb: 753perf_event_mlock_kb:
754====================
724 755
725Control size of per-cpu ring buffer not counted agains mlock limit. 756Control size of per-cpu ring buffer not counted agains mlock limit.
726 757
727The default value is 512 + 1 page 758The default value is 512 + 1 page
728 759
729==============================================================
730 760
731perf_event_max_contexts_per_stack: 761perf_event_max_contexts_per_stack:
762==================================
732 763
733Controls maximum number of stack frame context entries for 764Controls maximum number of stack frame context entries for
734(attr.sample_type & PERF_SAMPLE_CALLCHAIN) configured events, for 765(attr.sample_type & PERF_SAMPLE_CALLCHAIN) configured events, for
@@ -739,25 +770,25 @@ enabled, otherwise writing to this file will return -EBUSY.
739 770
740The default value is 8. 771The default value is 8.
741 772
742==============================================================
743 773
744pid_max: 774pid_max:
775========
745 776
746PID allocation wrap value. When the kernel's next PID value 777PID allocation wrap value. When the kernel's next PID value
747reaches this value, it wraps back to a minimum PID value. 778reaches this value, it wraps back to a minimum PID value.
748PIDs of value pid_max or larger are not allocated. 779PIDs of value pid_max or larger are not allocated.
749 780
750==============================================================
751 781
752ns_last_pid: 782ns_last_pid:
783============
753 784
754The last pid allocated in the current (the one task using this sysctl 785The last pid allocated in the current (the one task using this sysctl
755lives in) pid namespace. When selecting a pid for a next task on fork 786lives in) pid namespace. When selecting a pid for a next task on fork
756kernel tries to allocate a number starting from this one. 787kernel tries to allocate a number starting from this one.
757 788
758==============================================================
759 789
760powersave-nap: (PPC only) 790powersave-nap: (PPC only)
791=========================
761 792
762If set, Linux-PPC will use the 'nap' mode of powersaving, 793If set, Linux-PPC will use the 'nap' mode of powersaving,
763otherwise the 'doze' mode will be used. 794otherwise the 'doze' mode will be used.
@@ -765,6 +796,7 @@ otherwise the 'doze' mode will be used.
765============================================================== 796==============================================================
766 797
767printk: 798printk:
799=======
768 800
769The four values in printk denote: console_loglevel, 801The four values in printk denote: console_loglevel,
770default_message_loglevel, minimum_console_loglevel and 802default_message_loglevel, minimum_console_loglevel and
@@ -774,25 +806,29 @@ These values influence printk() behavior when printing or
774logging error messages. See 'man 2 syslog' for more info on 806logging error messages. See 'man 2 syslog' for more info on
775the different loglevels. 807the different loglevels.
776 808
777- console_loglevel: messages with a higher priority than 809- console_loglevel:
778 this will be printed to the console 810 messages with a higher priority than
779- default_message_loglevel: messages without an explicit priority 811 this will be printed to the console
780 will be printed with this priority 812- default_message_loglevel:
781- minimum_console_loglevel: minimum (highest) value to which 813 messages without an explicit priority
782 console_loglevel can be set 814 will be printed with this priority
783- default_console_loglevel: default value for console_loglevel 815- minimum_console_loglevel:
816 minimum (highest) value to which
817 console_loglevel can be set
818- default_console_loglevel:
819 default value for console_loglevel
784 820
785==============================================================
786 821
787printk_delay: 822printk_delay:
823=============
788 824
789Delay each printk message in printk_delay milliseconds 825Delay each printk message in printk_delay milliseconds
790 826
791Value from 0 - 10000 is allowed. 827Value from 0 - 10000 is allowed.
792 828
793==============================================================
794 829
795printk_ratelimit: 830printk_ratelimit:
831=================
796 832
797Some warning messages are rate limited. printk_ratelimit specifies 833Some warning messages are rate limited. printk_ratelimit specifies
798the minimum length of time between these messages (in jiffies), by 834the minimum length of time between these messages (in jiffies), by
@@ -800,48 +836,52 @@ default we allow one every 5 seconds.
800 836
801A value of 0 will disable rate limiting. 837A value of 0 will disable rate limiting.
802 838
803==============================================================
804 839
805printk_ratelimit_burst: 840printk_ratelimit_burst:
841=======================
806 842
807While long term we enforce one message per printk_ratelimit 843While long term we enforce one message per printk_ratelimit
808seconds, we do allow a burst of messages to pass through. 844seconds, we do allow a burst of messages to pass through.
809printk_ratelimit_burst specifies the number of messages we can 845printk_ratelimit_burst specifies the number of messages we can
810send before ratelimiting kicks in. 846send before ratelimiting kicks in.
811 847
812==============================================================
813 848
814printk_devkmsg: 849printk_devkmsg:
850===============
815 851
816Control the logging to /dev/kmsg from userspace: 852Control the logging to /dev/kmsg from userspace:
817 853
818ratelimit: default, ratelimited 854ratelimit:
855 default, ratelimited
856
819on: unlimited logging to /dev/kmsg from userspace 857on: unlimited logging to /dev/kmsg from userspace
858
820off: logging to /dev/kmsg disabled 859off: logging to /dev/kmsg disabled
821 860
822The kernel command line parameter printk.devkmsg= overrides this and is 861The kernel command line parameter printk.devkmsg= overrides this and is
823a one-time setting until next reboot: once set, it cannot be changed by 862a one-time setting until next reboot: once set, it cannot be changed by
824this sysctl interface anymore. 863this sysctl interface anymore.
825 864
826==============================================================
827 865
828randomize_va_space: 866randomize_va_space:
867===================
829 868
830This option can be used to select the type of process address 869This option can be used to select the type of process address
831space randomization that is used in the system, for architectures 870space randomization that is used in the system, for architectures
832that support this feature. 871that support this feature.
833 872
8340 - Turn the process address space randomization off. This is the 873== ===========================================================================
8740 Turn the process address space randomization off. This is the
835 default for architectures that do not support this feature anyways, 875 default for architectures that do not support this feature anyways,
836 and kernels that are booted with the "norandmaps" parameter. 876 and kernels that are booted with the "norandmaps" parameter.
837 877
8381 - Make the addresses of mmap base, stack and VDSO page randomized. 8781 Make the addresses of mmap base, stack and VDSO page randomized.
839 This, among other things, implies that shared libraries will be 879 This, among other things, implies that shared libraries will be
840 loaded to random addresses. Also for PIE-linked binaries, the 880 loaded to random addresses. Also for PIE-linked binaries, the
841 location of code start is randomized. This is the default if the 881 location of code start is randomized. This is the default if the
842 CONFIG_COMPAT_BRK option is enabled. 882 CONFIG_COMPAT_BRK option is enabled.
843 883
8442 - Additionally enable heap randomization. This is the default if 8842 Additionally enable heap randomization. This is the default if
845 CONFIG_COMPAT_BRK is disabled. 885 CONFIG_COMPAT_BRK is disabled.
846 886
847 There are a few legacy applications out there (such as some ancient 887 There are a few legacy applications out there (such as some ancient
@@ -854,18 +894,19 @@ that support this feature.
854 Systems with ancient and/or broken binaries should be configured 894 Systems with ancient and/or broken binaries should be configured
855 with CONFIG_COMPAT_BRK enabled, which excludes the heap from process 895 with CONFIG_COMPAT_BRK enabled, which excludes the heap from process
856 address space randomization. 896 address space randomization.
897== ===========================================================================
857 898
858==============================================================
859 899
860reboot-cmd: (Sparc only) 900reboot-cmd: (Sparc only)
901========================
861 902
862??? This seems to be a way to give an argument to the Sparc 903??? This seems to be a way to give an argument to the Sparc
863ROM/Flash boot loader. Maybe to tell it what to do after 904ROM/Flash boot loader. Maybe to tell it what to do after
864rebooting. ??? 905rebooting. ???
865 906
866==============================================================
867 907
868rtsig-max & rtsig-nr: 908rtsig-max & rtsig-nr:
909=====================
869 910
870The file rtsig-max can be used to tune the maximum number 911The file rtsig-max can be used to tune the maximum number
871of POSIX realtime (queued) signals that can be outstanding 912of POSIX realtime (queued) signals that can be outstanding
@@ -873,9 +914,9 @@ in the system.
873 914
874rtsig-nr shows the number of RT signals currently queued. 915rtsig-nr shows the number of RT signals currently queued.
875 916
876==============================================================
877 917
878sched_energy_aware: 918sched_energy_aware:
919===================
879 920
880Enables/disables Energy Aware Scheduling (EAS). EAS starts 921Enables/disables Energy Aware Scheduling (EAS). EAS starts
881automatically on platforms where it can run (that is, 922automatically on platforms where it can run (that is,
@@ -884,17 +925,17 @@ Model available). If your platform happens to meet the
884requirements for EAS but you do not want to use it, change 925requirements for EAS but you do not want to use it, change
885this value to 0. 926this value to 0.
886 927
887==============================================================
888 928
889sched_schedstats: 929sched_schedstats:
930=================
890 931
891Enables/disables scheduler statistics. Enabling this feature 932Enables/disables scheduler statistics. Enabling this feature
892incurs a small amount of overhead in the scheduler but is 933incurs a small amount of overhead in the scheduler but is
893useful for debugging and performance tuning. 934useful for debugging and performance tuning.
894 935
895==============================================================
896 936
897sg-big-buff: 937sg-big-buff:
938============
898 939
899This file shows the size of the generic SCSI (sg) buffer. 940This file shows the size of the generic SCSI (sg) buffer.
900You can't tune it just yet, but you could change it on 941You can't tune it just yet, but you could change it on
@@ -905,9 +946,9 @@ There shouldn't be any reason to change this value. If
905you can come up with one, you probably know what you 946you can come up with one, you probably know what you
906are doing anyway :) 947are doing anyway :)
907 948
908==============================================================
909 949
910shmall: 950shmall:
951=======
911 952
912This parameter sets the total amount of shared memory pages that 953This parameter sets the total amount of shared memory pages that
913can be used system wide. Hence, SHMALL should always be at least 954can be used system wide. Hence, SHMALL should always be at least
@@ -916,20 +957,20 @@ ceil(shmmax/PAGE_SIZE).
916If you are not sure what the default PAGE_SIZE is on your Linux 957If you are not sure what the default PAGE_SIZE is on your Linux
917system, you can run the following command: 958system, you can run the following command:
918 959
919# getconf PAGE_SIZE 960 # getconf PAGE_SIZE
920 961
921==============================================================
922 962
923shmmax: 963shmmax:
964=======
924 965
925This value can be used to query and set the run time limit 966This value can be used to query and set the run time limit
926on the maximum shared memory segment size that can be created. 967on the maximum shared memory segment size that can be created.
927Shared memory segments up to 1Gb are now supported in the 968Shared memory segments up to 1Gb are now supported in the
928kernel. This value defaults to SHMMAX. 969kernel. This value defaults to SHMMAX.
929 970
930==============================================================
931 971
932shm_rmid_forced: 972shm_rmid_forced:
973================
933 974
934Linux lets you set resource limits, including how much memory one 975Linux lets you set resource limits, including how much memory one
935process can consume, via setrlimit(2). Unfortunately, shared memory 976process can consume, via setrlimit(2). Unfortunately, shared memory
@@ -948,28 +989,30 @@ need this.
948Note that if you change this from 0 to 1, already created segments 989Note that if you change this from 0 to 1, already created segments
949without users and with a dead originative process will be destroyed. 990without users and with a dead originative process will be destroyed.
950 991
951==============================================================
952 992
953sysctl_writes_strict: 993sysctl_writes_strict:
994=====================
954 995
955Control how file position affects the behavior of updating sysctl values 996Control how file position affects the behavior of updating sysctl values
956via the /proc/sys interface: 997via the /proc/sys interface:
957 998
958 -1 - Legacy per-write sysctl value handling, with no printk warnings. 999 == ======================================================================
1000 -1 Legacy per-write sysctl value handling, with no printk warnings.
959 Each write syscall must fully contain the sysctl value to be 1001 Each write syscall must fully contain the sysctl value to be
960 written, and multiple writes on the same sysctl file descriptor 1002 written, and multiple writes on the same sysctl file descriptor
961 will rewrite the sysctl value, regardless of file position. 1003 will rewrite the sysctl value, regardless of file position.
962 0 - Same behavior as above, but warn about processes that perform writes 1004 0 Same behavior as above, but warn about processes that perform writes
963 to a sysctl file descriptor when the file position is not 0. 1005 to a sysctl file descriptor when the file position is not 0.
964 1 - (default) Respect file position when writing sysctl strings. Multiple 1006 1 (default) Respect file position when writing sysctl strings. Multiple
965 writes will append to the sysctl value buffer. Anything past the max 1007 writes will append to the sysctl value buffer. Anything past the max
966 length of the sysctl value buffer will be ignored. Writes to numeric 1008 length of the sysctl value buffer will be ignored. Writes to numeric
967 sysctl entries must always be at file position 0 and the value must 1009 sysctl entries must always be at file position 0 and the value must
968 be fully contained in the buffer sent in the write syscall. 1010 be fully contained in the buffer sent in the write syscall.
1011 == ======================================================================
969 1012
970==============================================================
971 1013
972softlockup_all_cpu_backtrace: 1014softlockup_all_cpu_backtrace:
1015=============================
973 1016
974This value controls the soft lockup detector thread's behavior 1017This value controls the soft lockup detector thread's behavior
975when a soft lockup condition is detected as to whether or not 1018when a soft lockup condition is detected as to whether or not
@@ -983,13 +1026,14 @@ NMI.
983 1026
9841: on detection capture more debug information. 10271: on detection capture more debug information.
985 1028
986==============================================================
987 1029
988soft_watchdog 1030soft_watchdog:
1031==============
989 1032
990This parameter can be used to control the soft lockup detector. 1033This parameter can be used to control the soft lockup detector.
991 1034
992 0 - disable the soft lockup detector 1035 0 - disable the soft lockup detector
1036
993 1 - enable the soft lockup detector 1037 1 - enable the soft lockup detector
994 1038
995The soft lockup detector monitors CPUs for threads that are hogging the CPUs 1039The soft lockup detector monitors CPUs for threads that are hogging the CPUs
@@ -999,9 +1043,9 @@ interrupts which are needed for the 'watchdog/N' threads to be woken up by
999the watchdog timer function, otherwise the NMI watchdog - if enabled - can 1043the watchdog timer function, otherwise the NMI watchdog - if enabled - can
1000detect a hard lockup condition. 1044detect a hard lockup condition.
1001 1045
1002==============================================================
1003 1046
1004stack_erasing 1047stack_erasing:
1048==============
1005 1049
1006This parameter can be used to control kernel stack erasing at the end 1050This parameter can be used to control kernel stack erasing at the end
1007of syscalls for kernels built with CONFIG_GCC_PLUGIN_STACKLEAK. 1051of syscalls for kernels built with CONFIG_GCC_PLUGIN_STACKLEAK.
@@ -1015,37 +1059,40 @@ compilation sees a 1% slowdown, other systems and workloads may vary.
1015 1059
1016 1: kernel stack erasing is enabled (default), it is performed before 1060 1: kernel stack erasing is enabled (default), it is performed before
1017 returning to the userspace at the end of syscalls. 1061 returning to the userspace at the end of syscalls.
1018============================================================== 1062
1019 1063
1020tainted 1064tainted
1065=======
1021 1066
1022Non-zero if the kernel has been tainted. Numeric values, which can be 1067Non-zero if the kernel has been tainted. Numeric values, which can be
1023ORed together. The letters are seen in "Tainted" line of Oops reports. 1068ORed together. The letters are seen in "Tainted" line of Oops reports.
1024 1069
1025 1 (P): proprietary module was loaded 1070====== ===== ==============================================================
1026 2 (F): module was force loaded 1071 1 `(P)` proprietary module was loaded
1027 4 (S): SMP kernel oops on an officially SMP incapable processor 1072 2 `(F)` module was force loaded
1028 8 (R): module was force unloaded 1073 4 `(S)` SMP kernel oops on an officially SMP incapable processor
1029 16 (M): processor reported a Machine Check Exception (MCE) 1074 8 `(R)` module was force unloaded
1030 32 (B): bad page referenced or some unexpected page flags 1075 16 `(M)` processor reported a Machine Check Exception (MCE)
1031 64 (U): taint requested by userspace application 1076 32 `(B)` bad page referenced or some unexpected page flags
1032 128 (D): kernel died recently, i.e. there was an OOPS or BUG 1077 64 `(U)` taint requested by userspace application
1033 256 (A): an ACPI table was overridden by user 1078 128 `(D)` kernel died recently, i.e. there was an OOPS or BUG
1034 512 (W): kernel issued warning 1079 256 `(A)` an ACPI table was overridden by user
1035 1024 (C): staging driver was loaded 1080 512 `(W)` kernel issued warning
1036 2048 (I): workaround for bug in platform firmware applied 1081 1024 `(C)` staging driver was loaded
1037 4096 (O): externally-built ("out-of-tree") module was loaded 1082 2048 `(I)` workaround for bug in platform firmware applied
1038 8192 (E): unsigned module was loaded 1083 4096 `(O)` externally-built ("out-of-tree") module was loaded
1039 16384 (L): soft lockup occurred 1084 8192 `(E)` unsigned module was loaded
1040 32768 (K): kernel has been live patched 1085 16384 `(L)` soft lockup occurred
1041 65536 (X): Auxiliary taint, defined and used by for distros 1086 32768 `(K)` kernel has been live patched
1042131072 (T): The kernel was built with the struct randomization plugin 1087 65536 `(X)` Auxiliary taint, defined and used by for distros
1088131072 `(T)` The kernel was built with the struct randomization plugin
1089====== ===== ==============================================================
1043 1090
1044See Documentation/admin-guide/tainted-kernels.rst for more information. 1091See Documentation/admin-guide/tainted-kernels.rst for more information.
1045 1092
1046==============================================================
1047 1093
1048threads-max 1094threads-max:
1095============
1049 1096
1050This value controls the maximum number of threads that can be created 1097This value controls the maximum number of threads that can be created
1051using fork(). 1098using fork().
@@ -1055,8 +1102,10 @@ maximum number of threads is created, the thread structures occupy only
1055a part (1/8th) of the available RAM pages. 1102a part (1/8th) of the available RAM pages.
1056 1103
1057The minimum value that can be written to threads-max is 20. 1104The minimum value that can be written to threads-max is 20.
1105
1058The maximum value that can be written to threads-max is given by the 1106The maximum value that can be written to threads-max is given by the
1059constant FUTEX_TID_MASK (0x3fffffff). 1107constant FUTEX_TID_MASK (0x3fffffff).
1108
1060If a value outside of this range is written to threads-max an error 1109If a value outside of this range is written to threads-max an error
1061EINVAL occurs. 1110EINVAL occurs.
1062 1111
@@ -1064,9 +1113,9 @@ The value written is checked against the available RAM pages. If the
1064thread structures would occupy too much (more than 1/8th) of the 1113thread structures would occupy too much (more than 1/8th) of the
1065available RAM pages threads-max is reduced accordingly. 1114available RAM pages threads-max is reduced accordingly.
1066 1115
1067==============================================================
1068 1116
1069unknown_nmi_panic: 1117unknown_nmi_panic:
1118==================
1070 1119
1071The value in this file affects behavior of handling NMI. When the 1120The value in this file affects behavior of handling NMI. When the
1072value is non-zero, unknown NMI is trapped and then panic occurs. At 1121value is non-zero, unknown NMI is trapped and then panic occurs. At
@@ -1075,28 +1124,29 @@ that time, kernel debugging information is displayed on console.
1075NMI switch that most IA32 servers have fires unknown NMI up, for 1124NMI switch that most IA32 servers have fires unknown NMI up, for
1076example. If a system hangs up, try pressing the NMI switch. 1125example. If a system hangs up, try pressing the NMI switch.
1077 1126
1078==============================================================
1079 1127
1080watchdog: 1128watchdog:
1129=========
1081 1130
1082This parameter can be used to disable or enable the soft lockup detector 1131This parameter can be used to disable or enable the soft lockup detector
1083_and_ the NMI watchdog (i.e. the hard lockup detector) at the same time. 1132_and_ the NMI watchdog (i.e. the hard lockup detector) at the same time.
1084 1133
1085 0 - disable both lockup detectors 1134 0 - disable both lockup detectors
1135
1086 1 - enable both lockup detectors 1136 1 - enable both lockup detectors
1087 1137
1088The soft lockup detector and the NMI watchdog can also be disabled or 1138The soft lockup detector and the NMI watchdog can also be disabled or
1089enabled individually, using the soft_watchdog and nmi_watchdog parameters. 1139enabled individually, using the soft_watchdog and nmi_watchdog parameters.
1090If the watchdog parameter is read, for example by executing 1140If the watchdog parameter is read, for example by executing::
1091 1141
1092 cat /proc/sys/kernel/watchdog 1142 cat /proc/sys/kernel/watchdog
1093 1143
1094the output of this command (0 or 1) shows the logical OR of soft_watchdog 1144the output of this command (0 or 1) shows the logical OR of soft_watchdog
1095and nmi_watchdog. 1145and nmi_watchdog.
1096 1146
1097==============================================================
1098 1147
1099watchdog_cpumask: 1148watchdog_cpumask:
1149=================
1100 1150
1101This value can be used to control on which cpus the watchdog may run. 1151This value can be used to control on which cpus the watchdog may run.
1102The default cpumask is all possible cores, but if NO_HZ_FULL is 1152The default cpumask is all possible cores, but if NO_HZ_FULL is
@@ -1111,13 +1161,13 @@ if a kernel lockup was suspected on those cores.
1111 1161
1112The argument value is the standard cpulist format for cpumasks, 1162The argument value is the standard cpulist format for cpumasks,
1113so for example to enable the watchdog on cores 0, 2, 3, and 4 you 1163so for example to enable the watchdog on cores 0, 2, 3, and 4 you
1114might say: 1164might say::
1115 1165
1116 echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask 1166 echo 0,2-4 > /proc/sys/kernel/watchdog_cpumask
1117 1167
1118==============================================================
1119 1168
1120watchdog_thresh: 1169watchdog_thresh:
1170================
1121 1171
1122This value can be used to control the frequency of hrtimer and NMI 1172This value can be used to control the frequency of hrtimer and NMI
1123events and the soft and hard lockup thresholds. The default threshold 1173events and the soft and hard lockup thresholds. The default threshold
@@ -1125,5 +1175,3 @@ is 10 seconds.
1125 1175
1126The softlockup threshold is (2 * watchdog_thresh). Setting this 1176The softlockup threshold is (2 * watchdog_thresh). Setting this
1127tunable to zero will disable lockup detection altogether. 1177tunable to zero will disable lockup detection altogether.
1128
1129==============================================================
diff --git a/Documentation/sysctl/net.txt b/Documentation/admin-guide/sysctl/net.rst
index 2ae91d3873bb..a7d44e71019d 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/admin-guide/sysctl/net.rst
@@ -1,12 +1,25 @@
1Documentation for /proc/sys/net/* 1================================
2 (c) 1999 Terrehon Bowden <terrehon@pacbell.net> 2Documentation for /proc/sys/net/
3 Bodo Bauer <bb@ricochet.net> 3================================
4 (c) 2000 Jorge Nerin <comandante@zaralinux.com>
5 (c) 2009 Shen Feng <shen@cn.fujitsu.com>
6 4
7For general info and legal blurb, please look in README. 5Copyright
8 6
9============================================================== 7Copyright (c) 1999
8
9 - Terrehon Bowden <terrehon@pacbell.net>
10 - Bodo Bauer <bb@ricochet.net>
11
12Copyright (c) 2000
13
14 - Jorge Nerin <comandante@zaralinux.com>
15
16Copyright (c) 2009
17
18 - Shen Feng <shen@cn.fujitsu.com>
19
20For general info and legal blurb, please look in index.rst.
21
22------------------------------------------------------------------------------
10 23
11This file contains the documentation for the sysctl files in 24This file contains the documentation for the sysctl files in
12/proc/sys/net 25/proc/sys/net
@@ -17,20 +30,22 @@ see only some of them, depending on your kernel's configuration.
17 30
18 31
19Table : Subdirectories in /proc/sys/net 32Table : Subdirectories in /proc/sys/net
20.............................................................................. 33
21 Directory Content Directory Content 34 ========= =================== = ========== ==================
22 core General parameter appletalk Appletalk protocol 35 Directory Content Directory Content
23 unix Unix domain sockets netrom NET/ROM 36 ========= =================== = ========== ==================
24 802 E802 protocol ax25 AX25 37 core General parameter appletalk Appletalk protocol
25 ethernet Ethernet protocol rose X.25 PLP layer 38 unix Unix domain sockets netrom NET/ROM
26 ipv4 IP version 4 x25 X.25 protocol 39 802 E802 protocol ax25 AX25
27 ipx IPX token-ring IBM token ring 40 ethernet Ethernet protocol rose X.25 PLP layer
28 bridge Bridging decnet DEC net 41 ipv4 IP version 4 x25 X.25 protocol
29 ipv6 IP version 6 tipc TIPC 42 ipx IPX token-ring IBM token ring
30.............................................................................. 43 bridge Bridging decnet DEC net
44 ipv6 IP version 6 tipc TIPC
45 ========= =================== = ========== ==================
31 46
321. /proc/sys/net/core - Network core options 471. /proc/sys/net/core - Network core options
33------------------------------------------------------- 48============================================
34 49
35bpf_jit_enable 50bpf_jit_enable
36-------------- 51--------------
@@ -44,6 +59,7 @@ restricted C into a sequence of BPF instructions. After program load
44through bpf(2) and passing a verifier in the kernel, a JIT will then 59through bpf(2) and passing a verifier in the kernel, a JIT will then
45translate these BPF proglets into native CPU instructions. There are 60translate these BPF proglets into native CPU instructions. There are
46two flavors of JITs, the newer eBPF JIT currently supported on: 61two flavors of JITs, the newer eBPF JIT currently supported on:
62
47 - x86_64 63 - x86_64
48 - x86_32 64 - x86_32
49 - arm64 65 - arm64
@@ -55,6 +71,7 @@ two flavors of JITs, the newer eBPF JIT currently supported on:
55 - riscv 71 - riscv
56 72
57And the older cBPF JIT supported on the following archs: 73And the older cBPF JIT supported on the following archs:
74
58 - mips 75 - mips
59 - ppc 76 - ppc
60 - sparc 77 - sparc
@@ -65,10 +82,11 @@ compile them transparently. Older cBPF JITs can only translate
65tcpdump filters, seccomp rules, etc, but not mentioned eBPF 82tcpdump filters, seccomp rules, etc, but not mentioned eBPF
66programs loaded through bpf(2). 83programs loaded through bpf(2).
67 84
68Values : 85Values:
69 0 - disable the JIT (default value) 86
70 1 - enable the JIT 87 - 0 - disable the JIT (default value)
71 2 - enable the JIT and ask the compiler to emit traces on kernel log. 88 - 1 - enable the JIT
89 - 2 - enable the JIT and ask the compiler to emit traces on kernel log.
72 90
73bpf_jit_harden 91bpf_jit_harden
74-------------- 92--------------
@@ -76,10 +94,12 @@ bpf_jit_harden
76This enables hardening for the BPF JIT compiler. Supported are eBPF 94This enables hardening for the BPF JIT compiler. Supported are eBPF
77JIT backends. Enabling hardening trades off performance, but can 95JIT backends. Enabling hardening trades off performance, but can
78mitigate JIT spraying. 96mitigate JIT spraying.
79Values : 97
80 0 - disable JIT hardening (default value) 98Values:
81 1 - enable JIT hardening for unprivileged users only 99
82 2 - enable JIT hardening for all users 100 - 0 - disable JIT hardening (default value)
101 - 1 - enable JIT hardening for unprivileged users only
102 - 2 - enable JIT hardening for all users
83 103
84bpf_jit_kallsyms 104bpf_jit_kallsyms
85---------------- 105----------------
@@ -89,9 +109,11 @@ addresses to the kernel, meaning they neither show up in traces nor
89in /proc/kallsyms. This enables export of these addresses, which can 109in /proc/kallsyms. This enables export of these addresses, which can
90be used for debugging/tracing. If bpf_jit_harden is enabled, this 110be used for debugging/tracing. If bpf_jit_harden is enabled, this
91feature is disabled. 111feature is disabled.
112
92Values : 113Values :
93 0 - disable JIT kallsyms export (default value) 114
94 1 - enable JIT kallsyms export for privileged users only 115 - 0 - disable JIT kallsyms export (default value)
116 - 1 - enable JIT kallsyms export for privileged users only
95 117
96bpf_jit_limit 118bpf_jit_limit
97------------- 119-------------
@@ -102,7 +124,7 @@ been surpassed. bpf_jit_limit contains the value of the global limit
102in bytes. 124in bytes.
103 125
104dev_weight 126dev_weight
105-------------- 127----------
106 128
107The maximum number of packets that kernel can handle on a NAPI interrupt, 129The maximum number of packets that kernel can handle on a NAPI interrupt,
108it's a Per-CPU variable. For drivers that support LRO or GRO_HW, a hardware 130it's a Per-CPU variable. For drivers that support LRO or GRO_HW, a hardware
@@ -111,7 +133,7 @@ aggregated packet is counted as one packet in this context.
111Default: 64 133Default: 64
112 134
113dev_weight_rx_bias 135dev_weight_rx_bias
114-------------- 136------------------
115 137
116RPS (e.g. RFS, aRFS) processing is competing with the registered NAPI poll function 138RPS (e.g. RFS, aRFS) processing is competing with the registered NAPI poll function
117of the driver for the per softirq cycle netdev_budget. This parameter influences 139of the driver for the per softirq cycle netdev_budget. This parameter influences
@@ -120,19 +142,22 @@ processing during RX softirq cycles. It is further meant for making current
120dev_weight adaptable for asymmetric CPU needs on RX/TX side of the network stack. 142dev_weight adaptable for asymmetric CPU needs on RX/TX side of the network stack.
121(see dev_weight_tx_bias) It is effective on a per CPU basis. Determination is based 143(see dev_weight_tx_bias) It is effective on a per CPU basis. Determination is based
122on dev_weight and is calculated multiplicative (dev_weight * dev_weight_rx_bias). 144on dev_weight and is calculated multiplicative (dev_weight * dev_weight_rx_bias).
145
123Default: 1 146Default: 1
124 147
125dev_weight_tx_bias 148dev_weight_tx_bias
126-------------- 149------------------
127 150
128Scales the maximum number of packets that can be processed during a TX softirq cycle. 151Scales the maximum number of packets that can be processed during a TX softirq cycle.
129Effective on a per CPU basis. Allows scaling of current dev_weight for asymmetric 152Effective on a per CPU basis. Allows scaling of current dev_weight for asymmetric
130net stack processing needs. Be careful to avoid making TX softirq processing a CPU hog. 153net stack processing needs. Be careful to avoid making TX softirq processing a CPU hog.
154
131Calculation is based on dev_weight (dev_weight * dev_weight_tx_bias). 155Calculation is based on dev_weight (dev_weight * dev_weight_tx_bias).
156
132Default: 1 157Default: 1
133 158
134default_qdisc 159default_qdisc
135-------------- 160-------------
136 161
137The default queuing discipline to use for network devices. This allows 162The default queuing discipline to use for network devices. This allows
138overriding the default of pfifo_fast with an alternative. Since the default 163overriding the default of pfifo_fast with an alternative. Since the default
@@ -144,17 +169,21 @@ which require setting up classes and bandwidths. Note that physical multiqueue
144interfaces still use mq as root qdisc, which in turn uses this default for its 169interfaces still use mq as root qdisc, which in turn uses this default for its
145leaves. Virtual devices (like e.g. lo or veth) ignore this setting and instead 170leaves. Virtual devices (like e.g. lo or veth) ignore this setting and instead
146default to noqueue. 171default to noqueue.
172
147Default: pfifo_fast 173Default: pfifo_fast
148 174
149busy_read 175busy_read
150---------------- 176---------
177
151Low latency busy poll timeout for socket reads. (needs CONFIG_NET_RX_BUSY_POLL) 178Low latency busy poll timeout for socket reads. (needs CONFIG_NET_RX_BUSY_POLL)
152Approximate time in us to busy loop waiting for packets on the device queue. 179Approximate time in us to busy loop waiting for packets on the device queue.
153This sets the default value of the SO_BUSY_POLL socket option. 180This sets the default value of the SO_BUSY_POLL socket option.
154Can be set or overridden per socket by setting socket option SO_BUSY_POLL, 181Can be set or overridden per socket by setting socket option SO_BUSY_POLL,
155which is the preferred method of enabling. If you need to enable the feature 182which is the preferred method of enabling. If you need to enable the feature
156globally via sysctl, a value of 50 is recommended. 183globally via sysctl, a value of 50 is recommended.
184
157Will increase power usage. 185Will increase power usage.
186
158Default: 0 (off) 187Default: 0 (off)
159 188
160busy_poll 189busy_poll
@@ -167,7 +196,9 @@ For more than that you probably want to use epoll.
167Note that only sockets with SO_BUSY_POLL set will be busy polled, 196Note that only sockets with SO_BUSY_POLL set will be busy polled,
168so you want to either selectively set SO_BUSY_POLL on those sockets or set 197so you want to either selectively set SO_BUSY_POLL on those sockets or set
169sysctl.net.busy_read globally. 198sysctl.net.busy_read globally.
199
170Will increase power usage. 200Will increase power usage.
201
171Default: 0 (off) 202Default: 0 (off)
172 203
173rmem_default 204rmem_default
@@ -185,6 +216,7 @@ tstamp_allow_data
185Allow processes to receive tx timestamps looped together with the original 216Allow processes to receive tx timestamps looped together with the original
186packet contents. If disabled, transmit timestamp requests from unprivileged 217packet contents. If disabled, transmit timestamp requests from unprivileged
187processes are dropped unless socket option SOF_TIMESTAMPING_OPT_TSONLY is set. 218processes are dropped unless socket option SOF_TIMESTAMPING_OPT_TSONLY is set.
219
188Default: 1 (on) 220Default: 1 (on)
189 221
190 222
@@ -250,19 +282,24 @@ randomly generated.
250Some user space might need to gather its content even if drivers do not 282Some user space might need to gather its content even if drivers do not
251provide ethtool -x support yet. 283provide ethtool -x support yet.
252 284
253myhost:~# cat /proc/sys/net/core/netdev_rss_key 285::
25484:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (52 bytes total) 286
287 myhost:~# cat /proc/sys/net/core/netdev_rss_key
288 84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (52 bytes total)
255 289
256File contains nul bytes if no driver ever called netdev_rss_key_fill() function. 290File contains nul bytes if no driver ever called netdev_rss_key_fill() function.
291
257Note: 292Note:
258/proc/sys/net/core/netdev_rss_key contains 52 bytes of key, 293 /proc/sys/net/core/netdev_rss_key contains 52 bytes of key,
259but most drivers only use 40 bytes of it. 294 but most drivers only use 40 bytes of it.
295
296::
260 297
261myhost:~# ethtool -x eth0 298 myhost:~# ethtool -x eth0
262RX flow hash indirection table for eth0 with 8 RX ring(s): 299 RX flow hash indirection table for eth0 with 8 RX ring(s):
263 0: 0 1 2 3 4 5 6 7 300 0: 0 1 2 3 4 5 6 7
264RSS hash key: 301 RSS hash key:
26584:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89 302 84:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89
266 303
267netdev_tstamp_prequeue 304netdev_tstamp_prequeue
268---------------------- 305----------------------
@@ -293,7 +330,7 @@ user space is responsible for creating them if needed.
293Default : 0 (for compatibility reasons) 330Default : 0 (for compatibility reasons)
294 331
295devconf_inherit_init_net 332devconf_inherit_init_net
296---------------------------- 333------------------------
297 334
298Controls if a new network namespace should inherit all current 335Controls if a new network namespace should inherit all current
299settings under /proc/sys/net/{ipv4,ipv6}/conf/{all,default}/. By 336settings under /proc/sys/net/{ipv4,ipv6}/conf/{all,default}/. By
@@ -307,7 +344,7 @@ forced to reset to their default values.
307Default : 0 (for compatibility reasons) 344Default : 0 (for compatibility reasons)
308 345
3092. /proc/sys/net/unix - Parameters for Unix domain sockets 3462. /proc/sys/net/unix - Parameters for Unix domain sockets
310------------------------------------------------------- 347----------------------------------------------------------
311 348
312There is only one file in this directory. 349There is only one file in this directory.
313unix_dgram_qlen limits the max number of datagrams queued in Unix domain 350unix_dgram_qlen limits the max number of datagrams queued in Unix domain
@@ -315,13 +352,13 @@ socket's buffer. It will not take effect unless PF_UNIX flag is specified.
315 352
316 353
3173. /proc/sys/net/ipv4 - IPV4 settings 3543. /proc/sys/net/ipv4 - IPV4 settings
318------------------------------------------------------- 355-------------------------------------
319Please see: Documentation/networking/ip-sysctl.txt and ipvs-sysctl.txt for 356Please see: Documentation/networking/ip-sysctl.txt and ipvs-sysctl.txt for
320descriptions of these entries. 357descriptions of these entries.
321 358
322 359
3234. Appletalk 3604. Appletalk
324------------------------------------------------------- 361------------
325 362
326The /proc/sys/net/appletalk directory holds the Appletalk configuration data 363The /proc/sys/net/appletalk directory holds the Appletalk configuration data
327when Appletalk is loaded. The configurable parameters are: 364when Appletalk is loaded. The configurable parameters are:
@@ -366,7 +403,7 @@ route flags, and the device the route is using.
366 403
367 404
3685. IPX 4055. IPX
369------------------------------------------------------- 406------
370 407
371The IPX protocol has no tunable values in proc/sys/net. 408The IPX protocol has no tunable values in proc/sys/net.
372 409
@@ -391,14 +428,16 @@ gives the destination network, the router node (or Directly) and the network
391address of the router (or Connected) for internal networks. 428address of the router (or Connected) for internal networks.
392 429
3936. TIPC 4306. TIPC
394------------------------------------------------------- 431-------
395 432
396tipc_rmem 433tipc_rmem
397---------- 434---------
398 435
399The TIPC protocol now has a tunable for the receive memory, similar to the 436The TIPC protocol now has a tunable for the receive memory, similar to the
400tcp_rmem - i.e. a vector of 3 INTEGERs: (min, default, max) 437tcp_rmem - i.e. a vector of 3 INTEGERs: (min, default, max)
401 438
439::
440
402 # cat /proc/sys/net/tipc/tipc_rmem 441 # cat /proc/sys/net/tipc/tipc_rmem
403 4252725 34021800 68043600 442 4252725 34021800 68043600
404 # 443 #
@@ -409,7 +448,7 @@ is not at this point in time used in any meaningful way, but the triplet is
409preserved in order to be consistent with things like tcp_rmem. 448preserved in order to be consistent with things like tcp_rmem.
410 449
411named_timeout 450named_timeout
412-------------- 451-------------
413 452
414TIPC name table updates are distributed asynchronously in a cluster, without 453TIPC name table updates are distributed asynchronously in a cluster, without
415any form of transaction handling. This means that different race scenarios are 454any form of transaction handling. This means that different race scenarios are
diff --git a/Documentation/sysctl/sunrpc.txt b/Documentation/admin-guide/sysctl/sunrpc.rst
index ae1ecac6f85a..09780a682afd 100644
--- a/Documentation/sysctl/sunrpc.txt
+++ b/Documentation/admin-guide/sysctl/sunrpc.rst
@@ -1,9 +1,14 @@
1Documentation for /proc/sys/sunrpc/* kernel version 2.2.10 1===================================
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> 2Documentation for /proc/sys/sunrpc/
3===================================
3 4
4For general info and legal blurb, please look in README. 5kernel version 2.2.10
5 6
6============================================================== 7Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
8
9For general info and legal blurb, please look in index.rst.
10
11------------------------------------------------------------------------------
7 12
8This file contains the documentation for the sysctl files in 13This file contains the documentation for the sysctl files in
9/proc/sys/sunrpc and is valid for Linux kernel version 2.2. 14/proc/sys/sunrpc and is valid for Linux kernel version 2.2.
diff --git a/Documentation/sysctl/user.txt b/Documentation/admin-guide/sysctl/user.rst
index a5882865836e..650eaa03f15e 100644
--- a/Documentation/sysctl/user.txt
+++ b/Documentation/admin-guide/sysctl/user.rst
@@ -1,7 +1,12 @@
1Documentation for /proc/sys/user/* kernel version 4.9.0 1=================================
2 (c) 2016 Eric Biederman <ebiederm@xmission.com> 2Documentation for /proc/sys/user/
3=================================
3 4
4============================================================== 5kernel version 4.9.0
6
7Copyright (c) 2016 Eric Biederman <ebiederm@xmission.com>
8
9------------------------------------------------------------------------------
5 10
6This file contains the documentation for the sysctl files in 11This file contains the documentation for the sysctl files in
7/proc/sys/user. 12/proc/sys/user.
@@ -30,37 +35,44 @@ user namespace does not allow a user to escape their current limits.
30 35
31Currently, these files are in /proc/sys/user: 36Currently, these files are in /proc/sys/user:
32 37
33- max_cgroup_namespaces 38max_cgroup_namespaces
39=====================
34 40
35 The maximum number of cgroup namespaces that any user in the current 41 The maximum number of cgroup namespaces that any user in the current
36 user namespace may create. 42 user namespace may create.
37 43
38- max_ipc_namespaces 44max_ipc_namespaces
45==================
39 46
40 The maximum number of ipc namespaces that any user in the current 47 The maximum number of ipc namespaces that any user in the current
41 user namespace may create. 48 user namespace may create.
42 49
43- max_mnt_namespaces 50max_mnt_namespaces
51==================
44 52
45 The maximum number of mount namespaces that any user in the current 53 The maximum number of mount namespaces that any user in the current
46 user namespace may create. 54 user namespace may create.
47 55
48- max_net_namespaces 56max_net_namespaces
57==================
49 58
50 The maximum number of network namespaces that any user in the 59 The maximum number of network namespaces that any user in the
51 current user namespace may create. 60 current user namespace may create.
52 61
53- max_pid_namespaces 62max_pid_namespaces
63==================
54 64
55 The maximum number of pid namespaces that any user in the current 65 The maximum number of pid namespaces that any user in the current
56 user namespace may create. 66 user namespace may create.
57 67
58- max_user_namespaces 68max_user_namespaces
69===================
59 70
60 The maximum number of user namespaces that any user in the current 71 The maximum number of user namespaces that any user in the current
61 user namespace may create. 72 user namespace may create.
62 73
63- max_uts_namespaces 74max_uts_namespaces
75==================
64 76
65 The maximum number of user namespaces that any user in the current 77 The maximum number of user namespaces that any user in the current
66 user namespace may create. 78 user namespace may create.
diff --git a/Documentation/sysctl/vm.txt b/Documentation/admin-guide/sysctl/vm.rst
index 749322060f10..64aeee1009ca 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/admin-guide/sysctl/vm.rst
@@ -1,10 +1,16 @@
1Documentation for /proc/sys/vm/* kernel version 2.6.29 1===============================
2 (c) 1998, 1999, Rik van Riel <riel@nl.linux.org> 2Documentation for /proc/sys/vm/
3 (c) 2008 Peter W. Morreale <pmorreale@novell.com> 3===============================
4 4
5For general info and legal blurb, please look in README. 5kernel version 2.6.29
6 6
7============================================================== 7Copyright (c) 1998, 1999, Rik van Riel <riel@nl.linux.org>
8
9Copyright (c) 2008 Peter W. Morreale <pmorreale@novell.com>
10
11For general info and legal blurb, please look in index.rst.
12
13------------------------------------------------------------------------------
8 14
9This file contains the documentation for the sysctl files in 15This file contains the documentation for the sysctl files in
10/proc/sys/vm and is valid for Linux kernel version 2.6.29. 16/proc/sys/vm and is valid for Linux kernel version 2.6.29.
@@ -68,9 +74,9 @@ Currently, these files are in /proc/sys/vm:
68- watermark_scale_factor 74- watermark_scale_factor
69- zone_reclaim_mode 75- zone_reclaim_mode
70 76
71==============================================================
72 77
73admin_reserve_kbytes 78admin_reserve_kbytes
79====================
74 80
75The amount of free memory in the system that should be reserved for users 81The amount of free memory in the system that should be reserved for users
76with the capability cap_sys_admin. 82with the capability cap_sys_admin.
@@ -97,25 +103,25 @@ On x86_64 this is about 128MB.
97 103
98Changing this takes effect whenever an application requests memory. 104Changing this takes effect whenever an application requests memory.
99 105
100==============================================================
101 106
102block_dump 107block_dump
108==========
103 109
104block_dump enables block I/O debugging when set to a nonzero value. More 110block_dump enables block I/O debugging when set to a nonzero value. More
105information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. 111information on block I/O debugging is in Documentation/admin-guide/laptops/laptop-mode.rst.
106 112
107==============================================================
108 113
109compact_memory 114compact_memory
115==============
110 116
111Available only when CONFIG_COMPACTION is set. When 1 is written to the file, 117Available only when CONFIG_COMPACTION is set. When 1 is written to the file,
112all zones are compacted such that free memory is available in contiguous 118all zones are compacted such that free memory is available in contiguous
113blocks where possible. This can be important for example in the allocation of 119blocks where possible. This can be important for example in the allocation of
114huge pages although processes will also directly compact memory as required. 120huge pages although processes will also directly compact memory as required.
115 121
116==============================================================
117 122
118compact_unevictable_allowed 123compact_unevictable_allowed
124===========================
119 125
120Available only when CONFIG_COMPACTION is set. When set to 1, compaction is 126Available only when CONFIG_COMPACTION is set. When set to 1, compaction is
121allowed to examine the unevictable lru (mlocked pages) for pages to compact. 127allowed to examine the unevictable lru (mlocked pages) for pages to compact.
@@ -123,21 +129,22 @@ This should be used on systems where stalls for minor page faults are an
123acceptable trade for large contiguous free memory. Set to 0 to prevent 129acceptable trade for large contiguous free memory. Set to 0 to prevent
124compaction from moving pages that are unevictable. Default value is 1. 130compaction from moving pages that are unevictable. Default value is 1.
125 131
126==============================================================
127 132
128dirty_background_bytes 133dirty_background_bytes
134======================
129 135
130Contains the amount of dirty memory at which the background kernel 136Contains the amount of dirty memory at which the background kernel
131flusher threads will start writeback. 137flusher threads will start writeback.
132 138
133Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only 139Note:
134one of them may be specified at a time. When one sysctl is written it is 140 dirty_background_bytes is the counterpart of dirty_background_ratio. Only
135immediately taken into account to evaluate the dirty memory limits and the 141 one of them may be specified at a time. When one sysctl is written it is
136other appears as 0 when read. 142 immediately taken into account to evaluate the dirty memory limits and the
143 other appears as 0 when read.
137 144
138==============================================================
139 145
140dirty_background_ratio 146dirty_background_ratio
147======================
141 148
142Contains, as a percentage of total available memory that contains free pages 149Contains, as a percentage of total available memory that contains free pages
143and reclaimable pages, the number of pages at which the background kernel 150and reclaimable pages, the number of pages at which the background kernel
@@ -145,9 +152,9 @@ flusher threads will start writing out dirty data.
145 152
146The total available memory is not equal to total system memory. 153The total available memory is not equal to total system memory.
147 154
148==============================================================
149 155
150dirty_bytes 156dirty_bytes
157===========
151 158
152Contains the amount of dirty memory at which a process generating disk writes 159Contains the amount of dirty memory at which a process generating disk writes
153will itself start writeback. 160will itself start writeback.
@@ -161,18 +168,18 @@ Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
161value lower than this limit will be ignored and the old configuration will be 168value lower than this limit will be ignored and the old configuration will be
162retained. 169retained.
163 170
164==============================================================
165 171
166dirty_expire_centisecs 172dirty_expire_centisecs
173======================
167 174
168This tunable is used to define when dirty data is old enough to be eligible 175This tunable is used to define when dirty data is old enough to be eligible
169for writeout by the kernel flusher threads. It is expressed in 100'ths 176for writeout by the kernel flusher threads. It is expressed in 100'ths
170of a second. Data which has been dirty in-memory for longer than this 177of a second. Data which has been dirty in-memory for longer than this
171interval will be written out next time a flusher thread wakes up. 178interval will be written out next time a flusher thread wakes up.
172 179
173==============================================================
174 180
175dirty_ratio 181dirty_ratio
182===========
176 183
177Contains, as a percentage of total available memory that contains free pages 184Contains, as a percentage of total available memory that contains free pages
178and reclaimable pages, the number of pages at which a process which is 185and reclaimable pages, the number of pages at which a process which is
@@ -180,9 +187,9 @@ generating disk writes will itself start writing out dirty data.
180 187
181The total available memory is not equal to total system memory. 188The total available memory is not equal to total system memory.
182 189
183==============================================================
184 190
185dirtytime_expire_seconds 191dirtytime_expire_seconds
192========================
186 193
187When a lazytime inode is constantly having its pages dirtied, the inode with 194When a lazytime inode is constantly having its pages dirtied, the inode with
188an updated timestamp will never get chance to be written out. And, if the 195an updated timestamp will never get chance to be written out. And, if the
@@ -192,34 +199,39 @@ eventually gets pushed out to disk. This tunable is used to define when dirty
192inode is old enough to be eligible for writeback by the kernel flusher threads. 199inode is old enough to be eligible for writeback by the kernel flusher threads.
193And, it is also used as the interval to wakeup dirtytime_writeback thread. 200And, it is also used as the interval to wakeup dirtytime_writeback thread.
194 201
195==============================================================
196 202
197dirty_writeback_centisecs 203dirty_writeback_centisecs
204=========================
198 205
199The kernel flusher threads will periodically wake up and write `old' data 206The kernel flusher threads will periodically wake up and write `old` data
200out to disk. This tunable expresses the interval between those wakeups, in 207out to disk. This tunable expresses the interval between those wakeups, in
201100'ths of a second. 208100'ths of a second.
202 209
203Setting this to zero disables periodic writeback altogether. 210Setting this to zero disables periodic writeback altogether.
204 211
205==============================================================
206 212
207drop_caches 213drop_caches
214===========
208 215
209Writing to this will cause the kernel to drop clean caches, as well as 216Writing to this will cause the kernel to drop clean caches, as well as
210reclaimable slab objects like dentries and inodes. Once dropped, their 217reclaimable slab objects like dentries and inodes. Once dropped, their
211memory becomes free. 218memory becomes free.
212 219
213To free pagecache: 220To free pagecache::
221
214 echo 1 > /proc/sys/vm/drop_caches 222 echo 1 > /proc/sys/vm/drop_caches
215To free reclaimable slab objects (includes dentries and inodes): 223
224To free reclaimable slab objects (includes dentries and inodes)::
225
216 echo 2 > /proc/sys/vm/drop_caches 226 echo 2 > /proc/sys/vm/drop_caches
217To free slab objects and pagecache: 227
228To free slab objects and pagecache::
229
218 echo 3 > /proc/sys/vm/drop_caches 230 echo 3 > /proc/sys/vm/drop_caches
219 231
220This is a non-destructive operation and will not free any dirty objects. 232This is a non-destructive operation and will not free any dirty objects.
221To increase the number of objects freed by this operation, the user may run 233To increase the number of objects freed by this operation, the user may run
222`sync' prior to writing to /proc/sys/vm/drop_caches. This will minimize the 234`sync` prior to writing to /proc/sys/vm/drop_caches. This will minimize the
223number of dirty objects on the system and create more candidates to be 235number of dirty objects on the system and create more candidates to be
224dropped. 236dropped.
225 237
@@ -233,16 +245,16 @@ dropped objects, especially if they were under heavy use. Because of this,
233use outside of a testing or debugging environment is not recommended. 245use outside of a testing or debugging environment is not recommended.
234 246
235You may see informational messages in your kernel log when this file is 247You may see informational messages in your kernel log when this file is
236used: 248used::
237 249
238 cat (1234): drop_caches: 3 250 cat (1234): drop_caches: 3
239 251
240These are informational only. They do not mean that anything is wrong 252These are informational only. They do not mean that anything is wrong
241with your system. To disable them, echo 4 (bit 2) into drop_caches. 253with your system. To disable them, echo 4 (bit 2) into drop_caches.
242 254
243==============================================================
244 255
245extfrag_threshold 256extfrag_threshold
257=================
246 258
247This parameter affects whether the kernel will compact memory or direct 259This parameter affects whether the kernel will compact memory or direct
248reclaim to satisfy a high-order allocation. The extfrag/extfrag_index file in 260reclaim to satisfy a high-order allocation. The extfrag/extfrag_index file in
@@ -254,9 +266,9 @@ implies that the allocation will succeed as long as watermarks are met.
254The kernel will not compact memory in a zone if the 266The kernel will not compact memory in a zone if the
255fragmentation index is <= extfrag_threshold. The default value is 500. 267fragmentation index is <= extfrag_threshold. The default value is 500.
256 268
257==============================================================
258 269
259highmem_is_dirtyable 270highmem_is_dirtyable
271====================
260 272
261Available only for systems with CONFIG_HIGHMEM enabled (32b systems). 273Available only for systems with CONFIG_HIGHMEM enabled (32b systems).
262 274
@@ -274,30 +286,30 @@ OOM killer because some writers (e.g. direct block device writes) can
274only use the low memory and they can fill it up with dirty data without 286only use the low memory and they can fill it up with dirty data without
275any throttling. 287any throttling.
276 288
277==============================================================
278 289
279hugetlb_shm_group 290hugetlb_shm_group
291=================
280 292
281hugetlb_shm_group contains group id that is allowed to create SysV 293hugetlb_shm_group contains group id that is allowed to create SysV
282shared memory segment using hugetlb page. 294shared memory segment using hugetlb page.
283 295
284==============================================================
285 296
286laptop_mode 297laptop_mode
298===========
287 299
288laptop_mode is a knob that controls "laptop mode". All the things that are 300laptop_mode is a knob that controls "laptop mode". All the things that are
289controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. 301controlled by this knob are discussed in Documentation/admin-guide/laptops/laptop-mode.rst.
290 302
291==============================================================
292 303
293legacy_va_layout 304legacy_va_layout
305================
294 306
295If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel 307If non-zero, this sysctl disables the new 32-bit mmap layout - the kernel
296will use the legacy (2.4) layout for all processes. 308will use the legacy (2.4) layout for all processes.
297 309
298==============================================================
299 310
300lowmem_reserve_ratio 311lowmem_reserve_ratio
312====================
301 313
302For some specialised workloads on highmem machines it is dangerous for 314For some specialised workloads on highmem machines it is dangerous for
303the kernel to allow process memory to be allocated from the "lowmem" 315the kernel to allow process memory to be allocated from the "lowmem"
@@ -308,7 +320,7 @@ And on large highmem machines this lack of reclaimable lowmem memory
308can be fatal. 320can be fatal.
309 321
310So the Linux page allocator has a mechanism which prevents allocations 322So the Linux page allocator has a mechanism which prevents allocations
311which _could_ use highmem from using too much lowmem. This means that 323which *could* use highmem from using too much lowmem. This means that
312a certain amount of lowmem is defended from the possibility of being 324a certain amount of lowmem is defended from the possibility of being
313captured into pinned user memory. 325captured into pinned user memory.
314 326
@@ -316,39 +328,37 @@ captured into pinned user memory.
316mechanism will also defend that region from allocations which could use 328mechanism will also defend that region from allocations which could use
317highmem or lowmem). 329highmem or lowmem).
318 330
319The `lowmem_reserve_ratio' tunable determines how aggressive the kernel is 331The `lowmem_reserve_ratio` tunable determines how aggressive the kernel is
320in defending these lower zones. 332in defending these lower zones.
321 333
322If you have a machine which uses highmem or ISA DMA and your 334If you have a machine which uses highmem or ISA DMA and your
323applications are using mlock(), or if you are running with no swap then 335applications are using mlock(), or if you are running with no swap then
324you probably should change the lowmem_reserve_ratio setting. 336you probably should change the lowmem_reserve_ratio setting.
325 337
326The lowmem_reserve_ratio is an array. You can see them by reading this file. 338The lowmem_reserve_ratio is an array. You can see them by reading this file::
327- 339
328% cat /proc/sys/vm/lowmem_reserve_ratio 340 % cat /proc/sys/vm/lowmem_reserve_ratio
329256 256 32 341 256 256 32
330-
331 342
332But, these values are not used directly. The kernel calculates # of protection 343But, these values are not used directly. The kernel calculates # of protection
333pages for each zones from them. These are shown as array of protection pages 344pages for each zones from them. These are shown as array of protection pages
334in /proc/zoneinfo like followings. (This is an example of x86-64 box). 345in /proc/zoneinfo like followings. (This is an example of x86-64 box).
335Each zone has an array of protection pages like this. 346Each zone has an array of protection pages like this::
336 347
337- 348 Node 0, zone DMA
338Node 0, zone DMA 349 pages free 1355
339 pages free 1355 350 min 3
340 min 3 351 low 3
341 low 3 352 high 4
342 high 4
343 : 353 :
344 : 354 :
345 numa_other 0 355 numa_other 0
346 protection: (0, 2004, 2004, 2004) 356 protection: (0, 2004, 2004, 2004)
347 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 357 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
348 pagesets 358 pagesets
349 cpu: 0 pcp: 0 359 cpu: 0 pcp: 0
350 : 360 :
351- 361
352These protections are added to score to judge whether this zone should be used 362These protections are added to score to judge whether this zone should be used
353for page allocation or should be reclaimed. 363for page allocation or should be reclaimed.
354 364
@@ -359,20 +369,24 @@ not be used because pages_free(1355) is smaller than watermark + protection[2]
359normal page requirement. If requirement is DMA zone(index=0), protection[0] 369normal page requirement. If requirement is DMA zone(index=0), protection[0]
360(=0) is used. 370(=0) is used.
361 371
362zone[i]'s protection[j] is calculated by following expression. 372zone[i]'s protection[j] is calculated by following expression::
363 373
364(i < j): 374 (i < j):
365 zone[i]->protection[j] 375 zone[i]->protection[j]
366 = (total sums of managed_pages from zone[i+1] to zone[j] on the node) 376 = (total sums of managed_pages from zone[i+1] to zone[j] on the node)
367 / lowmem_reserve_ratio[i]; 377 / lowmem_reserve_ratio[i];
368(i = j): 378 (i = j):
369 (should not be protected. = 0; 379 (should not be protected. = 0;
370(i > j): 380 (i > j):
371 (not necessary, but looks 0) 381 (not necessary, but looks 0)
372 382
373The default values of lowmem_reserve_ratio[i] are 383The default values of lowmem_reserve_ratio[i] are
384
385 === ====================================
374 256 (if zone[i] means DMA or DMA32 zone) 386 256 (if zone[i] means DMA or DMA32 zone)
375 32 (others). 387 32 (others)
388 === ====================================
389
376As above expression, they are reciprocal number of ratio. 390As above expression, they are reciprocal number of ratio.
377256 means 1/256. # of protection pages becomes about "0.39%" of total managed 391256 means 1/256. # of protection pages becomes about "0.39%" of total managed
378pages of higher zones on the node. 392pages of higher zones on the node.
@@ -381,9 +395,9 @@ If you would like to protect more pages, smaller values are effective.
381The minimum value is 1 (1/1 -> 100%). The value less than 1 completely 395The minimum value is 1 (1/1 -> 100%). The value less than 1 completely
382disables protection of the pages. 396disables protection of the pages.
383 397
384==============================================================
385 398
386max_map_count: 399max_map_count:
400==============
387 401
388This file contains the maximum number of memory map areas a process 402This file contains the maximum number of memory map areas a process
389may have. Memory map areas are used as a side-effect of calling 403may have. Memory map areas are used as a side-effect of calling
@@ -396,9 +410,9 @@ e.g., up to one or two maps per allocation.
396 410
397The default value is 65536. 411The default value is 65536.
398 412
399=============================================================
400 413
401memory_failure_early_kill: 414memory_failure_early_kill:
415==========================
402 416
403Control how to kill processes when uncorrected memory error (typically 417Control how to kill processes when uncorrected memory error (typically
404a 2bit error in a memory module) is detected in the background by hardware 418a 2bit error in a memory module) is detected in the background by hardware
@@ -424,9 +438,9 @@ check handling and depends on the hardware capabilities.
424 438
425Applications can override this setting individually with the PR_MCE_KILL prctl 439Applications can override this setting individually with the PR_MCE_KILL prctl
426 440
427==============================================================
428 441
429memory_failure_recovery 442memory_failure_recovery
443=======================
430 444
431Enable memory failure recovery (when supported by the platform) 445Enable memory failure recovery (when supported by the platform)
432 446
@@ -434,9 +448,9 @@ Enable memory failure recovery (when supported by the platform)
434 448
4350: Always panic on a memory failure. 4490: Always panic on a memory failure.
436 450
437==============================================================
438 451
439min_free_kbytes: 452min_free_kbytes
453===============
440 454
441This is used to force the Linux VM to keep a minimum number 455This is used to force the Linux VM to keep a minimum number
442of kilobytes free. The VM uses this number to compute a 456of kilobytes free. The VM uses this number to compute a
@@ -450,9 +464,9 @@ become subtly broken, and prone to deadlock under high loads.
450 464
451Setting this too high will OOM your machine instantly. 465Setting this too high will OOM your machine instantly.
452 466
453=============================================================
454 467
455min_slab_ratio: 468min_slab_ratio
469==============
456 470
457This is available only on NUMA kernels. 471This is available only on NUMA kernels.
458 472
@@ -468,9 +482,9 @@ Note that slab reclaim is triggered in a per zone / node fashion.
468The process of reclaiming slab memory is currently not node specific 482The process of reclaiming slab memory is currently not node specific
469and may not be fast. 483and may not be fast.
470 484
471=============================================================
472 485
473min_unmapped_ratio: 486min_unmapped_ratio
487==================
474 488
475This is available only on NUMA kernels. 489This is available only on NUMA kernels.
476 490
@@ -485,9 +499,9 @@ files and similar are considered.
485 499
486The default is 1 percent. 500The default is 1 percent.
487 501
488==============================================================
489 502
490mmap_min_addr 503mmap_min_addr
504=============
491 505
492This file indicates the amount of address space which a user process will 506This file indicates the amount of address space which a user process will
493be restricted from mmapping. Since kernel null dereference bugs could 507be restricted from mmapping. Since kernel null dereference bugs could
@@ -498,9 +512,9 @@ security module. Setting this value to something like 64k will allow the
498vast majority of applications to work correctly and provide defense in depth 512vast majority of applications to work correctly and provide defense in depth
499against future potential kernel bugs. 513against future potential kernel bugs.
500 514
501==============================================================
502 515
503mmap_rnd_bits: 516mmap_rnd_bits
517=============
504 518
505This value can be used to select the number of bits to use to 519This value can be used to select the number of bits to use to
506determine the random offset to the base address of vma regions 520determine the random offset to the base address of vma regions
@@ -511,9 +525,9 @@ by the architecture's minimum and maximum supported values.
511This value can be changed after boot using the 525This value can be changed after boot using the
512/proc/sys/vm/mmap_rnd_bits tunable 526/proc/sys/vm/mmap_rnd_bits tunable
513 527
514==============================================================
515 528
516mmap_rnd_compat_bits: 529mmap_rnd_compat_bits
530====================
517 531
518This value can be used to select the number of bits to use to 532This value can be used to select the number of bits to use to
519determine the random offset to the base address of vma regions 533determine the random offset to the base address of vma regions
@@ -525,35 +539,35 @@ architecture's minimum and maximum supported values.
525This value can be changed after boot using the 539This value can be changed after boot using the
526/proc/sys/vm/mmap_rnd_compat_bits tunable 540/proc/sys/vm/mmap_rnd_compat_bits tunable
527 541
528==============================================================
529 542
530nr_hugepages 543nr_hugepages
544============
531 545
532Change the minimum size of the hugepage pool. 546Change the minimum size of the hugepage pool.
533 547
534See Documentation/admin-guide/mm/hugetlbpage.rst 548See Documentation/admin-guide/mm/hugetlbpage.rst
535 549
536==============================================================
537 550
538nr_hugepages_mempolicy 551nr_hugepages_mempolicy
552======================
539 553
540Change the size of the hugepage pool at run-time on a specific 554Change the size of the hugepage pool at run-time on a specific
541set of NUMA nodes. 555set of NUMA nodes.
542 556
543See Documentation/admin-guide/mm/hugetlbpage.rst 557See Documentation/admin-guide/mm/hugetlbpage.rst
544 558
545==============================================================
546 559
547nr_overcommit_hugepages 560nr_overcommit_hugepages
561=======================
548 562
549Change the maximum size of the hugepage pool. The maximum is 563Change the maximum size of the hugepage pool. The maximum is
550nr_hugepages + nr_overcommit_hugepages. 564nr_hugepages + nr_overcommit_hugepages.
551 565
552See Documentation/admin-guide/mm/hugetlbpage.rst 566See Documentation/admin-guide/mm/hugetlbpage.rst
553 567
554==============================================================
555 568
556nr_trim_pages 569nr_trim_pages
570=============
557 571
558This is available only on NOMMU kernels. 572This is available only on NOMMU kernels.
559 573
@@ -568,16 +582,17 @@ The default value is 1.
568 582
569See Documentation/nommu-mmap.txt for more information. 583See Documentation/nommu-mmap.txt for more information.
570 584
571==============================================================
572 585
573numa_zonelist_order 586numa_zonelist_order
587===================
574 588
575This sysctl is only for NUMA and it is deprecated. Anything but 589This sysctl is only for NUMA and it is deprecated. Anything but
576Node order will fail! 590Node order will fail!
577 591
578'where the memory is allocated from' is controlled by zonelists. 592'where the memory is allocated from' is controlled by zonelists.
593
579(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation. 594(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation.
580 you may be able to read ZONE_DMA as ZONE_DMA32...) 595you may be able to read ZONE_DMA as ZONE_DMA32...)
581 596
582In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following. 597In non-NUMA case, a zonelist for GFP_KERNEL is ordered as following.
583ZONE_NORMAL -> ZONE_DMA 598ZONE_NORMAL -> ZONE_DMA
@@ -585,10 +600,10 @@ This means that a memory allocation request for GFP_KERNEL will
585get memory from ZONE_DMA only when ZONE_NORMAL is not available. 600get memory from ZONE_DMA only when ZONE_NORMAL is not available.
586 601
587In NUMA case, you can think of following 2 types of order. 602In NUMA case, you can think of following 2 types of order.
588Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL 603Assume 2 node NUMA and below is zonelist of Node(0)'s GFP_KERNEL::
589 604
590(A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL 605 (A) Node(0) ZONE_NORMAL -> Node(0) ZONE_DMA -> Node(1) ZONE_NORMAL
591(B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA. 606 (B) Node(0) ZONE_NORMAL -> Node(1) ZONE_NORMAL -> Node(0) ZONE_DMA.
592 607
593Type(A) offers the best locality for processes on Node(0), but ZONE_DMA 608Type(A) offers the best locality for processes on Node(0), but ZONE_DMA
594will be used before ZONE_NORMAL exhaustion. This increases possibility of 609will be used before ZONE_NORMAL exhaustion. This increases possibility of
@@ -616,9 +631,9 @@ order will be selected.
616Default order is recommended unless this is causing problems for your 631Default order is recommended unless this is causing problems for your
617system/application. 632system/application.
618 633
619==============================================================
620 634
621oom_dump_tasks 635oom_dump_tasks
636==============
622 637
623Enables a system-wide task dump (excluding kernel threads) to be produced 638Enables a system-wide task dump (excluding kernel threads) to be produced
624when the kernel performs an OOM-killing and includes such information as 639when the kernel performs an OOM-killing and includes such information as
@@ -638,9 +653,9 @@ OOM killer actually kills a memory-hogging task.
638 653
639The default value is 1 (enabled). 654The default value is 1 (enabled).
640 655
641==============================================================
642 656
643oom_kill_allocating_task 657oom_kill_allocating_task
658========================
644 659
645This enables or disables killing the OOM-triggering task in 660This enables or disables killing the OOM-triggering task in
646out-of-memory situations. 661out-of-memory situations.
@@ -659,9 +674,9 @@ is used in oom_kill_allocating_task.
659 674
660The default value is 0. 675The default value is 0.
661 676
662==============================================================
663 677
664overcommit_kbytes: 678overcommit_kbytes
679=================
665 680
666When overcommit_memory is set to 2, the committed address space is not 681When overcommit_memory is set to 2, the committed address space is not
667permitted to exceed swap plus this amount of physical RAM. See below. 682permitted to exceed swap plus this amount of physical RAM. See below.
@@ -670,9 +685,9 @@ Note: overcommit_kbytes is the counterpart of overcommit_ratio. Only one
670of them may be specified at a time. Setting one disables the other (which 685of them may be specified at a time. Setting one disables the other (which
671then appears as 0 when read). 686then appears as 0 when read).
672 687
673==============================================================
674 688
675overcommit_memory: 689overcommit_memory
690=================
676 691
677This value contains a flag that enables memory overcommitment. 692This value contains a flag that enables memory overcommitment.
678 693
@@ -695,17 +710,17 @@ The default value is 0.
695See Documentation/vm/overcommit-accounting.rst and 710See Documentation/vm/overcommit-accounting.rst and
696mm/util.c::__vm_enough_memory() for more information. 711mm/util.c::__vm_enough_memory() for more information.
697 712
698==============================================================
699 713
700overcommit_ratio: 714overcommit_ratio
715================
701 716
702When overcommit_memory is set to 2, the committed address 717When overcommit_memory is set to 2, the committed address
703space is not permitted to exceed swap plus this percentage 718space is not permitted to exceed swap plus this percentage
704of physical RAM. See above. 719of physical RAM. See above.
705 720
706==============================================================
707 721
708page-cluster 722page-cluster
723============
709 724
710page-cluster controls the number of pages up to which consecutive pages 725page-cluster controls the number of pages up to which consecutive pages
711are read in from swap in a single attempt. This is the swap counterpart 726are read in from swap in a single attempt. This is the swap counterpart
@@ -725,9 +740,9 @@ Lower values mean lower latencies for initial faults, but at the same time
725extra faults and I/O delays for following faults if they would have been part of 740extra faults and I/O delays for following faults if they would have been part of
726that consecutive pages readahead would have brought in. 741that consecutive pages readahead would have brought in.
727 742
728=============================================================
729 743
730panic_on_oom 744panic_on_oom
745============
731 746
732This enables or disables panic on out-of-memory feature. 747This enables or disables panic on out-of-memory feature.
733 748
@@ -747,14 +762,16 @@ above-mentioned. Even oom happens under memory cgroup, the whole
747system panics. 762system panics.
748 763
749The default value is 0. 764The default value is 0.
765
7501 and 2 are for failover of clustering. Please select either 7661 and 2 are for failover of clustering. Please select either
751according to your policy of failover. 767according to your policy of failover.
768
752panic_on_oom=2+kdump gives you very strong tool to investigate 769panic_on_oom=2+kdump gives you very strong tool to investigate
753why oom happens. You can get snapshot. 770why oom happens. You can get snapshot.
754 771
755=============================================================
756 772
757percpu_pagelist_fraction 773percpu_pagelist_fraction
774========================
758 775
759This is the fraction of pages at most (high mark pcp->high) in each zone that 776This is the fraction of pages at most (high mark pcp->high) in each zone that
760are allocated for each per cpu page list. The min value for this is 8. It 777are allocated for each per cpu page list. The min value for this is 8. It
@@ -770,16 +787,16 @@ The initial value is zero. Kernel does not use this value at boot time to set
770the high water marks for each per cpu page list. If the user writes '0' to this 787the high water marks for each per cpu page list. If the user writes '0' to this
771sysctl, it will revert to this default behavior. 788sysctl, it will revert to this default behavior.
772 789
773==============================================================
774 790
775stat_interval 791stat_interval
792=============
776 793
777The time interval between which vm statistics are updated. The default 794The time interval between which vm statistics are updated. The default
778is 1 second. 795is 1 second.
779 796
780==============================================================
781 797
782stat_refresh 798stat_refresh
799============
783 800
784Any read or write (by root only) flushes all the per-cpu vm statistics 801Any read or write (by root only) flushes all the per-cpu vm statistics
785into their global totals, for more accurate reports when testing 802into their global totals, for more accurate reports when testing
@@ -790,24 +807,26 @@ as 0) and "fails" with EINVAL if any are found, with a warning in dmesg.
790(At time of writing, a few stats are known sometimes to be found negative, 807(At time of writing, a few stats are known sometimes to be found negative,
791with no ill effects: errors and warnings on these stats are suppressed.) 808with no ill effects: errors and warnings on these stats are suppressed.)
792 809
793==============================================================
794 810
795numa_stat 811numa_stat
812=========
796 813
797This interface allows runtime configuration of numa statistics. 814This interface allows runtime configuration of numa statistics.
798 815
799When page allocation performance becomes a bottleneck and you can tolerate 816When page allocation performance becomes a bottleneck and you can tolerate
800some possible tool breakage and decreased numa counter precision, you can 817some possible tool breakage and decreased numa counter precision, you can
801do: 818do::
819
802 echo 0 > /proc/sys/vm/numa_stat 820 echo 0 > /proc/sys/vm/numa_stat
803 821
804When page allocation performance is not a bottleneck and you want all 822When page allocation performance is not a bottleneck and you want all
805tooling to work, you can do: 823tooling to work, you can do::
824
806 echo 1 > /proc/sys/vm/numa_stat 825 echo 1 > /proc/sys/vm/numa_stat
807 826
808==============================================================
809 827
810swappiness 828swappiness
829==========
811 830
812This control is used to define how aggressive the kernel will swap 831This control is used to define how aggressive the kernel will swap
813memory pages. Higher values will increase aggressiveness, lower values 832memory pages. Higher values will increase aggressiveness, lower values
@@ -817,9 +836,9 @@ than the high water mark in a zone.
817 836
818The default value is 60. 837The default value is 60.
819 838
820==============================================================
821 839
822unprivileged_userfaultfd 840unprivileged_userfaultfd
841========================
823 842
824This flag controls whether unprivileged users can use the userfaultfd 843This flag controls whether unprivileged users can use the userfaultfd
825system calls. Set this to 1 to allow unprivileged users to use the 844system calls. Set this to 1 to allow unprivileged users to use the
@@ -828,9 +847,9 @@ privileged users (with SYS_CAP_PTRACE capability).
828 847
829The default value is 1. 848The default value is 1.
830 849
831==============================================================
832 850
833- user_reserve_kbytes 851user_reserve_kbytes
852===================
834 853
835When overcommit_memory is set to 2, "never overcommit" mode, reserve 854When overcommit_memory is set to 2, "never overcommit" mode, reserve
836min(3% of current process size, user_reserve_kbytes) of free memory. 855min(3% of current process size, user_reserve_kbytes) of free memory.
@@ -846,10 +865,9 @@ Any subsequent attempts to execute a command will result in
846 865
847Changing this takes effect whenever an application requests memory. 866Changing this takes effect whenever an application requests memory.
848 867
849==============================================================
850 868
851vfs_cache_pressure 869vfs_cache_pressure
852------------------ 870==================
853 871
854This percentage value controls the tendency of the kernel to reclaim 872This percentage value controls the tendency of the kernel to reclaim
855the memory which is used for caching of directory and inode objects. 873the memory which is used for caching of directory and inode objects.
@@ -867,9 +885,9 @@ performance impact. Reclaim code needs to take various locks to find freeable
867directory and inode objects. With vfs_cache_pressure=1000, it will look for 885directory and inode objects. With vfs_cache_pressure=1000, it will look for
868ten times more freeable objects than there are. 886ten times more freeable objects than there are.
869 887
870=============================================================
871 888
872watermark_boost_factor: 889watermark_boost_factor
890======================
873 891
874This factor controls the level of reclaim when memory is being fragmented. 892This factor controls the level of reclaim when memory is being fragmented.
875It defines the percentage of the high watermark of a zone that will be 893It defines the percentage of the high watermark of a zone that will be
@@ -887,9 +905,9 @@ fragmentation events that occurred in the recent past. If this value is
887smaller than a pageblock then a pageblocks worth of pages will be reclaimed 905smaller than a pageblock then a pageblocks worth of pages will be reclaimed
888(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. 906(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature.
889 907
890=============================================================
891 908
892watermark_scale_factor: 909watermark_scale_factor
910======================
893 911
894This factor controls the aggressiveness of kswapd. It defines the 912This factor controls the aggressiveness of kswapd. It defines the
895amount of memory left in a node/system before kswapd is woken up and 913amount of memory left in a node/system before kswapd is woken up and
@@ -905,20 +923,22 @@ that the number of free pages kswapd maintains for latency reasons is
905too small for the allocation bursts occurring in the system. This knob 923too small for the allocation bursts occurring in the system. This knob
906can then be used to tune kswapd aggressiveness accordingly. 924can then be used to tune kswapd aggressiveness accordingly.
907 925
908==============================================================
909 926
910zone_reclaim_mode: 927zone_reclaim_mode
928=================
911 929
912Zone_reclaim_mode allows someone to set more or less aggressive approaches to 930Zone_reclaim_mode allows someone to set more or less aggressive approaches to
913reclaim memory when a zone runs out of memory. If it is set to zero then no 931reclaim memory when a zone runs out of memory. If it is set to zero then no
914zone reclaim occurs. Allocations will be satisfied from other zones / nodes 932zone reclaim occurs. Allocations will be satisfied from other zones / nodes
915in the system. 933in the system.
916 934
917This is value ORed together of 935This is value OR'ed together of
918 936
9191 = Zone reclaim on 937= ===================================
9202 = Zone reclaim writes dirty pages out 9381 Zone reclaim on
9214 = Zone reclaim swaps pages 9392 Zone reclaim writes dirty pages out
9404 Zone reclaim swaps pages
941= ===================================
922 942
923zone_reclaim_mode is disabled by default. For file servers or workloads 943zone_reclaim_mode is disabled by default. For file servers or workloads
924that benefit from having their data cached, zone_reclaim_mode should be 944that benefit from having their data cached, zone_reclaim_mode should be
@@ -942,5 +962,3 @@ of other processes running on other nodes will not be affected.
942Allowing regular swap effectively restricts allocations to the local 962Allowing regular swap effectively restricts allocations to the local
943node unless explicitly overridden by memory policies or cpuset 963node unless explicitly overridden by memory policies or cpuset
944configurations. 964configurations.
945
946============ End of Document =================================
diff --git a/Documentation/video-output.txt b/Documentation/admin-guide/video-output.rst
index 56d6fa2e2368..56d6fa2e2368 100644
--- a/Documentation/video-output.txt
+++ b/Documentation/admin-guide/video-output.rst
diff --git a/Documentation/arm/Marvell/README b/Documentation/arm/Marvell/README
deleted file mode 100644
index 56ada27c53be..000000000000
--- a/Documentation/arm/Marvell/README
+++ /dev/null
@@ -1,395 +0,0 @@
1ARM Marvell SoCs
2================
3
4This document lists all the ARM Marvell SoCs that are currently
5supported in mainline by the Linux kernel. As the Marvell families of
6SoCs are large and complex, it is hard to understand where the support
7for a particular SoC is available in the Linux kernel. This document
8tries to help in understanding where those SoCs are supported, and to
9match them with their corresponding public datasheet, when available.
10
11Orion family
12------------
13
14 Flavors:
15 88F5082
16 88F5181
17 88F5181L
18 88F5182
19 Datasheet : http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf
20 Programmer's User Guide : http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf
21 User Manual : http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf
22 88F5281
23 Datasheet : http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
24 88F6183
25 Core: Feroceon 88fr331 (88f51xx) or 88fr531-vd (88f52xx) ARMv5 compatible
26 Linux kernel mach directory: arch/arm/mach-orion5x
27 Linux kernel plat directory: arch/arm/plat-orion
28
29Kirkwood family
30---------------
31
32 Flavors:
33 88F6282 a.k.a Armada 300
34 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
35 88F6283 a.k.a Armada 310
36 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
37 88F6190
38 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
39 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
40 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
41 88F6192
42 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
43 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
44 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
45 88F6182
46 88F6180
47 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
48 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
49 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
50 88F6281
51 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
52 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
53 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
54 Homepage: http://www.marvell.com/embedded-processors/kirkwood/
55 Core: Feroceon 88fr131 ARMv5 compatible
56 Linux kernel mach directory: arch/arm/mach-mvebu
57 Linux kernel plat directory: none
58
59Discovery family
60----------------
61
62 Flavors:
63 MV78100
64 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
65 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
66 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
67 MV78200
68 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
69 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
70 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
71 MV76100
72 Not supported by the Linux kernel.
73
74 Core: Feroceon 88fr571-vd ARMv5 compatible
75
76 Linux kernel mach directory: arch/arm/mach-mv78xx0
77 Linux kernel plat directory: arch/arm/plat-orion
78
79EBU Armada family
80-----------------
81
82 Armada 370 Flavors:
83 88F6710
84 88F6707
85 88F6W11
86 Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
87 Hardware Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
88 Functional Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
89 Core: Sheeva ARMv7 compatible PJ4B
90
91 Armada 375 Flavors:
92 88F6720
93 Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
94 Core: ARM Cortex-A9
95
96 Armada 38x Flavors:
97 88F6810 Armada 380
98 88F6820 Armada 385
99 88F6828 Armada 388
100 Product infos: http://www.marvell.com/embedded-processors/armada-38x/
101 Functional Spec: https://marvellcorp.wufoo.com/forms/marvell-armada-38x-functional-specifications/
102 Core: ARM Cortex-A9
103
104 Armada 39x Flavors:
105 88F6920 Armada 390
106 88F6928 Armada 398
107 Product infos: http://www.marvell.com/embedded-processors/armada-39x/
108 Core: ARM Cortex-A9
109
110 Armada XP Flavors:
111 MV78230
112 MV78260
113 MV78460
114 NOTE: not to be confused with the non-SMP 78xx0 SoCs
115 Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
116 Functional Spec: http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
117 Hardware Specs:
118 http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
119 http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
120 http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
121 Core: Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP
122
123 Linux kernel mach directory: arch/arm/mach-mvebu
124 Linux kernel plat directory: none
125
126EBU Armada family ARMv8
127-----------------------
128
129 Armada 3710/3720 Flavors:
130 88F3710
131 88F3720
132 Core: ARM Cortex A53 (ARMv8)
133
134 Homepage: http://www.marvell.com/embedded-processors/armada-3700/
135 Product Brief: http://www.marvell.com/embedded-processors/assets/PB-88F3700-FNL.pdf
136 Device tree files: arch/arm64/boot/dts/marvell/armada-37*
137
138 Armada 7K Flavors:
139 88F7020 (AP806 Dual + one CP110)
140 88F7040 (AP806 Quad + one CP110)
141 Core: ARM Cortex A72
142
143 Homepage: http://www.marvell.com/embedded-processors/armada-70xx/
144 Product Brief: http://www.marvell.com/embedded-processors/assets/Armada7020PB-Jan2016.pdf
145 http://www.marvell.com/embedded-processors/assets/Armada7040PB-Jan2016.pdf
146 Device tree files: arch/arm64/boot/dts/marvell/armada-70*
147
148 Armada 8K Flavors:
149 88F8020 (AP806 Dual + two CP110)
150 88F8040 (AP806 Quad + two CP110)
151 Core: ARM Cortex A72
152
153 Homepage: http://www.marvell.com/embedded-processors/armada-80xx/
154 Product Brief: http://www.marvell.com/embedded-processors/assets/Armada8020PB-Jan2016.pdf
155 http://www.marvell.com/embedded-processors/assets/Armada8040PB-Jan2016.pdf
156 Device tree files: arch/arm64/boot/dts/marvell/armada-80*
157
158Avanta family
159-------------
160
161 Flavors:
162 88F6510
163 88F6530P
164 88F6550
165 88F6560
166 Homepage : http://www.marvell.com/broadband/
167 Product Brief: http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
168 No public datasheet available.
169
170 Core: ARMv5 compatible
171
172 Linux kernel mach directory: no code in mainline yet, planned for the future
173 Linux kernel plat directory: no code in mainline yet, planned for the future
174
175Storage family
176--------------
177
178 Armada SP:
179 88RC1580
180 Product infos: http://www.marvell.com/storage/armada-sp/
181 Core: Sheeva ARMv7 comatible Quad-core PJ4C
182 (not supported in upstream Linux kernel)
183
184Dove family (application processor)
185-----------------------------------
186
187 Flavors:
188 88AP510 a.k.a Armada 510
189 Product Brief : http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
190 Hardware Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
191 Functional Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
192 Homepage: http://www.marvell.com/application-processors/armada-500/
193 Core: ARMv7 compatible
194
195 Directory: arch/arm/mach-mvebu (DT enabled platforms)
196 arch/arm/mach-dove (non-DT enabled platforms)
197
198PXA 2xx/3xx/93x/95x family
199--------------------------
200
201 Flavors:
202 PXA21x, PXA25x, PXA26x
203 Application processor only
204 Core: ARMv5 XScale1 core
205 PXA270, PXA271, PXA272
206 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
207 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
208 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
209 Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
210 Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
211 Application processor only
212 Core: ARMv5 XScale2 core
213 PXA300, PXA310, PXA320
214 PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
215 PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
216 PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
217 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
218 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
219 Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
220 Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
221 Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
222 Application processor only
223 Core: ARMv5 XScale3 core
224 PXA930, PXA935
225 Application processor with Communication processor
226 Core: ARMv5 XScale3 core
227 PXA955
228 Application processor with Communication processor
229 Core: ARMv7 compatible Sheeva PJ4 core
230
231 Comments:
232
233 * This line of SoCs originates from the XScale family developed by
234 Intel and acquired by Marvell in ~2006. The PXA21x, PXA25x,
235 PXA26x, PXA27x, PXA3xx and PXA93x were developed by Intel, while
236 the later PXA95x were developed by Marvell.
237
238 * Due to their XScale origin, these SoCs have virtually nothing in
239 common with the other (Kirkwood, Dove, etc.) families of Marvell
240 SoCs, except with the MMP/MMP2 family of SoCs.
241
242 Linux kernel mach directory: arch/arm/mach-pxa
243 Linux kernel plat directory: arch/arm/plat-pxa
244
245MMP/MMP2/MMP3 family (communication processor)
246-----------------------------------------
247
248 Flavors:
249 PXA168, a.k.a Armada 168
250 Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp
251 Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
252 Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
253 Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
254 Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
255 Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
256 App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
257 Application processor only
258 Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
259 PXA910/PXA920
260 Homepage : http://www.marvell.com/communication-processors/pxa910/
261 Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf
262 Application processor with Communication processor
263 Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
264 PXA688, a.k.a. MMP2, a.k.a Armada 610
265 Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
266 Application processor only
267 Core: ARMv7 compatible Sheeva PJ4 88sv581x core
268 PXA2128, a.k.a. MMP3 (OLPC XO4, Linux support not upstream)
269 Product Brief : http://www.marvell.com/application-processors/armada/pxa2128/assets/Marvell-ARMADA-PXA2128-SoC-PB.pdf
270 Application processor only
271 Core: Dual-core ARMv7 compatible Sheeva PJ4C core
272 PXA960/PXA968/PXA978 (Linux support not upstream)
273 Application processor with Communication Processor
274 Core: ARMv7 compatible Sheeva PJ4 core
275 PXA986/PXA988 (Linux support not upstream)
276 Application processor with Communication Processor
277 Core: Dual-core ARMv7 compatible Sheeva PJ4B-MP core
278 PXA1088/PXA1920 (Linux support not upstream)
279 Application processor with Communication Processor
280 Core: quad-core ARMv7 Cortex-A7
281 PXA1908/PXA1928/PXA1936
282 Application processor with Communication Processor
283 Core: multi-core ARMv8 Cortex-A53
284
285 Comments:
286
287 * This line of SoCs originates from the XScale family developed by
288 Intel and acquired by Marvell in ~2006. All the processors of
289 this MMP/MMP2 family were developed by Marvell.
290
291 * Due to their XScale origin, these SoCs have virtually nothing in
292 common with the other (Kirkwood, Dove, etc.) families of Marvell
293 SoCs, except with the PXA family of SoCs listed above.
294
295 Linux kernel mach directory: arch/arm/mach-mmp
296 Linux kernel plat directory: arch/arm/plat-pxa
297
298Berlin family (Multimedia Solutions)
299-------------------------------------
300
301 Flavors:
302 88DE3010, Armada 1000 (no Linux support)
303 Core: Marvell PJ1 (ARMv5TE), Dual-core
304 Product Brief: http://www.marvell.com.cn/digital-entertainment/assets/armada_1000_pb.pdf
305 88DE3005, Armada 1500 Mini
306 Design name: BG2CD
307 Core: ARM Cortex-A9, PL310 L2CC
308 88DE3006, Armada 1500 Mini Plus
309 Design name: BG2CDP
310 Core: Dual Core ARM Cortex-A7
311 88DE3100, Armada 1500
312 Design name: BG2
313 Core: Marvell PJ4B-MP (ARMv7), Tauros3 L2CC
314 88DE3114, Armada 1500 Pro
315 Design name: BG2Q
316 Core: Quad Core ARM Cortex-A9, PL310 L2CC
317 88DE3214, Armada 1500 Pro 4K
318 Design name: BG3
319 Core: ARM Cortex-A15, CA15 integrated L2CC
320 88DE3218, ARMADA 1500 Ultra
321 Core: ARM Cortex-A53
322
323 Homepage: https://www.synaptics.com/products/multimedia-solutions
324 Directory: arch/arm/mach-berlin
325
326 Comments:
327
328 * This line of SoCs is based on Marvell Sheeva or ARM Cortex CPUs
329 with Synopsys DesignWare (IRQ, GPIO, Timers, ...) and PXA IP (SDHCI, USB, ETH, ...).
330
331 * The Berlin family was acquired by Synaptics from Marvell in 2017.
332
333CPU Cores
334---------
335
336The XScale cores were designed by Intel, and shipped by Marvell in the older
337PXA processors. Feroceon is a Marvell designed core that developed in-house,
338and that evolved into Sheeva. The XScale and Feroceon cores were phased out
339over time and replaced with Sheeva cores in later products, which subsequently
340got replaced with licensed ARM Cortex-A cores.
341
342 XScale 1
343 CPUID 0x69052xxx
344 ARMv5, iWMMXt
345 XScale 2
346 CPUID 0x69054xxx
347 ARMv5, iWMMXt
348 XScale 3
349 CPUID 0x69056xxx or 0x69056xxx
350 ARMv5, iWMMXt
351 Feroceon-1850 88fr331 "Mohawk"
352 CPUID 0x5615331x or 0x41xx926x
353 ARMv5TE, single issue
354 Feroceon-2850 88fr531-vd "Jolteon"
355 CPUID 0x5605531x or 0x41xx926x
356 ARMv5TE, VFP, dual-issue
357 Feroceon 88fr571-vd "Jolteon"
358 CPUID 0x5615571x
359 ARMv5TE, VFP, dual-issue
360 Feroceon 88fr131 "Mohawk-D"
361 CPUID 0x5625131x
362 ARMv5TE, single-issue in-order
363 Sheeva PJ1 88sv331 "Mohawk"
364 CPUID 0x561584xx
365 ARMv5, single-issue iWMMXt v2
366 Sheeva PJ4 88sv581x "Flareon"
367 CPUID 0x560f581x
368 ARMv7, idivt, optional iWMMXt v2
369 Sheeva PJ4B 88sv581x
370 CPUID 0x561f581x
371 ARMv7, idivt, optional iWMMXt v2
372 Sheeva PJ4B-MP / PJ4C
373 CPUID 0x562f584x
374 ARMv7, idivt/idiva, LPAE, optional iWMMXt v2 and/or NEON
375
376Long-term plans
377---------------
378
379 * Unify the mach-dove/, mach-mv78xx0/, mach-orion5x/ into the
380 mach-mvebu/ to support all SoCs from the Marvell EBU (Engineering
381 Business Unit) in a single mach-<foo> directory. The plat-orion/
382 would therefore disappear.
383
384 * Unify the mach-mmp/ and mach-pxa/ into the same mach-pxa
385 directory. The plat-pxa/ would therefore disappear.
386
387Credits
388-------
389
390 Maen Suleiman <maen@marvell.com>
391 Lior Amsalem <alior@marvell.com>
392 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
393 Andrew Lunn <andrew@lunn.ch>
394 Nicolas Pitre <nico@fluxnic.net>
395 Eric Miao <eric.y.miao@gmail.com>
diff --git a/Documentation/arm/Netwinder b/Documentation/arm/Netwinder
deleted file mode 100644
index f1b457fbd3de..000000000000
--- a/Documentation/arm/Netwinder
+++ /dev/null
@@ -1,78 +0,0 @@
1NetWinder specific documentation
2================================
3
4The NetWinder is a small low-power computer, primarily designed
5to run Linux. It is based around the StrongARM RISC processor,
6DC21285 PCI bridge, with PC-type hardware glued around it.
7
8Port usage
9==========
10
11Min - Max Description
12---------------------------
130x0000 - 0x000f DMA1
140x0020 - 0x0021 PIC1
150x0060 - 0x006f Keyboard
160x0070 - 0x007f RTC
170x0080 - 0x0087 DMA1
180x0088 - 0x008f DMA2
190x00a0 - 0x00a3 PIC2
200x00c0 - 0x00df DMA2
210x0180 - 0x0187 IRDA
220x01f0 - 0x01f6 ide0
230x0201 Game port
240x0203 RWA010 configuration read
250x0220 - ? SoundBlaster
260x0250 - ? WaveArtist
270x0279 RWA010 configuration index
280x02f8 - 0x02ff Serial ttyS1
290x0300 - 0x031f Ether10
300x0338 GPIO1
310x033a GPIO2
320x0370 - 0x0371 W83977F configuration registers
330x0388 - ? AdLib
340x03c0 - 0x03df VGA
350x03f6 ide0
360x03f8 - 0x03ff Serial ttyS0
370x0400 - 0x0408 DC21143
380x0480 - 0x0487 DMA1
390x0488 - 0x048f DMA2
400x0a79 RWA010 configuration write
410xe800 - 0xe80f ide0/ide1 BM DMA
42
43
44Interrupt usage
45===============
46
47IRQ type Description
48---------------------------
49 0 ISA 100Hz timer
50 1 ISA Keyboard
51 2 ISA cascade
52 3 ISA Serial ttyS1
53 4 ISA Serial ttyS0
54 5 ISA PS/2 mouse
55 6 ISA IRDA
56 7 ISA Printer
57 8 ISA RTC alarm
58 9 ISA
5910 ISA GP10 (Orange reset button)
6011 ISA
6112 ISA WaveArtist
6213 ISA
6314 ISA hda1
6415 ISA
65
66DMA usage
67=========
68
69DMA type Description
70---------------------------
71 0 ISA IRDA
72 1 ISA
73 2 ISA cascade
74 3 ISA WaveArtist
75 4 ISA
76 5 ISA
77 6 ISA
78 7 ISA WaveArtist
diff --git a/Documentation/arm/SA1100/FreeBird b/Documentation/arm/SA1100/FreeBird
deleted file mode 100644
index ab9193663b2b..000000000000
--- a/Documentation/arm/SA1100/FreeBird
+++ /dev/null
@@ -1,21 +0,0 @@
1Freebird-1.1 is produced by Legend(C), Inc.
2http://web.archive.org/web/*/http://www.legend.com.cn
3and software/linux maintained by Coventive(C), Inc.
4(http://www.coventive.com)
5
6Based on the Nicolas's strongarm kernel tree.
7
8===============================================================
9Maintainer:
10
11Chester Kuo <chester@coventive.com>
12 <chester@linux.org.tw>
13
14Author :
15Tim wu <timwu@coventive.com>
16CIH <cih@coventive.com>
17Eric Peng <ericpeng@coventive.com>
18Jeff Lee <jeff_lee@coventive.com>
19Allen Cheng
20Tony Liu <tonyliu@coventive.com>
21
diff --git a/Documentation/arm/SA1100/empeg b/Documentation/arm/SA1100/empeg
deleted file mode 100644
index 4ece4849a42c..000000000000
--- a/Documentation/arm/SA1100/empeg
+++ /dev/null
@@ -1,2 +0,0 @@
1See ../empeg/README
2
diff --git a/Documentation/arm/SA1100/serial_UART b/Documentation/arm/SA1100/serial_UART
deleted file mode 100644
index a63966f1d083..000000000000
--- a/Documentation/arm/SA1100/serial_UART
+++ /dev/null
@@ -1,47 +0,0 @@
1The SA1100 serial port had its major/minor numbers officially assigned:
2
3> Date: Sun, 24 Sep 2000 21:40:27 -0700
4> From: H. Peter Anvin <hpa@transmeta.com>
5> To: Nicolas Pitre <nico@CAM.ORG>
6> Cc: Device List Maintainer <device@lanana.org>
7> Subject: Re: device
8>
9> Okay. Note that device numbers 204 and 205 are used for "low density
10> serial devices", so you will have a range of minors on those majors (the
11> tty device layer handles this just fine, so you don't have to worry about
12> doing anything special.)
13>
14> So your assignments are:
15>
16> 204 char Low-density serial ports
17> 5 = /dev/ttySA0 SA1100 builtin serial port 0
18> 6 = /dev/ttySA1 SA1100 builtin serial port 1
19> 7 = /dev/ttySA2 SA1100 builtin serial port 2
20>
21> 205 char Low-density serial ports (alternate device)
22> 5 = /dev/cusa0 Callout device for ttySA0
23> 6 = /dev/cusa1 Callout device for ttySA1
24> 7 = /dev/cusa2 Callout device for ttySA2
25>
26
27You must create those inodes in /dev on the root filesystem used
28by your SA1100-based device:
29
30 mknod ttySA0 c 204 5
31 mknod ttySA1 c 204 6
32 mknod ttySA2 c 204 7
33 mknod cusa0 c 205 5
34 mknod cusa1 c 205 6
35 mknod cusa2 c 205 7
36
37In addition to the creation of the appropriate device nodes above, you
38must ensure your user space applications make use of the correct device
39name. The classic example is the content of the /etc/inittab file where
40you might have a getty process started on ttyS0. In this case:
41
42- replace occurrences of ttyS0 with ttySA0, ttyS1 with ttySA1, etc.
43
44- don't forget to add 'ttySA0', 'console', or the appropriate tty name
45 in /etc/securetty for root to be allowed to login as well.
46
47
diff --git a/Documentation/arm/README b/Documentation/arm/arm.rst
index 9d1e5b2c92e6..2edc509df92a 100644
--- a/Documentation/arm/README
+++ b/Documentation/arm/arm.rst
@@ -1,5 +1,6 @@
1 ARM Linux 2.6 1=======================
2 ============= 2ARM Linux 2.6 and upper
3=======================
3 4
4 Please check <ftp://ftp.arm.linux.org.uk/pub/armlinux> for 5 Please check <ftp://ftp.arm.linux.org.uk/pub/armlinux> for
5 updates. 6 updates.
@@ -18,22 +19,28 @@ Compilation of kernel
18 line as detailed below. 19 line as detailed below.
19 20
20 If you wish to cross-compile, then alter the following lines in the top 21 If you wish to cross-compile, then alter the following lines in the top
21 level make file: 22 level make file::
22 23
23 ARCH = <whatever> 24 ARCH = <whatever>
24 with 25
26 with::
27
25 ARCH = arm 28 ARCH = arm
26 29
27 and 30 and::
28 31
29 CROSS_COMPILE= 32 CROSS_COMPILE=
30 to 33
34 to::
35
31 CROSS_COMPILE=<your-path-to-your-compiler-without-gcc> 36 CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>
32 eg. 37
38 eg.::
39
33 CROSS_COMPILE=arm-linux- 40 CROSS_COMPILE=arm-linux-
34 41
35 Do a 'make config', followed by 'make Image' to build the kernel 42 Do a 'make config', followed by 'make Image' to build the kernel
36 (arch/arm/boot/Image). A compressed image can be built by doing a 43 (arch/arm/boot/Image). A compressed image can be built by doing a
37 'make zImage' instead of 'make Image'. 44 'make zImage' instead of 'make Image'.
38 45
39 46
@@ -46,7 +53,7 @@ Bug reports etc
46 53
47 Bug reports should be sent to linux-arm-kernel@lists.arm.linux.org.uk, 54 Bug reports should be sent to linux-arm-kernel@lists.arm.linux.org.uk,
48 or submitted through the web form at 55 or submitted through the web form at
49 http://www.arm.linux.org.uk/developer/ 56 http://www.arm.linux.org.uk/developer/
50 57
51 When sending bug reports, please ensure that they contain all relevant 58 When sending bug reports, please ensure that they contain all relevant
52 information, eg. the kernel messages that were printed before/during 59 information, eg. the kernel messages that were printed before/during
@@ -60,11 +67,13 @@ Include files
60 which are there to reduce the clutter in the top-level directory. These 67 which are there to reduce the clutter in the top-level directory. These
61 directories, and their purpose is listed below: 68 directories, and their purpose is listed below:
62 69
63 arch-* machine/platform specific header files 70 ============= ==========================================================
64 hardware driver-internal ARM specific data structures/definitions 71 `arch-*` machine/platform specific header files
65 mach descriptions of generic ARM to specific machine interfaces 72 `hardware` driver-internal ARM specific data structures/definitions
66 proc-* processor dependent header files (currently only two 73 `mach` descriptions of generic ARM to specific machine interfaces
74 `proc-*` processor dependent header files (currently only two
67 categories) 75 categories)
76 ============= ==========================================================
68 77
69 78
70Machine/Platform support 79Machine/Platform support
@@ -129,7 +138,7 @@ ST506 hard drives
129 HDC base to the source. 138 HDC base to the source.
130 139
131 As of 31/3/96 it works with two drives (you should get the ADFS 140 As of 31/3/96 it works with two drives (you should get the ADFS
132 *configure harddrive set to 2). I've got an internal 20MB and a great 141 `*configure` harddrive set to 2). I've got an internal 20MB and a great
133 big external 5.25" FH 64MB drive (who could ever want more :-) ). 142 big external 5.25" FH 64MB drive (who could ever want more :-) ).
134 143
135 I've just got 240K/s off it (a dd with bs=128k); thats about half of what 144 I've just got 240K/s off it (a dd with bs=128k); thats about half of what
@@ -149,13 +158,13 @@ ST506 hard drives
149 are welcome. 158 are welcome.
150 159
151 160
152CONFIG_MACH_ and CONFIG_ARCH_ 161`CONFIG_MACH_` and `CONFIG_ARCH_`
153----------------------------- 162---------------------------------
154 A change was made in 2003 to the macro names for new machines. 163 A change was made in 2003 to the macro names for new machines.
155 Historically, CONFIG_ARCH_ was used for the bonafide architecture, 164 Historically, `CONFIG_ARCH_` was used for the bonafide architecture,
156 e.g. SA1100, as well as implementations of the architecture, 165 e.g. SA1100, as well as implementations of the architecture,
157 e.g. Assabet. It was decided to change the implementation macros 166 e.g. Assabet. It was decided to change the implementation macros
158 to read CONFIG_MACH_ for clarity. Moreover, a retroactive fixup has 167 to read `CONFIG_MACH_` for clarity. Moreover, a retroactive fixup has
159 not been made because it would complicate patching. 168 not been made because it would complicate patching.
160 169
161 Previous registrations may be found online. 170 Previous registrations may be found online.
@@ -163,7 +172,7 @@ CONFIG_MACH_ and CONFIG_ARCH_
163 <http://www.arm.linux.org.uk/developer/machines/> 172 <http://www.arm.linux.org.uk/developer/machines/>
164 173
165Kernel entry (head.S) 174Kernel entry (head.S)
166-------------------------- 175---------------------
167 The initial entry into the kernel is via head.S, which uses machine 176 The initial entry into the kernel is via head.S, which uses machine
168 independent code. The machine is selected by the value of 'r1' on 177 independent code. The machine is selected by the value of 'r1' on
169 entry, which must be kept unique. 178 entry, which must be kept unique.
@@ -201,4 +210,5 @@ Kernel entry (head.S)
201 platform is DT-only, you do not need a registered machine type. 210 platform is DT-only, you do not need a registered machine type.
202 211
203--- 212---
213
204Russell King (15/03/2004) 214Russell King (15/03/2004)
diff --git a/Documentation/arm/Booting b/Documentation/arm/booting.rst
index f1f965ce93d6..4babb6c6ae1e 100644
--- a/Documentation/arm/Booting
+++ b/Documentation/arm/booting.rst
@@ -1,7 +1,9 @@
1 Booting ARM Linux 1=================
2 ================= 2Booting ARM Linux
3=================
3 4
4Author: Russell King 5Author: Russell King
6
5Date : 18 May 2002 7Date : 18 May 2002
6 8
7The following documentation is relevant to 2.4.18-rmk6 and beyond. 9The following documentation is relevant to 2.4.18-rmk6 and beyond.
@@ -25,8 +27,10 @@ following:
251. Setup and initialise RAM 271. Setup and initialise RAM
26--------------------------- 28---------------------------
27 29
28Existing boot loaders: MANDATORY 30Existing boot loaders:
29New boot loaders: MANDATORY 31 MANDATORY
32New boot loaders:
33 MANDATORY
30 34
31The boot loader is expected to find and initialise all RAM that the 35The boot loader is expected to find and initialise all RAM that the
32kernel will use for volatile data storage in the system. It performs 36kernel will use for volatile data storage in the system. It performs
@@ -39,8 +43,10 @@ sees fit.)
392. Initialise one serial port 432. Initialise one serial port
40----------------------------- 44-----------------------------
41 45
42Existing boot loaders: OPTIONAL, RECOMMENDED 46Existing boot loaders:
43New boot loaders: OPTIONAL, RECOMMENDED 47 OPTIONAL, RECOMMENDED
48New boot loaders:
49 OPTIONAL, RECOMMENDED
44 50
45The boot loader should initialise and enable one serial port on the 51The boot loader should initialise and enable one serial port on the
46target. This allows the kernel serial driver to automatically detect 52target. This allows the kernel serial driver to automatically detect
@@ -57,8 +63,10 @@ serial format options as described in
573. Detect the machine type 633. Detect the machine type
58-------------------------- 64--------------------------
59 65
60Existing boot loaders: OPTIONAL 66Existing boot loaders:
61New boot loaders: MANDATORY except for DT-only platforms 67 OPTIONAL
68New boot loaders:
69 MANDATORY except for DT-only platforms
62 70
63The boot loader should detect the machine type its running on by some 71The boot loader should detect the machine type its running on by some
64method. Whether this is a hard coded value or some algorithm that 72method. Whether this is a hard coded value or some algorithm that
@@ -74,8 +82,10 @@ necessary, but assures that it will not match any existing types.
744. Setup boot data 824. Setup boot data
75------------------ 83------------------
76 84
77Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED 85Existing boot loaders:
78New boot loaders: MANDATORY 86 OPTIONAL, HIGHLY RECOMMENDED
87New boot loaders:
88 MANDATORY
79 89
80The boot loader must provide either a tagged list or a dtb image for 90The boot loader must provide either a tagged list or a dtb image for
81passing configuration data to the kernel. The physical address of the 91passing configuration data to the kernel. The physical address of the
@@ -97,15 +107,15 @@ entirety; some tags behave as the former, others the latter.
97 107
98The boot loader must pass at a minimum the size and location of 108The boot loader must pass at a minimum the size and location of
99the system memory, and root filesystem location. Therefore, the 109the system memory, and root filesystem location. Therefore, the
100minimum tagged list should look: 110minimum tagged list should look::
101 111
102 +-----------+ 112 +-----------+
103base -> | ATAG_CORE | | 113 base -> | ATAG_CORE | |
104 +-----------+ | 114 +-----------+ |
105 | ATAG_MEM | | increasing address 115 | ATAG_MEM | | increasing address
106 +-----------+ | 116 +-----------+ |
107 | ATAG_NONE | | 117 | ATAG_NONE | |
108 +-----------+ v 118 +-----------+ v
109 119
110The tagged list should be stored in system RAM. 120The tagged list should be stored in system RAM.
111 121
@@ -134,8 +144,10 @@ A safe location is just above the 128MiB boundary from start of RAM.
1345. Load initramfs. 1445. Load initramfs.
135------------------ 145------------------
136 146
137Existing boot loaders: OPTIONAL 147Existing boot loaders:
138New boot loaders: OPTIONAL 148 OPTIONAL
149New boot loaders:
150 OPTIONAL
139 151
140If an initramfs is in use then, as with the dtb, it must be placed in 152If an initramfs is in use then, as with the dtb, it must be placed in
141a region of memory where the kernel decompressor will not overwrite it 153a region of memory where the kernel decompressor will not overwrite it
@@ -149,8 +161,10 @@ recommended above.
1496. Calling the kernel image 1616. Calling the kernel image
150--------------------------- 162---------------------------
151 163
152Existing boot loaders: MANDATORY 164Existing boot loaders:
153New boot loaders: MANDATORY 165 MANDATORY
166New boot loaders:
167 MANDATORY
154 168
155There are two options for calling the kernel zImage. If the zImage 169There are two options for calling the kernel zImage. If the zImage
156is stored in flash, and is linked correctly to be run from flash, 170is stored in flash, and is linked correctly to be run from flash,
@@ -174,12 +188,14 @@ In any case, the following conditions must be met:
174 you many hours of debug. 188 you many hours of debug.
175 189
176- CPU register settings 190- CPU register settings
177 r0 = 0, 191
178 r1 = machine type number discovered in (3) above. 192 - r0 = 0,
179 r2 = physical address of tagged list in system RAM, or 193 - r1 = machine type number discovered in (3) above.
180 physical address of device tree block (dtb) in system RAM 194 - r2 = physical address of tagged list in system RAM, or
195 physical address of device tree block (dtb) in system RAM
181 196
182- CPU mode 197- CPU mode
198
183 All forms of interrupts must be disabled (IRQs and FIQs) 199 All forms of interrupts must be disabled (IRQs and FIQs)
184 200
185 For CPUs which do not include the ARM virtualization extensions, the 201 For CPUs which do not include the ARM virtualization extensions, the
@@ -195,8 +211,11 @@ In any case, the following conditions must be met:
195 entered in SVC mode. 211 entered in SVC mode.
196 212
197- Caches, MMUs 213- Caches, MMUs
214
198 The MMU must be off. 215 The MMU must be off.
216
199 Instruction cache may be on or off. 217 Instruction cache may be on or off.
218
200 Data cache must be off. 219 Data cache must be off.
201 220
202 If the kernel is entered in HYP mode, the above requirements apply to 221 If the kernel is entered in HYP mode, the above requirements apply to
diff --git a/Documentation/arm/cluster-pm-race-avoidance.txt b/Documentation/arm/cluster-pm-race-avoidance.rst
index 750b6fc24af9..aa58603d3f28 100644
--- a/Documentation/arm/cluster-pm-race-avoidance.txt
+++ b/Documentation/arm/cluster-pm-race-avoidance.rst
@@ -1,3 +1,4 @@
1=========================================================
1Cluster-wide Power-up/power-down race avoidance algorithm 2Cluster-wide Power-up/power-down race avoidance algorithm
2========================================================= 3=========================================================
3 4
@@ -46,10 +47,12 @@ Basic model
46 47
47Each cluster and CPU is assigned a state, as follows: 48Each cluster and CPU is assigned a state, as follows:
48 49
49 DOWN 50 - DOWN
50 COMING_UP 51 - COMING_UP
51 UP 52 - UP
52 GOING_DOWN 53 - GOING_DOWN
54
55::
53 56
54 +---------> UP ----------+ 57 +---------> UP ----------+
55 | v 58 | v
@@ -60,18 +63,22 @@ Each cluster and CPU is assigned a state, as follows:
60 +--------- DOWN <--------+ 63 +--------- DOWN <--------+
61 64
62 65
63DOWN: The CPU or cluster is not coherent, and is either powered off or 66DOWN:
67 The CPU or cluster is not coherent, and is either powered off or
64 suspended, or is ready to be powered off or suspended. 68 suspended, or is ready to be powered off or suspended.
65 69
66COMING_UP: The CPU or cluster has committed to moving to the UP state. 70COMING_UP:
71 The CPU or cluster has committed to moving to the UP state.
67 It may be part way through the process of initialisation and 72 It may be part way through the process of initialisation and
68 enabling coherency. 73 enabling coherency.
69 74
70UP: The CPU or cluster is active and coherent at the hardware 75UP:
76 The CPU or cluster is active and coherent at the hardware
71 level. A CPU in this state is not necessarily being used 77 level. A CPU in this state is not necessarily being used
72 actively by the kernel. 78 actively by the kernel.
73 79
74GOING_DOWN: The CPU or cluster has committed to moving to the DOWN 80GOING_DOWN:
81 The CPU or cluster has committed to moving to the DOWN
75 state. It may be part way through the process of teardown and 82 state. It may be part way through the process of teardown and
76 coherency exit. 83 coherency exit.
77 84
@@ -86,8 +93,8 @@ CPUs in the cluster simultaneously modifying the state. The cluster-
86level states are described in the "Cluster state" section. 93level states are described in the "Cluster state" section.
87 94
88To help distinguish the CPU states from cluster states in this 95To help distinguish the CPU states from cluster states in this
89discussion, the state names are given a CPU_ prefix for the CPU states, 96discussion, the state names are given a `CPU_` prefix for the CPU states,
90and a CLUSTER_ or INBOUND_ prefix for the cluster states. 97and a `CLUSTER_` or `INBOUND_` prefix for the cluster states.
91 98
92 99
93CPU state 100CPU state
@@ -101,10 +108,12 @@ This means that CPUs fit the basic model closely.
101 108
102The algorithm defines the following states for each CPU in the system: 109The algorithm defines the following states for each CPU in the system:
103 110
104 CPU_DOWN 111 - CPU_DOWN
105 CPU_COMING_UP 112 - CPU_COMING_UP
106 CPU_UP 113 - CPU_UP
107 CPU_GOING_DOWN 114 - CPU_GOING_DOWN
115
116::
108 117
109 cluster setup and 118 cluster setup and
110 CPU setup complete policy decision 119 CPU setup complete policy decision
@@ -130,17 +139,17 @@ requirement for any external event to happen.
130 139
131 140
132CPU_DOWN: 141CPU_DOWN:
133
134 A CPU reaches the CPU_DOWN state when it is ready for 142 A CPU reaches the CPU_DOWN state when it is ready for
135 power-down. On reaching this state, the CPU will typically 143 power-down. On reaching this state, the CPU will typically
136 power itself down or suspend itself, via a WFI instruction or a 144 power itself down or suspend itself, via a WFI instruction or a
137 firmware call. 145 firmware call.
138 146
139 Next state: CPU_COMING_UP 147 Next state:
140 Conditions: none 148 CPU_COMING_UP
149 Conditions:
150 none
141 151
142 Trigger events: 152 Trigger events:
143
144 a) an explicit hardware power-up operation, resulting 153 a) an explicit hardware power-up operation, resulting
145 from a policy decision on another CPU; 154 from a policy decision on another CPU;
146 155
@@ -148,15 +157,17 @@ CPU_DOWN:
148 157
149 158
150CPU_COMING_UP: 159CPU_COMING_UP:
151
152 A CPU cannot start participating in hardware coherency until the 160 A CPU cannot start participating in hardware coherency until the
153 cluster is set up and coherent. If the cluster is not ready, 161 cluster is set up and coherent. If the cluster is not ready,
154 then the CPU will wait in the CPU_COMING_UP state until the 162 then the CPU will wait in the CPU_COMING_UP state until the
155 cluster has been set up. 163 cluster has been set up.
156 164
157 Next state: CPU_UP 165 Next state:
158 Conditions: The CPU's parent cluster must be in CLUSTER_UP. 166 CPU_UP
159 Trigger events: Transition of the parent cluster to CLUSTER_UP. 167 Conditions:
168 The CPU's parent cluster must be in CLUSTER_UP.
169 Trigger events:
170 Transition of the parent cluster to CLUSTER_UP.
160 171
161 Refer to the "Cluster state" section for a description of the 172 Refer to the "Cluster state" section for a description of the
162 CLUSTER_UP state. 173 CLUSTER_UP state.
@@ -178,20 +189,25 @@ CPU_UP:
178 The CPU remains in this state until an explicit policy decision 189 The CPU remains in this state until an explicit policy decision
179 is made to shut down or suspend the CPU. 190 is made to shut down or suspend the CPU.
180 191
181 Next state: CPU_GOING_DOWN 192 Next state:
182 Conditions: none 193 CPU_GOING_DOWN
183 Trigger events: explicit policy decision 194 Conditions:
195 none
196 Trigger events:
197 explicit policy decision
184 198
185 199
186CPU_GOING_DOWN: 200CPU_GOING_DOWN:
187
188 While in this state, the CPU exits coherency, including any 201 While in this state, the CPU exits coherency, including any
189 operations required to achieve this (such as cleaning data 202 operations required to achieve this (such as cleaning data
190 caches). 203 caches).
191 204
192 Next state: CPU_DOWN 205 Next state:
193 Conditions: local CPU teardown complete 206 CPU_DOWN
194 Trigger events: (spontaneous) 207 Conditions:
208 local CPU teardown complete
209 Trigger events:
210 (spontaneous)
195 211
196 212
197Cluster state 213Cluster state
@@ -212,20 +228,20 @@ independently of the CPU which is tearing down the cluster. For this
212reason, the cluster state is split into two parts: 228reason, the cluster state is split into two parts:
213 229
214 "cluster" state: The global state of the cluster; or the state 230 "cluster" state: The global state of the cluster; or the state
215 on the outbound side: 231 on the outbound side:
216 232
217 CLUSTER_DOWN 233 - CLUSTER_DOWN
218 CLUSTER_UP 234 - CLUSTER_UP
219 CLUSTER_GOING_DOWN 235 - CLUSTER_GOING_DOWN
220 236
221 "inbound" state: The state of the cluster on the inbound side. 237 "inbound" state: The state of the cluster on the inbound side.
222 238
223 INBOUND_NOT_COMING_UP 239 - INBOUND_NOT_COMING_UP
224 INBOUND_COMING_UP 240 - INBOUND_COMING_UP
225 241
226 242
227 The different pairings of these states results in six possible 243 The different pairings of these states results in six possible
228 states for the cluster as a whole: 244 states for the cluster as a whole::
229 245
230 CLUSTER_UP 246 CLUSTER_UP
231 +==========> INBOUND_NOT_COMING_UP -------------+ 247 +==========> INBOUND_NOT_COMING_UP -------------+
@@ -284,11 +300,12 @@ reason, the cluster state is split into two parts:
284 300
285 301
286CLUSTER_DOWN/INBOUND_NOT_COMING_UP: 302CLUSTER_DOWN/INBOUND_NOT_COMING_UP:
303 Next state:
304 CLUSTER_DOWN/INBOUND_COMING_UP (inbound)
305 Conditions:
306 none
287 307
288 Next state: CLUSTER_DOWN/INBOUND_COMING_UP (inbound)
289 Conditions: none
290 Trigger events: 308 Trigger events:
291
292 a) an explicit hardware power-up operation, resulting 309 a) an explicit hardware power-up operation, resulting
293 from a policy decision on another CPU; 310 from a policy decision on another CPU;
294 311
@@ -306,9 +323,12 @@ CLUSTER_DOWN/INBOUND_COMING_UP:
306 setup to enable other CPUs in the cluster to enter coherency 323 setup to enable other CPUs in the cluster to enter coherency
307 safely. 324 safely.
308 325
309 Next state: CLUSTER_UP/INBOUND_COMING_UP (inbound) 326 Next state:
310 Conditions: cluster-level setup and hardware coherency complete 327 CLUSTER_UP/INBOUND_COMING_UP (inbound)
311 Trigger events: (spontaneous) 328 Conditions:
329 cluster-level setup and hardware coherency complete
330 Trigger events:
331 (spontaneous)
312 332
313 333
314CLUSTER_UP/INBOUND_COMING_UP: 334CLUSTER_UP/INBOUND_COMING_UP:
@@ -321,9 +341,12 @@ CLUSTER_UP/INBOUND_COMING_UP:
321 CLUSTER_UP/INBOUND_NOT_COMING_UP. All other CPUs on the cluster 341 CLUSTER_UP/INBOUND_NOT_COMING_UP. All other CPUs on the cluster
322 should consider treat these two states as equivalent. 342 should consider treat these two states as equivalent.
323 343
324 Next state: CLUSTER_UP/INBOUND_NOT_COMING_UP (inbound) 344 Next state:
325 Conditions: none 345 CLUSTER_UP/INBOUND_NOT_COMING_UP (inbound)
326 Trigger events: (spontaneous) 346 Conditions:
347 none
348 Trigger events:
349 (spontaneous)
327 350
328 351
329CLUSTER_UP/INBOUND_NOT_COMING_UP: 352CLUSTER_UP/INBOUND_NOT_COMING_UP:
@@ -335,9 +358,12 @@ CLUSTER_UP/INBOUND_NOT_COMING_UP:
335 The cluster will remain in this state until a policy decision is 358 The cluster will remain in this state until a policy decision is
336 made to power the cluster down. 359 made to power the cluster down.
337 360
338 Next state: CLUSTER_GOING_DOWN/INBOUND_NOT_COMING_UP (outbound) 361 Next state:
339 Conditions: none 362 CLUSTER_GOING_DOWN/INBOUND_NOT_COMING_UP (outbound)
340 Trigger events: policy decision to power down the cluster 363 Conditions:
364 none
365 Trigger events:
366 policy decision to power down the cluster
341 367
342 368
343CLUSTER_GOING_DOWN/INBOUND_NOT_COMING_UP: 369CLUSTER_GOING_DOWN/INBOUND_NOT_COMING_UP:
@@ -359,13 +385,16 @@ CLUSTER_GOING_DOWN/INBOUND_NOT_COMING_UP:
359 Next states: 385 Next states:
360 386
361 CLUSTER_DOWN/INBOUND_NOT_COMING_UP (outbound) 387 CLUSTER_DOWN/INBOUND_NOT_COMING_UP (outbound)
362 Conditions: cluster torn down and ready to power off 388 Conditions:
363 Trigger events: (spontaneous) 389 cluster torn down and ready to power off
390 Trigger events:
391 (spontaneous)
364 392
365 CLUSTER_GOING_DOWN/INBOUND_COMING_UP (inbound) 393 CLUSTER_GOING_DOWN/INBOUND_COMING_UP (inbound)
366 Conditions: none 394 Conditions:
367 Trigger events: 395 none
368 396
397 Trigger events:
369 a) an explicit hardware power-up operation, 398 a) an explicit hardware power-up operation,
370 resulting from a policy decision on another 399 resulting from a policy decision on another
371 CPU; 400 CPU;
@@ -396,13 +425,19 @@ CLUSTER_GOING_DOWN/INBOUND_COMING_UP:
396 Next states: 425 Next states:
397 426
398 CLUSTER_UP/INBOUND_COMING_UP (outbound) 427 CLUSTER_UP/INBOUND_COMING_UP (outbound)
399 Conditions: cluster-level setup and hardware 428 Conditions:
429 cluster-level setup and hardware
400 coherency complete 430 coherency complete
401 Trigger events: (spontaneous) 431
432 Trigger events:
433 (spontaneous)
402 434
403 CLUSTER_DOWN/INBOUND_COMING_UP (outbound) 435 CLUSTER_DOWN/INBOUND_COMING_UP (outbound)
404 Conditions: cluster torn down and ready to power off 436 Conditions:
405 Trigger events: (spontaneous) 437 cluster torn down and ready to power off
438
439 Trigger events:
440 (spontaneous)
406 441
407 442
408Last man and First man selection 443Last man and First man selection
@@ -452,30 +487,30 @@ Implementation:
452 arch/arm/common/mcpm_entry.c (everything else): 487 arch/arm/common/mcpm_entry.c (everything else):
453 488
454 __mcpm_cpu_going_down() signals the transition of a CPU to the 489 __mcpm_cpu_going_down() signals the transition of a CPU to the
455 CPU_GOING_DOWN state. 490 CPU_GOING_DOWN state.
456 491
457 __mcpm_cpu_down() signals the transition of a CPU to the CPU_DOWN 492 __mcpm_cpu_down() signals the transition of a CPU to the CPU_DOWN
458 state. 493 state.
459 494
460 A CPU transitions to CPU_COMING_UP and then to CPU_UP via the 495 A CPU transitions to CPU_COMING_UP and then to CPU_UP via the
461 low-level power-up code in mcpm_head.S. This could 496 low-level power-up code in mcpm_head.S. This could
462 involve CPU-specific setup code, but in the current 497 involve CPU-specific setup code, but in the current
463 implementation it does not. 498 implementation it does not.
464 499
465 __mcpm_outbound_enter_critical() and __mcpm_outbound_leave_critical() 500 __mcpm_outbound_enter_critical() and __mcpm_outbound_leave_critical()
466 handle transitions from CLUSTER_UP to CLUSTER_GOING_DOWN 501 handle transitions from CLUSTER_UP to CLUSTER_GOING_DOWN
467 and from there to CLUSTER_DOWN or back to CLUSTER_UP (in 502 and from there to CLUSTER_DOWN or back to CLUSTER_UP (in
468 the case of an aborted cluster power-down). 503 the case of an aborted cluster power-down).
469 504
470 These functions are more complex than the __mcpm_cpu_*() 505 These functions are more complex than the __mcpm_cpu_*()
471 functions due to the extra inter-CPU coordination which 506 functions due to the extra inter-CPU coordination which
472 is needed for safe transitions at the cluster level. 507 is needed for safe transitions at the cluster level.
473 508
474 A cluster transitions from CLUSTER_DOWN back to CLUSTER_UP via 509 A cluster transitions from CLUSTER_DOWN back to CLUSTER_UP via
475 the low-level power-up code in mcpm_head.S. This 510 the low-level power-up code in mcpm_head.S. This
476 typically involves platform-specific setup code, 511 typically involves platform-specific setup code,
477 provided by the platform-specific power_up_setup 512 provided by the platform-specific power_up_setup
478 function registered via mcpm_sync_init. 513 function registered via mcpm_sync_init.
479 514
480Deep topologies: 515Deep topologies:
481 516
diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.rst
index 7f175dbb427e..efd844baec1d 100644
--- a/Documentation/arm/firmware.txt
+++ b/Documentation/arm/firmware.rst
@@ -1,5 +1,7 @@
1Interface for registering and calling firmware-specific operations for ARM. 1==========================================================================
2---- 2Interface for registering and calling firmware-specific operations for ARM
3==========================================================================
4
3Written by Tomasz Figa <t.figa@samsung.com> 5Written by Tomasz Figa <t.figa@samsung.com>
4 6
5Some boards are running with secure firmware running in TrustZone secure 7Some boards are running with secure firmware running in TrustZone secure
@@ -9,7 +11,7 @@ operations and call them when needed.
9 11
10Firmware operations can be specified by filling in a struct firmware_ops 12Firmware operations can be specified by filling in a struct firmware_ops
11with appropriate callbacks and then registering it with register_firmware_ops() 13with appropriate callbacks and then registering it with register_firmware_ops()
12function. 14function::
13 15
14 void register_firmware_ops(const struct firmware_ops *ops) 16 void register_firmware_ops(const struct firmware_ops *ops)
15 17
@@ -19,7 +21,7 @@ and its members can be found in arch/arm/include/asm/firmware.h header.
19There is a default, empty set of operations provided, so there is no need to 21There is a default, empty set of operations provided, so there is no need to
20set anything if platform does not require firmware operations. 22set anything if platform does not require firmware operations.
21 23
22To call a firmware operation, a helper macro is provided 24To call a firmware operation, a helper macro is provided::
23 25
24 #define call_firmware_op(op, ...) \ 26 #define call_firmware_op(op, ...) \
25 ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS)) 27 ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
@@ -28,7 +30,7 @@ the macro checks if the operation is provided and calls it or otherwise returns
28-ENOSYS to signal that given operation is not available (for example, to allow 30-ENOSYS to signal that given operation is not available (for example, to allow
29fallback to legacy operation). 31fallback to legacy operation).
30 32
31Example of registering firmware operations: 33Example of registering firmware operations::
32 34
33 /* board file */ 35 /* board file */
34 36
@@ -56,7 +58,7 @@ Example of registering firmware operations:
56 register_firmware_ops(&platformX_firmware_ops); 58 register_firmware_ops(&platformX_firmware_ops);
57 } 59 }
58 60
59Example of using a firmware operation: 61Example of using a firmware operation::
60 62
61 /* some platform code, e.g. SMP initialization */ 63 /* some platform code, e.g. SMP initialization */
62 64
diff --git a/Documentation/arm/index.rst b/Documentation/arm/index.rst
new file mode 100644
index 000000000000..5fc072dd0c5e
--- /dev/null
+++ b/Documentation/arm/index.rst
@@ -0,0 +1,80 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3================
4ARM Architecture
5================
6
7.. toctree::
8 :maxdepth: 1
9
10 arm
11 booting
12 cluster-pm-race-avoidance
13 firmware
14 interrupts
15 kernel_mode_neon
16 kernel_user_helpers
17 memory
18 mem_alignment
19 tcm
20 setup
21 swp_emulation
22 uefi
23 vlocks
24 porting
25
26SoC-specific documents
27======================
28
29.. toctree::
30 :maxdepth: 1
31
32 ixp4xx
33
34 marvel
35 microchip
36
37 netwinder
38 nwfpe/index
39
40 keystone/overview
41 keystone/knav-qmss
42
43 omap/index
44
45 pxa/mfp
46
47
48 sa1100/index
49
50 stm32/stm32f746-overview
51 stm32/overview
52 stm32/stm32h743-overview
53 stm32/stm32f769-overview
54 stm32/stm32f429-overview
55 stm32/stm32mp157-overview
56
57 sunxi
58
59 samsung/index
60 samsung-s3c24xx/index
61
62 sunxi/clocks
63
64 spear/overview
65
66 sti/stih416-overview
67 sti/stih407-overview
68 sti/stih418-overview
69 sti/overview
70 sti/stih415-overview
71
72 vfp/release-notes
73
74
75.. only:: subproject and html
76
77 Indices
78 =======
79
80 * :ref:`genindex`
diff --git a/Documentation/arm/Interrupts b/Documentation/arm/interrupts.rst
index f09ab1b90ef1..2ae70e0e9732 100644
--- a/Documentation/arm/Interrupts
+++ b/Documentation/arm/interrupts.rst
@@ -1,8 +1,10 @@
12.5.2-rmk5 1==========
2---------- 2Interrupts
3==========
3 4
4This is the first kernel that contains a major shake up of some of the 52.5.2-rmk5:
5major architecture-specific subsystems. 6 This is the first kernel that contains a major shake up of some of the
7 major architecture-specific subsystems.
6 8
7Firstly, it contains some pretty major changes to the way we handle the 9Firstly, it contains some pretty major changes to the way we handle the
8MMU TLB. Each MMU TLB variant is now handled completely separately - 10MMU TLB. Each MMU TLB variant is now handled completely separately -
@@ -18,7 +20,7 @@ Unfortunately, this means that machine types that touch the irq_desc[]
18array (basically all machine types) will break, and this means every 20array (basically all machine types) will break, and this means every
19machine type that we currently have. 21machine type that we currently have.
20 22
21Lets take an example. On the Assabet with Neponset, we have: 23Lets take an example. On the Assabet with Neponset, we have::
22 24
23 GPIO25 IRR:2 25 GPIO25 IRR:2
24 SA1100 ------------> Neponset -----------> SA1111 26 SA1100 ------------> Neponset -----------> SA1111
@@ -48,42 +50,47 @@ the irqdesc array). This doesn't have to be a real "IC"; indeed the
48SA11x0 IRQs are handled by two separate "chip" structures, one for 50SA11x0 IRQs are handled by two separate "chip" structures, one for
49GPIO0-10, and another for all the rest. It is just a container for 51GPIO0-10, and another for all the rest. It is just a container for
50the various operations (maybe this'll change to a better name). 52the various operations (maybe this'll change to a better name).
51This structure has the following operations: 53This structure has the following operations::
52 54
53struct irqchip { 55 struct irqchip {
54 /* 56 /*
55 * Acknowledge the IRQ. 57 * Acknowledge the IRQ.
56 * If this is a level-based IRQ, then it is expected to mask the IRQ 58 * If this is a level-based IRQ, then it is expected to mask the IRQ
57 * as well. 59 * as well.
58 */ 60 */
59 void (*ack)(unsigned int irq); 61 void (*ack)(unsigned int irq);
60 /* 62 /*
61 * Mask the IRQ in hardware. 63 * Mask the IRQ in hardware.
62 */ 64 */
63 void (*mask)(unsigned int irq); 65 void (*mask)(unsigned int irq);
64 /* 66 /*
65 * Unmask the IRQ in hardware. 67 * Unmask the IRQ in hardware.
66 */ 68 */
67 void (*unmask)(unsigned int irq); 69 void (*unmask)(unsigned int irq);
68 /* 70 /*
69 * Re-run the IRQ 71 * Re-run the IRQ
70 */ 72 */
71 void (*rerun)(unsigned int irq); 73 void (*rerun)(unsigned int irq);
72 /* 74 /*
73 * Set the type of the IRQ. 75 * Set the type of the IRQ.
74 */ 76 */
75 int (*type)(unsigned int irq, unsigned int, type); 77 int (*type)(unsigned int irq, unsigned int, type);
76}; 78 };
77 79
78ack - required. May be the same function as mask for IRQs 80ack
81 - required. May be the same function as mask for IRQs
79 handled by do_level_IRQ. 82 handled by do_level_IRQ.
80mask - required. 83mask
81unmask - required. 84 - required.
82rerun - optional. Not required if you're using do_level_IRQ for all 85unmask
86 - required.
87rerun
88 - optional. Not required if you're using do_level_IRQ for all
83 IRQs that use this 'irqchip'. Generally expected to re-trigger 89 IRQs that use this 'irqchip'. Generally expected to re-trigger
84 the hardware IRQ if possible. If not, may call the handler 90 the hardware IRQ if possible. If not, may call the handler
85 directly. 91 directly.
86type - optional. If you don't support changing the type of an IRQ, 92type
93 - optional. If you don't support changing the type of an IRQ,
87 it should be null so people can detect if they are unable to 94 it should be null so people can detect if they are unable to
88 set the IRQ type. 95 set the IRQ type.
89 96
@@ -109,6 +116,7 @@ manipulation, nor state tracking. This is useful for things like the
109SMC9196 and USAR above. 116SMC9196 and USAR above.
110 117
111So, what's changed? 118So, what's changed?
119===================
112 120
1131. Machine implementations must not write to the irqdesc array. 1211. Machine implementations must not write to the irqdesc array.
114 122
@@ -118,24 +126,19 @@ So, what's changed?
118 absolutely necessary. 126 absolutely necessary.
119 127
120 set_irq_chip(irq,chip) 128 set_irq_chip(irq,chip)
121
122 Set the mask/unmask methods for handling this IRQ 129 Set the mask/unmask methods for handling this IRQ
123 130
124 set_irq_handler(irq,handler) 131 set_irq_handler(irq,handler)
125
126 Set the handler for this IRQ (level, edge, simple) 132 Set the handler for this IRQ (level, edge, simple)
127 133
128 set_irq_chained_handler(irq,handler) 134 set_irq_chained_handler(irq,handler)
129
130 Set a "chained" handler for this IRQ - automatically 135 Set a "chained" handler for this IRQ - automatically
131 enables this IRQ (eg, Neponset and SA1111 handlers). 136 enables this IRQ (eg, Neponset and SA1111 handlers).
132 137
133 set_irq_flags(irq,flags) 138 set_irq_flags(irq,flags)
134
135 Set the valid/probe/noautoenable flags. 139 Set the valid/probe/noautoenable flags.
136 140
137 set_irq_type(irq,type) 141 set_irq_type(irq,type)
138
139 Set active the IRQ edge(s)/level. This replaces the 142 Set active the IRQ edge(s)/level. This replaces the
140 SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() 143 SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge()
141 function. Type should be one of IRQ_TYPE_xxx defined in 144 function. Type should be one of IRQ_TYPE_xxx defined in
@@ -158,10 +161,9 @@ So, what's changed?
158 be re-checked for pending events. (see the Neponset IRQ handler for 161 be re-checked for pending events. (see the Neponset IRQ handler for
159 details). 162 details).
160 163
1617. fixup_irq() is gone, as is arch/arm/mach-*/include/mach/irq.h 1647. fixup_irq() is gone, as is `arch/arm/mach-*/include/mach/irq.h`
162 165
163Please note that this will not solve all problems - some of them are 166Please note that this will not solve all problems - some of them are
164hardware based. Mixing level-based and edge-based IRQs on the same 167hardware based. Mixing level-based and edge-based IRQs on the same
165parent signal (eg neponset) is one such area where a software based 168parent signal (eg neponset) is one such area where a software based
166solution can't provide the full answer to low IRQ latency. 169solution can't provide the full answer to low IRQ latency.
167
diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/ixp4xx.rst
index e48b74de6ac0..a57235616294 100644
--- a/Documentation/arm/IXP4xx
+++ b/Documentation/arm/ixp4xx.rst
@@ -1,6 +1,6 @@
1 1===========================================================
2-------------------------------------------------------------------------
3Release Notes for Linux on Intel's IXP4xx Network Processor 2Release Notes for Linux on Intel's IXP4xx Network Processor
3===========================================================
4 4
5Maintained by Deepak Saxena <dsaxena@plexity.net> 5Maintained by Deepak Saxena <dsaxena@plexity.net>
6------------------------------------------------------------------------- 6-------------------------------------------------------------------------
@@ -8,7 +8,7 @@ Maintained by Deepak Saxena <dsaxena@plexity.net>
81. Overview 81. Overview
9 9
10Intel's IXP4xx network processor is a highly integrated SOC that 10Intel's IXP4xx network processor is a highly integrated SOC that
11is targeted for network applications, though it has become popular 11is targeted for network applications, though it has become popular
12in industrial control and other areas due to low cost and power 12in industrial control and other areas due to low cost and power
13consumption. The IXP4xx family currently consists of several processors 13consumption. The IXP4xx family currently consists of several processors
14that support different network offload functions such as encryption, 14that support different network offload functions such as encryption,
@@ -20,7 +20,7 @@ For more information on the various versions of the CPU, see:
20 20
21 http://developer.intel.com/design/network/products/npfamily/ixp4xx.htm 21 http://developer.intel.com/design/network/products/npfamily/ixp4xx.htm
22 22
23Intel also made the IXCP1100 CPU for sometime which is an IXP4xx 23Intel also made the IXCP1100 CPU for sometime which is an IXP4xx
24stripped of much of the network intelligence. 24stripped of much of the network intelligence.
25 25
262. Linux Support 262. Linux Support
@@ -31,7 +31,7 @@ Linux currently supports the following features on the IXP4xx chips:
31- PCI interface 31- PCI interface
32- Flash access (MTD/JFFS) 32- Flash access (MTD/JFFS)
33- I2C through GPIO on IXP42x 33- I2C through GPIO on IXP42x
34- GPIO for input/output/interrupts 34- GPIO for input/output/interrupts
35 See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions. 35 See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions.
36- Timers (watchdog, OS) 36- Timers (watchdog, OS)
37 37
@@ -45,7 +45,7 @@ require the use of Intel's proprietary CSR software:
45If you need to use any of the above, you need to download Intel's 45If you need to use any of the above, you need to download Intel's
46software from: 46software from:
47 47
48 http://developer.intel.com/design/network/products/npfamily/ixp425.htm 48 http://developer.intel.com/design/network/products/npfamily/ixp425.htm
49 49
50DO NOT POST QUESTIONS TO THE LINUX MAILING LISTS REGARDING THE PROPRIETARY 50DO NOT POST QUESTIONS TO THE LINUX MAILING LISTS REGARDING THE PROPRIETARY
51SOFTWARE. 51SOFTWARE.
@@ -53,14 +53,14 @@ SOFTWARE.
53There are several websites that provide directions/pointers on using 53There are several websites that provide directions/pointers on using
54Intel's software: 54Intel's software:
55 55
56 http://sourceforge.net/projects/ixp4xx-osdg/ 56 - http://sourceforge.net/projects/ixp4xx-osdg/
57 Open Source Developer's Guide for using uClinux and the Intel libraries 57 Open Source Developer's Guide for using uClinux and the Intel libraries
58 58
59http://gatewaymaker.sourceforge.net/ 59 - http://gatewaymaker.sourceforge.net/
60 Simple one page summary of building a gateway using an IXP425 and Linux 60 Simple one page summary of building a gateway using an IXP425 and Linux
61 61
62http://ixp425.sourceforge.net/ 62 - http://ixp425.sourceforge.net/
63 ATM device driver for IXP425 that relies on Intel's libraries 63 ATM device driver for IXP425 that relies on Intel's libraries
64 64
653. Known Issues/Limitations 653. Known Issues/Limitations
66 66
@@ -70,7 +70,7 @@ The IXP4xx family allows for up to 256MB of memory but the PCI interface
70can only expose 64MB of that memory to the PCI bus. This means that if 70can only expose 64MB of that memory to the PCI bus. This means that if
71you are running with > 64MB, all PCI buffers outside of the accessible 71you are running with > 64MB, all PCI buffers outside of the accessible
72range will be bounced using the routines in arch/arm/common/dmabounce.c. 72range will be bounced using the routines in arch/arm/common/dmabounce.c.
73 73
743b. Limited outbound PCI window 743b. Limited outbound PCI window
75 75
76IXP4xx provides two methods of accessing PCI memory space: 76IXP4xx provides two methods of accessing PCI memory space:
@@ -79,15 +79,15 @@ IXP4xx provides two methods of accessing PCI memory space:
79 To access PCI via this space, we simply ioremap() the BAR 79 To access PCI via this space, we simply ioremap() the BAR
80 into the kernel and we can use the standard read[bwl]/write[bwl] 80 into the kernel and we can use the standard read[bwl]/write[bwl]
81 macros. This is the preffered method due to speed but it 81 macros. This is the preffered method due to speed but it
82 limits the system to just 64MB of PCI memory. This can be 82 limits the system to just 64MB of PCI memory. This can be
83 problamatic if using video cards and other memory-heavy devices. 83 problamatic if using video cards and other memory-heavy devices.
84 84
852) If > 64MB of memory space is required, the IXP4xx can be 852) If > 64MB of memory space is required, the IXP4xx can be
86 configured to use indirect registers to access PCI This allows 86 configured to use indirect registers to access PCI This allows
87 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus. 87 for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus.
88 The disadvantage of this is that every PCI access requires 88 The disadvantage of this is that every PCI access requires
89 three local register accesses plus a spinlock, but in some 89 three local register accesses plus a spinlock, but in some
90 cases the performance hit is acceptable. In addition, you cannot 90 cases the performance hit is acceptable. In addition, you cannot
91 mmap() PCI devices in this case due to the indirect nature 91 mmap() PCI devices in this case due to the indirect nature
92 of the PCI window. 92 of the PCI window.
93 93
@@ -96,14 +96,14 @@ you need more PCI memory, enable the IXP4XX_INDIRECT_PCI config option.
96 96
973c. GPIO as Interrupts 973c. GPIO as Interrupts
98 98
99Currently the code only handles level-sensitive GPIO interrupts 99Currently the code only handles level-sensitive GPIO interrupts
100 100
1014. Supported platforms 1014. Supported platforms
102 102
103ADI Engineering Coyote Gateway Reference Platform 103ADI Engineering Coyote Gateway Reference Platform
104http://www.adiengineering.com/productsCoyote.html 104http://www.adiengineering.com/productsCoyote.html
105 105
106 The ADI Coyote platform is reference design for those building 106 The ADI Coyote platform is reference design for those building
107 small residential/office gateways. One NPE is connected to a 10/100 107 small residential/office gateways. One NPE is connected to a 10/100
108 interface, one to 4-port 10/100 switch, and the third to and ADSL 108 interface, one to 4-port 10/100 switch, and the third to and ADSL
109 interface. In addition, it also supports to POTs interfaces connected 109 interface. In addition, it also supports to POTs interfaces connected
@@ -119,9 +119,9 @@ http://www.gateworks.com/support/overview.php
119 the expansion bus. 119 the expansion bus.
120 120
121Intel IXDP425 Development Platform 121Intel IXDP425 Development Platform
122http://www.intel.com/design/network/products/npfamily/ixdpg425.htm 122http://www.intel.com/design/network/products/npfamily/ixdpg425.htm
123 123
124 This is Intel's standard reference platform for the IXDP425 and is 124 This is Intel's standard reference platform for the IXDP425 and is
125 also known as the Richfield board. It contains 4 PCI slots, 16MB 125 also known as the Richfield board. It contains 4 PCI slots, 16MB
126 of flash, two 10/100 ports and one ADSL port. 126 of flash, two 10/100 ports and one ADSL port.
127 127
@@ -161,11 +161,12 @@ The IXP4xx work has been funded by Intel Corp. and MontaVista Software, Inc.
161 161
162The following people have contributed patches/comments/etc: 162The following people have contributed patches/comments/etc:
163 163
164Lennerty Buytenhek 164- Lennerty Buytenhek
165Lutz Jaenicke 165- Lutz Jaenicke
166Justin Mayfield 166- Justin Mayfield
167Robert E. Ranslam 167- Robert E. Ranslam
168[I know I've forgotten others, please email me to be added] 168
169[I know I've forgotten others, please email me to be added]
169 170
170------------------------------------------------------------------------- 171-------------------------------------------------------------------------
171 172
diff --git a/Documentation/arm/kernel_mode_neon.txt b/Documentation/arm/kernel_mode_neon.rst
index b9e060c5b61e..9bfb71a2a9b9 100644
--- a/Documentation/arm/kernel_mode_neon.txt
+++ b/Documentation/arm/kernel_mode_neon.rst
@@ -1,3 +1,4 @@
1================
1Kernel mode NEON 2Kernel mode NEON
2================ 3================
3 4
@@ -86,6 +87,7 @@ instructions appearing in unexpected places if no special care is taken.
86 87
87Therefore, the recommended and only supported way of using NEON/VFP in the 88Therefore, the recommended and only supported way of using NEON/VFP in the
88kernel is by adhering to the following rules: 89kernel is by adhering to the following rules:
90
89* isolate the NEON code in a separate compilation unit and compile it with 91* isolate the NEON code in a separate compilation unit and compile it with
90 '-march=armv7-a -mfpu=neon -mfloat-abi=softfp'; 92 '-march=armv7-a -mfpu=neon -mfloat-abi=softfp';
91* issue the calls to kernel_neon_begin(), kernel_neon_end() as well as the calls 93* issue the calls to kernel_neon_begin(), kernel_neon_end() as well as the calls
@@ -115,6 +117,7 @@ NEON intrinsics
115NEON intrinsics are also supported. However, as code using NEON intrinsics 117NEON intrinsics are also supported. However, as code using NEON intrinsics
116relies on the GCC header <arm_neon.h>, (which #includes <stdint.h>), you should 118relies on the GCC header <arm_neon.h>, (which #includes <stdint.h>), you should
117observe the following in addition to the rules above: 119observe the following in addition to the rules above:
120
118* Compile the unit containing the NEON intrinsics with '-ffreestanding' so GCC 121* Compile the unit containing the NEON intrinsics with '-ffreestanding' so GCC
119 uses its builtin version of <stdint.h> (this is a C99 header which the kernel 122 uses its builtin version of <stdint.h> (this is a C99 header which the kernel
120 does not supply); 123 does not supply);
diff --git a/Documentation/arm/kernel_user_helpers.txt b/Documentation/arm/kernel_user_helpers.rst
index 5673594717cf..eb6f3d916622 100644
--- a/Documentation/arm/kernel_user_helpers.txt
+++ b/Documentation/arm/kernel_user_helpers.rst
@@ -1,3 +1,4 @@
1============================
1Kernel-provided User Helpers 2Kernel-provided User Helpers
2============================ 3============================
3 4
@@ -43,7 +44,7 @@ kuser_helper_version
43 44
44Location: 0xffff0ffc 45Location: 0xffff0ffc
45 46
46Reference declaration: 47Reference declaration::
47 48
48 extern int32_t __kuser_helper_version; 49 extern int32_t __kuser_helper_version;
49 50
@@ -53,17 +54,17 @@ Definition:
53 running kernel. User space may read this to determine the availability 54 running kernel. User space may read this to determine the availability
54 of a particular helper. 55 of a particular helper.
55 56
56Usage example: 57Usage example::
57 58
58#define __kuser_helper_version (*(int32_t *)0xffff0ffc) 59 #define __kuser_helper_version (*(int32_t *)0xffff0ffc)
59 60
60void check_kuser_version(void) 61 void check_kuser_version(void)
61{ 62 {
62 if (__kuser_helper_version < 2) { 63 if (__kuser_helper_version < 2) {
63 fprintf(stderr, "can't do atomic operations, kernel too old\n"); 64 fprintf(stderr, "can't do atomic operations, kernel too old\n");
64 abort(); 65 abort();
65 } 66 }
66} 67 }
67 68
68Notes: 69Notes:
69 70
@@ -77,7 +78,7 @@ kuser_get_tls
77 78
78Location: 0xffff0fe0 79Location: 0xffff0fe0
79 80
80Reference prototype: 81Reference prototype::
81 82
82 void * __kuser_get_tls(void); 83 void * __kuser_get_tls(void);
83 84
@@ -97,16 +98,16 @@ Definition:
97 98
98 Get the TLS value as previously set via the __ARM_NR_set_tls syscall. 99 Get the TLS value as previously set via the __ARM_NR_set_tls syscall.
99 100
100Usage example: 101Usage example::
101 102
102typedef void * (__kuser_get_tls_t)(void); 103 typedef void * (__kuser_get_tls_t)(void);
103#define __kuser_get_tls (*(__kuser_get_tls_t *)0xffff0fe0) 104 #define __kuser_get_tls (*(__kuser_get_tls_t *)0xffff0fe0)
104 105
105void foo() 106 void foo()
106{ 107 {
107 void *tls = __kuser_get_tls(); 108 void *tls = __kuser_get_tls();
108 printf("TLS = %p\n", tls); 109 printf("TLS = %p\n", tls);
109} 110 }
110 111
111Notes: 112Notes:
112 113
@@ -117,7 +118,7 @@ kuser_cmpxchg
117 118
118Location: 0xffff0fc0 119Location: 0xffff0fc0
119 120
120Reference prototype: 121Reference prototype::
121 122
122 int __kuser_cmpxchg(int32_t oldval, int32_t newval, volatile int32_t *ptr); 123 int __kuser_cmpxchg(int32_t oldval, int32_t newval, volatile int32_t *ptr);
123 124
@@ -139,18 +140,18 @@ Clobbered registers:
139 140
140Definition: 141Definition:
141 142
142 Atomically store newval in *ptr only if *ptr is equal to oldval. 143 Atomically store newval in `*ptr` only if `*ptr` is equal to oldval.
143 Return zero if *ptr was changed or non-zero if no exchange happened. 144 Return zero if `*ptr` was changed or non-zero if no exchange happened.
144 The C flag is also set if *ptr was changed to allow for assembly 145 The C flag is also set if `*ptr` was changed to allow for assembly
145 optimization in the calling code. 146 optimization in the calling code.
146 147
147Usage example: 148Usage example::
148 149
149typedef int (__kuser_cmpxchg_t)(int oldval, int newval, volatile int *ptr); 150 typedef int (__kuser_cmpxchg_t)(int oldval, int newval, volatile int *ptr);
150#define __kuser_cmpxchg (*(__kuser_cmpxchg_t *)0xffff0fc0) 151 #define __kuser_cmpxchg (*(__kuser_cmpxchg_t *)0xffff0fc0)
151 152
152int atomic_add(volatile int *ptr, int val) 153 int atomic_add(volatile int *ptr, int val)
153{ 154 {
154 int old, new; 155 int old, new;
155 156
156 do { 157 do {
@@ -159,7 +160,7 @@ int atomic_add(volatile int *ptr, int val)
159 } while(__kuser_cmpxchg(old, new, ptr)); 160 } while(__kuser_cmpxchg(old, new, ptr));
160 161
161 return new; 162 return new;
162} 163 }
163 164
164Notes: 165Notes:
165 166
@@ -172,7 +173,7 @@ kuser_memory_barrier
172 173
173Location: 0xffff0fa0 174Location: 0xffff0fa0
174 175
175Reference prototype: 176Reference prototype::
176 177
177 void __kuser_memory_barrier(void); 178 void __kuser_memory_barrier(void);
178 179
@@ -193,10 +194,10 @@ Definition:
193 Apply any needed memory barrier to preserve consistency with data modified 194 Apply any needed memory barrier to preserve consistency with data modified
194 manually and __kuser_cmpxchg usage. 195 manually and __kuser_cmpxchg usage.
195 196
196Usage example: 197Usage example::
197 198
198typedef void (__kuser_dmb_t)(void); 199 typedef void (__kuser_dmb_t)(void);
199#define __kuser_dmb (*(__kuser_dmb_t *)0xffff0fa0) 200 #define __kuser_dmb (*(__kuser_dmb_t *)0xffff0fa0)
200 201
201Notes: 202Notes:
202 203
@@ -207,7 +208,7 @@ kuser_cmpxchg64
207 208
208Location: 0xffff0f60 209Location: 0xffff0f60
209 210
210Reference prototype: 211Reference prototype::
211 212
212 int __kuser_cmpxchg64(const int64_t *oldval, 213 int __kuser_cmpxchg64(const int64_t *oldval,
213 const int64_t *newval, 214 const int64_t *newval,
@@ -231,22 +232,22 @@ Clobbered registers:
231 232
232Definition: 233Definition:
233 234
234 Atomically store the 64-bit value pointed by *newval in *ptr only if *ptr 235 Atomically store the 64-bit value pointed by `*newval` in `*ptr` only if `*ptr`
235 is equal to the 64-bit value pointed by *oldval. Return zero if *ptr was 236 is equal to the 64-bit value pointed by `*oldval`. Return zero if `*ptr` was
236 changed or non-zero if no exchange happened. 237 changed or non-zero if no exchange happened.
237 238
238 The C flag is also set if *ptr was changed to allow for assembly 239 The C flag is also set if `*ptr` was changed to allow for assembly
239 optimization in the calling code. 240 optimization in the calling code.
240 241
241Usage example: 242Usage example::
242 243
243typedef int (__kuser_cmpxchg64_t)(const int64_t *oldval, 244 typedef int (__kuser_cmpxchg64_t)(const int64_t *oldval,
244 const int64_t *newval, 245 const int64_t *newval,
245 volatile int64_t *ptr); 246 volatile int64_t *ptr);
246#define __kuser_cmpxchg64 (*(__kuser_cmpxchg64_t *)0xffff0f60) 247 #define __kuser_cmpxchg64 (*(__kuser_cmpxchg64_t *)0xffff0f60)
247 248
248int64_t atomic_add64(volatile int64_t *ptr, int64_t val) 249 int64_t atomic_add64(volatile int64_t *ptr, int64_t val)
249{ 250 {
250 int64_t old, new; 251 int64_t old, new;
251 252
252 do { 253 do {
@@ -255,7 +256,7 @@ int64_t atomic_add64(volatile int64_t *ptr, int64_t val)
255 } while(__kuser_cmpxchg64(&old, &new, ptr)); 256 } while(__kuser_cmpxchg64(&old, &new, ptr));
256 257
257 return new; 258 return new;
258} 259 }
259 260
260Notes: 261Notes:
261 262
diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.rst
index fcdb9fd5f53a..7f7638d80b42 100644
--- a/Documentation/arm/keystone/knav-qmss.txt
+++ b/Documentation/arm/keystone/knav-qmss.rst
@@ -1,4 +1,6 @@
1* Texas Instruments Keystone Navigator Queue Management SubSystem driver 1======================================================================
2Texas Instruments Keystone Navigator Queue Management SubSystem driver
3======================================================================
2 4
3Driver source code path 5Driver source code path
4 drivers/soc/ti/knav_qmss.c 6 drivers/soc/ti/knav_qmss.c
@@ -34,11 +36,13 @@ driver that interface with the accumulator PDSP. This configures
34accumulator channels defined in DTS (example in DT documentation) to monitor 36accumulator channels defined in DTS (example in DT documentation) to monitor
351 or 32 queues per channel. More description on the firmware is available in 371 or 32 queues per channel. More description on the firmware is available in
36CPPI/QMSS Low Level Driver document (docs/CPPI_QMSS_LLD_SDS.pdf) at 38CPPI/QMSS Low Level Driver document (docs/CPPI_QMSS_LLD_SDS.pdf) at
39
37 git://git.ti.com/keystone-rtos/qmss-lld.git 40 git://git.ti.com/keystone-rtos/qmss-lld.git
38 41
39k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin firmware supports upto 48 accumulator 42k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin firmware supports upto 48 accumulator
40channels. This firmware is available under ti-keystone folder of 43channels. This firmware is available under ti-keystone folder of
41firmware.git at 44firmware.git at
45
42 git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git 46 git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
43 47
44To use copy the firmware image to lib/firmware folder of the initramfs or 48To use copy the firmware image to lib/firmware folder of the initramfs or
diff --git a/Documentation/arm/keystone/Overview.txt b/Documentation/arm/keystone/overview.rst
index 400c0c270d2e..cd90298c493c 100644
--- a/Documentation/arm/keystone/Overview.txt
+++ b/Documentation/arm/keystone/overview.rst
@@ -1,5 +1,6 @@
1 TI Keystone Linux Overview 1==========================
2 -------------------------- 2TI Keystone Linux Overview
3==========================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -9,47 +10,65 @@ for users to run Linux on Keystone based EVMs from Texas Instruments.
9 10
10Following SoCs & EVMs are currently supported:- 11Following SoCs & EVMs are currently supported:-
11 12
12------------ K2HK SoC and EVM -------------------------------------------------- 13K2HK SoC and EVM
14=================
13 15
14a.k.a Keystone 2 Hawking/Kepler SoC 16a.k.a Keystone 2 Hawking/Kepler SoC
15TCI6636K2H & TCI6636K2K: See documentation at 17TCI6636K2H & TCI6636K2K: See documentation at
18
16 http://www.ti.com/product/tci6638k2k 19 http://www.ti.com/product/tci6638k2k
17 http://www.ti.com/product/tci6638k2h 20 http://www.ti.com/product/tci6638k2h
18 21
19EVM: 22EVM:
20http://www.advantech.com/Support/TI-EVM/EVMK2HX_sd.aspx 23 http://www.advantech.com/Support/TI-EVM/EVMK2HX_sd.aspx
21 24
22------------ K2E SoC and EVM --------------------------------------------------- 25K2E SoC and EVM
26===============
23 27
24a.k.a Keystone 2 Edison SoC 28a.k.a Keystone 2 Edison SoC
25K2E - 66AK2E05: See documentation at 29
30K2E - 66AK2E05:
31
32See documentation at
33
26 http://www.ti.com/product/66AK2E05/technicaldocuments 34 http://www.ti.com/product/66AK2E05/technicaldocuments
27 35
28EVM: 36EVM:
29https://www.einfochips.com/index.php/partnerships/texas-instruments/k2e-evm.html 37 https://www.einfochips.com/index.php/partnerships/texas-instruments/k2e-evm.html
30 38
31------------ K2L SoC and EVM --------------------------------------------------- 39K2L SoC and EVM
40===============
32 41
33a.k.a Keystone 2 Lamarr SoC 42a.k.a Keystone 2 Lamarr SoC
34K2L - TCI6630K2L: See documentation at 43
44K2L - TCI6630K2L:
45
46See documentation at
35 http://www.ti.com/product/TCI6630K2L/technicaldocuments 47 http://www.ti.com/product/TCI6630K2L/technicaldocuments
48
36EVM: 49EVM:
37https://www.einfochips.com/index.php/partnerships/texas-instruments/k2l-evm.html 50 https://www.einfochips.com/index.php/partnerships/texas-instruments/k2l-evm.html
38 51
39Configuration 52Configuration
40------------- 53-------------
41 54
42All of the K2 SoCs/EVMs share a common defconfig, keystone_defconfig and same 55All of the K2 SoCs/EVMs share a common defconfig, keystone_defconfig and same
43image is used to boot on individual EVMs. The platform configuration is 56image is used to boot on individual EVMs. The platform configuration is
44specified through DTS. Following are the DTS used:- 57specified through DTS. Following are the DTS used:
45 K2HK EVM : k2hk-evm.dts 58
46 K2E EVM : k2e-evm.dts 59 K2HK EVM:
47 K2L EVM : k2l-evm.dts 60 k2hk-evm.dts
61 K2E EVM:
62 k2e-evm.dts
63 K2L EVM:
64 k2l-evm.dts
48 65
49The device tree documentation for the keystone machines are located at 66The device tree documentation for the keystone machines are located at
67
50 Documentation/devicetree/bindings/arm/keystone/keystone.txt 68 Documentation/devicetree/bindings/arm/keystone/keystone.txt
51 69
52Document Author 70Document Author
53--------------- 71---------------
54Murali Karicheri <m-karicheri2@ti.com> 72Murali Karicheri <m-karicheri2@ti.com>
73
55Copyright 2015 Texas Instruments 74Copyright 2015 Texas Instruments
diff --git a/Documentation/arm/marvel.rst b/Documentation/arm/marvel.rst
new file mode 100644
index 000000000000..16ab2eb085b8
--- /dev/null
+++ b/Documentation/arm/marvel.rst
@@ -0,0 +1,488 @@
1================
2ARM Marvell SoCs
3================
4
5This document lists all the ARM Marvell SoCs that are currently
6supported in mainline by the Linux kernel. As the Marvell families of
7SoCs are large and complex, it is hard to understand where the support
8for a particular SoC is available in the Linux kernel. This document
9tries to help in understanding where those SoCs are supported, and to
10match them with their corresponding public datasheet, when available.
11
12Orion family
13------------
14
15 Flavors:
16 - 88F5082
17 - 88F5181
18 - 88F5181L
19 - 88F5182
20
21 - Datasheet: http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf
22 - Programmer's User Guide: http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf
23 - User Manual: http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf
24 - 88F5281
25
26 - Datasheet: http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
27 - 88F6183
28 Core:
29 Feroceon 88fr331 (88f51xx) or 88fr531-vd (88f52xx) ARMv5 compatible
30 Linux kernel mach directory:
31 arch/arm/mach-orion5x
32 Linux kernel plat directory:
33 arch/arm/plat-orion
34
35Kirkwood family
36---------------
37
38 Flavors:
39 - 88F6282 a.k.a Armada 300
40
41 - Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
42 - 88F6283 a.k.a Armada 310
43
44 - Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
45 - 88F6190
46
47 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
48 - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
49 - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
50 - 88F6192
51
52 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
53 - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
54 - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
55 - 88F6182
56 - 88F6180
57
58 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
59 - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
60 - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
61 - 88F6281
62
63 - Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
64 - Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
65 - Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
66 Homepage:
67 http://www.marvell.com/embedded-processors/kirkwood/
68 Core:
69 Feroceon 88fr131 ARMv5 compatible
70 Linux kernel mach directory:
71 arch/arm/mach-mvebu
72 Linux kernel plat directory:
73 none
74
75Discovery family
76----------------
77
78 Flavors:
79 - MV78100
80
81 - Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
82 - Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
83 - Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
84 - MV78200
85
86 - Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
87 - Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
88 - Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
89 - MV76100
90
91 Not supported by the Linux kernel.
92
93 Core:
94 Feroceon 88fr571-vd ARMv5 compatible
95
96 Linux kernel mach directory:
97 arch/arm/mach-mv78xx0
98 Linux kernel plat directory:
99 arch/arm/plat-orion
100
101EBU Armada family
102-----------------
103
104 Armada 370 Flavors:
105 - 88F6710
106 - 88F6707
107 - 88F6W11
108
109 - Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
110 - Hardware Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-datasheet.pdf
111 - Functional Spec: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA370-FunctionalSpec-datasheet.pdf
112
113 Core:
114 Sheeva ARMv7 compatible PJ4B
115
116 Armada 375 Flavors:
117 - 88F6720
118
119 - Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
120
121 Core:
122 ARM Cortex-A9
123
124 Armada 38x Flavors:
125 - 88F6810 Armada 380
126 - 88F6820 Armada 385
127 - 88F6828 Armada 388
128
129 - Product infos: http://www.marvell.com/embedded-processors/armada-38x/
130 - Functional Spec: https://marvellcorp.wufoo.com/forms/marvell-armada-38x-functional-specifications/
131
132 Core:
133 ARM Cortex-A9
134
135 Armada 39x Flavors:
136 - 88F6920 Armada 390
137 - 88F6928 Armada 398
138
139 - Product infos: http://www.marvell.com/embedded-processors/armada-39x/
140
141 Core:
142 ARM Cortex-A9
143
144 Armada XP Flavors:
145 - MV78230
146 - MV78260
147 - MV78460
148
149 NOTE:
150 not to be confused with the non-SMP 78xx0 SoCs
151
152 Product Brief:
153 http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
154
155 Functional Spec:
156 http://www.marvell.com/embedded-processors/armada-xp/assets/ARMADA-XP-Functional-SpecDatasheet.pdf
157
158 - Hardware Specs:
159
160 - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78230_OS.PDF
161 - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78260_OS.PDF
162 - http://www.marvell.com/embedded-processors/armada-xp/assets/HW_MV78460_OS.PDF
163
164 Core:
165 Sheeva ARMv7 compatible Dual-core or Quad-core PJ4B-MP
166
167 Linux kernel mach directory:
168 arch/arm/mach-mvebu
169 Linux kernel plat directory:
170 none
171
172EBU Armada family ARMv8
173-----------------------
174
175 Armada 3710/3720 Flavors:
176 - 88F3710
177 - 88F3720
178
179 Core:
180 ARM Cortex A53 (ARMv8)
181
182 Homepage:
183 http://www.marvell.com/embedded-processors/armada-3700/
184
185 Product Brief:
186 http://www.marvell.com/embedded-processors/assets/PB-88F3700-FNL.pdf
187
188 Device tree files:
189 arch/arm64/boot/dts/marvell/armada-37*
190
191 Armada 7K Flavors:
192 - 88F7020 (AP806 Dual + one CP110)
193 - 88F7040 (AP806 Quad + one CP110)
194
195 Core: ARM Cortex A72
196
197 Homepage:
198 http://www.marvell.com/embedded-processors/armada-70xx/
199
200 Product Brief:
201 - http://www.marvell.com/embedded-processors/assets/Armada7020PB-Jan2016.pdf
202 - http://www.marvell.com/embedded-processors/assets/Armada7040PB-Jan2016.pdf
203
204 Device tree files:
205 arch/arm64/boot/dts/marvell/armada-70*
206
207 Armada 8K Flavors:
208 - 88F8020 (AP806 Dual + two CP110)
209 - 88F8040 (AP806 Quad + two CP110)
210 Core:
211 ARM Cortex A72
212
213 Homepage:
214 http://www.marvell.com/embedded-processors/armada-80xx/
215
216 Product Brief:
217 - http://www.marvell.com/embedded-processors/assets/Armada8020PB-Jan2016.pdf
218 - http://www.marvell.com/embedded-processors/assets/Armada8040PB-Jan2016.pdf
219
220 Device tree files:
221 arch/arm64/boot/dts/marvell/armada-80*
222
223Avanta family
224-------------
225
226 Flavors:
227 - 88F6510
228 - 88F6530P
229 - 88F6550
230 - 88F6560
231
232 Homepage:
233 http://www.marvell.com/broadband/
234
235 Product Brief:
236 http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
237
238 No public datasheet available.
239
240 Core:
241 ARMv5 compatible
242
243 Linux kernel mach directory:
244 no code in mainline yet, planned for the future
245 Linux kernel plat directory:
246 no code in mainline yet, planned for the future
247
248Storage family
249--------------
250
251 Armada SP:
252 - 88RC1580
253
254 Product infos:
255 http://www.marvell.com/storage/armada-sp/
256
257 Core:
258 Sheeva ARMv7 comatible Quad-core PJ4C
259
260 (not supported in upstream Linux kernel)
261
262Dove family (application processor)
263-----------------------------------
264
265 Flavors:
266 - 88AP510 a.k.a Armada 510
267
268 Product Brief:
269 http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
270
271 Hardware Spec:
272 http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
273
274 Functional Spec:
275 http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
276
277 Homepage:
278 http://www.marvell.com/application-processors/armada-500/
279
280 Core:
281 ARMv7 compatible
282
283 Directory:
284 - arch/arm/mach-mvebu (DT enabled platforms)
285 - arch/arm/mach-dove (non-DT enabled platforms)
286
287PXA 2xx/3xx/93x/95x family
288--------------------------
289
290 Flavors:
291 - PXA21x, PXA25x, PXA26x
292 - Application processor only
293 - Core: ARMv5 XScale1 core
294 - PXA270, PXA271, PXA272
295 - Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
296 - Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
297 - Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
298 - Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
299 - Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
300 - Application processor only
301 - Core: ARMv5 XScale2 core
302 - PXA300, PXA310, PXA320
303 - PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
304 - PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
305 - PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
306 - Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
307 - Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
308 - Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
309 - Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
310 - Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
311 - Application processor only
312 - Core: ARMv5 XScale3 core
313 - PXA930, PXA935
314 - Application processor with Communication processor
315 - Core: ARMv5 XScale3 core
316 - PXA955
317 - Application processor with Communication processor
318 - Core: ARMv7 compatible Sheeva PJ4 core
319
320 Comments:
321
322 * This line of SoCs originates from the XScale family developed by
323 Intel and acquired by Marvell in ~2006. The PXA21x, PXA25x,
324 PXA26x, PXA27x, PXA3xx and PXA93x were developed by Intel, while
325 the later PXA95x were developed by Marvell.
326
327 * Due to their XScale origin, these SoCs have virtually nothing in
328 common with the other (Kirkwood, Dove, etc.) families of Marvell
329 SoCs, except with the MMP/MMP2 family of SoCs.
330
331 Linux kernel mach directory:
332 arch/arm/mach-pxa
333 Linux kernel plat directory:
334 arch/arm/plat-pxa
335
336MMP/MMP2/MMP3 family (communication processor)
337----------------------------------------------
338
339 Flavors:
340 - PXA168, a.k.a Armada 168
341 - Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp
342 - Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
343 - Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
344 - Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
345 - Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
346 - Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
347 - App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
348 - Application processor only
349 - Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
350 - PXA910/PXA920
351 - Homepage : http://www.marvell.com/communication-processors/pxa910/
352 - Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf
353 - Application processor with Communication processor
354 - Core: ARMv5 compatible Marvell PJ1 88sv331 (Mohawk)
355 - PXA688, a.k.a. MMP2, a.k.a Armada 610
356 - Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
357 - Application processor only
358 - Core: ARMv7 compatible Sheeva PJ4 88sv581x core
359 - PXA2128, a.k.a. MMP3 (OLPC XO4, Linux support not upstream)
360 - Product Brief : http://www.marvell.com/application-processors/armada/pxa2128/assets/Marvell-ARMADA-PXA2128-SoC-PB.pdf
361 - Application processor only
362 - Core: Dual-core ARMv7 compatible Sheeva PJ4C core
363 - PXA960/PXA968/PXA978 (Linux support not upstream)
364 - Application processor with Communication Processor
365 - Core: ARMv7 compatible Sheeva PJ4 core
366 - PXA986/PXA988 (Linux support not upstream)
367 - Application processor with Communication Processor
368 - Core: Dual-core ARMv7 compatible Sheeva PJ4B-MP core
369 - PXA1088/PXA1920 (Linux support not upstream)
370 - Application processor with Communication Processor
371 - Core: quad-core ARMv7 Cortex-A7
372 - PXA1908/PXA1928/PXA1936
373 - Application processor with Communication Processor
374 - Core: multi-core ARMv8 Cortex-A53
375
376 Comments:
377
378 * This line of SoCs originates from the XScale family developed by
379 Intel and acquired by Marvell in ~2006. All the processors of
380 this MMP/MMP2 family were developed by Marvell.
381
382 * Due to their XScale origin, these SoCs have virtually nothing in
383 common with the other (Kirkwood, Dove, etc.) families of Marvell
384 SoCs, except with the PXA family of SoCs listed above.
385
386 Linux kernel mach directory:
387 arch/arm/mach-mmp
388 Linux kernel plat directory:
389 arch/arm/plat-pxa
390
391Berlin family (Multimedia Solutions)
392-------------------------------------
393
394 - Flavors:
395 - 88DE3010, Armada 1000 (no Linux support)
396 - Core: Marvell PJ1 (ARMv5TE), Dual-core
397 - Product Brief: http://www.marvell.com.cn/digital-entertainment/assets/armada_1000_pb.pdf
398 - 88DE3005, Armada 1500 Mini
399 - Design name: BG2CD
400 - Core: ARM Cortex-A9, PL310 L2CC
401 - 88DE3006, Armada 1500 Mini Plus
402 - Design name: BG2CDP
403 - Core: Dual Core ARM Cortex-A7
404 - 88DE3100, Armada 1500
405 - Design name: BG2
406 - Core: Marvell PJ4B-MP (ARMv7), Tauros3 L2CC
407 - 88DE3114, Armada 1500 Pro
408 - Design name: BG2Q
409 - Core: Quad Core ARM Cortex-A9, PL310 L2CC
410 - 88DE3214, Armada 1500 Pro 4K
411 - Design name: BG3
412 - Core: ARM Cortex-A15, CA15 integrated L2CC
413 - 88DE3218, ARMADA 1500 Ultra
414 - Core: ARM Cortex-A53
415
416 Homepage: https://www.synaptics.com/products/multimedia-solutions
417 Directory: arch/arm/mach-berlin
418
419 Comments:
420
421 * This line of SoCs is based on Marvell Sheeva or ARM Cortex CPUs
422 with Synopsys DesignWare (IRQ, GPIO, Timers, ...) and PXA IP (SDHCI, USB, ETH, ...).
423
424 * The Berlin family was acquired by Synaptics from Marvell in 2017.
425
426CPU Cores
427---------
428
429The XScale cores were designed by Intel, and shipped by Marvell in the older
430PXA processors. Feroceon is a Marvell designed core that developed in-house,
431and that evolved into Sheeva. The XScale and Feroceon cores were phased out
432over time and replaced with Sheeva cores in later products, which subsequently
433got replaced with licensed ARM Cortex-A cores.
434
435 XScale 1
436 CPUID 0x69052xxx
437 ARMv5, iWMMXt
438 XScale 2
439 CPUID 0x69054xxx
440 ARMv5, iWMMXt
441 XScale 3
442 CPUID 0x69056xxx or 0x69056xxx
443 ARMv5, iWMMXt
444 Feroceon-1850 88fr331 "Mohawk"
445 CPUID 0x5615331x or 0x41xx926x
446 ARMv5TE, single issue
447 Feroceon-2850 88fr531-vd "Jolteon"
448 CPUID 0x5605531x or 0x41xx926x
449 ARMv5TE, VFP, dual-issue
450 Feroceon 88fr571-vd "Jolteon"
451 CPUID 0x5615571x
452 ARMv5TE, VFP, dual-issue
453 Feroceon 88fr131 "Mohawk-D"
454 CPUID 0x5625131x
455 ARMv5TE, single-issue in-order
456 Sheeva PJ1 88sv331 "Mohawk"
457 CPUID 0x561584xx
458 ARMv5, single-issue iWMMXt v2
459 Sheeva PJ4 88sv581x "Flareon"
460 CPUID 0x560f581x
461 ARMv7, idivt, optional iWMMXt v2
462 Sheeva PJ4B 88sv581x
463 CPUID 0x561f581x
464 ARMv7, idivt, optional iWMMXt v2
465 Sheeva PJ4B-MP / PJ4C
466 CPUID 0x562f584x
467 ARMv7, idivt/idiva, LPAE, optional iWMMXt v2 and/or NEON
468
469Long-term plans
470---------------
471
472 * Unify the mach-dove/, mach-mv78xx0/, mach-orion5x/ into the
473 mach-mvebu/ to support all SoCs from the Marvell EBU (Engineering
474 Business Unit) in a single mach-<foo> directory. The plat-orion/
475 would therefore disappear.
476
477 * Unify the mach-mmp/ and mach-pxa/ into the same mach-pxa
478 directory. The plat-pxa/ would therefore disappear.
479
480Credits
481-------
482
483- Maen Suleiman <maen@marvell.com>
484- Lior Amsalem <alior@marvell.com>
485- Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
486- Andrew Lunn <andrew@lunn.ch>
487- Nicolas Pitre <nico@fluxnic.net>
488- Eric Miao <eric.y.miao@gmail.com>
diff --git a/Documentation/arm/mem_alignment b/Documentation/arm/mem_alignment.rst
index e110e2781039..aa22893b62bc 100644
--- a/Documentation/arm/mem_alignment
+++ b/Documentation/arm/mem_alignment.rst
@@ -1,3 +1,7 @@
1================
2Memory alignment
3================
4
1Too many problems popped up because of unnoticed misaligned memory access in 5Too many problems popped up because of unnoticed misaligned memory access in
2kernel code lately. Therefore the alignment fixup is now unconditionally 6kernel code lately. Therefore the alignment fixup is now unconditionally
3configured in for SA11x0 based targets. According to Alan Cox, this is a 7configured in for SA11x0 based targets. According to Alan Cox, this is a
@@ -26,9 +30,9 @@ space, and might cause programs to fail unexpectedly.
26To change the alignment trap behavior, simply echo a number into 30To change the alignment trap behavior, simply echo a number into
27/proc/cpu/alignment. The number is made up from various bits: 31/proc/cpu/alignment. The number is made up from various bits:
28 32
33=== ========================================================
29bit behavior when set 34bit behavior when set
30--- ----------------- 35=== ========================================================
31
320 A user process performing an unaligned memory access 360 A user process performing an unaligned memory access
33 will cause the kernel to print a message indicating 37 will cause the kernel to print a message indicating
34 process name, pid, pc, instruction, address, and the 38 process name, pid, pc, instruction, address, and the
@@ -41,12 +45,13 @@ bit behavior when set
41 45
422 The kernel will send a SIGBUS signal to the user process 462 The kernel will send a SIGBUS signal to the user process
43 performing the unaligned access. 47 performing the unaligned access.
48=== ========================================================
44 49
45Note that not all combinations are supported - only values 0 through 5. 50Note that not all combinations are supported - only values 0 through 5.
46(6 and 7 don't make sense). 51(6 and 7 don't make sense).
47 52
48For example, the following will turn on the warnings, but without 53For example, the following will turn on the warnings, but without
49fixing up or sending SIGBUS signals: 54fixing up or sending SIGBUS signals::
50 55
51 echo 1 > /proc/cpu/alignment 56 echo 1 > /proc/cpu/alignment
52 57
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.rst
index 546a39048eb0..0521b4ce5c96 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.rst
@@ -1,6 +1,9 @@
1 Kernel Memory Layout on ARM Linux 1=================================
2Kernel Memory Layout on ARM Linux
3=================================
2 4
3 Russell King <rmk@arm.linux.org.uk> 5 Russell King <rmk@arm.linux.org.uk>
6
4 November 17, 2005 (2.6.15) 7 November 17, 2005 (2.6.15)
5 8
6This document describes the virtual memory layout which the Linux 9This document describes the virtual memory layout which the Linux
@@ -15,8 +18,9 @@ As the ARM architecture matures, it becomes necessary to reserve
15certain regions of VM space for use for new facilities; therefore 18certain regions of VM space for use for new facilities; therefore
16this document may reserve more VM space over time. 19this document may reserve more VM space over time.
17 20
21=============== =============== ===============================================
18Start End Use 22Start End Use
19-------------------------------------------------------------------------- 23=============== =============== ===============================================
20ffff8000 ffffffff copy_user_page / clear_user_page use. 24ffff8000 ffffffff copy_user_page / clear_user_page use.
21 For SA11xx and Xscale, this is used to 25 For SA11xx and Xscale, this is used to
22 setup a minicache mapping. 26 setup a minicache mapping.
@@ -77,6 +81,7 @@ MODULES_VADDR MODULES_END-1 Kernel module space
77 place their vector page here. NULL pointer 81 place their vector page here. NULL pointer
78 dereferences by both the kernel and user 82 dereferences by both the kernel and user
79 space are also caught via this mapping. 83 space are also caught via this mapping.
84=============== =============== ===============================================
80 85
81Please note that mappings which collide with the above areas may result 86Please note that mappings which collide with the above areas may result
82in a non-bootable kernel, or may cause the kernel to (eventually) panic 87in a non-bootable kernel, or may cause the kernel to (eventually) panic
diff --git a/Documentation/arm/Microchip/README b/Documentation/arm/microchip.rst
index a366f37d38f1..c9a44c98e868 100644
--- a/Documentation/arm/Microchip/README
+++ b/Documentation/arm/microchip.rst
@@ -1,3 +1,4 @@
1=============================
1ARM Microchip SoCs (aka AT91) 2ARM Microchip SoCs (aka AT91)
2============================= 3=============================
3 4
@@ -22,32 +23,46 @@ the Microchip website: http://www.microchip.com.
22 Flavors: 23 Flavors:
23 * ARM 920 based SoC 24 * ARM 920 based SoC
24 - at91rm9200 25 - at91rm9200
25 + Datasheet 26
27 * Datasheet
28
26 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-1768-32-bit-ARM920T-Embedded-Microprocessor-AT91RM9200_Datasheet.pdf 29 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-1768-32-bit-ARM920T-Embedded-Microprocessor-AT91RM9200_Datasheet.pdf
27 30
28 * ARM 926 based SoCs 31 * ARM 926 based SoCs
29 - at91sam9260 32 - at91sam9260
30 + Datasheet 33
34 * Datasheet
35
31 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6221-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9260_Datasheet.pdf 36 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6221-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9260_Datasheet.pdf
32 37
33 - at91sam9xe 38 - at91sam9xe
34 + Datasheet 39
40 * Datasheet
41
35 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6254-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9XE_Datasheet.pdf 42 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6254-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9XE_Datasheet.pdf
36 43
37 - at91sam9261 44 - at91sam9261
38 + Datasheet 45
46 * Datasheet
47
39 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6062-ARM926EJ-S-Microprocessor-SAM9261_Datasheet.pdf 48 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6062-ARM926EJ-S-Microprocessor-SAM9261_Datasheet.pdf
40 49
41 - at91sam9263 50 - at91sam9263
42 + Datasheet 51
52 * Datasheet
53
43 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6249-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9263_Datasheet.pdf 54 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6249-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9263_Datasheet.pdf
44 55
45 - at91sam9rl 56 - at91sam9rl
46 + Datasheet 57
58 * Datasheet
59
47 http://ww1.microchip.com/downloads/en/DeviceDoc/doc6289.pdf 60 http://ww1.microchip.com/downloads/en/DeviceDoc/doc6289.pdf
48 61
49 - at91sam9g20 62 - at91sam9g20
50 + Datasheet 63
64 * Datasheet
65
51 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001516A.pdf 66 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001516A.pdf
52 67
53 - at91sam9g45 family 68 - at91sam9g45 family
@@ -55,7 +70,9 @@ the Microchip website: http://www.microchip.com.
55 - at91sam9g46 70 - at91sam9g46
56 - at91sam9m10 71 - at91sam9m10
57 - at91sam9m11 (device superset) 72 - at91sam9m11 (device superset)
58 + Datasheet 73
74 * Datasheet
75
59 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6437-32-bit-ARM926-Embedded-Microprocessor-SAM9M11_Datasheet.pdf 76 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6437-32-bit-ARM926-Embedded-Microprocessor-SAM9M11_Datasheet.pdf
60 77
61 - at91sam9x5 family (aka "The 5 series") 78 - at91sam9x5 family (aka "The 5 series")
@@ -64,33 +81,44 @@ the Microchip website: http://www.microchip.com.
64 - at91sam9g35 81 - at91sam9g35
65 - at91sam9x25 82 - at91sam9x25
66 - at91sam9x35 83 - at91sam9x35
67 + Datasheet (can be considered as covering the whole family) 84
85 * Datasheet (can be considered as covering the whole family)
86
68 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11055-32-bit-ARM926EJ-S-Microcontroller-SAM9X35_Datasheet.pdf 87 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11055-32-bit-ARM926EJ-S-Microcontroller-SAM9X35_Datasheet.pdf
69 88
70 - at91sam9n12 89 - at91sam9n12
71 + Datasheet 90
91 * Datasheet
92
72 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001517A.pdf 93 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001517A.pdf
73 94
74 * ARM Cortex-A5 based SoCs 95 * ARM Cortex-A5 based SoCs
75 - sama5d3 family 96 - sama5d3 family
97
76 - sama5d31 98 - sama5d31
77 - sama5d33 99 - sama5d33
78 - sama5d34 100 - sama5d34
79 - sama5d35 101 - sama5d35
80 - sama5d36 (device superset) 102 - sama5d36 (device superset)
81 + Datasheet 103
104 * Datasheet
105
82 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf 106 http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf
83 107
84 * ARM Cortex-A5 + NEON based SoCs 108 * ARM Cortex-A5 + NEON based SoCs
85 - sama5d4 family 109 - sama5d4 family
110
86 - sama5d41 111 - sama5d41
87 - sama5d42 112 - sama5d42
88 - sama5d43 113 - sama5d43
89 - sama5d44 (device superset) 114 - sama5d44 (device superset)
90 + Datasheet 115
116 * Datasheet
117
91 http://ww1.microchip.com/downloads/en/DeviceDoc/60001525A.pdf 118 http://ww1.microchip.com/downloads/en/DeviceDoc/60001525A.pdf
92 119
93 - sama5d2 family 120 - sama5d2 family
121
94 - sama5d21 122 - sama5d21
95 - sama5d22 123 - sama5d22
96 - sama5d23 124 - sama5d23
@@ -98,11 +126,14 @@ the Microchip website: http://www.microchip.com.
98 - sama5d26 126 - sama5d26
99 - sama5d27 (device superset) 127 - sama5d27 (device superset)
100 - sama5d28 (device superset + environmental monitors) 128 - sama5d28 (device superset + environmental monitors)
101 + Datasheet 129
130 * Datasheet
131
102 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001476B.pdf 132 http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001476B.pdf
103 133
104 * ARM Cortex-M7 MCUs 134 * ARM Cortex-M7 MCUs
105 - sams70 family 135 - sams70 family
136
106 - sams70j19 137 - sams70j19
107 - sams70j20 138 - sams70j20
108 - sams70j21 139 - sams70j21
@@ -114,6 +145,7 @@ the Microchip website: http://www.microchip.com.
114 - sams70q21 145 - sams70q21
115 146
116 - samv70 family 147 - samv70 family
148
117 - samv70j19 149 - samv70j19
118 - samv70j20 150 - samv70j20
119 - samv70n19 151 - samv70n19
@@ -122,6 +154,7 @@ the Microchip website: http://www.microchip.com.
122 - samv70q20 154 - samv70q20
123 155
124 - samv71 family 156 - samv71 family
157
125 - samv71j19 158 - samv71j19
126 - samv71j20 159 - samv71j20
127 - samv71j21 160 - samv71j21
@@ -132,7 +165,8 @@ the Microchip website: http://www.microchip.com.
132 - samv71q20 165 - samv71q20
133 - samv71q21 166 - samv71q21
134 167
135 + Datasheet 168 * Datasheet
169
136 http://ww1.microchip.com/downloads/en/DeviceDoc/60001527A.pdf 170 http://ww1.microchip.com/downloads/en/DeviceDoc/60001527A.pdf
137 171
138 172
@@ -157,6 +191,7 @@ definition of a "Stable" binding/ABI.
157This statement will be removed by AT91 MAINTAINERS when appropriate. 191This statement will be removed by AT91 MAINTAINERS when appropriate.
158 192
159Naming conventions and best practice: 193Naming conventions and best practice:
194
160- SoCs Device Tree Source Include files are named after the official name of 195- SoCs Device Tree Source Include files are named after the official name of
161 the product (at91sam9g20.dtsi or sama5d33.dtsi for instance). 196 the product (at91sam9g20.dtsi or sama5d33.dtsi for instance).
162- Device Tree Source Include files (.dtsi) are used to collect common nodes that can be 197- Device Tree Source Include files (.dtsi) are used to collect common nodes that can be
diff --git a/Documentation/arm/netwinder.rst b/Documentation/arm/netwinder.rst
new file mode 100644
index 000000000000..8eab66caa2ac
--- /dev/null
+++ b/Documentation/arm/netwinder.rst
@@ -0,0 +1,85 @@
1================================
2NetWinder specific documentation
3================================
4
5The NetWinder is a small low-power computer, primarily designed
6to run Linux. It is based around the StrongARM RISC processor,
7DC21285 PCI bridge, with PC-type hardware glued around it.
8
9Port usage
10==========
11
12======= ====== ===============================
13Min Max Description
14======= ====== ===============================
150x0000 0x000f DMA1
160x0020 0x0021 PIC1
170x0060 0x006f Keyboard
180x0070 0x007f RTC
190x0080 0x0087 DMA1
200x0088 0x008f DMA2
210x00a0 0x00a3 PIC2
220x00c0 0x00df DMA2
230x0180 0x0187 IRDA
240x01f0 0x01f6 ide0
250x0201 Game port
260x0203 RWA010 configuration read
270x0220 ? SoundBlaster
280x0250 ? WaveArtist
290x0279 RWA010 configuration index
300x02f8 0x02ff Serial ttyS1
310x0300 0x031f Ether10
320x0338 GPIO1
330x033a GPIO2
340x0370 0x0371 W83977F configuration registers
350x0388 ? AdLib
360x03c0 0x03df VGA
370x03f6 ide0
380x03f8 0x03ff Serial ttyS0
390x0400 0x0408 DC21143
400x0480 0x0487 DMA1
410x0488 0x048f DMA2
420x0a79 RWA010 configuration write
430xe800 0xe80f ide0/ide1 BM DMA
44======= ====== ===============================
45
46
47Interrupt usage
48===============
49
50======= ======= ========================
51IRQ type Description
52======= ======= ========================
53 0 ISA 100Hz timer
54 1 ISA Keyboard
55 2 ISA cascade
56 3 ISA Serial ttyS1
57 4 ISA Serial ttyS0
58 5 ISA PS/2 mouse
59 6 ISA IRDA
60 7 ISA Printer
61 8 ISA RTC alarm
62 9 ISA
6310 ISA GP10 (Orange reset button)
6411 ISA
6512 ISA WaveArtist
6613 ISA
6714 ISA hda1
6815 ISA
69======= ======= ========================
70
71DMA usage
72=========
73
74======= ======= ===========
75DMA type Description
76======= ======= ===========
77 0 ISA IRDA
78 1 ISA
79 2 ISA cascade
80 3 ISA WaveArtist
81 4 ISA
82 5 ISA
83 6 ISA
84 7 ISA WaveArtist
85======= ======= ===========
diff --git a/Documentation/arm/nwfpe/index.rst b/Documentation/arm/nwfpe/index.rst
new file mode 100644
index 000000000000..3c4d2f9aa10e
--- /dev/null
+++ b/Documentation/arm/nwfpe/index.rst
@@ -0,0 +1,13 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===================================
4NetWinder's floating point emulator
5===================================
6
7.. toctree::
8 :maxdepth: 1
9
10 nwfpe
11 netwinder-fpe
12 notes
13 todo
diff --git a/Documentation/arm/nwfpe/README.FPE b/Documentation/arm/nwfpe/netwinder-fpe.rst
index 26f5d7bb9a41..cbb320960fc4 100644
--- a/Documentation/arm/nwfpe/README.FPE
+++ b/Documentation/arm/nwfpe/netwinder-fpe.rst
@@ -1,12 +1,18 @@
1=============
2Current State
3=============
4
1The following describes the current state of the NetWinder's floating point 5The following describes the current state of the NetWinder's floating point
2emulator. 6emulator.
3 7
4In the following nomenclature is used to describe the floating point 8In the following nomenclature is used to describe the floating point
5instructions. It follows the conventions in the ARM manual. 9instructions. It follows the conventions in the ARM manual.
6 10
7<S|D|E> = <single|double|extended>, no default 11::
8{P|M|Z} = {round to +infinity,round to -infinity,round to zero}, 12
9 default = round to nearest 13 <S|D|E> = <single|double|extended>, no default
14 {P|M|Z} = {round to +infinity,round to -infinity,round to zero},
15 default = round to nearest
10 16
11Note: items enclosed in {} are optional. 17Note: items enclosed in {} are optional.
12 18
@@ -32,10 +38,10 @@ Form 2 syntax:
32<LFM|SFM>{cond}<FD,EA> Fd, <count>, [Rn]{!} 38<LFM|SFM>{cond}<FD,EA> Fd, <count>, [Rn]{!}
33 39
34These instructions are fully implemented. They store/load three words 40These instructions are fully implemented. They store/load three words
35for each floating point register into the memory location given in the 41for each floating point register into the memory location given in the
36instruction. The format in memory is unlikely to be compatible with 42instruction. The format in memory is unlikely to be compatible with
37other implementations, in particular the actual hardware. Specific 43other implementations, in particular the actual hardware. Specific
38mention of this is made in the ARM manuals. 44mention of this is made in the ARM manuals.
39 45
40Floating Point Coprocessor Register Transfer Instructions (CPRT) 46Floating Point Coprocessor Register Transfer Instructions (CPRT)
41---------------------------------------------------------------- 47----------------------------------------------------------------
@@ -123,7 +129,7 @@ RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
123POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2) 129POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
124 130
125LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10 131LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10
126LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e 132LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e
127EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent 133EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent
128SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine 134SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine
129COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine 135COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
@@ -134,7 +140,7 @@ ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent
134 140
135These are not implemented. They are not currently issued by the compiler, 141These are not implemented. They are not currently issued by the compiler,
136and are handled by routines in libc. These are not implemented by the FPA11 142and are handled by routines in libc. These are not implemented by the FPA11
137hardware, but are handled by the floating point support code. They should 143hardware, but are handled by the floating point support code. They should
138be implemented in future versions. 144be implemented in future versions.
139 145
140Signalling: 146Signalling:
@@ -147,10 +153,10 @@ current_set[0] correctly.
147The kernel provided with this distribution (vmlinux-nwfpe-0.93) contains 153The kernel provided with this distribution (vmlinux-nwfpe-0.93) contains
148a fix for this problem and also incorporates the current version of the 154a fix for this problem and also incorporates the current version of the
149emulator directly. It is possible to run with no floating point module 155emulator directly. It is possible to run with no floating point module
150loaded with this kernel. It is provided as a demonstration of the 156loaded with this kernel. It is provided as a demonstration of the
151technology and for those who want to do floating point work that depends 157technology and for those who want to do floating point work that depends
152on signals. It is not strictly necessary to use the module. 158on signals. It is not strictly necessary to use the module.
153 159
154A module (either the one provided by Russell King, or the one in this 160A module (either the one provided by Russell King, or the one in this
155distribution) can be loaded to replace the functionality of the emulator 161distribution) can be loaded to replace the functionality of the emulator
156built into the kernel. 162built into the kernel.
diff --git a/Documentation/arm/nwfpe/NOTES b/Documentation/arm/nwfpe/notes.rst
index 40577b5a49d3..102e55af8439 100644
--- a/Documentation/arm/nwfpe/NOTES
+++ b/Documentation/arm/nwfpe/notes.rst
@@ -1,3 +1,6 @@
1Notes
2=====
3
1There seems to be a problem with exp(double) and our emulator. I haven't 4There seems to be a problem with exp(double) and our emulator. I haven't
2been able to track it down yet. This does not occur with the emulator 5been able to track it down yet. This does not occur with the emulator
3supplied by Russell King. 6supplied by Russell King.
diff --git a/Documentation/arm/nwfpe/README b/Documentation/arm/nwfpe/nwfpe.rst
index 771871de0c8b..35cd90dacbff 100644
--- a/Documentation/arm/nwfpe/README
+++ b/Documentation/arm/nwfpe/nwfpe.rst
@@ -1,4 +1,7 @@
1This directory contains the version 0.92 test release of the NetWinder 1Introduction
2============
3
4This directory contains the version 0.92 test release of the NetWinder
2Floating Point Emulator. 5Floating Point Emulator.
3 6
4The majority of the code was written by me, Scott Bambrough It is 7The majority of the code was written by me, Scott Bambrough It is
@@ -31,7 +34,7 @@ SoftFloat to the ARM was done by Phil Blundell, based on an earlier
31port of SoftFloat version 1 by Neil Carson for NetBSD/arm32. 34port of SoftFloat version 1 by Neil Carson for NetBSD/arm32.
32 35
33The file README.FPE contains a description of what has been implemented 36The file README.FPE contains a description of what has been implemented
34so far in the emulator. The file TODO contains a information on what 37so far in the emulator. The file TODO contains a information on what
35remains to be done, and other ideas for the emulator. 38remains to be done, and other ideas for the emulator.
36 39
37Bug reports, comments, suggestions should be directed to me at 40Bug reports, comments, suggestions should be directed to me at
@@ -48,10 +51,11 @@ Legal Notices
48 51
49The NetWinder Floating Point Emulator is free software. Everything Rebel.com 52The NetWinder Floating Point Emulator is free software. Everything Rebel.com
50has written is provided under the GNU GPL. See the file COPYING for copying 53has written is provided under the GNU GPL. See the file COPYING for copying
51conditions. Excluded from the above is the SoftFloat code. John Hauser's 54conditions. Excluded from the above is the SoftFloat code. John Hauser's
52legal notice for SoftFloat is included below. 55legal notice for SoftFloat is included below.
53 56
54------------------------------------------------------------------------------- 57-------------------------------------------------------------------------------
58
55SoftFloat Legal Notice 59SoftFloat Legal Notice
56 60
57SoftFloat was written by John R. Hauser. This work was made possible in 61SoftFloat was written by John R. Hauser. This work was made possible in
diff --git a/Documentation/arm/nwfpe/TODO b/Documentation/arm/nwfpe/todo.rst
index 8027061b60eb..393f11b14540 100644
--- a/Documentation/arm/nwfpe/TODO
+++ b/Documentation/arm/nwfpe/todo.rst
@@ -1,39 +1,42 @@
1TODO LIST 1TODO LIST
2--------- 2=========
3 3
4POW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - power 4::
5RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
6POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
7 5
8LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10 6 POW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - power
9LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e 7 RPW{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - reverse power
10EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent 8 POL{cond}<S|D|E>{P,M,Z} Fd, Fn, <Fm,#value> - polar angle (arctan2)
11SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine 9
12COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine 10 LOG{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base 10
13TAN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - tangent 11 LGN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - logarithm to base e
14ASN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arcsine 12 EXP{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - exponent
15ACS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arccosine 13 SIN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - sine
16ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent 14 COS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - cosine
15 TAN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - tangent
16 ASN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arcsine
17 ACS{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arccosine
18 ATN{cond}<S|D|E>{P,M,Z} Fd, <Fm,#value> - arctangent
17 19
18These are not implemented. They are not currently issued by the compiler, 20These are not implemented. They are not currently issued by the compiler,
19and are handled by routines in libc. These are not implemented by the FPA11 21and are handled by routines in libc. These are not implemented by the FPA11
20hardware, but are handled by the floating point support code. They should 22hardware, but are handled by the floating point support code. They should
21be implemented in future versions. 23be implemented in future versions.
22 24
23There are a couple of ways to approach the implementation of these. One 25There are a couple of ways to approach the implementation of these. One
24method would be to use accurate table methods for these routines. I have 26method would be to use accurate table methods for these routines. I have
25a couple of papers by S. Gal from IBM's research labs in Haifa, Israel that 27a couple of papers by S. Gal from IBM's research labs in Haifa, Israel that
26seem to promise extreme accuracy (in the order of 99.8%) and reasonable speed. 28seem to promise extreme accuracy (in the order of 99.8%) and reasonable speed.
27These methods are used in GLIBC for some of the transcendental functions. 29These methods are used in GLIBC for some of the transcendental functions.
28 30
29Another approach, which I know little about is CORDIC. This stands for 31Another approach, which I know little about is CORDIC. This stands for
30Coordinate Rotation Digital Computer, and is a method of computing 32Coordinate Rotation Digital Computer, and is a method of computing
31transcendental functions using mostly shifts and adds and a few 33transcendental functions using mostly shifts and adds and a few
32multiplications and divisions. The ARM excels at shifts and adds, 34multiplications and divisions. The ARM excels at shifts and adds,
33so such a method could be promising, but requires more research to 35so such a method could be promising, but requires more research to
34determine if it is feasible. 36determine if it is feasible.
35 37
36Rounding Methods 38Rounding Methods
39----------------
37 40
38The IEEE standard defines 4 rounding modes. Round to nearest is the 41The IEEE standard defines 4 rounding modes. Round to nearest is the
39default, but rounding to + or - infinity or round to zero are also allowed. 42default, but rounding to + or - infinity or round to zero are also allowed.
@@ -42,8 +45,8 @@ in a control register. Not so with the ARM FPA11 architecture. To change
42the rounding mode one must specify it with each instruction. 45the rounding mode one must specify it with each instruction.
43 46
44This has made porting some benchmarks difficult. It is possible to 47This has made porting some benchmarks difficult. It is possible to
45introduce such a capability into the emulator. The FPCR contains 48introduce such a capability into the emulator. The FPCR contains
46bits describing the rounding mode. The emulator could be altered to 49bits describing the rounding mode. The emulator could be altered to
47examine a flag, which if set forced it to ignore the rounding mode in 50examine a flag, which if set forced it to ignore the rounding mode in
48the instruction, and use the mode specified in the bits in the FPCR. 51the instruction, and use the mode specified in the bits in the FPCR.
49 52
@@ -52,7 +55,8 @@ in the FPCR. This requires a kernel call in ArmLinux, as WFC/RFC are
52supervisor only instructions. If anyone has any ideas or comments I 55supervisor only instructions. If anyone has any ideas or comments I
53would like to hear them. 56would like to hear them.
54 57
55[NOTE: pulled out from some docs on ARM floating point, specifically 58NOTE:
59 pulled out from some docs on ARM floating point, specifically
56 for the Acorn FPE, but not limited to it: 60 for the Acorn FPE, but not limited to it:
57 61
58 The floating point control register (FPCR) may only be present in some 62 The floating point control register (FPCR) may only be present in some
@@ -64,4 +68,5 @@ would like to hear them.
64 68
65 Hence, the answer is yes, you could do this, but then you will run a high 69 Hence, the answer is yes, you could do this, but then you will run a high
66 risk of becoming isolated if and when hardware FP emulation comes out 70 risk of becoming isolated if and when hardware FP emulation comes out
67 -- Russell]. 71
72 -- Russell.
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/omap/dss.rst
index 4484e021290e..a40c4d9c717a 100644
--- a/Documentation/arm/OMAP/DSS
+++ b/Documentation/arm/omap/dss.rst
@@ -1,5 +1,6 @@
1=========================
1OMAP2/3 Display Subsystem 2OMAP2/3 Display Subsystem
2------------------------- 3=========================
3 4
4This is an almost total rewrite of the OMAP FB driver in drivers/video/omap 5This is an almost total rewrite of the OMAP FB driver in drivers/video/omap
5(let's call it DSS1). The main differences between DSS1 and DSS2 are DSI, 6(let's call it DSS1). The main differences between DSS1 and DSS2 are DSI,
@@ -190,6 +191,8 @@ trans_key_value transparency color key (RGB24)
190default_color default background color (RGB24) 191default_color default background color (RGB24)
191 192
192/sys/devices/platform/omapdss/display? directory: 193/sys/devices/platform/omapdss/display? directory:
194
195=============== =============================================================
193ctrl_name Controller name 196ctrl_name Controller name
194mirror 0=off, 1=on 197mirror 0=off, 1=on
195update_mode 0=off, 1=auto, 2=manual 198update_mode 0=off, 1=auto, 2=manual
@@ -202,6 +205,7 @@ timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
202panel_name 205panel_name
203tear_elim Tearing elimination 0=off, 1=on 206tear_elim Tearing elimination 0=off, 1=on
204output_type Output type (video encoder only): "composite" or "svideo" 207output_type Output type (video encoder only): "composite" or "svideo"
208=============== =============================================================
205 209
206There are also some debugfs files at <debugfs>/omapdss/ which show information 210There are also some debugfs files at <debugfs>/omapdss/ which show information
207about clocks and registers. 211about clocks and registers.
@@ -209,22 +213,22 @@ about clocks and registers.
209Examples 213Examples
210-------- 214--------
211 215
212The following definitions have been made for the examples below: 216The following definitions have been made for the examples below::
213 217
214ovl0=/sys/devices/platform/omapdss/overlay0 218 ovl0=/sys/devices/platform/omapdss/overlay0
215ovl1=/sys/devices/platform/omapdss/overlay1 219 ovl1=/sys/devices/platform/omapdss/overlay1
216ovl2=/sys/devices/platform/omapdss/overlay2 220 ovl2=/sys/devices/platform/omapdss/overlay2
217 221
218mgr0=/sys/devices/platform/omapdss/manager0 222 mgr0=/sys/devices/platform/omapdss/manager0
219mgr1=/sys/devices/platform/omapdss/manager1 223 mgr1=/sys/devices/platform/omapdss/manager1
220 224
221lcd=/sys/devices/platform/omapdss/display0 225 lcd=/sys/devices/platform/omapdss/display0
222dvi=/sys/devices/platform/omapdss/display1 226 dvi=/sys/devices/platform/omapdss/display1
223tv=/sys/devices/platform/omapdss/display2 227 tv=/sys/devices/platform/omapdss/display2
224 228
225fb0=/sys/class/graphics/fb0 229 fb0=/sys/class/graphics/fb0
226fb1=/sys/class/graphics/fb1 230 fb1=/sys/class/graphics/fb1
227fb2=/sys/class/graphics/fb2 231 fb2=/sys/class/graphics/fb2
228 232
229Default setup on OMAP3 SDP 233Default setup on OMAP3 SDP
230-------------------------- 234--------------------------
@@ -232,55 +236,59 @@ Default setup on OMAP3 SDP
232Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI 236Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
233and TV-out are not in use. The columns from left to right are: 237and TV-out are not in use. The columns from left to right are:
234framebuffers, overlays, overlay managers, displays. Framebuffers are 238framebuffers, overlays, overlay managers, displays. Framebuffers are
235handled by omapfb, and the rest by the DSS. 239handled by omapfb, and the rest by the DSS::
236 240
237FB0 --- GFX -\ DVI 241 FB0 --- GFX -\ DVI
238FB1 --- VID1 --+- LCD ---- LCD 242 FB1 --- VID1 --+- LCD ---- LCD
239FB2 --- VID2 -/ TV ----- TV 243 FB2 --- VID2 -/ TV ----- TV
240 244
241Example: Switch from LCD to DVI 245Example: Switch from LCD to DVI
242---------------------- 246-------------------------------
247
248::
243 249
244w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1` 250 w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
245h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1` 251 h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
246 252
247echo "0" > $lcd/enabled 253 echo "0" > $lcd/enabled
248echo "" > $mgr0/display 254 echo "" > $mgr0/display
249fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h 255 fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
250# at this point you have to switch the dvi/lcd dip-switch from the omap board 256 # at this point you have to switch the dvi/lcd dip-switch from the omap board
251echo "dvi" > $mgr0/display 257 echo "dvi" > $mgr0/display
252echo "1" > $dvi/enabled 258 echo "1" > $dvi/enabled
253 259
254After this the configuration looks like: 260After this the configuration looks like:::
255 261
256FB0 --- GFX -\ -- DVI 262 FB0 --- GFX -\ -- DVI
257FB1 --- VID1 --+- LCD -/ LCD 263 FB1 --- VID1 --+- LCD -/ LCD
258FB2 --- VID2 -/ TV ----- TV 264 FB2 --- VID2 -/ TV ----- TV
259 265
260Example: Clone GFX overlay to LCD and TV 266Example: Clone GFX overlay to LCD and TV
261------------------------------- 267----------------------------------------
268
269::
262 270
263w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1` 271 w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
264h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1` 272 h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
265 273
266echo "0" > $ovl0/enabled 274 echo "0" > $ovl0/enabled
267echo "0" > $ovl1/enabled 275 echo "0" > $ovl1/enabled
268 276
269echo "" > $fb1/overlays 277 echo "" > $fb1/overlays
270echo "0,1" > $fb0/overlays 278 echo "0,1" > $fb0/overlays
271 279
272echo "$w,$h" > $ovl1/output_size 280 echo "$w,$h" > $ovl1/output_size
273echo "tv" > $ovl1/manager 281 echo "tv" > $ovl1/manager
274 282
275echo "1" > $ovl0/enabled 283 echo "1" > $ovl0/enabled
276echo "1" > $ovl1/enabled 284 echo "1" > $ovl1/enabled
277 285
278echo "1" > $tv/enabled 286 echo "1" > $tv/enabled
279 287
280After this the configuration looks like (only relevant parts shown): 288After this the configuration looks like (only relevant parts shown)::
281 289
282FB0 +-- GFX ---- LCD ---- LCD 290 FB0 +-- GFX ---- LCD ---- LCD
283 \- VID1 ---- TV ---- TV 291 \- VID1 ---- TV ---- TV
284 292
285Misc notes 293Misc notes
286---------- 294----------
@@ -351,12 +359,14 @@ TODO
351DSS locking 359DSS locking
352 360
353Error checking 361Error checking
362
354- Lots of checks are missing or implemented just as BUG() 363- Lots of checks are missing or implemented just as BUG()
355 364
356System DMA update for DSI 365System DMA update for DSI
366
357- Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how 367- Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
358 to skip the empty byte?) 368 to skip the empty byte?)
359 369
360OMAP1 support 370OMAP1 support
361- Not sure if needed
362 371
372- Not sure if needed
diff --git a/Documentation/arm/omap/index.rst b/Documentation/arm/omap/index.rst
new file mode 100644
index 000000000000..8b365b212e49
--- /dev/null
+++ b/Documentation/arm/omap/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=======
4TI OMAP
5=======
6
7.. toctree::
8 :maxdepth: 1
9
10 omap
11 omap_pm
12 dss
diff --git a/Documentation/arm/OMAP/README b/Documentation/arm/omap/omap.rst
index 90c6c57d61e8..f440c0f4613f 100644
--- a/Documentation/arm/OMAP/README
+++ b/Documentation/arm/omap/omap.rst
@@ -1,7 +1,13 @@
1============
2OMAP history
3============
4
1This file contains documentation for running mainline 5This file contains documentation for running mainline
2kernel on omaps. 6kernel on omaps.
3 7
8====== ======================================================
4KERNEL NEW DEPENDENCIES 9KERNEL NEW DEPENDENCIES
10====== ======================================================
5v4.3+ Update is needed for custom .config files to make sure 11v4.3+ Update is needed for custom .config files to make sure
6 CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work 12 CONFIG_REGULATOR_PBIAS is enabled for MMC1 to work
7 properly. 13 properly.
@@ -9,3 +15,4 @@ v4.3+ Update is needed for custom .config files to make sure
9v4.18+ Update is needed for custom .config files to make sure 15v4.18+ Update is needed for custom .config files to make sure
10 CONFIG_MMC_SDHCI_OMAP is enabled for all MMC instances 16 CONFIG_MMC_SDHCI_OMAP is enabled for all MMC instances
11 to work in DRA7 and K2G based boards. 17 to work in DRA7 and K2G based boards.
18====== ======================================================
diff --git a/Documentation/arm/OMAP/omap_pm b/Documentation/arm/omap/omap_pm.rst
index 4ae915a9f899..a335e4c8ce2c 100644
--- a/Documentation/arm/OMAP/omap_pm
+++ b/Documentation/arm/omap/omap_pm.rst
@@ -1,4 +1,4 @@
1 1=====================
2The OMAP PM interface 2The OMAP PM interface
3===================== 3=====================
4 4
@@ -31,19 +31,24 @@ Drivers need to express PM parameters which:
31This document proposes the OMAP PM interface, including the following 31This document proposes the OMAP PM interface, including the following
32five power management functions for driver code: 32five power management functions for driver code:
33 33
341. Set the maximum MPU wakeup latency: 341. Set the maximum MPU wakeup latency::
35
35 (*pdata->set_max_mpu_wakeup_lat)(struct device *dev, unsigned long t) 36 (*pdata->set_max_mpu_wakeup_lat)(struct device *dev, unsigned long t)
36 37
372. Set the maximum device wakeup latency: 382. Set the maximum device wakeup latency::
39
38 (*pdata->set_max_dev_wakeup_lat)(struct device *dev, unsigned long t) 40 (*pdata->set_max_dev_wakeup_lat)(struct device *dev, unsigned long t)
39 41
403. Set the maximum system DMA transfer start latency (CORE pwrdm): 423. Set the maximum system DMA transfer start latency (CORE pwrdm)::
43
41 (*pdata->set_max_sdma_lat)(struct device *dev, long t) 44 (*pdata->set_max_sdma_lat)(struct device *dev, long t)
42 45
434. Set the minimum bus throughput needed by a device: 464. Set the minimum bus throughput needed by a device::
47
44 (*pdata->set_min_bus_tput)(struct device *dev, u8 agent_id, unsigned long r) 48 (*pdata->set_min_bus_tput)(struct device *dev, u8 agent_id, unsigned long r)
45 49
465. Return the number of times the device has lost context 505. Return the number of times the device has lost context::
51
47 (*pdata->get_dev_context_loss_count)(struct device *dev) 52 (*pdata->get_dev_context_loss_count)(struct device *dev)
48 53
49 54
@@ -65,12 +70,13 @@ Driver usage of the OMAP PM functions
65 70
66As the 'pdata' in the above examples indicates, these functions are 71As the 'pdata' in the above examples indicates, these functions are
67exposed to drivers through function pointers in driver .platform_data 72exposed to drivers through function pointers in driver .platform_data
68structures. The function pointers are initialized by the board-*.c 73structures. The function pointers are initialized by the `board-*.c`
69files to point to the corresponding OMAP PM functions: 74files to point to the corresponding OMAP PM functions:
70.set_max_dev_wakeup_lat will point to 75
71omap_pm_set_max_dev_wakeup_lat(), etc. Other architectures which do 76- set_max_dev_wakeup_lat will point to
72not support these functions should leave these function pointers set 77 omap_pm_set_max_dev_wakeup_lat(), etc. Other architectures which do
73to NULL. Drivers should use the following idiom: 78 not support these functions should leave these function pointers set
79 to NULL. Drivers should use the following idiom::
74 80
75 if (pdata->set_max_dev_wakeup_lat) 81 if (pdata->set_max_dev_wakeup_lat)
76 (*pdata->set_max_dev_wakeup_lat)(dev, t); 82 (*pdata->set_max_dev_wakeup_lat)(dev, t);
@@ -81,7 +87,7 @@ becomes accessible. To accomplish this, driver writers should use the
81set_max_mpu_wakeup_lat() function to constrain the MPU wakeup 87set_max_mpu_wakeup_lat() function to constrain the MPU wakeup
82latency, and the set_max_dev_wakeup_lat() function to constrain the 88latency, and the set_max_dev_wakeup_lat() function to constrain the
83device wakeup latency (from clk_enable() to accessibility). For 89device wakeup latency (from clk_enable() to accessibility). For
84example, 90example::
85 91
86 /* Limit MPU wakeup latency */ 92 /* Limit MPU wakeup latency */
87 if (pdata->set_max_mpu_wakeup_lat) 93 if (pdata->set_max_mpu_wakeup_lat)
@@ -116,17 +122,17 @@ specialized cases to convert that input information (OPPs/MPU
116frequency) into the form that the underlying power management 122frequency) into the form that the underlying power management
117implementation needs: 123implementation needs:
118 124
1196. (*pdata->dsp_get_opp_table)(void) 1256. `(*pdata->dsp_get_opp_table)(void)`
120 126
1217. (*pdata->dsp_set_min_opp)(u8 opp_id) 1277. `(*pdata->dsp_set_min_opp)(u8 opp_id)`
122 128
1238. (*pdata->dsp_get_opp)(void) 1298. `(*pdata->dsp_get_opp)(void)`
124 130
1259. (*pdata->cpu_get_freq_table)(void) 1319. `(*pdata->cpu_get_freq_table)(void)`
126 132
12710. (*pdata->cpu_set_freq)(unsigned long f) 13310. `(*pdata->cpu_set_freq)(unsigned long f)`
128 134
12911. (*pdata->cpu_get_freq)(void) 13511. `(*pdata->cpu_get_freq)(void)`
130 136
131Customizing OPP for platform 137Customizing OPP for platform
132============================ 138============================
@@ -134,12 +140,15 @@ Defining CONFIG_PM should enable OPP layer for the silicon
134and the registration of OPP table should take place automatically. 140and the registration of OPP table should take place automatically.
135However, in special cases, the default OPP table may need to be 141However, in special cases, the default OPP table may need to be
136tweaked, for e.g.: 142tweaked, for e.g.:
143
137 * enable default OPPs which are disabled by default, but which 144 * enable default OPPs which are disabled by default, but which
138 could be enabled on a platform 145 could be enabled on a platform
139 * Disable an unsupported OPP on the platform 146 * Disable an unsupported OPP on the platform
140 * Define and add a custom opp table entry 147 * Define and add a custom opp table entry
141in these cases, the board file needs to do additional steps as follows: 148 in these cases, the board file needs to do additional steps as follows:
142arch/arm/mach-omapx/board-xyz.c 149
150arch/arm/mach-omapx/board-xyz.c::
151
143 #include "pm.h" 152 #include "pm.h"
144 .... 153 ....
145 static void __init omap_xyz_init_irq(void) 154 static void __init omap_xyz_init_irq(void)
@@ -150,5 +159,7 @@ arch/arm/mach-omapx/board-xyz.c
150 /* Do customization to the defaults */ 159 /* Do customization to the defaults */
151 .... 160 ....
152 } 161 }
153NOTE: omapx_opp_init will be omap3_opp_init or as required 162
154based on the omap family. 163NOTE:
164 omapx_opp_init will be omap3_opp_init or as required
165 based on the omap family.
diff --git a/Documentation/arm/Porting b/Documentation/arm/porting.rst
index a492233931b9..bd21958bdb2d 100644
--- a/Documentation/arm/Porting
+++ b/Documentation/arm/porting.rst
@@ -1,3 +1,7 @@
1=======
2Porting
3=======
4
1Taken from list archive at http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2001-July/004064.html 5Taken from list archive at http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2001-July/004064.html
2 6
3Initial definitions 7Initial definitions
@@ -89,8 +93,7 @@ DATAADDR
89 Virtual address for the kernel data segment. Must not be defined 93 Virtual address for the kernel data segment. Must not be defined
90 when using the decompressor. 94 when using the decompressor.
91 95
92VMALLOC_START 96VMALLOC_START / VMALLOC_END
93VMALLOC_END
94 Virtual addresses bounding the vmalloc() area. There must not be 97 Virtual addresses bounding the vmalloc() area. There must not be
95 any static mappings in this area; vmalloc will overwrite them. 98 any static mappings in this area; vmalloc will overwrite them.
96 The addresses must also be in the kernel segment (see above). 99 The addresses must also be in the kernel segment (see above).
@@ -107,13 +110,13 @@ Architecture Specific Macros
107---------------------------- 110----------------------------
108 111
109BOOT_MEM(pram,pio,vio) 112BOOT_MEM(pram,pio,vio)
110 `pram' specifies the physical start address of RAM. Must always 113 `pram` specifies the physical start address of RAM. Must always
111 be present, and should be the same as PHYS_OFFSET. 114 be present, and should be the same as PHYS_OFFSET.
112 115
113 `pio' is the physical address of an 8MB region containing IO for 116 `pio` is the physical address of an 8MB region containing IO for
114 use with the debugging macros in arch/arm/kernel/debug-armv.S. 117 use with the debugging macros in arch/arm/kernel/debug-armv.S.
115 118
116 `vio' is the virtual address of the 8MB debugging region. 119 `vio` is the virtual address of the 8MB debugging region.
117 120
118 It is expected that the debugging region will be re-initialised 121 It is expected that the debugging region will be re-initialised
119 by the architecture specific code later in the code (via the 122 by the architecture specific code later in the code (via the
@@ -132,4 +135,3 @@ MAPIO(func)
132 135
133INITIRQ(func) 136INITIRQ(func)
134 Machine specific function to initialise interrupts. 137 Machine specific function to initialise interrupts.
135
diff --git a/Documentation/arm/pxa/mfp.txt b/Documentation/arm/pxa/mfp.rst
index 0b7cab978c02..ac34e5d7ee44 100644
--- a/Documentation/arm/pxa/mfp.txt
+++ b/Documentation/arm/pxa/mfp.rst
@@ -1,4 +1,6 @@
1 MFP Configuration for PXA2xx/PXA3xx Processors 1==============================================
2MFP Configuration for PXA2xx/PXA3xx Processors
3==============================================
2 4
3 Eric Miao <eric.miao@marvell.com> 5 Eric Miao <eric.miao@marvell.com>
4 6
@@ -6,15 +8,15 @@ MFP stands for Multi-Function Pin, which is the pin-mux logic on PXA3xx and
6later PXA series processors. This document describes the existing MFP API, 8later PXA series processors. This document describes the existing MFP API,
7and how board/platform driver authors could make use of it. 9and how board/platform driver authors could make use of it.
8 10
9 Basic Concept 11Basic Concept
10=============== 12=============
11 13
12Unlike the GPIO alternate function settings on PXA25x and PXA27x, a new MFP 14Unlike the GPIO alternate function settings on PXA25x and PXA27x, a new MFP
13mechanism is introduced from PXA3xx to completely move the pin-mux functions 15mechanism is introduced from PXA3xx to completely move the pin-mux functions
14out of the GPIO controller. In addition to pin-mux configurations, the MFP 16out of the GPIO controller. In addition to pin-mux configurations, the MFP
15also controls the low power state, driving strength, pull-up/down and event 17also controls the low power state, driving strength, pull-up/down and event
16detection of each pin. Below is a diagram of internal connections between 18detection of each pin. Below is a diagram of internal connections between
17the MFP logic and the remaining SoC peripherals: 19the MFP logic and the remaining SoC peripherals::
18 20
19 +--------+ 21 +--------+
20 | |--(GPIO19)--+ 22 | |--(GPIO19)--+
@@ -69,8 +71,8 @@ NOTE: with such a clear separation of MFP and GPIO, by GPIO<xx> we normally
69mean it is a GPIO signal, and by MFP<xxx> or pin xxx, we mean a physical 71mean it is a GPIO signal, and by MFP<xxx> or pin xxx, we mean a physical
70pad (or ball). 72pad (or ball).
71 73
72 MFP API Usage 74MFP API Usage
73=============== 75=============
74 76
75For board code writers, here are some guidelines: 77For board code writers, here are some guidelines:
76 78
@@ -94,9 +96,9 @@ For board code writers, here are some guidelines:
94 PXA310 supporting some additional ones), thus the difference is actually 96 PXA310 supporting some additional ones), thus the difference is actually
95 covered in a single mfp-pxa300.h. 97 covered in a single mfp-pxa300.h.
96 98
972. prepare an array for the initial pin configurations, e.g.: 992. prepare an array for the initial pin configurations, e.g.::
98 100
99 static unsigned long mainstone_pin_config[] __initdata = { 101 static unsigned long mainstone_pin_config[] __initdata = {
100 /* Chip Select */ 102 /* Chip Select */
101 GPIO15_nCS_1, 103 GPIO15_nCS_1,
102 104
@@ -116,7 +118,7 @@ For board code writers, here are some guidelines:
116 118
117 /* GPIO */ 119 /* GPIO */
118 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, 120 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
119 }; 121 };
120 122
121 a) once the pin configurations are passed to pxa{2xx,3xx}_mfp_config(), 123 a) once the pin configurations are passed to pxa{2xx,3xx}_mfp_config(),
122 and written to the actual registers, they are useless and may discard, 124 and written to the actual registers, they are useless and may discard,
@@ -143,17 +145,17 @@ For board code writers, here are some guidelines:
143 d) although PXA3xx MFP supports edge detection on each pin, the 145 d) although PXA3xx MFP supports edge detection on each pin, the
144 internal logic will only wakeup the system when those specific bits 146 internal logic will only wakeup the system when those specific bits
145 in ADxER registers are set, which can be well mapped to the 147 in ADxER registers are set, which can be well mapped to the
146 corresponding peripheral, thus set_irq_wake() can be called with 148 corresponding peripheral, thus set_irq_wake() can be called with
147 the peripheral IRQ to enable the wakeup. 149 the peripheral IRQ to enable the wakeup.
148 150
149 151
150 MFP on PXA3xx 152MFP on PXA3xx
151=============== 153=============
152 154
153Every external I/O pad on PXA3xx (excluding those for special purpose) has 155Every external I/O pad on PXA3xx (excluding those for special purpose) has
154one MFP logic associated, and is controlled by one MFP register (MFPR). 156one MFP logic associated, and is controlled by one MFP register (MFPR).
155 157
156The MFPR has the following bit definitions (for PXA300/PXA310/PXA320): 158The MFPR has the following bit definitions (for PXA300/PXA310/PXA320)::
157 159
158 31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 160 31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
159 +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 161 +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
@@ -183,8 +185,8 @@ The MFPR has the following bit definitions (for PXA300/PXA310/PXA320):
183 0b006 - slow 10mA 185 0b006 - slow 10mA
184 0b007 - fast 10mA 186 0b007 - fast 10mA
185 187
186 MFP Design for PXA2xx/PXA3xx 188MFP Design for PXA2xx/PXA3xx
187============================== 189============================
188 190
189Due to the difference of pin-mux handling between PXA2xx and PXA3xx, a unified 191Due to the difference of pin-mux handling between PXA2xx and PXA3xx, a unified
190MFP API is introduced to cover both series of processors. 192MFP API is introduced to cover both series of processors.
@@ -194,11 +196,11 @@ configurations, these definitions are processor and platform independent, and
194the actual API invoked to convert these definitions into register settings and 196the actual API invoked to convert these definitions into register settings and
195make them effective there-after. 197make them effective there-after.
196 198
197 Files Involved 199Files Involved
198 -------------- 200--------------
199 201
200 - arch/arm/mach-pxa/include/mach/mfp.h 202 - arch/arm/mach-pxa/include/mach/mfp.h
201 203
202 for 204 for
203 1. Unified pin definitions - enum constants for all configurable pins 205 1. Unified pin definitions - enum constants for all configurable pins
204 2. processor-neutral bit definitions for a possible MFP configuration 206 2. processor-neutral bit definitions for a possible MFP configuration
@@ -226,42 +228,42 @@ make them effective there-after.
226 for implementation of the pin configuration to take effect for the actual 228 for implementation of the pin configuration to take effect for the actual
227 processor. 229 processor.
228 230
229 Pin Configuration 231Pin Configuration
230 ----------------- 232-----------------
231 233
232 The following comments are copied from mfp.h (see the actual source code 234 The following comments are copied from mfp.h (see the actual source code
233 for most updated info) 235 for most updated info)::
234 236
235 /* 237 /*
236 * a possible MFP configuration is represented by a 32-bit integer 238 * a possible MFP configuration is represented by a 32-bit integer
237 * 239 *
238 * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum) 240 * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum)
239 * bit 10..12 - Alternate Function Selection 241 * bit 10..12 - Alternate Function Selection
240 * bit 13..15 - Drive Strength 242 * bit 13..15 - Drive Strength
241 * bit 16..18 - Low Power Mode State 243 * bit 16..18 - Low Power Mode State
242 * bit 19..20 - Low Power Mode Edge Detection 244 * bit 19..20 - Low Power Mode Edge Detection
243 * bit 21..22 - Run Mode Pull State 245 * bit 21..22 - Run Mode Pull State
244 * 246 *
245 * to facilitate the definition, the following macros are provided 247 * to facilitate the definition, the following macros are provided
246 * 248 *
247 * MFP_CFG_DEFAULT - default MFP configuration value, with 249 * MFP_CFG_DEFAULT - default MFP configuration value, with
248 * alternate function = 0, 250 * alternate function = 0,
249 * drive strength = fast 3mA (MFP_DS03X) 251 * drive strength = fast 3mA (MFP_DS03X)
250 * low power mode = default 252 * low power mode = default
251 * edge detection = none 253 * edge detection = none
252 * 254 *
253 * MFP_CFG - default MFPR value with alternate function 255 * MFP_CFG - default MFPR value with alternate function
254 * MFP_CFG_DRV - default MFPR value with alternate function and 256 * MFP_CFG_DRV - default MFPR value with alternate function and
255 * pin drive strength 257 * pin drive strength
256 * MFP_CFG_LPM - default MFPR value with alternate function and 258 * MFP_CFG_LPM - default MFPR value with alternate function and
257 * low power mode 259 * low power mode
258 * MFP_CFG_X - default MFPR value with alternate function, 260 * MFP_CFG_X - default MFPR value with alternate function,
259 * pin drive strength and low power mode 261 * pin drive strength and low power mode
260 */ 262 */
261 263
262 Examples of pin configurations are: 264 Examples of pin configurations are::
263 265
264 #define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT) 266 #define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT)
265 267
266 which reads GPIO94 can be configured as SSP3_RXD, with alternate function 268 which reads GPIO94 can be configured as SSP3_RXD, with alternate function
267 selection of 1, driving strength of 0b101, and a float state in low power 269 selection of 1, driving strength of 0b101, and a float state in low power
@@ -272,8 +274,8 @@ make them effective there-after.
272 do so, simply because this default setting is usually carefully encoded, 274 do so, simply because this default setting is usually carefully encoded,
273 and is supposed to work in most cases. 275 and is supposed to work in most cases.
274 276
275 Register Settings 277Register Settings
276 ----------------- 278-----------------
277 279
278 Register settings on PXA3xx for a pin configuration is actually very 280 Register settings on PXA3xx for a pin configuration is actually very
279 straight-forward, most bits can be converted directly into MFPR value 281 straight-forward, most bits can be converted directly into MFPR value
diff --git a/Documentation/arm/SA1100/ADSBitsy b/Documentation/arm/sa1100/adsbitsy.rst
index f9f62e8c0719..c179cb26b682 100644
--- a/Documentation/arm/SA1100/ADSBitsy
+++ b/Documentation/arm/sa1100/adsbitsy.rst
@@ -1,4 +1,7 @@
1===============================
1ADS Bitsy Single Board Computer 2ADS Bitsy Single Board Computer
3===============================
4
2(It is different from Bitsy(iPAQ) of Compaq) 5(It is different from Bitsy(iPAQ) of Compaq)
3 6
4For more details, contact Applied Data Systems or see 7For more details, contact Applied Data Systems or see
@@ -15,7 +18,9 @@ The kernel zImage is linked to be loaded and executed at 0xc0400000.
15Linux can be used with the ADS BootLoader that ships with the 18Linux can be used with the ADS BootLoader that ships with the
16newer rev boards. See their documentation on how to load Linux. 19newer rev boards. See their documentation on how to load Linux.
17 20
18Supported peripherals: 21Supported peripherals
22=====================
23
19- SA1100 LCD frame buffer (8/16bpp...sort of) 24- SA1100 LCD frame buffer (8/16bpp...sort of)
20- SA1111 USB Master 25- SA1111 USB Master
21- SA1100 serial port 26- SA1100 serial port
@@ -25,10 +30,13 @@ Supported peripherals:
25- serial ports (ttyS[0-2]) 30- serial ports (ttyS[0-2])
26 - ttyS0 is default for serial console 31 - ttyS0 is default for serial console
27 32
28To do: 33To do
34=====
35
29- everything else! :-) 36- everything else! :-)
30 37
31Notes: 38Notes
39=====
32 40
33- The flash on board is divided into 3 partitions. 41- The flash on board is divided into 3 partitions.
34 You should be careful to use flash on board. 42 You should be careful to use flash on board.
diff --git a/Documentation/arm/SA1100/Assabet b/Documentation/arm/sa1100/assabet.rst
index e08a6739e72c..3e704831c311 100644
--- a/Documentation/arm/SA1100/Assabet
+++ b/Documentation/arm/sa1100/assabet.rst
@@ -1,3 +1,4 @@
1============================================
1The Intel Assabet (SA-1110 evaluation) board 2The Intel Assabet (SA-1110 evaluation) board
2============================================ 3============================================
3 4
@@ -11,7 +12,7 @@ http://www.cs.cmu.edu/~wearable/software/assabet.html
11Building the kernel 12Building the kernel
12------------------- 13-------------------
13 14
14To build the kernel with current defaults: 15To build the kernel with current defaults::
15 16
16 make assabet_config 17 make assabet_config
17 make oldconfig 18 make oldconfig
@@ -51,9 +52,9 @@ Brief examples on how to boot Linux with RedBoot are shown below. But first
51you need to have RedBoot installed in your flash memory. A known to work 52you need to have RedBoot installed in your flash memory. A known to work
52precompiled RedBoot binary is available from the following location: 53precompiled RedBoot binary is available from the following location:
53 54
54ftp://ftp.netwinder.org/users/n/nico/ 55- ftp://ftp.netwinder.org/users/n/nico/
55ftp://ftp.arm.linux.org.uk/pub/linux/arm/people/nico/ 56- ftp://ftp.arm.linux.org.uk/pub/linux/arm/people/nico/
56ftp://ftp.handhelds.org/pub/linux/arm/sa-1100-patches/ 57- ftp://ftp.handhelds.org/pub/linux/arm/sa-1100-patches/
57 58
58Look for redboot-assabet*.tgz. Some installation infos are provided in 59Look for redboot-assabet*.tgz. Some installation infos are provided in
59redboot-assabet*.txt. 60redboot-assabet*.txt.
@@ -71,12 +72,12 @@ Socket Communications Inc.), you should strongly consider using it for TFTP
71file transfers. You must insert it before RedBoot runs since it can't detect 72file transfers. You must insert it before RedBoot runs since it can't detect
72it dynamically. 73it dynamically.
73 74
74To initialize the flash directory: 75To initialize the flash directory::
75 76
76 fis init -f 77 fis init -f
77 78
78To initialize the non-volatile settings, like whether you want to use BOOTP or 79To initialize the non-volatile settings, like whether you want to use BOOTP or
79a static IP address, etc, use this command: 80a static IP address, etc, use this command::
80 81
81 fconfig -i 82 fconfig -i
82 83
@@ -85,15 +86,15 @@ Writing a kernel image into flash
85--------------------------------- 86---------------------------------
86 87
87First, the kernel image must be loaded into RAM. If you have the zImage file 88First, the kernel image must be loaded into RAM. If you have the zImage file
88available on a TFTP server: 89available on a TFTP server::
89 90
90 load zImage -r -b 0x100000 91 load zImage -r -b 0x100000
91 92
92If you rather want to use Y-Modem upload over the serial port: 93If you rather want to use Y-Modem upload over the serial port::
93 94
94 load -m ymodem -r -b 0x100000 95 load -m ymodem -r -b 0x100000
95 96
96To write it to flash: 97To write it to flash::
97 98
98 fis create "Linux kernel" -b 0x100000 -l 0xc0000 99 fis create "Linux kernel" -b 0x100000 -l 0xc0000
99 100
@@ -102,18 +103,18 @@ Booting the kernel
102------------------ 103------------------
103 104
104The kernel still requires a filesystem to boot. A ramdisk image can be loaded 105The kernel still requires a filesystem to boot. A ramdisk image can be loaded
105as follows: 106as follows::
106 107
107 load ramdisk_image.gz -r -b 0x800000 108 load ramdisk_image.gz -r -b 0x800000
108 109
109Again, Y-Modem upload can be used instead of TFTP by replacing the file name 110Again, Y-Modem upload can be used instead of TFTP by replacing the file name
110by '-y ymodem'. 111by '-y ymodem'.
111 112
112Now the kernel can be retrieved from flash like this: 113Now the kernel can be retrieved from flash like this::
113 114
114 fis load "Linux kernel" 115 fis load "Linux kernel"
115 116
116or loaded as described previously. To boot the kernel: 117or loaded as described previously. To boot the kernel::
117 118
118 exec -b 0x100000 -l 0xc0000 119 exec -b 0x100000 -l 0xc0000
119 120
@@ -134,35 +135,35 @@ creating JFFS/JFFS2 images is available from the same site.
134For instance, a sample JFFS2 image can be retrieved from the same FTP sites 135For instance, a sample JFFS2 image can be retrieved from the same FTP sites
135mentioned below for the precompiled RedBoot image. 136mentioned below for the precompiled RedBoot image.
136 137
137To load this file: 138To load this file::
138 139
139 load sample_img.jffs2 -r -b 0x100000 140 load sample_img.jffs2 -r -b 0x100000
140 141
141The result should look like: 142The result should look like::
142 143
143RedBoot> load sample_img.jffs2 -r -b 0x100000 144 RedBoot> load sample_img.jffs2 -r -b 0x100000
144Raw file loaded 0x00100000-0x00377424 145 Raw file loaded 0x00100000-0x00377424
145 146
146Now we must know the size of the unallocated flash: 147Now we must know the size of the unallocated flash::
147 148
148 fis free 149 fis free
149 150
150Result: 151Result::
151 152
152RedBoot> fis free 153 RedBoot> fis free
153 0x500E0000 .. 0x503C0000 154 0x500E0000 .. 0x503C0000
154 155
155The values above may be different depending on the size of the filesystem and 156The values above may be different depending on the size of the filesystem and
156the type of flash. See their usage below as an example and take care of 157the type of flash. See their usage below as an example and take care of
157substituting yours appropriately. 158substituting yours appropriately.
158 159
159We must determine some values: 160We must determine some values::
160 161
161size of unallocated flash: 0x503c0000 - 0x500e0000 = 0x2e0000 162 size of unallocated flash: 0x503c0000 - 0x500e0000 = 0x2e0000
162size of the filesystem image: 0x00377424 - 0x00100000 = 0x277424 163 size of the filesystem image: 0x00377424 - 0x00100000 = 0x277424
163 164
164We want to fit the filesystem image of course, but we also want to give it all 165We want to fit the filesystem image of course, but we also want to give it all
165the remaining flash space as well. To write it: 166the remaining flash space as well. To write it::
166 167
167 fis unlock -f 0x500E0000 -l 0x2e0000 168 fis unlock -f 0x500E0000 -l 0x2e0000
168 fis erase -f 0x500E0000 -l 0x2e0000 169 fis erase -f 0x500E0000 -l 0x2e0000
@@ -171,32 +172,32 @@ the remaining flash space as well. To write it:
171 172
172Now the filesystem is associated to a MTD "partition" once Linux has discovered 173Now the filesystem is associated to a MTD "partition" once Linux has discovered
173what they are in the boot process. From Redboot, the 'fis list' command 174what they are in the boot process. From Redboot, the 'fis list' command
174displays them: 175displays them::
175 176
176RedBoot> fis list 177 RedBoot> fis list
177Name FLASH addr Mem addr Length Entry point 178 Name FLASH addr Mem addr Length Entry point
178RedBoot 0x50000000 0x50000000 0x00020000 0x00000000 179 RedBoot 0x50000000 0x50000000 0x00020000 0x00000000
179RedBoot config 0x503C0000 0x503C0000 0x00020000 0x00000000 180 RedBoot config 0x503C0000 0x503C0000 0x00020000 0x00000000
180FIS directory 0x503E0000 0x503E0000 0x00020000 0x00000000 181 FIS directory 0x503E0000 0x503E0000 0x00020000 0x00000000
181Linux kernel 0x50020000 0x00100000 0x000C0000 0x00000000 182 Linux kernel 0x50020000 0x00100000 0x000C0000 0x00000000
182JFFS2 0x500E0000 0x500E0000 0x002E0000 0x00000000 183 JFFS2 0x500E0000 0x500E0000 0x002E0000 0x00000000
183 184
184However Linux should display something like: 185However Linux should display something like::
185 186
186SA1100 flash: probing 32-bit flash bus 187 SA1100 flash: probing 32-bit flash bus
187SA1100 flash: Found 2 x16 devices at 0x0 in 32-bit mode 188 SA1100 flash: Found 2 x16 devices at 0x0 in 32-bit mode
188Using RedBoot partition definition 189 Using RedBoot partition definition
189Creating 5 MTD partitions on "SA1100 flash": 190 Creating 5 MTD partitions on "SA1100 flash":
1900x00000000-0x00020000 : "RedBoot" 191 0x00000000-0x00020000 : "RedBoot"
1910x00020000-0x000e0000 : "Linux kernel" 192 0x00020000-0x000e0000 : "Linux kernel"
1920x000e0000-0x003c0000 : "JFFS2" 193 0x000e0000-0x003c0000 : "JFFS2"
1930x003c0000-0x003e0000 : "RedBoot config" 194 0x003c0000-0x003e0000 : "RedBoot config"
1940x003e0000-0x00400000 : "FIS directory" 195 0x003e0000-0x00400000 : "FIS directory"
195 196
196What's important here is the position of the partition we are interested in, 197What's important here is the position of the partition we are interested in,
197which is the third one. Within Linux, this correspond to /dev/mtdblock2. 198which is the third one. Within Linux, this correspond to /dev/mtdblock2.
198Therefore to boot Linux with the kernel and its root filesystem in flash, we 199Therefore to boot Linux with the kernel and its root filesystem in flash, we
199need this RedBoot command: 200need this RedBoot command::
200 201
201 fis load "Linux kernel" 202 fis load "Linux kernel"
202 exec -b 0x100000 -l 0xc0000 -c "root=/dev/mtdblock2" 203 exec -b 0x100000 -l 0xc0000 -c "root=/dev/mtdblock2"
@@ -218,21 +219,21 @@ time the Assabet is rebooted. Therefore it's possible to automate the boot
218process using RedBoot's scripting capability. 219process using RedBoot's scripting capability.
219 220
220For example, I use this to boot Linux with both the kernel and the ramdisk 221For example, I use this to boot Linux with both the kernel and the ramdisk
221images retrieved from a TFTP server on the network: 222images retrieved from a TFTP server on the network::
222 223
223RedBoot> fconfig 224 RedBoot> fconfig
224Run script at boot: false true 225 Run script at boot: false true
225Boot script: 226 Boot script:
226Enter script, terminate with empty line 227 Enter script, terminate with empty line
227>> load zImage -r -b 0x100000 228 >> load zImage -r -b 0x100000
228>> load ramdisk_ks.gz -r -b 0x800000 229 >> load ramdisk_ks.gz -r -b 0x800000
229>> exec -b 0x100000 -l 0xc0000 230 >> exec -b 0x100000 -l 0xc0000
230>> 231 >>
231Boot script timeout (1000ms resolution): 3 232 Boot script timeout (1000ms resolution): 3
232Use BOOTP for network configuration: true 233 Use BOOTP for network configuration: true
233GDB connection port: 9000 234 GDB connection port: 9000
234Network debug at boot time: false 235 Network debug at boot time: false
235Update RedBoot non-volatile configuration - are you sure (y/n)? y 236 Update RedBoot non-volatile configuration - are you sure (y/n)? y
236 237
237Then, rebooting the Assabet is just a matter of waiting for the login prompt. 238Then, rebooting the Assabet is just a matter of waiting for the login prompt.
238 239
@@ -240,6 +241,7 @@ Then, rebooting the Assabet is just a matter of waiting for the login prompt.
240 241
241Nicolas Pitre 242Nicolas Pitre
242nico@fluxnic.net 243nico@fluxnic.net
244
243June 12, 2001 245June 12, 2001
244 246
245 247
@@ -249,52 +251,51 @@ Status of peripherals in -rmk tree (updated 14/10/2001)
249Assabet: 251Assabet:
250 Serial ports: 252 Serial ports:
251 Radio: TX, RX, CTS, DSR, DCD, RI 253 Radio: TX, RX, CTS, DSR, DCD, RI
252 PM: Not tested. 254 - PM: Not tested.
253 COM: TX, RX, CTS, DSR, DCD, RTS, DTR, PM 255 - COM: TX, RX, CTS, DSR, DCD, RTS, DTR, PM
254 PM: Not tested. 256 - PM: Not tested.
255 I2C: Implemented, not fully tested. 257 - I2C: Implemented, not fully tested.
256 L3: Fully tested, pass. 258 - L3: Fully tested, pass.
257 PM: Not tested. 259 - PM: Not tested.
258 260
259 Video: 261 Video:
260 LCD: Fully tested. PM 262 - LCD: Fully tested. PM
261 (LCD doesn't like being blanked with 263
262 neponset connected) 264 (LCD doesn't like being blanked with neponset connected)
263 Video out: Not fully 265
266 - Video out: Not fully
264 267
265 Audio: 268 Audio:
266 UDA1341: 269 UDA1341:
267 Playback: Fully tested, pass. 270 - Playback: Fully tested, pass.
268 Record: Implemented, not tested. 271 - Record: Implemented, not tested.
269 PM: Not tested. 272 - PM: Not tested.
270 273
271 UCB1200: 274 UCB1200:
272 Audio play: Implemented, not heavily tested. 275 - Audio play: Implemented, not heavily tested.
273 Audio rec: Implemented, not heavily tested. 276 - Audio rec: Implemented, not heavily tested.
274 Telco audio play: Implemented, not heavily tested. 277 - Telco audio play: Implemented, not heavily tested.
275 Telco audio rec: Implemented, not heavily tested. 278 - Telco audio rec: Implemented, not heavily tested.
276 POTS control: No 279 - POTS control: No
277 Touchscreen: Yes 280 - Touchscreen: Yes
278 PM: Not tested. 281 - PM: Not tested.
279 282
280 Other: 283 Other:
281 PCMCIA: 284 - PCMCIA:
282 LPE: Fully tested, pass. 285 - LPE: Fully tested, pass.
283 USB: No 286 - USB: No
284 IRDA: 287 - IRDA:
285 SIR: Fully tested, pass. 288 - SIR: Fully tested, pass.
286 FIR: Fully tested, pass. 289 - FIR: Fully tested, pass.
287 PM: Not tested. 290 - PM: Not tested.
288 291
289Neponset: 292Neponset:
290 Serial ports: 293 Serial ports:
291 COM1,2: TX, RX, CTS, DSR, DCD, RTS, DTR 294 - COM1,2: TX, RX, CTS, DSR, DCD, RTS, DTR
292 PM: Not tested. 295 - PM: Not tested.
293 USB: Implemented, not heavily tested. 296 - USB: Implemented, not heavily tested.
294 PCMCIA: Implemented, not heavily tested. 297 - PCMCIA: Implemented, not heavily tested.
295 PM: Not tested. 298 - CF: Implemented, not heavily tested.
296 CF: Implemented, not heavily tested. 299 - PM: Not tested.
297 PM: Not tested.
298 300
299More stuff can be found in the -np (Nicolas Pitre's) tree. 301More stuff can be found in the -np (Nicolas Pitre's) tree.
300
diff --git a/Documentation/arm/SA1100/Brutus b/Documentation/arm/sa1100/brutus.rst
index 6a3aa95e9bfd..e1a23bee6d44 100644
--- a/Documentation/arm/SA1100/Brutus
+++ b/Documentation/arm/sa1100/brutus.rst
@@ -1,9 +1,13 @@
1Brutus is an evaluation platform for the SA1100 manufactured by Intel. 1======
2Brutus
3======
4
5Brutus is an evaluation platform for the SA1100 manufactured by Intel.
2For more details, see: 6For more details, see:
3 7
4http://developer.intel.com 8http://developer.intel.com
5 9
6To compile for Brutus, you must issue the following commands: 10To compile for Brutus, you must issue the following commands::
7 11
8 make brutus_config 12 make brutus_config
9 make config 13 make config
@@ -16,25 +20,23 @@ must be loaded at 0xc0008000 in Brutus's memory and execution started at
16entry. 20entry.
17 21
18But prior to execute the kernel, a ramdisk image must also be loaded in 22But prior to execute the kernel, a ramdisk image must also be loaded in
19memory. Use memory address 0xd8000000 for this. Note that the file 23memory. Use memory address 0xd8000000 for this. Note that the file
20containing the (compressed) ramdisk image must not exceed 4 MB. 24containing the (compressed) ramdisk image must not exceed 4 MB.
21 25
22Typically, you'll need angelboot to load the kernel. 26Typically, you'll need angelboot to load the kernel.
23The following angelboot.opt file should be used: 27The following angelboot.opt file should be used::
24 28
25----- begin angelboot.opt ----- 29 base 0xc0008000
26base 0xc0008000 30 entry 0xc0008000
27entry 0xc0008000 31 r0 0x00000000
28r0 0x00000000 32 r1 0x00000010
29r1 0x00000010 33 device /dev/ttyS0
30device /dev/ttyS0 34 options "9600 8N1"
31options "9600 8N1" 35 baud 115200
32baud 115200 36 otherfile ramdisk_img.gz
33otherfile ramdisk_img.gz 37 otherbase 0xd8000000
34otherbase 0xd8000000 38
35----- end angelboot.opt ----- 39Then load the kernel and ramdisk with::
36
37Then load the kernel and ramdisk with:
38 40
39 angelboot -f angelboot.opt zImage 41 angelboot -f angelboot.opt zImage
40 42
@@ -44,14 +46,16 @@ console is provided through the second Brutus serial port. To access it,
44you may use minicom configured with /dev/ttyS1, 9600 baud, 8N1, no flow 46you may use minicom configured with /dev/ttyS1, 9600 baud, 8N1, no flow
45control. 47control.
46 48
47Currently supported: 49Currently supported
50===================
51
48 - RS232 serial ports 52 - RS232 serial ports
49 - audio output 53 - audio output
50 - LCD screen 54 - LCD screen
51 - keyboard 55 - keyboard
52 56
53The actual Brutus support may not be complete without extra patches. 57The actual Brutus support may not be complete without extra patches.
54If such patches exist, they should be found from 58If such patches exist, they should be found from
55ftp.netwinder.org/users/n/nico. 59ftp.netwinder.org/users/n/nico.
56 60
57A full PCMCIA support is still missing, although it's possible to hack 61A full PCMCIA support is still missing, although it's possible to hack
@@ -63,4 +67,3 @@ Any contribution is welcome.
63Please send patches to nico@fluxnic.net 67Please send patches to nico@fluxnic.net
64 68
65Have Fun ! 69Have Fun !
66
diff --git a/Documentation/arm/SA1100/CERF b/Documentation/arm/sa1100/cerf.rst
index b3d845301ef1..7fa71b609bf9 100644
--- a/Documentation/arm/SA1100/CERF
+++ b/Documentation/arm/sa1100/cerf.rst
@@ -1,3 +1,7 @@
1==============
2CerfBoard/Cube
3==============
4
1*** The StrongARM version of the CerfBoard/Cube has been discontinued *** 5*** The StrongARM version of the CerfBoard/Cube has been discontinued ***
2 6
3The Intrinsyc CerfBoard is a StrongARM 1110-based computer on a board 7The Intrinsyc CerfBoard is a StrongARM 1110-based computer on a board
@@ -9,7 +13,9 @@ Intrinsyc website, http://www.intrinsyc.com.
9This document describes the support in the Linux kernel for the 13This document describes the support in the Linux kernel for the
10Intrinsyc CerfBoard. 14Intrinsyc CerfBoard.
11 15
12Supported in this version: 16Supported in this version
17=========================
18
13 - CompactFlash+ slot (select PCMCIA in General Setup and any options 19 - CompactFlash+ slot (select PCMCIA in General Setup and any options
14 that may be required) 20 that may be required)
15 - Onboard Crystal CS8900 Ethernet controller (Cerf CS8900A support in 21 - Onboard Crystal CS8900 Ethernet controller (Cerf CS8900A support in
@@ -19,7 +25,7 @@ Supported in this version:
19In order to get this kernel onto your Cerf, you need a server that runs 25In order to get this kernel onto your Cerf, you need a server that runs
20both BOOTP and TFTP. Detailed instructions should have come with your 26both BOOTP and TFTP. Detailed instructions should have come with your
21evaluation kit on how to use the bootloader. This series of commands 27evaluation kit on how to use the bootloader. This series of commands
22will suffice: 28will suffice::
23 29
24 make ARCH=arm CROSS_COMPILE=arm-linux- cerfcube_defconfig 30 make ARCH=arm CROSS_COMPILE=arm-linux- cerfcube_defconfig
25 make ARCH=arm CROSS_COMPILE=arm-linux- zImage 31 make ARCH=arm CROSS_COMPILE=arm-linux- zImage
diff --git a/Documentation/arm/sa1100/freebird.rst b/Documentation/arm/sa1100/freebird.rst
new file mode 100644
index 000000000000..81043d0c6d64
--- /dev/null
+++ b/Documentation/arm/sa1100/freebird.rst
@@ -0,0 +1,25 @@
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 b/Documentation/arm/sa1100/graphicsclient.rst
index 867bb35943af..a73d61c3ce91 100644
--- a/Documentation/arm/SA1100/GraphicsClient
+++ b/Documentation/arm/sa1100/graphicsclient.rst
@@ -1,9 +1,11 @@
1=============================================
1ADS GraphicsClient Plus Single Board Computer 2ADS GraphicsClient Plus Single Board Computer
3=============================================
2 4
3For more details, contact Applied Data Systems or see 5For more details, contact Applied Data Systems or see
4http://www.applieddata.net/products.html 6http://www.applieddata.net/products.html
5 7
6The original Linux support for this product has been provided by 8The original Linux support for this product has been provided by
7Nicolas Pitre <nico@fluxnic.net>. Continued development work by 9Nicolas Pitre <nico@fluxnic.net>. Continued development work by
8Woojung Huh <whuh@applieddata.net> 10Woojung Huh <whuh@applieddata.net>
9 11
@@ -14,8 +16,8 @@ board supports MTD/JFFS, so you could also mount something on there.
14Use 'make graphicsclient_config' before any 'make config'. This will set up 16Use 'make graphicsclient_config' before any 'make config'. This will set up
15defaults for GraphicsClient Plus support. 17defaults for GraphicsClient Plus support.
16 18
17The kernel zImage is linked to be loaded and executed at 0xc0200000. 19The kernel zImage is linked to be loaded and executed at 0xc0200000.
18Also the following registers should have the specified values upon entry: 20Also the following registers should have the specified values upon entry::
19 21
20 r0 = 0 22 r0 = 0
21 r1 = 29 (this is the GraphicsClient architecture number) 23 r1 = 29 (this is the GraphicsClient architecture number)
@@ -31,23 +33,21 @@ as outlined below. In any case, if you're planning on deploying
31something en masse, you should probably get the newer board. 33something en masse, you should probably get the newer board.
32 34
33If using Angel on the older boards, here is a typical angel.opt option file 35If using Angel on the older boards, here is a typical angel.opt option file
34if the kernel is loaded through the Angel Debug Monitor: 36if the kernel is loaded through the Angel Debug Monitor::
35 37
36----- begin angelboot.opt ----- 38 base 0xc0200000
37base 0xc0200000 39 entry 0xc0200000
38entry 0xc0200000 40 r0 0x00000000
39r0 0x00000000 41 r1 0x0000001d
40r1 0x0000001d 42 device /dev/ttyS1
41device /dev/ttyS1 43 options "38400 8N1"
42options "38400 8N1" 44 baud 115200
43baud 115200 45 #otherfile ramdisk.gz
44#otherfile ramdisk.gz 46 #otherbase 0xc0800000
45#otherbase 0xc0800000 47 exec minicom
46exec minicom
47----- end angelboot.opt -----
48 48
49Then the kernel (and ramdisk if otherfile/otherbase lines above are 49Then the kernel (and ramdisk if otherfile/otherbase lines above are
50uncommented) would be loaded with: 50uncommented) would be loaded with::
51 51
52 angelboot -f angelboot.opt zImage 52 angelboot -f angelboot.opt zImage
53 53
@@ -59,7 +59,9 @@ If any other bootloader is used, ensure it accomplish the same, especially
59for r0/r1 register values before jumping into the kernel. 59for r0/r1 register values before jumping into the kernel.
60 60
61 61
62Supported peripherals: 62Supported peripherals
63=====================
64
63- SA1100 LCD frame buffer (8/16bpp...sort of) 65- SA1100 LCD frame buffer (8/16bpp...sort of)
64- on-board SMC 92C96 ethernet NIC 66- on-board SMC 92C96 ethernet NIC
65- SA1100 serial port 67- SA1100 serial port
@@ -74,11 +76,14 @@ Supported peripherals:
74 See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation 76 See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation
75 and example user space code. ps/2 keybd is multiplexed through this driver 77 and example user space code. ps/2 keybd is multiplexed through this driver
76 78
77To do: 79To do
80=====
81
78- UCB1200 audio with new ucb_generic layer 82- UCB1200 audio with new ucb_generic layer
79- everything else! :-) 83- everything else! :-)
80 84
81Notes: 85Notes
86=====
82 87
83- The flash on board is divided into 3 partitions. mtd0 is where 88- The flash on board is divided into 3 partitions. mtd0 is where
84 the ADS boot ROM and zImage is stored. It's been marked as 89 the ADS boot ROM and zImage is stored. It's been marked as
@@ -95,4 +100,3 @@ Notes:
95 fixed soon. 100 fixed soon.
96 101
97Any contribution can be sent to nico@fluxnic.net and will be greatly welcome! 102Any contribution can be sent to nico@fluxnic.net and will be greatly welcome!
98
diff --git a/Documentation/arm/SA1100/GraphicsMaster b/Documentation/arm/sa1100/graphicsmaster.rst
index 9145088a0ba2..e39892514f0c 100644
--- a/Documentation/arm/SA1100/GraphicsMaster
+++ b/Documentation/arm/sa1100/graphicsmaster.rst
@@ -1,4 +1,6 @@
1========================================
1ADS GraphicsMaster Single Board Computer 2ADS GraphicsMaster Single Board Computer
3========================================
2 4
3For more details, contact Applied Data Systems or see 5For more details, contact Applied Data Systems or see
4http://www.applieddata.net/products.html 6http://www.applieddata.net/products.html
@@ -15,7 +17,9 @@ The kernel zImage is linked to be loaded and executed at 0xc0400000.
15Linux can be used with the ADS BootLoader that ships with the 17Linux can be used with the ADS BootLoader that ships with the
16newer rev boards. See their documentation on how to load Linux. 18newer rev boards. See their documentation on how to load Linux.
17 19
18Supported peripherals: 20Supported peripherals
21=====================
22
19- SA1100 LCD frame buffer (8/16bpp...sort of) 23- SA1100 LCD frame buffer (8/16bpp...sort of)
20- SA1111 USB Master 24- SA1111 USB Master
21- on-board SMC 92C96 ethernet NIC 25- on-board SMC 92C96 ethernet NIC
@@ -31,10 +35,13 @@ Supported peripherals:
31 See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation 35 See http://www.eurotech-inc.com/linux-sbc.asp for IOCTL documentation
32 and example user space code. ps/2 keybd is multiplexed through this driver 36 and example user space code. ps/2 keybd is multiplexed through this driver
33 37
34To do: 38To do
39=====
40
35- everything else! :-) 41- everything else! :-)
36 42
37Notes: 43Notes
44=====
38 45
39- The flash on board is divided into 3 partitions. mtd0 is where 46- The flash on board is divided into 3 partitions. mtd0 is where
40 the zImage is stored. It's been marked as read-only to keep you 47 the zImage is stored. It's been marked as read-only to keep you
diff --git a/Documentation/arm/SA1100/HUW_WEBPANEL b/Documentation/arm/sa1100/huw_webpanel.rst
index fd56b48d4833..1dc7ccb165f0 100644
--- a/Documentation/arm/SA1100/HUW_WEBPANEL
+++ b/Documentation/arm/sa1100/huw_webpanel.rst
@@ -1,9 +1,14 @@
1=======================
2Hoeft & Wessel Webpanel
3=======================
4
1The HUW_WEBPANEL is a product of the german company Hoeft & Wessel AG 5The HUW_WEBPANEL is a product of the german company Hoeft & Wessel AG
2 6
3If you want more information, please visit 7If you want more information, please visit
4http://www.hoeft-wessel.de 8http://www.hoeft-wessel.de
5 9
6To build the kernel: 10To build the kernel::
11
7 make huw_webpanel_config 12 make huw_webpanel_config
8 make oldconfig 13 make oldconfig
9 [accept all defaults] 14 [accept all defaults]
@@ -14,4 +19,3 @@ Roman Jordan jor@hoeft-wessel.de
14Christoph Schulz schu@hoeft-wessel.de 19Christoph Schulz schu@hoeft-wessel.de
15 20
162000/12/18/ 212000/12/18/
17
diff --git a/Documentation/arm/sa1100/index.rst b/Documentation/arm/sa1100/index.rst
new file mode 100644
index 000000000000..68c2a280a745
--- /dev/null
+++ b/Documentation/arm/sa1100/index.rst
@@ -0,0 +1,25 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3====================
4Intel StrongARM 1100
5====================
6
7.. toctree::
8 :maxdepth: 1
9
10 adsbitsy
11 assabet
12 brutus
13 cerf
14 freebird
15 graphicsclient
16 graphicsmaster
17 huw_webpanel
18 itsy
19 lart
20 nanoengine
21 pangolin
22 pleb
23 serial_uart
24 tifon
25 yopy
diff --git a/Documentation/arm/SA1100/Itsy b/Documentation/arm/sa1100/itsy.rst
index 44b94997fa0d..f49896ba3ef1 100644
--- a/Documentation/arm/SA1100/Itsy
+++ b/Documentation/arm/sa1100/itsy.rst
@@ -1,3 +1,7 @@
1====
2Itsy
3====
4
1Itsy is a research project done by the Western Research Lab, and Systems 5Itsy is a research project done by the Western Research Lab, and Systems
2Research Center in Palo Alto, CA. The Itsy project is one of several 6Research Center in Palo Alto, CA. The Itsy project is one of several
3research projects at Compaq that are related to pocket computing. 7research projects at Compaq that are related to pocket computing.
@@ -7,6 +11,7 @@ For more information, see:
7 http://www.hpl.hp.com/downloads/crl/itsy/ 11 http://www.hpl.hp.com/downloads/crl/itsy/
8 12
9Notes on initial 2.4 Itsy support (8/27/2000) : 13Notes on initial 2.4 Itsy support (8/27/2000) :
14
10The port was done on an Itsy version 1.5 machine with a daughtercard with 15The port was done on an Itsy version 1.5 machine with a daughtercard with
1164 Meg of DRAM and 32 Meg of Flash. The initial work includes support for 1664 Meg of DRAM and 32 Meg of Flash. The initial work includes support for
12serial console (to see what you're doing). No other devices have been 17serial console (to see what you're doing). No other devices have been
@@ -18,8 +23,10 @@ Finally, you will need to cd to arch/arm/boot/tools and execute a make there
18to build the params-itsy program used to boot the kernel. 23to build the params-itsy program used to boot the kernel.
19 24
20In order to install the port of 2.4 to the itsy, You will need to set the 25In order to install the port of 2.4 to the itsy, You will need to set the
21configuration parameters in the monitor as follows: 26configuration parameters in the monitor as follows::
22Arg 1:0x08340000, Arg2: 0xC0000000, Arg3:18 (0x12), Arg4:0 27
28 Arg 1:0x08340000, Arg2: 0xC0000000, Arg3:18 (0x12), Arg4:0
29
23Make sure the start-routine address is set to 0x00060000. 30Make sure the start-routine address is set to 0x00060000.
24 31
25Next, flash the params-itsy program to 0x00060000 ("p 1 0x00060000" in the 32Next, flash the params-itsy program to 0x00060000 ("p 1 0x00060000" in the
@@ -29,7 +36,8 @@ flash menu) Flash the kernel in arch/arm/boot/zImage into 0x08340000
29handhelds.org. 36handhelds.org.
30 37
31The serial connection we established was at: 38The serial connection we established was at:
32 8-bit data, no parity, 1 stop bit(s), 115200.00 b/s. in the monitor, in the 39
408-bit data, no parity, 1 stop bit(s), 115200.00 b/s. in the monitor, in the
33params-itsy program, and in the kernel itself. This can be changed, but 41params-itsy program, and in the kernel itself. This can be changed, but
34not easily. The monitor parameters are easily changed, the params program 42not easily. The monitor parameters are easily changed, the params program
35setup is assembly outl's, and the kernel is a configuration item specific to 43setup is assembly outl's, and the kernel is a configuration item specific to
diff --git a/Documentation/arm/SA1100/LART b/Documentation/arm/sa1100/lart.rst
index 6d412b685598..94c0568d1095 100644
--- a/Documentation/arm/SA1100/LART
+++ b/Documentation/arm/sa1100/lart.rst
@@ -1,5 +1,6 @@
1====================================
1Linux Advanced Radio Terminal (LART) 2Linux Advanced Radio Terminal (LART)
2------------------------------------ 3====================================
3 4
4The LART is a small (7.5 x 10cm) SA-1100 board, designed for embedded 5The LART is a small (7.5 x 10cm) SA-1100 board, designed for embedded
5applications. It has 32 MB DRAM, 4MB Flash ROM, double RS232 and all 6applications. It has 32 MB DRAM, 4MB Flash ROM, double RS232 and all
diff --git a/Documentation/arm/SA1100/nanoEngine b/Documentation/arm/sa1100/nanoengine.rst
index 48a7934f95f6..47f1a14cf98a 100644
--- a/Documentation/arm/SA1100/nanoEngine
+++ b/Documentation/arm/sa1100/nanoengine.rst
@@ -1,11 +1,11 @@
1==========
1nanoEngine 2nanoEngine
2---------- 3==========
3 4
4"nanoEngine" is a SA1110 based single board computer from 5"nanoEngine" is a SA1110 based single board computer from
5Bright Star Engineering Inc. See www.brightstareng.com/arm 6Bright Star Engineering Inc. See www.brightstareng.com/arm
6for more info. 7for more info.
7(Ref: Stuart Adams <sja@brightstareng.com>) 8(Ref: Stuart Adams <sja@brightstareng.com>)
8 9
9Also visit Larry Doolittle's "Linux for the nanoEngine" site: 10Also visit Larry Doolittle's "Linux for the nanoEngine" site:
10http://www.brightstareng.com/arm/nanoeng.htm 11http://www.brightstareng.com/arm/nanoeng.htm
11
diff --git a/Documentation/arm/SA1100/Pangolin b/Documentation/arm/sa1100/pangolin.rst
index 077a6120e129..f0c5c1618553 100644
--- a/Documentation/arm/SA1100/Pangolin
+++ b/Documentation/arm/sa1100/pangolin.rst
@@ -1,16 +1,22 @@
1========
2Pangolin
3========
4
1Pangolin is a StrongARM 1110-based evaluation platform produced 5Pangolin is a StrongARM 1110-based evaluation platform produced
2by Dialogue Technology (http://www.dialogue.com.tw/). 6by Dialogue Technology (http://www.dialogue.com.tw/).
3It has EISA slots for ease of configuration with SDRAM/Flash 7It has EISA slots for ease of configuration with SDRAM/Flash
4memory card, USB/Serial/Audio card, Compact Flash card, 8memory card, USB/Serial/Audio card, Compact Flash card,
5PCMCIA/IDE card and TFT-LCD card. 9PCMCIA/IDE card and TFT-LCD card.
6 10
7To compile for Pangolin, you must issue the following commands: 11To compile for Pangolin, you must issue the following commands::
8 12
9 make pangolin_config 13 make pangolin_config
10 make oldconfig 14 make oldconfig
11 make zImage 15 make zImage
12 16
13Supported peripherals: 17Supported peripherals
18=====================
19
14- SA1110 serial port (UART1/UART2/UART3) 20- SA1110 serial port (UART1/UART2/UART3)
15- flash memory access 21- flash memory access
16- compact flash driver 22- compact flash driver
diff --git a/Documentation/arm/SA1100/PLEB b/Documentation/arm/sa1100/pleb.rst
index b9c8a631a351..d5b732967aa3 100644
--- a/Documentation/arm/SA1100/PLEB
+++ b/Documentation/arm/sa1100/pleb.rst
@@ -1,3 +1,7 @@
1====
2PLEB
3====
4
1The PLEB project was started as a student initiative at the School of 5The PLEB project was started as a student initiative at the School of
2Computer Science and Engineering, University of New South Wales to make a 6Computer Science and Engineering, University of New South Wales to make a
3pocket computer capable of running the Linux Kernel. 7pocket computer capable of running the Linux Kernel.
@@ -7,5 +11,3 @@ PLEB support has yet to be fully integrated.
7For more information, see: 11For more information, see:
8 12
9 http://www.cse.unsw.edu.au 13 http://www.cse.unsw.edu.au
10
11
diff --git a/Documentation/arm/sa1100/serial_uart.rst b/Documentation/arm/sa1100/serial_uart.rst
new file mode 100644
index 000000000000..ea983642b9be
--- /dev/null
+++ b/Documentation/arm/sa1100/serial_uart.rst
@@ -0,0 +1,51 @@
1==================
2SA1100 serial port
3==================
4
5The SA1100 serial port had its major/minor numbers officially assigned::
6
7 > Date: Sun, 24 Sep 2000 21:40:27 -0700
8 > From: H. Peter Anvin <hpa@transmeta.com>
9 > To: Nicolas Pitre <nico@CAM.ORG>
10 > Cc: Device List Maintainer <device@lanana.org>
11 > Subject: Re: device
12 >
13 > Okay. Note that device numbers 204 and 205 are used for "low density
14 > serial devices", so you will have a range of minors on those majors (the
15 > tty device layer handles this just fine, so you don't have to worry about
16 > doing anything special.)
17 >
18 > So your assignments are:
19 >
20 > 204 char Low-density serial ports
21 > 5 = /dev/ttySA0 SA1100 builtin serial port 0
22 > 6 = /dev/ttySA1 SA1100 builtin serial port 1
23 > 7 = /dev/ttySA2 SA1100 builtin serial port 2
24 >
25 > 205 char Low-density serial ports (alternate device)
26 > 5 = /dev/cusa0 Callout device for ttySA0
27 > 6 = /dev/cusa1 Callout device for ttySA1
28 > 7 = /dev/cusa2 Callout device for ttySA2
29 >
30
31You must create those inodes in /dev on the root filesystem used
32by your SA1100-based device::
33
34 mknod ttySA0 c 204 5
35 mknod ttySA1 c 204 6
36 mknod ttySA2 c 204 7
37 mknod cusa0 c 205 5
38 mknod cusa1 c 205 6
39 mknod cusa2 c 205 7
40
41In addition to the creation of the appropriate device nodes above, you
42must ensure your user space applications make use of the correct device
43name. The classic example is the content of the /etc/inittab file where
44you might have a getty process started on ttyS0.
45
46In this case:
47
48- replace occurrences of ttyS0 with ttySA0, ttyS1 with ttySA1, etc.
49
50- don't forget to add 'ttySA0', 'console', or the appropriate tty name
51 in /etc/securetty for root to be allowed to login as well.
diff --git a/Documentation/arm/SA1100/Tifon b/Documentation/arm/sa1100/tifon.rst
index dd1934d9c851..c26e910b9ea7 100644
--- a/Documentation/arm/SA1100/Tifon
+++ b/Documentation/arm/sa1100/tifon.rst
@@ -1,7 +1,7 @@
1=====
1Tifon 2Tifon
2----- 3=====
3 4
4More info has to come... 5More info has to come...
5 6
6Contact: Peter Danielsson <peter.danielsson@era-t.ericsson.se> 7Contact: Peter Danielsson <peter.danielsson@era-t.ericsson.se>
7
diff --git a/Documentation/arm/SA1100/Yopy b/Documentation/arm/sa1100/yopy.rst
index e14f16d836ac..5b35a5f61a44 100644
--- a/Documentation/arm/SA1100/Yopy
+++ b/Documentation/arm/sa1100/yopy.rst
@@ -1,2 +1,5 @@
1See http://www.yopydeveloper.org for more. 1====
2Yopy
3====
2 4
5See http://www.yopydeveloper.org for more.
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/samsung-s3c24xx/cpufreq.rst
index fa968aa99d67..2ddc26c03b1f 100644
--- a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
+++ b/Documentation/arm/samsung-s3c24xx/cpufreq.rst
@@ -1,5 +1,6 @@
1 S3C24XX CPUfreq support 1=======================
2 ======================= 2S3C24XX CPUfreq support
3=======================
3 4
4Introduction 5Introduction
5------------ 6------------
diff --git a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/samsung-s3c24xx/eb2410itx.rst
index b87292e05f2f..7863c93652f8 100644
--- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
+++ b/Documentation/arm/samsung-s3c24xx/eb2410itx.rst
@@ -1,5 +1,6 @@
1 Simtec Electronics EB2410ITX (BAST) 1===================================
2 =================================== 2Simtec Electronics EB2410ITX (BAST)
3===================================
3 4
4 http://www.simtec.co.uk/products/EB2410ITX/ 5 http://www.simtec.co.uk/products/EB2410ITX/
5 6
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/samsung-s3c24xx/gpio.rst
index e8f918b96123..f7c3d7d011a2 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/samsung-s3c24xx/gpio.rst
@@ -1,5 +1,6 @@
1 S3C24XX GPIO Control 1====================
2 ==================== 2S3C24XX GPIO Control
3====================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -12,7 +13,7 @@ Introduction
12 of the s3c2410 GPIO system, please read the Samsung provided 13 of the s3c2410 GPIO system, please read the Samsung provided
13 data-sheet/users manual to find out the complete list. 14 data-sheet/users manual to find out the complete list.
14 15
15 See Documentation/arm/Samsung/GPIO.txt for the core implementation. 16 See Documentation/arm/samsung/gpio.rst for the core implementation.
16 17
17 18
18GPIOLIB 19GPIOLIB
@@ -26,16 +27,16 @@ GPIOLIB
26 listed below will be removed (they may be marked as __deprecated 27 listed below will be removed (they may be marked as __deprecated
27 in the near future). 28 in the near future).
28 29
29 The following functions now either have a s3c_ specific variant 30 The following functions now either have a `s3c_` specific variant
30 or are merged into gpiolib. See the definitions in 31 or are merged into gpiolib. See the definitions in
31 arch/arm/plat-samsung/include/plat/gpio-cfg.h: 32 arch/arm/plat-samsung/include/plat/gpio-cfg.h:
32 33
33 s3c2410_gpio_setpin() gpio_set_value() or gpio_direction_output() 34 - s3c2410_gpio_setpin() gpio_set_value() or gpio_direction_output()
34 s3c2410_gpio_getpin() gpio_get_value() or gpio_direction_input() 35 - s3c2410_gpio_getpin() gpio_get_value() or gpio_direction_input()
35 s3c2410_gpio_getirq() gpio_to_irq() 36 - s3c2410_gpio_getirq() gpio_to_irq()
36 s3c2410_gpio_cfgpin() s3c_gpio_cfgpin() 37 - s3c2410_gpio_cfgpin() s3c_gpio_cfgpin()
37 s3c2410_gpio_getcfg() s3c_gpio_getcfg() 38 - s3c2410_gpio_getcfg() s3c_gpio_getcfg()
38 s3c2410_gpio_pullup() s3c_gpio_setpull() 39 - s3c2410_gpio_pullup() s3c_gpio_setpull()
39 40
40 41
41GPIOLIB conversion 42GPIOLIB conversion
@@ -77,7 +78,7 @@ out s3c2410 API, then here are some notes on the process.
776) s3c2410_gpio_getirq() should be directly replaceable with the 786) s3c2410_gpio_getirq() should be directly replaceable with the
78 gpio_to_irq() call. 79 gpio_to_irq() call.
79 80
80The s3c2410_gpio and gpio_ calls have always operated on the same gpio 81The s3c2410_gpio and `gpio_` calls have always operated on the same gpio
81numberspace, so there is no problem with converting the gpio numbering 82numberspace, so there is no problem with converting the gpio numbering
82between the calls. 83between the calls.
83 84
diff --git a/Documentation/arm/Samsung-S3C24XX/H1940.txt b/Documentation/arm/samsung-s3c24xx/h1940.rst
index b738859b1fc0..62a562c178e3 100644
--- a/Documentation/arm/Samsung-S3C24XX/H1940.txt
+++ b/Documentation/arm/samsung-s3c24xx/h1940.rst
@@ -1,5 +1,6 @@
1 HP IPAQ H1940 1=============
2 ============= 2HP IPAQ H1940
3=============
3 4
4http://www.handhelds.org/projects/h1940.html 5http://www.handhelds.org/projects/h1940.html
5 6
diff --git a/Documentation/arm/samsung-s3c24xx/index.rst b/Documentation/arm/samsung-s3c24xx/index.rst
new file mode 100644
index 000000000000..5b8a7f9398d8
--- /dev/null
+++ b/Documentation/arm/samsung-s3c24xx/index.rst
@@ -0,0 +1,20 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==========================
4Samsung S3C24XX SoC Family
5==========================
6
7.. toctree::
8 :maxdepth: 1
9
10 h1940
11 gpio
12 cpufreq
13 suspend
14 usb-host
15 s3c2412
16 eb2410itx
17 nand
18 smdk2440
19 s3c2413
20 overview
diff --git a/Documentation/arm/Samsung-S3C24XX/NAND.txt b/Documentation/arm/samsung-s3c24xx/nand.rst
index bc478a3409b8..938995694ee7 100644
--- a/Documentation/arm/Samsung-S3C24XX/NAND.txt
+++ b/Documentation/arm/samsung-s3c24xx/nand.rst
@@ -1,5 +1,6 @@
1 S3C24XX NAND Support 1====================
2 ==================== 2S3C24XX NAND Support
3====================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -27,4 +28,3 @@ Document Author
27--------------- 28---------------
28 29
29Ben Dooks, Copyright 2007 Simtec Electronics 30Ben Dooks, Copyright 2007 Simtec Electronics
30
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/samsung-s3c24xx/overview.rst
index 00d3c3141e21..e9a1dc7276b5 100644
--- a/Documentation/arm/Samsung-S3C24XX/Overview.txt
+++ b/Documentation/arm/samsung-s3c24xx/overview.rst
@@ -1,5 +1,6 @@
1 S3C24XX ARM Linux Overview 1==========================
2 ========================== 2S3C24XX ARM Linux Overview
3==========================
3 4
4 5
5 6
@@ -182,7 +183,7 @@ NAND
182 controller. If there are any problems the latest linux-mtd 183 controller. If there are any problems the latest linux-mtd
183 code can be found from http://www.linux-mtd.infradead.org/ 184 code can be found from http://www.linux-mtd.infradead.org/
184 185
185 For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt 186 For more information see Documentation/arm/samsung-s3c24xx/nand.rst
186 187
187 188
188SD/MMC 189SD/MMC
@@ -221,8 +222,8 @@ GPIO
221 As of v2.6.34, the move towards using gpiolib support is almost 222 As of v2.6.34, the move towards using gpiolib support is almost
222 complete, and very little of the old calls are left. 223 complete, and very little of the old calls are left.
223 224
224 See Documentation/arm/Samsung-S3C24XX/GPIO.txt for the S3C24XX specific 225 See Documentation/arm/samsung-s3c24xx/gpio.rst for the S3C24XX specific
225 support and Documentation/arm/Samsung/GPIO.txt for the core Samsung 226 support and Documentation/arm/samsung/gpio.rst for the core Samsung
226 implementation. 227 implementation.
227 228
228 229
@@ -276,18 +277,18 @@ Platform Data
276 kmalloc()s an area of memory, and copies the __initdata 277 kmalloc()s an area of memory, and copies the __initdata
277 and then sets the relevant device's platform data. Making 278 and then sets the relevant device's platform data. Making
278 the function `__init` takes care of ensuring it is discarded 279 the function `__init` takes care of ensuring it is discarded
279 with the rest of the initialisation code 280 with the rest of the initialisation code::
280 281
281 static __init void s3c24xx_xxx_set_platdata(struct xxx_data *pd) 282 static __init void s3c24xx_xxx_set_platdata(struct xxx_data *pd)
282 { 283 {
283 struct s3c2410_xxx_mach_info *npd; 284 struct s3c2410_xxx_mach_info *npd;
284 285
285 npd = kmalloc(sizeof(struct s3c2410_xxx_mach_info), GFP_KERNEL); 286 npd = kmalloc(sizeof(struct s3c2410_xxx_mach_info), GFP_KERNEL);
286 if (npd) { 287 if (npd) {
287 memcpy(npd, pd, sizeof(struct s3c2410_xxx_mach_info)); 288 memcpy(npd, pd, sizeof(struct s3c2410_xxx_mach_info));
288 s3c_device_xxx.dev.platform_data = npd; 289 s3c_device_xxx.dev.platform_data = npd;
289 } else { 290 } else {
290 printk(KERN_ERR "no memory for xxx platform data\n"); 291 printk(KERN_ERR "no memory for xxx platform data\n");
291 } 292 }
292 } 293 }
293 294
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt b/Documentation/arm/samsung-s3c24xx/s3c2412.rst
index dc1fd362d3c1..68b985fc6bf4 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
+++ b/Documentation/arm/samsung-s3c24xx/s3c2412.rst
@@ -1,5 +1,6 @@
1 S3C2412 ARM Linux Overview 1==========================
2 ========================== 2S3C2412 ARM Linux Overview
3==========================
3 4
4Introduction 5Introduction
5------------ 6------------
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt b/Documentation/arm/samsung-s3c24xx/s3c2413.rst
index 909bdc7dd7b5..1f51e207fc46 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
+++ b/Documentation/arm/samsung-s3c24xx/s3c2413.rst
@@ -1,5 +1,6 @@
1 S3C2413 ARM Linux Overview 1==========================
2 ========================== 2S3C2413 ARM Linux Overview
3==========================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -10,7 +11,7 @@ Introduction
10 11
11 12
12Camera Interface 13Camera Interface
13--------------- 14----------------
14 15
15 This block is currently not supported. 16 This block is currently not supported.
16 17
diff --git a/Documentation/arm/Samsung-S3C24XX/SMDK2440.txt b/Documentation/arm/samsung-s3c24xx/smdk2440.rst
index 429390bd4684..524fd0b4afaf 100644
--- a/Documentation/arm/Samsung-S3C24XX/SMDK2440.txt
+++ b/Documentation/arm/samsung-s3c24xx/smdk2440.rst
@@ -1,5 +1,6 @@
1 Samsung/Meritech SMDK2440 1=========================
2 ========================= 2Samsung/Meritech SMDK2440
3=========================
3 4
4Introduction 5Introduction
5------------ 6------------
diff --git a/Documentation/arm/Samsung-S3C24XX/Suspend.txt b/Documentation/arm/samsung-s3c24xx/suspend.rst
index cb4f0c0cdf9d..b4f3ae9fe76e 100644
--- a/Documentation/arm/Samsung-S3C24XX/Suspend.txt
+++ b/Documentation/arm/samsung-s3c24xx/suspend.rst
@@ -1,5 +1,6 @@
1 S3C24XX Suspend Support 1=======================
2 ======================= 2S3C24XX Suspend Support
3=======================
3 4
4 5
5Introduction 6Introduction
@@ -57,16 +58,16 @@ Machine Support
57 and will end up initialising all compiled machines' pm init! 58 and will end up initialising all compiled machines' pm init!
58 59
59 The following is an example of code used for testing wakeup from 60 The following is an example of code used for testing wakeup from
60 an falling edge on IRQ_EINT0: 61 an falling edge on IRQ_EINT0::
61 62
62 63
63static irqreturn_t button_irq(int irq, void *pw) 64 static irqreturn_t button_irq(int irq, void *pw)
64{ 65 {
65 return IRQ_HANDLED; 66 return IRQ_HANDLED;
66} 67 }
67 68
68statuc void __init machine_init(void) 69 statuc void __init machine_init(void)
69{ 70 {
70 ... 71 ...
71 72
72 request_irq(IRQ_EINT0, button_irq, IRQF_TRIGGER_FALLING, 73 request_irq(IRQ_EINT0, button_irq, IRQF_TRIGGER_FALLING,
@@ -75,7 +76,7 @@ statuc void __init machine_init(void)
75 enable_irq_wake(IRQ_EINT0); 76 enable_irq_wake(IRQ_EINT0);
76 77
77 s3c_pm_init(); 78 s3c_pm_init();
78} 79 }
79 80
80 81
81Debugging 82Debugging
@@ -134,4 +135,3 @@ Document Author
134--------------- 135---------------
135 136
136Ben Dooks, Copyright 2004 Simtec Electronics 137Ben Dooks, Copyright 2004 Simtec Electronics
137
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/samsung-s3c24xx/usb-host.rst
index f82b1faefad5..c84268bd1884 100644
--- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
+++ b/Documentation/arm/samsung-s3c24xx/usb-host.rst
@@ -1,5 +1,6 @@
1 S3C24XX USB Host support 1========================
2 ======================== 2S3C24XX USB Host support
3========================
3 4
4 5
5 6
@@ -13,7 +14,7 @@ Configuration
13 14
14 Enable at least the following kernel options: 15 Enable at least the following kernel options:
15 16
16 menuconfig: 17 menuconfig::
17 18
18 Device Drivers ---> 19 Device Drivers --->
19 USB support ---> 20 USB support --->
@@ -22,8 +23,9 @@ Configuration
22 23
23 24
24 .config: 25 .config:
25 CONFIG_USB 26
26 CONFIG_USB_OHCI_HCD 27 - CONFIG_USB
28 - CONFIG_USB_OHCI_HCD
27 29
28 30
29 Once these options are configured, the standard set of USB device 31 Once these options are configured, the standard set of USB device
@@ -60,17 +62,14 @@ Platform Data
60 The ports are numbered 0 and 1. 62 The ports are numbered 0 and 1.
61 63
62 power_control: 64 power_control:
63
64 Called to enable or disable the power on the port. 65 Called to enable or disable the power on the port.
65 66
66 enable_oc: 67 enable_oc:
67
68 Called to enable or disable the over-current monitoring. 68 Called to enable or disable the over-current monitoring.
69 This should claim or release the resources being used to 69 This should claim or release the resources being used to
70 check the power condition on the port, such as an IRQ. 70 check the power condition on the port, such as an IRQ.
71 71
72 report_oc: 72 report_oc:
73
74 The OHCI driver fills this field in for the over-current code 73 The OHCI driver fills this field in for the over-current code
75 to call when there is a change to the over-current state on 74 to call when there is a change to the over-current state on
76 an port. The ports argument is a bitmask of 1 bit per port, 75 an port. The ports argument is a bitmask of 1 bit per port,
@@ -80,7 +79,6 @@ Platform Data
80 ensure this is called correctly. 79 ensure this is called correctly.
81 80
82 port[x]: 81 port[x]:
83
84 This is struct describes each port, 0 or 1. The platform driver 82 This is struct describes each port, 0 or 1. The platform driver
85 should set the flags field of each port to S3C_HCDFLG_USED if 83 should set the flags field of each port to S3C_HCDFLG_USED if
86 the port is enabled. 84 the port is enabled.
diff --git a/Documentation/arm/Samsung/Bootloader-interface.txt b/Documentation/arm/samsung/bootloader-interface.rst
index d17ed518a7ea..a56f325dae78 100644
--- a/Documentation/arm/Samsung/Bootloader-interface.txt
+++ b/Documentation/arm/samsung/bootloader-interface.rst
@@ -1,7 +1,9 @@
1 Interface between kernel and boot loaders on Exynos boards 1==========================================================
2 ========================================================== 2Interface between kernel and boot loaders on Exynos boards
3==========================================================
3 4
4Author: Krzysztof Kozlowski 5Author: Krzysztof Kozlowski
6
5Date : 6 June 2015 7Date : 6 June 2015
6 8
7The document tries to describe currently used interface between Linux kernel 9The document tries to describe currently used interface between Linux kernel
@@ -17,8 +19,10 @@ executing kernel.
171. Non-Secure mode 191. Non-Secure mode
18 20
19Address: sysram_ns_base_addr 21Address: sysram_ns_base_addr
22
23============= ============================================ ==================
20Offset Value Purpose 24Offset Value Purpose
21============================================================================= 25============= ============================================ ==================
220x08 exynos_cpu_resume_ns, mcpm_entry_point System suspend 260x08 exynos_cpu_resume_ns, mcpm_entry_point System suspend
230x0c 0x00000bad (Magic cookie) System suspend 270x0c 0x00000bad (Magic cookie) System suspend
240x1c exynos4_secondary_startup Secondary CPU boot 280x1c exynos4_secondary_startup Secondary CPU boot
@@ -27,22 +31,28 @@ Offset Value Purpose
270x24 exynos_cpu_resume_ns AFTR 310x24 exynos_cpu_resume_ns AFTR
280x28 + 4*cpu 0x8 (Magic cookie, Exynos3250) AFTR 320x28 + 4*cpu 0x8 (Magic cookie, Exynos3250) AFTR
290x28 0x0 or last value during resume (Exynos542x) System suspend 330x28 0x0 or last value during resume (Exynos542x) System suspend
34============= ============================================ ==================
30 35
31 36
322. Secure mode 372. Secure mode
33 38
34Address: sysram_base_addr 39Address: sysram_base_addr
40
41============= ============================================ ==================
35Offset Value Purpose 42Offset Value Purpose
36============================================================================= 43============= ============================================ ==================
370x00 exynos4_secondary_startup Secondary CPU boot 440x00 exynos4_secondary_startup Secondary CPU boot
380x04 exynos4_secondary_startup (Exynos542x) Secondary CPU boot 450x04 exynos4_secondary_startup (Exynos542x) Secondary CPU boot
394*cpu exynos4_secondary_startup (Exynos4412) Secondary CPU boot 464*cpu exynos4_secondary_startup (Exynos4412) Secondary CPU boot
400x20 exynos_cpu_resume (Exynos4210 r1.0) AFTR 470x20 exynos_cpu_resume (Exynos4210 r1.0) AFTR
410x24 0xfcba0d10 (Magic cookie, Exynos4210 r1.0) AFTR 480x24 0xfcba0d10 (Magic cookie, Exynos4210 r1.0) AFTR
49============= ============================================ ==================
42 50
43Address: pmu_base_addr 51Address: pmu_base_addr
52
53============= ============================================ ==================
44Offset Value Purpose 54Offset Value Purpose
45============================================================================= 55============= ============================================ ==================
460x0800 exynos_cpu_resume AFTR, suspend 560x0800 exynos_cpu_resume AFTR, suspend
470x0800 mcpm_entry_point (Exynos542x with MCPM) AFTR, suspend 570x0800 mcpm_entry_point (Exynos542x with MCPM) AFTR, suspend
480x0804 0xfcba0d10 (Magic cookie) AFTR 580x0804 0xfcba0d10 (Magic cookie) AFTR
@@ -50,15 +60,18 @@ Offset Value Purpose
500x0814 exynos4_secondary_startup (Exynos4210 r1.1) Secondary CPU boot 600x0814 exynos4_secondary_startup (Exynos4210 r1.1) Secondary CPU boot
510x0818 0xfcba0d10 (Magic cookie, Exynos4210 r1.1) AFTR 610x0818 0xfcba0d10 (Magic cookie, Exynos4210 r1.1) AFTR
520x081C exynos_cpu_resume (Exynos4210 r1.1) AFTR 620x081C exynos_cpu_resume (Exynos4210 r1.1) AFTR
53 63============= ============================================ ==================
54 64
553. Other (regardless of secure/non-secure mode) 653. Other (regardless of secure/non-secure mode)
56 66
57Address: pmu_base_addr 67Address: pmu_base_addr
68
69============= =============================== ===============================
58Offset Value Purpose 70Offset Value Purpose
59============================================================================= 71============= =============================== ===============================
600x0908 Non-zero Secondary CPU boot up indicator 720x0908 Non-zero Secondary CPU boot up indicator
61 on Exynos3250 and Exynos542x 73 on Exynos3250 and Exynos542x
74============= =============================== ===============================
62 75
63 76
644. Glossary 774. Glossary
diff --git a/Documentation/arm/Samsung/clksrc-change-registers.awk b/Documentation/arm/samsung/clksrc-change-registers.awk
index 7be1b8aa7cd9..7be1b8aa7cd9 100755
--- a/Documentation/arm/Samsung/clksrc-change-registers.awk
+++ b/Documentation/arm/samsung/clksrc-change-registers.awk
diff --git a/Documentation/arm/Samsung/GPIO.txt b/Documentation/arm/samsung/gpio.rst
index 795adfd88081..5f7cadd7159e 100644
--- a/Documentation/arm/Samsung/GPIO.txt
+++ b/Documentation/arm/samsung/gpio.rst
@@ -1,5 +1,6 @@
1 Samsung GPIO implementation 1===========================
2 =========================== 2Samsung GPIO implementation
3===========================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -11,7 +12,7 @@ specific calls provided alongside the drivers/gpio core.
11S3C24XX (Legacy) 12S3C24XX (Legacy)
12---------------- 13----------------
13 14
14See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information 15See Documentation/arm/samsung-s3c24xx/gpio.rst for more information
15about these devices. Their implementation has been brought into line 16about these devices. Their implementation has been brought into line
16with the core samsung implementation described in this document. 17with the core samsung implementation described in this document.
17 18
diff --git a/Documentation/arm/samsung/index.rst b/Documentation/arm/samsung/index.rst
new file mode 100644
index 000000000000..8142cce3d23e
--- /dev/null
+++ b/Documentation/arm/samsung/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===========
4Samsung SoC
5===========
6
7.. toctree::
8 :maxdepth: 1
9
10 gpio
11 bootloader-interface
12 overview
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/samsung/overview.rst
index 8f7309bad460..e74307897416 100644
--- a/Documentation/arm/Samsung/Overview.txt
+++ b/Documentation/arm/samsung/overview.rst
@@ -1,5 +1,6 @@
1 Samsung ARM Linux Overview 1==========================
2 ========================== 2Samsung ARM Linux Overview
3==========================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -11,7 +12,7 @@ Introduction
11 12
12 The currently supported SoCs are: 13 The currently supported SoCs are:
13 14
14 - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list 15 - S3C24XX: See Documentation/arm/samsung-s3c24xx/overview.rst for full list
15 - S3C64XX: S3C6400 and S3C6410 16 - S3C64XX: S3C6400 and S3C6410
16 - S5PC110 / S5PV210 17 - S5PC110 / S5PV210
17 18
@@ -22,7 +23,7 @@ S3C24XX Systems
22 There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which 23 There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which
23 deals with the architecture and drivers specific to these devices. 24 deals with the architecture and drivers specific to these devices.
24 25
25 See Documentation/arm/Samsung-S3C24XX/Overview.txt for more information 26 See Documentation/arm/samsung-s3c24xx/overview.rst for more information
26 on the implementation details and specific support. 27 on the implementation details and specific support.
27 28
28 29
@@ -32,8 +33,10 @@ Configuration
32 A number of configurations are supplied, as there is no current way of 33 A number of configurations are supplied, as there is no current way of
33 unifying all the SoCs into one kernel. 34 unifying all the SoCs into one kernel.
34 35
35 s5pc110_defconfig - S5PC110 specific default configuration 36 s5pc110_defconfig
36 s5pv210_defconfig - S5PV210 specific default configuration 37 - S5PC110 specific default configuration
38 s5pv210_defconfig
39 - S5PV210 specific default configuration
37 40
38 41
39Layout 42Layout
diff --git a/Documentation/arm/Setup b/Documentation/arm/setup.rst
index 0cb1e64bde80..8e12ef3fb9a7 100644
--- a/Documentation/arm/Setup
+++ b/Documentation/arm/setup.rst
@@ -1,5 +1,6 @@
1=============================================
1Kernel initialisation parameters on ARM Linux 2Kernel initialisation parameters on ARM Linux
2--------------------------------------------- 3=============================================
3 4
4The following document describes the kernel initialisation parameter 5The following document describes the kernel initialisation parameter
5structure, otherwise known as 'struct param_struct' which is used 6structure, otherwise known as 'struct param_struct' which is used
@@ -14,12 +15,10 @@ There are a lot of parameters listed in there, and they are described
14below: 15below:
15 16
16 page_size 17 page_size
17
18 This parameter must be set to the page size of the machine, and 18 This parameter must be set to the page size of the machine, and
19 will be checked by the kernel. 19 will be checked by the kernel.
20 20
21 nr_pages 21 nr_pages
22
23 This is the total number of pages of memory in the system. If 22 This is the total number of pages of memory in the system. If
24 the memory is banked, then this should contain the total number 23 the memory is banked, then this should contain the total number
25 of pages in the system. 24 of pages in the system.
@@ -28,24 +27,22 @@ below:
28 include this information. 27 include this information.
29 28
30 ramdisk_size 29 ramdisk_size
31
32 This is now obsolete, and should not be used. 30 This is now obsolete, and should not be used.
33 31
34 flags 32 flags
35
36 Various kernel flags, including: 33 Various kernel flags, including:
37 bit 0 - 1 = mount root read only
38 bit 1 - unused
39 bit 2 - 0 = load ramdisk
40 bit 3 - 0 = prompt for ramdisk
41 34
42 rootdev 35 ===== ========================
36 bit 0 1 = mount root read only
37 bit 1 unused
38 bit 2 0 = load ramdisk
39 bit 3 0 = prompt for ramdisk
40 ===== ========================
43 41
42 rootdev
44 major/minor number pair of device to mount as the root filesystem. 43 major/minor number pair of device to mount as the root filesystem.
45 44
46 video_num_cols 45 video_num_cols / video_num_rows
47 video_num_rows
48
49 These two together describe the character size of the dummy console, 46 These two together describe the character size of the dummy console,
50 or VGA console character size. They should not be used for any other 47 or VGA console character size. They should not be used for any other
51 purpose. 48 purpose.
@@ -54,66 +51,50 @@ below:
54 the equivalent character size of your fbcon display. This then allows 51 the equivalent character size of your fbcon display. This then allows
55 all the bootup messages to be displayed correctly. 52 all the bootup messages to be displayed correctly.
56 53
57 video_x 54 video_x / video_y
58 video_y
59
60 This describes the character position of cursor on VGA console, and 55 This describes the character position of cursor on VGA console, and
61 is otherwise unused. (should not be used for other console types, and 56 is otherwise unused. (should not be used for other console types, and
62 should not be used for other purposes). 57 should not be used for other purposes).
63 58
64 memc_control_reg 59 memc_control_reg
65
66 MEMC chip control register for Acorn Archimedes and Acorn A5000 60 MEMC chip control register for Acorn Archimedes and Acorn A5000
67 based machines. May be used differently by different architectures. 61 based machines. May be used differently by different architectures.
68 62
69 sounddefault 63 sounddefault
70
71 Default sound setting on Acorn machines. May be used differently by 64 Default sound setting on Acorn machines. May be used differently by
72 different architectures. 65 different architectures.
73 66
74 adfsdrives 67 adfsdrives
75
76 Number of ADFS/MFM disks. May be used differently by different 68 Number of ADFS/MFM disks. May be used differently by different
77 architectures. 69 architectures.
78 70
79 bytes_per_char_h 71 bytes_per_char_h / bytes_per_char_v
80 bytes_per_char_v
81
82 These are now obsolete, and should not be used. 72 These are now obsolete, and should not be used.
83 73
84 pages_in_bank[4] 74 pages_in_bank[4]
85
86 Number of pages in each bank of the systems memory (used for RiscPC). 75 Number of pages in each bank of the systems memory (used for RiscPC).
87 This is intended to be used on systems where the physical memory 76 This is intended to be used on systems where the physical memory
88 is non-contiguous from the processors point of view. 77 is non-contiguous from the processors point of view.
89 78
90 pages_in_vram 79 pages_in_vram
91
92 Number of pages in VRAM (used on Acorn RiscPC). This value may also 80 Number of pages in VRAM (used on Acorn RiscPC). This value may also
93 be used by loaders if the size of the video RAM can't be obtained 81 be used by loaders if the size of the video RAM can't be obtained
94 from the hardware. 82 from the hardware.
95 83
96 initrd_start 84 initrd_start / initrd_size
97 initrd_size
98
99 This describes the kernel virtual start address and size of the 85 This describes the kernel virtual start address and size of the
100 initial ramdisk. 86 initial ramdisk.
101 87
102 rd_start 88 rd_start
103
104 Start address in sectors of the ramdisk image on a floppy disk. 89 Start address in sectors of the ramdisk image on a floppy disk.
105 90
106 system_rev 91 system_rev
107
108 system revision number. 92 system revision number.
109 93
110 system_serial_low 94 system_serial_low / system_serial_high
111 system_serial_high
112
113 system 64-bit serial number 95 system 64-bit serial number
114 96
115 mem_fclk_21285 97 mem_fclk_21285
116
117 The speed of the external oscillator to the 21285 (footbridge), 98 The speed of the external oscillator to the 21285 (footbridge),
118 which control's the speed of the memory bus, timer & serial port. 99 which control's the speed of the memory bus, timer & serial port.
119 Depending upon the speed of the cpu its value can be between 100 Depending upon the speed of the cpu its value can be between
@@ -121,9 +102,7 @@ below:
121 then a value of 50 Mhz is the default on 21285 architectures. 102 then a value of 50 Mhz is the default on 21285 architectures.
122 103
123 paths[8][128] 104 paths[8][128]
124
125 These are now obsolete, and should not be used. 105 These are now obsolete, and should not be used.
126 106
127 commandline 107 commandline
128
129 Kernel command line parameters. Details can be found elsewhere. 108 Kernel command line parameters. Details can be found elsewhere.
diff --git a/Documentation/arm/SH-Mobile/.gitignore b/Documentation/arm/sh-mobile/.gitignore
index c928dbf3cc88..c928dbf3cc88 100644
--- a/Documentation/arm/SH-Mobile/.gitignore
+++ b/Documentation/arm/sh-mobile/.gitignore
diff --git a/Documentation/arm/SPEAr/overview.txt b/Documentation/arm/spear/overview.rst
index 1b049be6c84f..1a77f6b213b6 100644
--- a/Documentation/arm/SPEAr/overview.txt
+++ b/Documentation/arm/spear/overview.rst
@@ -1,5 +1,6 @@
1 SPEAr ARM Linux Overview 1========================
2 ========================== 2SPEAr ARM Linux Overview
3========================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -14,6 +15,7 @@ Introduction
14 Hierarchy in SPEAr is as follows: 15 Hierarchy in SPEAr is as follows:
15 16
16 SPEAr (Platform) 17 SPEAr (Platform)
18
17 - SPEAr3XX (3XX SOC series, based on ARM9) 19 - SPEAr3XX (3XX SOC series, based on ARM9)
18 - SPEAr300 (SOC) 20 - SPEAr300 (SOC)
19 - SPEAr300 Evaluation Board 21 - SPEAr300 Evaluation Board
@@ -30,17 +32,18 @@ Introduction
30 - SPEAr1340 (SOC) 32 - SPEAr1340 (SOC)
31 - SPEAr1340 Evaluation Board 33 - SPEAr1340 Evaluation Board
32 34
33 Configuration 35Configuration
34 ------------- 36-------------
35 37
36 A generic configuration is provided for each machine, and can be used as the 38 A generic configuration is provided for each machine, and can be used as the
37 default by 39 default by::
40
38 make spear13xx_defconfig 41 make spear13xx_defconfig
39 make spear3xx_defconfig 42 make spear3xx_defconfig
40 make spear6xx_defconfig 43 make spear6xx_defconfig
41 44
42 Layout 45Layout
43 ------ 46------
44 47
45 The common files for multiple machine families (SPEAr3xx, SPEAr6xx and 48 The common files for multiple machine families (SPEAr3xx, SPEAr6xx and
46 SPEAr13xx) are located in the platform code contained in arch/arm/plat-spear 49 SPEAr13xx) are located in the platform code contained in arch/arm/plat-spear
@@ -57,7 +60,7 @@ Introduction
57 support Flattened Device Tree. 60 support Flattened Device Tree.
58 61
59 62
60 Document Author 63Document Author
61 --------------- 64---------------
62 65
63 Viresh Kumar <vireshk@kernel.org>, (c) 2010-2012 ST Microelectronics 66 Viresh Kumar <vireshk@kernel.org>, (c) 2010-2012 ST Microelectronics
diff --git a/Documentation/arm/sti/overview.txt b/Documentation/arm/sti/overview.rst
index 1a4e93d6027f..70743617a74f 100644
--- a/Documentation/arm/sti/overview.txt
+++ b/Documentation/arm/sti/overview.rst
@@ -1,5 +1,6 @@
1 STi ARM Linux Overview 1======================
2 ========================== 2STi ARM Linux Overview
3======================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -10,15 +11,17 @@ Introduction
10 B2000 and B2020 Reference boards. 11 B2000 and B2020 Reference boards.
11 12
12 13
13 configuration 14configuration
14 ------------- 15-------------
15 16
16 A generic configuration is provided for both STiH415/416, and can be used as the 17 A generic configuration is provided for both STiH415/416, and can be used as the
17 default by 18 default by::
19
18 make stih41x_defconfig 20 make stih41x_defconfig
19 21
20 Layout 22Layout
21 ------ 23------
24
22 All the files for multiple machine families (STiH415, STiH416, and STiG125) 25 All the files for multiple machine families (STiH415, STiH416, and STiG125)
23 are located in the platform code contained in arch/arm/mach-sti 26 are located in the platform code contained in arch/arm/mach-sti
24 27
@@ -27,7 +30,7 @@ Introduction
27 Device Trees. 30 Device Trees.
28 31
29 32
30 Document Author 33Document Author
31 --------------- 34---------------
32 35
33 Srinivas Kandagatla <srinivas.kandagatla@st.com>, (c) 2013 ST Microelectronics 36 Srinivas Kandagatla <srinivas.kandagatla@st.com>, (c) 2013 ST Microelectronics
diff --git a/Documentation/arm/sti/stih407-overview.txt b/Documentation/arm/sti/stih407-overview.rst
index 3343f32f58bc..027e75bc7b7c 100644
--- a/Documentation/arm/sti/stih407-overview.txt
+++ b/Documentation/arm/sti/stih407-overview.rst
@@ -1,5 +1,6 @@
1 STiH407 Overview 1================
2 ================ 2STiH407 Overview
3================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -12,7 +13,7 @@ Introduction
12 - ARM Cortex-A9 1.5 GHz dual core CPU (28nm) 13 - ARM Cortex-A9 1.5 GHz dual core CPU (28nm)
13 - SATA2, USB 3.0, PCIe, Gbit Ethernet 14 - SATA2, USB 3.0, PCIe, Gbit Ethernet
14 15
15 Document Author 16Document Author
16 --------------- 17---------------
17 18
18 Maxime Coquelin <maxime.coquelin@st.com>, (c) 2014 ST Microelectronics 19 Maxime Coquelin <maxime.coquelin@st.com>, (c) 2014 ST Microelectronics
diff --git a/Documentation/arm/sti/stih415-overview.txt b/Documentation/arm/sti/stih415-overview.rst
index 1383e33f265d..b67452d610c4 100644
--- a/Documentation/arm/sti/stih415-overview.txt
+++ b/Documentation/arm/sti/stih415-overview.rst
@@ -1,5 +1,6 @@
1 STiH415 Overview 1================
2 ================ 2STiH415 Overview
3================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -7,6 +8,7 @@ Introduction
7 The STiH415 is the next generation of HD, AVC set-top box processors 8 The STiH415 is the next generation of HD, AVC set-top box processors
8 for satellite, cable, terrestrial and IP-STB markets. 9 for satellite, cable, terrestrial and IP-STB markets.
9 10
10 Features 11 Features:
12
11 - ARM Cortex-A9 1.0 GHz, dual-core CPU 13 - ARM Cortex-A9 1.0 GHz, dual-core CPU
12 - SATA2x2,USB 2.0x3, PCIe, Gbit Ethernet MACx2 14 - SATA2x2,USB 2.0x3, PCIe, Gbit Ethernet MACx2
diff --git a/Documentation/arm/sti/stih416-overview.txt b/Documentation/arm/sti/stih416-overview.rst
index 558444c201c6..93f17d74d8db 100644
--- a/Documentation/arm/sti/stih416-overview.txt
+++ b/Documentation/arm/sti/stih416-overview.rst
@@ -1,5 +1,6 @@
1 STiH416 Overview 1================
2 ================ 2STiH416 Overview
3================
3 4
4Introduction 5Introduction
5------------ 6------------
diff --git a/Documentation/arm/sti/stih418-overview.txt b/Documentation/arm/sti/stih418-overview.rst
index 1cd8fc80646d..b563c1f4fe5a 100644
--- a/Documentation/arm/sti/stih418-overview.txt
+++ b/Documentation/arm/sti/stih418-overview.rst
@@ -1,5 +1,6 @@
1 STiH418 Overview 1================
2 ================ 2STiH418 Overview
3================
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -14,7 +15,7 @@ Introduction
14 - HEVC L5.1 Main 10 15 - HEVC L5.1 Main 10
15 - VP9 16 - VP9
16 17
17 Document Author 18Document Author
18 --------------- 19---------------
19 20
20 Maxime Coquelin <maxime.coquelin@st.com>, (c) 2015 ST Microelectronics 21 Maxime Coquelin <maxime.coquelin@st.com>, (c) 2015 ST Microelectronics
diff --git a/Documentation/arm/stm32/overview.rst b/Documentation/arm/stm32/overview.rst
index f7e734153860..85cfc8410798 100644
--- a/Documentation/arm/stm32/overview.rst
+++ b/Documentation/arm/stm32/overview.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3======================== 1========================
4STM32 ARM Linux Overview 2STM32 ARM Linux Overview
5======================== 3========================
diff --git a/Documentation/arm/stm32/stm32f429-overview.rst b/Documentation/arm/stm32/stm32f429-overview.rst
index 65bbb1c3b423..a7ebe8ea6697 100644
--- a/Documentation/arm/stm32/stm32f429-overview.rst
+++ b/Documentation/arm/stm32/stm32f429-overview.rst
@@ -1,5 +1,4 @@
1:orphan: 1==================
2
3STM32F429 Overview 2STM32F429 Overview
4================== 3==================
5 4
@@ -23,6 +22,4 @@ Datasheet and reference manual are publicly available on ST website (STM32F429_)
23 22
24.. _STM32F429: http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1577/LN1806?ecmp=stm32f429-439_pron_pr-ces2014_nov2013 23.. _STM32F429: http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1577/LN1806?ecmp=stm32f429-439_pron_pr-ces2014_nov2013
25 24
26:Authors: 25:Authors: Maxime Coquelin <mcoquelin.stm32@gmail.com>
27
28Maxime Coquelin <mcoquelin.stm32@gmail.com>
diff --git a/Documentation/arm/stm32/stm32f746-overview.rst b/Documentation/arm/stm32/stm32f746-overview.rst
index 42d593085015..78befddc7740 100644
--- a/Documentation/arm/stm32/stm32f746-overview.rst
+++ b/Documentation/arm/stm32/stm32f746-overview.rst
@@ -1,5 +1,4 @@
1:orphan: 1==================
2
3STM32F746 Overview 2STM32F746 Overview
4================== 3==================
5 4
@@ -30,6 +29,4 @@ Datasheet and reference manual are publicly available on ST website (STM32F746_)
30 29
31.. _STM32F746: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html 30.. _STM32F746: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html
32 31
33:Authors: 32:Authors: Alexandre Torgue <alexandre.torgue@st.com>
34
35Alexandre Torgue <alexandre.torgue@st.com>
diff --git a/Documentation/arm/stm32/stm32f769-overview.rst b/Documentation/arm/stm32/stm32f769-overview.rst
index f6adac862b17..e482980ddf21 100644
--- a/Documentation/arm/stm32/stm32f769-overview.rst
+++ b/Documentation/arm/stm32/stm32f769-overview.rst
@@ -1,5 +1,4 @@
1:orphan: 1==================
2
3STM32F769 Overview 2STM32F769 Overview
4================== 3==================
5 4
@@ -32,6 +31,4 @@ Datasheet and reference manual are publicly available on ST website (STM32F769_)
32 31
33.. _STM32F769: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f7-series/stm32f7x9/stm32f769ni.html 32.. _STM32F769: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f7-series/stm32f7x9/stm32f769ni.html
34 33
35:Authors: 34:Authors: Alexandre Torgue <alexandre.torgue@st.com>
36
37Alexandre Torgue <alexandre.torgue@st.com>
diff --git a/Documentation/arm/stm32/stm32h743-overview.rst b/Documentation/arm/stm32/stm32h743-overview.rst
index c525835e7473..4e15f1a42730 100644
--- a/Documentation/arm/stm32/stm32h743-overview.rst
+++ b/Documentation/arm/stm32/stm32h743-overview.rst
@@ -1,5 +1,4 @@
1:orphan: 1==================
2
3STM32H743 Overview 2STM32H743 Overview
4================== 3==================
5 4
@@ -31,6 +30,4 @@ Datasheet and reference manual are publicly available on ST website (STM32H743_)
31 30
32.. _STM32H743: http://www.st.com/en/microcontrollers/stm32h7x3.html?querycriteria=productId=LN2033 31.. _STM32H743: http://www.st.com/en/microcontrollers/stm32h7x3.html?querycriteria=productId=LN2033
33 32
34:Authors: 33:Authors: Alexandre Torgue <alexandre.torgue@st.com>
35
36Alexandre Torgue <alexandre.torgue@st.com>
diff --git a/Documentation/arm/stm32/stm32mp157-overview.rst b/Documentation/arm/stm32/stm32mp157-overview.rst
index 2c52cd020601..f62fdc8e7d8d 100644
--- a/Documentation/arm/stm32/stm32mp157-overview.rst
+++ b/Documentation/arm/stm32/stm32mp157-overview.rst
@@ -1,5 +1,4 @@
1:orphan: 1===================
2
3STM32MP157 Overview 2STM32MP157 Overview
4=================== 3===================
5 4
diff --git a/Documentation/arm/sunxi/README b/Documentation/arm/sunxi.rst
index f8efc21998bf..b037428aee98 100644
--- a/Documentation/arm/sunxi/README
+++ b/Documentation/arm/sunxi.rst
@@ -1,3 +1,4 @@
1==================
1ARM Allwinner SoCs 2ARM Allwinner SoCs
2================== 3==================
3 4
@@ -10,93 +11,140 @@ SunXi family
10 Linux kernel mach directory: arch/arm/mach-sunxi 11 Linux kernel mach directory: arch/arm/mach-sunxi
11 12
12 Flavors: 13 Flavors:
14
13 * ARM926 based SoCs 15 * ARM926 based SoCs
14 - Allwinner F20 (sun3i) 16 - Allwinner F20 (sun3i)
15 + Not Supported 17
18 * Not Supported
16 19
17 * ARM Cortex-A8 based SoCs 20 * ARM Cortex-A8 based SoCs
18 - Allwinner A10 (sun4i) 21 - Allwinner A10 (sun4i)
19 + Datasheet 22
23 * Datasheet
24
20 http://dl.linux-sunxi.org/A10/A10%20Datasheet%20-%20v1.21%20%282012-04-06%29.pdf 25 http://dl.linux-sunxi.org/A10/A10%20Datasheet%20-%20v1.21%20%282012-04-06%29.pdf
21 + User Manual 26 * User Manual
27
22 http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09%2c%20DECRYPTED%29.pdf 28 http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09%2c%20DECRYPTED%29.pdf
23 29
24 - Allwinner A10s (sun5i) 30 - Allwinner A10s (sun5i)
25 + Datasheet 31
32 * Datasheet
33
26 http://dl.linux-sunxi.org/A10s/A10s%20Datasheet%20-%20v1.20%20%282012-03-27%29.pdf 34 http://dl.linux-sunxi.org/A10s/A10s%20Datasheet%20-%20v1.20%20%282012-03-27%29.pdf
27 35
28 - Allwinner A13 / R8 (sun5i) 36 - Allwinner A13 / R8 (sun5i)
29 + Datasheet 37
38 * Datasheet
39
30 http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf 40 http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf
31 + User Manual 41 * User Manual
42
32 http://dl.linux-sunxi.org/A13/A13%20User%20Manual%20-%20v1.2%20%282013-01-08%29.pdf 43 http://dl.linux-sunxi.org/A13/A13%20User%20Manual%20-%20v1.2%20%282013-01-08%29.pdf
33 44
34 - Next Thing Co GR8 (sun5i) 45 - Next Thing Co GR8 (sun5i)
35 46
36 * Single ARM Cortex-A7 based SoCs 47 * Single ARM Cortex-A7 based SoCs
37 - Allwinner V3s (sun8i) 48 - Allwinner V3s (sun8i)
38 + Datasheet 49
50 * Datasheet
51
39 http://linux-sunxi.org/File:Allwinner_V3s_Datasheet_V1.0.pdf 52 http://linux-sunxi.org/File:Allwinner_V3s_Datasheet_V1.0.pdf
40 53
41 * Dual ARM Cortex-A7 based SoCs 54 * Dual ARM Cortex-A7 based SoCs
42 - Allwinner A20 (sun7i) 55 - Allwinner A20 (sun7i)
43 + User Manual 56
57 * User Manual
58
44 http://dl.linux-sunxi.org/A20/A20%20User%20Manual%202013-03-22.pdf 59 http://dl.linux-sunxi.org/A20/A20%20User%20Manual%202013-03-22.pdf
45 60
46 - Allwinner A23 (sun8i) 61 - Allwinner A23 (sun8i)
47 + Datasheet 62
63 * Datasheet
64
48 http://dl.linux-sunxi.org/A23/A23%20Datasheet%20V1.0%2020130830.pdf 65 http://dl.linux-sunxi.org/A23/A23%20Datasheet%20V1.0%2020130830.pdf
49 + User Manual 66
67 * User Manual
68
50 http://dl.linux-sunxi.org/A23/A23%20User%20Manual%20V1.0%2020130830.pdf 69 http://dl.linux-sunxi.org/A23/A23%20User%20Manual%20V1.0%2020130830.pdf
51 70
52 * Quad ARM Cortex-A7 based SoCs 71 * Quad ARM Cortex-A7 based SoCs
53 - Allwinner A31 (sun6i) 72 - Allwinner A31 (sun6i)
54 + Datasheet 73
74 * Datasheet
75
55 http://dl.linux-sunxi.org/A31/A3x_release_document/A31/IC/A31%20datasheet%20V1.3%2020131106.pdf 76 http://dl.linux-sunxi.org/A31/A3x_release_document/A31/IC/A31%20datasheet%20V1.3%2020131106.pdf
56 + User Manual 77
78 * User Manual
79
57 http://dl.linux-sunxi.org/A31/A3x_release_document/A31/IC/A31%20user%20manual%20V1.1%2020130630.pdf 80 http://dl.linux-sunxi.org/A31/A3x_release_document/A31/IC/A31%20user%20manual%20V1.1%2020130630.pdf
58 81
59 - Allwinner A31s (sun6i) 82 - Allwinner A31s (sun6i)
60 + Datasheet 83
84 * Datasheet
85
61 http://dl.linux-sunxi.org/A31/A3x_release_document/A31s/IC/A31s%20datasheet%20V1.3%2020131106.pdf 86 http://dl.linux-sunxi.org/A31/A3x_release_document/A31s/IC/A31s%20datasheet%20V1.3%2020131106.pdf
62 + User Manual 87
88 * User Manual
89
63 http://dl.linux-sunxi.org/A31/A3x_release_document/A31s/IC/A31s%20User%20Manual%20%20V1.0%2020130322.pdf 90 http://dl.linux-sunxi.org/A31/A3x_release_document/A31s/IC/A31s%20User%20Manual%20%20V1.0%2020130322.pdf
64 91
65 - Allwinner A33 (sun8i) 92 - Allwinner A33 (sun8i)
66 + Datasheet 93
94 * Datasheet
95
67 http://dl.linux-sunxi.org/A33/A33%20Datasheet%20release%201.1.pdf 96 http://dl.linux-sunxi.org/A33/A33%20Datasheet%20release%201.1.pdf
68 + User Manual 97
98 * User Manual
99
69 http://dl.linux-sunxi.org/A33/A33%20user%20manual%20release%201.1.pdf 100 http://dl.linux-sunxi.org/A33/A33%20user%20manual%20release%201.1.pdf
70 101
71 - Allwinner H2+ (sun8i) 102 - Allwinner H2+ (sun8i)
72 + No document available now, but is known to be working properly with 103
104 * No document available now, but is known to be working properly with
73 H3 drivers and memory map. 105 H3 drivers and memory map.
74 106
75 - Allwinner H3 (sun8i) 107 - Allwinner H3 (sun8i)
76 + Datasheet 108
109 * Datasheet
110
77 http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf 111 http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf
78 112
79 - Allwinner R40 (sun8i) 113 - Allwinner R40 (sun8i)
80 + Datasheet 114
115 * Datasheet
116
81 https://github.com/tinalinux/docs/raw/r40-v1.y/R40_Datasheet_V1.0.pdf 117 https://github.com/tinalinux/docs/raw/r40-v1.y/R40_Datasheet_V1.0.pdf
82 + User Manual 118
119 * User Manual
120
83 https://github.com/tinalinux/docs/raw/r40-v1.y/Allwinner_R40_User_Manual_V1.0.pdf 121 https://github.com/tinalinux/docs/raw/r40-v1.y/Allwinner_R40_User_Manual_V1.0.pdf
84 122
85 * Quad ARM Cortex-A15, Quad ARM Cortex-A7 based SoCs 123 * Quad ARM Cortex-A15, Quad ARM Cortex-A7 based SoCs
86 - Allwinner A80 124 - Allwinner A80
87 + Datasheet 125
126 * Datasheet
127
88 http://dl.linux-sunxi.org/A80/A80_Datasheet_Revision_1.0_0404.pdf 128 http://dl.linux-sunxi.org/A80/A80_Datasheet_Revision_1.0_0404.pdf
89 129
90 * Octa ARM Cortex-A7 based SoCs 130 * Octa ARM Cortex-A7 based SoCs
91 - Allwinner A83T 131 - Allwinner A83T
92 + Datasheet 132
133 * Datasheet
134
93 https://github.com/allwinner-zh/documents/raw/master/A83T/A83T_Datasheet_v1.3_20150510.pdf 135 https://github.com/allwinner-zh/documents/raw/master/A83T/A83T_Datasheet_v1.3_20150510.pdf
94 + User Manual 136
137 * User Manual
138
95 https://github.com/allwinner-zh/documents/raw/master/A83T/A83T_User_Manual_v1.5.1_20150513.pdf 139 https://github.com/allwinner-zh/documents/raw/master/A83T/A83T_User_Manual_v1.5.1_20150513.pdf
96 140
97 * Quad ARM Cortex-A53 based SoCs 141 * Quad ARM Cortex-A53 based SoCs
98 - Allwinner A64 142 - Allwinner A64
99 + Datasheet 143
144 * Datasheet
145
100 http://dl.linux-sunxi.org/A64/A64_Datasheet_V1.1.pdf 146 http://dl.linux-sunxi.org/A64/A64_Datasheet_V1.1.pdf
101 + User Manual 147
148 * User Manual
149
102 http://dl.linux-sunxi.org/A64/Allwinner%20A64%20User%20Manual%20v1.0.pdf 150 http://dl.linux-sunxi.org/A64/Allwinner%20A64%20User%20Manual%20v1.0.pdf
diff --git a/Documentation/arm/sunxi/clocks.txt b/Documentation/arm/sunxi/clocks.rst
index e09a88aa3136..23bd03f3e21f 100644
--- a/Documentation/arm/sunxi/clocks.txt
+++ b/Documentation/arm/sunxi/clocks.rst
@@ -1,3 +1,4 @@
1=======================================================
1Frequently asked questions about the sunxi clock system 2Frequently asked questions about the sunxi clock system
2======================================================= 3=======================================================
3 4
@@ -12,7 +13,7 @@ A: The 24MHz oscillator allows gating to save power. Indeed, if gated
12 steps, one can gate it and keep the system running. Consider this 13 steps, one can gate it and keep the system running. Consider this
13 simplified suspend example: 14 simplified suspend example:
14 15
15 While the system is operational, you would see something like 16 While the system is operational, you would see something like::
16 17
17 24MHz 32kHz 18 24MHz 32kHz
18 | 19 |
@@ -23,7 +24,7 @@ A: The 24MHz oscillator allows gating to save power. Indeed, if gated
23 [CPU] 24 [CPU]
24 25
25 When you are about to suspend, you switch the CPU Mux to the 32kHz 26 When you are about to suspend, you switch the CPU Mux to the 32kHz
26 oscillator: 27 oscillator::
27 28
28 24Mhz 32kHz 29 24Mhz 32kHz
29 | | 30 | |
@@ -33,7 +34,7 @@ A: The 24MHz oscillator allows gating to save power. Indeed, if gated
33 | 34 |
34 [CPU] 35 [CPU]
35 36
36 Finally you can gate the main oscillator 37 Finally you can gate the main oscillator::
37 38
38 32kHz 39 32kHz
39 | 40 |
diff --git a/Documentation/arm/swp_emulation b/Documentation/arm/swp_emulation.rst
index af903d22fd93..6a608a9c3715 100644
--- a/Documentation/arm/swp_emulation
+++ b/Documentation/arm/swp_emulation.rst
@@ -11,17 +11,17 @@ sequence. If a memory access fault (an abort) occurs, a segmentation fault is
11signalled to the triggering process. 11signalled to the triggering process.
12 12
13/proc/cpu/swp_emulation holds some statistics/information, including the PID of 13/proc/cpu/swp_emulation holds some statistics/information, including the PID of
14the last process to trigger the emulation to be invocated. For example: 14the last process to trigger the emulation to be invocated. For example::
15---
16Emulated SWP: 12
17Emulated SWPB: 0
18Aborted SWP{B}: 1
19Last process: 314
20---
21 15
22NOTE: when accessing uncached shared regions, LDREX/STREX rely on an external 16 Emulated SWP: 12
23transaction monitoring block called a global monitor to maintain update 17 Emulated SWPB: 0
24atomicity. If your system does not implement a global monitor, this option can 18 Aborted SWP{B}: 1
25cause programs that perform SWP operations to uncached memory to deadlock, as 19 Last process: 314
26the STREX operation will always fail.
27 20
21
22NOTE:
23 when accessing uncached shared regions, LDREX/STREX rely on an external
24 transaction monitoring block called a global monitor to maintain update
25 atomicity. If your system does not implement a global monitor, this option can
26 cause programs that perform SWP operations to uncached memory to deadlock, as
27 the STREX operation will always fail.
diff --git a/Documentation/arm/tcm.txt b/Documentation/arm/tcm.rst
index 7c15871c1885..effd9c7bc968 100644
--- a/Documentation/arm/tcm.txt
+++ b/Documentation/arm/tcm.rst
@@ -1,5 +1,7 @@
1==================================================
1ARM TCM (Tightly-Coupled Memory) handling in Linux 2ARM TCM (Tightly-Coupled Memory) handling in Linux
2---- 3==================================================
4
3Written by Linus Walleij <linus.walleij@stericsson.com> 5Written by Linus Walleij <linus.walleij@stericsson.com>
4 6
5Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory). 7Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory).
@@ -85,46 +87,50 @@ to have functions called locally inside the TCM without
85wasting space, there is also the __tcmlocalfunc prefix that 87wasting space, there is also the __tcmlocalfunc prefix that
86will make the call relative. 88will make the call relative.
87 89
88Variables to go into dtcm can be tagged like this: 90Variables to go into dtcm can be tagged like this::
89int __tcmdata foo; 91
92 int __tcmdata foo;
93
94Constants can be tagged like this::
90 95
91Constants can be tagged like this: 96 int __tcmconst foo;
92int __tcmconst foo; 97
98To put assembler into TCM just use::
99
100 .section ".tcm.text" or .section ".tcm.data"
93 101
94To put assembler into TCM just use
95.section ".tcm.text" or .section ".tcm.data"
96respectively. 102respectively.
97 103
98Example code: 104Example code::
99 105
100#include <asm/tcm.h> 106 #include <asm/tcm.h>
101 107
102/* Uninitialized data */ 108 /* Uninitialized data */
103static u32 __tcmdata tcmvar; 109 static u32 __tcmdata tcmvar;
104/* Initialized data */ 110 /* Initialized data */
105static u32 __tcmdata tcmassigned = 0x2BADBABEU; 111 static u32 __tcmdata tcmassigned = 0x2BADBABEU;
106/* Constant */ 112 /* Constant */
107static const u32 __tcmconst tcmconst = 0xCAFEBABEU; 113 static const u32 __tcmconst tcmconst = 0xCAFEBABEU;
108 114
109static void __tcmlocalfunc tcm_to_tcm(void) 115 static void __tcmlocalfunc tcm_to_tcm(void)
110{ 116 {
111 int i; 117 int i;
112 for (i = 0; i < 100; i++) 118 for (i = 0; i < 100; i++)
113 tcmvar ++; 119 tcmvar ++;
114} 120 }
115 121
116static void __tcmfunc hello_tcm(void) 122 static void __tcmfunc hello_tcm(void)
117{ 123 {
118 /* Some abstract code that runs in ITCM */ 124 /* Some abstract code that runs in ITCM */
119 int i; 125 int i;
120 for (i = 0; i < 100; i++) { 126 for (i = 0; i < 100; i++) {
121 tcmvar ++; 127 tcmvar ++;
122 } 128 }
123 tcm_to_tcm(); 129 tcm_to_tcm();
124} 130 }
125 131
126static void __init test_tcm(void) 132 static void __init test_tcm(void)
127{ 133 {
128 u32 *tcmem; 134 u32 *tcmem;
129 int i; 135 int i;
130 136
@@ -152,4 +158,4 @@ static void __init test_tcm(void)
152 printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]); 158 printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]);
153 tcm_free(tcmem, 20); 159 tcm_free(tcmem, 20);
154 } 160 }
155} 161 }
diff --git a/Documentation/arm/uefi.txt b/Documentation/arm/uefi.rst
index 6543a0adea8a..f868330df6be 100644
--- a/Documentation/arm/uefi.txt
+++ b/Documentation/arm/uefi.rst
@@ -1,3 +1,7 @@
1================================================
2The Unified Extensible Firmware Interface (UEFI)
3================================================
4
1UEFI, the Unified Extensible Firmware Interface, is a specification 5UEFI, the Unified Extensible Firmware Interface, is a specification
2governing the behaviours of compatible firmware interfaces. It is 6governing the behaviours of compatible firmware interfaces. It is
3maintained by the UEFI Forum - http://www.uefi.org/. 7maintained by the UEFI Forum - http://www.uefi.org/.
@@ -11,11 +15,13 @@ UEFI support in Linux
11===================== 15=====================
12Booting on a platform with firmware compliant with the UEFI specification 16Booting on a platform with firmware compliant with the UEFI specification
13makes it possible for the kernel to support additional features: 17makes it possible for the kernel to support additional features:
18
14- UEFI Runtime Services 19- UEFI Runtime Services
15- Retrieving various configuration information through the standardised 20- Retrieving various configuration information through the standardised
16 interface of UEFI configuration tables. (ACPI, SMBIOS, ...) 21 interface of UEFI configuration tables. (ACPI, SMBIOS, ...)
17 22
18For actually enabling [U]EFI support, enable: 23For actually enabling [U]EFI support, enable:
24
19- CONFIG_EFI=y 25- CONFIG_EFI=y
20- CONFIG_EFI_VARS=y or m 26- CONFIG_EFI_VARS=y or m
21 27
@@ -42,19 +48,20 @@ Instead, the kernel reads the UEFI memory map.
42 48
43The stub populates the FDT /chosen node with (and the kernel scans for) the 49The stub populates the FDT /chosen node with (and the kernel scans for) the
44following parameters: 50following parameters:
45________________________________________________________________________________ 51
46Name | Size | Description 52========================== ====== ===========================================
47================================================================================ 53Name Size Description
48linux,uefi-system-table | 64-bit | Physical address of the UEFI System Table. 54========================== ====== ===========================================
49-------------------------------------------------------------------------------- 55linux,uefi-system-table 64-bit Physical address of the UEFI System Table.
50linux,uefi-mmap-start | 64-bit | Physical address of the UEFI memory map, 56
51 | | populated by the UEFI GetMemoryMap() call. 57linux,uefi-mmap-start 64-bit Physical address of the UEFI memory map,
52-------------------------------------------------------------------------------- 58 populated by the UEFI GetMemoryMap() call.
53linux,uefi-mmap-size | 32-bit | Size in bytes of the UEFI memory map 59
54 | | pointed to in previous entry. 60linux,uefi-mmap-size 32-bit Size in bytes of the UEFI memory map
55-------------------------------------------------------------------------------- 61 pointed to in previous entry.
56linux,uefi-mmap-desc-size | 32-bit | Size in bytes of each entry in the UEFI 62
57 | | memory map. 63linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI
58-------------------------------------------------------------------------------- 64 memory map.
59linux,uefi-mmap-desc-ver | 32-bit | Version of the mmap descriptor format. 65
60-------------------------------------------------------------------------------- 66linux,uefi-mmap-desc-ver 32-bit Version of the mmap descriptor format.
67========================== ====== ===========================================
diff --git a/Documentation/arm/VFP/release-notes.txt b/Documentation/arm/vfp/release-notes.rst
index 28a2795705ca..c6b04937cee3 100644
--- a/Documentation/arm/VFP/release-notes.txt
+++ b/Documentation/arm/vfp/release-notes.rst
@@ -1,7 +1,9 @@
1===============================================
1Release notes for Linux Kernel VFP support code 2Release notes for Linux Kernel VFP support code
2----------------------------------------------- 3===============================================
3 4
4Date: 20 May 2004 5Date: 20 May 2004
6
5Author: Russell King 7Author: Russell King
6 8
7This is the first release of the Linux Kernel VFP support code. It 9This is the first release of the Linux Kernel VFP support code. It
diff --git a/Documentation/arm/vlocks.txt b/Documentation/arm/vlocks.rst
index 45731672c564..a40a1742110b 100644
--- a/Documentation/arm/vlocks.txt
+++ b/Documentation/arm/vlocks.rst
@@ -1,3 +1,4 @@
1======================================
1vlocks for Bare-Metal Mutual Exclusion 2vlocks for Bare-Metal Mutual Exclusion
2====================================== 3======================================
3 4
@@ -26,7 +27,7 @@ started yet.
26Algorithm 27Algorithm
27--------- 28---------
28 29
29The easiest way to explain the vlocks algorithm is with some pseudo-code: 30The easiest way to explain the vlocks algorithm is with some pseudo-code::
30 31
31 32
32 int currently_voting[NR_CPUS] = { 0, }; 33 int currently_voting[NR_CPUS] = { 0, };
@@ -93,7 +94,7 @@ Features and limitations
93 number of CPUs. 94 number of CPUs.
94 95
95 vlocks can be cascaded in a voting hierarchy to permit better scaling 96 vlocks can be cascaded in a voting hierarchy to permit better scaling
96 if necessary, as in the following hypothetical example for 4096 CPUs: 97 if necessary, as in the following hypothetical example for 4096 CPUs::
97 98
98 /* first level: local election */ 99 /* first level: local election */
99 my_town = towns[(this_cpu >> 4) & 0xf]; 100 my_town = towns[(this_cpu >> 4) & 0xf];
@@ -127,12 +128,12 @@ the basic algorithm:
127 reduces the number of round-trips required to external memory. 128 reduces the number of round-trips required to external memory.
128 129
129 In the ARM implementation, this means that we can use a single load 130 In the ARM implementation, this means that we can use a single load
130 and comparison: 131 and comparison::
131 132
132 LDR Rt, [Rn] 133 LDR Rt, [Rn]
133 CMP Rt, #0 134 CMP Rt, #0
134 135
135 ...in place of code equivalent to: 136 ...in place of code equivalent to::
136 137
137 LDRB Rt, [Rn] 138 LDRB Rt, [Rn]
138 CMP Rt, #0 139 CMP Rt, #0
diff --git a/Documentation/arm64/index.rst b/Documentation/arm64/index.rst
index 018b7836ecb7..96b696ba4e6c 100644
--- a/Documentation/arm64/index.rst
+++ b/Documentation/arm64/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3================== 1==================
4ARM64 Architecture 2ARM64 Architecture
5================== 3==================
diff --git a/Documentation/backlight/lp855x-driver.txt b/Documentation/backlight/lp855x-driver.txt
deleted file mode 100644
index 01bce243d3d7..000000000000
--- a/Documentation/backlight/lp855x-driver.txt
+++ /dev/null
@@ -1,66 +0,0 @@
1Kernel driver lp855x
2====================
3
4Backlight driver for LP855x ICs
5
6Supported chips:
7 Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
8 LP8557
9
10Author: Milo(Woogyom) Kim <milo.kim@ti.com>
11
12Description
13-----------
14
15* Brightness control
16
17Brightness can be controlled by the pwm input or the i2c command.
18The lp855x driver supports both cases.
19
20* Device attributes
21
221) bl_ctl_mode
23Backlight control mode.
24Value : pwm based or register based
25
262) chip_id
27The lp855x chip id.
28Value : lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557
29
30Platform data for lp855x
31------------------------
32
33For supporting platform specific data, the lp855x platform data can be used.
34
35* name : Backlight driver name. If it is not defined, default name is set.
36* device_control : Value of DEVICE CONTROL register.
37* initial_brightness : Initial value of backlight brightness.
38* period_ns : Platform specific PWM period value. unit is nano.
39 Only valid when brightness is pwm input mode.
40* size_program : Total size of lp855x_rom_data.
41* rom_data : List of new eeprom/eprom registers.
42
43example 1) lp8552 platform data : i2c register mode with new eeprom data
44
45#define EEPROM_A5_ADDR 0xA5
46#define EEPROM_A5_VAL 0x4f /* EN_VSYNC=0 */
47
48static struct lp855x_rom_data lp8552_eeprom_arr[] = {
49 {EEPROM_A5_ADDR, EEPROM_A5_VAL},
50};
51
52static struct lp855x_platform_data lp8552_pdata = {
53 .name = "lcd-bl",
54 .device_control = I2C_CONFIG(LP8552),
55 .initial_brightness = INITIAL_BRT,
56 .size_program = ARRAY_SIZE(lp8552_eeprom_arr),
57 .rom_data = lp8552_eeprom_arr,
58};
59
60example 2) lp8556 platform data : pwm input mode with default rom data
61
62static struct lp855x_platform_data lp8556_pdata = {
63 .device_control = PWM_CONFIG(LP8556),
64 .initial_brightness = INITIAL_BRT,
65 .period_ns = 1000000,
66};
diff --git a/Documentation/block/bfq-iosched.txt b/Documentation/block/bfq-iosched.rst
index bbd6eb5bbb07..0d237d402860 100644
--- a/Documentation/block/bfq-iosched.txt
+++ b/Documentation/block/bfq-iosched.rst
@@ -1,9 +1,11 @@
1==========================
1BFQ (Budget Fair Queueing) 2BFQ (Budget Fair Queueing)
2========================== 3==========================
3 4
4BFQ is a proportional-share I/O scheduler, with some extra 5BFQ is a proportional-share I/O scheduler, with some extra
5low-latency capabilities. In addition to cgroups support (blkio or io 6low-latency capabilities. In addition to cgroups support (blkio or io
6controllers), BFQ's main features are: 7controllers), BFQ's main features are:
8
7- BFQ guarantees a high system and application responsiveness, and a 9- BFQ guarantees a high system and application responsiveness, and a
8 low latency for time-sensitive applications, such as audio or video 10 low latency for time-sensitive applications, such as audio or video
9 players; 11 players;
@@ -55,18 +57,18 @@ sustainable throughputs, on the same systems as above:
55 57
56BFQ works for multi-queue devices too. 58BFQ works for multi-queue devices too.
57 59
58The table of contents follow. Impatients can just jump to Section 3. 60.. The table of contents follow. Impatients can just jump to Section 3.
59 61
60CONTENTS 62.. CONTENTS
61 63
621. When may BFQ be useful? 64 1. When may BFQ be useful?
63 1-1 Personal systems 65 1-1 Personal systems
64 1-2 Server systems 66 1-2 Server systems
652. How does BFQ work? 67 2. How does BFQ work?
663. What are BFQ's tunables and how to properly configure BFQ? 68 3. What are BFQ's tunables and how to properly configure BFQ?
674. BFQ group scheduling 69 4. BFQ group scheduling
68 4-1 Service guarantees provided 70 4-1 Service guarantees provided
69 4-2 Interface 71 4-2 Interface
70 72
711. When may BFQ be useful? 731. When may BFQ be useful?
72========================== 74==========================
@@ -77,17 +79,20 @@ BFQ provides the following benefits on personal and server systems.
77-------------------- 79--------------------
78 80
79Low latency for interactive applications 81Low latency for interactive applications
82^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80 83
81Regardless of the actual background workload, BFQ guarantees that, for 84Regardless of the actual background workload, BFQ guarantees that, for
82interactive tasks, the storage device is virtually as responsive as if 85interactive tasks, the storage device is virtually as responsive as if
83it was idle. For example, even if one or more of the following 86it was idle. For example, even if one or more of the following
84background workloads are being executed: 87background workloads are being executed:
88
85- one or more large files are being read, written or copied, 89- one or more large files are being read, written or copied,
86- a tree of source files is being compiled, 90- a tree of source files is being compiled,
87- one or more virtual machines are performing I/O, 91- one or more virtual machines are performing I/O,
88- a software update is in progress, 92- a software update is in progress,
89- indexing daemons are scanning filesystems and updating their 93- indexing daemons are scanning filesystems and updating their
90 databases, 94 databases,
95
91starting an application or loading a file from within an application 96starting an application or loading a file from within an application
92takes about the same time as if the storage device was idle. As a 97takes about the same time as if the storage device was idle. As a
93comparison, with CFQ, NOOP or DEADLINE, and in the same conditions, 98comparison, with CFQ, NOOP or DEADLINE, and in the same conditions,
@@ -95,13 +100,14 @@ applications experience high latencies, or even become unresponsive
95until the background workload terminates (also on SSDs). 100until the background workload terminates (also on SSDs).
96 101
97Low latency for soft real-time applications 102Low latency for soft real-time applications
98 103^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99Also soft real-time applications, such as audio and video 104Also soft real-time applications, such as audio and video
100players/streamers, enjoy a low latency and a low drop rate, regardless 105players/streamers, enjoy a low latency and a low drop rate, regardless
101of the background I/O workload. As a consequence, these applications 106of the background I/O workload. As a consequence, these applications
102do not suffer from almost any glitch due to the background workload. 107do not suffer from almost any glitch due to the background workload.
103 108
104Higher speed for code-development tasks 109Higher speed for code-development tasks
110^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105 111
106If some additional workload happens to be executed in parallel, then 112If some additional workload happens to be executed in parallel, then
107BFQ executes the I/O-related components of typical code-development 113BFQ executes the I/O-related components of typical code-development
@@ -109,6 +115,7 @@ tasks (compilation, checkout, merge, ...) much more quickly than CFQ,
109NOOP or DEADLINE. 115NOOP or DEADLINE.
110 116
111High throughput 117High throughput
118^^^^^^^^^^^^^^^
112 119
113On hard disks, BFQ achieves up to 30% higher throughput than CFQ, and 120On hard disks, BFQ achieves up to 30% higher throughput than CFQ, and
114up to 150% higher throughput than DEADLINE and NOOP, with all the 121up to 150% higher throughput than DEADLINE and NOOP, with all the
@@ -117,6 +124,7 @@ and with all the workloads on flash-based devices, BFQ achieves,
117instead, about the same throughput as the other schedulers. 124instead, about the same throughput as the other schedulers.
118 125
119Strong fairness, bandwidth and delay guarantees 126Strong fairness, bandwidth and delay guarantees
127^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120 128
121BFQ distributes the device throughput, and not just the device time, 129BFQ distributes the device throughput, and not just the device time,
122among I/O-bound applications in proportion their weights, with any 130among I/O-bound applications in proportion their weights, with any
@@ -133,15 +141,15 @@ Most benefits for server systems follow from the same service
133properties as above. In particular, regardless of whether additional, 141properties as above. In particular, regardless of whether additional,
134possibly heavy workloads are being served, BFQ guarantees: 142possibly heavy workloads are being served, BFQ guarantees:
135 143
136. audio and video-streaming with zero or very low jitter and drop 144* audio and video-streaming with zero or very low jitter and drop
137 rate; 145 rate;
138 146
139. fast retrieval of WEB pages and embedded objects; 147* fast retrieval of WEB pages and embedded objects;
140 148
141. real-time recording of data in live-dumping applications (e.g., 149* real-time recording of data in live-dumping applications (e.g.,
142 packet logging); 150 packet logging);
143 151
144. responsiveness in local and remote access to a server. 152* responsiveness in local and remote access to a server.
145 153
146 154
1472. How does BFQ work? 1552. How does BFQ work?
@@ -151,7 +159,7 @@ BFQ is a proportional-share I/O scheduler, whose general structure,
151plus a lot of code, are borrowed from CFQ. 159plus a lot of code, are borrowed from CFQ.
152 160
153- Each process doing I/O on a device is associated with a weight and a 161- Each process doing I/O on a device is associated with a weight and a
154 (bfq_)queue. 162 `(bfq_)queue`.
155 163
156- BFQ grants exclusive access to the device, for a while, to one queue 164- BFQ grants exclusive access to the device, for a while, to one queue
157 (process) at a time, and implements this service model by 165 (process) at a time, and implements this service model by
@@ -539,12 +547,13 @@ As for cgroups-v1 (blkio controller), the exact set of stat files
539created, and kept up-to-date by bfq, depends on whether 547created, and kept up-to-date by bfq, depends on whether
540CONFIG_BFQ_CGROUP_DEBUG is set. If it is set, then bfq creates all 548CONFIG_BFQ_CGROUP_DEBUG is set. If it is set, then bfq creates all
541the stat files documented in 549the stat files documented in
542Documentation/cgroup-v1/blkio-controller.rst. If, instead, 550Documentation/admin-guide/cgroup-v1/blkio-controller.rst. If, instead,
543CONFIG_BFQ_CGROUP_DEBUG is not set, then bfq creates only the files 551CONFIG_BFQ_CGROUP_DEBUG is not set, then bfq creates only the files::
544blkio.bfq.io_service_bytes 552
545blkio.bfq.io_service_bytes_recursive 553 blkio.bfq.io_service_bytes
546blkio.bfq.io_serviced 554 blkio.bfq.io_service_bytes_recursive
547blkio.bfq.io_serviced_recursive 555 blkio.bfq.io_serviced
556 blkio.bfq.io_serviced_recursive
548 557
549The value of CONFIG_BFQ_CGROUP_DEBUG greatly influences the maximum 558The value of CONFIG_BFQ_CGROUP_DEBUG greatly influences the maximum
550throughput sustainable with bfq, because updating the blkio.bfq.* 559throughput sustainable with bfq, because updating the blkio.bfq.*
@@ -567,17 +576,22 @@ weight of the queues associated with interactive and soft real-time
567applications. Unset this tunable if you need/want to control weights. 576applications. Unset this tunable if you need/want to control weights.
568 577
569 578
570[1] P. Valente, A. Avanzini, "Evolution of the BFQ Storage I/O 579[1]
580 P. Valente, A. Avanzini, "Evolution of the BFQ Storage I/O
571 Scheduler", Proceedings of the First Workshop on Mobile System 581 Scheduler", Proceedings of the First Workshop on Mobile System
572 Technologies (MST-2015), May 2015. 582 Technologies (MST-2015), May 2015.
583
573 http://algogroup.unimore.it/people/paolo/disk_sched/mst-2015.pdf 584 http://algogroup.unimore.it/people/paolo/disk_sched/mst-2015.pdf
574 585
575[2] P. Valente and M. Andreolini, "Improving Application 586[2]
587 P. Valente and M. Andreolini, "Improving Application
576 Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of 588 Responsiveness with the BFQ Disk I/O Scheduler", Proceedings of
577 the 5th Annual International Systems and Storage Conference 589 the 5th Annual International Systems and Storage Conference
578 (SYSTOR '12), June 2012. 590 (SYSTOR '12), June 2012.
591
579 Slightly extended version: 592 Slightly extended version:
580 http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite-
581 results.pdf
582 593
583[3] https://github.com/Algodev-github/S 594 http://algogroup.unimore.it/people/paolo/disk_sched/bfq-v1-suite-results.pdf
595
596[3]
597 https://github.com/Algodev-github/S
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.rst
index 5a4a799fe61b..b964796ec9c7 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.rst
@@ -1,15 +1,25 @@
1 Notes on the Generic Block Layer Rewrite in Linux 2.5 1=====================================================
2 ===================================================== 2Notes on the Generic Block Layer Rewrite in Linux 2.5
3=====================================================
4
5.. note::
6
7 It seems that there are lot of outdated stuff here. This seems
8 to be written somewhat as a task list. Yet, eventually, something
9 here might still be useful.
3 10
4Notes Written on Jan 15, 2002: 11Notes Written on Jan 15, 2002:
5 Jens Axboe <jens.axboe@oracle.com> 12
6 Suparna Bhattacharya <suparna@in.ibm.com> 13 - Jens Axboe <jens.axboe@oracle.com>
14 - Suparna Bhattacharya <suparna@in.ibm.com>
7 15
8Last Updated May 2, 2002 16Last Updated May 2, 2002
17
9September 2003: Updated I/O Scheduler portions 18September 2003: Updated I/O Scheduler portions
10 Nick Piggin <npiggin@kernel.dk> 19 - Nick Piggin <npiggin@kernel.dk>
11 20
12Introduction: 21Introduction
22============
13 23
14These are some notes describing some aspects of the 2.5 block layer in the 24These are some notes describing some aspects of the 2.5 block layer in the
15context of the bio rewrite. The idea is to bring out some of the key 25context of the bio rewrite. The idea is to bring out some of the key
@@ -17,11 +27,11 @@ changes and a glimpse of the rationale behind those changes.
17 27
18Please mail corrections & suggestions to suparna@in.ibm.com. 28Please mail corrections & suggestions to suparna@in.ibm.com.
19 29
20Credits: 30Credits
21--------- 31=======
22 32
232.5 bio rewrite: 332.5 bio rewrite:
24 Jens Axboe <jens.axboe@oracle.com> 34 - Jens Axboe <jens.axboe@oracle.com>
25 35
26Many aspects of the generic block layer redesign were driven by and evolved 36Many aspects of the generic block layer redesign were driven by and evolved
27over discussions, prior patches and the collective experience of several 37over discussions, prior patches and the collective experience of several
@@ -29,62 +39,63 @@ people. See sections 8 and 9 for a list of some related references.
29 39
30The following people helped with review comments and inputs for this 40The following people helped with review comments and inputs for this
31document: 41document:
32 Christoph Hellwig <hch@infradead.org> 42
33 Arjan van de Ven <arjanv@redhat.com> 43 - Christoph Hellwig <hch@infradead.org>
34 Randy Dunlap <rdunlap@xenotime.net> 44 - Arjan van de Ven <arjanv@redhat.com>
35 Andre Hedrick <andre@linux-ide.org> 45 - Randy Dunlap <rdunlap@xenotime.net>
46 - Andre Hedrick <andre@linux-ide.org>
36 47
37The following people helped with fixes/contributions to the bio patches 48The following people helped with fixes/contributions to the bio patches
38while it was still work-in-progress: 49while it was still work-in-progress:
39 David S. Miller <davem@redhat.com>
40 50
51 - David S. Miller <davem@redhat.com>
41 52
42Description of Contents:
43------------------------
44 53
451. Scope for tuning of logic to various needs 54.. Description of Contents:
46 1.1 Tuning based on device or low level driver capabilities 55
56 1. Scope for tuning of logic to various needs
57 1.1 Tuning based on device or low level driver capabilities
47 - Per-queue parameters 58 - Per-queue parameters
48 - Highmem I/O support 59 - Highmem I/O support
49 - I/O scheduler modularization 60 - I/O scheduler modularization
50 1.2 Tuning based on high level requirements/capabilities 61 1.2 Tuning based on high level requirements/capabilities
51 1.2.1 Request Priority/Latency 62 1.2.1 Request Priority/Latency
52 1.3 Direct access/bypass to lower layers for diagnostics and special 63 1.3 Direct access/bypass to lower layers for diagnostics and special
53 device operations 64 device operations
54 1.3.1 Pre-built commands 65 1.3.1 Pre-built commands
552. New flexible and generic but minimalist i/o structure or descriptor 66 2. New flexible and generic but minimalist i/o structure or descriptor
56 (instead of using buffer heads at the i/o layer) 67 (instead of using buffer heads at the i/o layer)
57 2.1 Requirements/Goals addressed 68 2.1 Requirements/Goals addressed
58 2.2 The bio struct in detail (multi-page io unit) 69 2.2 The bio struct in detail (multi-page io unit)
59 2.3 Changes in the request structure 70 2.3 Changes in the request structure
603. Using bios 71 3. Using bios
61 3.1 Setup/teardown (allocation, splitting) 72 3.1 Setup/teardown (allocation, splitting)
62 3.2 Generic bio helper routines 73 3.2 Generic bio helper routines
63 3.2.1 Traversing segments and completion units in a request 74 3.2.1 Traversing segments and completion units in a request
64 3.2.2 Setting up DMA scatterlists 75 3.2.2 Setting up DMA scatterlists
65 3.2.3 I/O completion 76 3.2.3 I/O completion
66 3.2.4 Implications for drivers that do not interpret bios (don't handle 77 3.2.4 Implications for drivers that do not interpret bios (don't handle
67 multiple segments) 78 multiple segments)
68 3.3 I/O submission 79 3.3 I/O submission
694. The I/O scheduler 80 4. The I/O scheduler
705. Scalability related changes 81 5. Scalability related changes
71 5.1 Granular locking: Removal of io_request_lock 82 5.1 Granular locking: Removal of io_request_lock
72 5.2 Prepare for transition to 64 bit sector_t 83 5.2 Prepare for transition to 64 bit sector_t
736. Other Changes/Implications 84 6. Other Changes/Implications
74 6.1 Partition re-mapping handled by the generic block layer 85 6.1 Partition re-mapping handled by the generic block layer
757. A few tips on migration of older drivers 86 7. A few tips on migration of older drivers
768. A list of prior/related/impacted patches/ideas 87 8. A list of prior/related/impacted patches/ideas
779. Other References/Discussion Threads 88 9. Other References/Discussion Threads
78 89
79---------------------------------------------------------------------------
80 90
81Bio Notes 91Bio Notes
82-------- 92=========
83 93
84Let us discuss the changes in the context of how some overall goals for the 94Let us discuss the changes in the context of how some overall goals for the
85block layer are addressed. 95block layer are addressed.
86 96
871. Scope for tuning the generic logic to satisfy various requirements 971. Scope for tuning the generic logic to satisfy various requirements
98=====================================================================
88 99
89The block layer design supports adaptable abstractions to handle common 100The block layer design supports adaptable abstractions to handle common
90processing with the ability to tune the logic to an appropriate extent 101processing with the ability to tune the logic to an appropriate extent
@@ -97,6 +108,7 @@ and application/middleware software designed to take advantage of these
97capabilities. 108capabilities.
98 109
991.1 Tuning based on low level device / driver capabilities 1101.1 Tuning based on low level device / driver capabilities
111----------------------------------------------------------
100 112
101Sophisticated devices with large built-in caches, intelligent i/o scheduling 113Sophisticated devices with large built-in caches, intelligent i/o scheduling
102optimizations, high memory DMA support, etc may find some of the 114optimizations, high memory DMA support, etc may find some of the
@@ -133,12 +145,12 @@ Some new queue property settings:
133 Sets two variables that limit the size of the request. 145 Sets two variables that limit the size of the request.
134 146
135 - The request queue's max_sectors, which is a soft size in 147 - The request queue's max_sectors, which is a soft size in
136 units of 512 byte sectors, and could be dynamically varied 148 units of 512 byte sectors, and could be dynamically varied
137 by the core kernel. 149 by the core kernel.
138 150
139 - The request queue's max_hw_sectors, which is a hard limit 151 - The request queue's max_hw_sectors, which is a hard limit
140 and reflects the maximum size request a driver can handle 152 and reflects the maximum size request a driver can handle
141 in units of 512 byte sectors. 153 in units of 512 byte sectors.
142 154
143 The default for both max_sectors and max_hw_sectors is 155 The default for both max_sectors and max_hw_sectors is
144 255. The upper limit of max_sectors is 1024. 156 255. The upper limit of max_sectors is 1024.
@@ -161,8 +173,8 @@ Some new queue property settings:
161 173
162New queue flags: 174New queue flags:
163 175
164 QUEUE_FLAG_CLUSTER (see 3.2.2) 176 - QUEUE_FLAG_CLUSTER (see 3.2.2)
165 QUEUE_FLAG_QUEUED (see 3.2.4) 177 - QUEUE_FLAG_QUEUED (see 3.2.4)
166 178
167 179
168ii. High-mem i/o capabilities are now considered the default 180ii. High-mem i/o capabilities are now considered the default
@@ -234,6 +246,7 @@ I/O scheduler wrappers are to be used instead of accessing the queue directly.
234See section 4. The I/O scheduler for details. 246See section 4. The I/O scheduler for details.
235 247
2361.2 Tuning Based on High level code capabilities 2481.2 Tuning Based on High level code capabilities
249------------------------------------------------
237 250
238i. Application capabilities for raw i/o 251i. Application capabilities for raw i/o
239 252
@@ -258,9 +271,11 @@ would need an additional mechanism either via open flags or ioctls, or some
258other upper level mechanism to communicate such settings to block. 271other upper level mechanism to communicate such settings to block.
259 272
2601.2.1 Request Priority/Latency 2731.2.1 Request Priority/Latency
274^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
261 275
262Todo/Under discussion: 276Todo/Under discussion::
263Arjan's proposed request priority scheme allows higher levels some broad 277
278 Arjan's proposed request priority scheme allows higher levels some broad
264 control (high/med/low) over the priority of an i/o request vs other pending 279 control (high/med/low) over the priority of an i/o request vs other pending
265 requests in the queue. For example it allows reads for bringing in an 280 requests in the queue. For example it allows reads for bringing in an
266 executable page on demand to be given a higher priority over pending write 281 executable page on demand to be given a higher priority over pending write
@@ -272,7 +287,9 @@ Arjan's proposed request priority scheme allows higher levels some broad
272 287
273 288
2741.3 Direct Access to Low level Device/Driver Capabilities (Bypass mode) 2891.3 Direct Access to Low level Device/Driver Capabilities (Bypass mode)
275 (e.g Diagnostics, Systems Management) 290-----------------------------------------------------------------------
291
292(e.g Diagnostics, Systems Management)
276 293
277There are situations where high-level code needs to have direct access to 294There are situations where high-level code needs to have direct access to
278the low level device capabilities or requires the ability to issue commands 295the low level device capabilities or requires the ability to issue commands
@@ -308,28 +325,32 @@ involved. In the latter case, the driver would modify and manage the
308request->buffer, request->sector and request->nr_sectors or 325request->buffer, request->sector and request->nr_sectors or
309request->current_nr_sectors fields itself rather than using the block layer 326request->current_nr_sectors fields itself rather than using the block layer
310end_request or end_that_request_first completion interfaces. 327end_request or end_that_request_first completion interfaces.
311(See 2.3 or Documentation/block/request.txt for a brief explanation of 328(See 2.3 or Documentation/block/request.rst for a brief explanation of
312the request structure fields) 329the request structure fields)
313 330
314[TBD: end_that_request_last should be usable even in this case; 331::
315Perhaps an end_that_direct_request_first routine could be implemented to make 332
316handling direct requests easier for such drivers; Also for drivers that 333 [TBD: end_that_request_last should be usable even in this case;
317expect bios, a helper function could be provided for setting up a bio 334 Perhaps an end_that_direct_request_first routine could be implemented to make
318corresponding to a data buffer] 335 handling direct requests easier for such drivers; Also for drivers that
319 336 expect bios, a helper function could be provided for setting up a bio
320<JENS: I dont understand the above, why is end_that_request_first() not 337 corresponding to a data buffer]
321usable? Or _last for that matter. I must be missing something> 338
322<SUP: What I meant here was that if the request doesn't have a bio, then 339 <JENS: I dont understand the above, why is end_that_request_first() not
323 end_that_request_first doesn't modify nr_sectors or current_nr_sectors, 340 usable? Or _last for that matter. I must be missing something>
324 and hence can't be used for advancing request state settings on the 341
325 completion of partial transfers. The driver has to modify these fields 342 <SUP: What I meant here was that if the request doesn't have a bio, then
326 directly by hand. 343 end_that_request_first doesn't modify nr_sectors or current_nr_sectors,
327 This is because end_that_request_first only iterates over the bio list, 344 and hence can't be used for advancing request state settings on the
328 and always returns 0 if there are none associated with the request. 345 completion of partial transfers. The driver has to modify these fields
329 _last works OK in this case, and is not a problem, as I mentioned earlier 346 directly by hand.
330> 347 This is because end_that_request_first only iterates over the bio list,
348 and always returns 0 if there are none associated with the request.
349 _last works OK in this case, and is not a problem, as I mentioned earlier
350 >
331 351
3321.3.1 Pre-built Commands 3521.3.1 Pre-built Commands
353^^^^^^^^^^^^^^^^^^^^^^^^
333 354
334A request can be created with a pre-built custom command to be sent directly 355A request can be created with a pre-built custom command to be sent directly
335to the device. The cmd block in the request structure has room for filling 356to the device. The cmd block in the request structure has room for filling
@@ -360,9 +381,11 @@ Aside:
360 the pre-builder hook can be invoked there. 381 the pre-builder hook can be invoked there.
361 382
362 383
3632. Flexible and generic but minimalist i/o structure/descriptor. 3842. Flexible and generic but minimalist i/o structure/descriptor
385===============================================================
364 386
3652.1 Reason for a new structure and requirements addressed 3872.1 Reason for a new structure and requirements addressed
388---------------------------------------------------------
366 389
367Prior to 2.5, buffer heads were used as the unit of i/o at the generic block 390Prior to 2.5, buffer heads were used as the unit of i/o at the generic block
368layer, and the low level request structure was associated with a chain of 391layer, and the low level request structure was associated with a chain of
@@ -378,26 +401,26 @@ which were generated for each such chunk.
378The following were some of the goals and expectations considered in the 401The following were some of the goals and expectations considered in the
379redesign of the block i/o data structure in 2.5. 402redesign of the block i/o data structure in 2.5.
380 403
381i. Should be appropriate as a descriptor for both raw and buffered i/o - 4041. Should be appropriate as a descriptor for both raw and buffered i/o -
382 avoid cache related fields which are irrelevant in the direct/page i/o path, 405 avoid cache related fields which are irrelevant in the direct/page i/o path,
383 or filesystem block size alignment restrictions which may not be relevant 406 or filesystem block size alignment restrictions which may not be relevant
384 for raw i/o. 407 for raw i/o.
385ii. Ability to represent high-memory buffers (which do not have a virtual 4082. Ability to represent high-memory buffers (which do not have a virtual
386 address mapping in kernel address space). 409 address mapping in kernel address space).
387iii.Ability to represent large i/os w/o unnecessarily breaking them up (i.e 4103. Ability to represent large i/os w/o unnecessarily breaking them up (i.e
388 greater than PAGE_SIZE chunks in one shot) 411 greater than PAGE_SIZE chunks in one shot)
389iv. At the same time, ability to retain independent identity of i/os from 4124. At the same time, ability to retain independent identity of i/os from
390 different sources or i/o units requiring individual completion (e.g. for 413 different sources or i/o units requiring individual completion (e.g. for
391 latency reasons) 414 latency reasons)
392v. Ability to represent an i/o involving multiple physical memory segments 4155. Ability to represent an i/o involving multiple physical memory segments
393 (including non-page aligned page fragments, as specified via readv/writev) 416 (including non-page aligned page fragments, as specified via readv/writev)
394 without unnecessarily breaking it up, if the underlying device is capable of 417 without unnecessarily breaking it up, if the underlying device is capable of
395 handling it. 418 handling it.
396vi. Preferably should be based on a memory descriptor structure that can be 4196. Preferably should be based on a memory descriptor structure that can be
397 passed around different types of subsystems or layers, maybe even 420 passed around different types of subsystems or layers, maybe even
398 networking, without duplication or extra copies of data/descriptor fields 421 networking, without duplication or extra copies of data/descriptor fields
399 themselves in the process 422 themselves in the process
400vii.Ability to handle the possibility of splits/merges as the structure passes 4237. Ability to handle the possibility of splits/merges as the structure passes
401 through layered drivers (lvm, md, evms), with minimal overhead. 424 through layered drivers (lvm, md, evms), with minimal overhead.
402 425
403The solution was to define a new structure (bio) for the block layer, 426The solution was to define a new structure (bio) for the block layer,
@@ -408,6 +431,7 @@ bh structure for buffered i/o, and in the case of raw/direct i/o kiobufs are
408mapped to bio structures. 431mapped to bio structures.
409 432
4102.2 The bio struct 4332.2 The bio struct
434------------------
411 435
412The bio structure uses a vector representation pointing to an array of tuples 436The bio structure uses a vector representation pointing to an array of tuples
413of <page, offset, len> to describe the i/o buffer, and has various other 437of <page, offset, len> to describe the i/o buffer, and has various other
@@ -417,16 +441,18 @@ performing the i/o.
417Notice that this representation means that a bio has no virtual address 441Notice that this representation means that a bio has no virtual address
418mapping at all (unlike buffer heads). 442mapping at all (unlike buffer heads).
419 443
420struct bio_vec { 444::
445
446 struct bio_vec {
421 struct page *bv_page; 447 struct page *bv_page;
422 unsigned short bv_len; 448 unsigned short bv_len;
423 unsigned short bv_offset; 449 unsigned short bv_offset;
424}; 450 };
425 451
426/* 452 /*
427 * main unit of I/O for the block layer and lower layers (ie drivers) 453 * main unit of I/O for the block layer and lower layers (ie drivers)
428 */ 454 */
429struct bio { 455 struct bio {
430 struct bio *bi_next; /* request queue link */ 456 struct bio *bi_next; /* request queue link */
431 struct block_device *bi_bdev; /* target device */ 457 struct block_device *bi_bdev; /* target device */
432 unsigned long bi_flags; /* status, command, etc */ 458 unsigned long bi_flags; /* status, command, etc */
@@ -443,7 +469,7 @@ struct bio {
443 bio_end_io_t *bi_end_io; /* bi_end_io (bio) */ 469 bio_end_io_t *bi_end_io; /* bi_end_io (bio) */
444 atomic_t bi_cnt; /* pin count: free when it hits zero */ 470 atomic_t bi_cnt; /* pin count: free when it hits zero */
445 void *bi_private; 471 void *bi_private;
446}; 472 };
447 473
448With this multipage bio design: 474With this multipage bio design:
449 475
@@ -453,7 +479,7 @@ With this multipage bio design:
453- Splitting of an i/o request across multiple devices (as in the case of 479- Splitting of an i/o request across multiple devices (as in the case of
454 lvm or raid) is achieved by cloning the bio (where the clone points to 480 lvm or raid) is achieved by cloning the bio (where the clone points to
455 the same bi_io_vec array, but with the index and size accordingly modified) 481 the same bi_io_vec array, but with the index and size accordingly modified)
456- A linked list of bios is used as before for unrelated merges (*) - this 482- A linked list of bios is used as before for unrelated merges [#]_ - this
457 avoids reallocs and makes independent completions easier to handle. 483 avoids reallocs and makes independent completions easier to handle.
458- Code that traverses the req list can find all the segments of a bio 484- Code that traverses the req list can find all the segments of a bio
459 by using rq_for_each_segment. This handles the fact that a request 485 by using rq_for_each_segment. This handles the fact that a request
@@ -462,10 +488,12 @@ With this multipage bio design:
462 field to keep track of the next bio_vec entry to process. 488 field to keep track of the next bio_vec entry to process.
463 (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE) 489 (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE)
464 [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid modifying 490 [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid modifying
465 bi_offset an len fields] 491 bi_offset an len fields]
492
493.. [#]
466 494
467(*) unrelated merges -- a request ends up containing two or more bios that 495 unrelated merges -- a request ends up containing two or more bios that
468 didn't originate from the same place. 496 didn't originate from the same place.
469 497
470bi_end_io() i/o callback gets called on i/o completion of the entire bio. 498bi_end_io() i/o callback gets called on i/o completion of the entire bio.
471 499
@@ -483,10 +511,11 @@ which in turn means that only raw I/O uses it (direct i/o may not work
483right now). The intent however is to enable clustering of pages etc to 511right now). The intent however is to enable clustering of pages etc to
484become possible. The pagebuf abstraction layer from SGI also uses multi-page 512become possible. The pagebuf abstraction layer from SGI also uses multi-page
485bios, but that is currently not included in the stock development kernels. 513bios, but that is currently not included in the stock development kernels.
486The same is true of Andrew Morton's work-in-progress multipage bio writeout 514The same is true of Andrew Morton's work-in-progress multipage bio writeout
487and readahead patches. 515and readahead patches.
488 516
4892.3 Changes in the Request Structure 5172.3 Changes in the Request Structure
518------------------------------------
490 519
491The request structure is the structure that gets passed down to low level 520The request structure is the structure that gets passed down to low level
492drivers. The block layer make_request function builds up a request structure, 521drivers. The block layer make_request function builds up a request structure,
@@ -499,11 +528,11 @@ request structure.
499Only some relevant fields (mainly those which changed or may be referred 528Only some relevant fields (mainly those which changed or may be referred
500to in some of the discussion here) are listed below, not necessarily in 529to in some of the discussion here) are listed below, not necessarily in
501the order in which they occur in the structure (see include/linux/blkdev.h) 530the order in which they occur in the structure (see include/linux/blkdev.h)
502Refer to Documentation/block/request.txt for details about all the request 531Refer to Documentation/block/request.rst for details about all the request
503structure fields and a quick reference about the layers which are 532structure fields and a quick reference about the layers which are
504supposed to use or modify those fields. 533supposed to use or modify those fields::
505 534
506struct request { 535 struct request {
507 struct list_head queuelist; /* Not meant to be directly accessed by 536 struct list_head queuelist; /* Not meant to be directly accessed by
508 the driver. 537 the driver.
509 Used by q->elv_next_request_fn 538 Used by q->elv_next_request_fn
@@ -548,11 +577,11 @@ struct request {
548 . 577 .
549 struct bio *bio, *biotail; /* bio list instead of bh */ 578 struct bio *bio, *biotail; /* bio list instead of bh */
550 struct request_list *rl; 579 struct request_list *rl;
551} 580 }
552 581
553See the req_ops and req_flag_bits definitions for an explanation of the various 582See the req_ops and req_flag_bits definitions for an explanation of the various
554flags available. Some bits are used by the block layer or i/o scheduler. 583flags available. Some bits are used by the block layer or i/o scheduler.
555 584
556The behaviour of the various sector counts are almost the same as before, 585The behaviour of the various sector counts are almost the same as before,
557except that since we have multi-segment bios, current_nr_sectors refers 586except that since we have multi-segment bios, current_nr_sectors refers
558to the numbers of sectors in the current segment being processed which could 587to the numbers of sectors in the current segment being processed which could
@@ -578,8 +607,10 @@ a driver needs to be careful about interoperation with the block layer helper
578functions which the driver uses. (Section 1.3) 607functions which the driver uses. (Section 1.3)
579 608
5803. Using bios 6093. Using bios
610=============
581 611
5823.1 Setup/Teardown 6123.1 Setup/Teardown
613------------------
583 614
584There are routines for managing the allocation, and reference counting, and 615There are routines for managing the allocation, and reference counting, and
585freeing of bios (bio_alloc, bio_get, bio_put). 616freeing of bios (bio_alloc, bio_get, bio_put).
@@ -606,10 +637,13 @@ case of bio, these routines make use of the standard slab allocator.
606The caller of bio_alloc is expected to taken certain steps to avoid 637The caller of bio_alloc is expected to taken certain steps to avoid
607deadlocks, e.g. avoid trying to allocate more memory from the pool while 638deadlocks, e.g. avoid trying to allocate more memory from the pool while
608already holding memory obtained from the pool. 639already holding memory obtained from the pool.
609[TBD: This is a potential issue, though a rare possibility 640
610 in the bounce bio allocation that happens in the current code, since 641::
611 it ends up allocating a second bio from the same pool while 642
612 holding the original bio ] 643 [TBD: This is a potential issue, though a rare possibility
644 in the bounce bio allocation that happens in the current code, since
645 it ends up allocating a second bio from the same pool while
646 holding the original bio ]
613 647
614Memory allocated from the pool should be released back within a limited 648Memory allocated from the pool should be released back within a limited
615amount of time (in the case of bio, that would be after the i/o is completed). 649amount of time (in the case of bio, that would be after the i/o is completed).
@@ -635,14 +669,18 @@ same bio_vec_list). This would typically be used for splitting i/o requests
635in lvm or md. 669in lvm or md.
636 670
6373.2 Generic bio helper Routines 6713.2 Generic bio helper Routines
672-------------------------------
638 673
6393.2.1 Traversing segments and completion units in a request 6743.2.1 Traversing segments and completion units in a request
675^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
640 676
641The macro rq_for_each_segment() should be used for traversing the bios 677The macro rq_for_each_segment() should be used for traversing the bios
642in the request list (drivers should avoid directly trying to do it 678in the request list (drivers should avoid directly trying to do it
643themselves). Using these helpers should also make it easier to cope 679themselves). Using these helpers should also make it easier to cope
644with block changes in the future. 680with block changes in the future.
645 681
682::
683
646 struct req_iterator iter; 684 struct req_iterator iter;
647 rq_for_each_segment(bio_vec, rq, iter) 685 rq_for_each_segment(bio_vec, rq, iter)
648 /* bio_vec is now current segment */ 686 /* bio_vec is now current segment */
@@ -653,6 +691,7 @@ which don't make a distinction between segments and completion units would
653need to be reorganized to support multi-segment bios. 691need to be reorganized to support multi-segment bios.
654 692
6553.2.2 Setting up DMA scatterlists 6933.2.2 Setting up DMA scatterlists
694^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
656 695
657The blk_rq_map_sg() helper routine would be used for setting up scatter 696The blk_rq_map_sg() helper routine would be used for setting up scatter
658gather lists from a request, so a driver need not do it on its own. 697gather lists from a request, so a driver need not do it on its own.
@@ -683,6 +722,7 @@ of physical data segments in a request (i.e. the largest sized scatter list
683a driver could handle) 722a driver could handle)
684 723
6853.2.3 I/O completion 7243.2.3 I/O completion
725^^^^^^^^^^^^^^^^^^^^
686 726
687The existing generic block layer helper routines end_request, 727The existing generic block layer helper routines end_request,
688end_that_request_first and end_that_request_last can be used for i/o 728end_that_request_first and end_that_request_last can be used for i/o
@@ -691,8 +731,10 @@ request can be kicked of) as before. With the introduction of multi-page
691bio support, end_that_request_first requires an additional argument indicating 731bio support, end_that_request_first requires an additional argument indicating
692the number of sectors completed. 732the number of sectors completed.
693 733
6943.2.4 Implications for drivers that do not interpret bios (don't handle 7343.2.4 Implications for drivers that do not interpret bios
695 multiple segments) 735^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
736
737(don't handle multiple segments)
696 738
697Drivers that do not interpret bios e.g those which do not handle multiple 739Drivers that do not interpret bios e.g those which do not handle multiple
698segments and do not support i/o into high memory addresses (require bounce 740segments and do not support i/o into high memory addresses (require bounce
@@ -707,15 +749,18 @@ be used if only if the request has come down from block/bio path, not for
707direct access requests which only specify rq->buffer without a valid rq->bio) 749direct access requests which only specify rq->buffer without a valid rq->bio)
708 750
7093.3 I/O Submission 7513.3 I/O Submission
752------------------
710 753
711The routine submit_bio() is used to submit a single io. Higher level i/o 754The routine submit_bio() is used to submit a single io. Higher level i/o
712routines make use of this: 755routines make use of this:
713 756
714(a) Buffered i/o: 757(a) Buffered i/o:
758
715The routine submit_bh() invokes submit_bio() on a bio corresponding to the 759The routine submit_bh() invokes submit_bio() on a bio corresponding to the
716bh, allocating the bio if required. ll_rw_block() uses submit_bh() as before. 760bh, allocating the bio if required. ll_rw_block() uses submit_bh() as before.
717 761
718(b) Kiobuf i/o (for raw/direct i/o): 762(b) Kiobuf i/o (for raw/direct i/o):
763
719The ll_rw_kio() routine breaks up the kiobuf into page sized chunks and 764The ll_rw_kio() routine breaks up the kiobuf into page sized chunks and
720maps the array to one or more multi-page bios, issuing submit_bio() to 765maps the array to one or more multi-page bios, issuing submit_bio() to
721perform the i/o on each of these. 766perform the i/o on each of these.
@@ -738,6 +783,7 @@ Todo/Observation:
738 783
739 784
740(c) Page i/o: 785(c) Page i/o:
786
741Todo/Under discussion: 787Todo/Under discussion:
742 788
743 Andrew Morton's multi-page bio patches attempt to issue multi-page 789 Andrew Morton's multi-page bio patches attempt to issue multi-page
@@ -753,6 +799,7 @@ Todo/Under discussion:
753 abstraction, but intended to be as lightweight as possible). 799 abstraction, but intended to be as lightweight as possible).
754 800
755(d) Direct access i/o: 801(d) Direct access i/o:
802
756Direct access requests that do not contain bios would be submitted differently 803Direct access requests that do not contain bios would be submitted differently
757as discussed earlier in section 1.3. 804as discussed earlier in section 1.3.
758 805
@@ -780,11 +827,13 @@ Aside:
780 827
781 828
7824. The I/O scheduler 8294. The I/O scheduler
830====================
831
783I/O scheduler, a.k.a. elevator, is implemented in two layers. Generic dispatch 832I/O scheduler, a.k.a. elevator, is implemented in two layers. Generic dispatch
784queue and specific I/O schedulers. Unless stated otherwise, elevator is used 833queue and specific I/O schedulers. Unless stated otherwise, elevator is used
785to refer to both parts and I/O scheduler to specific I/O schedulers. 834to refer to both parts and I/O scheduler to specific I/O schedulers.
786 835
787Block layer implements generic dispatch queue in block/*.c. 836Block layer implements generic dispatch queue in `block/*.c`.
788The generic dispatch queue is responsible for requeueing, handling non-fs 837The generic dispatch queue is responsible for requeueing, handling non-fs
789requests and all other subtleties. 838requests and all other subtleties.
790 839
@@ -802,8 +851,11 @@ doesn't implement a function, the switch does nothing or some minimal house
802keeping work. 851keeping work.
803 852
8044.1. I/O scheduler API 8534.1. I/O scheduler API
854----------------------
805 855
806The functions an elevator may implement are: (* are mandatory) 856The functions an elevator may implement are: (* are mandatory)
857
858=============================== ================================================
807elevator_merge_fn called to query requests for merge with a bio 859elevator_merge_fn called to query requests for merge with a bio
808 860
809elevator_merge_req_fn called when two requests get merged. the one 861elevator_merge_req_fn called when two requests get merged. the one
@@ -857,8 +909,11 @@ elevator_deactivate_req_fn Called when device driver decides to delay
857elevator_init_fn* 909elevator_init_fn*
858elevator_exit_fn Allocate and free any elevator specific storage 910elevator_exit_fn Allocate and free any elevator specific storage
859 for a queue. 911 for a queue.
912=============================== ================================================
860 913
8614.2 Request flows seen by I/O schedulers 9144.2 Request flows seen by I/O schedulers
915----------------------------------------
916
862All requests seen by I/O schedulers strictly follow one of the following three 917All requests seen by I/O schedulers strictly follow one of the following three
863flows. 918flows.
864 919
@@ -872,9 +927,12 @@ flows.
872 -> put_req_fn 927 -> put_req_fn
873 928
8744.3 I/O scheduler implementation 9294.3 I/O scheduler implementation
930--------------------------------
931
875The generic i/o scheduler algorithm attempts to sort/merge/batch requests for 932The generic i/o scheduler algorithm attempts to sort/merge/batch requests for
876optimal disk scan and request servicing performance (based on generic 933optimal disk scan and request servicing performance (based on generic
877principles and device capabilities), optimized for: 934principles and device capabilities), optimized for:
935
878i. improved throughput 936i. improved throughput
879ii. improved latency 937ii. improved latency
880iii. better utilization of h/w & CPU time 938iii. better utilization of h/w & CPU time
@@ -928,15 +986,19 @@ Aside:
928 a big request from the broken up pieces coming by. 986 a big request from the broken up pieces coming by.
929 987
9304.4 I/O contexts 9884.4 I/O contexts
989----------------
990
931I/O contexts provide a dynamically allocated per process data area. They may 991I/O contexts provide a dynamically allocated per process data area. They may
932be used in I/O schedulers, and in the block layer (could be used for IO statis, 992be used in I/O schedulers, and in the block layer (could be used for IO statis,
933priorities for example). See *io_context in block/ll_rw_blk.c, and as-iosched.c 993priorities for example). See `*io_context` in block/ll_rw_blk.c, and as-iosched.c
934for an example of usage in an i/o scheduler. 994for an example of usage in an i/o scheduler.
935 995
936 996
9375. Scalability related changes 9975. Scalability related changes
998==============================
938 999
9395.1 Granular Locking: io_request_lock replaced by a per-queue lock 10005.1 Granular Locking: io_request_lock replaced by a per-queue lock
1001------------------------------------------------------------------
940 1002
941The global io_request_lock has been removed as of 2.5, to avoid 1003The global io_request_lock has been removed as of 2.5, to avoid
942the scalability bottleneck it was causing, and has been replaced by more 1004the scalability bottleneck it was causing, and has been replaced by more
@@ -951,20 +1013,23 @@ request_fn execution which it means that lots of older drivers
951should still be SMP safe. Drivers are free to drop the queue 1013should still be SMP safe. Drivers are free to drop the queue
952lock themselves, if required. Drivers that explicitly used the 1014lock themselves, if required. Drivers that explicitly used the
953io_request_lock for serialization need to be modified accordingly. 1015io_request_lock for serialization need to be modified accordingly.
954Usually it's as easy as adding a global lock: 1016Usually it's as easy as adding a global lock::
955 1017
956 static DEFINE_SPINLOCK(my_driver_lock); 1018 static DEFINE_SPINLOCK(my_driver_lock);
957 1019
958and passing the address to that lock to blk_init_queue(). 1020and passing the address to that lock to blk_init_queue().
959 1021
9605.2 64 bit sector numbers (sector_t prepares for 64 bit support) 10225.2 64 bit sector numbers (sector_t prepares for 64 bit support)
1023----------------------------------------------------------------
961 1024
962The sector number used in the bio structure has been changed to sector_t, 1025The sector number used in the bio structure has been changed to sector_t,
963which could be defined as 64 bit in preparation for 64 bit sector support. 1026which could be defined as 64 bit in preparation for 64 bit sector support.
964 1027
9656. Other Changes/Implications 10286. Other Changes/Implications
1029=============================
966 1030
9676.1 Partition re-mapping handled by the generic block layer 10316.1 Partition re-mapping handled by the generic block layer
1032-----------------------------------------------------------
968 1033
969In 2.5 some of the gendisk/partition related code has been reorganized. 1034In 2.5 some of the gendisk/partition related code has been reorganized.
970Now the generic block layer performs partition-remapping early and thus 1035Now the generic block layer performs partition-remapping early and thus
@@ -979,6 +1044,7 @@ sent are offset from the beginning of the device.
979 1044
980 1045
9817. A Few Tips on Migration of older drivers 10467. A Few Tips on Migration of older drivers
1047===========================================
982 1048
983Old-style drivers that just use CURRENT and ignores clustered requests, 1049Old-style drivers that just use CURRENT and ignores clustered requests,
984may not need much change. The generic layer will automatically handle 1050may not need much change. The generic layer will automatically handle
@@ -1012,12 +1078,12 @@ blk_init_queue time.
1012 1078
1013Drivers no longer have to map a {partition, sector offset} into the 1079Drivers no longer have to map a {partition, sector offset} into the
1014correct absolute location anymore, this is done by the block layer, so 1080correct absolute location anymore, this is done by the block layer, so
1015where a driver received a request ala this before: 1081where a driver received a request ala this before::
1016 1082
1017 rq->rq_dev = mk_kdev(3, 5); /* /dev/hda5 */ 1083 rq->rq_dev = mk_kdev(3, 5); /* /dev/hda5 */
1018 rq->sector = 0; /* first sector on hda5 */ 1084 rq->sector = 0; /* first sector on hda5 */
1019 1085
1020 it will now see 1086it will now see::
1021 1087
1022 rq->rq_dev = mk_kdev(3, 0); /* /dev/hda */ 1088 rq->rq_dev = mk_kdev(3, 0); /* /dev/hda */
1023 rq->sector = 123128; /* offset from start of disk */ 1089 rq->sector = 123128; /* offset from start of disk */
@@ -1034,38 +1100,65 @@ a bio into the virtual address space.
1034 1100
1035 1101
10368. Prior/Related/Impacted patches 11028. Prior/Related/Impacted patches
1103=================================
1037 1104
10388.1. Earlier kiobuf patches (sct/axboe/chait/hch/mkp) 11058.1. Earlier kiobuf patches (sct/axboe/chait/hch/mkp)
1106-----------------------------------------------------
1107
1039- orig kiobuf & raw i/o patches (now in 2.4 tree) 1108- orig kiobuf & raw i/o patches (now in 2.4 tree)
1040- direct kiobuf based i/o to devices (no intermediate bh's) 1109- direct kiobuf based i/o to devices (no intermediate bh's)
1041- page i/o using kiobuf 1110- page i/o using kiobuf
1042- kiobuf splitting for lvm (mkp) 1111- kiobuf splitting for lvm (mkp)
1043- elevator support for kiobuf request merging (axboe) 1112- elevator support for kiobuf request merging (axboe)
1113
10448.2. Zero-copy networking (Dave Miller) 11148.2. Zero-copy networking (Dave Miller)
1115---------------------------------------
1116
10458.3. SGI XFS - pagebuf patches - use of kiobufs 11178.3. SGI XFS - pagebuf patches - use of kiobufs
1118-----------------------------------------------
10468.4. Multi-page pioent patch for bio (Christoph Hellwig) 11198.4. Multi-page pioent patch for bio (Christoph Hellwig)
1120--------------------------------------------------------
10478.5. Direct i/o implementation (Andrea Arcangeli) since 2.4.10-pre11 11218.5. Direct i/o implementation (Andrea Arcangeli) since 2.4.10-pre11
1122--------------------------------------------------------------------
10488.6. Async i/o implementation patch (Ben LaHaise) 11238.6. Async i/o implementation patch (Ben LaHaise)
1124-------------------------------------------------
10498.7. EVMS layering design (IBM EVMS team) 11258.7. EVMS layering design (IBM EVMS team)
10508.8. Larger page cache size patch (Ben LaHaise) and 1126-----------------------------------------
1051 Large page size (Daniel Phillips) 11278.8. Larger page cache size patch (Ben LaHaise) and Large page size (Daniel Phillips)
1128-------------------------------------------------------------------------------------
1129
1052 => larger contiguous physical memory buffers 1130 => larger contiguous physical memory buffers
1131
10538.9. VM reservations patch (Ben LaHaise) 11328.9. VM reservations patch (Ben LaHaise)
1133----------------------------------------
10548.10. Write clustering patches ? (Marcelo/Quintela/Riel ?) 11348.10. Write clustering patches ? (Marcelo/Quintela/Riel ?)
1135----------------------------------------------------------
10558.11. Block device in page cache patch (Andrea Archangeli) - now in 2.4.10+ 11368.11. Block device in page cache patch (Andrea Archangeli) - now in 2.4.10+
10568.12. Multiple block-size transfers for faster raw i/o (Shailabh Nagar, 1137---------------------------------------------------------------------------
1057 Badari) 11388.12. Multiple block-size transfers for faster raw i/o (Shailabh Nagar, Badari)
1139-------------------------------------------------------------------------------
10588.13 Priority based i/o scheduler - prepatches (Arjan van de Ven) 11408.13 Priority based i/o scheduler - prepatches (Arjan van de Ven)
1141------------------------------------------------------------------
10598.14 IDE Taskfile i/o patch (Andre Hedrick) 11428.14 IDE Taskfile i/o patch (Andre Hedrick)
1143--------------------------------------------
10608.15 Multi-page writeout and readahead patches (Andrew Morton) 11448.15 Multi-page writeout and readahead patches (Andrew Morton)
1145---------------------------------------------------------------
10618.16 Direct i/o patches for 2.5 using kvec and bio (Badari Pulavarthy) 11468.16 Direct i/o patches for 2.5 using kvec and bio (Badari Pulavarthy)
1147-----------------------------------------------------------------------
1062 1148
10639. Other References: 11499. Other References
1150===================
1064 1151
10659.1 The Splice I/O Model - Larry McVoy (and subsequent discussions on lkml, 11529.1 The Splice I/O Model
1066and Linus' comments - Jan 2001) 1153------------------------
10679.2 Discussions about kiobuf and bh design on lkml between sct, linus, alan 1154
1068et al - Feb-March 2001 (many of the initial thoughts that led to bio were 1155Larry McVoy (and subsequent discussions on lkml, and Linus' comments - Jan 2001
1069brought up in this discussion thread)
10709.3 Discussions on mempool on lkml - Dec 2001.
1071 1156
11579.2 Discussions about kiobuf and bh design
1158------------------------------------------
1159
1160On lkml between sct, linus, alan et al - Feb-March 2001 (many of the
1161initial thoughts that led to bio were brought up in this discussion thread)
1162
11639.3 Discussions on mempool on lkml - Dec 2001.
1164----------------------------------------------
diff --git a/Documentation/block/biovecs.txt b/Documentation/block/biovecs.rst
index ce6eccaf5df7..86fa66c87172 100644
--- a/Documentation/block/biovecs.txt
+++ b/Documentation/block/biovecs.rst
@@ -1,6 +1,6 @@
1 1======================================
2Immutable biovecs and biovec iterators: 2Immutable biovecs and biovec iterators
3======================================= 3======================================
4 4
5Kent Overstreet <kmo@daterainc.com> 5Kent Overstreet <kmo@daterainc.com>
6 6
@@ -121,10 +121,12 @@ Other implications:
121Usage of helpers: 121Usage of helpers:
122================= 122=================
123 123
124* The following helpers whose names have the suffix of "_all" can only be used 124* The following helpers whose names have the suffix of `_all` can only be used
125on non-BIO_CLONED bio. They are usually used by filesystem code. Drivers 125 on non-BIO_CLONED bio. They are usually used by filesystem code. Drivers
126shouldn't use them because the bio may have been split before it reached the 126 shouldn't use them because the bio may have been split before it reached the
127driver. 127 driver.
128
129::
128 130
129 bio_for_each_segment_all() 131 bio_for_each_segment_all()
130 bio_first_bvec_all() 132 bio_first_bvec_all()
@@ -132,13 +134,13 @@ driver.
132 bio_last_bvec_all() 134 bio_last_bvec_all()
133 135
134* The following helpers iterate over single-page segment. The passed 'struct 136* The following helpers iterate over single-page segment. The passed 'struct
135bio_vec' will contain a single-page IO vector during the iteration 137 bio_vec' will contain a single-page IO vector during the iteration::
136 138
137 bio_for_each_segment() 139 bio_for_each_segment()
138 bio_for_each_segment_all() 140 bio_for_each_segment_all()
139 141
140* The following helpers iterate over multi-page bvec. The passed 'struct 142* The following helpers iterate over multi-page bvec. The passed 'struct
141bio_vec' will contain a multi-page IO vector during the iteration 143 bio_vec' will contain a multi-page IO vector during the iteration::
142 144
143 bio_for_each_bvec() 145 bio_for_each_bvec()
144 rq_for_each_bvec() 146 rq_for_each_bvec()
diff --git a/Documentation/block/capability.rst b/Documentation/block/capability.rst
new file mode 100644
index 000000000000..2cf258d64bbe
--- /dev/null
+++ b/Documentation/block/capability.rst
@@ -0,0 +1,18 @@
1===============================
2Generic Block Device Capability
3===============================
4
5This file documents the sysfs file block/<disk>/capability
6
7capability is a hex word indicating which capabilities a specific disk
8supports. For more information on bits not listed here, see
9include/linux/genhd.h
10
11GENHD_FL_MEDIA_CHANGE_NOTIFY
12----------------------------
13
14Value: 4
15
16When this bit is set, the disk supports Asynchronous Notification
17of media change events. These events will be broadcast to user
18space via kernel uevent.
diff --git a/Documentation/block/capability.txt b/Documentation/block/capability.txt
deleted file mode 100644
index 2f1729424ef4..000000000000
--- a/Documentation/block/capability.txt
+++ /dev/null
@@ -1,15 +0,0 @@
1Generic Block Device Capability
2===============================================================================
3This file documents the sysfs file block/<disk>/capability
4
5capability is a hex word indicating which capabilities a specific disk
6supports. For more information on bits not listed here, see
7include/linux/genhd.h
8
9Capability Value
10-------------------------------------------------------------------------------
11GENHD_FL_MEDIA_CHANGE_NOTIFY 4
12 When this bit is set, the disk supports Asynchronous Notification
13 of media change events. These events will be broadcast to user
14 space via kernel uevent.
15
diff --git a/Documentation/block/cmdline-partition.txt b/Documentation/block/cmdline-partition.rst
index 760a3f7c3ed4..530bedff548a 100644
--- a/Documentation/block/cmdline-partition.txt
+++ b/Documentation/block/cmdline-partition.rst
@@ -1,5 +1,6 @@
1==============================================
1Embedded device command line partition parsing 2Embedded device command line partition parsing
2===================================================================== 3==============================================
3 4
4The "blkdevparts" command line option adds support for reading the 5The "blkdevparts" command line option adds support for reading the
5block device partition table from the kernel command line. 6block device partition table from the kernel command line.
@@ -22,12 +23,15 @@ blkdevparts=<blkdev-def>[;<blkdev-def>]
22<size> 23<size>
23 partition size, in bytes, such as: 512, 1m, 1G. 24 partition size, in bytes, such as: 512, 1m, 1G.
24 size may contain an optional suffix of (upper or lower case): 25 size may contain an optional suffix of (upper or lower case):
26
25 K, M, G, T, P, E. 27 K, M, G, T, P, E.
28
26 "-" is used to denote all remaining space. 29 "-" is used to denote all remaining space.
27 30
28<offset> 31<offset>
29 partition start address, in bytes. 32 partition start address, in bytes.
30 offset may contain an optional suffix of (upper or lower case): 33 offset may contain an optional suffix of (upper or lower case):
34
31 K, M, G, T, P, E. 35 K, M, G, T, P, E.
32 36
33(part-name) 37(part-name)
@@ -36,11 +40,14 @@ blkdevparts=<blkdev-def>[;<blkdev-def>]
36 User space application can access partition by partition name. 40 User space application can access partition by partition name.
37 41
38Example: 42Example:
43
39 eMMC disk names are "mmcblk0" and "mmcblk0boot0". 44 eMMC disk names are "mmcblk0" and "mmcblk0boot0".
40 45
41 bootargs: 46 bootargs::
47
42 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(kernel)' 48 'blkdevparts=mmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(kernel)'
43 49
44 dmesg: 50 dmesg::
51
45 mmcblk0: p1(data0) p2(data1) p3() 52 mmcblk0: p1(data0) p2(data1) p3()
46 mmcblk0boot0: p1(boot) p2(kernel) 53 mmcblk0boot0: p1(boot) p2(kernel)
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.rst
index 934c44ea0c57..4f2452a95c43 100644
--- a/Documentation/block/data-integrity.txt
+++ b/Documentation/block/data-integrity.rst
@@ -1,5 +1,9 @@
1---------------------------------------------------------------------- 1==============
21. INTRODUCTION 2Data Integrity
3==============
4
51. Introduction
6===============
3 7
4Modern filesystems feature checksumming of data and metadata to 8Modern filesystems feature checksumming of data and metadata to
5protect against data corruption. However, the detection of the 9protect against data corruption. However, the detection of the
@@ -28,8 +32,8 @@ integrity of the I/O and reject it if corruption is detected. This
28allows not only corruption prevention but also isolation of the point 32allows not only corruption prevention but also isolation of the point
29of failure. 33of failure.
30 34
31---------------------------------------------------------------------- 352. The Data Integrity Extensions
322. THE DATA INTEGRITY EXTENSIONS 36================================
33 37
34As written, the protocol extensions only protect the path between 38As written, the protocol extensions only protect the path between
35controller and storage device. However, many controllers actually 39controller and storage device. However, many controllers actually
@@ -75,8 +79,8 @@ Extensions. As these extensions are outside the scope of the protocol
75bodies (T10, T13), Oracle and its partners are trying to standardize 79bodies (T10, T13), Oracle and its partners are trying to standardize
76them within the Storage Networking Industry Association. 80them within the Storage Networking Industry Association.
77 81
78---------------------------------------------------------------------- 823. Kernel Changes
793. KERNEL CHANGES 83=================
80 84
81The data integrity framework in Linux enables protection information 85The data integrity framework in Linux enables protection information
82to be pinned to I/Os and sent to/received from controllers that 86to be pinned to I/Os and sent to/received from controllers that
@@ -123,10 +127,11 @@ access to manipulate the tags from user space. A passthrough
123interface for this is being worked on. 127interface for this is being worked on.
124 128
125 129
126---------------------------------------------------------------------- 1304. Block Layer Implementation Details
1274. BLOCK LAYER IMPLEMENTATION DETAILS 131=====================================
128 132
1294.1 BIO 1334.1 Bio
134-------
130 135
131The data integrity patches add a new field to struct bio when 136The data integrity patches add a new field to struct bio when
132CONFIG_BLK_DEV_INTEGRITY is enabled. bio_integrity(bio) returns a 137CONFIG_BLK_DEV_INTEGRITY is enabled. bio_integrity(bio) returns a
@@ -145,7 +150,8 @@ attached using bio_integrity_add_page().
145bio_free() will automatically free the bip. 150bio_free() will automatically free the bip.
146 151
147 152
1484.2 BLOCK DEVICE 1534.2 Block Device
154----------------
149 155
150Because the format of the protection data is tied to the physical 156Because the format of the protection data is tied to the physical
151disk, each block device has been extended with a block integrity 157disk, each block device has been extended with a block integrity
@@ -163,10 +169,11 @@ and MD linear, RAID0 and RAID1 are currently supported. RAID4/5/6
163will require extra work due to the application tag. 169will require extra work due to the application tag.
164 170
165 171
166---------------------------------------------------------------------- 1725.0 Block Layer Integrity API
1675.0 BLOCK LAYER INTEGRITY API 173=============================
168 174
1695.1 NORMAL FILESYSTEM 1755.1 Normal Filesystem
176---------------------
170 177
171 The normal filesystem is unaware that the underlying block device 178 The normal filesystem is unaware that the underlying block device
172 is capable of sending/receiving integrity metadata. The IMD will 179 is capable of sending/receiving integrity metadata. The IMD will
@@ -174,25 +181,26 @@ will require extra work due to the application tag.
174 in case of a WRITE. A READ request will cause the I/O integrity 181 in case of a WRITE. A READ request will cause the I/O integrity
175 to be verified upon completion. 182 to be verified upon completion.
176 183
177 IMD generation and verification can be toggled using the 184 IMD generation and verification can be toggled using the::
178 185
179 /sys/block/<bdev>/integrity/write_generate 186 /sys/block/<bdev>/integrity/write_generate
180 187
181 and 188 and::
182 189
183 /sys/block/<bdev>/integrity/read_verify 190 /sys/block/<bdev>/integrity/read_verify
184 191
185 flags. 192 flags.
186 193
187 194
1885.2 INTEGRITY-AWARE FILESYSTEM 1955.2 Integrity-Aware Filesystem
196------------------------------
189 197
190 A filesystem that is integrity-aware can prepare I/Os with IMD 198 A filesystem that is integrity-aware can prepare I/Os with IMD
191 attached. It can also use the application tag space if this is 199 attached. It can also use the application tag space if this is
192 supported by the block device. 200 supported by the block device.
193 201
194 202
195 bool bio_integrity_prep(bio); 203 `bool bio_integrity_prep(bio);`
196 204
197 To generate IMD for WRITE and to set up buffers for READ, the 205 To generate IMD for WRITE and to set up buffers for READ, the
198 filesystem must call bio_integrity_prep(bio). 206 filesystem must call bio_integrity_prep(bio).
@@ -204,14 +212,15 @@ will require extra work due to the application tag.
204 Complete bio with error if prepare failed for some reson. 212 Complete bio with error if prepare failed for some reson.
205 213
206 214
2075.3 PASSING EXISTING INTEGRITY METADATA 2155.3 Passing Existing Integrity Metadata
216---------------------------------------
208 217
209 Filesystems that either generate their own integrity metadata or 218 Filesystems that either generate their own integrity metadata or
210 are capable of transferring IMD from user space can use the 219 are capable of transferring IMD from user space can use the
211 following calls: 220 following calls:
212 221
213 222
214 struct bip * bio_integrity_alloc(bio, gfp_mask, nr_pages); 223 `struct bip * bio_integrity_alloc(bio, gfp_mask, nr_pages);`
215 224
216 Allocates the bio integrity payload and hangs it off of the bio. 225 Allocates the bio integrity payload and hangs it off of the bio.
217 nr_pages indicate how many pages of protection data need to be 226 nr_pages indicate how many pages of protection data need to be
@@ -220,7 +229,7 @@ will require extra work due to the application tag.
220 The integrity payload will be freed at bio_free() time. 229 The integrity payload will be freed at bio_free() time.
221 230
222 231
223 int bio_integrity_add_page(bio, page, len, offset); 232 `int bio_integrity_add_page(bio, page, len, offset);`
224 233
225 Attaches a page containing integrity metadata to an existing 234 Attaches a page containing integrity metadata to an existing
226 bio. The bio must have an existing bip, 235 bio. The bio must have an existing bip,
@@ -241,21 +250,21 @@ will require extra work due to the application tag.
241 integrity upon completion. 250 integrity upon completion.
242 251
243 252
2445.4 REGISTERING A BLOCK DEVICE AS CAPABLE OF EXCHANGING INTEGRITY 2535.4 Registering A Block Device As Capable Of Exchanging Integrity Metadata
245 METADATA 254--------------------------------------------------------------------------
246 255
247 To enable integrity exchange on a block device the gendisk must be 256 To enable integrity exchange on a block device the gendisk must be
248 registered as capable: 257 registered as capable:
249 258
250 int blk_integrity_register(gendisk, blk_integrity); 259 `int blk_integrity_register(gendisk, blk_integrity);`
251 260
252 The blk_integrity struct is a template and should contain the 261 The blk_integrity struct is a template and should contain the
253 following: 262 following::
254 263
255 static struct blk_integrity my_profile = { 264 static struct blk_integrity my_profile = {
256 .name = "STANDARDSBODY-TYPE-VARIANT-CSUM", 265 .name = "STANDARDSBODY-TYPE-VARIANT-CSUM",
257 .generate_fn = my_generate_fn, 266 .generate_fn = my_generate_fn,
258 .verify_fn = my_verify_fn, 267 .verify_fn = my_verify_fn,
259 .tuple_size = sizeof(struct my_tuple_size), 268 .tuple_size = sizeof(struct my_tuple_size),
260 .tag_size = <tag bytes per hw sector>, 269 .tag_size = <tag bytes per hw sector>,
261 }; 270 };
@@ -278,4 +287,5 @@ will require extra work due to the application tag.
278 0 depending on the value of the Control Mode Page ATO bit. 287 0 depending on the value of the Control Mode Page ATO bit.
279 288
280---------------------------------------------------------------------- 289----------------------------------------------------------------------
290
2812007-12-24 Martin K. Petersen <martin.petersen@oracle.com> 2912007-12-24 Martin K. Petersen <martin.petersen@oracle.com>
diff --git a/Documentation/block/deadline-iosched.txt b/Documentation/block/deadline-iosched.rst
index 2d82c80322cb..9f5c5a4c370e 100644
--- a/Documentation/block/deadline-iosched.txt
+++ b/Documentation/block/deadline-iosched.rst
@@ -1,3 +1,4 @@
1==============================
1Deadline IO scheduler tunables 2Deadline IO scheduler tunables
2============================== 3==============================
3 4
@@ -7,15 +8,13 @@ of interest to power users.
7 8
8Selecting IO schedulers 9Selecting IO schedulers
9----------------------- 10-----------------------
10Refer to Documentation/block/switching-sched.txt for information on 11Refer to Documentation/block/switching-sched.rst for information on
11selecting an io scheduler on a per-device basis. 12selecting an io scheduler on a per-device basis.
12 13
13 14------------------------------------------------------------------------------
14********************************************************************************
15
16 15
17read_expire (in ms) 16read_expire (in ms)
18----------- 17-----------------------
19 18
20The goal of the deadline io scheduler is to attempt to guarantee a start 19The goal of the deadline io scheduler is to attempt to guarantee a start
21service time for a request. As we focus mainly on read latencies, this is 20service time for a request. As we focus mainly on read latencies, this is
@@ -25,15 +24,15 @@ milliseconds.
25 24
26 25
27write_expire (in ms) 26write_expire (in ms)
28----------- 27-----------------------
29 28
30Similar to read_expire mentioned above, but for writes. 29Similar to read_expire mentioned above, but for writes.
31 30
32 31
33fifo_batch (number of requests) 32fifo_batch (number of requests)
34---------- 33------------------------------------
35 34
36Requests are grouped into ``batches'' of a particular data direction (read or 35Requests are grouped into ``batches`` of a particular data direction (read or
37write) which are serviced in increasing sector order. To limit extra seeking, 36write) which are serviced in increasing sector order. To limit extra seeking,
38deadline expiries are only checked between batches. fifo_batch controls the 37deadline expiries are only checked between batches. fifo_batch controls the
39maximum number of requests per batch. 38maximum number of requests per batch.
@@ -45,7 +44,7 @@ generally improves throughput, at the cost of latency variation.
45 44
46 45
47writes_starved (number of dispatches) 46writes_starved (number of dispatches)
48-------------- 47--------------------------------------
49 48
50When we have to move requests from the io scheduler queue to the block 49When we have to move requests from the io scheduler queue to the block
51device dispatch queue, we always give a preference to reads. However, we 50device dispatch queue, we always give a preference to reads. However, we
@@ -56,7 +55,7 @@ same criteria as reads.
56 55
57 56
58front_merges (bool) 57front_merges (bool)
59------------ 58----------------------
60 59
61Sometimes it happens that a request enters the io scheduler that is contiguous 60Sometimes it happens that a request enters the io scheduler that is contiguous
62with a request that is already on the queue. Either it fits in the back of that 61with a request that is already on the queue. Either it fits in the back of that
@@ -71,5 +70,3 @@ rbtree front sector lookup when the io scheduler merge function is called.
71 70
72 71
73Nov 11 2002, Jens Axboe <jens.axboe@oracle.com> 72Nov 11 2002, Jens Axboe <jens.axboe@oracle.com>
74
75
diff --git a/Documentation/block/index.rst b/Documentation/block/index.rst
new file mode 100644
index 000000000000..3fa7a52fafa4
--- /dev/null
+++ b/Documentation/block/index.rst
@@ -0,0 +1,25 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=====
4Block
5=====
6
7.. toctree::
8 :maxdepth: 1
9
10 bfq-iosched
11 biodoc
12 biovecs
13 capability
14 cmdline-partition
15 data-integrity
16 deadline-iosched
17 ioprio
18 kyber-iosched
19 null_blk
20 pr
21 queue-sysfs
22 request
23 stat
24 switching-sched
25 writeback_cache_control
diff --git a/Documentation/block/ioprio.txt b/Documentation/block/ioprio.rst
index 8ed8c59380b4..f72b0de65af7 100644
--- a/Documentation/block/ioprio.txt
+++ b/Documentation/block/ioprio.rst
@@ -1,3 +1,4 @@
1===================
1Block io priorities 2Block io priorities
2=================== 3===================
3 4
@@ -40,81 +41,81 @@ class data, since it doesn't really apply here.
40Tools 41Tools
41----- 42-----
42 43
43See below for a sample ionice tool. Usage: 44See below for a sample ionice tool. Usage::
44 45
45# ionice -c<class> -n<level> -p<pid> 46 # ionice -c<class> -n<level> -p<pid>
46 47
47If pid isn't given, the current process is assumed. IO priority settings 48If pid isn't given, the current process is assumed. IO priority settings
48are inherited on fork, so you can use ionice to start the process at a given 49are inherited on fork, so you can use ionice to start the process at a given
49level: 50level::
50 51
51# ionice -c2 -n0 /bin/ls 52 # ionice -c2 -n0 /bin/ls
52 53
53will run ls at the best-effort scheduling class at the highest priority. 54will run ls at the best-effort scheduling class at the highest priority.
54For a running process, you can give the pid instead: 55For a running process, you can give the pid instead::
55 56
56# ionice -c1 -n2 -p100 57 # ionice -c1 -n2 -p100
57 58
58will change pid 100 to run at the realtime scheduling class, at priority 2. 59will change pid 100 to run at the realtime scheduling class, at priority 2.
59 60
60---> snip ionice.c tool <--- 61ionice.c tool::
61 62
62#include <stdio.h> 63 #include <stdio.h>
63#include <stdlib.h> 64 #include <stdlib.h>
64#include <errno.h> 65 #include <errno.h>
65#include <getopt.h> 66 #include <getopt.h>
66#include <unistd.h> 67 #include <unistd.h>
67#include <sys/ptrace.h> 68 #include <sys/ptrace.h>
68#include <asm/unistd.h> 69 #include <asm/unistd.h>
69 70
70extern int sys_ioprio_set(int, int, int); 71 extern int sys_ioprio_set(int, int, int);
71extern int sys_ioprio_get(int, int); 72 extern int sys_ioprio_get(int, int);
72 73
73#if defined(__i386__) 74 #if defined(__i386__)
74#define __NR_ioprio_set 289 75 #define __NR_ioprio_set 289
75#define __NR_ioprio_get 290 76 #define __NR_ioprio_get 290
76#elif defined(__ppc__) 77 #elif defined(__ppc__)
77#define __NR_ioprio_set 273 78 #define __NR_ioprio_set 273
78#define __NR_ioprio_get 274 79 #define __NR_ioprio_get 274
79#elif defined(__x86_64__) 80 #elif defined(__x86_64__)
80#define __NR_ioprio_set 251 81 #define __NR_ioprio_set 251
81#define __NR_ioprio_get 252 82 #define __NR_ioprio_get 252
82#elif defined(__ia64__) 83 #elif defined(__ia64__)
83#define __NR_ioprio_set 1274 84 #define __NR_ioprio_set 1274
84#define __NR_ioprio_get 1275 85 #define __NR_ioprio_get 1275
85#else 86 #else
86#error "Unsupported arch" 87 #error "Unsupported arch"
87#endif 88 #endif
88 89
89static inline int ioprio_set(int which, int who, int ioprio) 90 static inline int ioprio_set(int which, int who, int ioprio)
90{ 91 {
91 return syscall(__NR_ioprio_set, which, who, ioprio); 92 return syscall(__NR_ioprio_set, which, who, ioprio);
92} 93 }
93 94
94static inline int ioprio_get(int which, int who) 95 static inline int ioprio_get(int which, int who)
95{ 96 {
96 return syscall(__NR_ioprio_get, which, who); 97 return syscall(__NR_ioprio_get, which, who);
97} 98 }
98 99
99enum { 100 enum {
100 IOPRIO_CLASS_NONE, 101 IOPRIO_CLASS_NONE,
101 IOPRIO_CLASS_RT, 102 IOPRIO_CLASS_RT,
102 IOPRIO_CLASS_BE, 103 IOPRIO_CLASS_BE,
103 IOPRIO_CLASS_IDLE, 104 IOPRIO_CLASS_IDLE,
104}; 105 };
105 106
106enum { 107 enum {
107 IOPRIO_WHO_PROCESS = 1, 108 IOPRIO_WHO_PROCESS = 1,
108 IOPRIO_WHO_PGRP, 109 IOPRIO_WHO_PGRP,
109 IOPRIO_WHO_USER, 110 IOPRIO_WHO_USER,
110}; 111 };
111 112
112#define IOPRIO_CLASS_SHIFT 13 113 #define IOPRIO_CLASS_SHIFT 13
113 114
114const char *to_prio[] = { "none", "realtime", "best-effort", "idle", }; 115 const char *to_prio[] = { "none", "realtime", "best-effort", "idle", };
115 116
116int main(int argc, char *argv[]) 117 int main(int argc, char *argv[])
117{ 118 {
118 int ioprio = 4, set = 0, ioprio_class = IOPRIO_CLASS_BE; 119 int ioprio = 4, set = 0, ioprio_class = IOPRIO_CLASS_BE;
119 int c, pid = 0; 120 int c, pid = 0;
120 121
@@ -175,9 +176,7 @@ int main(int argc, char *argv[])
175 } 176 }
176 177
177 return 0; 178 return 0;
178} 179 }
179
180---> snip ionice.c tool <---
181 180
182 181
183March 11 2005, Jens Axboe <jens.axboe@oracle.com> 182March 11 2005, Jens Axboe <jens.axboe@oracle.com>
diff --git a/Documentation/block/kyber-iosched.txt b/Documentation/block/kyber-iosched.rst
index e94feacd7edc..3e164dd0617c 100644
--- a/Documentation/block/kyber-iosched.txt
+++ b/Documentation/block/kyber-iosched.rst
@@ -1,5 +1,6 @@
1============================
1Kyber I/O scheduler tunables 2Kyber I/O scheduler tunables
2=========================== 3============================
3 4
4The only two tunables for the Kyber scheduler are the target latencies for 5The only two tunables for the Kyber scheduler are the target latencies for
5reads and synchronous writes. Kyber will throttle requests in order to meet 6reads and synchronous writes. Kyber will throttle requests in order to meet
diff --git a/Documentation/block/null_blk.txt b/Documentation/block/null_blk.rst
index 41f0a3d33bbd..31451d80783c 100644
--- a/Documentation/block/null_blk.txt
+++ b/Documentation/block/null_blk.rst
@@ -1,33 +1,43 @@
1========================
1Null block device driver 2Null block device driver
2================================================================================ 3========================
3 4
4I. Overview 51. Overview
6===========
5 7
6The null block device (/dev/nullb*) is used for benchmarking the various 8The null block device (/dev/nullb*) is used for benchmarking the various
7block-layer implementations. It emulates a block device of X gigabytes in size. 9block-layer implementations. It emulates a block device of X gigabytes in size.
8The following instances are possible: 10The following instances are possible:
9 11
10 Single-queue block-layer 12 Single-queue block-layer
13
11 - Request-based. 14 - Request-based.
12 - Single submission queue per device. 15 - Single submission queue per device.
13 - Implements IO scheduling algorithms (CFQ, Deadline, noop). 16 - Implements IO scheduling algorithms (CFQ, Deadline, noop).
17
14 Multi-queue block-layer 18 Multi-queue block-layer
19
15 - Request-based. 20 - Request-based.
16 - Configurable submission queues per device. 21 - Configurable submission queues per device.
22
17 No block-layer (Known as bio-based) 23 No block-layer (Known as bio-based)
24
18 - Bio-based. IO requests are submitted directly to the device driver. 25 - Bio-based. IO requests are submitted directly to the device driver.
19 - Directly accepts bio data structure and returns them. 26 - Directly accepts bio data structure and returns them.
20 27
21All of them have a completion queue for each core in the system. 28All of them have a completion queue for each core in the system.
22 29
23II. Module parameters applicable for all instances: 302. Module parameters applicable for all instances
31=================================================
24 32
25queue_mode=[0-2]: Default: 2-Multi-queue 33queue_mode=[0-2]: Default: 2-Multi-queue
26 Selects which block-layer the module should instantiate with. 34 Selects which block-layer the module should instantiate with.
27 35
28 0: Bio-based. 36 = ============
29 1: Single-queue. 37 0 Bio-based
30 2: Multi-queue. 38 1 Single-queue
39 2 Multi-queue
40 = ============
31 41
32home_node=[0--nr_nodes]: Default: NUMA_NO_NODE 42home_node=[0--nr_nodes]: Default: NUMA_NO_NODE
33 Selects what CPU node the data structures are allocated from. 43 Selects what CPU node the data structures are allocated from.
@@ -45,12 +55,14 @@ nr_devices=[Number of devices]: Default: 1
45irqmode=[0-2]: Default: 1-Soft-irq 55irqmode=[0-2]: Default: 1-Soft-irq
46 The completion mode used for completing IOs to the block-layer. 56 The completion mode used for completing IOs to the block-layer.
47 57
48 0: None. 58 = ===========================================================================
49 1: Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead 59 0 None.
60 1 Soft-irq. Uses IPI to complete IOs across CPU nodes. Simulates the overhead
50 when IOs are issued from another CPU node than the home the device is 61 when IOs are issued from another CPU node than the home the device is
51 connected to. 62 connected to.
52 2: Timer: Waits a specific period (completion_nsec) for each IO before 63 2 Timer: Waits a specific period (completion_nsec) for each IO before
53 completion. 64 completion.
65 = ===========================================================================
54 66
55completion_nsec=[ns]: Default: 10,000ns 67completion_nsec=[ns]: Default: 10,000ns
56 Combined with irqmode=2 (timer). The time each completion event must wait. 68 Combined with irqmode=2 (timer). The time each completion event must wait.
@@ -66,30 +78,45 @@ hw_queue_depth=[0..qdepth]: Default: 64
66III: Multi-queue specific parameters 78III: Multi-queue specific parameters
67 79
68use_per_node_hctx=[0/1]: Default: 0 80use_per_node_hctx=[0/1]: Default: 0
69 0: The number of submit queues are set to the value of the submit_queues 81
82 = =====================================================================
83 0 The number of submit queues are set to the value of the submit_queues
70 parameter. 84 parameter.
71 1: The multi-queue block layer is instantiated with a hardware dispatch 85 1 The multi-queue block layer is instantiated with a hardware dispatch
72 queue for each CPU node in the system. 86 queue for each CPU node in the system.
87 = =====================================================================
73 88
74no_sched=[0/1]: Default: 0 89no_sched=[0/1]: Default: 0
75 0: nullb* use default blk-mq io scheduler. 90
76 1: nullb* doesn't use io scheduler. 91 = ======================================
92 0 nullb* use default blk-mq io scheduler
93 1 nullb* doesn't use io scheduler
94 = ======================================
77 95
78blocking=[0/1]: Default: 0 96blocking=[0/1]: Default: 0
79 0: Register as a non-blocking blk-mq driver device. 97
80 1: Register as a blocking blk-mq driver device, null_blk will set 98 = ===============================================================
99 0 Register as a non-blocking blk-mq driver device.
100 1 Register as a blocking blk-mq driver device, null_blk will set
81 the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always 101 the BLK_MQ_F_BLOCKING flag, indicating that it sometimes/always
82 needs to block in its ->queue_rq() function. 102 needs to block in its ->queue_rq() function.
103 = ===============================================================
83 104
84shared_tags=[0/1]: Default: 0 105shared_tags=[0/1]: Default: 0
85 0: Tag set is not shared. 106
86 1: Tag set shared between devices for blk-mq. Only makes sense with 107 = ================================================================
108 0 Tag set is not shared.
109 1 Tag set shared between devices for blk-mq. Only makes sense with
87 nr_devices > 1, otherwise there's no tag set to share. 110 nr_devices > 1, otherwise there's no tag set to share.
111 = ================================================================
88 112
89zoned=[0/1]: Default: 0 113zoned=[0/1]: Default: 0
90 0: Block device is exposed as a random-access block device. 114
91 1: Block device is exposed as a host-managed zoned block device. Requires 115 = ======================================================================
116 0 Block device is exposed as a random-access block device.
117 1 Block device is exposed as a host-managed zoned block device. Requires
92 CONFIG_BLK_DEV_ZONED. 118 CONFIG_BLK_DEV_ZONED.
119 = ======================================================================
93 120
94zone_size=[MB]: Default: 256 121zone_size=[MB]: Default: 256
95 Per zone size when exposed as a zoned block device. Must be a power of two. 122 Per zone size when exposed as a zoned block device. Must be a power of two.
diff --git a/Documentation/block/pr.txt b/Documentation/block/pr.rst
index ac9b8e70e64b..30ea1c2e39eb 100644
--- a/Documentation/block/pr.txt
+++ b/Documentation/block/pr.rst
@@ -1,4 +1,4 @@
1 1===============================================
2Block layer support for Persistent Reservations 2Block layer support for Persistent Reservations
3=============================================== 3===============================================
4 4
@@ -23,22 +23,18 @@ The following types of reservations are supported:
23-------------------------------------------------- 23--------------------------------------------------
24 24
25 - PR_WRITE_EXCLUSIVE 25 - PR_WRITE_EXCLUSIVE
26
27 Only the initiator that owns the reservation can write to the 26 Only the initiator that owns the reservation can write to the
28 device. Any initiator can read from the device. 27 device. Any initiator can read from the device.
29 28
30 - PR_EXCLUSIVE_ACCESS 29 - PR_EXCLUSIVE_ACCESS
31
32 Only the initiator that owns the reservation can access the 30 Only the initiator that owns the reservation can access the
33 device. 31 device.
34 32
35 - PR_WRITE_EXCLUSIVE_REG_ONLY 33 - PR_WRITE_EXCLUSIVE_REG_ONLY
36
37 Only initiators with a registered key can write to the device, 34 Only initiators with a registered key can write to the device,
38 Any initiator can read from the device. 35 Any initiator can read from the device.
39 36
40 - PR_EXCLUSIVE_ACCESS_REG_ONLY 37 - PR_EXCLUSIVE_ACCESS_REG_ONLY
41
42 Only initiators with a registered key can access the device. 38 Only initiators with a registered key can access the device.
43 39
44 - PR_WRITE_EXCLUSIVE_ALL_REGS 40 - PR_WRITE_EXCLUSIVE_ALL_REGS
@@ -48,21 +44,21 @@ The following types of reservations are supported:
48 All initiators with a registered key are considered reservation 44 All initiators with a registered key are considered reservation
49 holders. 45 holders.
50 Please reference the SPC spec on the meaning of a reservation 46 Please reference the SPC spec on the meaning of a reservation
51 holder if you want to use this type. 47 holder if you want to use this type.
52 48
53 - PR_EXCLUSIVE_ACCESS_ALL_REGS 49 - PR_EXCLUSIVE_ACCESS_ALL_REGS
54
55 Only initiators with a registered key can access the device. 50 Only initiators with a registered key can access the device.
56 All initiators with a registered key are considered reservation 51 All initiators with a registered key are considered reservation
57 holders. 52 holders.
58 Please reference the SPC spec on the meaning of a reservation 53 Please reference the SPC spec on the meaning of a reservation
59 holder if you want to use this type. 54 holder if you want to use this type.
60 55
61 56
62The following ioctl are supported: 57The following ioctl are supported:
63---------------------------------- 58----------------------------------
64 59
651. IOC_PR_REGISTER 601. IOC_PR_REGISTER
61^^^^^^^^^^^^^^^^^^
66 62
67This ioctl command registers a new reservation if the new_key argument 63This ioctl command registers a new reservation if the new_key argument
68is non-null. If no existing reservation exists old_key must be zero, 64is non-null. If no existing reservation exists old_key must be zero,
@@ -74,6 +70,7 @@ in old_key.
74 70
75 71
762. IOC_PR_RESERVE 722. IOC_PR_RESERVE
73^^^^^^^^^^^^^^^^^
77 74
78This ioctl command reserves the device and thus restricts access for other 75This ioctl command reserves the device and thus restricts access for other
79devices based on the type argument. The key argument must be the existing 76devices based on the type argument. The key argument must be the existing
@@ -82,12 +79,14 @@ IOC_PR_REGISTER_IGNORE, IOC_PR_PREEMPT or IOC_PR_PREEMPT_ABORT commands.
82 79
83 80
843. IOC_PR_RELEASE 813. IOC_PR_RELEASE
82^^^^^^^^^^^^^^^^^
85 83
86This ioctl command releases the reservation specified by key and flags 84This ioctl command releases the reservation specified by key and flags
87and thus removes any access restriction implied by it. 85and thus removes any access restriction implied by it.
88 86
89 87
904. IOC_PR_PREEMPT 884. IOC_PR_PREEMPT
89^^^^^^^^^^^^^^^^^
91 90
92This ioctl command releases the existing reservation referred to by 91This ioctl command releases the existing reservation referred to by
93old_key and replaces it with a new reservation of type for the 92old_key and replaces it with a new reservation of type for the
@@ -95,11 +94,13 @@ reservation key new_key.
95 94
96 95
975. IOC_PR_PREEMPT_ABORT 965. IOC_PR_PREEMPT_ABORT
97^^^^^^^^^^^^^^^^^^^^^^^
98 98
99This ioctl command works like IOC_PR_PREEMPT except that it also aborts 99This ioctl command works like IOC_PR_PREEMPT except that it also aborts
100any outstanding command sent over a connection identified by old_key. 100any outstanding command sent over a connection identified by old_key.
101 101
1026. IOC_PR_CLEAR 1026. IOC_PR_CLEAR
103^^^^^^^^^^^^^^^
103 104
104This ioctl command unregisters both key and any other reservation key 105This ioctl command unregisters both key and any other reservation key
105registered with the device and drops any existing reservation. 106registered with the device and drops any existing reservation.
@@ -111,7 +112,6 @@ Flags
111All the ioctls have a flag field. Currently only one flag is supported: 112All the ioctls have a flag field. Currently only one flag is supported:
112 113
113 - PR_FL_IGNORE_KEY 114 - PR_FL_IGNORE_KEY
114
115 Ignore the existing reservation key. This is commonly supported for 115 Ignore the existing reservation key. This is commonly supported for
116 IOC_PR_REGISTER, and some implementation may support the flag for 116 IOC_PR_REGISTER, and some implementation may support the flag for
117 IOC_PR_RESERVE. 117 IOC_PR_RESERVE.
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.rst
index b40b5b7cebd9..6a8513af9201 100644
--- a/Documentation/block/queue-sysfs.txt
+++ b/Documentation/block/queue-sysfs.rst
@@ -1,3 +1,4 @@
1=================
1Queue sysfs files 2Queue sysfs files
2================= 3=================
3 4
@@ -10,7 +11,7 @@ Files denoted with a RO postfix are readonly and the RW postfix means
10read-write. 11read-write.
11 12
12add_random (RW) 13add_random (RW)
13---------------- 14---------------
14This file allows to turn off the disk entropy contribution. Default 15This file allows to turn off the disk entropy contribution. Default
15value of this file is '1'(on). 16value of this file is '1'(on).
16 17
@@ -30,13 +31,13 @@ used by CPU-addressable storage to bypass the pagecache. It shows '1'
30if true, '0' if not. 31if true, '0' if not.
31 32
32discard_granularity (RO) 33discard_granularity (RO)
33----------------------- 34------------------------
34This shows the size of internal allocation of the device in bytes, if 35This shows the size of internal allocation of the device in bytes, if
35reported by the device. A value of '0' means device does not support 36reported by the device. A value of '0' means device does not support
36the discard functionality. 37the discard functionality.
37 38
38discard_max_hw_bytes (RO) 39discard_max_hw_bytes (RO)
39---------------------- 40-------------------------
40Devices that support discard functionality may have internal limits on 41Devices that support discard functionality may have internal limits on
41the number of bytes that can be trimmed or unmapped in a single operation. 42the number of bytes that can be trimmed or unmapped in a single operation.
42The discard_max_bytes parameter is set by the device driver to the maximum 43The discard_max_bytes parameter is set by the device driver to the maximum
diff --git a/Documentation/block/request.txt b/Documentation/block/request.rst
index 754e104ed369..747021e1ffdb 100644
--- a/Documentation/block/request.txt
+++ b/Documentation/block/request.rst
@@ -1,26 +1,37 @@
1 1============================
2struct request documentation 2struct request documentation
3============================
3 4
4Jens Axboe <jens.axboe@oracle.com> 27/05/02 5Jens Axboe <jens.axboe@oracle.com> 27/05/02
5 6
61.0
7Index
8 7
92.0 Struct request members classification 8.. FIXME:
9 No idea about what does mean - seems just some noise, so comment it
10
11 1.0
12 Index
13
14 2.0 Struct request members classification
15
16 2.1 struct request members explanation
10 17
11 2.1 struct request members explanation 18 3.0
19
20
21 2.0
12 22
133.0
14 23
15 24
162.0
17Short explanation of request members 25Short explanation of request members
26====================================
18 27
19Classification flags: 28Classification flags:
20 29
30 = ====================
21 D driver member 31 D driver member
22 B block layer member 32 B block layer member
23 I I/O scheduler member 33 I I/O scheduler member
34 = ====================
24 35
25Unless an entry contains a D classification, a device driver must not access 36Unless an entry contains a D classification, a device driver must not access
26this member. Some members may contain D classifications, but should only be 37this member. Some members may contain D classifications, but should only be
@@ -28,14 +39,13 @@ access through certain macros or functions (eg ->flags).
28 39
29<linux/blkdev.h> 40<linux/blkdev.h>
30 41
312.1 42=============================== ======= =======================================
32Member Flag Comment 43Member Flag Comment
33------ ---- ------- 44=============================== ======= =======================================
34
35struct list_head queuelist BI Organization on various internal 45struct list_head queuelist BI Organization on various internal
36 queues 46 queues
37 47
38void *elevator_private I I/O scheduler private data 48``void *elevator_private`` I I/O scheduler private data
39 49
40unsigned char cmd[16] D Driver can use this for setting up 50unsigned char cmd[16] D Driver can use this for setting up
41 a cdb before execution, see 51 a cdb before execution, see
@@ -71,18 +81,19 @@ unsigned int hard_cur_sectors B Used to keep current_nr_sectors sane
71 81
72int tag DB TCQ tag, if assigned 82int tag DB TCQ tag, if assigned
73 83
74void *special D Free to be used by driver 84``void *special`` D Free to be used by driver
75 85
76char *buffer D Map of first segment, also see 86``char *buffer`` D Map of first segment, also see
77 section on bouncing SECTION 87 section on bouncing SECTION
78 88
79struct completion *waiting D Can be used by driver to get signalled 89``struct completion *waiting`` D Can be used by driver to get signalled
80 on request completion 90 on request completion
81 91
82struct bio *bio DBI First bio in request 92``struct bio *bio`` DBI First bio in request
83 93
84struct bio *biotail DBI Last bio in request 94``struct bio *biotail`` DBI Last bio in request
85 95
86struct request_queue *q DB Request queue this request belongs to 96``struct request_queue *q`` DB Request queue this request belongs to
87 97
88struct request_list *rl B Request list this request came from 98``struct request_list *rl`` B Request list this request came from
99=============================== ======= =======================================
diff --git a/Documentation/block/stat.txt b/Documentation/block/stat.rst
index 0aace9cc536c..9c07bc22b0bc 100644
--- a/Documentation/block/stat.txt
+++ b/Documentation/block/stat.rst
@@ -1,3 +1,4 @@
1===============================================
1Block layer statistics in /sys/block/<dev>/stat 2Block layer statistics in /sys/block/<dev>/stat
2=============================================== 3===============================================
3 4
@@ -6,9 +7,12 @@ This file documents the contents of the /sys/block/<dev>/stat file.
6The stat file provides several statistics about the state of block 7The stat file provides several statistics about the state of block
7device <dev>. 8device <dev>.
8 9
9Q. Why are there multiple statistics in a single file? Doesn't sysfs 10Q.
11 Why are there multiple statistics in a single file? Doesn't sysfs
10 normally contain a single value per file? 12 normally contain a single value per file?
11A. By having a single file, the kernel can guarantee that the statistics 13
14A.
15 By having a single file, the kernel can guarantee that the statistics
12 represent a consistent snapshot of the state of the device. If the 16 represent a consistent snapshot of the state of the device. If the
13 statistics were exported as multiple files containing one statistic 17 statistics were exported as multiple files containing one statistic
14 each, it would be impossible to guarantee that a set of readings 18 each, it would be impossible to guarantee that a set of readings
@@ -18,8 +22,10 @@ The stat file consists of a single line of text containing 11 decimal
18values separated by whitespace. The fields are summarized in the 22values separated by whitespace. The fields are summarized in the
19following table, and described in more detail below. 23following table, and described in more detail below.
20 24
25
26=============== ============= =================================================
21Name units description 27Name units description
22---- ----- ----------- 28=============== ============= =================================================
23read I/Os requests number of read I/Os processed 29read I/Os requests number of read I/Os processed
24read merges requests number of read I/Os merged with in-queue I/O 30read merges requests number of read I/Os merged with in-queue I/O
25read sectors sectors number of sectors read 31read sectors sectors number of sectors read
@@ -35,6 +41,7 @@ discard I/Os requests number of discard I/Os processed
35discard merges requests number of discard I/Os merged with in-queue I/O 41discard merges requests number of discard I/Os merged with in-queue I/O
36discard sectors sectors number of sectors discarded 42discard sectors sectors number of sectors discarded
37discard ticks milliseconds total wait time for discard requests 43discard ticks milliseconds total wait time for discard requests
44=============== ============= =================================================
38 45
39read I/Os, write I/Os, discard I/0s 46read I/Os, write I/Os, discard I/0s
40=================================== 47===================================
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.rst
index 7977f6fb8b20..42042417380e 100644
--- a/Documentation/block/switching-sched.txt
+++ b/Documentation/block/switching-sched.rst
@@ -1,35 +1,39 @@
1===================
2Switching Scheduler
3===================
4
1To choose IO schedulers at boot time, use the argument 'elevator=deadline'. 5To choose IO schedulers at boot time, use the argument 'elevator=deadline'.
2'noop' and 'cfq' (the default) are also available. IO schedulers are assigned 6'noop' and 'cfq' (the default) are also available. IO schedulers are assigned
3globally at boot time only presently. 7globally at boot time only presently.
4 8
5Each io queue has a set of io scheduler tunables associated with it. These 9Each io queue has a set of io scheduler tunables associated with it. These
6tunables control how the io scheduler works. You can find these entries 10tunables control how the io scheduler works. You can find these entries
7in: 11in::
8 12
9/sys/block/<device>/queue/iosched 13 /sys/block/<device>/queue/iosched
10 14
11assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted, 15assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
12you can do so by typing: 16you can do so by typing::
13 17
14# mount none /sys -t sysfs 18 # mount none /sys -t sysfs
15 19
16It is possible to change the IO scheduler for a given block device on 20It is possible to change the IO scheduler for a given block device on
17the fly to select one of mq-deadline, none, bfq, or kyber schedulers - 21the fly to select one of mq-deadline, none, bfq, or kyber schedulers -
18which can improve that device's throughput. 22which can improve that device's throughput.
19 23
20To set a specific scheduler, simply do this: 24To set a specific scheduler, simply do this::
21 25
22echo SCHEDNAME > /sys/block/DEV/queue/scheduler 26 echo SCHEDNAME > /sys/block/DEV/queue/scheduler
23 27
24where SCHEDNAME is the name of a defined IO scheduler, and DEV is the 28where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
25device name (hda, hdb, sga, or whatever you happen to have). 29device name (hda, hdb, sga, or whatever you happen to have).
26 30
27The list of defined schedulers can be found by simply doing 31The list of defined schedulers can be found by simply doing
28a "cat /sys/block/DEV/queue/scheduler" - the list of valid names 32a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
29will be displayed, with the currently selected scheduler in brackets: 33will be displayed, with the currently selected scheduler in brackets::
30 34
31# cat /sys/block/sda/queue/scheduler 35 # cat /sys/block/sda/queue/scheduler
32[mq-deadline] kyber bfq none 36 [mq-deadline] kyber bfq none
33# echo none >/sys/block/sda/queue/scheduler 37 # echo none >/sys/block/sda/queue/scheduler
34# cat /sys/block/sda/queue/scheduler 38 # cat /sys/block/sda/queue/scheduler
35[none] mq-deadline kyber bfq 39 [none] mq-deadline kyber bfq
diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.rst
index 8a6bdada5f6b..2c752c57c14c 100644
--- a/Documentation/block/writeback_cache_control.txt
+++ b/Documentation/block/writeback_cache_control.rst
@@ -1,6 +1,6 @@
1 1==========================================
2Explicit volatile write back cache control 2Explicit volatile write back cache control
3===================================== 3==========================================
4 4
5Introduction 5Introduction
6------------ 6------------
@@ -31,7 +31,7 @@ the blkdev_issue_flush() helper for a pure cache flush.
31 31
32 32
33Forced Unit Access 33Forced Unit Access
34----------------- 34------------------
35 35
36The REQ_FUA flag can be OR ed into the r/w flags of a bio submitted from the 36The REQ_FUA flag can be OR ed into the r/w flags of a bio submitted from the
37filesystem and will make sure that I/O completion for this request is only 37filesystem and will make sure that I/O completion for this request is only
@@ -62,14 +62,14 @@ flags themselves without any help from the block layer.
62 62
63 63
64Implementation details for request_fn based block drivers 64Implementation details for request_fn based block drivers
65-------------------------------------------------------------- 65---------------------------------------------------------
66 66
67For devices that do not support volatile write caches there is no driver 67For devices that do not support volatile write caches there is no driver
68support required, the block layer completes empty REQ_PREFLUSH requests before 68support required, the block layer completes empty REQ_PREFLUSH requests before
69entering the driver and strips off the REQ_PREFLUSH and REQ_FUA bits from 69entering the driver and strips off the REQ_PREFLUSH and REQ_FUA bits from
70requests that have a payload. For devices with volatile write caches the 70requests that have a payload. For devices with volatile write caches the
71driver needs to tell the block layer that it supports flushing caches by 71driver needs to tell the block layer that it supports flushing caches by
72doing: 72doing::
73 73
74 blk_queue_write_cache(sdkp->disk->queue, true, false); 74 blk_queue_write_cache(sdkp->disk->queue, true, false);
75 75
@@ -77,7 +77,7 @@ and handle empty REQ_OP_FLUSH requests in its prep_fn/request_fn. Note that
77REQ_PREFLUSH requests with a payload are automatically turned into a sequence 77REQ_PREFLUSH requests with a payload are automatically turned into a sequence
78of an empty REQ_OP_FLUSH request followed by the actual write by the block 78of an empty REQ_OP_FLUSH request followed by the actual write by the block
79layer. For devices that also support the FUA bit the block layer needs 79layer. For devices that also support the FUA bit the block layer needs
80to be told to pass through the REQ_FUA bit using: 80to be told to pass through the REQ_FUA bit using::
81 81
82 blk_queue_write_cache(sdkp->disk->queue, true, true); 82 blk_queue_write_cache(sdkp->disk->queue, true, true);
83 83
diff --git a/Documentation/cdrom/index.rst b/Documentation/cdrom/index.rst
index efbd5d111825..338ad5f94e7c 100644
--- a/Documentation/cdrom/index.rst
+++ b/Documentation/cdrom/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3===== 3=====
4cdrom 4cdrom
diff --git a/Documentation/gcc-plugins.txt b/Documentation/core-api/gcc-plugins.rst
index 8502f24396fb..8502f24396fb 100644
--- a/Documentation/gcc-plugins.txt
+++ b/Documentation/core-api/gcc-plugins.rst
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst
index 322ac954b390..da0ed972d224 100644
--- a/Documentation/core-api/index.rst
+++ b/Documentation/core-api/index.rst
@@ -36,6 +36,7 @@ Core utilities
36 memory-hotplug 36 memory-hotplug
37 protection-keys 37 protection-keys
38 ../RCU/index 38 ../RCU/index
39 gcc-plugins
39 40
40 41
41Interfaces for kernel debugging 42Interfaces for kernel debugging
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index 75d2bbe9813f..c6224d039bcb 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -119,7 +119,7 @@ Kernel Pointers
119 119
120For printing kernel pointers which should be hidden from unprivileged 120For printing kernel pointers which should be hidden from unprivileged
121users. The behaviour of %pK depends on the kptr_restrict sysctl - see 121users. The behaviour of %pK depends on the kptr_restrict sysctl - see
122Documentation/sysctl/kernel.txt for more details. 122Documentation/admin-guide/sysctl/kernel.rst for more details.
123 123
124Unmodified Addresses 124Unmodified Addresses
125-------------------- 125--------------------
diff --git a/Documentation/devicetree/bindings/arm/xen.txt b/Documentation/devicetree/bindings/arm/xen.txt
index c9b9321434ea..db5c56db30ec 100644
--- a/Documentation/devicetree/bindings/arm/xen.txt
+++ b/Documentation/devicetree/bindings/arm/xen.txt
@@ -54,7 +54,7 @@ hypervisor {
54}; 54};
55 55
56The format and meaning of the "xen,uefi-*" parameters are similar to those in 56The format and meaning of the "xen,uefi-*" parameters are similar to those in
57Documentation/arm/uefi.txt, which are provided by the regular UEFI stub. However 57Documentation/arm/uefi.rst, which are provided by the regular UEFI stub. However
58they differ because they are provided by the Xen hypervisor, together with a set 58they differ because they are provided by the Xen hypervisor, together with a set
59of UEFI runtime services implemented via hypercalls, see 59of UEFI runtime services implemented via hypercalls, see
60http://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,platform.h.html. 60http://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,platform.h.html.
diff --git a/Documentation/devicetree/bindings/phy/phy-bindings.txt b/Documentation/devicetree/bindings/phy/phy-bindings.txt
index a403b81d0679..c4eb38902533 100644
--- a/Documentation/devicetree/bindings/phy/phy-bindings.txt
+++ b/Documentation/devicetree/bindings/phy/phy-bindings.txt
@@ -1,5 +1,5 @@
1This document explains only the device tree data binding. For general 1This document explains only the device tree data binding. For general
2information about PHY subsystem refer to Documentation/phy.txt 2information about PHY subsystem refer to Documentation/driver-api/phy/phy.rst
3 3
4PHY device node 4PHY device node
5=============== 5===============
diff --git a/Documentation/devicetree/bindings/phy/phy-pxa-usb.txt b/Documentation/devicetree/bindings/phy/phy-pxa-usb.txt
index 93fc09c12954..d80e36a77ec5 100644
--- a/Documentation/devicetree/bindings/phy/phy-pxa-usb.txt
+++ b/Documentation/devicetree/bindings/phy/phy-pxa-usb.txt
@@ -15,4 +15,4 @@ Example:
15 }; 15 };
16 16
17This document explains the device tree binding. For general 17This document explains the device tree binding. For general
18information about PHY subsystem refer to Documentation/phy.txt 18information about PHY subsystem refer to Documentation/driver-api/phy/phy.rst
diff --git a/Documentation/devicetree/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt
index 60f8640f2b2f..4660ccee35a3 100644
--- a/Documentation/devicetree/booting-without-of.txt
+++ b/Documentation/devicetree/booting-without-of.txt
@@ -160,7 +160,7 @@ it with special cases.
160 of the kernel image. That entry point supports two calling 160 of the kernel image. That entry point supports two calling
161 conventions. A summary of the interface is described here. A full 161 conventions. A summary of the interface is described here. A full
162 description of the boot requirements is documented in 162 description of the boot requirements is documented in
163 Documentation/arm/Booting 163 Documentation/arm/booting.rst
164 164
165 a) ATAGS interface. Minimal information is passed from firmware 165 a) ATAGS interface. Minimal information is passed from firmware
166 to the kernel with a tagged list of predefined parameters. 166 to the kernel with a tagged list of predefined parameters.
@@ -174,7 +174,7 @@ it with special cases.
174 b) Entry with a flattened device-tree block. Firmware loads the 174 b) Entry with a flattened device-tree block. Firmware loads the
175 physical address of the flattened device tree block (dtb) into r2, 175 physical address of the flattened device tree block (dtb) into r2,
176 r1 is not used, but it is considered good practice to use a valid 176 r1 is not used, but it is considered good practice to use a valid
177 machine number as described in Documentation/arm/Booting. 177 machine number as described in Documentation/arm/booting.rst.
178 178
179 r0 : 0 179 r0 : 0
180 180
diff --git a/Documentation/driver-api/backlight/lp855x-driver.rst b/Documentation/driver-api/backlight/lp855x-driver.rst
new file mode 100644
index 000000000000..1e0b224fc397
--- /dev/null
+++ b/Documentation/driver-api/backlight/lp855x-driver.rst
@@ -0,0 +1,81 @@
1====================
2Kernel driver lp855x
3====================
4
5Backlight driver for LP855x ICs
6
7Supported chips:
8
9 Texas Instruments LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
10 LP8557
11
12Author: Milo(Woogyom) Kim <milo.kim@ti.com>
13
14Description
15-----------
16
17* Brightness control
18
19 Brightness can be controlled by the pwm input or the i2c command.
20 The lp855x driver supports both cases.
21
22* Device attributes
23
24 1) bl_ctl_mode
25
26 Backlight control mode.
27
28 Value: pwm based or register based
29
30 2) chip_id
31
32 The lp855x chip id.
33
34 Value: lp8550/lp8551/lp8552/lp8553/lp8555/lp8556/lp8557
35
36Platform data for lp855x
37------------------------
38
39For supporting platform specific data, the lp855x platform data can be used.
40
41* name:
42 Backlight driver name. If it is not defined, default name is set.
43* device_control:
44 Value of DEVICE CONTROL register.
45* initial_brightness:
46 Initial value of backlight brightness.
47* period_ns:
48 Platform specific PWM period value. unit is nano.
49 Only valid when brightness is pwm input mode.
50* size_program:
51 Total size of lp855x_rom_data.
52* rom_data:
53 List of new eeprom/eprom registers.
54
55Examples
56========
57
581) lp8552 platform data: i2c register mode with new eeprom data::
59
60 #define EEPROM_A5_ADDR 0xA5
61 #define EEPROM_A5_VAL 0x4f /* EN_VSYNC=0 */
62
63 static struct lp855x_rom_data lp8552_eeprom_arr[] = {
64 {EEPROM_A5_ADDR, EEPROM_A5_VAL},
65 };
66
67 static struct lp855x_platform_data lp8552_pdata = {
68 .name = "lcd-bl",
69 .device_control = I2C_CONFIG(LP8552),
70 .initial_brightness = INITIAL_BRT,
71 .size_program = ARRAY_SIZE(lp8552_eeprom_arr),
72 .rom_data = lp8552_eeprom_arr,
73 };
74
752) lp8556 platform data: pwm input mode with default rom data::
76
77 static struct lp855x_platform_data lp8556_pdata = {
78 .device_control = PWM_CONFIG(LP8556),
79 .initial_brightness = INITIAL_BRT,
80 .period_ns = 1000000,
81 };
diff --git a/Documentation/bt8xxgpio.txt b/Documentation/driver-api/bt8xxgpio.rst
index a845feb074de..a845feb074de 100644
--- a/Documentation/bt8xxgpio.txt
+++ b/Documentation/driver-api/bt8xxgpio.rst
diff --git a/Documentation/connector/connector.txt b/Documentation/driver-api/connector.rst
index ab7ca897fab7..c100c7482289 100644
--- a/Documentation/connector/connector.txt
+++ b/Documentation/driver-api/connector.rst
@@ -1,6 +1,8 @@
1/*****************************************/ 1.. SPDX-License-Identifier: GPL-2.0
2Kernel Connector. 2
3/*****************************************/ 3================
4Kernel Connector
5================
4 6
5Kernel connector - new netlink based userspace <-> kernel space easy 7Kernel connector - new netlink based userspace <-> kernel space easy
6to use communication module. 8to use communication module.
@@ -12,94 +14,55 @@ identifier, the appropriate callback will be called.
12 14
13From the userspace point of view it's quite straightforward: 15From the userspace point of view it's quite straightforward:
14 16
15 socket(); 17 - socket();
16 bind(); 18 - bind();
17 send(); 19 - send();
18 recv(); 20 - recv();
19 21
20But if kernelspace wants to use the full power of such connections, the 22But if kernelspace wants to use the full power of such connections, the
21driver writer must create special sockets, must know about struct sk_buff 23driver writer must create special sockets, must know about struct sk_buff
22handling, etc... The Connector driver allows any kernelspace agents to use 24handling, etc... The Connector driver allows any kernelspace agents to use
23netlink based networking for inter-process communication in a significantly 25netlink based networking for inter-process communication in a significantly
24easier way: 26easier way::
25 27
26int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); 28 int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
27void cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __group, int gfp_mask); 29 void cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __group, int gfp_mask);
28void cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, int gfp_mask); 30 void cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, int gfp_mask);
29 31
30struct cb_id 32 struct cb_id
31{ 33 {
32 __u32 idx; 34 __u32 idx;
33 __u32 val; 35 __u32 val;
34}; 36 };
35 37
36idx and val are unique identifiers which must be registered in the 38idx and val are unique identifiers which must be registered in the
37connector.h header for in-kernel usage. void (*callback) (void *) is a 39connector.h header for in-kernel usage. `void (*callback) (void *)` is a
38callback function which will be called when a message with above idx.val 40callback function which will be called when a message with above idx.val
39is received by the connector core. The argument for that function must 41is received by the connector core. The argument for that function must
40be dereferenced to struct cn_msg *. 42be dereferenced to `struct cn_msg *`::
41 43
42struct cn_msg 44 struct cn_msg
43{ 45 {
44 struct cb_id id; 46 struct cb_id id;
45 47
46 __u32 seq; 48 __u32 seq;
47 __u32 ack; 49 __u32 ack;
48 50
49 __u32 len; /* Length of the following data */ 51 __u32 len; /* Length of the following data */
50 __u8 data[0]; 52 __u8 data[0];
51}; 53 };
52
53/*****************************************/
54Connector interfaces.
55/*****************************************/
56
57int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
58
59 Registers new callback with connector core.
60
61 struct cb_id *id - unique connector's user identifier.
62 It must be registered in connector.h for legal in-kernel users.
63 char *name - connector's callback symbolic name.
64 void (*callback) (struct cn..) - connector's callback.
65 cn_msg and the sender's credentials
66
67
68void cn_del_callback(struct cb_id *id);
69
70 Unregisters new callback with connector core.
71
72 struct cb_id *id - unique connector's user identifier.
73
74
75int cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __groups, int gfp_mask);
76int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __groups, int gfp_mask);
77 54
78 Sends message to the specified groups. It can be safely called from 55Connector interfaces
79 softirq context, but may silently fail under strong memory pressure. 56====================
80 If there are no listeners for given group -ESRCH can be returned.
81 57
82 struct cn_msg * - message header(with attached data). 58 .. kernel-doc:: include/linux/connector.h
83 u16 len - for *_multi multiple cn_msg messages can be sent
84 u32 port - destination port.
85 If non-zero the message will be sent to the
86 given port, which should be set to the
87 original sender.
88 u32 __group - destination group.
89 If port and __group is zero, then appropriate group will
90 be searched through all registered connector users,
91 and message will be delivered to the group which was
92 created for user with the same ID as in msg.
93 If __group is not zero, then message will be delivered
94 to the specified group.
95 int gfp_mask - GFP mask.
96 59
97 Note: When registering new callback user, connector core assigns 60 Note:
98 netlink group to the user which is equal to its id.idx. 61 When registering new callback user, connector core assigns
62 netlink group to the user which is equal to its id.idx.
99 63
100/*****************************************/ 64Protocol description
101Protocol description. 65====================
102/*****************************************/
103 66
104The current framework offers a transport layer with fixed headers. The 67The current framework offers a transport layer with fixed headers. The
105recommended protocol which uses such a header is as following: 68recommended protocol which uses such a header is as following:
@@ -132,9 +95,8 @@ driver (it also registers itself with id={-1, -1}).
132As example of this usage can be found in the cn_test.c module which 95As example of this usage can be found in the cn_test.c module which
133uses the connector to request notification and to send messages. 96uses the connector to request notification and to send messages.
134 97
135/*****************************************/ 98Reliability
136Reliability. 99===========
137/*****************************************/
138 100
139Netlink itself is not a reliable protocol. That means that messages can 101Netlink itself is not a reliable protocol. That means that messages can
140be lost due to memory pressure or process' receiving queue overflowed, 102be lost due to memory pressure or process' receiving queue overflowed,
@@ -142,32 +104,31 @@ so caller is warned that it must be prepared. That is why the struct
142cn_msg [main connector's message header] contains u32 seq and u32 ack 104cn_msg [main connector's message header] contains u32 seq and u32 ack
143fields. 105fields.
144 106
145/*****************************************/ 107Userspace usage
146Userspace usage. 108===============
147/*****************************************/
148 109
1492.6.14 has a new netlink socket implementation, which by default does not 1102.6.14 has a new netlink socket implementation, which by default does not
150allow people to send data to netlink groups other than 1. 111allow people to send data to netlink groups other than 1.
151So, if you wish to use a netlink socket (for example using connector) 112So, if you wish to use a netlink socket (for example using connector)
152with a different group number, the userspace application must subscribe to 113with a different group number, the userspace application must subscribe to
153that group first. It can be achieved by the following pseudocode: 114that group first. It can be achieved by the following pseudocode::
154 115
155s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); 116 s = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
156 117
157l_local.nl_family = AF_NETLINK; 118 l_local.nl_family = AF_NETLINK;
158l_local.nl_groups = 12345; 119 l_local.nl_groups = 12345;
159l_local.nl_pid = 0; 120 l_local.nl_pid = 0;
160 121
161if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) { 122 if (bind(s, (struct sockaddr *)&l_local, sizeof(struct sockaddr_nl)) == -1) {
162 perror("bind"); 123 perror("bind");
163 close(s); 124 close(s);
164 return -1; 125 return -1;
165} 126 }
166 127
167{ 128 {
168 int on = l_local.nl_groups; 129 int on = l_local.nl_groups;
169 setsockopt(s, 270, 1, &on, sizeof(on)); 130 setsockopt(s, 270, 1, &on, sizeof(on));
170} 131 }
171 132
172Where 270 above is SOL_NETLINK, and 1 is a NETLINK_ADD_MEMBERSHIP socket 133Where 270 above is SOL_NETLINK, and 1 is a NETLINK_ADD_MEMBERSHIP socket
173option. To drop a multicast subscription, one should call the above socket 134option. To drop a multicast subscription, one should call the above socket
@@ -180,16 +141,15 @@ group number 12345, you must increment CN_NETLINK_USERS to that number.
180Additional 0xf numbers are allocated to be used by non-in-kernel users. 141Additional 0xf numbers are allocated to be used by non-in-kernel users.
181 142
182Due to this limitation, group 0xffffffff does not work now, so one can 143Due to this limitation, group 0xffffffff does not work now, so one can
183not use add/remove connector's group notifications, but as far as I know, 144not use add/remove connector's group notifications, but as far as I know,
184only cn_test.c test module used it. 145only cn_test.c test module used it.
185 146
186Some work in netlink area is still being done, so things can be changed in 147Some work in netlink area is still being done, so things can be changed in
1872.6.15 timeframe, if it will happen, documentation will be updated for that 1482.6.15 timeframe, if it will happen, documentation will be updated for that
188kernel. 149kernel.
189 150
190/*****************************************/
191Code samples 151Code samples
192/*****************************************/ 152============
193 153
194Sample code for a connector test module and user space can be found 154Sample code for a connector test module and user space can be found
195in samples/connector/. To build this code, enable CONFIG_CONNECTOR 155in samples/connector/. To build this code, enable CONFIG_CONNECTOR
diff --git a/Documentation/console/console.txt b/Documentation/driver-api/console.rst
index d73c2ab4beda..8394ad7747ac 100644
--- a/Documentation/console/console.txt
+++ b/Documentation/driver-api/console.rst
@@ -1,3 +1,6 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===============
1Console Drivers 4Console Drivers
2=============== 5===============
3 6
@@ -17,25 +20,26 @@ of driver occupying the consoles.) They can only take over the console that is
17occupied by the system driver. In the same token, if the modular driver is 20occupied by the system driver. In the same token, if the modular driver is
18released by the console, the system driver will take over. 21released by the console, the system driver will take over.
19 22
20Modular drivers, from the programmer's point of view, have to call: 23Modular drivers, from the programmer's point of view, have to call::
21 24
22 do_take_over_console() - load and bind driver to console layer 25 do_take_over_console() - load and bind driver to console layer
23 give_up_console() - unload driver; it will only work if driver 26 give_up_console() - unload driver; it will only work if driver
24 is fully unbound 27 is fully unbound
25 28
26In newer kernels, the following are also available: 29In newer kernels, the following are also available::
27 30
28 do_register_con_driver() 31 do_register_con_driver()
29 do_unregister_con_driver() 32 do_unregister_con_driver()
30 33
31If sysfs is enabled, the contents of /sys/class/vtconsole can be 34If sysfs is enabled, the contents of /sys/class/vtconsole can be
32examined. This shows the console backends currently registered by the 35examined. This shows the console backends currently registered by the
33system which are named vtcon<n> where <n> is an integer from 0 to 15. Thus: 36system which are named vtcon<n> where <n> is an integer from 0 to 15.
37Thus::
34 38
35 ls /sys/class/vtconsole 39 ls /sys/class/vtconsole
36 . .. vtcon0 vtcon1 40 . .. vtcon0 vtcon1
37 41
38Each directory in /sys/class/vtconsole has 3 files: 42Each directory in /sys/class/vtconsole has 3 files::
39 43
40 ls /sys/class/vtconsole/vtcon0 44 ls /sys/class/vtconsole/vtcon0
41 . .. bind name uevent 45 . .. bind name uevent
@@ -46,27 +50,29 @@ What do these files signify?
46 read, or acts to bind or unbind the driver to the virtual consoles 50 read, or acts to bind or unbind the driver to the virtual consoles
47 when written to. The possible values are: 51 when written to. The possible values are:
48 52
49 0 - means the driver is not bound and if echo'ed, commands the driver 53 0
54 - means the driver is not bound and if echo'ed, commands the driver
50 to unbind 55 to unbind
51 56
52 1 - means the driver is bound and if echo'ed, commands the driver to 57 1
58 - means the driver is bound and if echo'ed, commands the driver to
53 bind 59 bind
54 60
55 2. name - read-only file. Shows the name of the driver in this format: 61 2. name - read-only file. Shows the name of the driver in this format::
56 62
57 cat /sys/class/vtconsole/vtcon0/name 63 cat /sys/class/vtconsole/vtcon0/name
58 (S) VGA+ 64 (S) VGA+
59 65
60 '(S)' stands for a (S)ystem driver, i.e., it cannot be directly 66 '(S)' stands for a (S)ystem driver, i.e., it cannot be directly
61 commanded to bind or unbind 67 commanded to bind or unbind
62 68
63 'VGA+' is the name of the driver 69 'VGA+' is the name of the driver
64 70
65 cat /sys/class/vtconsole/vtcon1/name 71 cat /sys/class/vtconsole/vtcon1/name
66 (M) frame buffer device 72 (M) frame buffer device
67 73
68 In this case, '(M)' stands for a (M)odular driver, one that can be 74 In this case, '(M)' stands for a (M)odular driver, one that can be
69 directly commanded to bind or unbind. 75 directly commanded to bind or unbind.
70 76
71 3. uevent - ignore this file 77 3. uevent - ignore this file
72 78
@@ -75,14 +81,17 @@ driver takes over the consoles vacated by the driver. Binding, on the other
75hand, will bind the driver to the consoles that are currently occupied by a 81hand, will bind the driver to the consoles that are currently occupied by a
76system driver. 82system driver.
77 83
78NOTE1: Binding and unbinding must be selected in Kconfig. It's under: 84NOTE1:
85 Binding and unbinding must be selected in Kconfig. It's under::
79 86
80Device Drivers -> Character devices -> Support for binding and unbinding 87 Device Drivers ->
81console drivers 88 Character devices ->
89 Support for binding and unbinding console drivers
82 90
83NOTE2: If any of the virtual consoles are in KD_GRAPHICS mode, then binding or 91NOTE2:
84unbinding will not succeed. An example of an application that sets the console 92 If any of the virtual consoles are in KD_GRAPHICS mode, then binding or
85to KD_GRAPHICS is X. 93 unbinding will not succeed. An example of an application that sets the
94 console to KD_GRAPHICS is X.
86 95
87How useful is this feature? This is very useful for console driver 96How useful is this feature? This is very useful for console driver
88developers. By unbinding the driver from the console layer, one can unload the 97developers. By unbinding the driver from the console layer, one can unload the
@@ -92,10 +101,10 @@ framebuffer console to VGA console and vice versa, this feature also makes
92this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb 101this possible. (NOTE NOTE NOTE: Please read fbcon.txt under Documentation/fb
93for more details.) 102for more details.)
94 103
95Notes for developers: 104Notes for developers
96===================== 105====================
97 106
98do_take_over_console() is now broken up into: 107do_take_over_console() is now broken up into::
99 108
100 do_register_con_driver() 109 do_register_con_driver()
101 do_bind_con_driver() - private function 110 do_bind_con_driver() - private function
@@ -104,7 +113,7 @@ give_up_console() is a wrapper to do_unregister_con_driver(), and a driver must
104be fully unbound for this call to succeed. con_is_bound() will check if the 113be fully unbound for this call to succeed. con_is_bound() will check if the
105driver is bound or not. 114driver is bound or not.
106 115
107Guidelines for console driver writers: 116Guidelines for console driver writers
108===================================== 117=====================================
109 118
110In order for binding to and unbinding from the console to properly work, 119In order for binding to and unbinding from the console to properly work,
@@ -140,6 +149,4 @@ The current crop of console drivers should still work correctly, but binding
140and unbinding them may cause problems. With minimal fixes, these drivers can 149and unbinding them may cause problems. With minimal fixes, these drivers can
141be made to work correctly. 150be made to work correctly.
142 151
143==========================
144Antonino Daplas <adaplas@pol.net> 152Antonino Daplas <adaplas@pol.net>
145
diff --git a/Documentation/dcdbas.txt b/Documentation/driver-api/dcdbas.rst
index 309cc57a7c1c..309cc57a7c1c 100644
--- a/Documentation/dcdbas.txt
+++ b/Documentation/driver-api/dcdbas.rst
diff --git a/Documentation/dell_rbu.txt b/Documentation/driver-api/dell_rbu.rst
index 5d1ce7bcd04d..5d1ce7bcd04d 100644
--- a/Documentation/dell_rbu.txt
+++ b/Documentation/driver-api/dell_rbu.rst
diff --git a/Documentation/driver-model/binding.rst b/Documentation/driver-api/driver-model/binding.rst
index 7ea1d7a41e1d..7ea1d7a41e1d 100644
--- a/Documentation/driver-model/binding.rst
+++ b/Documentation/driver-api/driver-model/binding.rst
diff --git a/Documentation/driver-model/bus.rst b/Documentation/driver-api/driver-model/bus.rst
index 016b15a6e8ea..016b15a6e8ea 100644
--- a/Documentation/driver-model/bus.rst
+++ b/Documentation/driver-api/driver-model/bus.rst
diff --git a/Documentation/driver-model/class.rst b/Documentation/driver-api/driver-model/class.rst
index fff55b80e86a..fff55b80e86a 100644
--- a/Documentation/driver-model/class.rst
+++ b/Documentation/driver-api/driver-model/class.rst
diff --git a/Documentation/driver-model/design-patterns.rst b/Documentation/driver-api/driver-model/design-patterns.rst
index 41eb8f41f7dd..41eb8f41f7dd 100644
--- a/Documentation/driver-model/design-patterns.rst
+++ b/Documentation/driver-api/driver-model/design-patterns.rst
diff --git a/Documentation/driver-model/device.rst b/Documentation/driver-api/driver-model/device.rst
index 2b868d49d349..2b868d49d349 100644
--- a/Documentation/driver-model/device.rst
+++ b/Documentation/driver-api/driver-model/device.rst
diff --git a/Documentation/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 4ac99122b5f1..4ac99122b5f1 100644
--- a/Documentation/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
diff --git a/Documentation/driver-model/driver.rst b/Documentation/driver-api/driver-model/driver.rst
index 11d281506a04..11d281506a04 100644
--- a/Documentation/driver-model/driver.rst
+++ b/Documentation/driver-api/driver-model/driver.rst
diff --git a/Documentation/driver-model/index.rst b/Documentation/driver-api/driver-model/index.rst
index 9f85d579ce56..755016422269 100644
--- a/Documentation/driver-model/index.rst
+++ b/Documentation/driver-api/driver-model/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3============ 1============
4Driver Model 2Driver Model
5============ 3============
diff --git a/Documentation/driver-model/overview.rst b/Documentation/driver-api/driver-model/overview.rst
index d4d1e9b40e0c..d4d1e9b40e0c 100644
--- a/Documentation/driver-model/overview.rst
+++ b/Documentation/driver-api/driver-model/overview.rst
diff --git a/Documentation/driver-model/platform.rst b/Documentation/driver-api/driver-model/platform.rst
index 334dd4071ae4..334dd4071ae4 100644
--- a/Documentation/driver-model/platform.rst
+++ b/Documentation/driver-api/driver-model/platform.rst
diff --git a/Documentation/driver-model/porting.rst b/Documentation/driver-api/driver-model/porting.rst
index ae4bf843c1d6..931ea879af3f 100644
--- a/Documentation/driver-model/porting.rst
+++ b/Documentation/driver-api/driver-model/porting.rst
@@ -9,7 +9,7 @@ Patrick Mochel
9 9
10Overview 10Overview
11 11
12Please refer to `Documentation/driver-model/*.rst` for definitions of 12Please refer to `Documentation/driver-api/driver-model/*.rst` for definitions of
13various driver types and concepts. 13various driver types and concepts.
14 14
15Most of the work of porting devices drivers to the new model happens 15Most of the work of porting devices drivers to the new model happens
diff --git a/Documentation/early-userspace/buffer-format.txt b/Documentation/driver-api/early-userspace/buffer-format.rst
index e1fd7f9dad16..7f74e301fdf3 100644
--- a/Documentation/early-userspace/buffer-format.txt
+++ b/Documentation/driver-api/early-userspace/buffer-format.rst
@@ -1,8 +1,10 @@
1 initramfs buffer format 1=======================
2 ----------------------- 2initramfs buffer format
3=======================
3 4
4 Al Viro, H. Peter Anvin 5Al Viro, H. Peter Anvin
5 Last revision: 2002-01-13 6
7Last revision: 2002-01-13
6 8
7Starting with kernel 2.5.x, the old "initial ramdisk" protocol is 9Starting with kernel 2.5.x, the old "initial ramdisk" protocol is
8getting {replaced/complemented} with the new "initial ramfs" 10getting {replaced/complemented} with the new "initial ramfs"
@@ -18,7 +20,8 @@ archive can be compressed using gzip(1). One valid version of an
18initramfs buffer is thus a single .cpio.gz file. 20initramfs buffer is thus a single .cpio.gz file.
19 21
20The full format of the initramfs buffer is defined by the following 22The full format of the initramfs buffer is defined by the following
21grammar, where: 23grammar, where::
24
22 * is used to indicate "0 or more occurrences of" 25 * is used to indicate "0 or more occurrences of"
23 (|) indicates alternatives 26 (|) indicates alternatives
24 + indicates concatenation 27 + indicates concatenation
@@ -49,7 +52,9 @@ hexadecimal ASCII numbers fully padded with '0' on the left to the
49full width of the field, for example, the integer 4780 is represented 52full width of the field, for example, the integer 4780 is represented
50by the ASCII string "000012ac"): 53by the ASCII string "000012ac"):
51 54
55============= ================== ==============================================
52Field name Field size Meaning 56Field name Field size Meaning
57============= ================== ==============================================
53c_magic 6 bytes The string "070701" or "070702" 58c_magic 6 bytes The string "070701" or "070702"
54c_ino 8 bytes File inode number 59c_ino 8 bytes File inode number
55c_mode 8 bytes File mode and permissions 60c_mode 8 bytes File mode and permissions
@@ -65,6 +70,7 @@ c_rmin 8 bytes Minor part of device node reference
65c_namesize 8 bytes Length of filename, including final \0 70c_namesize 8 bytes Length of filename, including final \0
66c_chksum 8 bytes Checksum of data field if c_magic is 070702; 71c_chksum 8 bytes Checksum of data field if c_magic is 070702;
67 otherwise zero 72 otherwise zero
73============= ================== ==============================================
68 74
69The c_mode field matches the contents of st_mode returned by stat(2) 75The c_mode field matches the contents of st_mode returned by stat(2)
70on Linux, and encodes the file type and file permissions. 76on Linux, and encodes the file type and file permissions.
@@ -82,7 +88,8 @@ If the filename is "TRAILER!!!" this is actually an end-of-archive
82marker; the c_filesize for an end-of-archive marker must be zero. 88marker; the c_filesize for an end-of-archive marker must be zero.
83 89
84 90
85*** Handling of hard links 91Handling of hard links
92======================
86 93
87When a nondirectory with c_nlink > 1 is seen, the (c_maj,c_min,c_ino) 94When a nondirectory with c_nlink > 1 is seen, the (c_maj,c_min,c_ino)
88tuple is looked up in a tuple buffer. If not found, it is entered in 95tuple is looked up in a tuple buffer. If not found, it is entered in
diff --git a/Documentation/early-userspace/README b/Documentation/driver-api/early-userspace/early_userspace_support.rst
index 955d667dc87e..3deefb34046b 100644
--- a/Documentation/early-userspace/README
+++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst
@@ -1,3 +1,4 @@
1=======================
1Early userspace support 2Early userspace support
2======================= 3=======================
3 4
@@ -26,6 +27,7 @@ archive to be used as the image or have the kernel build process build
26the image from specifications. 27the image from specifications.
27 28
28CPIO ARCHIVE method 29CPIO ARCHIVE method
30-------------------
29 31
30You can create a cpio archive that contains the early userspace image. 32You can create a cpio archive that contains the early userspace image.
31Your cpio archive should be specified in CONFIG_INITRAMFS_SOURCE and it 33Your cpio archive should be specified in CONFIG_INITRAMFS_SOURCE and it
@@ -34,6 +36,7 @@ CONFIG_INITRAMFS_SOURCE and directory and file names are not allowed in
34combination with a cpio archive. 36combination with a cpio archive.
35 37
36IMAGE BUILDING method 38IMAGE BUILDING method
39---------------------
37 40
38The kernel build process can also build an early userspace image from 41The kernel build process can also build an early userspace image from
39source parts rather than supplying a cpio archive. This method provides 42source parts rather than supplying a cpio archive. This method provides
diff --git a/Documentation/driver-api/early-userspace/index.rst b/Documentation/driver-api/early-userspace/index.rst
new file mode 100644
index 000000000000..149c1822f06d
--- /dev/null
+++ b/Documentation/driver-api/early-userspace/index.rst
@@ -0,0 +1,18 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===============
4Early Userspace
5===============
6
7.. toctree::
8 :maxdepth: 1
9
10 early_userspace_support
11 buffer-format
12
13.. only:: subproject and html
14
15 Indices
16 =======
17
18 * :ref:`genindex`
diff --git a/Documentation/EDID/howto.rst b/Documentation/driver-api/edid.rst
index 725fd49a88ca..b1b5acd501ed 100644
--- a/Documentation/EDID/howto.rst
+++ b/Documentation/driver-api/edid.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3==== 3====
4EDID 4EDID
diff --git a/Documentation/eisa.txt b/Documentation/driver-api/eisa.rst
index f388545a85a7..c07565ba57da 100644
--- a/Documentation/eisa.txt
+++ b/Documentation/driver-api/eisa.rst
@@ -103,7 +103,7 @@ id_table an array of NULL terminated EISA id strings,
103 (driver_data). 103 (driver_data).
104 104
105driver a generic driver, such as described in 105driver a generic driver, such as described in
106 Documentation/driver-model/driver.rst. Only .name, 106 Documentation/driver-api/driver-model/driver.rst. Only .name,
107 .probe and .remove members are mandatory. 107 .probe and .remove members are mandatory.
108=============== ==================================================== 108=============== ====================================================
109 109
@@ -152,7 +152,7 @@ state set of flags indicating the state of the device. Current
152 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED. 152 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED.
153res set of four 256 bytes I/O regions allocated to this device 153res set of four 256 bytes I/O regions allocated to this device
154dma_mask DMA mask set from the parent device. 154dma_mask DMA mask set from the parent device.
155dev generic device (see Documentation/driver-model/device.rst) 155dev generic device (see Documentation/driver-api/driver-model/device.rst)
156======== ============================================================ 156======== ============================================================
157 157
158You can get the 'struct eisa_device' from 'struct device' using the 158You can get the 'struct eisa_device' from 'struct device' using the
diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst
index 349f2dc33029..921c71a3d683 100644
--- a/Documentation/driver-api/gpio/driver.rst
+++ b/Documentation/driver-api/gpio/driver.rst
@@ -399,7 +399,7 @@ symbol:
399 will pass the struct gpio_chip* for the chip to all IRQ callbacks, so the 399 will pass the struct gpio_chip* for the chip to all IRQ callbacks, so the
400 callbacks need to embed the gpio_chip in its state container and obtain a 400 callbacks need to embed the gpio_chip in its state container and obtain a
401 pointer to the container using container_of(). 401 pointer to the container using container_of().
402 (See Documentation/driver-model/design-patterns.rst) 402 (See Documentation/driver-api/driver-model/design-patterns.rst)
403 403
404- gpiochip_irqchip_add_nested(): adds a nested cascaded irqchip to a gpiochip, 404- gpiochip_irqchip_add_nested(): adds a nested cascaded irqchip to a gpiochip,
405 as discussed above regarding different types of cascaded irqchips. The 405 as discussed above regarding different types of cascaded irqchips. The
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst
index 6cd750a03ea0..d12a80f386a6 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -14,8 +14,10 @@ available subsections can be seen below.
14.. toctree:: 14.. toctree::
15 :maxdepth: 2 15 :maxdepth: 2
16 16
17 driver-model/index
17 basics 18 basics
18 infrastructure 19 infrastructure
20 early-userspace/index
19 pm/index 21 pm/index
20 clk 22 clk
21 device-io 23 device-io
@@ -36,6 +38,7 @@ available subsections can be seen below.
36 i2c 38 i2c
37 ipmb 39 ipmb
38 i3c/index 40 i3c/index
41 interconnect
39 hsi 42 hsi
40 edac 43 edac
41 scsi 44 scsi
@@ -44,8 +47,11 @@ available subsections can be seen below.
44 mtdnand 47 mtdnand
45 miscellaneous 48 miscellaneous
46 mei/index 49 mei/index
50 mtd/index
51 mmc/index
52 nvdimm/index
47 w1 53 w1
48 rapidio 54 rapidio/index
49 s390-drivers 55 s390-drivers
50 vme 56 vme
51 80211/index 57 80211/index
@@ -53,13 +59,48 @@ available subsections can be seen below.
53 firmware/index 59 firmware/index
54 pinctl 60 pinctl
55 gpio/index 61 gpio/index
62 md/index
56 misc_devices 63 misc_devices
64 nfc/index
57 dmaengine/index 65 dmaengine/index
58 slimbus 66 slimbus
59 soundwire/index 67 soundwire/index
60 fpga/index 68 fpga/index
61 acpi/index 69 acpi/index
70 backlight/lp855x-driver.rst
71 bt8xxgpio
72 connector
73 console
74 dcdbas
75 dell_rbu
76 edid
77 eisa
78 isa
79 isapnp
62 generic-counter 80 generic-counter
81 lightnvm-pblk
82 memory-devices/index
83 men-chameleon-bus
84 ntb
85 nvmem
86 parport-lowlevel
87 pps
88 ptp
89 phy/index
90 pti_intel_mid
91 pwm
92 rfkill
93 serial/index
94 sgi-ioc4
95 sm501
96 smsc_ece1099
97 switchtec
98 sync_file
99 vfio-mediated-device
100 vfio
101 xilinx/index
102 xillybus
103 zorro
63 104
64.. only:: subproject and html 105.. only:: subproject and html
65 106
diff --git a/Documentation/interconnect/interconnect.rst b/Documentation/driver-api/interconnect.rst
index 56e331dab70e..c3e004893796 100644
--- a/Documentation/interconnect/interconnect.rst
+++ b/Documentation/driver-api/interconnect.rst
@@ -1,7 +1,5 @@
1.. SPDX-License-Identifier: GPL-2.0 1.. SPDX-License-Identifier: GPL-2.0
2 2
3:orphan:
4
5===================================== 3=====================================
6GENERIC SYSTEM INTERCONNECT SUBSYSTEM 4GENERIC SYSTEM INTERCONNECT SUBSYSTEM
7===================================== 5=====================================
diff --git a/Documentation/isa.txt b/Documentation/driver-api/isa.rst
index def4a7b690b5..def4a7b690b5 100644
--- a/Documentation/isa.txt
+++ b/Documentation/driver-api/isa.rst
diff --git a/Documentation/isapnp.txt b/Documentation/driver-api/isapnp.rst
index 8d0840ac847b..8d0840ac847b 100644
--- a/Documentation/isapnp.txt
+++ b/Documentation/driver-api/isapnp.rst
diff --git a/Documentation/lightnvm/pblk.txt b/Documentation/driver-api/lightnvm-pblk.rst
index 1040ed1cec81..1040ed1cec81 100644
--- a/Documentation/lightnvm/pblk.txt
+++ b/Documentation/driver-api/lightnvm-pblk.rst
diff --git a/Documentation/driver-api/md/index.rst b/Documentation/driver-api/md/index.rst
new file mode 100644
index 000000000000..18f54a7d7d6e
--- /dev/null
+++ b/Documentation/driver-api/md/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3====
4RAID
5====
6
7.. toctree::
8 :maxdepth: 1
9
10 md-cluster
11 raid5-cache
12 raid5-ppl
diff --git a/Documentation/md/md-cluster.txt b/Documentation/driver-api/md/md-cluster.rst
index e1055f105cf5..96eb52cec7eb 100644
--- a/Documentation/md/md-cluster.txt
+++ b/Documentation/driver-api/md/md-cluster.rst
@@ -1,19 +1,24 @@
1==========
2MD Cluster
3==========
4
1The cluster MD is a shared-device RAID for a cluster, it supports 5The cluster MD is a shared-device RAID for a cluster, it supports
2two levels: raid1 and raid10 (limited support). 6two levels: raid1 and raid10 (limited support).
3 7
4 8
51. On-disk format 91. On-disk format
10=================
6 11
7Separate write-intent-bitmaps are used for each cluster node. 12Separate write-intent-bitmaps are used for each cluster node.
8The bitmaps record all writes that may have been started on that node, 13The bitmaps record all writes that may have been started on that node,
9and may not yet have finished. The on-disk layout is: 14and may not yet have finished. The on-disk layout is::
10 15
110 4k 8k 12k 16 0 4k 8k 12k
12------------------------------------------------------------------- 17 -------------------------------------------------------------------
13| idle | md super | bm super [0] + bits | 18 | idle | md super | bm super [0] + bits |
14| bm bits[0, contd] | bm super[1] + bits | bm bits[1, contd] | 19 | bm bits[0, contd] | bm super[1] + bits | bm bits[1, contd] |
15| bm super[2] + bits | bm bits [2, contd] | bm super[3] + bits | 20 | bm super[2] + bits | bm bits [2, contd] | bm super[3] + bits |
16| bm bits [3, contd] | | | 21 | bm bits [3, contd] | | |
17 22
18During "normal" functioning we assume the filesystem ensures that only 23During "normal" functioning we assume the filesystem ensures that only
19one node writes to any given block at a time, so a write request will 24one node writes to any given block at a time, so a write request will
@@ -28,10 +33,12 @@ node) is writing.
28 33
29 34
302. DLM Locks for management 352. DLM Locks for management
36===========================
31 37
32There are three groups of locks for managing the device: 38There are three groups of locks for managing the device:
33 39
342.1 Bitmap lock resource (bm_lockres) 402.1 Bitmap lock resource (bm_lockres)
41-------------------------------------
35 42
36 The bm_lockres protects individual node bitmaps. They are named in 43 The bm_lockres protects individual node bitmaps. They are named in
37 the form bitmap000 for node 1, bitmap001 for node 2 and so on. When a 44 the form bitmap000 for node 1, bitmap001 for node 2 and so on. When a
@@ -48,6 +55,7 @@ There are three groups of locks for managing the device:
48 joins the cluster. 55 joins the cluster.
49 56
502.2 Message passing locks 572.2 Message passing locks
58-------------------------
51 59
52 Each node has to communicate with other nodes when starting or ending 60 Each node has to communicate with other nodes when starting or ending
53 resync, and for metadata superblock updates. This communication is 61 resync, and for metadata superblock updates. This communication is
@@ -55,116 +63,155 @@ There are three groups of locks for managing the device:
55 with the Lock Value Block (LVB) of one of the "message" lock. 63 with the Lock Value Block (LVB) of one of the "message" lock.
56 64
572.3 new-device management 652.3 new-device management
66-------------------------
58 67
59 A single lock: "no-new-dev" is used to co-ordinate the addition of 68 A single lock: "no-new-dev" is used to co-ordinate the addition of
60 new devices - this must be synchronized across the array. 69 new devices - this must be synchronized across the array.
61 Normally all nodes hold a concurrent-read lock on this device. 70 Normally all nodes hold a concurrent-read lock on this device.
62 71
633. Communication 723. Communication
73================
64 74
65 Messages can be broadcast to all nodes, and the sender waits for all 75 Messages can be broadcast to all nodes, and the sender waits for all
66 other nodes to acknowledge the message before proceeding. Only one 76 other nodes to acknowledge the message before proceeding. Only one
67 message can be processed at a time. 77 message can be processed at a time.
68 78
693.1 Message Types 793.1 Message Types
80-----------------
70 81
71 There are six types of messages which are passed: 82 There are six types of messages which are passed:
72 83
73 3.1.1 METADATA_UPDATED: informs other nodes that the metadata has 843.1.1 METADATA_UPDATED
85^^^^^^^^^^^^^^^^^^^^^^
86
87 informs other nodes that the metadata has
74 been updated, and the node must re-read the md superblock. This is 88 been updated, and the node must re-read the md superblock. This is
75 performed synchronously. It is primarily used to signal device 89 performed synchronously. It is primarily used to signal device
76 failure. 90 failure.
77 91
78 3.1.2 RESYNCING: informs other nodes that a resync is initiated or 923.1.2 RESYNCING
93^^^^^^^^^^^^^^^
94 informs other nodes that a resync is initiated or
79 ended so that each node may suspend or resume the region. Each 95 ended so that each node may suspend or resume the region. Each
80 RESYNCING message identifies a range of the devices that the 96 RESYNCING message identifies a range of the devices that the
81 sending node is about to resync. This overrides any previous 97 sending node is about to resync. This overrides any previous
82 notification from that node: only one ranged can be resynced at a 98 notification from that node: only one ranged can be resynced at a
83 time per-node. 99 time per-node.
84 100
85 3.1.3 NEWDISK: informs other nodes that a device is being added to 1013.1.3 NEWDISK
102^^^^^^^^^^^^^
103
104 informs other nodes that a device is being added to
86 the array. Message contains an identifier for that device. See 105 the array. Message contains an identifier for that device. See
87 below for further details. 106 below for further details.
88 107
89 3.1.4 REMOVE: A failed or spare device is being removed from the 1083.1.4 REMOVE
109^^^^^^^^^^^^
110
111 A failed or spare device is being removed from the
90 array. The slot-number of the device is included in the message. 112 array. The slot-number of the device is included in the message.
91 113
92 3.1.5 RE_ADD: A failed device is being re-activated - the assumption 114 3.1.5 RE_ADD:
115
116 A failed device is being re-activated - the assumption
93 is that it has been determined to be working again. 117 is that it has been determined to be working again.
94 118
95 3.1.6 BITMAP_NEEDS_SYNC: if a node is stopped locally but the bitmap 119 3.1.6 BITMAP_NEEDS_SYNC:
120
121 If a node is stopped locally but the bitmap
96 isn't clean, then another node is informed to take the ownership of 122 isn't clean, then another node is informed to take the ownership of
97 resync. 123 resync.
98 124
993.2 Communication mechanism 1253.2 Communication mechanism
126---------------------------
100 127
101 The DLM LVB is used to communicate within nodes of the cluster. There 128 The DLM LVB is used to communicate within nodes of the cluster. There
102 are three resources used for the purpose: 129 are three resources used for the purpose:
103 130
104 3.2.1 token: The resource which protects the entire communication 1313.2.1 token
132^^^^^^^^^^^
133 The resource which protects the entire communication
105 system. The node having the token resource is allowed to 134 system. The node having the token resource is allowed to
106 communicate. 135 communicate.
107 136
108 3.2.2 message: The lock resource which carries the data to 1373.2.2 message
109 communicate. 138^^^^^^^^^^^^^
139 The lock resource which carries the data to communicate.
110 140
111 3.2.3 ack: The resource, acquiring which means the message has been 1413.2.3 ack
142^^^^^^^^^
143
144 The resource, acquiring which means the message has been
112 acknowledged by all nodes in the cluster. The BAST of the resource 145 acknowledged by all nodes in the cluster. The BAST of the resource
113 is used to inform the receiving node that a node wants to 146 is used to inform the receiving node that a node wants to
114 communicate. 147 communicate.
115 148
116The algorithm is: 149The algorithm is:
117 150
118 1. receive status - all nodes have concurrent-reader lock on "ack". 151 1. receive status - all nodes have concurrent-reader lock on "ack"::
152
153 sender receiver receiver
154 "ack":CR "ack":CR "ack":CR
119 155
120 sender receiver receiver 156 2. sender get EX on "token",
121 "ack":CR "ack":CR "ack":CR 157 sender get EX on "message"::
122 158
123 2. sender get EX on "token" 159 sender receiver receiver
124 sender get EX on "message" 160 "token":EX "ack":CR "ack":CR
125 sender receiver receiver 161 "message":EX
126 "token":EX "ack":CR "ack":CR 162 "ack":CR
127 "message":EX
128 "ack":CR
129 163
130 Sender checks that it still needs to send a message. Messages 164 Sender checks that it still needs to send a message. Messages
131 received or other events that happened while waiting for the 165 received or other events that happened while waiting for the
132 "token" may have made this message inappropriate or redundant. 166 "token" may have made this message inappropriate or redundant.
133 167
134 3. sender writes LVB. 168 3. sender writes LVB
169
135 sender down-convert "message" from EX to CW 170 sender down-convert "message" from EX to CW
171
136 sender try to get EX of "ack" 172 sender try to get EX of "ack"
137 [ wait until all receivers have *processed* the "message" ]
138 173
139 [ triggered by bast of "ack" ] 174 ::
140 receiver get CR on "message" 175
141 receiver read LVB 176 [ wait until all receivers have *processed* the "message" ]
142 receiver processes the message
143 [ wait finish ]
144 receiver releases "ack"
145 receiver tries to get PR on "message"
146 177
147 sender receiver receiver 178 [ triggered by bast of "ack" ]
148 "token":EX "message":CR "message":CR 179 receiver get CR on "message"
149 "message":CW 180 receiver read LVB
150 "ack":EX 181 receiver processes the message
182 [ wait finish ]
183 receiver releases "ack"
184 receiver tries to get PR on "message"
185
186 sender receiver receiver
187 "token":EX "message":CR "message":CR
188 "message":CW
189 "ack":EX
151 190
152 4. triggered by grant of EX on "ack" (indicating all receivers 191 4. triggered by grant of EX on "ack" (indicating all receivers
153 have processed message) 192 have processed message)
193
154 sender down-converts "ack" from EX to CR 194 sender down-converts "ack" from EX to CR
195
155 sender releases "message" 196 sender releases "message"
197
156 sender releases "token" 198 sender releases "token"
157 receiver upconvert to PR on "message"
158 receiver get CR of "ack"
159 receiver release "message"
160 199
161 sender receiver receiver 200 ::
162 "ack":CR "ack":CR "ack":CR 201
202 receiver upconvert to PR on "message"
203 receiver get CR of "ack"
204 receiver release "message"
205
206 sender receiver receiver
207 "ack":CR "ack":CR "ack":CR
163 208
164 209
1654. Handling Failures 2104. Handling Failures
211====================
166 212
1674.1 Node Failure 2134.1 Node Failure
214----------------
168 215
169 When a node fails, the DLM informs the cluster with the slot 216 When a node fails, the DLM informs the cluster with the slot
170 number. The node starts a cluster recovery thread. The cluster 217 number. The node starts a cluster recovery thread. The cluster
@@ -177,11 +224,11 @@ The algorithm is:
177 - cleans the bitmap of the failed node 224 - cleans the bitmap of the failed node
178 - releases bitmap<number> lock of the failed node 225 - releases bitmap<number> lock of the failed node
179 - initiates resync of the bitmap on the current node 226 - initiates resync of the bitmap on the current node
180 md_check_recovery is invoked within recover_bitmaps, 227 md_check_recovery is invoked within recover_bitmaps,
181 then md_check_recovery -> metadata_update_start/finish, 228 then md_check_recovery -> metadata_update_start/finish,
182 it will lock the communication by lock_comm. 229 it will lock the communication by lock_comm.
183 Which means when one node is resyncing it blocks all 230 Which means when one node is resyncing it blocks all
184 other nodes from writing anywhere on the array. 231 other nodes from writing anywhere on the array.
185 232
186 The resync process is the regular md resync. However, in a clustered 233 The resync process is the regular md resync. However, in a clustered
187 environment when a resync is performed, it needs to tell other nodes 234 environment when a resync is performed, it needs to tell other nodes
@@ -198,6 +245,7 @@ The algorithm is:
198 particular I/O range should be suspended or not. 245 particular I/O range should be suspended or not.
199 246
2004.2 Device Failure 2474.2 Device Failure
248==================
201 249
202 Device failures are handled and communicated with the metadata update 250 Device failures are handled and communicated with the metadata update
203 routine. When a node detects a device failure it does not allow 251 routine. When a node detects a device failure it does not allow
@@ -205,38 +253,41 @@ The algorithm is:
205 acknowledged by all other nodes. 253 acknowledged by all other nodes.
206 254
2075. Adding a new Device 2555. Adding a new Device
256----------------------
208 257
209 For adding a new device, it is necessary that all nodes "see" the new 258 For adding a new device, it is necessary that all nodes "see" the new
210 device to be added. For this, the following algorithm is used: 259 device to be added. For this, the following algorithm is used:
211 260
212 1. Node 1 issues mdadm --manage /dev/mdX --add /dev/sdYY which issues 261 1. Node 1 issues mdadm --manage /dev/mdX --add /dev/sdYY which issues
213 ioctl(ADD_NEW_DISK with disc.state set to MD_DISK_CLUSTER_ADD) 262 ioctl(ADD_NEW_DISK with disc.state set to MD_DISK_CLUSTER_ADD)
214 2. Node 1 sends a NEWDISK message with uuid and slot number 263 2. Node 1 sends a NEWDISK message with uuid and slot number
215 3. Other nodes issue kobject_uevent_env with uuid and slot number 264 3. Other nodes issue kobject_uevent_env with uuid and slot number
216 (Steps 4,5 could be a udev rule) 265 (Steps 4,5 could be a udev rule)
217 4. In userspace, the node searches for the disk, perhaps 266 4. In userspace, the node searches for the disk, perhaps
218 using blkid -t SUB_UUID="" 267 using blkid -t SUB_UUID=""
219 5. Other nodes issue either of the following depending on whether 268 5. Other nodes issue either of the following depending on whether
220 the disk was found: 269 the disk was found:
221 ioctl(ADD_NEW_DISK with disc.state set to MD_DISK_CANDIDATE and 270 ioctl(ADD_NEW_DISK with disc.state set to MD_DISK_CANDIDATE and
222 disc.number set to slot number) 271 disc.number set to slot number)
223 ioctl(CLUSTERED_DISK_NACK) 272 ioctl(CLUSTERED_DISK_NACK)
224 6. Other nodes drop lock on "no-new-devs" (CR) if device is found 273 6. Other nodes drop lock on "no-new-devs" (CR) if device is found
225 7. Node 1 attempts EX lock on "no-new-dev" 274 7. Node 1 attempts EX lock on "no-new-dev"
226 8. If node 1 gets the lock, it sends METADATA_UPDATED after 275 8. If node 1 gets the lock, it sends METADATA_UPDATED after
227 unmarking the disk as SpareLocal 276 unmarking the disk as SpareLocal
228 9. If not (get "no-new-dev" lock), it fails the operation and sends 277 9. If not (get "no-new-dev" lock), it fails the operation and sends
229 METADATA_UPDATED. 278 METADATA_UPDATED.
230 10. Other nodes get the information whether a disk is added or not 279 10. Other nodes get the information whether a disk is added or not
231 by the following METADATA_UPDATED. 280 by the following METADATA_UPDATED.
232 281
2336. Module interface. 2826. Module interface
283===================
234 284
235 There are 17 call-backs which the md core can make to the cluster 285 There are 17 call-backs which the md core can make to the cluster
236 module. Understanding these can give a good overview of the whole 286 module. Understanding these can give a good overview of the whole
237 process. 287 process.
238 288
2396.1 join(nodes) and leave() 2896.1 join(nodes) and leave()
290---------------------------
240 291
241 These are called when an array is started with a clustered bitmap, 292 These are called when an array is started with a clustered bitmap,
242 and when the array is stopped. join() ensures the cluster is 293 and when the array is stopped. join() ensures the cluster is
@@ -244,11 +295,13 @@ The algorithm is:
244 Only the first 'nodes' nodes in the cluster can use the array. 295 Only the first 'nodes' nodes in the cluster can use the array.
245 296
2466.2 slot_number() 2976.2 slot_number()
298-----------------
247 299
248 Reports the slot number advised by the cluster infrastructure. 300 Reports the slot number advised by the cluster infrastructure.
249 Range is from 0 to nodes-1. 301 Range is from 0 to nodes-1.
250 302
2516.3 resync_info_update() 3036.3 resync_info_update()
304------------------------
252 305
253 This updates the resync range that is stored in the bitmap lock. 306 This updates the resync range that is stored in the bitmap lock.
254 The starting point is updated as the resync progresses. The 307 The starting point is updated as the resync progresses. The
@@ -256,6 +309,7 @@ The algorithm is:
256 It does *not* send a RESYNCING message. 309 It does *not* send a RESYNCING message.
257 310
2586.4 resync_start(), resync_finish() 3116.4 resync_start(), resync_finish()
312-----------------------------------
259 313
260 These are called when resync/recovery/reshape starts or stops. 314 These are called when resync/recovery/reshape starts or stops.
261 They update the resyncing range in the bitmap lock and also 315 They update the resyncing range in the bitmap lock and also
@@ -265,8 +319,8 @@ The algorithm is:
265 resync_finish() also sends a BITMAP_NEEDS_SYNC message which 319 resync_finish() also sends a BITMAP_NEEDS_SYNC message which
266 allows some other node to take over. 320 allows some other node to take over.
267 321
2686.5 metadata_update_start(), metadata_update_finish(), 3226.5 metadata_update_start(), metadata_update_finish(), metadata_update_cancel()
269 metadata_update_cancel(). 323-------------------------------------------------------------------------------
270 324
271 metadata_update_start is used to get exclusive access to 325 metadata_update_start is used to get exclusive access to
272 the metadata. If a change is still needed once that access is 326 the metadata. If a change is still needed once that access is
@@ -275,6 +329,7 @@ The algorithm is:
275 can be used to release the lock. 329 can be used to release the lock.
276 330
2776.6 area_resyncing() 3316.6 area_resyncing()
332--------------------
278 333
279 This combines two elements of functionality. 334 This combines two elements of functionality.
280 335
@@ -289,6 +344,7 @@ The algorithm is:
289 a node failure. 344 a node failure.
290 345
2916.7 add_new_disk_start(), add_new_disk_finish(), new_disk_ack() 3466.7 add_new_disk_start(), add_new_disk_finish(), new_disk_ack()
347---------------------------------------------------------------
292 348
293 These are used to manage the new-disk protocol described above. 349 These are used to manage the new-disk protocol described above.
294 When a new device is added, add_new_disk_start() is called before 350 When a new device is added, add_new_disk_start() is called before
@@ -300,17 +356,20 @@ The algorithm is:
300 new_disk_ack() is called. 356 new_disk_ack() is called.
301 357
3026.8 remove_disk() 3586.8 remove_disk()
359-----------------
303 360
304 This is called when a spare or failed device is removed from 361 This is called when a spare or failed device is removed from
305 the array. It causes a REMOVE message to be send to other nodes. 362 the array. It causes a REMOVE message to be send to other nodes.
306 363
3076.9 gather_bitmaps() 3646.9 gather_bitmaps()
365--------------------
308 366
309 This sends a RE_ADD message to all other nodes and then 367 This sends a RE_ADD message to all other nodes and then
310 gathers bitmap information from all bitmaps. This combined 368 gathers bitmap information from all bitmaps. This combined
311 bitmap is then used to recovery the re-added device. 369 bitmap is then used to recovery the re-added device.
312 370
3136.10 lock_all_bitmaps() and unlock_all_bitmaps() 3716.10 lock_all_bitmaps() and unlock_all_bitmaps()
372------------------------------------------------
314 373
315 These are called when change bitmap to none. If a node plans 374 These are called when change bitmap to none. If a node plans
316 to clear the cluster raid's bitmap, it need to make sure no other 375 to clear the cluster raid's bitmap, it need to make sure no other
@@ -319,6 +378,7 @@ The algorithm is:
319 accordingly. 378 accordingly.
320 379
3217. Unsupported features 3807. Unsupported features
381=======================
322 382
323There are somethings which are not supported by cluster MD yet. 383There are somethings which are not supported by cluster MD yet.
324 384
diff --git a/Documentation/md/raid5-cache.txt b/Documentation/driver-api/md/raid5-cache.rst
index 2b210f295786..d7a15f44a7c3 100644
--- a/Documentation/md/raid5-cache.txt
+++ b/Documentation/driver-api/md/raid5-cache.rst
@@ -1,4 +1,6 @@
1RAID5 cache 1================
2RAID 4/5/6 cache
3================
2 4
3Raid 4/5/6 could include an extra disk for data cache besides normal RAID 5Raid 4/5/6 could include an extra disk for data cache besides normal RAID
4disks. The role of RAID disks isn't changed with the cache disk. The cache disk 6disks. The role of RAID disks isn't changed with the cache disk. The cache disk
@@ -6,19 +8,19 @@ caches data to the RAID disks. The cache can be in write-through (supported
6since 4.4) or write-back mode (supported since 4.10). mdadm (supported since 8since 4.4) or write-back mode (supported since 4.10). mdadm (supported since
73.4) has a new option '--write-journal' to create array with cache. Please 93.4) has a new option '--write-journal' to create array with cache. Please
8refer to mdadm manual for details. By default (RAID array starts), the cache is 10refer to mdadm manual for details. By default (RAID array starts), the cache is
9in write-through mode. A user can switch it to write-back mode by: 11in write-through mode. A user can switch it to write-back mode by::
10 12
11echo "write-back" > /sys/block/md0/md/journal_mode 13 echo "write-back" > /sys/block/md0/md/journal_mode
12 14
13And switch it back to write-through mode by: 15And switch it back to write-through mode by::
14 16
15echo "write-through" > /sys/block/md0/md/journal_mode 17 echo "write-through" > /sys/block/md0/md/journal_mode
16 18
17In both modes, all writes to the array will hit cache disk first. This means 19In both modes, all writes to the array will hit cache disk first. This means
18the cache disk must be fast and sustainable. 20the cache disk must be fast and sustainable.
19 21
20------------------------------------- 22write-through mode
21write-through mode: 23==================
22 24
23This mode mainly fixes the 'write hole' issue. For RAID 4/5/6 array, an unclean 25This mode mainly fixes the 'write hole' issue. For RAID 4/5/6 array, an unclean
24shutdown can cause data in some stripes to not be in consistent state, eg, data 26shutdown can cause data in some stripes to not be in consistent state, eg, data
@@ -42,8 +44,8 @@ exposed to 'write hole' again.
42In write-through mode, the cache disk isn't required to be big. Several 44In write-through mode, the cache disk isn't required to be big. Several
43hundreds megabytes are enough. 45hundreds megabytes are enough.
44 46
45-------------------------------------- 47write-back mode
46write-back mode: 48===============
47 49
48write-back mode fixes the 'write hole' issue too, since all write data is 50write-back mode fixes the 'write hole' issue too, since all write data is
49cached on cache disk. But the main goal of 'write-back' cache is to speed up 51cached on cache disk. But the main goal of 'write-back' cache is to speed up
@@ -64,16 +66,16 @@ data loss.
64In write-back mode, MD also caches data in memory. The memory cache includes 66In write-back mode, MD also caches data in memory. The memory cache includes
65the same data stored on cache disk, so a power loss doesn't cause data loss. 67the same data stored on cache disk, so a power loss doesn't cause data loss.
66The memory cache size has performance impact for the array. It's recommended 68The memory cache size has performance impact for the array. It's recommended
67the size is big. A user can configure the size by: 69the size is big. A user can configure the size by::
68 70
69echo "2048" > /sys/block/md0/md/stripe_cache_size 71 echo "2048" > /sys/block/md0/md/stripe_cache_size
70 72
71Too small cache disk will make the write aggregation less efficient in this 73Too small cache disk will make the write aggregation less efficient in this
72mode depending on the workloads. It's recommended to use a cache disk with at 74mode depending on the workloads. It's recommended to use a cache disk with at
73least several gigabytes size in write-back mode. 75least several gigabytes size in write-back mode.
74 76
75-------------------------------------- 77The implementation
76The implementation: 78==================
77 79
78The write-through and write-back cache use the same disk format. The cache disk 80The write-through and write-back cache use the same disk format. The cache disk
79is organized as a simple write log. The log consists of 'meta data' and 'data' 81is organized as a simple write log. The log consists of 'meta data' and 'data'
diff --git a/Documentation/md/raid5-ppl.txt b/Documentation/driver-api/md/raid5-ppl.rst
index bfa092589e00..357e5515bc55 100644
--- a/Documentation/md/raid5-ppl.txt
+++ b/Documentation/driver-api/md/raid5-ppl.rst
@@ -1,4 +1,6 @@
1==================
1Partial Parity Log 2Partial Parity Log
3==================
2 4
3Partial Parity Log (PPL) is a feature available for RAID5 arrays. The issue 5Partial Parity Log (PPL) is a feature available for RAID5 arrays. The issue
4addressed by PPL is that after a dirty shutdown, parity of a particular stripe 6addressed by PPL is that after a dirty shutdown, parity of a particular stripe
diff --git a/Documentation/driver-api/memory-devices/index.rst b/Documentation/driver-api/memory-devices/index.rst
new file mode 100644
index 000000000000..28101458cda5
--- /dev/null
+++ b/Documentation/driver-api/memory-devices/index.rst
@@ -0,0 +1,18 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=========================
4Memory Controller drivers
5=========================
6
7.. toctree::
8 :maxdepth: 1
9
10 ti-emif
11 ti-gpmc
12
13.. only:: subproject and html
14
15 Indices
16 =======
17
18 * :ref:`genindex`
diff --git a/Documentation/memory-devices/ti-emif.txt b/Documentation/driver-api/memory-devices/ti-emif.rst
index f4ad9a7d0f4b..dea2ad9bcd7e 100644
--- a/Documentation/memory-devices/ti-emif.txt
+++ b/Documentation/driver-api/memory-devices/ti-emif.rst
@@ -1,20 +1,24 @@
1TI EMIF SDRAM Controller Driver: 1.. SPDX-License-Identifier: GPL-2.0
2
3===============================
4TI EMIF SDRAM Controller Driver
5===============================
2 6
3Author 7Author
4======== 8======
5Aneesh V <aneesh@ti.com> 9Aneesh V <aneesh@ti.com>
6 10
7Location 11Location
8============ 12========
9driver/memory/emif.c 13driver/memory/emif.c
10 14
11Supported SoCs: 15Supported SoCs:
12=================== 16===============
13TI OMAP44xx 17TI OMAP44xx
14TI OMAP54xx 18TI OMAP54xx
15 19
16Menuconfig option: 20Menuconfig option:
17========================== 21==================
18Device Drivers 22Device Drivers
19 Memory devices 23 Memory devices
20 Texas Instruments EMIF driver 24 Texas Instruments EMIF driver
@@ -29,10 +33,11 @@ functions of the driver includes re-configuring AC timing
29parameters and other settings during frequency, voltage and 33parameters and other settings during frequency, voltage and
30temperature changes 34temperature changes
31 35
32Platform Data (see include/linux/platform_data/emif_plat.h): 36Platform Data (see include/linux/platform_data/emif_plat.h)
33===================================================================== 37===========================================================
34DDR device details and other board dependent and SoC dependent 38DDR device details and other board dependent and SoC dependent
35information can be passed through platform data (struct emif_platform_data) 39information can be passed through platform data (struct emif_platform_data)
40
36- DDR device details: 'struct ddr_device_info' 41- DDR device details: 'struct ddr_device_info'
37- Device AC timings: 'struct lpddr2_timings' and 'struct lpddr2_min_tck' 42- Device AC timings: 'struct lpddr2_timings' and 'struct lpddr2_min_tck'
38- Custom configurations: customizable policy options through 43- Custom configurations: customizable policy options through
@@ -40,17 +45,19 @@ information can be passed through platform data (struct emif_platform_data)
40- IP revision 45- IP revision
41- PHY type 46- PHY type
42 47
43Interface to the external world: 48Interface to the external world
44================================ 49===============================
45EMIF driver registers notifiers for voltage and frequency changes 50EMIF driver registers notifiers for voltage and frequency changes
46affecting EMIF and takes appropriate actions when these are invoked. 51affecting EMIF and takes appropriate actions when these are invoked.
52
47- freq_pre_notify_handling() 53- freq_pre_notify_handling()
48- freq_post_notify_handling() 54- freq_post_notify_handling()
49- volt_notify_handling() 55- volt_notify_handling()
50 56
51Debugfs 57Debugfs
52======== 58=======
53The driver creates two debugfs entries per device. 59The driver creates two debugfs entries per device.
60
54- regcache_dump : dump of register values calculated and saved for all 61- regcache_dump : dump of register values calculated and saved for all
55 frequencies used so far. 62 frequencies used so far.
56- mr4 : last polled value of MR4 register in the LPDDR2 device. MR4 63- mr4 : last polled value of MR4 register in the LPDDR2 device. MR4
diff --git a/Documentation/bus-devices/ti-gpmc.txt b/Documentation/driver-api/memory-devices/ti-gpmc.rst
index cc9ce57e0a26..33efcb81f080 100644
--- a/Documentation/bus-devices/ti-gpmc.txt
+++ b/Documentation/driver-api/memory-devices/ti-gpmc.rst
@@ -1,8 +1,12 @@
1GPMC (General Purpose Memory Controller): 1.. SPDX-License-Identifier: GPL-2.0
2========================================= 2
3========================================
4GPMC (General Purpose Memory Controller)
5========================================
3 6
4GPMC is an unified memory controller dedicated to interfacing external 7GPMC is an unified memory controller dedicated to interfacing external
5memory devices like 8memory devices like
9
6 * Asynchronous SRAM like memories and application specific integrated 10 * Asynchronous SRAM like memories and application specific integrated
7 circuit devices. 11 circuit devices.
8 * Asynchronous, synchronous, and page mode burst NOR flash devices 12 * Asynchronous, synchronous, and page mode burst NOR flash devices
@@ -48,75 +52,128 @@ most of the datasheets & hardware (to be exact none of those supported
48in mainline having custom timing routine) and by simulation. 52in mainline having custom timing routine) and by simulation.
49 53
50gpmc timing dependency on peripheral timings: 54gpmc timing dependency on peripheral timings:
55
51[<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...] 56[<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...]
52 57
531. common 581. common
54cs_on: t_ceasu 59
55adv_on: t_avdasu, t_ceavd 60cs_on:
61 t_ceasu
62adv_on:
63 t_avdasu, t_ceavd
56 64
572. sync common 652. sync common
58sync_clk: clk 66
59page_burst_access: t_bacc 67sync_clk:
60clk_activation: t_ces, t_avds 68 clk
69page_burst_access:
70 t_bacc
71clk_activation:
72 t_ces, t_avds
61 73
623. read async muxed 743. read async muxed
63adv_rd_off: t_avdp_r 75
64oe_on: t_oeasu, t_aavdh 76adv_rd_off:
65access: t_iaa, t_oe, t_ce, t_aa 77 t_avdp_r
66rd_cycle: t_rd_cycle, t_cez_r, t_oez 78oe_on:
79 t_oeasu, t_aavdh
80access:
81 t_iaa, t_oe, t_ce, t_aa
82rd_cycle:
83 t_rd_cycle, t_cez_r, t_oez
67 84
684. read async non-muxed 854. read async non-muxed
69adv_rd_off: t_avdp_r 86
70oe_on: t_oeasu 87adv_rd_off:
71access: t_iaa, t_oe, t_ce, t_aa 88 t_avdp_r
72rd_cycle: t_rd_cycle, t_cez_r, t_oez 89oe_on:
90 t_oeasu
91access:
92 t_iaa, t_oe, t_ce, t_aa
93rd_cycle:
94 t_rd_cycle, t_cez_r, t_oez
73 95
745. read sync muxed 965. read sync muxed
75adv_rd_off: t_avdp_r, t_avdh 97
76oe_on: t_oeasu, t_ach, cyc_aavdh_oe 98adv_rd_off:
77access: t_iaa, cyc_iaa, cyc_oe 99 t_avdp_r, t_avdh
78rd_cycle: t_cez_r, t_oez, t_ce_rdyz 100oe_on:
101 t_oeasu, t_ach, cyc_aavdh_oe
102access:
103 t_iaa, cyc_iaa, cyc_oe
104rd_cycle:
105 t_cez_r, t_oez, t_ce_rdyz
79 106
806. read sync non-muxed 1076. read sync non-muxed
81adv_rd_off: t_avdp_r 108
82oe_on: t_oeasu 109adv_rd_off:
83access: t_iaa, cyc_iaa, cyc_oe 110 t_avdp_r
84rd_cycle: t_cez_r, t_oez, t_ce_rdyz 111oe_on:
112 t_oeasu
113access:
114 t_iaa, cyc_iaa, cyc_oe
115rd_cycle:
116 t_cez_r, t_oez, t_ce_rdyz
85 117
867. write async muxed 1187. write async muxed
87adv_wr_off: t_avdp_w 119
88we_on, wr_data_mux_bus: t_weasu, t_aavdh, cyc_aavhd_we 120adv_wr_off:
89we_off: t_wpl 121 t_avdp_w
90cs_wr_off: t_wph 122we_on, wr_data_mux_bus:
91wr_cycle: t_cez_w, t_wr_cycle 123 t_weasu, t_aavdh, cyc_aavhd_we
124we_off:
125 t_wpl
126cs_wr_off:
127 t_wph
128wr_cycle:
129 t_cez_w, t_wr_cycle
92 130
938. write async non-muxed 1318. write async non-muxed
94adv_wr_off: t_avdp_w 132
95we_on, wr_data_mux_bus: t_weasu 133adv_wr_off:
96we_off: t_wpl 134 t_avdp_w
97cs_wr_off: t_wph 135we_on, wr_data_mux_bus:
98wr_cycle: t_cez_w, t_wr_cycle 136 t_weasu
137we_off:
138 t_wpl
139cs_wr_off:
140 t_wph
141wr_cycle:
142 t_cez_w, t_wr_cycle
99 143
1009. write sync muxed 1449. write sync muxed
101adv_wr_off: t_avdp_w, t_avdh 145
102we_on, wr_data_mux_bus: t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we 146adv_wr_off:
103we_off: t_wpl, cyc_wpl 147 t_avdp_w, t_avdh
104cs_wr_off: t_wph 148we_on, wr_data_mux_bus:
105wr_cycle: t_cez_w, t_ce_rdyz 149 t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we
150we_off:
151 t_wpl, cyc_wpl
152cs_wr_off:
153 t_wph
154wr_cycle:
155 t_cez_w, t_ce_rdyz
106 156
10710. write sync non-muxed 15710. write sync non-muxed
108adv_wr_off: t_avdp_w 158
109we_on, wr_data_mux_bus: t_weasu, t_rdyo 159adv_wr_off:
110we_off: t_wpl, cyc_wpl 160 t_avdp_w
111cs_wr_off: t_wph 161we_on, wr_data_mux_bus:
112wr_cycle: t_cez_w, t_ce_rdyz 162 t_weasu, t_rdyo
113 163we_off:
114 164 t_wpl, cyc_wpl
115Note: Many of gpmc timings are dependent on other gpmc timings (a few 165cs_wr_off:
116gpmc timings purely dependent on other gpmc timings, a reason that 166 t_wph
117some of the gpmc timings are missing above), and it will result in 167wr_cycle:
118indirect dependency of peripheral timings to gpmc timings other than 168 t_cez_w, t_ce_rdyz
119mentioned above, refer timing routine for more details. To know what 169
120these peripheral timings correspond to, please see explanations in 170
121struct gpmc_device_timings definition. And for gpmc timings refer 171Note:
122IP details (link above). 172 Many of gpmc timings are dependent on other gpmc timings (a few
173 gpmc timings purely dependent on other gpmc timings, a reason that
174 some of the gpmc timings are missing above), and it will result in
175 indirect dependency of peripheral timings to gpmc timings other than
176 mentioned above, refer timing routine for more details. To know what
177 these peripheral timings correspond to, please see explanations in
178 struct gpmc_device_timings definition. And for gpmc timings refer
179 IP details (link above).
diff --git a/Documentation/men-chameleon-bus.txt b/Documentation/driver-api/men-chameleon-bus.rst
index 1b1f048aa748..1b1f048aa748 100644
--- a/Documentation/men-chameleon-bus.txt
+++ b/Documentation/driver-api/men-chameleon-bus.rst
diff --git a/Documentation/driver-api/mmc/index.rst b/Documentation/driver-api/mmc/index.rst
new file mode 100644
index 000000000000..7339736ac774
--- /dev/null
+++ b/Documentation/driver-api/mmc/index.rst
@@ -0,0 +1,13 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3========================
4MMC/SD/SDIO card support
5========================
6
7.. toctree::
8 :maxdepth: 1
9
10 mmc-dev-attrs
11 mmc-dev-parts
12 mmc-async-req
13 mmc-tools
diff --git a/Documentation/mmc/mmc-async-req.txt b/Documentation/driver-api/mmc/mmc-async-req.rst
index ae1907b10e4a..0f7197c9c3b5 100644
--- a/Documentation/mmc/mmc-async-req.txt
+++ b/Documentation/driver-api/mmc/mmc-async-req.rst
@@ -1,13 +1,20 @@
1========================
2MMC Asynchronous Request
3========================
4
1Rationale 5Rationale
2========= 6=========
3 7
4How significant is the cache maintenance overhead? 8How significant is the cache maintenance overhead?
9
5It depends. Fast eMMC and multiple cache levels with speculative cache 10It depends. Fast eMMC and multiple cache levels with speculative cache
6pre-fetch makes the cache overhead relatively significant. If the DMA 11pre-fetch makes the cache overhead relatively significant. If the DMA
7preparations for the next request are done in parallel with the current 12preparations for the next request are done in parallel with the current
8transfer, the DMA preparation overhead would not affect the MMC performance. 13transfer, the DMA preparation overhead would not affect the MMC performance.
14
9The intention of non-blocking (asynchronous) MMC requests is to minimize the 15The intention of non-blocking (asynchronous) MMC requests is to minimize the
10time between when an MMC request ends and another MMC request begins. 16time between when an MMC request ends and another MMC request begins.
17
11Using mmc_wait_for_req(), the MMC controller is idle while dma_map_sg and 18Using mmc_wait_for_req(), the MMC controller is idle while dma_map_sg and
12dma_unmap_sg are processing. Using non-blocking MMC requests makes it 19dma_unmap_sg are processing. Using non-blocking MMC requests makes it
13possible to prepare the caches for next job in parallel with an active 20possible to prepare the caches for next job in parallel with an active
@@ -17,6 +24,7 @@ MMC block driver
17================ 24================
18 25
19The mmc_blk_issue_rw_rq() in the MMC block driver is made non-blocking. 26The mmc_blk_issue_rw_rq() in the MMC block driver is made non-blocking.
27
20The increase in throughput is proportional to the time it takes to 28The increase in throughput is proportional to the time it takes to
21prepare (major part of preparations are dma_map_sg() and dma_unmap_sg()) 29prepare (major part of preparations are dma_map_sg() and dma_unmap_sg())
22a request and how fast the memory is. The faster the MMC/SD is the 30a request and how fast the memory is. The faster the MMC/SD is the
@@ -35,6 +43,7 @@ MMC core API extension
35====================== 43======================
36 44
37There is one new public function mmc_start_req(). 45There is one new public function mmc_start_req().
46
38It starts a new MMC command request for a host. The function isn't 47It starts a new MMC command request for a host. The function isn't
39truly non-blocking. If there is an ongoing async request it waits 48truly non-blocking. If there is an ongoing async request it waits
40for completion of that request and starts the new one and returns. It 49for completion of that request and starts the new one and returns. It
@@ -47,6 +56,7 @@ MMC host extensions
47There are two optional members in the mmc_host_ops -- pre_req() and 56There are two optional members in the mmc_host_ops -- pre_req() and
48post_req() -- that the host driver may implement in order to move work 57post_req() -- that the host driver may implement in order to move work
49to before and after the actual mmc_host_ops.request() function is called. 58to before and after the actual mmc_host_ops.request() function is called.
59
50In the DMA case pre_req() may do dma_map_sg() and prepare the DMA 60In the DMA case pre_req() may do dma_map_sg() and prepare the DMA
51descriptor, and post_req() runs the dma_unmap_sg(). 61descriptor, and post_req() runs the dma_unmap_sg().
52 62
@@ -55,33 +65,34 @@ Optimize for the first request
55 65
56The first request in a series of requests can't be prepared in parallel 66The first request in a series of requests can't be prepared in parallel
57with the previous transfer, since there is no previous request. 67with the previous transfer, since there is no previous request.
68
58The argument is_first_req in pre_req() indicates that there is no previous 69The argument is_first_req in pre_req() indicates that there is no previous
59request. The host driver may optimize for this scenario to minimize 70request. The host driver may optimize for this scenario to minimize
60the performance loss. A way to optimize for this is to split the current 71the performance loss. A way to optimize for this is to split the current
61request in two chunks, prepare the first chunk and start the request, 72request in two chunks, prepare the first chunk and start the request,
62and finally prepare the second chunk and start the transfer. 73and finally prepare the second chunk and start the transfer.
63 74
64Pseudocode to handle is_first_req scenario with minimal prepare overhead: 75Pseudocode to handle is_first_req scenario with minimal prepare overhead::
65 76
66if (is_first_req && req->size > threshold) 77 if (is_first_req && req->size > threshold)
67 /* start MMC transfer for the complete transfer size */ 78 /* start MMC transfer for the complete transfer size */
68 mmc_start_command(MMC_CMD_TRANSFER_FULL_SIZE); 79 mmc_start_command(MMC_CMD_TRANSFER_FULL_SIZE);
69 80
70 /* 81 /*
71 * Begin to prepare DMA while cmd is being processed by MMC. 82 * Begin to prepare DMA while cmd is being processed by MMC.
72 * The first chunk of the request should take the same time 83 * The first chunk of the request should take the same time
73 * to prepare as the "MMC process command time". 84 * to prepare as the "MMC process command time".
74 * If prepare time exceeds MMC cmd time 85 * If prepare time exceeds MMC cmd time
75 * the transfer is delayed, guesstimate max 4k as first chunk size. 86 * the transfer is delayed, guesstimate max 4k as first chunk size.
76 */ 87 */
77 prepare_1st_chunk_for_dma(req); 88 prepare_1st_chunk_for_dma(req);
78 /* flush pending desc to the DMAC (dmaengine.h) */ 89 /* flush pending desc to the DMAC (dmaengine.h) */
79 dma_issue_pending(req->dma_desc); 90 dma_issue_pending(req->dma_desc);
80 91
81 prepare_2nd_chunk_for_dma(req); 92 prepare_2nd_chunk_for_dma(req);
82 /* 93 /*
83 * The second issue_pending should be called before MMC runs out 94 * The second issue_pending should be called before MMC runs out
84 * of the first chunk. If the MMC runs out of the first data chunk 95 * of the first chunk. If the MMC runs out of the first data chunk
85 * before this call, the transfer is delayed. 96 * before this call, the transfer is delayed.
86 */ 97 */
87 dma_issue_pending(req->dma_desc); 98 dma_issue_pending(req->dma_desc);
diff --git a/Documentation/mmc/mmc-dev-attrs.txt b/Documentation/driver-api/mmc/mmc-dev-attrs.rst
index 4ad0bb17f343..4f44b1b730d6 100644
--- a/Documentation/mmc/mmc-dev-attrs.txt
+++ b/Documentation/driver-api/mmc/mmc-dev-attrs.rst
@@ -1,3 +1,4 @@
1==================================
1SD and MMC Block Device Attributes 2SD and MMC Block Device Attributes
2================================== 3==================================
3 4
@@ -6,23 +7,29 @@ SD or MMC device.
6 7
7The following attributes are read/write. 8The following attributes are read/write.
8 9
9 force_ro Enforce read-only access even if write protect switch is off. 10 ======== ===============================================
11 force_ro Enforce read-only access even if write protect switch is off.
12 ======== ===============================================
10 13
11SD and MMC Device Attributes 14SD and MMC Device Attributes
12============================ 15============================
13 16
14All attributes are read-only. 17All attributes are read-only.
15 18
19 ====================== ===============================================
16 cid Card Identification Register 20 cid Card Identification Register
17 csd Card Specific Data Register 21 csd Card Specific Data Register
18 scr SD Card Configuration Register (SD only) 22 scr SD Card Configuration Register (SD only)
19 date Manufacturing Date (from CID Register) 23 date Manufacturing Date (from CID Register)
20 fwrev Firmware/Product Revision (from CID Register) (SD and MMCv1 only) 24 fwrev Firmware/Product Revision (from CID Register)
21 hwrev Hardware/Product Revision (from CID Register) (SD and MMCv1 only) 25 (SD and MMCv1 only)
26 hwrev Hardware/Product Revision (from CID Register)
27 (SD and MMCv1 only)
22 manfid Manufacturer ID (from CID Register) 28 manfid Manufacturer ID (from CID Register)
23 name Product Name (from CID Register) 29 name Product Name (from CID Register)
24 oemid OEM/Application ID (from CID Register) 30 oemid OEM/Application ID (from CID Register)
25 prv Product Revision (from CID Register) (SD and MMCv4 only) 31 prv Product Revision (from CID Register)
32 (SD and MMCv4 only)
26 serial Product Serial Number (from CID Register) 33 serial Product Serial Number (from CID Register)
27 erase_size Erase group size 34 erase_size Erase group size
28 preferred_erase_size Preferred erase size 35 preferred_erase_size Preferred erase size
@@ -30,7 +37,10 @@ All attributes are read-only.
30 rel_sectors Reliable write sector count 37 rel_sectors Reliable write sector count
31 ocr Operation Conditions Register 38 ocr Operation Conditions Register
32 dsr Driver Stage Register 39 dsr Driver Stage Register
33 cmdq_en Command Queue enabled: 1 => enabled, 0 => not enabled 40 cmdq_en Command Queue enabled:
41
42 1 => enabled, 0 => not enabled
43 ====================== ===============================================
34 44
35Note on Erase Size and Preferred Erase Size: 45Note on Erase Size and Preferred Erase Size:
36 46
@@ -44,14 +54,15 @@ Note on Erase Size and Preferred Erase Size:
44 SD/MMC cards can erase an arbitrarily large area up to and 54 SD/MMC cards can erase an arbitrarily large area up to and
45 including the whole card. When erasing a large area it may 55 including the whole card. When erasing a large area it may
46 be desirable to do it in smaller chunks for three reasons: 56 be desirable to do it in smaller chunks for three reasons:
47 1. A single erase command will make all other I/O on 57
58 1. A single erase command will make all other I/O on
48 the card wait. This is not a problem if the whole card 59 the card wait. This is not a problem if the whole card
49 is being erased, but erasing one partition will make 60 is being erased, but erasing one partition will make
50 I/O for another partition on the same card wait for the 61 I/O for another partition on the same card wait for the
51 duration of the erase - which could be a several 62 duration of the erase - which could be a several
52 minutes. 63 minutes.
53 2. To be able to inform the user of erase progress. 64 2. To be able to inform the user of erase progress.
54 3. The erase timeout becomes too large to be very 65 3. The erase timeout becomes too large to be very
55 useful. Because the erase timeout contains a margin 66 useful. Because the erase timeout contains a margin
56 which is multiplied by the size of the erase area, 67 which is multiplied by the size of the erase area,
57 the value can end up being several minutes for large 68 the value can end up being several minutes for large
@@ -72,6 +83,9 @@ Note on Erase Size and Preferred Erase Size:
72 "preferred_erase_size" is in bytes. 83 "preferred_erase_size" is in bytes.
73 84
74Note on raw_rpmb_size_mult: 85Note on raw_rpmb_size_mult:
86
75 "raw_rpmb_size_mult" is a multiple of 128kB block. 87 "raw_rpmb_size_mult" is a multiple of 128kB block.
88
76 RPMB size in byte is calculated by using the following equation: 89 RPMB size in byte is calculated by using the following equation:
77 RPMB partition size = 128kB x raw_rpmb_size_mult 90
91 RPMB partition size = 128kB x raw_rpmb_size_mult
diff --git a/Documentation/mmc/mmc-dev-parts.txt b/Documentation/driver-api/mmc/mmc-dev-parts.rst
index f08d078d43cf..995922f1f744 100644
--- a/Documentation/mmc/mmc-dev-parts.txt
+++ b/Documentation/driver-api/mmc/mmc-dev-parts.rst
@@ -1,3 +1,4 @@
1============================
1SD and MMC Device Partitions 2SD and MMC Device Partitions
2============================ 3============================
3 4
@@ -18,18 +19,18 @@ platform, write access is disabled by default to reduce the chance of
18accidental bricking. 19accidental bricking.
19 20
20To enable write access to /dev/mmcblkXbootY, disable the forced read-only 21To enable write access to /dev/mmcblkXbootY, disable the forced read-only
21access with: 22access with::
22 23
23echo 0 > /sys/block/mmcblkXbootY/force_ro 24 echo 0 > /sys/block/mmcblkXbootY/force_ro
24 25
25To re-enable read-only access: 26To re-enable read-only access::
26 27
27echo 1 > /sys/block/mmcblkXbootY/force_ro 28 echo 1 > /sys/block/mmcblkXbootY/force_ro
28 29
29The boot partitions can also be locked read only until the next power on, 30The boot partitions can also be locked read only until the next power on,
30with: 31with::
31 32
32echo 1 > /sys/block/mmcblkXbootY/ro_lock_until_next_power_on 33 echo 1 > /sys/block/mmcblkXbootY/ro_lock_until_next_power_on
33 34
34This is a feature of the card and not of the kernel. If the card does 35This is a feature of the card and not of the kernel. If the card does
35not support boot partition locking, the file will not exist. If the 36not support boot partition locking, the file will not exist. If the
diff --git a/Documentation/mmc/mmc-tools.txt b/Documentation/driver-api/mmc/mmc-tools.rst
index 735509c165d5..54406093768b 100644
--- a/Documentation/mmc/mmc-tools.txt
+++ b/Documentation/driver-api/mmc/mmc-tools.rst
@@ -1,14 +1,17 @@
1======================
1MMC tools introduction 2MMC tools introduction
2====================== 3======================
3 4
4There is one MMC test tools called mmc-utils, which is maintained by Chris Ball, 5There is one MMC test tools called mmc-utils, which is maintained by Chris Ball,
5you can find it at the below public git repository: 6you can find it at the below public git repository:
6http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/ 7
8 http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/
7 9
8Functions 10Functions
9========= 11=========
10 12
11The mmc-utils tools can do the following: 13The mmc-utils tools can do the following:
14
12 - Print and parse extcsd data. 15 - Print and parse extcsd data.
13 - Determine the eMMC writeprotect status. 16 - Determine the eMMC writeprotect status.
14 - Set the eMMC writeprotect status. 17 - Set the eMMC writeprotect status.
diff --git a/Documentation/driver-api/mtd/index.rst b/Documentation/driver-api/mtd/index.rst
new file mode 100644
index 000000000000..436ba5a851d7
--- /dev/null
+++ b/Documentation/driver-api/mtd/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==============================
4Memory Technology Device (MTD)
5==============================
6
7.. toctree::
8 :maxdepth: 1
9
10 intel-spi
11 nand_ecc
12 spi-nor
diff --git a/Documentation/mtd/intel-spi.txt b/Documentation/driver-api/mtd/intel-spi.rst
index bc357729c2cb..0e6d9cd5388d 100644
--- a/Documentation/mtd/intel-spi.txt
+++ b/Documentation/driver-api/mtd/intel-spi.rst
@@ -1,5 +1,6 @@
1==============================
1Upgrading BIOS using intel-spi 2Upgrading BIOS using intel-spi
2------------------------------ 3==============================
3 4
4Many Intel CPUs like Baytrail and Braswell include SPI serial flash host 5Many Intel CPUs like Baytrail and Braswell include SPI serial flash host
5controller which is used to hold BIOS and other platform specific data. 6controller which is used to hold BIOS and other platform specific data.
@@ -36,45 +37,45 @@ Linux.
36 module parameter to modprobe). 37 module parameter to modprobe).
37 38
38 4) Once the board is up and running again, find the right MTD partition 39 4) Once the board is up and running again, find the right MTD partition
39 (it is named as "BIOS"): 40 (it is named as "BIOS")::
40 41
41 # cat /proc/mtd 42 # cat /proc/mtd
42 dev: size erasesize name 43 dev: size erasesize name
43 mtd0: 00800000 00001000 "BIOS" 44 mtd0: 00800000 00001000 "BIOS"
44 45
45 So here it will be /dev/mtd0 but it may vary. 46 So here it will be /dev/mtd0 but it may vary.
46 47
47 5) Make backup of the existing image first: 48 5) Make backup of the existing image first::
48 49
49 # dd if=/dev/mtd0ro of=bios.bak 50 # dd if=/dev/mtd0ro of=bios.bak
50 16384+0 records in 51 16384+0 records in
51 16384+0 records out 52 16384+0 records out
52 8388608 bytes (8.4 MB) copied, 10.0269 s, 837 kB/s 53 8388608 bytes (8.4 MB) copied, 10.0269 s, 837 kB/s
53 54
54 6) Verify the backup 55 6) Verify the backup:
55 56
56 # sha1sum /dev/mtd0ro bios.bak 57 # sha1sum /dev/mtd0ro bios.bak
57 fdbb011920572ca6c991377c4b418a0502668b73 /dev/mtd0ro 58 fdbb011920572ca6c991377c4b418a0502668b73 /dev/mtd0ro
58 fdbb011920572ca6c991377c4b418a0502668b73 bios.bak 59 fdbb011920572ca6c991377c4b418a0502668b73 bios.bak
59 60
60 The SHA1 sums must match. Otherwise do not continue any further! 61 The SHA1 sums must match. Otherwise do not continue any further!
61 62
62 7) Erase the SPI serial flash. After this step, do not reboot the 63 7) Erase the SPI serial flash. After this step, do not reboot the
63 board! Otherwise it will not start anymore. 64 board! Otherwise it will not start anymore::
64 65
65 # flash_erase /dev/mtd0 0 0 66 # flash_erase /dev/mtd0 0 0
66 Erasing 4 Kibyte @ 7ff000 -- 100 % complete 67 Erasing 4 Kibyte @ 7ff000 -- 100 % complete
67 68
68 8) Once completed without errors you can write the new BIOS image: 69 8) Once completed without errors you can write the new BIOS image:
69 70
70 # dd if=MNW2MAX1.X64.0092.R01.1605221712.bin of=/dev/mtd0 71 # dd if=MNW2MAX1.X64.0092.R01.1605221712.bin of=/dev/mtd0
71 72
72 9) Verify that the new content of the SPI serial flash matches the new 73 9) Verify that the new content of the SPI serial flash matches the new
73 BIOS image: 74 BIOS image::
74 75
75 # sha1sum /dev/mtd0ro MNW2MAX1.X64.0092.R01.1605221712.bin 76 # sha1sum /dev/mtd0ro MNW2MAX1.X64.0092.R01.1605221712.bin
76 9b4df9e4be2057fceec3a5529ec3d950836c87a2 /dev/mtd0ro 77 9b4df9e4be2057fceec3a5529ec3d950836c87a2 /dev/mtd0ro
77 9b4df9e4be2057fceec3a5529ec3d950836c87a2 MNW2MAX1.X64.0092.R01.1605221712.bin 78 9b4df9e4be2057fceec3a5529ec3d950836c87a2 MNW2MAX1.X64.0092.R01.1605221712.bin
78 79
79 The SHA1 sums should match. 80 The SHA1 sums should match.
80 81
@@ -84,5 +85,6 @@ Linux.
84References 85References
85---------- 86----------
86 87
87[1] https://firmware.intel.com/sites/default/files/MinnowBoard.MAX_.X64.92.R01.zip 88[1] https://firmware.intel.com/sites/default/files/MinnowBoard%2EMAX_%2EX64%2E92%2ER01%2Ezip
89
88[2] http://www.linux-mtd.infradead.org/ 90[2] http://www.linux-mtd.infradead.org/
diff --git a/Documentation/mtd/nand_ecc.txt b/Documentation/driver-api/mtd/nand_ecc.rst
index f8c3284bf6a7..e8d3c53a5056 100644
--- a/Documentation/mtd/nand_ecc.txt
+++ b/Documentation/driver-api/mtd/nand_ecc.rst
@@ -1,3 +1,7 @@
1==========================
2NAND Error-correction Code
3==========================
4
1Introduction 5Introduction
2============ 6============
3 7
@@ -37,63 +41,79 @@ sometimes also referred to as xor. In C the operator for xor is ^
37Back to ecc. 41Back to ecc.
38Let's give a small figure: 42Let's give a small figure:
39 43
44========= ==== ==== ==== ==== ==== ==== ==== ==== === === === === ====
40byte 0: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp4 ... rp14 45byte 0: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp4 ... rp14
41byte 1: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp2 rp4 ... rp14 46byte 1: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp2 rp4 ... rp14
42byte 2: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp4 ... rp14 47byte 2: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp4 ... rp14
43byte 3: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp4 ... rp14 48byte 3: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp4 ... rp14
44byte 4: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp5 ... rp14 49byte 4: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp2 rp5 ... rp14
45.... 50...
46byte 254: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp5 ... rp15 51byte 254: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp0 rp3 rp5 ... rp15
47byte 255: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp5 ... rp15 52byte 255: bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rp1 rp3 rp5 ... rp15
48 cp1 cp0 cp1 cp0 cp1 cp0 cp1 cp0 53 cp1 cp0 cp1 cp0 cp1 cp0 cp1 cp0
49 cp3 cp3 cp2 cp2 cp3 cp3 cp2 cp2 54 cp3 cp3 cp2 cp2 cp3 cp3 cp2 cp2
50 cp5 cp5 cp5 cp5 cp4 cp4 cp4 cp4 55 cp5 cp5 cp5 cp5 cp4 cp4 cp4 cp4
56========= ==== ==== ==== ==== ==== ==== ==== ==== === === === === ====
51 57
52This figure represents a sector of 256 bytes. 58This figure represents a sector of 256 bytes.
53cp is my abbreviation for column parity, rp for row parity. 59cp is my abbreviation for column parity, rp for row parity.
54 60
55Let's start to explain column parity. 61Let's start to explain column parity.
56cp0 is the parity that belongs to all bit0, bit2, bit4, bit6. 62
57so the sum of all bit0, bit2, bit4 and bit6 values + cp0 itself is even. 63- cp0 is the parity that belongs to all bit0, bit2, bit4, bit6.
64
65 so the sum of all bit0, bit2, bit4 and bit6 values + cp0 itself is even.
66
58Similarly cp1 is the sum of all bit1, bit3, bit5 and bit7. 67Similarly cp1 is the sum of all bit1, bit3, bit5 and bit7.
59cp2 is the parity over bit0, bit1, bit4 and bit5 68
60cp3 is the parity over bit2, bit3, bit6 and bit7. 69- cp2 is the parity over bit0, bit1, bit4 and bit5
61cp4 is the parity over bit0, bit1, bit2 and bit3. 70- cp3 is the parity over bit2, bit3, bit6 and bit7.
62cp5 is the parity over bit4, bit5, bit6 and bit7. 71- cp4 is the parity over bit0, bit1, bit2 and bit3.
72- cp5 is the parity over bit4, bit5, bit6 and bit7.
73
63Note that each of cp0 .. cp5 is exactly one bit. 74Note that each of cp0 .. cp5 is exactly one bit.
64 75
65Row parity actually works almost the same. 76Row parity actually works almost the same.
66rp0 is the parity of all even bytes (0, 2, 4, 6, ... 252, 254) 77
67rp1 is the parity of all odd bytes (1, 3, 5, 7, ..., 253, 255) 78- rp0 is the parity of all even bytes (0, 2, 4, 6, ... 252, 254)
68rp2 is the parity of all bytes 0, 1, 4, 5, 8, 9, ... 79- rp1 is the parity of all odd bytes (1, 3, 5, 7, ..., 253, 255)
69(so handle two bytes, then skip 2 bytes). 80- rp2 is the parity of all bytes 0, 1, 4, 5, 8, 9, ...
70rp3 is covers the half rp2 does not cover (bytes 2, 3, 6, 7, 10, 11, ...) 81 (so handle two bytes, then skip 2 bytes).
71for rp4 the rule is cover 4 bytes, skip 4 bytes, cover 4 bytes, skip 4 etc. 82- rp3 is covers the half rp2 does not cover (bytes 2, 3, 6, 7, 10, 11, ...)
72so rp4 calculates parity over bytes 0, 1, 2, 3, 8, 9, 10, 11, 16, ...) 83- for rp4 the rule is cover 4 bytes, skip 4 bytes, cover 4 bytes, skip 4 etc.
73and rp5 covers the other half, so bytes 4, 5, 6, 7, 12, 13, 14, 15, 20, .. 84
85 so rp4 calculates parity over bytes 0, 1, 2, 3, 8, 9, 10, 11, 16, ...)
86- and rp5 covers the other half, so bytes 4, 5, 6, 7, 12, 13, 14, 15, 20, ..
87
74The story now becomes quite boring. I guess you get the idea. 88The story now becomes quite boring. I guess you get the idea.
75rp6 covers 8 bytes then skips 8 etc 89
76rp7 skips 8 bytes then covers 8 etc 90- rp6 covers 8 bytes then skips 8 etc
77rp8 covers 16 bytes then skips 16 etc 91- rp7 skips 8 bytes then covers 8 etc
78rp9 skips 16 bytes then covers 16 etc 92- rp8 covers 16 bytes then skips 16 etc
79rp10 covers 32 bytes then skips 32 etc 93- rp9 skips 16 bytes then covers 16 etc
80rp11 skips 32 bytes then covers 32 etc 94- rp10 covers 32 bytes then skips 32 etc
81rp12 covers 64 bytes then skips 64 etc 95- rp11 skips 32 bytes then covers 32 etc
82rp13 skips 64 bytes then covers 64 etc 96- rp12 covers 64 bytes then skips 64 etc
83rp14 covers 128 bytes then skips 128 97- rp13 skips 64 bytes then covers 64 etc
84rp15 skips 128 bytes then covers 128 98- rp14 covers 128 bytes then skips 128
99- rp15 skips 128 bytes then covers 128
85 100
86In the end the parity bits are grouped together in three bytes as 101In the end the parity bits are grouped together in three bytes as
87follows: 102follows:
103
104===== ===== ===== ===== ===== ===== ===== ===== =====
88ECC Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 105ECC Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
106===== ===== ===== ===== ===== ===== ===== ===== =====
89ECC 0 rp07 rp06 rp05 rp04 rp03 rp02 rp01 rp00 107ECC 0 rp07 rp06 rp05 rp04 rp03 rp02 rp01 rp00
90ECC 1 rp15 rp14 rp13 rp12 rp11 rp10 rp09 rp08 108ECC 1 rp15 rp14 rp13 rp12 rp11 rp10 rp09 rp08
91ECC 2 cp5 cp4 cp3 cp2 cp1 cp0 1 1 109ECC 2 cp5 cp4 cp3 cp2 cp1 cp0 1 1
110===== ===== ===== ===== ===== ===== ===== ===== =====
92 111
93I detected after writing this that ST application note AN1823 112I detected after writing this that ST application note AN1823
94(http://www.st.com/stonline/) gives a much 113(http://www.st.com/stonline/) gives a much
95nicer picture.(but they use line parity as term where I use row parity) 114nicer picture.(but they use line parity as term where I use row parity)
96Oh well, I'm graphically challenged, so suffer with me for a moment :-) 115Oh well, I'm graphically challenged, so suffer with me for a moment :-)
116
97And I could not reuse the ST picture anyway for copyright reasons. 117And I could not reuse the ST picture anyway for copyright reasons.
98 118
99 119
@@ -101,9 +121,10 @@ Attempt 0
101========= 121=========
102 122
103Implementing the parity calculation is pretty simple. 123Implementing the parity calculation is pretty simple.
104In C pseudocode: 124In C pseudocode::
105for (i = 0; i < 256; i++) 125
106{ 126 for (i = 0; i < 256; i++)
127 {
107 if (i & 0x01) 128 if (i & 0x01)
108 rp1 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp1; 129 rp1 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ bit3 ^ bit2 ^ bit1 ^ bit0 ^ rp1;
109 else 130 else
@@ -142,7 +163,7 @@ for (i = 0; i < 256; i++)
142 cp3 = bit7 ^ bit6 ^ bit3 ^ bit2 ^ cp3 163 cp3 = bit7 ^ bit6 ^ bit3 ^ bit2 ^ cp3
143 cp4 = bit3 ^ bit2 ^ bit1 ^ bit0 ^ cp4 164 cp4 = bit3 ^ bit2 ^ bit1 ^ bit0 ^ cp4
144 cp5 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ cp5 165 cp5 = bit7 ^ bit6 ^ bit5 ^ bit4 ^ cp5
145} 166 }
146 167
147 168
148Analysis 0 169Analysis 0
@@ -167,82 +188,84 @@ This leads to:
167Attempt 1 188Attempt 1
168========= 189=========
169 190
170const char parity[256] = { 191::
171 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 192
172 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 193 const char parity[256] = {
173 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 194 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
174 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 195 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
175 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 196 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
176 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 197 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
177 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 198 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
178 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 199 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
179 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 200 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
180 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 201 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
181 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 202 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
182 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 203 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
183 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 204 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
184 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 205 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
185 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 206 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
186 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 207 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
187}; 208 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
188 209 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
189void ecc1(const unsigned char *buf, unsigned char *code) 210 };
190{ 211
191 int i; 212 void ecc1(const unsigned char *buf, unsigned char *code)
192 const unsigned char *bp = buf; 213 {
193 unsigned char cur; 214 int i;
194 unsigned char rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7; 215 const unsigned char *bp = buf;
195 unsigned char rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15; 216 unsigned char cur;
196 unsigned char par; 217 unsigned char rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;
197 218 unsigned char rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15;
198 par = 0; 219 unsigned char par;
199 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0; 220
200 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0; 221 par = 0;
201 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0; 222 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0;
202 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0; 223 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0;
203 224 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0;
204 for (i = 0; i < 256; i++) 225 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0;
205 { 226
206 cur = *bp++; 227 for (i = 0; i < 256; i++)
207 par ^= cur; 228 {
208 if (i & 0x01) rp1 ^= cur; else rp0 ^= cur; 229 cur = *bp++;
209 if (i & 0x02) rp3 ^= cur; else rp2 ^= cur; 230 par ^= cur;
210 if (i & 0x04) rp5 ^= cur; else rp4 ^= cur; 231 if (i & 0x01) rp1 ^= cur; else rp0 ^= cur;
211 if (i & 0x08) rp7 ^= cur; else rp6 ^= cur; 232 if (i & 0x02) rp3 ^= cur; else rp2 ^= cur;
212 if (i & 0x10) rp9 ^= cur; else rp8 ^= cur; 233 if (i & 0x04) rp5 ^= cur; else rp4 ^= cur;
213 if (i & 0x20) rp11 ^= cur; else rp10 ^= cur; 234 if (i & 0x08) rp7 ^= cur; else rp6 ^= cur;
214 if (i & 0x40) rp13 ^= cur; else rp12 ^= cur; 235 if (i & 0x10) rp9 ^= cur; else rp8 ^= cur;
215 if (i & 0x80) rp15 ^= cur; else rp14 ^= cur; 236 if (i & 0x20) rp11 ^= cur; else rp10 ^= cur;
216 } 237 if (i & 0x40) rp13 ^= cur; else rp12 ^= cur;
217 code[0] = 238 if (i & 0x80) rp15 ^= cur; else rp14 ^= cur;
218 (parity[rp7] << 7) | 239 }
219 (parity[rp6] << 6) | 240 code[0] =
220 (parity[rp5] << 5) | 241 (parity[rp7] << 7) |
221 (parity[rp4] << 4) | 242 (parity[rp6] << 6) |
222 (parity[rp3] << 3) | 243 (parity[rp5] << 5) |
223 (parity[rp2] << 2) | 244 (parity[rp4] << 4) |
224 (parity[rp1] << 1) | 245 (parity[rp3] << 3) |
225 (parity[rp0]); 246 (parity[rp2] << 2) |
226 code[1] = 247 (parity[rp1] << 1) |
227 (parity[rp15] << 7) | 248 (parity[rp0]);
228 (parity[rp14] << 6) | 249 code[1] =
229 (parity[rp13] << 5) | 250 (parity[rp15] << 7) |
230 (parity[rp12] << 4) | 251 (parity[rp14] << 6) |
231 (parity[rp11] << 3) | 252 (parity[rp13] << 5) |
232 (parity[rp10] << 2) | 253 (parity[rp12] << 4) |
233 (parity[rp9] << 1) | 254 (parity[rp11] << 3) |
234 (parity[rp8]); 255 (parity[rp10] << 2) |
235 code[2] = 256 (parity[rp9] << 1) |
236 (parity[par & 0xf0] << 7) | 257 (parity[rp8]);
237 (parity[par & 0x0f] << 6) | 258 code[2] =
238 (parity[par & 0xcc] << 5) | 259 (parity[par & 0xf0] << 7) |
239 (parity[par & 0x33] << 4) | 260 (parity[par & 0x0f] << 6) |
240 (parity[par & 0xaa] << 3) | 261 (parity[par & 0xcc] << 5) |
241 (parity[par & 0x55] << 2); 262 (parity[par & 0x33] << 4) |
242 code[0] = ~code[0]; 263 (parity[par & 0xaa] << 3) |
243 code[1] = ~code[1]; 264 (parity[par & 0x55] << 2);
244 code[2] = ~code[2]; 265 code[0] = ~code[0];
245} 266 code[1] = ~code[1];
267 code[2] = ~code[2];
268 }
246 269
247Still pretty straightforward. The last three invert statements are there to 270Still pretty straightforward. The last three invert statements are there to
248give a checksum of 0xff 0xff 0xff for an empty flash. In an empty flash 271give a checksum of 0xff 0xff 0xff for an empty flash. In an empty flash
@@ -293,88 +316,90 @@ Let's give it a try...
293Attempt 2 316Attempt 2
294========= 317=========
295 318
296extern const char parity[256]; 319::
297 320
298void ecc2(const unsigned char *buf, unsigned char *code) 321 extern const char parity[256];
299{ 322
300 int i; 323 void ecc2(const unsigned char *buf, unsigned char *code)
301 const unsigned long *bp = (unsigned long *)buf; 324 {
302 unsigned long cur; 325 int i;
303 unsigned long rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7; 326 const unsigned long *bp = (unsigned long *)buf;
304 unsigned long rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15; 327 unsigned long cur;
305 unsigned long par; 328 unsigned long rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;
306 329 unsigned long rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15;
307 par = 0; 330 unsigned long par;
308 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0; 331
309 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0; 332 par = 0;
310 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0; 333 rp0 = 0; rp1 = 0; rp2 = 0; rp3 = 0;
311 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0; 334 rp4 = 0; rp5 = 0; rp6 = 0; rp7 = 0;
312 335 rp8 = 0; rp9 = 0; rp10 = 0; rp11 = 0;
313 for (i = 0; i < 64; i++) 336 rp12 = 0; rp13 = 0; rp14 = 0; rp15 = 0;
314 { 337
315 cur = *bp++; 338 for (i = 0; i < 64; i++)
316 par ^= cur; 339 {
317 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur; 340 cur = *bp++;
318 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur; 341 par ^= cur;
319 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur; 342 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
320 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur; 343 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
321 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur; 344 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
322 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur; 345 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
323 } 346 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
324 /* 347 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
325 we need to adapt the code generation for the fact that rp vars are now 348 }
326 long; also the column parity calculation needs to be changed. 349 /*
327 we'll bring rp4 to 15 back to single byte entities by shifting and 350 we need to adapt the code generation for the fact that rp vars are now
328 xoring 351 long; also the column parity calculation needs to be changed.
329 */ 352 we'll bring rp4 to 15 back to single byte entities by shifting and
330 rp4 ^= (rp4 >> 16); rp4 ^= (rp4 >> 8); rp4 &= 0xff; 353 xoring
331 rp5 ^= (rp5 >> 16); rp5 ^= (rp5 >> 8); rp5 &= 0xff; 354 */
332 rp6 ^= (rp6 >> 16); rp6 ^= (rp6 >> 8); rp6 &= 0xff; 355 rp4 ^= (rp4 >> 16); rp4 ^= (rp4 >> 8); rp4 &= 0xff;
333 rp7 ^= (rp7 >> 16); rp7 ^= (rp7 >> 8); rp7 &= 0xff; 356 rp5 ^= (rp5 >> 16); rp5 ^= (rp5 >> 8); rp5 &= 0xff;
334 rp8 ^= (rp8 >> 16); rp8 ^= (rp8 >> 8); rp8 &= 0xff; 357 rp6 ^= (rp6 >> 16); rp6 ^= (rp6 >> 8); rp6 &= 0xff;
335 rp9 ^= (rp9 >> 16); rp9 ^= (rp9 >> 8); rp9 &= 0xff; 358 rp7 ^= (rp7 >> 16); rp7 ^= (rp7 >> 8); rp7 &= 0xff;
336 rp10 ^= (rp10 >> 16); rp10 ^= (rp10 >> 8); rp10 &= 0xff; 359 rp8 ^= (rp8 >> 16); rp8 ^= (rp8 >> 8); rp8 &= 0xff;
337 rp11 ^= (rp11 >> 16); rp11 ^= (rp11 >> 8); rp11 &= 0xff; 360 rp9 ^= (rp9 >> 16); rp9 ^= (rp9 >> 8); rp9 &= 0xff;
338 rp12 ^= (rp12 >> 16); rp12 ^= (rp12 >> 8); rp12 &= 0xff; 361 rp10 ^= (rp10 >> 16); rp10 ^= (rp10 >> 8); rp10 &= 0xff;
339 rp13 ^= (rp13 >> 16); rp13 ^= (rp13 >> 8); rp13 &= 0xff; 362 rp11 ^= (rp11 >> 16); rp11 ^= (rp11 >> 8); rp11 &= 0xff;
340 rp14 ^= (rp14 >> 16); rp14 ^= (rp14 >> 8); rp14 &= 0xff; 363 rp12 ^= (rp12 >> 16); rp12 ^= (rp12 >> 8); rp12 &= 0xff;
341 rp15 ^= (rp15 >> 16); rp15 ^= (rp15 >> 8); rp15 &= 0xff; 364 rp13 ^= (rp13 >> 16); rp13 ^= (rp13 >> 8); rp13 &= 0xff;
342 rp3 = (par >> 16); rp3 ^= (rp3 >> 8); rp3 &= 0xff; 365 rp14 ^= (rp14 >> 16); rp14 ^= (rp14 >> 8); rp14 &= 0xff;
343 rp2 = par & 0xffff; rp2 ^= (rp2 >> 8); rp2 &= 0xff; 366 rp15 ^= (rp15 >> 16); rp15 ^= (rp15 >> 8); rp15 &= 0xff;
344 par ^= (par >> 16); 367 rp3 = (par >> 16); rp3 ^= (rp3 >> 8); rp3 &= 0xff;
345 rp1 = (par >> 8); rp1 &= 0xff; 368 rp2 = par & 0xffff; rp2 ^= (rp2 >> 8); rp2 &= 0xff;
346 rp0 = (par & 0xff); 369 par ^= (par >> 16);
347 par ^= (par >> 8); par &= 0xff; 370 rp1 = (par >> 8); rp1 &= 0xff;
348 371 rp0 = (par & 0xff);
349 code[0] = 372 par ^= (par >> 8); par &= 0xff;
350 (parity[rp7] << 7) | 373
351 (parity[rp6] << 6) | 374 code[0] =
352 (parity[rp5] << 5) | 375 (parity[rp7] << 7) |
353 (parity[rp4] << 4) | 376 (parity[rp6] << 6) |
354 (parity[rp3] << 3) | 377 (parity[rp5] << 5) |
355 (parity[rp2] << 2) | 378 (parity[rp4] << 4) |
356 (parity[rp1] << 1) | 379 (parity[rp3] << 3) |
357 (parity[rp0]); 380 (parity[rp2] << 2) |
358 code[1] = 381 (parity[rp1] << 1) |
359 (parity[rp15] << 7) | 382 (parity[rp0]);
360 (parity[rp14] << 6) | 383 code[1] =
361 (parity[rp13] << 5) | 384 (parity[rp15] << 7) |
362 (parity[rp12] << 4) | 385 (parity[rp14] << 6) |
363 (parity[rp11] << 3) | 386 (parity[rp13] << 5) |
364 (parity[rp10] << 2) | 387 (parity[rp12] << 4) |
365 (parity[rp9] << 1) | 388 (parity[rp11] << 3) |
366 (parity[rp8]); 389 (parity[rp10] << 2) |
367 code[2] = 390 (parity[rp9] << 1) |
368 (parity[par & 0xf0] << 7) | 391 (parity[rp8]);
369 (parity[par & 0x0f] << 6) | 392 code[2] =
370 (parity[par & 0xcc] << 5) | 393 (parity[par & 0xf0] << 7) |
371 (parity[par & 0x33] << 4) | 394 (parity[par & 0x0f] << 6) |
372 (parity[par & 0xaa] << 3) | 395 (parity[par & 0xcc] << 5) |
373 (parity[par & 0x55] << 2); 396 (parity[par & 0x33] << 4) |
374 code[0] = ~code[0]; 397 (parity[par & 0xaa] << 3) |
375 code[1] = ~code[1]; 398 (parity[par & 0x55] << 2);
376 code[2] = ~code[2]; 399 code[0] = ~code[0];
377} 400 code[1] = ~code[1];
401 code[2] = ~code[2];
402 }
378 403
379The parity array is not shown any more. Note also that for these 404The parity array is not shown any more. Note also that for these
380examples I kinda deviated from my regular programming style by allowing 405examples I kinda deviated from my regular programming style by allowing
@@ -403,28 +428,32 @@ lookups
403Attempt 3 428Attempt 3
404========= 429=========
405 430
406Odd replaced: 431Odd replaced::
407 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur; 432
408 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur; 433 if (i & 0x01) rp5 ^= cur; else rp4 ^= cur;
409 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur; 434 if (i & 0x02) rp7 ^= cur; else rp6 ^= cur;
410 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur; 435 if (i & 0x04) rp9 ^= cur; else rp8 ^= cur;
411 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur; 436 if (i & 0x08) rp11 ^= cur; else rp10 ^= cur;
412 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur; 437 if (i & 0x10) rp13 ^= cur; else rp12 ^= cur;
413with 438 if (i & 0x20) rp15 ^= cur; else rp14 ^= cur;
414 if (i & 0x01) rp5 ^= cur; 439
415 if (i & 0x02) rp7 ^= cur; 440with::
416 if (i & 0x04) rp9 ^= cur; 441
417 if (i & 0x08) rp11 ^= cur; 442 if (i & 0x01) rp5 ^= cur;
418 if (i & 0x10) rp13 ^= cur; 443 if (i & 0x02) rp7 ^= cur;
419 if (i & 0x20) rp15 ^= cur; 444 if (i & 0x04) rp9 ^= cur;
420 445 if (i & 0x08) rp11 ^= cur;
421 and outside the loop added: 446 if (i & 0x10) rp13 ^= cur;
422 rp4 = par ^ rp5; 447 if (i & 0x20) rp15 ^= cur;
423 rp6 = par ^ rp7; 448
424 rp8 = par ^ rp9; 449and outside the loop added::
425 rp10 = par ^ rp11; 450
426 rp12 = par ^ rp13; 451 rp4 = par ^ rp5;
427 rp14 = par ^ rp15; 452 rp6 = par ^ rp7;
453 rp8 = par ^ rp9;
454 rp10 = par ^ rp11;
455 rp12 = par ^ rp13;
456 rp14 = par ^ rp15;
428 457
429And after that the code takes about 30% more time, although the number of 458And after that the code takes about 30% more time, although the number of
430statements is reduced. This is also reflected in the assembly code. 459statements is reduced. This is also reflected in the assembly code.
@@ -448,7 +477,7 @@ Attempt 4
448========= 477=========
449 478
450Unrolled the loop 1, 2, 3 and 4 times. 479Unrolled the loop 1, 2, 3 and 4 times.
451For 4 the code starts with: 480For 4 the code starts with::
452 481
453 for (i = 0; i < 4; i++) 482 for (i = 0; i < 4; i++)
454 { 483 {
@@ -471,8 +500,11 @@ Analysis 4
471========== 500==========
472 501
473Unrolling once gains about 15% 502Unrolling once gains about 15%
503
474Unrolling twice keeps the gain at about 15% 504Unrolling twice keeps the gain at about 15%
505
475Unrolling three times gives a gain of 30% compared to attempt 2. 506Unrolling three times gives a gain of 30% compared to attempt 2.
507
476Unrolling four times gives a marginal improvement compared to unrolling 508Unrolling four times gives a marginal improvement compared to unrolling
477three times. 509three times.
478 510
@@ -492,8 +524,10 @@ Attempt 5
492 524
493Effectively so all odd digit rp assignments in the loop were removed. 525Effectively so all odd digit rp assignments in the loop were removed.
494This included the else clause of the if statements. 526This included the else clause of the if statements.
495Of course after the loop we need to correct things by adding code like: 527Of course after the loop we need to correct things by adding code like::
528
496 rp5 = par ^ rp4; 529 rp5 = par ^ rp4;
530
497Also the initial assignments (rp5 = 0; etc) could be removed. 531Also the initial assignments (rp5 = 0; etc) could be removed.
498Along the line I also removed the initialisation of rp0/1/2/3. 532Along the line I also removed the initialisation of rp0/1/2/3.
499 533
@@ -513,7 +547,7 @@ statement. Time for yet another version!
513Attempt 6 547Attempt 6
514========= 548=========
515 549
516THe code within the for loop was changed to: 550THe code within the for loop was changed to::
517 551
518 for (i = 0; i < 4; i++) 552 for (i = 0; i < 4; i++)
519 { 553 {
@@ -564,13 +598,17 @@ million iterations in order not to lose too much accuracy. This one
564definitely seemed to be the jackpot! 598definitely seemed to be the jackpot!
565 599
566There is a little bit more room for improvement though. There are three 600There is a little bit more room for improvement though. There are three
567places with statements: 601places with statements::
568rp4 ^= cur; rp6 ^= cur; 602
603 rp4 ^= cur; rp6 ^= cur;
604
569It seems more efficient to also maintain a variable rp4_6 in the while 605It seems more efficient to also maintain a variable rp4_6 in the while
570loop; This eliminates 3 statements per loop. Of course after the loop we 606loop; This eliminates 3 statements per loop. Of course after the loop we
571need to correct by adding: 607need to correct by adding::
572 rp4 ^= rp4_6; 608
573 rp6 ^= rp4_6 609 rp4 ^= rp4_6;
610 rp6 ^= rp4_6
611
574Furthermore there are 4 sequential assignments to rp8. This can be 612Furthermore there are 4 sequential assignments to rp8. This can be
575encoded slightly more efficiently by saving tmppar before those 4 lines 613encoded slightly more efficiently by saving tmppar before those 4 lines
576and later do rp8 = rp8 ^ tmppar ^ notrp8; 614and later do rp8 = rp8 ^ tmppar ^ notrp8;
@@ -582,7 +620,7 @@ Time for a new test!
582Attempt 7 620Attempt 7
583========= 621=========
584 622
585The new code now looks like: 623The new code now looks like::
586 624
587 for (i = 0; i < 4; i++) 625 for (i = 0; i < 4; i++)
588 { 626 {
@@ -644,9 +682,12 @@ Although it seems that the code within the loop cannot be optimised
644further there is still room to optimize the generation of the ecc codes. 682further there is still room to optimize the generation of the ecc codes.
645We can simply calculate the total parity. If this is 0 then rp4 = rp5 683We can simply calculate the total parity. If this is 0 then rp4 = rp5
646etc. If the parity is 1, then rp4 = !rp5; 684etc. If the parity is 1, then rp4 = !rp5;
685
647But if rp4 = rp5 we do not need rp5 etc. We can just write the even bits 686But if rp4 = rp5 we do not need rp5 etc. We can just write the even bits
648in the result byte and then do something like 687in the result byte and then do something like::
688
649 code[0] |= (code[0] << 1); 689 code[0] |= (code[0] << 1);
690
650Lets test this. 691Lets test this.
651 692
652 693
@@ -657,11 +698,13 @@ Changed the code but again this slightly degrades performance. Tried all
657kind of other things, like having dedicated parity arrays to avoid the 698kind of other things, like having dedicated parity arrays to avoid the
658shift after parity[rp7] << 7; No gain. 699shift after parity[rp7] << 7; No gain.
659Change the lookup using the parity array by using shift operators (e.g. 700Change the lookup using the parity array by using shift operators (e.g.
660replace parity[rp7] << 7 with: 701replace parity[rp7] << 7 with::
661rp7 ^= (rp7 << 4); 702
662rp7 ^= (rp7 << 2); 703 rp7 ^= (rp7 << 4);
663rp7 ^= (rp7 << 1); 704 rp7 ^= (rp7 << 2);
664rp7 &= 0x80; 705 rp7 ^= (rp7 << 1);
706 rp7 &= 0x80;
707
665No gain. 708No gain.
666 709
667The only marginal change was inverting the parity bits, so we can remove 710The only marginal change was inverting the parity bits, so we can remove
@@ -683,13 +726,16 @@ Correcting errors
683 726
684For correcting errors I again used the ST application note as a starter, 727For correcting errors I again used the ST application note as a starter,
685but I also peeked at the existing code. 728but I also peeked at the existing code.
729
686The algorithm itself is pretty straightforward. Just xor the given and 730The algorithm itself is pretty straightforward. Just xor the given and
687the calculated ecc. If all bytes are 0 there is no problem. If 11 bits 731the calculated ecc. If all bytes are 0 there is no problem. If 11 bits
688are 1 we have one correctable bit error. If there is 1 bit 1, we have an 732are 1 we have one correctable bit error. If there is 1 bit 1, we have an
689error in the given ecc code. 733error in the given ecc code.
734
690It proved to be fastest to do some table lookups. Performance gain 735It proved to be fastest to do some table lookups. Performance gain
691introduced by this is about a factor 2 on my system when a repair had to 736introduced by this is about a factor 2 on my system when a repair had to
692be done, and 1% or so if no repair had to be done. 737be done, and 1% or so if no repair had to be done.
738
693Code size increased from 330 bytes to 686 bytes for this function. 739Code size increased from 330 bytes to 686 bytes for this function.
694(gcc 4.2, -O3) 740(gcc 4.2, -O3)
695 741
@@ -700,8 +746,10 @@ Conclusion
700The gain when calculating the ecc is tremendous. Om my development hardware 746The gain when calculating the ecc is tremendous. Om my development hardware
701a speedup of a factor of 18 for ecc calculation was achieved. On a test on an 747a speedup of a factor of 18 for ecc calculation was achieved. On a test on an
702embedded system with a MIPS core a factor 7 was obtained. 748embedded system with a MIPS core a factor 7 was obtained.
749
703On a test with a Linksys NSLU2 (ARMv5TE processor) the speedup was a factor 750On a test with a Linksys NSLU2 (ARMv5TE processor) the speedup was a factor
7045 (big endian mode, gcc 4.1.2, -O3) 7515 (big endian mode, gcc 4.1.2, -O3)
752
705For correction not much gain could be obtained (as bitflips are rare). Then 753For correction not much gain could be obtained (as bitflips are rare). Then
706again there are also much less cycles spent there. 754again there are also much less cycles spent there.
707 755
@@ -711,4 +759,5 @@ out of it with an assembler program, but due to pipeline behaviour etc
711this is very tricky (at least for intel hw). 759this is very tricky (at least for intel hw).
712 760
713Author: Frans Meulenbroeks 761Author: Frans Meulenbroeks
762
714Copyright (C) 2008 Koninklijke Philips Electronics NV. 763Copyright (C) 2008 Koninklijke Philips Electronics NV.
diff --git a/Documentation/mtd/spi-nor.txt b/Documentation/driver-api/mtd/spi-nor.rst
index da1fbff5a24c..f5333e3bf486 100644
--- a/Documentation/mtd/spi-nor.txt
+++ b/Documentation/driver-api/mtd/spi-nor.rst
@@ -1,5 +1,6 @@
1 SPI NOR framework 1=================
2 ============================================ 2SPI NOR framework
3=================
3 4
4Part I - Why do we need this framework? 5Part I - Why do we need this framework?
5--------------------------------------- 6---------------------------------------
@@ -23,7 +24,7 @@ This framework just adds a new layer between the MTD and the SPI bus driver.
23With this new layer, the SPI NOR controller driver does not depend on the 24With this new layer, the SPI NOR controller driver does not depend on the
24m25p80 code anymore. 25m25p80 code anymore.
25 26
26 Before this framework, the layer is like: 27Before this framework, the layer is like::
27 28
28 MTD 29 MTD
29 ------------------------ 30 ------------------------
diff --git a/Documentation/driver-api/nfc/index.rst b/Documentation/driver-api/nfc/index.rst
new file mode 100644
index 000000000000..b6e9eedbff29
--- /dev/null
+++ b/Documentation/driver-api/nfc/index.rst
@@ -0,0 +1,11 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3========================
4Near Field Communication
5========================
6
7.. toctree::
8 :maxdepth: 1
9
10 nfc-hci
11 nfc-pn544
diff --git a/Documentation/nfc/nfc-hci.txt b/Documentation/driver-api/nfc/nfc-hci.rst
index 0dc078cab972..eb8a1a14e919 100644
--- a/Documentation/nfc/nfc-hci.txt
+++ b/Documentation/driver-api/nfc/nfc-hci.rst
@@ -1,7 +1,9 @@
1========================
1HCI backend for NFC Core 2HCI backend for NFC Core
3========================
2 4
3Author: Eric Lapuyade, Samuel Ortiz 5- Author: Eric Lapuyade, Samuel Ortiz
4Contact: eric.lapuyade@intel.com, samuel.ortiz@intel.com 6- Contact: eric.lapuyade@intel.com, samuel.ortiz@intel.com
5 7
6General 8General
7------- 9-------
@@ -24,12 +26,13 @@ HCI events can also be received from the host controller. They will be handled
24and a translation will be forwarded to NFC Core as needed. There are hooks to 26and a translation will be forwarded to NFC Core as needed. There are hooks to
25let the HCI driver handle proprietary events or override standard behavior. 27let the HCI driver handle proprietary events or override standard behavior.
26HCI uses 2 execution contexts: 28HCI uses 2 execution contexts:
29
27- one for executing commands : nfc_hci_msg_tx_work(). Only one command 30- one for executing commands : nfc_hci_msg_tx_work(). Only one command
28can be executing at any given moment. 31 can be executing at any given moment.
29- one for dispatching received events and commands : nfc_hci_msg_rx_work(). 32- one for dispatching received events and commands : nfc_hci_msg_rx_work().
30 33
31HCI Session initialization: 34HCI Session initialization
32--------------------------- 35--------------------------
33 36
34The Session initialization is an HCI standard which must unfortunately 37The Session initialization is an HCI standard which must unfortunately
35support proprietary gates. This is the reason why the driver will pass a list 38support proprietary gates. This is the reason why the driver will pass a list
@@ -58,9 +61,9 @@ HCI Management
58-------------- 61--------------
59 62
60A driver would normally register itself with HCI and provide the following 63A driver would normally register itself with HCI and provide the following
61entry points: 64entry points::
62 65
63struct nfc_hci_ops { 66 struct nfc_hci_ops {
64 int (*open)(struct nfc_hci_dev *hdev); 67 int (*open)(struct nfc_hci_dev *hdev);
65 void (*close)(struct nfc_hci_dev *hdev); 68 void (*close)(struct nfc_hci_dev *hdev);
66 int (*hci_ready) (struct nfc_hci_dev *hdev); 69 int (*hci_ready) (struct nfc_hci_dev *hdev);
@@ -82,38 +85,38 @@ struct nfc_hci_ops {
82 struct nfc_target *target); 85 struct nfc_target *target);
83 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 86 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
84 struct sk_buff *skb); 87 struct sk_buff *skb);
85}; 88 };
86 89
87- open() and close() shall turn the hardware on and off. 90- open() and close() shall turn the hardware on and off.
88- hci_ready() is an optional entry point that is called right after the hci 91- hci_ready() is an optional entry point that is called right after the hci
89session has been set up. The driver can use it to do additional initialization 92 session has been set up. The driver can use it to do additional initialization
90that must be performed using HCI commands. 93 that must be performed using HCI commands.
91- xmit() shall simply write a frame to the physical link. 94- xmit() shall simply write a frame to the physical link.
92- start_poll() is an optional entrypoint that shall set the hardware in polling 95- start_poll() is an optional entrypoint that shall set the hardware in polling
93mode. This must be implemented only if the hardware uses proprietary gates or a 96 mode. This must be implemented only if the hardware uses proprietary gates or a
94mechanism slightly different from the HCI standard. 97 mechanism slightly different from the HCI standard.
95- dep_link_up() is called after a p2p target has been detected, to finish 98- dep_link_up() is called after a p2p target has been detected, to finish
96the p2p connection setup with hardware parameters that need to be passed back 99 the p2p connection setup with hardware parameters that need to be passed back
97to nfc core. 100 to nfc core.
98- dep_link_down() is called to bring the p2p link down. 101- dep_link_down() is called to bring the p2p link down.
99- target_from_gate() is an optional entrypoint to return the nfc protocols 102- target_from_gate() is an optional entrypoint to return the nfc protocols
100corresponding to a proprietary gate. 103 corresponding to a proprietary gate.
101- complete_target_discovered() is an optional entry point to let the driver 104- complete_target_discovered() is an optional entry point to let the driver
102perform additional proprietary processing necessary to auto activate the 105 perform additional proprietary processing necessary to auto activate the
103discovered target. 106 discovered target.
104- im_transceive() must be implemented by the driver if proprietary HCI commands 107- im_transceive() must be implemented by the driver if proprietary HCI commands
105are required to send data to the tag. Some tag types will require custom 108 are required to send data to the tag. Some tag types will require custom
106commands, others can be written to using the standard HCI commands. The driver 109 commands, others can be written to using the standard HCI commands. The driver
107can check the tag type and either do proprietary processing, or return 1 to ask 110 can check the tag type and either do proprietary processing, or return 1 to ask
108for standard processing. The data exchange command itself must be sent 111 for standard processing. The data exchange command itself must be sent
109asynchronously. 112 asynchronously.
110- tm_send() is called to send data in the case of a p2p connection 113- tm_send() is called to send data in the case of a p2p connection
111- check_presence() is an optional entry point that will be called regularly 114- check_presence() is an optional entry point that will be called regularly
112by the core to check that an activated tag is still in the field. If this is 115 by the core to check that an activated tag is still in the field. If this is
113not implemented, the core will not be able to push tag_lost events to the user 116 not implemented, the core will not be able to push tag_lost events to the user
114space 117 space
115- event_received() is called to handle an event coming from the chip. Driver 118- event_received() is called to handle an event coming from the chip. Driver
116can handle the event or return 1 to let HCI attempt standard processing. 119 can handle the event or return 1 to let HCI attempt standard processing.
117 120
118On the rx path, the driver is responsible to push incoming HCP frames to HCI 121On the rx path, the driver is responsible to push incoming HCP frames to HCI
119using nfc_hci_recv_frame(). HCI will take care of re-aggregation and handling 122using nfc_hci_recv_frame(). HCI will take care of re-aggregation and handling
@@ -122,20 +125,23 @@ This must be done from a context that can sleep.
122PHY Management 125PHY Management
123-------------- 126--------------
124 127
125The physical link (i2c, ...) management is defined by the following structure: 128The physical link (i2c, ...) management is defined by the following structure::
126 129
127struct nfc_phy_ops { 130 struct nfc_phy_ops {
128 int (*write)(void *dev_id, struct sk_buff *skb); 131 int (*write)(void *dev_id, struct sk_buff *skb);
129 int (*enable)(void *dev_id); 132 int (*enable)(void *dev_id);
130 void (*disable)(void *dev_id); 133 void (*disable)(void *dev_id);
131}; 134 };
132 135
133enable(): turn the phy on (power on), make it ready to transfer data 136enable():
134disable(): turn the phy off 137 turn the phy on (power on), make it ready to transfer data
135write(): Send a data frame to the chip. Note that to enable higher 138disable():
136layers such as an llc to store the frame for re-emission, this function must 139 turn the phy off
137not alter the skb. It must also not return a positive result (return 0 for 140write():
138success, negative for failure). 141 Send a data frame to the chip. Note that to enable higher
142 layers such as an llc to store the frame for re-emission, this
143 function must not alter the skb. It must also not return a positive
144 result (return 0 for success, negative for failure).
139 145
140Data coming from the chip shall be sent directly to nfc_hci_recv_frame(). 146Data coming from the chip shall be sent directly to nfc_hci_recv_frame().
141 147
@@ -145,9 +151,9 @@ LLC
145Communication between the CPU and the chip often requires some link layer 151Communication between the CPU and the chip often requires some link layer
146protocol. Those are isolated as modules managed by the HCI layer. There are 152protocol. Those are isolated as modules managed by the HCI layer. There are
147currently two modules : nop (raw transfert) and shdlc. 153currently two modules : nop (raw transfert) and shdlc.
148A new llc must implement the following functions: 154A new llc must implement the following functions::
149 155
150struct nfc_llc_ops { 156 struct nfc_llc_ops {
151 void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv, 157 void *(*init) (struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
152 rcv_to_hci_t rcv_to_hci, int tx_headroom, 158 rcv_to_hci_t rcv_to_hci, int tx_headroom,
153 int tx_tailroom, int *rx_headroom, int *rx_tailroom, 159 int tx_tailroom, int *rx_headroom, int *rx_tailroom,
@@ -157,17 +163,25 @@ struct nfc_llc_ops {
157 int (*stop) (struct nfc_llc *llc); 163 int (*stop) (struct nfc_llc *llc);
158 void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb); 164 void (*rcv_from_drv) (struct nfc_llc *llc, struct sk_buff *skb);
159 int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb); 165 int (*xmit_from_hci) (struct nfc_llc *llc, struct sk_buff *skb);
160}; 166 };
161 167
162- init() : allocate and init your private storage 168init():
163- deinit() : cleanup 169 allocate and init your private storage
164- start() : establish the logical connection 170deinit():
165- stop () : terminate the logical connection 171 cleanup
166- rcv_from_drv() : handle data coming from the chip, going to HCI 172start():
167- xmit_from_hci() : handle data sent by HCI, going to the chip 173 establish the logical connection
174stop ():
175 terminate the logical connection
176rcv_from_drv():
177 handle data coming from the chip, going to HCI
178xmit_from_hci():
179 handle data sent by HCI, going to the chip
168 180
169The llc must be registered with nfc before it can be used. Do that by 181The llc must be registered with nfc before it can be used. Do that by
170calling nfc_llc_register(const char *name, struct nfc_llc_ops *ops); 182calling::
183
184 nfc_llc_register(const char *name, struct nfc_llc_ops *ops);
171 185
172Again, note that the llc does not handle the physical link. It is thus very 186Again, note that the llc does not handle the physical link. It is thus very
173easy to mix any physical link with any llc for a given chip driver. 187easy to mix any physical link with any llc for a given chip driver.
@@ -187,26 +201,32 @@ fast, cannot sleep. sends incoming frames to HCI where they are passed to
187the current llc. In case of shdlc, the frame is queued in shdlc rx queue. 201the current llc. In case of shdlc, the frame is queued in shdlc rx queue.
188 202
189- SHDLC State Machine worker (SMW) 203- SHDLC State Machine worker (SMW)
190Only when llc_shdlc is used: handles shdlc rx & tx queues. 204
191Dispatches HCI cmd responses. 205 Only when llc_shdlc is used: handles shdlc rx & tx queues.
206
207 Dispatches HCI cmd responses.
192 208
193- HCI Tx Cmd worker (MSGTXWQ) 209- HCI Tx Cmd worker (MSGTXWQ)
194Serializes execution of HCI commands. Completes execution in case of response 210
195timeout. 211 Serializes execution of HCI commands.
212
213 Completes execution in case of response timeout.
196 214
197- HCI Rx worker (MSGRXWQ) 215- HCI Rx worker (MSGRXWQ)
198Dispatches incoming HCI commands or events. 216
217 Dispatches incoming HCI commands or events.
199 218
200- Syscall context from a userspace call (SYSCALL) 219- Syscall context from a userspace call (SYSCALL)
201Any entrypoint in HCI called from NFC Core 220
221 Any entrypoint in HCI called from NFC Core
202 222
203Workflow executing an HCI command (using shdlc) 223Workflow executing an HCI command (using shdlc)
204----------------------------------------------- 224-----------------------------------------------
205 225
206Executing an HCI command can easily be performed synchronously using the 226Executing an HCI command can easily be performed synchronously using the
207following API: 227following API::
208 228
209int nfc_hci_send_cmd (struct nfc_hci_dev *hdev, u8 gate, u8 cmd, 229 int nfc_hci_send_cmd (struct nfc_hci_dev *hdev, u8 gate, u8 cmd,
210 const u8 *param, size_t param_len, struct sk_buff **skb) 230 const u8 *param, size_t param_len, struct sk_buff **skb)
211 231
212The API must be invoked from a context that can sleep. Most of the time, this 232The API must be invoked from a context that can sleep. Most of the time, this
@@ -234,11 +254,11 @@ waiting command execution. Response processing involves invoking the completion
234callback that was provided by nfc_hci_msg_tx_work() when it sent the command. 254callback that was provided by nfc_hci_msg_tx_work() when it sent the command.
235The completion callback will then wake the syscall context. 255The completion callback will then wake the syscall context.
236 256
237It is also possible to execute the command asynchronously using this API: 257It is also possible to execute the command asynchronously using this API::
238 258
239static int nfc_hci_execute_cmd_async(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd, 259 static int nfc_hci_execute_cmd_async(struct nfc_hci_dev *hdev, u8 pipe, u8 cmd,
240 const u8 *param, size_t param_len, 260 const u8 *param, size_t param_len,
241 data_exchange_cb_t cb, void *cb_context) 261 data_exchange_cb_t cb, void *cb_context)
242 262
243The workflow is the same, except that the API call returns immediately, and 263The workflow is the same, except that the API call returns immediately, and
244the callback will be called with the result from the SMW context. 264the callback will be called with the result from the SMW context.
@@ -268,23 +288,24 @@ went wrong below and know that expected events will probably never happen.
268Handling of these errors is done as follows: 288Handling of these errors is done as follows:
269 289
270- driver (pn544) fails to deliver an incoming frame: it stores the error such 290- driver (pn544) fails to deliver an incoming frame: it stores the error such
271that any subsequent call to the driver will result in this error. Then it calls 291 that any subsequent call to the driver will result in this error. Then it
272the standard nfc_shdlc_recv_frame() with a NULL argument to report the problem 292 calls the standard nfc_shdlc_recv_frame() with a NULL argument to report the
273above. shdlc stores a EREMOTEIO sticky status, which will trigger SMW to 293 problem above. shdlc stores a EREMOTEIO sticky status, which will trigger
274report above in turn. 294 SMW to report above in turn.
275 295
276- SMW is basically a background thread to handle incoming and outgoing shdlc 296- SMW is basically a background thread to handle incoming and outgoing shdlc
277frames. This thread will also check the shdlc sticky status and report to HCI 297 frames. This thread will also check the shdlc sticky status and report to HCI
278when it discovers it is not able to run anymore because of an unrecoverable 298 when it discovers it is not able to run anymore because of an unrecoverable
279error that happened within shdlc or below. If the problem occurs during shdlc 299 error that happened within shdlc or below. If the problem occurs during shdlc
280connection, the error is reported through the connect completion. 300 connection, the error is reported through the connect completion.
281 301
282- HCI: if an internal HCI error happens (frame is lost), or HCI is reported an 302- HCI: if an internal HCI error happens (frame is lost), or HCI is reported an
283error from a lower layer, HCI will either complete the currently executing 303 error from a lower layer, HCI will either complete the currently executing
284command with that error, or notify NFC Core directly if no command is executing. 304 command with that error, or notify NFC Core directly if no command is
305 executing.
285 306
286- NFC Core: when NFC Core is notified of an error from below and polling is 307- NFC Core: when NFC Core is notified of an error from below and polling is
287active, it will send a tag discovered event with an empty tag list to the user 308 active, it will send a tag discovered event with an empty tag list to the user
288space to let it know that the poll operation will never be able to detect a tag. 309 space to let it know that the poll operation will never be able to detect a
289If polling is not active and the error was sticky, lower levels will return it 310 tag. If polling is not active and the error was sticky, lower levels will
290at next invocation. 311 return it at next invocation.
diff --git a/Documentation/nfc/nfc-pn544.txt b/Documentation/driver-api/nfc/nfc-pn544.rst
index b36ca14ca2d6..6b2d8aae0c4e 100644
--- a/Documentation/nfc/nfc-pn544.txt
+++ b/Documentation/driver-api/nfc/nfc-pn544.rst
@@ -1,5 +1,7 @@
1Kernel driver for the NXP Semiconductors PN544 Near Field 1============================================================================
2Communication chip 2Kernel driver for the NXP Semiconductors PN544 Near Field Communication chip
3============================================================================
4
3 5
4General 6General
5------- 7-------
diff --git a/Documentation/ntb.txt b/Documentation/driver-api/ntb.rst
index 074a423c853c..074a423c853c 100644
--- a/Documentation/ntb.txt
+++ b/Documentation/driver-api/ntb.rst
diff --git a/Documentation/nvdimm/btt.txt b/Documentation/driver-api/nvdimm/btt.rst
index e293fb664924..107395c042ae 100644
--- a/Documentation/nvdimm/btt.txt
+++ b/Documentation/driver-api/nvdimm/btt.rst
@@ -1,9 +1,10 @@
1=============================
1BTT - Block Translation Table 2BTT - Block Translation Table
2============================= 3=============================
3 4
4 5
51. Introduction 61. Introduction
6--------------- 7===============
7 8
8Persistent memory based storage is able to perform IO at byte (or more 9Persistent memory based storage is able to perform IO at byte (or more
9accurately, cache line) granularity. However, we often want to expose such 10accurately, cache line) granularity. However, we often want to expose such
@@ -25,7 +26,7 @@ provides atomic sector updates.
25 26
26 27
272. Static Layout 282. Static Layout
28---------------- 29================
29 30
30The underlying storage on which a BTT can be laid out is not limited in any way. 31The underlying storage on which a BTT can be laid out is not limited in any way.
31The BTT, however, splits the available space into chunks of up to 512 GiB, 32The BTT, however, splits the available space into chunks of up to 512 GiB,
@@ -33,43 +34,43 @@ called "Arenas".
33 34
34Each arena follows the same layout for its metadata, and all references in an 35Each arena follows the same layout for its metadata, and all references in an
35arena are internal to it (with the exception of one field that points to the 36arena are internal to it (with the exception of one field that points to the
36next arena). The following depicts the "On-disk" metadata layout: 37next arena). The following depicts the "On-disk" metadata layout::
37 38
38 39
39 Backing Store +-------> Arena 40 Backing Store +-------> Arena
40+---------------+ | +------------------+ 41 +---------------+ | +------------------+
41| | | | Arena info block | 42 | | | | Arena info block |
42| Arena 0 +---+ | 4K | 43 | Arena 0 +---+ | 4K |
43| 512G | +------------------+ 44 | 512G | +------------------+
44| | | | 45 | | | |
45+---------------+ | | 46 +---------------+ | |
46| | | | 47 | | | |
47| Arena 1 | | Data Blocks | 48 | Arena 1 | | Data Blocks |
48| 512G | | | 49 | 512G | | |
49| | | | 50 | | | |
50+---------------+ | | 51 +---------------+ | |
51| . | | | 52 | . | | |
52| . | | | 53 | . | | |
53| . | | | 54 | . | | |
54| | | | 55 | | | |
55| | | | 56 | | | |
56+---------------+ +------------------+ 57 +---------------+ +------------------+
57 | | 58 | |
58 | BTT Map | 59 | BTT Map |
59 | | 60 | |
60 | | 61 | |
61 +------------------+ 62 +------------------+
62 | | 63 | |
63 | BTT Flog | 64 | BTT Flog |
64 | | 65 | |
65 +------------------+ 66 +------------------+
66 | Info block copy | 67 | Info block copy |
67 | 4K | 68 | 4K |
68 +------------------+ 69 +------------------+
69 70
70 71
713. Theory of Operation 723. Theory of Operation
72---------------------- 73======================
73 74
74 75
75a. The BTT Map 76a. The BTT Map
@@ -79,31 +80,37 @@ The map is a simple lookup/indirection table that maps an LBA to an internal
79block. Each map entry is 32 bits. The two most significant bits are special 80block. Each map entry is 32 bits. The two most significant bits are special
80flags, and the remaining form the internal block number. 81flags, and the remaining form the internal block number.
81 82
83======== =============================================================
82Bit Description 84Bit Description
8331 - 30 : Error and Zero flags - Used in the following way: 85======== =============================================================
84 Bit Description 8631 - 30 Error and Zero flags - Used in the following way::
85 31 30
86 -----------------------------------------------------------------------
87 00 Initial state. Reads return zeroes; Premap = Postmap
88 01 Zero state: Reads return zeroes
89 10 Error state: Reads fail; Writes clear 'E' bit
90 11 Normal Block – has valid postmap
91 87
88 == == ====================================================
89 31 30 Description
90 == == ====================================================
91 0 0 Initial state. Reads return zeroes; Premap = Postmap
92 0 1 Zero state: Reads return zeroes
93 1 0 Error state: Reads fail; Writes clear 'E' bit
94 1 1 Normal Block – has valid postmap
95 == == ====================================================
92 96
9329 - 0 : Mappings to internal 'postmap' blocks 9729 - 0 Mappings to internal 'postmap' blocks
98======== =============================================================
94 99
95 100
96Some of the terminology that will be subsequently used: 101Some of the terminology that will be subsequently used:
97 102
98External LBA : LBA as made visible to upper layers. 103============ ================================================================
99ABA : Arena Block Address - Block offset/number within an arena 104External LBA LBA as made visible to upper layers.
100Premap ABA : The block offset into an arena, which was decided upon by range 105ABA Arena Block Address - Block offset/number within an arena
106Premap ABA The block offset into an arena, which was decided upon by range
101 checking the External LBA 107 checking the External LBA
102Postmap ABA : The block number in the "Data Blocks" area obtained after 108Postmap ABA The block number in the "Data Blocks" area obtained after
103 indirection from the map 109 indirection from the map
104nfree : The number of free blocks that are maintained at any given time. 110nfree The number of free blocks that are maintained at any given time.
105 This is the number of concurrent writes that can happen to the 111 This is the number of concurrent writes that can happen to the
106 arena. 112 arena.
113============ ================================================================
107 114
108 115
109For example, after adding a BTT, we surface a disk of 1024G. We get a read for 116For example, after adding a BTT, we surface a disk of 1024G. We get a read for
@@ -121,19 +128,21 @@ i.e. Every write goes to a "free" block. A running list of free blocks is
121maintained in the form of the BTT flog. 'Flog' is a combination of the words 128maintained in the form of the BTT flog. 'Flog' is a combination of the words
122"free list" and "log". The flog contains 'nfree' entries, and an entry contains: 129"free list" and "log". The flog contains 'nfree' entries, and an entry contains:
123 130
124lba : The premap ABA that is being written to 131======== =====================================================================
125old_map : The old postmap ABA - after 'this' write completes, this will be a 132lba The premap ABA that is being written to
133old_map The old postmap ABA - after 'this' write completes, this will be a
126 free block. 134 free block.
127new_map : The new postmap ABA. The map will up updated to reflect this 135new_map The new postmap ABA. The map will up updated to reflect this
128 lba->postmap_aba mapping, but we log it here in case we have to 136 lba->postmap_aba mapping, but we log it here in case we have to
129 recover. 137 recover.
130seq : Sequence number to mark which of the 2 sections of this flog entry is 138seq Sequence number to mark which of the 2 sections of this flog entry is
131 valid/newest. It cycles between 01->10->11->01 (binary) under normal 139 valid/newest. It cycles between 01->10->11->01 (binary) under normal
132 operation, with 00 indicating an uninitialized state. 140 operation, with 00 indicating an uninitialized state.
133lba' : alternate lba entry 141lba' alternate lba entry
134old_map': alternate old postmap entry 142old_map' alternate old postmap entry
135new_map': alternate new postmap entry 143new_map' alternate new postmap entry
136seq' : alternate sequence number. 144seq' alternate sequence number.
145======== =====================================================================
137 146
138Each of the above fields is 32-bit, making one entry 32 bytes. Entries are also 147Each of the above fields is 32-bit, making one entry 32 bytes. Entries are also
139padded to 64 bytes to avoid cache line sharing or aliasing. Flog updates are 148padded to 64 bytes to avoid cache line sharing or aliasing. Flog updates are
@@ -147,8 +156,10 @@ c. The concept of lanes
147 156
148While 'nfree' describes the number of concurrent IOs an arena can process 157While 'nfree' describes the number of concurrent IOs an arena can process
149concurrently, 'nlanes' is the number of IOs the BTT device as a whole can 158concurrently, 'nlanes' is the number of IOs the BTT device as a whole can
150process. 159process::
151 nlanes = min(nfree, num_cpus) 160
161 nlanes = min(nfree, num_cpus)
162
152A lane number is obtained at the start of any IO, and is used for indexing into 163A lane number is obtained at the start of any IO, and is used for indexing into
153all the on-disk and in-memory data structures for the duration of the IO. If 164all the on-disk and in-memory data structures for the duration of the IO. If
154there are more CPUs than the max number of available lanes, than lanes are 165there are more CPUs than the max number of available lanes, than lanes are
@@ -180,10 +191,10 @@ e. In-memory data structure: map locks
180-------------------------------------- 191--------------------------------------
181 192
182Consider a case where two writer threads are writing to the same LBA. There can 193Consider a case where two writer threads are writing to the same LBA. There can
183be a race in the following sequence of steps: 194be a race in the following sequence of steps::
184 195
185free[lane] = map[premap_aba] 196 free[lane] = map[premap_aba]
186map[premap_aba] = postmap_aba 197 map[premap_aba] = postmap_aba
187 198
188Both threads can update their respective free[lane] with the same old, freed 199Both threads can update their respective free[lane] with the same old, freed
189postmap_aba. This has made the layout inconsistent by losing a free entry, and 200postmap_aba. This has made the layout inconsistent by losing a free entry, and
@@ -202,6 +213,7 @@ On startup, we analyze the BTT flog to create our list of free blocks. We walk
202through all the entries, and for each lane, of the set of two possible 213through all the entries, and for each lane, of the set of two possible
203'sections', we always look at the most recent one only (based on the sequence 214'sections', we always look at the most recent one only (based on the sequence
204number). The reconstruction rules/steps are simple: 215number). The reconstruction rules/steps are simple:
216
205- Read map[log_entry.lba]. 217- Read map[log_entry.lba].
206- If log_entry.new matches the map entry, then log_entry.old is free. 218- If log_entry.new matches the map entry, then log_entry.old is free.
207- If log_entry.new does not match the map entry, then log_entry.new is free. 219- If log_entry.new does not match the map entry, then log_entry.new is free.
@@ -228,7 +240,7 @@ Write:
2281. Convert external LBA to Arena number + pre-map ABA 2401. Convert external LBA to Arena number + pre-map ABA
2292. Get a lane (and take lane_lock) 2412. Get a lane (and take lane_lock)
2303. Use lane to index into in-memory free list and obtain a new block, next flog 2423. Use lane to index into in-memory free list and obtain a new block, next flog
231 index, next sequence number 243 index, next sequence number
2324. Scan the RTT to check if free block is present, and spin/wait if it is. 2444. Scan the RTT to check if free block is present, and spin/wait if it is.
2335. Write data to this free block 2455. Write data to this free block
2346. Read map to get the existing post-map ABA entry for this pre-map ABA 2466. Read map to get the existing post-map ABA entry for this pre-map ABA
@@ -245,6 +257,7 @@ Write:
245An arena would be in an error state if any of the metadata is corrupted 257An arena would be in an error state if any of the metadata is corrupted
246irrecoverably, either due to a bug or a media error. The following conditions 258irrecoverably, either due to a bug or a media error. The following conditions
247indicate an error: 259indicate an error:
260
248- Info block checksum does not match (and recovering from the copy also fails) 261- Info block checksum does not match (and recovering from the copy also fails)
249- All internal available blocks are not uniquely and entirely addressed by the 262- All internal available blocks are not uniquely and entirely addressed by the
250 sum of mapped blocks and free blocks (from the BTT flog). 263 sum of mapped blocks and free blocks (from the BTT flog).
@@ -263,11 +276,10 @@ The BTT can be set up on any disk (namespace) exposed by the libnvdimm subsystem
263(pmem, or blk mode). The easiest way to set up such a namespace is using the 276(pmem, or blk mode). The easiest way to set up such a namespace is using the
264'ndctl' utility [1]: 277'ndctl' utility [1]:
265 278
266For example, the ndctl command line to setup a btt with a 4k sector size is: 279For example, the ndctl command line to setup a btt with a 4k sector size is::
267 280
268 ndctl create-namespace -f -e namespace0.0 -m sector -l 4k 281 ndctl create-namespace -f -e namespace0.0 -m sector -l 4k
269 282
270See ndctl create-namespace --help for more options. 283See ndctl create-namespace --help for more options.
271 284
272[1]: https://github.com/pmem/ndctl 285[1]: https://github.com/pmem/ndctl
273
diff --git a/Documentation/driver-api/nvdimm/index.rst b/Documentation/driver-api/nvdimm/index.rst
new file mode 100644
index 000000000000..a4f8f98aeb94
--- /dev/null
+++ b/Documentation/driver-api/nvdimm/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===================================
4Non-Volatile Memory Device (NVDIMM)
5===================================
6
7.. toctree::
8 :maxdepth: 1
9
10 nvdimm
11 btt
12 security
diff --git a/Documentation/nvdimm/nvdimm.txt b/Documentation/driver-api/nvdimm/nvdimm.rst
index 1669f626b037..08f855cbb4e6 100644
--- a/Documentation/nvdimm/nvdimm.txt
+++ b/Documentation/driver-api/nvdimm/nvdimm.rst
@@ -1,8 +1,14 @@
1 LIBNVDIMM: Non-Volatile Devices 1===============================
2 libnvdimm - kernel / libndctl - userspace helper library 2LIBNVDIMM: Non-Volatile Devices
3 linux-nvdimm@lists.01.org 3===============================
4 v13
5 4
5libnvdimm - kernel / libndctl - userspace helper library
6
7linux-nvdimm@lists.01.org
8
9Version 13
10
11.. contents:
6 12
7 Glossary 13 Glossary
8 Overview 14 Overview
@@ -40,49 +46,57 @@
40 46
41 47
42Glossary 48Glossary
43-------- 49========
44 50
45PMEM: A system-physical-address range where writes are persistent. A 51PMEM:
46block device composed of PMEM is capable of DAX. A PMEM address range 52 A system-physical-address range where writes are persistent. A
47may span an interleave of several DIMMs. 53 block device composed of PMEM is capable of DAX. A PMEM address range
48 54 may span an interleave of several DIMMs.
49BLK: A set of one or more programmable memory mapped apertures provided 55
50by a DIMM to access its media. This indirection precludes the 56BLK:
51performance benefit of interleaving, but enables DIMM-bounded failure 57 A set of one or more programmable memory mapped apertures provided
52modes. 58 by a DIMM to access its media. This indirection precludes the
53 59 performance benefit of interleaving, but enables DIMM-bounded failure
54DPA: DIMM Physical Address, is a DIMM-relative offset. With one DIMM in 60 modes.
55the system there would be a 1:1 system-physical-address:DPA association. 61
56Once more DIMMs are added a memory controller interleave must be 62DPA:
57decoded to determine the DPA associated with a given 63 DIMM Physical Address, is a DIMM-relative offset. With one DIMM in
58system-physical-address. BLK capacity always has a 1:1 relationship 64 the system there would be a 1:1 system-physical-address:DPA association.
59with a single-DIMM's DPA range. 65 Once more DIMMs are added a memory controller interleave must be
60 66 decoded to determine the DPA associated with a given
61DAX: File system extensions to bypass the page cache and block layer to 67 system-physical-address. BLK capacity always has a 1:1 relationship
62mmap persistent memory, from a PMEM block device, directly into a 68 with a single-DIMM's DPA range.
63process address space. 69
64 70DAX:
65DSM: Device Specific Method: ACPI method to to control specific 71 File system extensions to bypass the page cache and block layer to
66device - in this case the firmware. 72 mmap persistent memory, from a PMEM block device, directly into a
67 73 process address space.
68DCR: NVDIMM Control Region Structure defined in ACPI 6 Section 5.2.25.5. 74
69It defines a vendor-id, device-id, and interface format for a given DIMM. 75DSM:
70 76 Device Specific Method: ACPI method to to control specific
71BTT: Block Translation Table: Persistent memory is byte addressable. 77 device - in this case the firmware.
72Existing software may have an expectation that the power-fail-atomicity 78
73of writes is at least one sector, 512 bytes. The BTT is an indirection 79DCR:
74table with atomic update semantics to front a PMEM/BLK block device 80 NVDIMM Control Region Structure defined in ACPI 6 Section 5.2.25.5.
75driver and present arbitrary atomic sector sizes. 81 It defines a vendor-id, device-id, and interface format for a given DIMM.
76 82
77LABEL: Metadata stored on a DIMM device that partitions and identifies 83BTT:
78(persistently names) storage between PMEM and BLK. It also partitions 84 Block Translation Table: Persistent memory is byte addressable.
79BLK storage to host BTTs with different parameters per BLK-partition. 85 Existing software may have an expectation that the power-fail-atomicity
80Note that traditional partition tables, GPT/MBR, are layered on top of a 86 of writes is at least one sector, 512 bytes. The BTT is an indirection
81BLK or PMEM device. 87 table with atomic update semantics to front a PMEM/BLK block device
88 driver and present arbitrary atomic sector sizes.
89
90LABEL:
91 Metadata stored on a DIMM device that partitions and identifies
92 (persistently names) storage between PMEM and BLK. It also partitions
93 BLK storage to host BTTs with different parameters per BLK-partition.
94 Note that traditional partition tables, GPT/MBR, are layered on top of a
95 BLK or PMEM device.
82 96
83 97
84Overview 98Overview
85-------- 99========
86 100
87The LIBNVDIMM subsystem provides support for three types of NVDIMMs, namely, 101The LIBNVDIMM subsystem provides support for three types of NVDIMMs, namely,
88PMEM, BLK, and NVDIMM devices that can simultaneously support both PMEM 102PMEM, BLK, and NVDIMM devices that can simultaneously support both PMEM
@@ -96,19 +110,30 @@ accessible via BLK. When that occurs a LABEL is needed to reserve DPA
96for exclusive access via one mode a time. 110for exclusive access via one mode a time.
97 111
98Supporting Documents 112Supporting Documents
99ACPI 6: http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf 113--------------------
100NVDIMM Namespace: http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf 114
101DSM Interface Example: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf 115ACPI 6:
102Driver Writer's Guide: http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf 116 http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf
117NVDIMM Namespace:
118 http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf
119DSM Interface Example:
120 http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
121Driver Writer's Guide:
122 http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf
103 123
104Git Trees 124Git Trees
105LIBNVDIMM: https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git 125---------
106LIBNDCTL: https://github.com/pmem/ndctl.git 126
107PMEM: https://github.com/01org/prd 127LIBNVDIMM:
128 https://git.kernel.org/cgit/linux/kernel/git/djbw/nvdimm.git
129LIBNDCTL:
130 https://github.com/pmem/ndctl.git
131PMEM:
132 https://github.com/01org/prd
108 133
109 134
110LIBNVDIMM PMEM and BLK 135LIBNVDIMM PMEM and BLK
111------------------ 136======================
112 137
113Prior to the arrival of the NFIT, non-volatile memory was described to a 138Prior to the arrival of the NFIT, non-volatile memory was described to a
114system in various ad-hoc ways. Usually only the bare minimum was 139system in various ad-hoc ways. Usually only the bare minimum was
@@ -122,38 +147,39 @@ For each NVDIMM access method (PMEM, BLK), LIBNVDIMM provides a block
122device driver: 147device driver:
123 148
124 1. PMEM (nd_pmem.ko): Drives a system-physical-address range. This 149 1. PMEM (nd_pmem.ko): Drives a system-physical-address range. This
125 range is contiguous in system memory and may be interleaved (hardware 150 range is contiguous in system memory and may be interleaved (hardware
126 memory controller striped) across multiple DIMMs. When interleaved the 151 memory controller striped) across multiple DIMMs. When interleaved the
127 platform may optionally provide details of which DIMMs are participating 152 platform may optionally provide details of which DIMMs are participating
128 in the interleave. 153 in the interleave.
129 154
130 Note that while LIBNVDIMM describes system-physical-address ranges that may 155 Note that while LIBNVDIMM describes system-physical-address ranges that may
131 alias with BLK access as ND_NAMESPACE_PMEM ranges and those without 156 alias with BLK access as ND_NAMESPACE_PMEM ranges and those without
132 alias as ND_NAMESPACE_IO ranges, to the nd_pmem driver there is no 157 alias as ND_NAMESPACE_IO ranges, to the nd_pmem driver there is no
133 distinction. The different device-types are an implementation detail 158 distinction. The different device-types are an implementation detail
134 that userspace can exploit to implement policies like "only interface 159 that userspace can exploit to implement policies like "only interface
135 with address ranges from certain DIMMs". It is worth noting that when 160 with address ranges from certain DIMMs". It is worth noting that when
136 aliasing is present and a DIMM lacks a label, then no block device can 161 aliasing is present and a DIMM lacks a label, then no block device can
137 be created by default as userspace needs to do at least one allocation 162 be created by default as userspace needs to do at least one allocation
138 of DPA to the PMEM range. In contrast ND_NAMESPACE_IO ranges, once 163 of DPA to the PMEM range. In contrast ND_NAMESPACE_IO ranges, once
139 registered, can be immediately attached to nd_pmem. 164 registered, can be immediately attached to nd_pmem.
140 165
141 2. BLK (nd_blk.ko): This driver performs I/O using a set of platform 166 2. BLK (nd_blk.ko): This driver performs I/O using a set of platform
142 defined apertures. A set of apertures will access just one DIMM. 167 defined apertures. A set of apertures will access just one DIMM.
143 Multiple windows (apertures) allow multiple concurrent accesses, much like 168 Multiple windows (apertures) allow multiple concurrent accesses, much like
144 tagged-command-queuing, and would likely be used by different threads or 169 tagged-command-queuing, and would likely be used by different threads or
145 different CPUs. 170 different CPUs.
171
172 The NFIT specification defines a standard format for a BLK-aperture, but
173 the spec also allows for vendor specific layouts, and non-NFIT BLK
174 implementations may have other designs for BLK I/O. For this reason
175 "nd_blk" calls back into platform-specific code to perform the I/O.
146 176
147 The NFIT specification defines a standard format for a BLK-aperture, but 177 One such implementation is defined in the "Driver Writer's Guide" and "DSM
148 the spec also allows for vendor specific layouts, and non-NFIT BLK 178 Interface Example".
149 implementations may have other designs for BLK I/O. For this reason
150 "nd_blk" calls back into platform-specific code to perform the I/O.
151 One such implementation is defined in the "Driver Writer's Guide" and "DSM
152 Interface Example".
153 179
154 180
155Why BLK? 181Why BLK?
156-------- 182========
157 183
158While PMEM provides direct byte-addressable CPU-load/store access to 184While PMEM provides direct byte-addressable CPU-load/store access to
159NVDIMM storage, it does not provide the best system RAS (recovery, 185NVDIMM storage, it does not provide the best system RAS (recovery,
@@ -162,12 +188,15 @@ system-physical-address address causes a CPU exception while an access
162to a corrupted address through an BLK-aperture causes that block window 188to a corrupted address through an BLK-aperture causes that block window
163to raise an error status in a register. The latter is more aligned with 189to raise an error status in a register. The latter is more aligned with
164the standard error model that host-bus-adapter attached disks present. 190the standard error model that host-bus-adapter attached disks present.
191
165Also, if an administrator ever wants to replace a memory it is easier to 192Also, if an administrator ever wants to replace a memory it is easier to
166service a system at DIMM module boundaries. Compare this to PMEM where 193service a system at DIMM module boundaries. Compare this to PMEM where
167data could be interleaved in an opaque hardware specific manner across 194data could be interleaved in an opaque hardware specific manner across
168several DIMMs. 195several DIMMs.
169 196
170PMEM vs BLK 197PMEM vs BLK
198-----------
199
171BLK-apertures solve these RAS problems, but their presence is also the 200BLK-apertures solve these RAS problems, but their presence is also the
172major contributing factor to the complexity of the ND subsystem. They 201major contributing factor to the complexity of the ND subsystem. They
173complicate the implementation because PMEM and BLK alias in DPA space. 202complicate the implementation because PMEM and BLK alias in DPA space.
@@ -185,13 +214,14 @@ carved into an arbitrary number of BLK devices with discontiguous
185extents. 214extents.
186 215
187BLK-REGIONs, PMEM-REGIONs, Atomic Sectors, and DAX 216BLK-REGIONs, PMEM-REGIONs, Atomic Sectors, and DAX
188-------------------------------------------------- 217^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189 218
190One of the few 219One of the few
191reasons to allow multiple BLK namespaces per REGION is so that each 220reasons to allow multiple BLK namespaces per REGION is so that each
192BLK-namespace can be configured with a BTT with unique atomic sector 221BLK-namespace can be configured with a BTT with unique atomic sector
193sizes. While a PMEM device can host a BTT the LABEL specification does 222sizes. While a PMEM device can host a BTT the LABEL specification does
194not provide for a sector size to be specified for a PMEM namespace. 223not provide for a sector size to be specified for a PMEM namespace.
224
195This is due to the expectation that the primary usage model for PMEM is 225This is due to the expectation that the primary usage model for PMEM is
196via DAX, and the BTT is incompatible with DAX. However, for the cases 226via DAX, and the BTT is incompatible with DAX. However, for the cases
197where an application or filesystem still needs atomic sector update 227where an application or filesystem still needs atomic sector update
@@ -200,52 +230,52 @@ LIBNVDIMM/NDCTL: Block Translation Table "btt"
200 230
201 231
202Example NVDIMM Platform 232Example NVDIMM Platform
203----------------------- 233=======================
204 234
205For the remainder of this document the following diagram will be 235For the remainder of this document the following diagram will be
206referenced for any example sysfs layouts. 236referenced for any example sysfs layouts::
207 237
208 238
209 (a) (b) DIMM BLK-REGION 239 (a) (b) DIMM BLK-REGION
210 +-------------------+--------+--------+--------+ 240 +-------------------+--------+--------+--------+
211+------+ | pm0.0 | blk2.0 | pm1.0 | blk2.1 | 0 region2 241 +------+ | pm0.0 | blk2.0 | pm1.0 | blk2.1 | 0 region2
212| imc0 +--+- - - region0- - - +--------+ +--------+ 242 | imc0 +--+- - - region0- - - +--------+ +--------+
213+--+---+ | pm0.0 | blk3.0 | pm1.0 | blk3.1 | 1 region3 243 +--+---+ | pm0.0 | blk3.0 | pm1.0 | blk3.1 | 1 region3
214 | +-------------------+--------v v--------+ 244 | +-------------------+--------v v--------+
215+--+---+ | | 245 +--+---+ | |
216| cpu0 | region1 246 | cpu0 | region1
217+--+---+ | | 247 +--+---+ | |
218 | +----------------------------^ ^--------+ 248 | +----------------------------^ ^--------+
219+--+---+ | blk4.0 | pm1.0 | blk4.0 | 2 region4 249 +--+---+ | blk4.0 | pm1.0 | blk4.0 | 2 region4
220| imc1 +--+----------------------------| +--------+ 250 | imc1 +--+----------------------------| +--------+
221+------+ | blk5.0 | pm1.0 | blk5.0 | 3 region5 251 +------+ | blk5.0 | pm1.0 | blk5.0 | 3 region5
222 +----------------------------+--------+--------+ 252 +----------------------------+--------+--------+
223 253
224In this platform we have four DIMMs and two memory controllers in one 254In this platform we have four DIMMs and two memory controllers in one
225socket. Each unique interface (BLK or PMEM) to DPA space is identified 255socket. Each unique interface (BLK or PMEM) to DPA space is identified
226by a region device with a dynamically assigned id (REGION0 - REGION5). 256by a region device with a dynamically assigned id (REGION0 - REGION5).
227 257
228 1. The first portion of DIMM0 and DIMM1 are interleaved as REGION0. A 258 1. The first portion of DIMM0 and DIMM1 are interleaved as REGION0. A
229 single PMEM namespace is created in the REGION0-SPA-range that spans most 259 single PMEM namespace is created in the REGION0-SPA-range that spans most
230 of DIMM0 and DIMM1 with a user-specified name of "pm0.0". Some of that 260 of DIMM0 and DIMM1 with a user-specified name of "pm0.0". Some of that
231 interleaved system-physical-address range is reclaimed as BLK-aperture 261 interleaved system-physical-address range is reclaimed as BLK-aperture
232 accessed space starting at DPA-offset (a) into each DIMM. In that 262 accessed space starting at DPA-offset (a) into each DIMM. In that
233 reclaimed space we create two BLK-aperture "namespaces" from REGION2 and 263 reclaimed space we create two BLK-aperture "namespaces" from REGION2 and
234 REGION3 where "blk2.0" and "blk3.0" are just human readable names that 264 REGION3 where "blk2.0" and "blk3.0" are just human readable names that
235 could be set to any user-desired name in the LABEL. 265 could be set to any user-desired name in the LABEL.
236 266
237 2. In the last portion of DIMM0 and DIMM1 we have an interleaved 267 2. In the last portion of DIMM0 and DIMM1 we have an interleaved
238 system-physical-address range, REGION1, that spans those two DIMMs as 268 system-physical-address range, REGION1, that spans those two DIMMs as
239 well as DIMM2 and DIMM3. Some of REGION1 is allocated to a PMEM namespace 269 well as DIMM2 and DIMM3. Some of REGION1 is allocated to a PMEM namespace
240 named "pm1.0", the rest is reclaimed in 4 BLK-aperture namespaces (for 270 named "pm1.0", the rest is reclaimed in 4 BLK-aperture namespaces (for
241 each DIMM in the interleave set), "blk2.1", "blk3.1", "blk4.0", and 271 each DIMM in the interleave set), "blk2.1", "blk3.1", "blk4.0", and
242 "blk5.0". 272 "blk5.0".
243 273
244 3. The portion of DIMM2 and DIMM3 that do not participate in the REGION1 274 3. The portion of DIMM2 and DIMM3 that do not participate in the REGION1
245 interleaved system-physical-address range (i.e. the DPA address past 275 interleaved system-physical-address range (i.e. the DPA address past
246 offset (b) are also included in the "blk4.0" and "blk5.0" namespaces. 276 offset (b) are also included in the "blk4.0" and "blk5.0" namespaces.
247 Note, that this example shows that BLK-aperture namespaces don't need to 277 Note, that this example shows that BLK-aperture namespaces don't need to
248 be contiguous in DPA-space. 278 be contiguous in DPA-space.
249 279
250 This bus is provided by the kernel under the device 280 This bus is provided by the kernel under the device
251 /sys/devices/platform/nfit_test.0 when CONFIG_NFIT_TEST is enabled and 281 /sys/devices/platform/nfit_test.0 when CONFIG_NFIT_TEST is enabled and
@@ -254,7 +284,7 @@ by a region device with a dynamically assigned id (REGION0 - REGION5).
254 284
255 285
256LIBNVDIMM Kernel Device Model and LIBNDCTL Userspace API 286LIBNVDIMM Kernel Device Model and LIBNDCTL Userspace API
257---------------------------------------------------- 287========================================================
258 288
259What follows is a description of the LIBNVDIMM sysfs layout and a 289What follows is a description of the LIBNVDIMM sysfs layout and a
260corresponding object hierarchy diagram as viewed through the LIBNDCTL 290corresponding object hierarchy diagram as viewed through the LIBNDCTL
@@ -263,12 +293,18 @@ NVDIMM Platform which is also the LIBNVDIMM bus used in the LIBNDCTL unit
263test. 293test.
264 294
265LIBNDCTL: Context 295LIBNDCTL: Context
296-----------------
297
266Every API call in the LIBNDCTL library requires a context that holds the 298Every API call in the LIBNDCTL library requires a context that holds the
267logging parameters and other library instance state. The library is 299logging parameters and other library instance state. The library is
268based on the libabc template: 300based on the libabc template:
269https://git.kernel.org/cgit/linux/kernel/git/kay/libabc.git 301
302 https://git.kernel.org/cgit/linux/kernel/git/kay/libabc.git
270 303
271LIBNDCTL: instantiate a new library context example 304LIBNDCTL: instantiate a new library context example
305^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
306
307::
272 308
273 struct ndctl_ctx *ctx; 309 struct ndctl_ctx *ctx;
274 310
@@ -278,7 +314,7 @@ LIBNDCTL: instantiate a new library context example
278 return NULL; 314 return NULL;
279 315
280LIBNVDIMM/LIBNDCTL: Bus 316LIBNVDIMM/LIBNDCTL: Bus
281------------------- 317-----------------------
282 318
283A bus has a 1:1 relationship with an NFIT. The current expectation for 319A bus has a 1:1 relationship with an NFIT. The current expectation for
284ACPI based systems is that there is only ever one platform-global NFIT. 320ACPI based systems is that there is only ever one platform-global NFIT.
@@ -288,9 +324,10 @@ we use this capability to test multiple NFIT configurations in the unit
288test. 324test.
289 325
290LIBNVDIMM: control class device in /sys/class 326LIBNVDIMM: control class device in /sys/class
327---------------------------------------------
291 328
292This character device accepts DSM messages to be passed to DIMM 329This character device accepts DSM messages to be passed to DIMM
293identified by its NFIT handle. 330identified by its NFIT handle::
294 331
295 /sys/class/nd/ndctl0 332 /sys/class/nd/ndctl0
296 |-- dev 333 |-- dev
@@ -300,10 +337,15 @@ identified by its NFIT handle.
300 337
301 338
302LIBNVDIMM: bus 339LIBNVDIMM: bus
340--------------
341
342::
303 343
304 struct nvdimm_bus *nvdimm_bus_register(struct device *parent, 344 struct nvdimm_bus *nvdimm_bus_register(struct device *parent,
305 struct nvdimm_bus_descriptor *nfit_desc); 345 struct nvdimm_bus_descriptor *nfit_desc);
306 346
347::
348
307 /sys/devices/platform/nfit_test.0/ndbus0 349 /sys/devices/platform/nfit_test.0/ndbus0
308 |-- commands 350 |-- commands
309 |-- nd 351 |-- nd
@@ -324,7 +366,9 @@ LIBNVDIMM: bus
324 `-- wait_probe 366 `-- wait_probe
325 367
326LIBNDCTL: bus enumeration example 368LIBNDCTL: bus enumeration example
327Find the bus handle that describes the bus from Example NVDIMM Platform 369^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
370
371Find the bus handle that describes the bus from Example NVDIMM Platform::
328 372
329 static struct ndctl_bus *get_bus_by_provider(struct ndctl_ctx *ctx, 373 static struct ndctl_bus *get_bus_by_provider(struct ndctl_ctx *ctx,
330 const char *provider) 374 const char *provider)
@@ -342,7 +386,7 @@ Find the bus handle that describes the bus from Example NVDIMM Platform
342 386
343 387
344LIBNVDIMM/LIBNDCTL: DIMM (NMEM) 388LIBNVDIMM/LIBNDCTL: DIMM (NMEM)
345--------------------------- 389-------------------------------
346 390
347The DIMM device provides a character device for sending commands to 391The DIMM device provides a character device for sending commands to
348hardware, and it is a container for LABELs. If the DIMM is defined by 392hardware, and it is a container for LABELs. If the DIMM is defined by
@@ -355,11 +399,16 @@ Range Mapping Structure", and there is no requirement that they actually
355be physical DIMMs, so we use a more generic name. 399be physical DIMMs, so we use a more generic name.
356 400
357LIBNVDIMM: DIMM (NMEM) 401LIBNVDIMM: DIMM (NMEM)
402^^^^^^^^^^^^^^^^^^^^^^
403
404::
358 405
359 struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data, 406 struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data,
360 const struct attribute_group **groups, unsigned long flags, 407 const struct attribute_group **groups, unsigned long flags,
361 unsigned long *dsm_mask); 408 unsigned long *dsm_mask);
362 409
410::
411
363 /sys/devices/platform/nfit_test.0/ndbus0 412 /sys/devices/platform/nfit_test.0/ndbus0
364 |-- nmem0 413 |-- nmem0
365 | |-- available_slots 414 | |-- available_slots
@@ -384,15 +433,20 @@ LIBNVDIMM: DIMM (NMEM)
384 433
385 434
386LIBNDCTL: DIMM enumeration example 435LIBNDCTL: DIMM enumeration example
436^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
387 437
388Note, in this example we are assuming NFIT-defined DIMMs which are 438Note, in this example we are assuming NFIT-defined DIMMs which are
389identified by an "nfit_handle" a 32-bit value where: 439identified by an "nfit_handle" a 32-bit value where:
390Bit 3:0 DIMM number within the memory channel 440
391Bit 7:4 memory channel number 441 - Bit 3:0 DIMM number within the memory channel
392Bit 11:8 memory controller ID 442 - Bit 7:4 memory channel number
393Bit 15:12 socket ID (within scope of a Node controller if node controller is present) 443 - Bit 11:8 memory controller ID
394Bit 27:16 Node Controller ID 444 - Bit 15:12 socket ID (within scope of a Node controller if node
395Bit 31:28 Reserved 445 controller is present)
446 - Bit 27:16 Node Controller ID
447 - Bit 31:28 Reserved
448
449::
396 450
397 static struct ndctl_dimm *get_dimm_by_handle(struct ndctl_bus *bus, 451 static struct ndctl_dimm *get_dimm_by_handle(struct ndctl_bus *bus,
398 unsigned int handle) 452 unsigned int handle)
@@ -413,7 +467,7 @@ Bit 31:28 Reserved
413 dimm = get_dimm_by_handle(bus, DIMM_HANDLE(0, 0, 0, 0, 0)); 467 dimm = get_dimm_by_handle(bus, DIMM_HANDLE(0, 0, 0, 0, 0));
414 468
415LIBNVDIMM/LIBNDCTL: Region 469LIBNVDIMM/LIBNDCTL: Region
416---------------------- 470--------------------------
417 471
418A generic REGION device is registered for each PMEM range or BLK-aperture 472A generic REGION device is registered for each PMEM range or BLK-aperture
419set. Per the example there are 6 regions: 2 PMEM and 4 BLK-aperture 473set. Per the example there are 6 regions: 2 PMEM and 4 BLK-aperture
@@ -435,13 +489,15 @@ emits, "devtype" duplicates the DEVTYPE variable stored by udev at the
435at the 'add' event, and finally, the optional "spa_index" is provided in 489at the 'add' event, and finally, the optional "spa_index" is provided in
436the case where the region is defined by a SPA. 490the case where the region is defined by a SPA.
437 491
438LIBNVDIMM: region 492LIBNVDIMM: region::
439 493
440 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus, 494 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus,
441 struct nd_region_desc *ndr_desc); 495 struct nd_region_desc *ndr_desc);
442 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus, 496 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus,
443 struct nd_region_desc *ndr_desc); 497 struct nd_region_desc *ndr_desc);
444 498
499::
500
445 /sys/devices/platform/nfit_test.0/ndbus0 501 /sys/devices/platform/nfit_test.0/ndbus0
446 |-- region0 502 |-- region0
447 | |-- available_size 503 | |-- available_size
@@ -468,10 +524,11 @@ LIBNVDIMM: region
468 [..] 524 [..]
469 525
470LIBNDCTL: region enumeration example 526LIBNDCTL: region enumeration example
527^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471 528
472Sample region retrieval routines based on NFIT-unique data like 529Sample region retrieval routines based on NFIT-unique data like
473"spa_index" (interleave set id) for PMEM and "nfit_handle" (dimm id) for 530"spa_index" (interleave set id) for PMEM and "nfit_handle" (dimm id) for
474BLK. 531BLK::
475 532
476 static struct ndctl_region *get_pmem_region_by_spa_index(struct ndctl_bus *bus, 533 static struct ndctl_region *get_pmem_region_by_spa_index(struct ndctl_bus *bus,
477 unsigned int spa_index) 534 unsigned int spa_index)
@@ -518,33 +575,33 @@ REGION name generic and expects userspace to always consider the
518region-attributes for four reasons: 575region-attributes for four reasons:
519 576
520 1. There are already more than two REGION and "namespace" types. For 577 1. There are already more than two REGION and "namespace" types. For
521 PMEM there are two subtypes. As mentioned previously we have PMEM where 578 PMEM there are two subtypes. As mentioned previously we have PMEM where
522 the constituent DIMM devices are known and anonymous PMEM. For BLK 579 the constituent DIMM devices are known and anonymous PMEM. For BLK
523 regions the NFIT specification already anticipates vendor specific 580 regions the NFIT specification already anticipates vendor specific
524 implementations. The exact distinction of what a region contains is in 581 implementations. The exact distinction of what a region contains is in
525 the region-attributes not the region-name or the region-devtype. 582 the region-attributes not the region-name or the region-devtype.
526 583
527 2. A region with zero child-namespaces is a possible configuration. For 584 2. A region with zero child-namespaces is a possible configuration. For
528 example, the NFIT allows for a DCR to be published without a 585 example, the NFIT allows for a DCR to be published without a
529 corresponding BLK-aperture. This equates to a DIMM that can only accept 586 corresponding BLK-aperture. This equates to a DIMM that can only accept
530 control/configuration messages, but no i/o through a descendant block 587 control/configuration messages, but no i/o through a descendant block
531 device. Again, this "type" is advertised in the attributes ('mappings' 588 device. Again, this "type" is advertised in the attributes ('mappings'
532 == 0) and the name does not tell you much. 589 == 0) and the name does not tell you much.
533 590
534 3. What if a third major interface type arises in the future? Outside 591 3. What if a third major interface type arises in the future? Outside
535 of vendor specific implementations, it's not difficult to envision a 592 of vendor specific implementations, it's not difficult to envision a
536 third class of interface type beyond BLK and PMEM. With a generic name 593 third class of interface type beyond BLK and PMEM. With a generic name
537 for the REGION level of the device-hierarchy old userspace 594 for the REGION level of the device-hierarchy old userspace
538 implementations can still make sense of new kernel advertised 595 implementations can still make sense of new kernel advertised
539 region-types. Userspace can always rely on the generic region 596 region-types. Userspace can always rely on the generic region
540 attributes like "mappings", "size", etc and the expected child devices 597 attributes like "mappings", "size", etc and the expected child devices
541 named "namespace". This generic format of the device-model hierarchy 598 named "namespace". This generic format of the device-model hierarchy
542 allows the LIBNVDIMM and LIBNDCTL implementations to be more uniform and 599 allows the LIBNVDIMM and LIBNDCTL implementations to be more uniform and
543 future-proof. 600 future-proof.
544 601
545 4. There are more robust mechanisms for determining the major type of a 602 4. There are more robust mechanisms for determining the major type of a
546 region than a device name. See the next section, How Do I Determine the 603 region than a device name. See the next section, How Do I Determine the
547 Major Type of a Region? 604 Major Type of a Region?
548 605
549How Do I Determine the Major Type of a Region? 606How Do I Determine the Major Type of a Region?
550---------------------------------------------- 607----------------------------------------------
@@ -553,7 +610,8 @@ Outside of the blanket recommendation of "use libndctl", or simply
553looking at the kernel header (/usr/include/linux/ndctl.h) to decode the 610looking at the kernel header (/usr/include/linux/ndctl.h) to decode the
554"nstype" integer attribute, here are some other options. 611"nstype" integer attribute, here are some other options.
555 612
556 1. module alias lookup: 6131. module alias lookup
614^^^^^^^^^^^^^^^^^^^^^^
557 615
558 The whole point of region/namespace device type differentiation is to 616 The whole point of region/namespace device type differentiation is to
559 decide which block-device driver will attach to a given LIBNVDIMM namespace. 617 decide which block-device driver will attach to a given LIBNVDIMM namespace.
@@ -569,28 +627,31 @@ looking at the kernel header (/usr/include/linux/ndctl.h) to decode the
569 the resulting namespaces. The output from module resolution is more 627 the resulting namespaces. The output from module resolution is more
570 accurate than a region-name or region-devtype. 628 accurate than a region-name or region-devtype.
571 629
572 2. udev: 6302. udev
631^^^^^^^
632
633 The kernel "devtype" is registered in the udev database::
573 634
574 The kernel "devtype" is registered in the udev database 635 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region0
575 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region0 636 P: /devices/platform/nfit_test.0/ndbus0/region0
576 P: /devices/platform/nfit_test.0/ndbus0/region0 637 E: DEVPATH=/devices/platform/nfit_test.0/ndbus0/region0
577 E: DEVPATH=/devices/platform/nfit_test.0/ndbus0/region0 638 E: DEVTYPE=nd_pmem
578 E: DEVTYPE=nd_pmem 639 E: MODALIAS=nd:t2
579 E: MODALIAS=nd:t2 640 E: SUBSYSTEM=nd
580 E: SUBSYSTEM=nd
581 641
582 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region4 642 # udevadm info --path=/devices/platform/nfit_test.0/ndbus0/region4
583 P: /devices/platform/nfit_test.0/ndbus0/region4 643 P: /devices/platform/nfit_test.0/ndbus0/region4
584 E: DEVPATH=/devices/platform/nfit_test.0/ndbus0/region4 644 E: DEVPATH=/devices/platform/nfit_test.0/ndbus0/region4
585 E: DEVTYPE=nd_blk 645 E: DEVTYPE=nd_blk
586 E: MODALIAS=nd:t3 646 E: MODALIAS=nd:t3
587 E: SUBSYSTEM=nd 647 E: SUBSYSTEM=nd
588 648
589 ...and is available as a region attribute, but keep in mind that the 649 ...and is available as a region attribute, but keep in mind that the
590 "devtype" does not indicate sub-type variations and scripts should 650 "devtype" does not indicate sub-type variations and scripts should
591 really be understanding the other attributes. 651 really be understanding the other attributes.
592 652
593 3. type specific attributes: 6533. type specific attributes
654^^^^^^^^^^^^^^^^^^^^^^^^^^^
594 655
595 As it currently stands a BLK-aperture region will never have a 656 As it currently stands a BLK-aperture region will never have a
596 "nfit/spa_index" attribute, but neither will a non-NFIT PMEM region. A 657 "nfit/spa_index" attribute, but neither will a non-NFIT PMEM region. A
@@ -600,7 +661,7 @@ looking at the kernel header (/usr/include/linux/ndctl.h) to decode the
600 661
601 662
602LIBNVDIMM/LIBNDCTL: Namespace 663LIBNVDIMM/LIBNDCTL: Namespace
603------------------------- 664-----------------------------
604 665
605A REGION, after resolving DPA aliasing and LABEL specified boundaries, 666A REGION, after resolving DPA aliasing and LABEL specified boundaries,
606surfaces one or more "namespace" devices. The arrival of a "namespace" 667surfaces one or more "namespace" devices. The arrival of a "namespace"
@@ -608,12 +669,14 @@ device currently triggers either the nd_blk or nd_pmem driver to load
608and register a disk/block device. 669and register a disk/block device.
609 670
610LIBNVDIMM: namespace 671LIBNVDIMM: namespace
672^^^^^^^^^^^^^^^^^^^^
673
611Here is a sample layout from the three major types of NAMESPACE where 674Here is a sample layout from the three major types of NAMESPACE where
612namespace0.0 represents DIMM-info-backed PMEM (note that it has a 'uuid' 675namespace0.0 represents DIMM-info-backed PMEM (note that it has a 'uuid'
613attribute), namespace2.0 represents a BLK namespace (note it has a 676attribute), namespace2.0 represents a BLK namespace (note it has a
614'sector_size' attribute) that, and namespace6.0 represents an anonymous 677'sector_size' attribute) that, and namespace6.0 represents an anonymous
615PMEM namespace (note that has no 'uuid' attribute due to not support a 678PMEM namespace (note that has no 'uuid' attribute due to not support a
616LABEL). 679LABEL)::
617 680
618 /sys/devices/platform/nfit_test.0/ndbus0/region0/namespace0.0 681 /sys/devices/platform/nfit_test.0/ndbus0/region0/namespace0.0
619 |-- alt_name 682 |-- alt_name
@@ -656,76 +719,84 @@ LABEL).
656 `-- uevent 719 `-- uevent
657 720
658LIBNDCTL: namespace enumeration example 721LIBNDCTL: namespace enumeration example
722^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
659Namespaces are indexed relative to their parent region, example below. 723Namespaces are indexed relative to their parent region, example below.
660These indexes are mostly static from boot to boot, but subsystem makes 724These indexes are mostly static from boot to boot, but subsystem makes
661no guarantees in this regard. For a static namespace identifier use its 725no guarantees in this regard. For a static namespace identifier use its
662'uuid' attribute. 726'uuid' attribute.
663 727
664static struct ndctl_namespace *get_namespace_by_id(struct ndctl_region *region, 728::
665 unsigned int id)
666{
667 struct ndctl_namespace *ndns;
668 729
669 ndctl_namespace_foreach(region, ndns) 730 static struct ndctl_namespace
670 if (ndctl_namespace_get_id(ndns) == id) 731 *get_namespace_by_id(struct ndctl_region *region, unsigned int id)
671 return ndns; 732 {
733 struct ndctl_namespace *ndns;
672 734
673 return NULL; 735 ndctl_namespace_foreach(region, ndns)
674} 736 if (ndctl_namespace_get_id(ndns) == id)
737 return ndns;
738
739 return NULL;
740 }
675 741
676LIBNDCTL: namespace creation example 742LIBNDCTL: namespace creation example
743^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
744
677Idle namespaces are automatically created by the kernel if a given 745Idle namespaces are automatically created by the kernel if a given
678region has enough available capacity to create a new namespace. 746region has enough available capacity to create a new namespace.
679Namespace instantiation involves finding an idle namespace and 747Namespace instantiation involves finding an idle namespace and
680configuring it. For the most part the setting of namespace attributes 748configuring it. For the most part the setting of namespace attributes
681can occur in any order, the only constraint is that 'uuid' must be set 749can occur in any order, the only constraint is that 'uuid' must be set
682before 'size'. This enables the kernel to track DPA allocations 750before 'size'. This enables the kernel to track DPA allocations
683internally with a static identifier. 751internally with a static identifier::
684 752
685static int configure_namespace(struct ndctl_region *region, 753 static int configure_namespace(struct ndctl_region *region,
686 struct ndctl_namespace *ndns, 754 struct ndctl_namespace *ndns,
687 struct namespace_parameters *parameters) 755 struct namespace_parameters *parameters)
688{ 756 {
689 char devname[50]; 757 char devname[50];
690 758
691 snprintf(devname, sizeof(devname), "namespace%d.%d", 759 snprintf(devname, sizeof(devname), "namespace%d.%d",
692 ndctl_region_get_id(region), paramaters->id); 760 ndctl_region_get_id(region), paramaters->id);
693 761
694 ndctl_namespace_set_alt_name(ndns, devname); 762 ndctl_namespace_set_alt_name(ndns, devname);
695 /* 'uuid' must be set prior to setting size! */ 763 /* 'uuid' must be set prior to setting size! */
696 ndctl_namespace_set_uuid(ndns, paramaters->uuid); 764 ndctl_namespace_set_uuid(ndns, paramaters->uuid);
697 ndctl_namespace_set_size(ndns, paramaters->size); 765 ndctl_namespace_set_size(ndns, paramaters->size);
698 /* unlike pmem namespaces, blk namespaces have a sector size */ 766 /* unlike pmem namespaces, blk namespaces have a sector size */
699 if (parameters->lbasize) 767 if (parameters->lbasize)
700 ndctl_namespace_set_sector_size(ndns, parameters->lbasize); 768 ndctl_namespace_set_sector_size(ndns, parameters->lbasize);
701 ndctl_namespace_enable(ndns); 769 ndctl_namespace_enable(ndns);
702} 770 }
703 771
704 772
705Why the Term "namespace"? 773Why the Term "namespace"?
774^^^^^^^^^^^^^^^^^^^^^^^^^
706 775
707 1. Why not "volume" for instance? "volume" ran the risk of confusing 776 1. Why not "volume" for instance? "volume" ran the risk of confusing
708 ND (libnvdimm subsystem) to a volume manager like device-mapper. 777 ND (libnvdimm subsystem) to a volume manager like device-mapper.
709 778
710 2. The term originated to describe the sub-devices that can be created 779 2. The term originated to describe the sub-devices that can be created
711 within a NVME controller (see the nvme specification: 780 within a NVME controller (see the nvme specification:
712 http://www.nvmexpress.org/specifications/), and NFIT namespaces are 781 http://www.nvmexpress.org/specifications/), and NFIT namespaces are
713 meant to parallel the capabilities and configurability of 782 meant to parallel the capabilities and configurability of
714 NVME-namespaces. 783 NVME-namespaces.
715 784
716 785
717LIBNVDIMM/LIBNDCTL: Block Translation Table "btt" 786LIBNVDIMM/LIBNDCTL: Block Translation Table "btt"
718--------------------------------------------- 787-------------------------------------------------
719 788
720A BTT (design document: http://pmem.io/2014/09/23/btt.html) is a stacked 789A BTT (design document: http://pmem.io/2014/09/23/btt.html) is a stacked
721block device driver that fronts either the whole block device or a 790block device driver that fronts either the whole block device or a
722partition of a block device emitted by either a PMEM or BLK NAMESPACE. 791partition of a block device emitted by either a PMEM or BLK NAMESPACE.
723 792
724LIBNVDIMM: btt layout 793LIBNVDIMM: btt layout
794^^^^^^^^^^^^^^^^^^^^^
795
725Every region will start out with at least one BTT device which is the 796Every region will start out with at least one BTT device which is the
726seed device. To activate it set the "namespace", "uuid", and 797seed device. To activate it set the "namespace", "uuid", and
727"sector_size" attributes and then bind the device to the nd_pmem or 798"sector_size" attributes and then bind the device to the nd_pmem or
728nd_blk driver depending on the region type. 799nd_blk driver depending on the region type::
729 800
730 /sys/devices/platform/nfit_test.1/ndbus0/region0/btt0/ 801 /sys/devices/platform/nfit_test.1/ndbus0/region0/btt0/
731 |-- namespace 802 |-- namespace
@@ -739,10 +810,12 @@ nd_blk driver depending on the region type.
739 `-- uuid 810 `-- uuid
740 811
741LIBNDCTL: btt creation example 812LIBNDCTL: btt creation example
813^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
814
742Similar to namespaces an idle BTT device is automatically created per 815Similar to namespaces an idle BTT device is automatically created per
743region. Each time this "seed" btt device is configured and enabled a new 816region. Each time this "seed" btt device is configured and enabled a new
744seed is created. Creating a BTT configuration involves two steps of 817seed is created. Creating a BTT configuration involves two steps of
745finding and idle BTT and assigning it to consume a PMEM or BLK namespace. 818finding and idle BTT and assigning it to consume a PMEM or BLK namespace::
746 819
747 static struct ndctl_btt *get_idle_btt(struct ndctl_region *region) 820 static struct ndctl_btt *get_idle_btt(struct ndctl_region *region)
748 { 821 {
@@ -787,29 +860,28 @@ Summary LIBNDCTL Diagram
787------------------------ 860------------------------
788 861
789For the given example above, here is the view of the objects as seen by the 862For the given example above, here is the view of the objects as seen by the
790LIBNDCTL API: 863LIBNDCTL API::
791 +---+ 864
792 |CTX| +---------+ +--------------+ +---------------+ 865 +---+
793 +-+-+ +-> REGION0 +---> NAMESPACE0.0 +--> PMEM8 "pm0.0" | 866 |CTX| +---------+ +--------------+ +---------------+
794 | | +---------+ +--------------+ +---------------+ 867 +-+-+ +-> REGION0 +---> NAMESPACE0.0 +--> PMEM8 "pm0.0" |
795+-------+ | | +---------+ +--------------+ +---------------+ 868 | | +---------+ +--------------+ +---------------+
796| DIMM0 <-+ | +-> REGION1 +---> NAMESPACE1.0 +--> PMEM6 "pm1.0" | 869 +-------+ | | +---------+ +--------------+ +---------------+
797+-------+ | | | +---------+ +--------------+ +---------------+ 870 | DIMM0 <-+ | +-> REGION1 +---> NAMESPACE1.0 +--> PMEM6 "pm1.0" |
798| DIMM1 <-+ +-v--+ | +---------+ +--------------+ +---------------+ 871 +-------+ | | | +---------+ +--------------+ +---------------+
799+-------+ +-+BUS0+---> REGION2 +-+-> NAMESPACE2.0 +--> ND6 "blk2.0" | 872 | DIMM1 <-+ +-v--+ | +---------+ +--------------+ +---------------+
800| DIMM2 <-+ +----+ | +---------+ | +--------------+ +----------------------+ 873 +-------+ +-+BUS0+---> REGION2 +-+-> NAMESPACE2.0 +--> ND6 "blk2.0" |
801+-------+ | | +-> NAMESPACE2.1 +--> ND5 "blk2.1" | BTT2 | 874 | DIMM2 <-+ +----+ | +---------+ | +--------------+ +----------------------+
802| DIMM3 <-+ | +--------------+ +----------------------+ 875 +-------+ | | +-> NAMESPACE2.1 +--> ND5 "blk2.1" | BTT2 |
803+-------+ | +---------+ +--------------+ +---------------+ 876 | DIMM3 <-+ | +--------------+ +----------------------+
804 +-> REGION3 +-+-> NAMESPACE3.0 +--> ND4 "blk3.0" | 877 +-------+ | +---------+ +--------------+ +---------------+
805 | +---------+ | +--------------+ +----------------------+ 878 +-> REGION3 +-+-> NAMESPACE3.0 +--> ND4 "blk3.0" |
806 | +-> NAMESPACE3.1 +--> ND3 "blk3.1" | BTT1 | 879 | +---------+ | +--------------+ +----------------------+
807 | +--------------+ +----------------------+ 880 | +-> NAMESPACE3.1 +--> ND3 "blk3.1" | BTT1 |
808 | +---------+ +--------------+ +---------------+ 881 | +--------------+ +----------------------+
809 +-> REGION4 +---> NAMESPACE4.0 +--> ND2 "blk4.0" | 882 | +---------+ +--------------+ +---------------+
810 | +---------+ +--------------+ +---------------+ 883 +-> REGION4 +---> NAMESPACE4.0 +--> ND2 "blk4.0" |
811 | +---------+ +--------------+ +----------------------+ 884 | +---------+ +--------------+ +---------------+
812 +-> REGION5 +---> NAMESPACE5.0 +--> ND1 "blk5.0" | BTT0 | 885 | +---------+ +--------------+ +----------------------+
813 +---------+ +--------------+ +---------------+------+ 886 +-> REGION5 +---> NAMESPACE5.0 +--> ND1 "blk5.0" | BTT0 |
814 887 +---------+ +--------------+ +---------------+------+
815
diff --git a/Documentation/nvdimm/security.txt b/Documentation/driver-api/nvdimm/security.rst
index 4c36c05ca98e..ad9dea099b34 100644
--- a/Documentation/nvdimm/security.txt
+++ b/Documentation/driver-api/nvdimm/security.rst
@@ -1,4 +1,5 @@
1NVDIMM SECURITY 1===============
2NVDIMM Security
2=============== 3===============
3 4
41. Introduction 51. Introduction
@@ -138,4 +139,5 @@ This command is only available when the master security is enabled, indicated
138by the extended security status. 139by the extended security status.
139 140
140[1]: http://pmem.io/documents/NVDIMM_DSM_Interface-V1.8.pdf 141[1]: http://pmem.io/documents/NVDIMM_DSM_Interface-V1.8.pdf
142
141[2]: http://www.t13.org/documents/UploadedDocuments/docs2006/e05179r4-ACS-SecurityClarifications.pdf 143[2]: http://www.t13.org/documents/UploadedDocuments/docs2006/e05179r4-ACS-SecurityClarifications.pdf
diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/driver-api/nvmem.rst
index fc2fe4b18655..d9d958d5c824 100644
--- a/Documentation/nvmem/nvmem.txt
+++ b/Documentation/driver-api/nvmem.rst
@@ -1,5 +1,10 @@
1 NVMEM SUBSYSTEM 1.. SPDX-License-Identifier: GPL-2.0
2 Srinivas Kandagatla <srinivas.kandagatla@linaro.org> 2
3===============
4NVMEM Subsystem
5===============
6
7 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
3 8
4This document explains the NVMEM Framework along with the APIs provided, 9This document explains the NVMEM Framework along with the APIs provided,
5and how to use it. 10and how to use it.
@@ -40,54 +45,54 @@ nvmem_device pointer.
40 45
41nvmem_unregister(nvmem) is used to unregister a previously registered provider. 46nvmem_unregister(nvmem) is used to unregister a previously registered provider.
42 47
43For example, a simple qfprom case: 48For example, a simple qfprom case::
44 49
45static struct nvmem_config econfig = { 50 static struct nvmem_config econfig = {
46 .name = "qfprom", 51 .name = "qfprom",
47 .owner = THIS_MODULE, 52 .owner = THIS_MODULE,
48}; 53 };
49 54
50static int qfprom_probe(struct platform_device *pdev) 55 static int qfprom_probe(struct platform_device *pdev)
51{ 56 {
52 ... 57 ...
53 econfig.dev = &pdev->dev; 58 econfig.dev = &pdev->dev;
54 nvmem = nvmem_register(&econfig); 59 nvmem = nvmem_register(&econfig);
55 ... 60 ...
56} 61 }
57 62
58It is mandatory that the NVMEM provider has a regmap associated with its 63It is mandatory that the NVMEM provider has a regmap associated with its
59struct device. Failure to do would return error code from nvmem_register(). 64struct device. Failure to do would return error code from nvmem_register().
60 65
61Users of board files can define and register nvmem cells using the 66Users of board files can define and register nvmem cells using the
62nvmem_cell_table struct: 67nvmem_cell_table struct::
63 68
64static struct nvmem_cell_info foo_nvmem_cells[] = { 69 static struct nvmem_cell_info foo_nvmem_cells[] = {
65 { 70 {
66 .name = "macaddr", 71 .name = "macaddr",
67 .offset = 0x7f00, 72 .offset = 0x7f00,
68 .bytes = ETH_ALEN, 73 .bytes = ETH_ALEN,
69 } 74 }
70}; 75 };
71 76
72static struct nvmem_cell_table foo_nvmem_cell_table = { 77 static struct nvmem_cell_table foo_nvmem_cell_table = {
73 .nvmem_name = "i2c-eeprom", 78 .nvmem_name = "i2c-eeprom",
74 .cells = foo_nvmem_cells, 79 .cells = foo_nvmem_cells,
75 .ncells = ARRAY_SIZE(foo_nvmem_cells), 80 .ncells = ARRAY_SIZE(foo_nvmem_cells),
76}; 81 };
77 82
78nvmem_add_cell_table(&foo_nvmem_cell_table); 83 nvmem_add_cell_table(&foo_nvmem_cell_table);
79 84
80Additionally it is possible to create nvmem cell lookup entries and register 85Additionally it is possible to create nvmem cell lookup entries and register
81them with the nvmem framework from machine code as shown in the example below: 86them with the nvmem framework from machine code as shown in the example below::
82 87
83static struct nvmem_cell_lookup foo_nvmem_lookup = { 88 static struct nvmem_cell_lookup foo_nvmem_lookup = {
84 .nvmem_name = "i2c-eeprom", 89 .nvmem_name = "i2c-eeprom",
85 .cell_name = "macaddr", 90 .cell_name = "macaddr",
86 .dev_id = "foo_mac.0", 91 .dev_id = "foo_mac.0",
87 .con_id = "mac-address", 92 .con_id = "mac-address",
88}; 93 };
89 94
90nvmem_add_cell_lookups(&foo_nvmem_lookup, 1); 95 nvmem_add_cell_lookups(&foo_nvmem_lookup, 1);
91 96
92NVMEM Consumers 97NVMEM Consumers
93+++++++++++++++ 98+++++++++++++++
@@ -99,43 +104,43 @@ read from and to NVMEM.
99================================= 104=================================
100 105
101NVMEM cells are the data entries/fields in the NVMEM. 106NVMEM cells are the data entries/fields in the NVMEM.
102The NVMEM framework provides 3 APIs to read/write NVMEM cells. 107The NVMEM framework provides 3 APIs to read/write NVMEM cells::
103 108
104struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *name); 109 struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *name);
105struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *name); 110 struct nvmem_cell *devm_nvmem_cell_get(struct device *dev, const char *name);
106 111
107void nvmem_cell_put(struct nvmem_cell *cell); 112 void nvmem_cell_put(struct nvmem_cell *cell);
108void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); 113 void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);
109 114
110void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len); 115 void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len);
111int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len); 116 int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len);
112 117
113*nvmem_cell_get() apis will get a reference to nvmem cell for a given id, 118`*nvmem_cell_get()` apis will get a reference to nvmem cell for a given id,
114and nvmem_cell_read/write() can then read or write to the cell. 119and nvmem_cell_read/write() can then read or write to the cell.
115Once the usage of the cell is finished the consumer should call *nvmem_cell_put() 120Once the usage of the cell is finished the consumer should call
116to free all the allocation memory for the cell. 121`*nvmem_cell_put()` to free all the allocation memory for the cell.
117 122
1184. Direct NVMEM device based consumer APIs 1234. Direct NVMEM device based consumer APIs
119========================================== 124==========================================
120 125
121In some instances it is necessary to directly read/write the NVMEM. 126In some instances it is necessary to directly read/write the NVMEM.
122To facilitate such consumers NVMEM framework provides below apis. 127To facilitate such consumers NVMEM framework provides below apis::
123 128
124struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); 129 struct nvmem_device *nvmem_device_get(struct device *dev, const char *name);
125struct nvmem_device *devm_nvmem_device_get(struct device *dev, 130 struct nvmem_device *devm_nvmem_device_get(struct device *dev,
126 const char *name); 131 const char *name);
127void nvmem_device_put(struct nvmem_device *nvmem); 132 void nvmem_device_put(struct nvmem_device *nvmem);
128int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset, 133 int nvmem_device_read(struct nvmem_device *nvmem, unsigned int offset,
129 size_t bytes, void *buf); 134 size_t bytes, void *buf);
130int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset, 135 int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset,
131 size_t bytes, void *buf); 136 size_t bytes, void *buf);
132int nvmem_device_cell_read(struct nvmem_device *nvmem, 137 int nvmem_device_cell_read(struct nvmem_device *nvmem,
133 struct nvmem_cell_info *info, void *buf); 138 struct nvmem_cell_info *info, void *buf);
134int nvmem_device_cell_write(struct nvmem_device *nvmem, 139 int nvmem_device_cell_write(struct nvmem_device *nvmem,
135 struct nvmem_cell_info *info, void *buf); 140 struct nvmem_cell_info *info, void *buf);
136 141
137Before the consumers can read/write NVMEM directly, it should get hold 142Before the consumers can read/write NVMEM directly, it should get hold
138of nvmem_controller from one of the *nvmem_device_get() api. 143of nvmem_controller from one of the `*nvmem_device_get()` api.
139 144
140The difference between these apis and cell based apis is that these apis always 145The difference between these apis and cell based apis is that these apis always
141take nvmem_device as parameter. 146take nvmem_device as parameter.
@@ -145,12 +150,12 @@ take nvmem_device as parameter.
145 150
146When a consumer no longer needs the NVMEM, it has to release the reference 151When a consumer no longer needs the NVMEM, it has to release the reference
147to the NVMEM it has obtained using the APIs mentioned in the above section. 152to the NVMEM it has obtained using the APIs mentioned in the above section.
148The NVMEM framework provides 2 APIs to release a reference to the NVMEM. 153The NVMEM framework provides 2 APIs to release a reference to the NVMEM::
149 154
150void nvmem_cell_put(struct nvmem_cell *cell); 155 void nvmem_cell_put(struct nvmem_cell *cell);
151void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); 156 void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);
152void nvmem_device_put(struct nvmem_device *nvmem); 157 void nvmem_device_put(struct nvmem_device *nvmem);
153void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem); 158 void devm_nvmem_device_put(struct device *dev, struct nvmem_device *nvmem);
154 159
155Both these APIs are used to release a reference to the NVMEM and 160Both these APIs are used to release a reference to the NVMEM and
156devm_nvmem_cell_put and devm_nvmem_device_put destroys the devres associated 161devm_nvmem_cell_put and devm_nvmem_device_put destroys the devres associated
@@ -162,20 +167,21 @@ Userspace
1626. Userspace binary interface 1676. Userspace binary interface
163============================== 168==============================
164 169
165Userspace can read/write the raw NVMEM file located at 170Userspace can read/write the raw NVMEM file located at::
166/sys/bus/nvmem/devices/*/nvmem 171
172 /sys/bus/nvmem/devices/*/nvmem
167 173
168ex: 174ex::
169 175
170hexdump /sys/bus/nvmem/devices/qfprom0/nvmem 176 hexdump /sys/bus/nvmem/devices/qfprom0/nvmem
171 177
1720000000 0000 0000 0000 0000 0000 0000 0000 0000 178 0000000 0000 0000 0000 0000 0000 0000 0000 0000
173* 179 *
17400000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00 180 00000a0 db10 2240 0000 e000 0c00 0c00 0000 0c00
1750000000 0000 0000 0000 0000 0000 0000 0000 0000 181 0000000 0000 0000 0000 0000 0000 0000 0000 0000
176... 182 ...
177* 183 *
1780001000 184 0001000
179 185
1807. DeviceTree Binding 1867. DeviceTree Binding
181===================== 187=====================
diff --git a/Documentation/parport-lowlevel.txt b/Documentation/driver-api/parport-lowlevel.rst
index 0633d70ffda7..0633d70ffda7 100644
--- a/Documentation/parport-lowlevel.txt
+++ b/Documentation/driver-api/parport-lowlevel.rst
diff --git a/Documentation/driver-api/phy/index.rst b/Documentation/driver-api/phy/index.rst
new file mode 100644
index 000000000000..69ba1216de72
--- /dev/null
+++ b/Documentation/driver-api/phy/index.rst
@@ -0,0 +1,18 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=====================
4Generic PHY Framework
5=====================
6
7.. toctree::
8
9 phy
10 samsung-usb2
11
12.. only:: subproject and html
13
14 Indices
15 =======
16
17 * :ref:`genindex`
18
diff --git a/Documentation/phy.txt b/Documentation/driver-api/phy/phy.rst
index 457c3e0f86d6..457c3e0f86d6 100644
--- a/Documentation/phy.txt
+++ b/Documentation/driver-api/phy/phy.rst
diff --git a/Documentation/phy/samsung-usb2.txt b/Documentation/driver-api/phy/samsung-usb2.rst
index ed12d437189d..c48c8b9797b9 100644
--- a/Documentation/phy/samsung-usb2.txt
+++ b/Documentation/driver-api/phy/samsung-usb2.rst
@@ -1,9 +1,9 @@
1.------------------------------------------------------------------------------+ 1====================================
2| Samsung USB 2.0 PHY adaptation layer | 2Samsung USB 2.0 PHY adaptation layer
3+-----------------------------------------------------------------------------+' 3====================================
4 4
5| 1. Description 51. Description
6+---------------- 6--------------
7 7
8The architecture of the USB 2.0 PHY module in Samsung SoCs is similar 8The architecture of the USB 2.0 PHY module in Samsung SoCs is similar
9among many SoCs. In spite of the similarities it proved difficult to 9among many SoCs. In spite of the similarities it proved difficult to
@@ -14,8 +14,8 @@ the PHY powering up process had to be altered. This adaptation layer is
14a compromise between having separate drivers and having a single driver 14a compromise between having separate drivers and having a single driver
15with added support for many special cases. 15with added support for many special cases.
16 16
17| 2. Files description 172. Files description
18+---------------------- 18--------------------
19 19
20- phy-samsung-usb2.c 20- phy-samsung-usb2.c
21 This is the main file of the adaptation layer. This file contains 21 This is the main file of the adaptation layer. This file contains
@@ -32,44 +32,45 @@ with added support for many special cases.
32 driver. In addition it should contain extern declarations for 32 driver. In addition it should contain extern declarations for
33 structures that describe particular SoCs. 33 structures that describe particular SoCs.
34 34
35| 3. Supporting SoCs 353. Supporting SoCs
36+-------------------- 36------------------
37 37
38To support a new SoC a new file should be added to the drivers/phy 38To support a new SoC a new file should be added to the drivers/phy
39directory. Each SoC's configuration is stored in an instance of the 39directory. Each SoC's configuration is stored in an instance of the
40struct samsung_usb2_phy_config. 40struct samsung_usb2_phy_config::
41 41
42struct samsung_usb2_phy_config { 42 struct samsung_usb2_phy_config {
43 const struct samsung_usb2_common_phy *phys; 43 const struct samsung_usb2_common_phy *phys;
44 int (*rate_to_clk)(unsigned long, u32 *); 44 int (*rate_to_clk)(unsigned long, u32 *);
45 unsigned int num_phys; 45 unsigned int num_phys;
46 bool has_mode_switch; 46 bool has_mode_switch;
47}; 47 };
48 48
49The num_phys is the number of phys handled by the driver. *phys is an 49The num_phys is the number of phys handled by the driver. `*phys` is an
50array that contains the configuration for each phy. The has_mode_switch 50array that contains the configuration for each phy. The has_mode_switch
51property is a boolean flag that determines whether the SoC has USB host 51property is a boolean flag that determines whether the SoC has USB host
52and device on a single pair of pins. If so, a special register has to 52and device on a single pair of pins. If so, a special register has to
53be modified to change the internal routing of these pins between a USB 53be modified to change the internal routing of these pins between a USB
54device or host module. 54device or host module.
55 55
56For example the configuration for Exynos 4210 is following: 56For example the configuration for Exynos 4210 is following::
57 57
58const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = { 58 const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = {
59 .has_mode_switch = 0, 59 .has_mode_switch = 0,
60 .num_phys = EXYNOS4210_NUM_PHYS, 60 .num_phys = EXYNOS4210_NUM_PHYS,
61 .phys = exynos4210_phys, 61 .phys = exynos4210_phys,
62 .rate_to_clk = exynos4210_rate_to_clk, 62 .rate_to_clk = exynos4210_rate_to_clk,
63} 63 }
64
65- `int (*rate_to_clk)(unsigned long, u32 *)`
64 66
65- int (*rate_to_clk)(unsigned long, u32 *)
66 The rate_to_clk callback is to convert the rate of the clock 67 The rate_to_clk callback is to convert the rate of the clock
67 used as the reference clock for the PHY module to the value 68 used as the reference clock for the PHY module to the value
68 that should be written in the hardware register. 69 that should be written in the hardware register.
69 70
70The exynos4210_phys configuration array is as follows: 71The exynos4210_phys configuration array is as follows::
71 72
72static const struct samsung_usb2_common_phy exynos4210_phys[] = { 73 static const struct samsung_usb2_common_phy exynos4210_phys[] = {
73 { 74 {
74 .label = "device", 75 .label = "device",
75 .id = EXYNOS4210_DEVICE, 76 .id = EXYNOS4210_DEVICE,
@@ -95,29 +96,30 @@ static const struct samsung_usb2_common_phy exynos4210_phys[] = {
95 .power_off = exynos4210_power_off, 96 .power_off = exynos4210_power_off,
96 }, 97 },
97 {}, 98 {},
98}; 99 };
100
101- `int (*power_on)(struct samsung_usb2_phy_instance *);`
102 `int (*power_off)(struct samsung_usb2_phy_instance *);`
99 103
100- int (*power_on)(struct samsung_usb2_phy_instance *);
101- int (*power_off)(struct samsung_usb2_phy_instance *);
102 These two callbacks are used to power on and power off the phy 104 These two callbacks are used to power on and power off the phy
103 by modifying appropriate registers. 105 by modifying appropriate registers.
104 106
105Final change to the driver is adding appropriate compatible value to the 107Final change to the driver is adding appropriate compatible value to the
106phy-samsung-usb2.c file. In case of Exynos 4210 the following lines were 108phy-samsung-usb2.c file. In case of Exynos 4210 the following lines were
107added to the struct of_device_id samsung_usb2_phy_of_match[] array: 109added to the struct of_device_id samsung_usb2_phy_of_match[] array::
108 110
109#ifdef CONFIG_PHY_EXYNOS4210_USB2 111 #ifdef CONFIG_PHY_EXYNOS4210_USB2
110 { 112 {
111 .compatible = "samsung,exynos4210-usb2-phy", 113 .compatible = "samsung,exynos4210-usb2-phy",
112 .data = &exynos4210_usb2_phy_config, 114 .data = &exynos4210_usb2_phy_config,
113 }, 115 },
114#endif 116 #endif
115 117
116To add further flexibility to the driver the Kconfig file enables to 118To add further flexibility to the driver the Kconfig file enables to
117include support for selected SoCs in the compiled driver. The Kconfig 119include support for selected SoCs in the compiled driver. The Kconfig
118entry for Exynos 4210 is following: 120entry for Exynos 4210 is following::
119 121
120config PHY_EXYNOS4210_USB2 122 config PHY_EXYNOS4210_USB2
121 bool "Support for Exynos 4210" 123 bool "Support for Exynos 4210"
122 depends on PHY_SAMSUNG_USB2 124 depends on PHY_SAMSUNG_USB2
123 depends on CPU_EXYNOS4210 125 depends on CPU_EXYNOS4210
@@ -128,8 +130,8 @@ config PHY_EXYNOS4210_USB2
128 phys are available - device, host, HSCI0 and HSCI1. 130 phys are available - device, host, HSCI0 and HSCI1.
129 131
130The newly created file that supports the new SoC has to be also added to the 132The newly created file that supports the new SoC has to be also added to the
131Makefile. In case of Exynos 4210 the added line is following: 133Makefile. In case of Exynos 4210 the added line is following::
132 134
133obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o 135 obj-$(CONFIG_PHY_EXYNOS4210_USB2) += phy-exynos4210-usb2.o
134 136
135After completing these steps the support for the new SoC should be ready. 137After completing these steps the support for the new SoC should be ready.
diff --git a/Documentation/driver-api/pps.rst b/Documentation/driver-api/pps.rst
index 1456d2c32ebd..2d6b99766ee8 100644
--- a/Documentation/driver-api/pps.rst
+++ b/Documentation/driver-api/pps.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3====================== 3======================
4PPS - Pulse Per Second 4PPS - Pulse Per Second
diff --git a/Documentation/driver-api/pti_intel_mid.rst b/Documentation/driver-api/pti_intel_mid.rst
new file mode 100644
index 000000000000..20f1cff42d5f
--- /dev/null
+++ b/Documentation/driver-api/pti_intel_mid.rst
@@ -0,0 +1,106 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=============
4Intel MID PTI
5=============
6
7The Intel MID PTI project is HW implemented in Intel Atom
8system-on-a-chip designs based on the Parallel Trace
9Interface for MIPI P1149.7 cJTAG standard. The kernel solution
10for this platform involves the following files::
11
12 ./include/linux/pti.h
13 ./drivers/.../n_tracesink.h
14 ./drivers/.../n_tracerouter.c
15 ./drivers/.../n_tracesink.c
16 ./drivers/.../pti.c
17
18pti.c is the driver that enables various debugging features
19popular on platforms from certain mobile manufacturers.
20n_tracerouter.c and n_tracesink.c allow extra system information to
21be collected and routed to the pti driver, such as trace
22debugging data from a modem. Although n_tracerouter
23and n_tracesink are a part of the complete PTI solution,
24these two line disciplines can work separately from
25pti.c and route any data stream from one /dev/tty node
26to another /dev/tty node via kernel-space. This provides
27a stable, reliable connection that will not break unless
28the user-space application shuts down (plus avoids
29kernel->user->kernel context switch overheads of routing
30data).
31
32An example debugging usage for this driver system:
33
34 * Hook /dev/ttyPTI0 to syslogd. Opening this port will also start
35 a console device to further capture debugging messages to PTI.
36 * Hook /dev/ttyPTI1 to modem debugging data to write to PTI HW.
37 This is where n_tracerouter and n_tracesink are used.
38 * Hook /dev/pti to a user-level debugging application for writing
39 to PTI HW.
40 * `Use mipi_` Kernel Driver API in other device drivers for
41 debugging to PTI by first requesting a PTI write address via
42 mipi_request_masterchannel(1).
43
44Below is example pseudo-code on how a 'privileged' application
45can hook up n_tracerouter and n_tracesink to any tty on
46a system. 'Privileged' means the application has enough
47privileges to successfully manipulate the ldisc drivers
48but is not just blindly executing as 'root'. Keep in mind
49the use of ioctl(,TIOCSETD,) is not specific to the n_tracerouter
50and n_tracesink line discpline drivers but is a generic
51operation for a program to use a line discpline driver
52on a tty port other than the default n_tty::
53
54 /////////// To hook up n_tracerouter and n_tracesink /////////
55
56 // Note that n_tracerouter depends on n_tracesink.
57 #include <errno.h>
58 #define ONE_TTY "/dev/ttyOne"
59 #define TWO_TTY "/dev/ttyTwo"
60
61 // needed global to hand onto ldisc connection
62 static int g_fd_source = -1;
63 static int g_fd_sink = -1;
64
65 // these two vars used to grab LDISC values from loaded ldisc drivers
66 // in OS. Look at /proc/tty/ldiscs to get the right numbers from
67 // the ldiscs loaded in the system.
68 int source_ldisc_num, sink_ldisc_num = -1;
69 int retval;
70
71 g_fd_source = open(ONE_TTY, O_RDWR); // must be R/W
72 g_fd_sink = open(TWO_TTY, O_RDWR); // must be R/W
73
74 if (g_fd_source <= 0) || (g_fd_sink <= 0) {
75 // doubt you'll want to use these exact error lines of code
76 printf("Error on open(). errno: %d\n",errno);
77 return errno;
78 }
79
80 retval = ioctl(g_fd_sink, TIOCSETD, &sink_ldisc_num);
81 if (retval < 0) {
82 printf("Error on ioctl(). errno: %d\n", errno);
83 return errno;
84 }
85
86 retval = ioctl(g_fd_source, TIOCSETD, &source_ldisc_num);
87 if (retval < 0) {
88 printf("Error on ioctl(). errno: %d\n", errno);
89 return errno;
90 }
91
92 /////////// To disconnect n_tracerouter and n_tracesink ////////
93
94 // First make sure data through the ldiscs has stopped.
95
96 // Second, disconnect ldiscs. This provides a
97 // little cleaner shutdown on tty stack.
98 sink_ldisc_num = 0;
99 source_ldisc_num = 0;
100 ioctl(g_fd_uart, TIOCSETD, &sink_ldisc_num);
101 ioctl(g_fd_gadget, TIOCSETD, &source_ldisc_num);
102
103 // Three, program closes connection, and cleanup:
104 close(g_fd_uart);
105 close(g_fd_gadget);
106 g_fd_uart = g_fd_gadget = NULL;
diff --git a/Documentation/driver-api/ptp.rst b/Documentation/driver-api/ptp.rst
index b6e65d66d37a..a15192e32347 100644
--- a/Documentation/driver-api/ptp.rst
+++ b/Documentation/driver-api/ptp.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3=========================================== 3===========================================
4PTP hardware clock infrastructure for Linux 4PTP hardware clock infrastructure for Linux
diff --git a/Documentation/pwm.txt b/Documentation/driver-api/pwm.rst
index ab62f1bb0366..ab62f1bb0366 100644
--- a/Documentation/pwm.txt
+++ b/Documentation/driver-api/pwm.rst
diff --git a/Documentation/driver-api/rapidio/index.rst b/Documentation/driver-api/rapidio/index.rst
new file mode 100644
index 000000000000..a41b4242d16f
--- /dev/null
+++ b/Documentation/driver-api/rapidio/index.rst
@@ -0,0 +1,15 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===========================
4The Linux RapidIO Subsystem
5===========================
6
7.. toctree::
8 :maxdepth: 1
9
10 rapidio
11 sysfs
12
13 tsi721
14 mport_cdev
15 rio_cm
diff --git a/Documentation/rapidio/mport_cdev.txt b/Documentation/driver-api/rapidio/mport_cdev.rst
index a53f786ee2e9..df77a7f7be7d 100644
--- a/Documentation/rapidio/mport_cdev.txt
+++ b/Documentation/driver-api/rapidio/mport_cdev.rst
@@ -1,13 +1,9 @@
1RapidIO subsystem mport character device driver (rio_mport_cdev.c)
2================================================================== 1==================================================================
3 2RapidIO subsystem mport character device driver (rio_mport_cdev.c)
4Version History:
5----------------
6 1.0.0 - Initial driver release.
7
8================================================================== 3==================================================================
9 4
10I. Overview 51. Overview
6===========
11 7
12This device driver is the result of collaboration within the RapidIO.org 8This device driver is the result of collaboration within the RapidIO.org
13Software Task Group (STG) between Texas Instruments, Freescale, 9Software Task Group (STG) between Texas Instruments, Freescale,
@@ -29,40 +25,41 @@ Using available set of ioctl commands user-space applications can perform
29following RapidIO bus and subsystem operations: 25following RapidIO bus and subsystem operations:
30 26
31- Reads and writes from/to configuration registers of mport devices 27- Reads and writes from/to configuration registers of mport devices
32 (RIO_MPORT_MAINT_READ_LOCAL/RIO_MPORT_MAINT_WRITE_LOCAL) 28 (RIO_MPORT_MAINT_READ_LOCAL/RIO_MPORT_MAINT_WRITE_LOCAL)
33- Reads and writes from/to configuration registers of remote RapidIO devices. 29- Reads and writes from/to configuration registers of remote RapidIO devices.
34 This operations are defined as RapidIO Maintenance reads/writes in RIO spec. 30 This operations are defined as RapidIO Maintenance reads/writes in RIO spec.
35 (RIO_MPORT_MAINT_READ_REMOTE/RIO_MPORT_MAINT_WRITE_REMOTE) 31 (RIO_MPORT_MAINT_READ_REMOTE/RIO_MPORT_MAINT_WRITE_REMOTE)
36- Set RapidIO Destination ID for mport devices (RIO_MPORT_MAINT_HDID_SET) 32- Set RapidIO Destination ID for mport devices (RIO_MPORT_MAINT_HDID_SET)
37- Set RapidIO Component Tag for mport devices (RIO_MPORT_MAINT_COMPTAG_SET) 33- Set RapidIO Component Tag for mport devices (RIO_MPORT_MAINT_COMPTAG_SET)
38- Query logical index of mport devices (RIO_MPORT_MAINT_PORT_IDX_GET) 34- Query logical index of mport devices (RIO_MPORT_MAINT_PORT_IDX_GET)
39- Query capabilities and RapidIO link configuration of mport devices 35- Query capabilities and RapidIO link configuration of mport devices
40 (RIO_MPORT_GET_PROPERTIES) 36 (RIO_MPORT_GET_PROPERTIES)
41- Enable/Disable reporting of RapidIO doorbell events to user-space applications 37- Enable/Disable reporting of RapidIO doorbell events to user-space applications
42 (RIO_ENABLE_DOORBELL_RANGE/RIO_DISABLE_DOORBELL_RANGE) 38 (RIO_ENABLE_DOORBELL_RANGE/RIO_DISABLE_DOORBELL_RANGE)
43- Enable/Disable reporting of RIO port-write events to user-space applications 39- Enable/Disable reporting of RIO port-write events to user-space applications
44 (RIO_ENABLE_PORTWRITE_RANGE/RIO_DISABLE_PORTWRITE_RANGE) 40 (RIO_ENABLE_PORTWRITE_RANGE/RIO_DISABLE_PORTWRITE_RANGE)
45- Query/Control type of events reported through this driver: doorbells, 41- Query/Control type of events reported through this driver: doorbells,
46 port-writes or both (RIO_SET_EVENT_MASK/RIO_GET_EVENT_MASK) 42 port-writes or both (RIO_SET_EVENT_MASK/RIO_GET_EVENT_MASK)
47- Configure/Map mport's outbound requests window(s) for specific size, 43- Configure/Map mport's outbound requests window(s) for specific size,
48 RapidIO destination ID, hopcount and request type 44 RapidIO destination ID, hopcount and request type
49 (RIO_MAP_OUTBOUND/RIO_UNMAP_OUTBOUND) 45 (RIO_MAP_OUTBOUND/RIO_UNMAP_OUTBOUND)
50- Configure/Map mport's inbound requests window(s) for specific size, 46- Configure/Map mport's inbound requests window(s) for specific size,
51 RapidIO base address and local memory base address 47 RapidIO base address and local memory base address
52 (RIO_MAP_INBOUND/RIO_UNMAP_INBOUND) 48 (RIO_MAP_INBOUND/RIO_UNMAP_INBOUND)
53- Allocate/Free contiguous DMA coherent memory buffer for DMA data transfers 49- Allocate/Free contiguous DMA coherent memory buffer for DMA data transfers
54 to/from remote RapidIO devices (RIO_ALLOC_DMA/RIO_FREE_DMA) 50 to/from remote RapidIO devices (RIO_ALLOC_DMA/RIO_FREE_DMA)
55- Initiate DMA data transfers to/from remote RapidIO devices (RIO_TRANSFER). 51- Initiate DMA data transfers to/from remote RapidIO devices (RIO_TRANSFER).
56 Supports blocking, asynchronous and posted (a.k.a 'fire-and-forget') data 52 Supports blocking, asynchronous and posted (a.k.a 'fire-and-forget') data
57 transfer modes. 53 transfer modes.
58- Check/Wait for completion of asynchronous DMA data transfer 54- Check/Wait for completion of asynchronous DMA data transfer
59 (RIO_WAIT_FOR_ASYNC) 55 (RIO_WAIT_FOR_ASYNC)
60- Manage device objects supported by RapidIO subsystem (RIO_DEV_ADD/RIO_DEV_DEL). 56- Manage device objects supported by RapidIO subsystem (RIO_DEV_ADD/RIO_DEV_DEL).
61 This allows implementation of various RapidIO fabric enumeration algorithms 57 This allows implementation of various RapidIO fabric enumeration algorithms
62 as user-space applications while using remaining functionality provided by 58 as user-space applications while using remaining functionality provided by
63 kernel RapidIO subsystem. 59 kernel RapidIO subsystem.
64 60
65II. Hardware Compatibility 612. Hardware Compatibility
62=========================
66 63
67This device driver uses standard interfaces defined by kernel RapidIO subsystem 64This device driver uses standard interfaces defined by kernel RapidIO subsystem
68and therefore it can be used with any mport device driver registered by RapidIO 65and therefore it can be used with any mport device driver registered by RapidIO
@@ -78,29 +75,35 @@ functionality of their platform when planning to use this driver:
78 specific DMA engine support and therefore DMA data transfers mport_cdev driver 75 specific DMA engine support and therefore DMA data transfers mport_cdev driver
79 are not available. 76 are not available.
80 77
81III. Module parameters 783. Module parameters
79====================
82 80
83- 'dma_timeout' - DMA transfer completion timeout (in msec, default value 3000). 81- 'dma_timeout'
82 - DMA transfer completion timeout (in msec, default value 3000).
84 This parameter set a maximum completion wait time for SYNC mode DMA 83 This parameter set a maximum completion wait time for SYNC mode DMA
85 transfer requests and for RIO_WAIT_FOR_ASYNC ioctl requests. 84 transfer requests and for RIO_WAIT_FOR_ASYNC ioctl requests.
86 85
87- 'dbg_level' - This parameter allows to control amount of debug information 86- 'dbg_level'
87 - This parameter allows to control amount of debug information
88 generated by this device driver. This parameter is formed by set of 88 generated by this device driver. This parameter is formed by set of
89 bit masks that correspond to the specific functional blocks. 89 bit masks that correspond to the specific functional blocks.
90 For mask definitions see 'drivers/rapidio/devices/rio_mport_cdev.c' 90 For mask definitions see 'drivers/rapidio/devices/rio_mport_cdev.c'
91 This parameter can be changed dynamically. 91 This parameter can be changed dynamically.
92 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level. 92 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level.
93 93
94IV. Known problems 944. Known problems
95=================
95 96
96 None. 97 None.
97 98
98V. User-space Applications and API 995. User-space Applications and API
100==================================
99 101
100API library and applications that use this device driver are available from 102API library and applications that use this device driver are available from
101RapidIO.org. 103RapidIO.org.
102 104
103VI. TODO List 1056. TODO List
106============
104 107
105- Add support for sending/receiving "raw" RapidIO messaging packets. 108- Add support for sending/receiving "raw" RapidIO messaging packets.
106- Add memory mapped DMA data transfers as an option when RapidIO-specific DMA 109- Add memory mapped DMA data transfers as an option when RapidIO-specific DMA
diff --git a/Documentation/rapidio/rapidio.txt b/Documentation/driver-api/rapidio/rapidio.rst
index 28fbd877f85a..fb8942d3ba85 100644
--- a/Documentation/rapidio/rapidio.txt
+++ b/Documentation/driver-api/rapidio/rapidio.rst
@@ -1,6 +1,6 @@
1 The Linux RapidIO Subsystem 1============
2 2Introduction
3~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3============
4 4
5The RapidIO standard is a packet-based fabric interconnect standard designed for 5The RapidIO standard is a packet-based fabric interconnect standard designed for
6use in embedded systems. Development of the RapidIO standard is directed by the 6use in embedded systems. Development of the RapidIO standard is directed by the
@@ -11,7 +11,7 @@ This document describes the basics of the Linux RapidIO subsystem and provides
11information on its major components. 11information on its major components.
12 12
131 Overview 131 Overview
14---------- 14==========
15 15
16Because the RapidIO subsystem follows the Linux device model it is integrated 16Because the RapidIO subsystem follows the Linux device model it is integrated
17into the kernel similarly to other buses by defining RapidIO-specific device and 17into the kernel similarly to other buses by defining RapidIO-specific device and
@@ -22,7 +22,7 @@ architecture-specific interfaces that provide support for common RapidIO
22subsystem operations. 22subsystem operations.
23 23
242. Core Components 242. Core Components
25------------------ 25==================
26 26
27A typical RapidIO network is a combination of endpoints and switches. 27A typical RapidIO network is a combination of endpoints and switches.
28Each of these components is represented in the subsystem by an associated data 28Each of these components is represented in the subsystem by an associated data
@@ -30,6 +30,7 @@ structure. The core logical components of the RapidIO subsystem are defined
30in include/linux/rio.h file. 30in include/linux/rio.h file.
31 31
322.1 Master Port 322.1 Master Port
33---------------
33 34
34A master port (or mport) is a RapidIO interface controller that is local to the 35A master port (or mport) is a RapidIO interface controller that is local to the
35processor executing the Linux code. A master port generates and receives RapidIO 36processor executing the Linux code. A master port generates and receives RapidIO
@@ -46,6 +47,7 @@ includes rio_ops data structure which contains pointers to hardware specific
46implementations of RapidIO functions. 47implementations of RapidIO functions.
47 48
482.2 Device 492.2 Device
50----------
49 51
50A RapidIO device is any endpoint (other than mport) or switch in the network. 52A RapidIO device is any endpoint (other than mport) or switch in the network.
51All devices are presented in the RapidIO subsystem by corresponding rio_dev data 53All devices are presented in the RapidIO subsystem by corresponding rio_dev data
@@ -53,6 +55,7 @@ structure. Devices form one global device list and per-network device lists
53(depending on number of available mports and networks). 55(depending on number of available mports and networks).
54 56
552.3 Switch 572.3 Switch
58----------
56 59
57A RapidIO switch is a special class of device that routes packets between its 60A RapidIO switch is a special class of device that routes packets between its
58ports towards their final destination. The packet destination port within a 61ports towards their final destination. The packet destination port within a
@@ -66,6 +69,7 @@ specific switch drivers that are designed to provide hardware-specific
66implementation of common switch management routines. 69implementation of common switch management routines.
67 70
682.4 Network 712.4 Network
72-----------
69 73
70A RapidIO network is a combination of interconnected endpoint and switch devices. 74A RapidIO network is a combination of interconnected endpoint and switch devices.
71Each RapidIO network known to the system is represented by corresponding rio_net 75Each RapidIO network known to the system is represented by corresponding rio_net
@@ -74,11 +78,13 @@ ports that form the same network. It also contains a pointer to the default
74master port that is used to communicate with devices within the network. 78master port that is used to communicate with devices within the network.
75 79
762.5 Device Drivers 802.5 Device Drivers
81------------------
77 82
78RapidIO device-specific drivers follow Linux Kernel Driver Model and are 83RapidIO device-specific drivers follow Linux Kernel Driver Model and are
79intended to support specific RapidIO devices attached to the RapidIO network. 84intended to support specific RapidIO devices attached to the RapidIO network.
80 85
812.6 Subsystem Interfaces 862.6 Subsystem Interfaces
87------------------------
82 88
83RapidIO interconnect specification defines features that may be used to provide 89RapidIO interconnect specification defines features that may be used to provide
84one or more common service layers for all participating RapidIO devices. These 90one or more common service layers for all participating RapidIO devices. These
@@ -90,7 +96,7 @@ subsystem interfaces. This allows to have multiple common services attached to
90the same device without blocking attachment of a device-specific driver. 96the same device without blocking attachment of a device-specific driver.
91 97
923. Subsystem Initialization 983. Subsystem Initialization
93--------------------------- 99===========================
94 100
95In order to initialize the RapidIO subsystem, a platform must initialize and 101In order to initialize the RapidIO subsystem, a platform must initialize and
96register at least one master port within the RapidIO network. To register mport 102register at least one master port within the RapidIO network. To register mport
@@ -105,7 +111,7 @@ RapidIO subsystem can be configured to be built as a statically linked or
105modular component of the kernel (see details below). 111modular component of the kernel (see details below).
106 112
1074. Enumeration and Discovery 1134. Enumeration and Discovery
108---------------------------- 114============================
109 115
1104.1 Overview 1164.1 Overview
111------------ 117------------
@@ -168,14 +174,16 @@ on RapidIO subsystem build configuration:
168 (b) If the RapidIO subsystem core is built as a loadable module, in addition 174 (b) If the RapidIO subsystem core is built as a loadable module, in addition
169 to the method shown above, the host destination ID(s) can be specified using 175 to the method shown above, the host destination ID(s) can be specified using
170 traditional methods of passing module parameter "hdid=" during its loading: 176 traditional methods of passing module parameter "hdid=" during its loading:
177
171 - from command line: "modprobe rapidio hdid=-1,7", or 178 - from command line: "modprobe rapidio hdid=-1,7", or
172 - from modprobe configuration file using configuration command "options", 179 - from modprobe configuration file using configuration command "options",
173 like in this example: "options rapidio hdid=-1,7". An example of modprobe 180 like in this example: "options rapidio hdid=-1,7". An example of modprobe
174 configuration file is provided in the section below. 181 configuration file is provided in the section below.
175 182
176 NOTES: 183NOTES:
177 (i) if "hdid=" parameter is omitted all available mport will be assigned 184 (i) if "hdid=" parameter is omitted all available mport will be assigned
178 destination ID = -1; 185 destination ID = -1;
186
179 (ii) the "hdid=" parameter in systems with multiple mports can have 187 (ii) the "hdid=" parameter in systems with multiple mports can have
180 destination ID assignments omitted from the end of list (default = -1). 188 destination ID assignments omitted from the end of list (default = -1).
181 189
@@ -317,8 +325,7 @@ must ensure that they are loaded before the enumeration/discovery starts.
317This process can be automated by specifying pre- or post- dependencies in the 325This process can be automated by specifying pre- or post- dependencies in the
318RapidIO-specific modprobe configuration file as shown in the example below. 326RapidIO-specific modprobe configuration file as shown in the example below.
319 327
320 File /etc/modprobe.d/rapidio.conf: 328File /etc/modprobe.d/rapidio.conf::
321 ----------------------------------
322 329
323 # Configure RapidIO subsystem modules 330 # Configure RapidIO subsystem modules
324 331
@@ -335,17 +342,21 @@ RapidIO-specific modprobe configuration file as shown in the example below.
335 342
336 -------------------------- 343 --------------------------
337 344
338NOTE: In the example above, one of "softdep" commands must be removed or 345NOTE:
339commented out to keep required module loading sequence. 346 In the example above, one of "softdep" commands must be removed or
347 commented out to keep required module loading sequence.
340 348
341A. References 3495. References
342------------- 350=============
343 351
344[1] RapidIO Trade Association. RapidIO Interconnect Specifications. 352[1] RapidIO Trade Association. RapidIO Interconnect Specifications.
345 http://www.rapidio.org. 353 http://www.rapidio.org.
354
346[2] Rapidio TA. Technology Comparisons. 355[2] Rapidio TA. Technology Comparisons.
347 http://www.rapidio.org/education/technology_comparisons/ 356 http://www.rapidio.org/education/technology_comparisons/
357
348[3] RapidIO support for Linux. 358[3] RapidIO support for Linux.
349 http://lwn.net/Articles/139118/ 359 http://lwn.net/Articles/139118/
360
350[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005 361[4] Matt Porter. RapidIO for Linux. Ottawa Linux Symposium, 2005
351 http://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdf 362 http://www.kernel.org/doc/ols/2005/ols2005v2-pages-43-56.pdf
diff --git a/Documentation/rapidio/rio_cm.txt b/Documentation/driver-api/rapidio/rio_cm.rst
index 27aa401f1126..5294430a7a74 100644
--- a/Documentation/rapidio/rio_cm.txt
+++ b/Documentation/driver-api/rapidio/rio_cm.rst
@@ -1,13 +1,10 @@
1==========================================================================
1RapidIO subsystem Channelized Messaging character device driver (rio_cm.c) 2RapidIO subsystem Channelized Messaging character device driver (rio_cm.c)
2========================================================================== 3==========================================================================
3 4
4Version History:
5----------------
6 1.0.0 - Initial driver release.
7
8==========================================================================
9 5
10I. Overview 61. Overview
7===========
11 8
12This device driver is the result of collaboration within the RapidIO.org 9This device driver is the result of collaboration within the RapidIO.org
13Software Task Group (STG) between Texas Instruments, Prodrive Technologies, 10Software Task Group (STG) between Texas Instruments, Prodrive Technologies,
@@ -41,79 +38,98 @@ in /dev directory common for all registered RapidIO mport devices.
41 38
42Following ioctl commands are available to user-space applications: 39Following ioctl commands are available to user-space applications:
43 40
44- RIO_CM_MPORT_GET_LIST : Returns to caller list of local mport devices that 41- RIO_CM_MPORT_GET_LIST:
42 Returns to caller list of local mport devices that
45 support messaging operations (number of entries up to RIO_MAX_MPORTS). 43 support messaging operations (number of entries up to RIO_MAX_MPORTS).
46 Each list entry is combination of mport's index in the system and RapidIO 44 Each list entry is combination of mport's index in the system and RapidIO
47 destination ID assigned to the port. 45 destination ID assigned to the port.
48- RIO_CM_EP_GET_LIST_SIZE : Returns number of messaging capable remote endpoints 46- RIO_CM_EP_GET_LIST_SIZE:
47 Returns number of messaging capable remote endpoints
49 in a RapidIO network associated with the specified mport device. 48 in a RapidIO network associated with the specified mport device.
50- RIO_CM_EP_GET_LIST : Returns list of RapidIO destination IDs for messaging 49- RIO_CM_EP_GET_LIST:
50 Returns list of RapidIO destination IDs for messaging
51 capable remote endpoints (peers) available in a RapidIO network associated 51 capable remote endpoints (peers) available in a RapidIO network associated
52 with the specified mport device. 52 with the specified mport device.
53- RIO_CM_CHAN_CREATE : Creates RapidIO message exchange channel data structure 53- RIO_CM_CHAN_CREATE:
54 Creates RapidIO message exchange channel data structure
54 with channel ID assigned automatically or as requested by a caller. 55 with channel ID assigned automatically or as requested by a caller.
55- RIO_CM_CHAN_BIND : Binds the specified channel data structure to the specified 56- RIO_CM_CHAN_BIND:
57 Binds the specified channel data structure to the specified
56 mport device. 58 mport device.
57- RIO_CM_CHAN_LISTEN : Enables listening for connection requests on the specified 59- RIO_CM_CHAN_LISTEN:
60 Enables listening for connection requests on the specified
58 channel. 61 channel.
59- RIO_CM_CHAN_ACCEPT : Accepts a connection request from peer on the specified 62- RIO_CM_CHAN_ACCEPT:
63 Accepts a connection request from peer on the specified
60 channel. If wait timeout for this request is specified by a caller it is 64 channel. If wait timeout for this request is specified by a caller it is
61 a blocking call. If timeout set to 0 this is non-blocking call - ioctl 65 a blocking call. If timeout set to 0 this is non-blocking call - ioctl
62 handler checks for a pending connection request and if one is not available 66 handler checks for a pending connection request and if one is not available
63 exits with -EGAIN error status immediately. 67 exits with -EGAIN error status immediately.
64- RIO_CM_CHAN_CONNECT : Sends a connection request to a remote peer/channel. 68- RIO_CM_CHAN_CONNECT:
65- RIO_CM_CHAN_SEND : Sends a data message through the specified channel. 69 Sends a connection request to a remote peer/channel.
70- RIO_CM_CHAN_SEND:
71 Sends a data message through the specified channel.
66 The handler for this request assumes that message buffer specified by 72 The handler for this request assumes that message buffer specified by
67 a caller includes the reserved space for a packet header required by 73 a caller includes the reserved space for a packet header required by
68 this driver. 74 this driver.
69- RIO_CM_CHAN_RECEIVE : Receives a data message through a connected channel. 75- RIO_CM_CHAN_RECEIVE:
76 Receives a data message through a connected channel.
70 If the channel does not have an incoming message ready to return this ioctl 77 If the channel does not have an incoming message ready to return this ioctl
71 handler will wait for new message until timeout specified by a caller 78 handler will wait for new message until timeout specified by a caller
72 expires. If timeout value is set to 0, ioctl handler uses a default value 79 expires. If timeout value is set to 0, ioctl handler uses a default value
73 defined by MAX_SCHEDULE_TIMEOUT. 80 defined by MAX_SCHEDULE_TIMEOUT.
74- RIO_CM_CHAN_CLOSE : Closes a specified channel and frees associated buffers. 81- RIO_CM_CHAN_CLOSE:
82 Closes a specified channel and frees associated buffers.
75 If the specified channel is in the CONNECTED state, sends close notification 83 If the specified channel is in the CONNECTED state, sends close notification
76 to the remote peer. 84 to the remote peer.
77 85
78The ioctl command codes and corresponding data structures intended for use by 86The ioctl command codes and corresponding data structures intended for use by
79user-space applications are defined in 'include/uapi/linux/rio_cm_cdev.h'. 87user-space applications are defined in 'include/uapi/linux/rio_cm_cdev.h'.
80 88
81II. Hardware Compatibility 892. Hardware Compatibility
90=========================
82 91
83This device driver uses standard interfaces defined by kernel RapidIO subsystem 92This device driver uses standard interfaces defined by kernel RapidIO subsystem
84and therefore it can be used with any mport device driver registered by RapidIO 93and therefore it can be used with any mport device driver registered by RapidIO
85subsystem with limitations set by available mport HW implementation of messaging 94subsystem with limitations set by available mport HW implementation of messaging
86mailboxes. 95mailboxes.
87 96
88III. Module parameters 973. Module parameters
98====================
89 99
90- 'dbg_level' - This parameter allows to control amount of debug information 100- 'dbg_level'
101 - This parameter allows to control amount of debug information
91 generated by this device driver. This parameter is formed by set of 102 generated by this device driver. This parameter is formed by set of
92 bit masks that correspond to the specific functional block. 103 bit masks that correspond to the specific functional block.
93 For mask definitions see 'drivers/rapidio/devices/rio_cm.c' 104 For mask definitions see 'drivers/rapidio/devices/rio_cm.c'
94 This parameter can be changed dynamically. 105 This parameter can be changed dynamically.
95 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level. 106 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level.
96 107
97- 'cmbox' - Number of RapidIO mailbox to use (default value is 1). 108- 'cmbox'
109 - Number of RapidIO mailbox to use (default value is 1).
98 This parameter allows to set messaging mailbox number that will be used 110 This parameter allows to set messaging mailbox number that will be used
99 within entire RapidIO network. It can be used when default mailbox is 111 within entire RapidIO network. It can be used when default mailbox is
100 used by other device drivers or is not supported by some nodes in the 112 used by other device drivers or is not supported by some nodes in the
101 RapidIO network. 113 RapidIO network.
102 114
103- 'chstart' - Start channel number for dynamic assignment. Default value - 256. 115- 'chstart'
116 - Start channel number for dynamic assignment. Default value - 256.
104 Allows to exclude channel numbers below this parameter from dynamic 117 Allows to exclude channel numbers below this parameter from dynamic
105 allocation to avoid conflicts with software components that use 118 allocation to avoid conflicts with software components that use
106 reserved predefined channel numbers. 119 reserved predefined channel numbers.
107 120
108IV. Known problems 1214. Known problems
122=================
109 123
110 None. 124 None.
111 125
112V. User-space Applications and API Library 1265. User-space Applications and API Library
127==========================================
113 128
114Messaging API library and applications that use this device driver are available 129Messaging API library and applications that use this device driver are available
115from RapidIO.org. 130from RapidIO.org.
116 131
117VI. TODO List 1326. TODO List
133============
118 134
119- Add support for system notification messages (reserved channel 0). 135- Add support for system notification messages (reserved channel 0).
diff --git a/Documentation/rapidio/sysfs.txt b/Documentation/driver-api/rapidio/sysfs.rst
index a1adac888e6e..540f72683496 100644
--- a/Documentation/rapidio/sysfs.txt
+++ b/Documentation/driver-api/rapidio/sysfs.rst
@@ -1,3 +1,7 @@
1=============
2Sysfs entries
3=============
4
1The RapidIO sysfs files have moved to: 5The RapidIO sysfs files have moved to:
2Documentation/ABI/testing/sysfs-bus-rapidio and 6Documentation/ABI/testing/sysfs-bus-rapidio and
3Documentation/ABI/testing/sysfs-class-rapidio 7Documentation/ABI/testing/sysfs-class-rapidio
diff --git a/Documentation/rapidio/tsi721.txt b/Documentation/driver-api/rapidio/tsi721.rst
index cd2a2935d51d..42aea438cd20 100644
--- a/Documentation/rapidio/tsi721.txt
+++ b/Documentation/driver-api/rapidio/tsi721.rst
@@ -1,7 +1,9 @@
1=========================================================================
1RapidIO subsystem mport driver for IDT Tsi721 PCI Express-to-SRIO bridge. 2RapidIO subsystem mport driver for IDT Tsi721 PCI Express-to-SRIO bridge.
2========================================================================= 3=========================================================================
3 4
4I. Overview 51. Overview
6===========
5 7
6This driver implements all currently defined RapidIO mport callback functions. 8This driver implements all currently defined RapidIO mport callback functions.
7It supports maintenance read and write operations, inbound and outbound RapidIO 9It supports maintenance read and write operations, inbound and outbound RapidIO
@@ -17,7 +19,9 @@ into the corresponding message queue. Messaging callbacks are implemented to be
17fully compatible with RIONET driver (Ethernet over RapidIO messaging services). 19fully compatible with RIONET driver (Ethernet over RapidIO messaging services).
18 20
191. Module parameters: 211. Module parameters:
20- 'dbg_level' - This parameter allows to control amount of debug information 22
23- 'dbg_level'
24 - This parameter allows to control amount of debug information
21 generated by this device driver. This parameter is formed by set of 25 generated by this device driver. This parameter is formed by set of
22 This parameter can be changed bit masks that correspond to the specific 26 This parameter can be changed bit masks that correspond to the specific
23 functional block. 27 functional block.
@@ -25,37 +29,44 @@ fully compatible with RIONET driver (Ethernet over RapidIO messaging services).
25 This parameter can be changed dynamically. 29 This parameter can be changed dynamically.
26 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level. 30 Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level.
27 31
28- 'dma_desc_per_channel' - This parameter defines number of hardware buffer 32- 'dma_desc_per_channel'
33 - This parameter defines number of hardware buffer
29 descriptors allocated for each registered Tsi721 DMA channel. 34 descriptors allocated for each registered Tsi721 DMA channel.
30 Its default value is 128. 35 Its default value is 128.
31 36
32- 'dma_txqueue_sz' - DMA transactions queue size. Defines number of pending 37- 'dma_txqueue_sz'
38 - DMA transactions queue size. Defines number of pending
33 transaction requests that can be accepted by each DMA channel. 39 transaction requests that can be accepted by each DMA channel.
34 Default value is 16. 40 Default value is 16.
35 41
36- 'dma_sel' - DMA channel selection mask. Bitmask that defines which hardware 42- 'dma_sel'
43 - DMA channel selection mask. Bitmask that defines which hardware
37 DMA channels (0 ... 6) will be registered with DmaEngine core. 44 DMA channels (0 ... 6) will be registered with DmaEngine core.
38 If bit is set to 1, the corresponding DMA channel will be registered. 45 If bit is set to 1, the corresponding DMA channel will be registered.
39 DMA channels not selected by this mask will not be used by this device 46 DMA channels not selected by this mask will not be used by this device
40 driver. Default value is 0x7f (use all channels). 47 driver. Default value is 0x7f (use all channels).
41 48
42- 'pcie_mrrs' - override value for PCIe Maximum Read Request Size (MRRS). 49- 'pcie_mrrs'
50 - override value for PCIe Maximum Read Request Size (MRRS).
43 This parameter gives an ability to override MRRS value set during PCIe 51 This parameter gives an ability to override MRRS value set during PCIe
44 configuration process. Tsi721 supports read request sizes up to 4096B. 52 configuration process. Tsi721 supports read request sizes up to 4096B.
45 Value for this parameter must be set as defined by PCIe specification: 53 Value for this parameter must be set as defined by PCIe specification:
46 0 = 128B, 1 = 256B, 2 = 512B, 3 = 1024B, 4 = 2048B and 5 = 4096B. 54 0 = 128B, 1 = 256B, 2 = 512B, 3 = 1024B, 4 = 2048B and 5 = 4096B.
47 Default value is '-1' (= keep platform setting). 55 Default value is '-1' (= keep platform setting).
48 56
49- 'mbox_sel' - RIO messaging MBOX selection mask. This is a bitmask that defines 57- 'mbox_sel'
58 - RIO messaging MBOX selection mask. This is a bitmask that defines
50 messaging MBOXes are managed by this device driver. Mask bits 0 - 3 59 messaging MBOXes are managed by this device driver. Mask bits 0 - 3
51 correspond to MBOX0 - MBOX3. MBOX is under driver's control if the 60 correspond to MBOX0 - MBOX3. MBOX is under driver's control if the
52 corresponding bit is set to '1'. Default value is 0x0f (= all). 61 corresponding bit is set to '1'. Default value is 0x0f (= all).
53 62
54II. Known problems 632. Known problems
64=================
55 65
56 None. 66 None.
57 67
58III. DMA Engine Support 683. DMA Engine Support
69=====================
59 70
60Tsi721 mport driver supports DMA data transfers between local system memory and 71Tsi721 mport driver supports DMA data transfers between local system memory and
61remote RapidIO devices. This functionality is implemented according to SLAVE 72remote RapidIO devices. This functionality is implemented according to SLAVE
@@ -68,17 +79,21 @@ One BDMA channel is reserved for generation of maintenance read/write requests.
68 79
69If Tsi721 mport driver have been built with RAPIDIO_DMA_ENGINE support included, 80If Tsi721 mport driver have been built with RAPIDIO_DMA_ENGINE support included,
70this driver will accept DMA-specific module parameter: 81this driver will accept DMA-specific module parameter:
71 "dma_desc_per_channel" - defines number of hardware buffer descriptors used by 82
83 "dma_desc_per_channel"
84 - defines number of hardware buffer descriptors used by
72 each BDMA channel of Tsi721 (by default - 128). 85 each BDMA channel of Tsi721 (by default - 128).
73 86
74IV. Version History 874. Version History
75 88
76 1.1.0 - DMA operations re-worked to support data scatter/gather lists larger 89 ===== ====================================================================
90 1.1.0 DMA operations re-worked to support data scatter/gather lists larger
77 than hardware buffer descriptors ring. 91 than hardware buffer descriptors ring.
78 1.0.0 - Initial driver release. 92 1.0.0 Initial driver release.
93 ===== ====================================================================
79 94
80V. License 955. License
81----------------------------------------------- 96===========
82 97
83 Copyright(c) 2011 Integrated Device Technology, Inc. All rights reserved. 98 Copyright(c) 2011 Integrated Device Technology, Inc. All rights reserved.
84 99
diff --git a/Documentation/rfkill.txt b/Documentation/driver-api/rfkill.rst
index 7d3684e81df6..7d3684e81df6 100644
--- a/Documentation/rfkill.txt
+++ b/Documentation/driver-api/rfkill.rst
diff --git a/Documentation/serial/cyclades_z.rst b/Documentation/driver-api/serial/cyclades_z.rst
index 532ff67e2f1c..532ff67e2f1c 100644
--- a/Documentation/serial/cyclades_z.rst
+++ b/Documentation/driver-api/serial/cyclades_z.rst
diff --git a/Documentation/serial/driver.rst b/Documentation/driver-api/serial/driver.rst
index 4537119bf624..31bd4e16fb1f 100644
--- a/Documentation/serial/driver.rst
+++ b/Documentation/driver-api/serial/driver.rst
@@ -311,7 +311,7 @@ hardware.
311 This call must not sleep 311 This call must not sleep
312 312
313 set_ldisc(port,termios) 313 set_ldisc(port,termios)
314 Notifier for discipline change. See Documentation/serial/tty.rst. 314 Notifier for discipline change. See Documentation/driver-api/serial/tty.rst.
315 315
316 Locking: caller holds tty_port->mutex 316 Locking: caller holds tty_port->mutex
317 317
diff --git a/Documentation/serial/index.rst b/Documentation/driver-api/serial/index.rst
index d0ba22ea23bf..33ad10d05b26 100644
--- a/Documentation/serial/index.rst
+++ b/Documentation/driver-api/serial/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3========================== 3==========================
4Support for Serial devices 4Support for Serial devices
diff --git a/Documentation/serial/moxa-smartio.rst b/Documentation/driver-api/serial/moxa-smartio.rst
index 156100f17c3f..156100f17c3f 100644
--- a/Documentation/serial/moxa-smartio.rst
+++ b/Documentation/driver-api/serial/moxa-smartio.rst
diff --git a/Documentation/serial/n_gsm.rst b/Documentation/driver-api/serial/n_gsm.rst
index f3ad9fd26408..f3ad9fd26408 100644
--- a/Documentation/serial/n_gsm.rst
+++ b/Documentation/driver-api/serial/n_gsm.rst
diff --git a/Documentation/serial/rocket.rst b/Documentation/driver-api/serial/rocket.rst
index 23761eae4282..23761eae4282 100644
--- a/Documentation/serial/rocket.rst
+++ b/Documentation/driver-api/serial/rocket.rst
diff --git a/Documentation/serial/serial-iso7816.rst b/Documentation/driver-api/serial/serial-iso7816.rst
index d990143de0c6..d990143de0c6 100644
--- a/Documentation/serial/serial-iso7816.rst
+++ b/Documentation/driver-api/serial/serial-iso7816.rst
diff --git a/Documentation/serial/serial-rs485.rst b/Documentation/driver-api/serial/serial-rs485.rst
index 6bc824f948f9..6bc824f948f9 100644
--- a/Documentation/serial/serial-rs485.rst
+++ b/Documentation/driver-api/serial/serial-rs485.rst
diff --git a/Documentation/serial/tty.rst b/Documentation/driver-api/serial/tty.rst
index dd972caacf3e..dd972caacf3e 100644
--- a/Documentation/serial/tty.rst
+++ b/Documentation/driver-api/serial/tty.rst
diff --git a/Documentation/sgi-ioc4.txt b/Documentation/driver-api/sgi-ioc4.rst
index 72709222d3c0..72709222d3c0 100644
--- a/Documentation/sgi-ioc4.txt
+++ b/Documentation/driver-api/sgi-ioc4.rst
diff --git a/Documentation/SM501.txt b/Documentation/driver-api/sm501.rst
index 882507453ba4..882507453ba4 100644
--- a/Documentation/SM501.txt
+++ b/Documentation/driver-api/sm501.rst
diff --git a/Documentation/smsc_ece1099.txt b/Documentation/driver-api/smsc_ece1099.rst
index 079277421eaf..079277421eaf 100644
--- a/Documentation/smsc_ece1099.txt
+++ b/Documentation/driver-api/smsc_ece1099.rst
diff --git a/Documentation/switchtec.txt b/Documentation/driver-api/switchtec.rst
index 30d6a64e53f7..7611fdc53e19 100644
--- a/Documentation/switchtec.txt
+++ b/Documentation/driver-api/switchtec.rst
@@ -97,6 +97,6 @@ the following configuration settings:
97NT EP BAR 2 will be dynamically configured as a Direct Window, and 97NT EP BAR 2 will be dynamically configured as a Direct Window, and
98the configuration file does not need to configure it explicitly. 98the configuration file does not need to configure it explicitly.
99 99
100Please refer to Documentation/ntb.txt in Linux source tree for an overall 100Please refer to Documentation/driver-api/ntb.rst in Linux source tree for an overall
101understanding of the Linux NTB stack. ntb_hw_switchtec works as an NTB 101understanding of the Linux NTB stack. ntb_hw_switchtec works as an NTB
102Hardware Driver in this stack. 102Hardware Driver in this stack.
diff --git a/Documentation/sync_file.txt b/Documentation/driver-api/sync_file.rst
index 496fb2c3b3e6..496fb2c3b3e6 100644
--- a/Documentation/sync_file.txt
+++ b/Documentation/driver-api/sync_file.rst
diff --git a/Documentation/vfio-mediated-device.txt b/Documentation/driver-api/vfio-mediated-device.rst
index c3f69bcaf96e..25eb7d5b834b 100644
--- a/Documentation/vfio-mediated-device.txt
+++ b/Documentation/driver-api/vfio-mediated-device.rst
@@ -408,7 +408,7 @@ card.
408References 408References
409========== 409==========
410 410
4111. See Documentation/vfio.txt for more information on VFIO. 4111. See Documentation/driver-api/vfio.rst for more information on VFIO.
4122. struct mdev_driver in include/linux/mdev.h 4122. struct mdev_driver in include/linux/mdev.h
4133. struct mdev_parent_ops in include/linux/mdev.h 4133. struct mdev_parent_ops in include/linux/mdev.h
4144. struct vfio_iommu_driver_ops in include/linux/vfio.h 4144. struct vfio_iommu_driver_ops in include/linux/vfio.h
diff --git a/Documentation/vfio.txt b/Documentation/driver-api/vfio.rst
index f1a4d3c3ba0b..f1a4d3c3ba0b 100644
--- a/Documentation/vfio.txt
+++ b/Documentation/driver-api/vfio.rst
diff --git a/Documentation/xilinx/eemi.rst b/Documentation/driver-api/xilinx/eemi.rst
index 9dcbc6f18d75..9dcbc6f18d75 100644
--- a/Documentation/xilinx/eemi.rst
+++ b/Documentation/driver-api/xilinx/eemi.rst
diff --git a/Documentation/xilinx/index.rst b/Documentation/driver-api/xilinx/index.rst
index 01cc1a0714df..13f7589ed442 100644
--- a/Documentation/xilinx/index.rst
+++ b/Documentation/driver-api/xilinx/index.rst
@@ -1,4 +1,3 @@
1:orphan:
2 1
3=========== 2===========
4Xilinx FPGA 3Xilinx FPGA
diff --git a/Documentation/xillybus.txt b/Documentation/driver-api/xillybus.rst
index 2446ee303c09..2446ee303c09 100644
--- a/Documentation/xillybus.txt
+++ b/Documentation/driver-api/xillybus.rst
diff --git a/Documentation/zorro.txt b/Documentation/driver-api/zorro.rst
index 664072b017e3..664072b017e3 100644
--- a/Documentation/zorro.txt
+++ b/Documentation/driver-api/zorro.rst
diff --git a/Documentation/fault-injection/index.rst b/Documentation/fault-injection/index.rst
index 92b5639ed07a..8408a8a91b34 100644
--- a/Documentation/fault-injection/index.rst
+++ b/Documentation/fault-injection/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3=============== 3===============
4fault-injection 4fault-injection
diff --git a/Documentation/fb/fbcon.rst b/Documentation/fb/fbcon.rst
index 1da65b9000de..ebca41785abe 100644
--- a/Documentation/fb/fbcon.rst
+++ b/Documentation/fb/fbcon.rst
@@ -187,7 +187,7 @@ the hardware. Thus, in a VGA console::
187Assuming the VGA driver can be unloaded, one must first unbind the VGA driver 187Assuming the VGA driver can be unloaded, one must first unbind the VGA driver
188from the console layer before unloading the driver. The VGA driver cannot be 188from the console layer before unloading the driver. The VGA driver cannot be
189unloaded if it is still bound to the console layer. (See 189unloaded if it is still bound to the console layer. (See
190Documentation/console/console.txt for more information). 190Documentation/driver-api/console.rst for more information).
191 191
192This is more complicated in the case of the framebuffer console (fbcon), 192This is more complicated in the case of the framebuffer console (fbcon),
193because fbcon is an intermediate layer between the console and the drivers:: 193because fbcon is an intermediate layer between the console and the drivers::
@@ -204,7 +204,7 @@ fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from
204fbcon. 204fbcon.
205 205
206So, how do we unbind fbcon from the console? Part of the answer is in 206So, how do we unbind fbcon from the console? Part of the answer is in
207Documentation/console/console.txt. To summarize: 207Documentation/driver-api/console.rst. To summarize:
208 208
209Echo a value to the bind file that represents the framebuffer console 209Echo a value to the bind file that represents the framebuffer console
210driver. So assuming vtcon1 represents fbcon, then:: 210driver. So assuming vtcon1 represents fbcon, then::
diff --git a/Documentation/fb/index.rst b/Documentation/fb/index.rst
index d47313714635..baf02393d8ee 100644
--- a/Documentation/fb/index.rst
+++ b/Documentation/fb/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3============ 3============
4Frame Buffer 4Frame Buffer
diff --git a/Documentation/fb/vesafb.rst b/Documentation/fb/vesafb.rst
index 2ed0dfb661cf..6821c87b7893 100644
--- a/Documentation/fb/vesafb.rst
+++ b/Documentation/fb/vesafb.rst
@@ -30,7 +30,7 @@ How to use it?
30============== 30==============
31 31
32Switching modes is done using the vga=... boot parameter. Read 32Switching modes is done using the vga=... boot parameter. Read
33Documentation/svga.txt for details. 33Documentation/admin-guide/svga.rst for details.
34 34
35You should compile in both vgacon (for text mode) and vesafb (for 35You should compile in both vgacon (for text mode) and vesafb (for
36graphics mode). Which of them takes over the console depends on 36graphics mode). Which of them takes over the console depends on
diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index d2963123eb1c..ae4332464560 100644
--- a/Documentation/filesystems/nfs/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
@@ -239,7 +239,7 @@ rdinit=<executable file>
239 A description of the process of mounting the root file system can be 239 A description of the process of mounting the root file system can be
240 found in: 240 found in:
241 241
242 Documentation/early-userspace/README 242 Documentation/driver-api/early-userspace/early_userspace_support.rst
243 243
244 244
245 245
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index d750b6926899..fb4735fd73b0 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1500,7 +1500,7 @@ review the kernel documentation in the directory /usr/src/linux/Documentation.
1500This chapter is heavily based on the documentation included in the pre 2.2 1500This chapter is heavily based on the documentation included in the pre 2.2
1501kernels, and became part of it in version 2.2.1 of the Linux kernel. 1501kernels, and became part of it in version 2.2.1 of the Linux kernel.
1502 1502
1503Please see: Documentation/sysctl/ directory for descriptions of these 1503Please see: Documentation/admin-guide/sysctl/ directory for descriptions of these
1504entries. 1504entries.
1505 1505
1506------------------------------------------------------------------------------ 1506------------------------------------------------------------------------------
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.txt b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
index 79637d227e85..97d42ccaa92d 100644
--- a/Documentation/filesystems/ramfs-rootfs-initramfs.txt
+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.txt
@@ -105,7 +105,7 @@ All this differs from the old initrd in several ways:
105 - The old initrd file was a gzipped filesystem image (in some file format, 105 - The old initrd file was a gzipped filesystem image (in some file format,
106 such as ext2, that needed a driver built into the kernel), while the new 106 such as ext2, that needed a driver built into the kernel), while the new
107 initramfs archive is a gzipped cpio archive (like tar only simpler, 107 initramfs archive is a gzipped cpio archive (like tar only simpler,
108 see cpio(1) and Documentation/early-userspace/buffer-format.txt). The 108 see cpio(1) and Documentation/driver-api/early-userspace/buffer-format.rst). The
109 kernel's cpio extraction code is not only extremely small, it's also 109 kernel's cpio extraction code is not only extremely small, it's also
110 __init text and data that can be discarded during the boot process. 110 __init text and data that can be discarded during the boot process.
111 111
@@ -159,7 +159,7 @@ One advantage of the configuration file is that root access is not required to
159set permissions or create device nodes in the new archive. (Note that those 159set permissions or create device nodes in the new archive. (Note that those
160two example "file" entries expect to find files named "init.sh" and "busybox" in 160two example "file" entries expect to find files named "init.sh" and "busybox" in
161a directory called "initramfs", under the linux-2.6.* directory. See 161a directory called "initramfs", under the linux-2.6.* directory. See
162Documentation/early-userspace/README for more details.) 162Documentation/driver-api/early-userspace/early_userspace_support.rst for more details.)
163 163
164The kernel does not depend on external cpio tools. If you specify a 164The kernel does not depend on external cpio tools. If you specify a
165directory instead of a configuration file, the kernel's build infrastructure 165directory instead of a configuration file, the kernel's build infrastructure
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 5b5311f9358d..ddf15b1b0d5a 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -319,7 +319,7 @@ quick way to lookup the sysfs interface for a device from the result of
319a stat(2) operation. 319a stat(2) operation.
320 320
321More information can driver-model specific features can be found in 321More information can driver-model specific features can be found in
322Documentation/driver-model/. 322Documentation/driver-api/driver-model/.
323 323
324 324
325TODO: Finish this section. 325TODO: Finish this section.
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt
index cad797a8a39e..5ecbc03e6b2f 100644
--- a/Documentation/filesystems/tmpfs.txt
+++ b/Documentation/filesystems/tmpfs.txt
@@ -98,7 +98,7 @@ A memory policy with a valid NodeList will be saved, as specified, for
98use at file creation time. When a task allocates a file in the file 98use at file creation time. When a task allocates a file in the file
99system, the mount option memory policy will be applied with a NodeList, 99system, the mount option memory policy will be applied with a NodeList,
100if any, modified by the calling task's cpuset constraints 100if any, modified by the calling task's cpuset constraints
101[See Documentation/cgroup-v1/cpusets.rst] and any optional flags, listed 101[See Documentation/admin-guide/cgroup-v1/cpusets.rst] and any optional flags, listed
102below. If the resulting NodeLists is the empty set, the effective memory 102below. If the resulting NodeLists is the empty set, the effective memory
103policy for the file will revert to "default" policy. 103policy for the file will revert to "default" policy.
104 104
diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
index 1252617b520f..0a72b6321f5f 100644
--- a/Documentation/firmware-guide/acpi/enumeration.rst
+++ b/Documentation/firmware-guide/acpi/enumeration.rst
@@ -316,7 +316,7 @@ specifies the path to the controller. In order to use these GPIOs in Linux
316we need to translate them to the corresponding Linux GPIO descriptors. 316we need to translate them to the corresponding Linux GPIO descriptors.
317 317
318There is a standard GPIO API for that and is documented in 318There is a standard GPIO API for that and is documented in
319Documentation/gpio/. 319Documentation/admin-guide/gpio/.
320 320
321In the above example we can get the corresponding two GPIO descriptors with 321In the above example we can get the corresponding two GPIO descriptors with
322a code like this:: 322a code like this::
diff --git a/Documentation/fpga/index.rst b/Documentation/fpga/index.rst
index 2c87d1ea084f..f80f95667ca2 100644
--- a/Documentation/fpga/index.rst
+++ b/Documentation/fpga/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3==== 3====
4fpga 4fpga
diff --git a/Documentation/hid/index.rst b/Documentation/hid/index.rst
index af4324902622..737d66dc16a1 100644
--- a/Documentation/hid/index.rst
+++ b/Documentation/hid/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3============================= 3=============================
4Human Interface Devices (HID) 4Human Interface Devices (HID)
diff --git a/Documentation/hwmon/submitting-patches.rst b/Documentation/hwmon/submitting-patches.rst
index d5b05d3e54ba..452fc28d8e0b 100644
--- a/Documentation/hwmon/submitting-patches.rst
+++ b/Documentation/hwmon/submitting-patches.rst
@@ -89,7 +89,7 @@ increase the chances of your change being accepted.
89 console. Excessive logging can seriously affect system performance. 89 console. Excessive logging can seriously affect system performance.
90 90
91* Use devres functions whenever possible to allocate resources. For rationale 91* Use devres functions whenever possible to allocate resources. For rationale
92 and supported functions, please see Documentation/driver-model/devres.rst. 92 and supported functions, please see Documentation/driver-api/driver-model/devres.rst.
93 If a function is not supported by devres, consider using devm_add_action(). 93 If a function is not supported by devres, consider using devm_add_action().
94 94
95* If the driver has a detect function, make sure it is silent. Debug messages 95* If the driver has a detect function, make sure it is silent. Debug messages
diff --git a/Documentation/ia64/aliasing.txt b/Documentation/ia64/aliasing.rst
index 5a4dea6abebd..a08b36aba015 100644
--- a/Documentation/ia64/aliasing.txt
+++ b/Documentation/ia64/aliasing.rst
@@ -1,20 +1,25 @@
1 MEMORY ATTRIBUTE ALIASING ON IA-64 1==================================
2Memory Attribute Aliasing on IA-64
3==================================
2 4
3 Bjorn Helgaas 5Bjorn Helgaas <bjorn.helgaas@hp.com>
4 <bjorn.helgaas@hp.com>
5 May 4, 2006
6 6
7May 4, 2006
7 8
8MEMORY ATTRIBUTES 9
10Memory Attributes
11=================
9 12
10 Itanium supports several attributes for virtual memory references. 13 Itanium supports several attributes for virtual memory references.
11 The attribute is part of the virtual translation, i.e., it is 14 The attribute is part of the virtual translation, i.e., it is
12 contained in the TLB entry. The ones of most interest to the Linux 15 contained in the TLB entry. The ones of most interest to the Linux
13 kernel are: 16 kernel are:
14 17
15 WB Write-back (cacheable) 18 == ======================
19 WB Write-back (cacheable)
16 UC Uncacheable 20 UC Uncacheable
17 WC Write-coalescing 21 WC Write-coalescing
22 == ======================
18 23
19 System memory typically uses the WB attribute. The UC attribute is 24 System memory typically uses the WB attribute. The UC attribute is
20 used for memory-mapped I/O devices. The WC attribute is uncacheable 25 used for memory-mapped I/O devices. The WC attribute is uncacheable
@@ -29,7 +34,8 @@ MEMORY ATTRIBUTES
29 support either WB or UC access to main memory, while others support 34 support either WB or UC access to main memory, while others support
30 only WB access. 35 only WB access.
31 36
32MEMORY MAP 37Memory Map
38==========
33 39
34 Platform firmware describes the physical memory map and the 40 Platform firmware describes the physical memory map and the
35 supported attributes for each region. At boot-time, the kernel uses 41 supported attributes for each region. At boot-time, the kernel uses
@@ -55,7 +61,8 @@ MEMORY MAP
55 The efi_memmap table is preserved unmodified because the original 61 The efi_memmap table is preserved unmodified because the original
56 boot-time information is required for kexec. 62 boot-time information is required for kexec.
57 63
58KERNEL IDENTITY MAPPINGS 64Kernel Identify Mappings
65========================
59 66
60 Linux/ia64 identity mappings are done with large pages, currently 67 Linux/ia64 identity mappings are done with large pages, currently
61 either 16MB or 64MB, referred to as "granules." Cacheable mappings 68 either 16MB or 64MB, referred to as "granules." Cacheable mappings
@@ -74,17 +81,20 @@ KERNEL IDENTITY MAPPINGS
74 are only partially populated, or populated with a combination of UC 81 are only partially populated, or populated with a combination of UC
75 and WB regions. 82 and WB regions.
76 83
77USER MAPPINGS 84User Mappings
85=============
78 86
79 User mappings are typically done with 16K or 64K pages. The smaller 87 User mappings are typically done with 16K or 64K pages. The smaller
80 page size allows more flexibility because only 16K or 64K has to be 88 page size allows more flexibility because only 16K or 64K has to be
81 homogeneous with respect to memory attributes. 89 homogeneous with respect to memory attributes.
82 90
83POTENTIAL ATTRIBUTE ALIASING CASES 91Potential Attribute Aliasing Cases
92==================================
84 93
85 There are several ways the kernel creates new mappings: 94 There are several ways the kernel creates new mappings:
86 95
87 mmap of /dev/mem 96mmap of /dev/mem
97----------------
88 98
89 This uses remap_pfn_range(), which creates user mappings. These 99 This uses remap_pfn_range(), which creates user mappings. These
90 mappings may be either WB or UC. If the region being mapped 100 mappings may be either WB or UC. If the region being mapped
@@ -98,7 +108,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES
98 Since the EFI memory map does not describe MMIO on some 108 Since the EFI memory map does not describe MMIO on some
99 machines, this should use an uncacheable mapping as a fallback. 109 machines, this should use an uncacheable mapping as a fallback.
100 110
101 mmap of /sys/class/pci_bus/.../legacy_mem 111mmap of /sys/class/pci_bus/.../legacy_mem
112-----------------------------------------
102 113
103 This is very similar to mmap of /dev/mem, except that legacy_mem 114 This is very similar to mmap of /dev/mem, except that legacy_mem
104 only allows mmap of the one megabyte "legacy MMIO" area for a 115 only allows mmap of the one megabyte "legacy MMIO" area for a
@@ -112,9 +123,10 @@ POTENTIAL ATTRIBUTE ALIASING CASES
112 123
113 The /dev/mem mmap constraints apply. 124 The /dev/mem mmap constraints apply.
114 125
115 mmap of /proc/bus/pci/.../??.? 126mmap of /proc/bus/pci/.../??.?
127------------------------------
116 128
117 This is an MMIO mmap of PCI functions, which additionally may or 129 This is an MMIO mmap of PCI functions, which additionally may or
118 may not be requested as using the WC attribute. 130 may not be requested as using the WC attribute.
119 131
120 If WC is requested, and the region in kern_memmap is either WC 132 If WC is requested, and the region in kern_memmap is either WC
@@ -124,7 +136,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES
124 Otherwise, the user mapping must use the same attribute as the 136 Otherwise, the user mapping must use the same attribute as the
125 kernel mapping. 137 kernel mapping.
126 138
127 read/write of /dev/mem 139read/write of /dev/mem
140----------------------
128 141
129 This uses copy_from_user(), which implicitly uses a kernel 142 This uses copy_from_user(), which implicitly uses a kernel
130 identity mapping. This is obviously safe for things in 143 identity mapping. This is obviously safe for things in
@@ -138,7 +151,8 @@ POTENTIAL ATTRIBUTE ALIASING CASES
138 eight-byte accesses, and the copy_from_user() path doesn't allow 151 eight-byte accesses, and the copy_from_user() path doesn't allow
139 any control over the access size, so this would be dangerous. 152 any control over the access size, so this would be dangerous.
140 153
141 ioremap() 154ioremap()
155---------
142 156
143 This returns a mapping for use inside the kernel. 157 This returns a mapping for use inside the kernel.
144 158
@@ -155,9 +169,11 @@ POTENTIAL ATTRIBUTE ALIASING CASES
155 169
156 Failing all of the above, we have to fall back to a UC mapping. 170 Failing all of the above, we have to fall back to a UC mapping.
157 171
158PAST PROBLEM CASES 172Past Problem Cases
173==================
159 174
160 mmap of various MMIO regions from /dev/mem by "X" on Intel platforms 175mmap of various MMIO regions from /dev/mem by "X" on Intel platforms
176--------------------------------------------------------------------
161 177
162 The EFI memory map may not report these MMIO regions. 178 The EFI memory map may not report these MMIO regions.
163 179
@@ -166,12 +182,16 @@ PAST PROBLEM CASES
166 succeed. It may create either WB or UC user mappings, depending 182 succeed. It may create either WB or UC user mappings, depending
167 on whether the region is in kern_memmap or the EFI memory map. 183 on whether the region is in kern_memmap or the EFI memory map.
168 184
169 mmap of 0x0-0x9FFFF /dev/mem by "hwinfo" on HP sx1000 with VGA enabled 185mmap of 0x0-0x9FFFF /dev/mem by "hwinfo" on HP sx1000 with VGA enabled
186----------------------------------------------------------------------
170 187
171 The EFI memory map reports the following attributes: 188 The EFI memory map reports the following attributes:
189
190 =============== ======= ==================
172 0x00000-0x9FFFF WB only 191 0x00000-0x9FFFF WB only
173 0xA0000-0xBFFFF UC only (VGA frame buffer) 192 0xA0000-0xBFFFF UC only (VGA frame buffer)
174 0xC0000-0xFFFFF WB only 193 0xC0000-0xFFFFF WB only
194 =============== ======= ==================
175 195
176 This mmap is done with user pages, not kernel identity mappings, 196 This mmap is done with user pages, not kernel identity mappings,
177 so it is safe to use WB mappings. 197 so it is safe to use WB mappings.
@@ -182,7 +202,8 @@ PAST PROBLEM CASES
182 never generate an uncacheable reference to the WB-only areas unless 202 never generate an uncacheable reference to the WB-only areas unless
183 the driver explicitly touches them. 203 the driver explicitly touches them.
184 204
185 mmap of 0x0-0xFFFFF legacy_mem by "X" 205mmap of 0x0-0xFFFFF legacy_mem by "X"
206-------------------------------------
186 207
187 If the EFI memory map reports that the entire range supports the 208 If the EFI memory map reports that the entire range supports the
188 same attributes, we can allow the mmap (and we will prefer WB if 209 same attributes, we can allow the mmap (and we will prefer WB if
@@ -197,15 +218,18 @@ PAST PROBLEM CASES
197 that doesn't report the VGA frame buffer at all), we should fail the 218 that doesn't report the VGA frame buffer at all), we should fail the
198 mmap and force the user to map just the specific region of interest. 219 mmap and force the user to map just the specific region of interest.
199 220
200 mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled 221mmap of 0xA0000-0xBFFFF legacy_mem by "X" on HP sx1000 with VGA disabled
222------------------------------------------------------------------------
223
224 The EFI memory map reports the following attributes::
201 225
202 The EFI memory map reports the following attributes:
203 0x00000-0xFFFFF WB only (no VGA MMIO hole) 226 0x00000-0xFFFFF WB only (no VGA MMIO hole)
204 227
205 This is a special case of the previous case, and the mmap should 228 This is a special case of the previous case, and the mmap should
206 fail for the same reason as above. 229 fail for the same reason as above.
207 230
208 read of /sys/devices/.../rom 231read of /sys/devices/.../rom
232----------------------------
209 233
210 For VGA devices, this may cause an ioremap() of 0xC0000. This 234 For VGA devices, this may cause an ioremap() of 0xC0000. This
211 used to be done with a UC mapping, because the VGA frame buffer 235 used to be done with a UC mapping, because the VGA frame buffer
@@ -215,7 +239,8 @@ PAST PROBLEM CASES
215 We should use WB page table mappings to avoid covering the VGA 239 We should use WB page table mappings to avoid covering the VGA
216 frame buffer. 240 frame buffer.
217 241
218NOTES 242Notes
243=====
219 244
220 [1] SDM rev 2.2, vol 2, sec 4.4.1. 245 [1] SDM rev 2.2, vol 2, sec 4.4.1.
221 [2] SDM rev 2.2, vol 2, sec 4.4.6. 246 [2] SDM rev 2.2, vol 2, sec 4.4.6.
diff --git a/Documentation/ia64/efirtc.txt b/Documentation/ia64/efirtc.rst
index 057e6bebda8f..2f7ff5026308 100644
--- a/Documentation/ia64/efirtc.txt
+++ b/Documentation/ia64/efirtc.rst
@@ -1,12 +1,16 @@
1==========================
1EFI Real Time Clock driver 2EFI Real Time Clock driver
2------------------------------- 3==========================
4
3S. Eranian <eranian@hpl.hp.com> 5S. Eranian <eranian@hpl.hp.com>
6
4March 2000 7March 2000
5 8
6I/ Introduction 91. Introduction
10===============
7 11
8This document describes the efirtc.c driver has provided for 12This document describes the efirtc.c driver has provided for
9the IA-64 platform. 13the IA-64 platform.
10 14
11The purpose of this driver is to supply an API for kernel and user applications 15The purpose of this driver is to supply an API for kernel and user applications
12to get access to the Time Service offered by EFI version 0.92. 16to get access to the Time Service offered by EFI version 0.92.
@@ -16,112 +20,124 @@ SetTime(), GetWakeupTime(), SetWakeupTime() which are all supported by this
16driver. We describe those calls as well the design of the driver in the 20driver. We describe those calls as well the design of the driver in the
17following sections. 21following sections.
18 22
19II/ Design Decisions 232. Design Decisions
24===================
20 25
21The original ideas was to provide a very simple driver to get access to, 26The original ideas was to provide a very simple driver to get access to,
22at first, the time of day service. This is required in order to access, in a 27at first, the time of day service. This is required in order to access, in a
23portable way, the CMOS clock. A program like /sbin/hwclock uses such a clock 28portable way, the CMOS clock. A program like /sbin/hwclock uses such a clock
24to initialize the system view of the time during boot. 29to initialize the system view of the time during boot.
25 30
26Because we wanted to minimize the impact on existing user-level apps using 31Because we wanted to minimize the impact on existing user-level apps using
27the CMOS clock, we decided to expose an API that was very similar to the one 32the CMOS clock, we decided to expose an API that was very similar to the one
28used today with the legacy RTC driver (driver/char/rtc.c). However, because 33used today with the legacy RTC driver (driver/char/rtc.c). However, because
29EFI provides a simpler services, not all ioctl() are available. Also 34EFI provides a simpler services, not all ioctl() are available. Also
30new ioctl()s have been introduced for things that EFI provides but not the 35new ioctl()s have been introduced for things that EFI provides but not the
31legacy. 36legacy.
32 37
33EFI uses a slightly different way of representing the time, noticeably 38EFI uses a slightly different way of representing the time, noticeably
34the reference date is different. Year is the using the full 4-digit format. 39the reference date is different. Year is the using the full 4-digit format.
35The Epoch is January 1st 1998. For backward compatibility reasons we don't 40The Epoch is January 1st 1998. For backward compatibility reasons we don't
36expose this new way of representing time. Instead we use something very 41expose this new way of representing time. Instead we use something very
37similar to the struct tm, i.e. struct rtc_time, as used by hwclock. 42similar to the struct tm, i.e. struct rtc_time, as used by hwclock.
38One of the reasons for doing it this way is to allow for EFI to still evolve 43One of the reasons for doing it this way is to allow for EFI to still evolve
39without necessarily impacting any of the user applications. The decoupling 44without necessarily impacting any of the user applications. The decoupling
40enables flexibility and permits writing wrapper code is ncase things change. 45enables flexibility and permits writing wrapper code is ncase things change.
41 46
42The driver exposes two interfaces, one via the device file and a set of 47The driver exposes two interfaces, one via the device file and a set of
43ioctl()s. The other is read-only via the /proc filesystem. 48ioctl()s. The other is read-only via the /proc filesystem.
44 49
45As of today we don't offer a /proc/sys interface. 50As of today we don't offer a /proc/sys interface.
46 51
47To allow for a uniform interface between the legacy RTC and EFI time service, 52To allow for a uniform interface between the legacy RTC and EFI time service,
48we have created the include/linux/rtc.h header file to contain only the 53we have created the include/linux/rtc.h header file to contain only the
49"public" API of the two drivers. The specifics of the legacy RTC are still 54"public" API of the two drivers. The specifics of the legacy RTC are still
50in include/linux/mc146818rtc.h. 55in include/linux/mc146818rtc.h.
51 56
52 57
53III/ Time of day service 583. Time of day service
59======================
54 60
55The part of the driver gives access to the time of day service of EFI. 61The part of the driver gives access to the time of day service of EFI.
56Two ioctl()s, compatible with the legacy RTC calls: 62Two ioctl()s, compatible with the legacy RTC calls:
57 63
58 Read the CMOS clock: ioctl(d, RTC_RD_TIME, &rtc); 64 Read the CMOS clock::
65
66 ioctl(d, RTC_RD_TIME, &rtc);
67
68 Write the CMOS clock::
59 69
60 Write the CMOS clock: ioctl(d, RTC_SET_TIME, &rtc); 70 ioctl(d, RTC_SET_TIME, &rtc);
61 71
62The rtc is a pointer to a data structure defined in rtc.h which is close 72The rtc is a pointer to a data structure defined in rtc.h which is close
63to a struct tm: 73to a struct tm::
64 74
65struct rtc_time { 75 struct rtc_time {
66 int tm_sec; 76 int tm_sec;
67 int tm_min; 77 int tm_min;
68 int tm_hour; 78 int tm_hour;
69 int tm_mday; 79 int tm_mday;
70 int tm_mon; 80 int tm_mon;
71 int tm_year; 81 int tm_year;
72 int tm_wday; 82 int tm_wday;
73 int tm_yday; 83 int tm_yday;
74 int tm_isdst; 84 int tm_isdst;
75}; 85 };
76 86
77The driver takes care of converting back an forth between the EFI time and 87The driver takes care of converting back an forth between the EFI time and
78this format. 88this format.
79 89
80Those two ioctl()s can be exercised with the hwclock command: 90Those two ioctl()s can be exercised with the hwclock command:
81 91
82For reading: 92For reading::
83# /sbin/hwclock --show
84Mon Mar 6 15:32:32 2000 -0.910248 seconds
85 93
86For setting: 94 # /sbin/hwclock --show
87# /sbin/hwclock --systohc 95 Mon Mar 6 15:32:32 2000 -0.910248 seconds
96
97For setting::
98
99 # /sbin/hwclock --systohc
88 100
89Root privileges are required to be able to set the time of day. 101Root privileges are required to be able to set the time of day.
90 102
91IV/ Wakeup Alarm service 1034. Wakeup Alarm service
104=======================
92 105
93EFI provides an API by which one can program when a machine should wakeup, 106EFI provides an API by which one can program when a machine should wakeup,
94i.e. reboot. This is very different from the alarm provided by the legacy 107i.e. reboot. This is very different from the alarm provided by the legacy
95RTC which is some kind of interval timer alarm. For this reason we don't use 108RTC which is some kind of interval timer alarm. For this reason we don't use
96the same ioctl()s to get access to the service. Instead we have 109the same ioctl()s to get access to the service. Instead we have
97introduced 2 news ioctl()s to the interface of an RTC. 110introduced 2 news ioctl()s to the interface of an RTC.
98 111
99We have added 2 new ioctl()s that are specific to the EFI driver: 112We have added 2 new ioctl()s that are specific to the EFI driver:
100 113
101 Read the current state of the alarm 114 Read the current state of the alarm::
102 ioctl(d, RTC_WKLAM_RD, &wkt) 115
116 ioctl(d, RTC_WKLAM_RD, &wkt)
117
118 Set the alarm or change its status::
119
120 ioctl(d, RTC_WKALM_SET, &wkt)
103 121
104 Set the alarm or change its status 122The wkt structure encapsulates a struct rtc_time + 2 extra fields to get
105 ioctl(d, RTC_WKALM_SET, &wkt) 123status information::
106 124
107The wkt structure encapsulates a struct rtc_time + 2 extra fields to get 125 struct rtc_wkalrm {
108status information:
109
110struct rtc_wkalrm {
111 126
112 unsigned char enabled; /* =1 if alarm is enabled */ 127 unsigned char enabled; /* =1 if alarm is enabled */
113 unsigned char pending; /* =1 if alarm is pending */ 128 unsigned char pending; /* =1 if alarm is pending */
114 129
115 struct rtc_time time; 130 struct rtc_time time;
116} 131 }
117 132
118As of today, none of the existing user-level apps supports this feature. 133As of today, none of the existing user-level apps supports this feature.
119However writing such a program should be hard by simply using those two 134However writing such a program should be hard by simply using those two
120ioctl(). 135ioctl().
121 136
122Root privileges are required to be able to set the alarm. 137Root privileges are required to be able to set the alarm.
123 138
124V/ References. 1395. References
140=============
125 141
126Checkout the following Web site for more information on EFI: 142Checkout the following Web site for more information on EFI:
127 143
diff --git a/Documentation/ia64/err_inject.txt b/Documentation/ia64/err_inject.rst
index 9f651c181429..900f71e93a29 100644
--- a/Documentation/ia64/err_inject.txt
+++ b/Documentation/ia64/err_inject.rst
@@ -1,4 +1,4 @@
1 1========================================
2IPF Machine Check (MC) error inject tool 2IPF Machine Check (MC) error inject tool
3======================================== 3========================================
4 4
@@ -32,94 +32,94 @@ Errata: Itanium 2 Processors Specification Update lists some errata against
32the pal_mc_error_inject PAL procedure. The following err.conf has been tested 32the pal_mc_error_inject PAL procedure. The following err.conf has been tested
33on latest Montecito PAL. 33on latest Montecito PAL.
34 34
35err.conf: 35err.conf::
36 36
37#This is configuration file for err_inject_tool. 37 #This is configuration file for err_inject_tool.
38#The format of the each line is: 38 #The format of the each line is:
39#cpu, loop, interval, err_type_info, err_struct_info, err_data_buffer 39 #cpu, loop, interval, err_type_info, err_struct_info, err_data_buffer
40#where 40 #where
41# cpu: logical cpu number the error will be inject in. 41 # cpu: logical cpu number the error will be inject in.
42# loop: times the error will be injected. 42 # loop: times the error will be injected.
43# interval: In second. every so often one error is injected. 43 # interval: In second. every so often one error is injected.
44# err_type_info, err_struct_info: PAL parameters. 44 # err_type_info, err_struct_info: PAL parameters.
45# 45 #
46#Note: All values are hex w/o or w/ 0x prefix. 46 #Note: All values are hex w/o or w/ 0x prefix.
47 47
48 48
49#On cpu2, inject only total 0x10 errors, interval 5 seconds 49 #On cpu2, inject only total 0x10 errors, interval 5 seconds
50#corrected, data cache, hier-2, physical addr(assigned by tool code). 50 #corrected, data cache, hier-2, physical addr(assigned by tool code).
51#working on Montecito latest PAL. 51 #working on Montecito latest PAL.
522, 10, 5, 4101, 95 52 2, 10, 5, 4101, 95
53 53
54#On cpu4, inject and consume total 0x10 errors, interval 5 seconds 54 #On cpu4, inject and consume total 0x10 errors, interval 5 seconds
55#corrected, data cache, hier-2, physical addr(assigned by tool code). 55 #corrected, data cache, hier-2, physical addr(assigned by tool code).
56#working on Montecito latest PAL. 56 #working on Montecito latest PAL.
574, 10, 5, 4109, 95 57 4, 10, 5, 4109, 95
58 58
59#On cpu15, inject and consume total 0x10 errors, interval 5 seconds 59 #On cpu15, inject and consume total 0x10 errors, interval 5 seconds
60#recoverable, DTR0, hier-2. 60 #recoverable, DTR0, hier-2.
61#working on Montecito latest PAL. 61 #working on Montecito latest PAL.
620xf, 0x10, 5, 4249, 15 62 0xf, 0x10, 5, 4249, 15
63 63
64The sample application source code: 64The sample application source code:
65 65
66err_injection_tool.c: 66err_injection_tool.c::
67 67
68/* 68 /*
69 * This program is free software; you can redistribute it and/or modify 69 * This program is free software; you can redistribute it and/or modify
70 * it under the terms of the GNU General Public License as published by 70 * it under the terms of the GNU General Public License as published by
71 * the Free Software Foundation; either version 2 of the License, or 71 * the Free Software Foundation; either version 2 of the License, or
72 * (at your option) any later version. 72 * (at your option) any later version.
73 * 73 *
74 * This program is distributed in the hope that it will be useful, but 74 * This program is distributed in the hope that it will be useful, but
75 * WITHOUT ANY WARRANTY; without even the implied warranty of 75 * WITHOUT ANY WARRANTY; without even the implied warranty of
76 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 76 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
77 * NON INFRINGEMENT. See the GNU General Public License for more 77 * NON INFRINGEMENT. See the GNU General Public License for more
78 * details. 78 * details.
79 * 79 *
80 * You should have received a copy of the GNU General Public License 80 * You should have received a copy of the GNU General Public License
81 * along with this program; if not, write to the Free Software 81 * along with this program; if not, write to the Free Software
82 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 82 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
83 * 83 *
84 * Copyright (C) 2006 Intel Co 84 * Copyright (C) 2006 Intel Co
85 * Fenghua Yu <fenghua.yu@intel.com> 85 * Fenghua Yu <fenghua.yu@intel.com>
86 * 86 *
87 */ 87 */
88#include <sys/types.h> 88 #include <sys/types.h>
89#include <sys/stat.h> 89 #include <sys/stat.h>
90#include <fcntl.h> 90 #include <fcntl.h>
91#include <stdio.h> 91 #include <stdio.h>
92#include <sched.h> 92 #include <sched.h>
93#include <unistd.h> 93 #include <unistd.h>
94#include <stdlib.h> 94 #include <stdlib.h>
95#include <stdarg.h> 95 #include <stdarg.h>
96#include <string.h> 96 #include <string.h>
97#include <errno.h> 97 #include <errno.h>
98#include <time.h> 98 #include <time.h>
99#include <sys/ipc.h> 99 #include <sys/ipc.h>
100#include <sys/sem.h> 100 #include <sys/sem.h>
101#include <sys/wait.h> 101 #include <sys/wait.h>
102#include <sys/mman.h> 102 #include <sys/mman.h>
103#include <sys/shm.h> 103 #include <sys/shm.h>
104 104
105#define MAX_FN_SIZE 256 105 #define MAX_FN_SIZE 256
106#define MAX_BUF_SIZE 256 106 #define MAX_BUF_SIZE 256
107#define DATA_BUF_SIZE 256 107 #define DATA_BUF_SIZE 256
108#define NR_CPUS 512 108 #define NR_CPUS 512
109#define MAX_TASK_NUM 2048 109 #define MAX_TASK_NUM 2048
110#define MIN_INTERVAL 5 // seconds 110 #define MIN_INTERVAL 5 // seconds
111#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte. 111 #define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte.
112#define PARA_FIELD_NUM 5 112 #define PARA_FIELD_NUM 5
113#define MASK_SIZE (NR_CPUS/64) 113 #define MASK_SIZE (NR_CPUS/64)
114#define PATH_FORMAT "/sys/devices/system/cpu/cpu%d/err_inject/" 114 #define PATH_FORMAT "/sys/devices/system/cpu/cpu%d/err_inject/"
115 115
116int sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask); 116 int sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask);
117 117
118int verbose; 118 int verbose;
119#define vbprintf if (verbose) printf 119 #define vbprintf if (verbose) printf
120 120
121int log_info(int cpu, const char *fmt, ...) 121 int log_info(int cpu, const char *fmt, ...)
122{ 122 {
123 FILE *log; 123 FILE *log;
124 char fn[MAX_FN_SIZE]; 124 char fn[MAX_FN_SIZE];
125 char buf[MAX_BUF_SIZE]; 125 char buf[MAX_BUF_SIZE];
@@ -142,12 +142,12 @@ int log_info(int cpu, const char *fmt, ...)
142 fclose(log); 142 fclose(log);
143 143
144 return 0; 144 return 0;
145} 145 }
146 146
147typedef unsigned long u64; 147 typedef unsigned long u64;
148typedef unsigned int u32; 148 typedef unsigned int u32;
149 149
150typedef union err_type_info_u { 150 typedef union err_type_info_u {
151 struct { 151 struct {
152 u64 mode : 3, /* 0-2 */ 152 u64 mode : 3, /* 0-2 */
153 err_inj : 3, /* 3-5 */ 153 err_inj : 3, /* 3-5 */
@@ -157,9 +157,9 @@ typedef union err_type_info_u {
157 reserved : 48; /* 16-63 */ 157 reserved : 48; /* 16-63 */
158 } err_type_info_u; 158 } err_type_info_u;
159 u64 err_type_info; 159 u64 err_type_info;
160} err_type_info_t; 160 } err_type_info_t;
161 161
162typedef union err_struct_info_u { 162 typedef union err_struct_info_u {
163 struct { 163 struct {
164 u64 siv : 1, /* 0 */ 164 u64 siv : 1, /* 0 */
165 c_t : 2, /* 1-2 */ 165 c_t : 2, /* 1-2 */
@@ -197,9 +197,9 @@ typedef union err_struct_info_u {
197 u64 reserved; 197 u64 reserved;
198 } err_struct_info_bus_processor_interconnect; 198 } err_struct_info_bus_processor_interconnect;
199 u64 err_struct_info; 199 u64 err_struct_info;
200} err_struct_info_t; 200 } err_struct_info_t;
201 201
202typedef union err_data_buffer_u { 202 typedef union err_data_buffer_u {
203 struct { 203 struct {
204 u64 trigger_addr; /* 0-63 */ 204 u64 trigger_addr; /* 0-63 */
205 u64 inj_addr; /* 64-127 */ 205 u64 inj_addr; /* 64-127 */
@@ -221,9 +221,9 @@ typedef union err_data_buffer_u {
221 u64 reserved; /* 0-63 */ 221 u64 reserved; /* 0-63 */
222 } err_data_buffer_bus_processor_interconnect; 222 } err_data_buffer_bus_processor_interconnect;
223 u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; 223 u64 err_data_buffer[ERR_DATA_BUFFER_SIZE];
224} err_data_buffer_t; 224 } err_data_buffer_t;
225 225
226typedef union capabilities_u { 226 typedef union capabilities_u {
227 struct { 227 struct {
228 u64 i : 1, 228 u64 i : 1,
229 d : 1, 229 d : 1,
@@ -276,9 +276,9 @@ typedef union capabilities_u {
276 struct { 276 struct {
277 u64 reserved; 277 u64 reserved;
278 } capabilities_bus_processor_interconnect; 278 } capabilities_bus_processor_interconnect;
279} capabilities_t; 279 } capabilities_t;
280 280
281typedef struct resources_s { 281 typedef struct resources_s {
282 u64 ibr0 : 1, 282 u64 ibr0 : 1,
283 ibr2 : 1, 283 ibr2 : 1,
284 ibr4 : 1, 284 ibr4 : 1,
@@ -288,24 +288,24 @@ typedef struct resources_s {
288 dbr4 : 1, 288 dbr4 : 1,
289 dbr6 : 1, 289 dbr6 : 1,
290 reserved : 48; 290 reserved : 48;
291} resources_t; 291 } resources_t;
292 292
293 293
294long get_page_size(void) 294 long get_page_size(void)
295{ 295 {
296 long page_size=sysconf(_SC_PAGESIZE); 296 long page_size=sysconf(_SC_PAGESIZE);
297 return page_size; 297 return page_size;
298} 298 }
299 299
300#define PAGE_SIZE (get_page_size()==-1?0x4000:get_page_size()) 300 #define PAGE_SIZE (get_page_size()==-1?0x4000:get_page_size())
301#define SHM_SIZE (2*PAGE_SIZE*NR_CPUS) 301 #define SHM_SIZE (2*PAGE_SIZE*NR_CPUS)
302#define SHM_VA 0x2000000100000000 302 #define SHM_VA 0x2000000100000000
303 303
304int shmid; 304 int shmid;
305void *shmaddr; 305 void *shmaddr;
306 306
307int create_shm(void) 307 int create_shm(void)
308{ 308 {
309 key_t key; 309 key_t key;
310 char fn[MAX_FN_SIZE]; 310 char fn[MAX_FN_SIZE];
311 311
@@ -343,34 +343,34 @@ int create_shm(void)
343 mlock(shmaddr, SHM_SIZE); 343 mlock(shmaddr, SHM_SIZE);
344 344
345 return 0; 345 return 0;
346} 346 }
347 347
348int free_shm() 348 int free_shm()
349{ 349 {
350 munlock(shmaddr, SHM_SIZE); 350 munlock(shmaddr, SHM_SIZE);
351 shmdt(shmaddr); 351 shmdt(shmaddr);
352 semctl(shmid, 0, IPC_RMID); 352 semctl(shmid, 0, IPC_RMID);
353 353
354 return 0; 354 return 0;
355} 355 }
356 356
357#ifdef _SEM_SEMUN_UNDEFINED 357 #ifdef _SEM_SEMUN_UNDEFINED
358union semun 358 union semun
359{ 359 {
360 int val; 360 int val;
361 struct semid_ds *buf; 361 struct semid_ds *buf;
362 unsigned short int *array; 362 unsigned short int *array;
363 struct seminfo *__buf; 363 struct seminfo *__buf;
364}; 364 };
365#endif 365 #endif
366 366
367u32 mode=1; /* 1: physical mode; 2: virtual mode. */ 367 u32 mode=1; /* 1: physical mode; 2: virtual mode. */
368int one_lock=1; 368 int one_lock=1;
369key_t key[NR_CPUS]; 369 key_t key[NR_CPUS];
370int semid[NR_CPUS]; 370 int semid[NR_CPUS];
371 371
372int create_sem(int cpu) 372 int create_sem(int cpu)
373{ 373 {
374 union semun arg; 374 union semun arg;
375 char fn[MAX_FN_SIZE]; 375 char fn[MAX_FN_SIZE];
376 int sid; 376 int sid;
@@ -407,37 +407,37 @@ int create_sem(int cpu)
407 } 407 }
408 408
409 return 0; 409 return 0;
410} 410 }
411 411
412static int lock(int cpu) 412 static int lock(int cpu)
413{ 413 {
414 struct sembuf lock; 414 struct sembuf lock;
415 415
416 lock.sem_num = cpu; 416 lock.sem_num = cpu;
417 lock.sem_op = 1; 417 lock.sem_op = 1;
418 semop(semid[cpu], &lock, 1); 418 semop(semid[cpu], &lock, 1);
419 419
420 return 0; 420 return 0;
421} 421 }
422 422
423static int unlock(int cpu) 423 static int unlock(int cpu)
424{ 424 {
425 struct sembuf unlock; 425 struct sembuf unlock;
426 426
427 unlock.sem_num = cpu; 427 unlock.sem_num = cpu;
428 unlock.sem_op = -1; 428 unlock.sem_op = -1;
429 semop(semid[cpu], &unlock, 1); 429 semop(semid[cpu], &unlock, 1);
430 430
431 return 0; 431 return 0;
432} 432 }
433 433
434void free_sem(int cpu) 434 void free_sem(int cpu)
435{ 435 {
436 semctl(semid[cpu], 0, IPC_RMID); 436 semctl(semid[cpu], 0, IPC_RMID);
437} 437 }
438 438
439int wr_multi(char *fn, unsigned long *data, int size) 439 int wr_multi(char *fn, unsigned long *data, int size)
440{ 440 {
441 int fd; 441 int fd;
442 char buf[MAX_BUF_SIZE]; 442 char buf[MAX_BUF_SIZE];
443 int ret; 443 int ret;
@@ -459,15 +459,15 @@ int wr_multi(char *fn, unsigned long *data, int size)
459 ret=write(fd, buf, sizeof(buf)); 459 ret=write(fd, buf, sizeof(buf));
460 close(fd); 460 close(fd);
461 return ret; 461 return ret;
462} 462 }
463 463
464int wr(char *fn, unsigned long data) 464 int wr(char *fn, unsigned long data)
465{ 465 {
466 return wr_multi(fn, &data, 1); 466 return wr_multi(fn, &data, 1);
467} 467 }
468 468
469int rd(char *fn, unsigned long *data) 469 int rd(char *fn, unsigned long *data)
470{ 470 {
471 int fd; 471 int fd;
472 char buf[MAX_BUF_SIZE]; 472 char buf[MAX_BUF_SIZE];
473 473
@@ -480,10 +480,10 @@ int rd(char *fn, unsigned long *data)
480 *data=strtoul(buf, NULL, 16); 480 *data=strtoul(buf, NULL, 16);
481 close(fd); 481 close(fd);
482 return 0; 482 return 0;
483} 483 }
484 484
485int rd_status(char *path, int *status) 485 int rd_status(char *path, int *status)
486{ 486 {
487 char fn[MAX_FN_SIZE]; 487 char fn[MAX_FN_SIZE];
488 sprintf(fn, "%s/status", path); 488 sprintf(fn, "%s/status", path);
489 if (rd(fn, (u64*)status)<0) { 489 if (rd(fn, (u64*)status)<0) {
@@ -492,10 +492,10 @@ int rd_status(char *path, int *status)
492 } 492 }
493 493
494 return 0; 494 return 0;
495} 495 }
496 496
497int rd_capabilities(char *path, u64 *capabilities) 497 int rd_capabilities(char *path, u64 *capabilities)
498{ 498 {
499 char fn[MAX_FN_SIZE]; 499 char fn[MAX_FN_SIZE];
500 sprintf(fn, "%s/capabilities", path); 500 sprintf(fn, "%s/capabilities", path);
501 if (rd(fn, capabilities)<0) { 501 if (rd(fn, capabilities)<0) {
@@ -504,10 +504,10 @@ int rd_capabilities(char *path, u64 *capabilities)
504 } 504 }
505 505
506 return 0; 506 return 0;
507} 507 }
508 508
509int rd_all(char *path) 509 int rd_all(char *path)
510{ 510 {
511 unsigned long err_type_info, err_struct_info, err_data_buffer; 511 unsigned long err_type_info, err_struct_info, err_data_buffer;
512 int status; 512 int status;
513 unsigned long capabilities, resources; 513 unsigned long capabilities, resources;
@@ -556,11 +556,11 @@ int rd_all(char *path)
556 printf("resources=%lx\n", resources); 556 printf("resources=%lx\n", resources);
557 557
558 return 0; 558 return 0;
559} 559 }
560 560
561int query_capabilities(char *path, err_type_info_t err_type_info, 561 int query_capabilities(char *path, err_type_info_t err_type_info,
562 u64 *capabilities) 562 u64 *capabilities)
563{ 563 {
564 char fn[MAX_FN_SIZE]; 564 char fn[MAX_FN_SIZE];
565 err_struct_info_t err_struct_info; 565 err_struct_info_t err_struct_info;
566 err_data_buffer_t err_data_buffer; 566 err_data_buffer_t err_data_buffer;
@@ -583,10 +583,10 @@ int query_capabilities(char *path, err_type_info_t err_type_info,
583 return -1; 583 return -1;
584 584
585 return 0; 585 return 0;
586} 586 }
587 587
588int query_all_capabilities() 588 int query_all_capabilities()
589{ 589 {
590 int status; 590 int status;
591 err_type_info_t err_type_info; 591 err_type_info_t err_type_info;
592 int err_sev, err_struct, struct_hier; 592 int err_sev, err_struct, struct_hier;
@@ -629,12 +629,12 @@ int query_all_capabilities()
629 } 629 }
630 630
631 return 0; 631 return 0;
632} 632 }
633 633
634int err_inject(int cpu, char *path, err_type_info_t err_type_info, 634 int err_inject(int cpu, char *path, err_type_info_t err_type_info,
635 err_struct_info_t err_struct_info, 635 err_struct_info_t err_struct_info,
636 err_data_buffer_t err_data_buffer) 636 err_data_buffer_t err_data_buffer)
637{ 637 {
638 int status; 638 int status;
639 char fn[MAX_FN_SIZE]; 639 char fn[MAX_FN_SIZE];
640 640
@@ -667,13 +667,13 @@ int err_inject(int cpu, char *path, err_type_info_t err_type_info,
667 } 667 }
668 668
669 return status; 669 return status;
670} 670 }
671 671
672static int construct_data_buf(char *path, err_type_info_t err_type_info, 672 static int construct_data_buf(char *path, err_type_info_t err_type_info,
673 err_struct_info_t err_struct_info, 673 err_struct_info_t err_struct_info,
674 err_data_buffer_t *err_data_buffer, 674 err_data_buffer_t *err_data_buffer,
675 void *va1) 675 void *va1)
676{ 676 {
677 char fn[MAX_FN_SIZE]; 677 char fn[MAX_FN_SIZE];
678 u64 virt_addr=0, phys_addr=0; 678 u64 virt_addr=0, phys_addr=0;
679 679
@@ -710,22 +710,22 @@ static int construct_data_buf(char *path, err_type_info_t err_type_info,
710 } 710 }
711 711
712 return 0; 712 return 0;
713} 713 }
714 714
715typedef struct { 715 typedef struct {
716 u64 cpu; 716 u64 cpu;
717 u64 loop; 717 u64 loop;
718 u64 interval; 718 u64 interval;
719 u64 err_type_info; 719 u64 err_type_info;
720 u64 err_struct_info; 720 u64 err_struct_info;
721 u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; 721 u64 err_data_buffer[ERR_DATA_BUFFER_SIZE];
722} parameters_t; 722 } parameters_t;
723 723
724parameters_t line_para; 724 parameters_t line_para;
725int para; 725 int para;
726 726
727static int empty_data_buffer(u64 *err_data_buffer) 727 static int empty_data_buffer(u64 *err_data_buffer)
728{ 728 {
729 int empty=1; 729 int empty=1;
730 int i; 730 int i;
731 731
@@ -734,10 +734,10 @@ static int empty_data_buffer(u64 *err_data_buffer)
734 empty=0; 734 empty=0;
735 735
736 return empty; 736 return empty;
737} 737 }
738 738
739int err_inj() 739 int err_inj()
740{ 740 {
741 err_type_info_t err_type_info; 741 err_type_info_t err_type_info;
742 err_struct_info_t err_struct_info; 742 err_struct_info_t err_struct_info;
743 err_data_buffer_t err_data_buffer; 743 err_data_buffer_t err_data_buffer;
@@ -951,10 +951,10 @@ int err_inj()
951 printf("All done.\n"); 951 printf("All done.\n");
952 952
953 return 0; 953 return 0;
954} 954 }
955 955
956void help() 956 void help()
957{ 957 {
958 printf("err_inject_tool:\n"); 958 printf("err_inject_tool:\n");
959 printf("\t-q: query all capabilities. default: off\n"); 959 printf("\t-q: query all capabilities. default: off\n");
960 printf("\t-m: procedure mode. 1: physical 2: virtual. default: 1\n"); 960 printf("\t-m: procedure mode. 1: physical 2: virtual. default: 1\n");
@@ -977,10 +977,10 @@ void help()
977 printf("The tool will take err.conf file as "); 977 printf("The tool will take err.conf file as ");
978 printf("input to inject single or multiple errors "); 978 printf("input to inject single or multiple errors ");
979 printf("on one or multiple cpus in parallel.\n"); 979 printf("on one or multiple cpus in parallel.\n");
980} 980 }
981 981
982int main(int argc, char **argv) 982 int main(int argc, char **argv)
983{ 983 {
984 char c; 984 char c;
985 int do_err_inj=0; 985 int do_err_inj=0;
986 int do_query_all=0; 986 int do_query_all=0;
@@ -1031,7 +1031,7 @@ int main(int argc, char **argv)
1031 if (count!=PARA_FIELD_NUM+3) { 1031 if (count!=PARA_FIELD_NUM+3) {
1032 line_para.err_data_buffer[0]=-1, 1032 line_para.err_data_buffer[0]=-1,
1033 line_para.err_data_buffer[1]=-1, 1033 line_para.err_data_buffer[1]=-1,
1034 line_para.err_data_buffer[2]=-1; 1034 line_para.err_data_buffer[2]=-1;
1035 count=sscanf(optarg, "%lx, %lx, %lx, %lx, %lx\n", 1035 count=sscanf(optarg, "%lx, %lx, %lx, %lx, %lx\n",
1036 &line_para.cpu, 1036 &line_para.cpu,
1037 &line_para.loop, 1037 &line_para.loop,
@@ -1064,5 +1064,4 @@ int main(int argc, char **argv)
1064 help(); 1064 help();
1065 1065
1066 return 0; 1066 return 0;
1067} 1067 }
1068
diff --git a/Documentation/ia64/fsys.txt b/Documentation/ia64/fsys.rst
index 59dd689d9b86..a702d2cc94b6 100644
--- a/Documentation/ia64/fsys.txt
+++ b/Documentation/ia64/fsys.rst
@@ -1,9 +1,9 @@
1-*-Mode: outline-*- 1===================================
2 2Light-weight System Calls for IA-64
3 Light-weight System Calls for IA-64 3===================================
4 -----------------------------------
5 4
6 Started: 13-Jan-2003 5 Started: 13-Jan-2003
6
7 Last update: 27-Sep-2003 7 Last update: 27-Sep-2003
8 8
9 David Mosberger-Tang 9 David Mosberger-Tang
@@ -52,12 +52,13 @@ privilege level is at level 0, this means that fsys-mode requires some
52care (see below). 52care (see below).
53 53
54 54
55* How to tell fsys-mode 55How to tell fsys-mode
56=====================
56 57
57Linux operates in fsys-mode when (a) the privilege level is 0 (most 58Linux operates in fsys-mode when (a) the privilege level is 0 (most
58privileged) and (b) the stacks have NOT been switched to kernel memory 59privileged) and (b) the stacks have NOT been switched to kernel memory
59yet. For convenience, the header file <asm-ia64/ptrace.h> provides 60yet. For convenience, the header file <asm-ia64/ptrace.h> provides
60three macros: 61three macros::
61 62
62 user_mode(regs) 63 user_mode(regs)
63 user_stack(task,regs) 64 user_stack(task,regs)
@@ -70,11 +71,12 @@ to by "regs" was executing in user mode (privilege level 3).
70user_stack() returns TRUE if the state pointed to by "regs" was 71user_stack() returns TRUE if the state pointed to by "regs" was
71executing on the user-level stack(s). Finally, fsys_mode() returns 72executing on the user-level stack(s). Finally, fsys_mode() returns
72TRUE if the CPU state pointed to by "regs" was executing in fsys-mode. 73TRUE if the CPU state pointed to by "regs" was executing in fsys-mode.
73The fsys_mode() macro is equivalent to the expression: 74The fsys_mode() macro is equivalent to the expression::
74 75
75 !user_mode(regs) && user_stack(task,regs) 76 !user_mode(regs) && user_stack(task,regs)
76 77
77* How to write an fsyscall handler 78How to write an fsyscall handler
79================================
78 80
79The file arch/ia64/kernel/fsys.S contains a table of fsyscall-handlers 81The file arch/ia64/kernel/fsys.S contains a table of fsyscall-handlers
80(fsyscall_table). This table contains one entry for each system call. 82(fsyscall_table). This table contains one entry for each system call.
@@ -87,66 +89,72 @@ of the getpid() system call.
87 89
88The entry and exit-state of an fsyscall handler is as follows: 90The entry and exit-state of an fsyscall handler is as follows:
89 91
90** Machine state on entry to fsyscall handler: 92Machine state on entry to fsyscall handler
91 93------------------------------------------
92 - r10 = 0 94
93 - r11 = saved ar.pfs (a user-level value) 95 ========= ===============================================================
94 - r15 = system call number 96 r10 0
95 - r16 = "current" task pointer (in normal kernel-mode, this is in r13) 97 r11 saved ar.pfs (a user-level value)
96 - r32-r39 = system call arguments 98 r15 system call number
97 - b6 = return address (a user-level value) 99 r16 "current" task pointer (in normal kernel-mode, this is in r13)
98 - ar.pfs = previous frame-state (a user-level value) 100 r32-r39 system call arguments
99 - PSR.be = cleared to zero (i.e., little-endian byte order is in effect) 101 b6 return address (a user-level value)
100 - all other registers may contain values passed in from user-mode 102 ar.pfs previous frame-state (a user-level value)
101 103 PSR.be cleared to zero (i.e., little-endian byte order is in effect)
102** Required machine state on exit to fsyscall handler: 104 - all other registers may contain values passed in from user-mode
103 105 ========= ===============================================================
104 - r11 = saved ar.pfs (as passed into the fsyscall handler) 106
105 - r15 = system call number (as passed into the fsyscall handler) 107Required machine state on exit to fsyscall handler
106 - r32-r39 = system call arguments (as passed into the fsyscall handler) 108--------------------------------------------------
107 - b6 = return address (as passed into the fsyscall handler) 109
108 - ar.pfs = previous frame-state (as passed into the fsyscall handler) 110 ========= ===========================================================
111 r11 saved ar.pfs (as passed into the fsyscall handler)
112 r15 system call number (as passed into the fsyscall handler)
113 r32-r39 system call arguments (as passed into the fsyscall handler)
114 b6 return address (as passed into the fsyscall handler)
115 ar.pfs previous frame-state (as passed into the fsyscall handler)
116 ========= ===========================================================
109 117
110Fsyscall handlers can execute with very little overhead, but with that 118Fsyscall handlers can execute with very little overhead, but with that
111speed comes a set of restrictions: 119speed comes a set of restrictions:
112 120
113 o Fsyscall-handlers MUST check for any pending work in the flags 121 * Fsyscall-handlers MUST check for any pending work in the flags
114 member of the thread-info structure and if any of the 122 member of the thread-info structure and if any of the
115 TIF_ALLWORK_MASK flags are set, the handler needs to fall back on 123 TIF_ALLWORK_MASK flags are set, the handler needs to fall back on
116 doing a full system call (by calling fsys_fallback_syscall). 124 doing a full system call (by calling fsys_fallback_syscall).
117 125
118 o Fsyscall-handlers MUST preserve incoming arguments (r32-r39, r11, 126 * Fsyscall-handlers MUST preserve incoming arguments (r32-r39, r11,
119 r15, b6, and ar.pfs) because they will be needed in case of a 127 r15, b6, and ar.pfs) because they will be needed in case of a
120 system call restart. Of course, all "preserved" registers also 128 system call restart. Of course, all "preserved" registers also
121 must be preserved, in accordance to the normal calling conventions. 129 must be preserved, in accordance to the normal calling conventions.
122 130
123 o Fsyscall-handlers MUST check argument registers for containing a 131 * Fsyscall-handlers MUST check argument registers for containing a
124 NaT value before using them in any way that could trigger a 132 NaT value before using them in any way that could trigger a
125 NaT-consumption fault. If a system call argument is found to 133 NaT-consumption fault. If a system call argument is found to
126 contain a NaT value, an fsyscall-handler may return immediately 134 contain a NaT value, an fsyscall-handler may return immediately
127 with r8=EINVAL, r10=-1. 135 with r8=EINVAL, r10=-1.
128 136
129 o Fsyscall-handlers MUST NOT use the "alloc" instruction or perform 137 * Fsyscall-handlers MUST NOT use the "alloc" instruction or perform
130 any other operation that would trigger mandatory RSE 138 any other operation that would trigger mandatory RSE
131 (register-stack engine) traffic. 139 (register-stack engine) traffic.
132 140
133 o Fsyscall-handlers MUST NOT write to any stacked registers because 141 * Fsyscall-handlers MUST NOT write to any stacked registers because
134 it is not safe to assume that user-level called a handler with the 142 it is not safe to assume that user-level called a handler with the
135 proper number of arguments. 143 proper number of arguments.
136 144
137 o Fsyscall-handlers need to be careful when accessing per-CPU variables: 145 * Fsyscall-handlers need to be careful when accessing per-CPU variables:
138 unless proper safe-guards are taken (e.g., interruptions are avoided), 146 unless proper safe-guards are taken (e.g., interruptions are avoided),
139 execution may be pre-empted and resumed on another CPU at any given 147 execution may be pre-empted and resumed on another CPU at any given
140 time. 148 time.
141 149
142 o Fsyscall-handlers must be careful not to leak sensitive kernel' 150 * Fsyscall-handlers must be careful not to leak sensitive kernel'
143 information back to user-level. In particular, before returning to 151 information back to user-level. In particular, before returning to
144 user-level, care needs to be taken to clear any scratch registers 152 user-level, care needs to be taken to clear any scratch registers
145 that could contain sensitive information (note that the current 153 that could contain sensitive information (note that the current
146 task pointer is not considered sensitive: it's already exposed 154 task pointer is not considered sensitive: it's already exposed
147 through ar.k6). 155 through ar.k6).
148 156
149 o Fsyscall-handlers MUST NOT access user-memory without first 157 * Fsyscall-handlers MUST NOT access user-memory without first
150 validating access-permission (this can be done typically via 158 validating access-permission (this can be done typically via
151 probe.r.fault and/or probe.w.fault) and without guarding against 159 probe.r.fault and/or probe.w.fault) and without guarding against
152 memory access exceptions (this can be done with the EX() macros 160 memory access exceptions (this can be done with the EX() macros
@@ -162,7 +170,8 @@ fast system call execution (while fully preserving system call
162semantics), but there is also a lot of flexibility in handling more 170semantics), but there is also a lot of flexibility in handling more
163complicated cases. 171complicated cases.
164 172
165* Signal handling 173Signal handling
174===============
166 175
167The delivery of (asynchronous) signals must be delayed until fsys-mode 176The delivery of (asynchronous) signals must be delayed until fsys-mode
168is exited. This is accomplished with the help of the lower-privilege 177is exited. This is accomplished with the help of the lower-privilege
@@ -173,7 +182,8 @@ PSR.lp and returns immediately. When fsys-mode is exited via the
173occur. The trap handler clears PSR.lp again and returns immediately. 182occur. The trap handler clears PSR.lp again and returns immediately.
174The kernel exit path then checks for and delivers any pending signals. 183The kernel exit path then checks for and delivers any pending signals.
175 184
176* PSR Handling 185PSR Handling
186============
177 187
178The "epc" instruction doesn't change the contents of PSR at all. This 188The "epc" instruction doesn't change the contents of PSR at all. This
179is in contrast to a regular interruption, which clears almost all 189is in contrast to a regular interruption, which clears almost all
@@ -181,6 +191,7 @@ bits. Because of that, some care needs to be taken to ensure things
181work as expected. The following discussion describes how each PSR bit 191work as expected. The following discussion describes how each PSR bit
182is handled. 192is handled.
183 193
194======= =======================================================================
184PSR.be Cleared when entering fsys-mode. A srlz.d instruction is used 195PSR.be Cleared when entering fsys-mode. A srlz.d instruction is used
185 to ensure the CPU is in little-endian mode before the first 196 to ensure the CPU is in little-endian mode before the first
186 load/store instruction is executed. PSR.be is normally NOT 197 load/store instruction is executed. PSR.be is normally NOT
@@ -202,7 +213,8 @@ PSR.pp Unchanged.
202PSR.di Unchanged. 213PSR.di Unchanged.
203PSR.si Unchanged. 214PSR.si Unchanged.
204PSR.db Unchanged. The kernel prevents user-level from setting a hardware 215PSR.db Unchanged. The kernel prevents user-level from setting a hardware
205 breakpoint that triggers at any privilege level other than 3 (user-mode). 216 breakpoint that triggers at any privilege level other than
217 3 (user-mode).
206PSR.lp Unchanged. 218PSR.lp Unchanged.
207PSR.tb Lazy redirect. If a taken-branch trap occurs while in 219PSR.tb Lazy redirect. If a taken-branch trap occurs while in
208 fsys-mode, the trap-handler modifies the saved machine state 220 fsys-mode, the trap-handler modifies the saved machine state
@@ -235,47 +247,52 @@ PSR.ed Unchanged. Note: This bit could only have an effect if an fsys-mode
235PSR.bn Unchanged. Note: fsys-mode handlers may clear the bit, if needed. 247PSR.bn Unchanged. Note: fsys-mode handlers may clear the bit, if needed.
236 Doing so requires clearing PSR.i and PSR.ic as well. 248 Doing so requires clearing PSR.i and PSR.ic as well.
237PSR.ia Unchanged. Note: the ia64 linux kernel never sets this bit. 249PSR.ia Unchanged. Note: the ia64 linux kernel never sets this bit.
250======= =======================================================================
238 251
239* Using fast system calls 252Using fast system calls
253=======================
240 254
241To use fast system calls, userspace applications need simply call 255To use fast system calls, userspace applications need simply call
242__kernel_syscall_via_epc(). For example 256__kernel_syscall_via_epc(). For example
243 257
244-- example fgettimeofday() call -- 258-- example fgettimeofday() call --
259
245-- fgettimeofday.S -- 260-- fgettimeofday.S --
246 261
247#include <asm/asmmacro.h> 262::
263
264 #include <asm/asmmacro.h>
248 265
249GLOBAL_ENTRY(fgettimeofday) 266 GLOBAL_ENTRY(fgettimeofday)
250.prologue 267 .prologue
251.save ar.pfs, r11 268 .save ar.pfs, r11
252mov r11 = ar.pfs 269 mov r11 = ar.pfs
253.body 270 .body
254 271
255mov r2 = 0xa000000000020660;; // gate address 272 mov r2 = 0xa000000000020660;; // gate address
256 // found by inspection of System.map for the 273 // found by inspection of System.map for the
257 // __kernel_syscall_via_epc() function. See 274 // __kernel_syscall_via_epc() function. See
258 // below for how to do this for real. 275 // below for how to do this for real.
259 276
260mov b7 = r2 277 mov b7 = r2
261mov r15 = 1087 // gettimeofday syscall 278 mov r15 = 1087 // gettimeofday syscall
262;; 279 ;;
263br.call.sptk.many b6 = b7 280 br.call.sptk.many b6 = b7
264;; 281 ;;
265 282
266.restore sp 283 .restore sp
267 284
268mov ar.pfs = r11 285 mov ar.pfs = r11
269br.ret.sptk.many rp;; // return to caller 286 br.ret.sptk.many rp;; // return to caller
270END(fgettimeofday) 287 END(fgettimeofday)
271 288
272-- end fgettimeofday.S -- 289-- end fgettimeofday.S --
273 290
274In reality, getting the gate address is accomplished by two extra 291In reality, getting the gate address is accomplished by two extra
275values passed via the ELF auxiliary vector (include/asm-ia64/elf.h) 292values passed via the ELF auxiliary vector (include/asm-ia64/elf.h)
276 293
277 o AT_SYSINFO : is the address of __kernel_syscall_via_epc() 294 * AT_SYSINFO : is the address of __kernel_syscall_via_epc()
278 o AT_SYSINFO_EHDR : is the address of the kernel gate ELF DSO 295 * AT_SYSINFO_EHDR : is the address of the kernel gate ELF DSO
279 296
280The ELF DSO is a pre-linked library that is mapped in by the kernel at 297The ELF DSO is a pre-linked library that is mapped in by the kernel at
281the gate page. It is a proper ELF shared object so, with a dynamic 298the gate page. It is a proper ELF shared object so, with a dynamic
diff --git a/Documentation/ia64/README b/Documentation/ia64/ia64.rst
index aa17f2154cba..b725019a9492 100644
--- a/Documentation/ia64/README
+++ b/Documentation/ia64/ia64.rst
@@ -1,43 +1,49 @@
1 Linux kernel release 2.4.xx for the IA-64 Platform 1===========================================
2Linux kernel release for the IA-64 Platform
3===========================================
2 4
3 These are the release notes for Linux version 2.4 for IA-64 5 These are the release notes for Linux since version 2.4 for IA-64
4 platform. This document provides information specific to IA-64 6 platform. This document provides information specific to IA-64
5 ONLY, to get additional information about the Linux kernel also 7 ONLY, to get additional information about the Linux kernel also
6 read the original Linux README provided with the kernel. 8 read the original Linux README provided with the kernel.
7 9
8INSTALLING the kernel: 10Installing the Kernel
11=====================
9 12
10 - IA-64 kernel installation is the same as the other platforms, see 13 - IA-64 kernel installation is the same as the other platforms, see
11 original README for details. 14 original README for details.
12 15
13 16
14SOFTWARE REQUIREMENTS 17Software Requirements
18=====================
15 19
16 Compiling and running this kernel requires an IA-64 compliant GCC 20 Compiling and running this kernel requires an IA-64 compliant GCC
17 compiler. And various software packages also compiled with an 21 compiler. And various software packages also compiled with an
18 IA-64 compliant GCC compiler. 22 IA-64 compliant GCC compiler.
19 23
20 24
21CONFIGURING the kernel: 25Configuring the Kernel
26======================
22 27
23 Configuration is the same, see original README for details. 28 Configuration is the same, see original README for details.
24 29
25 30
26COMPILING the kernel: 31Compiling the Kernel:
27 32
28 - Compiling this kernel doesn't differ from other platform so read 33 - Compiling this kernel doesn't differ from other platform so read
29 the original README for details BUT make sure you have an IA-64 34 the original README for details BUT make sure you have an IA-64
30 compliant GCC compiler. 35 compliant GCC compiler.
31 36
32IA-64 SPECIFICS 37IA-64 Specifics
38===============
33 39
34 - General issues: 40 - General issues:
35 41
36 o Hardly any performance tuning has been done. Obvious targets 42 * Hardly any performance tuning has been done. Obvious targets
37 include the library routines (IP checksum, etc.). Less 43 include the library routines (IP checksum, etc.). Less
38 obvious targets include making sure we don't flush the TLB 44 obvious targets include making sure we don't flush the TLB
39 needlessly, etc. 45 needlessly, etc.
40 46
41 o SMP locks cleanup/optimization 47 * SMP locks cleanup/optimization
42 48
43 o IA32 support. Currently experimental. It mostly works. 49 * IA32 support. Currently experimental. It mostly works.
diff --git a/Documentation/ia64/index.rst b/Documentation/ia64/index.rst
new file mode 100644
index 000000000000..0436e1034115
--- /dev/null
+++ b/Documentation/ia64/index.rst
@@ -0,0 +1,18 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3==================
4IA-64 Architecture
5==================
6
7.. toctree::
8 :maxdepth: 1
9
10 ia64
11 aliasing
12 efirtc
13 err_inject
14 fsys
15 irq-redir
16 mca
17 serial
18 xen
diff --git a/Documentation/ia64/IRQ-redir.txt b/Documentation/ia64/irq-redir.rst
index f7bd72261283..39bf94484a15 100644
--- a/Documentation/ia64/IRQ-redir.txt
+++ b/Documentation/ia64/irq-redir.rst
@@ -1,6 +1,8 @@
1==============================
1IRQ affinity on IA64 platforms 2IRQ affinity on IA64 platforms
2------------------------------ 3==============================
3 07.01.2002, Erich Focht <efocht@ess.nec.de> 4
507.01.2002, Erich Focht <efocht@ess.nec.de>
4 6
5 7
6By writing to /proc/irq/IRQ#/smp_affinity the interrupt routing can be 8By writing to /proc/irq/IRQ#/smp_affinity the interrupt routing can be
@@ -12,22 +14,27 @@ IRQ target is one particular CPU and cannot be a mask of several
12CPUs. Only the first non-zero bit is taken into account. 14CPUs. Only the first non-zero bit is taken into account.
13 15
14 16
15Usage examples: 17Usage examples
18==============
16 19
17The target CPU has to be specified as a hexadecimal CPU mask. The 20The target CPU has to be specified as a hexadecimal CPU mask. The
18first non-zero bit is the selected CPU. This format has been kept for 21first non-zero bit is the selected CPU. This format has been kept for
19compatibility reasons with i386. 22compatibility reasons with i386.
20 23
21Set the delivery mode of interrupt 41 to fixed and route the 24Set the delivery mode of interrupt 41 to fixed and route the
22interrupts to CPU #3 (logical CPU number) (2^3=0x08): 25interrupts to CPU #3 (logical CPU number) (2^3=0x08)::
26
23 echo "8" >/proc/irq/41/smp_affinity 27 echo "8" >/proc/irq/41/smp_affinity
24 28
25Set the default route for IRQ number 41 to CPU 6 in lowest priority 29Set the default route for IRQ number 41 to CPU 6 in lowest priority
26delivery mode (redirectable): 30delivery mode (redirectable)::
31
27 echo "r 40" >/proc/irq/41/smp_affinity 32 echo "r 40" >/proc/irq/41/smp_affinity
28 33
29The output of the command 34The output of the command::
35
30 cat /proc/irq/IRQ#/smp_affinity 36 cat /proc/irq/IRQ#/smp_affinity
37
31gives the target CPU mask for the specified interrupt vector. If the CPU 38gives the target CPU mask for the specified interrupt vector. If the CPU
32mask is preceded by the character "r", the interrupt is redirectable 39mask is preceded by the character "r", the interrupt is redirectable
33(i.e. lowest priority mode routing is used), otherwise its route is 40(i.e. lowest priority mode routing is used), otherwise its route is
@@ -35,7 +42,8 @@ fixed.
35 42
36 43
37 44
38Initialization and default behavior: 45Initialization and default behavior
46===================================
39 47
40If the platform features IRQ redirection (info provided by SAL) all 48If the platform features IRQ redirection (info provided by SAL) all
41IO-SAPIC interrupts are initialized with CPU#0 as their default target 49IO-SAPIC interrupts are initialized with CPU#0 as their default target
@@ -43,9 +51,11 @@ and the routing is the so called "lowest priority mode" (actually
43fixed SAPIC mode with hint). The XTP chipset registers are used as hints 51fixed SAPIC mode with hint). The XTP chipset registers are used as hints
44for the IRQ routing. Currently in Linux XTP registers can have three 52for the IRQ routing. Currently in Linux XTP registers can have three
45values: 53values:
54
46 - minimal for an idle task, 55 - minimal for an idle task,
47 - normal if any other task runs, 56 - normal if any other task runs,
48 - maximal if the CPU is going to be switched off. 57 - maximal if the CPU is going to be switched off.
58
49The IRQ is routed to the CPU with lowest XTP register value, the 59The IRQ is routed to the CPU with lowest XTP register value, the
50search begins at the default CPU. Therefore most of the interrupts 60search begins at the default CPU. Therefore most of the interrupts
51will be handled by CPU #0. 61will be handled by CPU #0.
@@ -53,12 +63,14 @@ will be handled by CPU #0.
53If the platform doesn't feature interrupt redirection IOSAPIC fixed 63If the platform doesn't feature interrupt redirection IOSAPIC fixed
54routing is used. The target CPUs are distributed in a round robin 64routing is used. The target CPUs are distributed in a round robin
55manner. IRQs will be routed only to the selected target CPUs. Check 65manner. IRQs will be routed only to the selected target CPUs. Check
56with 66with::
67
57 cat /proc/interrupts 68 cat /proc/interrupts
58 69
59 70
60 71
61Comments: 72Comments
73========
62 74
63On large (multi-node) systems it is recommended to route the IRQs to 75On large (multi-node) systems it is recommended to route the IRQs to
64the node to which the corresponding device is connected. 76the node to which the corresponding device is connected.
@@ -66,4 +78,3 @@ For systems like the NEC AzusA we get IRQ node-affinity for free. This
66is because usually the chipsets on each node redirect the interrupts 78is because usually the chipsets on each node redirect the interrupts
67only to their own CPUs (as they cannot see the XTP registers on the 79only to their own CPUs (as they cannot see the XTP registers on the
68other nodes). 80other nodes).
69
diff --git a/Documentation/ia64/mca.txt b/Documentation/ia64/mca.rst
index f097c60cba1b..08270bba44a4 100644
--- a/Documentation/ia64/mca.txt
+++ b/Documentation/ia64/mca.rst
@@ -1,5 +1,8 @@
1An ad-hoc collection of notes on IA64 MCA and INIT processing. Feel 1=============================================================
2free to update it with notes about any area that is not clear. 2An ad-hoc collection of notes on IA64 MCA and INIT processing
3=============================================================
4
5Feel free to update it with notes about any area that is not clear.
3 6
4--- 7---
5 8
@@ -82,7 +85,8 @@ if we have a choice here.
82 own stack as running on that cpu. Then a recursive error gets a 85 own stack as running on that cpu. Then a recursive error gets a
83 trace of the failing handler's "task". 86 trace of the failing handler's "task".
84 87
85[1] My (Keith Owens) original design called for ia64 to separate its 88[1]
89 My (Keith Owens) original design called for ia64 to separate its
86 struct task and the kernel stacks. Then the MCA/INIT data would be 90 struct task and the kernel stacks. Then the MCA/INIT data would be
87 chained stacks like i386 interrupt stacks. But that required 91 chained stacks like i386 interrupt stacks. But that required
88 radical surgery on the rest of ia64, plus extra hard wired TLB 92 radical surgery on the rest of ia64, plus extra hard wired TLB
diff --git a/Documentation/ia64/serial.txt b/Documentation/ia64/serial.rst
index a63d2c54329b..1de70c305a79 100644
--- a/Documentation/ia64/serial.txt
+++ b/Documentation/ia64/serial.rst
@@ -1,4 +1,9 @@
1SERIAL DEVICE NAMING 1==============
2Serial Devices
3==============
4
5Serial Device Naming
6====================
2 7
3 As of 2.6.10, serial devices on ia64 are named based on the 8 As of 2.6.10, serial devices on ia64 are named based on the
4 order of ACPI and PCI enumeration. The first device in the 9 order of ACPI and PCI enumeration. The first device in the
@@ -30,17 +35,21 @@ SERIAL DEVICE NAMING
30 (described in the ACPI namespace) plus an MP[2] (a PCI device) has 35 (described in the ACPI namespace) plus an MP[2] (a PCI device) has
31 these ports: 36 these ports:
32 37
33 pre-2.6.10 pre-2.6.10 38 ========== ========== ============ ============ =======
34 MMIO (EFI console (EFI console 39 Type MMIO pre-2.6.10 pre-2.6.10 2.6.10+
35 address on builtin) on MP port) 2.6.10 40 address
36 ========== ========== ========== ====== 41 (EFI console (EFI console
42 on builtin) on MP port)
43 ========== ========== ============ ============ =======
37 builtin 0xff5e0000 ttyS0 ttyS1 ttyS0 44 builtin 0xff5e0000 ttyS0 ttyS1 ttyS0
38 MP UPS 0xf8031000 ttyS1 ttyS2 ttyS1 45 MP UPS 0xf8031000 ttyS1 ttyS2 ttyS1
39 MP Console 0xf8030000 ttyS2 ttyS0 ttyS2 46 MP Console 0xf8030000 ttyS2 ttyS0 ttyS2
40 MP 2 0xf8030010 ttyS3 ttyS3 ttyS3 47 MP 2 0xf8030010 ttyS3 ttyS3 ttyS3
41 MP 3 0xf8030038 ttyS4 ttyS4 ttyS4 48 MP 3 0xf8030038 ttyS4 ttyS4 ttyS4
49 ========== ========== ============ ============ =======
42 50
43CONSOLE SELECTION 51Console Selection
52=================
44 53
45 EFI knows what your console devices are, but it doesn't tell the 54 EFI knows what your console devices are, but it doesn't tell the
46 kernel quite enough to actually locate them. The DIG64 HCDP 55 kernel quite enough to actually locate them. The DIG64 HCDP
@@ -67,7 +76,8 @@ CONSOLE SELECTION
67 entries in /etc/inittab (for getty) and /etc/securetty (to allow 76 entries in /etc/inittab (for getty) and /etc/securetty (to allow
68 root login). 77 root login).
69 78
70EARLY SERIAL CONSOLE 79Early Serial Console
80====================
71 81
72 The kernel can't start using a serial console until it knows where 82 The kernel can't start using a serial console until it knows where
73 the device lives. Normally this happens when the driver enumerates 83 the device lives. Normally this happens when the driver enumerates
@@ -80,7 +90,8 @@ EARLY SERIAL CONSOLE
80 or if the EFI console path contains only a UART device and the 90 or if the EFI console path contains only a UART device and the
81 firmware supplies an HCDP. 91 firmware supplies an HCDP.
82 92
83TROUBLESHOOTING SERIAL CONSOLE PROBLEMS 93Troubleshooting Serial Console Problems
94=======================================
84 95
85 No kernel output after elilo prints "Uncompressing Linux... done": 96 No kernel output after elilo prints "Uncompressing Linux... done":
86 97
@@ -133,19 +144,22 @@ TROUBLESHOOTING SERIAL CONSOLE PROBLEMS
133 144
134 145
135 146
136[1] http://www.dig64.org/specifications/agreement 147[1]
148 http://www.dig64.org/specifications/agreement
137 The table was originally defined as the "HCDP" for "Headless 149 The table was originally defined as the "HCDP" for "Headless
138 Console/Debug Port." The current version is the "PCDP" for 150 Console/Debug Port." The current version is the "PCDP" for
139 "Primary Console and Debug Port Devices." 151 "Primary Console and Debug Port Devices."
140 152
141[2] The HP MP (management processor) is a PCI device that provides 153[2]
154 The HP MP (management processor) is a PCI device that provides
142 several UARTs. One of the UARTs is often used as a console; the 155 several UARTs. One of the UARTs is often used as a console; the
143 EFI Boot Manager identifies it as "Acpi(HWP0002,700)/Pci(...)/Uart". 156 EFI Boot Manager identifies it as "Acpi(HWP0002,700)/Pci(...)/Uart".
144 The external connection is usually a 25-pin connector, and a 157 The external connection is usually a 25-pin connector, and a
145 special dongle converts that to three 9-pin connectors, one of 158 special dongle converts that to three 9-pin connectors, one of
146 which is labelled "Console." 159 which is labelled "Console."
147 160
148[3] EFI console devices are configured using the EFI Boot Manager 161[3]
162 EFI console devices are configured using the EFI Boot Manager
149 "Boot option maintenance" menu. You may have to interrupt the 163 "Boot option maintenance" menu. You may have to interrupt the
150 boot sequence to use this menu, and you will have to reset the 164 boot sequence to use this menu, and you will have to reset the
151 box after changing console configuration. 165 box after changing console configuration.
diff --git a/Documentation/ia64/xen.rst b/Documentation/ia64/xen.rst
new file mode 100644
index 000000000000..831339c74441
--- /dev/null
+++ b/Documentation/ia64/xen.rst
@@ -0,0 +1,206 @@
1********************************************************
2Recipe for getting/building/running Xen/ia64 with pv_ops
3********************************************************
4This recipe describes how to get xen-ia64 source and build it,
5and run domU with pv_ops.
6
7Requirements
8============
9
10 - python
11 - mercurial
12 it (aka "hg") is an open-source source code
13 management software. See the below.
14 http://www.selenic.com/mercurial/wiki/
15 - git
16 - bridge-utils
17
18Getting and Building Xen and Dom0
19=================================
20
21 My environment is:
22
23 - Machine : Tiger4
24 - Domain0 OS : RHEL5
25 - DomainU OS : RHEL5
26
27 1. Download source::
28
29 # hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
30 # cd xen-unstable.hg
31 # hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
32
33 2. # make world
34
35 3. # make install-tools
36
37 4. copy kernels and xen::
38
39 # cp xen/xen.gz /boot/efi/efi/redhat/
40 # cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
41 /boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
42
43 5. make initrd for Dom0/DomU::
44
45 # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
46 O=$(pwd)/build-linux-2.6.18-xen_ia64
47 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
48 2.6.18.8-xen --builtin mptspi --builtin mptbase \
49 --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
50 --builtin ehci-hcd
51
52Making a disk image for guest OS
53================================
54
55 1. make file::
56
57 # dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
58 # mke2fs -F -j /root/rhel5.img
59 # mount -o loop /root/rhel5.img /mnt
60 # cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
61 # mkdir /mnt/{root,proc,sys,home,tmp}
62
63 Note: You may miss some device files. If so, please create them
64 with mknod. Or you can use tar instead of cp.
65
66 2. modify DomU's fstab::
67
68 # vi /mnt/etc/fstab
69 /dev/xvda1 / ext3 defaults 1 1
70 none /dev/pts devpts gid=5,mode=620 0 0
71 none /dev/shm tmpfs defaults 0 0
72 none /proc proc defaults 0 0
73 none /sys sysfs defaults 0 0
74
75 3. modify inittab
76
77 set runlevel to 3 to avoid X trying to start::
78
79 # vi /mnt/etc/inittab
80 id:3:initdefault:
81
82 Start a getty on the hvc0 console::
83
84 X0:2345:respawn:/sbin/mingetty hvc0
85
86 tty1-6 mingetty can be commented out
87
88 4. add hvc0 into /etc/securetty::
89
90 # vi /mnt/etc/securetty (add hvc0)
91
92 5. umount::
93
94 # umount /mnt
95
96FYI, virt-manager can also make a disk image for guest OS.
97It's GUI tools and easy to make it.
98
99Boot Xen & Domain0
100==================
101
102 1. replace elilo
103 elilo of RHEL5 can boot Xen and Dom0.
104 If you use old elilo (e.g RHEL4), please download from the below
105 http://elilo.sourceforge.net/cgi-bin/blosxom
106 and copy into /boot/efi/efi/redhat/::
107
108 # cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
109
110 2. modify elilo.conf (like the below)::
111
112 # vi /boot/efi/efi/redhat/elilo.conf
113 prompt
114 timeout=20
115 default=xen
116 relocatable
117
118 image=vmlinuz-2.6.18.8-xen
119 label=xen
120 vmm=xen.gz
121 initrd=initrd-2.6.18.8-xen.img
122 read-only
123 append=" -- rhgb root=/dev/sda2"
124
125The append options before "--" are for xen hypervisor,
126the options after "--" are for dom0.
127
128FYI, your machine may need console options like
129"com1=19200,8n1 console=vga,com1". For example,
130append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
131console=ttyS0 root=/dev/sda2"
132
133Getting and Building domU with pv_ops
134=====================================
135
136 1. get pv_ops tree::
137
138 # git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
139
140 2. git branch (if necessary)::
141
142 # cd linux-2.6-xen-ia64/
143 # git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
144
145 Note:
146 The current branch is xen-ia64-domu-minimal-2008may19.
147 But you would find the new branch. You can see with
148 "git branch -r" to get the branch lists.
149
150 http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
151
152 is also available.
153
154 The tree is based on
155
156 git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
157
158 3. copy .config for pv_ops of domU::
159
160 # cp arch/ia64/configs/xen_domu_wip_defconfig .config
161
162 4. make kernel with pv_ops::
163
164 # make oldconfig
165 # make
166
167 5. install the kernel and initrd::
168
169 # cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
170 # make modules_install
171 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
172 2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
173 --builtin mptbase --builtin mptscsih --builtin uhci-hcd \
174 --builtin ohci-hcd --builtin ehci-hcd
175
176Boot DomainU with pv_ops
177========================
178
179 1. make config of DomU::
180
181 # vi /etc/xen/rhel5
182 kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
183 ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
184 vcpus = 1
185 memory = 512
186 name = "rhel5"
187 disk = [ 'file:/root/rhel5.img,xvda1,w' ]
188 root = "/dev/xvda1 ro"
189 extra= "rhgb console=hvc0"
190
191 2. After boot xen and dom0, start xend::
192
193 # /etc/init.d/xend start
194
195 ( In the debugging case, `# XEND_DEBUG=1 xend trace_start` )
196
197 3. start domU::
198
199 # xm create -c rhel5
200
201Reference
202=========
203- Wiki of Xen/IA64 upstream merge
204 http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
205
206Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008
diff --git a/Documentation/ia64/xen.txt b/Documentation/ia64/xen.txt
deleted file mode 100644
index a12c74ce2773..000000000000
--- a/Documentation/ia64/xen.txt
+++ /dev/null
@@ -1,183 +0,0 @@
1 Recipe for getting/building/running Xen/ia64 with pv_ops
2 --------------------------------------------------------
3
4This recipe describes how to get xen-ia64 source and build it,
5and run domU with pv_ops.
6
7============
8Requirements
9============
10
11 - python
12 - mercurial
13 it (aka "hg") is an open-source source code
14 management software. See the below.
15 http://www.selenic.com/mercurial/wiki/
16 - git
17 - bridge-utils
18
19=================================
20Getting and Building Xen and Dom0
21=================================
22
23 My environment is;
24 Machine : Tiger4
25 Domain0 OS : RHEL5
26 DomainU OS : RHEL5
27
28 1. Download source
29 # hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
30 # cd xen-unstable.hg
31 # hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
32
33 2. # make world
34
35 3. # make install-tools
36
37 4. copy kernels and xen
38 # cp xen/xen.gz /boot/efi/efi/redhat/
39 # cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
40 /boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
41
42 5. make initrd for Dom0/DomU
43 # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
44 O=$(pwd)/build-linux-2.6.18-xen_ia64
45 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
46 2.6.18.8-xen --builtin mptspi --builtin mptbase \
47 --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
48 --builtin ehci-hcd
49
50================================
51Making a disk image for guest OS
52================================
53
54 1. make file
55 # dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
56 # mke2fs -F -j /root/rhel5.img
57 # mount -o loop /root/rhel5.img /mnt
58 # cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
59 # mkdir /mnt/{root,proc,sys,home,tmp}
60
61 Note: You may miss some device files. If so, please create them
62 with mknod. Or you can use tar instead of cp.
63
64 2. modify DomU's fstab
65 # vi /mnt/etc/fstab
66 /dev/xvda1 / ext3 defaults 1 1
67 none /dev/pts devpts gid=5,mode=620 0 0
68 none /dev/shm tmpfs defaults 0 0
69 none /proc proc defaults 0 0
70 none /sys sysfs defaults 0 0
71
72 3. modify inittab
73 set runlevel to 3 to avoid X trying to start
74 # vi /mnt/etc/inittab
75 id:3:initdefault:
76 Start a getty on the hvc0 console
77 X0:2345:respawn:/sbin/mingetty hvc0
78 tty1-6 mingetty can be commented out
79
80 4. add hvc0 into /etc/securetty
81 # vi /mnt/etc/securetty (add hvc0)
82
83 5. umount
84 # umount /mnt
85
86FYI, virt-manager can also make a disk image for guest OS.
87It's GUI tools and easy to make it.
88
89==================
90Boot Xen & Domain0
91==================
92
93 1. replace elilo
94 elilo of RHEL5 can boot Xen and Dom0.
95 If you use old elilo (e.g RHEL4), please download from the below
96 http://elilo.sourceforge.net/cgi-bin/blosxom
97 and copy into /boot/efi/efi/redhat/
98 # cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
99
100 2. modify elilo.conf (like the below)
101 # vi /boot/efi/efi/redhat/elilo.conf
102 prompt
103 timeout=20
104 default=xen
105 relocatable
106
107 image=vmlinuz-2.6.18.8-xen
108 label=xen
109 vmm=xen.gz
110 initrd=initrd-2.6.18.8-xen.img
111 read-only
112 append=" -- rhgb root=/dev/sda2"
113
114The append options before "--" are for xen hypervisor,
115the options after "--" are for dom0.
116
117FYI, your machine may need console options like
118"com1=19200,8n1 console=vga,com1". For example,
119append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
120console=ttyS0 root=/dev/sda2"
121
122=====================================
123Getting and Building domU with pv_ops
124=====================================
125
126 1. get pv_ops tree
127 # git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
128
129 2. git branch (if necessary)
130 # cd linux-2.6-xen-ia64/
131 # git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
132 (Note: The current branch is xen-ia64-domu-minimal-2008may19.
133 But you would find the new branch. You can see with
134 "git branch -r" to get the branch lists.
135 http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
136 is also available. The tree is based on
137 git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
138
139
140 3. copy .config for pv_ops of domU
141 # cp arch/ia64/configs/xen_domu_wip_defconfig .config
142
143 4. make kernel with pv_ops
144 # make oldconfig
145 # make
146
147 5. install the kernel and initrd
148 # cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
149 # make modules_install
150 # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
151 2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
152 --builtin mptbase --builtin mptscsih --builtin uhci-hcd \
153 --builtin ohci-hcd --builtin ehci-hcd
154
155========================
156Boot DomainU with pv_ops
157========================
158
159 1. make config of DomU
160 # vi /etc/xen/rhel5
161 kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
162 ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
163 vcpus = 1
164 memory = 512
165 name = "rhel5"
166 disk = [ 'file:/root/rhel5.img,xvda1,w' ]
167 root = "/dev/xvda1 ro"
168 extra= "rhgb console=hvc0"
169
170 2. After boot xen and dom0, start xend
171 # /etc/init.d/xend start
172 ( In the debugging case, # XEND_DEBUG=1 xend trace_start )
173
174 3. start domU
175 # xm create -c rhel5
176
177=========
178Reference
179=========
180- Wiki of Xen/IA64 upstream merge
181 http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
182
183Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008
diff --git a/Documentation/ide/index.rst b/Documentation/ide/index.rst
index 45bc12d3957f..813dfe611a31 100644
--- a/Documentation/ide/index.rst
+++ b/Documentation/ide/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3================================== 3==================================
4Integrated Drive Electronics (IDE) 4Integrated Drive Electronics (IDE)
diff --git a/Documentation/iio/index.rst b/Documentation/iio/index.rst
index 0593dca89a94..58b7a4ebac51 100644
--- a/Documentation/iio/index.rst
+++ b/Documentation/iio/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3============== 3==============
4Industrial I/O 4Industrial I/O
diff --git a/Documentation/index.rst b/Documentation/index.rst
index 00a0fe4241a4..70ae148ec980 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -1,3 +1,4 @@
1
1.. The Linux Kernel documentation master file, created by 2.. The Linux Kernel documentation master file, created by
2 sphinx-quickstart on Fri Feb 12 13:51:46 2016. 3 sphinx-quickstart on Fri Feb 12 13:51:46 2016.
3 You can adapt this file completely to your liking, but it should at least 4 You can adapt this file completely to your liking, but it should at least
@@ -34,6 +35,7 @@ trying to get it to work optimally on a given system.
34 :maxdepth: 2 35 :maxdepth: 2
35 36
36 admin-guide/index 37 admin-guide/index
38 kbuild/index
37 39
38Firmware-related documentation 40Firmware-related documentation
39------------------------------ 41------------------------------
@@ -55,6 +57,7 @@ the kernel interface as seen by application developers.
55 :maxdepth: 2 57 :maxdepth: 2
56 58
57 userspace-api/index 59 userspace-api/index
60 ioctl/index
58 61
59 62
60Introduction to kernel development 63Introduction to kernel development
@@ -75,6 +78,9 @@ merged much easier.
75 kernel-hacking/index 78 kernel-hacking/index
76 trace/index 79 trace/index
77 maintainer/index 80 maintainer/index
81 fault-injection/index
82 livepatch/index
83
78 84
79Kernel API documentation 85Kernel API documentation
80------------------------ 86------------------------
@@ -90,9 +96,24 @@ needed).
90 96
91 driver-api/index 97 driver-api/index
92 core-api/index 98 core-api/index
99 locking/index
100 accounting/index
101 block/index
102 cdrom/index
103 ide/index
104 fb/index
105 fpga/index
106 hid/index
107 iio/index
93 infiniband/index 108 infiniband/index
109 leds/index
94 media/index 110 media/index
111 netlabel/index
95 networking/index 112 networking/index
113 pcmcia/index
114 target/index
115 timers/index
116 watchdog/index
96 input/index 117 input/index
97 hwmon/index 118 hwmon/index
98 gpu/index 119 gpu/index
@@ -105,6 +126,8 @@ needed).
105 usb/index 126 usb/index
106 PCI/index 127 PCI/index
107 misc-devices/index 128 misc-devices/index
129 mic/index
130 scheduler/index
108 131
109Architecture-specific documentation 132Architecture-specific documentation
110----------------------------------- 133-----------------------------------
@@ -116,7 +139,16 @@ implementation.
116 :maxdepth: 2 139 :maxdepth: 2
117 140
118 sh/index 141 sh/index
142 arm/index
143 arm64/index
144 ia64/index
145 m68k/index
146 riscv/index
147 s390/index
148 sh/index
149 sparc/index
119 x86/index 150 x86/index
151 xtensa/index
120 152
121Filesystem Documentation 153Filesystem Documentation
122------------------------ 154------------------------
diff --git a/Documentation/ioctl/botching-up-ioctls.txt b/Documentation/ioctl/botching-up-ioctls.rst
index 883fb034bd04..ac697fef3545 100644
--- a/Documentation/ioctl/botching-up-ioctls.txt
+++ b/Documentation/ioctl/botching-up-ioctls.rst
@@ -1,3 +1,4 @@
1=================================
1(How to avoid) Botching up ioctls 2(How to avoid) Botching up ioctls
2================================= 3=================================
3 4
diff --git a/Documentation/ioctl/cdrom.rst b/Documentation/ioctl/cdrom.rst
new file mode 100644
index 000000000000..3b4c0506de46
--- /dev/null
+++ b/Documentation/ioctl/cdrom.rst
@@ -0,0 +1,1233 @@
1============================
2Summary of CDROM ioctl calls
3============================
4
5- Edward A. Falk <efalk@google.com>
6
7November, 2004
8
9This document attempts to describe the ioctl(2) calls supported by
10the CDROM layer. These are by-and-large implemented (as of Linux 2.6)
11in drivers/cdrom/cdrom.c and drivers/block/scsi_ioctl.c
12
13ioctl values are listed in <linux/cdrom.h>. As of this writing, they
14are as follows:
15
16 ====================== ===============================================
17 CDROMPAUSE Pause Audio Operation
18 CDROMRESUME Resume paused Audio Operation
19 CDROMPLAYMSF Play Audio MSF (struct cdrom_msf)
20 CDROMPLAYTRKIND Play Audio Track/index (struct cdrom_ti)
21 CDROMREADTOCHDR Read TOC header (struct cdrom_tochdr)
22 CDROMREADTOCENTRY Read TOC entry (struct cdrom_tocentry)
23 CDROMSTOP Stop the cdrom drive
24 CDROMSTART Start the cdrom drive
25 CDROMEJECT Ejects the cdrom media
26 CDROMVOLCTRL Control output volume (struct cdrom_volctrl)
27 CDROMSUBCHNL Read subchannel data (struct cdrom_subchnl)
28 CDROMREADMODE2 Read CDROM mode 2 data (2336 Bytes)
29 (struct cdrom_read)
30 CDROMREADMODE1 Read CDROM mode 1 data (2048 Bytes)
31 (struct cdrom_read)
32 CDROMREADAUDIO (struct cdrom_read_audio)
33 CDROMEJECT_SW enable(1)/disable(0) auto-ejecting
34 CDROMMULTISESSION Obtain the start-of-last-session
35 address of multi session disks
36 (struct cdrom_multisession)
37 CDROM_GET_MCN Obtain the "Universal Product Code"
38 if available (struct cdrom_mcn)
39 CDROM_GET_UPC Deprecated, use CDROM_GET_MCN instead.
40 CDROMRESET hard-reset the drive
41 CDROMVOLREAD Get the drive's volume setting
42 (struct cdrom_volctrl)
43 CDROMREADRAW read data in raw mode (2352 Bytes)
44 (struct cdrom_read)
45 CDROMREADCOOKED read data in cooked mode
46 CDROMSEEK seek msf address
47 CDROMPLAYBLK scsi-cd only, (struct cdrom_blk)
48 CDROMREADALL read all 2646 bytes
49 CDROMGETSPINDOWN return 4-bit spindown value
50 CDROMSETSPINDOWN set 4-bit spindown value
51 CDROMCLOSETRAY pendant of CDROMEJECT
52 CDROM_SET_OPTIONS Set behavior options
53 CDROM_CLEAR_OPTIONS Clear behavior options
54 CDROM_SELECT_SPEED Set the CD-ROM speed
55 CDROM_SELECT_DISC Select disc (for juke-boxes)
56 CDROM_MEDIA_CHANGED Check is media changed
57 CDROM_DRIVE_STATUS Get tray position, etc.
58 CDROM_DISC_STATUS Get disc type, etc.
59 CDROM_CHANGER_NSLOTS Get number of slots
60 CDROM_LOCKDOOR lock or unlock door
61 CDROM_DEBUG Turn debug messages on/off
62 CDROM_GET_CAPABILITY get capabilities
63 CDROMAUDIOBUFSIZ set the audio buffer size
64 DVD_READ_STRUCT Read structure
65 DVD_WRITE_STRUCT Write structure
66 DVD_AUTH Authentication
67 CDROM_SEND_PACKET send a packet to the drive
68 CDROM_NEXT_WRITABLE get next writable block
69 CDROM_LAST_WRITTEN get last block written on disc
70 ====================== ===============================================
71
72
73The information that follows was determined from reading kernel source
74code. It is likely that some corrections will be made over time.
75
76------------------------------------------------------------------------------
77
78General:
79
80 Unless otherwise specified, all ioctl calls return 0 on success
81 and -1 with errno set to an appropriate value on error. (Some
82 ioctls return non-negative data values.)
83
84 Unless otherwise specified, all ioctl calls return -1 and set
85 errno to EFAULT on a failed attempt to copy data to or from user
86 address space.
87
88 Individual drivers may return error codes not listed here.
89
90 Unless otherwise specified, all data structures and constants
91 are defined in <linux/cdrom.h>
92
93------------------------------------------------------------------------------
94
95
96CDROMPAUSE
97 Pause Audio Operation
98
99
100 usage::
101
102 ioctl(fd, CDROMPAUSE, 0);
103
104
105 inputs:
106 none
107
108
109 outputs:
110 none
111
112
113 error return:
114 - ENOSYS cd drive not audio-capable.
115
116
117CDROMRESUME
118 Resume paused Audio Operation
119
120
121 usage::
122
123 ioctl(fd, CDROMRESUME, 0);
124
125
126 inputs:
127 none
128
129
130 outputs:
131 none
132
133
134 error return:
135 - ENOSYS cd drive not audio-capable.
136
137
138CDROMPLAYMSF
139 Play Audio MSF
140
141 (struct cdrom_msf)
142
143
144 usage::
145
146 struct cdrom_msf msf;
147
148 ioctl(fd, CDROMPLAYMSF, &msf);
149
150 inputs:
151 cdrom_msf structure, describing a segment of music to play
152
153
154 outputs:
155 none
156
157
158 error return:
159 - ENOSYS cd drive not audio-capable.
160
161 notes:
162 - MSF stands for minutes-seconds-frames
163 - LBA stands for logical block address
164 - Segment is described as start and end times, where each time
165 is described as minutes:seconds:frames.
166 A frame is 1/75 of a second.
167
168
169CDROMPLAYTRKIND
170 Play Audio Track/index
171
172 (struct cdrom_ti)
173
174
175 usage::
176
177 struct cdrom_ti ti;
178
179 ioctl(fd, CDROMPLAYTRKIND, &ti);
180
181 inputs:
182 cdrom_ti structure, describing a segment of music to play
183
184
185 outputs:
186 none
187
188
189 error return:
190 - ENOSYS cd drive not audio-capable.
191
192 notes:
193 - Segment is described as start and end times, where each time
194 is described as a track and an index.
195
196
197
198CDROMREADTOCHDR
199 Read TOC header
200
201 (struct cdrom_tochdr)
202
203
204 usage::
205
206 cdrom_tochdr header;
207
208 ioctl(fd, CDROMREADTOCHDR, &header);
209
210 inputs:
211 cdrom_tochdr structure
212
213
214 outputs:
215 cdrom_tochdr structure
216
217
218 error return:
219 - ENOSYS cd drive not audio-capable.
220
221
222
223CDROMREADTOCENTRY
224 Read TOC entry
225
226 (struct cdrom_tocentry)
227
228
229 usage::
230
231 struct cdrom_tocentry entry;
232
233 ioctl(fd, CDROMREADTOCENTRY, &entry);
234
235 inputs:
236 cdrom_tocentry structure
237
238
239 outputs:
240 cdrom_tocentry structure
241
242
243 error return:
244 - ENOSYS cd drive not audio-capable.
245 - EINVAL entry.cdte_format not CDROM_MSF or CDROM_LBA
246 - EINVAL requested track out of bounds
247 - EIO I/O error reading TOC
248
249 notes:
250 - TOC stands for Table Of Contents
251 - MSF stands for minutes-seconds-frames
252 - LBA stands for logical block address
253
254
255
256CDROMSTOP
257 Stop the cdrom drive
258
259
260 usage::
261
262 ioctl(fd, CDROMSTOP, 0);
263
264
265 inputs:
266 none
267
268
269 outputs:
270 none
271
272
273 error return:
274 - ENOSYS cd drive not audio-capable.
275
276 notes:
277 - Exact interpretation of this ioctl depends on the device,
278 but most seem to spin the drive down.
279
280
281CDROMSTART
282 Start the cdrom drive
283
284
285 usage::
286
287 ioctl(fd, CDROMSTART, 0);
288
289
290 inputs:
291 none
292
293
294 outputs:
295 none
296
297
298 error return:
299 - ENOSYS cd drive not audio-capable.
300
301 notes:
302 - Exact interpretation of this ioctl depends on the device,
303 but most seem to spin the drive up and/or close the tray.
304 Other devices ignore the ioctl completely.
305
306
307CDROMEJECT
308 - Ejects the cdrom media
309
310
311 usage::
312
313 ioctl(fd, CDROMEJECT, 0);
314
315
316 inputs:
317 none
318
319
320 outputs:
321 none
322
323
324 error returns:
325 - ENOSYS cd drive not capable of ejecting
326 - EBUSY other processes are accessing drive, or door is locked
327
328 notes:
329 - See CDROM_LOCKDOOR, below.
330
331
332
333
334CDROMCLOSETRAY
335 pendant of CDROMEJECT
336
337
338 usage::
339
340 ioctl(fd, CDROMCLOSETRAY, 0);
341
342
343 inputs:
344 none
345
346
347 outputs:
348 none
349
350
351 error returns:
352 - ENOSYS cd drive not capable of closing the tray
353 - EBUSY other processes are accessing drive, or door is locked
354
355 notes:
356 - See CDROM_LOCKDOOR, below.
357
358
359
360
361CDROMVOLCTRL
362 Control output volume (struct cdrom_volctrl)
363
364
365 usage::
366
367 struct cdrom_volctrl volume;
368
369 ioctl(fd, CDROMVOLCTRL, &volume);
370
371 inputs:
372 cdrom_volctrl structure containing volumes for up to 4
373 channels.
374
375 outputs:
376 none
377
378
379 error return:
380 - ENOSYS cd drive not audio-capable.
381
382
383
384CDROMVOLREAD
385 Get the drive's volume setting
386
387 (struct cdrom_volctrl)
388
389
390 usage::
391
392 struct cdrom_volctrl volume;
393
394 ioctl(fd, CDROMVOLREAD, &volume);
395
396 inputs:
397 none
398
399
400 outputs:
401 The current volume settings.
402
403
404 error return:
405 - ENOSYS cd drive not audio-capable.
406
407
408
409CDROMSUBCHNL
410 Read subchannel data
411
412 (struct cdrom_subchnl)
413
414
415 usage::
416
417 struct cdrom_subchnl q;
418
419 ioctl(fd, CDROMSUBCHNL, &q);
420
421 inputs:
422 cdrom_subchnl structure
423
424
425 outputs:
426 cdrom_subchnl structure
427
428
429 error return:
430 - ENOSYS cd drive not audio-capable.
431 - EINVAL format not CDROM_MSF or CDROM_LBA
432
433 notes:
434 - Format is converted to CDROM_MSF or CDROM_LBA
435 as per user request on return
436
437
438
439CDROMREADRAW
440 read data in raw mode (2352 Bytes)
441
442 (struct cdrom_read)
443
444 usage::
445
446 union {
447
448 struct cdrom_msf msf; /* input */
449 char buffer[CD_FRAMESIZE_RAW]; /* return */
450 } arg;
451 ioctl(fd, CDROMREADRAW, &arg);
452
453 inputs:
454 cdrom_msf structure indicating an address to read.
455
456 Only the start values are significant.
457
458 outputs:
459 Data written to address provided by user.
460
461
462 error return:
463 - EINVAL address less than 0, or msf less than 0:2:0
464 - ENOMEM out of memory
465
466 notes:
467 - As of 2.6.8.1, comments in <linux/cdrom.h> indicate that this
468 ioctl accepts a cdrom_read structure, but actual source code
469 reads a cdrom_msf structure and writes a buffer of data to
470 the same address.
471
472 - MSF values are converted to LBA values via this formula::
473
474 lba = (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
475
476
477
478
479CDROMREADMODE1
480 Read CDROM mode 1 data (2048 Bytes)
481
482 (struct cdrom_read)
483
484 notes:
485 Identical to CDROMREADRAW except that block size is
486 CD_FRAMESIZE (2048) bytes
487
488
489
490CDROMREADMODE2
491 Read CDROM mode 2 data (2336 Bytes)
492
493 (struct cdrom_read)
494
495 notes:
496 Identical to CDROMREADRAW except that block size is
497 CD_FRAMESIZE_RAW0 (2336) bytes
498
499
500
501CDROMREADAUDIO
502 (struct cdrom_read_audio)
503
504 usage::
505
506 struct cdrom_read_audio ra;
507
508 ioctl(fd, CDROMREADAUDIO, &ra);
509
510 inputs:
511 cdrom_read_audio structure containing read start
512 point and length
513
514 outputs:
515 audio data, returned to buffer indicated by ra
516
517
518 error return:
519 - EINVAL format not CDROM_MSF or CDROM_LBA
520 - EINVAL nframes not in range [1 75]
521 - ENXIO drive has no queue (probably means invalid fd)
522 - ENOMEM out of memory
523
524
525CDROMEJECT_SW
526 enable(1)/disable(0) auto-ejecting
527
528
529 usage::
530
531 int val;
532
533 ioctl(fd, CDROMEJECT_SW, val);
534
535 inputs:
536 Flag specifying auto-eject flag.
537
538
539 outputs:
540 none
541
542
543 error return:
544 - ENOSYS Drive is not capable of ejecting.
545 - EBUSY Door is locked
546
547
548
549
550CDROMMULTISESSION
551 Obtain the start-of-last-session address of multi session disks
552
553 (struct cdrom_multisession)
554
555 usage::
556
557 struct cdrom_multisession ms_info;
558
559 ioctl(fd, CDROMMULTISESSION, &ms_info);
560
561 inputs:
562 cdrom_multisession structure containing desired
563
564 format.
565
566 outputs:
567 cdrom_multisession structure is filled with last_session
568 information.
569
570 error return:
571 - EINVAL format not CDROM_MSF or CDROM_LBA
572
573
574CDROM_GET_MCN
575 Obtain the "Universal Product Code"
576 if available
577
578 (struct cdrom_mcn)
579
580
581 usage::
582
583 struct cdrom_mcn mcn;
584
585 ioctl(fd, CDROM_GET_MCN, &mcn);
586
587 inputs:
588 none
589
590
591 outputs:
592 Universal Product Code
593
594
595 error return:
596 - ENOSYS Drive is not capable of reading MCN data.
597
598 notes:
599 - Source code comments state::
600
601 The following function is implemented, although very few
602 audio discs give Universal Product Code information, which
603 should just be the Medium Catalog Number on the box. Note,
604 that the way the code is written on the CD is /not/ uniform
605 across all discs!
606
607
608
609
610CDROM_GET_UPC
611 CDROM_GET_MCN (deprecated)
612
613
614 Not implemented, as of 2.6.8.1
615
616
617
618CDROMRESET
619 hard-reset the drive
620
621
622 usage::
623
624 ioctl(fd, CDROMRESET, 0);
625
626
627 inputs:
628 none
629
630
631 outputs:
632 none
633
634
635 error return:
636 - EACCES Access denied: requires CAP_SYS_ADMIN
637 - ENOSYS Drive is not capable of resetting.
638
639
640
641
642CDROMREADCOOKED
643 read data in cooked mode
644
645
646 usage::
647
648 u8 buffer[CD_FRAMESIZE]
649
650 ioctl(fd, CDROMREADCOOKED, buffer);
651
652 inputs:
653 none
654
655
656 outputs:
657 2048 bytes of data, "cooked" mode.
658
659
660 notes:
661 Not implemented on all drives.
662
663
664
665
666
667CDROMREADALL
668 read all 2646 bytes
669
670
671 Same as CDROMREADCOOKED, but reads 2646 bytes.
672
673
674
675CDROMSEEK
676 seek msf address
677
678
679 usage::
680
681 struct cdrom_msf msf;
682
683 ioctl(fd, CDROMSEEK, &msf);
684
685 inputs:
686 MSF address to seek to.
687
688
689 outputs:
690 none
691
692
693
694
695CDROMPLAYBLK
696 scsi-cd only
697
698 (struct cdrom_blk)
699
700
701 usage::
702
703 struct cdrom_blk blk;
704
705 ioctl(fd, CDROMPLAYBLK, &blk);
706
707 inputs:
708 Region to play
709
710
711 outputs:
712 none
713
714
715
716
717CDROMGETSPINDOWN
718 usage::
719
720 char spindown;
721
722 ioctl(fd, CDROMGETSPINDOWN, &spindown);
723
724 inputs:
725 none
726
727
728 outputs:
729 The value of the current 4-bit spindown value.
730
731
732
733
734
735CDROMSETSPINDOWN
736 usage::
737
738 char spindown
739
740 ioctl(fd, CDROMSETSPINDOWN, &spindown);
741
742 inputs:
743 4-bit value used to control spindown (TODO: more detail here)
744
745
746 outputs:
747 none
748
749
750
751
752
753
754CDROM_SET_OPTIONS
755 Set behavior options
756
757
758 usage::
759
760 int options;
761
762 ioctl(fd, CDROM_SET_OPTIONS, options);
763
764 inputs:
765 New values for drive options. The logical 'or' of:
766
767 ============== ==================================
768 CDO_AUTO_CLOSE close tray on first open(2)
769 CDO_AUTO_EJECT open tray on last release
770 CDO_USE_FFLAGS use O_NONBLOCK information on open
771 CDO_LOCK lock tray on open files
772 CDO_CHECK_TYPE check type on open for data
773 ============== ==================================
774
775 outputs:
776 Returns the resulting options settings in the
777 ioctl return value. Returns -1 on error.
778
779 error return:
780 - ENOSYS selected option(s) not supported by drive.
781
782
783
784
785CDROM_CLEAR_OPTIONS
786 Clear behavior options
787
788
789 Same as CDROM_SET_OPTIONS, except that selected options are
790 turned off.
791
792
793
794CDROM_SELECT_SPEED
795 Set the CD-ROM speed
796
797
798 usage::
799
800 int speed;
801
802 ioctl(fd, CDROM_SELECT_SPEED, speed);
803
804 inputs:
805 New drive speed.
806
807
808 outputs:
809 none
810
811
812 error return:
813 - ENOSYS speed selection not supported by drive.
814
815
816
817CDROM_SELECT_DISC
818 Select disc (for juke-boxes)
819
820
821 usage::
822
823 int disk;
824
825 ioctl(fd, CDROM_SELECT_DISC, disk);
826
827 inputs:
828 Disk to load into drive.
829
830
831 outputs:
832 none
833
834
835 error return:
836 - EINVAL Disk number beyond capacity of drive
837
838
839
840CDROM_MEDIA_CHANGED
841 Check is media changed
842
843
844 usage::
845
846 int slot;
847
848 ioctl(fd, CDROM_MEDIA_CHANGED, slot);
849
850 inputs:
851 Slot number to be tested, always zero except for jukeboxes.
852
853 May also be special values CDSL_NONE or CDSL_CURRENT
854
855 outputs:
856 Ioctl return value is 0 or 1 depending on whether the media
857
858 has been changed, or -1 on error.
859
860 error returns:
861 - ENOSYS Drive can't detect media change
862 - EINVAL Slot number beyond capacity of drive
863 - ENOMEM Out of memory
864
865
866
867CDROM_DRIVE_STATUS
868 Get tray position, etc.
869
870
871 usage::
872
873 int slot;
874
875 ioctl(fd, CDROM_DRIVE_STATUS, slot);
876
877 inputs:
878 Slot number to be tested, always zero except for jukeboxes.
879
880 May also be special values CDSL_NONE or CDSL_CURRENT
881
882 outputs:
883 Ioctl return value will be one of the following values
884
885 from <linux/cdrom.h>:
886
887 =================== ==========================
888 CDS_NO_INFO Information not available.
889 CDS_NO_DISC
890 CDS_TRAY_OPEN
891 CDS_DRIVE_NOT_READY
892 CDS_DISC_OK
893 -1 error
894 =================== ==========================
895
896 error returns:
897 - ENOSYS Drive can't detect drive status
898 - EINVAL Slot number beyond capacity of drive
899 - ENOMEM Out of memory
900
901
902
903
904CDROM_DISC_STATUS
905 Get disc type, etc.
906
907
908 usage::
909
910 ioctl(fd, CDROM_DISC_STATUS, 0);
911
912
913 inputs:
914 none
915
916
917 outputs:
918 Ioctl return value will be one of the following values
919
920 from <linux/cdrom.h>:
921
922 - CDS_NO_INFO
923 - CDS_AUDIO
924 - CDS_MIXED
925 - CDS_XA_2_2
926 - CDS_XA_2_1
927 - CDS_DATA_1
928
929 error returns:
930 none at present
931
932 notes:
933 - Source code comments state::
934
935
936 Ok, this is where problems start. The current interface for
937 the CDROM_DISC_STATUS ioctl is flawed. It makes the false
938 assumption that CDs are all CDS_DATA_1 or all CDS_AUDIO, etc.
939 Unfortunately, while this is often the case, it is also
940 very common for CDs to have some tracks with data, and some
941 tracks with audio. Just because I feel like it, I declare
942 the following to be the best way to cope. If the CD has
943 ANY data tracks on it, it will be returned as a data CD.
944 If it has any XA tracks, I will return it as that. Now I
945 could simplify this interface by combining these returns with
946 the above, but this more clearly demonstrates the problem
947 with the current interface. Too bad this wasn't designed
948 to use bitmasks... -Erik
949
950 Well, now we have the option CDS_MIXED: a mixed-type CD.
951 User level programmers might feel the ioctl is not very
952 useful.
953 ---david
954
955
956
957
958CDROM_CHANGER_NSLOTS
959 Get number of slots
960
961
962 usage::
963
964 ioctl(fd, CDROM_CHANGER_NSLOTS, 0);
965
966
967 inputs:
968 none
969
970
971 outputs:
972 The ioctl return value will be the number of slots in a
973 CD changer. Typically 1 for non-multi-disk devices.
974
975 error returns:
976 none
977
978
979
980CDROM_LOCKDOOR
981 lock or unlock door
982
983
984 usage::
985
986 int lock;
987
988 ioctl(fd, CDROM_LOCKDOOR, lock);
989
990 inputs:
991 Door lock flag, 1=lock, 0=unlock
992
993
994 outputs:
995 none
996
997
998 error returns:
999 - EDRIVE_CANT_DO_THIS
1000
1001 Door lock function not supported.
1002 - EBUSY
1003
1004 Attempt to unlock when multiple users
1005 have the drive open and not CAP_SYS_ADMIN
1006
1007 notes:
1008 As of 2.6.8.1, the lock flag is a global lock, meaning that
1009 all CD drives will be locked or unlocked together. This is
1010 probably a bug.
1011
1012 The EDRIVE_CANT_DO_THIS value is defined in <linux/cdrom.h>
1013 and is currently (2.6.8.1) the same as EOPNOTSUPP
1014
1015
1016
1017CDROM_DEBUG
1018 Turn debug messages on/off
1019
1020
1021 usage::
1022
1023 int debug;
1024
1025 ioctl(fd, CDROM_DEBUG, debug);
1026
1027 inputs:
1028 Cdrom debug flag, 0=disable, 1=enable
1029
1030
1031 outputs:
1032 The ioctl return value will be the new debug flag.
1033
1034
1035 error return:
1036 - EACCES Access denied: requires CAP_SYS_ADMIN
1037
1038
1039
1040CDROM_GET_CAPABILITY
1041 get capabilities
1042
1043
1044 usage::
1045
1046 ioctl(fd, CDROM_GET_CAPABILITY, 0);
1047
1048
1049 inputs:
1050 none
1051
1052
1053 outputs:
1054 The ioctl return value is the current device capability
1055 flags. See CDC_CLOSE_TRAY, CDC_OPEN_TRAY, etc.
1056
1057
1058
1059CDROMAUDIOBUFSIZ
1060 set the audio buffer size
1061
1062
1063 usage::
1064
1065 int arg;
1066
1067 ioctl(fd, CDROMAUDIOBUFSIZ, val);
1068
1069 inputs:
1070 New audio buffer size
1071
1072
1073 outputs:
1074 The ioctl return value is the new audio buffer size, or -1
1075 on error.
1076
1077 error return:
1078 - ENOSYS Not supported by this driver.
1079
1080 notes:
1081 Not supported by all drivers.
1082
1083
1084
1085
1086DVD_READ_STRUCT Read structure
1087
1088 usage::
1089
1090 dvd_struct s;
1091
1092 ioctl(fd, DVD_READ_STRUCT, &s);
1093
1094 inputs:
1095 dvd_struct structure, containing:
1096
1097 =================== ==========================================
1098 type specifies the information desired, one of
1099 DVD_STRUCT_PHYSICAL, DVD_STRUCT_COPYRIGHT,
1100 DVD_STRUCT_DISCKEY, DVD_STRUCT_BCA,
1101 DVD_STRUCT_MANUFACT
1102 physical.layer_num desired layer, indexed from 0
1103 copyright.layer_num desired layer, indexed from 0
1104 disckey.agid
1105 =================== ==========================================
1106
1107 outputs:
1108 dvd_struct structure, containing:
1109
1110 =================== ================================
1111 physical for type == DVD_STRUCT_PHYSICAL
1112 copyright for type == DVD_STRUCT_COPYRIGHT
1113 disckey.value for type == DVD_STRUCT_DISCKEY
1114 bca.{len,value} for type == DVD_STRUCT_BCA
1115 manufact.{len,valu} for type == DVD_STRUCT_MANUFACT
1116 =================== ================================
1117
1118 error returns:
1119 - EINVAL physical.layer_num exceeds number of layers
1120 - EIO Received invalid response from drive
1121
1122
1123
1124DVD_WRITE_STRUCT Write structure
1125
1126 Not implemented, as of 2.6.8.1
1127
1128
1129
1130DVD_AUTH Authentication
1131
1132 usage::
1133
1134 dvd_authinfo ai;
1135
1136 ioctl(fd, DVD_AUTH, &ai);
1137
1138 inputs:
1139 dvd_authinfo structure. See <linux/cdrom.h>
1140
1141
1142 outputs:
1143 dvd_authinfo structure.
1144
1145
1146 error return:
1147 - ENOTTY ai.type not recognized.
1148
1149
1150
1151CDROM_SEND_PACKET
1152 send a packet to the drive
1153
1154
1155 usage::
1156
1157 struct cdrom_generic_command cgc;
1158
1159 ioctl(fd, CDROM_SEND_PACKET, &cgc);
1160
1161 inputs:
1162 cdrom_generic_command structure containing the packet to send.
1163
1164
1165 outputs:
1166 none
1167
1168 cdrom_generic_command structure containing results.
1169
1170 error return:
1171 - EIO
1172
1173 command failed.
1174 - EPERM
1175
1176 Operation not permitted, either because a
1177 write command was attempted on a drive which
1178 is opened read-only, or because the command
1179 requires CAP_SYS_RAWIO
1180 - EINVAL
1181
1182 cgc.data_direction not set
1183
1184
1185
1186CDROM_NEXT_WRITABLE
1187 get next writable block
1188
1189
1190 usage::
1191
1192 long next;
1193
1194 ioctl(fd, CDROM_NEXT_WRITABLE, &next);
1195
1196 inputs:
1197 none
1198
1199
1200 outputs:
1201 The next writable block.
1202
1203
1204 notes:
1205 If the device does not support this ioctl directly, the
1206
1207 ioctl will return CDROM_LAST_WRITTEN + 7.
1208
1209
1210
1211CDROM_LAST_WRITTEN
1212 get last block written on disc
1213
1214
1215 usage::
1216
1217 long last;
1218
1219 ioctl(fd, CDROM_LAST_WRITTEN, &last);
1220
1221 inputs:
1222 none
1223
1224
1225 outputs:
1226 The last block written on disc
1227
1228
1229 notes:
1230 If the device does not support this ioctl directly, the
1231 result is derived from the disc's table of contents. If the
1232 table of contents can't be read, this ioctl returns an
1233 error.
diff --git a/Documentation/ioctl/cdrom.txt b/Documentation/ioctl/cdrom.txt
deleted file mode 100644
index a4d62a9d6771..000000000000
--- a/Documentation/ioctl/cdrom.txt
+++ /dev/null
@@ -1,967 +0,0 @@
1 Summary of CDROM ioctl calls.
2 ============================
3
4 Edward A. Falk <efalk@google.com>
5
6 November, 2004
7
8This document attempts to describe the ioctl(2) calls supported by
9the CDROM layer. These are by-and-large implemented (as of Linux 2.6)
10in drivers/cdrom/cdrom.c and drivers/block/scsi_ioctl.c
11
12ioctl values are listed in <linux/cdrom.h>. As of this writing, they
13are as follows:
14
15 CDROMPAUSE Pause Audio Operation
16 CDROMRESUME Resume paused Audio Operation
17 CDROMPLAYMSF Play Audio MSF (struct cdrom_msf)
18 CDROMPLAYTRKIND Play Audio Track/index (struct cdrom_ti)
19 CDROMREADTOCHDR Read TOC header (struct cdrom_tochdr)
20 CDROMREADTOCENTRY Read TOC entry (struct cdrom_tocentry)
21 CDROMSTOP Stop the cdrom drive
22 CDROMSTART Start the cdrom drive
23 CDROMEJECT Ejects the cdrom media
24 CDROMVOLCTRL Control output volume (struct cdrom_volctrl)
25 CDROMSUBCHNL Read subchannel data (struct cdrom_subchnl)
26 CDROMREADMODE2 Read CDROM mode 2 data (2336 Bytes)
27 (struct cdrom_read)
28 CDROMREADMODE1 Read CDROM mode 1 data (2048 Bytes)
29 (struct cdrom_read)
30 CDROMREADAUDIO (struct cdrom_read_audio)
31 CDROMEJECT_SW enable(1)/disable(0) auto-ejecting
32 CDROMMULTISESSION Obtain the start-of-last-session
33 address of multi session disks
34 (struct cdrom_multisession)
35 CDROM_GET_MCN Obtain the "Universal Product Code"
36 if available (struct cdrom_mcn)
37 CDROM_GET_UPC Deprecated, use CDROM_GET_MCN instead.
38 CDROMRESET hard-reset the drive
39 CDROMVOLREAD Get the drive's volume setting
40 (struct cdrom_volctrl)
41 CDROMREADRAW read data in raw mode (2352 Bytes)
42 (struct cdrom_read)
43 CDROMREADCOOKED read data in cooked mode
44 CDROMSEEK seek msf address
45 CDROMPLAYBLK scsi-cd only, (struct cdrom_blk)
46 CDROMREADALL read all 2646 bytes
47 CDROMGETSPINDOWN return 4-bit spindown value
48 CDROMSETSPINDOWN set 4-bit spindown value
49 CDROMCLOSETRAY pendant of CDROMEJECT
50 CDROM_SET_OPTIONS Set behavior options
51 CDROM_CLEAR_OPTIONS Clear behavior options
52 CDROM_SELECT_SPEED Set the CD-ROM speed
53 CDROM_SELECT_DISC Select disc (for juke-boxes)
54 CDROM_MEDIA_CHANGED Check is media changed
55 CDROM_DRIVE_STATUS Get tray position, etc.
56 CDROM_DISC_STATUS Get disc type, etc.
57 CDROM_CHANGER_NSLOTS Get number of slots
58 CDROM_LOCKDOOR lock or unlock door
59 CDROM_DEBUG Turn debug messages on/off
60 CDROM_GET_CAPABILITY get capabilities
61 CDROMAUDIOBUFSIZ set the audio buffer size
62 DVD_READ_STRUCT Read structure
63 DVD_WRITE_STRUCT Write structure
64 DVD_AUTH Authentication
65 CDROM_SEND_PACKET send a packet to the drive
66 CDROM_NEXT_WRITABLE get next writable block
67 CDROM_LAST_WRITTEN get last block written on disc
68
69
70The information that follows was determined from reading kernel source
71code. It is likely that some corrections will be made over time.
72
73
74
75
76
77
78
79General:
80
81 Unless otherwise specified, all ioctl calls return 0 on success
82 and -1 with errno set to an appropriate value on error. (Some
83 ioctls return non-negative data values.)
84
85 Unless otherwise specified, all ioctl calls return -1 and set
86 errno to EFAULT on a failed attempt to copy data to or from user
87 address space.
88
89 Individual drivers may return error codes not listed here.
90
91 Unless otherwise specified, all data structures and constants
92 are defined in <linux/cdrom.h>
93
94
95
96
97CDROMPAUSE Pause Audio Operation
98
99 usage:
100
101 ioctl(fd, CDROMPAUSE, 0);
102
103 inputs: none
104
105 outputs: none
106
107 error return:
108 ENOSYS cd drive not audio-capable.
109
110
111CDROMRESUME Resume paused Audio Operation
112
113 usage:
114
115 ioctl(fd, CDROMRESUME, 0);
116
117 inputs: none
118
119 outputs: none
120
121 error return:
122 ENOSYS cd drive not audio-capable.
123
124
125CDROMPLAYMSF Play Audio MSF (struct cdrom_msf)
126
127 usage:
128
129 struct cdrom_msf msf;
130 ioctl(fd, CDROMPLAYMSF, &msf);
131
132 inputs:
133 cdrom_msf structure, describing a segment of music to play
134
135 outputs: none
136
137 error return:
138 ENOSYS cd drive not audio-capable.
139
140 notes:
141 MSF stands for minutes-seconds-frames
142 LBA stands for logical block address
143
144 Segment is described as start and end times, where each time
145 is described as minutes:seconds:frames. A frame is 1/75 of
146 a second.
147
148
149CDROMPLAYTRKIND Play Audio Track/index (struct cdrom_ti)
150
151 usage:
152
153 struct cdrom_ti ti;
154 ioctl(fd, CDROMPLAYTRKIND, &ti);
155
156 inputs:
157 cdrom_ti structure, describing a segment of music to play
158
159 outputs: none
160
161 error return:
162 ENOSYS cd drive not audio-capable.
163
164 notes:
165 Segment is described as start and end times, where each time
166 is described as a track and an index.
167
168
169
170CDROMREADTOCHDR Read TOC header (struct cdrom_tochdr)
171
172 usage:
173
174 cdrom_tochdr header;
175 ioctl(fd, CDROMREADTOCHDR, &header);
176
177 inputs:
178 cdrom_tochdr structure
179
180 outputs:
181 cdrom_tochdr structure
182
183 error return:
184 ENOSYS cd drive not audio-capable.
185
186
187
188CDROMREADTOCENTRY Read TOC entry (struct cdrom_tocentry)
189
190 usage:
191
192 struct cdrom_tocentry entry;
193 ioctl(fd, CDROMREADTOCENTRY, &entry);
194
195 inputs:
196 cdrom_tocentry structure
197
198 outputs:
199 cdrom_tocentry structure
200
201 error return:
202 ENOSYS cd drive not audio-capable.
203 EINVAL entry.cdte_format not CDROM_MSF or CDROM_LBA
204 EINVAL requested track out of bounds
205 EIO I/O error reading TOC
206
207 notes:
208 TOC stands for Table Of Contents
209 MSF stands for minutes-seconds-frames
210 LBA stands for logical block address
211
212
213
214CDROMSTOP Stop the cdrom drive
215
216 usage:
217
218 ioctl(fd, CDROMSTOP, 0);
219
220 inputs: none
221
222 outputs: none
223
224 error return:
225 ENOSYS cd drive not audio-capable.
226
227 notes:
228 Exact interpretation of this ioctl depends on the device,
229 but most seem to spin the drive down.
230
231
232CDROMSTART Start the cdrom drive
233
234 usage:
235
236 ioctl(fd, CDROMSTART, 0);
237
238 inputs: none
239
240 outputs: none
241
242 error return:
243 ENOSYS cd drive not audio-capable.
244
245 notes:
246 Exact interpretation of this ioctl depends on the device,
247 but most seem to spin the drive up and/or close the tray.
248 Other devices ignore the ioctl completely.
249
250
251CDROMEJECT Ejects the cdrom media
252
253 usage:
254
255 ioctl(fd, CDROMEJECT, 0);
256
257 inputs: none
258
259 outputs: none
260
261 error returns:
262 ENOSYS cd drive not capable of ejecting
263 EBUSY other processes are accessing drive, or door is locked
264
265 notes:
266 See CDROM_LOCKDOOR, below.
267
268
269
270CDROMCLOSETRAY pendant of CDROMEJECT
271
272 usage:
273
274 ioctl(fd, CDROMCLOSETRAY, 0);
275
276 inputs: none
277
278 outputs: none
279
280 error returns:
281 ENOSYS cd drive not capable of closing the tray
282 EBUSY other processes are accessing drive, or door is locked
283
284 notes:
285 See CDROM_LOCKDOOR, below.
286
287
288
289CDROMVOLCTRL Control output volume (struct cdrom_volctrl)
290
291 usage:
292
293 struct cdrom_volctrl volume;
294 ioctl(fd, CDROMVOLCTRL, &volume);
295
296 inputs:
297 cdrom_volctrl structure containing volumes for up to 4
298 channels.
299
300 outputs: none
301
302 error return:
303 ENOSYS cd drive not audio-capable.
304
305
306
307CDROMVOLREAD Get the drive's volume setting
308 (struct cdrom_volctrl)
309
310 usage:
311
312 struct cdrom_volctrl volume;
313 ioctl(fd, CDROMVOLREAD, &volume);
314
315 inputs: none
316
317 outputs:
318 The current volume settings.
319
320 error return:
321 ENOSYS cd drive not audio-capable.
322
323
324
325CDROMSUBCHNL Read subchannel data (struct cdrom_subchnl)
326
327 usage:
328
329 struct cdrom_subchnl q;
330 ioctl(fd, CDROMSUBCHNL, &q);
331
332 inputs:
333 cdrom_subchnl structure
334
335 outputs:
336 cdrom_subchnl structure
337
338 error return:
339 ENOSYS cd drive not audio-capable.
340 EINVAL format not CDROM_MSF or CDROM_LBA
341
342 notes:
343 Format is converted to CDROM_MSF or CDROM_LBA
344 as per user request on return
345
346
347
348CDROMREADRAW read data in raw mode (2352 Bytes)
349 (struct cdrom_read)
350
351 usage:
352
353 union {
354 struct cdrom_msf msf; /* input */
355 char buffer[CD_FRAMESIZE_RAW]; /* return */
356 } arg;
357 ioctl(fd, CDROMREADRAW, &arg);
358
359 inputs:
360 cdrom_msf structure indicating an address to read.
361 Only the start values are significant.
362
363 outputs:
364 Data written to address provided by user.
365
366 error return:
367 EINVAL address less than 0, or msf less than 0:2:0
368 ENOMEM out of memory
369
370 notes:
371 As of 2.6.8.1, comments in <linux/cdrom.h> indicate that this
372 ioctl accepts a cdrom_read structure, but actual source code
373 reads a cdrom_msf structure and writes a buffer of data to
374 the same address.
375
376 MSF values are converted to LBA values via this formula:
377
378 lba = (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
379
380
381
382
383CDROMREADMODE1 Read CDROM mode 1 data (2048 Bytes)
384 (struct cdrom_read)
385
386 notes:
387 Identical to CDROMREADRAW except that block size is
388 CD_FRAMESIZE (2048) bytes
389
390
391
392CDROMREADMODE2 Read CDROM mode 2 data (2336 Bytes)
393 (struct cdrom_read)
394
395 notes:
396 Identical to CDROMREADRAW except that block size is
397 CD_FRAMESIZE_RAW0 (2336) bytes
398
399
400
401CDROMREADAUDIO (struct cdrom_read_audio)
402
403 usage:
404
405 struct cdrom_read_audio ra;
406 ioctl(fd, CDROMREADAUDIO, &ra);
407
408 inputs:
409 cdrom_read_audio structure containing read start
410 point and length
411
412 outputs:
413 audio data, returned to buffer indicated by ra
414
415 error return:
416 EINVAL format not CDROM_MSF or CDROM_LBA
417 EINVAL nframes not in range [1 75]
418 ENXIO drive has no queue (probably means invalid fd)
419 ENOMEM out of memory
420
421
422CDROMEJECT_SW enable(1)/disable(0) auto-ejecting
423
424 usage:
425
426 int val;
427 ioctl(fd, CDROMEJECT_SW, val);
428
429 inputs:
430 Flag specifying auto-eject flag.
431
432 outputs: none
433
434 error return:
435 ENOSYS Drive is not capable of ejecting.
436 EBUSY Door is locked
437
438
439
440
441CDROMMULTISESSION Obtain the start-of-last-session
442 address of multi session disks
443 (struct cdrom_multisession)
444 usage:
445
446 struct cdrom_multisession ms_info;
447 ioctl(fd, CDROMMULTISESSION, &ms_info);
448
449 inputs:
450 cdrom_multisession structure containing desired
451 format.
452
453 outputs:
454 cdrom_multisession structure is filled with last_session
455 information.
456
457 error return:
458 EINVAL format not CDROM_MSF or CDROM_LBA
459
460
461CDROM_GET_MCN Obtain the "Universal Product Code"
462 if available (struct cdrom_mcn)
463
464 usage:
465
466 struct cdrom_mcn mcn;
467 ioctl(fd, CDROM_GET_MCN, &mcn);
468
469 inputs: none
470
471 outputs:
472 Universal Product Code
473
474 error return:
475 ENOSYS Drive is not capable of reading MCN data.
476
477 notes:
478 Source code comments state:
479
480 The following function is implemented, although very few
481 audio discs give Universal Product Code information, which
482 should just be the Medium Catalog Number on the box. Note,
483 that the way the code is written on the CD is /not/ uniform
484 across all discs!
485
486
487
488
489CDROM_GET_UPC CDROM_GET_MCN (deprecated)
490
491 Not implemented, as of 2.6.8.1
492
493
494
495CDROMRESET hard-reset the drive
496
497 usage:
498
499 ioctl(fd, CDROMRESET, 0);
500
501 inputs: none
502
503 outputs: none
504
505 error return:
506 EACCES Access denied: requires CAP_SYS_ADMIN
507 ENOSYS Drive is not capable of resetting.
508
509
510
511
512CDROMREADCOOKED read data in cooked mode
513
514 usage:
515
516 u8 buffer[CD_FRAMESIZE]
517 ioctl(fd, CDROMREADCOOKED, buffer);
518
519 inputs: none
520
521 outputs:
522 2048 bytes of data, "cooked" mode.
523
524 notes:
525 Not implemented on all drives.
526
527
528
529
530CDROMREADALL read all 2646 bytes
531
532 Same as CDROMREADCOOKED, but reads 2646 bytes.
533
534
535
536CDROMSEEK seek msf address
537
538 usage:
539
540 struct cdrom_msf msf;
541 ioctl(fd, CDROMSEEK, &msf);
542
543 inputs:
544 MSF address to seek to.
545
546 outputs: none
547
548
549
550CDROMPLAYBLK scsi-cd only, (struct cdrom_blk)
551
552 usage:
553
554 struct cdrom_blk blk;
555 ioctl(fd, CDROMPLAYBLK, &blk);
556
557 inputs:
558 Region to play
559
560 outputs: none
561
562
563
564CDROMGETSPINDOWN
565
566 usage:
567
568 char spindown;
569 ioctl(fd, CDROMGETSPINDOWN, &spindown);
570
571 inputs: none
572
573 outputs:
574 The value of the current 4-bit spindown value.
575
576
577
578
579CDROMSETSPINDOWN
580
581 usage:
582
583 char spindown
584 ioctl(fd, CDROMSETSPINDOWN, &spindown);
585
586 inputs:
587 4-bit value used to control spindown (TODO: more detail here)
588
589 outputs: none
590
591
592
593
594
595CDROM_SET_OPTIONS Set behavior options
596
597 usage:
598
599 int options;
600 ioctl(fd, CDROM_SET_OPTIONS, options);
601
602 inputs:
603 New values for drive options. The logical 'or' of:
604 CDO_AUTO_CLOSE close tray on first open(2)
605 CDO_AUTO_EJECT open tray on last release
606 CDO_USE_FFLAGS use O_NONBLOCK information on open
607 CDO_LOCK lock tray on open files
608 CDO_CHECK_TYPE check type on open for data
609
610 outputs:
611 Returns the resulting options settings in the
612 ioctl return value. Returns -1 on error.
613
614 error return:
615 ENOSYS selected option(s) not supported by drive.
616
617
618
619
620CDROM_CLEAR_OPTIONS Clear behavior options
621
622 Same as CDROM_SET_OPTIONS, except that selected options are
623 turned off.
624
625
626
627CDROM_SELECT_SPEED Set the CD-ROM speed
628
629 usage:
630
631 int speed;
632 ioctl(fd, CDROM_SELECT_SPEED, speed);
633
634 inputs:
635 New drive speed.
636
637 outputs: none
638
639 error return:
640 ENOSYS speed selection not supported by drive.
641
642
643
644CDROM_SELECT_DISC Select disc (for juke-boxes)
645
646 usage:
647
648 int disk;
649 ioctl(fd, CDROM_SELECT_DISC, disk);
650
651 inputs:
652 Disk to load into drive.
653
654 outputs: none
655
656 error return:
657 EINVAL Disk number beyond capacity of drive
658
659
660
661CDROM_MEDIA_CHANGED Check is media changed
662
663 usage:
664
665 int slot;
666 ioctl(fd, CDROM_MEDIA_CHANGED, slot);
667
668 inputs:
669 Slot number to be tested, always zero except for jukeboxes.
670 May also be special values CDSL_NONE or CDSL_CURRENT
671
672 outputs:
673 Ioctl return value is 0 or 1 depending on whether the media
674 has been changed, or -1 on error.
675
676 error returns:
677 ENOSYS Drive can't detect media change
678 EINVAL Slot number beyond capacity of drive
679 ENOMEM Out of memory
680
681
682
683CDROM_DRIVE_STATUS Get tray position, etc.
684
685 usage:
686
687 int slot;
688 ioctl(fd, CDROM_DRIVE_STATUS, slot);
689
690 inputs:
691 Slot number to be tested, always zero except for jukeboxes.
692 May also be special values CDSL_NONE or CDSL_CURRENT
693
694 outputs:
695 Ioctl return value will be one of the following values
696 from <linux/cdrom.h>:
697
698 CDS_NO_INFO Information not available.
699 CDS_NO_DISC
700 CDS_TRAY_OPEN
701 CDS_DRIVE_NOT_READY
702 CDS_DISC_OK
703 -1 error
704
705 error returns:
706 ENOSYS Drive can't detect drive status
707 EINVAL Slot number beyond capacity of drive
708 ENOMEM Out of memory
709
710
711
712
713CDROM_DISC_STATUS Get disc type, etc.
714
715 usage:
716
717 ioctl(fd, CDROM_DISC_STATUS, 0);
718
719 inputs: none
720
721 outputs:
722 Ioctl return value will be one of the following values
723 from <linux/cdrom.h>:
724 CDS_NO_INFO
725 CDS_AUDIO
726 CDS_MIXED
727 CDS_XA_2_2
728 CDS_XA_2_1
729 CDS_DATA_1
730
731 error returns: none at present
732
733 notes:
734 Source code comments state:
735
736 Ok, this is where problems start. The current interface for
737 the CDROM_DISC_STATUS ioctl is flawed. It makes the false
738 assumption that CDs are all CDS_DATA_1 or all CDS_AUDIO, etc.
739 Unfortunately, while this is often the case, it is also
740 very common for CDs to have some tracks with data, and some
741 tracks with audio. Just because I feel like it, I declare
742 the following to be the best way to cope. If the CD has
743 ANY data tracks on it, it will be returned as a data CD.
744 If it has any XA tracks, I will return it as that. Now I
745 could simplify this interface by combining these returns with
746 the above, but this more clearly demonstrates the problem
747 with the current interface. Too bad this wasn't designed
748 to use bitmasks... -Erik
749
750 Well, now we have the option CDS_MIXED: a mixed-type CD.
751 User level programmers might feel the ioctl is not very
752 useful.
753 ---david
754
755
756
757
758CDROM_CHANGER_NSLOTS Get number of slots
759
760 usage:
761
762 ioctl(fd, CDROM_CHANGER_NSLOTS, 0);
763
764 inputs: none
765
766 outputs:
767 The ioctl return value will be the number of slots in a
768 CD changer. Typically 1 for non-multi-disk devices.
769
770 error returns: none
771
772
773
774CDROM_LOCKDOOR lock or unlock door
775
776 usage:
777
778 int lock;
779 ioctl(fd, CDROM_LOCKDOOR, lock);
780
781 inputs:
782 Door lock flag, 1=lock, 0=unlock
783
784 outputs: none
785
786 error returns:
787 EDRIVE_CANT_DO_THIS Door lock function not supported.
788 EBUSY Attempt to unlock when multiple users
789 have the drive open and not CAP_SYS_ADMIN
790
791 notes:
792 As of 2.6.8.1, the lock flag is a global lock, meaning that
793 all CD drives will be locked or unlocked together. This is
794 probably a bug.
795
796 The EDRIVE_CANT_DO_THIS value is defined in <linux/cdrom.h>
797 and is currently (2.6.8.1) the same as EOPNOTSUPP
798
799
800
801CDROM_DEBUG Turn debug messages on/off
802
803 usage:
804
805 int debug;
806 ioctl(fd, CDROM_DEBUG, debug);
807
808 inputs:
809 Cdrom debug flag, 0=disable, 1=enable
810
811 outputs:
812 The ioctl return value will be the new debug flag.
813
814 error return:
815 EACCES Access denied: requires CAP_SYS_ADMIN
816
817
818
819CDROM_GET_CAPABILITY get capabilities
820
821 usage:
822
823 ioctl(fd, CDROM_GET_CAPABILITY, 0);
824
825 inputs: none
826
827 outputs:
828 The ioctl return value is the current device capability
829 flags. See CDC_CLOSE_TRAY, CDC_OPEN_TRAY, etc.
830
831
832
833CDROMAUDIOBUFSIZ set the audio buffer size
834
835 usage:
836
837 int arg;
838 ioctl(fd, CDROMAUDIOBUFSIZ, val);
839
840 inputs:
841 New audio buffer size
842
843 outputs:
844 The ioctl return value is the new audio buffer size, or -1
845 on error.
846
847 error return:
848 ENOSYS Not supported by this driver.
849
850 notes:
851 Not supported by all drivers.
852
853
854
855DVD_READ_STRUCT Read structure
856
857 usage:
858
859 dvd_struct s;
860 ioctl(fd, DVD_READ_STRUCT, &s);
861
862 inputs:
863 dvd_struct structure, containing:
864 type specifies the information desired, one of
865 DVD_STRUCT_PHYSICAL, DVD_STRUCT_COPYRIGHT,
866 DVD_STRUCT_DISCKEY, DVD_STRUCT_BCA,
867 DVD_STRUCT_MANUFACT
868 physical.layer_num desired layer, indexed from 0
869 copyright.layer_num desired layer, indexed from 0
870 disckey.agid
871
872 outputs:
873 dvd_struct structure, containing:
874 physical for type == DVD_STRUCT_PHYSICAL
875 copyright for type == DVD_STRUCT_COPYRIGHT
876 disckey.value for type == DVD_STRUCT_DISCKEY
877 bca.{len,value} for type == DVD_STRUCT_BCA
878 manufact.{len,valu} for type == DVD_STRUCT_MANUFACT
879
880 error returns:
881 EINVAL physical.layer_num exceeds number of layers
882 EIO Received invalid response from drive
883
884
885
886DVD_WRITE_STRUCT Write structure
887
888 Not implemented, as of 2.6.8.1
889
890
891
892DVD_AUTH Authentication
893
894 usage:
895
896 dvd_authinfo ai;
897 ioctl(fd, DVD_AUTH, &ai);
898
899 inputs:
900 dvd_authinfo structure. See <linux/cdrom.h>
901
902 outputs:
903 dvd_authinfo structure.
904
905 error return:
906 ENOTTY ai.type not recognized.
907
908
909
910CDROM_SEND_PACKET send a packet to the drive
911
912 usage:
913
914 struct cdrom_generic_command cgc;
915 ioctl(fd, CDROM_SEND_PACKET, &cgc);
916
917 inputs:
918 cdrom_generic_command structure containing the packet to send.
919
920 outputs: none
921 cdrom_generic_command structure containing results.
922
923 error return:
924 EIO command failed.
925 EPERM Operation not permitted, either because a
926 write command was attempted on a drive which
927 is opened read-only, or because the command
928 requires CAP_SYS_RAWIO
929 EINVAL cgc.data_direction not set
930
931
932
933CDROM_NEXT_WRITABLE get next writable block
934
935 usage:
936
937 long next;
938 ioctl(fd, CDROM_NEXT_WRITABLE, &next);
939
940 inputs: none
941
942 outputs:
943 The next writable block.
944
945 notes:
946 If the device does not support this ioctl directly, the
947 ioctl will return CDROM_LAST_WRITTEN + 7.
948
949
950
951CDROM_LAST_WRITTEN get last block written on disc
952
953 usage:
954
955 long last;
956 ioctl(fd, CDROM_LAST_WRITTEN, &last);
957
958 inputs: none
959
960 outputs:
961 The last block written on disc
962
963 notes:
964 If the device does not support this ioctl directly, the
965 result is derived from the disc's table of contents. If the
966 table of contents can't be read, this ioctl returns an
967 error.
diff --git a/Documentation/ioctl/hdio.txt b/Documentation/ioctl/hdio.rst
index 18eb98c44ffe..e822e3dff176 100644
--- a/Documentation/ioctl/hdio.txt
+++ b/Documentation/ioctl/hdio.rst
@@ -1,9 +1,10 @@
1 Summary of HDIO_ ioctl calls. 1==============================
2 ============================ 2Summary of `HDIO_` ioctl calls
3==============================
3 4
4 Edward A. Falk <efalk@google.com> 5- Edward A. Falk <efalk@google.com>
5 6
6 November, 2004 7November, 2004
7 8
8This document attempts to describe the ioctl(2) calls supported by 9This document attempts to describe the ioctl(2) calls supported by
9the HD/IDE layer. These are by-and-large implemented (as of Linux 2.6) 10the HD/IDE layer. These are by-and-large implemented (as of Linux 2.6)
@@ -14,6 +15,7 @@ are as follows:
14 15
15 ioctls that pass argument pointers to user space: 16 ioctls that pass argument pointers to user space:
16 17
18 ======================= =======================================
17 HDIO_GETGEO get device geometry 19 HDIO_GETGEO get device geometry
18 HDIO_GET_UNMASKINTR get current unmask setting 20 HDIO_GET_UNMASKINTR get current unmask setting
19 HDIO_GET_MULTCOUNT get current IDE blockmode setting 21 HDIO_GET_MULTCOUNT get current IDE blockmode setting
@@ -36,9 +38,11 @@ are as follows:
36 HDIO_DRIVE_TASK execute task and special drive command 38 HDIO_DRIVE_TASK execute task and special drive command
37 HDIO_DRIVE_CMD execute a special drive command 39 HDIO_DRIVE_CMD execute a special drive command
38 HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK 40 HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
41 ======================= =======================================
39 42
40 ioctls that pass non-pointer values: 43 ioctls that pass non-pointer values:
41 44
45 ======================= =======================================
42 HDIO_SET_MULTCOUNT change IDE blockmode 46 HDIO_SET_MULTCOUNT change IDE blockmode
43 HDIO_SET_UNMASKINTR permit other irqs during I/O 47 HDIO_SET_UNMASKINTR permit other irqs during I/O
44 HDIO_SET_KEEPSETTINGS keep ioctl settings on reset 48 HDIO_SET_KEEPSETTINGS keep ioctl settings on reset
@@ -57,16 +61,13 @@ are as follows:
57 61
58 HDIO_SET_IDE_SCSI Set scsi emulation mode on/off 62 HDIO_SET_IDE_SCSI Set scsi emulation mode on/off
59 HDIO_SET_SCSI_IDE not implemented yet 63 HDIO_SET_SCSI_IDE not implemented yet
64 ======================= =======================================
60 65
61 66
62The information that follows was determined from reading kernel source 67The information that follows was determined from reading kernel source
63code. It is likely that some corrections will be made over time. 68code. It is likely that some corrections will be made over time.
64 69
65 70------------------------------------------------------------------------------
66
67
68
69
70 71
71General: 72General:
72 73
@@ -80,459 +81,610 @@ General:
80 Unless otherwise specified, all data structures and constants 81 Unless otherwise specified, all data structures and constants
81 are defined in <linux/hdreg.h> 82 are defined in <linux/hdreg.h>
82 83
84------------------------------------------------------------------------------
83 85
86HDIO_GETGEO
87 get device geometry
84 88
85HDIO_GETGEO get device geometry
86 89
87 usage: 90 usage::
88 91
89 struct hd_geometry geom; 92 struct hd_geometry geom;
93
90 ioctl(fd, HDIO_GETGEO, &geom); 94 ioctl(fd, HDIO_GETGEO, &geom);
91 95
92 96
93 inputs: none 97 inputs:
98 none
99
100
94 101
95 outputs: 102 outputs:
103 hd_geometry structure containing:
96 104
97 hd_geometry structure containing:
98 105
106 ========= ==================================
99 heads number of heads 107 heads number of heads
100 sectors number of sectors/track 108 sectors number of sectors/track
101 cylinders number of cylinders, mod 65536 109 cylinders number of cylinders, mod 65536
102 start starting sector of this partition. 110 start starting sector of this partition.
111 ========= ==================================
103 112
104 113
105 error returns: 114 error returns:
106 EINVAL if the device is not a disk drive or floppy drive, 115 - EINVAL
107 or if the user passes a null pointer 116
117 if the device is not a disk drive or floppy drive,
118 or if the user passes a null pointer
108 119
109 120
110 notes: 121 notes:
122 Not particularly useful with modern disk drives, whose geometry
123 is a polite fiction anyway. Modern drives are addressed
124 purely by sector number nowadays (lba addressing), and the
125 drive geometry is an abstraction which is actually subject
126 to change. Currently (as of Nov 2004), the geometry values
127 are the "bios" values -- presumably the values the drive had
128 when Linux first booted.
111 129
112 Not particularly useful with modern disk drives, whose geometry 130 In addition, the cylinders field of the hd_geometry is an
113 is a polite fiction anyway. Modern drives are addressed 131 unsigned short, meaning that on most architectures, this
114 purely by sector number nowadays (lba addressing), and the 132 ioctl will not return a meaningful value on drives with more
115 drive geometry is an abstraction which is actually subject 133 than 65535 tracks.
116 to change. Currently (as of Nov 2004), the geometry values
117 are the "bios" values -- presumably the values the drive had
118 when Linux first booted.
119 134
120 In addition, the cylinders field of the hd_geometry is an 135 The start field is unsigned long, meaning that it will not
121 unsigned short, meaning that on most architectures, this 136 contain a meaningful value for disks over 219 Gb in size.
122 ioctl will not return a meaningful value on drives with more
123 than 65535 tracks.
124 137
125 The start field is unsigned long, meaning that it will not
126 contain a meaningful value for disks over 219 Gb in size.
127 138
128 139
129 140
141HDIO_GET_UNMASKINTR
142 get current unmask setting
130 143
131HDIO_GET_UNMASKINTR get current unmask setting
132 144
133 usage: 145 usage::
134 146
135 long val; 147 long val;
148
136 ioctl(fd, HDIO_GET_UNMASKINTR, &val); 149 ioctl(fd, HDIO_GET_UNMASKINTR, &val);
137 150
138 inputs: none 151 inputs:
152 none
153
154
139 155
140 outputs: 156 outputs:
141 The value of the drive's current unmask setting 157 The value of the drive's current unmask setting
142 158
143 159
144 160
145HDIO_SET_UNMASKINTR permit other irqs during I/O
146 161
147 usage: 162
163HDIO_SET_UNMASKINTR
164 permit other irqs during I/O
165
166
167 usage::
148 168
149 unsigned long val; 169 unsigned long val;
170
150 ioctl(fd, HDIO_SET_UNMASKINTR, val); 171 ioctl(fd, HDIO_SET_UNMASKINTR, val);
151 172
152 inputs: 173 inputs:
153 New value for unmask flag 174 New value for unmask flag
175
176
177
178 outputs:
179 none
180
154 181
155 outputs: none
156 182
157 error return: 183 error return:
158 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 184 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
159 EACCES Access denied: requires CAP_SYS_ADMIN 185 - EACCES Access denied: requires CAP_SYS_ADMIN
160 EINVAL value out of range [0 1] 186 - EINVAL value out of range [0 1]
161 EBUSY Controller busy 187 - EBUSY Controller busy
188
162 189
163 190
164 191
192HDIO_GET_MULTCOUNT
193 get current IDE blockmode setting
165 194
166HDIO_GET_MULTCOUNT get current IDE blockmode setting
167 195
168 usage: 196 usage::
169 197
170 long val; 198 long val;
199
171 ioctl(fd, HDIO_GET_MULTCOUNT, &val); 200 ioctl(fd, HDIO_GET_MULTCOUNT, &val);
172 201
173 inputs: none 202 inputs:
203 none
204
205
174 206
175 outputs: 207 outputs:
176 The value of the current IDE block mode setting. This 208 The value of the current IDE block mode setting. This
177 controls how many sectors the drive will transfer per 209 controls how many sectors the drive will transfer per
178 interrupt. 210 interrupt.
211
179 212
180 213
214HDIO_SET_MULTCOUNT
215 change IDE blockmode
181 216
182HDIO_SET_MULTCOUNT change IDE blockmode
183 217
184 usage: 218 usage::
185 219
186 int val; 220 int val;
221
187 ioctl(fd, HDIO_SET_MULTCOUNT, val); 222 ioctl(fd, HDIO_SET_MULTCOUNT, val);
188 223
189 inputs: 224 inputs:
190 New value for IDE block mode setting. This controls how many 225 New value for IDE block mode setting. This controls how many
191 sectors the drive will transfer per interrupt. 226 sectors the drive will transfer per interrupt.
227
228 outputs:
229 none
230
192 231
193 outputs: none
194 232
195 error return: 233 error return:
196 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 234 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
197 EACCES Access denied: requires CAP_SYS_ADMIN 235 - EACCES Access denied: requires CAP_SYS_ADMIN
198 EINVAL value out of range supported by disk. 236 - EINVAL value out of range supported by disk.
199 EBUSY Controller busy or blockmode already set. 237 - EBUSY Controller busy or blockmode already set.
200 EIO Drive did not accept new block mode. 238 - EIO Drive did not accept new block mode.
201 239
202 notes: 240 notes:
203 241 Source code comments read::
204 Source code comments read:
205 242
206 This is tightly woven into the driver->do_special cannot 243 This is tightly woven into the driver->do_special cannot
207 touch. DON'T do it again until a total personality rewrite 244 touch. DON'T do it again until a total personality rewrite
208 is committed. 245 is committed.
209 246
210 If blockmode has already been set, this ioctl will fail with 247 If blockmode has already been set, this ioctl will fail with
211 EBUSY 248 -EBUSY
212 249
213 250
214 251
215HDIO_GET_QDMA get use-qdma flag 252HDIO_GET_QDMA
253 get use-qdma flag
254
216 255
217 Not implemented, as of 2.6.8.1 256 Not implemented, as of 2.6.8.1
218 257
219 258
220 259
221HDIO_SET_XFER set transfer rate via proc 260HDIO_SET_XFER
261 set transfer rate via proc
262
222 263
223 Not implemented, as of 2.6.8.1 264 Not implemented, as of 2.6.8.1
224 265
225 266
226 267
227HDIO_OBSOLETE_IDENTITY OBSOLETE, DO NOT USE 268HDIO_OBSOLETE_IDENTITY
269 OBSOLETE, DO NOT USE
270
228 271
229 Same as HDIO_GET_IDENTITY (see below), except that it only 272 Same as HDIO_GET_IDENTITY (see below), except that it only
230 returns the first 142 bytes of drive identity information. 273 returns the first 142 bytes of drive identity information.
231 274
232 275
233 276
234HDIO_GET_IDENTITY get IDE identification info 277HDIO_GET_IDENTITY
278 get IDE identification info
279
235 280
236 usage: 281 usage::
237 282
238 unsigned char identity[512]; 283 unsigned char identity[512];
284
239 ioctl(fd, HDIO_GET_IDENTITY, identity); 285 ioctl(fd, HDIO_GET_IDENTITY, identity);
240 286
241 inputs: none 287 inputs:
288 none
242 289
243 outputs:
244 290
245 ATA drive identity information. For full description, see 291
246 the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in 292 outputs:
247 the ATA specification. 293 ATA drive identity information. For full description, see
294 the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands in
295 the ATA specification.
248 296
249 error returns: 297 error returns:
250 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 298 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
251 ENOMSG IDENTIFY DEVICE information not available 299 - ENOMSG IDENTIFY DEVICE information not available
252 300
253 notes: 301 notes:
302 Returns information that was obtained when the drive was
303 probed. Some of this information is subject to change, and
304 this ioctl does not re-probe the drive to update the
305 information.
254 306
255 Returns information that was obtained when the drive was 307 This information is also available from /proc/ide/hdX/identify
256 probed. Some of this information is subject to change, and
257 this ioctl does not re-probe the drive to update the
258 information.
259 308
260 This information is also available from /proc/ide/hdX/identify
261 309
262 310
311HDIO_GET_KEEPSETTINGS
312 get keep-settings-on-reset flag
263 313
264HDIO_GET_KEEPSETTINGS get keep-settings-on-reset flag
265 314
266 usage: 315 usage::
267 316
268 long val; 317 long val;
318
269 ioctl(fd, HDIO_GET_KEEPSETTINGS, &val); 319 ioctl(fd, HDIO_GET_KEEPSETTINGS, &val);
270 320
271 inputs: none 321 inputs:
322 none
323
324
272 325
273 outputs: 326 outputs:
274 The value of the current "keep settings" flag 327 The value of the current "keep settings" flag
328
329
275 330
276 notes: 331 notes:
332 When set, indicates that kernel should restore settings
333 after a drive reset.
277 334
278 When set, indicates that kernel should restore settings
279 after a drive reset.
280 335
281 336
337HDIO_SET_KEEPSETTINGS
338 keep ioctl settings on reset
282 339
283HDIO_SET_KEEPSETTINGS keep ioctl settings on reset
284 340
285 usage: 341 usage::
286 342
287 long val; 343 long val;
344
288 ioctl(fd, HDIO_SET_KEEPSETTINGS, val); 345 ioctl(fd, HDIO_SET_KEEPSETTINGS, val);
289 346
290 inputs: 347 inputs:
291 New value for keep_settings flag 348 New value for keep_settings flag
349
350
351
352 outputs:
353 none
354
292 355
293 outputs: none
294 356
295 error return: 357 error return:
296 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 358 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
297 EACCES Access denied: requires CAP_SYS_ADMIN 359 - EACCES Access denied: requires CAP_SYS_ADMIN
298 EINVAL value out of range [0 1] 360 - EINVAL value out of range [0 1]
299 EBUSY Controller busy 361 - EBUSY Controller busy
362
300 363
301 364
365HDIO_GET_32BIT
366 get current io_32bit setting
302 367
303HDIO_GET_32BIT get current io_32bit setting
304 368
305 usage: 369 usage::
306 370
307 long val; 371 long val;
372
308 ioctl(fd, HDIO_GET_32BIT, &val); 373 ioctl(fd, HDIO_GET_32BIT, &val);
309 374
310 inputs: none 375 inputs:
376 none
377
378
311 379
312 outputs: 380 outputs:
313 The value of the current io_32bit setting 381 The value of the current io_32bit setting
382
383
314 384
315 notes: 385 notes:
386 0=16-bit, 1=32-bit, 2,3 = 32bit+sync
387
316 388
317 0=16-bit, 1=32-bit, 2,3 = 32bit+sync
318 389
319 390
320 391
321HDIO_GET_NOWERR get ignore-write-error flag 392HDIO_GET_NOWERR
393 get ignore-write-error flag
322 394
323 usage: 395
396 usage::
324 397
325 long val; 398 long val;
399
326 ioctl(fd, HDIO_GET_NOWERR, &val); 400 ioctl(fd, HDIO_GET_NOWERR, &val);
327 401
328 inputs: none 402 inputs:
403 none
404
405
329 406
330 outputs: 407 outputs:
331 The value of the current ignore-write-error flag 408 The value of the current ignore-write-error flag
332 409
333 410
334 411
335HDIO_GET_DMA get use-dma flag
336 412
337 usage: 413
414HDIO_GET_DMA
415 get use-dma flag
416
417
418 usage::
338 419
339 long val; 420 long val;
421
340 ioctl(fd, HDIO_GET_DMA, &val); 422 ioctl(fd, HDIO_GET_DMA, &val);
341 423
342 inputs: none 424 inputs:
425 none
426
427
343 428
344 outputs: 429 outputs:
345 The value of the current use-dma flag 430 The value of the current use-dma flag
346 431
347 432
348 433
349HDIO_GET_NICE get nice flags
350 434
351 usage: 435
436HDIO_GET_NICE
437 get nice flags
438
439
440 usage::
352 441
353 long nice; 442 long nice;
443
354 ioctl(fd, HDIO_GET_NICE, &nice); 444 ioctl(fd, HDIO_GET_NICE, &nice);
355 445
356 inputs: none 446 inputs:
447 none
448
449
357 450
358 outputs: 451 outputs:
452 The drive's "nice" values.
453
359 454
360 The drive's "nice" values.
361 455
362 notes: 456 notes:
457 Per-drive flags which determine when the system will give more
458 bandwidth to other devices sharing the same IDE bus.
363 459
364 Per-drive flags which determine when the system will give more 460 See <linux/hdreg.h>, near symbol IDE_NICE_DSC_OVERLAP.
365 bandwidth to other devices sharing the same IDE bus.
366 See <linux/hdreg.h>, near symbol IDE_NICE_DSC_OVERLAP.
367 461
368 462
369 463
370 464
371HDIO_SET_NICE set nice flags 465HDIO_SET_NICE
466 set nice flags
372 467
373 usage: 468
469 usage::
374 470
375 unsigned long nice; 471 unsigned long nice;
472
376 ... 473 ...
377 ioctl(fd, HDIO_SET_NICE, nice); 474 ioctl(fd, HDIO_SET_NICE, nice);
378 475
379 inputs: 476 inputs:
380 bitmask of nice flags. 477 bitmask of nice flags.
478
479
480
481 outputs:
482 none
483
381 484
382 outputs: none
383 485
384 error returns: 486 error returns:
385 EACCES Access denied: requires CAP_SYS_ADMIN 487 - EACCES Access denied: requires CAP_SYS_ADMIN
386 EPERM Flags other than DSC_OVERLAP and NICE_1 set. 488 - EPERM Flags other than DSC_OVERLAP and NICE_1 set.
387 EPERM DSC_OVERLAP specified but not supported by drive 489 - EPERM DSC_OVERLAP specified but not supported by drive
388 490
389 notes: 491 notes:
492 This ioctl sets the DSC_OVERLAP and NICE_1 flags from values
493 provided by the user.
390 494
391 This ioctl sets the DSC_OVERLAP and NICE_1 flags from values 495 Nice flags are listed in <linux/hdreg.h>, starting with
392 provided by the user. 496 IDE_NICE_DSC_OVERLAP. These values represent shifts.
393 497
394 Nice flags are listed in <linux/hdreg.h>, starting with
395 IDE_NICE_DSC_OVERLAP. These values represent shifts.
396 498
397 499
398 500
399 501
502HDIO_GET_WCACHE
503 get write cache mode on|off
400 504
401HDIO_GET_WCACHE get write cache mode on|off
402 505
403 usage: 506 usage::
404 507
405 long val; 508 long val;
509
406 ioctl(fd, HDIO_GET_WCACHE, &val); 510 ioctl(fd, HDIO_GET_WCACHE, &val);
407 511
408 inputs: none 512 inputs:
513 none
514
515
409 516
410 outputs: 517 outputs:
411 The value of the current write cache mode 518 The value of the current write cache mode
412 519
413 520
414 521
415HDIO_GET_ACOUSTIC get acoustic value
416 522
417 usage: 523
524HDIO_GET_ACOUSTIC
525 get acoustic value
526
527
528 usage::
418 529
419 long val; 530 long val;
531
420 ioctl(fd, HDIO_GET_ACOUSTIC, &val); 532 ioctl(fd, HDIO_GET_ACOUSTIC, &val);
421 533
422 inputs: none 534 inputs:
535 none
536
537
423 538
424 outputs: 539 outputs:
425 The value of the current acoustic settings 540 The value of the current acoustic settings
541
542
426 543
427 notes: 544 notes:
545 See HDIO_SET_ACOUSTIC
546
428 547
429 See HDIO_SET_ACOUSTIC
430 548
431 549
432 550
433HDIO_GET_ADDRESS 551HDIO_GET_ADDRESS
552 usage::
434 553
435 usage:
436 554
437 long val; 555 long val;
556
438 ioctl(fd, HDIO_GET_ADDRESS, &val); 557 ioctl(fd, HDIO_GET_ADDRESS, &val);
439 558
440 inputs: none 559 inputs:
560 none
561
562
441 563
442 outputs: 564 outputs:
443 The value of the current addressing mode: 565 The value of the current addressing mode:
444 0 = 28-bit 566
445 1 = 48-bit 567 = ===================
446 2 = 48-bit doing 28-bit 568 0 28-bit
447 3 = 64-bit 569 1 48-bit
570 2 48-bit doing 28-bit
571 3 64-bit
572 = ===================
448 573
449 574
450 575
451HDIO_GET_BUSSTATE get the bus state of the hwif 576HDIO_GET_BUSSTATE
577 get the bus state of the hwif
452 578
453 usage: 579
580 usage::
454 581
455 long state; 582 long state;
583
456 ioctl(fd, HDIO_SCAN_HWIF, &state); 584 ioctl(fd, HDIO_SCAN_HWIF, &state);
457 585
458 inputs: none 586 inputs:
587 none
588
589
459 590
460 outputs: 591 outputs:
461 Current power state of the IDE bus. One of BUSSTATE_OFF, 592 Current power state of the IDE bus. One of BUSSTATE_OFF,
462 BUSSTATE_ON, or BUSSTATE_TRISTATE 593 BUSSTATE_ON, or BUSSTATE_TRISTATE
463 594
464 error returns: 595 error returns:
465 EACCES Access denied: requires CAP_SYS_ADMIN 596 - EACCES Access denied: requires CAP_SYS_ADMIN
466 597
467 598
468 599
469 600
470HDIO_SET_BUSSTATE set the bus state of the hwif 601HDIO_SET_BUSSTATE
602 set the bus state of the hwif
471 603
472 usage: 604
605 usage::
473 606
474 int state; 607 int state;
608
475 ... 609 ...
476 ioctl(fd, HDIO_SCAN_HWIF, state); 610 ioctl(fd, HDIO_SCAN_HWIF, state);
477 611
478 inputs: 612 inputs:
479 Desired IDE power state. One of BUSSTATE_OFF, BUSSTATE_ON, 613 Desired IDE power state. One of BUSSTATE_OFF, BUSSTATE_ON,
480 or BUSSTATE_TRISTATE 614 or BUSSTATE_TRISTATE
615
616 outputs:
617 none
618
481 619
482 outputs: none
483 620
484 error returns: 621 error returns:
485 EACCES Access denied: requires CAP_SYS_RAWIO 622 - EACCES Access denied: requires CAP_SYS_RAWIO
486 EOPNOTSUPP Hardware interface does not support bus power control 623 - EOPNOTSUPP Hardware interface does not support bus power control
624
487 625
488 626
489 627
628HDIO_TRISTATE_HWIF
629 execute a channel tristate
490 630
491HDIO_TRISTATE_HWIF execute a channel tristate
492 631
493 Not implemented, as of 2.6.8.1. See HDIO_SET_BUSSTATE 632 Not implemented, as of 2.6.8.1. See HDIO_SET_BUSSTATE
494 633
495 634
496 635
497HDIO_DRIVE_RESET execute a device reset 636HDIO_DRIVE_RESET
637 execute a device reset
638
498 639
499 usage: 640 usage::
500 641
501 int args[3] 642 int args[3]
643
502 ... 644 ...
503 ioctl(fd, HDIO_DRIVE_RESET, args); 645 ioctl(fd, HDIO_DRIVE_RESET, args);
504 646
505 inputs: none 647 inputs:
648 none
649
650
651
652 outputs:
653 none
654
506 655
507 outputs: none
508 656
509 error returns: 657 error returns:
510 EACCES Access denied: requires CAP_SYS_ADMIN 658 - EACCES Access denied: requires CAP_SYS_ADMIN
511 ENXIO No such device: phy dead or ctl_addr == 0 659 - ENXIO No such device: phy dead or ctl_addr == 0
512 EIO I/O error: reset timed out or hardware error 660 - EIO I/O error: reset timed out or hardware error
513 661
514 notes: 662 notes:
515 663
516 Execute a reset on the device as soon as the current IO 664 - Execute a reset on the device as soon as the current IO
517 operation has completed. 665 operation has completed.
518 666
519 Executes an ATAPI soft reset if applicable, otherwise 667 - Executes an ATAPI soft reset if applicable, otherwise
520 executes an ATA soft reset on the controller. 668 executes an ATA soft reset on the controller.
521 669
522 670
523 671
524HDIO_DRIVE_TASKFILE execute raw taskfile 672HDIO_DRIVE_TASKFILE
673 execute raw taskfile
525 674
526 Note: If you don't have a copy of the ANSI ATA specification
527 handy, you should probably ignore this ioctl.
528 675
529 Execute an ATA disk command directly by writing the "taskfile" 676 Note:
530 registers of the drive. Requires ADMIN and RAWIO access 677 If you don't have a copy of the ANSI ATA specification
531 privileges. 678 handy, you should probably ignore this ioctl.
679
680 - Execute an ATA disk command directly by writing the "taskfile"
681 registers of the drive. Requires ADMIN and RAWIO access
682 privileges.
532 683
533 usage: 684 usage::
534 685
535 struct { 686 struct {
687
536 ide_task_request_t req_task; 688 ide_task_request_t req_task;
537 u8 outbuf[OUTPUT_SIZE]; 689 u8 outbuf[OUTPUT_SIZE];
538 u8 inbuf[INPUT_SIZE]; 690 u8 inbuf[INPUT_SIZE];
@@ -548,6 +700,7 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
548 700
549 (See below for details on memory area passed to ioctl.) 701 (See below for details on memory area passed to ioctl.)
550 702
703 ============ ===================================================
551 io_ports[8] values to be written to taskfile registers 704 io_ports[8] values to be written to taskfile registers
552 hob_ports[8] high-order bytes, for extended commands. 705 hob_ports[8] high-order bytes, for extended commands.
553 out_flags flags indicating which registers are valid 706 out_flags flags indicating which registers are valid
@@ -557,24 +710,29 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
557 out_size size of output buffer 710 out_size size of output buffer
558 outbuf buffer of data to be transmitted to disk 711 outbuf buffer of data to be transmitted to disk
559 inbuf buffer of data to be received from disk (see [1]) 712 inbuf buffer of data to be received from disk (see [1])
713 ============ ===================================================
560 714
561 outputs: 715 outputs:
562 716
717 =========== ====================================================
563 io_ports[] values returned in the taskfile registers 718 io_ports[] values returned in the taskfile registers
564 hob_ports[] high-order bytes, for extended commands. 719 hob_ports[] high-order bytes, for extended commands.
565 out_flags flags indicating which registers are valid (see [2]) 720 out_flags flags indicating which registers are valid (see [2])
566 in_flags flags indicating which registers should be returned 721 in_flags flags indicating which registers should be returned
567 outbuf buffer of data to be transmitted to disk (see [1]) 722 outbuf buffer of data to be transmitted to disk (see [1])
568 inbuf buffer of data to be received from disk 723 inbuf buffer of data to be received from disk
724 =========== ====================================================
569 725
570 error returns: 726 error returns:
571 EACCES CAP_SYS_ADMIN or CAP_SYS_RAWIO privilege not set. 727 - EACCES CAP_SYS_ADMIN or CAP_SYS_RAWIO privilege not set.
572 ENOMSG Device is not a disk drive. 728 - ENOMSG Device is not a disk drive.
573 ENOMEM Unable to allocate memory for task 729 - ENOMEM Unable to allocate memory for task
574 EFAULT req_cmd == TASKFILE_IN_OUT (not implemented as of 2.6.8) 730 - EFAULT req_cmd == TASKFILE_IN_OUT (not implemented as of 2.6.8)
575 EPERM req_cmd == TASKFILE_MULTI_OUT and drive 731 - EPERM
576 multi-count not yet set. 732
577 EIO Drive failed the command. 733 req_cmd == TASKFILE_MULTI_OUT and drive
734 multi-count not yet set.
735 - EIO Drive failed the command.
578 736
579 notes: 737 notes:
580 738
@@ -615,22 +773,25 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
615 Command is passed to the disk drive via the ide_task_request_t 773 Command is passed to the disk drive via the ide_task_request_t
616 structure, which contains these fields: 774 structure, which contains these fields:
617 775
776 ============ ===============================================
618 io_ports[8] values for the taskfile registers 777 io_ports[8] values for the taskfile registers
619 hob_ports[8] high-order bytes, for extended commands 778 hob_ports[8] high-order bytes, for extended commands
620 out_flags flags indicating which entries in the 779 out_flags flags indicating which entries in the
621 io_ports[] and hob_ports[] arrays 780 io_ports[] and hob_ports[] arrays
622 contain valid values. Type ide_reg_valid_t. 781 contain valid values. Type ide_reg_valid_t.
623 in_flags flags indicating which entries in the 782 in_flags flags indicating which entries in the
624 io_ports[] and hob_ports[] arrays 783 io_ports[] and hob_ports[] arrays
625 are expected to contain valid values 784 are expected to contain valid values
626 on return. 785 on return.
627 data_phase See below 786 data_phase See below
628 req_cmd Command type, see below 787 req_cmd Command type, see below
629 out_size output (user->drive) buffer size, bytes 788 out_size output (user->drive) buffer size, bytes
630 in_size input (drive->user) buffer size, bytes 789 in_size input (drive->user) buffer size, bytes
790 ============ ===============================================
631 791
632 When out_flags is zero, the following registers are loaded. 792 When out_flags is zero, the following registers are loaded.
633 793
794 ============ ===============================================
634 HOB_FEATURE If the drive supports LBA48 795 HOB_FEATURE If the drive supports LBA48
635 HOB_NSECTOR If the drive supports LBA48 796 HOB_NSECTOR If the drive supports LBA48
636 HOB_SECTOR If the drive supports LBA48 797 HOB_SECTOR If the drive supports LBA48
@@ -644,9 +805,11 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
644 SELECT First, masked with 0xE0 if LBA48, 0xEF 805 SELECT First, masked with 0xE0 if LBA48, 0xEF
645 otherwise; then, or'ed with the default 806 otherwise; then, or'ed with the default
646 value of SELECT. 807 value of SELECT.
808 ============ ===============================================
647 809
648 If any bit in out_flags is set, the following registers are loaded. 810 If any bit in out_flags is set, the following registers are loaded.
649 811
812 ============ ===============================================
650 HOB_DATA If out_flags.b.data is set. HOB_DATA will 813 HOB_DATA If out_flags.b.data is set. HOB_DATA will
651 travel on DD8-DD15 on little endian machines 814 travel on DD8-DD15 on little endian machines
652 and on DD0-DD7 on big endian machines. 815 and on DD0-DD7 on big endian machines.
@@ -664,6 +827,7 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
664 HCYL If out_flags.b.hcyl is set 827 HCYL If out_flags.b.hcyl is set
665 SELECT Or'ed with the default value of SELECT and 828 SELECT Or'ed with the default value of SELECT and
666 loaded regardless of out_flags.b.select. 829 loaded regardless of out_flags.b.select.
830 ============ ===============================================
667 831
668 Taskfile registers are read back from the drive into 832 Taskfile registers are read back from the drive into
669 {io|hob}_ports[] after the command completes iff one of the 833 {io|hob}_ports[] after the command completes iff one of the
@@ -674,6 +838,7 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
674 2. One or more than one bits are set in out_flags. 838 2. One or more than one bits are set in out_flags.
675 3. The requested data_phase is TASKFILE_NO_DATA. 839 3. The requested data_phase is TASKFILE_NO_DATA.
676 840
841 ============ ===============================================
677 HOB_DATA If in_flags.b.data is set. It will contain 842 HOB_DATA If in_flags.b.data is set. It will contain
678 DD8-DD15 on little endian machines and 843 DD8-DD15 on little endian machines and
679 DD0-DD7 on big endian machines. 844 DD0-DD7 on big endian machines.
@@ -689,10 +854,12 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
689 SECTOR 854 SECTOR
690 LCYL 855 LCYL
691 HCYL 856 HCYL
857 ============ ===============================================
692 858
693 The data_phase field describes the data transfer to be 859 The data_phase field describes the data transfer to be
694 performed. Value is one of: 860 performed. Value is one of:
695 861
862 =================== ========================================
696 TASKFILE_IN 863 TASKFILE_IN
697 TASKFILE_MULTI_IN 864 TASKFILE_MULTI_IN
698 TASKFILE_OUT 865 TASKFILE_OUT
@@ -708,15 +875,18 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
708 TASKFILE_P_OUT unimplemented 875 TASKFILE_P_OUT unimplemented
709 TASKFILE_P_OUT_DMA unimplemented 876 TASKFILE_P_OUT_DMA unimplemented
710 TASKFILE_P_OUT_DMAQ unimplemented 877 TASKFILE_P_OUT_DMAQ unimplemented
878 =================== ========================================
711 879
712 The req_cmd field classifies the command type. It may be 880 The req_cmd field classifies the command type. It may be
713 one of: 881 one of:
714 882
883 ======================== =======================================
715 IDE_DRIVE_TASK_NO_DATA 884 IDE_DRIVE_TASK_NO_DATA
716 IDE_DRIVE_TASK_SET_XFER unimplemented 885 IDE_DRIVE_TASK_SET_XFER unimplemented
717 IDE_DRIVE_TASK_IN 886 IDE_DRIVE_TASK_IN
718 IDE_DRIVE_TASK_OUT unimplemented 887 IDE_DRIVE_TASK_OUT unimplemented
719 IDE_DRIVE_TASK_RAW_WRITE 888 IDE_DRIVE_TASK_RAW_WRITE
889 ======================== =======================================
720 890
721 [6] Do not access {in|out}_flags->all except for resetting 891 [6] Do not access {in|out}_flags->all except for resetting
722 all the bits. Always access individual bit fields. ->all 892 all the bits. Always access individual bit fields. ->all
@@ -726,45 +896,57 @@ HDIO_DRIVE_TASKFILE execute raw taskfile
726 896
727 897
728 898
729HDIO_DRIVE_CMD execute a special drive command 899HDIO_DRIVE_CMD
900 execute a special drive command
901
730 902
731 Note: If you don't have a copy of the ANSI ATA specification 903 Note: If you don't have a copy of the ANSI ATA specification
732 handy, you should probably ignore this ioctl. 904 handy, you should probably ignore this ioctl.
733 905
734 usage: 906 usage::
735 907
736 u8 args[4+XFER_SIZE]; 908 u8 args[4+XFER_SIZE];
909
737 ... 910 ...
738 ioctl(fd, HDIO_DRIVE_CMD, args); 911 ioctl(fd, HDIO_DRIVE_CMD, args);
739 912
740 inputs: 913 inputs:
914 Commands other than WIN_SMART:
741 915
742 Commands other than WIN_SMART 916 ======= =======
743 args[0] COMMAND 917 args[0] COMMAND
744 args[1] NSECTOR 918 args[1] NSECTOR
745 args[2] FEATURE 919 args[2] FEATURE
746 args[3] NSECTOR 920 args[3] NSECTOR
921 ======= =======
922
923 WIN_SMART:
747 924
748 WIN_SMART 925 ======= =======
749 args[0] COMMAND 926 args[0] COMMAND
750 args[1] SECTOR 927 args[1] SECTOR
751 args[2] FEATURE 928 args[2] FEATURE
752 args[3] NSECTOR 929 args[3] NSECTOR
930 ======= =======
753 931
754 outputs: 932 outputs:
933 args[] buffer is filled with register values followed by any
934
755 935
756 args[] buffer is filled with register values followed by any
757 data returned by the disk. 936 data returned by the disk.
937
938 ======== ====================================================
758 args[0] status 939 args[0] status
759 args[1] error 940 args[1] error
760 args[2] NSECTOR 941 args[2] NSECTOR
761 args[3] undefined 942 args[3] undefined
762 args[4+] NSECTOR * 512 bytes of data returned by the command. 943 args[4+] NSECTOR * 512 bytes of data returned by the command.
944 ======== ====================================================
763 945
764 error returns: 946 error returns:
765 EACCES Access denied: requires CAP_SYS_RAWIO 947 - EACCES Access denied: requires CAP_SYS_RAWIO
766 ENOMEM Unable to allocate memory for task 948 - ENOMEM Unable to allocate memory for task
767 EIO Drive reports error 949 - EIO Drive reports error
768 950
769 notes: 951 notes:
770 952
@@ -789,20 +971,24 @@ HDIO_DRIVE_CMD execute a special drive command
789 971
790 972
791 973
792HDIO_DRIVE_TASK execute task and special drive command 974HDIO_DRIVE_TASK
975 execute task and special drive command
976
793 977
794 Note: If you don't have a copy of the ANSI ATA specification 978 Note: If you don't have a copy of the ANSI ATA specification
795 handy, you should probably ignore this ioctl. 979 handy, you should probably ignore this ioctl.
796 980
797 usage: 981 usage::
798 982
799 u8 args[7]; 983 u8 args[7];
984
800 ... 985 ...
801 ioctl(fd, HDIO_DRIVE_TASK, args); 986 ioctl(fd, HDIO_DRIVE_TASK, args);
802 987
803 inputs: 988 inputs:
989 Taskfile register values:
804 990
805 Taskfile register values: 991 ======= =======
806 args[0] COMMAND 992 args[0] COMMAND
807 args[1] FEATURE 993 args[1] FEATURE
808 args[2] NSECTOR 994 args[2] NSECTOR
@@ -810,10 +996,13 @@ HDIO_DRIVE_TASK execute task and special drive command
810 args[4] LCYL 996 args[4] LCYL
811 args[5] HCYL 997 args[5] HCYL
812 args[6] SELECT 998 args[6] SELECT
999 ======= =======
813 1000
814 outputs: 1001 outputs:
1002 Taskfile register values:
1003
815 1004
816 Taskfile register values: 1005 ======= =======
817 args[0] status 1006 args[0] status
818 args[1] error 1007 args[1] error
819 args[2] NSECTOR 1008 args[2] NSECTOR
@@ -821,12 +1010,13 @@ HDIO_DRIVE_TASK execute task and special drive command
821 args[4] LCYL 1010 args[4] LCYL
822 args[5] HCYL 1011 args[5] HCYL
823 args[6] SELECT 1012 args[6] SELECT
1013 ======= =======
824 1014
825 error returns: 1015 error returns:
826 EACCES Access denied: requires CAP_SYS_RAWIO 1016 - EACCES Access denied: requires CAP_SYS_RAWIO
827 ENOMEM Unable to allocate memory for task 1017 - ENOMEM Unable to allocate memory for task
828 ENOMSG Device is not a disk drive. 1018 - ENOMSG Device is not a disk drive.
829 EIO Drive failed the command. 1019 - EIO Drive failed the command.
830 1020
831 notes: 1021 notes:
832 1022
@@ -836,236 +1026,317 @@ HDIO_DRIVE_TASK execute task and special drive command
836 1026
837 1027
838 1028
839HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK 1029HDIO_DRIVE_CMD_AEB
1030 HDIO_DRIVE_TASK
1031
840 1032
841 Not implemented, as of 2.6.8.1 1033 Not implemented, as of 2.6.8.1
842 1034
843 1035
844 1036
845HDIO_SET_32BIT change io_32bit flags 1037HDIO_SET_32BIT
1038 change io_32bit flags
1039
846 1040
847 usage: 1041 usage::
848 1042
849 int val; 1043 int val;
1044
850 ioctl(fd, HDIO_SET_32BIT, val); 1045 ioctl(fd, HDIO_SET_32BIT, val);
851 1046
852 inputs: 1047 inputs:
853 New value for io_32bit flag 1048 New value for io_32bit flag
1049
1050
1051
1052 outputs:
1053 none
1054
854 1055
855 outputs: none
856 1056
857 error return: 1057 error return:
858 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1058 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
859 EACCES Access denied: requires CAP_SYS_ADMIN 1059 - EACCES Access denied: requires CAP_SYS_ADMIN
860 EINVAL value out of range [0 3] 1060 - EINVAL value out of range [0 3]
861 EBUSY Controller busy 1061 - EBUSY Controller busy
862 1062
863 1063
864 1064
865 1065
866HDIO_SET_NOWERR change ignore-write-error flag 1066HDIO_SET_NOWERR
1067 change ignore-write-error flag
867 1068
868 usage: 1069
1070 usage::
869 1071
870 int val; 1072 int val;
1073
871 ioctl(fd, HDIO_SET_NOWERR, val); 1074 ioctl(fd, HDIO_SET_NOWERR, val);
872 1075
873 inputs: 1076 inputs:
874 New value for ignore-write-error flag. Used for ignoring 1077 New value for ignore-write-error flag. Used for ignoring
1078
1079
875 WRERR_STAT 1080 WRERR_STAT
876 1081
877 outputs: none 1082 outputs:
1083 none
1084
1085
878 1086
879 error return: 1087 error return:
880 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1088 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
881 EACCES Access denied: requires CAP_SYS_ADMIN 1089 - EACCES Access denied: requires CAP_SYS_ADMIN
882 EINVAL value out of range [0 1] 1090 - EINVAL value out of range [0 1]
883 EBUSY Controller busy 1091 - EBUSY Controller busy
1092
884 1093
885 1094
1095HDIO_SET_DMA
1096 change use-dma flag
886 1097
887HDIO_SET_DMA change use-dma flag
888 1098
889 usage: 1099 usage::
890 1100
891 long val; 1101 long val;
1102
892 ioctl(fd, HDIO_SET_DMA, val); 1103 ioctl(fd, HDIO_SET_DMA, val);
893 1104
894 inputs: 1105 inputs:
895 New value for use-dma flag 1106 New value for use-dma flag
1107
1108
1109
1110 outputs:
1111 none
1112
896 1113
897 outputs: none
898 1114
899 error return: 1115 error return:
900 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1116 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
901 EACCES Access denied: requires CAP_SYS_ADMIN 1117 - EACCES Access denied: requires CAP_SYS_ADMIN
902 EINVAL value out of range [0 1] 1118 - EINVAL value out of range [0 1]
903 EBUSY Controller busy 1119 - EBUSY Controller busy
1120
904 1121
905 1122
1123HDIO_SET_PIO_MODE
1124 reconfig interface to new speed
906 1125
907HDIO_SET_PIO_MODE reconfig interface to new speed
908 1126
909 usage: 1127 usage::
910 1128
911 long val; 1129 long val;
1130
912 ioctl(fd, HDIO_SET_PIO_MODE, val); 1131 ioctl(fd, HDIO_SET_PIO_MODE, val);
913 1132
914 inputs: 1133 inputs:
915 New interface speed. 1134 New interface speed.
1135
1136
1137
1138 outputs:
1139 none
1140
916 1141
917 outputs: none
918 1142
919 error return: 1143 error return:
920 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1144 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
921 EACCES Access denied: requires CAP_SYS_ADMIN 1145 - EACCES Access denied: requires CAP_SYS_ADMIN
922 EINVAL value out of range [0 255] 1146 - EINVAL value out of range [0 255]
923 EBUSY Controller busy 1147 - EBUSY Controller busy
1148
924 1149
925 1150
1151HDIO_SCAN_HWIF
1152 register and (re)scan interface
926 1153
927HDIO_SCAN_HWIF register and (re)scan interface
928 1154
929 usage: 1155 usage::
930 1156
931 int args[3] 1157 int args[3]
1158
932 ... 1159 ...
933 ioctl(fd, HDIO_SCAN_HWIF, args); 1160 ioctl(fd, HDIO_SCAN_HWIF, args);
934 1161
935 inputs: 1162 inputs:
1163
1164 ======= =========================
936 args[0] io address to probe 1165 args[0] io address to probe
1166
1167
937 args[1] control address to probe 1168 args[1] control address to probe
938 args[2] irq number 1169 args[2] irq number
1170 ======= =========================
1171
1172 outputs:
1173 none
1174
939 1175
940 outputs: none
941 1176
942 error returns: 1177 error returns:
943 EACCES Access denied: requires CAP_SYS_RAWIO 1178 - EACCES Access denied: requires CAP_SYS_RAWIO
944 EIO Probe failed. 1179 - EIO Probe failed.
945 1180
946 notes: 1181 notes:
1182 This ioctl initializes the addresses and irq for a disk
1183 controller, probes for drives, and creates /proc/ide
1184 interfaces as appropriate.
947 1185
948 This ioctl initializes the addresses and irq for a disk
949 controller, probes for drives, and creates /proc/ide
950 interfaces as appropriate.
951 1186
952 1187
1188HDIO_UNREGISTER_HWIF
1189 unregister interface
953 1190
954HDIO_UNREGISTER_HWIF unregister interface
955 1191
956 usage: 1192 usage::
957 1193
958 int index; 1194 int index;
1195
959 ioctl(fd, HDIO_UNREGISTER_HWIF, index); 1196 ioctl(fd, HDIO_UNREGISTER_HWIF, index);
960 1197
961 inputs: 1198 inputs:
962 index index of hardware interface to unregister 1199 index index of hardware interface to unregister
1200
1201
1202
1203 outputs:
1204 none
1205
963 1206
964 outputs: none
965 1207
966 error returns: 1208 error returns:
967 EACCES Access denied: requires CAP_SYS_RAWIO 1209 - EACCES Access denied: requires CAP_SYS_RAWIO
968 1210
969 notes: 1211 notes:
1212 This ioctl removes a hardware interface from the kernel.
970 1213
971 This ioctl removes a hardware interface from the kernel. 1214 Currently (2.6.8) this ioctl silently fails if any drive on
1215 the interface is busy.
972 1216
973 Currently (2.6.8) this ioctl silently fails if any drive on
974 the interface is busy.
975 1217
976 1218
1219HDIO_SET_WCACHE
1220 change write cache enable-disable
977 1221
978HDIO_SET_WCACHE change write cache enable-disable
979 1222
980 usage: 1223 usage::
981 1224
982 int val; 1225 int val;
1226
983 ioctl(fd, HDIO_SET_WCACHE, val); 1227 ioctl(fd, HDIO_SET_WCACHE, val);
984 1228
985 inputs: 1229 inputs:
986 New value for write cache enable 1230 New value for write cache enable
1231
1232
1233
1234 outputs:
1235 none
1236
987 1237
988 outputs: none
989 1238
990 error return: 1239 error return:
991 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1240 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
992 EACCES Access denied: requires CAP_SYS_ADMIN 1241 - EACCES Access denied: requires CAP_SYS_ADMIN
993 EINVAL value out of range [0 1] 1242 - EINVAL value out of range [0 1]
994 EBUSY Controller busy 1243 - EBUSY Controller busy
1244
995 1245
996 1246
1247HDIO_SET_ACOUSTIC
1248 change acoustic behavior
997 1249
998HDIO_SET_ACOUSTIC change acoustic behavior
999 1250
1000 usage: 1251 usage::
1001 1252
1002 int val; 1253 int val;
1254
1003 ioctl(fd, HDIO_SET_ACOUSTIC, val); 1255 ioctl(fd, HDIO_SET_ACOUSTIC, val);
1004 1256
1005 inputs: 1257 inputs:
1006 New value for drive acoustic settings 1258 New value for drive acoustic settings
1259
1260
1261
1262 outputs:
1263 none
1264
1007 1265
1008 outputs: none
1009 1266
1010 error return: 1267 error return:
1011 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1268 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
1012 EACCES Access denied: requires CAP_SYS_ADMIN 1269 - EACCES Access denied: requires CAP_SYS_ADMIN
1013 EINVAL value out of range [0 254] 1270 - EINVAL value out of range [0 254]
1014 EBUSY Controller busy 1271 - EBUSY Controller busy
1015 1272
1016 1273
1017 1274
1018HDIO_SET_QDMA change use-qdma flag 1275HDIO_SET_QDMA
1276 change use-qdma flag
1277
1019 1278
1020 Not implemented, as of 2.6.8.1 1279 Not implemented, as of 2.6.8.1
1021 1280
1022 1281
1023 1282
1024HDIO_SET_ADDRESS change lba addressing modes 1283HDIO_SET_ADDRESS
1284 change lba addressing modes
1285
1025 1286
1026 usage: 1287 usage::
1027 1288
1028 int val; 1289 int val;
1290
1029 ioctl(fd, HDIO_SET_ADDRESS, val); 1291 ioctl(fd, HDIO_SET_ADDRESS, val);
1030 1292
1031 inputs: 1293 inputs:
1032 New value for addressing mode 1294 New value for addressing mode
1033 0 = 28-bit 1295
1034 1 = 48-bit 1296 = ===================
1035 2 = 48-bit doing 28-bit 1297 0 28-bit
1298 1 48-bit
1299 2 48-bit doing 28-bit
1300 = ===================
1301
1302 outputs:
1303 none
1304
1036 1305
1037 outputs: none
1038 1306
1039 error return: 1307 error return:
1040 EINVAL (bdev != bdev->bd_contains) (not sure what this means) 1308 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
1041 EACCES Access denied: requires CAP_SYS_ADMIN 1309 - EACCES Access denied: requires CAP_SYS_ADMIN
1042 EINVAL value out of range [0 2] 1310 - EINVAL value out of range [0 2]
1043 EBUSY Controller busy 1311 - EBUSY Controller busy
1044 EIO Drive does not support lba48 mode. 1312 - EIO Drive does not support lba48 mode.
1045 1313
1046 1314
1047HDIO_SET_IDE_SCSI 1315HDIO_SET_IDE_SCSI
1316 usage::
1048 1317
1049 usage:
1050 1318
1051 long val; 1319 long val;
1320
1052 ioctl(fd, HDIO_SET_IDE_SCSI, val); 1321 ioctl(fd, HDIO_SET_IDE_SCSI, val);
1053 1322
1054 inputs: 1323 inputs:
1055 New value for scsi emulation mode (?) 1324 New value for scsi emulation mode (?)
1056 1325
1057 outputs: none
1058 1326
1059 error return:
1060 EINVAL (bdev != bdev->bd_contains) (not sure what this means)
1061 EACCES Access denied: requires CAP_SYS_ADMIN
1062 EINVAL value out of range [0 1]
1063 EBUSY Controller busy
1064 1327
1328 outputs:
1329 none
1065 1330
1066 1331
1067HDIO_SET_SCSI_IDE
1068 1332
1069 Not implemented, as of 2.6.8.1 1333 error return:
1334 - EINVAL (bdev != bdev->bd_contains) (not sure what this means)
1335 - EACCES Access denied: requires CAP_SYS_ADMIN
1336 - EINVAL value out of range [0 1]
1337 - EBUSY Controller busy
1070 1338
1071 1339
1340
1341HDIO_SET_SCSI_IDE
1342 Not implemented, as of 2.6.8.1
diff --git a/Documentation/ioctl/index.rst b/Documentation/ioctl/index.rst
new file mode 100644
index 000000000000..0f0a857f6615
--- /dev/null
+++ b/Documentation/ioctl/index.rst
@@ -0,0 +1,16 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3======
4IOCTLs
5======
6
7.. toctree::
8 :maxdepth: 1
9
10 ioctl-number
11
12 botching-up-ioctls
13 ioctl-decoding
14
15 cdrom
16 hdio
diff --git a/Documentation/ioctl/ioctl-decoding.txt b/Documentation/ioctl/ioctl-decoding.rst
index e35efb0cec2e..380d6bb3e3ea 100644
--- a/Documentation/ioctl/ioctl-decoding.txt
+++ b/Documentation/ioctl/ioctl-decoding.rst
@@ -1,10 +1,16 @@
1==============================
2Decoding an IOCTL Magic Number
3==============================
4
1To decode a hex IOCTL code: 5To decode a hex IOCTL code:
2 6
3Most architectures use this generic format, but check 7Most architectures use this generic format, but check
4include/ARCH/ioctl.h for specifics, e.g. powerpc 8include/ARCH/ioctl.h for specifics, e.g. powerpc
5uses 3 bits to encode read/write and 13 bits for size. 9uses 3 bits to encode read/write and 13 bits for size.
6 10
7 bits meaning 11 ====== ==================================
12 bits meaning
13 ====== ==================================
8 31-30 00 - no parameters: uses _IO macro 14 31-30 00 - no parameters: uses _IO macro
9 10 - read: _IOR 15 10 - read: _IOR
10 01 - write: _IOW 16 01 - write: _IOW
@@ -16,9 +22,10 @@ uses 3 bits to encode read/write and 13 bits for size.
16 unique to each driver 22 unique to each driver
17 23
18 7-0 function # 24 7-0 function #
25 ====== ==================================
19 26
20 27
21So for example 0x82187201 is a read with arg length of 0x218, 28So for example 0x82187201 is a read with arg length of 0x218,
22character 'r' function 1. Grepping the source reveals this is: 29character 'r' function 1. Grepping the source reveals this is::
23 30
24#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) 31 #define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
diff --git a/Documentation/ioctl/ioctl-number.rst b/Documentation/ioctl/ioctl-number.rst
new file mode 100644
index 000000000000..7f8dcae7a230
--- /dev/null
+++ b/Documentation/ioctl/ioctl-number.rst
@@ -0,0 +1,361 @@
1=============
2Ioctl Numbers
3=============
4
519 October 1999
6
7Michael Elizabeth Chastain
8<mec@shout.net>
9
10If you are adding new ioctl's to the kernel, you should use the _IO
11macros defined in <linux/ioctl.h>:
12
13 ====== == ============================================
14 _IO an ioctl with no parameters
15 _IOW an ioctl with write parameters (copy_from_user)
16 _IOR an ioctl with read parameters (copy_to_user)
17 _IOWR an ioctl with both write and read parameters.
18 ====== == ============================================
19
20'Write' and 'read' are from the user's point of view, just like the
21system calls 'write' and 'read'. For example, a SET_FOO ioctl would
22be _IOW, although the kernel would actually read data from user space;
23a GET_FOO ioctl would be _IOR, although the kernel would actually write
24data to user space.
25
26The first argument to _IO, _IOW, _IOR, or _IOWR is an identifying letter
27or number from the table below. Because of the large number of drivers,
28many drivers share a partial letter with other drivers.
29
30If you are writing a driver for a new device and need a letter, pick an
31unused block with enough room for expansion: 32 to 256 ioctl commands.
32You can register the block by patching this file and submitting the
33patch to Linus Torvalds. Or you can e-mail me at <mec@shout.net> and
34I'll register one for you.
35
36The second argument to _IO, _IOW, _IOR, or _IOWR is a sequence number
37to distinguish ioctls from each other. The third argument to _IOW,
38_IOR, or _IOWR is the type of the data going into the kernel or coming
39out of the kernel (e.g. 'int' or 'struct foo'). NOTE! Do NOT use
40sizeof(arg) as the third argument as this results in your ioctl thinking
41it passes an argument of type size_t.
42
43Some devices use their major number as the identifier; this is OK, as
44long as it is unique. Some devices are irregular and don't follow any
45convention at all.
46
47Following this convention is good because:
48
49(1) Keeping the ioctl's globally unique helps error checking:
50 if a program calls an ioctl on the wrong device, it will get an
51 error rather than some unexpected behaviour.
52
53(2) The 'strace' build procedure automatically finds ioctl numbers
54 defined with _IO, _IOW, _IOR, or _IOWR.
55
56(3) 'strace' can decode numbers back into useful names when the
57 numbers are unique.
58
59(4) People looking for ioctls can grep for them more easily when
60 this convention is used to define the ioctl numbers.
61
62(5) When following the convention, the driver code can use generic
63 code to copy the parameters between user and kernel space.
64
65This table lists ioctls visible from user land for Linux/x86. It contains
66most drivers up to 2.6.31, but I know I am missing some. There has been
67no attempt to list non-X86 architectures or ioctls from drivers/staging/.
68
69==== ===== ======================================================= ================================================================
70Code Seq# Include File Comments
71 (hex)
72==== ===== ======================================================= ================================================================
730x00 00-1F linux/fs.h conflict!
740x00 00-1F scsi/scsi_ioctl.h conflict!
750x00 00-1F linux/fb.h conflict!
760x00 00-1F linux/wavefront.h conflict!
770x02 all linux/fd.h
780x03 all linux/hdreg.h
790x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
800x06 all linux/lp.h
810x09 all linux/raid/md_u.h
820x10 00-0F drivers/char/s390/vmcp.h
830x10 10-1F arch/s390/include/uapi/sclp_ctl.h
840x10 20-2F arch/s390/include/uapi/asm/hypfs.h
850x12 all linux/fs.h
86 linux/blkpg.h
870x1b all InfiniBand Subsystem
88 <http://infiniband.sourceforge.net/>
890x20 all drivers/cdrom/cm206.h
900x22 all scsi/sg.h
91'!' 00-1F uapi/linux/seccomp.h
92'#' 00-3F IEEE 1394 Subsystem
93 Block for the entire subsystem
94'$' 00-0F linux/perf_counter.h, linux/perf_event.h
95'%' 00-0F include/uapi/linux/stm.h System Trace Module subsystem
96 <mailto:alexander.shishkin@linux.intel.com>
97'&' 00-07 drivers/firewire/nosy-user.h
98'1' 00-1F linux/timepps.h PPS kit from Ulrich Windl
99 <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
100'2' 01-04 linux/i2o.h
101'3' 00-0F drivers/s390/char/raw3270.h conflict!
102'3' 00-1F linux/suspend_ioctls.h, conflict!
103 kernel/power/user.c
104'8' all SNP8023 advanced NIC card
105 <mailto:mcr@solidum.com>
106';' 64-7F linux/vfio.h
107'@' 00-0F linux/radeonfb.h conflict!
108'@' 00-0F drivers/video/aty/aty128fb.c conflict!
109'A' 00-1F linux/apm_bios.h conflict!
110'A' 00-0F linux/agpgart.h, conflict!
111 drivers/char/agp/compat_ioctl.h
112'A' 00-7F sound/asound.h conflict!
113'B' 00-1F linux/cciss_ioctl.h conflict!
114'B' 00-0F include/linux/pmu.h conflict!
115'B' C0-FF advanced bbus <mailto:maassen@uni-freiburg.de>
116'C' all linux/soundcard.h conflict!
117'C' 01-2F linux/capi.h conflict!
118'C' F0-FF drivers/net/wan/cosa.h conflict!
119'D' all arch/s390/include/asm/dasd.h
120'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
121'D' 05 drivers/scsi/pmcraid.h
122'E' all linux/input.h conflict!
123'E' 00-0F xen/evtchn.h conflict!
124'F' all linux/fb.h conflict!
125'F' 01-02 drivers/scsi/pmcraid.h conflict!
126'F' 20 drivers/video/fsl-diu-fb.h conflict!
127'F' 20 drivers/video/intelfb/intelfb.h conflict!
128'F' 20 linux/ivtvfb.h conflict!
129'F' 20 linux/matroxfb.h conflict!
130'F' 20 drivers/video/aty/atyfb_base.c conflict!
131'F' 00-0F video/da8xx-fb.h conflict!
132'F' 80-8F linux/arcfb.h conflict!
133'F' DD video/sstfb.h conflict!
134'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
135'G' 00-0F linux/gigaset_dev.h conflict!
136'H' 00-7F linux/hiddev.h conflict!
137'H' 00-0F linux/hidraw.h conflict!
138'H' 01 linux/mei.h conflict!
139'H' 02 linux/mei.h conflict!
140'H' 03 linux/mei.h conflict!
141'H' 00-0F sound/asound.h conflict!
142'H' 20-40 sound/asound_fm.h conflict!
143'H' 80-8F sound/sfnt_info.h conflict!
144'H' 10-8F sound/emu10k1.h conflict!
145'H' 10-1F sound/sb16_csp.h conflict!
146'H' 10-1F sound/hda_hwdep.h conflict!
147'H' 40-4F sound/hdspm.h conflict!
148'H' 40-4F sound/hdsp.h conflict!
149'H' 90 sound/usb/usx2y/usb_stream.h
150'H' A0 uapi/linux/usb/cdc-wdm.h
151'H' C0-F0 net/bluetooth/hci.h conflict!
152'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
153'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
154'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
155'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net>
156'H' F8-FA sound/firewire.h
157'I' all linux/isdn.h conflict!
158'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
159'I' 40-4F linux/mISDNif.h conflict!
160'J' 00-1F drivers/scsi/gdth_ioctl.h
161'K' all linux/kd.h
162'L' 00-1F linux/loop.h conflict!
163'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
164'L' 20-2F linux/lightnvm.h
165'L' E0-FF linux/ppdd.h encrypted disk device driver
166 <http://linux01.gwdg.de/~alatham/ppdd.html>
167'M' all linux/soundcard.h conflict!
168'M' 01-16 mtd/mtd-abi.h conflict!
169 and drivers/mtd/mtdchar.c
170'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
171'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
172'N' 00-1F drivers/usb/scanner.h
173'N' 40-7F drivers/block/nvme.c
174'O' 00-06 mtd/ubi-user.h UBI
175'P' all linux/soundcard.h conflict!
176'P' 60-6F sound/sscape_ioctl.h conflict!
177'P' 00-0F drivers/usb/class/usblp.c conflict!
178'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
179'Q' all linux/soundcard.h
180'R' 00-1F linux/random.h conflict!
181'R' 01 linux/rfkill.h conflict!
182'R' C0-DF net/bluetooth/rfcomm.h
183'S' all linux/cdrom.h conflict!
184'S' 80-81 scsi/scsi_ioctl.h conflict!
185'S' 82-FF scsi/scsi.h conflict!
186'S' 00-7F sound/asequencer.h conflict!
187'T' all linux/soundcard.h conflict!
188'T' 00-AF sound/asound.h conflict!
189'T' all arch/x86/include/asm/ioctls.h conflict!
190'T' C0-DF linux/if_tun.h conflict!
191'U' all sound/asound.h conflict!
192'U' 00-CF linux/uinput.h conflict!
193'U' 00-EF linux/usbdevice_fs.h
194'U' C0-CF drivers/bluetooth/hci_uart.h
195'V' all linux/vt.h conflict!
196'V' all linux/videodev2.h conflict!
197'V' C0 linux/ivtvfb.h conflict!
198'V' C0 linux/ivtv.h conflict!
199'V' C0 media/davinci/vpfe_capture.h conflict!
200'V' C0 media/si4713.h conflict!
201'W' 00-1F linux/watchdog.h conflict!
202'W' 00-1F linux/wanrouter.h conflict! (pre 3.9)
203'W' 00-3F sound/asound.h conflict!
204'W' 40-5F drivers/pci/switch/switchtec.c
205'X' all fs/xfs/xfs_fs.h, conflict!
206 fs/xfs/linux-2.6/xfs_ioctl32.h,
207 include/linux/falloc.h,
208 linux/fs.h,
209'X' all fs/ocfs2/ocfs_fs.h conflict!
210'X' 01 linux/pktcdvd.h conflict!
211'Y' all linux/cyclades.h
212'Z' 14-15 drivers/message/fusion/mptctl.h
213'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
214 <mailto:gregkh@linuxfoundation.org>
215'a' all linux/atm*.h, linux/sonet.h ATM on linux
216 <http://lrcwww.epfl.ch/>
217'a' 00-0F drivers/crypto/qat/qat_common/adf_cfg_common.h conflict! qat driver
218'b' 00-FF conflict! bit3 vme host bridge
219 <mailto:natalia@nikhefk.nikhef.nl>
220'c' all linux/cm4000_cs.h conflict!
221'c' 00-7F linux/comstats.h conflict!
222'c' 00-7F linux/coda.h conflict!
223'c' 00-1F linux/chio.h conflict!
224'c' 80-9F arch/s390/include/asm/chsc.h conflict!
225'c' A0-AF arch/x86/include/asm/msr.h conflict!
226'd' 00-FF linux/char/drm/drm.h conflict!
227'd' 02-40 pcmcia/ds.h conflict!
228'd' F0-FF linux/digi1.h
229'e' all linux/digi1.h conflict!
230'f' 00-1F linux/ext2_fs.h conflict!
231'f' 00-1F linux/ext3_fs.h conflict!
232'f' 00-0F fs/jfs/jfs_dinode.h conflict!
233'f' 00-0F fs/ext4/ext4.h conflict!
234'f' 00-0F linux/fs.h conflict!
235'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
236'g' 00-0F linux/usb/gadgetfs.h
237'g' 20-2F linux/usb/g_printer.h
238'h' 00-7F conflict! Charon filesystem
239 <mailto:zapman@interlan.net>
240'h' 00-1F linux/hpet.h conflict!
241'h' 80-8F fs/hfsplus/ioctl.c
242'i' 00-3F linux/i2o-dev.h conflict!
243'i' 0B-1F linux/ipmi.h conflict!
244'i' 80-8F linux/i8k.h
245'j' 00-3F linux/joystick.h
246'k' 00-0F linux/spi/spidev.h conflict!
247'k' 00-05 video/kyro.h conflict!
248'k' 10-17 linux/hsi/hsi_char.h HSI character device
249'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
250 <http://web.archive.org/web/%2A/http://mikonos.dia.unisa.it/tcfs>
251'l' 40-7F linux/udf_fs_i.h in development:
252 <http://sourceforge.net/projects/linux-udf/>
253'm' 00-09 linux/mmtimer.h conflict!
254'm' all linux/mtio.h conflict!
255'm' all linux/soundcard.h conflict!
256'm' all linux/synclink.h conflict!
257'm' 00-19 drivers/message/fusion/mptctl.h conflict!
258'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
259'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
260'n' 80-8F uapi/linux/nilfs2_api.h NILFS2
261'n' E0-FF linux/matroxfb.h matroxfb
262'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
263'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
264'o' 40-41 mtd/ubi-user.h UBI
265'o' 01-A1 `linux/dvb/*.h` DVB
266'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
267'p' 00-1F linux/rtc.h conflict!
268'p' 00-3F linux/mc146818rtc.h conflict!
269'p' 40-7F linux/nvram.h
270'p' 80-9F linux/ppdev.h user-space parport
271 <mailto:tim@cyberelk.net>
272'p' A1-A5 linux/pps.h LinuxPPS
273 <mailto:giometti@linux.it>
274'q' 00-1F linux/serio.h
275'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
276 linux/ixjuser.h <http://web.archive.org/web/%2A/http://www.quicknet.net>
277'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
278's' all linux/cdk.h
279't' 00-7F linux/ppp-ioctl.h
280't' 80-8F linux/isdn_ppp.h
281't' 90-91 linux/toshiba.h toshiba and toshiba_acpi SMM
282'u' 00-1F linux/smb_fs.h gone
283'u' 20-3F linux/uvcvideo.h USB video class host driver
284'u' 40-4f linux/udmabuf.h userspace dma-buf misc device
285'v' 00-1F linux/ext2_fs.h conflict!
286'v' 00-1F linux/fs.h conflict!
287'v' 00-0F linux/sonypi.h conflict!
288'v' 00-0F media/v4l2-subdev.h conflict!
289'v' C0-FF linux/meye.h conflict!
290'w' all CERN SCI driver
291'y' 00-1F packet based user level communications
292 <mailto:zapman@interlan.net>
293'z' 00-3F CAN bus card conflict!
294 <mailto:hdstich@connectu.ulm.circular.de>
295'z' 40-7F CAN bus card conflict!
296 <mailto:oe@port.de>
297'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
298'|' 00-7F linux/media.h
2990x80 00-1F linux/fb.h
3000x89 00-06 arch/x86/include/asm/sockios.h
3010x89 0B-DF linux/sockios.h
3020x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
3030x89 E0-EF linux/dn.h PROTOPRIVATE range
3040x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
3050x8B all linux/wireless.h
3060x8C 00-3F WiNRADiO driver
307 <http://www.winradio.com.au/>
3080x90 00 drivers/cdrom/sbpcd.h
3090x92 00-0F drivers/usb/mon/mon_bin.c
3100x93 60-7F linux/auto_fs.h
3110x94 all fs/btrfs/ioctl.h Btrfs filesystem
312 and linux/fs.h some lifted to vfs/generic
3130x97 00-7F fs/ceph/ioctl.h Ceph file system
3140x99 00-0F 537-Addinboard driver
315 <mailto:buk@buks.ipn.de>
3160xA0 all linux/sdp/sdp.h Industrial Device Project
317 <mailto:kenji@bitgate.com>
3180xA1 0 linux/vtpm_proxy.h TPM Emulator Proxy Driver
3190xA3 80-8F Port ACL in development:
320 <mailto:tlewis@mindspring.com>
3210xA3 90-9F linux/dtlk.h
3220xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
3230xAA 00-3F linux/uapi/linux/userfaultfd.h
3240xAB 00-1F linux/nbd.h
3250xAC 00-1F linux/raw.h
3260xAD 00 Netfilter device in development:
327 <mailto:rusty@rustcorp.com.au>
3280xAE all linux/kvm.h Kernel-based Virtual Machine
329 <mailto:kvm@vger.kernel.org>
3300xAF 00-1F linux/fsl_hypervisor.h Freescale hypervisor
3310xB0 all RATIO devices in development:
332 <mailto:vgo@ratio.de>
3330xB1 00-1F PPPoX
334 <mailto:mostrows@styx.uwaterloo.ca>
3350xB3 00 linux/mmc/ioctl.h
3360xB4 00-0F linux/gpio.h <mailto:linux-gpio@vger.kernel.org>
3370xB5 00-0F uapi/linux/rpmsg.h <mailto:linux-remoteproc@vger.kernel.org>
3380xB6 all linux/fpga-dfl.h
3390xC0 00-0F linux/usb/iowarrior.h
3400xCA 00-0F uapi/misc/cxl.h
3410xCA 10-2F uapi/misc/ocxl.h
3420xCA 80-BF uapi/scsi/cxlflash_ioctl.h
3430xCB 00-1F CBM serial IEC bus in development:
344 <mailto:michael.klein@puffin.lb.shuttle.de>
3450xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
3460xCD 01 linux/reiserfs_fs.h
3470xCF 02 fs/cifs/ioctl.c
3480xDB 00-0F drivers/char/mwave/mwavepub.h
3490xDD 00-3F ZFCP device driver see drivers/s390/scsi/
350 <mailto:aherrman@de.ibm.com>
3510xE5 00-3F linux/fuse.h
3520xEC 00-01 drivers/platform/chrome/cros_ec_dev.h ChromeOS EC driver
3530xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
354 <mailto:thomas@winischhofer.net>
3550xF4 00-1F video/mbxfb.h mbxfb
356 <mailto:raph@8d.com>
3570xF6 all LTTng Linux Trace Toolkit Next Generation
358 <mailto:mathieu.desnoyers@efficios.com>
3590xFD all linux/dm-ioctl.h
3600xFE all linux/isst_if.h
361==== ===== ======================================================= ================================================================
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
deleted file mode 100644
index ab0b3f686454..000000000000
--- a/Documentation/ioctl/ioctl-number.txt
+++ /dev/null
@@ -1,351 +0,0 @@
1Ioctl Numbers
219 October 1999
3Michael Elizabeth Chastain
4<mec@shout.net>
5
6If you are adding new ioctl's to the kernel, you should use the _IO
7macros defined in <linux/ioctl.h>:
8
9 _IO an ioctl with no parameters
10 _IOW an ioctl with write parameters (copy_from_user)
11 _IOR an ioctl with read parameters (copy_to_user)
12 _IOWR an ioctl with both write and read parameters.
13
14'Write' and 'read' are from the user's point of view, just like the
15system calls 'write' and 'read'. For example, a SET_FOO ioctl would
16be _IOW, although the kernel would actually read data from user space;
17a GET_FOO ioctl would be _IOR, although the kernel would actually write
18data to user space.
19
20The first argument to _IO, _IOW, _IOR, or _IOWR is an identifying letter
21or number from the table below. Because of the large number of drivers,
22many drivers share a partial letter with other drivers.
23
24If you are writing a driver for a new device and need a letter, pick an
25unused block with enough room for expansion: 32 to 256 ioctl commands.
26You can register the block by patching this file and submitting the
27patch to Linus Torvalds. Or you can e-mail me at <mec@shout.net> and
28I'll register one for you.
29
30The second argument to _IO, _IOW, _IOR, or _IOWR is a sequence number
31to distinguish ioctls from each other. The third argument to _IOW,
32_IOR, or _IOWR is the type of the data going into the kernel or coming
33out of the kernel (e.g. 'int' or 'struct foo'). NOTE! Do NOT use
34sizeof(arg) as the third argument as this results in your ioctl thinking
35it passes an argument of type size_t.
36
37Some devices use their major number as the identifier; this is OK, as
38long as it is unique. Some devices are irregular and don't follow any
39convention at all.
40
41Following this convention is good because:
42
43(1) Keeping the ioctl's globally unique helps error checking:
44 if a program calls an ioctl on the wrong device, it will get an
45 error rather than some unexpected behaviour.
46
47(2) The 'strace' build procedure automatically finds ioctl numbers
48 defined with _IO, _IOW, _IOR, or _IOWR.
49
50(3) 'strace' can decode numbers back into useful names when the
51 numbers are unique.
52
53(4) People looking for ioctls can grep for them more easily when
54 this convention is used to define the ioctl numbers.
55
56(5) When following the convention, the driver code can use generic
57 code to copy the parameters between user and kernel space.
58
59This table lists ioctls visible from user land for Linux/x86. It contains
60most drivers up to 2.6.31, but I know I am missing some. There has been
61no attempt to list non-X86 architectures or ioctls from drivers/staging/.
62
63Code Seq#(hex) Include File Comments
64========================================================
650x00 00-1F linux/fs.h conflict!
660x00 00-1F scsi/scsi_ioctl.h conflict!
670x00 00-1F linux/fb.h conflict!
680x00 00-1F linux/wavefront.h conflict!
690x02 all linux/fd.h
700x03 all linux/hdreg.h
710x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
720x06 all linux/lp.h
730x09 all linux/raid/md_u.h
740x10 00-0F drivers/char/s390/vmcp.h
750x10 10-1F arch/s390/include/uapi/sclp_ctl.h
760x10 20-2F arch/s390/include/uapi/asm/hypfs.h
770x12 all linux/fs.h
78 linux/blkpg.h
790x1b all InfiniBand Subsystem <http://infiniband.sourceforge.net/>
800x20 all drivers/cdrom/cm206.h
810x22 all scsi/sg.h
82'!' 00-1F uapi/linux/seccomp.h
83'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
84'$' 00-0F linux/perf_counter.h, linux/perf_event.h
85'%' 00-0F include/uapi/linux/stm.h
86 System Trace Module subsystem
87 <mailto:alexander.shishkin@linux.intel.com>
88'&' 00-07 drivers/firewire/nosy-user.h
89'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
90 <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
91'2' 01-04 linux/i2o.h
92'3' 00-0F drivers/s390/char/raw3270.h conflict!
93'3' 00-1F linux/suspend_ioctls.h conflict!
94 and kernel/power/user.c
95'8' all SNP8023 advanced NIC card
96 <mailto:mcr@solidum.com>
97';' 64-7F linux/vfio.h
98'@' 00-0F linux/radeonfb.h conflict!
99'@' 00-0F drivers/video/aty/aty128fb.c conflict!
100'A' 00-1F linux/apm_bios.h conflict!
101'A' 00-0F linux/agpgart.h conflict!
102 and drivers/char/agp/compat_ioctl.h
103'A' 00-7F sound/asound.h conflict!
104'B' 00-1F linux/cciss_ioctl.h conflict!
105'B' 00-0F include/linux/pmu.h conflict!
106'B' C0-FF advanced bbus
107 <mailto:maassen@uni-freiburg.de>
108'C' all linux/soundcard.h conflict!
109'C' 01-2F linux/capi.h conflict!
110'C' F0-FF drivers/net/wan/cosa.h conflict!
111'D' all arch/s390/include/asm/dasd.h
112'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
113'D' 05 drivers/scsi/pmcraid.h
114'E' all linux/input.h conflict!
115'E' 00-0F xen/evtchn.h conflict!
116'F' all linux/fb.h conflict!
117'F' 01-02 drivers/scsi/pmcraid.h conflict!
118'F' 20 drivers/video/fsl-diu-fb.h conflict!
119'F' 20 drivers/video/intelfb/intelfb.h conflict!
120'F' 20 linux/ivtvfb.h conflict!
121'F' 20 linux/matroxfb.h conflict!
122'F' 20 drivers/video/aty/atyfb_base.c conflict!
123'F' 00-0F video/da8xx-fb.h conflict!
124'F' 80-8F linux/arcfb.h conflict!
125'F' DD video/sstfb.h conflict!
126'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
127'G' 00-0F linux/gigaset_dev.h conflict!
128'H' 00-7F linux/hiddev.h conflict!
129'H' 00-0F linux/hidraw.h conflict!
130'H' 01 linux/mei.h conflict!
131'H' 02 linux/mei.h conflict!
132'H' 03 linux/mei.h conflict!
133'H' 00-0F sound/asound.h conflict!
134'H' 20-40 sound/asound_fm.h conflict!
135'H' 80-8F sound/sfnt_info.h conflict!
136'H' 10-8F sound/emu10k1.h conflict!
137'H' 10-1F sound/sb16_csp.h conflict!
138'H' 10-1F sound/hda_hwdep.h conflict!
139'H' 40-4F sound/hdspm.h conflict!
140'H' 40-4F sound/hdsp.h conflict!
141'H' 90 sound/usb/usx2y/usb_stream.h
142'H' A0 uapi/linux/usb/cdc-wdm.h
143'H' C0-F0 net/bluetooth/hci.h conflict!
144'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
145'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
146'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
147'H' F1 linux/hid-roccat.h <mailto:erazor_de@users.sourceforge.net>
148'H' F8-FA sound/firewire.h
149'I' all linux/isdn.h conflict!
150'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
151'I' 40-4F linux/mISDNif.h conflict!
152'J' 00-1F drivers/scsi/gdth_ioctl.h
153'K' all linux/kd.h
154'L' 00-1F linux/loop.h conflict!
155'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
156'L' 20-2F linux/lightnvm.h
157'L' E0-FF linux/ppdd.h encrypted disk device driver
158 <http://linux01.gwdg.de/~alatham/ppdd.html>
159'M' all linux/soundcard.h conflict!
160'M' 01-16 mtd/mtd-abi.h conflict!
161 and drivers/mtd/mtdchar.c
162'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
163'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
164'N' 00-1F drivers/usb/scanner.h
165'N' 40-7F drivers/block/nvme.c
166'O' 00-06 mtd/ubi-user.h UBI
167'P' all linux/soundcard.h conflict!
168'P' 60-6F sound/sscape_ioctl.h conflict!
169'P' 00-0F drivers/usb/class/usblp.c conflict!
170'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
171'Q' all linux/soundcard.h
172'R' 00-1F linux/random.h conflict!
173'R' 01 linux/rfkill.h conflict!
174'R' C0-DF net/bluetooth/rfcomm.h
175'S' all linux/cdrom.h conflict!
176'S' 80-81 scsi/scsi_ioctl.h conflict!
177'S' 82-FF scsi/scsi.h conflict!
178'S' 00-7F sound/asequencer.h conflict!
179'T' all linux/soundcard.h conflict!
180'T' 00-AF sound/asound.h conflict!
181'T' all arch/x86/include/asm/ioctls.h conflict!
182'T' C0-DF linux/if_tun.h conflict!
183'U' all sound/asound.h conflict!
184'U' 00-CF linux/uinput.h conflict!
185'U' 00-EF linux/usbdevice_fs.h
186'U' C0-CF drivers/bluetooth/hci_uart.h
187'V' all linux/vt.h conflict!
188'V' all linux/videodev2.h conflict!
189'V' C0 linux/ivtvfb.h conflict!
190'V' C0 linux/ivtv.h conflict!
191'V' C0 media/davinci/vpfe_capture.h conflict!
192'V' C0 media/si4713.h conflict!
193'W' 00-1F linux/watchdog.h conflict!
194'W' 00-1F linux/wanrouter.h conflict! (pre 3.9)
195'W' 00-3F sound/asound.h conflict!
196'W' 40-5F drivers/pci/switch/switchtec.c
197'X' all fs/xfs/xfs_fs.h conflict!
198 and fs/xfs/linux-2.6/xfs_ioctl32.h
199 and include/linux/falloc.h
200 and linux/fs.h
201'X' all fs/ocfs2/ocfs_fs.h conflict!
202'X' 01 linux/pktcdvd.h conflict!
203'Y' all linux/cyclades.h
204'Z' 14-15 drivers/message/fusion/mptctl.h
205'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
206 <mailto:gregkh@linuxfoundation.org>
207'a' all linux/atm*.h, linux/sonet.h ATM on linux
208 <http://lrcwww.epfl.ch/>
209'a' 00-0F drivers/crypto/qat/qat_common/adf_cfg_common.h conflict! qat driver
210'b' 00-FF conflict! bit3 vme host bridge
211 <mailto:natalia@nikhefk.nikhef.nl>
212'c' all linux/cm4000_cs.h conflict!
213'c' 00-7F linux/comstats.h conflict!
214'c' 00-7F linux/coda.h conflict!
215'c' 00-1F linux/chio.h conflict!
216'c' 80-9F arch/s390/include/asm/chsc.h conflict!
217'c' A0-AF arch/x86/include/asm/msr.h conflict!
218'd' 00-FF linux/char/drm/drm.h conflict!
219'd' 02-40 pcmcia/ds.h conflict!
220'd' F0-FF linux/digi1.h
221'e' all linux/digi1.h conflict!
222'f' 00-1F linux/ext2_fs.h conflict!
223'f' 00-1F linux/ext3_fs.h conflict!
224'f' 00-0F fs/jfs/jfs_dinode.h conflict!
225'f' 00-0F fs/ext4/ext4.h conflict!
226'f' 00-0F linux/fs.h conflict!
227'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
228'g' 00-0F linux/usb/gadgetfs.h
229'g' 20-2F linux/usb/g_printer.h
230'h' 00-7F conflict! Charon filesystem
231 <mailto:zapman@interlan.net>
232'h' 00-1F linux/hpet.h conflict!
233'h' 80-8F fs/hfsplus/ioctl.c
234'i' 00-3F linux/i2o-dev.h conflict!
235'i' 0B-1F linux/ipmi.h conflict!
236'i' 80-8F linux/i8k.h
237'j' 00-3F linux/joystick.h
238'k' 00-0F linux/spi/spidev.h conflict!
239'k' 00-05 video/kyro.h conflict!
240'k' 10-17 linux/hsi/hsi_char.h HSI character device
241'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
242 <http://web.archive.org/web/*/http://mikonos.dia.unisa.it/tcfs>
243'l' 40-7F linux/udf_fs_i.h in development:
244 <http://sourceforge.net/projects/linux-udf/>
245'm' 00-09 linux/mmtimer.h conflict!
246'm' all linux/mtio.h conflict!
247'm' all linux/soundcard.h conflict!
248'm' all linux/synclink.h conflict!
249'm' 00-19 drivers/message/fusion/mptctl.h conflict!
250'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
251'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
252'n' 80-8F uapi/linux/nilfs2_api.h NILFS2
253'n' E0-FF linux/matroxfb.h matroxfb
254'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
255'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
256'o' 40-41 mtd/ubi-user.h UBI
257'o' 01-A1 linux/dvb/*.h DVB
258'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
259'p' 00-1F linux/rtc.h conflict!
260'p' 00-3F linux/mc146818rtc.h conflict!
261'p' 40-7F linux/nvram.h
262'p' 80-9F linux/ppdev.h user-space parport
263 <mailto:tim@cyberelk.net>
264'p' A1-A5 linux/pps.h LinuxPPS
265 <mailto:giometti@linux.it>
266'q' 00-1F linux/serio.h
267'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
268 linux/ixjuser.h <http://web.archive.org/web/*/http://www.quicknet.net>
269'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
270's' all linux/cdk.h
271't' 00-7F linux/ppp-ioctl.h
272't' 80-8F linux/isdn_ppp.h
273't' 90-91 linux/toshiba.h toshiba and toshiba_acpi SMM
274'u' 00-1F linux/smb_fs.h gone
275'u' 20-3F linux/uvcvideo.h USB video class host driver
276'u' 40-4f linux/udmabuf.h userspace dma-buf misc device
277'v' 00-1F linux/ext2_fs.h conflict!
278'v' 00-1F linux/fs.h conflict!
279'v' 00-0F linux/sonypi.h conflict!
280'v' 00-0F media/v4l2-subdev.h conflict!
281'v' C0-FF linux/meye.h conflict!
282'w' all CERN SCI driver
283'y' 00-1F packet based user level communications
284 <mailto:zapman@interlan.net>
285'z' 00-3F CAN bus card conflict!
286 <mailto:hdstich@connectu.ulm.circular.de>
287'z' 40-7F CAN bus card conflict!
288 <mailto:oe@port.de>
289'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
290'|' 00-7F linux/media.h
2910x80 00-1F linux/fb.h
2920x89 00-06 arch/x86/include/asm/sockios.h
2930x89 0B-DF linux/sockios.h
2940x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
2950x89 E0-EF linux/dn.h PROTOPRIVATE range
2960x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
2970x8B all linux/wireless.h
2980x8C 00-3F WiNRADiO driver
299 <http://www.winradio.com.au/>
3000x90 00 drivers/cdrom/sbpcd.h
3010x92 00-0F drivers/usb/mon/mon_bin.c
3020x93 60-7F linux/auto_fs.h
3030x94 all fs/btrfs/ioctl.h Btrfs filesystem
304 and linux/fs.h some lifted to vfs/generic
3050x97 00-7F fs/ceph/ioctl.h Ceph file system
3060x99 00-0F 537-Addinboard driver
307 <mailto:buk@buks.ipn.de>
3080xA0 all linux/sdp/sdp.h Industrial Device Project
309 <mailto:kenji@bitgate.com>
3100xA1 0 linux/vtpm_proxy.h TPM Emulator Proxy Driver
3110xA3 80-8F Port ACL in development:
312 <mailto:tlewis@mindspring.com>
3130xA3 90-9F linux/dtlk.h
3140xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
3150xAA 00-3F linux/uapi/linux/userfaultfd.h
3160xAB 00-1F linux/nbd.h
3170xAC 00-1F linux/raw.h
3180xAD 00 Netfilter device in development:
319 <mailto:rusty@rustcorp.com.au>
3200xAE all linux/kvm.h Kernel-based Virtual Machine
321 <mailto:kvm@vger.kernel.org>
3220xAF 00-1F linux/fsl_hypervisor.h Freescale hypervisor
3230xB0 all RATIO devices in development:
324 <mailto:vgo@ratio.de>
3250xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
3260xB3 00 linux/mmc/ioctl.h
3270xB4 00-0F linux/gpio.h <mailto:linux-gpio@vger.kernel.org>
3280xB5 00-0F uapi/linux/rpmsg.h <mailto:linux-remoteproc@vger.kernel.org>
3290xB6 all linux/fpga-dfl.h
3300xC0 00-0F linux/usb/iowarrior.h
3310xCA 00-0F uapi/misc/cxl.h
3320xCA 10-2F uapi/misc/ocxl.h
3330xCA 80-BF uapi/scsi/cxlflash_ioctl.h
3340xCB 00-1F CBM serial IEC bus in development:
335 <mailto:michael.klein@puffin.lb.shuttle.de>
3360xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
3370xCD 01 linux/reiserfs_fs.h
3380xCF 02 fs/cifs/ioctl.c
3390xDB 00-0F drivers/char/mwave/mwavepub.h
3400xDD 00-3F ZFCP device driver see drivers/s390/scsi/
341 <mailto:aherrman@de.ibm.com>
3420xE5 00-3F linux/fuse.h
3430xEC 00-01 drivers/platform/chrome/cros_ec_dev.h ChromeOS EC driver
3440xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
345 <mailto:thomas@winischhofer.net>
3460xF4 00-1F video/mbxfb.h mbxfb
347 <mailto:raph@8d.com>
3480xF6 all LTTng Linux Trace Toolkit Next Generation
349 <mailto:mathieu.desnoyers@efficios.com>
3500xFD all linux/dm-ioctl.h
3510xFE all linux/isst_if.h
diff --git a/Documentation/kbuild/index.rst b/Documentation/kbuild/index.rst
index 42d4cbe4460c..e323a3f2cc81 100644
--- a/Documentation/kbuild/index.rst
+++ b/Documentation/kbuild/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3=================== 3===================
4Kernel Build System 4Kernel Build System
diff --git a/Documentation/kbuild/issues.rst b/Documentation/kbuild/issues.rst
index 9fdded4b681c..bdab01f733f6 100644
--- a/Documentation/kbuild/issues.rst
+++ b/Documentation/kbuild/issues.rst
@@ -1,11 +1,15 @@
1Recursion issue #1 1================
2------------------ 2Recursion issues
3================
3 4
4 .. include:: Kconfig.recursion-issue-01 5issue #1
5 :literal: 6--------
6 7
7Recursion issue #2 8.. literalinclude:: Kconfig.recursion-issue-01
8------------------ 9 :language: kconfig
9 10
10 .. include:: Kconfig.recursion-issue-02 11issue #2
11 :literal: 12--------
13
14.. literalinclude:: Kconfig.recursion-issue-02
15 :language: kconfig
diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
index b25548963d70..ce9b99c004ae 100644
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -18,7 +18,7 @@ This file lists all modules that are built into the kernel. This is used
18by modprobe to not fail when trying to load something builtin. 18by modprobe to not fail when trying to load something builtin.
19 19
20modules.builtin.modinfo 20modules.builtin.modinfo
21-------------------------------------------------- 21-----------------------
22This file contains modinfo from all modules that are built into the kernel. 22This file contains modinfo from all modules that are built into the kernel.
23Unlike modinfo of a separate module, all fields are prefixed with module name. 23Unlike modinfo of a separate module, all fields are prefixed with module name.
24 24
@@ -153,6 +153,7 @@ Install script called when using "make install".
153The default name is "installkernel". 153The default name is "installkernel".
154 154
155The script will be called with the following arguments: 155The script will be called with the following arguments:
156
156 - $1 - kernel version 157 - $1 - kernel version
157 - $2 - kernel image file 158 - $2 - kernel image file
158 - $3 - kernel map file 159 - $3 - kernel map file
diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index 2bc8a7803365..74bef19f69f0 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -53,6 +53,7 @@ A menu entry can have a number of attributes. Not all of them are
53applicable everywhere (see syntax). 53applicable everywhere (see syntax).
54 54
55- type definition: "bool"/"tristate"/"string"/"hex"/"int" 55- type definition: "bool"/"tristate"/"string"/"hex"/"int"
56
56 Every config option must have a type. There are only two basic types: 57 Every config option must have a type. There are only two basic types:
57 tristate and string; the other types are based on these two. The type 58 tristate and string; the other types are based on these two. The type
58 definition optionally accepts an input prompt, so these two examples 59 definition optionally accepts an input prompt, so these two examples
@@ -66,11 +67,13 @@ applicable everywhere (see syntax).
66 prompt "Networking support" 67 prompt "Networking support"
67 68
68- input prompt: "prompt" <prompt> ["if" <expr>] 69- input prompt: "prompt" <prompt> ["if" <expr>]
70
69 Every menu entry can have at most one prompt, which is used to display 71 Every menu entry can have at most one prompt, which is used to display
70 to the user. Optionally dependencies only for this prompt can be added 72 to the user. Optionally dependencies only for this prompt can be added
71 with "if". 73 with "if".
72 74
73- default value: "default" <expr> ["if" <expr>] 75- default value: "default" <expr> ["if" <expr>]
76
74 A config option can have any number of default values. If multiple 77 A config option can have any number of default values. If multiple
75 default values are visible, only the first defined one is active. 78 default values are visible, only the first defined one is active.
76 Default values are not limited to the menu entry where they are 79 Default values are not limited to the menu entry where they are
@@ -112,6 +115,7 @@ applicable everywhere (see syntax).
112 Optionally dependencies for this default value can be added with "if". 115 Optionally dependencies for this default value can be added with "if".
113 116
114- dependencies: "depends on" <expr> 117- dependencies: "depends on" <expr>
118
115 This defines a dependency for this menu entry. If multiple 119 This defines a dependency for this menu entry. If multiple
116 dependencies are defined, they are connected with '&&'. Dependencies 120 dependencies are defined, they are connected with '&&'. Dependencies
117 are applied to all other options within this menu entry (which also 121 are applied to all other options within this menu entry (which also
@@ -127,6 +131,7 @@ applicable everywhere (see syntax).
127 default y 131 default y
128 132
129- reverse dependencies: "select" <symbol> ["if" <expr>] 133- reverse dependencies: "select" <symbol> ["if" <expr>]
134
130 While normal dependencies reduce the upper limit of a symbol (see 135 While normal dependencies reduce the upper limit of a symbol (see
131 below), reverse dependencies can be used to force a lower limit of 136 below), reverse dependencies can be used to force a lower limit of
132 another symbol. The value of the current menu symbol is used as the 137 another symbol. The value of the current menu symbol is used as the
@@ -146,6 +151,7 @@ applicable everywhere (see syntax).
146 the illegal configurations all over. 151 the illegal configurations all over.
147 152
148- weak reverse dependencies: "imply" <symbol> ["if" <expr>] 153- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
154
149 This is similar to "select" as it enforces a lower limit on another 155 This is similar to "select" as it enforces a lower limit on another
150 symbol except that the "implied" symbol's value may still be set to n 156 symbol except that the "implied" symbol's value may still be set to n
151 from a direct dependency or with a visible prompt. 157 from a direct dependency or with a visible prompt.
@@ -176,6 +182,7 @@ applicable everywhere (see syntax).
176 configure that subsystem out without also having to unset these drivers. 182 configure that subsystem out without also having to unset these drivers.
177 183
178- limiting menu display: "visible if" <expr> 184- limiting menu display: "visible if" <expr>
185
179 This attribute is only applicable to menu blocks, if the condition is 186 This attribute is only applicable to menu blocks, if the condition is
180 false, the menu block is not displayed to the user (the symbols 187 false, the menu block is not displayed to the user (the symbols
181 contained there can still be selected by other symbols, though). It is 188 contained there can still be selected by other symbols, though). It is
@@ -183,12 +190,14 @@ applicable everywhere (see syntax).
183 entries. Default value of "visible" is true. 190 entries. Default value of "visible" is true.
184 191
185- numerical ranges: "range" <symbol> <symbol> ["if" <expr>] 192- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
193
186 This allows to limit the range of possible input values for int 194 This allows to limit the range of possible input values for int
187 and hex symbols. The user can only input a value which is larger than 195 and hex symbols. The user can only input a value which is larger than
188 or equal to the first symbol and smaller than or equal to the second 196 or equal to the first symbol and smaller than or equal to the second
189 symbol. 197 symbol.
190 198
191- help text: "help" or "---help---" 199- help text: "help" or "---help---"
200
192 This defines a help text. The end of the help text is determined by 201 This defines a help text. The end of the help text is determined by
193 the indentation level, this means it ends at the first line which has 202 the indentation level, this means it ends at the first line which has
194 a smaller indentation than the first line of the help text. 203 a smaller indentation than the first line of the help text.
@@ -197,6 +206,7 @@ applicable everywhere (see syntax).
197 the file as an aid to developers. 206 the file as an aid to developers.
198 207
199- misc options: "option" <symbol>[=<value>] 208- misc options: "option" <symbol>[=<value>]
209
200 Various less common options can be defined via this option syntax, 210 Various less common options can be defined via this option syntax,
201 which can modify the behaviour of the menu entry and its config 211 which can modify the behaviour of the menu entry and its config
202 symbol. These options are currently possible: 212 symbol. These options are currently possible:
@@ -325,6 +335,7 @@ end a menu entry:
325The first five also start the definition of a menu entry. 335The first five also start the definition of a menu entry.
326 336
327config:: 337config::
338
328 "config" <symbol> 339 "config" <symbol>
329 <config options> 340 <config options>
330 341
@@ -332,6 +343,7 @@ This defines a config symbol <symbol> and accepts any of above
332attributes as options. 343attributes as options.
333 344
334menuconfig:: 345menuconfig::
346
335 "menuconfig" <symbol> 347 "menuconfig" <symbol>
336 <config options> 348 <config options>
337 349
diff --git a/Documentation/kbuild/kconfig.rst b/Documentation/kbuild/kconfig.rst
index 88129af7e539..a9a855f894b3 100644
--- a/Documentation/kbuild/kconfig.rst
+++ b/Documentation/kbuild/kconfig.rst
@@ -264,6 +264,7 @@ NCONFIG_MODE
264This mode shows all sub-menus in one large tree. 264This mode shows all sub-menus in one large tree.
265 265
266Example:: 266Example::
267
267 make NCONFIG_MODE=single_menu nconfig 268 make NCONFIG_MODE=single_menu nconfig
268 269
269---------------------------------------------------------------------- 270----------------------------------------------------------------------
@@ -277,9 +278,12 @@ Searching in xconfig:
277 names, so you have to know something close to what you are 278 names, so you have to know something close to what you are
278 looking for. 279 looking for.
279 280
280 Example: 281 Example::
282
281 Ctrl-F hotplug 283 Ctrl-F hotplug
282 or 284
285 or::
286
283 Menu: File, Search, hotplug 287 Menu: File, Search, hotplug
284 288
285 lists all config symbol entries that contain "hotplug" in 289 lists all config symbol entries that contain "hotplug" in
diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst
index 093f2d79ab95..f31158457753 100644
--- a/Documentation/kbuild/makefiles.rst
+++ b/Documentation/kbuild/makefiles.rst
@@ -384,6 +384,7 @@ more details, with real examples.
384----------------------- 384-----------------------
385 385
386 Kbuild tracks dependencies on the following: 386 Kbuild tracks dependencies on the following:
387
387 1) All prerequisite files (both `*.c` and `*.h`) 388 1) All prerequisite files (both `*.c` and `*.h`)
388 2) `CONFIG_` options used in all prerequisite files 389 2) `CONFIG_` options used in all prerequisite files
389 3) Command-line used to compile target 390 3) Command-line used to compile target
diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kernel-hacking/locking.rst
index dc698ea456e0..a8518ac0d31d 100644
--- a/Documentation/kernel-hacking/locking.rst
+++ b/Documentation/kernel-hacking/locking.rst
@@ -1364,7 +1364,7 @@ Futex API reference
1364Further reading 1364Further reading
1365=============== 1365===============
1366 1366
1367- ``Documentation/locking/spinlocks.txt``: Linus Torvalds' spinlocking 1367- ``Documentation/locking/spinlocks.rst``: Linus Torvalds' spinlocking
1368 tutorial in the kernel sources. 1368 tutorial in the kernel sources.
1369 1369
1370- Unix Systems for Modern Architectures: Symmetric Multiprocessing and 1370- Unix Systems for Modern Architectures: Symmetric Multiprocessing and
diff --git a/Documentation/leds/index.rst b/Documentation/leds/index.rst
index 9885f7c1b75d..060f4e485897 100644
--- a/Documentation/leds/index.rst
+++ b/Documentation/leds/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3==== 3====
4LEDs 4LEDs
diff --git a/Documentation/livepatch/index.rst b/Documentation/livepatch/index.rst
index edd291d51847..17674a9e21b2 100644
--- a/Documentation/livepatch/index.rst
+++ b/Documentation/livepatch/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3=================== 3===================
4Kernel Livepatching 4Kernel Livepatching
diff --git a/Documentation/locking/index.rst b/Documentation/locking/index.rst
new file mode 100644
index 000000000000..626a463f7e42
--- /dev/null
+++ b/Documentation/locking/index.rst
@@ -0,0 +1,24 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=======
4locking
5=======
6
7.. toctree::
8 :maxdepth: 1
9
10 lockdep-design
11 lockstat
12 locktorture
13 mutex-design
14 rt-mutex-design
15 rt-mutex
16 spinlocks
17 ww-mutex-design
18
19.. only:: subproject and html
20
21 Indices
22 =======
23
24 * :ref:`genindex`
diff --git a/Documentation/locking/lockdep-design.txt b/Documentation/locking/lockdep-design.rst
index f189d130e543..23fcbc4d3fc0 100644
--- a/Documentation/locking/lockdep-design.txt
+++ b/Documentation/locking/lockdep-design.rst
@@ -2,6 +2,7 @@ Runtime locking correctness validator
2===================================== 2=====================================
3 3
4started by Ingo Molnar <mingo@redhat.com> 4started by Ingo Molnar <mingo@redhat.com>
5
5additions by Arjan van de Ven <arjan@linux.intel.com> 6additions by Arjan van de Ven <arjan@linux.intel.com>
6 7
7Lock-class 8Lock-class
@@ -56,7 +57,7 @@ where the last 1 category is:
56 57
57When locking rules are violated, these usage bits are presented in the 58When locking rules are violated, these usage bits are presented in the
58locking error messages, inside curlies, with a total of 2 * n STATEs bits. 59locking error messages, inside curlies, with a total of 2 * n STATEs bits.
59A contrived example: 60A contrived example::
60 61
61 modprobe/2287 is trying to acquire lock: 62 modprobe/2287 is trying to acquire lock:
62 (&sio_locks[i].lock){-.-.}, at: [<c02867fd>] mutex_lock+0x21/0x24 63 (&sio_locks[i].lock){-.-.}, at: [<c02867fd>] mutex_lock+0x21/0x24
@@ -70,12 +71,14 @@ of the lock and readlock (if exists), for each of the n STATEs listed
70above respectively, and the character displayed at each bit position 71above respectively, and the character displayed at each bit position
71indicates: 72indicates:
72 73
74 === ===================================================
73 '.' acquired while irqs disabled and not in irq context 75 '.' acquired while irqs disabled and not in irq context
74 '-' acquired in irq context 76 '-' acquired in irq context
75 '+' acquired with irqs enabled 77 '+' acquired with irqs enabled
76 '?' acquired in irq context with irqs enabled. 78 '?' acquired in irq context with irqs enabled.
79 === ===================================================
77 80
78The bits are illustrated with an example: 81The bits are illustrated with an example::
79 82
80 (&sio_locks[i].lock){-.-.}, at: [<c02867fd>] mutex_lock+0x21/0x24 83 (&sio_locks[i].lock){-.-.}, at: [<c02867fd>] mutex_lock+0x21/0x24
81 |||| 84 ||||
@@ -90,13 +93,13 @@ context and whether that STATE is enabled yields four possible cases as
90shown in the table below. The bit character is able to indicate which 93shown in the table below. The bit character is able to indicate which
91exact case is for the lock as of the reporting time. 94exact case is for the lock as of the reporting time.
92 95
93 ------------------------------------------- 96 +--------------+-------------+--------------+
94 | | irq enabled | irq disabled | 97 | | irq enabled | irq disabled |
95 |-------------------------------------------| 98 +--------------+-------------+--------------+
96 | ever in irq | ? | - | 99 | ever in irq | ? | - |
97 |-------------------------------------------| 100 +--------------+-------------+--------------+
98 | never in irq | + | . | 101 | never in irq | + | . |
99 ------------------------------------------- 102 +--------------+-------------+--------------+
100 103
101The character '-' suggests irq is disabled because if otherwise the 104The character '-' suggests irq is disabled because if otherwise the
102charactor '?' would have been shown instead. Similar deduction can be 105charactor '?' would have been shown instead. Similar deduction can be
@@ -113,7 +116,7 @@ is irq-unsafe means it was ever acquired with irq enabled.
113 116
114A softirq-unsafe lock-class is automatically hardirq-unsafe as well. The 117A softirq-unsafe lock-class is automatically hardirq-unsafe as well. The
115following states must be exclusive: only one of them is allowed to be set 118following states must be exclusive: only one of them is allowed to be set
116for any lock-class based on its usage: 119for any lock-class based on its usage::
117 120
118 <hardirq-safe> or <hardirq-unsafe> 121 <hardirq-safe> or <hardirq-unsafe>
119 <softirq-safe> or <softirq-unsafe> 122 <softirq-safe> or <softirq-unsafe>
@@ -134,7 +137,7 @@ Multi-lock dependency rules:
134The same lock-class must not be acquired twice, because this could lead 137The same lock-class must not be acquired twice, because this could lead
135to lock recursion deadlocks. 138to lock recursion deadlocks.
136 139
137Furthermore, two locks can not be taken in inverse order: 140Furthermore, two locks can not be taken in inverse order::
138 141
139 <L1> -> <L2> 142 <L1> -> <L2>
140 <L2> -> <L1> 143 <L2> -> <L1>
@@ -148,7 +151,7 @@ operations; the validator will still find whether these locks can be
148acquired in a circular fashion. 151acquired in a circular fashion.
149 152
150Furthermore, the following usage based lock dependencies are not allowed 153Furthermore, the following usage based lock dependencies are not allowed
151between any two lock-classes: 154between any two lock-classes::
152 155
153 <hardirq-safe> -> <hardirq-unsafe> 156 <hardirq-safe> -> <hardirq-unsafe>
154 <softirq-safe> -> <softirq-unsafe> 157 <softirq-safe> -> <softirq-unsafe>
@@ -204,16 +207,16 @@ the ordering is not static.
204In order to teach the validator about this correct usage model, new 207In order to teach the validator about this correct usage model, new
205versions of the various locking primitives were added that allow you to 208versions of the various locking primitives were added that allow you to
206specify a "nesting level". An example call, for the block device mutex, 209specify a "nesting level". An example call, for the block device mutex,
207looks like this: 210looks like this::
208 211
209enum bdev_bd_mutex_lock_class 212 enum bdev_bd_mutex_lock_class
210{ 213 {
211 BD_MUTEX_NORMAL, 214 BD_MUTEX_NORMAL,
212 BD_MUTEX_WHOLE, 215 BD_MUTEX_WHOLE,
213 BD_MUTEX_PARTITION 216 BD_MUTEX_PARTITION
214}; 217 };
215 218
216 mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION); 219mutex_lock_nested(&bdev->bd_contains->bd_mutex, BD_MUTEX_PARTITION);
217 220
218In this case the locking is done on a bdev object that is known to be a 221In this case the locking is done on a bdev object that is known to be a
219partition. 222partition.
@@ -234,7 +237,7 @@ must be held: lockdep_assert_held*(&lock) and lockdep_*pin_lock(&lock).
234As the name suggests, lockdep_assert_held* family of macros assert that a 237As the name suggests, lockdep_assert_held* family of macros assert that a
235particular lock is held at a certain time (and generate a WARN() otherwise). 238particular lock is held at a certain time (and generate a WARN() otherwise).
236This annotation is largely used all over the kernel, e.g. kernel/sched/ 239This annotation is largely used all over the kernel, e.g. kernel/sched/
237core.c 240core.c::
238 241
239 void update_rq_clock(struct rq *rq) 242 void update_rq_clock(struct rq *rq)
240 { 243 {
@@ -253,7 +256,7 @@ out to be especially helpful to debug code with callbacks, where an upper
253layer assumes a lock remains taken, but a lower layer thinks it can maybe drop 256layer assumes a lock remains taken, but a lower layer thinks it can maybe drop
254and reacquire the lock ("unwittingly" introducing races). lockdep_pin_lock() 257and reacquire the lock ("unwittingly" introducing races). lockdep_pin_lock()
255returns a 'struct pin_cookie' that is then used by lockdep_unpin_lock() to check 258returns a 'struct pin_cookie' that is then used by lockdep_unpin_lock() to check
256that nobody tampered with the lock, e.g. kernel/sched/sched.h 259that nobody tampered with the lock, e.g. kernel/sched/sched.h::
257 260
258 static inline void rq_pin_lock(struct rq *rq, struct rq_flags *rf) 261 static inline void rq_pin_lock(struct rq *rq, struct rq_flags *rf)
259 { 262 {
@@ -280,7 +283,7 @@ correctness) in the sense that for every simple, standalone single-task
280locking sequence that occurred at least once during the lifetime of the 283locking sequence that occurred at least once during the lifetime of the
281kernel, the validator proves it with a 100% certainty that no 284kernel, the validator proves it with a 100% certainty that no
282combination and timing of these locking sequences can cause any class of 285combination and timing of these locking sequences can cause any class of
283lock related deadlock. [*] 286lock related deadlock. [1]_
284 287
285I.e. complex multi-CPU and multi-task locking scenarios do not have to 288I.e. complex multi-CPU and multi-task locking scenarios do not have to
286occur in practice to prove a deadlock: only the simple 'component' 289occur in practice to prove a deadlock: only the simple 'component'
@@ -299,7 +302,9 @@ possible combination of locking interaction between CPUs, combined with
299every possible hardirq and softirq nesting scenario (which is impossible 302every possible hardirq and softirq nesting scenario (which is impossible
300to do in practice). 303to do in practice).
301 304
302[*] assuming that the validator itself is 100% correct, and no other 305.. [1]
306
307 assuming that the validator itself is 100% correct, and no other
303 part of the system corrupts the state of the validator in any way. 308 part of the system corrupts the state of the validator in any way.
304 We also assume that all NMI/SMM paths [which could interrupt 309 We also assume that all NMI/SMM paths [which could interrupt
305 even hardirq-disabled codepaths] are correct and do not interfere 310 even hardirq-disabled codepaths] are correct and do not interfere
@@ -310,7 +315,7 @@ to do in practice).
310Performance: 315Performance:
311------------ 316------------
312 317
313The above rules require _massive_ amounts of runtime checking. If we did 318The above rules require **massive** amounts of runtime checking. If we did
314that for every lock taken and for every irqs-enable event, it would 319that for every lock taken and for every irqs-enable event, it would
315render the system practically unusably slow. The complexity of checking 320render the system practically unusably slow. The complexity of checking
316is O(N^2), so even with just a few hundred lock-classes we'd have to do 321is O(N^2), so even with just a few hundred lock-classes we'd have to do
@@ -369,17 +374,17 @@ be harder to do than to say.
369 374
370Of course, if you do run out of lock classes, the next thing to do is 375Of course, if you do run out of lock classes, the next thing to do is
371to find the offending lock classes. First, the following command gives 376to find the offending lock classes. First, the following command gives
372you the number of lock classes currently in use along with the maximum: 377you the number of lock classes currently in use along with the maximum::
373 378
374 grep "lock-classes" /proc/lockdep_stats 379 grep "lock-classes" /proc/lockdep_stats
375 380
376This command produces the following output on a modest system: 381This command produces the following output on a modest system::
377 382
378 lock-classes: 748 [max: 8191] 383 lock-classes: 748 [max: 8191]
379 384
380If the number allocated (748 above) increases continually over time, 385If the number allocated (748 above) increases continually over time,
381then there is likely a leak. The following command can be used to 386then there is likely a leak. The following command can be used to
382identify the leaking lock classes: 387identify the leaking lock classes::
383 388
384 grep "BD" /proc/lockdep 389 grep "BD" /proc/lockdep
385 390
diff --git a/Documentation/locking/lockstat.rst b/Documentation/locking/lockstat.rst
new file mode 100644
index 000000000000..536eab8dbd99
--- /dev/null
+++ b/Documentation/locking/lockstat.rst
@@ -0,0 +1,204 @@
1===============
2Lock Statistics
3===============
4
5What
6====
7
8As the name suggests, it provides statistics on locks.
9
10
11Why
12===
13
14Because things like lock contention can severely impact performance.
15
16How
17===
18
19Lockdep already has hooks in the lock functions and maps lock instances to
20lock classes. We build on that (see Documentation/locking/lockdep-design.rst).
21The graph below shows the relation between the lock functions and the various
22hooks therein::
23
24 __acquire
25 |
26 lock _____
27 | \
28 | __contended
29 | |
30 | <wait>
31 | _______/
32 |/
33 |
34 __acquired
35 |
36 .
37 <hold>
38 .
39 |
40 __release
41 |
42 unlock
43
44 lock, unlock - the regular lock functions
45 __* - the hooks
46 <> - states
47
48With these hooks we provide the following statistics:
49
50 con-bounces
51 - number of lock contention that involved x-cpu data
52 contentions
53 - number of lock acquisitions that had to wait
54 wait time
55 min
56 - shortest (non-0) time we ever had to wait for a lock
57 max
58 - longest time we ever had to wait for a lock
59 total
60 - total time we spend waiting on this lock
61 avg
62 - average time spent waiting on this lock
63 acq-bounces
64 - number of lock acquisitions that involved x-cpu data
65 acquisitions
66 - number of times we took the lock
67 hold time
68 min
69 - shortest (non-0) time we ever held the lock
70 max
71 - longest time we ever held the lock
72 total
73 - total time this lock was held
74 avg
75 - average time this lock was held
76
77These numbers are gathered per lock class, per read/write state (when
78applicable).
79
80It also tracks 4 contention points per class. A contention point is a call site
81that had to wait on lock acquisition.
82
83Configuration
84-------------
85
86Lock statistics are enabled via CONFIG_LOCK_STAT.
87
88Usage
89-----
90
91Enable collection of statistics::
92
93 # echo 1 >/proc/sys/kernel/lock_stat
94
95Disable collection of statistics::
96
97 # echo 0 >/proc/sys/kernel/lock_stat
98
99Look at the current lock statistics::
100
101 ( line numbers not part of actual output, done for clarity in the explanation
102 below )
103
104 # less /proc/lock_stat
105
106 01 lock_stat version 0.4
107 02-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
108 03 class name con-bounces contentions waittime-min waittime-max waittime-total waittime-avg acq-bounces acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg
109 04-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
110 05
111 06 &mm->mmap_sem-W: 46 84 0.26 939.10 16371.53 194.90 47291 2922365 0.16 2220301.69 17464026916.32 5975.99
112 07 &mm->mmap_sem-R: 37 100 1.31 299502.61 325629.52 3256.30 212344 34316685 0.10 7744.91 95016910.20 2.77
113 08 ---------------
114 09 &mm->mmap_sem 1 [<ffffffff811502a7>] khugepaged_scan_mm_slot+0x57/0x280
115 10 &mm->mmap_sem 96 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
116 11 &mm->mmap_sem 34 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
117 12 &mm->mmap_sem 17 [<ffffffff81127e71>] vm_munmap+0x41/0x80
118 13 ---------------
119 14 &mm->mmap_sem 1 [<ffffffff81046fda>] dup_mmap+0x2a/0x3f0
120 15 &mm->mmap_sem 60 [<ffffffff81129e29>] SyS_mprotect+0xe9/0x250
121 16 &mm->mmap_sem 41 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
122 17 &mm->mmap_sem 68 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
123 18
124 19.............................................................................................................................................................................................................................
125 20
126 21 unix_table_lock: 110 112 0.21 49.24 163.91 1.46 21094 66312 0.12 624.42 31589.81 0.48
127 22 ---------------
128 23 unix_table_lock 45 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
129 24 unix_table_lock 47 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
130 25 unix_table_lock 15 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
131 26 unix_table_lock 5 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
132 27 ---------------
133 28 unix_table_lock 39 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
134 29 unix_table_lock 49 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
135 30 unix_table_lock 20 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
136 31 unix_table_lock 4 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
137
138
139This excerpt shows the first two lock class statistics. Line 01 shows the
140output version - each time the format changes this will be updated. Line 02-04
141show the header with column descriptions. Lines 05-18 and 20-31 show the actual
142statistics. These statistics come in two parts; the actual stats separated by a
143short separator (line 08, 13) from the contention points.
144
145Lines 09-12 show the first 4 recorded contention points (the code
146which tries to get the lock) and lines 14-17 show the first 4 recorded
147contended points (the lock holder). It is possible that the max
148con-bounces point is missing in the statistics.
149
150The first lock (05-18) is a read/write lock, and shows two lines above the
151short separator. The contention points don't match the column descriptors,
152they have two: contentions and [<IP>] symbol. The second set of contention
153points are the points we're contending with.
154
155The integer part of the time values is in us.
156
157Dealing with nested locks, subclasses may appear::
158
159 32...........................................................................................................................................................................................................................
160 33
161 34 &rq->lock: 13128 13128 0.43 190.53 103881.26 7.91 97454 3453404 0.00 401.11 13224683.11 3.82
162 35 ---------
163 36 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
164 37 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
165 38 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
166 39 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
167 40 ---------
168 41 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
169 42 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
170 43 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
171 44 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8
172 45
173 46...........................................................................................................................................................................................................................
174 47
175 48 &rq->lock/1: 1526 11488 0.33 388.73 136294.31 11.86 21461 38404 0.00 37.93 109388.53 2.84
176 49 -----------
177 50 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
178 51 -----------
179 52 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
180 53 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8
181 54 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
182 55 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
183
184Line 48 shows statistics for the second subclass (/1) of &rq->lock class
185(subclass starts from 0), since in this case, as line 50 suggests,
186double_rq_lock actually acquires a nested lock of two spinlocks.
187
188View the top contending locks::
189
190 # grep : /proc/lock_stat | head
191 clockevents_lock: 2926159 2947636 0.15 46882.81 1784540466.34 605.41 3381345 3879161 0.00 2260.97 53178395.68 13.71
192 tick_broadcast_lock: 346460 346717 0.18 2257.43 39364622.71 113.54 3642919 4242696 0.00 2263.79 49173646.60 11.59
193 &mapping->i_mmap_mutex: 203896 203899 3.36 645530.05 31767507988.39 155800.21 3361776 8893984 0.17 2254.15 14110121.02 1.59
194 &rq->lock: 135014 136909 0.18 606.09 842160.68 6.15 1540728 10436146 0.00 728.72 17606683.41 1.69
195 &(&zone->lru_lock)->rlock: 93000 94934 0.16 59.18 188253.78 1.98 1199912 3809894 0.15 391.40 3559518.81 0.93
196 tasklist_lock-W: 40667 41130 0.23 1189.42 428980.51 10.43 270278 510106 0.16 653.51 3939674.91 7.72
197 tasklist_lock-R: 21298 21305 0.20 1310.05 215511.12 10.12 186204 241258 0.14 1162.33 1179779.23 4.89
198 rcu_node_1: 47656 49022 0.16 635.41 193616.41 3.95 844888 1865423 0.00 764.26 1656226.96 0.89
199 &(&dentry->d_lockref.lock)->rlock: 39791 40179 0.15 1302.08 88851.96 2.21 2790851 12527025 0.10 1910.75 3379714.27 0.27
200 rcu_node_0: 29203 30064 0.16 786.55 1555573.00 51.74 88963 244254 0.00 398.87 428872.51 1.76
201
202Clear the statistics::
203
204 # echo 0 > /proc/lock_stat
diff --git a/Documentation/locking/lockstat.txt b/Documentation/locking/lockstat.txt
deleted file mode 100644
index fdbeb0c45ef3..000000000000
--- a/Documentation/locking/lockstat.txt
+++ /dev/null
@@ -1,183 +0,0 @@
1
2LOCK STATISTICS
3
4- WHAT
5
6As the name suggests, it provides statistics on locks.
7
8- WHY
9
10Because things like lock contention can severely impact performance.
11
12- HOW
13
14Lockdep already has hooks in the lock functions and maps lock instances to
15lock classes. We build on that (see Documentation/locking/lockdep-design.txt).
16The graph below shows the relation between the lock functions and the various
17hooks therein.
18
19 __acquire
20 |
21 lock _____
22 | \
23 | __contended
24 | |
25 | <wait>
26 | _______/
27 |/
28 |
29 __acquired
30 |
31 .
32 <hold>
33 .
34 |
35 __release
36 |
37 unlock
38
39lock, unlock - the regular lock functions
40__* - the hooks
41<> - states
42
43With these hooks we provide the following statistics:
44
45 con-bounces - number of lock contention that involved x-cpu data
46 contentions - number of lock acquisitions that had to wait
47 wait time min - shortest (non-0) time we ever had to wait for a lock
48 max - longest time we ever had to wait for a lock
49 total - total time we spend waiting on this lock
50 avg - average time spent waiting on this lock
51 acq-bounces - number of lock acquisitions that involved x-cpu data
52 acquisitions - number of times we took the lock
53 hold time min - shortest (non-0) time we ever held the lock
54 max - longest time we ever held the lock
55 total - total time this lock was held
56 avg - average time this lock was held
57
58These numbers are gathered per lock class, per read/write state (when
59applicable).
60
61It also tracks 4 contention points per class. A contention point is a call site
62that had to wait on lock acquisition.
63
64 - CONFIGURATION
65
66Lock statistics are enabled via CONFIG_LOCK_STAT.
67
68 - USAGE
69
70Enable collection of statistics:
71
72# echo 1 >/proc/sys/kernel/lock_stat
73
74Disable collection of statistics:
75
76# echo 0 >/proc/sys/kernel/lock_stat
77
78Look at the current lock statistics:
79
80( line numbers not part of actual output, done for clarity in the explanation
81 below )
82
83# less /proc/lock_stat
84
8501 lock_stat version 0.4
8602-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8703 class name con-bounces contentions waittime-min waittime-max waittime-total waittime-avg acq-bounces acquisitions holdtime-min holdtime-max holdtime-total holdtime-avg
8804-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
8905
9006 &mm->mmap_sem-W: 46 84 0.26 939.10 16371.53 194.90 47291 2922365 0.16 2220301.69 17464026916.32 5975.99
9107 &mm->mmap_sem-R: 37 100 1.31 299502.61 325629.52 3256.30 212344 34316685 0.10 7744.91 95016910.20 2.77
9208 ---------------
9309 &mm->mmap_sem 1 [<ffffffff811502a7>] khugepaged_scan_mm_slot+0x57/0x280
9410 &mm->mmap_sem 96 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
9511 &mm->mmap_sem 34 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
9612 &mm->mmap_sem 17 [<ffffffff81127e71>] vm_munmap+0x41/0x80
9713 ---------------
9814 &mm->mmap_sem 1 [<ffffffff81046fda>] dup_mmap+0x2a/0x3f0
9915 &mm->mmap_sem 60 [<ffffffff81129e29>] SyS_mprotect+0xe9/0x250
10016 &mm->mmap_sem 41 [<ffffffff815351c4>] __do_page_fault+0x1d4/0x510
10117 &mm->mmap_sem 68 [<ffffffff81113d77>] vm_mmap_pgoff+0x87/0xd0
10218
10319.............................................................................................................................................................................................................................
10420
10521 unix_table_lock: 110 112 0.21 49.24 163.91 1.46 21094 66312 0.12 624.42 31589.81 0.48
10622 ---------------
10723 unix_table_lock 45 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
10824 unix_table_lock 47 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
10925 unix_table_lock 15 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
11026 unix_table_lock 5 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
11127 ---------------
11228 unix_table_lock 39 [<ffffffff8150b111>] unix_release_sock+0x31/0x250
11329 unix_table_lock 49 [<ffffffff8150ad8e>] unix_create1+0x16e/0x1b0
11430 unix_table_lock 20 [<ffffffff8150ca37>] unix_find_other+0x117/0x230
11531 unix_table_lock 4 [<ffffffff8150a09f>] unix_autobind+0x11f/0x1b0
116
117
118This excerpt shows the first two lock class statistics. Line 01 shows the
119output version - each time the format changes this will be updated. Line 02-04
120show the header with column descriptions. Lines 05-18 and 20-31 show the actual
121statistics. These statistics come in two parts; the actual stats separated by a
122short separator (line 08, 13) from the contention points.
123
124Lines 09-12 show the first 4 recorded contention points (the code
125which tries to get the lock) and lines 14-17 show the first 4 recorded
126contended points (the lock holder). It is possible that the max
127con-bounces point is missing in the statistics.
128
129The first lock (05-18) is a read/write lock, and shows two lines above the
130short separator. The contention points don't match the column descriptors,
131they have two: contentions and [<IP>] symbol. The second set of contention
132points are the points we're contending with.
133
134The integer part of the time values is in us.
135
136Dealing with nested locks, subclasses may appear:
137
13832...........................................................................................................................................................................................................................
13933
14034 &rq->lock: 13128 13128 0.43 190.53 103881.26 7.91 97454 3453404 0.00 401.11 13224683.11 3.82
14135 ---------
14236 &rq->lock 645 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
14337 &rq->lock 297 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14438 &rq->lock 360 [<ffffffff8103c4c5>] select_task_rq_fair+0x1f0/0x74a
14539 &rq->lock 428 [<ffffffff81045f98>] scheduler_tick+0x46/0x1fb
14640 ---------
14741 &rq->lock 77 [<ffffffff8103bfc4>] task_rq_lock+0x43/0x75
14842 &rq->lock 174 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
14943 &rq->lock 4715 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
15044 &rq->lock 893 [<ffffffff81340524>] schedule+0x157/0x7b8
15145
15246...........................................................................................................................................................................................................................
15347
15448 &rq->lock/1: 1526 11488 0.33 388.73 136294.31 11.86 21461 38404 0.00 37.93 109388.53 2.84
15549 -----------
15650 &rq->lock/1 11526 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
15751 -----------
15852 &rq->lock/1 5645 [<ffffffff8103ed4b>] double_rq_lock+0x42/0x54
15953 &rq->lock/1 1224 [<ffffffff81340524>] schedule+0x157/0x7b8
16054 &rq->lock/1 4336 [<ffffffff8103ed58>] double_rq_lock+0x4f/0x54
16155 &rq->lock/1 181 [<ffffffff8104ba65>] try_to_wake_up+0x127/0x25a
162
163Line 48 shows statistics for the second subclass (/1) of &rq->lock class
164(subclass starts from 0), since in this case, as line 50 suggests,
165double_rq_lock actually acquires a nested lock of two spinlocks.
166
167View the top contending locks:
168
169# grep : /proc/lock_stat | head
170 clockevents_lock: 2926159 2947636 0.15 46882.81 1784540466.34 605.41 3381345 3879161 0.00 2260.97 53178395.68 13.71
171 tick_broadcast_lock: 346460 346717 0.18 2257.43 39364622.71 113.54 3642919 4242696 0.00 2263.79 49173646.60 11.59
172 &mapping->i_mmap_mutex: 203896 203899 3.36 645530.05 31767507988.39 155800.21 3361776 8893984 0.17 2254.15 14110121.02 1.59
173 &rq->lock: 135014 136909 0.18 606.09 842160.68 6.15 1540728 10436146 0.00 728.72 17606683.41 1.69
174 &(&zone->lru_lock)->rlock: 93000 94934 0.16 59.18 188253.78 1.98 1199912 3809894 0.15 391.40 3559518.81 0.93
175 tasklist_lock-W: 40667 41130 0.23 1189.42 428980.51 10.43 270278 510106 0.16 653.51 3939674.91 7.72
176 tasklist_lock-R: 21298 21305 0.20 1310.05 215511.12 10.12 186204 241258 0.14 1162.33 1179779.23 4.89
177 rcu_node_1: 47656 49022 0.16 635.41 193616.41 3.95 844888 1865423 0.00 764.26 1656226.96 0.89
178 &(&dentry->d_lockref.lock)->rlock: 39791 40179 0.15 1302.08 88851.96 2.21 2790851 12527025 0.10 1910.75 3379714.27 0.27
179 rcu_node_0: 29203 30064 0.16 786.55 1555573.00 51.74 88963 244254 0.00 398.87 428872.51 1.76
180
181Clear the statistics:
182
183# echo 0 > /proc/lock_stat
diff --git a/Documentation/locking/locktorture.txt b/Documentation/locking/locktorture.rst
index 6a8df4cd19bf..e79eeeca3ac6 100644
--- a/Documentation/locking/locktorture.txt
+++ b/Documentation/locking/locktorture.rst
@@ -1,6 +1,9 @@
1==================================
1Kernel Lock Torture Test Operation 2Kernel Lock Torture Test Operation
3==================================
2 4
3CONFIG_LOCK_TORTURE_TEST 5CONFIG_LOCK_TORTURE_TEST
6========================
4 7
5The CONFIG LOCK_TORTURE_TEST config option provides a kernel module 8The CONFIG LOCK_TORTURE_TEST config option provides a kernel module
6that runs torture tests on core kernel locking primitives. The kernel 9that runs torture tests on core kernel locking primitives. The kernel
@@ -18,61 +21,77 @@ can be simulated by either enlarging this critical region hold time and/or
18creating more kthreads. 21creating more kthreads.
19 22
20 23
21MODULE PARAMETERS 24Module Parameters
25=================
22 26
23This module has the following parameters: 27This module has the following parameters:
24 28
25 29
26 ** Locktorture-specific ** 30Locktorture-specific
31--------------------
27 32
28nwriters_stress Number of kernel threads that will stress exclusive lock 33nwriters_stress
34 Number of kernel threads that will stress exclusive lock
29 ownership (writers). The default value is twice the number 35 ownership (writers). The default value is twice the number
30 of online CPUs. 36 of online CPUs.
31 37
32nreaders_stress Number of kernel threads that will stress shared lock 38nreaders_stress
39 Number of kernel threads that will stress shared lock
33 ownership (readers). The default is the same amount of writer 40 ownership (readers). The default is the same amount of writer
34 locks. If the user did not specify nwriters_stress, then 41 locks. If the user did not specify nwriters_stress, then
35 both readers and writers be the amount of online CPUs. 42 both readers and writers be the amount of online CPUs.
36 43
37torture_type Type of lock to torture. By default, only spinlocks will 44torture_type
45 Type of lock to torture. By default, only spinlocks will
38 be tortured. This module can torture the following locks, 46 be tortured. This module can torture the following locks,
39 with string values as follows: 47 with string values as follows:
40 48
41 o "lock_busted": Simulates a buggy lock implementation. 49 - "lock_busted":
50 Simulates a buggy lock implementation.
42 51
43 o "spin_lock": spin_lock() and spin_unlock() pairs. 52 - "spin_lock":
53 spin_lock() and spin_unlock() pairs.
44 54
45 o "spin_lock_irq": spin_lock_irq() and spin_unlock_irq() 55 - "spin_lock_irq":
46 pairs. 56 spin_lock_irq() and spin_unlock_irq() pairs.
47 57
48 o "rw_lock": read/write lock() and unlock() rwlock pairs. 58 - "rw_lock":
59 read/write lock() and unlock() rwlock pairs.
49 60
50 o "rw_lock_irq": read/write lock_irq() and unlock_irq() 61 - "rw_lock_irq":
51 rwlock pairs. 62 read/write lock_irq() and unlock_irq()
63 rwlock pairs.
52 64
53 o "mutex_lock": mutex_lock() and mutex_unlock() pairs. 65 - "mutex_lock":
66 mutex_lock() and mutex_unlock() pairs.
54 67
55 o "rtmutex_lock": rtmutex_lock() and rtmutex_unlock() 68 - "rtmutex_lock":
56 pairs. Kernel must have CONFIG_RT_MUTEX=y. 69 rtmutex_lock() and rtmutex_unlock() pairs.
70 Kernel must have CONFIG_RT_MUTEX=y.
57 71
58 o "rwsem_lock": read/write down() and up() semaphore pairs. 72 - "rwsem_lock":
73 read/write down() and up() semaphore pairs.
59 74
60 75
61 ** Torture-framework (RCU + locking) ** 76Torture-framework (RCU + locking)
77---------------------------------
62 78
63shutdown_secs The number of seconds to run the test before terminating 79shutdown_secs
80 The number of seconds to run the test before terminating
64 the test and powering off the system. The default is 81 the test and powering off the system. The default is
65 zero, which disables test termination and system shutdown. 82 zero, which disables test termination and system shutdown.
66 This capability is useful for automated testing. 83 This capability is useful for automated testing.
67 84
68onoff_interval The number of seconds between each attempt to execute a 85onoff_interval
86 The number of seconds between each attempt to execute a
69 randomly selected CPU-hotplug operation. Defaults 87 randomly selected CPU-hotplug operation. Defaults
70 to zero, which disables CPU hotplugging. In 88 to zero, which disables CPU hotplugging. In
71 CONFIG_HOTPLUG_CPU=n kernels, locktorture will silently 89 CONFIG_HOTPLUG_CPU=n kernels, locktorture will silently
72 refuse to do any CPU-hotplug operations regardless of 90 refuse to do any CPU-hotplug operations regardless of
73 what value is specified for onoff_interval. 91 what value is specified for onoff_interval.
74 92
75onoff_holdoff The number of seconds to wait until starting CPU-hotplug 93onoff_holdoff
94 The number of seconds to wait until starting CPU-hotplug
76 operations. This would normally only be used when 95 operations. This would normally only be used when
77 locktorture was built into the kernel and started 96 locktorture was built into the kernel and started
78 automatically at boot time, in which case it is useful 97 automatically at boot time, in which case it is useful
@@ -80,53 +99,59 @@ onoff_holdoff The number of seconds to wait until starting CPU-hotplug
80 coming and going. This parameter is only useful if 99 coming and going. This parameter is only useful if
81 CONFIG_HOTPLUG_CPU is enabled. 100 CONFIG_HOTPLUG_CPU is enabled.
82 101
83stat_interval Number of seconds between statistics-related printk()s. 102stat_interval
103 Number of seconds between statistics-related printk()s.
84 By default, locktorture will report stats every 60 seconds. 104 By default, locktorture will report stats every 60 seconds.
85 Setting the interval to zero causes the statistics to 105 Setting the interval to zero causes the statistics to
86 be printed -only- when the module is unloaded, and this 106 be printed -only- when the module is unloaded, and this
87 is the default. 107 is the default.
88 108
89stutter The length of time to run the test before pausing for this 109stutter
110 The length of time to run the test before pausing for this
90 same period of time. Defaults to "stutter=5", so as 111 same period of time. Defaults to "stutter=5", so as
91 to run and pause for (roughly) five-second intervals. 112 to run and pause for (roughly) five-second intervals.
92 Specifying "stutter=0" causes the test to run continuously 113 Specifying "stutter=0" causes the test to run continuously
93 without pausing, which is the old default behavior. 114 without pausing, which is the old default behavior.
94 115
95shuffle_interval The number of seconds to keep the test threads affinitied 116shuffle_interval
117 The number of seconds to keep the test threads affinitied
96 to a particular subset of the CPUs, defaults to 3 seconds. 118 to a particular subset of the CPUs, defaults to 3 seconds.
97 Used in conjunction with test_no_idle_hz. 119 Used in conjunction with test_no_idle_hz.
98 120
99verbose Enable verbose debugging printing, via printk(). Enabled 121verbose
122 Enable verbose debugging printing, via printk(). Enabled
100 by default. This extra information is mostly related to 123 by default. This extra information is mostly related to
101 high-level errors and reports from the main 'torture' 124 high-level errors and reports from the main 'torture'
102 framework. 125 framework.
103 126
104 127
105STATISTICS 128Statistics
129==========
106 130
107Statistics are printed in the following format: 131Statistics are printed in the following format::
108 132
109spin_lock-torture: Writes: Total: 93746064 Max/Min: 0/0 Fail: 0 133 spin_lock-torture: Writes: Total: 93746064 Max/Min: 0/0 Fail: 0
110 (A) (B) (C) (D) (E) 134 (A) (B) (C) (D) (E)
111 135
112(A): Lock type that is being tortured -- torture_type parameter. 136 (A): Lock type that is being tortured -- torture_type parameter.
113 137
114(B): Number of writer lock acquisitions. If dealing with a read/write primitive 138 (B): Number of writer lock acquisitions. If dealing with a read/write
115 a second "Reads" statistics line is printed. 139 primitive a second "Reads" statistics line is printed.
116 140
117(C): Number of times the lock was acquired. 141 (C): Number of times the lock was acquired.
118 142
119(D): Min and max number of times threads failed to acquire the lock. 143 (D): Min and max number of times threads failed to acquire the lock.
120 144
121(E): true/false values if there were errors acquiring the lock. This should 145 (E): true/false values if there were errors acquiring the lock. This should
122 -only- be positive if there is a bug in the locking primitive's 146 -only- be positive if there is a bug in the locking primitive's
123 implementation. Otherwise a lock should never fail (i.e., spin_lock()). 147 implementation. Otherwise a lock should never fail (i.e., spin_lock()).
124 Of course, the same applies for (C), above. A dummy example of this is 148 Of course, the same applies for (C), above. A dummy example of this is
125 the "lock_busted" type. 149 the "lock_busted" type.
126 150
127USAGE 151Usage
152=====
128 153
129The following script may be used to torture locks: 154The following script may be used to torture locks::
130 155
131 #!/bin/sh 156 #!/bin/sh
132 157
diff --git a/Documentation/locking/mutex-design.txt b/Documentation/locking/mutex-design.rst
index 818aca19612f..4d8236b81fa5 100644
--- a/Documentation/locking/mutex-design.txt
+++ b/Documentation/locking/mutex-design.rst
@@ -1,6 +1,9 @@
1=======================
1Generic Mutex Subsystem 2Generic Mutex Subsystem
3=======================
2 4
3started by Ingo Molnar <mingo@redhat.com> 5started by Ingo Molnar <mingo@redhat.com>
6
4updated by Davidlohr Bueso <davidlohr@hp.com> 7updated by Davidlohr Bueso <davidlohr@hp.com>
5 8
6What are mutexes? 9What are mutexes?
@@ -23,7 +26,7 @@ Implementation
23Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h 26Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h
24and implemented in kernel/locking/mutex.c. These locks use an atomic variable 27and implemented in kernel/locking/mutex.c. These locks use an atomic variable
25(->owner) to keep track of the lock state during its lifetime. Field owner 28(->owner) to keep track of the lock state during its lifetime. Field owner
26actually contains 'struct task_struct *' to the current lock owner and it is 29actually contains `struct task_struct *` to the current lock owner and it is
27therefore NULL if not currently owned. Since task_struct pointers are aligned 30therefore NULL if not currently owned. Since task_struct pointers are aligned
28at at least L1_CACHE_BYTES, low bits (3) are used to store extra state (e.g., 31at at least L1_CACHE_BYTES, low bits (3) are used to store extra state (e.g.,
29if waiter list is non-empty). In its most basic form it also includes a 32if waiter list is non-empty). In its most basic form it also includes a
@@ -101,29 +104,36 @@ features that make lock debugging easier and faster:
101 104
102Interfaces 105Interfaces
103---------- 106----------
104Statically define the mutex: 107Statically define the mutex::
108
105 DEFINE_MUTEX(name); 109 DEFINE_MUTEX(name);
106 110
107Dynamically initialize the mutex: 111Dynamically initialize the mutex::
112
108 mutex_init(mutex); 113 mutex_init(mutex);
109 114
110Acquire the mutex, uninterruptible: 115Acquire the mutex, uninterruptible::
116
111 void mutex_lock(struct mutex *lock); 117 void mutex_lock(struct mutex *lock);
112 void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 118 void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
113 int mutex_trylock(struct mutex *lock); 119 int mutex_trylock(struct mutex *lock);
114 120
115Acquire the mutex, interruptible: 121Acquire the mutex, interruptible::
122
116 int mutex_lock_interruptible_nested(struct mutex *lock, 123 int mutex_lock_interruptible_nested(struct mutex *lock,
117 unsigned int subclass); 124 unsigned int subclass);
118 int mutex_lock_interruptible(struct mutex *lock); 125 int mutex_lock_interruptible(struct mutex *lock);
119 126
120Acquire the mutex, interruptible, if dec to 0: 127Acquire the mutex, interruptible, if dec to 0::
128
121 int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); 129 int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
122 130
123Unlock the mutex: 131Unlock the mutex::
132
124 void mutex_unlock(struct mutex *lock); 133 void mutex_unlock(struct mutex *lock);
125 134
126Test if the mutex is taken: 135Test if the mutex is taken::
136
127 int mutex_is_locked(struct mutex *lock); 137 int mutex_is_locked(struct mutex *lock);
128 138
129Disadvantages 139Disadvantages
diff --git a/Documentation/locking/rt-mutex-design.txt b/Documentation/locking/rt-mutex-design.rst
index 3d7b865539cc..59c2a64efb21 100644
--- a/Documentation/locking/rt-mutex-design.txt
+++ b/Documentation/locking/rt-mutex-design.rst
@@ -1,14 +1,15 @@
1# 1==============================
2# Copyright (c) 2006 Steven Rostedt
3# Licensed under the GNU Free Documentation License, Version 1.2
4#
5
6RT-mutex implementation design 2RT-mutex implementation design
7------------------------------ 3==============================
4
5Copyright (c) 2006 Steven Rostedt
6
7Licensed under the GNU Free Documentation License, Version 1.2
8
8 9
9This document tries to describe the design of the rtmutex.c implementation. 10This document tries to describe the design of the rtmutex.c implementation.
10It doesn't describe the reasons why rtmutex.c exists. For that please see 11It doesn't describe the reasons why rtmutex.c exists. For that please see
11Documentation/locking/rt-mutex.txt. Although this document does explain problems 12Documentation/locking/rt-mutex.rst. Although this document does explain problems
12that happen without this code, but that is in the concept to understand 13that happen without this code, but that is in the concept to understand
13what the code actually is doing. 14what the code actually is doing.
14 15
@@ -41,17 +42,17 @@ to release the lock, because for all we know, B is a CPU hog and will
41never give C a chance to release the lock. This is called unbounded priority 42never give C a chance to release the lock. This is called unbounded priority
42inversion. 43inversion.
43 44
44Here's a little ASCII art to show the problem. 45Here's a little ASCII art to show the problem::
45 46
46 grab lock L1 (owned by C) 47 grab lock L1 (owned by C)
47 | 48 |
48A ---+ 49 A ---+
49 C preempted by B 50 C preempted by B
50 | 51 |
51C +----+ 52 C +----+
52 53
53B +--------> 54 B +-------->
54 B now keeps A from running. 55 B now keeps A from running.
55 56
56 57
57Priority Inheritance (PI) 58Priority Inheritance (PI)
@@ -75,24 +76,29 @@ Terminology
75Here I explain some terminology that is used in this document to help describe 76Here I explain some terminology that is used in this document to help describe
76the design that is used to implement PI. 77the design that is used to implement PI.
77 78
78PI chain - The PI chain is an ordered series of locks and processes that cause 79PI chain
80 - The PI chain is an ordered series of locks and processes that cause
79 processes to inherit priorities from a previous process that is 81 processes to inherit priorities from a previous process that is
80 blocked on one of its locks. This is described in more detail 82 blocked on one of its locks. This is described in more detail
81 later in this document. 83 later in this document.
82 84
83mutex - In this document, to differentiate from locks that implement 85mutex
86 - In this document, to differentiate from locks that implement
84 PI and spin locks that are used in the PI code, from now on 87 PI and spin locks that are used in the PI code, from now on
85 the PI locks will be called a mutex. 88 the PI locks will be called a mutex.
86 89
87lock - In this document from now on, I will use the term lock when 90lock
91 - In this document from now on, I will use the term lock when
88 referring to spin locks that are used to protect parts of the PI 92 referring to spin locks that are used to protect parts of the PI
89 algorithm. These locks disable preemption for UP (when 93 algorithm. These locks disable preemption for UP (when
90 CONFIG_PREEMPT is enabled) and on SMP prevents multiple CPUs from 94 CONFIG_PREEMPT is enabled) and on SMP prevents multiple CPUs from
91 entering critical sections simultaneously. 95 entering critical sections simultaneously.
92 96
93spin lock - Same as lock above. 97spin lock
98 - Same as lock above.
94 99
95waiter - A waiter is a struct that is stored on the stack of a blocked 100waiter
101 - A waiter is a struct that is stored on the stack of a blocked
96 process. Since the scope of the waiter is within the code for 102 process. Since the scope of the waiter is within the code for
97 a process being blocked on the mutex, it is fine to allocate 103 a process being blocked on the mutex, it is fine to allocate
98 the waiter on the process's stack (local variable). This 104 the waiter on the process's stack (local variable). This
@@ -104,14 +110,18 @@ waiter - A waiter is a struct that is stored on the stack of a blocked
104 waiter is sometimes used in reference to the task that is waiting 110 waiter is sometimes used in reference to the task that is waiting
105 on a mutex. This is the same as waiter->task. 111 on a mutex. This is the same as waiter->task.
106 112
107waiters - A list of processes that are blocked on a mutex. 113waiters
114 - A list of processes that are blocked on a mutex.
108 115
109top waiter - The highest priority process waiting on a specific mutex. 116top waiter
117 - The highest priority process waiting on a specific mutex.
110 118
111top pi waiter - The highest priority process waiting on one of the mutexes 119top pi waiter
120 - The highest priority process waiting on one of the mutexes
112 that a specific process owns. 121 that a specific process owns.
113 122
114Note: task and process are used interchangeably in this document, mostly to 123Note:
124 task and process are used interchangeably in this document, mostly to
115 differentiate between two processes that are being described together. 125 differentiate between two processes that are being described together.
116 126
117 127
@@ -123,7 +133,7 @@ inheritance to take place. Multiple chains may converge, but a chain
123would never diverge, since a process can't be blocked on more than one 133would never diverge, since a process can't be blocked on more than one
124mutex at a time. 134mutex at a time.
125 135
126Example: 136Example::
127 137
128 Process: A, B, C, D, E 138 Process: A, B, C, D, E
129 Mutexes: L1, L2, L3, L4 139 Mutexes: L1, L2, L3, L4
@@ -137,21 +147,21 @@ Example:
137 D owns L4 147 D owns L4
138 E blocked on L4 148 E blocked on L4
139 149
140The chain would be: 150The chain would be::
141 151
142 E->L4->D->L3->C->L2->B->L1->A 152 E->L4->D->L3->C->L2->B->L1->A
143 153
144To show where two chains merge, we could add another process F and 154To show where two chains merge, we could add another process F and
145another mutex L5 where B owns L5 and F is blocked on mutex L5. 155another mutex L5 where B owns L5 and F is blocked on mutex L5.
146 156
147The chain for F would be: 157The chain for F would be::
148 158
149 F->L5->B->L1->A 159 F->L5->B->L1->A
150 160
151Since a process may own more than one mutex, but never be blocked on more than 161Since a process may own more than one mutex, but never be blocked on more than
152one, the chains merge. 162one, the chains merge.
153 163
154Here we show both chains: 164Here we show both chains::
155 165
156 E->L4->D->L3->C->L2-+ 166 E->L4->D->L3->C->L2-+
157 | 167 |
@@ -165,12 +175,12 @@ than the processes to the left or below in the chain.
165 175
166Also since a mutex may have more than one process blocked on it, we can 176Also since a mutex may have more than one process blocked on it, we can
167have multiple chains merge at mutexes. If we add another process G that is 177have multiple chains merge at mutexes. If we add another process G that is
168blocked on mutex L2: 178blocked on mutex L2::
169 179
170 G->L2->B->L1->A 180 G->L2->B->L1->A
171 181
172And once again, to show how this can grow I will show the merging chains 182And once again, to show how this can grow I will show the merging chains
173again. 183again::
174 184
175 E->L4->D->L3->C-+ 185 E->L4->D->L3->C-+
176 +->L2-+ 186 +->L2-+
@@ -184,7 +194,7 @@ the chain (A and B in this example), must have their priorities increased
184to that of G. 194to that of G.
185 195
186Mutex Waiters Tree 196Mutex Waiters Tree
187----------------- 197------------------
188 198
189Every mutex keeps track of all the waiters that are blocked on itself. The 199Every mutex keeps track of all the waiters that are blocked on itself. The
190mutex has a rbtree to store these waiters by priority. This tree is protected 200mutex has a rbtree to store these waiters by priority. This tree is protected
@@ -219,19 +229,19 @@ defined. But is very complex to figure it out, since it depends on all
219the nesting of mutexes. Let's look at the example where we have 3 mutexes, 229the nesting of mutexes. Let's look at the example where we have 3 mutexes,
220L1, L2, and L3, and four separate functions func1, func2, func3 and func4. 230L1, L2, and L3, and four separate functions func1, func2, func3 and func4.
221The following shows a locking order of L1->L2->L3, but may not actually 231The following shows a locking order of L1->L2->L3, but may not actually
222be directly nested that way. 232be directly nested that way::
223 233
224void func1(void) 234 void func1(void)
225{ 235 {
226 mutex_lock(L1); 236 mutex_lock(L1);
227 237
228 /* do anything */ 238 /* do anything */
229 239
230 mutex_unlock(L1); 240 mutex_unlock(L1);
231} 241 }
232 242
233void func2(void) 243 void func2(void)
234{ 244 {
235 mutex_lock(L1); 245 mutex_lock(L1);
236 mutex_lock(L2); 246 mutex_lock(L2);
237 247
@@ -239,10 +249,10 @@ void func2(void)
239 249
240 mutex_unlock(L2); 250 mutex_unlock(L2);
241 mutex_unlock(L1); 251 mutex_unlock(L1);
242} 252 }
243 253
244void func3(void) 254 void func3(void)
245{ 255 {
246 mutex_lock(L2); 256 mutex_lock(L2);
247 mutex_lock(L3); 257 mutex_lock(L3);
248 258
@@ -250,30 +260,30 @@ void func3(void)
250 260
251 mutex_unlock(L3); 261 mutex_unlock(L3);
252 mutex_unlock(L2); 262 mutex_unlock(L2);
253} 263 }
254 264
255void func4(void) 265 void func4(void)
256{ 266 {
257 mutex_lock(L3); 267 mutex_lock(L3);
258 268
259 /* do something again */ 269 /* do something again */
260 270
261 mutex_unlock(L3); 271 mutex_unlock(L3);
262} 272 }
263 273
264Now we add 4 processes that run each of these functions separately. 274Now we add 4 processes that run each of these functions separately.
265Processes A, B, C, and D which run functions func1, func2, func3 and func4 275Processes A, B, C, and D which run functions func1, func2, func3 and func4
266respectively, and such that D runs first and A last. With D being preempted 276respectively, and such that D runs first and A last. With D being preempted
267in func4 in the "do something again" area, we have a locking that follows: 277in func4 in the "do something again" area, we have a locking that follows::
268 278
269D owns L3 279 D owns L3
270 C blocked on L3 280 C blocked on L3
271 C owns L2 281 C owns L2
272 B blocked on L2 282 B blocked on L2
273 B owns L1 283 B owns L1
274 A blocked on L1 284 A blocked on L1
275 285
276And thus we have the chain A->L1->B->L2->C->L3->D. 286 And thus we have the chain A->L1->B->L2->C->L3->D.
277 287
278This gives us a PI depth of 4 (four processes), but looking at any of the 288This gives us a PI depth of 4 (four processes), but looking at any of the
279functions individually, it seems as though they only have at most a locking 289functions individually, it seems as though they only have at most a locking
@@ -298,7 +308,7 @@ not true, the rtmutex.c code will be broken!), this allows for the least
298significant bit to be used as a flag. Bit 0 is used as the "Has Waiters" 308significant bit to be used as a flag. Bit 0 is used as the "Has Waiters"
299flag. It's set whenever there are waiters on a mutex. 309flag. It's set whenever there are waiters on a mutex.
300 310
301See Documentation/locking/rt-mutex.txt for further details. 311See Documentation/locking/rt-mutex.rst for further details.
302 312
303cmpxchg Tricks 313cmpxchg Tricks
304-------------- 314--------------
@@ -307,17 +317,17 @@ Some architectures implement an atomic cmpxchg (Compare and Exchange). This
307is used (when applicable) to keep the fast path of grabbing and releasing 317is used (when applicable) to keep the fast path of grabbing and releasing
308mutexes short. 318mutexes short.
309 319
310cmpxchg is basically the following function performed atomically: 320cmpxchg is basically the following function performed atomically::
311 321
312unsigned long _cmpxchg(unsigned long *A, unsigned long *B, unsigned long *C) 322 unsigned long _cmpxchg(unsigned long *A, unsigned long *B, unsigned long *C)
313{ 323 {
314 unsigned long T = *A; 324 unsigned long T = *A;
315 if (*A == *B) { 325 if (*A == *B) {
316 *A = *C; 326 *A = *C;
317 } 327 }
318 return T; 328 return T;
319} 329 }
320#define cmpxchg(a,b,c) _cmpxchg(&a,&b,&c) 330 #define cmpxchg(a,b,c) _cmpxchg(&a,&b,&c)
321 331
322This is really nice to have, since it allows you to only update a variable 332This is really nice to have, since it allows you to only update a variable
323if the variable is what you expect it to be. You know if it succeeded if 333if the variable is what you expect it to be. You know if it succeeded if
@@ -352,9 +362,10 @@ Then rt_mutex_setprio is called to adjust the priority of the task to the
352new priority. Note that rt_mutex_setprio is defined in kernel/sched/core.c 362new priority. Note that rt_mutex_setprio is defined in kernel/sched/core.c
353to implement the actual change in priority. 363to implement the actual change in priority.
354 364
355(Note: For the "prio" field in task_struct, the lower the number, the 365Note:
366 For the "prio" field in task_struct, the lower the number, the
356 higher the priority. A "prio" of 5 is of higher priority than a 367 higher the priority. A "prio" of 5 is of higher priority than a
357 "prio" of 10.) 368 "prio" of 10.
358 369
359It is interesting to note that rt_mutex_adjust_prio can either increase 370It is interesting to note that rt_mutex_adjust_prio can either increase
360or decrease the priority of the task. In the case that a higher priority 371or decrease the priority of the task. In the case that a higher priority
@@ -439,6 +450,7 @@ wait_lock, which this code currently holds. So setting the "Has Waiters" flag
439forces the current owner to synchronize with this code. 450forces the current owner to synchronize with this code.
440 451
441The lock is taken if the following are true: 452The lock is taken if the following are true:
453
442 1) The lock has no owner 454 1) The lock has no owner
443 2) The current task is the highest priority against all other 455 2) The current task is the highest priority against all other
444 waiters of the lock 456 waiters of the lock
@@ -546,10 +558,13 @@ Credits
546------- 558-------
547 559
548Author: Steven Rostedt <rostedt@goodmis.org> 560Author: Steven Rostedt <rostedt@goodmis.org>
561
549Updated: Alex Shi <alex.shi@linaro.org> - 7/6/2017 562Updated: Alex Shi <alex.shi@linaro.org> - 7/6/2017
550 563
551Original Reviewers: Ingo Molnar, Thomas Gleixner, Thomas Duetsch, and 564Original Reviewers:
565 Ingo Molnar, Thomas Gleixner, Thomas Duetsch, and
552 Randy Dunlap 566 Randy Dunlap
567
553Update (7/6/2017) Reviewers: Steven Rostedt and Sebastian Siewior 568Update (7/6/2017) Reviewers: Steven Rostedt and Sebastian Siewior
554 569
555Updates 570Updates
diff --git a/Documentation/locking/rt-mutex.txt b/Documentation/locking/rt-mutex.rst
index 35793e003041..c365dc302081 100644
--- a/Documentation/locking/rt-mutex.txt
+++ b/Documentation/locking/rt-mutex.rst
@@ -1,5 +1,6 @@
1==================================
1RT-mutex subsystem with PI support 2RT-mutex subsystem with PI support
2---------------------------------- 3==================================
3 4
4RT-mutexes with priority inheritance are used to support PI-futexes, 5RT-mutexes with priority inheritance are used to support PI-futexes,
5which enable pthread_mutex_t priority inheritance attributes 6which enable pthread_mutex_t priority inheritance attributes
@@ -46,27 +47,30 @@ The state of the rt-mutex is tracked via the owner field of the rt-mutex
46structure: 47structure:
47 48
48lock->owner holds the task_struct pointer of the owner. Bit 0 is used to 49lock->owner holds the task_struct pointer of the owner. Bit 0 is used to
49keep track of the "lock has waiters" state. 50keep track of the "lock has waiters" state:
50 51
51 owner bit0 52 ============ ======= ================================================
53 owner bit0 Notes
54 ============ ======= ================================================
52 NULL 0 lock is free (fast acquire possible) 55 NULL 0 lock is free (fast acquire possible)
53 NULL 1 lock is free and has waiters and the top waiter 56 NULL 1 lock is free and has waiters and the top waiter
54 is going to take the lock* 57 is going to take the lock [1]_
55 taskpointer 0 lock is held (fast release possible) 58 taskpointer 0 lock is held (fast release possible)
56 taskpointer 1 lock is held and has waiters** 59 taskpointer 1 lock is held and has waiters [2]_
60 ============ ======= ================================================
57 61
58The fast atomic compare exchange based acquire and release is only 62The fast atomic compare exchange based acquire and release is only
59possible when bit 0 of lock->owner is 0. 63possible when bit 0 of lock->owner is 0.
60 64
61(*) It also can be a transitional state when grabbing the lock 65.. [1] It also can be a transitional state when grabbing the lock
62with ->wait_lock is held. To prevent any fast path cmpxchg to the lock, 66 with ->wait_lock is held. To prevent any fast path cmpxchg to the lock,
63we need to set the bit0 before looking at the lock, and the owner may be 67 we need to set the bit0 before looking at the lock, and the owner may
64NULL in this small time, hence this can be a transitional state. 68 be NULL in this small time, hence this can be a transitional state.
65 69
66(**) There is a small time when bit 0 is set but there are no 70.. [2] There is a small time when bit 0 is set but there are no
67waiters. This can happen when grabbing the lock in the slow path. 71 waiters. This can happen when grabbing the lock in the slow path.
68To prevent a cmpxchg of the owner releasing the lock, we need to 72 To prevent a cmpxchg of the owner releasing the lock, we need to
69set this bit before looking at the lock. 73 set this bit before looking at the lock.
70 74
71BTW, there is still technically a "Pending Owner", it's just not called 75BTW, there is still technically a "Pending Owner", it's just not called
72that anymore. The pending owner happens to be the top_waiter of a lock 76that anymore. The pending owner happens to be the top_waiter of a lock
diff --git a/Documentation/locking/spinlocks.txt b/Documentation/locking/spinlocks.rst
index ff35e40bdf5b..098107fb7d86 100644
--- a/Documentation/locking/spinlocks.txt
+++ b/Documentation/locking/spinlocks.rst
@@ -1,8 +1,13 @@
1===============
2Locking lessons
3===============
4
1Lesson 1: Spin locks 5Lesson 1: Spin locks
6====================
2 7
3The most basic primitive for locking is spinlock. 8The most basic primitive for locking is spinlock::
4 9
5static DEFINE_SPINLOCK(xxx_lock); 10 static DEFINE_SPINLOCK(xxx_lock);
6 11
7 unsigned long flags; 12 unsigned long flags;
8 13
@@ -19,23 +24,25 @@ worry about UP vs SMP issues: the spinlocks work correctly under both.
19 NOTE! Implications of spin_locks for memory are further described in: 24 NOTE! Implications of spin_locks for memory are further described in:
20 25
21 Documentation/memory-barriers.txt 26 Documentation/memory-barriers.txt
27
22 (5) LOCK operations. 28 (5) LOCK operations.
29
23 (6) UNLOCK operations. 30 (6) UNLOCK operations.
24 31
25The above is usually pretty simple (you usually need and want only one 32The above is usually pretty simple (you usually need and want only one
26spinlock for most things - using more than one spinlock can make things a 33spinlock for most things - using more than one spinlock can make things a
27lot more complex and even slower and is usually worth it only for 34lot more complex and even slower and is usually worth it only for
28sequences that you _know_ need to be split up: avoid it at all cost if you 35sequences that you **know** need to be split up: avoid it at all cost if you
29aren't sure). 36aren't sure).
30 37
31This is really the only really hard part about spinlocks: once you start 38This is really the only really hard part about spinlocks: once you start
32using spinlocks they tend to expand to areas you might not have noticed 39using spinlocks they tend to expand to areas you might not have noticed
33before, because you have to make sure the spinlocks correctly protect the 40before, because you have to make sure the spinlocks correctly protect the
34shared data structures _everywhere_ they are used. The spinlocks are most 41shared data structures **everywhere** they are used. The spinlocks are most
35easily added to places that are completely independent of other code (for 42easily added to places that are completely independent of other code (for
36example, internal driver data structures that nobody else ever touches). 43example, internal driver data structures that nobody else ever touches).
37 44
38 NOTE! The spin-lock is safe only when you _also_ use the lock itself 45 NOTE! The spin-lock is safe only when you **also** use the lock itself
39 to do locking across CPU's, which implies that EVERYTHING that 46 to do locking across CPU's, which implies that EVERYTHING that
40 touches a shared variable has to agree about the spinlock they want 47 touches a shared variable has to agree about the spinlock they want
41 to use. 48 to use.
@@ -43,6 +50,7 @@ example, internal driver data structures that nobody else ever touches).
43---- 50----
44 51
45Lesson 2: reader-writer spinlocks. 52Lesson 2: reader-writer spinlocks.
53==================================
46 54
47If your data accesses have a very natural pattern where you usually tend 55If your data accesses have a very natural pattern where you usually tend
48to mostly read from the shared variables, the reader-writer locks 56to mostly read from the shared variables, the reader-writer locks
@@ -54,7 +62,7 @@ to change the variables it has to get an exclusive write lock.
54 simple spinlocks. Unless the reader critical section is long, you 62 simple spinlocks. Unless the reader critical section is long, you
55 are better off just using spinlocks. 63 are better off just using spinlocks.
56 64
57The routines look the same as above: 65The routines look the same as above::
58 66
59 rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock); 67 rwlock_t xxx_lock = __RW_LOCK_UNLOCKED(xxx_lock);
60 68
@@ -71,7 +79,7 @@ The routines look the same as above:
71The above kind of lock may be useful for complex data structures like 79The above kind of lock may be useful for complex data structures like
72linked lists, especially searching for entries without changing the list 80linked lists, especially searching for entries without changing the list
73itself. The read lock allows many concurrent readers. Anything that 81itself. The read lock allows many concurrent readers. Anything that
74_changes_ the list will have to get the write lock. 82**changes** the list will have to get the write lock.
75 83
76 NOTE! RCU is better for list traversal, but requires careful 84 NOTE! RCU is better for list traversal, but requires careful
77 attention to design detail (see Documentation/RCU/listRCU.txt). 85 attention to design detail (see Documentation/RCU/listRCU.txt).
@@ -87,10 +95,11 @@ to get the write-lock at the very beginning.
87---- 95----
88 96
89Lesson 3: spinlocks revisited. 97Lesson 3: spinlocks revisited.
98==============================
90 99
91The single spin-lock primitives above are by no means the only ones. They 100The single spin-lock primitives above are by no means the only ones. They
92are the most safe ones, and the ones that work under all circumstances, 101are the most safe ones, and the ones that work under all circumstances,
93but partly _because_ they are safe they are also fairly slow. They are slower 102but partly **because** they are safe they are also fairly slow. They are slower
94than they'd need to be, because they do have to disable interrupts 103than they'd need to be, because they do have to disable interrupts
95(which is just a single instruction on a x86, but it's an expensive one - 104(which is just a single instruction on a x86, but it's an expensive one -
96and on other architectures it can be worse). 105and on other architectures it can be worse).
@@ -98,7 +107,7 @@ and on other architectures it can be worse).
98If you have a case where you have to protect a data structure across 107If you have a case where you have to protect a data structure across
99several CPU's and you want to use spinlocks you can potentially use 108several CPU's and you want to use spinlocks you can potentially use
100cheaper versions of the spinlocks. IFF you know that the spinlocks are 109cheaper versions of the spinlocks. IFF you know that the spinlocks are
101never used in interrupt handlers, you can use the non-irq versions: 110never used in interrupt handlers, you can use the non-irq versions::
102 111
103 spin_lock(&lock); 112 spin_lock(&lock);
104 ... 113 ...
@@ -110,7 +119,7 @@ This is useful if you know that the data in question is only ever
110manipulated from a "process context", ie no interrupts involved. 119manipulated from a "process context", ie no interrupts involved.
111 120
112The reasons you mustn't use these versions if you have interrupts that 121The reasons you mustn't use these versions if you have interrupts that
113play with the spinlock is that you can get deadlocks: 122play with the spinlock is that you can get deadlocks::
114 123
115 spin_lock(&lock); 124 spin_lock(&lock);
116 ... 125 ...
@@ -147,9 +156,10 @@ indeed), while write-locks need to protect themselves against interrupts.
147---- 156----
148 157
149Reference information: 158Reference information:
159======================
150 160
151For dynamic initialization, use spin_lock_init() or rwlock_init() as 161For dynamic initialization, use spin_lock_init() or rwlock_init() as
152appropriate: 162appropriate::
153 163
154 spinlock_t xxx_lock; 164 spinlock_t xxx_lock;
155 rwlock_t xxx_rw_lock; 165 rwlock_t xxx_rw_lock;
diff --git a/Documentation/locking/ww-mutex-design.txt b/Documentation/locking/ww-mutex-design.rst
index f0ed7c30e695..1846c199da23 100644
--- a/Documentation/locking/ww-mutex-design.txt
+++ b/Documentation/locking/ww-mutex-design.rst
@@ -1,3 +1,4 @@
1======================================
1Wound/Wait Deadlock-Proof Mutex Design 2Wound/Wait Deadlock-Proof Mutex Design
2====================================== 3======================================
3 4
@@ -85,6 +86,7 @@ Furthermore there are three different class of w/w lock acquire functions:
85 no deadlock potential and hence the ww_mutex_lock call will block and not 86 no deadlock potential and hence the ww_mutex_lock call will block and not
86 prematurely return -EDEADLK. The advantage of the _slow functions is in 87 prematurely return -EDEADLK. The advantage of the _slow functions is in
87 interface safety: 88 interface safety:
89
88 - ww_mutex_lock has a __must_check int return type, whereas ww_mutex_lock_slow 90 - ww_mutex_lock has a __must_check int return type, whereas ww_mutex_lock_slow
89 has a void return type. Note that since ww mutex code needs loops/retries 91 has a void return type. Note that since ww mutex code needs loops/retries
90 anyway the __must_check doesn't result in spurious warnings, even though the 92 anyway the __must_check doesn't result in spurious warnings, even though the
@@ -115,36 +117,36 @@ expect the number of simultaneous competing transactions to be typically small,
115and you want to reduce the number of rollbacks. 117and you want to reduce the number of rollbacks.
116 118
117Three different ways to acquire locks within the same w/w class. Common 119Three different ways to acquire locks within the same w/w class. Common
118definitions for methods #1 and #2: 120definitions for methods #1 and #2::
119 121
120static DEFINE_WW_CLASS(ww_class); 122 static DEFINE_WW_CLASS(ww_class);
121 123
122struct obj { 124 struct obj {
123 struct ww_mutex lock; 125 struct ww_mutex lock;
124 /* obj data */ 126 /* obj data */
125}; 127 };
126 128
127struct obj_entry { 129 struct obj_entry {
128 struct list_head head; 130 struct list_head head;
129 struct obj *obj; 131 struct obj *obj;
130}; 132 };
131 133
132Method 1, using a list in execbuf->buffers that's not allowed to be reordered. 134Method 1, using a list in execbuf->buffers that's not allowed to be reordered.
133This is useful if a list of required objects is already tracked somewhere. 135This is useful if a list of required objects is already tracked somewhere.
134Furthermore the lock helper can use propagate the -EALREADY return code back to 136Furthermore the lock helper can use propagate the -EALREADY return code back to
135the caller as a signal that an object is twice on the list. This is useful if 137the caller as a signal that an object is twice on the list. This is useful if
136the list is constructed from userspace input and the ABI requires userspace to 138the list is constructed from userspace input and the ABI requires userspace to
137not have duplicate entries (e.g. for a gpu commandbuffer submission ioctl). 139not have duplicate entries (e.g. for a gpu commandbuffer submission ioctl)::
138 140
139int lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx) 141 int lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
140{ 142 {
141 struct obj *res_obj = NULL; 143 struct obj *res_obj = NULL;
142 struct obj_entry *contended_entry = NULL; 144 struct obj_entry *contended_entry = NULL;
143 struct obj_entry *entry; 145 struct obj_entry *entry;
144 146
145 ww_acquire_init(ctx, &ww_class); 147 ww_acquire_init(ctx, &ww_class);
146 148
147retry: 149 retry:
148 list_for_each_entry (entry, list, head) { 150 list_for_each_entry (entry, list, head) {
149 if (entry->obj == res_obj) { 151 if (entry->obj == res_obj) {
150 res_obj = NULL; 152 res_obj = NULL;
@@ -160,7 +162,7 @@ retry:
160 ww_acquire_done(ctx); 162 ww_acquire_done(ctx);
161 return 0; 163 return 0;
162 164
163err: 165 err:
164 list_for_each_entry_continue_reverse (entry, list, head) 166 list_for_each_entry_continue_reverse (entry, list, head)
165 ww_mutex_unlock(&entry->obj->lock); 167 ww_mutex_unlock(&entry->obj->lock);
166 168
@@ -176,14 +178,14 @@ err:
176 ww_acquire_fini(ctx); 178 ww_acquire_fini(ctx);
177 179
178 return ret; 180 return ret;
179} 181 }
180 182
181Method 2, using a list in execbuf->buffers that can be reordered. Same semantics 183Method 2, using a list in execbuf->buffers that can be reordered. Same semantics
182of duplicate entry detection using -EALREADY as method 1 above. But the 184of duplicate entry detection using -EALREADY as method 1 above. But the
183list-reordering allows for a bit more idiomatic code. 185list-reordering allows for a bit more idiomatic code::
184 186
185int lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx) 187 int lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
186{ 188 {
187 struct obj_entry *entry, *entry2; 189 struct obj_entry *entry, *entry2;
188 190
189 ww_acquire_init(ctx, &ww_class); 191 ww_acquire_init(ctx, &ww_class);
@@ -216,24 +218,25 @@ int lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
216 218
217 ww_acquire_done(ctx); 219 ww_acquire_done(ctx);
218 return 0; 220 return 0;
219} 221 }
220 222
221Unlocking works the same way for both methods #1 and #2: 223Unlocking works the same way for both methods #1 and #2::
222 224
223void unlock_objs(struct list_head *list, struct ww_acquire_ctx *ctx) 225 void unlock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
224{ 226 {
225 struct obj_entry *entry; 227 struct obj_entry *entry;
226 228
227 list_for_each_entry (entry, list, head) 229 list_for_each_entry (entry, list, head)
228 ww_mutex_unlock(&entry->obj->lock); 230 ww_mutex_unlock(&entry->obj->lock);
229 231
230 ww_acquire_fini(ctx); 232 ww_acquire_fini(ctx);
231} 233 }
232 234
233Method 3 is useful if the list of objects is constructed ad-hoc and not upfront, 235Method 3 is useful if the list of objects is constructed ad-hoc and not upfront,
234e.g. when adjusting edges in a graph where each node has its own ww_mutex lock, 236e.g. when adjusting edges in a graph where each node has its own ww_mutex lock,
235and edges can only be changed when holding the locks of all involved nodes. w/w 237and edges can only be changed when holding the locks of all involved nodes. w/w
236mutexes are a natural fit for such a case for two reasons: 238mutexes are a natural fit for such a case for two reasons:
239
237- They can handle lock-acquisition in any order which allows us to start walking 240- They can handle lock-acquisition in any order which allows us to start walking
238 a graph from a starting point and then iteratively discovering new edges and 241 a graph from a starting point and then iteratively discovering new edges and
239 locking down the nodes those edges connect to. 242 locking down the nodes those edges connect to.
@@ -243,6 +246,7 @@ mutexes are a natural fit for such a case for two reasons:
243 as a starting point). 246 as a starting point).
244 247
245Note that this approach differs in two important ways from the above methods: 248Note that this approach differs in two important ways from the above methods:
249
246- Since the list of objects is dynamically constructed (and might very well be 250- Since the list of objects is dynamically constructed (and might very well be
247 different when retrying due to hitting the -EDEADLK die condition) there's 251 different when retrying due to hitting the -EDEADLK die condition) there's
248 no need to keep any object on a persistent list when it's not locked. We can 252 no need to keep any object on a persistent list when it's not locked. We can
@@ -260,17 +264,17 @@ any interface misuse for these cases.
260 264
261Also, method 3 can't fail the lock acquisition step since it doesn't return 265Also, method 3 can't fail the lock acquisition step since it doesn't return
262-EALREADY. Of course this would be different when using the _interruptible 266-EALREADY. Of course this would be different when using the _interruptible
263variants, but that's outside of the scope of these examples here. 267variants, but that's outside of the scope of these examples here::
264 268
265struct obj { 269 struct obj {
266 struct ww_mutex ww_mutex; 270 struct ww_mutex ww_mutex;
267 struct list_head locked_list; 271 struct list_head locked_list;
268}; 272 };
269 273
270static DEFINE_WW_CLASS(ww_class); 274 static DEFINE_WW_CLASS(ww_class);
271 275
272void __unlock_objs(struct list_head *list) 276 void __unlock_objs(struct list_head *list)
273{ 277 {
274 struct obj *entry, *temp; 278 struct obj *entry, *temp;
275 279
276 list_for_each_entry_safe (entry, temp, list, locked_list) { 280 list_for_each_entry_safe (entry, temp, list, locked_list) {
@@ -279,15 +283,15 @@ void __unlock_objs(struct list_head *list)
279 list_del(&entry->locked_list); 283 list_del(&entry->locked_list);
280 ww_mutex_unlock(entry->ww_mutex) 284 ww_mutex_unlock(entry->ww_mutex)
281 } 285 }
282} 286 }
283 287
284void lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx) 288 void lock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
285{ 289 {
286 struct obj *obj; 290 struct obj *obj;
287 291
288 ww_acquire_init(ctx, &ww_class); 292 ww_acquire_init(ctx, &ww_class);
289 293
290retry: 294 retry:
291 /* re-init loop start state */ 295 /* re-init loop start state */
292 loop { 296 loop {
293 /* magic code which walks over a graph and decides which objects 297 /* magic code which walks over a graph and decides which objects
@@ -312,13 +316,13 @@ retry:
312 316
313 ww_acquire_done(ctx); 317 ww_acquire_done(ctx);
314 return 0; 318 return 0;
315} 319 }
316 320
317void unlock_objs(struct list_head *list, struct ww_acquire_ctx *ctx) 321 void unlock_objs(struct list_head *list, struct ww_acquire_ctx *ctx)
318{ 322 {
319 __unlock_objs(list); 323 __unlock_objs(list);
320 ww_acquire_fini(ctx); 324 ww_acquire_fini(ctx);
321} 325 }
322 326
323Method 4: Only lock one single objects. In that case deadlock detection and 327Method 4: Only lock one single objects. In that case deadlock detection and
324prevention is obviously overkill, since with grabbing just one lock you can't 328prevention is obviously overkill, since with grabbing just one lock you can't
@@ -329,11 +333,14 @@ Implementation Details
329---------------------- 333----------------------
330 334
331Design: 335Design:
336^^^^^^^
337
332 ww_mutex currently encapsulates a struct mutex, this means no extra overhead for 338 ww_mutex currently encapsulates a struct mutex, this means no extra overhead for
333 normal mutex locks, which are far more common. As such there is only a small 339 normal mutex locks, which are far more common. As such there is only a small
334 increase in code size if wait/wound mutexes are not used. 340 increase in code size if wait/wound mutexes are not used.
335 341
336 We maintain the following invariants for the wait list: 342 We maintain the following invariants for the wait list:
343
337 (1) Waiters with an acquire context are sorted by stamp order; waiters 344 (1) Waiters with an acquire context are sorted by stamp order; waiters
338 without an acquire context are interspersed in FIFO order. 345 without an acquire context are interspersed in FIFO order.
339 (2) For Wait-Die, among waiters with contexts, only the first one can have 346 (2) For Wait-Die, among waiters with contexts, only the first one can have
@@ -355,6 +362,8 @@ Design:
355 therefore be directed towards the uncontended cases. 362 therefore be directed towards the uncontended cases.
356 363
357Lockdep: 364Lockdep:
365^^^^^^^^
366
358 Special care has been taken to warn for as many cases of api abuse 367 Special care has been taken to warn for as many cases of api abuse
359 as possible. Some common api abuses will be caught with 368 as possible. Some common api abuses will be caught with
360 CONFIG_DEBUG_MUTEXES, but CONFIG_PROVE_LOCKING is recommended. 369 CONFIG_DEBUG_MUTEXES, but CONFIG_PROVE_LOCKING is recommended.
@@ -379,5 +388,6 @@ Lockdep:
379 having called ww_acquire_fini on the first. 388 having called ww_acquire_fini on the first.
380 - 'normal' deadlocks that can occur. 389 - 'normal' deadlocks that can occur.
381 390
382FIXME: Update this section once we have the TASK_DEADLOCK task state flag magic 391FIXME:
383implemented. 392 Update this section once we have the TASK_DEADLOCK task state flag magic
393 implemented.
diff --git a/Documentation/m68k/index.rst b/Documentation/m68k/index.rst
new file mode 100644
index 000000000000..3a5ba7fe1703
--- /dev/null
+++ b/Documentation/m68k/index.rst
@@ -0,0 +1,17 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=================
4m68k Architecture
5=================
6
7.. toctree::
8 :maxdepth: 2
9
10 kernel-options
11
12.. only:: subproject and html
13
14 Indices
15 =======
16
17 * :ref:`genindex`
diff --git a/Documentation/m68k/kernel-options.txt b/Documentation/m68k/kernel-options.rst
index 79d21246c75a..cabd9419740d 100644
--- a/Documentation/m68k/kernel-options.txt
+++ b/Documentation/m68k/kernel-options.rst
@@ -1,22 +1,24 @@
1 1===================================
2 2Command Line Options for Linux/m68k
3 Command Line Options for Linux/m68k 3===================================
4 ===================================
5 4
6Last Update: 2 May 1999 5Last Update: 2 May 1999
6
7Linux/m68k version: 2.2.6 7Linux/m68k version: 2.2.6
8
8Author: Roman.Hodek@informatik.uni-erlangen.de (Roman Hodek) 9Author: Roman.Hodek@informatik.uni-erlangen.de (Roman Hodek)
10
9Update: jds@kom.auc.dk (Jes Sorensen) and faq@linux-m68k.org (Chris Lawrence) 11Update: jds@kom.auc.dk (Jes Sorensen) and faq@linux-m68k.org (Chris Lawrence)
10 12
110) Introduction 130) Introduction
12=============== 14===============
13 15
14 Often I've been asked which command line options the Linux/m68k 16Often I've been asked which command line options the Linux/m68k
15kernel understands, or how the exact syntax for the ... option is, or 17kernel understands, or how the exact syntax for the ... option is, or
16... about the option ... . I hope, this document supplies all the 18... about the option ... . I hope, this document supplies all the
17answers... 19answers...
18 20
19 Note that some options might be outdated, their descriptions being 21Note that some options might be outdated, their descriptions being
20incomplete or missing. Please update the information and send in the 22incomplete or missing. Please update the information and send in the
21patches. 23patches.
22 24
@@ -38,11 +40,11 @@ argument contains an '=', it is of class 2, and the definition is put
38into init's environment. All other arguments are passed to init as 40into init's environment. All other arguments are passed to init as
39command line options. 41command line options.
40 42
41 This document describes the valid kernel options for Linux/m68k in 43This document describes the valid kernel options for Linux/m68k in
42the version mentioned at the start of this file. Later revisions may 44the version mentioned at the start of this file. Later revisions may
43add new such options, and some may be missing in older versions. 45add new such options, and some may be missing in older versions.
44 46
45 In general, the value (the part after the '=') of an option is a 47In general, the value (the part after the '=') of an option is a
46list of values separated by commas. The interpretation of these values 48list of values separated by commas. The interpretation of these values
47is up to the driver that "owns" the option. This association of 49is up to the driver that "owns" the option. This association of
48options with drivers is also the reason that some are further 50options with drivers is also the reason that some are further
@@ -55,21 +57,21 @@ subdivided.
552.1) root= 572.1) root=
56---------- 58----------
57 59
58Syntax: root=/dev/<device> 60:Syntax: root=/dev/<device>
59 or: root=<hex_number> 61:or: root=<hex_number>
60 62
61This tells the kernel which device it should mount as the root 63This tells the kernel which device it should mount as the root
62filesystem. The device must be a block device with a valid filesystem 64filesystem. The device must be a block device with a valid filesystem
63on it. 65on it.
64 66
65 The first syntax gives the device by name. These names are converted 67The first syntax gives the device by name. These names are converted
66into a major/minor number internally in the kernel in an unusual way. 68into a major/minor number internally in the kernel in an unusual way.
67Normally, this "conversion" is done by the device files in /dev, but 69Normally, this "conversion" is done by the device files in /dev, but
68this isn't possible here, because the root filesystem (with /dev) 70this isn't possible here, because the root filesystem (with /dev)
69isn't mounted yet... So the kernel parses the name itself, with some 71isn't mounted yet... So the kernel parses the name itself, with some
70hardcoded name to number mappings. The name must always be a 72hardcoded name to number mappings. The name must always be a
71combination of two or three letters, followed by a decimal number. 73combination of two or three letters, followed by a decimal number.
72Valid names are: 74Valid names are::
73 75
74 /dev/ram: -> 0x0100 (initial ramdisk) 76 /dev/ram: -> 0x0100 (initial ramdisk)
75 /dev/hda: -> 0x0300 (first IDE disk) 77 /dev/hda: -> 0x0300 (first IDE disk)
@@ -81,7 +83,7 @@ Valid names are:
81 /dev/sde: -> 0x0840 (fifth SCSI disk) 83 /dev/sde: -> 0x0840 (fifth SCSI disk)
82 /dev/fd : -> 0x0200 (floppy disk) 84 /dev/fd : -> 0x0200 (floppy disk)
83 85
84 The name must be followed by a decimal number, that stands for the 86The name must be followed by a decimal number, that stands for the
85partition number. Internally, the value of the number is just 87partition number. Internally, the value of the number is just
86added to the device number mentioned in the table above. The 88added to the device number mentioned in the table above. The
87exceptions are /dev/ram and /dev/fd, where /dev/ram refers to an 89exceptions are /dev/ram and /dev/fd, where /dev/ram refers to an
@@ -100,12 +102,12 @@ the kernel command line.
100 102
101[Strange and maybe uninteresting stuff ON] 103[Strange and maybe uninteresting stuff ON]
102 104
103 This unusual translation of device names has some strange 105This unusual translation of device names has some strange
104consequences: If, for example, you have a symbolic link from /dev/fd 106consequences: If, for example, you have a symbolic link from /dev/fd
105to /dev/fd0D720 as an abbreviation for floppy driver #0 in DD format, 107to /dev/fd0D720 as an abbreviation for floppy driver #0 in DD format,
106you cannot use this name for specifying the root device, because the 108you cannot use this name for specifying the root device, because the
107kernel cannot see this symlink before mounting the root FS and it 109kernel cannot see this symlink before mounting the root FS and it
108isn't in the table above. If you use it, the root device will not be 110isn't in the table above. If you use it, the root device will not be
109set at all, without an error message. Another example: You cannot use a 111set at all, without an error message. Another example: You cannot use a
110partition on e.g. the sixth SCSI disk as the root filesystem, if you 112partition on e.g. the sixth SCSI disk as the root filesystem, if you
111want to specify it by name. This is, because only the devices up to 113want to specify it by name. This is, because only the devices up to
@@ -118,7 +120,7 @@ knowledge that each disk uses 16 minors, and write "root=/dev/sde17"
118 120
119[Strange and maybe uninteresting stuff OFF] 121[Strange and maybe uninteresting stuff OFF]
120 122
121 If the device containing your root partition isn't in the table 123If the device containing your root partition isn't in the table
122above, you can also specify it by major and minor numbers. These are 124above, you can also specify it by major and minor numbers. These are
123written in hex, with no prefix and no separator between. E.g., if you 125written in hex, with no prefix and no separator between. E.g., if you
124have a CD with contents appropriate as a root filesystem in the first 126have a CD with contents appropriate as a root filesystem in the first
@@ -136,6 +138,7 @@ known partition UUID as the starting point. For example,
136if partition 5 of the device has the UUID of 138if partition 5 of the device has the UUID of
13700112233-4455-6677-8899-AABBCCDDEEFF then partition 3 may be found as 13900112233-4455-6677-8899-AABBCCDDEEFF then partition 3 may be found as
138follows: 140follows:
141
139 PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF/PARTNROFF=-2 142 PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF/PARTNROFF=-2
140 143
141Authoritative information can be found in 144Authoritative information can be found in
@@ -145,8 +148,8 @@ Authoritative information can be found in
1452.2) ro, rw 1482.2) ro, rw
146----------- 149-----------
147 150
148Syntax: ro 151:Syntax: ro
149 or: rw 152:or: rw
150 153
151These two options tell the kernel whether it should mount the root 154These two options tell the kernel whether it should mount the root
152filesystem read-only or read-write. The default is read-only, except 155filesystem read-only or read-write. The default is read-only, except
@@ -156,7 +159,7 @@ for ramdisks, which default to read-write.
1562.3) debug 1592.3) debug
157---------- 160----------
158 161
159Syntax: debug 162:Syntax: debug
160 163
161This raises the kernel log level to 10 (the default is 7). This is the 164This raises the kernel log level to 10 (the default is 7). This is the
162same level as set by the "dmesg" command, just that the maximum level 165same level as set by the "dmesg" command, just that the maximum level
@@ -166,7 +169,7 @@ selectable by dmesg is 8.
1662.4) debug= 1692.4) debug=
167----------- 170-----------
168 171
169Syntax: debug=<device> 172:Syntax: debug=<device>
170 173
171This option causes certain kernel messages be printed to the selected 174This option causes certain kernel messages be printed to the selected
172debugging device. This can aid debugging the kernel, since the 175debugging device. This can aid debugging the kernel, since the
@@ -175,7 +178,7 @@ devices are possible depends on the machine type. There are no checks
175for the validity of the device name. If the device isn't implemented, 178for the validity of the device name. If the device isn't implemented,
176nothing happens. 179nothing happens.
177 180
178 Messages logged this way are in general stack dumps after kernel 181Messages logged this way are in general stack dumps after kernel
179memory faults or bad kernel traps, and kernel panics. To be exact: all 182memory faults or bad kernel traps, and kernel panics. To be exact: all
180messages of level 0 (panic messages) and all messages printed while 183messages of level 0 (panic messages) and all messages printed while
181the log level is 8 or more (their level doesn't matter). Before stack 184the log level is 8 or more (their level doesn't matter). Before stack
@@ -185,19 +188,27 @@ at least 8 can also be set by the "debug" command line option (see
185 188
186Devices possible for Amiga: 189Devices possible for Amiga:
187 190
188 - "ser": built-in serial port; parameters: 9600bps, 8N1 191 - "ser":
189 - "mem": Save the messages to a reserved area in chip mem. After 192 built-in serial port; parameters: 9600bps, 8N1
193 - "mem":
194 Save the messages to a reserved area in chip mem. After
190 rebooting, they can be read under AmigaOS with the tool 195 rebooting, they can be read under AmigaOS with the tool
191 'dmesg'. 196 'dmesg'.
192 197
193Devices possible for Atari: 198Devices possible for Atari:
194 199
195 - "ser1": ST-MFP serial port ("Modem1"); parameters: 9600bps, 8N1 200 - "ser1":
196 - "ser2": SCC channel B serial port ("Modem2"); parameters: 9600bps, 8N1 201 ST-MFP serial port ("Modem1"); parameters: 9600bps, 8N1
197 - "ser" : default serial port 202 - "ser2":
203 SCC channel B serial port ("Modem2"); parameters: 9600bps, 8N1
204 - "ser" :
205 default serial port
198 This is "ser2" for a Falcon, and "ser1" for any other machine 206 This is "ser2" for a Falcon, and "ser1" for any other machine
199 - "midi": The MIDI port; parameters: 31250bps, 8N1 207 - "midi":
200 - "par" : parallel port 208 The MIDI port; parameters: 31250bps, 8N1
209 - "par" :
210 parallel port
211
201 The printing routine for this implements a timeout for the 212 The printing routine for this implements a timeout for the
202 case there's no printer connected (else the kernel would 213 case there's no printer connected (else the kernel would
203 lock up). The timeout is not exact, but usually a few 214 lock up). The timeout is not exact, but usually a few
@@ -205,26 +216,29 @@ Devices possible for Atari:
205 216
206 217
2072.6) ramdisk_size= 2182.6) ramdisk_size=
208------------- 219------------------
209 220
210Syntax: ramdisk_size=<size> 221:Syntax: ramdisk_size=<size>
211 222
212 This option instructs the kernel to set up a ramdisk of the given 223This option instructs the kernel to set up a ramdisk of the given
213size in KBytes. Do not use this option if the ramdisk contents are 224size in KBytes. Do not use this option if the ramdisk contents are
214passed by bootstrap! In this case, the size is selected automatically 225passed by bootstrap! In this case, the size is selected automatically
215and should not be overwritten. 226and should not be overwritten.
216 227
217 The only application is for root filesystems on floppy disks, that 228The only application is for root filesystems on floppy disks, that
218should be loaded into memory. To do that, select the corresponding 229should be loaded into memory. To do that, select the corresponding
219size of the disk as ramdisk size, and set the root device to the disk 230size of the disk as ramdisk size, and set the root device to the disk
220drive (with "root="). 231drive (with "root=").
221 232
222 233
2232.7) swap= 2342.7) swap=
235
236 I can't find any sign of this option in 2.2.6.
237
2242.8) buff= 2382.8) buff=
225----------- 239-----------
226 240
227 I can't find any sign of these options in 2.2.6. 241 I can't find any sign of this option in 2.2.6.
228 242
229 243
2303) General Device Options (Amiga and Atari) 2443) General Device Options (Amiga and Atari)
@@ -233,13 +247,13 @@ drive (with "root=").
2333.1) ether= 2473.1) ether=
234----------- 248-----------
235 249
236Syntax: ether=[<irq>[,<base_addr>[,<mem_start>[,<mem_end>]]]],<dev-name> 250:Syntax: ether=[<irq>[,<base_addr>[,<mem_start>[,<mem_end>]]]],<dev-name>
237 251
238 <dev-name> is the name of a net driver, as specified in 252<dev-name> is the name of a net driver, as specified in
239drivers/net/Space.c in the Linux source. Most prominent are eth0, ... 253drivers/net/Space.c in the Linux source. Most prominent are eth0, ...
240eth3, sl0, ... sl3, ppp0, ..., ppp3, dummy, and lo. 254eth3, sl0, ... sl3, ppp0, ..., ppp3, dummy, and lo.
241 255
242 The non-ethernet drivers (sl, ppp, dummy, lo) obviously ignore the 256The non-ethernet drivers (sl, ppp, dummy, lo) obviously ignore the
243settings by this options. Also, the existing ethernet drivers for 257settings by this options. Also, the existing ethernet drivers for
244Linux/m68k (ariadne, a2065, hydra) don't use them because Zorro boards 258Linux/m68k (ariadne, a2065, hydra) don't use them because Zorro boards
245are really Plug-'n-Play, so the "ether=" option is useless altogether 259are really Plug-'n-Play, so the "ether=" option is useless altogether
@@ -249,9 +263,9 @@ for Linux/m68k.
2493.2) hd= 2633.2) hd=
250-------- 264--------
251 265
252Syntax: hd=<cylinders>,<heads>,<sectors> 266:Syntax: hd=<cylinders>,<heads>,<sectors>
253 267
254 This option sets the disk geometry of an IDE disk. The first hd= 268This option sets the disk geometry of an IDE disk. The first hd=
255option is for the first IDE disk, the second for the second one. 269option is for the first IDE disk, the second for the second one.
256(I.e., you can give this option twice.) In most cases, you won't have 270(I.e., you can give this option twice.) In most cases, you won't have
257to use this option, since the kernel can obtain the geometry data 271to use this option, since the kernel can obtain the geometry data
@@ -262,9 +276,9 @@ disks.
2623.3) max_scsi_luns= 2763.3) max_scsi_luns=
263------------------- 277-------------------
264 278
265Syntax: max_scsi_luns=<n> 279:Syntax: max_scsi_luns=<n>
266 280
267 Sets the maximum number of LUNs (logical units) of SCSI devices to 281Sets the maximum number of LUNs (logical units) of SCSI devices to
268be scanned. Valid values for <n> are between 1 and 8. Default is 8 if 282be scanned. Valid values for <n> are between 1 and 8. Default is 8 if
269"Probe all LUNs on each SCSI device" was selected during the kernel 283"Probe all LUNs on each SCSI device" was selected during the kernel
270configuration, else 1. 284configuration, else 1.
@@ -273,9 +287,9 @@ configuration, else 1.
2733.4) st= 2873.4) st=
274-------- 288--------
275 289
276Syntax: st=<buffer_size>,[<write_thres>,[<max_buffers>]] 290:Syntax: st=<buffer_size>,[<write_thres>,[<max_buffers>]]
277 291
278 Sets several parameters of the SCSI tape driver. <buffer_size> is 292Sets several parameters of the SCSI tape driver. <buffer_size> is
279the number of 512-byte buffers reserved for tape operations for each 293the number of 512-byte buffers reserved for tape operations for each
280device. <write_thres> sets the number of blocks which must be filled 294device. <write_thres> sets the number of blocks which must be filled
281to start an actual write operation to the tape. Maximum value is the 295to start an actual write operation to the tape. Maximum value is the
@@ -286,9 +300,9 @@ buffers allocated for all tape devices.
2863.5) dmasound= 3003.5) dmasound=
287-------------- 301--------------
288 302
289Syntax: dmasound=[<buffers>,<buffer-size>[,<catch-radius>]] 303:Syntax: dmasound=[<buffers>,<buffer-size>[,<catch-radius>]]
290 304
291 This option controls some configurations of the Linux/m68k DMA sound 305This option controls some configurations of the Linux/m68k DMA sound
292driver (Amiga and Atari): <buffers> is the number of buffers you want 306driver (Amiga and Atari): <buffers> is the number of buffers you want
293to use (minimum 4, default 4), <buffer-size> is the size of each 307to use (minimum 4, default 4), <buffer-size> is the size of each
294buffer in kilobytes (minimum 4, default 32) and <catch-radius> says 308buffer in kilobytes (minimum 4, default 32) and <catch-radius> says
@@ -305,20 +319,22 @@ don't need to expand the sound.
3054.1) video= 3194.1) video=
306----------- 320-----------
307 321
308Syntax: video=<fbname>:<sub-options...> 322:Syntax: video=<fbname>:<sub-options...>
309 323
310The <fbname> parameter specifies the name of the frame buffer, 324The <fbname> parameter specifies the name of the frame buffer,
311eg. most atari users will want to specify `atafb' here. The 325eg. most atari users will want to specify `atafb` here. The
312<sub-options> is a comma-separated list of the sub-options listed 326<sub-options> is a comma-separated list of the sub-options listed
313below. 327below.
314 328
315NB: Please notice that this option was renamed from `atavideo' to 329NB:
316 `video' during the development of the 1.3.x kernels, thus you 330 Please notice that this option was renamed from `atavideo` to
331 `video` during the development of the 1.3.x kernels, thus you
317 might need to update your boot-scripts if upgrading to 2.x from 332 might need to update your boot-scripts if upgrading to 2.x from
318 an 1.2.x kernel. 333 an 1.2.x kernel.
319 334
320NBB: The behavior of video= was changed in 2.1.57 so the recommended 335NBB:
321option is to specify the name of the frame buffer. 336 The behavior of video= was changed in 2.1.57 so the recommended
337 option is to specify the name of the frame buffer.
322 338
3234.1.1) Video Mode 3394.1.1) Video Mode
324----------------- 340-----------------
@@ -341,11 +357,11 @@ mode, if the hardware allows. Currently defined names are:
341 - falh2 : 896x608x1, Falcon only 357 - falh2 : 896x608x1, Falcon only
342 - falh16 : 896x608x4, Falcon only 358 - falh16 : 896x608x4, Falcon only
343 359
344 If no video mode is given on the command line, the kernel tries the 360If no video mode is given on the command line, the kernel tries the
345modes names "default<n>" in turn, until one is possible with the 361modes names "default<n>" in turn, until one is possible with the
346hardware in use. 362hardware in use.
347 363
348 A video mode setting doesn't make sense, if the external driver is 364A video mode setting doesn't make sense, if the external driver is
349activated by a "external:" sub-option. 365activated by a "external:" sub-option.
350 366
3514.1.2) inverse 3674.1.2) inverse
@@ -358,17 +374,17 @@ option, you can make the background white.
3584.1.3) font 3744.1.3) font
359----------- 375-----------
360 376
361Syntax: font:<fontname> 377:Syntax: font:<fontname>
362 378
363Specify the font to use in text modes. Currently you can choose only 379Specify the font to use in text modes. Currently you can choose only
364between `VGA8x8', `VGA8x16' and `PEARL8x8'. `VGA8x8' is default, if the 380between `VGA8x8`, `VGA8x16` and `PEARL8x8`. `VGA8x8` is default, if the
365vertical size of the display is less than 400 pixel rows. Otherwise, the 381vertical size of the display is less than 400 pixel rows. Otherwise, the
366`VGA8x16' font is the default. 382`VGA8x16` font is the default.
367 383
3684.1.4) hwscroll_ 3844.1.4) `hwscroll_`
369---------------- 385------------------
370 386
371Syntax: hwscroll_<n> 387:Syntax: `hwscroll_<n>`
372 388
373The number of additional lines of video memory to reserve for 389The number of additional lines of video memory to reserve for
374speeding up the scrolling ("hardware scrolling"). Hardware scrolling 390speeding up the scrolling ("hardware scrolling"). Hardware scrolling
@@ -378,7 +394,7 @@ possible with plain STs and graphics cards (The former because the
378base address must be on a 256 byte boundary there, the latter because 394base address must be on a 256 byte boundary there, the latter because
379the kernel doesn't know how to set the base address at all.) 395the kernel doesn't know how to set the base address at all.)
380 396
381 By default, <n> is set to the number of visible text lines on the 397By default, <n> is set to the number of visible text lines on the
382display. Thus, the amount of video memory is doubled, compared to no 398display. Thus, the amount of video memory is doubled, compared to no
383hardware scrolling. You can turn off the hardware scrolling altogether 399hardware scrolling. You can turn off the hardware scrolling altogether
384by setting <n> to 0. 400by setting <n> to 0.
@@ -386,31 +402,31 @@ by setting <n> to 0.
3864.1.5) internal: 4024.1.5) internal:
387---------------- 403----------------
388 404
389Syntax: internal:<xres>;<yres>[;<xres_max>;<yres_max>;<offset>] 405:Syntax: internal:<xres>;<yres>[;<xres_max>;<yres_max>;<offset>]
390 406
391This option specifies the capabilities of some extended internal video 407This option specifies the capabilities of some extended internal video
392hardware, like e.g. OverScan. <xres> and <yres> give the (extended) 408hardware, like e.g. OverScan. <xres> and <yres> give the (extended)
393dimensions of the screen. 409dimensions of the screen.
394 410
395 If your OverScan needs a black border, you have to write the last 411If your OverScan needs a black border, you have to write the last
396three arguments of the "internal:". <xres_max> is the maximum line 412three arguments of the "internal:". <xres_max> is the maximum line
397length the hardware allows, <yres_max> the maximum number of lines. 413length the hardware allows, <yres_max> the maximum number of lines.
398<offset> is the offset of the visible part of the screen memory to its 414<offset> is the offset of the visible part of the screen memory to its
399physical start, in bytes. 415physical start, in bytes.
400 416
401 Often, extended interval video hardware has to be activated somehow. 417Often, extended interval video hardware has to be activated somehow.
402For this, see the "sw_*" options below. 418For this, see the "sw_*" options below.
403 419
4044.1.6) external: 4204.1.6) external:
405---------------- 421----------------
406 422
407Syntax: 423:Syntax:
408 external:<xres>;<yres>;<depth>;<org>;<scrmem>[;<scrlen>[;<vgabase>\ 424 external:<xres>;<yres>;<depth>;<org>;<scrmem>[;<scrlen>[;<vgabase>
409 [;<colw>[;<coltype>[;<xres_virtual>]]]]] 425 [;<colw>[;<coltype>[;<xres_virtual>]]]]]
410 426
411[I had to break this line...] 427.. I had to break this line...
412 428
413 This is probably the most complicated parameter... It specifies that 429This is probably the most complicated parameter... It specifies that
414you have some external video hardware (a graphics board), and how to 430you have some external video hardware (a graphics board), and how to
415use it under Linux/m68k. The kernel cannot know more about the hardware 431use it under Linux/m68k. The kernel cannot know more about the hardware
416than you tell it here! The kernel also is unable to set or change any 432than you tell it here! The kernel also is unable to set or change any
@@ -418,38 +434,44 @@ video modes, since it doesn't know about any board internal. So, you
418have to switch to that video mode before you start Linux, and cannot 434have to switch to that video mode before you start Linux, and cannot
419switch to another mode once Linux has started. 435switch to another mode once Linux has started.
420 436
421 The first 3 parameters of this sub-option should be obvious: <xres>, 437The first 3 parameters of this sub-option should be obvious: <xres>,
422<yres> and <depth> give the dimensions of the screen and the number of 438<yres> and <depth> give the dimensions of the screen and the number of
423planes (depth). The depth is the logarithm to base 2 of the number 439planes (depth). The depth is the logarithm to base 2 of the number
424of colors possible. (Or, the other way round: The number of colors is 440of colors possible. (Or, the other way round: The number of colors is
4252^depth). 4412^depth).
426 442
427 You have to tell the kernel furthermore how the video memory is 443You have to tell the kernel furthermore how the video memory is
428organized. This is done by a letter as <org> parameter: 444organized. This is done by a letter as <org> parameter:
429 445
430 'n': "normal planes", i.e. one whole plane after another 446 'n':
431 'i': "interleaved planes", i.e. 16 bit of the first plane, than 16 bit 447 "normal planes", i.e. one whole plane after another
448 'i':
449 "interleaved planes", i.e. 16 bit of the first plane, than 16 bit
432 of the next, and so on... This mode is used only with the 450 of the next, and so on... This mode is used only with the
433 built-in Atari video modes, I think there is no card that 451 built-in Atari video modes, I think there is no card that
434 supports this mode. 452 supports this mode.
435 'p': "packed pixels", i.e. <depth> consecutive bits stand for all 453 'p':
436 planes of one pixel; this is the most common mode for 8 planes 454 "packed pixels", i.e. <depth> consecutive bits stand for all
437 (256 colors) on graphic cards 455 planes of one pixel; this is the most common mode for 8 planes
438 't': "true color" (more or less packed pixels, but without a color 456 (256 colors) on graphic cards
439 lookup table); usually depth is 24 457 't':
458 "true color" (more or less packed pixels, but without a color
459 lookup table); usually depth is 24
440 460
441For monochrome modes (i.e., <depth> is 1), the <org> letter has a 461For monochrome modes (i.e., <depth> is 1), the <org> letter has a
442different meaning: 462different meaning:
443 463
444 'n': normal colors, i.e. 0=white, 1=black 464 'n':
445 'i': inverted colors, i.e. 0=black, 1=white 465 normal colors, i.e. 0=white, 1=black
466 'i':
467 inverted colors, i.e. 0=black, 1=white
446 468
447 The next important information about the video hardware is the base 469The next important information about the video hardware is the base
448address of the video memory. That is given in the <scrmem> parameter, 470address of the video memory. That is given in the <scrmem> parameter,
449as a hexadecimal number with a "0x" prefix. You have to find out this 471as a hexadecimal number with a "0x" prefix. You have to find out this
450address in the documentation of your hardware. 472address in the documentation of your hardware.
451 473
452 The next parameter, <scrlen>, tells the kernel about the size of the 474The next parameter, <scrlen>, tells the kernel about the size of the
453video memory. If it's missing, the size is calculated from <xres>, 475video memory. If it's missing, the size is calculated from <xres>,
454<yres>, and <depth>. For now, it is not useful to write a value here. 476<yres>, and <depth>. For now, it is not useful to write a value here.
455It would be used only for hardware scrolling (which isn't possible 477It would be used only for hardware scrolling (which isn't possible
@@ -460,7 +482,7 @@ empty, either by ending the "external:" after the video address or by
460writing two consecutive semicolons, if you want to give a <vgabase> 482writing two consecutive semicolons, if you want to give a <vgabase>
461(it is allowed to leave this parameter empty). 483(it is allowed to leave this parameter empty).
462 484
463 The <vgabase> parameter is optional. If it is not given, the kernel 485The <vgabase> parameter is optional. If it is not given, the kernel
464cannot read or write any color registers of the video hardware, and 486cannot read or write any color registers of the video hardware, and
465thus you have to set appropriate colors before you start Linux. But if 487thus you have to set appropriate colors before you start Linux. But if
466your card is somehow VGA compatible, you can tell the kernel the base 488your card is somehow VGA compatible, you can tell the kernel the base
@@ -472,18 +494,18 @@ uses the addresses vgabase+0x3c7...vgabase+0x3c9. The <vgabase>
472parameter is written in hexadecimal with a "0x" prefix, just as 494parameter is written in hexadecimal with a "0x" prefix, just as
473<scrmem>. 495<scrmem>.
474 496
475 <colw> is meaningful only if <vgabase> is specified. It tells the 497<colw> is meaningful only if <vgabase> is specified. It tells the
476kernel how wide each of the color register is, i.e. the number of bits 498kernel how wide each of the color register is, i.e. the number of bits
477per single color (red/green/blue). Default is 6, another quite usual 499per single color (red/green/blue). Default is 6, another quite usual
478value is 8. 500value is 8.
479 501
480 Also <coltype> is used together with <vgabase>. It tells the kernel 502Also <coltype> is used together with <vgabase>. It tells the kernel
481about the color register model of your gfx board. Currently, the types 503about the color register model of your gfx board. Currently, the types
482"vga" (which is also the default) and "mv300" (SANG MV300) are 504"vga" (which is also the default) and "mv300" (SANG MV300) are
483implemented. 505implemented.
484 506
485 Parameter <xres_virtual> is required for ProMST or ET4000 cards where 507Parameter <xres_virtual> is required for ProMST or ET4000 cards where
486the physical linelength differs from the visible length. With ProMST, 508the physical linelength differs from the visible length. With ProMST,
487xres_virtual must be set to 2048. For ET4000, xres_virtual depends on the 509xres_virtual must be set to 2048. For ET4000, xres_virtual depends on the
488initialisation of the video-card. 510initialisation of the video-card.
489If you're missing a corresponding yres_virtual: the external part is legacy, 511If you're missing a corresponding yres_virtual: the external part is legacy,
@@ -499,13 +521,13 @@ currently works only with the ScreenWonder!
4994.1.8) monitorcap: 5214.1.8) monitorcap:
500------------------- 522-------------------
501 523
502Syntax: monitorcap:<vmin>;<vmax>;<hmin>;<hmax> 524:Syntax: monitorcap:<vmin>;<vmax>;<hmin>;<hmax>
503 525
504This describes the capabilities of a multisync monitor. Don't use it 526This describes the capabilities of a multisync monitor. Don't use it
505with a fixed-frequency monitor! For now, only the Falcon frame buffer 527with a fixed-frequency monitor! For now, only the Falcon frame buffer
506uses the settings of "monitorcap:". 528uses the settings of "monitorcap:".
507 529
508 <vmin> and <vmax> are the minimum and maximum, resp., vertical frequencies 530<vmin> and <vmax> are the minimum and maximum, resp., vertical frequencies
509your monitor can work with, in Hz. <hmin> and <hmax> are the same for 531your monitor can work with, in Hz. <hmin> and <hmax> are the same for
510the horizontal frequency, in kHz. 532the horizontal frequency, in kHz.
511 533
@@ -520,28 +542,28 @@ If this option is given, the framebuffer device doesn't do any video
520mode calculations and settings on its own. The only Atari fb device 542mode calculations and settings on its own. The only Atari fb device
521that does this currently is the Falcon. 543that does this currently is the Falcon.
522 544
523 What you reach with this: Settings for unknown video extensions 545What you reach with this: Settings for unknown video extensions
524aren't overridden by the driver, so you can still use the mode found 546aren't overridden by the driver, so you can still use the mode found
525when booting, when the driver doesn't know to set this mode itself. 547when booting, when the driver doesn't know to set this mode itself.
526But this also means, that you can't switch video modes anymore... 548But this also means, that you can't switch video modes anymore...
527 549
528 An example where you may want to use "keep" is the ScreenBlaster for 550An example where you may want to use "keep" is the ScreenBlaster for
529the Falcon. 551the Falcon.
530 552
531 553
5324.2) atamouse= 5544.2) atamouse=
533-------------- 555--------------
534 556
535Syntax: atamouse=<x-threshold>,[<y-threshold>] 557:Syntax: atamouse=<x-threshold>,[<y-threshold>]
536 558
537 With this option, you can set the mouse movement reporting threshold. 559With this option, you can set the mouse movement reporting threshold.
538This is the number of pixels of mouse movement that have to accumulate 560This is the number of pixels of mouse movement that have to accumulate
539before the IKBD sends a new mouse packet to the kernel. Higher values 561before the IKBD sends a new mouse packet to the kernel. Higher values
540reduce the mouse interrupt load and thus reduce the chance of keyboard 562reduce the mouse interrupt load and thus reduce the chance of keyboard
541overruns. Lower values give a slightly faster mouse responses and 563overruns. Lower values give a slightly faster mouse responses and
542slightly better mouse tracking. 564slightly better mouse tracking.
543 565
544 You can set the threshold in x and y separately, but usually this is 566You can set the threshold in x and y separately, but usually this is
545of little practical use. If there's just one number in the option, it 567of little practical use. If there's just one number in the option, it
546is used for both dimensions. The default value is 2 for both 568is used for both dimensions. The default value is 2 for both
547thresholds. 569thresholds.
@@ -550,7 +572,7 @@ thresholds.
5504.3) ataflop= 5724.3) ataflop=
551------------- 573-------------
552 574
553Syntax: ataflop=<drive type>[,<trackbuffering>[,<steprateA>[,<steprateB>]]] 575:Syntax: ataflop=<drive type>[,<trackbuffering>[,<steprateA>[,<steprateB>]]]
554 576
555 The drive type may be 0, 1, or 2, for DD, HD, and ED, resp. This 577 The drive type may be 0, 1, or 2, for DD, HD, and ED, resp. This
556 setting affects how many buffers are reserved and which formats are 578 setting affects how many buffers are reserved and which formats are
@@ -563,15 +585,15 @@ Syntax: ataflop=<drive type>[,<trackbuffering>[,<steprateA>[,<steprateB>]]]
563 no for the Medusa and yes for all others. 585 no for the Medusa and yes for all others.
564 586
565 With the two following parameters, you can change the default 587 With the two following parameters, you can change the default
566 steprate used for drive A and B, resp. 588 steprate used for drive A and B, resp.
567 589
568 590
5694.4) atascsi= 5914.4) atascsi=
570------------- 592-------------
571 593
572Syntax: atascsi=<can_queue>[,<cmd_per_lun>[,<scat-gat>[,<host-id>[,<tagged>]]]] 594:Syntax: atascsi=<can_queue>[,<cmd_per_lun>[,<scat-gat>[,<host-id>[,<tagged>]]]]
573 595
574 This option sets some parameters for the Atari native SCSI driver. 596This option sets some parameters for the Atari native SCSI driver.
575Generally, any number of arguments can be omitted from the end. And 597Generally, any number of arguments can be omitted from the end. And
576for each of the numbers, a negative value means "use default". The 598for each of the numbers, a negative value means "use default". The
577defaults depend on whether TT-style or Falcon-style SCSI is used. 599defaults depend on whether TT-style or Falcon-style SCSI is used.
@@ -597,11 +619,14 @@ ignored (others aren't affected).
597 32). Default: 8/1. (Note: Values > 1 seem to cause problems on a 619 32). Default: 8/1. (Note: Values > 1 seem to cause problems on a
598 Falcon, cause not yet known.) 620 Falcon, cause not yet known.)
599 621
600 The <cmd_per_lun> value at a great part determines the amount of 622 The <cmd_per_lun> value at a great part determines the amount of
601 memory SCSI reserves for itself. The formula is rather 623 memory SCSI reserves for itself. The formula is rather
602 complicated, but I can give you some hints: 624 complicated, but I can give you some hints:
603 no scatter-gather : cmd_per_lun * 232 bytes 625
604 full scatter-gather: cmd_per_lun * approx. 17 Kbytes 626 no scatter-gather:
627 cmd_per_lun * 232 bytes
628 full scatter-gather:
629 cmd_per_lun * approx. 17 Kbytes
605 630
606 <scat-gat>: 631 <scat-gat>:
607 Size of the scatter-gather table, i.e. the number of requests 632 Size of the scatter-gather table, i.e. the number of requests
@@ -634,19 +659,23 @@ ignored (others aren't affected).
6344.5 switches= 6594.5 switches=
635------------- 660-------------
636 661
637Syntax: switches=<list of switches> 662:Syntax: switches=<list of switches>
638 663
639 With this option you can switch some hardware lines that are often 664With this option you can switch some hardware lines that are often
640used to enable/disable certain hardware extensions. Examples are 665used to enable/disable certain hardware extensions. Examples are
641OverScan, overclocking, ... 666OverScan, overclocking, ...
642 667
643 The <list of switches> is a comma-separated list of the following 668The <list of switches> is a comma-separated list of the following
644items: 669items:
645 670
646 ikbd: set RTS of the keyboard ACIA high 671 ikbd:
647 midi: set RTS of the MIDI ACIA high 672 set RTS of the keyboard ACIA high
648 snd6: set bit 6 of the PSG port A 673 midi:
649 snd7: set bit 6 of the PSG port A 674 set RTS of the MIDI ACIA high
675 snd6:
676 set bit 6 of the PSG port A
677 snd7:
678 set bit 6 of the PSG port A
650 679
651It doesn't make sense to mention a switch more than once (no 680It doesn't make sense to mention a switch more than once (no
652difference to only once), but you can give as many switches as you 681difference to only once), but you can give as many switches as you
@@ -654,16 +683,16 @@ want to enable different features. The switch lines are set as early
654as possible during kernel initialization (even before determining the 683as possible during kernel initialization (even before determining the
655present hardware.) 684present hardware.)
656 685
657 All of the items can also be prefixed with "ov_", i.e. "ov_ikbd", 686All of the items can also be prefixed with `ov_`, i.e. `ov_ikbd`,
658"ov_midi", ... These options are meant for switching on an OverScan 687`ov_midi`, ... These options are meant for switching on an OverScan
659video extension. The difference to the bare option is that the 688video extension. The difference to the bare option is that the
660switch-on is done after video initialization, and somehow synchronized 689switch-on is done after video initialization, and somehow synchronized
661to the HBLANK. A speciality is that ov_ikbd and ov_midi are switched 690to the HBLANK. A speciality is that ov_ikbd and ov_midi are switched
662off before rebooting, so that OverScan is disabled and TOS boots 691off before rebooting, so that OverScan is disabled and TOS boots
663correctly. 692correctly.
664 693
665 If you give an option both, with and without the "ov_" prefix, the 694If you give an option both, with and without the `ov_` prefix, the
666earlier initialization ("ov_"-less) takes precedence. But the 695earlier initialization (`ov_`-less) takes precedence. But the
667switching-off on reset still happens in this case. 696switching-off on reset still happens in this case.
668 697
6695) Options for Amiga Only: 6985) Options for Amiga Only:
@@ -672,10 +701,10 @@ switching-off on reset still happens in this case.
6725.1) video= 7015.1) video=
673----------- 702-----------
674 703
675Syntax: video=<fbname>:<sub-options...> 704:Syntax: video=<fbname>:<sub-options...>
676 705
677The <fbname> parameter specifies the name of the frame buffer, valid 706The <fbname> parameter specifies the name of the frame buffer, valid
678options are `amifb', `cyber', 'virge', `retz3' and `clgen', provided 707options are `amifb`, `cyber`, 'virge', `retz3` and `clgen`, provided
679that the respective frame buffer devices have been compiled into the 708that the respective frame buffer devices have been compiled into the
680kernel (or compiled as loadable modules). The behavior of the <fbname> 709kernel (or compiled as loadable modules). The behavior of the <fbname>
681option was changed in 2.1.57 so it is now recommended to specify this 710option was changed in 2.1.57 so it is now recommended to specify this
@@ -697,9 +726,11 @@ predefined video modes are available:
697NTSC modes: 726NTSC modes:
698 - ntsc : 640x200, 15 kHz, 60 Hz 727 - ntsc : 640x200, 15 kHz, 60 Hz
699 - ntsc-lace : 640x400, 15 kHz, 60 Hz interlaced 728 - ntsc-lace : 640x400, 15 kHz, 60 Hz interlaced
729
700PAL modes: 730PAL modes:
701 - pal : 640x256, 15 kHz, 50 Hz 731 - pal : 640x256, 15 kHz, 50 Hz
702 - pal-lace : 640x512, 15 kHz, 50 Hz interlaced 732 - pal-lace : 640x512, 15 kHz, 50 Hz interlaced
733
703ECS modes: 734ECS modes:
704 - multiscan : 640x480, 29 kHz, 57 Hz 735 - multiscan : 640x480, 29 kHz, 57 Hz
705 - multiscan-lace : 640x960, 29 kHz, 57 Hz interlaced 736 - multiscan-lace : 640x960, 29 kHz, 57 Hz interlaced
@@ -715,6 +746,7 @@ ECS modes:
715 - dblpal-lace : 640x1024, 27 kHz, 47 Hz interlaced 746 - dblpal-lace : 640x1024, 27 kHz, 47 Hz interlaced
716 - dblntsc : 640x200, 27 kHz, 57 Hz doublescan 747 - dblntsc : 640x200, 27 kHz, 57 Hz doublescan
717 - dblpal : 640x256, 27 kHz, 47 Hz doublescan 748 - dblpal : 640x256, 27 kHz, 47 Hz doublescan
749
718VGA modes: 750VGA modes:
719 - vga : 640x480, 31 kHz, 60 Hz 751 - vga : 640x480, 31 kHz, 60 Hz
720 - vga70 : 640x400, 31 kHz, 70 Hz 752 - vga70 : 640x400, 31 kHz, 70 Hz
@@ -726,7 +758,7 @@ chipset and 8-bit color for the AGA chipset.
7265.1.2) depth 7585.1.2) depth
727------------ 759------------
728 760
729Syntax: depth:<nr. of bit-planes> 761:Syntax: depth:<nr. of bit-planes>
730 762
731Specify the number of bit-planes for the selected video-mode. 763Specify the number of bit-planes for the selected video-mode.
732 764
@@ -739,32 +771,32 @@ Use inverted display (black on white). Functionally the same as the
7395.1.4) font 7715.1.4) font
740----------- 772-----------
741 773
742Syntax: font:<fontname> 774:Syntax: font:<fontname>
743 775
744Specify the font to use in text modes. Functionally the same as the 776Specify the font to use in text modes. Functionally the same as the
745"font" sub-option for the Atari, except that `PEARL8x8' is used instead 777"font" sub-option for the Atari, except that `PEARL8x8` is used instead
746of `VGA8x8' if the vertical size of the display is less than 400 pixel 778of `VGA8x8` if the vertical size of the display is less than 400 pixel
747rows. 779rows.
748 780
7495.1.5) monitorcap: 7815.1.5) monitorcap:
750------------------- 782-------------------
751 783
752Syntax: monitorcap:<vmin>;<vmax>;<hmin>;<hmax> 784:Syntax: monitorcap:<vmin>;<vmax>;<hmin>;<hmax>
753 785
754This describes the capabilities of a multisync monitor. For now, only 786This describes the capabilities of a multisync monitor. For now, only
755the color frame buffer uses the settings of "monitorcap:". 787the color frame buffer uses the settings of "monitorcap:".
756 788
757 <vmin> and <vmax> are the minimum and maximum, resp., vertical frequencies 789<vmin> and <vmax> are the minimum and maximum, resp., vertical frequencies
758your monitor can work with, in Hz. <hmin> and <hmax> are the same for 790your monitor can work with, in Hz. <hmin> and <hmax> are the same for
759the horizontal frequency, in kHz. 791the horizontal frequency, in kHz.
760 792
761 The defaults are 50;90;15;38 (Generic Amiga multisync monitor). 793The defaults are 50;90;15;38 (Generic Amiga multisync monitor).
762 794
763 795
7645.2) fd_def_df0= 7965.2) fd_def_df0=
765---------------- 797----------------
766 798
767Syntax: fd_def_df0=<value> 799:Syntax: fd_def_df0=<value>
768 800
769Sets the df0 value for "silent" floppy drives. The value should be in 801Sets the df0 value for "silent" floppy drives. The value should be in
770hexadecimal with "0x" prefix. 802hexadecimal with "0x" prefix.
@@ -773,7 +805,7 @@ hexadecimal with "0x" prefix.
7735.3) wd33c93= 8055.3) wd33c93=
774------------- 806-------------
775 807
776Syntax: wd33c93=<sub-options...> 808:Syntax: wd33c93=<sub-options...>
777 809
778These options affect the A590/A2091, A3000 and GVP Series II SCSI 810These options affect the A590/A2091, A3000 and GVP Series II SCSI
779controllers. 811controllers.
@@ -784,9 +816,9 @@ below.
7845.3.1) nosync 8165.3.1) nosync
785------------- 817-------------
786 818
787Syntax: nosync:bitmask 819:Syntax: nosync:bitmask
788 820
789 bitmask is a byte where the 1st 7 bits correspond with the 7 821bitmask is a byte where the 1st 7 bits correspond with the 7
790possible SCSI devices. Set a bit to prevent sync negotiation on that 822possible SCSI devices. Set a bit to prevent sync negotiation on that
791device. To maintain backwards compatibility, a command-line such as 823device. To maintain backwards compatibility, a command-line such as
792"wd33c93=255" will be automatically translated to 824"wd33c93=255" will be automatically translated to
@@ -796,35 +828,35 @@ all devices, eg. nosync:0xff.
7965.3.2) period 8285.3.2) period
797------------- 829-------------
798 830
799Syntax: period:ns 831:Syntax: period:ns
800 832
801 `ns' is the minimum # of nanoseconds in a SCSI data transfer 833`ns` is the minimum # of nanoseconds in a SCSI data transfer
802period. Default is 500; acceptable values are 250 - 1000. 834period. Default is 500; acceptable values are 250 - 1000.
803 835
8045.3.3) disconnect 8365.3.3) disconnect
805----------------- 837-----------------
806 838
807Syntax: disconnect:x 839:Syntax: disconnect:x
808 840
809 Specify x = 0 to never allow disconnects, 2 to always allow them. 841Specify x = 0 to never allow disconnects, 2 to always allow them.
810x = 1 does 'adaptive' disconnects, which is the default and generally 842x = 1 does 'adaptive' disconnects, which is the default and generally
811the best choice. 843the best choice.
812 844
8135.3.4) debug 8455.3.4) debug
814------------ 846------------
815 847
816Syntax: debug:x 848:Syntax: debug:x
817 849
818 If `DEBUGGING_ON' is defined, x is a bit mask that causes various 850If `DEBUGGING_ON` is defined, x is a bit mask that causes various
819types of debug output to printed - see the DB_xxx defines in 851types of debug output to printed - see the DB_xxx defines in
820wd33c93.h. 852wd33c93.h.
821 853
8225.3.5) clock 8545.3.5) clock
823------------ 855------------
824 856
825Syntax: clock:x 857:Syntax: clock:x
826 858
827 x = clock input in MHz for WD33c93 chip. Normal values would be from 859x = clock input in MHz for WD33c93 chip. Normal values would be from
8288 through 20. The default value depends on your hostadapter(s), 8608 through 20. The default value depends on your hostadapter(s),
829default for the A3000 internal controller is 14, for the A2091 it's 8 861default for the A3000 internal controller is 14, for the A2091 it's 8
830and for the GVP hostadapters it's either 8 or 14, depending on the 862and for the GVP hostadapters it's either 8 or 14, depending on the
@@ -834,15 +866,15 @@ hostadapters.
8345.3.6) next 8665.3.6) next
835----------- 867-----------
836 868
837 No argument. Used to separate blocks of keywords when there's more 869No argument. Used to separate blocks of keywords when there's more
838than one wd33c93-based host adapter in the system. 870than one wd33c93-based host adapter in the system.
839 871
8405.3.7) nodma 8725.3.7) nodma
841------------ 873------------
842 874
843Syntax: nodma:x 875:Syntax: nodma:x
844 876
845 If x is 1 (or if the option is just written as "nodma"), the WD33c93 877If x is 1 (or if the option is just written as "nodma"), the WD33c93
846controller will not use DMA (= direct memory access) to access the 878controller will not use DMA (= direct memory access) to access the
847Amiga's memory. This is useful for some systems (like A3000's and 879Amiga's memory. This is useful for some systems (like A3000's and
848A4000's with the A3640 accelerator, revision 3.0) that have problems 880A4000's with the A3640 accelerator, revision 3.0) that have problems
@@ -853,32 +885,27 @@ possible.
8535.4) gvp11= 8855.4) gvp11=
854----------- 886-----------
855 887
856Syntax: gvp11=<addr-mask> 888:Syntax: gvp11=<addr-mask>
857 889
858 The earlier versions of the GVP driver did not handle DMA 890The earlier versions of the GVP driver did not handle DMA
859address-mask settings correctly which made it necessary for some 891address-mask settings correctly which made it necessary for some
860people to use this option, in order to get their GVP controller 892people to use this option, in order to get their GVP controller
861running under Linux. These problems have hopefully been solved and the 893running under Linux. These problems have hopefully been solved and the
862use of this option is now highly unrecommended! 894use of this option is now highly unrecommended!
863 895
864 Incorrect use can lead to unpredictable behavior, so please only use 896Incorrect use can lead to unpredictable behavior, so please only use
865this option if you *know* what you are doing and have a reason to do 897this option if you *know* what you are doing and have a reason to do
866so. In any case if you experience problems and need to use this 898so. In any case if you experience problems and need to use this
867option, please inform us about it by mailing to the Linux/68k kernel 899option, please inform us about it by mailing to the Linux/68k kernel
868mailing list. 900mailing list.
869 901
870 The address mask set by this option specifies which addresses are 902The address mask set by this option specifies which addresses are
871valid for DMA with the GVP Series II SCSI controller. An address is 903valid for DMA with the GVP Series II SCSI controller. An address is
872valid, if no bits are set except the bits that are set in the mask, 904valid, if no bits are set except the bits that are set in the mask,
873too. 905too.
874 906
875 Some versions of the GVP can only DMA into a 24 bit address range, 907Some versions of the GVP can only DMA into a 24 bit address range,
876some can address a 25 bit address range while others can use the whole 908some can address a 25 bit address range while others can use the whole
87732 bit address range for DMA. The correct setting depends on your 90932 bit address range for DMA. The correct setting depends on your
878controller and should be autodetected by the driver. An example is the 910controller and should be autodetected by the driver. An example is the
87924 bit region which is specified by a mask of 0x00fffffe. 91124 bit region which is specified by a mask of 0x00fffffe.
880
881
882/* Local Variables: */
883/* mode: text */
884/* End: */
diff --git a/Documentation/mic/index.rst b/Documentation/mic/index.rst
index 082fa8f6a260..3a8d06367ef1 100644
--- a/Documentation/mic/index.rst
+++ b/Documentation/mic/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3============================================= 1=============================================
4Intel Many Integrated Core (MIC) architecture 2Intel Many Integrated Core (MIC) architecture
5============================================= 3=============================================
diff --git a/Documentation/netlabel/index.rst b/Documentation/netlabel/index.rst
index 47f1e0e5acd1..984e1b191b12 100644
--- a/Documentation/netlabel/index.rst
+++ b/Documentation/netlabel/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3======== 3========
4NetLabel 4NetLabel
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 48c79e78817b..df33674799b5 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -2287,7 +2287,7 @@ addr_scope_policy - INTEGER
2287 2287
2288 2288
2289/proc/sys/net/core/* 2289/proc/sys/net/core/*
2290 Please see: Documentation/sysctl/net.txt for descriptions of these entries. 2290 Please see: Documentation/admin-guide/sysctl/net.rst for descriptions of these entries.
2291 2291
2292 2292
2293/proc/sys/net/unix/* 2293/proc/sys/net/unix/*
diff --git a/Documentation/pcmcia/index.rst b/Documentation/pcmcia/index.rst
index 779c8527109e..7ae1f62fca14 100644
--- a/Documentation/pcmcia/index.rst
+++ b/Documentation/pcmcia/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3====== 3======
4pcmcia 4pcmcia
diff --git a/Documentation/pi-futex.txt b/Documentation/pi-futex.txt
index b154f6c0c36e..c33ba2befbf8 100644
--- a/Documentation/pi-futex.txt
+++ b/Documentation/pi-futex.txt
@@ -119,4 +119,4 @@ properties of futexes, and all four combinations are possible: futex,
119robust-futex, PI-futex, robust+PI-futex. 119robust-futex, PI-futex, robust+PI-futex.
120 120
121More details about priority inheritance can be found in 121More details about priority inheritance can be found in
122Documentation/locking/rt-mutex.txt. 122Documentation/locking/rt-mutex.rst.
diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.txt
index 0c41d6d463f3..10e7f4d16c14 100644
--- a/Documentation/powerpc/firmware-assisted-dump.txt
+++ b/Documentation/powerpc/firmware-assisted-dump.txt
@@ -59,7 +59,7 @@ as follows:
59 the default calculated size. Use this option if default 59 the default calculated size. Use this option if default
60 boot memory size is not sufficient for second kernel to 60 boot memory size is not sufficient for second kernel to
61 boot successfully. For syntax of crashkernel= parameter, 61 boot successfully. For syntax of crashkernel= parameter,
62 refer to Documentation/kdump/kdump.rst. If any offset is 62 refer to Documentation/admin-guide/kdump/kdump.rst. If any offset is
63 provided in crashkernel= parameter, it will be ignored 63 provided in crashkernel= parameter, it will be ignored
64 as fadump uses a predefined offset to reserve memory 64 as fadump uses a predefined offset to reserve memory
65 for boot memory dump preservation in case of a crash. 65 for boot memory dump preservation in case of a crash.
diff --git a/Documentation/process/submit-checklist.rst b/Documentation/process/submit-checklist.rst
index 365efc9e4aa8..8e56337d422d 100644
--- a/Documentation/process/submit-checklist.rst
+++ b/Documentation/process/submit-checklist.rst
@@ -107,7 +107,7 @@ and elsewhere regarding submitting Linux kernel patches.
107 and why. 107 and why.
108 108
10926) If any ioctl's are added by the patch, then also update 10926) If any ioctl's are added by the patch, then also update
110 ``Documentation/ioctl/ioctl-number.txt``. 110 ``Documentation/ioctl/ioctl-number.rst``.
111 111
11227) If your modified source code depends on or uses any of the kernel 11227) If your modified source code depends on or uses any of the kernel
113 APIs or features that are related to the following ``Kconfig`` symbols, 113 APIs or features that are related to the following ``Kconfig`` symbols,
diff --git a/Documentation/pti/pti_intel_mid.txt b/Documentation/pti/pti_intel_mid.txt
deleted file mode 100644
index e7a5b6d1f7a9..000000000000
--- a/Documentation/pti/pti_intel_mid.txt
+++ /dev/null
@@ -1,99 +0,0 @@
1The Intel MID PTI project is HW implemented in Intel Atom
2system-on-a-chip designs based on the Parallel Trace
3Interface for MIPI P1149.7 cJTAG standard. The kernel solution
4for this platform involves the following files:
5
6./include/linux/pti.h
7./drivers/.../n_tracesink.h
8./drivers/.../n_tracerouter.c
9./drivers/.../n_tracesink.c
10./drivers/.../pti.c
11
12pti.c is the driver that enables various debugging features
13popular on platforms from certain mobile manufacturers.
14n_tracerouter.c and n_tracesink.c allow extra system information to
15be collected and routed to the pti driver, such as trace
16debugging data from a modem. Although n_tracerouter
17and n_tracesink are a part of the complete PTI solution,
18these two line disciplines can work separately from
19pti.c and route any data stream from one /dev/tty node
20to another /dev/tty node via kernel-space. This provides
21a stable, reliable connection that will not break unless
22the user-space application shuts down (plus avoids
23kernel->user->kernel context switch overheads of routing
24data).
25
26An example debugging usage for this driver system:
27 *Hook /dev/ttyPTI0 to syslogd. Opening this port will also start
28 a console device to further capture debugging messages to PTI.
29 *Hook /dev/ttyPTI1 to modem debugging data to write to PTI HW.
30 This is where n_tracerouter and n_tracesink are used.
31 *Hook /dev/pti to a user-level debugging application for writing
32 to PTI HW.
33 *Use mipi_* Kernel Driver API in other device drivers for
34 debugging to PTI by first requesting a PTI write address via
35 mipi_request_masterchannel(1).
36
37Below is example pseudo-code on how a 'privileged' application
38can hook up n_tracerouter and n_tracesink to any tty on
39a system. 'Privileged' means the application has enough
40privileges to successfully manipulate the ldisc drivers
41but is not just blindly executing as 'root'. Keep in mind
42the use of ioctl(,TIOCSETD,) is not specific to the n_tracerouter
43and n_tracesink line discpline drivers but is a generic
44operation for a program to use a line discpline driver
45on a tty port other than the default n_tty.
46
47/////////// To hook up n_tracerouter and n_tracesink /////////
48
49// Note that n_tracerouter depends on n_tracesink.
50#include <errno.h>
51#define ONE_TTY "/dev/ttyOne"
52#define TWO_TTY "/dev/ttyTwo"
53
54// needed global to hand onto ldisc connection
55static int g_fd_source = -1;
56static int g_fd_sink = -1;
57
58// these two vars used to grab LDISC values from loaded ldisc drivers
59// in OS. Look at /proc/tty/ldiscs to get the right numbers from
60// the ldiscs loaded in the system.
61int source_ldisc_num, sink_ldisc_num = -1;
62int retval;
63
64g_fd_source = open(ONE_TTY, O_RDWR); // must be R/W
65g_fd_sink = open(TWO_TTY, O_RDWR); // must be R/W
66
67if (g_fd_source <= 0) || (g_fd_sink <= 0) {
68 // doubt you'll want to use these exact error lines of code
69 printf("Error on open(). errno: %d\n",errno);
70 return errno;
71}
72
73retval = ioctl(g_fd_sink, TIOCSETD, &sink_ldisc_num);
74if (retval < 0) {
75 printf("Error on ioctl(). errno: %d\n", errno);
76 return errno;
77}
78
79retval = ioctl(g_fd_source, TIOCSETD, &source_ldisc_num);
80if (retval < 0) {
81 printf("Error on ioctl(). errno: %d\n", errno);
82 return errno;
83}
84
85/////////// To disconnect n_tracerouter and n_tracesink ////////
86
87// First make sure data through the ldiscs has stopped.
88
89// Second, disconnect ldiscs. This provides a
90// little cleaner shutdown on tty stack.
91sink_ldisc_num = 0;
92source_ldisc_num = 0;
93ioctl(g_fd_uart, TIOCSETD, &sink_ldisc_num);
94ioctl(g_fd_gadget, TIOCSETD, &source_ldisc_num);
95
96// Three, program closes connection, and cleanup:
97close(g_fd_uart);
98close(g_fd_gadget);
99g_fd_uart = g_fd_gadget = NULL;
diff --git a/Documentation/rbtree.txt b/Documentation/rbtree.txt
index c42a21b99046..523d54b60087 100644
--- a/Documentation/rbtree.txt
+++ b/Documentation/rbtree.txt
@@ -204,21 +204,21 @@ potentially expensive tree iterations. This is done at negligible runtime
204overhead for maintanence; albeit larger memory footprint. 204overhead for maintanence; albeit larger memory footprint.
205 205
206Similar to the rb_root structure, cached rbtrees are initialized to be 206Similar to the rb_root structure, cached rbtrees are initialized to be
207empty via: 207empty via::
208 208
209 struct rb_root_cached mytree = RB_ROOT_CACHED; 209 struct rb_root_cached mytree = RB_ROOT_CACHED;
210 210
211Cached rbtree is simply a regular rb_root with an extra pointer to cache the 211Cached rbtree is simply a regular rb_root with an extra pointer to cache the
212leftmost node. This allows rb_root_cached to exist wherever rb_root does, 212leftmost node. This allows rb_root_cached to exist wherever rb_root does,
213which permits augmented trees to be supported as well as only a few extra 213which permits augmented trees to be supported as well as only a few extra
214interfaces: 214interfaces::
215 215
216 struct rb_node *rb_first_cached(struct rb_root_cached *tree); 216 struct rb_node *rb_first_cached(struct rb_root_cached *tree);
217 void rb_insert_color_cached(struct rb_node *, struct rb_root_cached *, bool); 217 void rb_insert_color_cached(struct rb_node *, struct rb_root_cached *, bool);
218 void rb_erase_cached(struct rb_node *node, struct rb_root_cached *); 218 void rb_erase_cached(struct rb_node *node, struct rb_root_cached *);
219 219
220Both insert and erase calls have their respective counterpart of augmented 220Both insert and erase calls have their respective counterpart of augmented
221trees: 221trees::
222 222
223 void rb_insert_augmented_cached(struct rb_node *node, struct rb_root_cached *, 223 void rb_insert_augmented_cached(struct rb_node *node, struct rb_root_cached *,
224 bool, struct rb_augment_callbacks *); 224 bool, struct rb_augment_callbacks *);
diff --git a/Documentation/riscv/index.rst b/Documentation/riscv/index.rst
index c4b906d9b5a7..e3ca0922a8c2 100644
--- a/Documentation/riscv/index.rst
+++ b/Documentation/riscv/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3=================== 1===================
4RISC-V architecture 2RISC-V architecture
5=================== 3===================
diff --git a/Documentation/s390/debugging390.rst b/Documentation/s390/debugging390.rst
index d49305fd5e1a..73ad0b06c666 100644
--- a/Documentation/s390/debugging390.rst
+++ b/Documentation/s390/debugging390.rst
@@ -170,7 +170,7 @@ currently running at.
170| +----------------+-------------------------------------------------+ 170| +----------------+-------------------------------------------------+
171| | 32 | Basic Addressing Mode | 171| | 32 | Basic Addressing Mode |
172| | | | 172| | | |
173| | | Used to set addressing mode | 173| | | Used to set addressing mode:: |
174| | | | 174| | | |
175| | | +---------+----------+----------+ | 175| | | +---------+----------+----------+ |
176| | | | PSW 31 | PSW 32 | | | 176| | | | PSW 31 | PSW 32 | | |
diff --git a/Documentation/s390/index.rst b/Documentation/s390/index.rst
index 1a914da2a07b..4602312909d3 100644
--- a/Documentation/s390/index.rst
+++ b/Documentation/s390/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3================= 1=================
4s390 Architecture 2s390 Architecture
5================= 3=================
diff --git a/Documentation/s390/vfio-ccw.rst b/Documentation/s390/vfio-ccw.rst
index 1f6d0b56d53e..1e210c6afa88 100644
--- a/Documentation/s390/vfio-ccw.rst
+++ b/Documentation/s390/vfio-ccw.rst
@@ -38,7 +38,7 @@ every detail. More information/reference could be found here:
38 qemu/hw/s390x/css.c 38 qemu/hw/s390x/css.c
39 39
40For vfio mediated device framework: 40For vfio mediated device framework:
41- Documentation/vfio-mediated-device.txt 41- Documentation/driver-api/vfio-mediated-device.rst
42 42
43Motivation of vfio-ccw 43Motivation of vfio-ccw
44---------------------- 44----------------------
@@ -322,5 +322,5 @@ Reference
3222. ESA/390 Common I/O Device Commands manual (IBM Form. No. SA22-7204) 3222. ESA/390 Common I/O Device Commands manual (IBM Form. No. SA22-7204)
3233. https://en.wikipedia.org/wiki/Channel_I/O 3233. https://en.wikipedia.org/wiki/Channel_I/O
3244. Documentation/s390/cds.rst 3244. Documentation/s390/cds.rst
3255. Documentation/vfio.txt 3255. Documentation/driver-api/vfio.rst
3266. Documentation/vfio-mediated-device.txt 3266. Documentation/driver-api/vfio-mediated-device.rst
diff --git a/Documentation/scheduler/index.rst b/Documentation/scheduler/index.rst
index 058be77a4c34..69074e5de9c4 100644
--- a/Documentation/scheduler/index.rst
+++ b/Documentation/scheduler/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3=============== 1===============
4Linux Scheduler 2Linux Scheduler
5=============== 3===============
diff --git a/Documentation/scheduler/sched-deadline.rst b/Documentation/scheduler/sched-deadline.rst
index 3391e86d810c..14a2f7bf63fe 100644
--- a/Documentation/scheduler/sched-deadline.rst
+++ b/Documentation/scheduler/sched-deadline.rst
@@ -669,7 +669,7 @@ Deadline Task Scheduling
669 669
670 -deadline tasks cannot have an affinity mask smaller that the entire 670 -deadline tasks cannot have an affinity mask smaller that the entire
671 root_domain they are created on. However, affinities can be specified 671 root_domain they are created on. However, affinities can be specified
672 through the cpuset facility (Documentation/cgroup-v1/cpusets.rst). 672 through the cpuset facility (Documentation/admin-guide/cgroup-v1/cpusets.rst).
673 673
6745.1 SCHED_DEADLINE and cpusets HOWTO 6745.1 SCHED_DEADLINE and cpusets HOWTO
675------------------------------------ 675------------------------------------
diff --git a/Documentation/scheduler/sched-design-CFS.rst b/Documentation/scheduler/sched-design-CFS.rst
index 53b30d1967cf..a96c72651877 100644
--- a/Documentation/scheduler/sched-design-CFS.rst
+++ b/Documentation/scheduler/sched-design-CFS.rst
@@ -222,7 +222,7 @@ SCHED_BATCH) tasks.
222 222
223 These options need CONFIG_CGROUPS to be defined, and let the administrator 223 These options need CONFIG_CGROUPS to be defined, and let the administrator
224 create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See 224 create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See
225 Documentation/cgroup-v1/cgroups.rst for more information about this filesystem. 225 Documentation/admin-guide/cgroup-v1/cgroups.rst for more information about this filesystem.
226 226
227When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each 227When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
228group created using the pseudo filesystem. See example steps below to create 228group created using the pseudo filesystem. See example steps below to create
diff --git a/Documentation/scheduler/sched-rt-group.rst b/Documentation/scheduler/sched-rt-group.rst
index d27d3f3712fd..655a096ec8fb 100644
--- a/Documentation/scheduler/sched-rt-group.rst
+++ b/Documentation/scheduler/sched-rt-group.rst
@@ -133,7 +133,7 @@ This uses the cgroup virtual file system and "<cgroup>/cpu.rt_runtime_us"
133to control the CPU time reserved for each control group. 133to control the CPU time reserved for each control group.
134 134
135For more information on working with control groups, you should read 135For more information on working with control groups, you should read
136Documentation/cgroup-v1/cgroups.rst as well. 136Documentation/admin-guide/cgroup-v1/cgroups.rst as well.
137 137
138Group settings are checked against the following limits in order to keep the 138Group settings are checked against the following limits in order to keep the
139configuration schedulable: 139configuration schedulable:
diff --git a/Documentation/security/index.rst b/Documentation/security/index.rst
index aad6d92ffe31..fc503dd689a7 100644
--- a/Documentation/security/index.rst
+++ b/Documentation/security/index.rst
@@ -8,7 +8,10 @@ Security Documentation
8 credentials 8 credentials
9 IMA-templates 9 IMA-templates
10 keys/index 10 keys/index
11 LSM 11 lsm
12 lsm-development
13 sak
12 SCTP 14 SCTP
13 self-protection 15 self-protection
16 siphash
14 tpm/index 17 tpm/index
diff --git a/Documentation/security/LSM.rst b/Documentation/security/lsm-development.rst
index 31d92bc5fdd2..31d92bc5fdd2 100644
--- a/Documentation/security/LSM.rst
+++ b/Documentation/security/lsm-development.rst
diff --git a/Documentation/lsm.txt b/Documentation/security/lsm.rst
index ad4dfd020e0d..ad4dfd020e0d 100644
--- a/Documentation/lsm.txt
+++ b/Documentation/security/lsm.rst
diff --git a/Documentation/SAK.txt b/Documentation/security/sak.rst
index 260e1d3687bd..260e1d3687bd 100644
--- a/Documentation/SAK.txt
+++ b/Documentation/security/sak.rst
diff --git a/Documentation/siphash.txt b/Documentation/security/siphash.rst
index 9965821ab333..9965821ab333 100644
--- a/Documentation/siphash.txt
+++ b/Documentation/security/siphash.rst
diff --git a/Documentation/security/tpm/index.rst b/Documentation/security/tpm/index.rst
index af77a7bbb070..3296533e54cf 100644
--- a/Documentation/security/tpm/index.rst
+++ b/Documentation/security/tpm/index.rst
@@ -5,3 +5,4 @@ Trusted Platform Module documentation
5.. toctree:: 5.. toctree::
6 6
7 tpm_vtpm_proxy 7 tpm_vtpm_proxy
8 xen-tpmfront
diff --git a/Documentation/security/tpm/xen-tpmfront.txt b/Documentation/security/tpm/xen-tpmfront.rst
index 69346de87ff3..00d5b1db227d 100644
--- a/Documentation/security/tpm/xen-tpmfront.txt
+++ b/Documentation/security/tpm/xen-tpmfront.rst
@@ -1,4 +1,6 @@
1=============================
1Virtual TPM interface for Xen 2Virtual TPM interface for Xen
3=============================
2 4
3Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA) 5Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)
4 6
@@ -6,7 +8,8 @@ This document describes the virtual Trusted Platform Module (vTPM) subsystem for
6Xen. The reader is assumed to have familiarity with building and installing Xen, 8Xen. The reader is assumed to have familiarity with building and installing Xen,
7Linux, and a basic understanding of the TPM and vTPM concepts. 9Linux, and a basic understanding of the TPM and vTPM concepts.
8 10
9INTRODUCTION 11Introduction
12------------
10 13
11The goal of this work is to provide a TPM functionality to a virtual guest 14The goal of this work is to provide a TPM functionality to a virtual guest
12operating system (in Xen terms, a DomU). This allows programs to interact with 15operating system (in Xen terms, a DomU). This allows programs to interact with
@@ -24,81 +27,89 @@ This mini-os vTPM subsystem was built on top of the previous vTPM work done by
24IBM and Intel corporation. 27IBM and Intel corporation.
25 28
26 29
27DESIGN OVERVIEW 30Design Overview
28--------------- 31---------------
29 32
30The architecture of vTPM is described below: 33The architecture of vTPM is described below::
31 34
32+------------------+ 35 +------------------+
33| Linux DomU | ... 36 | Linux DomU | ...
34| | ^ | 37 | | ^ |
35| v | | 38 | v | |
36| xen-tpmfront | 39 | xen-tpmfront |
37+------------------+ 40 +------------------+
38 | ^ 41 | ^
39 v | 42 v |
40+------------------+ 43 +------------------+
41| mini-os/tpmback | 44 | mini-os/tpmback |
42| | ^ | 45 | | ^ |
43| v | | 46 | v | |
44| vtpm-stubdom | ... 47 | vtpm-stubdom | ...
45| | ^ | 48 | | ^ |
46| v | | 49 | v | |
47| mini-os/tpmfront | 50 | mini-os/tpmfront |
48+------------------+ 51 +------------------+
49 | ^ 52 | ^
50 v | 53 v |
51+------------------+ 54 +------------------+
52| mini-os/tpmback | 55 | mini-os/tpmback |
53| | ^ | 56 | | ^ |
54| v | | 57 | v | |
55| vtpmmgr-stubdom | 58 | vtpmmgr-stubdom |
56| | ^ | 59 | | ^ |
57| v | | 60 | v | |
58| mini-os/tpm_tis | 61 | mini-os/tpm_tis |
59+------------------+ 62 +------------------+
60 | ^ 63 | ^
61 v | 64 v |
62+------------------+ 65 +------------------+
63| Hardware TPM | 66 | Hardware TPM |
64+------------------+ 67 +------------------+
65 68
66 * Linux DomU: The Linux based guest that wants to use a vTPM. There may be 69* Linux DomU:
70 The Linux based guest that wants to use a vTPM. There may be
67 more than one of these. 71 more than one of these.
68 72
69 * xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver 73* xen-tpmfront.ko:
74 Linux kernel virtual TPM frontend driver. This driver
70 provides vTPM access to a Linux-based DomU. 75 provides vTPM access to a Linux-based DomU.
71 76
72 * mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver 77* mini-os/tpmback:
78 Mini-os TPM backend driver. The Linux frontend driver
73 connects to this backend driver to facilitate communications 79 connects to this backend driver to facilitate communications
74 between the Linux DomU and its vTPM. This driver is also 80 between the Linux DomU and its vTPM. This driver is also
75 used by vtpmmgr-stubdom to communicate with vtpm-stubdom. 81 used by vtpmmgr-stubdom to communicate with vtpm-stubdom.
76 82
77 * vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a 83* vtpm-stubdom:
84 A mini-os stub domain that implements a vTPM. There is a
78 one to one mapping between running vtpm-stubdom instances and 85 one to one mapping between running vtpm-stubdom instances and
79 logical vtpms on the system. The vTPM Platform Configuration 86 logical vtpms on the system. The vTPM Platform Configuration
80 Registers (PCRs) are normally all initialized to zero. 87 Registers (PCRs) are normally all initialized to zero.
81 88
82 * mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain 89* mini-os/tpmfront:
90 Mini-os TPM frontend driver. The vTPM mini-os domain
83 vtpm-stubdom uses this driver to communicate with 91 vtpm-stubdom uses this driver to communicate with
84 vtpmmgr-stubdom. This driver is also used in mini-os 92 vtpmmgr-stubdom. This driver is also used in mini-os
85 domains such as pv-grub that talk to the vTPM domain. 93 domains such as pv-grub that talk to the vTPM domain.
86 94
87 * vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager. There is 95* vtpmmgr-stubdom:
96 A mini-os domain that implements the vTPM manager. There is
88 only one vTPM manager and it should be running during the 97 only one vTPM manager and it should be running during the
89 entire lifetime of the machine. This domain regulates 98 entire lifetime of the machine. This domain regulates
90 access to the physical TPM on the system and secures the 99 access to the physical TPM on the system and secures the
91 persistent state of each vTPM. 100 persistent state of each vTPM.
92 101
93 * mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS) 102* mini-os/tpm_tis:
103 Mini-os TPM version 1.2 TPM Interface Specification (TIS)
94 driver. This driver used by vtpmmgr-stubdom to talk directly to 104 driver. This driver used by vtpmmgr-stubdom to talk directly to
95 the hardware TPM. Communication is facilitated by mapping 105 the hardware TPM. Communication is facilitated by mapping
96 hardware memory pages into vtpmmgr-stubdom. 106 hardware memory pages into vtpmmgr-stubdom.
97 107
98 * Hardware TPM: The physical TPM that is soldered onto the motherboard. 108* Hardware TPM:
109 The physical TPM that is soldered onto the motherboard.
99 110
100 111
101INTEGRATION WITH XEN 112Integration With Xen
102-------------------- 113--------------------
103 114
104Support for the vTPM driver was added in Xen using the libxl toolstack in Xen 115Support for the vTPM driver was added in Xen using the libxl toolstack in Xen
diff --git a/Documentation/sparc/index.rst b/Documentation/sparc/index.rst
index 91f7d6643dd5..71cff621f243 100644
--- a/Documentation/sparc/index.rst
+++ b/Documentation/sparc/index.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3================== 1==================
4Sparc Architecture 2Sparc Architecture
5================== 3==================
diff --git a/Documentation/sysctl/abi.txt b/Documentation/sysctl/abi.txt
deleted file mode 100644
index 63f4ebcf652c..000000000000
--- a/Documentation/sysctl/abi.txt
+++ /dev/null
@@ -1,54 +0,0 @@
1Documentation for /proc/sys/abi/* kernel version 2.6.0.test2
2 (c) 2003, Fabian Frederick <ffrederick@users.sourceforge.net>
3
4For general info : README.
5
6==============================================================
7
8This path is binary emulation relevant aka personality types aka abi.
9When a process is executed, it's linked to an exec_domain whose
10personality is defined using values available from /proc/sys/abi.
11You can find further details about abi in include/linux/personality.h.
12
13Here are the files featuring in 2.6 kernel :
14
15- defhandler_coff
16- defhandler_elf
17- defhandler_lcall7
18- defhandler_libcso
19- fake_utsname
20- trace
21
22===========================================================
23defhandler_coff:
24defined value :
25PER_SCOSVR3
260x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE
27
28===========================================================
29defhandler_elf:
30defined value :
31PER_LINUX
320
33
34===========================================================
35defhandler_lcall7:
36defined value :
37PER_SVR4
380x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
39
40===========================================================
41defhandler_libsco:
42defined value:
43PER_SVR4
440x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
45
46===========================================================
47fake_utsname:
48Unused
49
50===========================================================
51trace:
52Unused
53
54===========================================================
diff --git a/Documentation/target/index.rst b/Documentation/target/index.rst
index b68f48982392..4b24f81f747e 100644
--- a/Documentation/target/index.rst
+++ b/Documentation/target/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3================== 3==================
4TCM Virtual Device 4TCM Virtual Device
diff --git a/Documentation/timers/index.rst b/Documentation/timers/index.rst
index 91f6f8263c48..df510ad0c989 100644
--- a/Documentation/timers/index.rst
+++ b/Documentation/timers/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3====== 3======
4timers 4timers
diff --git a/Documentation/translations/it_IT/kernel-hacking/locking.rst b/Documentation/translations/it_IT/kernel-hacking/locking.rst
index 5fd8a1abd2be..b9a6be4b8499 100644
--- a/Documentation/translations/it_IT/kernel-hacking/locking.rst
+++ b/Documentation/translations/it_IT/kernel-hacking/locking.rst
@@ -1404,7 +1404,7 @@ Riferimento per l'API dei Futex
1404Approfondimenti 1404Approfondimenti
1405=============== 1405===============
1406 1406
1407- ``Documentation/locking/spinlocks.txt``: la guida di Linus Torvalds agli 1407- ``Documentation/locking/spinlocks.rst``: la guida di Linus Torvalds agli
1408 spinlock del kernel. 1408 spinlock del kernel.
1409 1409
1410- Unix Systems for Modern Architectures: Symmetric Multiprocessing and 1410- Unix Systems for Modern Architectures: Symmetric Multiprocessing and
diff --git a/Documentation/translations/it_IT/process/submit-checklist.rst b/Documentation/translations/it_IT/process/submit-checklist.rst
index ea74cae958d7..995ee69fab11 100644
--- a/Documentation/translations/it_IT/process/submit-checklist.rst
+++ b/Documentation/translations/it_IT/process/submit-checklist.rst
@@ -117,7 +117,7 @@ sottomissione delle patch, in particolare
117 sorgenti che ne spieghi la logica: cosa fanno e perché. 117 sorgenti che ne spieghi la logica: cosa fanno e perché.
118 118
11925) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate 11925) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate
120 ``Documentation/ioctl/ioctl-number.txt``. 120 ``Documentation/ioctl/ioctl-number.rst``.
121 121
12226) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o 12226) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o
123 funzionalità del kernel che è associata a uno dei seguenti simboli 123 funzionalità del kernel che è associata a uno dei seguenti simboli
diff --git a/Documentation/translations/zh_CN/arm/Booting b/Documentation/translations/zh_CN/arm/Booting
index 1fe866f8218f..562e9a2957e6 100644
--- a/Documentation/translations/zh_CN/arm/Booting
+++ b/Documentation/translations/zh_CN/arm/Booting
@@ -1,4 +1,4 @@
1Chinese translated version of Documentation/arm/Booting 1Chinese translated version of Documentation/arm/booting.rst
2 2
3If you have any comment or update to the content, please contact the 3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem 4original document maintainer directly. However, if you have a problem
@@ -9,7 +9,7 @@ or if there is a problem with the translation.
9Maintainer: Russell King <linux@arm.linux.org.uk> 9Maintainer: Russell King <linux@arm.linux.org.uk>
10Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> 10Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
11--------------------------------------------------------------------- 11---------------------------------------------------------------------
12Documentation/arm/Booting 的中文翻译 12Documentation/arm/booting.rst 的中文翻译
13 13
14如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文 14如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文
15äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻 15äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻
diff --git a/Documentation/translations/zh_CN/arm/kernel_user_helpers.txt b/Documentation/translations/zh_CN/arm/kernel_user_helpers.txt
index cd7fc8f34cf9..99af4363984d 100644
--- a/Documentation/translations/zh_CN/arm/kernel_user_helpers.txt
+++ b/Documentation/translations/zh_CN/arm/kernel_user_helpers.txt
@@ -1,4 +1,4 @@
1Chinese translated version of Documentation/arm/kernel_user_helpers.txt 1Chinese translated version of Documentation/arm/kernel_user_helpers.rst
2 2
3If you have any comment or update to the content, please contact the 3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem 4original document maintainer directly. However, if you have a problem
@@ -10,7 +10,7 @@ Maintainer: Nicolas Pitre <nicolas.pitre@linaro.org>
10 Dave Martin <dave.martin@linaro.org> 10 Dave Martin <dave.martin@linaro.org>
11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> 11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
12--------------------------------------------------------------------- 12---------------------------------------------------------------------
13Documentation/arm/kernel_user_helpers.txt 的中文翻译 13Documentation/arm/kernel_user_helpers.rst 的中文翻译
14 14
15如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文 15如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文
16äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻 16äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 452271dda141..ee1f37da5b23 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -288,7 +288,7 @@ dev/ 包å«ä¸¤ä¸ªå­ç›®å½•: char/ å’Œ block/。在这两个å­ç›®å½•中,有ä
288中相应的设备。/sys/dev æä¾›ä¸€ä¸ªé€šè¿‡ä¸€ä¸ª stat(2) æ“作结果,查找 288中相应的设备。/sys/dev æä¾›ä¸€ä¸ªé€šè¿‡ä¸€ä¸ª stat(2) æ“作结果,查找
289设备 sysfs 接å£å¿«æ·çš„æ–¹æ³•。 289设备 sysfs 接å£å¿«æ·çš„æ–¹æ³•。
290 290
291更多有关 driver-model 的特性信æ¯å¯ä»¥åœ¨ Documentation/driver-model/ 291更多有关 driver-model 的特性信æ¯å¯ä»¥åœ¨ Documentation/driver-api/driver-model/
292中找到。 292中找到。
293 293
294 294
diff --git a/Documentation/translations/zh_CN/gpio.txt b/Documentation/translations/zh_CN/gpio.txt
index 4cb1ba8b8fed..a23ee14fc927 100644
--- a/Documentation/translations/zh_CN/gpio.txt
+++ b/Documentation/translations/zh_CN/gpio.txt
@@ -1,4 +1,4 @@
1Chinese translated version of Documentation/gpio 1Chinese translated version of Documentation/admin-guide/gpio
2 2
3If you have any comment or update to the content, please contact the 3If you have any comment or update to the content, please contact the
4original document maintainer directly. However, if you have a problem 4original document maintainer directly. However, if you have a problem
@@ -10,7 +10,7 @@ Maintainer: Grant Likely <grant.likely@secretlab.ca>
10 Linus Walleij <linus.walleij@linaro.org> 10 Linus Walleij <linus.walleij@linaro.org>
11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> 11Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
12--------------------------------------------------------------------- 12---------------------------------------------------------------------
13Documentation/gpio 的中文翻译 13Documentation/admin-guide/gpio 的中文翻译
14 14
15如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文 15如果想评论或更新本文的内容,请直接è”系原文档的维护者。如果你使用英文
16äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻 16äº¤æµæœ‰å›°éš¾çš„è¯ï¼Œä¹Ÿå¯ä»¥å‘中文版维护者求助。如果本翻译更新ä¸åŠæ—¶æˆ–者翻
diff --git a/Documentation/translations/zh_CN/oops-tracing.txt b/Documentation/translations/zh_CN/oops-tracing.txt
index 368ddd05b304..c5f3bda7abcb 100644
--- a/Documentation/translations/zh_CN/oops-tracing.txt
+++ b/Documentation/translations/zh_CN/oops-tracing.txt
@@ -53,8 +53,8 @@ cat /proc/kmsg > file, 然而你必须介入中止传输, kmsg是一个“æ°
53(2)用串å£ç»ˆç«¯å¯åŠ¨ï¼ˆè¯·å‚看Documentation/admin-guide/serial-console.rst),è¿è¡Œä¸€ä¸ªnull 53(2)用串å£ç»ˆç«¯å¯åŠ¨ï¼ˆè¯·å‚看Documentation/admin-guide/serial-console.rst),è¿è¡Œä¸€ä¸ªnull
54modem到å¦ä¸€å°æœºå™¨å¹¶ç”¨ä½ å–œæ¬¢çš„通讯工具获å–输出。Minicom工作地很好。 54modem到å¦ä¸€å°æœºå™¨å¹¶ç”¨ä½ å–œæ¬¢çš„通讯工具获å–输出。Minicom工作地很好。
55 55
56(3)使用Kdump(请å‚看Documentation/kdump/kdump.rst), 56(3)使用Kdump(请å‚看Documentation/admin-guide/kdump/kdump.rst),
57使用在Documentation/kdump/gdbmacros.txt中定义的dmesg gdbå®ï¼Œä»Žæ—§çš„内存中æå–内核 57使用在Documentation/admin-guide/kdump/gdbmacros.txt中定义的dmesg gdbå®ï¼Œä»Žæ—§çš„内存中æå–内核
58环形缓冲区。 58环形缓冲区。
59 59
60å®Œæ•´ä¿¡æ¯ 60完整信æ¯
diff --git a/Documentation/translations/zh_CN/process/submit-checklist.rst b/Documentation/translations/zh_CN/process/submit-checklist.rst
index f4785d2b0491..8738c55e42a2 100644
--- a/Documentation/translations/zh_CN/process/submit-checklist.rst
+++ b/Documentation/translations/zh_CN/process/submit-checklist.rst
@@ -97,7 +97,7 @@ Linuxå†…æ ¸è¡¥ä¸æäº¤æ¸…å•
9724) 所有内存å±éšœä¾‹å¦‚ ``barrier()``, ``rmb()``, ``wmb()`` éƒ½éœ€è¦æºä»£ç ä¸­çš„æ³¨ 9724) 所有内存å±éšœä¾‹å¦‚ ``barrier()``, ``rmb()``, ``wmb()`` éƒ½éœ€è¦æºä»£ç ä¸­çš„æ³¨
98 释æ¥è§£é‡Šå®ƒä»¬æ­£åœ¨æ‰§è¡Œçš„æ“ä½œåŠå…¶åŽŸå› çš„é€»è¾‘ã€‚ 98 释æ¥è§£é‡Šå®ƒä»¬æ­£åœ¨æ‰§è¡Œçš„æ“ä½œåŠå…¶åŽŸå› çš„é€»è¾‘ã€‚
99 99
10025) å¦‚æžœè¡¥ä¸æ·»åŠ äº†ä»»ä½•ioctlï¼Œé‚£ä¹ˆä¹Ÿè¦æ›´æ–° ``Documentation/ioctl/ioctl-number.txt`` 10025) å¦‚æžœè¡¥ä¸æ·»åŠ äº†ä»»ä½•ioctlï¼Œé‚£ä¹ˆä¹Ÿè¦æ›´æ–° ``Documentation/ioctl/ioctl-number.rst``
101 101
10226) 如果修改åŽçš„æºä»£ç ä¾èµ–或使用与以下 ``Kconfig`` 符å·ç›¸å…³çš„任何内核API或 10226) 如果修改åŽçš„æºä»£ç ä¾èµ–或使用与以下 ``Kconfig`` 符å·ç›¸å…³çš„任何内核API或
103 功能,则在ç¦ç”¨ç›¸å…³ ``Kconfig`` 符å·å’Œ/或 ``=m`` (如果该选项å¯ç”¨ï¼‰çš„æƒ…况 103 功能,则在ç¦ç”¨ç›¸å…³ ``Kconfig`` 符å·å’Œ/或 ``=m`` (如果该选项å¯ç”¨ï¼‰çš„æƒ…况
diff --git a/Documentation/accelerators/ocxl.rst b/Documentation/userspace-api/accelerators/ocxl.rst
index b1cea19a90f5..14cefc020e2d 100644
--- a/Documentation/accelerators/ocxl.rst
+++ b/Documentation/userspace-api/accelerators/ocxl.rst
@@ -1,5 +1,3 @@
1:orphan:
2
3======================================================== 1========================================================
4OpenCAPI (Open Coherent Accelerator Processor Interface) 2OpenCAPI (Open Coherent Accelerator Processor Interface)
5======================================================== 3========================================================
diff --git a/Documentation/userspace-api/index.rst b/Documentation/userspace-api/index.rst
index a3233da7fa88..ad494da40009 100644
--- a/Documentation/userspace-api/index.rst
+++ b/Documentation/userspace-api/index.rst
@@ -20,6 +20,7 @@ place where this information is gathered.
20 seccomp_filter 20 seccomp_filter
21 unshare 21 unshare
22 spec_ctrl 22 spec_ctrl
23 accelerators/ocxl
23 24
24.. only:: subproject and html 25.. only:: subproject and html
25 26
diff --git a/Documentation/vm/numa.rst b/Documentation/vm/numa.rst
index 130f3cfa1c19..99fdeca917ca 100644
--- a/Documentation/vm/numa.rst
+++ b/Documentation/vm/numa.rst
@@ -67,7 +67,7 @@ nodes. Each emulated node will manage a fraction of the underlying cells'
67physical memory. NUMA emluation is useful for testing NUMA kernel and 67physical memory. NUMA emluation is useful for testing NUMA kernel and
68application features on non-NUMA platforms, and as a sort of memory resource 68application features on non-NUMA platforms, and as a sort of memory resource
69management mechanism when used together with cpusets. 69management mechanism when used together with cpusets.
70[see Documentation/cgroup-v1/cpusets.rst] 70[see Documentation/admin-guide/cgroup-v1/cpusets.rst]
71 71
72For each node with memory, Linux constructs an independent memory management 72For each node with memory, Linux constructs an independent memory management
73subsystem, complete with its own free page lists, in-use page lists, usage 73subsystem, complete with its own free page lists, in-use page lists, usage
@@ -114,7 +114,7 @@ allocation behavior using Linux NUMA memory policy. [see
114 114
115System administrators can restrict the CPUs and nodes' memories that a non- 115System administrators can restrict the CPUs and nodes' memories that a non-
116privileged user can specify in the scheduling or NUMA commands and functions 116privileged user can specify in the scheduling or NUMA commands and functions
117using control groups and CPUsets. [see Documentation/cgroup-v1/cpusets.rst] 117using control groups and CPUsets. [see Documentation/admin-guide/cgroup-v1/cpusets.rst]
118 118
119On architectures that do not hide memoryless nodes, Linux will include only 119On architectures that do not hide memoryless nodes, Linux will include only
120zones [nodes] with memory in the zonelists. This means that for a memoryless 120zones [nodes] with memory in the zonelists. This means that for a memoryless
diff --git a/Documentation/vm/page_migration.rst b/Documentation/vm/page_migration.rst
index 35bba27d5fff..1d6cd7db4e43 100644
--- a/Documentation/vm/page_migration.rst
+++ b/Documentation/vm/page_migration.rst
@@ -41,7 +41,7 @@ locations.
41Larger installations usually partition the system using cpusets into 41Larger installations usually partition the system using cpusets into
42sections of nodes. Paul Jackson has equipped cpusets with the ability to 42sections of nodes. Paul Jackson has equipped cpusets with the ability to
43move pages when a task is moved to another cpuset (See 43move pages when a task is moved to another cpuset (See
44Documentation/cgroup-v1/cpusets.rst). 44Documentation/admin-guide/cgroup-v1/cpusets.rst).
45Cpusets allows the automation of process locality. If a task is moved to 45Cpusets allows the automation of process locality. If a task is moved to
46a new cpuset then also all its pages are moved with it so that the 46a new cpuset then also all its pages are moved with it so that the
47performance of the process does not sink dramatically. Also the pages 47performance of the process does not sink dramatically. Also the pages
diff --git a/Documentation/vm/unevictable-lru.rst b/Documentation/vm/unevictable-lru.rst
index c6d94118fbcc..17d0861b0f1d 100644
--- a/Documentation/vm/unevictable-lru.rst
+++ b/Documentation/vm/unevictable-lru.rst
@@ -98,7 +98,7 @@ Memory Control Group Interaction
98-------------------------------- 98--------------------------------
99 99
100The unevictable LRU facility interacts with the memory control group [aka 100The unevictable LRU facility interacts with the memory control group [aka
101memory controller; see Documentation/cgroup-v1/memory.rst] by extending the 101memory controller; see Documentation/admin-guide/cgroup-v1/memory.rst] by extending the
102lru_list enum. 102lru_list enum.
103 103
104The memory controller data structure automatically gets a per-zone unevictable 104The memory controller data structure automatically gets a per-zone unevictable
@@ -439,7 +439,7 @@ Compacting MLOCKED Pages
439 439
440The unevictable LRU can be scanned for compactable regions and the default 440The unevictable LRU can be scanned for compactable regions and the default
441behavior is to do so. /proc/sys/vm/compact_unevictable_allowed controls 441behavior is to do so. /proc/sys/vm/compact_unevictable_allowed controls
442this behavior (see Documentation/sysctl/vm.txt). Once scanning of the 442this behavior (see Documentation/admin-guide/sysctl/vm.rst). Once scanning of the
443unevictable LRU is enabled, the work of compaction is mostly handled by 443unevictable LRU is enabled, the work of compaction is mostly handled by
444the page migration code and the same work flow as described in MIGRATING 444the page migration code and the same work flow as described in MIGRATING
445MLOCKED PAGES will apply. 445MLOCKED PAGES will apply.
diff --git a/Documentation/w1/w1.netlink b/Documentation/w1/w1.netlink
index ef2727192d69..94ad4c420828 100644
--- a/Documentation/w1/w1.netlink
+++ b/Documentation/w1/w1.netlink
@@ -183,7 +183,7 @@ acknowledge number is set to seq+1.
183Additional documantion, source code examples. 183Additional documantion, source code examples.
184============================================ 184============================================
185 185
1861. Documentation/connector 1861. Documentation/driver-api/connector.rst
1872. http://www.ioremap.net/archive/w1 1872. http://www.ioremap.net/archive/w1
188This archive includes userspace application w1d.c which uses 188This archive includes userspace application w1d.c which uses
189read/write/search commands for all master/slave devices found on the bus. 189read/write/search commands for all master/slave devices found on the bus.
diff --git a/Documentation/watchdog/index.rst b/Documentation/watchdog/index.rst
index 33a0de631e84..c177645081d8 100644
--- a/Documentation/watchdog/index.rst
+++ b/Documentation/watchdog/index.rst
@@ -1,4 +1,4 @@
1:orphan: 1.. SPDX-License-Identifier: GPL-2.0
2 2
3====================== 3======================
4Linux Watchdog Support 4Linux Watchdog Support
diff --git a/Documentation/x86/index.rst b/Documentation/x86/index.rst
index f2de1b2d3ac7..af64c4bb4447 100644
--- a/Documentation/x86/index.rst
+++ b/Documentation/x86/index.rst
@@ -20,6 +20,8 @@ x86-specific Documentation
20 mtrr 20 mtrr
21 pat 21 pat
22 intel_mpx 22 intel_mpx
23 intel-iommu
24 intel_txt
23 amd-memory-encryption 25 amd-memory-encryption
24 pti 26 pti
25 mds 27 mds
diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/x86/intel-iommu.rst
index 9dae6b47e398..9dae6b47e398 100644
--- a/Documentation/Intel-IOMMU.txt
+++ b/Documentation/x86/intel-iommu.rst
diff --git a/Documentation/intel_txt.txt b/Documentation/x86/intel_txt.rst
index d83c1a2122c9..d83c1a2122c9 100644
--- a/Documentation/intel_txt.txt
+++ b/Documentation/x86/intel_txt.rst
diff --git a/Documentation/x86/topology.rst b/Documentation/x86/topology.rst
index 8e9704f61017..e29739904e37 100644
--- a/Documentation/x86/topology.rst
+++ b/Documentation/x86/topology.rst
@@ -9,7 +9,7 @@ representation in the kernel. Update/change when doing changes to the
9respective code. 9respective code.
10 10
11The architecture-agnostic topology definitions are in 11The architecture-agnostic topology definitions are in
12Documentation/cputopology.txt. This file holds x86-specific 12Documentation/admin-guide/cputopology.rst. This file holds x86-specific
13differences/specialities which must not necessarily apply to the generic 13differences/specialities which must not necessarily apply to the generic
14definitions. Thus, the way to read up on Linux topology on x86 is to start 14definitions. Thus, the way to read up on Linux topology on x86 is to start
15with the generic one and look at this one in parallel for the x86 specifics. 15with the generic one and look at this one in parallel for the x86 specifics.
diff --git a/Documentation/x86/x86_64/fake-numa-for-cpusets.rst b/Documentation/x86/x86_64/fake-numa-for-cpusets.rst
index 30108684ae87..ff9bcfd2cc14 100644
--- a/Documentation/x86/x86_64/fake-numa-for-cpusets.rst
+++ b/Documentation/x86/x86_64/fake-numa-for-cpusets.rst
@@ -15,7 +15,7 @@ assign them to cpusets and their attached tasks. This is a way of limiting the
15amount of system memory that are available to a certain class of tasks. 15amount of system memory that are available to a certain class of tasks.
16 16
17For more information on the features of cpusets, see 17For more information on the features of cpusets, see
18Documentation/cgroup-v1/cpusets.rst. 18Documentation/admin-guide/cgroup-v1/cpusets.rst.
19There are a number of different configurations you can use for your needs. For 19There are a number of different configurations you can use for your needs. For
20more information on the numa=fake command line option and its various ways of 20more information on the numa=fake command line option and its various ways of
21configuring fake nodes, see Documentation/x86/x86_64/boot-options.rst. 21configuring fake nodes, see Documentation/x86/x86_64/boot-options.rst.
@@ -40,7 +40,7 @@ A machine may be split as follows with "numa=fake=4*512," as reported by dmesg::
40 On node 3 totalpages: 131072 40 On node 3 totalpages: 131072
41 41
42Now following the instructions for mounting the cpusets filesystem from 42Now following the instructions for mounting the cpusets filesystem from
43Documentation/cgroup-v1/cpusets.rst, you can assign fake nodes (i.e. contiguous memory 43Documentation/admin-guide/cgroup-v1/cpusets.rst, you can assign fake nodes (i.e. contiguous memory
44address spaces) to individual cpusets:: 44address spaces) to individual cpusets::
45 45
46 [root@xroads /]# mkdir exampleset 46 [root@xroads /]# mkdir exampleset
diff --git a/Documentation/xtensa/atomctl.txt b/Documentation/xtensa/atomctl.rst
index 1da783ac200c..1ecbd0ba9a2e 100644
--- a/Documentation/xtensa/atomctl.txt
+++ b/Documentation/xtensa/atomctl.rst
@@ -1,3 +1,7 @@
1===========================================
2Atomic Operation Control (ATOMCTL) Register
3===========================================
4
1We Have Atomic Operation Control (ATOMCTL) Register. 5We Have Atomic Operation Control (ATOMCTL) Register.
2This register determines the effect of using a S32C1I instruction 6This register determines the effect of using a S32C1I instruction
3with various combinations of: 7with various combinations of:
@@ -8,7 +12,7 @@ with various combinations of:
8 2. With and without An Intelligent Memory Controller which 12 2. With and without An Intelligent Memory Controller which
9 can do Atomic Transactions itself. 13 can do Atomic Transactions itself.
10 14
11The Core comes up with a default value of for the three types of cache ops: 15The Core comes up with a default value of for the three types of cache ops::
12 16
13 0x28: (WB: Internal, WT: Internal, BY:Exception) 17 0x28: (WB: Internal, WT: Internal, BY:Exception)
14 18
@@ -30,15 +34,18 @@ CUSTOMER-WARNING:
30Developers might find using RCW in Bypass mode convenient when testing 34Developers might find using RCW in Bypass mode convenient when testing
31with the cache being bypassed; for example studying cache alias problems. 35with the cache being bypassed; for example studying cache alias problems.
32 36
33See Section 4.3.12.4 of ISA; Bits: 37See Section 4.3.12.4 of ISA; Bits::
34 38
35 WB WT BY 39 WB WT BY
36 5 4 | 3 2 | 1 0 40 5 4 | 3 2 | 1 0
41
42========= ================== ================== ===============
37 2 Bit 43 2 Bit
38 Field 44 Field
39 Values WB - Write Back WT - Write Thru BY - Bypass 45 Values WB - Write Back WT - Write Thru BY - Bypass
40--------- --------------- ----------------- ---------------- 46========= ================== ================== ===============
41 0 Exception Exception Exception 47 0 Exception Exception Exception
42 1 RCW Transaction RCW Transaction RCW Transaction 48 1 RCW Transaction RCW Transaction RCW Transaction
43 2 Internal Operation Internal Operation Reserved 49 2 Internal Operation Internal Operation Reserved
44 3 Reserved Reserved Reserved 50 3 Reserved Reserved Reserved
51========= ================== ================== ===============
diff --git a/Documentation/xtensa/booting.txt b/Documentation/xtensa/booting.rst
index 402b33a2619f..e1b83707e5b6 100644
--- a/Documentation/xtensa/booting.txt
+++ b/Documentation/xtensa/booting.rst
@@ -1,10 +1,13 @@
1Passing boot parameters to the kernel. 1=====================================
2Passing boot parameters to the kernel
3=====================================
2 4
3Boot parameters are represented as a TLV list in the memory. Please see 5Boot parameters are represented as a TLV list in the memory. Please see
4arch/xtensa/include/asm/bootparam.h for definition of the bp_tag structure and 6arch/xtensa/include/asm/bootparam.h for definition of the bp_tag structure and
5tag value constants. First entry in the list must have type BP_TAG_FIRST, last 7tag value constants. First entry in the list must have type BP_TAG_FIRST, last
6entry must have type BP_TAG_LAST. The address of the first list entry is 8entry must have type BP_TAG_LAST. The address of the first list entry is
7passed to the kernel in the register a2. The address type depends on MMU type: 9passed to the kernel in the register a2. The address type depends on MMU type:
10
8- For configurations without MMU, with region protection or with MPU the 11- For configurations without MMU, with region protection or with MPU the
9 address must be the physical address. 12 address must be the physical address.
10- For configurations with region translarion MMU or with MMUv3 and CONFIG_MMU=n 13- For configurations with region translarion MMU or with MMUv3 and CONFIG_MMU=n
diff --git a/Documentation/xtensa/index.rst b/Documentation/xtensa/index.rst
new file mode 100644
index 000000000000..52fa04eb39a3
--- /dev/null
+++ b/Documentation/xtensa/index.rst
@@ -0,0 +1,12 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3===================
4Xtensa Architecture
5===================
6
7.. toctree::
8 :maxdepth: 1
9
10 atomctl
11 booting
12 mmu
diff --git a/Documentation/xtensa/mmu.rst b/Documentation/xtensa/mmu.rst
new file mode 100644
index 000000000000..e52a12960fdc
--- /dev/null
+++ b/Documentation/xtensa/mmu.rst
@@ -0,0 +1,195 @@
1=============================
2MMUv3 initialization sequence
3=============================
4
5The code in the initialize_mmu macro sets up MMUv3 memory mapping
6identically to MMUv2 fixed memory mapping. Depending on
7CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is
8located in addresses it was linked for (symbol undefined), or not
9(symbol defined), so it needs to be position-independent.
10
11The code has the following assumptions:
12
13 - This code fragment is run only on an MMU v3.
14 - TLBs are in their reset state.
15 - ITLBCFG and DTLBCFG are zero (reset state).
16 - RASID is 0x04030201 (reset state).
17 - PS.RING is zero (reset state).
18 - LITBASE is zero (reset state, PC-relative literals); required to be PIC.
19
20TLB setup proceeds along the following steps.
21
22 Legend:
23
24 - VA = virtual address (two upper nibbles of it);
25 - PA = physical address (two upper nibbles of it);
26 - pc = physical range that contains this code;
27
28After step 2, we jump to virtual address in the range 0x40000000..0x5fffffff
29or 0x00000000..0x1fffffff, depending on whether the kernel was loaded below
300x40000000 or above. That address corresponds to next instruction to execute
31in this code. After step 4, we jump to intended (linked) address of this code.
32The scheme below assumes that the kernel is loaded below 0x40000000.
33
34 ====== ===== ===== ===== ===== ====== ===== =====
35 - Step0 Step1 Step2 Step3 Step4 Step5
36
37 VA PA PA PA PA VA PA PA
38 ====== ===== ===== ===== ===== ====== ===== =====
39 E0..FF -> E0 -> E0 -> E0 F0..FF -> F0 -> F0
40 C0..DF -> C0 -> C0 -> C0 E0..EF -> F0 -> F0
41 A0..BF -> A0 -> A0 -> A0 D8..DF -> 00 -> 00
42 80..9F -> 80 -> 80 -> 80 D0..D7 -> 00 -> 00
43 60..7F -> 60 -> 60 -> 60
44 40..5F -> 40 -> pc -> pc 40..5F -> pc
45 20..3F -> 20 -> 20 -> 20
46 00..1F -> 00 -> 00 -> 00
47 ====== ===== ===== ===== ===== ====== ===== =====
48
49The default location of IO peripherals is above 0xf0000000. This may be changed
50using a "ranges" property in a device tree simple-bus node. See the Devicetree
51Specification, section 4.5 for details on the syntax and semantics of
52simple-bus nodes. The following limitations apply:
53
541. Only top level simple-bus nodes are considered
55
562. Only one (first) simple-bus node is considered
57
583. Empty "ranges" properties are not supported
59
604. Only the first triplet in the "ranges" property is considered
61
625. The parent-bus-address value is rounded down to the nearest 256MB boundary
63
646. The IO area covers the entire 256MB segment of parent-bus-address; the
65 "ranges" triplet length field is ignored
66
67
68MMUv3 address space layouts.
69============================
70
71Default MMUv2-compatible layout::
72
73 Symbol VADDR Size
74 +------------------+
75 | Userspace | 0x00000000 TASK_SIZE
76 +------------------+ 0x40000000
77 +------------------+
78 | Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
79 +------------------+
80 | KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
81 +------------------+ 0x8e400000
82 +------------------+
83 | VMALLOC area | VMALLOC_START 0xc0000000 128MB - 64KB
84 +------------------+ VMALLOC_END
85 | Cache aliasing | TLBTEMP_BASE_1 0xc7ff0000 DCACHE_WAY_SIZE
86 | remap area 1 |
87 +------------------+
88 | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
89 | remap area 2 |
90 +------------------+
91 +------------------+
92 | KMAP area | PKMAP_BASE PTRS_PER_PTE *
93 | | DCACHE_N_COLORS *
94 | | PAGE_SIZE
95 | | (4MB * DCACHE_N_COLORS)
96 +------------------+
97 | Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
98 | | NR_CPUS *
99 | | DCACHE_N_COLORS *
100 | | PAGE_SIZE
101 +------------------+ FIXADDR_TOP 0xcffff000
102 +------------------+
103 | Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xd0000000 128MB
104 +------------------+
105 | Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xd8000000 128MB
106 +------------------+
107 | Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
108 +------------------+
109 | Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
110 +------------------+
111
112
113256MB cached + 256MB uncached layout::
114
115 Symbol VADDR Size
116 +------------------+
117 | Userspace | 0x00000000 TASK_SIZE
118 +------------------+ 0x40000000
119 +------------------+
120 | Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
121 +------------------+
122 | KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
123 +------------------+ 0x8e400000
124 +------------------+
125 | VMALLOC area | VMALLOC_START 0xa0000000 128MB - 64KB
126 +------------------+ VMALLOC_END
127 | Cache aliasing | TLBTEMP_BASE_1 0xa7ff0000 DCACHE_WAY_SIZE
128 | remap area 1 |
129 +------------------+
130 | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
131 | remap area 2 |
132 +------------------+
133 +------------------+
134 | KMAP area | PKMAP_BASE PTRS_PER_PTE *
135 | | DCACHE_N_COLORS *
136 | | PAGE_SIZE
137 | | (4MB * DCACHE_N_COLORS)
138 +------------------+
139 | Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
140 | | NR_CPUS *
141 | | DCACHE_N_COLORS *
142 | | PAGE_SIZE
143 +------------------+ FIXADDR_TOP 0xaffff000
144 +------------------+
145 | Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xb0000000 256MB
146 +------------------+
147 | Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 256MB
148 +------------------+
149 +------------------+
150 | Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
151 +------------------+
152 | Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
153 +------------------+
154
155
156512MB cached + 512MB uncached layout::
157
158 Symbol VADDR Size
159 +------------------+
160 | Userspace | 0x00000000 TASK_SIZE
161 +------------------+ 0x40000000
162 +------------------+
163 | Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
164 +------------------+
165 | KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
166 +------------------+ 0x8e400000
167 +------------------+
168 | VMALLOC area | VMALLOC_START 0x90000000 128MB - 64KB
169 +------------------+ VMALLOC_END
170 | Cache aliasing | TLBTEMP_BASE_1 0x97ff0000 DCACHE_WAY_SIZE
171 | remap area 1 |
172 +------------------+
173 | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
174 | remap area 2 |
175 +------------------+
176 +------------------+
177 | KMAP area | PKMAP_BASE PTRS_PER_PTE *
178 | | DCACHE_N_COLORS *
179 | | PAGE_SIZE
180 | | (4MB * DCACHE_N_COLORS)
181 +------------------+
182 | Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
183 | | NR_CPUS *
184 | | DCACHE_N_COLORS *
185 | | PAGE_SIZE
186 +------------------+ FIXADDR_TOP 0x9ffff000
187 +------------------+
188 | Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xa0000000 512MB
189 +------------------+
190 | Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 512MB
191 +------------------+
192 | Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
193 +------------------+
194 | Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
195 +------------------+
diff --git a/Documentation/xtensa/mmu.txt b/Documentation/xtensa/mmu.txt
deleted file mode 100644
index 318114de63f3..000000000000
--- a/Documentation/xtensa/mmu.txt
+++ /dev/null
@@ -1,189 +0,0 @@
1MMUv3 initialization sequence.
2
3The code in the initialize_mmu macro sets up MMUv3 memory mapping
4identically to MMUv2 fixed memory mapping. Depending on
5CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is
6located in addresses it was linked for (symbol undefined), or not
7(symbol defined), so it needs to be position-independent.
8
9The code has the following assumptions:
10 This code fragment is run only on an MMU v3.
11 TLBs are in their reset state.
12 ITLBCFG and DTLBCFG are zero (reset state).
13 RASID is 0x04030201 (reset state).
14 PS.RING is zero (reset state).
15 LITBASE is zero (reset state, PC-relative literals); required to be PIC.
16
17TLB setup proceeds along the following steps.
18
19 Legend:
20 VA = virtual address (two upper nibbles of it);
21 PA = physical address (two upper nibbles of it);
22 pc = physical range that contains this code;
23
24After step 2, we jump to virtual address in the range 0x40000000..0x5fffffff
25or 0x00000000..0x1fffffff, depending on whether the kernel was loaded below
260x40000000 or above. That address corresponds to next instruction to execute
27in this code. After step 4, we jump to intended (linked) address of this code.
28The scheme below assumes that the kernel is loaded below 0x40000000.
29
30 Step0 Step1 Step2 Step3 Step4 Step5
31 ===== ===== ===== ===== ===== =====
32 VA PA PA PA PA VA PA PA
33 ------ -- -- -- -- ------ -- --
34 E0..FF -> E0 -> E0 -> E0 F0..FF -> F0 -> F0
35 C0..DF -> C0 -> C0 -> C0 E0..EF -> F0 -> F0
36 A0..BF -> A0 -> A0 -> A0 D8..DF -> 00 -> 00
37 80..9F -> 80 -> 80 -> 80 D0..D7 -> 00 -> 00
38 60..7F -> 60 -> 60 -> 60
39 40..5F -> 40 -> pc -> pc 40..5F -> pc
40 20..3F -> 20 -> 20 -> 20
41 00..1F -> 00 -> 00 -> 00
42
43The default location of IO peripherals is above 0xf0000000. This may be changed
44using a "ranges" property in a device tree simple-bus node. See the Devicetree
45Specification, section 4.5 for details on the syntax and semantics of
46simple-bus nodes. The following limitations apply:
47
481. Only top level simple-bus nodes are considered
49
502. Only one (first) simple-bus node is considered
51
523. Empty "ranges" properties are not supported
53
544. Only the first triplet in the "ranges" property is considered
55
565. The parent-bus-address value is rounded down to the nearest 256MB boundary
57
586. The IO area covers the entire 256MB segment of parent-bus-address; the
59 "ranges" triplet length field is ignored
60
61
62MMUv3 address space layouts.
63============================
64
65Default MMUv2-compatible layout.
66
67 Symbol VADDR Size
68+------------------+
69| Userspace | 0x00000000 TASK_SIZE
70+------------------+ 0x40000000
71+------------------+
72| Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
73+------------------+
74| KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
75+------------------+ 0x8e400000
76+------------------+
77| VMALLOC area | VMALLOC_START 0xc0000000 128MB - 64KB
78+------------------+ VMALLOC_END
79| Cache aliasing | TLBTEMP_BASE_1 0xc7ff0000 DCACHE_WAY_SIZE
80| remap area 1 |
81+------------------+
82| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
83| remap area 2 |
84+------------------+
85+------------------+
86| KMAP area | PKMAP_BASE PTRS_PER_PTE *
87| | DCACHE_N_COLORS *
88| | PAGE_SIZE
89| | (4MB * DCACHE_N_COLORS)
90+------------------+
91| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
92| | NR_CPUS *
93| | DCACHE_N_COLORS *
94| | PAGE_SIZE
95+------------------+ FIXADDR_TOP 0xcffff000
96+------------------+
97| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xd0000000 128MB
98+------------------+
99| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xd8000000 128MB
100+------------------+
101| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
102+------------------+
103| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
104+------------------+
105
106
107256MB cached + 256MB uncached layout.
108
109 Symbol VADDR Size
110+------------------+
111| Userspace | 0x00000000 TASK_SIZE
112+------------------+ 0x40000000
113+------------------+
114| Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
115+------------------+
116| KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
117+------------------+ 0x8e400000
118+------------------+
119| VMALLOC area | VMALLOC_START 0xa0000000 128MB - 64KB
120+------------------+ VMALLOC_END
121| Cache aliasing | TLBTEMP_BASE_1 0xa7ff0000 DCACHE_WAY_SIZE
122| remap area 1 |
123+------------------+
124| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
125| remap area 2 |
126+------------------+
127+------------------+
128| KMAP area | PKMAP_BASE PTRS_PER_PTE *
129| | DCACHE_N_COLORS *
130| | PAGE_SIZE
131| | (4MB * DCACHE_N_COLORS)
132+------------------+
133| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
134| | NR_CPUS *
135| | DCACHE_N_COLORS *
136| | PAGE_SIZE
137+------------------+ FIXADDR_TOP 0xaffff000
138+------------------+
139| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xb0000000 256MB
140+------------------+
141| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 256MB
142+------------------+
143+------------------+
144| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
145+------------------+
146| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
147+------------------+
148
149
150512MB cached + 512MB uncached layout.
151
152 Symbol VADDR Size
153+------------------+
154| Userspace | 0x00000000 TASK_SIZE
155+------------------+ 0x40000000
156+------------------+
157| Page table | XCHAL_PAGE_TABLE_VADDR 0x80000000 XCHAL_PAGE_TABLE_SIZE
158+------------------+
159| KASAN shadow map | KASAN_SHADOW_START 0x80400000 KASAN_SHADOW_SIZE
160+------------------+ 0x8e400000
161+------------------+
162| VMALLOC area | VMALLOC_START 0x90000000 128MB - 64KB
163+------------------+ VMALLOC_END
164| Cache aliasing | TLBTEMP_BASE_1 0x97ff0000 DCACHE_WAY_SIZE
165| remap area 1 |
166+------------------+
167| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
168| remap area 2 |
169+------------------+
170+------------------+
171| KMAP area | PKMAP_BASE PTRS_PER_PTE *
172| | DCACHE_N_COLORS *
173| | PAGE_SIZE
174| | (4MB * DCACHE_N_COLORS)
175+------------------+
176| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
177| | NR_CPUS *
178| | DCACHE_N_COLORS *
179| | PAGE_SIZE
180+------------------+ FIXADDR_TOP 0x9ffff000
181+------------------+
182| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xa0000000 512MB
183+------------------+
184| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 512MB
185+------------------+
186| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
187+------------------+
188| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
189+------------------+