aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/stable/sysfs-devices-node7
-rw-r--r--Documentation/ABI/stable/sysfs-driver-qla2xxx8
-rw-r--r--Documentation/ABI/testing/ima_policy12
-rw-r--r--Documentation/ABI/testing/procfs-diskstats2
-rw-r--r--Documentation/ABI/testing/sysfs-block16
-rw-r--r--Documentation/ABI/testing/sysfs-bus-pci-devices-cciss28
-rw-r--r--Documentation/ABI/testing/sysfs-bus-usb42
-rw-r--r--Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc (renamed from Documentation/ABI/testing/sysfs-class-usb_host)17
-rw-r--r--Documentation/ABI/testing/sysfs-devices-cache_disable18
-rw-r--r--Documentation/ABI/testing/sysfs-devices-memory14
-rw-r--r--Documentation/ABI/testing/sysfs-devices-power79
-rw-r--r--Documentation/ABI/testing/sysfs-devices-system-cpu203
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-slab109
-rw-r--r--Documentation/ABI/testing/sysfs-memory-page-offline44
-rw-r--r--Documentation/ABI/testing/sysfs-platform-asus-laptop12
-rw-r--r--Documentation/ABI/testing/sysfs-platform-eeepc-laptop10
-rw-r--r--Documentation/ABI/testing/sysfs-power13
-rw-r--r--Documentation/Changes2
-rw-r--r--Documentation/DMA-API.txt122
-rw-r--r--Documentation/DocBook/Makefile38
-rw-r--r--Documentation/DocBook/device-drivers.tmpl15
-rw-r--r--Documentation/DocBook/deviceiobook.tmpl2
-rw-r--r--Documentation/DocBook/dvb/dvbapi.xml13
-rw-r--r--Documentation/DocBook/dvb/dvbproperty.xml (renamed from Documentation/DocBook/dvb/isdbt.xml)4
-rw-r--r--Documentation/DocBook/dvb/frontend.h.xml415
-rw-r--r--Documentation/DocBook/dvb/frontend.xml185
-rw-r--r--Documentation/DocBook/genericirq.tmpl4
-rw-r--r--Documentation/DocBook/kernel-hacking.tmpl2
-rw-r--r--Documentation/DocBook/mac80211.tmpl3
-rw-r--r--Documentation/DocBook/media-entities.tmpl21
-rw-r--r--Documentation/DocBook/media-indices.tmpl4
-rw-r--r--Documentation/DocBook/mtdnand.tmpl20
-rw-r--r--Documentation/DocBook/procfs-guide.tmpl626
-rw-r--r--Documentation/DocBook/procfs_example.c201
-rw-r--r--Documentation/DocBook/tracepoint.tmpl5
-rw-r--r--Documentation/DocBook/v4l/common.xml37
-rw-r--r--Documentation/DocBook/v4l/compat.xml16
-rw-r--r--Documentation/DocBook/v4l/controls.xml20
-rw-r--r--Documentation/DocBook/v4l/io.xml3
-rw-r--r--Documentation/DocBook/v4l/pixfmt.xml5
-rw-r--r--Documentation/DocBook/v4l/v4l2.xml26
-rw-r--r--Documentation/DocBook/v4l/videodev2.h.xml125
-rw-r--r--Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml238
-rw-r--r--Documentation/DocBook/v4l/vidioc-enuminput.xml36
-rw-r--r--Documentation/DocBook/v4l/vidioc-enumoutput.xml36
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-preset.xml111
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-dv-timings.xml224
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-fbuf.xml17
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-parm.xml2
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-std.xml6
-rw-r--r--Documentation/DocBook/v4l/vidioc-qbuf.xml40
-rw-r--r--Documentation/DocBook/v4l/vidioc-query-dv-preset.xml85
-rw-r--r--Documentation/DocBook/v4l/vidioc-querybuf.xml7
-rw-r--r--Documentation/DocBook/v4l/vidioc-querystd.xml6
-rw-r--r--Documentation/DocBook/v4l/vidioc-reqbufs.xml36
-rw-r--r--Documentation/DocBook/writing-an-alsa-driver.tmpl2
-rw-r--r--Documentation/HOWTO113
-rw-r--r--Documentation/IO-mapping.txt2
-rw-r--r--Documentation/IPMI.txt12
-rw-r--r--Documentation/Makefile4
-rw-r--r--Documentation/PCI/PCI-DMA-mapping.txt (renamed from Documentation/DMA-mapping.txt)358
-rw-r--r--Documentation/RCU/00-INDEX10
-rw-r--r--Documentation/RCU/RTFP.txt61
-rw-r--r--Documentation/RCU/checklist.txt208
-rw-r--r--Documentation/RCU/lockdep.txt67
-rw-r--r--Documentation/RCU/rcu.txt48
-rw-r--r--Documentation/RCU/stallwarn.txt58
-rw-r--r--Documentation/RCU/torture.txt12
-rw-r--r--Documentation/RCU/trace.txt254
-rw-r--r--Documentation/RCU/whatisRCU.txt18
-rw-r--r--Documentation/SubmitChecklist13
-rw-r--r--Documentation/SubmittingPatches2
-rw-r--r--Documentation/acpi/method-customizing.txt66
-rw-r--r--Documentation/arm/OMAP/DSS317
-rw-r--r--Documentation/arm/Samsung-S3C24XX/CPUfreq.txt4
-rw-r--r--Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Overview.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/S3C2412.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/S3C2413.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Suspend.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/USB-Host.txt2
-rw-r--r--Documentation/arm/Samsung/Overview.txt86
-rwxr-xr-xDocumentation/arm/Samsung/clksrc-change-registers.awk167
-rw-r--r--Documentation/arm/memory.txt6
-rw-r--r--Documentation/arm/tcm.txt10
-rw-r--r--Documentation/blackfin/00-INDEX3
-rw-r--r--Documentation/blackfin/Makefile6
-rw-r--r--Documentation/blackfin/cache-lock.txt48
-rw-r--r--Documentation/blackfin/cachefeatures.txt10
-rw-r--r--Documentation/blackfin/gptimers-example.c83
-rw-r--r--Documentation/block/00-INDEX2
-rw-r--r--Documentation/block/as-iosched.txt172
-rw-r--r--Documentation/block/biodoc.txt2
-rw-r--r--Documentation/block/queue-sysfs.txt10
-rw-r--r--Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg588
-rw-r--r--Documentation/blockdev/drbd/DRBD-data-packets.svg459
-rw-r--r--Documentation/blockdev/drbd/README.txt16
-rw-r--r--Documentation/blockdev/drbd/conn-states-8.dot18
-rw-r--r--Documentation/blockdev/drbd/disk-states-8.dot16
-rw-r--r--Documentation/blockdev/drbd/drbd-connection-state-overview.dot85
-rw-r--r--Documentation/blockdev/drbd/node-states-8.dot14
-rw-r--r--Documentation/cachetlb.txt30
-rw-r--r--Documentation/cdrom/ide-cd39
-rw-r--r--Documentation/cgroups/blkio-controller.txt135
-rw-r--r--Documentation/cgroups/cgroup_event_listener.c110
-rw-r--r--Documentation/cgroups/cgroups.txt50
-rw-r--r--Documentation/cgroups/cpusets.txt127
-rw-r--r--Documentation/cgroups/memcg_test.txt47
-rw-r--r--Documentation/cgroups/memory.txt80
-rw-r--r--Documentation/connector/cn_test.c2
-rw-r--r--Documentation/connector/connector.txt8
-rw-r--r--Documentation/console/console.txt2
-rw-r--r--Documentation/cpu-freq/cpu-drivers.txt6
-rw-r--r--Documentation/cpu-freq/governors.txt4
-rw-r--r--Documentation/cpu-freq/pcc-cpufreq.txt207
-rw-r--r--Documentation/cpu-freq/user-guide.txt11
-rw-r--r--Documentation/cpu-hotplug.txt55
-rw-r--r--Documentation/cputopology.txt47
-rw-r--r--Documentation/debugging-via-ohci1394.txt8
-rw-r--r--Documentation/device-mapper/snapshot.txt104
-rw-r--r--Documentation/dontdiff5
-rw-r--r--Documentation/driver-model/driver.txt4
-rw-r--r--Documentation/driver-model/platform.txt2
-rw-r--r--Documentation/dvb/README.dvb-usb2
-rw-r--r--Documentation/dvb/get_dvb_firmware23
-rw-r--r--Documentation/edac.txt7
-rw-r--r--Documentation/eisa.txt2
-rw-r--r--Documentation/email-clients.txt30
-rw-r--r--Documentation/fault-injection/fault-injection.txt4
-rw-r--r--Documentation/fault-injection/provoke-crashes.txt38
-rw-r--r--Documentation/fb/framebuffer.txt6
-rw-r--r--Documentation/fb/viafb.txt12
-rw-r--r--Documentation/feature-removal-schedule.txt260
-rw-r--r--Documentation/filesystems/00-INDEX18
-rw-r--r--Documentation/filesystems/Locking18
-rw-r--r--Documentation/filesystems/Makefile8
-rw-r--r--Documentation/filesystems/caching/fscache.txt110
-rw-r--r--Documentation/filesystems/caching/netfs-api.txt21
-rw-r--r--Documentation/filesystems/dentry-locking.txt3
-rw-r--r--Documentation/filesystems/dnotify.txt39
-rw-r--r--Documentation/filesystems/dnotify_test.c34
-rw-r--r--Documentation/filesystems/exofs.txt23
-rw-r--r--Documentation/filesystems/ext3.txt20
-rw-r--r--Documentation/filesystems/ext4.txt33
-rw-r--r--Documentation/filesystems/logfs.txt241
-rw-r--r--Documentation/filesystems/nfs/00-INDEX16
-rw-r--r--Documentation/filesystems/nfs/Exporting (renamed from Documentation/filesystems/Exporting)0
-rw-r--r--Documentation/filesystems/nfs/knfsd-stats.txt (renamed from Documentation/filesystems/knfsd-stats.txt)0
-rw-r--r--Documentation/filesystems/nfs/nfs-rdma.txt (renamed from Documentation/filesystems/nfs-rdma.txt)0
-rw-r--r--Documentation/filesystems/nfs/nfs.txt (renamed from Documentation/filesystems/nfs.txt)0
-rw-r--r--Documentation/filesystems/nfs/nfs41-server.txt (renamed from Documentation/filesystems/nfs41-server.txt)14
-rw-r--r--Documentation/filesystems/nfs/nfsroot.txt (renamed from Documentation/filesystems/nfsroot.txt)0
-rw-r--r--Documentation/filesystems/nfs/rpc-cache.txt (renamed from Documentation/filesystems/rpc-cache.txt)0
-rw-r--r--Documentation/filesystems/nilfs2.txt12
-rw-r--r--Documentation/filesystems/ocfs2.txt6
-rw-r--r--Documentation/filesystems/porting2
-rw-r--r--Documentation/filesystems/proc.txt74
-rw-r--r--Documentation/filesystems/seq_file.txt4
-rw-r--r--Documentation/filesystems/sharedsubtree.txt16
-rw-r--r--Documentation/filesystems/sysfs.txt12
-rw-r--r--Documentation/filesystems/vfat.txt2
-rw-r--r--Documentation/filesystems/vfs.txt2
-rw-r--r--Documentation/flexible-arrays.txt43
-rw-r--r--Documentation/gpio.txt83
-rw-r--r--Documentation/hwmon/abituguru2
-rw-r--r--Documentation/hwmon/adt741142
-rw-r--r--Documentation/hwmon/adt747372
-rw-r--r--Documentation/hwmon/adt7475204
-rw-r--r--Documentation/hwmon/amc6821102
-rw-r--r--Documentation/hwmon/asc7621296
-rw-r--r--Documentation/hwmon/f71882fg10
-rw-r--r--Documentation/hwmon/it8754
-rw-r--r--Documentation/hwmon/k10temp65
-rw-r--r--Documentation/hwmon/lis3lv02d55
-rw-r--r--Documentation/hwmon/lm9022
-rw-r--r--Documentation/hwmon/ltc42157
-rw-r--r--Documentation/hwmon/ltc42457
-rw-r--r--Documentation/hwmon/mc13783-adc50
-rw-r--r--Documentation/hwmon/sysfs-interface68
-rw-r--r--Documentation/hwmon/w83627ehf10
-rw-r--r--Documentation/hwmon/w83627hf29
-rw-r--r--Documentation/i2c/busses/i2c-i8013
-rw-r--r--Documentation/i2c/busses/i2c-parport3
-rw-r--r--Documentation/i2c/busses/i2c-parport-light11
-rw-r--r--Documentation/i2c/busses/i2c-piix42
-rw-r--r--Documentation/i2c/busses/i2c-voodoo362
-rw-r--r--Documentation/i2c/i2c-stub16
-rw-r--r--Documentation/i2c/instantiating-devices2
-rw-r--r--Documentation/i2c/old-module-parameters44
-rw-r--r--Documentation/i2c/smbus-protocol16
-rw-r--r--Documentation/i2c/writing-clients7
-rw-r--r--Documentation/infiniband/ipoib.txt10
-rw-r--r--Documentation/infiniband/user_mad.txt4
-rw-r--r--Documentation/infiniband/user_verbs.txt2
-rw-r--r--Documentation/init.txt49
-rw-r--r--Documentation/input/multi-touch-protocol.txt48
-rw-r--r--Documentation/input/rotary-encoder.txt2
-rw-r--r--Documentation/input/sentelic.txt124
-rw-r--r--Documentation/ioctl/ioctl-number.txt204
-rw-r--r--Documentation/isdn/INTERFACE.CAPI92
-rw-r--r--Documentation/isdn/README.gigaset156
-rw-r--r--Documentation/kbuild/kbuild.txt14
-rw-r--r--Documentation/kbuild/kconfig.txt8
-rw-r--r--Documentation/kernel-doc-nano-HOWTO.txt12
-rw-r--r--Documentation/kernel-parameters.txt128
-rw-r--r--Documentation/kobject.txt2
-rw-r--r--Documentation/kprobes.txt207
-rw-r--r--Documentation/kvm/api.txt127
-rw-r--r--Documentation/laptops/00-INDEX6
-rw-r--r--Documentation/laptops/Makefile8
-rw-r--r--Documentation/laptops/dslm.c166
-rw-r--r--Documentation/laptops/laptop-mode.txt170
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt164
-rw-r--r--Documentation/lguest/lguest.c4
-rw-r--r--Documentation/lockstat.txt12
-rw-r--r--Documentation/md.txt72
-rw-r--r--Documentation/memory-hotplug.txt11
-rw-r--r--Documentation/misc-devices/ad525x_dpot.txt57
-rw-r--r--Documentation/misc-devices/c2port.txt (renamed from Documentation/c2port.txt)0
-rw-r--r--Documentation/misc-devices/eeprom (renamed from Documentation/i2c/chips/eeprom)0
-rw-r--r--Documentation/misc-devices/ics932s401 (renamed from Documentation/ics932s401)0
-rw-r--r--Documentation/misc-devices/max6875 (renamed from Documentation/i2c/chips/max6875)6
-rw-r--r--Documentation/networking/00-INDEX2
-rw-r--r--Documentation/networking/3c509.txt12
-rw-r--r--Documentation/networking/Makefile2
-rw-r--r--Documentation/networking/bonding.txt42
-rw-r--r--Documentation/networking/cxacru-cf.py48
-rw-r--r--Documentation/networking/cxacru.txt16
-rw-r--r--Documentation/networking/dccp.txt6
-rw-r--r--Documentation/networking/ip-sysctl.txt102
-rwxr-xr-xDocumentation/networking/ixgbevf.txt90
-rw-r--r--Documentation/networking/packet_mmap.txt8
-rw-r--r--Documentation/networking/pktgen.txt8
-rw-r--r--Documentation/networking/regulatory.txt24
-rw-r--r--Documentation/networking/skfp.txt2
-rw-r--r--Documentation/networking/tcp-thin.txt47
-rw-r--r--Documentation/networking/timestamping/Makefile11
-rw-r--r--Documentation/networking/timestamping/timestamping.c14
-rw-r--r--Documentation/nommu-mmap.txt26
-rw-r--r--Documentation/oops-tracing.txt2
-rw-r--r--Documentation/pcmcia/driver-changes.txt12
-rw-r--r--Documentation/pcmcia/locking.txt118
-rw-r--r--Documentation/pnp.txt13
-rw-r--r--Documentation/power/regulator/consumer.txt2
-rw-r--r--Documentation/power/runtime_pm.txt320
-rw-r--r--Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt93
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/board.txt4
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/can.txt53
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/dma.txt8
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/i2c.txt30
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt70
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/mpc5200.txt20
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/mpic.txt42
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/spi.txt7
-rw-r--r--Documentation/powerpc/dts-bindings/nintendo/gamecube.txt109
-rw-r--r--Documentation/powerpc/dts-bindings/nintendo/wii.txt184
-rw-r--r--Documentation/powerpc/dts-bindings/xilinx.txt11
-rw-r--r--Documentation/powerpc/ptrace.txt134
-rw-r--r--Documentation/s390/CommonIO6
-rw-r--r--Documentation/s390/driver-model.txt4
-rw-r--r--Documentation/s390/kvm.txt2
-rw-r--r--Documentation/scsi/ChangeLog.lpfc10
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas80
-rw-r--r--Documentation/scsi/hptiop.txt21
-rw-r--r--Documentation/serial/hayes-esp.txt154
-rw-r--r--Documentation/serial/tty.txt13
-rw-r--r--Documentation/slow-work.txt160
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt42
-rw-r--r--Documentation/sound/alsa/ControlNames.txt3
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt10
-rw-r--r--Documentation/sound/alsa/HD-Audio.txt33
-rw-r--r--Documentation/sound/alsa/Procfile.txt2
-rw-r--r--Documentation/spi/spi-summary2
-rw-r--r--Documentation/spinlocks.txt184
-rw-r--r--Documentation/stable_kernel_rules.txt24
-rw-r--r--Documentation/sysctl/ctl_unnumbered.txt22
-rw-r--r--Documentation/sysctl/kernel.txt37
-rw-r--r--Documentation/sysctl/vm.txt7
-rw-r--r--Documentation/thermal/sysfs-api.txt390
-rw-r--r--Documentation/timers/00-INDEX2
-rw-r--r--Documentation/timers/Makefile8
-rw-r--r--Documentation/timers/hpet.txt275
-rw-r--r--Documentation/timers/hpet_example.c269
-rw-r--r--Documentation/trace/events-kmem.txt14
-rw-r--r--Documentation/trace/ftrace-design.txt52
-rw-r--r--Documentation/trace/ftrace.txt6
-rw-r--r--Documentation/trace/kprobetrace.txt156
-rw-r--r--Documentation/trace/mmiotrace.txt15
-rw-r--r--Documentation/trace/ring-buffer-design.txt56
-rw-r--r--Documentation/trace/tracepoint-analysis.txt60
-rw-r--r--Documentation/usb/error-codes.txt6
-rw-r--r--Documentation/usb/power-management.txt301
-rw-r--r--Documentation/vgaarbiter.txt2
-rw-r--r--Documentation/video4linux/CARDLIST.cx238853
-rw-r--r--Documentation/video4linux/CARDLIST.cx881
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx3
-rw-r--r--Documentation/video4linux/CARDLIST.saa71343
-rw-r--r--Documentation/video4linux/CARDLIST.tuner1
-rw-r--r--Documentation/video4linux/README.tlg230047
-rw-r--r--Documentation/video4linux/gspca.txt70
-rw-r--r--Documentation/video4linux/sh_mobile_ceu_camera.txt157
-rw-r--r--Documentation/video4linux/si4713.txt2
-rw-r--r--Documentation/video4linux/v4l2-framework.txt122
-rw-r--r--Documentation/video4linux/videobuf360
-rw-r--r--Documentation/video4linux/zr364xx.txt1
-rw-r--r--Documentation/vm/00-INDEX16
-rw-r--r--Documentation/vm/Makefile2
-rw-r--r--Documentation/vm/hugepage-mmap.c91
-rw-r--r--Documentation/vm/hugepage-shm.c98
-rw-r--r--Documentation/vm/hugetlbpage.txt405
-rw-r--r--Documentation/vm/hwpoison.txt182
-rw-r--r--Documentation/vm/ksm.txt29
-rw-r--r--Documentation/vm/map_hugetlb.c6
-rw-r--r--Documentation/vm/page-types.c375
-rw-r--r--Documentation/vm/pagemap.txt8
-rw-r--r--Documentation/vm/slub.txt3
-rw-r--r--Documentation/voyager.txt95
-rw-r--r--Documentation/w1/masters/ds24826
-rw-r--r--Documentation/x86/x86_64/boot-options.txt20
320 files changed, 13578 insertions, 4931 deletions
diff --git a/Documentation/ABI/stable/sysfs-devices-node b/Documentation/ABI/stable/sysfs-devices-node
new file mode 100644
index 000000000000..49b82cad7003
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-devices-node
@@ -0,0 +1,7 @@
1What: /sys/devices/system/node/nodeX
2Date: October 2002
3Contact: Linux Memory Management list <linux-mm@kvack.org>
4Description:
5 When CONFIG_NUMA is enabled, this is a directory containing
6 information on node X such as what CPUs are local to the
7 node.
diff --git a/Documentation/ABI/stable/sysfs-driver-qla2xxx b/Documentation/ABI/stable/sysfs-driver-qla2xxx
new file mode 100644
index 000000000000..9a59d84497ed
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-driver-qla2xxx
@@ -0,0 +1,8 @@
1What: /sys/bus/pci/drivers/qla2xxx/.../devices/*
2Date: September 2009
3Contact: QLogic Linux Driver <linux-driver@qlogic.com>
4Description: qla2xxx-udev.sh currently looks for uevent CHANGE events to
5 signal a firmware-dump has been generated by the driver and is
6 ready for retrieval.
7Users: qla2xxx-udev.sh. Proposed changes should be mailed to
8 linux-driver@qlogic.com
diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy
index 6434f0df012e..6cd6daefaaed 100644
--- a/Documentation/ABI/testing/ima_policy
+++ b/Documentation/ABI/testing/ima_policy
@@ -20,7 +20,7 @@ Description:
20 lsm: [[subj_user=] [subj_role=] [subj_type=] 20 lsm: [[subj_user=] [subj_role=] [subj_type=]
21 [obj_user=] [obj_role=] [obj_type=]] 21 [obj_user=] [obj_role=] [obj_type=]]
22 22
23 base: func:= [BPRM_CHECK][FILE_MMAP][INODE_PERMISSION] 23 base: func:= [BPRM_CHECK][FILE_MMAP][FILE_CHECK]
24 mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC] 24 mask:= [MAY_READ] [MAY_WRITE] [MAY_APPEND] [MAY_EXEC]
25 fsmagic:= hex value 25 fsmagic:= hex value
26 uid:= decimal value 26 uid:= decimal value
@@ -40,11 +40,11 @@ Description:
40 40
41 measure func=BPRM_CHECK 41 measure func=BPRM_CHECK
42 measure func=FILE_MMAP mask=MAY_EXEC 42 measure func=FILE_MMAP mask=MAY_EXEC
43 measure func=INODE_PERM mask=MAY_READ uid=0 43 measure func=FILE_CHECK mask=MAY_READ uid=0
44 44
45 The default policy measures all executables in bprm_check, 45 The default policy measures all executables in bprm_check,
46 all files mmapped executable in file_mmap, and all files 46 all files mmapped executable in file_mmap, and all files
47 open for read by root in inode_permission. 47 open for read by root in do_filp_open.
48 48
49 Examples of LSM specific definitions: 49 Examples of LSM specific definitions:
50 50
@@ -54,8 +54,8 @@ Description:
54 54
55 dont_measure obj_type=var_log_t 55 dont_measure obj_type=var_log_t
56 dont_measure obj_type=auditd_log_t 56 dont_measure obj_type=auditd_log_t
57 measure subj_user=system_u func=INODE_PERM mask=MAY_READ 57 measure subj_user=system_u func=FILE_CHECK mask=MAY_READ
58 measure subj_role=system_r func=INODE_PERM mask=MAY_READ 58 measure subj_role=system_r func=FILE_CHECK mask=MAY_READ
59 59
60 Smack: 60 Smack:
61 measure subj_user=_ func=INODE_PERM mask=MAY_READ 61 measure subj_user=_ func=FILE_CHECK mask=MAY_READ
diff --git a/Documentation/ABI/testing/procfs-diskstats b/Documentation/ABI/testing/procfs-diskstats
index 99233902e09e..f91a973a37fe 100644
--- a/Documentation/ABI/testing/procfs-diskstats
+++ b/Documentation/ABI/testing/procfs-diskstats
@@ -8,7 +8,7 @@ Description:
8 1 - major number 8 1 - major number
9 2 - minor mumber 9 2 - minor mumber
10 3 - device name 10 3 - device name
11 4 - reads completed succesfully 11 4 - reads completed successfully
12 5 - reads merged 12 5 - reads merged
13 6 - sectors read 13 6 - sectors read
14 7 - time spent reading (ms) 14 7 - time spent reading (ms)
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index 5f3bedaf8e35..4873c759d535 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -4,7 +4,7 @@ Contact: Jerome Marchand <jmarchan@redhat.com>
4Description: 4Description:
5 The /sys/block/<disk>/stat files displays the I/O 5 The /sys/block/<disk>/stat files displays the I/O
6 statistics of disk <disk>. They contain 11 fields: 6 statistics of disk <disk>. They contain 11 fields:
7 1 - reads completed succesfully 7 1 - reads completed successfully
8 2 - reads merged 8 2 - reads merged
9 3 - sectors read 9 3 - sectors read
10 4 - time spent reading (ms) 10 4 - time spent reading (ms)
@@ -128,3 +128,17 @@ Description:
128 preferred request size for workloads where sustained 128 preferred request size for workloads where sustained
129 throughput is desired. If no optimal I/O size is 129 throughput is desired. If no optimal I/O size is
130 reported this file contains 0. 130 reported this file contains 0.
131
132What: /sys/block/<disk>/queue/nomerges
133Date: January 2010
134Contact:
135Description:
136 Standard I/O elevator operations include attempts to
137 merge contiguous I/Os. For known random I/O loads these
138 attempts will always fail and result in extra cycles
139 being spent in the kernel. This allows one to turn off
140 this behavior on one of two ways: When set to 1, complex
141 merge checks are disabled, but the simple one-shot merges
142 with the previous I/O request are enabled. When set to 2,
143 all merge tries are disabled. The default value is 0 -
144 which enables all types of merge tries.
diff --git a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
index 0a92a7c93a62..4f29e5f1ebfa 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
+++ b/Documentation/ABI/testing/sysfs-bus-pci-devices-cciss
@@ -31,3 +31,31 @@ Date: March 2009
31Kernel Version: 2.6.30 31Kernel Version: 2.6.30
32Contact: iss_storagedev@hp.com 32Contact: iss_storagedev@hp.com
33Description: A symbolic link to /sys/block/cciss!cXdY 33Description: A symbolic link to /sys/block/cciss!cXdY
34
35Where: /sys/bus/pci/devices/<dev>/ccissX/rescan
36Date: August 2009
37Kernel Version: 2.6.31
38Contact: iss_storagedev@hp.com
39Description: Kicks of a rescan of the controller to discover logical
40 drive topology changes.
41
42Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/lunid
43Date: August 2009
44Kernel Version: 2.6.31
45Contact: iss_storagedev@hp.com
46Description: Displays the 8-byte LUN ID used to address logical
47 drive Y of controller X.
48
49Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/raid_level
50Date: August 2009
51Kernel Version: 2.6.31
52Contact: iss_storagedev@hp.com
53Description: Displays the RAID level of logical drive Y of
54 controller X.
55
56Where: /sys/bus/pci/devices/<dev>/ccissX/cXdY/usage_count
57Date: August 2009
58Kernel Version: 2.6.31
59Contact: iss_storagedev@hp.com
60Description: Displays the usage count (number of opens) of logical drive Y
61 of controller X.
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb
index 7772928ee48f..a986e9bbba3d 100644
--- a/Documentation/ABI/testing/sysfs-bus-usb
+++ b/Documentation/ABI/testing/sysfs-bus-usb
@@ -21,25 +21,27 @@ Contact: Alan Stern <stern@rowland.harvard.edu>
21Description: 21Description:
22 Each USB device directory will contain a file named 22 Each USB device directory will contain a file named
23 power/level. This file holds a power-level setting for 23 power/level. This file holds a power-level setting for
24 the device, one of "on", "auto", or "suspend". 24 the device, either "on" or "auto".
25 25
26 "on" means that the device is not allowed to autosuspend, 26 "on" means that the device is not allowed to autosuspend,
27 although normal suspends for system sleep will still 27 although normal suspends for system sleep will still
28 be honored. "auto" means the device will autosuspend 28 be honored. "auto" means the device will autosuspend
29 and autoresume in the usual manner, according to the 29 and autoresume in the usual manner, according to the
30 capabilities of its driver. "suspend" means the device 30 capabilities of its driver.
31 is forced into a suspended state and it will not autoresume
32 in response to I/O requests. However remote-wakeup requests
33 from the device may still be enabled (the remote-wakeup
34 setting is controlled separately by the power/wakeup
35 attribute).
36 31
37 During normal use, devices should be left in the "auto" 32 During normal use, devices should be left in the "auto"
38 level. The other levels are meant for administrative uses. 33 level. The "on" level is meant for administrative uses.
39 If you want to suspend a device immediately but leave it 34 If you want to suspend a device immediately but leave it
40 free to wake up in response to I/O requests, you should 35 free to wake up in response to I/O requests, you should
41 write "0" to power/autosuspend. 36 write "0" to power/autosuspend.
42 37
38 Device not capable of proper suspend and resume should be
39 left in the "on" level. Although the USB spec requires
40 devices to support suspend/resume, many of them do not.
41 In fact so many don't that by default, the USB core
42 initializes all non-hub devices in the "on" level. Some
43 drivers may change this setting when they are bound.
44
43What: /sys/bus/usb/devices/.../power/persist 45What: /sys/bus/usb/devices/.../power/persist
44Date: May 2007 46Date: May 2007
45KernelVersion: 2.6.23 47KernelVersion: 2.6.23
@@ -144,3 +146,27 @@ Description:
144 146
145 Write a 1 to force the device to disconnect 147 Write a 1 to force the device to disconnect
146 (equivalent to unplugging a wired USB device). 148 (equivalent to unplugging a wired USB device).
149
150What: /sys/bus/usb/drivers/.../remove_id
151Date: November 2009
152Contact: CHENG Renquan <rqcheng@smu.edu.sg>
153Description:
154 Writing a device ID to this file will remove an ID
155 that was dynamically added via the new_id sysfs entry.
156 The format for the device ID is:
157 idVendor idProduct. After successfully
158 removing an ID, the driver will no longer support the
159 device. This is useful to ensure auto probing won't
160 match the driver to the device. For example:
161 # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id
162
163What: /sys/bus/usb/device/.../avoid_reset
164Date: December 2009
165Contact: Oliver Neukum <oliver@neukum.org>
166Description:
167 Writing 1 to this file tells the kernel that this
168 device will morph into another mode when it is reset.
169 Drivers will not use reset for error handling for
170 such devices.
171Users:
172 usb_modeswitch
diff --git a/Documentation/ABI/testing/sysfs-class-usb_host b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
index 46b66ad1f1b4..25b1e751b777 100644
--- a/Documentation/ABI/testing/sysfs-class-usb_host
+++ b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
@@ -1,4 +1,4 @@
1What: /sys/class/usb_host/usb_hostN/wusb_chid 1What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid
2Date: July 2008 2Date: July 2008
3KernelVersion: 2.6.27 3KernelVersion: 2.6.27
4Contact: David Vrabel <david.vrabel@csr.com> 4Contact: David Vrabel <david.vrabel@csr.com>
@@ -9,7 +9,7 @@ Description:
9 9
10 Set an all zero CHID to stop the host controller. 10 Set an all zero CHID to stop the host controller.
11 11
12What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout 12What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout
13Date: July 2008 13Date: July 2008
14KernelVersion: 2.6.27 14KernelVersion: 2.6.27
15Contact: David Vrabel <david.vrabel@csr.com> 15Contact: David Vrabel <david.vrabel@csr.com>
@@ -23,3 +23,16 @@ Description:
23 Since this relates to security (specifically, the 23 Since this relates to security (specifically, the
24 lifetime of PTKs and GTKs) it should not be changed 24 lifetime of PTKs and GTKs) it should not be changed
25 from the default. 25 from the default.
26
27What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_phy_rate
28Date: August 2009
29KernelVersion: 2.6.32
30Contact: David Vrabel <david.vrabel@csr.com>
31Description:
32 The maximum PHY rate to use for all connected devices.
33 This is only of limited use for testing and
34 development as the hardware's automatic rate
35 adaptation is better then this simple control.
36
37 Refer to [ECMA-368] section 10.3.1.1 for the value to
38 use.
diff --git a/Documentation/ABI/testing/sysfs-devices-cache_disable b/Documentation/ABI/testing/sysfs-devices-cache_disable
deleted file mode 100644
index 175bb4f70512..000000000000
--- a/Documentation/ABI/testing/sysfs-devices-cache_disable
+++ /dev/null
@@ -1,18 +0,0 @@
1What: /sys/devices/system/cpu/cpu*/cache/index*/cache_disable_X
2Date: August 2008
3KernelVersion: 2.6.27
4Contact: mark.langsdorf@amd.com
5Description: These files exist in every cpu's cache index directories.
6 There are currently 2 cache_disable_# files in each
7 directory. Reading from these files on a supported
8 processor will return that cache disable index value
9 for that processor and node. Writing to one of these
10 files will cause the specificed cache index to be disabled.
11
12 Currently, only AMD Family 10h Processors support cache index
13 disable, and only for their L3 caches. See the BIOS and
14 Kernel Developer's Guide at
15 http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116-Public-GH-BKDG_3.20_2-4-09.pdf
16 for formatting information and other details on the
17 cache index disable.
18Users: joachim.deguara@amd.com
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory
index 9fe91c02ee40..bf1627b02a03 100644
--- a/Documentation/ABI/testing/sysfs-devices-memory
+++ b/Documentation/ABI/testing/sysfs-devices-memory
@@ -60,6 +60,19 @@ Description:
60Users: hotplug memory remove tools 60Users: hotplug memory remove tools
61 https://w3.opensource.ibm.com/projects/powerpc-utils/ 61 https://w3.opensource.ibm.com/projects/powerpc-utils/
62 62
63
64What: /sys/devices/system/memoryX/nodeY
65Date: October 2009
66Contact: Linux Memory Management list <linux-mm@kvack.org>
67Description:
68 When CONFIG_NUMA is enabled, a symbolic link that
69 points to the corresponding NUMA node directory.
70
71 For example, the following symbolic link is created for
72 memory section 9 on node0:
73 /sys/devices/system/memory/memory9/node0 -> ../../node/node0
74
75
63What: /sys/devices/system/node/nodeX/memoryY 76What: /sys/devices/system/node/nodeX/memoryY
64Date: September 2008 77Date: September 2008
65Contact: Gary Hade <garyhade@us.ibm.com> 78Contact: Gary Hade <garyhade@us.ibm.com>
@@ -70,4 +83,3 @@ Description:
70 memory section directory. For example, the following symbolic 83 memory section directory. For example, the following symbolic
71 link is created for memory section 9 on node0. 84 link is created for memory section 9 on node0.
72 /sys/devices/system/node/node0/memory9 -> ../../memory/memory9 85 /sys/devices/system/node/node0/memory9 -> ../../memory/memory9
73
diff --git a/Documentation/ABI/testing/sysfs-devices-power b/Documentation/ABI/testing/sysfs-devices-power
new file mode 100644
index 000000000000..6123c523bfd7
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-power
@@ -0,0 +1,79 @@
1What: /sys/devices/.../power/
2Date: January 2009
3Contact: Rafael J. Wysocki <rjw@sisk.pl>
4Description:
5 The /sys/devices/.../power directory contains attributes
6 allowing the user space to check and modify some power
7 management related properties of given device.
8
9What: /sys/devices/.../power/wakeup
10Date: January 2009
11Contact: Rafael J. Wysocki <rjw@sisk.pl>
12Description:
13 The /sys/devices/.../power/wakeup attribute allows the user
14 space to check if the device is enabled to wake up the system
15 from sleep states, such as the memory sleep state (suspend to
16 RAM) and hibernation (suspend to disk), and to enable or disable
17 it to do that as desired.
18
19 Some devices support "wakeup" events, which are hardware signals
20 used to activate the system from a sleep state. Such devices
21 have one of the following two values for the sysfs power/wakeup
22 file:
23
24 + "enabled\n" to issue the events;
25 + "disabled\n" not to do so;
26
27 In that cases the user space can change the setting represented
28 by the contents of this file by writing either "enabled", or
29 "disabled" to it.
30
31 For the devices that are not capable of generating system wakeup
32 events this file contains "\n". In that cases the user space
33 cannot modify the contents of this file and the device cannot be
34 enabled to wake up the system.
35
36What: /sys/devices/.../power/control
37Date: January 2009
38Contact: Rafael J. Wysocki <rjw@sisk.pl>
39Description:
40 The /sys/devices/.../power/control attribute allows the user
41 space to control the run-time power management of the device.
42
43 All devices have one of the following two values for the
44 power/control file:
45
46 + "auto\n" to allow the device to be power managed at run time;
47 + "on\n" to prevent the device from being power managed;
48
49 The default for all devices is "auto", which means that they may
50 be subject to automatic power management, depending on their
51 drivers. Changing this attribute to "on" prevents the driver
52 from power managing the device at run time. Doing that while
53 the device is suspended causes it to be woken up.
54
55What: /sys/devices/.../power/async
56Date: January 2009
57Contact: Rafael J. Wysocki <rjw@sisk.pl>
58Description:
59 The /sys/devices/.../async attribute allows the user space to
60 enable or diasble the device's suspend and resume callbacks to
61 be executed asynchronously (ie. in separate threads, in parallel
62 with the main suspend/resume thread) during system-wide power
63 transitions (eg. suspend to RAM, hibernation).
64
65 All devices have one of the following two values for the
66 power/async file:
67
68 + "enabled\n" to permit the asynchronous suspend/resume;
69 + "disabled\n" to forbid it;
70
71 The value of this attribute may be changed by writing either
72 "enabled", or "disabled" to it.
73
74 It generally is unsafe to permit the asynchronous suspend/resume
75 of a device unless it is certain that all of the PM dependencies
76 of the device are known to the PM core. However, for some
77 devices this attribute is set to "enabled" by bus type code or
78 device drivers and in that cases it should be safe to leave the
79 default value.
diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
new file mode 100644
index 000000000000..84a710f87c64
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
@@ -0,0 +1,203 @@
1What: /sys/devices/system/cpu/
2Date: pre-git history
3Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
4Description:
5 A collection of both global and individual CPU attributes
6
7 Individual CPU attributes are contained in subdirectories
8 named by the kernel's logical CPU number, e.g.:
9
10 /sys/devices/system/cpu/cpu#/
11
12What: /sys/devices/system/cpu/sched_mc_power_savings
13 /sys/devices/system/cpu/sched_smt_power_savings
14Date: June 2006
15Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
16Description: Discover and adjust the kernel's multi-core scheduler support.
17
18 Possible values are:
19
20 0 - No power saving load balance (default value)
21 1 - Fill one thread/core/package first for long running threads
22 2 - Also bias task wakeups to semi-idle cpu package for power
23 savings
24
25 sched_mc_power_savings is dependent upon SCHED_MC, which is
26 itself architecture dependent.
27
28 sched_smt_power_savings is dependent upon SCHED_SMT, which
29 is itself architecture dependent.
30
31 The two files are independent of each other. It is possible
32 that one file may be present without the other.
33
34 Introduced by git commit 5c45bf27.
35
36
37What: /sys/devices/system/cpu/kernel_max
38 /sys/devices/system/cpu/offline
39 /sys/devices/system/cpu/online
40 /sys/devices/system/cpu/possible
41 /sys/devices/system/cpu/present
42Date: December 2008
43Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
44Description: CPU topology files that describe kernel limits related to
45 hotplug. Briefly:
46
47 kernel_max: the maximum cpu index allowed by the kernel
48 configuration.
49
50 offline: cpus that are not online because they have been
51 HOTPLUGGED off or exceed the limit of cpus allowed by the
52 kernel configuration (kernel_max above).
53
54 online: cpus that are online and being scheduled.
55
56 possible: cpus that have been allocated resources and can be
57 brought online if they are present.
58
59 present: cpus that have been identified as being present in
60 the system.
61
62 See Documentation/cputopology.txt for more information.
63
64
65What: /sys/devices/system/cpu/probe
66 /sys/devices/system/cpu/release
67Date: November 2009
68Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
69Description: Dynamic addition and removal of CPU's. This is not hotplug
70 removal, this is meant complete removal/addition of the CPU
71 from the system.
72
73 probe: writes to this file will dynamically add a CPU to the
74 system. Information written to the file to add CPU's is
75 architecture specific.
76
77 release: writes to this file dynamically remove a CPU from
78 the system. Information writtento the file to remove CPU's
79 is architecture specific.
80
81What: /sys/devices/system/cpu/cpu#/node
82Date: October 2009
83Contact: Linux memory management mailing list <linux-mm@kvack.org>
84Description: Discover NUMA node a CPU belongs to
85
86 When CONFIG_NUMA is enabled, a symbolic link that points
87 to the corresponding NUMA node directory.
88
89 For example, the following symlink is created for cpu42
90 in NUMA node 2:
91
92 /sys/devices/system/cpu/cpu42/node2 -> ../../node/node2
93
94
95What: /sys/devices/system/cpu/cpu#/node
96Date: October 2009
97Contact: Linux memory management mailing list <linux-mm@kvack.org>
98Description: Discover NUMA node a CPU belongs to
99
100 When CONFIG_NUMA is enabled, a symbolic link that points
101 to the corresponding NUMA node directory.
102
103 For example, the following symlink is created for cpu42
104 in NUMA node 2:
105
106 /sys/devices/system/cpu/cpu42/node2 -> ../../node/node2
107
108
109What: /sys/devices/system/cpu/cpu#/topology/core_id
110 /sys/devices/system/cpu/cpu#/topology/core_siblings
111 /sys/devices/system/cpu/cpu#/topology/core_siblings_list
112 /sys/devices/system/cpu/cpu#/topology/physical_package_id
113 /sys/devices/system/cpu/cpu#/topology/thread_siblings
114 /sys/devices/system/cpu/cpu#/topology/thread_siblings_list
115Date: December 2008
116Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
117Description: CPU topology files that describe a logical CPU's relationship
118 to other cores and threads in the same physical package.
119
120 One cpu# directory is created per logical CPU in the system,
121 e.g. /sys/devices/system/cpu/cpu42/.
122
123 Briefly, the files above are:
124
125 core_id: the CPU core ID of cpu#. Typically it is the
126 hardware platform's identifier (rather than the kernel's).
127 The actual value is architecture and platform dependent.
128
129 core_siblings: internal kernel map of cpu#'s hardware threads
130 within the same physical_package_id.
131
132 core_siblings_list: human-readable list of the logical CPU
133 numbers within the same physical_package_id as cpu#.
134
135 physical_package_id: physical package id of cpu#. Typically
136 corresponds to a physical socket number, but the actual value
137 is architecture and platform dependent.
138
139 thread_siblings: internel kernel map of cpu#'s hardware
140 threads within the same core as cpu#
141
142 thread_siblings_list: human-readable list of cpu#'s hardware
143 threads within the same core as cpu#
144
145 See Documentation/cputopology.txt for more information.
146
147
148What: /sys/devices/system/cpu/cpuidle/current_driver
149 /sys/devices/system/cpu/cpuidle/current_governer_ro
150Date: September 2007
151Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
152Description: Discover cpuidle policy and mechanism
153
154 Various CPUs today support multiple idle levels that are
155 differentiated by varying exit latencies and power
156 consumption during idle.
157
158 Idle policy (governor) is differentiated from idle mechanism
159 (driver)
160
161 current_driver: displays current idle mechanism
162
163 current_governor_ro: displays current idle policy
164
165 See files in Documentation/cpuidle/ for more information.
166
167
168What: /sys/devices/system/cpu/cpu#/cpufreq/*
169Date: pre-git history
170Contact: cpufreq@vger.kernel.org
171Description: Discover and change clock speed of CPUs
172
173 Clock scaling allows you to change the clock speed of the
174 CPUs on the fly. This is a nice method to save battery
175 power, because the lower the clock speed, the less power
176 the CPU consumes.
177
178 There are many knobs to tweak in this directory.
179
180 See files in Documentation/cpu-freq/ for more information.
181
182 In particular, read Documentation/cpu-freq/user-guide.txt
183 to learn how to control the knobs.
184
185
186What: /sys/devices/system/cpu/cpu*/cache/index*/cache_disable_X
187Date: August 2008
188KernelVersion: 2.6.27
189Contact: mark.langsdorf@amd.com
190Description: These files exist in every cpu's cache index directories.
191 There are currently 2 cache_disable_# files in each
192 directory. Reading from these files on a supported
193 processor will return that cache disable index value
194 for that processor and node. Writing to one of these
195 files will cause the specificed cache index to be disabled.
196
197 Currently, only AMD Family 10h Processors support cache index
198 disable, and only for their L3 caches. See the BIOS and
199 Kernel Developer's Guide at
200 http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/31116-Public-GH-BKDG_3.20_2-4-09.pdf
201 for formatting information and other details on the
202 cache index disable.
203Users: joachim.deguara@amd.com
diff --git a/Documentation/ABI/testing/sysfs-kernel-slab b/Documentation/ABI/testing/sysfs-kernel-slab
index 6dcf75e594fb..8b093f8222d3 100644
--- a/Documentation/ABI/testing/sysfs-kernel-slab
+++ b/Documentation/ABI/testing/sysfs-kernel-slab
@@ -45,8 +45,9 @@ KernelVersion: 2.6.25
45Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 45Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
46 Christoph Lameter <cl@linux-foundation.org> 46 Christoph Lameter <cl@linux-foundation.org>
47Description: 47Description:
48 The alloc_fastpath file is read-only and specifies how many 48 The alloc_fastpath file shows how many objects have been
49 objects have been allocated using the fast path. 49 allocated using the fast path. It can be written to clear the
50 current count.
50 Available when CONFIG_SLUB_STATS is enabled. 51 Available when CONFIG_SLUB_STATS is enabled.
51 52
52What: /sys/kernel/slab/cache/alloc_from_partial 53What: /sys/kernel/slab/cache/alloc_from_partial
@@ -55,9 +56,10 @@ KernelVersion: 2.6.25
55Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 56Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
56 Christoph Lameter <cl@linux-foundation.org> 57 Christoph Lameter <cl@linux-foundation.org>
57Description: 58Description:
58 The alloc_from_partial file is read-only and specifies how 59 The alloc_from_partial file shows how many times a cpu slab has
59 many times a cpu slab has been full and it has been refilled 60 been full and it has been refilled by using a slab from the list
60 by using a slab from the list of partially used slabs. 61 of partially used slabs. It can be written to clear the current
62 count.
61 Available when CONFIG_SLUB_STATS is enabled. 63 Available when CONFIG_SLUB_STATS is enabled.
62 64
63What: /sys/kernel/slab/cache/alloc_refill 65What: /sys/kernel/slab/cache/alloc_refill
@@ -66,9 +68,9 @@ KernelVersion: 2.6.25
66Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 68Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
67 Christoph Lameter <cl@linux-foundation.org> 69 Christoph Lameter <cl@linux-foundation.org>
68Description: 70Description:
69 The alloc_refill file is read-only and specifies how many 71 The alloc_refill file shows how many times the per-cpu freelist
70 times the per-cpu freelist was empty but there were objects 72 was empty but there were objects available as the result of
71 available as the result of remote cpu frees. 73 remote cpu frees. It can be written to clear the current count.
72 Available when CONFIG_SLUB_STATS is enabled. 74 Available when CONFIG_SLUB_STATS is enabled.
73 75
74What: /sys/kernel/slab/cache/alloc_slab 76What: /sys/kernel/slab/cache/alloc_slab
@@ -77,8 +79,9 @@ KernelVersion: 2.6.25
77Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 79Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
78 Christoph Lameter <cl@linux-foundation.org> 80 Christoph Lameter <cl@linux-foundation.org>
79Description: 81Description:
80 The alloc_slab file is read-only and specifies how many times 82 The alloc_slab file is shows how many times a new slab had to
81 a new slab had to be allocated from the page allocator. 83 be allocated from the page allocator. It can be written to
84 clear the current count.
82 Available when CONFIG_SLUB_STATS is enabled. 85 Available when CONFIG_SLUB_STATS is enabled.
83 86
84What: /sys/kernel/slab/cache/alloc_slowpath 87What: /sys/kernel/slab/cache/alloc_slowpath
@@ -87,9 +90,10 @@ KernelVersion: 2.6.25
87Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 90Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
88 Christoph Lameter <cl@linux-foundation.org> 91 Christoph Lameter <cl@linux-foundation.org>
89Description: 92Description:
90 The alloc_slowpath file is read-only and specifies how many 93 The alloc_slowpath file shows how many objects have been
91 objects have been allocated using the slow path because of a 94 allocated using the slow path because of a refill or
92 refill or allocation from a partial or new slab. 95 allocation from a partial or new slab. It can be written to
96 clear the current count.
93 Available when CONFIG_SLUB_STATS is enabled. 97 Available when CONFIG_SLUB_STATS is enabled.
94 98
95What: /sys/kernel/slab/cache/cache_dma 99What: /sys/kernel/slab/cache/cache_dma
@@ -117,10 +121,11 @@ KernelVersion: 2.6.31
117Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 121Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
118 Christoph Lameter <cl@linux-foundation.org> 122 Christoph Lameter <cl@linux-foundation.org>
119Description: 123Description:
120 The file cpuslab_flush is read-only and specifies how many 124 The file cpuslab_flush shows how many times a cache's cpu slabs
121 times a cache's cpu slabs have been flushed as the result of 125 have been flushed as the result of destroying or shrinking a
122 destroying or shrinking a cache, a cpu going offline, or as 126 cache, a cpu going offline, or as the result of forcing an
123 the result of forcing an allocation from a certain node. 127 allocation from a certain node. It can be written to clear the
128 current count.
124 Available when CONFIG_SLUB_STATS is enabled. 129 Available when CONFIG_SLUB_STATS is enabled.
125 130
126What: /sys/kernel/slab/cache/ctor 131What: /sys/kernel/slab/cache/ctor
@@ -139,8 +144,8 @@ KernelVersion: 2.6.25
139Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 144Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
140 Christoph Lameter <cl@linux-foundation.org> 145 Christoph Lameter <cl@linux-foundation.org>
141Description: 146Description:
142 The file deactivate_empty is read-only and specifies how many 147 The deactivate_empty file shows how many times an empty cpu slab
143 times an empty cpu slab was deactivated. 148 was deactivated. It can be written to clear the current count.
144 Available when CONFIG_SLUB_STATS is enabled. 149 Available when CONFIG_SLUB_STATS is enabled.
145 150
146What: /sys/kernel/slab/cache/deactivate_full 151What: /sys/kernel/slab/cache/deactivate_full
@@ -149,8 +154,8 @@ KernelVersion: 2.6.25
149Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 154Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
150 Christoph Lameter <cl@linux-foundation.org> 155 Christoph Lameter <cl@linux-foundation.org>
151Description: 156Description:
152 The file deactivate_full is read-only and specifies how many 157 The deactivate_full file shows how many times a full cpu slab
153 times a full cpu slab was deactivated. 158 was deactivated. It can be written to clear the current count.
154 Available when CONFIG_SLUB_STATS is enabled. 159 Available when CONFIG_SLUB_STATS is enabled.
155 160
156What: /sys/kernel/slab/cache/deactivate_remote_frees 161What: /sys/kernel/slab/cache/deactivate_remote_frees
@@ -159,9 +164,9 @@ KernelVersion: 2.6.25
159Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 164Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
160 Christoph Lameter <cl@linux-foundation.org> 165 Christoph Lameter <cl@linux-foundation.org>
161Description: 166Description:
162 The file deactivate_remote_frees is read-only and specifies how 167 The deactivate_remote_frees file shows how many times a cpu slab
163 many times a cpu slab has been deactivated and contained free 168 has been deactivated and contained free objects that were freed
164 objects that were freed remotely. 169 remotely. It can be written to clear the current count.
165 Available when CONFIG_SLUB_STATS is enabled. 170 Available when CONFIG_SLUB_STATS is enabled.
166 171
167What: /sys/kernel/slab/cache/deactivate_to_head 172What: /sys/kernel/slab/cache/deactivate_to_head
@@ -170,9 +175,9 @@ KernelVersion: 2.6.25
170Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 175Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
171 Christoph Lameter <cl@linux-foundation.org> 176 Christoph Lameter <cl@linux-foundation.org>
172Description: 177Description:
173 The file deactivate_to_head is read-only and specifies how 178 The deactivate_to_head file shows how many times a partial cpu
174 many times a partial cpu slab was deactivated and added to the 179 slab was deactivated and added to the head of its node's partial
175 head of its node's partial list. 180 list. It can be written to clear the current count.
176 Available when CONFIG_SLUB_STATS is enabled. 181 Available when CONFIG_SLUB_STATS is enabled.
177 182
178What: /sys/kernel/slab/cache/deactivate_to_tail 183What: /sys/kernel/slab/cache/deactivate_to_tail
@@ -181,9 +186,9 @@ KernelVersion: 2.6.25
181Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 186Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
182 Christoph Lameter <cl@linux-foundation.org> 187 Christoph Lameter <cl@linux-foundation.org>
183Description: 188Description:
184 The file deactivate_to_tail is read-only and specifies how 189 The deactivate_to_tail file shows how many times a partial cpu
185 many times a partial cpu slab was deactivated and added to the 190 slab was deactivated and added to the tail of its node's partial
186 tail of its node's partial list. 191 list. It can be written to clear the current count.
187 Available when CONFIG_SLUB_STATS is enabled. 192 Available when CONFIG_SLUB_STATS is enabled.
188 193
189What: /sys/kernel/slab/cache/destroy_by_rcu 194What: /sys/kernel/slab/cache/destroy_by_rcu
@@ -201,9 +206,9 @@ KernelVersion: 2.6.25
201Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 206Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
202 Christoph Lameter <cl@linux-foundation.org> 207 Christoph Lameter <cl@linux-foundation.org>
203Description: 208Description:
204 The file free_add_partial is read-only and specifies how many 209 The free_add_partial file shows how many times an object has
205 times an object has been freed in a full slab so that it had to 210 been freed in a full slab so that it had to added to its node's
206 added to its node's partial list. 211 partial list. It can be written to clear the current count.
207 Available when CONFIG_SLUB_STATS is enabled. 212 Available when CONFIG_SLUB_STATS is enabled.
208 213
209What: /sys/kernel/slab/cache/free_calls 214What: /sys/kernel/slab/cache/free_calls
@@ -222,9 +227,9 @@ KernelVersion: 2.6.25
222Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 227Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
223 Christoph Lameter <cl@linux-foundation.org> 228 Christoph Lameter <cl@linux-foundation.org>
224Description: 229Description:
225 The free_fastpath file is read-only and specifies how many 230 The free_fastpath file shows how many objects have been freed
226 objects have been freed using the fast path because it was an 231 using the fast path because it was an object from the cpu slab.
227 object from the cpu slab. 232 It can be written to clear the current count.
228 Available when CONFIG_SLUB_STATS is enabled. 233 Available when CONFIG_SLUB_STATS is enabled.
229 234
230What: /sys/kernel/slab/cache/free_frozen 235What: /sys/kernel/slab/cache/free_frozen
@@ -233,9 +238,9 @@ KernelVersion: 2.6.25
233Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 238Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
234 Christoph Lameter <cl@linux-foundation.org> 239 Christoph Lameter <cl@linux-foundation.org>
235Description: 240Description:
236 The free_frozen file is read-only and specifies how many 241 The free_frozen file shows how many objects have been freed to
237 objects have been freed to a frozen slab (i.e. a remote cpu 242 a frozen slab (i.e. a remote cpu slab). It can be written to
238 slab). 243 clear the current count.
239 Available when CONFIG_SLUB_STATS is enabled. 244 Available when CONFIG_SLUB_STATS is enabled.
240 245
241What: /sys/kernel/slab/cache/free_remove_partial 246What: /sys/kernel/slab/cache/free_remove_partial
@@ -244,9 +249,10 @@ KernelVersion: 2.6.25
244Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 249Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
245 Christoph Lameter <cl@linux-foundation.org> 250 Christoph Lameter <cl@linux-foundation.org>
246Description: 251Description:
247 The file free_remove_partial is read-only and specifies how 252 The free_remove_partial file shows how many times an object has
248 many times an object has been freed to a now-empty slab so 253 been freed to a now-empty slab so that it had to be removed from
249 that it had to be removed from its node's partial list. 254 its node's partial list. It can be written to clear the current
255 count.
250 Available when CONFIG_SLUB_STATS is enabled. 256 Available when CONFIG_SLUB_STATS is enabled.
251 257
252What: /sys/kernel/slab/cache/free_slab 258What: /sys/kernel/slab/cache/free_slab
@@ -255,8 +261,9 @@ KernelVersion: 2.6.25
255Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 261Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
256 Christoph Lameter <cl@linux-foundation.org> 262 Christoph Lameter <cl@linux-foundation.org>
257Description: 263Description:
258 The free_slab file is read-only and specifies how many times an 264 The free_slab file shows how many times an empty slab has been
259 empty slab has been freed back to the page allocator. 265 freed back to the page allocator. It can be written to clear
266 the current count.
260 Available when CONFIG_SLUB_STATS is enabled. 267 Available when CONFIG_SLUB_STATS is enabled.
261 268
262What: /sys/kernel/slab/cache/free_slowpath 269What: /sys/kernel/slab/cache/free_slowpath
@@ -265,9 +272,9 @@ KernelVersion: 2.6.25
265Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 272Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
266 Christoph Lameter <cl@linux-foundation.org> 273 Christoph Lameter <cl@linux-foundation.org>
267Description: 274Description:
268 The free_slowpath file is read-only and specifies how many 275 The free_slowpath file shows how many objects have been freed
269 objects have been freed using the slow path (i.e. to a full or 276 using the slow path (i.e. to a full or partial slab). It can
270 partial slab). 277 be written to clear the current count.
271 Available when CONFIG_SLUB_STATS is enabled. 278 Available when CONFIG_SLUB_STATS is enabled.
272 279
273What: /sys/kernel/slab/cache/hwcache_align 280What: /sys/kernel/slab/cache/hwcache_align
@@ -346,10 +353,10 @@ KernelVersion: 2.6.26
346Contact: Pekka Enberg <penberg@cs.helsinki.fi>, 353Contact: Pekka Enberg <penberg@cs.helsinki.fi>,
347 Christoph Lameter <cl@linux-foundation.org> 354 Christoph Lameter <cl@linux-foundation.org>
348Description: 355Description:
349 The file order_fallback is read-only and specifies how many 356 The order_fallback file shows how many times an allocation of a
350 times an allocation of a new slab has not been possible at the 357 new slab has not been possible at the cache's order and instead
351 cache's order and instead fallen back to its minimum possible 358 fallen back to its minimum possible order. It can be written to
352 order. 359 clear the current count.
353 Available when CONFIG_SLUB_STATS is enabled. 360 Available when CONFIG_SLUB_STATS is enabled.
354 361
355What: /sys/kernel/slab/cache/partial 362What: /sys/kernel/slab/cache/partial
diff --git a/Documentation/ABI/testing/sysfs-memory-page-offline b/Documentation/ABI/testing/sysfs-memory-page-offline
new file mode 100644
index 000000000000..e14703f12fdf
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-memory-page-offline
@@ -0,0 +1,44 @@
1What: /sys/devices/system/memory/soft_offline_page
2Date: Sep 2009
3KernelVersion: 2.6.33
4Contact: andi@firstfloor.org
5Description:
6 Soft-offline the memory page containing the physical address
7 written into this file. Input is a hex number specifying the
8 physical address of the page. The kernel will then attempt
9 to soft-offline it, by moving the contents elsewhere or
10 dropping it if possible. The kernel will then be placed
11 on the bad page list and never be reused.
12
13 The offlining is done in kernel specific granuality.
14 Normally it's the base page size of the kernel, but
15 this might change.
16
17 The page must be still accessible, not poisoned. The
18 kernel will never kill anything for this, but rather
19 fail the offline. Return value is the size of the
20 number, or a error when the offlining failed. Reading
21 the file is not allowed.
22
23What: /sys/devices/system/memory/hard_offline_page
24Date: Sep 2009
25KernelVersion: 2.6.33
26Contact: andi@firstfloor.org
27Description:
28 Hard-offline the memory page containing the physical
29 address written into this file. Input is a hex number
30 specifying the physical address of the page. The
31 kernel will then attempt to hard-offline the page, by
32 trying to drop the page or killing any owner or
33 triggering IO errors if needed. Note this may kill
34 any processes owning the page. The kernel will avoid
35 to access this page assuming it's poisoned by the
36 hardware.
37
38 The offlining is done in kernel specific granuality.
39 Normally it's the base page size of the kernel, but
40 this might change.
41
42 Return value is the size of the number, or a error when
43 the offlining failed.
44 Reading the file is not allowed.
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop
index a1cb660c50cf..1d775390e856 100644
--- a/Documentation/ABI/testing/sysfs-platform-asus-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop
@@ -1,4 +1,4 @@
1What: /sys/devices/platform/asus-laptop/display 1What: /sys/devices/platform/asus_laptop/display
2Date: January 2007 2Date: January 2007
3KernelVersion: 2.6.20 3KernelVersion: 2.6.20
4Contact: "Corentin Chary" <corentincj@iksaif.net> 4Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -13,7 +13,7 @@ Description:
13 Ex: - 0 (0000b) means no display 13 Ex: - 0 (0000b) means no display
14 - 3 (0011b) CRT+LCD. 14 - 3 (0011b) CRT+LCD.
15 15
16What: /sys/devices/platform/asus-laptop/gps 16What: /sys/devices/platform/asus_laptop/gps
17Date: January 2007 17Date: January 2007
18KernelVersion: 2.6.20 18KernelVersion: 2.6.20
19Contact: "Corentin Chary" <corentincj@iksaif.net> 19Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -21,7 +21,7 @@ Description:
21 Control the gps device. 1 means on, 0 means off. 21 Control the gps device. 1 means on, 0 means off.
22Users: Lapsus 22Users: Lapsus
23 23
24What: /sys/devices/platform/asus-laptop/ledd 24What: /sys/devices/platform/asus_laptop/ledd
25Date: January 2007 25Date: January 2007
26KernelVersion: 2.6.20 26KernelVersion: 2.6.20
27Contact: "Corentin Chary" <corentincj@iksaif.net> 27Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -29,11 +29,11 @@ Description:
29 Some models like the W1N have a LED display that can be 29 Some models like the W1N have a LED display that can be
30 used to display several informations. 30 used to display several informations.
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/laptops/asus-laptop.txt
35 35
36What: /sys/devices/platform/asus-laptop/bluetooth 36What: /sys/devices/platform/asus_laptop/bluetooth
37Date: January 2007 37Date: January 2007
38KernelVersion: 2.6.20 38KernelVersion: 2.6.20
39Contact: "Corentin Chary" <corentincj@iksaif.net> 39Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -42,7 +42,7 @@ Description:
42 This may control the led, the device or both. 42 This may control the led, the device or both.
43Users: Lapsus 43Users: Lapsus
44 44
45What: /sys/devices/platform/asus-laptop/wlan 45What: /sys/devices/platform/asus_laptop/wlan
46Date: January 2007 46Date: January 2007
47KernelVersion: 2.6.20 47KernelVersion: 2.6.20
48Contact: "Corentin Chary" <corentincj@iksaif.net> 48Contact: "Corentin Chary" <corentincj@iksaif.net>
diff --git a/Documentation/ABI/testing/sysfs-platform-eeepc-laptop b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop
index 7445dfb321b5..5b026c69587a 100644
--- a/Documentation/ABI/testing/sysfs-platform-eeepc-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-eeepc-laptop
@@ -1,4 +1,4 @@
1What: /sys/devices/platform/eeepc-laptop/disp 1What: /sys/devices/platform/eeepc/disp
2Date: May 2008 2Date: May 2008
3KernelVersion: 2.6.26 3KernelVersion: 2.6.26
4Contact: "Corentin Chary" <corentincj@iksaif.net> 4Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -9,21 +9,21 @@ Description:
9 - 3 = LCD+CRT 9 - 3 = LCD+CRT
10 If you run X11, you should use xrandr instead. 10 If you run X11, you should use xrandr instead.
11 11
12What: /sys/devices/platform/eeepc-laptop/camera 12What: /sys/devices/platform/eeepc/camera
13Date: May 2008 13Date: May 2008
14KernelVersion: 2.6.26 14KernelVersion: 2.6.26
15Contact: "Corentin Chary" <corentincj@iksaif.net> 15Contact: "Corentin Chary" <corentincj@iksaif.net>
16Description: 16Description:
17 Control the camera. 1 means on, 0 means off. 17 Control the camera. 1 means on, 0 means off.
18 18
19What: /sys/devices/platform/eeepc-laptop/cardr 19What: /sys/devices/platform/eeepc/cardr
20Date: May 2008 20Date: May 2008
21KernelVersion: 2.6.26 21KernelVersion: 2.6.26
22Contact: "Corentin Chary" <corentincj@iksaif.net> 22Contact: "Corentin Chary" <corentincj@iksaif.net>
23Description: 23Description:
24 Control the card reader. 1 means on, 0 means off. 24 Control the card reader. 1 means on, 0 means off.
25 25
26What: /sys/devices/platform/eeepc-laptop/cpufv 26What: /sys/devices/platform/eeepc/cpufv
27Date: Jun 2009 27Date: Jun 2009
28KernelVersion: 2.6.31 28KernelVersion: 2.6.31
29Contact: "Corentin Chary" <corentincj@iksaif.net> 29Contact: "Corentin Chary" <corentincj@iksaif.net>
@@ -42,7 +42,7 @@ Description:
42 `------------ Availables modes 42 `------------ Availables modes
43 For example, 0x301 means: mode 1 selected, 3 available modes. 43 For example, 0x301 means: mode 1 selected, 3 available modes.
44 44
45What: /sys/devices/platform/eeepc-laptop/available_cpufv 45What: /sys/devices/platform/eeepc/available_cpufv
46Date: Jun 2009 46Date: Jun 2009
47KernelVersion: 2.6.31 47KernelVersion: 2.6.31
48Contact: "Corentin Chary" <corentincj@iksaif.net> 48Contact: "Corentin Chary" <corentincj@iksaif.net>
diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power
index dcff4d0623ad..d6a801f45b48 100644
--- a/Documentation/ABI/testing/sysfs-power
+++ b/Documentation/ABI/testing/sysfs-power
@@ -101,3 +101,16 @@ Description:
101 101
102 CAUTION: Using it will cause your machine's real-time (CMOS) 102 CAUTION: Using it will cause your machine's real-time (CMOS)
103 clock to be set to a random invalid time after a resume. 103 clock to be set to a random invalid time after a resume.
104
105What: /sys/power/pm_async
106Date: January 2009
107Contact: Rafael J. Wysocki <rjw@sisk.pl>
108Description:
109 The /sys/power/pm_async file controls the switch allowing the
110 user space to enable or disable asynchronous suspend and resume
111 of devices. If enabled, this feature will cause some device
112 drivers' suspend and resume callbacks to be executed in parallel
113 with each other and with the main suspend thread. It is enabled
114 if this file contains "1", which is the default. It may be
115 disabled by writing "0" to this file, in which case all devices
116 will be suspended and resumed synchronously.
diff --git a/Documentation/Changes b/Documentation/Changes
index 6d0f1efc5bf6..f08b313cd235 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -49,6 +49,8 @@ o oprofile 0.9 # oprofiled --version
49o udev 081 # udevinfo -V 49o udev 081 # udevinfo -V
50o grub 0.93 # grub --version 50o grub 0.93 # grub --version
51o mcelog 0.6 51o mcelog 0.6
52o iptables 1.4.1 # iptables -V
53
52 54
53Kernel compilation 55Kernel compilation
54================== 56==================
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 5aceb88b3f8b..05e2ae236865 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -4,20 +4,18 @@
4 James E.J. Bottomley <James.Bottomley@HansenPartnership.com> 4 James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
5 5
6This document describes the DMA API. For a more gentle introduction 6This document describes the DMA API. For a more gentle introduction
7phrased in terms of the pci_ equivalents (and actual examples) see 7of the API (and actual examples) see
8Documentation/PCI/PCI-DMA-mapping.txt. 8Documentation/DMA-API-HOWTO.txt.
9 9
10This API is split into two pieces. Part I describes the API and the 10This API is split into two pieces. Part I describes the API. Part II
11corresponding pci_ API. Part II describes the extensions to the API 11describes the extensions to the API for supporting non-consistent
12for supporting non-consistent memory machines. Unless you know that 12memory machines. Unless you know that your driver absolutely has to
13your driver absolutely has to support non-consistent platforms (this 13support non-consistent platforms (this is usually only legacy
14is usually only legacy platforms) you should only use the API 14platforms) you should only use the API described in part I.
15described in part I.
16 15
17Part I - pci_ and dma_ Equivalent API 16Part I - dma_ API
18------------------------------------- 17-------------------------------------
19 18
20To get the pci_ API, you must #include <linux/pci.h>
21To get the dma_ API, you must #include <linux/dma-mapping.h> 19To get the dma_ API, you must #include <linux/dma-mapping.h>
22 20
23 21
@@ -27,9 +25,6 @@ Part Ia - Using large dma-coherent buffers
27void * 25void *
28dma_alloc_coherent(struct device *dev, size_t size, 26dma_alloc_coherent(struct device *dev, size_t size,
29 dma_addr_t *dma_handle, gfp_t flag) 27 dma_addr_t *dma_handle, gfp_t flag)
30void *
31pci_alloc_consistent(struct pci_dev *dev, size_t size,
32 dma_addr_t *dma_handle)
33 28
34Consistent memory is memory for which a write by either the device or 29Consistent memory is memory for which a write by either the device or
35the processor can immediately be read by the processor or device 30the processor can immediately be read by the processor or device
@@ -53,15 +48,11 @@ The simplest way to do that is to use the dma_pool calls (see below).
53The flag parameter (dma_alloc_coherent only) allows the caller to 48The flag parameter (dma_alloc_coherent only) allows the caller to
54specify the GFP_ flags (see kmalloc) for the allocation (the 49specify the GFP_ flags (see kmalloc) for the allocation (the
55implementation may choose to ignore flags that affect the location of 50implementation may choose to ignore flags that affect the location of
56the returned memory, like GFP_DMA). For pci_alloc_consistent, you 51the returned memory, like GFP_DMA).
57must assume GFP_ATOMIC behaviour.
58 52
59void 53void
60dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 54dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
61 dma_addr_t dma_handle) 55 dma_addr_t dma_handle)
62void
63pci_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr,
64 dma_addr_t dma_handle)
65 56
66Free the region of consistent memory you previously allocated. dev, 57Free the region of consistent memory you previously allocated. dev,
67size and dma_handle must all be the same as those passed into the 58size and dma_handle must all be the same as those passed into the
@@ -89,10 +80,6 @@ for alignment, like queue heads needing to be aligned on N-byte boundaries.
89 dma_pool_create(const char *name, struct device *dev, 80 dma_pool_create(const char *name, struct device *dev,
90 size_t size, size_t align, size_t alloc); 81 size_t size, size_t align, size_t alloc);
91 82
92 struct pci_pool *
93 pci_pool_create(const char *name, struct pci_device *dev,
94 size_t size, size_t align, size_t alloc);
95
96The pool create() routines initialize a pool of dma-coherent buffers 83The pool create() routines initialize a pool of dma-coherent buffers
97for use with a given device. It must be called in a context which 84for use with a given device. It must be called in a context which
98can sleep. 85can sleep.
@@ -108,9 +95,6 @@ from this pool must not cross 4KByte boundaries.
108 void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, 95 void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
109 dma_addr_t *dma_handle); 96 dma_addr_t *dma_handle);
110 97
111 void *pci_pool_alloc(struct pci_pool *pool, gfp_t gfp_flags,
112 dma_addr_t *dma_handle);
113
114This allocates memory from the pool; the returned memory will meet the size 98This allocates memory from the pool; the returned memory will meet the size
115and alignment requirements specified at creation time. Pass GFP_ATOMIC to 99and alignment requirements specified at creation time. Pass GFP_ATOMIC to
116prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), 100prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks),
@@ -122,9 +106,6 @@ pool's device.
122 void dma_pool_free(struct dma_pool *pool, void *vaddr, 106 void dma_pool_free(struct dma_pool *pool, void *vaddr,
123 dma_addr_t addr); 107 dma_addr_t addr);
124 108
125 void pci_pool_free(struct pci_pool *pool, void *vaddr,
126 dma_addr_t addr);
127
128This puts memory back into the pool. The pool is what was passed to 109This puts memory back into the pool. The pool is what was passed to
129the pool allocation routine; the cpu (vaddr) and dma addresses are what 110the pool allocation routine; the cpu (vaddr) and dma addresses are what
130were returned when that routine allocated the memory being freed. 111were returned when that routine allocated the memory being freed.
@@ -132,8 +113,6 @@ were returned when that routine allocated the memory being freed.
132 113
133 void dma_pool_destroy(struct dma_pool *pool); 114 void dma_pool_destroy(struct dma_pool *pool);
134 115
135 void pci_pool_destroy(struct pci_pool *pool);
136
137The pool destroy() routines free the resources of the pool. They must be 116The pool destroy() routines free the resources of the pool. They must be
138called in a context which can sleep. Make sure you've freed all allocated 117called in a context which can sleep. Make sure you've freed all allocated
139memory back to the pool before you destroy it. 118memory back to the pool before you destroy it.
@@ -144,8 +123,6 @@ Part Ic - DMA addressing limitations
144 123
145int 124int
146dma_supported(struct device *dev, u64 mask) 125dma_supported(struct device *dev, u64 mask)
147int
148pci_dma_supported(struct pci_dev *hwdev, u64 mask)
149 126
150Checks to see if the device can support DMA to the memory described by 127Checks to see if the device can support DMA to the memory described by
151mask. 128mask.
@@ -159,8 +136,14 @@ driver writers.
159 136
160int 137int
161dma_set_mask(struct device *dev, u64 mask) 138dma_set_mask(struct device *dev, u64 mask)
139
140Checks to see if the mask is possible and updates the device
141parameters if it is.
142
143Returns: 0 if successful and a negative error if not.
144
162int 145int
163pci_set_dma_mask(struct pci_device *dev, u64 mask) 146dma_set_coherent_mask(struct device *dev, u64 mask)
164 147
165Checks to see if the mask is possible and updates the device 148Checks to see if the mask is possible and updates the device
166parameters if it is. 149parameters if it is.
@@ -187,9 +170,6 @@ Part Id - Streaming DMA mappings
187dma_addr_t 170dma_addr_t
188dma_map_single(struct device *dev, void *cpu_addr, size_t size, 171dma_map_single(struct device *dev, void *cpu_addr, size_t size,
189 enum dma_data_direction direction) 172 enum dma_data_direction direction)
190dma_addr_t
191pci_map_single(struct pci_dev *hwdev, void *cpu_addr, size_t size,
192 int direction)
193 173
194Maps a piece of processor virtual memory so it can be accessed by the 174Maps a piece of processor virtual memory so it can be accessed by the
195device and returns the physical handle of the memory. 175device and returns the physical handle of the memory.
@@ -198,14 +178,10 @@ The direction for both api's may be converted freely by casting.
198However the dma_ API uses a strongly typed enumerator for its 178However the dma_ API uses a strongly typed enumerator for its
199direction: 179direction:
200 180
201DMA_NONE = PCI_DMA_NONE no direction (used for 181DMA_NONE no direction (used for debugging)
202 debugging) 182DMA_TO_DEVICE data is going from the memory to the device
203DMA_TO_DEVICE = PCI_DMA_TODEVICE data is going from the 183DMA_FROM_DEVICE data is coming from the device to the memory
204 memory to the device 184DMA_BIDIRECTIONAL direction isn't known
205DMA_FROM_DEVICE = PCI_DMA_FROMDEVICE data is coming from
206 the device to the
207 memory
208DMA_BIDIRECTIONAL = PCI_DMA_BIDIRECTIONAL direction isn't known
209 185
210Notes: Not all memory regions in a machine can be mapped by this 186Notes: Not all memory regions in a machine can be mapped by this
211API. Further, regions that appear to be physically contiguous in 187API. Further, regions that appear to be physically contiguous in
@@ -268,9 +244,6 @@ cache lines are updated with data that the device may have changed).
268void 244void
269dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 245dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
270 enum dma_data_direction direction) 246 enum dma_data_direction direction)
271void
272pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
273 size_t size, int direction)
274 247
275Unmaps the region previously mapped. All the parameters passed in 248Unmaps the region previously mapped. All the parameters passed in
276must be identical to those passed in (and returned) by the mapping 249must be identical to those passed in (and returned) by the mapping
@@ -280,15 +253,9 @@ dma_addr_t
280dma_map_page(struct device *dev, struct page *page, 253dma_map_page(struct device *dev, struct page *page,
281 unsigned long offset, size_t size, 254 unsigned long offset, size_t size,
282 enum dma_data_direction direction) 255 enum dma_data_direction direction)
283dma_addr_t
284pci_map_page(struct pci_dev *hwdev, struct page *page,
285 unsigned long offset, size_t size, int direction)
286void 256void
287dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 257dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
288 enum dma_data_direction direction) 258 enum dma_data_direction direction)
289void
290pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
291 size_t size, int direction)
292 259
293API for mapping and unmapping for pages. All the notes and warnings 260API for mapping and unmapping for pages. All the notes and warnings
294for the other mapping APIs apply here. Also, although the <offset> 261for the other mapping APIs apply here. Also, although the <offset>
@@ -299,9 +266,6 @@ cache width is.
299int 266int
300dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 267dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
301 268
302int
303pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)
304
305In some circumstances dma_map_single and dma_map_page will fail to create 269In some circumstances dma_map_single and dma_map_page will fail to create
306a mapping. A driver can check for these errors by testing the returned 270a mapping. A driver can check for these errors by testing the returned
307dma address with dma_mapping_error(). A non-zero return value means the mapping 271dma address with dma_mapping_error(). A non-zero return value means the mapping
@@ -311,9 +275,6 @@ reduce current DMA mapping usage or delay and try again later).
311 int 275 int
312 dma_map_sg(struct device *dev, struct scatterlist *sg, 276 dma_map_sg(struct device *dev, struct scatterlist *sg,
313 int nents, enum dma_data_direction direction) 277 int nents, enum dma_data_direction direction)
314 int
315 pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
316 int nents, int direction)
317 278
318Returns: the number of physical segments mapped (this may be shorter 279Returns: the number of physical segments mapped (this may be shorter
319than <nents> passed in if some elements of the scatter/gather list are 280than <nents> passed in if some elements of the scatter/gather list are
@@ -353,9 +314,6 @@ accessed sg->address and sg->length as shown above.
353 void 314 void
354 dma_unmap_sg(struct device *dev, struct scatterlist *sg, 315 dma_unmap_sg(struct device *dev, struct scatterlist *sg,
355 int nhwentries, enum dma_data_direction direction) 316 int nhwentries, enum dma_data_direction direction)
356 void
357 pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
358 int nents, int direction)
359 317
360Unmap the previously mapped scatter/gather list. All the parameters 318Unmap the previously mapped scatter/gather list. All the parameters
361must be the same as those and passed in to the scatter/gather mapping 319must be the same as those and passed in to the scatter/gather mapping
@@ -365,21 +323,23 @@ Note: <nents> must be the number you passed in, *not* the number of
365physical entries returned. 323physical entries returned.
366 324
367void 325void
368dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, 326dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
369 enum dma_data_direction direction) 327 enum dma_data_direction direction)
370void 328void
371pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, 329dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
372 size_t size, int direction) 330 enum dma_data_direction direction)
373void 331void
374dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, 332dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
375 enum dma_data_direction direction) 333 enum dma_data_direction direction)
376void 334void
377pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, 335dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
378 int nelems, int direction) 336 enum dma_data_direction direction)
379 337
380Synchronise a single contiguous or scatter/gather mapping. All the 338Synchronise a single contiguous or scatter/gather mapping for the cpu
381parameters must be the same as those passed into the single mapping 339and device. With the sync_sg API, all the parameters must be the same
382API. 340as those passed into the single mapping API. With the sync_single API,
341you can use dma_handle and size parameters that aren't identical to
342those passed into the single mapping API to do a partial sync.
383 343
384Notes: You must do this: 344Notes: You must do this:
385 345
@@ -461,9 +421,9 @@ void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr,
461Part II - Advanced dma_ usage 421Part II - Advanced dma_ usage
462----------------------------- 422-----------------------------
463 423
464Warning: These pieces of the DMA API have no PCI equivalent. They 424Warning: These pieces of the DMA API should not be used in the
465should also not be used in the majority of cases, since they cater for 425majority of cases, since they cater for unlikely corner cases that
466unlikely corner cases that don't belong in usual drivers. 426don't belong in usual drivers.
467 427
468If you don't understand how cache line coherency works between a 428If you don't understand how cache line coherency works between a
469processor and an I/O device, you should not be using this part of the 429processor and an I/O device, you should not be using this part of the
@@ -514,16 +474,6 @@ into the width returned by this call. It will also always be a power
514of two for easy alignment. 474of two for easy alignment.
515 475
516void 476void
517dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
518 unsigned long offset, size_t size,
519 enum dma_data_direction direction)
520
521Does a partial sync, starting at offset and continuing for size. You
522must be careful to observe the cache alignment and width when doing
523anything like this. You must also be extra careful about accessing
524memory you intend to sync partially.
525
526void
527dma_cache_sync(struct device *dev, void *vaddr, size_t size, 477dma_cache_sync(struct device *dev, void *vaddr, size_t size,
528 enum dma_data_direction direction) 478 enum dma_data_direction direction)
529 479
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index ab8300f67182..325cfd1d6d99 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -8,7 +8,7 @@
8 8
9DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ 9DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
10 kernel-hacking.xml kernel-locking.xml deviceiobook.xml \ 10 kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
11 procfs-guide.xml writing_usb_driver.xml networking.xml \ 11 writing_usb_driver.xml networking.xml \
12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ 12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ 13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ 14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
@@ -32,10 +32,10 @@ PS_METHOD = $(prefer-db2x)
32 32
33### 33###
34# The targets that may be used. 34# The targets that may be used.
35PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs media 35PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks
36 36
37BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) 37BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
38xmldocs: $(BOOKS) 38xmldocs: $(BOOKS) xmldoclinks
39sgmldocs: xmldocs 39sgmldocs: xmldocs
40 40
41PS := $(patsubst %.xml, %.ps, $(BOOKS)) 41PS := $(patsubst %.xml, %.ps, $(BOOKS))
@@ -45,15 +45,24 @@ PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
45pdfdocs: $(PDF) 45pdfdocs: $(PDF)
46 46
47HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS))) 47HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
48htmldocs: media $(HTML) 48htmldocs: $(HTML)
49 $(call build_main_index) 49 $(call build_main_index)
50 $(call build_images)
50 51
51MAN := $(patsubst %.xml, %.9, $(BOOKS)) 52MAN := $(patsubst %.xml, %.9, $(BOOKS))
52mandocs: $(MAN) 53mandocs: $(MAN)
53 54
54media: 55build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
55 mkdir -p $(srctree)/Documentation/DocBook/media/ 56 cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/
56 cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(srctree)/Documentation/DocBook/media/ 57
58xmldoclinks:
59ifneq ($(objtree),$(srctree))
60 for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \
61 rm -f $(objtree)/Documentation/DocBook/$$dep \
62 && ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \
63 || exit; \
64 done
65endif
57 66
58installmandocs: mandocs 67installmandocs: mandocs
59 mkdir -p /usr/local/man/man9/ 68 mkdir -p /usr/local/man/man9/
@@ -65,7 +74,7 @@ KERNELDOC = $(srctree)/scripts/kernel-doc
65DOCPROC = $(objtree)/scripts/basic/docproc 74DOCPROC = $(objtree)/scripts/basic/docproc
66 75
67XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl 76XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
68#XMLTOFLAGS += --skip-validation 77XMLTOFLAGS += --skip-validation
69 78
70### 79###
71# DOCPROC is used for two purposes: 80# DOCPROC is used for two purposes:
@@ -101,17 +110,6 @@ endif
101# Changes in kernel-doc force a rebuild of all documentation 110# Changes in kernel-doc force a rebuild of all documentation
102$(BOOKS): $(KERNELDOC) 111$(BOOKS): $(KERNELDOC)
103 112
104###
105# procfs guide uses a .c file as example code.
106# This requires an explicit dependency
107C-procfs-example = procfs_example.xml
108C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
109$(obj)/procfs-guide.xml: $(C-procfs-example2)
110
111# List of programs to build
112##oops, this is a kernel module::hostprogs-y := procfs_example
113obj-m += procfs_example.o
114
115# Tell kbuild to always build the programs 113# Tell kbuild to always build the programs
116always := $(hostprogs-y) 114always := $(hostprogs-y)
117 115
@@ -238,7 +236,7 @@ clean-files := $(DOCBOOKS) \
238 $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \ 236 $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
239 $(patsubst %.xml, %.html, $(DOCBOOKS)) \ 237 $(patsubst %.xml, %.html, $(DOCBOOKS)) \
240 $(patsubst %.xml, %.9, $(DOCBOOKS)) \ 238 $(patsubst %.xml, %.9, $(DOCBOOKS)) \
241 $(C-procfs-example) $(index) 239 $(index)
242 240
243clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man 241clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
244 242
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl
index 94a20fe8fedf..1b2dd4fc3db2 100644
--- a/Documentation/DocBook/device-drivers.tmpl
+++ b/Documentation/DocBook/device-drivers.tmpl
@@ -45,7 +45,7 @@
45 </sect1> 45 </sect1>
46 46
47 <sect1><title>Atomic and pointer manipulation</title> 47 <sect1><title>Atomic and pointer manipulation</title>
48!Iarch/x86/include/asm/atomic_32.h 48!Iarch/x86/include/asm/atomic.h
49!Iarch/x86/include/asm/unaligned.h 49!Iarch/x86/include/asm/unaligned.h
50 </sect1> 50 </sect1>
51 51
@@ -293,10 +293,23 @@ X!Idrivers/video/console/fonts.c
293 293
294 <chapter id="input_subsystem"> 294 <chapter id="input_subsystem">
295 <title>Input Subsystem</title> 295 <title>Input Subsystem</title>
296 <sect1><title>Input core</title>
296!Iinclude/linux/input.h 297!Iinclude/linux/input.h
297!Edrivers/input/input.c 298!Edrivers/input/input.c
298!Edrivers/input/ff-core.c 299!Edrivers/input/ff-core.c
299!Edrivers/input/ff-memless.c 300!Edrivers/input/ff-memless.c
301 </sect1>
302 <sect1><title>Polled input devices</title>
303!Iinclude/linux/input-polldev.h
304!Edrivers/input/input-polldev.c
305 </sect1>
306 <sect1><title>Matrix keyboars/keypads</title>
307!Iinclude/linux/input/matrix_keypad.h
308 </sect1>
309 <sect1><title>Sparse keymap support</title>
310!Iinclude/linux/input/sparse-keymap.h
311!Edrivers/input/sparse-keymap.c
312 </sect1>
300 </chapter> 313 </chapter>
301 314
302 <chapter id="spi"> 315 <chapter id="spi">
diff --git a/Documentation/DocBook/deviceiobook.tmpl b/Documentation/DocBook/deviceiobook.tmpl
index 3ed88126ab8f..c1ed6a49e598 100644
--- a/Documentation/DocBook/deviceiobook.tmpl
+++ b/Documentation/DocBook/deviceiobook.tmpl
@@ -316,7 +316,7 @@ CPU B: spin_unlock_irqrestore(&amp;dev_lock, flags)
316 316
317 <chapter id="pubfunctions"> 317 <chapter id="pubfunctions">
318 <title>Public Functions Provided</title> 318 <title>Public Functions Provided</title>
319!Iarch/x86/include/asm/io_32.h 319!Iarch/x86/include/asm/io.h
320!Elib/iomap.c 320!Elib/iomap.c
321 </chapter> 321 </chapter>
322 322
diff --git a/Documentation/DocBook/dvb/dvbapi.xml b/Documentation/DocBook/dvb/dvbapi.xml
index 4fc5b23470a3..63c528fee624 100644
--- a/Documentation/DocBook/dvb/dvbapi.xml
+++ b/Documentation/DocBook/dvb/dvbapi.xml
@@ -30,6 +30,14 @@
30<revhistory> 30<revhistory>
31<!-- Put document revisions here, newest first. --> 31<!-- Put document revisions here, newest first. -->
32<revision> 32<revision>
33 <revnumber>2.0.2</revnumber>
34 <date>2009-10-25</date>
35 <authorinitials>mcc</authorinitials>
36 <revremark>
37 documents FE_SET_FRONTEND_TUNE_MODE and FE_DISHETWORK_SEND_LEGACY_CMD ioctls.
38 </revremark>
39</revision>
40<revision>
33<revnumber>2.0.1</revnumber> 41<revnumber>2.0.1</revnumber>
34<date>2009-09-16</date> 42<date>2009-09-16</date>
35<authorinitials>mcc</authorinitials> 43<authorinitials>mcc</authorinitials>
@@ -85,3 +93,8 @@ Added ISDB-T test originally written by Patrick Boettcher
85 &sub-examples; 93 &sub-examples;
86 </chapter> 94 </chapter>
87<!-- END OF CHAPTERS --> 95<!-- END OF CHAPTERS -->
96 <appendix id="frontend_h">
97 <title>DVB Frontend Header File</title>
98 &sub-frontend-h;
99 </appendix>
100
diff --git a/Documentation/DocBook/dvb/isdbt.xml b/Documentation/DocBook/dvb/dvbproperty.xml
index 92855222fccb..5f57c7ccd4ba 100644
--- a/Documentation/DocBook/dvb/isdbt.xml
+++ b/Documentation/DocBook/dvb/dvbproperty.xml
@@ -1,3 +1,6 @@
1<section id="FE_GET_PROPERTY">
2<title>FE_GET_PROPERTY/FE_SET_PROPERTY</title>
3
1<section id="isdbt"> 4<section id="isdbt">
2 <title>ISDB-T frontend</title> 5 <title>ISDB-T frontend</title>
3 <para>This section describes shortly what are the possible parameters in the Linux 6 <para>This section describes shortly what are the possible parameters in the Linux
@@ -312,3 +315,4 @@
312 </section> 315 </section>
313 </section> 316 </section>
314</section> 317</section>
318</section>
diff --git a/Documentation/DocBook/dvb/frontend.h.xml b/Documentation/DocBook/dvb/frontend.h.xml
new file mode 100644
index 000000000000..b99644f5340a
--- /dev/null
+++ b/Documentation/DocBook/dvb/frontend.h.xml
@@ -0,0 +1,415 @@
1<programlisting>
2/*
3 * frontend.h
4 *
5 * Copyright (C) 2000 Marcus Metzler &lt;marcus@convergence.de&gt;
6 * Ralph Metzler &lt;ralph@convergence.de&gt;
7 * Holger Waechtler &lt;holger@convergence.de&gt;
8 * Andre Draszik &lt;ad@convergence.de&gt;
9 * for convergence integrated media GmbH
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
25 */
26
27#ifndef _DVBFRONTEND_H_
28#define _DVBFRONTEND_H_
29
30#include &lt;linux/types.h&gt;
31
32typedef enum fe_type {
33 FE_QPSK,
34 FE_QAM,
35 FE_OFDM,
36 FE_ATSC
37} fe_type_t;
38
39
40typedef enum fe_caps {
41 FE_IS_STUPID = 0,
42 FE_CAN_INVERSION_AUTO = 0x1,
43 FE_CAN_FEC_1_2 = 0x2,
44 FE_CAN_FEC_2_3 = 0x4,
45 FE_CAN_FEC_3_4 = 0x8,
46 FE_CAN_FEC_4_5 = 0x10,
47 FE_CAN_FEC_5_6 = 0x20,
48 FE_CAN_FEC_6_7 = 0x40,
49 FE_CAN_FEC_7_8 = 0x80,
50 FE_CAN_FEC_8_9 = 0x100,
51 FE_CAN_FEC_AUTO = 0x200,
52 FE_CAN_QPSK = 0x400,
53 FE_CAN_QAM_16 = 0x800,
54 FE_CAN_QAM_32 = 0x1000,
55 FE_CAN_QAM_64 = 0x2000,
56 FE_CAN_QAM_128 = 0x4000,
57 FE_CAN_QAM_256 = 0x8000,
58 FE_CAN_QAM_AUTO = 0x10000,
59 FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
60 FE_CAN_BANDWIDTH_AUTO = 0x40000,
61 FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
62 FE_CAN_HIERARCHY_AUTO = 0x100000,
63 FE_CAN_8VSB = 0x200000,
64 FE_CAN_16VSB = 0x400000,
65 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
66 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
67 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
68 FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */
69 FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */
70} fe_caps_t;
71
72
73struct dvb_frontend_info {
74 char name[128];
75 fe_type_t type;
76 __u32 frequency_min;
77 __u32 frequency_max;
78 __u32 frequency_stepsize;
79 __u32 frequency_tolerance;
80 __u32 symbol_rate_min;
81 __u32 symbol_rate_max;
82 __u32 symbol_rate_tolerance; /* ppm */
83 __u32 notifier_delay; /* DEPRECATED */
84 fe_caps_t caps;
85};
86
87
88/**
89 * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
90 * the meaning of this struct...
91 */
92struct dvb_diseqc_master_cmd {
93 __u8 msg [6]; /* { framing, address, command, data [3] } */
94 __u8 msg_len; /* valid values are 3...6 */
95};
96
97
98struct dvb_diseqc_slave_reply {
99 __u8 msg [4]; /* { framing, data [3] } */
100 __u8 msg_len; /* valid values are 0...4, 0 means no msg */
101 int timeout; /* return from ioctl after timeout ms with */
102}; /* errorcode when no message was received */
103
104
105typedef enum fe_sec_voltage {
106 SEC_VOLTAGE_13,
107 SEC_VOLTAGE_18,
108 SEC_VOLTAGE_OFF
109} fe_sec_voltage_t;
110
111
112typedef enum fe_sec_tone_mode {
113 SEC_TONE_ON,
114 SEC_TONE_OFF
115} fe_sec_tone_mode_t;
116
117
118typedef enum fe_sec_mini_cmd {
119 SEC_MINI_A,
120 SEC_MINI_B
121} fe_sec_mini_cmd_t;
122
123
124typedef enum fe_status {
125 FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
126 FE_HAS_CARRIER = 0x02, /* found a DVB signal */
127 FE_HAS_VITERBI = 0x04, /* FEC is stable */
128 FE_HAS_SYNC = 0x08, /* found sync bytes */
129 FE_HAS_LOCK = 0x10, /* everything's working... */
130 FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
131 FE_REINIT = 0x40 /* frontend was reinitialized, */
132} fe_status_t; /* application is recommended to reset */
133 /* DiSEqC, tone and parameters */
134
135typedef enum fe_spectral_inversion {
136 INVERSION_OFF,
137 INVERSION_ON,
138 INVERSION_AUTO
139} fe_spectral_inversion_t;
140
141
142typedef enum fe_code_rate {
143 FEC_NONE = 0,
144 FEC_1_2,
145 FEC_2_3,
146 FEC_3_4,
147 FEC_4_5,
148 FEC_5_6,
149 FEC_6_7,
150 FEC_7_8,
151 FEC_8_9,
152 FEC_AUTO,
153 FEC_3_5,
154 FEC_9_10,
155} fe_code_rate_t;
156
157
158typedef enum fe_modulation {
159 QPSK,
160 QAM_16,
161 QAM_32,
162 QAM_64,
163 QAM_128,
164 QAM_256,
165 QAM_AUTO,
166 VSB_8,
167 VSB_16,
168 PSK_8,
169 APSK_16,
170 APSK_32,
171 DQPSK,
172} fe_modulation_t;
173
174typedef enum fe_transmit_mode {
175 TRANSMISSION_MODE_2K,
176 TRANSMISSION_MODE_8K,
177 TRANSMISSION_MODE_AUTO,
178 TRANSMISSION_MODE_4K
179} fe_transmit_mode_t;
180
181typedef enum fe_bandwidth {
182 BANDWIDTH_8_MHZ,
183 BANDWIDTH_7_MHZ,
184 BANDWIDTH_6_MHZ,
185 BANDWIDTH_AUTO
186} fe_bandwidth_t;
187
188
189typedef enum fe_guard_interval {
190 GUARD_INTERVAL_1_32,
191 GUARD_INTERVAL_1_16,
192 GUARD_INTERVAL_1_8,
193 GUARD_INTERVAL_1_4,
194 GUARD_INTERVAL_AUTO
195} fe_guard_interval_t;
196
197
198typedef enum fe_hierarchy {
199 HIERARCHY_NONE,
200 HIERARCHY_1,
201 HIERARCHY_2,
202 HIERARCHY_4,
203 HIERARCHY_AUTO
204} fe_hierarchy_t;
205
206
207struct dvb_qpsk_parameters {
208 __u32 symbol_rate; /* symbol rate in Symbols per second */
209 fe_code_rate_t fec_inner; /* forward error correction (see above) */
210};
211
212struct dvb_qam_parameters {
213 __u32 symbol_rate; /* symbol rate in Symbols per second */
214 fe_code_rate_t fec_inner; /* forward error correction (see above) */
215 fe_modulation_t modulation; /* modulation type (see above) */
216};
217
218struct dvb_vsb_parameters {
219 fe_modulation_t modulation; /* modulation type (see above) */
220};
221
222struct dvb_ofdm_parameters {
223 fe_bandwidth_t bandwidth;
224 fe_code_rate_t code_rate_HP; /* high priority stream code rate */
225 fe_code_rate_t code_rate_LP; /* low priority stream code rate */
226 fe_modulation_t constellation; /* modulation type (see above) */
227 fe_transmit_mode_t transmission_mode;
228 fe_guard_interval_t guard_interval;
229 fe_hierarchy_t hierarchy_information;
230};
231
232
233struct dvb_frontend_parameters {
234 __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
235 /* intermediate frequency in kHz for QPSK */
236 fe_spectral_inversion_t inversion;
237 union {
238 struct dvb_qpsk_parameters qpsk;
239 struct dvb_qam_parameters qam;
240 struct dvb_ofdm_parameters ofdm;
241 struct dvb_vsb_parameters vsb;
242 } u;
243};
244
245
246struct dvb_frontend_event {
247 fe_status_t status;
248 struct dvb_frontend_parameters parameters;
249};
250
251/* S2API Commands */
252#define DTV_UNDEFINED 0
253#define DTV_TUNE 1
254#define DTV_CLEAR 2
255#define DTV_FREQUENCY 3
256#define DTV_MODULATION 4
257#define DTV_BANDWIDTH_HZ 5
258#define DTV_INVERSION 6
259#define DTV_DISEQC_MASTER 7
260#define DTV_SYMBOL_RATE 8
261#define DTV_INNER_FEC 9
262#define DTV_VOLTAGE 10
263#define DTV_TONE 11
264#define DTV_PILOT 12
265#define DTV_ROLLOFF 13
266#define DTV_DISEQC_SLAVE_REPLY 14
267
268/* Basic enumeration set for querying unlimited capabilities */
269#define DTV_FE_CAPABILITY_COUNT 15
270#define DTV_FE_CAPABILITY 16
271#define DTV_DELIVERY_SYSTEM 17
272
273/* ISDB-T and ISDB-Tsb */
274#define DTV_ISDBT_PARTIAL_RECEPTION 18
275#define DTV_ISDBT_SOUND_BROADCASTING 19
276
277#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
278#define DTV_ISDBT_SB_SEGMENT_IDX 21
279#define DTV_ISDBT_SB_SEGMENT_COUNT 22
280
281#define DTV_ISDBT_LAYERA_FEC 23
282#define DTV_ISDBT_LAYERA_MODULATION 24
283#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
284#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
285
286#define DTV_ISDBT_LAYERB_FEC 27
287#define DTV_ISDBT_LAYERB_MODULATION 28
288#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
289#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
290
291#define DTV_ISDBT_LAYERC_FEC 31
292#define DTV_ISDBT_LAYERC_MODULATION 32
293#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
294#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
295
296#define DTV_API_VERSION 35
297
298#define DTV_CODE_RATE_HP 36
299#define DTV_CODE_RATE_LP 37
300#define DTV_GUARD_INTERVAL 38
301#define DTV_TRANSMISSION_MODE 39
302#define DTV_HIERARCHY 40
303
304#define DTV_ISDBT_LAYER_ENABLED 41
305
306#define DTV_ISDBS_TS_ID 42
307
308#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID
309
310typedef enum fe_pilot {
311 PILOT_ON,
312 PILOT_OFF,
313 PILOT_AUTO,
314} fe_pilot_t;
315
316typedef enum fe_rolloff {
317 ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */
318 ROLLOFF_20,
319 ROLLOFF_25,
320 ROLLOFF_AUTO,
321} fe_rolloff_t;
322
323typedef enum fe_delivery_system {
324 SYS_UNDEFINED,
325 SYS_DVBC_ANNEX_AC,
326 SYS_DVBC_ANNEX_B,
327 SYS_DVBT,
328 SYS_DSS,
329 SYS_DVBS,
330 SYS_DVBS2,
331 SYS_DVBH,
332 SYS_ISDBT,
333 SYS_ISDBS,
334 SYS_ISDBC,
335 SYS_ATSC,
336 SYS_ATSCMH,
337 SYS_DMBTH,
338 SYS_CMMB,
339 SYS_DAB,
340} fe_delivery_system_t;
341
342struct dtv_cmds_h {
343 char *name; /* A display name for debugging purposes */
344
345 __u32 cmd; /* A unique ID */
346
347 /* Flags */
348 __u32 set:1; /* Either a set or get property */
349 __u32 buffer:1; /* Does this property use the buffer? */
350 __u32 reserved:30; /* Align */
351};
352
353struct dtv_property {
354 __u32 cmd;
355 __u32 reserved[3];
356 union {
357 __u32 data;
358 struct {
359 __u8 data[32];
360 __u32 len;
361 __u32 reserved1[3];
362 void *reserved2;
363 } buffer;
364 } u;
365 int result;
366} __attribute__ ((packed));
367
368/* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
369#define DTV_IOCTL_MAX_MSGS 64
370
371struct dtv_properties {
372 __u32 num;
373 struct dtv_property *props;
374};
375
376#define <link linkend="FE_GET_PROPERTY">FE_SET_PROPERTY</link> _IOW('o', 82, struct dtv_properties)
377#define <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY</link> _IOR('o', 83, struct dtv_properties)
378
379
380/**
381 * When set, this flag will disable any zigzagging or other "normal" tuning
382 * behaviour. Additionally, there will be no automatic monitoring of the lock
383 * status, and hence no frontend events will be generated. If a frontend device
384 * is closed, this flag will be automatically turned off when the device is
385 * reopened read-write.
386 */
387#define FE_TUNE_MODE_ONESHOT 0x01
388
389
390#define <link linkend="FE_GET_INFO">FE_GET_INFO</link> _IOR('o', 61, struct dvb_frontend_info)
391
392#define <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> _IO('o', 62)
393#define <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> _IOW('o', 63, struct dvb_diseqc_master_cmd)
394#define <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> _IOR('o', 64, struct dvb_diseqc_slave_reply)
395#define <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> _IO('o', 65) /* fe_sec_mini_cmd_t */
396
397#define <link linkend="FE_SET_TONE">FE_SET_TONE</link> _IO('o', 66) /* fe_sec_tone_mode_t */
398#define <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> _IO('o', 67) /* fe_sec_voltage_t */
399#define <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link> _IO('o', 68) /* int */
400
401#define <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> _IOR('o', 69, fe_status_t)
402#define <link linkend="FE_READ_BER">FE_READ_BER</link> _IOR('o', 70, __u32)
403#define <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> _IOR('o', 71, __u16)
404#define <link linkend="FE_READ_SNR">FE_READ_SNR</link> _IOR('o', 72, __u16)
405#define <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> _IOR('o', 73, __u32)
406
407#define <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> _IOW('o', 76, struct dvb_frontend_parameters)
408#define <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link> _IOR('o', 77, struct dvb_frontend_parameters)
409#define <link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link> _IO('o', 81) /* unsigned int */
410#define <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> _IOR('o', 78, struct dvb_frontend_event)
411
412#define <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link> _IO('o', 80) /* unsigned int */
413
414#endif /*_DVBFRONTEND_H_*/
415</programlisting>
diff --git a/Documentation/DocBook/dvb/frontend.xml b/Documentation/DocBook/dvb/frontend.xml
index 9d89a7b94fd5..300ba1f04177 100644
--- a/Documentation/DocBook/dvb/frontend.xml
+++ b/Documentation/DocBook/dvb/frontend.xml
@@ -73,7 +73,8 @@ a specific frontend type.</para>
73<section id="frontend_info"> 73<section id="frontend_info">
74<title>frontend information</title> 74<title>frontend information</title>
75 75
76<para>Information about the frontend ca be queried with FE_GET_INFO.</para> 76<para>Information about the frontend ca be queried with
77 <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
77 78
78<programlisting> 79<programlisting>
79 struct dvb_frontend_info { 80 struct dvb_frontend_info {
@@ -338,7 +339,7 @@ modulation mode which can be one of the following:
338<entry align="char"> 339<entry align="char">
339<para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) 340<para>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0)
340 for subsequent use. Usually the first thing to do after a successful open is to 341 for subsequent use. Usually the first thing to do after a successful open is to
341 find out the frontend type with FE_GET_INFO.</para> 342 find out the frontend type with <link linkend="FE_GET_INFO">FE_GET_INFO</link>.</para>
342<para>The device can be opened in read-only mode, which only allows monitoring of 343<para>The device can be opened in read-only mode, which only allows monitoring of
343 device status and statistics, or read/write mode, which allows any kind of use 344 device status and statistics, or read/write mode, which allows any kind of use
344 (e.g. performing tuning operations.) 345 (e.g. performing tuning operations.)
@@ -478,7 +479,7 @@ modulation mode which can be one of the following:
478 </row></tbody></tgroup></informaltable> 479 </row></tbody></tgroup></informaltable>
479</section> 480</section>
480 481
481<section id="frontend_read_status"> 482<section id="FE_READ_STATUS">
482<title>FE_READ_STATUS</title> 483<title>FE_READ_STATUS</title>
483<para>DESCRIPTION 484<para>DESCRIPTION
484</para> 485</para>
@@ -492,7 +493,7 @@ modulation mode which can be one of the following:
492</para> 493</para>
493<informaltable><tgroup cols="1"><tbody><row><entry 494<informaltable><tgroup cols="1"><tbody><row><entry
494 align="char"> 495 align="char">
495<para>int ioctl(int fd, int request = FE_READ_STATUS, 496<para>int ioctl(int fd, int request = <link linkend="FE_READ_STATUS">FE_READ_STATUS</link>,
496 fe_status_t &#x22C6;status);</para> 497 fe_status_t &#x22C6;status);</para>
497</entry> 498</entry>
498 </row></tbody></tgroup></informaltable> 499 </row></tbody></tgroup></informaltable>
@@ -511,7 +512,7 @@ modulation mode which can be one of the following:
511<para>int request</para> 512<para>int request</para>
512</entry><entry 513</entry><entry
513 align="char"> 514 align="char">
514<para>Equals FE_READ_STATUS for this command.</para> 515<para>Equals <link linkend="FE_READ_STATUS">FE_READ_STATUS</link> for this command.</para>
515</entry> 516</entry>
516 </row><row><entry 517 </row><row><entry
517 align="char"> 518 align="char">
@@ -542,7 +543,7 @@ modulation mode which can be one of the following:
542 </row></tbody></tgroup></informaltable> 543 </row></tbody></tgroup></informaltable>
543</section> 544</section>
544 545
545<section id="frontend_read_ber"> 546<section id="FE_READ_BER">
546<title>FE_READ_BER</title> 547<title>FE_READ_BER</title>
547<para>DESCRIPTION 548<para>DESCRIPTION
548</para> 549</para>
@@ -557,7 +558,7 @@ modulation mode which can be one of the following:
557</para> 558</para>
558<informaltable><tgroup cols="1"><tbody><row><entry 559<informaltable><tgroup cols="1"><tbody><row><entry
559 align="char"> 560 align="char">
560<para>int ioctl(int fd, int request = FE_READ_BER, 561<para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
561 uint32_t &#x22C6;ber);</para> 562 uint32_t &#x22C6;ber);</para>
562</entry> 563</entry>
563 </row></tbody></tgroup></informaltable> 564 </row></tbody></tgroup></informaltable>
@@ -575,7 +576,7 @@ modulation mode which can be one of the following:
575<para>int request</para> 576<para>int request</para>
576</entry><entry 577</entry><entry
577 align="char"> 578 align="char">
578<para>Equals FE_READ_BER for this command.</para> 579<para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
579</entry> 580</entry>
580 </row><row><entry 581 </row><row><entry
581 align="char"> 582 align="char">
@@ -619,7 +620,7 @@ modulation mode which can be one of the following:
619 </row></tbody></tgroup></informaltable> 620 </row></tbody></tgroup></informaltable>
620</section> 621</section>
621 622
622<section id="frontend_read_snr"> 623<section id="FE_READ_SNR">
623<title>FE_READ_SNR</title> 624<title>FE_READ_SNR</title>
624 625
625<para>DESCRIPTION 626<para>DESCRIPTION
@@ -634,7 +635,7 @@ modulation mode which can be one of the following:
634</para> 635</para>
635<informaltable><tgroup cols="1"><tbody><row><entry 636<informaltable><tgroup cols="1"><tbody><row><entry
636 align="char"> 637 align="char">
637<para>int ioctl(int fd, int request = FE_READ_SNR, int16_t 638<para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, int16_t
638 &#x22C6;snr);</para> 639 &#x22C6;snr);</para>
639</entry> 640</entry>
640 </row></tbody></tgroup></informaltable> 641 </row></tbody></tgroup></informaltable>
@@ -652,7 +653,7 @@ modulation mode which can be one of the following:
652<para>int request</para> 653<para>int request</para>
653</entry><entry 654</entry><entry
654 align="char"> 655 align="char">
655<para>Equals FE_READ_SNR for this command.</para> 656<para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
656</entry> 657</entry>
657 </row><row><entry 658 </row><row><entry
658 align="char"> 659 align="char">
@@ -697,7 +698,7 @@ modulation mode which can be one of the following:
697 </row></tbody></tgroup></informaltable> 698 </row></tbody></tgroup></informaltable>
698</section> 699</section>
699 700
700<section id="frontend_read_signal_strength"> 701<section id="FE_READ_SIGNAL_STRENGTH">
701<title>FE_READ_SIGNAL_STRENGTH</title> 702<title>FE_READ_SIGNAL_STRENGTH</title>
702<para>DESCRIPTION 703<para>DESCRIPTION
703</para> 704</para>
@@ -712,7 +713,7 @@ modulation mode which can be one of the following:
712<informaltable><tgroup cols="1"><tbody><row><entry 713<informaltable><tgroup cols="1"><tbody><row><entry
713 align="char"> 714 align="char">
714<para>int ioctl( int fd, int request = 715<para>int ioctl( int fd, int request =
715 FE_READ_SIGNAL_STRENGTH, int16_t &#x22C6;strength);</para> 716 <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, int16_t &#x22C6;strength);</para>
716</entry> 717</entry>
717 </row></tbody></tgroup></informaltable> 718 </row></tbody></tgroup></informaltable>
718 719
@@ -730,7 +731,7 @@ modulation mode which can be one of the following:
730<para>int request</para> 731<para>int request</para>
731</entry><entry 732</entry><entry
732 align="char"> 733 align="char">
733<para>Equals FE_READ_SIGNAL_STRENGTH for this 734<para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
734 command.</para> 735 command.</para>
735</entry> 736</entry>
736 </row><row><entry 737 </row><row><entry
@@ -775,7 +776,7 @@ modulation mode which can be one of the following:
775 </row></tbody></tgroup></informaltable> 776 </row></tbody></tgroup></informaltable>
776</section> 777</section>
777 778
778<section id="frontend_read_ub"> 779<section id="FE_READ_UNCORRECTED_BLOCKS">
779<title>FE_READ_UNCORRECTED_BLOCKS</title> 780<title>FE_READ_UNCORRECTED_BLOCKS</title>
780<para>DESCRIPTION 781<para>DESCRIPTION
781</para> 782</para>
@@ -797,7 +798,7 @@ modulation mode which can be one of the following:
797<informaltable><tgroup cols="1"><tbody><row><entry 798<informaltable><tgroup cols="1"><tbody><row><entry
798 align="char"> 799 align="char">
799<para>int ioctl( int fd, int request = 800<para>int ioctl( int fd, int request =
800 FE_READ_UNCORRECTED_BLOCKS, uint32_t &#x22C6;ublocks);</para> 801 <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t &#x22C6;ublocks);</para>
801</entry> 802</entry>
802 </row></tbody></tgroup></informaltable> 803 </row></tbody></tgroup></informaltable>
803<para>PARAMETERS 804<para>PARAMETERS
@@ -814,7 +815,7 @@ modulation mode which can be one of the following:
814<para>int request</para> 815<para>int request</para>
815</entry><entry 816</entry><entry
816 align="char"> 817 align="char">
817<para>Equals FE_READ_UNCORRECTED_BLOCKS for this 818<para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
818 command.</para> 819 command.</para>
819</entry> 820</entry>
820 </row><row><entry 821 </row><row><entry
@@ -852,7 +853,7 @@ modulation mode which can be one of the following:
852 </row></tbody></tgroup></informaltable> 853 </row></tbody></tgroup></informaltable>
853</section> 854</section>
854 855
855<section id="frontend_set_fe"> 856<section id="FE_SET_FRONTEND">
856<title>FE_SET_FRONTEND</title> 857<title>FE_SET_FRONTEND</title>
857<para>DESCRIPTION 858<para>DESCRIPTION
858</para> 859</para>
@@ -861,8 +862,8 @@ modulation mode which can be one of the following:
861<para>This ioctl call starts a tuning operation using specified parameters. The result 862<para>This ioctl call starts a tuning operation using specified parameters. The result
862 of this call will be successful if the parameters were valid and the tuning could 863 of this call will be successful if the parameters were valid and the tuning could
863 be initiated. The result of the tuning operation in itself, however, will arrive 864 be initiated. The result of the tuning operation in itself, however, will arrive
864 asynchronously as an event (see documentation for FE_GET_EVENT and 865 asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
865 FrontendEvent.) If a new FE_SET_FRONTEND operation is initiated before 866 FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
866 the previous one was completed, the previous operation will be aborted in favor 867 the previous one was completed, the previous operation will be aborted in favor
867 of the new one. This command requires read/write access to the device.</para> 868 of the new one. This command requires read/write access to the device.</para>
868</entry> 869</entry>
@@ -872,7 +873,7 @@ modulation mode which can be one of the following:
872</para> 873</para>
873<informaltable><tgroup cols="1"><tbody><row><entry 874<informaltable><tgroup cols="1"><tbody><row><entry
874 align="char"> 875 align="char">
875<para>int ioctl(int fd, int request = FE_SET_FRONTEND, 876<para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
876 struct dvb_frontend_parameters &#x22C6;p);</para> 877 struct dvb_frontend_parameters &#x22C6;p);</para>
877</entry> 878</entry>
878 </row></tbody></tgroup></informaltable> 879 </row></tbody></tgroup></informaltable>
@@ -890,7 +891,7 @@ modulation mode which can be one of the following:
890<para>int request</para> 891<para>int request</para>
891</entry><entry 892</entry><entry
892 align="char"> 893 align="char">
893<para>Equals FE_SET_FRONTEND for this command.</para> 894<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
894</entry> 895</entry>
895 </row><row><entry 896 </row><row><entry
896 align="char"> 897 align="char">
@@ -928,7 +929,7 @@ modulation mode which can be one of the following:
928</row></tbody></tgroup></informaltable> 929</row></tbody></tgroup></informaltable>
929</section> 930</section>
930 931
931<section id="frontend_get_fe"> 932<section id="FE_GET_FRONTEND">
932<title>FE_GET_FRONTEND</title> 933<title>FE_GET_FRONTEND</title>
933<para>DESCRIPTION 934<para>DESCRIPTION
934</para> 935</para>
@@ -943,7 +944,7 @@ modulation mode which can be one of the following:
943</para> 944</para>
944<informaltable><tgroup cols="1"><tbody><row><entry 945<informaltable><tgroup cols="1"><tbody><row><entry
945 align="char"> 946 align="char">
946<para>int ioctl(int fd, int request = FE_GET_FRONTEND, 947<para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
947 struct dvb_frontend_parameters &#x22C6;p);</para> 948 struct dvb_frontend_parameters &#x22C6;p);</para>
948</entry> 949</entry>
949 </row></tbody></tgroup></informaltable> 950 </row></tbody></tgroup></informaltable>
@@ -962,7 +963,7 @@ modulation mode which can be one of the following:
962<para>int request</para> 963<para>int request</para>
963</entry><entry 964</entry><entry
964 align="char"> 965 align="char">
965<para>Equals FE_SET_FRONTEND for this command.</para> 966<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
966</entry> 967</entry>
967 </row><row><entry 968 </row><row><entry
968 align="char"> 969 align="char">
@@ -1003,7 +1004,7 @@ modulation mode which can be one of the following:
1003 1004
1004</section> 1005</section>
1005 1006
1006<section id="frontend_get_event"> 1007<section id="FE_GET_EVENT">
1007<title>FE_GET_EVENT</title> 1008<title>FE_GET_EVENT</title>
1008<para>DESCRIPTION 1009<para>DESCRIPTION
1009</para> 1010</para>
@@ -1024,7 +1025,8 @@ modulation mode which can be one of the following:
1024 rather small (room for 8 events), the queue must be serviced regularly to avoid 1025 rather small (room for 8 events), the queue must be serviced regularly to avoid
1025 overflow. If an overflow happens, the oldest event is discarded from the queue, 1026 overflow. If an overflow happens, the oldest event is discarded from the queue,
1026 and an error (EOVERFLOW) occurs the next time the queue is read. After 1027 and an error (EOVERFLOW) occurs the next time the queue is read. After
1027 reporting the error condition in this fashion, subsequent FE_GET_EVENT 1028 reporting the error condition in this fashion, subsequent
1029 <link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
1028 calls will return events from the queue as usual.</para> 1030 calls will return events from the queue as usual.</para>
1029</entry> 1031</entry>
1030 </row><row><entry 1032 </row><row><entry
@@ -1057,7 +1059,7 @@ modulation mode which can be one of the following:
1057<para>int request</para> 1059<para>int request</para>
1058</entry><entry 1060</entry><entry
1059 align="char"> 1061 align="char">
1060<para>Equals FE_GET_EVENT for this command.</para> 1062<para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
1061</entry> 1063</entry>
1062 </row><row><entry 1064 </row><row><entry
1063 align="char"> 1065 align="char">
@@ -1115,7 +1117,7 @@ modulation mode which can be one of the following:
1115</row></tbody></tgroup></informaltable> 1117</row></tbody></tgroup></informaltable>
1116</section> 1118</section>
1117 1119
1118<section id="frontend_get_info"> 1120<section id="FE_GET_INFO">
1119<title>FE_GET_INFO</title> 1121<title>FE_GET_INFO</title>
1120<para>DESCRIPTION 1122<para>DESCRIPTION
1121</para> 1123</para>
@@ -1130,7 +1132,7 @@ modulation mode which can be one of the following:
1130 1132
1131<informaltable><tgroup cols="1"><tbody><row><entry 1133<informaltable><tgroup cols="1"><tbody><row><entry
1132 align="char"> 1134 align="char">
1133<para> int ioctl(int fd, int request = FE_GET_INFO, struct 1135<para> int ioctl(int fd, int request = <link linkend="FE_GET_INFO">FE_GET_INFO</link>, struct
1134 dvb_frontend_info &#x22C6;info);</para> 1136 dvb_frontend_info &#x22C6;info);</para>
1135</entry> 1137</entry>
1136 </row></tbody></tgroup></informaltable> 1138 </row></tbody></tgroup></informaltable>
@@ -1149,7 +1151,7 @@ modulation mode which can be one of the following:
1149<para>int request</para> 1151<para>int request</para>
1150</entry><entry 1152</entry><entry
1151 align="char"> 1153 align="char">
1152<para>Equals FE_GET_INFO for this command.</para> 1154<para>Equals <link linkend="FE_GET_INFO">FE_GET_INFO</link> for this command.</para>
1153</entry> 1155</entry>
1154 </row><row><entry 1156 </row><row><entry
1155 align="char"> 1157 align="char">
@@ -1181,7 +1183,7 @@ modulation mode which can be one of the following:
1181</row></tbody></tgroup></informaltable> 1183</row></tbody></tgroup></informaltable>
1182</section> 1184</section>
1183 1185
1184<section id="frontend_diseqc_reset_overload"> 1186<section id="FE_DISEQC_RESET_OVERLOAD">
1185<title>FE_DISEQC_RESET_OVERLOAD</title> 1187<title>FE_DISEQC_RESET_OVERLOAD</title>
1186<para>DESCRIPTION 1188<para>DESCRIPTION
1187</para> 1189</para>
@@ -1199,7 +1201,7 @@ modulation mode which can be one of the following:
1199<informaltable><tgroup cols="1"><tbody><row><entry 1201<informaltable><tgroup cols="1"><tbody><row><entry
1200 align="char"> 1202 align="char">
1201<para>int ioctl(int fd, int request = 1203<para>int ioctl(int fd, int request =
1202 FE_DISEQC_RESET_OVERLOAD);</para> 1204 <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link>);</para>
1203</entry> 1205</entry>
1204 </row></tbody></tgroup></informaltable> 1206 </row></tbody></tgroup></informaltable>
1205<para>PARAMETERS 1207<para>PARAMETERS
@@ -1216,7 +1218,7 @@ modulation mode which can be one of the following:
1216<para>int request</para> 1218<para>int request</para>
1217</entry><entry 1219</entry><entry
1218 align="char"> 1220 align="char">
1219<para>Equals FE_DISEQC_RESET_OVERLOAD for this 1221<para>Equals <link linkend="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</link> for this
1220 command.</para> 1222 command.</para>
1221</entry> 1223</entry>
1222 </row></tbody></tgroup></informaltable> 1224 </row></tbody></tgroup></informaltable>
@@ -1247,7 +1249,7 @@ modulation mode which can be one of the following:
1247</row></tbody></tgroup></informaltable> 1249</row></tbody></tgroup></informaltable>
1248</section> 1250</section>
1249 1251
1250<section id="frontend_diseqc_send_master_cmd"> 1252<section id="FE_DISEQC_SEND_MASTER_CMD">
1251<title>FE_DISEQC_SEND_MASTER_CMD</title> 1253<title>FE_DISEQC_SEND_MASTER_CMD</title>
1252<para>DESCRIPTION 1254<para>DESCRIPTION
1253</para> 1255</para>
@@ -1261,7 +1263,7 @@ modulation mode which can be one of the following:
1261<informaltable><tgroup cols="1"><tbody><row><entry 1263<informaltable><tgroup cols="1"><tbody><row><entry
1262 align="char"> 1264 align="char">
1263<para>int ioctl(int fd, int request = 1265<para>int ioctl(int fd, int request =
1264 FE_DISEQC_SEND_MASTER_CMD, struct 1266 <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link>, struct
1265 dvb_diseqc_master_cmd &#x22C6;cmd);</para> 1267 dvb_diseqc_master_cmd &#x22C6;cmd);</para>
1266</entry> 1268</entry>
1267 </row></tbody></tgroup></informaltable> 1269 </row></tbody></tgroup></informaltable>
@@ -1280,7 +1282,7 @@ modulation mode which can be one of the following:
1280<para>int request</para> 1282<para>int request</para>
1281</entry><entry 1283</entry><entry
1282 align="char"> 1284 align="char">
1283<para>Equals FE_DISEQC_SEND_MASTER_CMD for this 1285<para>Equals <link linkend="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</link> for this
1284 command.</para> 1286 command.</para>
1285</entry> 1287</entry>
1286 </row><row><entry 1288 </row><row><entry
@@ -1335,7 +1337,7 @@ modulation mode which can be one of the following:
1335</row></tbody></tgroup></informaltable> 1337</row></tbody></tgroup></informaltable>
1336</section> 1338</section>
1337 1339
1338<section id="frontend_diseqc_recv_slave_reply"> 1340<section id="FE_DISEQC_RECV_SLAVE_REPLY">
1339<title>FE_DISEQC_RECV_SLAVE_REPLY</title> 1341<title>FE_DISEQC_RECV_SLAVE_REPLY</title>
1340<para>DESCRIPTION 1342<para>DESCRIPTION
1341</para> 1343</para>
@@ -1350,7 +1352,7 @@ modulation mode which can be one of the following:
1350<informaltable><tgroup cols="1"><tbody><row><entry 1352<informaltable><tgroup cols="1"><tbody><row><entry
1351 align="char"> 1353 align="char">
1352<para>int ioctl(int fd, int request = 1354<para>int ioctl(int fd, int request =
1353 FE_DISEQC_RECV_SLAVE_REPLY, struct 1355 <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link>, struct
1354 dvb_diseqc_slave_reply &#x22C6;reply);</para> 1356 dvb_diseqc_slave_reply &#x22C6;reply);</para>
1355</entry> 1357</entry>
1356 </row></tbody></tgroup></informaltable> 1358 </row></tbody></tgroup></informaltable>
@@ -1369,7 +1371,7 @@ modulation mode which can be one of the following:
1369<para>int request</para> 1371<para>int request</para>
1370</entry><entry 1372</entry><entry
1371 align="char"> 1373 align="char">
1372<para>Equals FE_DISEQC_RECV_SLAVE_REPLY for this 1374<para>Equals <link linkend="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</link> for this
1373 command.</para> 1375 command.</para>
1374</entry> 1376</entry>
1375 </row><row><entry 1377 </row><row><entry
@@ -1423,7 +1425,7 @@ modulation mode which can be one of the following:
1423 </row></tbody></tgroup></informaltable> 1425 </row></tbody></tgroup></informaltable>
1424</section> 1426</section>
1425 1427
1426<section id="frontend_diseqc_send_burst"> 1428<section id="FE_DISEQC_SEND_BURST">
1427<title>FE_DISEQC_SEND_BURST</title> 1429<title>FE_DISEQC_SEND_BURST</title>
1428<para>DESCRIPTION 1430<para>DESCRIPTION
1429</para> 1431</para>
@@ -1438,7 +1440,7 @@ modulation mode which can be one of the following:
1438<informaltable><tgroup cols="1"><tbody><row><entry 1440<informaltable><tgroup cols="1"><tbody><row><entry
1439 align="char"> 1441 align="char">
1440<para>int ioctl(int fd, int request = 1442<para>int ioctl(int fd, int request =
1441 FE_DISEQC_SEND_BURST, fe_sec_mini_cmd_t burst);</para> 1443 <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link>, fe_sec_mini_cmd_t burst);</para>
1442</entry> 1444</entry>
1443 </row></tbody></tgroup></informaltable> 1445 </row></tbody></tgroup></informaltable>
1444 1446
@@ -1456,7 +1458,7 @@ modulation mode which can be one of the following:
1456<para>int request</para> 1458<para>int request</para>
1457</entry><entry 1459</entry><entry
1458 align="char"> 1460 align="char">
1459<para>Equals FE_DISEQC_SEND_BURST for this command.</para> 1461<para>Equals <link linkend="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</link> for this command.</para>
1460</entry> 1462</entry>
1461 </row><row><entry 1463 </row><row><entry
1462 align="char"> 1464 align="char">
@@ -1509,7 +1511,7 @@ modulation mode which can be one of the following:
1509</row></tbody></tgroup></informaltable> 1511</row></tbody></tgroup></informaltable>
1510</section> 1512</section>
1511 1513
1512<section id="frontend_set_tone"> 1514<section id="FE_SET_TONE">
1513<title>FE_SET_TONE</title> 1515<title>FE_SET_TONE</title>
1514<para>DESCRIPTION 1516<para>DESCRIPTION
1515</para> 1517</para>
@@ -1523,7 +1525,7 @@ modulation mode which can be one of the following:
1523</para> 1525</para>
1524<informaltable><tgroup cols="1"><tbody><row><entry 1526<informaltable><tgroup cols="1"><tbody><row><entry
1525 align="char"> 1527 align="char">
1526<para>int ioctl(int fd, int request = FE_SET_TONE, 1528<para>int ioctl(int fd, int request = <link linkend="FE_SET_TONE">FE_SET_TONE</link>,
1527 fe_sec_tone_mode_t tone);</para> 1529 fe_sec_tone_mode_t tone);</para>
1528</entry> 1530</entry>
1529 </row></tbody></tgroup></informaltable> 1531 </row></tbody></tgroup></informaltable>
@@ -1541,7 +1543,7 @@ modulation mode which can be one of the following:
1541<para>int request</para> 1543<para>int request</para>
1542</entry><entry 1544</entry><entry
1543 align="char"> 1545 align="char">
1544<para>Equals FE_SET_TONE for this command.</para> 1546<para>Equals <link linkend="FE_SET_TONE">FE_SET_TONE</link> for this command.</para>
1545</entry> 1547</entry>
1546 </row><row><entry 1548 </row><row><entry
1547 align="char"> 1549 align="char">
@@ -1592,7 +1594,7 @@ modulation mode which can be one of the following:
1592</row></tbody></tgroup></informaltable> 1594</row></tbody></tgroup></informaltable>
1593</section> 1595</section>
1594 1596
1595<section id="fe_set_voltage"> 1597<section id="FE_SET_VOLTAGE">
1596<title>FE_SET_VOLTAGE</title> 1598<title>FE_SET_VOLTAGE</title>
1597<para>DESCRIPTION 1599<para>DESCRIPTION
1598</para> 1600</para>
@@ -1606,7 +1608,7 @@ modulation mode which can be one of the following:
1606</para> 1608</para>
1607<informaltable><tgroup cols="1"><tbody><row><entry 1609<informaltable><tgroup cols="1"><tbody><row><entry
1608 align="char"> 1610 align="char">
1609<para>int ioctl(int fd, int request = FE_SET_VOLTAGE, 1611<para>int ioctl(int fd, int request = <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link>,
1610 fe_sec_voltage_t voltage);</para> 1612 fe_sec_voltage_t voltage);</para>
1611</entry> 1613</entry>
1612 </row></tbody></tgroup></informaltable> 1614 </row></tbody></tgroup></informaltable>
@@ -1625,7 +1627,7 @@ modulation mode which can be one of the following:
1625<para>int request</para> 1627<para>int request</para>
1626</entry><entry 1628</entry><entry
1627 align="char"> 1629 align="char">
1628<para>Equals FE_SET_VOLTAGE for this command.</para> 1630<para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1629</entry> 1631</entry>
1630 </row><row><entry 1632 </row><row><entry
1631 align="char"> 1633 align="char">
@@ -1677,7 +1679,7 @@ modulation mode which can be one of the following:
1677 </row></tbody></tgroup></informaltable> 1679 </row></tbody></tgroup></informaltable>
1678</section> 1680</section>
1679 1681
1680<section id="frontend_enable_high_lnb_volt"> 1682<section id="FE_ENABLE_HIGH_LNB_VOLTAGE">
1681<title>FE_ENABLE_HIGH_LNB_VOLTAGE</title> 1683<title>FE_ENABLE_HIGH_LNB_VOLTAGE</title>
1682<para>DESCRIPTION 1684<para>DESCRIPTION
1683</para> 1685</para>
@@ -1694,7 +1696,7 @@ modulation mode which can be one of the following:
1694<informaltable><tgroup cols="1"><tbody><row><entry 1696<informaltable><tgroup cols="1"><tbody><row><entry
1695 align="char"> 1697 align="char">
1696<para>int ioctl(int fd, int request = 1698<para>int ioctl(int fd, int request =
1697 FE_ENABLE_HIGH_LNB_VOLTAGE, int high);</para> 1699 <link linkend="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</link>, int high);</para>
1698</entry> 1700</entry>
1699 </row></tbody></tgroup></informaltable> 1701 </row></tbody></tgroup></informaltable>
1700 1702
@@ -1712,7 +1714,7 @@ modulation mode which can be one of the following:
1712<para>int request</para> 1714<para>int request</para>
1713</entry><entry 1715</entry><entry
1714 align="char"> 1716 align="char">
1715<para>Equals FE_SET_VOLTAGE for this command.</para> 1717<para>Equals <link linkend="FE_SET_VOLTAGE">FE_SET_VOLTAGE</link> for this command.</para>
1716</entry> 1718</entry>
1717 </row><row><entry 1719 </row><row><entry
1718 align="char"> 1720 align="char">
@@ -1762,5 +1764,82 @@ modulation mode which can be one of the following:
1762</entry> 1764</entry>
1763 </row></tbody></tgroup></informaltable> 1765 </row></tbody></tgroup></informaltable>
1764</section> 1766</section>
1767
1768<section id="FE_SET_FRONTEND_TUNE_MODE">
1769<title>FE_SET_FRONTEND_TUNE_MODE</title>
1770<para>DESCRIPTION</para>
1771<informaltable><tgroup cols="1"><tbody><row>
1772<entry align="char">
1773<para>Allow setting tuner mode flags to the frontend.</para>
1774</entry>
1775</row></tbody></tgroup></informaltable>
1776
1777<para>SYNOPSIS</para>
1778<informaltable><tgroup cols="1"><tbody><row>
1779<entry align="char">
1780<para>int ioctl(int fd, int request =
1781<link linkend="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</link>, unsigned int flags);</para>
1782</entry>
1783</row></tbody></tgroup></informaltable>
1784
1785<para>PARAMETERS</para>
1786<informaltable><tgroup cols="2"><tbody><row>
1787<entry align="char">
1788 <para>unsigned int flags</para>
1789</entry>
1790<entry align="char">
1791<para>
1792FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write.
1793</para>
1794</entry>
1795 </row></tbody></tgroup></informaltable>
1796
1797<para>ERRORS</para>
1798<informaltable><tgroup cols="2"><tbody><row>
1799<entry align="char"><para>EINVAL</para></entry>
1800<entry align="char"><para>Invalid argument.</para></entry>
1801 </row></tbody></tgroup></informaltable>
1765</section> 1802</section>
1766&sub-isdbt; 1803
1804<section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
1805 <title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
1806<para>DESCRIPTION</para>
1807<informaltable><tgroup cols="1"><tbody><row>
1808<entry align="char">
1809<para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
1810<para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
1811<para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
1812</entry>
1813</row></tbody></tgroup></informaltable>
1814
1815<para>SYNOPSIS</para>
1816<informaltable><tgroup cols="1"><tbody><row>
1817<entry align="char">
1818<para>int ioctl(int fd, int request =
1819 <link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
1820</entry>
1821</row></tbody></tgroup></informaltable>
1822
1823<para>PARAMETERS</para>
1824<informaltable><tgroup cols="2"><tbody><row>
1825<entry align="char">
1826 <para>unsigned long cmd</para>
1827</entry>
1828<entry align="char">
1829<para>
1830sends the specified raw cmd to the dish via DISEqC.
1831</para>
1832</entry>
1833 </row></tbody></tgroup></informaltable>
1834
1835<para>ERRORS</para>
1836<informaltable><tgroup cols="1"><tbody><row>
1837<entry align="char">
1838 <para>There are no errors in use for this call</para>
1839</entry>
1840</row></tbody></tgroup></informaltable>
1841</section>
1842
1843</section>
1844
1845&sub-dvbproperty;
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl
index c671a0168096..1448b33fd222 100644
--- a/Documentation/DocBook/genericirq.tmpl
+++ b/Documentation/DocBook/genericirq.tmpl
@@ -417,8 +417,8 @@ desc->chip->end();
417 </para> 417 </para>
418 <para> 418 <para>
419 To make use of the split implementation, replace the call to 419 To make use of the split implementation, replace the call to
420 __do_IRQ by a call to desc->chip->handle_irq() and associate 420 __do_IRQ by a call to desc->handle_irq() and associate
421 the appropriate handler function to desc->chip->handle_irq(). 421 the appropriate handler function to desc->handle_irq().
422 In most cases the generic handler implementations should 422 In most cases the generic handler implementations should
423 be sufficient. 423 be sufficient.
424 </para> 424 </para>
diff --git a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
index 992e67e6be7f..7b3f49363413 100644
--- a/Documentation/DocBook/kernel-hacking.tmpl
+++ b/Documentation/DocBook/kernel-hacking.tmpl
@@ -352,7 +352,7 @@ asmlinkage long sys_mycall(int arg)
352 </para> 352 </para>
353 353
354 <programlisting> 354 <programlisting>
355if (signal_pending()) 355if (signal_pending(current))
356 return -ERESTARTSYS; 356 return -ERESTARTSYS;
357 </programlisting> 357 </programlisting>
358 358
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl
index f3f37f141dbd..affb15a344a1 100644
--- a/Documentation/DocBook/mac80211.tmpl
+++ b/Documentation/DocBook/mac80211.tmpl
@@ -144,7 +144,7 @@ usage should require reading the full document.
144 this though and the recommendation to allow only a single 144 this though and the recommendation to allow only a single
145 interface in STA mode at first! 145 interface in STA mode at first!
146 </para> 146 </para>
147!Finclude/net/mac80211.h ieee80211_if_init_conf 147!Finclude/net/mac80211.h ieee80211_vif
148 </chapter> 148 </chapter>
149 149
150 <chapter id="rx-tx"> 150 <chapter id="rx-tx">
@@ -234,7 +234,6 @@ usage should require reading the full document.
234 <title>Multiple queues and QoS support</title> 234 <title>Multiple queues and QoS support</title>
235 <para>TBD</para> 235 <para>TBD</para>
236!Finclude/net/mac80211.h ieee80211_tx_queue_params 236!Finclude/net/mac80211.h ieee80211_tx_queue_params
237!Finclude/net/mac80211.h ieee80211_tx_queue_stats
238 </chapter> 237 </chapter>
239 238
240 <chapter id="AP"> 239 <chapter id="AP">
diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl
index 0eb43c1970bb..c725cb852c54 100644
--- a/Documentation/DocBook/media-entities.tmpl
+++ b/Documentation/DocBook/media-entities.tmpl
@@ -23,6 +23,7 @@
23<!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>"> 23<!ENTITY VIDIOC-ENUMINPUT "<link linkend='vidioc-enuminput'><constant>VIDIOC_ENUMINPUT</constant></link>">
24<!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>"> 24<!ENTITY VIDIOC-ENUMOUTPUT "<link linkend='vidioc-enumoutput'><constant>VIDIOC_ENUMOUTPUT</constant></link>">
25<!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>"> 25<!ENTITY VIDIOC-ENUMSTD "<link linkend='vidioc-enumstd'><constant>VIDIOC_ENUMSTD</constant></link>">
26<!ENTITY VIDIOC-ENUM-DV-PRESETS "<link linkend='vidioc-enum-dv-presets'><constant>VIDIOC_ENUM_DV_PRESETS</constant></link>">
26<!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>"> 27<!ENTITY VIDIOC-ENUM-FMT "<link linkend='vidioc-enum-fmt'><constant>VIDIOC_ENUM_FMT</constant></link>">
27<!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>"> 28<!ENTITY VIDIOC-ENUM-FRAMEINTERVALS "<link linkend='vidioc-enum-frameintervals'><constant>VIDIOC_ENUM_FRAMEINTERVALS</constant></link>">
28<!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>"> 29<!ENTITY VIDIOC-ENUM-FRAMESIZES "<link linkend='vidioc-enum-framesizes'><constant>VIDIOC_ENUM_FRAMESIZES</constant></link>">
@@ -30,6 +31,8 @@
30<!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>"> 31<!ENTITY VIDIOC-G-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_G_AUDOUT</constant></link>">
31<!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>"> 32<!ENTITY VIDIOC-G-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_G_CROP</constant></link>">
32<!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>"> 33<!ENTITY VIDIOC-G-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_G_CTRL</constant></link>">
34<!ENTITY VIDIOC-G-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_G_DV_PRESET</constant></link>">
35<!ENTITY VIDIOC-G-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_G_DV_TIMINGS</constant></link>">
33<!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>"> 36<!ENTITY VIDIOC-G-ENC-INDEX "<link linkend='vidioc-g-enc-index'><constant>VIDIOC_G_ENC_INDEX</constant></link>">
34<!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>"> 37<!ENTITY VIDIOC-G-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_G_EXT_CTRLS</constant></link>">
35<!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>"> 38<!ENTITY VIDIOC-G-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_G_FBUF</constant></link>">
@@ -53,6 +56,7 @@
53<!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>"> 56<!ENTITY VIDIOC-QUERYCTRL "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYCTRL</constant></link>">
54<!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>"> 57<!ENTITY VIDIOC-QUERYMENU "<link linkend='vidioc-queryctrl'><constant>VIDIOC_QUERYMENU</constant></link>">
55<!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>"> 58<!ENTITY VIDIOC-QUERYSTD "<link linkend='vidioc-querystd'><constant>VIDIOC_QUERYSTD</constant></link>">
59<!ENTITY VIDIOC-QUERY-DV-PRESET "<link linkend='vidioc-query-dv-preset'><constant>VIDIOC_QUERY_DV_PRESET</constant></link>">
56<!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>"> 60<!ENTITY VIDIOC-REQBUFS "<link linkend='vidioc-reqbufs'><constant>VIDIOC_REQBUFS</constant></link>">
57<!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>"> 61<!ENTITY VIDIOC-STREAMOFF "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMOFF</constant></link>">
58<!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>"> 62<!ENTITY VIDIOC-STREAMON "<link linkend='vidioc-streamon'><constant>VIDIOC_STREAMON</constant></link>">
@@ -60,6 +64,8 @@
60<!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>"> 64<!ENTITY VIDIOC-S-AUDOUT "<link linkend='vidioc-g-audioout'><constant>VIDIOC_S_AUDOUT</constant></link>">
61<!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>"> 65<!ENTITY VIDIOC-S-CROP "<link linkend='vidioc-g-crop'><constant>VIDIOC_S_CROP</constant></link>">
62<!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>"> 66<!ENTITY VIDIOC-S-CTRL "<link linkend='vidioc-g-ctrl'><constant>VIDIOC_S_CTRL</constant></link>">
67<!ENTITY VIDIOC-S-DV-PRESET "<link linkend='vidioc-g-dv-preset'><constant>VIDIOC_S_DV_PRESET</constant></link>">
68<!ENTITY VIDIOC-S-DV-TIMINGS "<link linkend='vidioc-g-dv-timings'><constant>VIDIOC_S_DV_TIMINGS</constant></link>">
63<!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>"> 69<!ENTITY VIDIOC-S-EXT-CTRLS "<link linkend='vidioc-g-ext-ctrls'><constant>VIDIOC_S_EXT_CTRLS</constant></link>">
64<!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>"> 70<!ENTITY VIDIOC-S-FBUF "<link linkend='vidioc-g-fbuf'><constant>VIDIOC_S_FBUF</constant></link>">
65<!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>"> 71<!ENTITY VIDIOC-S-FMT "<link linkend='vidioc-g-fmt'><constant>VIDIOC_S_FMT</constant></link>">
@@ -118,6 +124,7 @@
118<!-- Structures --> 124<!-- Structures -->
119<!ENTITY v4l2-audio "struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link>"> 125<!ENTITY v4l2-audio "struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link>">
120<!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>"> 126<!ENTITY v4l2-audioout "struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link>">
127<!ENTITY v4l2-bt-timings "struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link>">
121<!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>"> 128<!ENTITY v4l2-buffer "struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link>">
122<!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>"> 129<!ENTITY v4l2-capability "struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link>">
123<!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>"> 130<!ENTITY v4l2-captureparm "struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link>">
@@ -128,6 +135,9 @@
128<!ENTITY v4l2-dbg-chip-ident "struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>"> 135<!ENTITY v4l2-dbg-chip-ident "struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link>">
129<!ENTITY v4l2-dbg-match "struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>"> 136<!ENTITY v4l2-dbg-match "struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link>">
130<!ENTITY v4l2-dbg-register "struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>"> 137<!ENTITY v4l2-dbg-register "struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link>">
138<!ENTITY v4l2-dv-enum-preset "struct&nbsp;<link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link>">
139<!ENTITY v4l2-dv-preset "struct&nbsp;<link linkend='v4l2-dv-preset'>v4l2_dv_preset</link>">
140<!ENTITY v4l2-dv-timings "struct&nbsp;<link linkend='v4l2-dv-timings'>v4l2_dv_timings</link>">
131<!ENTITY v4l2-enc-idx "struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>"> 141<!ENTITY v4l2-enc-idx "struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link>">
132<!ENTITY v4l2-enc-idx-entry "struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>"> 142<!ENTITY v4l2-enc-idx-entry "struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link>">
133<!ENTITY v4l2-encoder-cmd "struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>"> 143<!ENTITY v4l2-encoder-cmd "struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link>">
@@ -243,6 +253,10 @@
243<!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> 253<!ENTITY sub-enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml">
244<!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml"> 254<!ENTITY sub-enuminput SYSTEM "v4l/vidioc-enuminput.xml">
245<!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> 255<!ENTITY sub-enumoutput SYSTEM "v4l/vidioc-enumoutput.xml">
256<!ENTITY sub-enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml">
257<!ENTITY sub-g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml">
258<!ENTITY sub-query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml">
259<!ENTITY sub-g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml">
246<!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml"> 260<!ENTITY sub-enumstd SYSTEM "v4l/vidioc-enumstd.xml">
247<!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml"> 261<!ENTITY sub-g-audio SYSTEM "v4l/vidioc-g-audio.xml">
248<!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> 262<!ENTITY sub-g-audioout SYSTEM "v4l/vidioc-g-audioout.xml">
@@ -280,7 +294,7 @@
280<!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml"> 294<!ENTITY sub-v4l2 SYSTEM "v4l/v4l2.xml">
281<!ENTITY sub-intro SYSTEM "dvb/intro.xml"> 295<!ENTITY sub-intro SYSTEM "dvb/intro.xml">
282<!ENTITY sub-frontend SYSTEM "dvb/frontend.xml"> 296<!ENTITY sub-frontend SYSTEM "dvb/frontend.xml">
283<!ENTITY sub-isdbt SYSTEM "dvb/isdbt.xml"> 297<!ENTITY sub-dvbproperty SYSTEM "dvb/dvbproperty.xml">
284<!ENTITY sub-demux SYSTEM "dvb/demux.xml"> 298<!ENTITY sub-demux SYSTEM "dvb/demux.xml">
285<!ENTITY sub-video SYSTEM "dvb/video.xml"> 299<!ENTITY sub-video SYSTEM "dvb/video.xml">
286<!ENTITY sub-audio SYSTEM "dvb/audio.xml"> 300<!ENTITY sub-audio SYSTEM "dvb/audio.xml">
@@ -288,6 +302,7 @@
288<!ENTITY sub-net SYSTEM "dvb/net.xml"> 302<!ENTITY sub-net SYSTEM "dvb/net.xml">
289<!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml"> 303<!ENTITY sub-kdapi SYSTEM "dvb/kdapi.xml">
290<!ENTITY sub-examples SYSTEM "dvb/examples.xml"> 304<!ENTITY sub-examples SYSTEM "dvb/examples.xml">
305<!ENTITY sub-frontend-h SYSTEM "dvb/frontend.h.xml">
291<!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml"> 306<!ENTITY sub-dvbapi SYSTEM "dvb/dvbapi.xml">
292<!ENTITY sub-media SYSTEM "media.xml"> 307<!ENTITY sub-media SYSTEM "media.xml">
293<!ENTITY sub-media-entities SYSTEM "media-entities.tmpl"> 308<!ENTITY sub-media-entities SYSTEM "media-entities.tmpl">
@@ -332,6 +347,10 @@
332<!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml"> 347<!ENTITY enumaudioout SYSTEM "v4l/vidioc-enumaudioout.xml">
333<!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml"> 348<!ENTITY enuminput SYSTEM "v4l/vidioc-enuminput.xml">
334<!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml"> 349<!ENTITY enumoutput SYSTEM "v4l/vidioc-enumoutput.xml">
350<!ENTITY enum-dv-presets SYSTEM "v4l/vidioc-enum-dv-presets.xml">
351<!ENTITY g-dv-preset SYSTEM "v4l/vidioc-g-dv-preset.xml">
352<!ENTITY query-dv-preset SYSTEM "v4l/vidioc-query-dv-preset.xml">
353<!ENTITY g-dv-timings SYSTEM "v4l/vidioc-g-dv-timings.xml">
335<!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml"> 354<!ENTITY enumstd SYSTEM "v4l/vidioc-enumstd.xml">
336<!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml"> 355<!ENTITY g-audio SYSTEM "v4l/vidioc-g-audio.xml">
337<!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml"> 356<!ENTITY g-audioout SYSTEM "v4l/vidioc-g-audioout.xml">
diff --git a/Documentation/DocBook/media-indices.tmpl b/Documentation/DocBook/media-indices.tmpl
index 9e30a236d74f..78d6031de001 100644
--- a/Documentation/DocBook/media-indices.tmpl
+++ b/Documentation/DocBook/media-indices.tmpl
@@ -36,6 +36,7 @@
36<indexentry><primaryie>enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry> 36<indexentry><primaryie>enum&nbsp;<link linkend='v4l2-preemphasis'>v4l2_preemphasis</link></primaryie></indexentry>
37<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry> 37<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audio'>v4l2_audio</link></primaryie></indexentry>
38<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry> 38<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-audioout'>v4l2_audioout</link></primaryie></indexentry>
39<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-bt-timings'>v4l2_bt_timings</link></primaryie></indexentry>
39<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry> 40<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-buffer'>v4l2_buffer</link></primaryie></indexentry>
40<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry> 41<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-capability'>v4l2_capability</link></primaryie></indexentry>
41<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry> 42<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-captureparm'>v4l2_captureparm</link></primaryie></indexentry>
@@ -46,6 +47,9 @@
46<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry> 47<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-chip-ident'>v4l2_dbg_chip_ident</link></primaryie></indexentry>
47<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry> 48<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-match'>v4l2_dbg_match</link></primaryie></indexentry>
48<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry> 49<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dbg-register'>v4l2_dbg_register</link></primaryie></indexentry>
50<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-enum-preset'>v4l2_dv_enum_preset</link></primaryie></indexentry>
51<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-preset'>v4l2_dv_preset</link></primaryie></indexentry>
52<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-dv-timings'>v4l2_dv_timings</link></primaryie></indexentry>
49<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry> 53<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx'>v4l2_enc_idx</link></primaryie></indexentry>
50<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry> 54<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-enc-idx-entry'>v4l2_enc_idx_entry</link></primaryie></indexentry>
51<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry> 55<indexentry><primaryie>struct&nbsp;<link linkend='v4l2-encoder-cmd'>v4l2_encoder_cmd</link></primaryie></indexentry>
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index df0d089d0fb9..133cd6c3f3c1 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -174,7 +174,7 @@
174 </para> 174 </para>
175 <programlisting> 175 <programlisting>
176static struct mtd_info *board_mtd; 176static struct mtd_info *board_mtd;
177static unsigned long baseaddr; 177static void __iomem *baseaddr;
178 </programlisting> 178 </programlisting>
179 <para> 179 <para>
180 Static example 180 Static example
@@ -182,7 +182,7 @@ static unsigned long baseaddr;
182 <programlisting> 182 <programlisting>
183static struct mtd_info board_mtd; 183static struct mtd_info board_mtd;
184static struct nand_chip board_chip; 184static struct nand_chip board_chip;
185static unsigned long baseaddr; 185static void __iomem *baseaddr;
186 </programlisting> 186 </programlisting>
187 </sect1> 187 </sect1>
188 <sect1 id="Partition_defines"> 188 <sect1 id="Partition_defines">
@@ -283,8 +283,8 @@ int __init board_init (void)
283 } 283 }
284 284
285 /* map physical address */ 285 /* map physical address */
286 baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024); 286 baseaddr = ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
287 if(!baseaddr){ 287 if (!baseaddr) {
288 printk("Ioremap to access NAND chip failed\n"); 288 printk("Ioremap to access NAND chip failed\n");
289 err = -EIO; 289 err = -EIO;
290 goto out_mtd; 290 goto out_mtd;
@@ -316,7 +316,7 @@ int __init board_init (void)
316 goto out; 316 goto out;
317 317
318out_ior: 318out_ior:
319 iounmap((void *)baseaddr); 319 iounmap(baseaddr);
320out_mtd: 320out_mtd:
321 kfree (board_mtd); 321 kfree (board_mtd);
322out: 322out:
@@ -341,7 +341,7 @@ static void __exit board_cleanup (void)
341 nand_release (board_mtd); 341 nand_release (board_mtd);
342 342
343 /* unmap physical address */ 343 /* unmap physical address */
344 iounmap((void *)baseaddr); 344 iounmap(baseaddr);
345 345
346 /* Free the MTD device structure */ 346 /* Free the MTD device structure */
347 kfree (board_mtd); 347 kfree (board_mtd);
@@ -362,7 +362,7 @@ module_exit(board_cleanup);
362 <sect1 id="Multiple_chip_control"> 362 <sect1 id="Multiple_chip_control">
363 <title>Multiple chip control</title> 363 <title>Multiple chip control</title>
364 <para> 364 <para>
365 The nand driver can control chip arrays. Therefor the 365 The nand driver can control chip arrays. Therefore the
366 board driver must provide an own select_chip function. This 366 board driver must provide an own select_chip function. This
367 function must (de)select the requested chip. 367 function must (de)select the requested chip.
368 The function pointer in the nand_chip structure must 368 The function pointer in the nand_chip structure must
@@ -488,7 +488,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
488 The ECC bytes must be placed immidiately after the data 488 The ECC bytes must be placed immidiately after the data
489 bytes in order to make the syndrome generator work. This 489 bytes in order to make the syndrome generator work. This
490 is contrary to the usual layout used by software ECC. The 490 is contrary to the usual layout used by software ECC. The
491 seperation of data and out of band area is not longer 491 separation of data and out of band area is not longer
492 possible. The nand driver code handles this layout and 492 possible. The nand driver code handles this layout and
493 the remaining free bytes in the oob area are managed by 493 the remaining free bytes in the oob area are managed by
494 the autoplacement code. Provide a matching oob-layout 494 the autoplacement code. Provide a matching oob-layout
@@ -560,7 +560,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
560 bad blocks. They have factory marked good blocks. The marker pattern 560 bad blocks. They have factory marked good blocks. The marker pattern
561 is erased when the block is erased to be reused. So in case of 561 is erased when the block is erased to be reused. So in case of
562 powerloss before writing the pattern back to the chip this block 562 powerloss before writing the pattern back to the chip this block
563 would be lost and added to the bad blocks. Therefor we scan the 563 would be lost and added to the bad blocks. Therefore we scan the
564 chip(s) when we detect them the first time for good blocks and 564 chip(s) when we detect them the first time for good blocks and
565 store this information in a bad block table before erasing any 565 store this information in a bad block table before erasing any
566 of the blocks. 566 of the blocks.
@@ -1094,7 +1094,7 @@ in this page</entry>
1094 manufacturers specifications. This applies similar to the spare area. 1094 manufacturers specifications. This applies similar to the spare area.
1095 </para> 1095 </para>
1096 <para> 1096 <para>
1097 Therefor NAND aware filesystems must either write in page size chunks 1097 Therefore NAND aware filesystems must either write in page size chunks
1098 or hold a writebuffer to collect smaller writes until they sum up to 1098 or hold a writebuffer to collect smaller writes until they sum up to
1099 pagesize. Available NAND aware filesystems: JFFS2, YAFFS. 1099 pagesize. Available NAND aware filesystems: JFFS2, YAFFS.
1100 </para> 1100 </para>
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl
deleted file mode 100644
index 9eba4b7af73d..000000000000
--- a/Documentation/DocBook/procfs-guide.tmpl
+++ /dev/null
@@ -1,626 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
4<!ENTITY procfsexample SYSTEM "procfs_example.xml">
5]>
6
7<book id="LKProcfsGuide">
8 <bookinfo>
9 <title>Linux Kernel Procfs Guide</title>
10
11 <authorgroup>
12 <author>
13 <firstname>Erik</firstname>
14 <othername>(J.A.K.)</othername>
15 <surname>Mouw</surname>
16 <affiliation>
17 <address>
18 <email>mouw@nl.linux.org</email>
19 </address>
20 </affiliation>
21 </author>
22 <othercredit>
23 <contrib>
24 This software and documentation were written while working on the
25 LART computing board
26 (<ulink url="http://www.lartmaker.nl/">http://www.lartmaker.nl/</ulink>),
27 which was sponsored by the Delt University of Technology projects
28 Mobile Multi-media Communications and Ubiquitous Communications.
29 </contrib>
30 </othercredit>
31 </authorgroup>
32
33 <revhistory>
34 <revision>
35 <revnumber>1.0</revnumber>
36 <date>May 30, 2001</date>
37 <revremark>Initial revision posted to linux-kernel</revremark>
38 </revision>
39 <revision>
40 <revnumber>1.1</revnumber>
41 <date>June 3, 2001</date>
42 <revremark>Revised after comments from linux-kernel</revremark>
43 </revision>
44 </revhistory>
45
46 <copyright>
47 <year>2001</year>
48 <holder>Erik Mouw</holder>
49 </copyright>
50
51
52 <legalnotice>
53 <para>
54 This documentation is free software; you can redistribute it
55 and/or modify it under the terms of the GNU General Public
56 License as published by the Free Software Foundation; either
57 version 2 of the License, or (at your option) any later
58 version.
59 </para>
60
61 <para>
62 This documentation is distributed in the hope that it will be
63 useful, but WITHOUT ANY WARRANTY; without even the implied
64 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
65 PURPOSE. See the GNU General Public License for more details.
66 </para>
67
68 <para>
69 You should have received a copy of the GNU General Public
70 License along with this program; if not, write to the Free
71 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
72 MA 02111-1307 USA
73 </para>
74
75 <para>
76 For more details see the file COPYING in the source
77 distribution of Linux.
78 </para>
79 </legalnotice>
80 </bookinfo>
81
82
83
84
85 <toc>
86 </toc>
87
88
89
90
91 <preface id="Preface">
92 <title>Preface</title>
93
94 <para>
95 This guide describes the use of the procfs file system from
96 within the Linux kernel. The idea to write this guide came up on
97 the #kernelnewbies IRC channel (see <ulink
98 url="http://www.kernelnewbies.org/">http://www.kernelnewbies.org/</ulink>),
99 when Jeff Garzik explained the use of procfs and forwarded me a
100 message Alexander Viro wrote to the linux-kernel mailing list. I
101 agreed to write it up nicely, so here it is.
102 </para>
103
104 <para>
105 I'd like to thank Jeff Garzik
106 <email>jgarzik@pobox.com</email> and Alexander Viro
107 <email>viro@parcelfarce.linux.theplanet.co.uk</email> for their input,
108 Tim Waugh <email>twaugh@redhat.com</email> for his <ulink
109 url="http://people.redhat.com/twaugh/docbook/selfdocbook/">Selfdocbook</ulink>,
110 and Marc Joosen <email>marcj@historia.et.tudelft.nl</email> for
111 proofreading.
112 </para>
113
114 <para>
115 Erik
116 </para>
117 </preface>
118
119
120
121
122 <chapter id="intro">
123 <title>Introduction</title>
124
125 <para>
126 The <filename class="directory">/proc</filename> file system
127 (procfs) is a special file system in the linux kernel. It's a
128 virtual file system: it is not associated with a block device
129 but exists only in memory. The files in the procfs are there to
130 allow userland programs access to certain information from the
131 kernel (like process information in <filename
132 class="directory">/proc/[0-9]+/</filename>), but also for debug
133 purposes (like <filename>/proc/ksyms</filename>).
134 </para>
135
136 <para>
137 This guide describes the use of the procfs file system from
138 within the Linux kernel. It starts by introducing all relevant
139 functions to manage the files within the file system. After that
140 it shows how to communicate with userland, and some tips and
141 tricks will be pointed out. Finally a complete example will be
142 shown.
143 </para>
144
145 <para>
146 Note that the files in <filename
147 class="directory">/proc/sys</filename> are sysctl files: they
148 don't belong to procfs and are governed by a completely
149 different API described in the Kernel API book.
150 </para>
151 </chapter>
152
153
154
155
156 <chapter id="managing">
157 <title>Managing procfs entries</title>
158
159 <para>
160 This chapter describes the functions that various kernel
161 components use to populate the procfs with files, symlinks,
162 device nodes, and directories.
163 </para>
164
165 <para>
166 A minor note before we start: if you want to use any of the
167 procfs functions, be sure to include the correct header file!
168 This should be one of the first lines in your code:
169 </para>
170
171 <programlisting>
172#include &lt;linux/proc_fs.h&gt;
173 </programlisting>
174
175
176
177
178 <sect1 id="regularfile">
179 <title>Creating a regular file</title>
180
181 <funcsynopsis>
182 <funcprototype>
183 <funcdef>struct proc_dir_entry* <function>create_proc_entry</function></funcdef>
184 <paramdef>const char* <parameter>name</parameter></paramdef>
185 <paramdef>mode_t <parameter>mode</parameter></paramdef>
186 <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
187 </funcprototype>
188 </funcsynopsis>
189
190 <para>
191 This function creates a regular file with the name
192 <parameter>name</parameter>, file mode
193 <parameter>mode</parameter> in the directory
194 <parameter>parent</parameter>. To create a file in the root of
195 the procfs, use <constant>NULL</constant> as
196 <parameter>parent</parameter> parameter. When successful, the
197 function will return a pointer to the freshly created
198 <structname>struct proc_dir_entry</structname>; otherwise it
199 will return <constant>NULL</constant>. <xref
200 linkend="userland"/> describes how to do something useful with
201 regular files.
202 </para>
203
204 <para>
205 Note that it is specifically supported that you can pass a
206 path that spans multiple directories. For example
207 <function>create_proc_entry</function>(<parameter>"drivers/via0/info"</parameter>)
208 will create the <filename class="directory">via0</filename>
209 directory if necessary, with standard
210 <constant>0755</constant> permissions.
211 </para>
212
213 <para>
214 If you only want to be able to read the file, the function
215 <function>create_proc_read_entry</function> described in <xref
216 linkend="convenience"/> may be used to create and initialise
217 the procfs entry in one single call.
218 </para>
219 </sect1>
220
221
222
223
224 <sect1 id="Creating_a_symlink">
225 <title>Creating a symlink</title>
226
227 <funcsynopsis>
228 <funcprototype>
229 <funcdef>struct proc_dir_entry*
230 <function>proc_symlink</function></funcdef> <paramdef>const
231 char* <parameter>name</parameter></paramdef>
232 <paramdef>struct proc_dir_entry*
233 <parameter>parent</parameter></paramdef> <paramdef>const
234 char* <parameter>dest</parameter></paramdef>
235 </funcprototype>
236 </funcsynopsis>
237
238 <para>
239 This creates a symlink in the procfs directory
240 <parameter>parent</parameter> that points from
241 <parameter>name</parameter> to
242 <parameter>dest</parameter>. This translates in userland to
243 <literal>ln -s</literal> <parameter>dest</parameter>
244 <parameter>name</parameter>.
245 </para>
246 </sect1>
247
248 <sect1 id="Creating_a_directory">
249 <title>Creating a directory</title>
250
251 <funcsynopsis>
252 <funcprototype>
253 <funcdef>struct proc_dir_entry* <function>proc_mkdir</function></funcdef>
254 <paramdef>const char* <parameter>name</parameter></paramdef>
255 <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
256 </funcprototype>
257 </funcsynopsis>
258
259 <para>
260 Create a directory <parameter>name</parameter> in the procfs
261 directory <parameter>parent</parameter>.
262 </para>
263 </sect1>
264
265
266
267
268 <sect1 id="Removing_an_entry">
269 <title>Removing an entry</title>
270
271 <funcsynopsis>
272 <funcprototype>
273 <funcdef>void <function>remove_proc_entry</function></funcdef>
274 <paramdef>const char* <parameter>name</parameter></paramdef>
275 <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
276 </funcprototype>
277 </funcsynopsis>
278
279 <para>
280 Removes the entry <parameter>name</parameter> in the directory
281 <parameter>parent</parameter> from the procfs. Entries are
282 removed by their <emphasis>name</emphasis>, not by the
283 <structname>struct proc_dir_entry</structname> returned by the
284 various create functions. Note that this function doesn't
285 recursively remove entries.
286 </para>
287
288 <para>
289 Be sure to free the <structfield>data</structfield> entry from
290 the <structname>struct proc_dir_entry</structname> before
291 <function>remove_proc_entry</function> is called (that is: if
292 there was some <structfield>data</structfield> allocated, of
293 course). See <xref linkend="usingdata"/> for more information
294 on using the <structfield>data</structfield> entry.
295 </para>
296 </sect1>
297 </chapter>
298
299
300
301
302 <chapter id="userland">
303 <title>Communicating with userland</title>
304
305 <para>
306 Instead of reading (or writing) information directly from
307 kernel memory, procfs works with <emphasis>call back
308 functions</emphasis> for files: functions that are called when
309 a specific file is being read or written. Such functions have
310 to be initialised after the procfs file is created by setting
311 the <structfield>read_proc</structfield> and/or
312 <structfield>write_proc</structfield> fields in the
313 <structname>struct proc_dir_entry*</structname> that the
314 function <function>create_proc_entry</function> returned:
315 </para>
316
317 <programlisting>
318struct proc_dir_entry* entry;
319
320entry->read_proc = read_proc_foo;
321entry->write_proc = write_proc_foo;
322 </programlisting>
323
324 <para>
325 If you only want to use a the
326 <structfield>read_proc</structfield>, the function
327 <function>create_proc_read_entry</function> described in <xref
328 linkend="convenience"/> may be used to create and initialise the
329 procfs entry in one single call.
330 </para>
331
332
333
334 <sect1 id="Reading_data">
335 <title>Reading data</title>
336
337 <para>
338 The read function is a call back function that allows userland
339 processes to read data from the kernel. The read function
340 should have the following format:
341 </para>
342
343 <funcsynopsis>
344 <funcprototype>
345 <funcdef>int <function>read_func</function></funcdef>
346 <paramdef>char* <parameter>buffer</parameter></paramdef>
347 <paramdef>char** <parameter>start</parameter></paramdef>
348 <paramdef>off_t <parameter>off</parameter></paramdef>
349 <paramdef>int <parameter>count</parameter></paramdef>
350 <paramdef>int* <parameter>peof</parameter></paramdef>
351 <paramdef>void* <parameter>data</parameter></paramdef>
352 </funcprototype>
353 </funcsynopsis>
354
355 <para>
356 The read function should write its information into the
357 <parameter>buffer</parameter>, which will be exactly
358 <literal>PAGE_SIZE</literal> bytes long.
359 </para>
360
361 <para>
362 The parameter
363 <parameter>peof</parameter> should be used to signal that the
364 end of the file has been reached by writing
365 <literal>1</literal> to the memory location
366 <parameter>peof</parameter> points to.
367 </para>
368
369 <para>
370 The <parameter>data</parameter>
371 parameter can be used to create a single call back function for
372 several files, see <xref linkend="usingdata"/>.
373 </para>
374
375 <para>
376 The rest of the parameters and the return value are described
377 by a comment in <filename>fs/proc/generic.c</filename> as follows:
378 </para>
379
380 <blockquote>
381 <para>
382 You have three ways to return data:
383 </para>
384 <orderedlist>
385 <listitem>
386 <para>
387 Leave <literal>*start = NULL</literal>. (This is the default.)
388 Put the data of the requested offset at that
389 offset within the buffer. Return the number (<literal>n</literal>)
390 of bytes there are from the beginning of the
391 buffer up to the last byte of data. If the
392 number of supplied bytes (<literal>= n - offset</literal>) is
393 greater than zero and you didn't signal eof
394 and the reader is prepared to take more data
395 you will be called again with the requested
396 offset advanced by the number of bytes
397 absorbed. This interface is useful for files
398 no larger than the buffer.
399 </para>
400 </listitem>
401 <listitem>
402 <para>
403 Set <literal>*start</literal> to an unsigned long value less than
404 the buffer address but greater than zero.
405 Put the data of the requested offset at the
406 beginning of the buffer. Return the number of
407 bytes of data placed there. If this number is
408 greater than zero and you didn't signal eof
409 and the reader is prepared to take more data
410 you will be called again with the requested
411 offset advanced by <literal>*start</literal>. This interface is
412 useful when you have a large file consisting
413 of a series of blocks which you want to count
414 and return as wholes.
415 (Hack by Paul.Russell@rustcorp.com.au)
416 </para>
417 </listitem>
418 <listitem>
419 <para>
420 Set <literal>*start</literal> to an address within the buffer.
421 Put the data of the requested offset at <literal>*start</literal>.
422 Return the number of bytes of data placed there.
423 If this number is greater than zero and you
424 didn't signal eof and the reader is prepared to
425 take more data you will be called again with the
426 requested offset advanced by the number of bytes
427 absorbed.
428 </para>
429 </listitem>
430 </orderedlist>
431 </blockquote>
432
433 <para>
434 <xref linkend="example"/> shows how to use a read call back
435 function.
436 </para>
437 </sect1>
438
439
440
441
442 <sect1 id="Writing_data">
443 <title>Writing data</title>
444
445 <para>
446 The write call back function allows a userland process to write
447 data to the kernel, so it has some kind of control over the
448 kernel. The write function should have the following format:
449 </para>
450
451 <funcsynopsis>
452 <funcprototype>
453 <funcdef>int <function>write_func</function></funcdef>
454 <paramdef>struct file* <parameter>file</parameter></paramdef>
455 <paramdef>const char* <parameter>buffer</parameter></paramdef>
456 <paramdef>unsigned long <parameter>count</parameter></paramdef>
457 <paramdef>void* <parameter>data</parameter></paramdef>
458 </funcprototype>
459 </funcsynopsis>
460
461 <para>
462 The write function should read <parameter>count</parameter>
463 bytes at maximum from the <parameter>buffer</parameter>. Note
464 that the <parameter>buffer</parameter> doesn't live in the
465 kernel's memory space, so it should first be copied to kernel
466 space with <function>copy_from_user</function>. The
467 <parameter>file</parameter> parameter is usually
468 ignored. <xref linkend="usingdata"/> shows how to use the
469 <parameter>data</parameter> parameter.
470 </para>
471
472 <para>
473 Again, <xref linkend="example"/> shows how to use this call back
474 function.
475 </para>
476 </sect1>
477
478
479
480
481 <sect1 id="usingdata">
482 <title>A single call back for many files</title>
483
484 <para>
485 When a large number of almost identical files is used, it's
486 quite inconvenient to use a separate call back function for
487 each file. A better approach is to have a single call back
488 function that distinguishes between the files by using the
489 <structfield>data</structfield> field in <structname>struct
490 proc_dir_entry</structname>. First of all, the
491 <structfield>data</structfield> field has to be initialised:
492 </para>
493
494 <programlisting>
495struct proc_dir_entry* entry;
496struct my_file_data *file_data;
497
498file_data = kmalloc(sizeof(struct my_file_data), GFP_KERNEL);
499entry->data = file_data;
500 </programlisting>
501
502 <para>
503 The <structfield>data</structfield> field is a <type>void
504 *</type>, so it can be initialised with anything.
505 </para>
506
507 <para>
508 Now that the <structfield>data</structfield> field is set, the
509 <function>read_proc</function> and
510 <function>write_proc</function> can use it to distinguish
511 between files because they get it passed into their
512 <parameter>data</parameter> parameter:
513 </para>
514
515 <programlisting>
516int foo_read_func(char *page, char **start, off_t off,
517 int count, int *eof, void *data)
518{
519 int len;
520
521 if(data == file_data) {
522 /* special case for this file */
523 } else {
524 /* normal processing */
525 }
526
527 return len;
528}
529 </programlisting>
530
531 <para>
532 Be sure to free the <structfield>data</structfield> data field
533 when removing the procfs entry.
534 </para>
535 </sect1>
536 </chapter>
537
538
539
540
541 <chapter id="tips">
542 <title>Tips and tricks</title>
543
544
545
546
547 <sect1 id="convenience">
548 <title>Convenience functions</title>
549
550 <funcsynopsis>
551 <funcprototype>
552 <funcdef>struct proc_dir_entry* <function>create_proc_read_entry</function></funcdef>
553 <paramdef>const char* <parameter>name</parameter></paramdef>
554 <paramdef>mode_t <parameter>mode</parameter></paramdef>
555 <paramdef>struct proc_dir_entry* <parameter>parent</parameter></paramdef>
556 <paramdef>read_proc_t* <parameter>read_proc</parameter></paramdef>
557 <paramdef>void* <parameter>data</parameter></paramdef>
558 </funcprototype>
559 </funcsynopsis>
560
561 <para>
562 This function creates a regular file in exactly the same way
563 as <function>create_proc_entry</function> from <xref
564 linkend="regularfile"/> does, but also allows to set the read
565 function <parameter>read_proc</parameter> in one call. This
566 function can set the <parameter>data</parameter> as well, like
567 explained in <xref linkend="usingdata"/>.
568 </para>
569 </sect1>
570
571
572
573 <sect1 id="Modules">
574 <title>Modules</title>
575
576 <para>
577 If procfs is being used from within a module, be sure to set
578 the <structfield>owner</structfield> field in the
579 <structname>struct proc_dir_entry</structname> to
580 <constant>THIS_MODULE</constant>.
581 </para>
582
583 <programlisting>
584struct proc_dir_entry* entry;
585
586entry->owner = THIS_MODULE;
587 </programlisting>
588 </sect1>
589
590
591
592
593 <sect1 id="Mode_and_ownership">
594 <title>Mode and ownership</title>
595
596 <para>
597 Sometimes it is useful to change the mode and/or ownership of
598 a procfs entry. Here is an example that shows how to achieve
599 that:
600 </para>
601
602 <programlisting>
603struct proc_dir_entry* entry;
604
605entry->mode = S_IWUSR |S_IRUSR | S_IRGRP | S_IROTH;
606entry->uid = 0;
607entry->gid = 100;
608 </programlisting>
609
610 </sect1>
611 </chapter>
612
613
614
615
616 <chapter id="example">
617 <title>Example</title>
618
619 <!-- be careful with the example code: it shouldn't be wider than
620 approx. 60 columns, or otherwise it won't fit properly on a page
621 -->
622
623&procfsexample;
624
625 </chapter>
626</book>
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
deleted file mode 100644
index a5b11793b1e0..000000000000
--- a/Documentation/DocBook/procfs_example.c
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 * procfs_example.c: an example proc interface
3 *
4 * Copyright (C) 2001, Erik Mouw (mouw@nl.linux.org)
5 *
6 * This file accompanies the procfs-guide in the Linux kernel
7 * source. Its main use is to demonstrate the concepts and
8 * functions described in the guide.
9 *
10 * This software has been developed while working on the LART
11 * computing board (http://www.lartmaker.nl), which was sponsored
12 * by the Delt University of Technology projects Mobile Multi-media
13 * Communications and Ubiquitous Communications.
14 *
15 * This program is free software; you can redistribute
16 * it and/or modify it under the terms of the GNU General
17 * Public License as published by the Free Software
18 * Foundation; either version 2 of the License, or (at your
19 * option) any later version.
20 *
21 * This program is distributed in the hope that it will be
22 * useful, but WITHOUT ANY WARRANTY; without even the implied
23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
24 * PURPOSE. See the GNU General Public License for more
25 * details.
26 *
27 * You should have received a copy of the GNU General Public
28 * License along with this program; if not, write to the
29 * Free Software Foundation, Inc., 59 Temple Place,
30 * Suite 330, Boston, MA 02111-1307 USA
31 *
32 */
33
34#include <linux/module.h>
35#include <linux/kernel.h>
36#include <linux/init.h>
37#include <linux/proc_fs.h>
38#include <linux/jiffies.h>
39#include <asm/uaccess.h>
40
41
42#define MODULE_VERS "1.0"
43#define MODULE_NAME "procfs_example"
44
45#define FOOBAR_LEN 8
46
47struct fb_data_t {
48 char name[FOOBAR_LEN + 1];
49 char value[FOOBAR_LEN + 1];
50};
51
52
53static struct proc_dir_entry *example_dir, *foo_file,
54 *bar_file, *jiffies_file, *symlink;
55
56
57struct fb_data_t foo_data, bar_data;
58
59
60static int proc_read_jiffies(char *page, char **start,
61 off_t off, int count,
62 int *eof, void *data)
63{
64 int len;
65
66 len = sprintf(page, "jiffies = %ld\n",
67 jiffies);
68
69 return len;
70}
71
72
73static int proc_read_foobar(char *page, char **start,
74 off_t off, int count,
75 int *eof, void *data)
76{
77 int len;
78 struct fb_data_t *fb_data = (struct fb_data_t *)data;
79
80 /* DON'T DO THAT - buffer overruns are bad */
81 len = sprintf(page, "%s = '%s'\n",
82 fb_data->name, fb_data->value);
83
84 return len;
85}
86
87
88static int proc_write_foobar(struct file *file,
89 const char *buffer,
90 unsigned long count,
91 void *data)
92{
93 int len;
94 struct fb_data_t *fb_data = (struct fb_data_t *)data;
95
96 if(count > FOOBAR_LEN)
97 len = FOOBAR_LEN;
98 else
99 len = count;
100
101 if(copy_from_user(fb_data->value, buffer, len))
102 return -EFAULT;
103
104 fb_data->value[len] = '\0';
105
106 return len;
107}
108
109
110static int __init init_procfs_example(void)
111{
112 int rv = 0;
113
114 /* create directory */
115 example_dir = proc_mkdir(MODULE_NAME, NULL);
116 if(example_dir == NULL) {
117 rv = -ENOMEM;
118 goto out;
119 }
120 /* create jiffies using convenience function */
121 jiffies_file = create_proc_read_entry("jiffies",
122 0444, example_dir,
123 proc_read_jiffies,
124 NULL);
125 if(jiffies_file == NULL) {
126 rv = -ENOMEM;
127 goto no_jiffies;
128 }
129
130 /* create foo and bar files using same callback
131 * functions
132 */
133 foo_file = create_proc_entry("foo", 0644, example_dir);
134 if(foo_file == NULL) {
135 rv = -ENOMEM;
136 goto no_foo;
137 }
138
139 strcpy(foo_data.name, "foo");
140 strcpy(foo_data.value, "foo");
141 foo_file->data = &foo_data;
142 foo_file->read_proc = proc_read_foobar;
143 foo_file->write_proc = proc_write_foobar;
144
145 bar_file = create_proc_entry("bar", 0644, example_dir);
146 if(bar_file == NULL) {
147 rv = -ENOMEM;
148 goto no_bar;
149 }
150
151 strcpy(bar_data.name, "bar");
152 strcpy(bar_data.value, "bar");
153 bar_file->data = &bar_data;
154 bar_file->read_proc = proc_read_foobar;
155 bar_file->write_proc = proc_write_foobar;
156
157 /* create symlink */
158 symlink = proc_symlink("jiffies_too", example_dir,
159 "jiffies");
160 if(symlink == NULL) {
161 rv = -ENOMEM;
162 goto no_symlink;
163 }
164
165 /* everything OK */
166 printk(KERN_INFO "%s %s initialised\n",
167 MODULE_NAME, MODULE_VERS);
168 return 0;
169
170no_symlink:
171 remove_proc_entry("bar", example_dir);
172no_bar:
173 remove_proc_entry("foo", example_dir);
174no_foo:
175 remove_proc_entry("jiffies", example_dir);
176no_jiffies:
177 remove_proc_entry(MODULE_NAME, NULL);
178out:
179 return rv;
180}
181
182
183static void __exit cleanup_procfs_example(void)
184{
185 remove_proc_entry("jiffies_too", example_dir);
186 remove_proc_entry("bar", example_dir);
187 remove_proc_entry("foo", example_dir);
188 remove_proc_entry("jiffies", example_dir);
189 remove_proc_entry(MODULE_NAME, NULL);
190
191 printk(KERN_INFO "%s %s removed\n",
192 MODULE_NAME, MODULE_VERS);
193}
194
195
196module_init(init_procfs_example);
197module_exit(cleanup_procfs_example);
198
199MODULE_AUTHOR("Erik Mouw");
200MODULE_DESCRIPTION("procfs examples");
201MODULE_LICENSE("GPL");
diff --git a/Documentation/DocBook/tracepoint.tmpl b/Documentation/DocBook/tracepoint.tmpl
index b0756d0fd579..8bca1d5cec09 100644
--- a/Documentation/DocBook/tracepoint.tmpl
+++ b/Documentation/DocBook/tracepoint.tmpl
@@ -86,4 +86,9 @@
86!Iinclude/trace/events/irq.h 86!Iinclude/trace/events/irq.h
87 </chapter> 87 </chapter>
88 88
89 <chapter id="signal">
90 <title>SIGNAL</title>
91!Iinclude/trace/events/signal.h
92 </chapter>
93
89</book> 94</book>
diff --git a/Documentation/DocBook/v4l/common.xml b/Documentation/DocBook/v4l/common.xml
index b1a81d246d58..cea23e1c4fc6 100644
--- a/Documentation/DocBook/v4l/common.xml
+++ b/Documentation/DocBook/v4l/common.xml
@@ -716,6 +716,41 @@ if (-1 == ioctl (fd, &VIDIOC-S-STD;, &amp;std_id)) {
716} 716}
717 </programlisting> 717 </programlisting>
718 </example> 718 </example>
719 <section id="dv-timings">
720 <title>Digital Video (DV) Timings</title>
721 <para>
722 The video standards discussed so far has been dealing with Analog TV and the
723corresponding video timings. Today there are many more different hardware interfaces
724such as High Definition TV interfaces (HDMI), VGA, DVI connectors etc., that carry
725video signals and there is a need to extend the API to select the video timings
726for these interfaces. Since it is not possible to extend the &v4l2-std-id; due to
727the limited bits available, a new set of IOCTLs is added to set/get video timings at
728the input and output: </para><itemizedlist>
729 <listitem>
730 <para>DV Presets: Digital Video (DV) presets. These are IDs representing a
731video timing at the input/output. Presets are pre-defined timings implemented
732by the hardware according to video standards. A __u32 data type is used to represent
733a preset unlike the bit mask that is used in &v4l2-std-id; allowing future extensions
734to support as many different presets as needed.</para>
735 </listitem>
736 <listitem>
737 <para>Custom DV Timings: This will allow applications to define more detailed
738custom video timings for the interface. This includes parameters such as width, height,
739polarities, frontporch, backporch etc.
740 </para>
741 </listitem>
742 </itemizedlist>
743 <para>To enumerate and query the attributes of DV presets supported by a device,
744applications use the &VIDIOC-ENUM-DV-PRESETS; ioctl. To get the current DV preset,
745applications use the &VIDIOC-G-DV-PRESET; ioctl and to set a preset they use the
746&VIDIOC-S-DV-PRESET; ioctl.</para>
747 <para>To set custom DV timings for the device, applications use the
748&VIDIOC-S-DV-TIMINGS; ioctl and to get current custom DV timings they use the
749&VIDIOC-G-DV-TIMINGS; ioctl.</para>
750 <para>Applications can make use of the <xref linkend="input-capabilities" /> and
751<xref linkend="output-capabilities"/> flags to decide what ioctls are available to set the
752video timings for the device.</para>
753 </section>
719 </section> 754 </section>
720 755
721 &sub-controls; 756 &sub-controls;
@@ -1135,7 +1170,7 @@ frames per second. If less than this number of frames is to be
1135captured or output, applications can request frame skipping or 1170captured or output, applications can request frame skipping or
1136duplicating on the driver side. This is especially useful when using 1171duplicating on the driver side. This is especially useful when using
1137the &func-read; or &func-write;, which are not augmented by timestamps 1172the &func-read; or &func-write;, which are not augmented by timestamps
1138or sequence counters, and to avoid unneccessary data copying.</para> 1173or sequence counters, and to avoid unnecessary data copying.</para>
1139 1174
1140 <para>Finally these ioctls can be used to determine the number of 1175 <para>Finally these ioctls can be used to determine the number of
1141buffers used internally by a driver in read/write mode. For 1176buffers used internally by a driver in read/write mode. For
diff --git a/Documentation/DocBook/v4l/compat.xml b/Documentation/DocBook/v4l/compat.xml
index 4d1902a54d61..b9dbdf9e6d29 100644
--- a/Documentation/DocBook/v4l/compat.xml
+++ b/Documentation/DocBook/v4l/compat.xml
@@ -2291,8 +2291,8 @@ was renamed to <structname id="v4l2-chip-ident-old">v4l2_chip_ident_old</structn
2291 <listitem> 2291 <listitem>
2292 <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para> 2292 <para>New control <constant>V4L2_CID_COLORFX</constant> was added.</para>
2293 </listitem> 2293 </listitem>
2294 </orderedlist> 2294 </orderedlist>
2295 </section> 2295 </section>
2296 <section> 2296 <section>
2297 <title>V4L2 in Linux 2.6.32</title> 2297 <title>V4L2 in Linux 2.6.32</title>
2298 <orderedlist> 2298 <orderedlist>
@@ -2322,8 +2322,16 @@ more information.</para>
2322 <listitem> 2322 <listitem>
2323 <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para> 2323 <para>Added Remote Controller chapter, describing the default Remote Controller mapping for media devices.</para>
2324 </listitem> 2324 </listitem>
2325 </orderedlist> 2325 </orderedlist>
2326 </section> 2326 </section>
2327 <section>
2328 <title>V4L2 in Linux 2.6.33</title>
2329 <orderedlist>
2330 <listitem>
2331 <para>Added support for Digital Video timings in order to support HDTV receivers and transmitters.</para>
2332 </listitem>
2333 </orderedlist>
2334 </section>
2327 </section> 2335 </section>
2328 2336
2329 <section id="other"> 2337 <section id="other">
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index f492accb691d..f46450610412 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -281,10 +281,28 @@ minimum value disables backlight compensation.</entry>
281<constant>V4L2_COLORFX_SEPIA</constant> (2).</entry> 281<constant>V4L2_COLORFX_SEPIA</constant> (2).</entry>
282 </row> 282 </row>
283 <row> 283 <row>
284 <entry><constant>V4L2_CID_ROTATE</constant></entry>
285 <entry>integer</entry>
286 <entry>Rotates the image by specified angle. Common angles are 90,
287 270 and 180. Rotating the image to 90 and 270 will reverse the height
288 and width of the display window. It is necessary to set the new height and
289 width of the picture using the &VIDIOC-S-FMT; ioctl according to
290 the rotation angle selected.</entry>
291 </row>
292 <row>
293 <entry><constant>V4L2_CID_BG_COLOR</constant></entry>
294 <entry>integer</entry>
295 <entry>Sets the background color on the current output device.
296 Background color needs to be specified in the RGB24 format. The
297 supplied 32 bit value is interpreted as bits 0-7 Red color information,
298 bits 8-15 Green color information, bits 16-23 Blue color
299 information and bits 24-31 must be zero.</entry>
300 </row>
301 <row>
284 <entry><constant>V4L2_CID_LASTP1</constant></entry> 302 <entry><constant>V4L2_CID_LASTP1</constant></entry>
285 <entry></entry> 303 <entry></entry>
286 <entry>End of the predefined control IDs (currently 304 <entry>End of the predefined control IDs (currently
287<constant>V4L2_CID_COLORFX</constant> + 1).</entry> 305<constant>V4L2_CID_BG_COLOR</constant> + 1).</entry>
288 </row> 306 </row>
289 <row> 307 <row>
290 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> 308 <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry>
diff --git a/Documentation/DocBook/v4l/io.xml b/Documentation/DocBook/v4l/io.xml
index f92f24323b2a..e870330cbf77 100644
--- a/Documentation/DocBook/v4l/io.xml
+++ b/Documentation/DocBook/v4l/io.xml
@@ -589,7 +589,8 @@ number of a video input as in &v4l2-input; field
589 <entry></entry> 589 <entry></entry>
590 <entry>A place holder for future extensions and custom 590 <entry>A place holder for future extensions and custom
591(driver defined) buffer types 591(driver defined) buffer types
592<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher.</entry> 592<constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
593should set this to 0.</entry>
593 </row> 594 </row>
594 </tbody> 595 </tbody>
595 </tgroup> 596 </tgroup>
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml
index 7d396a3785f5..885968d6a2fc 100644
--- a/Documentation/DocBook/v4l/pixfmt.xml
+++ b/Documentation/DocBook/v4l/pixfmt.xml
@@ -770,6 +770,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm
770 <entry>'S920'</entry> 770 <entry>'S920'</entry>
771 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> 771 <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry>
772 </row> 772 </row>
773 <row id="V4L2-PIX-FMT-STV0680">
774 <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry>
775 <entry>'S680'</entry>
776 <entry>Bayer format of the gspca stv0680 driver.</entry>
777 </row>
773 <row id="V4L2-PIX-FMT-WNVA"> 778 <row id="V4L2-PIX-FMT-WNVA">
774 <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry> 779 <entry><constant>V4L2_PIX_FMT_WNVA</constant></entry>
775 <entry>'WNVA'</entry> 780 <entry>'WNVA'</entry>
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml
index 937b4157a5d0..060105af49e5 100644
--- a/Documentation/DocBook/v4l/v4l2.xml
+++ b/Documentation/DocBook/v4l/v4l2.xml
@@ -74,6 +74,17 @@ Remote Controller chapter.</contrib>
74 </address> 74 </address>
75 </affiliation> 75 </affiliation>
76 </author> 76 </author>
77
78 <author>
79 <firstname>Muralidharan</firstname>
80 <surname>Karicheri</surname>
81 <contrib>Documented the Digital Video timings API.</contrib>
82 <affiliation>
83 <address>
84 <email>m-karicheri2@ti.com</email>
85 </address>
86 </affiliation>
87 </author>
77 </authorgroup> 88 </authorgroup>
78 89
79 <copyright> 90 <copyright>
@@ -89,7 +100,7 @@ Remote Controller chapter.</contrib>
89 <year>2008</year> 100 <year>2008</year>
90 <year>2009</year> 101 <year>2009</year>
91 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin 102 <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
92Rubli, Andy Walls, Mauro Carvalho Chehab</holder> 103Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
93 </copyright> 104 </copyright>
94 <legalnotice> 105 <legalnotice>
95 <para>Except when explicitly stated as GPL, programming examples within 106 <para>Except when explicitly stated as GPL, programming examples within
@@ -103,6 +114,13 @@ structs, ioctls) must be noted in more detail in the history chapter
103applications. --> 114applications. -->
104 115
105 <revision> 116 <revision>
117 <revnumber>2.6.33</revnumber>
118 <date>2009-12-03</date>
119 <authorinitials>mk</authorinitials>
120 <revremark>Added documentation for the Digital Video timings API.</revremark>
121 </revision>
122
123 <revision>
106 <revnumber>2.6.32</revnumber> 124 <revnumber>2.6.32</revnumber>
107 <date>2009-08-31</date> 125 <date>2009-08-31</date>
108 <authorinitials>mcc</authorinitials> 126 <authorinitials>mcc</authorinitials>
@@ -355,7 +373,7 @@ and discussions on the V4L mailing list.</revremark>
355</partinfo> 373</partinfo>
356 374
357<title>Video for Linux Two API Specification</title> 375<title>Video for Linux Two API Specification</title>
358 <subtitle>Revision 2.6.32</subtitle> 376 <subtitle>Revision 2.6.33</subtitle>
359 377
360 <chapter id="common"> 378 <chapter id="common">
361 &sub-common; 379 &sub-common;
@@ -411,6 +429,7 @@ and discussions on the V4L mailing list.</revremark>
411 &sub-encoder-cmd; 429 &sub-encoder-cmd;
412 &sub-enumaudio; 430 &sub-enumaudio;
413 &sub-enumaudioout; 431 &sub-enumaudioout;
432 &sub-enum-dv-presets;
414 &sub-enum-fmt; 433 &sub-enum-fmt;
415 &sub-enum-framesizes; 434 &sub-enum-framesizes;
416 &sub-enum-frameintervals; 435 &sub-enum-frameintervals;
@@ -421,6 +440,8 @@ and discussions on the V4L mailing list.</revremark>
421 &sub-g-audioout; 440 &sub-g-audioout;
422 &sub-g-crop; 441 &sub-g-crop;
423 &sub-g-ctrl; 442 &sub-g-ctrl;
443 &sub-g-dv-preset;
444 &sub-g-dv-timings;
424 &sub-g-enc-index; 445 &sub-g-enc-index;
425 &sub-g-ext-ctrls; 446 &sub-g-ext-ctrls;
426 &sub-g-fbuf; 447 &sub-g-fbuf;
@@ -441,6 +462,7 @@ and discussions on the V4L mailing list.</revremark>
441 &sub-querybuf; 462 &sub-querybuf;
442 &sub-querycap; 463 &sub-querycap;
443 &sub-queryctrl; 464 &sub-queryctrl;
465 &sub-query-dv-preset;
444 &sub-querystd; 466 &sub-querystd;
445 &sub-reqbufs; 467 &sub-reqbufs;
446 &sub-s-hw-freq-seek; 468 &sub-s-hw-freq-seek;
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml
index 97002060ac4f..068325940658 100644
--- a/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/Documentation/DocBook/v4l/videodev2.h.xml
@@ -363,6 +363,7 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> {
363#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 363#define <link linkend="V4L2-PIX-FMT-OV511">V4L2_PIX_FMT_OV511</link> v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
364#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 364#define <link linkend="V4L2-PIX-FMT-OV518">V4L2_PIX_FMT_OV518</link> v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
365#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ 365#define <link linkend="V4L2-PIX-FMT-TM6000">V4L2_PIX_FMT_TM6000</link> v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
366#define <link linkend="V4L2-PIX-FMT-STV0680">V4L2_PIX_FMT_STV0680</link> v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
366 367
367/* 368/*
368 * F O R M A T E N U M E R A T I O N 369 * F O R M A T E N U M E R A T I O N
@@ -492,7 +493,7 @@ struct <link linkend="v4l2-jpegcompression">v4l2_jpegcompression</link> {
492 * you do, leave them untouched. 493 * you do, leave them untouched.
493 * Inluding less markers will make the 494 * Inluding less markers will make the
494 * resulting code smaller, but there will 495 * resulting code smaller, but there will
495 * be fewer aplications which can read it. 496 * be fewer applications which can read it.
496 * The presence of the APP and COM marker 497 * The presence of the APP and COM marker
497 * is influenced by APP_len and COM_len 498 * is influenced by APP_len and COM_len
498 * ONLY, not by this property! */ 499 * ONLY, not by this property! */
@@ -565,6 +566,7 @@ struct <link linkend="v4l2-framebuffer">v4l2_framebuffer</link> {
565#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 566#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
566#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 567#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
567#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 568#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
569#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
568/* Flags for the 'flags' field. */ 570/* Flags for the 'flags' field. */
569#define V4L2_FBUF_FLAG_PRIMARY 0x0001 571#define V4L2_FBUF_FLAG_PRIMARY 0x0001
570#define V4L2_FBUF_FLAG_OVERLAY 0x0002 572#define V4L2_FBUF_FLAG_OVERLAY 0x0002
@@ -572,6 +574,7 @@ struct <link linkend="v4l2-framebuffer">v4l2_framebuffer</link> {
572#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 574#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
573#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 575#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
574#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 576#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
577#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
575 578
576struct <link linkend="v4l2-clip">v4l2_clip</link> { 579struct <link linkend="v4l2-clip">v4l2_clip</link> {
577 struct <link linkend="v4l2-rect">v4l2_rect</link> c; 580 struct <link linkend="v4l2-rect">v4l2_rect</link> c;
@@ -731,6 +734,99 @@ struct <link linkend="v4l2-standard">v4l2_standard</link> {
731}; 734};
732 735
733/* 736/*
737 * V I D E O T I M I N G S D V P R E S E T
738 */
739struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link> {
740 __u32 preset;
741 __u32 reserved[4];
742};
743
744/*
745 * D V P R E S E T S E N U M E R A T I O N
746 */
747struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link> {
748 __u32 index;
749 __u32 preset;
750 __u8 name[32]; /* Name of the preset timing */
751 __u32 width;
752 __u32 height;
753 __u32 reserved[4];
754};
755
756/*
757 * D V P R E S E T V A L U E S
758 */
759#define V4L2_DV_INVALID 0
760#define V4L2_DV_480P59_94 1 /* BT.1362 */
761#define V4L2_DV_576P50 2 /* BT.1362 */
762#define V4L2_DV_720P24 3 /* SMPTE 296M */
763#define V4L2_DV_720P25 4 /* SMPTE 296M */
764#define V4L2_DV_720P30 5 /* SMPTE 296M */
765#define V4L2_DV_720P50 6 /* SMPTE 296M */
766#define V4L2_DV_720P59_94 7 /* SMPTE 274M */
767#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
768#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
769#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
770#define V4L2_DV_1080I25 11 /* BT.1120 */
771#define V4L2_DV_1080I50 12 /* SMPTE 296M */
772#define V4L2_DV_1080I60 13 /* SMPTE 296M */
773#define V4L2_DV_1080P24 14 /* SMPTE 296M */
774#define V4L2_DV_1080P25 15 /* SMPTE 296M */
775#define V4L2_DV_1080P30 16 /* SMPTE 296M */
776#define V4L2_DV_1080P50 17 /* BT.1120 */
777#define V4L2_DV_1080P60 18 /* BT.1120 */
778
779/*
780 * D V B T T I M I N G S
781 */
782
783/* BT.656/BT.1120 timing data */
784struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> {
785 __u32 width; /* width in pixels */
786 __u32 height; /* height in lines */
787 __u32 interlaced; /* Interlaced or progressive */
788 __u32 polarities; /* Positive or negative polarity */
789 __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz-&gt;74250000 */
790 __u32 hfrontporch; /* Horizpontal front porch in pixels */
791 __u32 hsync; /* Horizontal Sync length in pixels */
792 __u32 hbackporch; /* Horizontal back porch in pixels */
793 __u32 vfrontporch; /* Vertical front porch in pixels */
794 __u32 vsync; /* Vertical Sync length in lines */
795 __u32 vbackporch; /* Vertical back porch in lines */
796 __u32 il_vfrontporch; /* Vertical front porch for bottom field of
797 * interlaced field formats
798 */
799 __u32 il_vsync; /* Vertical sync length for bottom field of
800 * interlaced field formats
801 */
802 __u32 il_vbackporch; /* Vertical back porch for bottom field of
803 * interlaced field formats
804 */
805 __u32 reserved[16];
806} __attribute__ ((packed));
807
808/* Interlaced or progressive format */
809#define V4L2_DV_PROGRESSIVE 0
810#define V4L2_DV_INTERLACED 1
811
812/* Polarities. If bit is not set, it is assumed to be negative polarity */
813#define V4L2_DV_VSYNC_POS_POL 0x00000001
814#define V4L2_DV_HSYNC_POS_POL 0x00000002
815
816
817/* DV timings */
818struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link> {
819 __u32 type;
820 union {
821 struct <link linkend="v4l2-bt-timings">v4l2_bt_timings</link> bt;
822 __u32 reserved[32];
823 };
824} __attribute__ ((packed));
825
826/* Values for the type field */
827#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
828
829/*
734 * V I D E O I N P U T S 830 * V I D E O I N P U T S
735 */ 831 */
736struct <link linkend="v4l2-input">v4l2_input</link> { 832struct <link linkend="v4l2-input">v4l2_input</link> {
@@ -741,7 +837,8 @@ struct <link linkend="v4l2-input">v4l2_input</link> {
741 __u32 tuner; /* Associated tuner */ 837 __u32 tuner; /* Associated tuner */
742 v4l2_std_id std; 838 v4l2_std_id std;
743 __u32 status; 839 __u32 status;
744 __u32 reserved[4]; 840 __u32 capabilities;
841 __u32 reserved[3];
745}; 842};
746 843
747/* Values for the 'type' field */ 844/* Values for the 'type' field */
@@ -772,6 +869,11 @@ struct <link linkend="v4l2-input">v4l2_input</link> {
772#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ 869#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
773#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ 870#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
774 871
872/* capabilities flags */
873#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
874#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
875#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
876
775/* 877/*
776 * V I D E O O U T P U T S 878 * V I D E O O U T P U T S
777 */ 879 */
@@ -782,13 +884,19 @@ struct <link linkend="v4l2-output">v4l2_output</link> {
782 __u32 audioset; /* Associated audios (bitfield) */ 884 __u32 audioset; /* Associated audios (bitfield) */
783 __u32 modulator; /* Associated modulator */ 885 __u32 modulator; /* Associated modulator */
784 v4l2_std_id std; 886 v4l2_std_id std;
785 __u32 reserved[4]; 887 __u32 capabilities;
888 __u32 reserved[3];
786}; 889};
787/* Values for the 'type' field */ 890/* Values for the 'type' field */
788#define V4L2_OUTPUT_TYPE_MODULATOR 1 891#define V4L2_OUTPUT_TYPE_MODULATOR 1
789#define V4L2_OUTPUT_TYPE_ANALOG 2 892#define V4L2_OUTPUT_TYPE_ANALOG 2
790#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 893#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
791 894
895/* capabilities flags */
896#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
897#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
898#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
899
792/* 900/*
793 * C O N T R O L S 901 * C O N T R O L S
794 */ 902 */
@@ -914,8 +1022,10 @@ enum <link linkend="v4l2-colorfx">v4l2_colorfx</link> {
914#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 1022#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
915#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 1023#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
916 1024
1025#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
1026#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
917/* last CID + 1 */ 1027/* last CID + 1 */
918#define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) 1028#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36)
919 1029
920/* MPEG-class control IDs defined by V4L2 */ 1030/* MPEG-class control IDs defined by V4L2 */
921#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1031#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1621,6 +1731,13 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> {
1621#endif 1731#endif
1622 1732
1623#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>) 1733#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct <link linkend="v4l2-hw-freq-seek">v4l2_hw_freq_seek</link>)
1734#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct <link linkend="v4l2-dv-enum-preset">v4l2_dv_enum_preset</link>)
1735#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
1736#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
1737#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct <link linkend="v4l2-dv-preset">v4l2_dv_preset</link>)
1738#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1739#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct <link linkend="v4l2-dv-timings">v4l2_dv_timings</link>)
1740
1624/* Reminder: when adding new ioctls please add support for them to 1741/* Reminder: when adding new ioctls please add support for them to
1625 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1742 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1626 1743
diff --git a/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml b/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml
new file mode 100644
index 000000000000..1d31427edd1b
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-enum-dv-presets.xml
@@ -0,0 +1,238 @@
1<refentry id="vidioc-enum-dv-presets">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_ENUM_DV_PRESETS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_ENUM_DV_PRESETS</refname>
9 <refpurpose>Enumerate supported Digital Video presets</refpurpose>
10 </refnamediv>
11
12 <refsynopsisdiv>
13 <funcsynopsis>
14 <funcprototype>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_dv_enum_preset *<parameter>argp</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>Arguments</title>
25
26 <variablelist>
27 <varlistentry>
28 <term><parameter>fd</parameter></term>
29 <listitem>
30 <para>&fd;</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>request</parameter></term>
35 <listitem>
36 <para>VIDIOC_ENUM_DV_PRESETS</para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>argp</parameter></term>
41 <listitem>
42 <para></para>
43 </listitem>
44 </varlistentry>
45 </variablelist>
46 </refsect1>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para>To query the attributes of a DV preset, applications initialize the
52<structfield>index</structfield> field and zero the reserved array of &v4l2-dv-enum-preset;
53and call the <constant>VIDIOC_ENUM_DV_PRESETS</constant> ioctl with a pointer to this
54structure. Drivers fill the rest of the structure or return an
55&EINVAL; when the index is out of bounds. To enumerate all DV Presets supported,
56applications shall begin at index zero, incrementing by one until the
57driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a
58different set of DV presets after switching the video input or
59output.</para>
60
61 <table pgwide="1" frame="none" id="v4l2-dv-enum-preset">
62 <title>struct <structname>v4l2_dv_enum_presets</structname></title>
63 <tgroup cols="3">
64 &cs-str;
65 <tbody valign="top">
66 <row>
67 <entry>__u32</entry>
68 <entry><structfield>index</structfield></entry>
69 <entry>Number of the DV preset, set by the
70application.</entry>
71 </row>
72 <row>
73 <entry>__u32</entry>
74 <entry><structfield>preset</structfield></entry>
75 <entry>This field identifies one of the DV preset values listed in <xref linkend="v4l2-dv-presets-vals"/>.</entry>
76 </row>
77 <row>
78 <entry>__u8</entry>
79 <entry><structfield>name</structfield>[24]</entry>
80 <entry>Name of the preset, a NUL-terminated ASCII string, for example: "720P-60", "1080I-60". This information is
81intended for the user.</entry>
82 </row>
83 <row>
84 <entry>__u32</entry>
85 <entry><structfield>width</structfield></entry>
86 <entry>Width of the active video in pixels for the DV preset.</entry>
87 </row>
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>height</structfield></entry>
91 <entry>Height of the active video in lines for the DV preset.</entry>
92 </row>
93 <row>
94 <entry>__u32</entry>
95 <entry><structfield>reserved</structfield>[4]</entry>
96 <entry>Reserved for future extensions. Drivers must set the array to zero.</entry>
97 </row>
98 </tbody>
99 </tgroup>
100 </table>
101
102 <table pgwide="1" frame="none" id="v4l2-dv-presets-vals">
103 <title>struct <structname>DV Presets</structname></title>
104 <tgroup cols="3">
105 &cs-str;
106 <tbody valign="top">
107 <row>
108 <entry>Preset</entry>
109 <entry>Preset value</entry>
110 <entry>Description</entry>
111 </row>
112 <row>
113 <entry></entry>
114 <entry></entry>
115 <entry></entry>
116 </row>
117 <row>
118 <entry>V4L2_DV_INVALID</entry>
119 <entry>0</entry>
120 <entry>Invalid preset value.</entry>
121 </row>
122 <row>
123 <entry>V4L2_DV_480P59_94</entry>
124 <entry>1</entry>
125 <entry>720x480 progressive video at 59.94 fps as per BT.1362.</entry>
126 </row>
127 <row>
128 <entry>V4L2_DV_576P50</entry>
129 <entry>2</entry>
130 <entry>720x576 progressive video at 50 fps as per BT.1362.</entry>
131 </row>
132 <row>
133 <entry>V4L2_DV_720P24</entry>
134 <entry>3</entry>
135 <entry>1280x720 progressive video at 24 fps as per SMPTE 296M.</entry>
136 </row>
137 <row>
138 <entry>V4L2_DV_720P25</entry>
139 <entry>4</entry>
140 <entry>1280x720 progressive video at 25 fps as per SMPTE 296M.</entry>
141 </row>
142 <row>
143 <entry>V4L2_DV_720P30</entry>
144 <entry>5</entry>
145 <entry>1280x720 progressive video at 30 fps as per SMPTE 296M.</entry>
146 </row>
147 <row>
148 <entry>V4L2_DV_720P50</entry>
149 <entry>6</entry>
150 <entry>1280x720 progressive video at 50 fps as per SMPTE 296M.</entry>
151 </row>
152 <row>
153 <entry>V4L2_DV_720P59_94</entry>
154 <entry>7</entry>
155 <entry>1280x720 progressive video at 59.94 fps as per SMPTE 274M.</entry>
156 </row>
157 <row>
158 <entry>V4L2_DV_720P60</entry>
159 <entry>8</entry>
160 <entry>1280x720 progressive video at 60 fps as per SMPTE 274M/296M.</entry>
161 </row>
162 <row>
163 <entry>V4L2_DV_1080I29_97</entry>
164 <entry>9</entry>
165 <entry>1920x1080 interlaced video at 29.97 fps as per BT.1120/SMPTE 274M.</entry>
166 </row>
167 <row>
168 <entry>V4L2_DV_1080I30</entry>
169 <entry>10</entry>
170 <entry>1920x1080 interlaced video at 30 fps as per BT.1120/SMPTE 274M.</entry>
171 </row>
172 <row>
173 <entry>V4L2_DV_1080I25</entry>
174 <entry>11</entry>
175 <entry>1920x1080 interlaced video at 25 fps as per BT.1120.</entry>
176 </row>
177 <row>
178 <entry>V4L2_DV_1080I50</entry>
179 <entry>12</entry>
180 <entry>1920x1080 interlaced video at 50 fps as per SMPTE 296M.</entry>
181 </row>
182 <row>
183 <entry>V4L2_DV_1080I60</entry>
184 <entry>13</entry>
185 <entry>1920x1080 interlaced video at 60 fps as per SMPTE 296M.</entry>
186 </row>
187 <row>
188 <entry>V4L2_DV_1080P24</entry>
189 <entry>14</entry>
190 <entry>1920x1080 progressive video at 24 fps as per SMPTE 296M.</entry>
191 </row>
192 <row>
193 <entry>V4L2_DV_1080P25</entry>
194 <entry>15</entry>
195 <entry>1920x1080 progressive video at 25 fps as per SMPTE 296M.</entry>
196 </row>
197 <row>
198 <entry>V4L2_DV_1080P30</entry>
199 <entry>16</entry>
200 <entry>1920x1080 progressive video at 30 fps as per SMPTE 296M.</entry>
201 </row>
202 <row>
203 <entry>V4L2_DV_1080P50</entry>
204 <entry>17</entry>
205 <entry>1920x1080 progressive video at 50 fps as per BT.1120.</entry>
206 </row>
207 <row>
208 <entry>V4L2_DV_1080P60</entry>
209 <entry>18</entry>
210 <entry>1920x1080 progressive video at 60 fps as per BT.1120.</entry>
211 </row>
212 </tbody>
213 </tgroup>
214 </table>
215 </refsect1>
216
217 <refsect1>
218 &return-value;
219
220 <variablelist>
221 <varlistentry>
222 <term><errorcode>EINVAL</errorcode></term>
223 <listitem>
224 <para>The &v4l2-dv-enum-preset; <structfield>index</structfield>
225is out of bounds.</para>
226 </listitem>
227 </varlistentry>
228 </variablelist>
229 </refsect1>
230</refentry>
231
232<!--
233Local Variables:
234mode: sgml
235sgml-parent-document: "v4l2.sgml"
236indent-tabs-mode: nil
237End:
238-->
diff --git a/Documentation/DocBook/v4l/vidioc-enuminput.xml b/Documentation/DocBook/v4l/vidioc-enuminput.xml
index 414856b82473..71b868e2fb8f 100644
--- a/Documentation/DocBook/v4l/vidioc-enuminput.xml
+++ b/Documentation/DocBook/v4l/vidioc-enuminput.xml
@@ -124,7 +124,13 @@ current input.</entry>
124 </row> 124 </row>
125 <row> 125 <row>
126 <entry>__u32</entry> 126 <entry>__u32</entry>
127 <entry><structfield>reserved</structfield>[4]</entry> 127 <entry><structfield>capabilities</structfield></entry>
128 <entry>This field provides capabilities for the
129input. See <xref linkend="input-capabilities" /> for flags.</entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>reserved</structfield>[3]</entry>
128 <entry>Reserved for future extensions. Drivers must set 134 <entry>Reserved for future extensions. Drivers must set
129the array to zero.</entry> 135the array to zero.</entry>
130 </row> 136 </row>
@@ -261,6 +267,34 @@ flag is set Macrovision has been detected.</entry>
261 </tbody> 267 </tbody>
262 </tgroup> 268 </tgroup>
263 </table> 269 </table>
270
271 <!-- Capability flags based on video timings RFC by Muralidharan
272Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
273input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
274 -->
275 <table frame="none" pgwide="1" id="input-capabilities">
276 <title>Input capabilities</title>
277 <tgroup cols="3">
278 &cs-def;
279 <tbody valign="top">
280 <row>
281 <entry><constant>V4L2_IN_CAP_PRESETS</constant></entry>
282 <entry>0x00000001</entry>
283 <entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
284 </row>
285 <row>
286 <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry>
287 <entry>0x00000002</entry>
288 <entry>This input supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry>
289 </row>
290 <row>
291 <entry><constant>V4L2_IN_CAP_STD</constant></entry>
292 <entry>0x00000004</entry>
293 <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
294 </row>
295 </tbody>
296 </tgroup>
297 </table>
264 </refsect1> 298 </refsect1>
265 299
266 <refsect1> 300 <refsect1>
diff --git a/Documentation/DocBook/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/v4l/vidioc-enumoutput.xml
index e8d16dcd50cf..a281d26a195f 100644
--- a/Documentation/DocBook/v4l/vidioc-enumoutput.xml
+++ b/Documentation/DocBook/v4l/vidioc-enumoutput.xml
@@ -114,7 +114,13 @@ details on video standards and how to switch see <xref
114 </row> 114 </row>
115 <row> 115 <row>
116 <entry>__u32</entry> 116 <entry>__u32</entry>
117 <entry><structfield>reserved</structfield>[4]</entry> 117 <entry><structfield>capabilities</structfield></entry>
118 <entry>This field provides capabilities for the
119output. See <xref linkend="output-capabilities" /> for flags.</entry>
120 </row>
121 <row>
122 <entry>__u32</entry>
123 <entry><structfield>reserved</structfield>[3]</entry>
118 <entry>Reserved for future extensions. Drivers must set 124 <entry>Reserved for future extensions. Drivers must set
119the array to zero.</entry> 125the array to zero.</entry>
120 </row> 126 </row>
@@ -147,6 +153,34 @@ CVBS, S-Video, RGB.</entry>
147 </tgroup> 153 </tgroup>
148 </table> 154 </table>
149 155
156 <!-- Capabilities flags based on video timings RFC by Muralidharan
157Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
158input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
159 -->
160 <table frame="none" pgwide="1" id="output-capabilities">
161 <title>Output capabilities</title>
162 <tgroup cols="3">
163 &cs-def;
164 <tbody valign="top">
165 <row>
166 <entry><constant>V4L2_OUT_CAP_PRESETS</constant></entry>
167 <entry>0x00000001</entry>
168 <entry>This output supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
169 </row>
170 <row>
171 <entry><constant>V4L2_OUT_CAP_CUSTOM_TIMINGS</constant></entry>
172 <entry>0x00000002</entry>
173 <entry>This output supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry>
174 </row>
175 <row>
176 <entry><constant>V4L2_OUT_CAP_STD</constant></entry>
177 <entry>0x00000004</entry>
178 <entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry>
179 </row>
180 </tbody>
181 </tgroup>
182 </table>
183
150 </refsect1> 184 </refsect1>
151 <refsect1> 185 <refsect1>
152 &return-value; 186 &return-value;
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
new file mode 100644
index 000000000000..3c6784e132f3
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-preset.xml
@@ -0,0 +1,111 @@
1<refentry id="vidioc-g-dv-preset">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_DV_PRESET</refname>
9 <refname>VIDIOC_S_DV_PRESET</refname>
10 <refpurpose>Query or select the DV preset of the current input or output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-preset;
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52 <para>To query and select the current DV preset, applications
53use the <constant>VIDIOC_G_DV_PRESET</constant> and <constant>VIDIOC_S_DV_PRESET</constant>
54ioctls which take a pointer to a &v4l2-dv-preset; type as argument.
55Applications must zero the reserved array in &v4l2-dv-preset;.
56<constant>VIDIOC_G_DV_PRESET</constant> returns a dv preset in the field
57<structfield>preset</structfield> of &v4l2-dv-preset;.</para>
58
59 <para><constant>VIDIOC_S_DV_PRESET</constant> accepts a pointer to a &v4l2-dv-preset;
60that has the preset value to be set. Applications must zero the reserved array in &v4l2-dv-preset;.
61If the preset is not supported, it returns an &EINVAL; </para>
62 </refsect1>
63
64 <refsect1>
65 &return-value;
66
67 <variablelist>
68 <varlistentry>
69 <term><errorcode>EINVAL</errorcode></term>
70 <listitem>
71 <para>This ioctl is not supported, or the
72<constant>VIDIOC_S_DV_PRESET</constant>,<constant>VIDIOC_S_DV_PRESET</constant> parameter was unsuitable.</para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><errorcode>EBUSY</errorcode></term>
77 <listitem>
78 <para>The device is busy and therefore can not change the preset.</para>
79 </listitem>
80 </varlistentry>
81 </variablelist>
82
83 <table pgwide="1" frame="none" id="v4l2-dv-preset">
84 <title>struct <structname>v4l2_dv_preset</structname></title>
85 <tgroup cols="3">
86 &cs-str;
87 <tbody valign="top">
88 <row>
89 <entry>__u32</entry>
90 <entry><structfield>preset</structfield></entry>
91 <entry>Preset value to represent the digital video timings</entry>
92 </row>
93 <row>
94 <entry>__u32</entry>
95 <entry><structfield>reserved[4]</structfield></entry>
96 <entry>Reserved fields for future use</entry>
97 </row>
98 </tbody>
99 </tgroup>
100 </table>
101
102 </refsect1>
103</refentry>
104
105<!--
106Local Variables:
107mode: sgml
108sgml-parent-document: "v4l2.sgml"
109indent-tabs-mode: nil
110End:
111-->
diff --git a/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
new file mode 100644
index 000000000000..ecc19576bb8f
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-g-dv-timings.xml
@@ -0,0 +1,224 @@
1<refentry id="vidioc-g-dv-timings">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_G_DV_TIMINGS</refname>
9 <refname>VIDIOC_S_DV_TIMINGS</refname>
10 <refpurpose>Get or set custom DV timings for input or output</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-timings;
20*<parameter>argp</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24
25 <refsect1>
26 <title>Arguments</title>
27
28 <variablelist>
29 <varlistentry>
30 <term><parameter>fd</parameter></term>
31 <listitem>
32 <para>&fd;</para>
33 </listitem>
34 </varlistentry>
35 <varlistentry>
36 <term><parameter>request</parameter></term>
37 <listitem>
38 <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
39 </listitem>
40 </varlistentry>
41 <varlistentry>
42 <term><parameter>argp</parameter></term>
43 <listitem>
44 <para></para>
45 </listitem>
46 </varlistentry>
47 </variablelist>
48 </refsect1>
49
50 <refsect1>
51 <title>Description</title>
52 <para>To set custom DV timings for the input or output, applications use the
53<constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current custom timings,
54applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
55information is filled in using the structure &v4l2-dv-timings;. These ioctls take
56a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
57or the timing values are not correct, the driver returns &EINVAL;.</para>
58 </refsect1>
59
60 <refsect1>
61 &return-value;
62
63 <variablelist>
64 <varlistentry>
65 <term><errorcode>EINVAL</errorcode></term>
66 <listitem>
67 <para>This ioctl is not supported, or the
68<constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
69 </listitem>
70 </varlistentry>
71 <varlistentry>
72 <term><errorcode>EBUSY</errorcode></term>
73 <listitem>
74 <para>The device is busy and therefore can not change the timings.</para>
75 </listitem>
76 </varlistentry>
77 </variablelist>
78
79 <table pgwide="1" frame="none" id="v4l2-bt-timings">
80 <title>struct <structname>v4l2_bt_timings</structname></title>
81 <tgroup cols="3">
82 &cs-str;
83 <tbody valign="top">
84 <row>
85 <entry>__u32</entry>
86 <entry><structfield>width</structfield></entry>
87 <entry>Width of the active video in pixels</entry>
88 </row>
89 <row>
90 <entry>__u32</entry>
91 <entry><structfield>height</structfield></entry>
92 <entry>Height of the active video in lines</entry>
93 </row>
94 <row>
95 <entry>__u32</entry>
96 <entry><structfield>interlaced</structfield></entry>
97 <entry>Progressive (0) or interlaced (1)</entry>
98 </row>
99 <row>
100 <entry>__u32</entry>
101 <entry><structfield>polarities</structfield></entry>
102 <entry>This is a bit mask that defines polarities of sync signals.
103bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set
104(1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
105 </row>
106 <row>
107 <entry>__u64</entry>
108 <entry><structfield>pixelclock</structfield></entry>
109 <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
110 </row>
111 <row>
112 <entry>__u32</entry>
113 <entry><structfield>hfrontporch</structfield></entry>
114 <entry>Horizontal front porch in pixels</entry>
115 </row>
116 <row>
117 <entry>__u32</entry>
118 <entry><structfield>hsync</structfield></entry>
119 <entry>Horizontal sync length in pixels</entry>
120 </row>
121 <row>
122 <entry>__u32</entry>
123 <entry><structfield>hbackporch</structfield></entry>
124 <entry>Horizontal back porch in pixels</entry>
125 </row>
126 <row>
127 <entry>__u32</entry>
128 <entry><structfield>vfrontporch</structfield></entry>
129 <entry>Vertical front porch in lines</entry>
130 </row>
131 <row>
132 <entry>__u32</entry>
133 <entry><structfield>vsync</structfield></entry>
134 <entry>Vertical sync length in lines</entry>
135 </row>
136 <row>
137 <entry>__u32</entry>
138 <entry><structfield>vbackporch</structfield></entry>
139 <entry>Vertical back porch in lines</entry>
140 </row>
141 <row>
142 <entry>__u32</entry>
143 <entry><structfield>il_vfrontporch</structfield></entry>
144 <entry>Vertical front porch in lines for bottom field of interlaced field formats</entry>
145 </row>
146 <row>
147 <entry>__u32</entry>
148 <entry><structfield>il_vsync</structfield></entry>
149 <entry>Vertical sync length in lines for bottom field of interlaced field formats</entry>
150 </row>
151 <row>
152 <entry>__u32</entry>
153 <entry><structfield>il_vbackporch</structfield></entry>
154 <entry>Vertical back porch in lines for bottom field of interlaced field formats</entry>
155 </row>
156 </tbody>
157 </tgroup>
158 </table>
159
160 <table pgwide="1" frame="none" id="v4l2-dv-timings">
161 <title>struct <structname>v4l2_dv_timings</structname></title>
162 <tgroup cols="4">
163 &cs-str;
164 <tbody valign="top">
165 <row>
166 <entry>__u32</entry>
167 <entry><structfield>type</structfield></entry>
168 <entry></entry>
169 <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
170 </row>
171 <row>
172 <entry>union</entry>
173 <entry><structfield></structfield></entry>
174 <entry></entry>
175 </row>
176 <row>
177 <entry></entry>
178 <entry>&v4l2-bt-timings;</entry>
179 <entry><structfield>bt</structfield></entry>
180 <entry>Timings defined by BT.656/1120 specifications</entry>
181 </row>
182 <row>
183 <entry></entry>
184 <entry>__u32</entry>
185 <entry><structfield>reserved</structfield>[32]</entry>
186 <entry></entry>
187 </row>
188 </tbody>
189 </tgroup>
190 </table>
191
192 <table pgwide="1" frame="none" id="dv-timing-types">
193 <title>DV Timing types</title>
194 <tgroup cols="3">
195 &cs-str;
196 <tbody valign="top">
197 <row>
198 <entry>Timing type</entry>
199 <entry>value</entry>
200 <entry>Description</entry>
201 </row>
202 <row>
203 <entry></entry>
204 <entry></entry>
205 <entry></entry>
206 </row>
207 <row>
208 <entry>V4L2_DV_BT_656_1120</entry>
209 <entry>0</entry>
210 <entry>BT.656/1120 timings</entry>
211 </row>
212 </tbody>
213 </tgroup>
214 </table>
215 </refsect1>
216</refentry>
217
218<!--
219Local Variables:
220mode: sgml
221sgml-parent-document: "v4l2.sgml"
222indent-tabs-mode: nil
223End:
224-->
diff --git a/Documentation/DocBook/v4l/vidioc-g-fbuf.xml b/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
index f7017062656e..e7dda4822f04 100644
--- a/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-fbuf.xml
@@ -336,6 +336,13 @@ alpha value. Alpha blending makes no sense for destructive overlays.</entry>
336inverted alpha channel of the framebuffer or VGA signal. Alpha 336inverted alpha channel of the framebuffer or VGA signal. Alpha
337blending makes no sense for destructive overlays.</entry> 337blending makes no sense for destructive overlays.</entry>
338 </row> 338 </row>
339 <row>
340 <entry><constant>V4L2_FBUF_CAP_SRC_CHROMAKEY</constant></entry>
341 <entry>0x0080</entry>
342 <entry>The device supports Source Chroma-keying. Framebuffer pixels
343with the chroma-key colors are replaced by video pixels, which is exactly opposite of
344<constant>V4L2_FBUF_CAP_CHROMAKEY</constant></entry>
345 </row>
339 </tbody> 346 </tbody>
340 </tgroup> 347 </tgroup>
341 </table> 348 </table>
@@ -411,6 +418,16 @@ images, but with an inverted alpha value. The blend function is:
411output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The 418output = framebuffer pixel * (1 - alpha) + video pixel * alpha. The
412actual alpha depth depends on the framebuffer pixel format.</entry> 419actual alpha depth depends on the framebuffer pixel format.</entry>
413 </row> 420 </row>
421 <row>
422 <entry><constant>V4L2_FBUF_FLAG_SRC_CHROMAKEY</constant></entry>
423 <entry>0x0040</entry>
424 <entry>Use source chroma-keying. The source chroma-key color is
425determined by the <structfield>chromakey</structfield> field of
426&v4l2-window; and negotiated with the &VIDIOC-S-FMT; ioctl, see <xref
427linkend="overlay" /> and <xref linkend="osd" />.
428Both chroma-keying are mutual exclusive to each other, so same
429<structfield>chromakey</structfield> field of &v4l2-window; is being used.</entry>
430 </row>
414 </tbody> 431 </tbody>
415 </tgroup> 432 </tgroup>
416 </table> 433 </table>
diff --git a/Documentation/DocBook/v4l/vidioc-g-parm.xml b/Documentation/DocBook/v4l/vidioc-g-parm.xml
index 78332d365ce9..392aa9e5571e 100644
--- a/Documentation/DocBook/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-parm.xml
@@ -55,7 +55,7 @@ captured or output, applications can request frame skipping or
55duplicating on the driver side. This is especially useful when using 55duplicating on the driver side. This is especially useful when using
56the <function>read()</function> or <function>write()</function>, which 56the <function>read()</function> or <function>write()</function>, which
57are not augmented by timestamps or sequence counters, and to avoid 57are not augmented by timestamps or sequence counters, and to avoid
58unneccessary data copying.</para> 58unnecessary data copying.</para>
59 59
60 <para>Further these ioctls can be used to determine the number of 60 <para>Further these ioctls can be used to determine the number of
61buffers used internally by a driver in read/write mode. For 61buffers used internally by a driver in read/write mode. For
diff --git a/Documentation/DocBook/v4l/vidioc-g-std.xml b/Documentation/DocBook/v4l/vidioc-g-std.xml
index b6f5d267e856..912f8513e5da 100644
--- a/Documentation/DocBook/v4l/vidioc-g-std.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-std.xml
@@ -86,6 +86,12 @@ standards.</para>
86<constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para> 86<constant>VIDIOC_S_STD</constant> parameter was unsuitable.</para>
87 </listitem> 87 </listitem>
88 </varlistentry> 88 </varlistentry>
89 <varlistentry>
90 <term><errorcode>EBUSY</errorcode></term>
91 <listitem>
92 <para>The device is busy and therefore can not change the standard</para>
93 </listitem>
94 </varlistentry>
89 </variablelist> 95 </variablelist>
90 </refsect1> 96 </refsect1>
91</refentry> 97</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-qbuf.xml b/Documentation/DocBook/v4l/vidioc-qbuf.xml
index 187081778154..b843bd7b3897 100644
--- a/Documentation/DocBook/v4l/vidioc-qbuf.xml
+++ b/Documentation/DocBook/v4l/vidioc-qbuf.xml
@@ -54,12 +54,10 @@ to enqueue an empty (capturing) or filled (output) buffer in the
54driver's incoming queue. The semantics depend on the selected I/O 54driver's incoming queue. The semantics depend on the selected I/O
55method.</para> 55method.</para>
56 56
57 <para>To enqueue a <link linkend="mmap">memory mapped</link> 57 <para>To enqueue a buffer applications set the <structfield>type</structfield>
58buffer applications set the <structfield>type</structfield> field of a 58field of a &v4l2-buffer; to the same buffer type as was previously used
59&v4l2-buffer; to the same buffer type as previously &v4l2-format; 59with &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
60<structfield>type</structfield> and &v4l2-requestbuffers; 60<structfield>type</structfield>. Applications must also set the
61<structfield>type</structfield>, the <structfield>memory</structfield>
62field to <constant>V4L2_MEMORY_MMAP</constant> and the
63<structfield>index</structfield> field. Valid index numbers range from 61<structfield>index</structfield> field. Valid index numbers range from
64zero to the number of buffers allocated with &VIDIOC-REQBUFS; 62zero to the number of buffers allocated with &VIDIOC-REQBUFS;
65(&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The 63(&v4l2-requestbuffers; <structfield>count</structfield>) minus one. The
@@ -70,8 +68,19 @@ intended for output (<structfield>type</structfield> is
70<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also 68<constant>V4L2_BUF_TYPE_VBI_OUTPUT</constant>) applications must also
71initialize the <structfield>bytesused</structfield>, 69initialize the <structfield>bytesused</structfield>,
72<structfield>field</structfield> and 70<structfield>field</structfield> and
73<structfield>timestamp</structfield> fields. See <xref 71<structfield>timestamp</structfield> fields, see <xref
74 linkend="buffer" /> for details. When 72linkend="buffer" /> for details.
73Applications must also set <structfield>flags</structfield> to 0. If a driver
74supports capturing from specific video inputs and you want to specify a video
75input, then <structfield>flags</structfield> should be set to
76<constant>V4L2_BUF_FLAG_INPUT</constant> and the field
77<structfield>input</structfield> must be initialized to the desired input.
78The <structfield>reserved</structfield> field must be set to 0.
79</para>
80
81 <para>To enqueue a <link linkend="mmap">memory mapped</link>
82buffer applications set the <structfield>memory</structfield>
83field to <constant>V4L2_MEMORY_MMAP</constant>. When
75<constant>VIDIOC_QBUF</constant> is called with a pointer to this 84<constant>VIDIOC_QBUF</constant> is called with a pointer to this
76structure the driver sets the 85structure the driver sets the
77<constant>V4L2_BUF_FLAG_MAPPED</constant> and 86<constant>V4L2_BUF_FLAG_MAPPED</constant> and
@@ -81,14 +90,10 @@ structure the driver sets the
81&EINVAL;.</para> 90&EINVAL;.</para>
82 91
83 <para>To enqueue a <link linkend="userp">user pointer</link> 92 <para>To enqueue a <link linkend="userp">user pointer</link>
84buffer applications set the <structfield>type</structfield> field of a 93buffer applications set the <structfield>memory</structfield>
85&v4l2-buffer; to the same buffer type as previously &v4l2-format; 94field to <constant>V4L2_MEMORY_USERPTR</constant>, the
86<structfield>type</structfield> and &v4l2-requestbuffers;
87<structfield>type</structfield>, the <structfield>memory</structfield>
88field to <constant>V4L2_MEMORY_USERPTR</constant> and the
89<structfield>m.userptr</structfield> field to the address of the 95<structfield>m.userptr</structfield> field to the address of the
90buffer and <structfield>length</structfield> to its size. When the 96buffer and <structfield>length</structfield> to its size.
91buffer is intended for output additional fields must be set as above.
92When <constant>VIDIOC_QBUF</constant> is called with a pointer to this 97When <constant>VIDIOC_QBUF</constant> is called with a pointer to this
93structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant> 98structure the driver sets the <constant>V4L2_BUF_FLAG_QUEUED</constant>
94flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and 99flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and
@@ -96,13 +101,14 @@ flag and clears the <constant>V4L2_BUF_FLAG_MAPPED</constant> and
96<structfield>flags</structfield> field, or it returns an error code. 101<structfield>flags</structfield> field, or it returns an error code.
97This ioctl locks the memory pages of the buffer in physical memory, 102This ioctl locks the memory pages of the buffer in physical memory,
98they cannot be swapped out to disk. Buffers remain locked until 103they cannot be swapped out to disk. Buffers remain locked until
99dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl are 104dequeued, until the &VIDIOC-STREAMOFF; or &VIDIOC-REQBUFS; ioctl is
100called, or until the device is closed.</para> 105called, or until the device is closed.</para>
101 106
102 <para>Applications call the <constant>VIDIOC_DQBUF</constant> 107 <para>Applications call the <constant>VIDIOC_DQBUF</constant>
103ioctl to dequeue a filled (capturing) or displayed (output) buffer 108ioctl to dequeue a filled (capturing) or displayed (output) buffer
104from the driver's outgoing queue. They just set the 109from the driver's outgoing queue. They just set the
105<structfield>type</structfield> and <structfield>memory</structfield> 110<structfield>type</structfield>, <structfield>memory</structfield>
111and <structfield>reserved</structfield>
106fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant> 112fields of a &v4l2-buffer; as above, when <constant>VIDIOC_DQBUF</constant>
107is called with a pointer to this structure the driver fills the 113is called with a pointer to this structure the driver fills the
108remaining fields or returns an error code.</para> 114remaining fields or returns an error code.</para>
diff --git a/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
new file mode 100644
index 000000000000..87e4f0f6151c
--- /dev/null
+++ b/Documentation/DocBook/v4l/vidioc-query-dv-preset.xml
@@ -0,0 +1,85 @@
1<refentry id="vidioc-query-dv-preset">
2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERY_DV_PRESET</refentrytitle>
4 &manvol;
5 </refmeta>
6
7 <refnamediv>
8 <refname>VIDIOC_QUERY_DV_PRESET</refname>
9 <refpurpose>Sense the DV preset received by the current
10input</refpurpose>
11 </refnamediv>
12
13 <refsynopsisdiv>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>int <function>ioctl</function></funcdef>
17 <paramdef>int <parameter>fd</parameter></paramdef>
18 <paramdef>int <parameter>request</parameter></paramdef>
19 <paramdef>&v4l2-dv-preset; *<parameter>argp</parameter></paramdef>
20 </funcprototype>
21 </funcsynopsis>
22 </refsynopsisdiv>
23
24 <refsect1>
25 <title>Arguments</title>
26
27 <variablelist>
28 <varlistentry>
29 <term><parameter>fd</parameter></term>
30 <listitem>
31 <para>&fd;</para>
32 </listitem>
33 </varlistentry>
34 <varlistentry>
35 <term><parameter>request</parameter></term>
36 <listitem>
37 <para>VIDIOC_QUERY_DV_PRESET</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>argp</parameter></term>
42 <listitem>
43 <para></para>
44 </listitem>
45 </varlistentry>
46 </variablelist>
47 </refsect1>
48
49 <refsect1>
50 <title>Description</title>
51
52 <para>The hardware may be able to detect the current DV preset
53automatically, similar to sensing the video standard. To do so, applications
54call <constant> VIDIOC_QUERY_DV_PRESET</constant> with a pointer to a
55&v4l2-dv-preset; type. Once the hardware detects a preset, that preset is
56returned in the preset field of &v4l2-dv-preset;. When detection is not
57possible or fails, the value V4L2_DV_INVALID is returned.</para>
58 </refsect1>
59
60 <refsect1>
61 &return-value;
62 <variablelist>
63 <varlistentry>
64 <term><errorcode>EINVAL</errorcode></term>
65 <listitem>
66 <para>This ioctl is not supported.</para>
67 </listitem>
68 </varlistentry>
69 <varlistentry>
70 <term><errorcode>EBUSY</errorcode></term>
71 <listitem>
72 <para>The device is busy and therefore can not sense the preset</para>
73 </listitem>
74 </varlistentry>
75 </variablelist>
76 </refsect1>
77</refentry>
78
79<!--
80Local Variables:
81mode: sgml
82sgml-parent-document: "v4l2.sgml"
83indent-tabs-mode: nil
84End:
85-->
diff --git a/Documentation/DocBook/v4l/vidioc-querybuf.xml b/Documentation/DocBook/v4l/vidioc-querybuf.xml
index d834993e6191..e649805a4908 100644
--- a/Documentation/DocBook/v4l/vidioc-querybuf.xml
+++ b/Documentation/DocBook/v4l/vidioc-querybuf.xml
@@ -54,12 +54,13 @@ buffer at any time after buffers have been allocated with the
54&VIDIOC-REQBUFS; ioctl.</para> 54&VIDIOC-REQBUFS; ioctl.</para>
55 55
56 <para>Applications set the <structfield>type</structfield> field 56 <para>Applications set the <structfield>type</structfield> field
57 of a &v4l2-buffer; to the same buffer type as previously 57 of a &v4l2-buffer; to the same buffer type as was previously used with
58&v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers; 58&v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
59<structfield>type</structfield>, and the <structfield>index</structfield> 59<structfield>type</structfield>, and the <structfield>index</structfield>
60 field. Valid index numbers range from zero 60 field. Valid index numbers range from zero
61to the number of buffers allocated with &VIDIOC-REQBUFS; 61to the number of buffers allocated with &VIDIOC-REQBUFS;
62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one. 62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
63The <structfield>reserved</structfield> field should to set to 0.
63After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to 64After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
64 this structure drivers return an error code or fill the rest of 65 this structure drivers return an error code or fill the rest of
65the structure.</para> 66the structure.</para>
@@ -68,8 +69,8 @@ the structure.</para>
68<constant>V4L2_BUF_FLAG_MAPPED</constant>, 69<constant>V4L2_BUF_FLAG_MAPPED</constant>,
69<constant>V4L2_BUF_FLAG_QUEUED</constant> and 70<constant>V4L2_BUF_FLAG_QUEUED</constant> and
70<constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The 71<constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
71<structfield>memory</structfield> field will be set to 72<structfield>memory</structfield> field will be set to the current
72<constant>V4L2_MEMORY_MMAP</constant>, the <structfield>m.offset</structfield> 73I/O method, the <structfield>m.offset</structfield>
73contains the offset of the buffer from the start of the device memory, 74contains the offset of the buffer from the start of the device memory,
74the <structfield>length</structfield> field its size. The driver may 75the <structfield>length</structfield> field its size. The driver may
75or may not set the remaining fields and flags, they are meaningless in 76or may not set the remaining fields and flags, they are meaningless in
diff --git a/Documentation/DocBook/v4l/vidioc-querystd.xml b/Documentation/DocBook/v4l/vidioc-querystd.xml
index b5a7ff934486..1a9e60393091 100644
--- a/Documentation/DocBook/v4l/vidioc-querystd.xml
+++ b/Documentation/DocBook/v4l/vidioc-querystd.xml
@@ -70,6 +70,12 @@ current video input or output.</para>
70 <para>This ioctl is not supported.</para> 70 <para>This ioctl is not supported.</para>
71 </listitem> 71 </listitem>
72 </varlistentry> 72 </varlistentry>
73 <varlistentry>
74 <term><errorcode>EBUSY</errorcode></term>
75 <listitem>
76 <para>The device is busy and therefore can not detect the standard</para>
77 </listitem>
78 </varlistentry>
73 </variablelist> 79 </variablelist>
74 </refsect1> 80 </refsect1>
75</refentry> 81</refentry>
diff --git a/Documentation/DocBook/v4l/vidioc-reqbufs.xml b/Documentation/DocBook/v4l/vidioc-reqbufs.xml
index bab38084454f..1c0816372074 100644
--- a/Documentation/DocBook/v4l/vidioc-reqbufs.xml
+++ b/Documentation/DocBook/v4l/vidioc-reqbufs.xml
@@ -54,23 +54,23 @@ I/O. Memory mapped buffers are located in device memory and must be
54allocated with this ioctl before they can be mapped into the 54allocated with this ioctl before they can be mapped into the
55application's address space. User buffers are allocated by 55application's address space. User buffers are allocated by
56applications themselves, and this ioctl is merely used to switch the 56applications themselves, and this ioctl is merely used to switch the
57driver into user pointer I/O mode.</para> 57driver into user pointer I/O mode and to setup some internal structures.</para>
58 58
59 <para>To allocate device buffers applications initialize three 59 <para>To allocate device buffers applications initialize all
60fields of a <structname>v4l2_requestbuffers</structname> structure. 60fields of the <structname>v4l2_requestbuffers</structname> structure.
61They set the <structfield>type</structfield> field to the respective 61They set the <structfield>type</structfield> field to the respective
62stream or buffer type, the <structfield>count</structfield> field to 62stream or buffer type, the <structfield>count</structfield> field to
63the desired number of buffers, and <structfield>memory</structfield> 63the desired number of buffers, <structfield>memory</structfield>
64must be set to <constant>V4L2_MEMORY_MMAP</constant>. When the ioctl 64must be set to the requested I/O method and the reserved array
65is called with a pointer to this structure the driver attempts to 65must be zeroed. When the ioctl
66allocate the requested number of buffers and stores the actual number 66is called with a pointer to this structure the driver will attempt to allocate
67the requested number of buffers and it stores the actual number
67allocated in the <structfield>count</structfield> field. It can be 68allocated in the <structfield>count</structfield> field. It can be
68smaller than the number requested, even zero, when the driver runs out 69smaller than the number requested, even zero, when the driver runs out
69of free memory. A larger number is possible when the driver requires 70of free memory. A larger number is also possible when the driver requires
70more buffers to function correctly.<footnote> 71more buffers to function correctly. For example video output requires at least two buffers,
71 <para>For example video output requires at least two buffers,
72one displayed and one filled by the application.</para> 72one displayed and one filled by the application.</para>
73 </footnote> When memory mapping I/O is not supported the ioctl 73 <para>When the I/O method is not supported the ioctl
74returns an &EINVAL;.</para> 74returns an &EINVAL;.</para>
75 75
76 <para>Applications can call <constant>VIDIOC_REQBUFS</constant> 76 <para>Applications can call <constant>VIDIOC_REQBUFS</constant>
@@ -81,14 +81,6 @@ in progress, an implicit &VIDIOC-STREAMOFF;. <!-- mhs: I see no
81reason why munmap()ping one or even all buffers must imply 81reason why munmap()ping one or even all buffers must imply
82streamoff.--></para> 82streamoff.--></para>
83 83
84 <para>To negotiate user pointer I/O, applications initialize only
85the <structfield>type</structfield> field and set
86<structfield>memory</structfield> to
87<constant>V4L2_MEMORY_USERPTR</constant>. When the ioctl is called
88with a pointer to this structure the driver prepares for user pointer
89I/O, when this I/O method is not supported the ioctl returns an
90&EINVAL;.</para>
91
92 <table pgwide="1" frame="none" id="v4l2-requestbuffers"> 84 <table pgwide="1" frame="none" id="v4l2-requestbuffers">
93 <title>struct <structname>v4l2_requestbuffers</structname></title> 85 <title>struct <structname>v4l2_requestbuffers</structname></title>
94 <tgroup cols="3"> 86 <tgroup cols="3">
@@ -97,9 +89,7 @@ I/O, when this I/O method is not supported the ioctl returns an
97 <row> 89 <row>
98 <entry>__u32</entry> 90 <entry>__u32</entry>
99 <entry><structfield>count</structfield></entry> 91 <entry><structfield>count</structfield></entry>
100 <entry>The number of buffers requested or granted. This 92 <entry>The number of buffers requested or granted.</entry>
101field is only used when <structfield>memory</structfield> is set to
102<constant>V4L2_MEMORY_MMAP</constant>.</entry>
103 </row> 93 </row>
104 <row> 94 <row>
105 <entry>&v4l2-buf-type;</entry> 95 <entry>&v4l2-buf-type;</entry>
@@ -120,7 +110,7 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref
120 <entry><structfield>reserved</structfield>[2]</entry> 110 <entry><structfield>reserved</structfield>[2]</entry>
121 <entry>A place holder for future extensions and custom 111 <entry>A place holder for future extensions and custom
122(driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and 112(driver defined) buffer types <constant>V4L2_BUF_TYPE_PRIVATE</constant> and
123higher.</entry> 113higher. This array should be zeroed by applications.</entry>
124 </row> 114 </row>
125 </tbody> 115 </tbody>
126 </tgroup> 116 </tgroup>
diff --git a/Documentation/DocBook/writing-an-alsa-driver.tmpl b/Documentation/DocBook/writing-an-alsa-driver.tmpl
index 7a2e0e98986a..0d0f7b4d4b1a 100644
--- a/Documentation/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/DocBook/writing-an-alsa-driver.tmpl
@@ -5318,7 +5318,7 @@ struct _snd_pcm_runtime {
5318 pages of the given size and map them onto the virtually contiguous 5318 pages of the given size and map them onto the virtually contiguous
5319 memory. The virtual pointer is addressed in runtime-&gt;dma_area. 5319 memory. The virtual pointer is addressed in runtime-&gt;dma_area.
5320 The physical address (runtime-&gt;dma_addr) is set to zero, 5320 The physical address (runtime-&gt;dma_addr) is set to zero,
5321 because the buffer is physically non-contigous. 5321 because the buffer is physically non-contiguous.
5322 The physical address table is set up in sgbuf-&gt;table. 5322 The physical address table is set up in sgbuf-&gt;table.
5323 You can get the physical address at a certain offset via 5323 You can get the physical address at a certain offset via
5324 <function>snd_pcm_sgbuf_get_addr()</function>. 5324 <function>snd_pcm_sgbuf_get_addr()</function>.
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 8495fc970391..f5395af88a41 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -221,8 +221,8 @@ branches. These different branches are:
221 - main 2.6.x kernel tree 221 - main 2.6.x kernel tree
222 - 2.6.x.y -stable kernel tree 222 - 2.6.x.y -stable kernel tree
223 - 2.6.x -git kernel patches 223 - 2.6.x -git kernel patches
224 - 2.6.x -mm kernel patches
225 - subsystem specific kernel trees and patches 224 - subsystem specific kernel trees and patches
225 - the 2.6.x -next kernel tree for integration tests
226 226
2272.6.x kernel tree 2272.6.x kernel tree
228----------------- 228-----------------
@@ -232,7 +232,7 @@ process is as follows:
232 - As soon as a new kernel is released a two weeks window is open, 232 - As soon as a new kernel is released a two weeks window is open,
233 during this period of time maintainers can submit big diffs to 233 during this period of time maintainers can submit big diffs to
234 Linus, usually the patches that have already been included in the 234 Linus, usually the patches that have already been included in the
235 -mm kernel for a few weeks. The preferred way to submit big changes 235 -next kernel for a few weeks. The preferred way to submit big changes
236 is using git (the kernel's source management tool, more information 236 is using git (the kernel's source management tool, more information
237 can be found at http://git.or.cz/) but plain patches are also just 237 can be found at http://git.or.cz/) but plain patches are also just
238 fine. 238 fine.
@@ -293,84 +293,43 @@ daily and represent the current state of Linus' tree. They are more
293experimental than -rc kernels since they are generated automatically 293experimental than -rc kernels since they are generated automatically
294without even a cursory glance to see if they are sane. 294without even a cursory glance to see if they are sane.
295 295
2962.6.x -mm kernel patches
297------------------------
298These are experimental kernel patches released by Andrew Morton. Andrew
299takes all of the different subsystem kernel trees and patches and mushes
300them together, along with a lot of patches that have been plucked from
301the linux-kernel mailing list. This tree serves as a proving ground for
302new features and patches. Once a patch has proved its worth in -mm for
303a while Andrew or the subsystem maintainer pushes it on to Linus for
304inclusion in mainline.
305
306It is heavily encouraged that all new patches get tested in the -mm tree
307before they are sent to Linus for inclusion in the main kernel tree. Code
308which does not make an appearance in -mm before the opening of the merge
309window will prove hard to merge into the mainline.
310
311These kernels are not appropriate for use on systems that are supposed
312to be stable and they are more risky to run than any of the other
313branches.
314
315If you wish to help out with the kernel development process, please test
316and use these kernel releases and provide feedback to the linux-kernel
317mailing list if you have any problems, and if everything works properly.
318
319In addition to all the other experimental patches, these kernels usually
320also contain any changes in the mainline -git kernels available at the
321time of release.
322
323The -mm kernels are not released on a fixed schedule, but usually a few
324-mm kernels are released in between each -rc kernel (1 to 3 is common).
325
326Subsystem Specific kernel trees and patches 296Subsystem Specific kernel trees and patches
327------------------------------------------- 297-------------------------------------------
328A number of the different kernel subsystem developers expose their 298The maintainers of the various kernel subsystems --- and also many
329development trees so that others can see what is happening in the 299kernel subsystem developers --- expose their current state of
330different areas of the kernel. These trees are pulled into the -mm 300development in source repositories. That way, others can see what is
331kernel releases as described above. 301happening in the different areas of the kernel. In areas where
332 302development is rapid, a developer may be asked to base his submissions
333Here is a list of some of the different kernel trees available: 303onto such a subsystem kernel tree so that conflicts between the
334 git trees: 304submission and other already ongoing work are avoided.
335 - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org> 305
336 git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git 306Most of these repositories are git trees, but there are also other SCMs
337 307in use, or patch queues being published as quilt series. Addresses of
338 - ACPI development tree, Len Brown <len.brown@intel.com> 308these subsystem repositories are listed in the MAINTAINERS file. Many
339 git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 309of them can be browsed at http://git.kernel.org/.
340 310
341 - Block development tree, Jens Axboe <jens.axboe@oracle.com> 311Before a proposed patch is committed to such a subsystem tree, it is
342 git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git 312subject to review which primarily happens on mailing lists (see the
343 313respective section below). For several kernel subsystems, this review
344 - DRM development tree, Dave Airlie <airlied@linux.ie> 314process is tracked with the tool patchwork. Patchwork offers a web
345 git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git 315interface which shows patch postings, any comments on a patch or
346 316revisions to it, and maintainers can mark patches as under review,
347 - ia64 development tree, Tony Luck <tony.luck@intel.com> 317accepted, or rejected. Most of these patchwork sites are listed at
348 git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git 318http://patchwork.kernel.org/ or http://patchwork.ozlabs.org/.
349 319
350 - infiniband, Roland Dreier <rolandd@cisco.com> 3202.6.x -next kernel tree for integration tests
351 git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git 321---------------------------------------------
352 322Before updates from subsystem trees are merged into the mainline 2.6.x
353 - libata, Jeff Garzik <jgarzik@pobox.com> 323tree, they need to be integration-tested. For this purpose, a special
354 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git 324testing repository exists into which virtually all subsystem trees are
355 325pulled on an almost daily basis:
356 - network drivers, Jeff Garzik <jgarzik@pobox.com> 326 http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git
357 git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git 327 http://linux.f-seidel.de/linux-next/pmwiki/
358 328
359 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> 329This way, the -next kernel gives a summary outlook onto what will be
360 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 330expected to go into the mainline kernel at the next merge period.
361 331Adventurous testers are very welcome to runtime-test the -next kernel.
362 - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
363 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
364
365 - x86, Ingo Molnar <mingo@elte.hu>
366 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
367
368 quilt trees:
369 - USB, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de>
370 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
371 332
372 Other kernel trees can be found listed at http://git.kernel.org/ and in
373 the MAINTAINERS file.
374 333
375Bug Reporting 334Bug Reporting
376------------- 335-------------
diff --git a/Documentation/IO-mapping.txt b/Documentation/IO-mapping.txt
index 78a440695e11..1b5aa10df845 100644
--- a/Documentation/IO-mapping.txt
+++ b/Documentation/IO-mapping.txt
@@ -157,7 +157,7 @@ For such memory, you can do things like
157 * access only the 640k-1MB area, so anything else 157 * access only the 640k-1MB area, so anything else
158 * has to be remapped. 158 * has to be remapped.
159 */ 159 */
160 char * baseptr = ioremap(0xFC000000, 1024*1024); 160 void __iomem *baseptr = ioremap(0xFC000000, 1024*1024);
161 161
162 /* write a 'A' to the offset 10 of the area */ 162 /* write a 'A' to the offset 10 of the area */
163 writeb('A',baseptr+10); 163 writeb('A',baseptr+10);
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt
index bc38283379f0..69dd29ed824e 100644
--- a/Documentation/IPMI.txt
+++ b/Documentation/IPMI.txt
@@ -365,6 +365,7 @@ You can change this at module load time (for a module) with:
365 regshifts=<shift1>,<shift2>,... 365 regshifts=<shift1>,<shift2>,...
366 slave_addrs=<addr1>,<addr2>,... 366 slave_addrs=<addr1>,<addr2>,...
367 force_kipmid=<enable1>,<enable2>,... 367 force_kipmid=<enable1>,<enable2>,...
368 kipmid_max_busy_us=<ustime1>,<ustime2>,...
368 unload_when_empty=[0|1] 369 unload_when_empty=[0|1]
369 370
370Each of these except si_trydefaults is a list, the first item for the 371Each of these except si_trydefaults is a list, the first item for the
@@ -433,6 +434,7 @@ kernel command line as:
433 ipmi_si.regshifts=<shift1>,<shift2>,... 434 ipmi_si.regshifts=<shift1>,<shift2>,...
434 ipmi_si.slave_addrs=<addr1>,<addr2>,... 435 ipmi_si.slave_addrs=<addr1>,<addr2>,...
435 ipmi_si.force_kipmid=<enable1>,<enable2>,... 436 ipmi_si.force_kipmid=<enable1>,<enable2>,...
437 ipmi_si.kipmid_max_busy_us=<ustime1>,<ustime2>,...
436 438
437It works the same as the module parameters of the same names. 439It works the same as the module parameters of the same names.
438 440
@@ -450,6 +452,16 @@ force this thread on or off. If you force it off and don't have
450interrupts, the driver will run VERY slowly. Don't blame me, 452interrupts, the driver will run VERY slowly. Don't blame me,
451these interfaces suck. 453these interfaces suck.
452 454
455Unfortunately, this thread can use a lot of CPU depending on the
456interface's performance. This can waste a lot of CPU and cause
457various issues with detecting idle CPU and using extra power. To
458avoid this, the kipmid_max_busy_us sets the maximum amount of time, in
459microseconds, that kipmid will spin before sleeping for a tick. This
460value sets a balance between performance and CPU waste and needs to be
461tuned to your needs. Maybe, someday, auto-tuning will be added, but
462that's not a simple thing and even the auto-tuning would need to be
463tuned to the user's desired performance.
464
453The driver supports a hot add and remove of interfaces. This way, 465The driver supports a hot add and remove of interfaces. This way,
454interfaces can be added or removed after the kernel is up and running. 466interfaces can be added or removed after the kernel is up and running.
455This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a 467This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 94b945733534..6fc7ea1d1f9d 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,3 +1,3 @@
1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ 1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
2 filesystems/configfs/ ia64/ networking/ \ 2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \
3 pcmcia/ spi/ video4linux/ vm/ watchdog/src/ 3 pcmcia/ spi/ timers/ video4linux/ vm/ watchdog/src/
diff --git a/Documentation/DMA-mapping.txt b/Documentation/PCI/PCI-DMA-mapping.txt
index 01f24e94bdb6..52618ab069ad 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/PCI/PCI-DMA-mapping.txt
@@ -1,12 +1,12 @@
1 Dynamic DMA mapping 1 Dynamic DMA mapping Guide
2 =================== 2 =========================
3 3
4 David S. Miller <davem@redhat.com> 4 David S. Miller <davem@redhat.com>
5 Richard Henderson <rth@cygnus.com> 5 Richard Henderson <rth@cygnus.com>
6 Jakub Jelinek <jakub@redhat.com> 6 Jakub Jelinek <jakub@redhat.com>
7 7
8This document describes the DMA mapping system in terms of the pci_ 8This is a guide to device driver writers on how to use the DMA API
9API. For a similar API that works for generic devices, see 9with example pseudo-code. For a concise description of the API, see
10DMA-API.txt. 10DMA-API.txt.
11 11
12Most of the 64bit platforms have special hardware that translates bus 12Most of the 64bit platforms have special hardware that translates bus
@@ -26,12 +26,15 @@ mapped only for the time they are actually used and unmapped after the DMA
26transfer. 26transfer.
27 27
28The following API will work of course even on platforms where no such 28The following API will work of course even on platforms where no such
29hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on 29hardware exists.
30top of the virt_to_bus interface. 30
31Note that the DMA API works with any bus independent of the underlying
32microprocessor architecture. You should use the DMA API rather than
33the bus specific DMA API (e.g. pci_dma_*).
31 34
32First of all, you should make sure 35First of all, you should make sure
33 36
34#include <linux/pci.h> 37#include <linux/dma-mapping.h>
35 38
36is in your driver. This file will obtain for you the definition of the 39is in your driver. This file will obtain for you the definition of the
37dma_addr_t (which can hold any valid DMA address for the platform) 40dma_addr_t (which can hold any valid DMA address for the platform)
@@ -78,44 +81,43 @@ for you to DMA from/to.
78 DMA addressing limitations 81 DMA addressing limitations
79 82
80Does your device have any DMA addressing limitations? For example, is 83Does your device have any DMA addressing limitations? For example, is
81your device only capable of driving the low order 24-bits of address 84your device only capable of driving the low order 24-bits of address?
82on the PCI bus for SAC DMA transfers? If so, you need to inform the 85If so, you need to inform the kernel of this fact.
83PCI layer of this fact.
84 86
85By default, the kernel assumes that your device can address the full 87By default, the kernel assumes that your device can address the full
8632-bits in a SAC cycle. For a 64-bit DAC capable device, this needs 8832-bits. For a 64-bit capable device, this needs to be increased.
87to be increased. And for a device with limitations, as discussed in 89And for a device with limitations, as discussed in the previous
88the previous paragraph, it needs to be decreased. 90paragraph, it needs to be decreased.
89 91
90pci_alloc_consistent() by default will return 32-bit DMA addresses. 92Special note about PCI: PCI-X specification requires PCI-X devices to
91PCI-X specification requires PCI-X devices to support 64-bit 93support 64-bit addressing (DAC) for all transactions. And at least
92addressing (DAC) for all transactions. And at least one platform (SGI 94one platform (SGI SN2) requires 64-bit consistent allocations to
93SN2) requires 64-bit consistent allocations to operate correctly when 95operate correctly when the IO bus is in PCI-X mode.
94the IO bus is in PCI-X mode. Therefore, like with pci_set_dma_mask(), 96
95it's good practice to call pci_set_consistent_dma_mask() to set the 97For correct operation, you must interrogate the kernel in your device
96appropriate mask even if your device only supports 32-bit DMA 98probe routine to see if the DMA controller on the machine can properly
97(default) and especially if it's a PCI-X device. 99support the DMA addressing limitation your device has. It is good
98 100style to do this even if your device holds the default setting,
99For correct operation, you must interrogate the PCI layer in your
100device probe routine to see if the PCI controller on the machine can
101properly support the DMA addressing limitation your device has. It is
102good style to do this even if your device holds the default setting,
103because this shows that you did think about these issues wrt. your 101because this shows that you did think about these issues wrt. your
104device. 102device.
105 103
106The query is performed via a call to pci_set_dma_mask(): 104The query is performed via a call to dma_set_mask():
107 105
108 int pci_set_dma_mask(struct pci_dev *pdev, u64 device_mask); 106 int dma_set_mask(struct device *dev, u64 mask);
109 107
110The query for consistent allocations is performed via a call to 108The query for consistent allocations is performed via a call to
111pci_set_consistent_dma_mask(): 109dma_set_coherent_mask():
112 110
113 int pci_set_consistent_dma_mask(struct pci_dev *pdev, u64 device_mask); 111 int dma_set_coherent_mask(struct device *dev, u64 mask);
114 112
115Here, pdev is a pointer to the PCI device struct of your device, and 113Here, dev is a pointer to the device struct of your device, and mask
116device_mask is a bit mask describing which bits of a PCI address your 114is a bit mask describing which bits of an address your device
117device supports. It returns zero if your card can perform DMA 115supports. It returns zero if your card can perform DMA properly on
118properly on the machine given the address mask you provided. 116the machine given the address mask you provided. In general, the
117device struct of your device is embedded in the bus specific device
118struct of your device. For example, a pointer to the device struct of
119your PCI device is pdev->dev (pdev is a pointer to the PCI device
120struct of your device).
119 121
120If it returns non-zero, your device cannot perform DMA properly on 122If it returns non-zero, your device cannot perform DMA properly on
121this platform, and attempting to do so will result in undefined 123this platform, and attempting to do so will result in undefined
@@ -133,31 +135,30 @@ of your driver reports that performance is bad or that the device is not
133even detected, you can ask them for the kernel messages to find out 135even detected, you can ask them for the kernel messages to find out
134exactly why. 136exactly why.
135 137
136The standard 32-bit addressing PCI device would do something like 138The standard 32-bit addressing device would do something like this:
137this:
138 139
139 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 140 if (dma_set_mask(dev, DMA_BIT_MASK(32))) {
140 printk(KERN_WARNING 141 printk(KERN_WARNING
141 "mydev: No suitable DMA available.\n"); 142 "mydev: No suitable DMA available.\n");
142 goto ignore_this_device; 143 goto ignore_this_device;
143 } 144 }
144 145
145Another common scenario is a 64-bit capable device. The approach 146Another common scenario is a 64-bit capable device. The approach here
146here is to try for 64-bit DAC addressing, but back down to a 147is to try for 64-bit addressing, but back down to a 32-bit mask that
14732-bit mask should that fail. The PCI platform code may fail the 148should not fail. The kernel may fail the 64-bit mask not because the
14864-bit mask not because the platform is not capable of 64-bit 149platform is not capable of 64-bit addressing. Rather, it may fail in
149addressing. Rather, it may fail in this case simply because 150this case simply because 32-bit addressing is done more efficiently
15032-bit SAC addressing is done more efficiently than DAC addressing. 151than 64-bit addressing. For example, Sparc64 PCI SAC addressing is
151Sparc64 is one platform which behaves in this way. 152more efficient than DAC addressing.
152 153
153Here is how you would handle a 64-bit capable device which can drive 154Here is how you would handle a 64-bit capable device which can drive
154all 64-bits when accessing streaming DMA: 155all 64-bits when accessing streaming DMA:
155 156
156 int using_dac; 157 int using_dac;
157 158
158 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { 159 if (!dma_set_mask(dev, DMA_BIT_MASK(64))) {
159 using_dac = 1; 160 using_dac = 1;
160 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 161 } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) {
161 using_dac = 0; 162 using_dac = 0;
162 } else { 163 } else {
163 printk(KERN_WARNING 164 printk(KERN_WARNING
@@ -170,36 +171,36 @@ the case would look like this:
170 171
171 int using_dac, consistent_using_dac; 172 int using_dac, consistent_using_dac;
172 173
173 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { 174 if (!dma_set_mask(dev, DMA_BIT_MASK(64))) {
174 using_dac = 1; 175 using_dac = 1;
175 consistent_using_dac = 1; 176 consistent_using_dac = 1;
176 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); 177 dma_set_coherent_mask(dev, DMA_BIT_MASK(64));
177 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 178 } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) {
178 using_dac = 0; 179 using_dac = 0;
179 consistent_using_dac = 0; 180 consistent_using_dac = 0;
180 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 181 dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
181 } else { 182 } else {
182 printk(KERN_WARNING 183 printk(KERN_WARNING
183 "mydev: No suitable DMA available.\n"); 184 "mydev: No suitable DMA available.\n");
184 goto ignore_this_device; 185 goto ignore_this_device;
185 } 186 }
186 187
187pci_set_consistent_dma_mask() will always be able to set the same or a 188dma_set_coherent_mask() will always be able to set the same or a
188smaller mask as pci_set_dma_mask(). However for the rare case that a 189smaller mask as dma_set_mask(). However for the rare case that a
189device driver only uses consistent allocations, one would have to 190device driver only uses consistent allocations, one would have to
190check the return value from pci_set_consistent_dma_mask(). 191check the return value from dma_set_coherent_mask().
191 192
192Finally, if your device can only drive the low 24-bits of 193Finally, if your device can only drive the low 24-bits of
193address during PCI bus mastering you might do something like: 194address you might do something like:
194 195
195 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) { 196 if (dma_set_mask(dev, DMA_BIT_MASK(24))) {
196 printk(KERN_WARNING 197 printk(KERN_WARNING
197 "mydev: 24-bit DMA addressing not available.\n"); 198 "mydev: 24-bit DMA addressing not available.\n");
198 goto ignore_this_device; 199 goto ignore_this_device;
199 } 200 }
200 201
201When pci_set_dma_mask() is successful, and returns zero, the PCI layer 202When dma_set_mask() is successful, and returns zero, the kernel saves
202saves away this mask you have provided. The PCI layer will use this 203away this mask you have provided. The kernel will use this
203information later when you make DMA mappings. 204information later when you make DMA mappings.
204 205
205There is a case which we are aware of at this time, which is worth 206There is a case which we are aware of at this time, which is worth
@@ -208,30 +209,30 @@ functions (for example a sound card provides playback and record
208functions) and the various different functions have _different_ 209functions) and the various different functions have _different_
209DMA addressing limitations, you may wish to probe each mask and 210DMA addressing limitations, you may wish to probe each mask and
210only provide the functionality which the machine can handle. It 211only provide the functionality which the machine can handle. It
211is important that the last call to pci_set_dma_mask() be for the 212is important that the last call to dma_set_mask() be for the
212most specific mask. 213most specific mask.
213 214
214Here is pseudo-code showing how this might be done: 215Here is pseudo-code showing how this might be done:
215 216
216 #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32) 217 #define PLAYBACK_ADDRESS_BITS DMA_BIT_MASK(32)
217 #define RECORD_ADDRESS_BITS 0x00ffffff 218 #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24)
218 219
219 struct my_sound_card *card; 220 struct my_sound_card *card;
220 struct pci_dev *pdev; 221 struct device *dev;
221 222
222 ... 223 ...
223 if (!pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) { 224 if (!dma_set_mask(dev, PLAYBACK_ADDRESS_BITS)) {
224 card->playback_enabled = 1; 225 card->playback_enabled = 1;
225 } else { 226 } else {
226 card->playback_enabled = 0; 227 card->playback_enabled = 0;
227 printk(KERN_WARN "%s: Playback disabled due to DMA limitations.\n", 228 printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n",
228 card->name); 229 card->name);
229 } 230 }
230 if (!pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) { 231 if (!dma_set_mask(dev, RECORD_ADDRESS_BITS)) {
231 card->record_enabled = 1; 232 card->record_enabled = 1;
232 } else { 233 } else {
233 card->record_enabled = 0; 234 card->record_enabled = 0;
234 printk(KERN_WARN "%s: Record disabled due to DMA limitations.\n", 235 printk(KERN_WARNING "%s: Record disabled due to DMA limitations.\n",
235 card->name); 236 card->name);
236 } 237 }
237 238
@@ -252,8 +253,8 @@ There are two types of DMA mappings:
252 Think of "consistent" as "synchronous" or "coherent". 253 Think of "consistent" as "synchronous" or "coherent".
253 254
254 The current default is to return consistent memory in the low 32 255 The current default is to return consistent memory in the low 32
255 bits of the PCI bus space. However, for future compatibility you 256 bits of the bus space. However, for future compatibility you should
256 should set the consistent mask even if this default is fine for your 257 set the consistent mask even if this default is fine for your
257 driver. 258 driver.
258 259
259 Good examples of what to use consistent mappings for are: 260 Good examples of what to use consistent mappings for are:
@@ -285,9 +286,9 @@ There are two types of DMA mappings:
285 found in PCI bridges (such as by reading a register's value 286 found in PCI bridges (such as by reading a register's value
286 after writing it). 287 after writing it).
287 288
288- Streaming DMA mappings which are usually mapped for one DMA transfer, 289- Streaming DMA mappings which are usually mapped for one DMA
289 unmapped right after it (unless you use pci_dma_sync_* below) and for which 290 transfer, unmapped right after it (unless you use dma_sync_* below)
290 hardware can optimize for sequential accesses. 291 and for which hardware can optimize for sequential accesses.
291 292
292 This of "streaming" as "asynchronous" or "outside the coherency 293 This of "streaming" as "asynchronous" or "outside the coherency
293 domain". 294 domain".
@@ -302,8 +303,8 @@ There are two types of DMA mappings:
302 optimizations the hardware allows. To this end, when using 303 optimizations the hardware allows. To this end, when using
303 such mappings you must be explicit about what you want to happen. 304 such mappings you must be explicit about what you want to happen.
304 305
305Neither type of DMA mapping has alignment restrictions that come 306Neither type of DMA mapping has alignment restrictions that come from
306from PCI, although some devices may have such restrictions. 307the underlying bus, although some devices may have such restrictions.
307Also, systems with caches that aren't DMA-coherent will work better 308Also, systems with caches that aren't DMA-coherent will work better
308when the underlying buffers don't share cache lines with other data. 309when the underlying buffers don't share cache lines with other data.
309 310
@@ -315,33 +316,27 @@ you should do:
315 316
316 dma_addr_t dma_handle; 317 dma_addr_t dma_handle;
317 318
318 cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle); 319 cpu_addr = dma_alloc_coherent(dev, size, &dma_handle, gfp);
319
320where pdev is a struct pci_dev *. This may be called in interrupt context.
321You should use dma_alloc_coherent (see DMA-API.txt) for buses
322where devices don't have struct pci_dev (like ISA, EISA).
323 320
324This argument is needed because the DMA translations may be bus 321where device is a struct device *. This may be called in interrupt
325specific (and often is private to the bus which the device is attached 322context with the GFP_ATOMIC flag.
326to).
327 323
328Size is the length of the region you want to allocate, in bytes. 324Size is the length of the region you want to allocate, in bytes.
329 325
330This routine will allocate RAM for that region, so it acts similarly to 326This routine will allocate RAM for that region, so it acts similarly to
331__get_free_pages (but takes size instead of a page order). If your 327__get_free_pages (but takes size instead of a page order). If your
332driver needs regions sized smaller than a page, you may prefer using 328driver needs regions sized smaller than a page, you may prefer using
333the pci_pool interface, described below. 329the dma_pool interface, described below.
334 330
335The consistent DMA mapping interfaces, for non-NULL pdev, will by 331The consistent DMA mapping interfaces, for non-NULL dev, will by
336default return a DMA address which is SAC (Single Address Cycle) 332default return a DMA address which is 32-bit addressable. Even if the
337addressable. Even if the device indicates (via PCI dma mask) that it 333device indicates (via DMA mask) that it may address the upper 32-bits,
338may address the upper 32-bits and thus perform DAC cycles, consistent 334consistent allocation will only return > 32-bit addresses for DMA if
339allocation will only return > 32-bit PCI addresses for DMA if the 335the consistent DMA mask has been explicitly changed via
340consistent dma mask has been explicitly changed via 336dma_set_coherent_mask(). This is true of the dma_pool interface as
341pci_set_consistent_dma_mask(). This is true of the pci_pool interface 337well.
342as well. 338
343 339dma_alloc_coherent returns two values: the virtual address which you
344pci_alloc_consistent returns two values: the virtual address which you
345can use to access it from the CPU and dma_handle which you pass to the 340can use to access it from the CPU and dma_handle which you pass to the
346card. 341card.
347 342
@@ -354,54 +349,54 @@ buffer you receive will not cross a 64K boundary.
354 349
355To unmap and free such a DMA region, you call: 350To unmap and free such a DMA region, you call:
356 351
357 pci_free_consistent(pdev, size, cpu_addr, dma_handle); 352 dma_free_coherent(dev, size, cpu_addr, dma_handle);
358 353
359where pdev, size are the same as in the above call and cpu_addr and 354where dev, size are the same as in the above call and cpu_addr and
360dma_handle are the values pci_alloc_consistent returned to you. 355dma_handle are the values dma_alloc_coherent returned to you.
361This function may not be called in interrupt context. 356This function may not be called in interrupt context.
362 357
363If your driver needs lots of smaller memory regions, you can write 358If your driver needs lots of smaller memory regions, you can write
364custom code to subdivide pages returned by pci_alloc_consistent, 359custom code to subdivide pages returned by dma_alloc_coherent,
365or you can use the pci_pool API to do that. A pci_pool is like 360or you can use the dma_pool API to do that. A dma_pool is like
366a kmem_cache, but it uses pci_alloc_consistent not __get_free_pages. 361a kmem_cache, but it uses dma_alloc_coherent not __get_free_pages.
367Also, it understands common hardware constraints for alignment, 362Also, it understands common hardware constraints for alignment,
368like queue heads needing to be aligned on N byte boundaries. 363like queue heads needing to be aligned on N byte boundaries.
369 364
370Create a pci_pool like this: 365Create a dma_pool like this:
371 366
372 struct pci_pool *pool; 367 struct dma_pool *pool;
373 368
374 pool = pci_pool_create(name, pdev, size, align, alloc); 369 pool = dma_pool_create(name, dev, size, align, alloc);
375 370
376The "name" is for diagnostics (like a kmem_cache name); pdev and size 371The "name" is for diagnostics (like a kmem_cache name); dev and size
377are as above. The device's hardware alignment requirement for this 372are as above. The device's hardware alignment requirement for this
378type of data is "align" (which is expressed in bytes, and must be a 373type of data is "align" (which is expressed in bytes, and must be a
379power of two). If your device has no boundary crossing restrictions, 374power of two). If your device has no boundary crossing restrictions,
380pass 0 for alloc; passing 4096 says memory allocated from this pool 375pass 0 for alloc; passing 4096 says memory allocated from this pool
381must not cross 4KByte boundaries (but at that time it may be better to 376must not cross 4KByte boundaries (but at that time it may be better to
382go for pci_alloc_consistent directly instead). 377go for dma_alloc_coherent directly instead).
383 378
384Allocate memory from a pci pool like this: 379Allocate memory from a dma pool like this:
385 380
386 cpu_addr = pci_pool_alloc(pool, flags, &dma_handle); 381 cpu_addr = dma_pool_alloc(pool, flags, &dma_handle);
387 382
388flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor 383flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor
389holding SMP locks), SLAB_ATOMIC otherwise. Like pci_alloc_consistent, 384holding SMP locks), SLAB_ATOMIC otherwise. Like dma_alloc_coherent,
390this returns two values, cpu_addr and dma_handle. 385this returns two values, cpu_addr and dma_handle.
391 386
392Free memory that was allocated from a pci_pool like this: 387Free memory that was allocated from a dma_pool like this:
393 388
394 pci_pool_free(pool, cpu_addr, dma_handle); 389 dma_pool_free(pool, cpu_addr, dma_handle);
395 390
396where pool is what you passed to pci_pool_alloc, and cpu_addr and 391where pool is what you passed to dma_pool_alloc, and cpu_addr and
397dma_handle are the values pci_pool_alloc returned. This function 392dma_handle are the values dma_pool_alloc returned. This function
398may be called in interrupt context. 393may be called in interrupt context.
399 394
400Destroy a pci_pool by calling: 395Destroy a dma_pool by calling:
401 396
402 pci_pool_destroy(pool); 397 dma_pool_destroy(pool);
403 398
404Make sure you've called pci_pool_free for all memory allocated 399Make sure you've called dma_pool_free for all memory allocated
405from a pool before you destroy the pool. This function may not 400from a pool before you destroy the pool. This function may not
406be called in interrupt context. 401be called in interrupt context.
407 402
@@ -411,15 +406,15 @@ The interfaces described in subsequent portions of this document
411take a DMA direction argument, which is an integer and takes on 406take a DMA direction argument, which is an integer and takes on
412one of the following values: 407one of the following values:
413 408
414 PCI_DMA_BIDIRECTIONAL 409 DMA_BIDIRECTIONAL
415 PCI_DMA_TODEVICE 410 DMA_TO_DEVICE
416 PCI_DMA_FROMDEVICE 411 DMA_FROM_DEVICE
417 PCI_DMA_NONE 412 DMA_NONE
418 413
419One should provide the exact DMA direction if you know it. 414One should provide the exact DMA direction if you know it.
420 415
421PCI_DMA_TODEVICE means "from main memory to the PCI device" 416DMA_TO_DEVICE means "from main memory to the device"
422PCI_DMA_FROMDEVICE means "from the PCI device to main memory" 417DMA_FROM_DEVICE means "from the device to main memory"
423It is the direction in which the data moves during the DMA 418It is the direction in which the data moves during the DMA
424transfer. 419transfer.
425 420
@@ -427,12 +422,12 @@ You are _strongly_ encouraged to specify this as precisely
427as you possibly can. 422as you possibly can.
428 423
429If you absolutely cannot know the direction of the DMA transfer, 424If you absolutely cannot know the direction of the DMA transfer,
430specify PCI_DMA_BIDIRECTIONAL. It means that the DMA can go in 425specify DMA_BIDIRECTIONAL. It means that the DMA can go in
431either direction. The platform guarantees that you may legally 426either direction. The platform guarantees that you may legally
432specify this, and that it will work, but this may be at the 427specify this, and that it will work, but this may be at the
433cost of performance for example. 428cost of performance for example.
434 429
435The value PCI_DMA_NONE is to be used for debugging. One can 430The value DMA_NONE is to be used for debugging. One can
436hold this in a data structure before you come to know the 431hold this in a data structure before you come to know the
437precise direction, and this will help catch cases where your 432precise direction, and this will help catch cases where your
438direction tracking logic has failed to set things up properly. 433direction tracking logic has failed to set things up properly.
@@ -442,21 +437,21 @@ potential platform-specific optimizations of such) is for debugging.
442Some platforms actually have a write permission boolean which DMA 437Some platforms actually have a write permission boolean which DMA
443mappings can be marked with, much like page protections in the user 438mappings can be marked with, much like page protections in the user
444program address space. Such platforms can and do report errors in the 439program address space. Such platforms can and do report errors in the
445kernel logs when the PCI controller hardware detects violation of the 440kernel logs when the DMA controller hardware detects violation of the
446permission setting. 441permission setting.
447 442
448Only streaming mappings specify a direction, consistent mappings 443Only streaming mappings specify a direction, consistent mappings
449implicitly have a direction attribute setting of 444implicitly have a direction attribute setting of
450PCI_DMA_BIDIRECTIONAL. 445DMA_BIDIRECTIONAL.
451 446
452The SCSI subsystem tells you the direction to use in the 447The SCSI subsystem tells you the direction to use in the
453'sc_data_direction' member of the SCSI command your driver is 448'sc_data_direction' member of the SCSI command your driver is
454working on. 449working on.
455 450
456For Networking drivers, it's a rather simple affair. For transmit 451For Networking drivers, it's a rather simple affair. For transmit
457packets, map/unmap them with the PCI_DMA_TODEVICE direction 452packets, map/unmap them with the DMA_TO_DEVICE direction
458specifier. For receive packets, just the opposite, map/unmap them 453specifier. For receive packets, just the opposite, map/unmap them
459with the PCI_DMA_FROMDEVICE direction specifier. 454with the DMA_FROM_DEVICE direction specifier.
460 455
461 Using Streaming DMA mappings 456 Using Streaming DMA mappings
462 457
@@ -467,43 +462,43 @@ scatterlist.
467 462
468To map a single region, you do: 463To map a single region, you do:
469 464
470 struct pci_dev *pdev = mydev->pdev; 465 struct device *dev = &my_dev->dev;
471 dma_addr_t dma_handle; 466 dma_addr_t dma_handle;
472 void *addr = buffer->ptr; 467 void *addr = buffer->ptr;
473 size_t size = buffer->len; 468 size_t size = buffer->len;
474 469
475 dma_handle = pci_map_single(pdev, addr, size, direction); 470 dma_handle = dma_map_single(dev, addr, size, direction);
476 471
477and to unmap it: 472and to unmap it:
478 473
479 pci_unmap_single(pdev, dma_handle, size, direction); 474 dma_unmap_single(dev, dma_handle, size, direction);
480 475
481You should call pci_unmap_single when the DMA activity is finished, e.g. 476You should call dma_unmap_single when the DMA activity is finished, e.g.
482from the interrupt which told you that the DMA transfer is done. 477from the interrupt which told you that the DMA transfer is done.
483 478
484Using cpu pointers like this for single mappings has a disadvantage, 479Using cpu pointers like this for single mappings has a disadvantage,
485you cannot reference HIGHMEM memory in this way. Thus, there is a 480you cannot reference HIGHMEM memory in this way. Thus, there is a
486map/unmap interface pair akin to pci_{map,unmap}_single. These 481map/unmap interface pair akin to dma_{map,unmap}_single. These
487interfaces deal with page/offset pairs instead of cpu pointers. 482interfaces deal with page/offset pairs instead of cpu pointers.
488Specifically: 483Specifically:
489 484
490 struct pci_dev *pdev = mydev->pdev; 485 struct device *dev = &my_dev->dev;
491 dma_addr_t dma_handle; 486 dma_addr_t dma_handle;
492 struct page *page = buffer->page; 487 struct page *page = buffer->page;
493 unsigned long offset = buffer->offset; 488 unsigned long offset = buffer->offset;
494 size_t size = buffer->len; 489 size_t size = buffer->len;
495 490
496 dma_handle = pci_map_page(pdev, page, offset, size, direction); 491 dma_handle = dma_map_page(dev, page, offset, size, direction);
497 492
498 ... 493 ...
499 494
500 pci_unmap_page(pdev, dma_handle, size, direction); 495 dma_unmap_page(dev, dma_handle, size, direction);
501 496
502Here, "offset" means byte offset within the given page. 497Here, "offset" means byte offset within the given page.
503 498
504With scatterlists, you map a region gathered from several regions by: 499With scatterlists, you map a region gathered from several regions by:
505 500
506 int i, count = pci_map_sg(pdev, sglist, nents, direction); 501 int i, count = dma_map_sg(dev, sglist, nents, direction);
507 struct scatterlist *sg; 502 struct scatterlist *sg;
508 503
509 for_each_sg(sglist, sg, count, i) { 504 for_each_sg(sglist, sg, count, i) {
@@ -527,16 +522,16 @@ accessed sg->address and sg->length as shown above.
527 522
528To unmap a scatterlist, just call: 523To unmap a scatterlist, just call:
529 524
530 pci_unmap_sg(pdev, sglist, nents, direction); 525 dma_unmap_sg(dev, sglist, nents, direction);
531 526
532Again, make sure DMA activity has already finished. 527Again, make sure DMA activity has already finished.
533 528
534PLEASE NOTE: The 'nents' argument to the pci_unmap_sg call must be 529PLEASE NOTE: The 'nents' argument to the dma_unmap_sg call must be
535 the _same_ one you passed into the pci_map_sg call, 530 the _same_ one you passed into the dma_map_sg call,
536 it should _NOT_ be the 'count' value _returned_ from the 531 it should _NOT_ be the 'count' value _returned_ from the
537 pci_map_sg call. 532 dma_map_sg call.
538 533
539Every pci_map_{single,sg} call should have its pci_unmap_{single,sg} 534Every dma_map_{single,sg} call should have its dma_unmap_{single,sg}
540counterpart, because the bus address space is a shared resource (although 535counterpart, because the bus address space is a shared resource (although
541in some ports the mapping is per each BUS so less devices contend for the 536in some ports the mapping is per each BUS so less devices contend for the
542same bus address space) and you could render the machine unusable by eating 537same bus address space) and you could render the machine unusable by eating
@@ -547,14 +542,14 @@ the data in between the DMA transfers, the buffer needs to be synced
547properly in order for the cpu and device to see the most uptodate and 542properly in order for the cpu and device to see the most uptodate and
548correct copy of the DMA buffer. 543correct copy of the DMA buffer.
549 544
550So, firstly, just map it with pci_map_{single,sg}, and after each DMA 545So, firstly, just map it with dma_map_{single,sg}, and after each DMA
551transfer call either: 546transfer call either:
552 547
553 pci_dma_sync_single_for_cpu(pdev, dma_handle, size, direction); 548 dma_sync_single_for_cpu(dev, dma_handle, size, direction);
554 549
555or: 550or:
556 551
557 pci_dma_sync_sg_for_cpu(pdev, sglist, nents, direction); 552 dma_sync_sg_for_cpu(dev, sglist, nents, direction);
558 553
559as appropriate. 554as appropriate.
560 555
@@ -562,27 +557,27 @@ Then, if you wish to let the device get at the DMA area again,
562finish accessing the data with the cpu, and then before actually 557finish accessing the data with the cpu, and then before actually
563giving the buffer to the hardware call either: 558giving the buffer to the hardware call either:
564 559
565 pci_dma_sync_single_for_device(pdev, dma_handle, size, direction); 560 dma_sync_single_for_device(dev, dma_handle, size, direction);
566 561
567or: 562or:
568 563
569 pci_dma_sync_sg_for_device(dev, sglist, nents, direction); 564 dma_sync_sg_for_device(dev, sglist, nents, direction);
570 565
571as appropriate. 566as appropriate.
572 567
573After the last DMA transfer call one of the DMA unmap routines 568After the last DMA transfer call one of the DMA unmap routines
574pci_unmap_{single,sg}. If you don't touch the data from the first pci_map_* 569dma_unmap_{single,sg}. If you don't touch the data from the first dma_map_*
575call till pci_unmap_*, then you don't have to call the pci_dma_sync_* 570call till dma_unmap_*, then you don't have to call the dma_sync_*
576routines at all. 571routines at all.
577 572
578Here is pseudo code which shows a situation in which you would need 573Here is pseudo code which shows a situation in which you would need
579to use the pci_dma_sync_*() interfaces. 574to use the dma_sync_*() interfaces.
580 575
581 my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) 576 my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len)
582 { 577 {
583 dma_addr_t mapping; 578 dma_addr_t mapping;
584 579
585 mapping = pci_map_single(cp->pdev, buffer, len, PCI_DMA_FROMDEVICE); 580 mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE);
586 581
587 cp->rx_buf = buffer; 582 cp->rx_buf = buffer;
588 cp->rx_len = len; 583 cp->rx_len = len;
@@ -606,25 +601,25 @@ to use the pci_dma_sync_*() interfaces.
606 * the DMA transfer with the CPU first 601 * the DMA transfer with the CPU first
607 * so that we see updated contents. 602 * so that we see updated contents.
608 */ 603 */
609 pci_dma_sync_single_for_cpu(cp->pdev, cp->rx_dma, 604 dma_sync_single_for_cpu(&cp->dev, cp->rx_dma,
610 cp->rx_len, 605 cp->rx_len,
611 PCI_DMA_FROMDEVICE); 606 DMA_FROM_DEVICE);
612 607
613 /* Now it is safe to examine the buffer. */ 608 /* Now it is safe to examine the buffer. */
614 hp = (struct my_card_header *) cp->rx_buf; 609 hp = (struct my_card_header *) cp->rx_buf;
615 if (header_is_ok(hp)) { 610 if (header_is_ok(hp)) {
616 pci_unmap_single(cp->pdev, cp->rx_dma, cp->rx_len, 611 dma_unmap_single(&cp->dev, cp->rx_dma, cp->rx_len,
617 PCI_DMA_FROMDEVICE); 612 DMA_FROM_DEVICE);
618 pass_to_upper_layers(cp->rx_buf); 613 pass_to_upper_layers(cp->rx_buf);
619 make_and_setup_new_rx_buf(cp); 614 make_and_setup_new_rx_buf(cp);
620 } else { 615 } else {
621 /* Just sync the buffer and give it back 616 /* Just sync the buffer and give it back
622 * to the card. 617 * to the card.
623 */ 618 */
624 pci_dma_sync_single_for_device(cp->pdev, 619 dma_sync_single_for_device(&cp->dev,
625 cp->rx_dma, 620 cp->rx_dma,
626 cp->rx_len, 621 cp->rx_len,
627 PCI_DMA_FROMDEVICE); 622 DMA_FROM_DEVICE);
628 give_rx_buf_to_card(cp); 623 give_rx_buf_to_card(cp);
629 } 624 }
630 } 625 }
@@ -634,19 +629,19 @@ Drivers converted fully to this interface should not use virt_to_bus any
634longer, nor should they use bus_to_virt. Some drivers have to be changed a 629longer, nor should they use bus_to_virt. Some drivers have to be changed a
635little bit, because there is no longer an equivalent to bus_to_virt in the 630little bit, because there is no longer an equivalent to bus_to_virt in the
636dynamic DMA mapping scheme - you have to always store the DMA addresses 631dynamic DMA mapping scheme - you have to always store the DMA addresses
637returned by the pci_alloc_consistent, pci_pool_alloc, and pci_map_single 632returned by the dma_alloc_coherent, dma_pool_alloc, and dma_map_single
638calls (pci_map_sg stores them in the scatterlist itself if the platform 633calls (dma_map_sg stores them in the scatterlist itself if the platform
639supports dynamic DMA mapping in hardware) in your driver structures and/or 634supports dynamic DMA mapping in hardware) in your driver structures and/or
640in the card registers. 635in the card registers.
641 636
642All PCI drivers should be using these interfaces with no exceptions. 637All drivers should be using these interfaces with no exceptions. It
643It is planned to completely remove virt_to_bus() and bus_to_virt() as 638is planned to completely remove virt_to_bus() and bus_to_virt() as
644they are entirely deprecated. Some ports already do not provide these 639they are entirely deprecated. Some ports already do not provide these
645as it is impossible to correctly support them. 640as it is impossible to correctly support them.
646 641
647 Optimizing Unmap State Space Consumption 642 Optimizing Unmap State Space Consumption
648 643
649On many platforms, pci_unmap_{single,page}() is simply a nop. 644On many platforms, dma_unmap_{single,page}() is simply a nop.
650Therefore, keeping track of the mapping address and length is a waste 645Therefore, keeping track of the mapping address and length is a waste
651of space. Instead of filling your drivers up with ifdefs and the like 646of space. Instead of filling your drivers up with ifdefs and the like
652to "work around" this (which would defeat the whole purpose of a 647to "work around" this (which would defeat the whole purpose of a
@@ -655,7 +650,7 @@ portable API) the following facilities are provided.
655Actually, instead of describing the macros one by one, we'll 650Actually, instead of describing the macros one by one, we'll
656transform some example code. 651transform some example code.
657 652
6581) Use DECLARE_PCI_UNMAP_{ADDR,LEN} in state saving structures. 6531) Use DEFINE_DMA_UNMAP_{ADDR,LEN} in state saving structures.
659 Example, before: 654 Example, before:
660 655
661 struct ring_state { 656 struct ring_state {
@@ -668,14 +663,11 @@ transform some example code.
668 663
669 struct ring_state { 664 struct ring_state {
670 struct sk_buff *skb; 665 struct sk_buff *skb;
671 DECLARE_PCI_UNMAP_ADDR(mapping) 666 DEFINE_DMA_UNMAP_ADDR(mapping);
672 DECLARE_PCI_UNMAP_LEN(len) 667 DEFINE_DMA_UNMAP_LEN(len);
673 }; 668 };
674 669
675 NOTE: DO NOT put a semicolon at the end of the DECLARE_*() 6702) Use dma_unmap_{addr,len}_set to set these values.
676 macro.
677
6782) Use pci_unmap_{addr,len}_set to set these values.
679 Example, before: 671 Example, before:
680 672
681 ringp->mapping = FOO; 673 ringp->mapping = FOO;
@@ -683,21 +675,21 @@ transform some example code.
683 675
684 after: 676 after:
685 677
686 pci_unmap_addr_set(ringp, mapping, FOO); 678 dma_unmap_addr_set(ringp, mapping, FOO);
687 pci_unmap_len_set(ringp, len, BAR); 679 dma_unmap_len_set(ringp, len, BAR);
688 680
6893) Use pci_unmap_{addr,len} to access these values. 6813) Use dma_unmap_{addr,len} to access these values.
690 Example, before: 682 Example, before:
691 683
692 pci_unmap_single(pdev, ringp->mapping, ringp->len, 684 dma_unmap_single(dev, ringp->mapping, ringp->len,
693 PCI_DMA_FROMDEVICE); 685 DMA_FROM_DEVICE);
694 686
695 after: 687 after:
696 688
697 pci_unmap_single(pdev, 689 dma_unmap_single(dev,
698 pci_unmap_addr(ringp, mapping), 690 dma_unmap_addr(ringp, mapping),
699 pci_unmap_len(ringp, len), 691 dma_unmap_len(ringp, len),
700 PCI_DMA_FROMDEVICE); 692 DMA_FROM_DEVICE);
701 693
702It really should be self-explanatory. We treat the ADDR and LEN 694It really should be self-explanatory. We treat the ADDR and LEN
703separately, because it is possible for an implementation to only 695separately, because it is possible for an implementation to only
@@ -732,15 +724,15 @@ to "Closing".
732DMA address space is limited on some architectures and an allocation 724DMA address space is limited on some architectures and an allocation
733failure can be determined by: 725failure can be determined by:
734 726
735- checking if pci_alloc_consistent returns NULL or pci_map_sg returns 0 727- checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0
736 728
737- checking the returned dma_addr_t of pci_map_single and pci_map_page 729- checking the returned dma_addr_t of dma_map_single and dma_map_page
738 by using pci_dma_mapping_error(): 730 by using dma_mapping_error():
739 731
740 dma_addr_t dma_handle; 732 dma_addr_t dma_handle;
741 733
742 dma_handle = pci_map_single(pdev, addr, size, direction); 734 dma_handle = dma_map_single(dev, addr, size, direction);
743 if (pci_dma_mapping_error(pdev, dma_handle)) { 735 if (dma_mapping_error(dev, dma_handle)) {
744 /* 736 /*
745 * reduce current DMA mapping usage, 737 * reduce current DMA mapping usage,
746 * delay and try again later or 738 * delay and try again later or
diff --git a/Documentation/RCU/00-INDEX b/Documentation/RCU/00-INDEX
index 9bb62f7b89c3..71b6f500ddb9 100644
--- a/Documentation/RCU/00-INDEX
+++ b/Documentation/RCU/00-INDEX
@@ -6,16 +6,22 @@ checklist.txt
6 - Review Checklist for RCU Patches 6 - Review Checklist for RCU Patches
7listRCU.txt 7listRCU.txt
8 - Using RCU to Protect Read-Mostly Linked Lists 8 - Using RCU to Protect Read-Mostly Linked Lists
9lockdep.txt
10 - RCU and lockdep checking
9NMI-RCU.txt 11NMI-RCU.txt
10 - Using RCU to Protect Dynamic NMI Handlers 12 - Using RCU to Protect Dynamic NMI Handlers
13rcubarrier.txt
14 - RCU and Unloadable Modules
15rculist_nulls.txt
16 - RCU list primitives for use with SLAB_DESTROY_BY_RCU
11rcuref.txt 17rcuref.txt
12 - Reference-count design for elements of lists/arrays protected by RCU 18 - Reference-count design for elements of lists/arrays protected by RCU
13rcu.txt 19rcu.txt
14 - RCU Concepts 20 - RCU Concepts
15rcubarrier.txt
16 - Unloading modules that use RCU callbacks
17RTFP.txt 21RTFP.txt
18 - List of RCU papers (bibliography) going back to 1980. 22 - List of RCU papers (bibliography) going back to 1980.
23stallwarn.txt
24 - RCU CPU stall warnings (CONFIG_RCU_CPU_STALL_DETECTOR)
19torture.txt 25torture.txt
20 - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST) 26 - RCU Torture Test Operation (CONFIG_RCU_TORTURE_TEST)
21trace.txt 27trace.txt
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt
index d2b85237c76e..5aea459e3dd6 100644
--- a/Documentation/RCU/RTFP.txt
+++ b/Documentation/RCU/RTFP.txt
@@ -25,10 +25,10 @@ to be referencing the data structure. However, this mechanism was not
25optimized for modern computer systems, which is not surprising given 25optimized for modern computer systems, which is not surprising given
26that these overheads were not so expensive in the mid-80s. Nonetheless, 26that these overheads were not so expensive in the mid-80s. Nonetheless,
27passive serialization appears to be the first deferred-destruction 27passive serialization appears to be the first deferred-destruction
28mechanism to be used in production. Furthermore, the relevant patent has 28mechanism to be used in production. Furthermore, the relevant patent
29lapsed, so this approach may be used in non-GPL software, if desired. 29has lapsed, so this approach may be used in non-GPL software, if desired.
30(In contrast, use of RCU is permitted only in software licensed under 30(In contrast, implementation of RCU is permitted only in software licensed
31GPL. Sorry!!!) 31under either GPL or LGPL. Sorry!!!)
32 32
33In 1990, Pugh [Pugh90] noted that explicitly tracking which threads 33In 1990, Pugh [Pugh90] noted that explicitly tracking which threads
34were reading a given data structure permitted deferred free to operate 34were reading a given data structure permitted deferred free to operate
@@ -150,6 +150,18 @@ preemptible RCU [PaulEMcKenney2007PreemptibleRCU], and the three-part
150LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally, 150LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally,
151PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI]. 151PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI].
152 152
1532008 saw a journal paper on real-time RCU [DinakarGuniguntala2008IBMSysJ],
154a history of how Linux changed RCU more than RCU changed Linux
155[PaulEMcKenney2008RCUOSR], and a design overview of hierarchical RCU
156[PaulEMcKenney2008HierarchicalRCU].
157
1582009 introduced user-level RCU algorithms [PaulEMcKenney2009MaliciousURCU],
159which Mathieu Desnoyers is now maintaining [MathieuDesnoyers2009URCU]
160[MathieuDesnoyersPhD]. TINY_RCU [PaulEMcKenney2009BloatWatchRCU] made
161its appearance, as did expedited RCU [PaulEMcKenney2009expeditedRCU].
162The problem of resizeable RCU-protected hash tables may now be on a path
163to a solution [JoshTriplett2009RPHash].
164
153Bibtex Entries 165Bibtex Entries
154 166
155@article{Kung80 167@article{Kung80
@@ -730,6 +742,11 @@ Revised:
730" 742"
731} 743}
732 744
745#
746# "What is RCU?" LWN series.
747#
748########################################################################
749
733@article{DinakarGuniguntala2008IBMSysJ 750@article{DinakarGuniguntala2008IBMSysJ
734,author="D. Guniguntala and P. E. McKenney and J. Triplett and J. Walpole" 751,author="D. Guniguntala and P. E. McKenney and J. Triplett and J. Walpole"
735,title="The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with {Linux}" 752,title="The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with {Linux}"
@@ -820,3 +837,39 @@ Revised:
820 Uniprocessor assumptions allow simplified RCU implementation. 837 Uniprocessor assumptions allow simplified RCU implementation.
821" 838"
822} 839}
840
841@unpublished{PaulEMcKenney2009expeditedRCU
842,Author="Paul E. McKenney"
843,Title="[{PATCH} -tip 0/3] expedited 'big hammer' {RCU} grace periods"
844,month="June"
845,day="25"
846,year="2009"
847,note="Available:
848\url{http://lkml.org/lkml/2009/6/25/306}
849[Viewed August 16, 2009]"
850,annotation="
851 First posting of expedited RCU to be accepted into -tip.
852"
853}
854
855@unpublished{JoshTriplett2009RPHash
856,Author="Josh Triplett"
857,Title="Scalable concurrent hash tables via relativistic programming"
858,month="September"
859,year="2009"
860,note="Linux Plumbers Conference presentation"
861,annotation="
862 RP fun with hash tables.
863"
864}
865
866@phdthesis{MathieuDesnoyersPhD
867, title = "Low-Impact Operating System Tracing"
868, author = "Mathieu Desnoyers"
869, school = "Ecole Polytechnique de Montr\'{e}al"
870, month = "December"
871, year = 2009
872,note="Available:
873\url{http://www.lttng.org/pub/thesis/desnoyers-dissertation-2009-12.pdf}
874[Viewed December 9, 2009]"
875}
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 51525a30e8b4..cbc180f90194 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -8,13 +8,12 @@ would cause. This list is based on experiences reviewing such patches
8over a rather long period of time, but improvements are always welcome! 8over a rather long period of time, but improvements are always welcome!
9 9
100. Is RCU being applied to a read-mostly situation? If the data 100. Is RCU being applied to a read-mostly situation? If the data
11 structure is updated more than about 10% of the time, then 11 structure is updated more than about 10% of the time, then you
12 you should strongly consider some other approach, unless 12 should strongly consider some other approach, unless detailed
13 detailed performance measurements show that RCU is nonetheless 13 performance measurements show that RCU is nonetheless the right
14 the right tool for the job. Yes, you might think of RCU 14 tool for the job. Yes, RCU does reduce read-side overhead by
15 as simply cutting overhead off of the readers and imposing it 15 increasing write-side overhead, which is exactly why normal uses
16 on the writers. That is exactly why normal uses of RCU will 16 of RCU will do much more reading than updating.
17 do much more reading than updating.
18 17
19 Another exception is where performance is not an issue, and RCU 18 Another exception is where performance is not an issue, and RCU
20 provides a simpler implementation. An example of this situation 19 provides a simpler implementation. An example of this situation
@@ -35,13 +34,13 @@ over a rather long period of time, but improvements are always welcome!
35 34
36 If you choose #b, be prepared to describe how you have handled 35 If you choose #b, be prepared to describe how you have handled
37 memory barriers on weakly ordered machines (pretty much all of 36 memory barriers on weakly ordered machines (pretty much all of
38 them -- even x86 allows reads to be reordered), and be prepared 37 them -- even x86 allows later loads to be reordered to precede
39 to explain why this added complexity is worthwhile. If you 38 earlier stores), and be prepared to explain why this added
40 choose #c, be prepared to explain how this single task does not 39 complexity is worthwhile. If you choose #c, be prepared to
41 become a major bottleneck on big multiprocessor machines (for 40 explain how this single task does not become a major bottleneck on
42 example, if the task is updating information relating to itself 41 big multiprocessor machines (for example, if the task is updating
43 that other tasks can read, there by definition can be no 42 information relating to itself that other tasks can read, there
44 bottleneck). 43 by definition can be no bottleneck).
45 44
462. Do the RCU read-side critical sections make proper use of 452. Do the RCU read-side critical sections make proper use of
47 rcu_read_lock() and friends? These primitives are needed 46 rcu_read_lock() and friends? These primitives are needed
@@ -51,8 +50,10 @@ over a rather long period of time, but improvements are always welcome!
51 actuarial risk of your kernel. 50 actuarial risk of your kernel.
52 51
53 As a rough rule of thumb, any dereference of an RCU-protected 52 As a rough rule of thumb, any dereference of an RCU-protected
54 pointer must be covered by rcu_read_lock() or rcu_read_lock_bh() 53 pointer must be covered by rcu_read_lock(), rcu_read_lock_bh(),
55 or by the appropriate update-side lock. 54 rcu_read_lock_sched(), or by the appropriate update-side lock.
55 Disabling of preemption can serve as rcu_read_lock_sched(), but
56 is less readable.
56 57
573. Does the update code tolerate concurrent accesses? 583. Does the update code tolerate concurrent accesses?
58 59
@@ -62,25 +63,27 @@ over a rather long period of time, but improvements are always welcome!
62 of ways to handle this concurrency, depending on the situation: 63 of ways to handle this concurrency, depending on the situation:
63 64
64 a. Use the RCU variants of the list and hlist update 65 a. Use the RCU variants of the list and hlist update
65 primitives to add, remove, and replace elements on an 66 primitives to add, remove, and replace elements on
66 RCU-protected list. Alternatively, use the RCU-protected 67 an RCU-protected list. Alternatively, use the other
67 trees that have been added to the Linux kernel. 68 RCU-protected data structures that have been added to
69 the Linux kernel.
68 70
69 This is almost always the best approach. 71 This is almost always the best approach.
70 72
71 b. Proceed as in (a) above, but also maintain per-element 73 b. Proceed as in (a) above, but also maintain per-element
72 locks (that are acquired by both readers and writers) 74 locks (that are acquired by both readers and writers)
73 that guard per-element state. Of course, fields that 75 that guard per-element state. Of course, fields that
74 the readers refrain from accessing can be guarded by the 76 the readers refrain from accessing can be guarded by
75 update-side lock. 77 some other lock acquired only by updaters, if desired.
76 78
77 This works quite well, also. 79 This works quite well, also.
78 80
79 c. Make updates appear atomic to readers. For example, 81 c. Make updates appear atomic to readers. For example,
80 pointer updates to properly aligned fields will appear 82 pointer updates to properly aligned fields will
81 atomic, as will individual atomic primitives. Operations 83 appear atomic, as will individual atomic primitives.
82 performed under a lock and sequences of multiple atomic 84 Sequences of perations performed under a lock will -not-
83 primitives will -not- appear to be atomic. 85 appear to be atomic to RCU readers, nor will sequences
86 of multiple atomic primitives.
84 87
85 This can work, but is starting to get a bit tricky. 88 This can work, but is starting to get a bit tricky.
86 89
@@ -98,9 +101,9 @@ over a rather long period of time, but improvements are always welcome!
98 a new structure containing updated values. 101 a new structure containing updated values.
99 102
1004. Weakly ordered CPUs pose special challenges. Almost all CPUs 1034. Weakly ordered CPUs pose special challenges. Almost all CPUs
101 are weakly ordered -- even i386 CPUs allow reads to be reordered. 104 are weakly ordered -- even x86 CPUs allow later loads to be
102 RCU code must take all of the following measures to prevent 105 reordered to precede earlier stores. RCU code must take all of
103 memory-corruption problems: 106 the following measures to prevent memory-corruption problems:
104 107
105 a. Readers must maintain proper ordering of their memory 108 a. Readers must maintain proper ordering of their memory
106 accesses. The rcu_dereference() primitive ensures that 109 accesses. The rcu_dereference() primitive ensures that
@@ -113,14 +116,25 @@ over a rather long period of time, but improvements are always welcome!
113 The rcu_dereference() primitive is also an excellent 116 The rcu_dereference() primitive is also an excellent
114 documentation aid, letting the person reading the code 117 documentation aid, letting the person reading the code
115 know exactly which pointers are protected by RCU. 118 know exactly which pointers are protected by RCU.
116 119 Please note that compilers can also reorder code, and
117 The rcu_dereference() primitive is used by the various 120 they are becoming increasingly aggressive about doing
118 "_rcu()" list-traversal primitives, such as the 121 just that. The rcu_dereference() primitive therefore
119 list_for_each_entry_rcu(). Note that it is perfectly 122 also prevents destructive compiler optimizations.
120 legal (if redundant) for update-side code to use 123
121 rcu_dereference() and the "_rcu()" list-traversal 124 The rcu_dereference() primitive is used by the
122 primitives. This is particularly useful in code 125 various "_rcu()" list-traversal primitives, such
123 that is common to readers and updaters. 126 as the list_for_each_entry_rcu(). Note that it is
127 perfectly legal (if redundant) for update-side code to
128 use rcu_dereference() and the "_rcu()" list-traversal
129 primitives. This is particularly useful in code that
130 is common to readers and updaters. However, lockdep
131 will complain if you access rcu_dereference() outside
132 of an RCU read-side critical section. See lockdep.txt
133 to learn what to do about this.
134
135 Of course, neither rcu_dereference() nor the "_rcu()"
136 list-traversal primitives can substitute for a good
137 concurrency design coordinating among multiple updaters.
124 138
125 b. If the list macros are being used, the list_add_tail_rcu() 139 b. If the list macros are being used, the list_add_tail_rcu()
126 and list_add_rcu() primitives must be used in order 140 and list_add_rcu() primitives must be used in order
@@ -135,11 +149,14 @@ over a rather long period of time, but improvements are always welcome!
135 readers. Similarly, if the hlist macros are being used, 149 readers. Similarly, if the hlist macros are being used,
136 the hlist_del_rcu() primitive is required. 150 the hlist_del_rcu() primitive is required.
137 151
138 The list_replace_rcu() primitive may be used to 152 The list_replace_rcu() and hlist_replace_rcu() primitives
139 replace an old structure with a new one in an 153 may be used to replace an old structure with a new one
140 RCU-protected list. 154 in their respective types of RCU-protected lists.
155
156 d. Rules similar to (4b) and (4c) apply to the "hlist_nulls"
157 type of RCU-protected linked lists.
141 158
142 d. Updates must ensure that initialization of a given 159 e. Updates must ensure that initialization of a given
143 structure happens before pointers to that structure are 160 structure happens before pointers to that structure are
144 publicized. Use the rcu_assign_pointer() primitive 161 publicized. Use the rcu_assign_pointer() primitive
145 when publicizing a pointer to a structure that can 162 when publicizing a pointer to a structure that can
@@ -151,16 +168,31 @@ over a rather long period of time, but improvements are always welcome!
151 it cannot block. 168 it cannot block.
152 169
1536. Since synchronize_rcu() can block, it cannot be called from 1706. Since synchronize_rcu() can block, it cannot be called from
154 any sort of irq context. Ditto for synchronize_sched() and 171 any sort of irq context. The same rule applies for
155 synchronize_srcu(). 172 synchronize_rcu_bh(), synchronize_sched(), synchronize_srcu(),
156 173 synchronize_rcu_expedited(), synchronize_rcu_bh_expedited(),
1577. If the updater uses call_rcu(), then the corresponding readers 174 synchronize_sched_expedite(), and synchronize_srcu_expedited().
158 must use rcu_read_lock() and rcu_read_unlock(). If the updater 175
159 uses call_rcu_bh(), then the corresponding readers must use 176 The expedited forms of these primitives have the same semantics
160 rcu_read_lock_bh() and rcu_read_unlock_bh(). If the updater 177 as the non-expedited forms, but expediting is both expensive
161 uses call_rcu_sched(), then the corresponding readers must 178 and unfriendly to real-time workloads. Use of the expedited
162 disable preemption. Mixing things up will result in confusion 179 primitives should be restricted to rare configuration-change
163 and broken kernels. 180 operations that would not normally be undertaken while a real-time
181 workload is running.
182
1837. If the updater uses call_rcu() or synchronize_rcu(), then the
184 corresponding readers must use rcu_read_lock() and
185 rcu_read_unlock(). If the updater uses call_rcu_bh() or
186 synchronize_rcu_bh(), then the corresponding readers must
187 use rcu_read_lock_bh() and rcu_read_unlock_bh(). If the
188 updater uses call_rcu_sched() or synchronize_sched(), then
189 the corresponding readers must disable preemption, possibly
190 by calling rcu_read_lock_sched() and rcu_read_unlock_sched().
191 If the updater uses synchronize_srcu(), the the corresponding
192 readers must use srcu_read_lock() and srcu_read_unlock(),
193 and with the same srcu_struct. The rules for the expedited
194 primitives are the same as for their non-expedited counterparts.
195 Mixing things up will result in confusion and broken kernels.
164 196
165 One exception to this rule: rcu_read_lock() and rcu_read_unlock() 197 One exception to this rule: rcu_read_lock() and rcu_read_unlock()
166 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh() 198 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh()
@@ -212,6 +244,8 @@ over a rather long period of time, but improvements are always welcome!
212 e. Periodically invoke synchronize_rcu(), permitting a limited 244 e. Periodically invoke synchronize_rcu(), permitting a limited
213 number of updates per grace period. 245 number of updates per grace period.
214 246
247 The same cautions apply to call_rcu_bh() and call_rcu_sched().
248
2159. All RCU list-traversal primitives, which include 2499. All RCU list-traversal primitives, which include
216 rcu_dereference(), list_for_each_entry_rcu(), 250 rcu_dereference(), list_for_each_entry_rcu(),
217 list_for_each_continue_rcu(), and list_for_each_safe_rcu(), 251 list_for_each_continue_rcu(), and list_for_each_safe_rcu(),
@@ -219,7 +253,9 @@ over a rather long period of time, but improvements are always welcome!
219 must be protected by appropriate update-side locks. RCU 253 must be protected by appropriate update-side locks. RCU
220 read-side critical sections are delimited by rcu_read_lock() 254 read-side critical sections are delimited by rcu_read_lock()
221 and rcu_read_unlock(), or by similar primitives such as 255 and rcu_read_unlock(), or by similar primitives such as
222 rcu_read_lock_bh() and rcu_read_unlock_bh(). 256 rcu_read_lock_bh() and rcu_read_unlock_bh(), in which case
257 the matching rcu_dereference() primitive must be used in order
258 to keep lockdep happy, in this case, rcu_dereference_bh().
223 259
224 The reason that it is permissible to use RCU list-traversal 260 The reason that it is permissible to use RCU list-traversal
225 primitives when the update-side lock is held is that doing so 261 primitives when the update-side lock is held is that doing so
@@ -229,7 +265,8 @@ over a rather long period of time, but improvements are always welcome!
22910. Conversely, if you are in an RCU read-side critical section, 26510. Conversely, if you are in an RCU read-side critical section,
230 and you don't hold the appropriate update-side lock, you -must- 266 and you don't hold the appropriate update-side lock, you -must-
231 use the "_rcu()" variants of the list macros. Failing to do so 267 use the "_rcu()" variants of the list macros. Failing to do so
232 will break Alpha and confuse people reading your code. 268 will break Alpha, cause aggressive compilers to generate bad code,
269 and confuse people trying to read your code.
233 270
23411. Note that synchronize_rcu() -only- guarantees to wait until 27111. Note that synchronize_rcu() -only- guarantees to wait until
235 all currently executing rcu_read_lock()-protected RCU read-side 272 all currently executing rcu_read_lock()-protected RCU read-side
@@ -239,15 +276,21 @@ over a rather long period of time, but improvements are always welcome!
239 rcu_read_lock()-protected read-side critical sections, do -not- 276 rcu_read_lock()-protected read-side critical sections, do -not-
240 use synchronize_rcu(). 277 use synchronize_rcu().
241 278
242 If you want to wait for some of these other things, you might 279 Similarly, disabling preemption is not an acceptable substitute
243 instead need to use synchronize_irq() or synchronize_sched(). 280 for rcu_read_lock(). Code that attempts to use preemption
281 disabling where it should be using rcu_read_lock() will break
282 in real-time kernel builds.
283
284 If you want to wait for interrupt handlers, NMI handlers, and
285 code under the influence of preempt_disable(), you instead
286 need to use synchronize_irq() or synchronize_sched().
244 287
24512. Any lock acquired by an RCU callback must be acquired elsewhere 28812. Any lock acquired by an RCU callback must be acquired elsewhere
246 with softirq disabled, e.g., via spin_lock_irqsave(), 289 with softirq disabled, e.g., via spin_lock_irqsave(),
247 spin_lock_bh(), etc. Failing to disable irq on a given 290 spin_lock_bh(), etc. Failing to disable irq on a given
248 acquisition of that lock will result in deadlock as soon as the 291 acquisition of that lock will result in deadlock as soon as
249 RCU callback happens to interrupt that acquisition's critical 292 the RCU softirq handler happens to run your RCU callback while
250 section. 293 interrupting that acquisition's critical section.
251 294
25213. RCU callbacks can be and are executed in parallel. In many cases, 29513. RCU callbacks can be and are executed in parallel. In many cases,
253 the callback code simply wrappers around kfree(), so that this 296 the callback code simply wrappers around kfree(), so that this
@@ -265,29 +308,30 @@ over a rather long period of time, but improvements are always welcome!
265 not the case, a self-spawning RCU callback would prevent the 308 not the case, a self-spawning RCU callback would prevent the
266 victim CPU from ever going offline.) 309 victim CPU from ever going offline.)
267 310
26814. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) 31114. SRCU (srcu_read_lock(), srcu_read_unlock(), srcu_dereference(),
269 may only be invoked from process context. Unlike other forms of 312 synchronize_srcu(), and synchronize_srcu_expedited()) may only
270 RCU, it -is- permissible to block in an SRCU read-side critical 313 be invoked from process context. Unlike other forms of RCU, it
271 section (demarked by srcu_read_lock() and srcu_read_unlock()), 314 -is- permissible to block in an SRCU read-side critical section
272 hence the "SRCU": "sleepable RCU". Please note that if you 315 (demarked by srcu_read_lock() and srcu_read_unlock()), hence the
273 don't need to sleep in read-side critical sections, you should 316 "SRCU": "sleepable RCU". Please note that if you don't need
274 be using RCU rather than SRCU, because RCU is almost always 317 to sleep in read-side critical sections, you should be using
275 faster and easier to use than is SRCU. 318 RCU rather than SRCU, because RCU is almost always faster and
319 easier to use than is SRCU.
276 320
277 Also unlike other forms of RCU, explicit initialization 321 Also unlike other forms of RCU, explicit initialization
278 and cleanup is required via init_srcu_struct() and 322 and cleanup is required via init_srcu_struct() and
279 cleanup_srcu_struct(). These are passed a "struct srcu_struct" 323 cleanup_srcu_struct(). These are passed a "struct srcu_struct"
280 that defines the scope of a given SRCU domain. Once initialized, 324 that defines the scope of a given SRCU domain. Once initialized,
281 the srcu_struct is passed to srcu_read_lock(), srcu_read_unlock() 325 the srcu_struct is passed to srcu_read_lock(), srcu_read_unlock()
282 and synchronize_srcu(). A given synchronize_srcu() waits only 326 synchronize_srcu(), and synchronize_srcu_expedited(). A given
283 for SRCU read-side critical sections governed by srcu_read_lock() 327 synchronize_srcu() waits only for SRCU read-side critical
284 and srcu_read_unlock() calls that have been passd the same 328 sections governed by srcu_read_lock() and srcu_read_unlock()
285 srcu_struct. This property is what makes sleeping read-side 329 calls that have been passed the same srcu_struct. This property
286 critical sections tolerable -- a given subsystem delays only 330 is what makes sleeping read-side critical sections tolerable --
287 its own updates, not those of other subsystems using SRCU. 331 a given subsystem delays only its own updates, not those of other
288 Therefore, SRCU is less prone to OOM the system than RCU would 332 subsystems using SRCU. Therefore, SRCU is less prone to OOM the
289 be if RCU's read-side critical sections were permitted to 333 system than RCU would be if RCU's read-side critical sections
290 sleep. 334 were permitted to sleep.
291 335
292 The ability to sleep in read-side critical sections does not 336 The ability to sleep in read-side critical sections does not
293 come for free. First, corresponding srcu_read_lock() and 337 come for free. First, corresponding srcu_read_lock() and
@@ -311,12 +355,12 @@ over a rather long period of time, but improvements are always welcome!
311 destructive operation, and -only- -then- invoke call_rcu(), 355 destructive operation, and -only- -then- invoke call_rcu(),
312 synchronize_rcu(), or friends. 356 synchronize_rcu(), or friends.
313 357
314 Because these primitives only wait for pre-existing readers, 358 Because these primitives only wait for pre-existing readers, it
315 it is the caller's responsibility to guarantee safety to 359 is the caller's responsibility to guarantee that any subsequent
316 any subsequent readers. 360 readers will execute safely.
317 361
31816. The various RCU read-side primitives do -not- contain memory 36216. The various RCU read-side primitives do -not- necessarily contain
319 barriers. The CPU (and in some cases, the compiler) is free 363 memory barriers. You should therefore plan for the CPU
320 to reorder code into and out of RCU read-side critical sections. 364 and the compiler to freely reorder code into and out of RCU
321 It is the responsibility of the RCU update-side primitives to 365 read-side critical sections. It is the responsibility of the
322 deal with this. 366 RCU update-side primitives to deal with this.
diff --git a/Documentation/RCU/lockdep.txt b/Documentation/RCU/lockdep.txt
new file mode 100644
index 000000000000..fe24b58627bd
--- /dev/null
+++ b/Documentation/RCU/lockdep.txt
@@ -0,0 +1,67 @@
1RCU and lockdep checking
2
3All flavors of RCU have lockdep checking available, so that lockdep is
4aware of when each task enters and leaves any flavor of RCU read-side
5critical section. Each flavor of RCU is tracked separately (but note
6that this is not the case in 2.6.32 and earlier). This allows lockdep's
7tracking to include RCU state, which can sometimes help when debugging
8deadlocks and the like.
9
10In addition, RCU provides the following primitives that check lockdep's
11state:
12
13 rcu_read_lock_held() for normal RCU.
14 rcu_read_lock_bh_held() for RCU-bh.
15 rcu_read_lock_sched_held() for RCU-sched.
16 srcu_read_lock_held() for SRCU.
17
18These functions are conservative, and will therefore return 1 if they
19aren't certain (for example, if CONFIG_DEBUG_LOCK_ALLOC is not set).
20This prevents things like WARN_ON(!rcu_read_lock_held()) from giving false
21positives when lockdep is disabled.
22
23In addition, a separate kernel config parameter CONFIG_PROVE_RCU enables
24checking of rcu_dereference() primitives:
25
26 rcu_dereference(p):
27 Check for RCU read-side critical section.
28 rcu_dereference_bh(p):
29 Check for RCU-bh read-side critical section.
30 rcu_dereference_sched(p):
31 Check for RCU-sched read-side critical section.
32 srcu_dereference(p, sp):
33 Check for SRCU read-side critical section.
34 rcu_dereference_check(p, c):
35 Use explicit check expression "c".
36 rcu_dereference_raw(p)
37 Don't check. (Use sparingly, if at all.)
38
39The rcu_dereference_check() check expression can be any boolean
40expression, but would normally include one of the rcu_read_lock_held()
41family of functions and a lockdep expression. However, any boolean
42expression can be used. For a moderately ornate example, consider
43the following:
44
45 file = rcu_dereference_check(fdt->fd[fd],
46 rcu_read_lock_held() ||
47 lockdep_is_held(&files->file_lock) ||
48 atomic_read(&files->count) == 1);
49
50This expression picks up the pointer "fdt->fd[fd]" in an RCU-safe manner,
51and, if CONFIG_PROVE_RCU is configured, verifies that this expression
52is used in:
53
541. An RCU read-side critical section, or
552. with files->file_lock held, or
563. on an unshared files_struct.
57
58In case (1), the pointer is picked up in an RCU-safe manner for vanilla
59RCU read-side critical sections, in case (2) the ->file_lock prevents
60any change from taking place, and finally, in case (3) the current task
61is the only task accessing the file_struct, again preventing any change
62from taking place.
63
64There are currently only "universal" versions of the rcu_assign_pointer()
65and RCU list-/tree-traversal primitives, which do not (yet) check for
66being in an RCU read-side critical section. In the future, separate
67versions of these primitives might be created.
diff --git a/Documentation/RCU/rcu.txt b/Documentation/RCU/rcu.txt
index 2a23523ce471..31852705b586 100644
--- a/Documentation/RCU/rcu.txt
+++ b/Documentation/RCU/rcu.txt
@@ -75,6 +75,8 @@ o I hear that RCU is patented? What is with that?
75 search for the string "Patent" in RTFP.txt to find them. 75 search for the string "Patent" in RTFP.txt to find them.
76 Of these, one was allowed to lapse by the assignee, and the 76 Of these, one was allowed to lapse by the assignee, and the
77 others have been contributed to the Linux kernel under GPL. 77 others have been contributed to the Linux kernel under GPL.
78 There are now also LGPL implementations of user-level RCU
79 available (http://lttng.org/?q=node/18).
78 80
79o I hear that RCU needs work in order to support realtime kernels? 81o I hear that RCU needs work in order to support realtime kernels?
80 82
@@ -91,48 +93,4 @@ o Where can I find more information on RCU?
91 93
92o What are all these files in this directory? 94o What are all these files in this directory?
93 95
94 96 See 00-INDEX for the list.
95 NMI-RCU.txt
96
97 Describes how to use RCU to implement dynamic
98 NMI handlers, which can be revectored on the fly,
99 without rebooting.
100
101 RTFP.txt
102
103 List of RCU-related publications and web sites.
104
105 UP.txt
106
107 Discussion of RCU usage in UP kernels.
108
109 arrayRCU.txt
110
111 Describes how to use RCU to protect arrays, with
112 resizeable arrays whose elements reference other
113 data structures being of the most interest.
114
115 checklist.txt
116
117 Lists things to check for when inspecting code that
118 uses RCU.
119
120 listRCU.txt
121
122 Describes how to use RCU to protect linked lists.
123 This is the simplest and most common use of RCU
124 in the Linux kernel.
125
126 rcu.txt
127
128 You are reading it!
129
130 rcuref.txt
131
132 Describes how to combine use of reference counts
133 with RCU.
134
135 whatisRCU.txt
136
137 Overview of how the RCU implementation works. Along
138 the way, presents a conceptual view of RCU.
diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt
new file mode 100644
index 000000000000..1423d2570d78
--- /dev/null
+++ b/Documentation/RCU/stallwarn.txt
@@ -0,0 +1,58 @@
1Using RCU's CPU Stall Detector
2
3The CONFIG_RCU_CPU_STALL_DETECTOR kernel config parameter enables
4RCU's CPU stall detector, which detects conditions that unduly delay
5RCU grace periods. The stall detector's idea of what constitutes
6"unduly delayed" is controlled by a pair of C preprocessor macros:
7
8RCU_SECONDS_TILL_STALL_CHECK
9
10 This macro defines the period of time that RCU will wait from
11 the beginning of a grace period until it issues an RCU CPU
12 stall warning. It is normally ten seconds.
13
14RCU_SECONDS_TILL_STALL_RECHECK
15
16 This macro defines the period of time that RCU will wait after
17 issuing a stall warning until it issues another stall warning.
18 It is normally set to thirty seconds.
19
20RCU_STALL_RAT_DELAY
21
22 The CPU stall detector tries to make the offending CPU rat on itself,
23 as this often gives better-quality stack traces. However, if
24 the offending CPU does not detect its own stall in the number
25 of jiffies specified by RCU_STALL_RAT_DELAY, then other CPUs will
26 complain. This is normally set to two jiffies.
27
28The following problems can result in an RCU CPU stall warning:
29
30o A CPU looping in an RCU read-side critical section.
31
32o A CPU looping with interrupts disabled.
33
34o A CPU looping with preemption disabled.
35
36o For !CONFIG_PREEMPT kernels, a CPU looping anywhere in the kernel
37 without invoking schedule().
38
39o A bug in the RCU implementation.
40
41o A hardware failure. This is quite unlikely, but has occurred
42 at least once in a former life. A CPU failed in a running system,
43 becoming unresponsive, but not causing an immediate crash.
44 This resulted in a series of RCU CPU stall warnings, eventually
45 leading the realization that the CPU had failed.
46
47The RCU, RCU-sched, and RCU-bh implementations have CPU stall warning.
48SRCU does not do so directly, but its calls to synchronize_sched() will
49result in RCU-sched detecting any CPU stalls that might be occurring.
50
51To diagnose the cause of the stall, inspect the stack traces. The offending
52function will usually be near the top of the stack. If you have a series
53of stall warnings from a single extended stall, comparing the stack traces
54can often help determine where the stall is occurring, which will usually
55be in the function nearest the top of the stack that stays the same from
56trace to trace.
57
58RCU bugs can often be debugged with the help of CONFIG_RCU_TRACE.
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt
index 9dba3bb90e60..0e50bc2aa1e2 100644
--- a/Documentation/RCU/torture.txt
+++ b/Documentation/RCU/torture.txt
@@ -30,6 +30,18 @@ MODULE PARAMETERS
30 30
31This module has the following parameters: 31This module has the following parameters:
32 32
33fqs_duration Duration (in microseconds) of artificially induced bursts
34 of force_quiescent_state() invocations. In RCU
35 implementations having force_quiescent_state(), these
36 bursts help force races between forcing a given grace
37 period and that grace period ending on its own.
38
39fqs_holdoff Holdoff time (in microseconds) between consecutive calls
40 to force_quiescent_state() within a burst.
41
42fqs_stutter Wait time (in seconds) between consecutive bursts
43 of calls to force_quiescent_state().
44
33irqreaders Says to invoke RCU readers from irq level. This is currently 45irqreaders Says to invoke RCU readers from irq level. This is currently
34 done via timers. Defaults to "1" for variants of RCU that 46 done via timers. Defaults to "1" for variants of RCU that
35 permit this. (Or, more accurately, variants of RCU that do 47 permit this. (Or, more accurately, variants of RCU that do
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index 187bbf10c923..8608fd85e921 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -1,185 +1,10 @@
1CONFIG_RCU_TRACE debugfs Files and Formats 1CONFIG_RCU_TRACE debugfs Files and Formats
2 2
3 3
4The rcupreempt and rcutree implementations of RCU provide debugfs trace 4The rcutree implementation of RCU provides debugfs trace output that
5output that summarizes counters and state. This information is useful for 5summarizes counters and state. This information is useful for debugging
6debugging RCU itself, and can sometimes also help to debug abuses of RCU. 6RCU itself, and can sometimes also help to debug abuses of RCU.
7Note that the rcuclassic implementation of RCU does not provide debugfs 7The following sections describe the debugfs files and formats.
8trace output.
9
10The following sections describe the debugfs files and formats for
11preemptable RCU (rcupreempt) and hierarchical RCU (rcutree).
12
13
14Preemptable RCU debugfs Files and Formats
15
16This implementation of RCU provides three debugfs files under the
17top-level directory RCU: rcu/rcuctrs (which displays the per-CPU
18counters used by preemptable RCU) rcu/rcugp (which displays grace-period
19counters), and rcu/rcustats (which internal counters for debugging RCU).
20
21The output of "cat rcu/rcuctrs" looks as follows:
22
23CPU last cur F M
24 0 5 -5 0 0
25 1 -1 0 0 0
26 2 0 1 0 0
27 3 0 1 0 0
28 4 0 1 0 0
29 5 0 1 0 0
30 6 0 2 0 0
31 7 0 -1 0 0
32 8 0 1 0 0
33ggp = 26226, state = waitzero
34
35The per-CPU fields are as follows:
36
37o "CPU" gives the CPU number. Offline CPUs are not displayed.
38
39o "last" gives the value of the counter that is being decremented
40 for the current grace period phase. In the example above,
41 the counters sum to 4, indicating that there are still four
42 RCU read-side critical sections still running that started
43 before the last counter flip.
44
45o "cur" gives the value of the counter that is currently being
46 both incremented (by rcu_read_lock()) and decremented (by
47 rcu_read_unlock()). In the example above, the counters sum to
48 1, indicating that there is only one RCU read-side critical section
49 still running that started after the last counter flip.
50
51o "F" indicates whether RCU is waiting for this CPU to acknowledge
52 a counter flip. In the above example, RCU is not waiting on any,
53 which is consistent with the state being "waitzero" rather than
54 "waitack".
55
56o "M" indicates whether RCU is waiting for this CPU to execute a
57 memory barrier. In the above example, RCU is not waiting on any,
58 which is consistent with the state being "waitzero" rather than
59 "waitmb".
60
61o "ggp" is the global grace-period counter.
62
63o "state" is the RCU state, which can be one of the following:
64
65 o "idle": there is no grace period in progress.
66
67 o "waitack": RCU just incremented the global grace-period
68 counter, which has the effect of reversing the roles of
69 the "last" and "cur" counters above, and is waiting for
70 all the CPUs to acknowledge the flip. Once the flip has
71 been acknowledged, CPUs will no longer be incrementing
72 what are now the "last" counters, so that their sum will
73 decrease monotonically down to zero.
74
75 o "waitzero": RCU is waiting for the sum of the "last" counters
76 to decrease to zero.
77
78 o "waitmb": RCU is waiting for each CPU to execute a memory
79 barrier, which ensures that instructions from a given CPU's
80 last RCU read-side critical section cannot be reordered
81 with instructions following the memory-barrier instruction.
82
83The output of "cat rcu/rcugp" looks as follows:
84
85oldggp=48870 newggp=48873
86
87Note that reading from this file provokes a synchronize_rcu(). The
88"oldggp" value is that of "ggp" from rcu/rcuctrs above, taken before
89executing the synchronize_rcu(), and the "newggp" value is also the
90"ggp" value, but taken after the synchronize_rcu() command returns.
91
92
93The output of "cat rcu/rcugp" looks as follows:
94
95na=1337955 nl=40 wa=1337915 wl=44 da=1337871 dl=0 dr=1337871 di=1337871
961=50989 e1=6138 i1=49722 ie1=82 g1=49640 a1=315203 ae1=265563 a2=49640
97z1=1401244 ze1=1351605 z2=49639 m1=5661253 me1=5611614 m2=49639
98
99These are counters tracking internal preemptable-RCU events, however,
100some of them may be useful for debugging algorithms using RCU. In
101particular, the "nl", "wl", and "dl" values track the number of RCU
102callbacks in various states. The fields are as follows:
103
104o "na" is the total number of RCU callbacks that have been enqueued
105 since boot.
106
107o "nl" is the number of RCU callbacks waiting for the previous
108 grace period to end so that they can start waiting on the next
109 grace period.
110
111o "wa" is the total number of RCU callbacks that have started waiting
112 for a grace period since boot. "na" should be roughly equal to
113 "nl" plus "wa".
114
115o "wl" is the number of RCU callbacks currently waiting for their
116 grace period to end.
117
118o "da" is the total number of RCU callbacks whose grace periods
119 have completed since boot. "wa" should be roughly equal to
120 "wl" plus "da".
121
122o "dr" is the total number of RCU callbacks that have been removed
123 from the list of callbacks ready to invoke. "dr" should be roughly
124 equal to "da".
125
126o "di" is the total number of RCU callbacks that have been invoked
127 since boot. "di" should be roughly equal to "da", though some
128 early versions of preemptable RCU had a bug so that only the
129 last CPU's count of invocations was displayed, rather than the
130 sum of all CPU's counts.
131
132o "1" is the number of calls to rcu_try_flip(). This should be
133 roughly equal to the sum of "e1", "i1", "a1", "z1", and "m1"
134 described below. In other words, the number of times that
135 the state machine is visited should be equal to the sum of the
136 number of times that each state is visited plus the number of
137 times that the state-machine lock acquisition failed.
138
139o "e1" is the number of times that rcu_try_flip() was unable to
140 acquire the fliplock.
141
142o "i1" is the number of calls to rcu_try_flip_idle().
143
144o "ie1" is the number of times rcu_try_flip_idle() exited early
145 due to the calling CPU having no work for RCU.
146
147o "g1" is the number of times that rcu_try_flip_idle() decided
148 to start a new grace period. "i1" should be roughly equal to
149 "ie1" plus "g1".
150
151o "a1" is the number of calls to rcu_try_flip_waitack().
152
153o "ae1" is the number of times that rcu_try_flip_waitack() found
154 that at least one CPU had not yet acknowledge the new grace period
155 (AKA "counter flip").
156
157o "a2" is the number of time rcu_try_flip_waitack() found that
158 all CPUs had acknowledged. "a1" should be roughly equal to
159 "ae1" plus "a2". (This particular output was collected on
160 a 128-CPU machine, hence the smaller-than-usual fraction of
161 calls to rcu_try_flip_waitack() finding all CPUs having already
162 acknowledged.)
163
164o "z1" is the number of calls to rcu_try_flip_waitzero().
165
166o "ze1" is the number of times that rcu_try_flip_waitzero() found
167 that not all of the old RCU read-side critical sections had
168 completed.
169
170o "z2" is the number of times that rcu_try_flip_waitzero() finds
171 the sum of the counters equal to zero, in other words, that
172 all of the old RCU read-side critical sections had completed.
173 The value of "z1" should be roughly equal to "ze1" plus
174 "z2".
175
176o "m1" is the number of calls to rcu_try_flip_waitmb().
177
178o "me1" is the number of times that rcu_try_flip_waitmb() finds
179 that at least one CPU has not yet executed a memory barrier.
180
181o "m2" is the number of times that rcu_try_flip_waitmb() finds that
182 all CPUs have executed a memory barrier.
183 8
184 9
185Hierarchical RCU debugfs Files and Formats 10Hierarchical RCU debugfs Files and Formats
@@ -210,9 +35,10 @@ rcu_bh:
210 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 35 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10
211 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 36 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10
212 37
213The first section lists the rcu_data structures for rcu, the second for 38The first section lists the rcu_data structures for rcu_sched, the second
214rcu_bh. Each section has one line per CPU, or eight for this 8-CPU system. 39for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an
215The fields are as follows: 40additional section for rcu_preempt. Each section has one line per CPU,
41or eight for this 8-CPU system. The fields are as follows:
216 42
217o The number at the beginning of each line is the CPU number. 43o The number at the beginning of each line is the CPU number.
218 CPUs numbers followed by an exclamation mark are offline, 44 CPUs numbers followed by an exclamation mark are offline,
@@ -223,9 +49,9 @@ o The number at the beginning of each line is the CPU number.
223 49
224o "c" is the count of grace periods that this CPU believes have 50o "c" is the count of grace periods that this CPU believes have
225 completed. CPUs in dynticks idle mode may lag quite a ways 51 completed. CPUs in dynticks idle mode may lag quite a ways
226 behind, for example, CPU 4 under "rcu" above, which has slept 52 behind, for example, CPU 4 under "rcu_sched" above, which has
227 through the past 25 RCU grace periods. It is not unusual to 53 slept through the past 25 RCU grace periods. It is not unusual
228 see CPUs lagging by thousands of grace periods. 54 to see CPUs lagging by thousands of grace periods.
229 55
230o "g" is the count of grace periods that this CPU believes have 56o "g" is the count of grace periods that this CPU believes have
231 started. Again, CPUs in dynticks idle mode may lag behind. 57 started. Again, CPUs in dynticks idle mode may lag behind.
@@ -308,8 +134,10 @@ The output of "cat rcu/rcugp" looks as follows:
308rcu_sched: completed=33062 gpnum=33063 134rcu_sched: completed=33062 gpnum=33063
309rcu_bh: completed=464 gpnum=464 135rcu_bh: completed=464 gpnum=464
310 136
311Again, this output is for both "rcu" and "rcu_bh". The fields are 137Again, this output is for both "rcu_sched" and "rcu_bh". Note that
312taken from the rcu_state structure, and are as follows: 138kernels built with CONFIG_TREE_PREEMPT_RCU will have an additional
139"rcu_preempt" line. The fields are taken from the rcu_state structure,
140and are as follows:
313 141
314o "completed" is the number of grace periods that have completed. 142o "completed" is the number of grace periods that have completed.
315 It is comparable to the "c" field from rcu/rcudata in that a 143 It is comparable to the "c" field from rcu/rcudata in that a
@@ -324,23 +152,24 @@ o "gpnum" is the number of grace periods that have started. It is
324 If these two fields are equal (as they are for "rcu_bh" above), 152 If these two fields are equal (as they are for "rcu_bh" above),
325 then there is no grace period in progress, in other words, RCU 153 then there is no grace period in progress, in other words, RCU
326 is idle. On the other hand, if the two fields differ (as they 154 is idle. On the other hand, if the two fields differ (as they
327 do for "rcu" above), then an RCU grace period is in progress. 155 do for "rcu_sched" above), then an RCU grace period is in progress.
328 156
329 157
330The output of "cat rcu/rcuhier" looks as follows, with very long lines: 158The output of "cat rcu/rcuhier" looks as follows, with very long lines:
331 159
332c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 160c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 oqlen=0
3331/1 0:127 ^0 1611/1 .>. 0:127 ^0
3343/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 1623/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3
3353/3f 0:5 ^0 2/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 1633/3f .>. 0:5 ^0 2/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3
336rcu_bh: 164rcu_bh:
337c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 165c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 oqlen=0
3380/1 0:127 ^0 1660/1 .>. 0:127 ^0
3390/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 1670/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3
3400/3f 0:5 ^0 0/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 1680/3f .>. 0:5 ^0 0/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3
341 169
342This is once again split into "rcu" and "rcu_bh" portions. The fields are 170This is once again split into "rcu_sched" and "rcu_bh" portions,
343as follows: 171and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional
172"rcu_preempt" section. The fields are as follows:
344 173
345o "c" is exactly the same as "completed" under rcu/rcugp. 174o "c" is exactly the same as "completed" under rcu/rcugp.
346 175
@@ -372,6 +201,11 @@ o "fqlh" is the number of calls to force_quiescent_state() that
372 exited immediately (without even being counted in nfqs above) 201 exited immediately (without even being counted in nfqs above)
373 due to contention on ->fqslock. 202 due to contention on ->fqslock.
374 203
204o "oqlen" is the number of callbacks on the "orphan" callback
205 list. RCU callbacks are placed on this list by CPUs going
206 offline, and are "adopted" either by the CPU helping the outgoing
207 CPU or by the next rcu_barrier*() call, whichever comes first.
208
375o Each element of the form "1/1 0:127 ^0" represents one struct 209o Each element of the form "1/1 0:127 ^0" represents one struct
376 rcu_node. Each line represents one level of the hierarchy, from 210 rcu_node. Each line represents one level of the hierarchy, from
377 root to leaves. It is best to think of the rcu_data structures 211 root to leaves. It is best to think of the rcu_data structures
@@ -379,7 +213,7 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
379 might be either one, two, or three levels of rcu_node structures, 213 might be either one, two, or three levels of rcu_node structures,
380 depending on the relationship between CONFIG_RCU_FANOUT and 214 depending on the relationship between CONFIG_RCU_FANOUT and
381 CONFIG_NR_CPUS. 215 CONFIG_NR_CPUS.
382 216
383 o The numbers separated by the "/" are the qsmask followed 217 o The numbers separated by the "/" are the qsmask followed
384 by the qsmaskinit. The qsmask will have one bit 218 by the qsmaskinit. The qsmask will have one bit
385 set for each entity in the next lower level that 219 set for each entity in the next lower level that
@@ -389,10 +223,19 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
389 The value of qsmaskinit is assigned to that of qsmask 223 The value of qsmaskinit is assigned to that of qsmask
390 at the beginning of each grace period. 224 at the beginning of each grace period.
391 225
392 For example, for "rcu", the qsmask of the first entry 226 For example, for "rcu_sched", the qsmask of the first
393 of the lowest level is 0x14, meaning that we are still 227 entry of the lowest level is 0x14, meaning that we
394 waiting for CPUs 2 and 4 to check in for the current 228 are still waiting for CPUs 2 and 4 to check in for the
395 grace period. 229 current grace period.
230
231 o The characters separated by the ">" indicate the state
232 of the blocked-tasks lists. A "T" preceding the ">"
233 indicates that at least one task blocked in an RCU
234 read-side critical section blocks the current grace
235 period, while a "." preceding the ">" indicates otherwise.
236 The character following the ">" indicates similarly for
237 the next grace period. A "T" should appear in this
238 field only for rcu-preempt.
396 239
397 o The numbers separated by the ":" are the range of CPUs 240 o The numbers separated by the ":" are the range of CPUs
398 served by this struct rcu_node. This can be helpful 241 served by this struct rcu_node. This can be helpful
@@ -431,8 +274,9 @@ rcu_bh:
431 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 274 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921
432 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 275 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542
433 276
434As always, this is once again split into "rcu" and "rcu_bh" portions. 277As always, this is once again split into "rcu_sched" and "rcu_bh"
435The fields are as follows: 278portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional
279"rcu_preempt" section. The fields are as follows:
436 280
437o "np" is the number of times that __rcu_pending() has been invoked 281o "np" is the number of times that __rcu_pending() has been invoked
438 for the corresponding flavor of RCU. 282 for the corresponding flavor of RCU.
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index e41a7fecf0d3..1dc00ee97163 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -323,14 +323,17 @@ used as follows:
323 Defer Protect 323 Defer Protect
324 324
325a. synchronize_rcu() rcu_read_lock() / rcu_read_unlock() 325a. synchronize_rcu() rcu_read_lock() / rcu_read_unlock()
326 call_rcu() 326 call_rcu() rcu_dereference()
327 327
328b. call_rcu_bh() rcu_read_lock_bh() / rcu_read_unlock_bh() 328b. call_rcu_bh() rcu_read_lock_bh() / rcu_read_unlock_bh()
329 rcu_dereference_bh()
329 330
330c. synchronize_sched() preempt_disable() / preempt_enable() 331c. synchronize_sched() rcu_read_lock_sched() / rcu_read_unlock_sched()
332 preempt_disable() / preempt_enable()
331 local_irq_save() / local_irq_restore() 333 local_irq_save() / local_irq_restore()
332 hardirq enter / hardirq exit 334 hardirq enter / hardirq exit
333 NMI enter / NMI exit 335 NMI enter / NMI exit
336 rcu_dereference_sched()
334 337
335These three mechanisms are used as follows: 338These three mechanisms are used as follows:
336 339
@@ -780,9 +783,8 @@ Linux-kernel source code, but it helps to have a full list of the
780APIs, since there does not appear to be a way to categorize them 783APIs, since there does not appear to be a way to categorize them
781in docbook. Here is the list, by category. 784in docbook. Here is the list, by category.
782 785
783RCU pointer/list traversal: 786RCU list traversal:
784 787
785 rcu_dereference
786 list_for_each_entry_rcu 788 list_for_each_entry_rcu
787 hlist_for_each_entry_rcu 789 hlist_for_each_entry_rcu
788 hlist_nulls_for_each_entry_rcu 790 hlist_nulls_for_each_entry_rcu
@@ -808,7 +810,7 @@ RCU: Critical sections Grace period Barrier
808 810
809 rcu_read_lock synchronize_net rcu_barrier 811 rcu_read_lock synchronize_net rcu_barrier
810 rcu_read_unlock synchronize_rcu 812 rcu_read_unlock synchronize_rcu
811 synchronize_rcu_expedited 813 rcu_dereference synchronize_rcu_expedited
812 call_rcu 814 call_rcu
813 815
814 816
@@ -816,7 +818,7 @@ bh: Critical sections Grace period Barrier
816 818
817 rcu_read_lock_bh call_rcu_bh rcu_barrier_bh 819 rcu_read_lock_bh call_rcu_bh rcu_barrier_bh
818 rcu_read_unlock_bh synchronize_rcu_bh 820 rcu_read_unlock_bh synchronize_rcu_bh
819 synchronize_rcu_bh_expedited 821 rcu_dereference_bh synchronize_rcu_bh_expedited
820 822
821 823
822sched: Critical sections Grace period Barrier 824sched: Critical sections Grace period Barrier
@@ -825,12 +827,14 @@ sched: Critical sections Grace period Barrier
825 rcu_read_unlock_sched call_rcu_sched 827 rcu_read_unlock_sched call_rcu_sched
826 [preempt_disable] synchronize_sched_expedited 828 [preempt_disable] synchronize_sched_expedited
827 [and friends] 829 [and friends]
830 rcu_dereference_sched
828 831
829 832
830SRCU: Critical sections Grace period Barrier 833SRCU: Critical sections Grace period Barrier
831 834
832 srcu_read_lock synchronize_srcu N/A 835 srcu_read_lock synchronize_srcu N/A
833 srcu_read_unlock 836 srcu_read_unlock synchronize_srcu_expedited
837 srcu_dereference
834 838
835SRCU: Initialization/cleanup 839SRCU: Initialization/cleanup
836 init_srcu_struct 840 init_srcu_struct
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 78a9168ff377..8916ca48bc95 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -9,13 +9,17 @@ Documentation/SubmittingPatches and elsewhere regarding submitting Linux
9kernel patches. 9kernel patches.
10 10
11 11
121: Builds cleanly with applicable or modified CONFIG options =y, =m, and 121: If you use a facility then #include the file that defines/declares
13 that facility. Don't depend on other header files pulling in ones
14 that you use.
15
162: Builds cleanly with applicable or modified CONFIG options =y, =m, and
13 =n. No gcc warnings/errors, no linker warnings/errors. 17 =n. No gcc warnings/errors, no linker warnings/errors.
14 18
152: Passes allnoconfig, allmodconfig 192b: Passes allnoconfig, allmodconfig
16 20
173: Builds on multiple CPU architectures by using local cross-compile tools 213: Builds on multiple CPU architectures by using local cross-compile tools
18 or something like PLM at OSDL. 22 or some other build farm.
19 23
204: ppc64 is a good architecture for cross-compilation checking because it 244: ppc64 is a good architecture for cross-compilation checking because it
21 tends to use `unsigned long' for 64-bit quantities. 25 tends to use `unsigned long' for 64-bit quantities.
@@ -88,3 +92,6 @@ kernel patches.
88 92
8924: All memory barriers {e.g., barrier(), rmb(), wmb()} need a comment in the 9324: All memory barriers {e.g., barrier(), rmb(), wmb()} need a comment in the
90 source code that explains the logic of what they are doing and why. 94 source code that explains the logic of what they are doing and why.
95
9625: If any ioctl's are added by the patch, then also update
97 Documentation/ioctl/ioctl-number.txt.
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index b7f9d3b4bbf6..72651f788f4e 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -232,7 +232,7 @@ your e-mail client so that it sends your patches untouched.
232When sending patches to Linus, always follow step #7. 232When sending patches to Linus, always follow step #7.
233 233
234Large changes are not appropriate for mailing lists, and some 234Large changes are not appropriate for mailing lists, and some
235maintainers. If your patch, uncompressed, exceeds 40 kB in size, 235maintainers. If your patch, uncompressed, exceeds 300 kB in size,
236it is preferred that you store your patch on an Internet-accessible 236it is preferred that you store your patch on an Internet-accessible
237server, and provide instead a URL (link) pointing to your patch. 237server, and provide instead a URL (link) pointing to your patch.
238 238
diff --git a/Documentation/acpi/method-customizing.txt b/Documentation/acpi/method-customizing.txt
new file mode 100644
index 000000000000..e628cd23ca80
--- /dev/null
+++ b/Documentation/acpi/method-customizing.txt
@@ -0,0 +1,66 @@
1Linux ACPI Custom Control Method How To
2=======================================
3
4Written by Zhang Rui <rui.zhang@intel.com>
5
6
7Linux supports customizing ACPI control methods at runtime.
8
9Users can use this to
101. override an existing method which may not work correctly,
11 or just for debugging purposes.
122. insert a completely new method in order to create a missing
13 method such as _OFF, _ON, _STA, _INI, etc.
14For these cases, it is far simpler to dynamically install a single
15control method rather than override the entire DSDT, because kernel
16rebuild/reboot is not needed and test result can be got in minutes.
17
18Note: Only ACPI METHOD can be overridden, any other object types like
19 "Device", "OperationRegion", are not recognized.
20Note: The same ACPI control method can be overridden for many times,
21 and it's always the latest one that used by Linux/kernel.
22
231. override an existing method
24 a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT,
25 just run "cat /sys/firmware/acpi/tables/DSDT > /tmp/dsdt.dat"
26 b) disassemble the table by running "iasl -d dsdt.dat".
27 c) rewrite the ASL code of the method and save it in a new file,
28 d) package the new file (psr.asl) to an ACPI table format.
29 Here is an example of a customized \_SB._AC._PSR method,
30
31 DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715)
32 {
33 External (ACON)
34
35 Method (\_SB_.AC._PSR, 0, NotSerialized)
36 {
37 Store ("In AC _PSR", Debug)
38 Return (ACON)
39 }
40 }
41 Note that the full pathname of the method in ACPI namespace
42 should be used.
43 And remember to use "External" to declare external objects.
44 e) assemble the file to generate the AML code of the method.
45 e.g. "iasl psr.asl" (psr.aml is generated as a result)
46 f) mount debugfs by "mount -t debugfs none /sys/kernel/debug"
47 g) override the old method via the debugfs by running
48 "cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method"
49
502. insert a new method
51 This is easier than overriding an existing method.
52 We just need to create the ASL code of the method we want to
53 insert and then follow the step c) ~ g) in section 1.
54
553. undo your changes
56 The "undo" operation is not supported for a new inserted method
57 right now, i.e. we can not remove a method currently.
58 For an overrided method, in order to undo your changes, please
59 save a copy of the method original ASL code in step c) section 1,
60 and redo step c) ~ g) to override the method with the original one.
61
62
63Note: We can use a kernel with multiple custom ACPI method running,
64 But each individual write to debugfs can implement a SINGLE
65 method override. i.e. if we want to insert/override multiple
66 ACPI methods, we need to redo step c) ~ g) for multiple times.
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS
new file mode 100644
index 000000000000..0af0e9eed5d6
--- /dev/null
+++ b/Documentation/arm/OMAP/DSS
@@ -0,0 +1,317 @@
1OMAP2/3 Display Subsystem
2-------------------------
3
4This 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,
6TV-out and multiple display support, but there are lots of small improvements
7also.
8
9The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB,
10panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live
11currently side by side, you can choose which one to use.
12
13Features
14--------
15
16Working and tested features include:
17
18- MIPI DPI (parallel) output
19- MIPI DSI output in command mode
20- MIPI DBI (RFBI) output
21- SDI output
22- TV output
23- All pieces can be compiled as a module or inside kernel
24- Use DISPC to update any of the outputs
25- Use CPU to update RFBI or DSI output
26- OMAP DISPC planes
27- RGB16, RGB24 packed, RGB24 unpacked
28- YUV2, UYVY
29- Scaling
30- Adjusting DSS FCK to find a good pixel clock
31- Use DSI DPLL to create DSS FCK
32
33Tested boards include:
34- OMAP3 SDP board
35- Beagle board
36- N810
37
38omapdss driver
39--------------
40
41The DSS driver does not itself have any support for Linux framebuffer, V4L or
42such like the current ones, but it has an internal kernel API that upper level
43drivers can use.
44
45The DSS driver models OMAP's overlays, overlay managers and displays in a
46flexible way to enable non-common multi-display configuration. In addition to
47modelling the hardware overlays, omapdss supports virtual overlays and overlay
48managers. These can be used when updating a display with CPU or system DMA.
49
50Panel and controller drivers
51----------------------------
52
53The drivers implement panel or controller specific functionality and are not
54usually visible to users except through omapfb driver. They register
55themselves to the DSS driver.
56
57omapfb driver
58-------------
59
60The omapfb driver implements arbitrary number of standard linux framebuffers.
61These framebuffers can be routed flexibly to any overlays, thus allowing very
62dynamic display architecture.
63
64The driver exports some omapfb specific ioctls, which are compatible with the
65ioctls in the old driver.
66
67The rest of the non standard features are exported via sysfs. Whether the final
68implementation will use sysfs, or ioctls, is still open.
69
70V4L2 drivers
71------------
72
73V4L2 is being implemented in TI.
74
75From omapdss point of view the V4L2 drivers should be similar to framebuffer
76driver.
77
78Architecture
79--------------------
80
81Some clarification what the different components do:
82
83 - Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the
84 pixel data for the image. Framebuffer has width and height and color
85 depth.
86 - Overlay defines where the pixels are read from and where they go on the
87 screen. The overlay may be smaller than framebuffer, thus displaying only
88 part of the framebuffer. The position of the overlay may be changed if
89 the overlay is smaller than the display.
90 - Overlay manager combines the overlays in to one image and feeds them to
91 display.
92 - Display is the actual physical display device.
93
94A framebuffer can be connected to multiple overlays to show the same pixel data
95on all of the overlays. Note that in this case the overlay input sizes must be
96the same, but, in case of video overlays, the output size can be different. Any
97framebuffer can be connected to any overlay.
98
99An overlay can be connected to one overlay manager. Also DISPC overlays can be
100connected only to DISPC overlay managers, and virtual overlays can be only
101connected to virtual overlays.
102
103An overlay manager can be connected to one display. There are certain
104restrictions which kinds of displays an overlay manager can be connected:
105
106 - DISPC TV overlay manager can be only connected to TV display.
107 - Virtual overlay managers can only be connected to DBI or DSI displays.
108 - DISPC LCD overlay manager can be connected to all displays, except TV
109 display.
110
111Sysfs
112-----
113The sysfs interface is mainly used for testing. I don't think sysfs
114interface is the best for this in the final version, but I don't quite know
115what would be the best interfaces for these things.
116
117The sysfs interface is divided to two parts: DSS and FB.
118
119/sys/class/graphics/fb? directory:
120mirror 0=off, 1=on
121rotate Rotation 0-3 for 0, 90, 180, 270 degrees
122rotate_type 0 = DMA rotation, 1 = VRFB rotation
123overlays List of overlay numbers to which framebuffer pixels go
124phys_addr Physical address of the framebuffer
125virt_addr Virtual address of the framebuffer
126size Size of the framebuffer
127
128/sys/devices/platform/omapdss/overlay? directory:
129enabled 0=off, 1=on
130input_size width,height (ie. the framebuffer size)
131manager Destination overlay manager name
132name
133output_size width,height
134position x,y
135screen_width width
136global_alpha global alpha 0-255 0=transparent 255=opaque
137
138/sys/devices/platform/omapdss/manager? directory:
139display Destination display
140name
141alpha_blending_enabled 0=off, 1=on
142trans_key_enabled 0=off, 1=on
143trans_key_type gfx-destination, video-source
144trans_key_value transparency color key (RGB24)
145default_color default background color (RGB24)
146
147/sys/devices/platform/omapdss/display? directory:
148ctrl_name Controller name
149mirror 0=off, 1=on
150update_mode 0=off, 1=auto, 2=manual
151enabled 0=off, 1=on
152name
153rotate Rotation 0-3 for 0, 90, 180, 270 degrees
154timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
155 When writing, two special timings are accepted for tv-out:
156 "pal" and "ntsc"
157panel_name
158tear_elim Tearing elimination 0=off, 1=on
159
160There are also some debugfs files at <debugfs>/omapdss/ which show information
161about clocks and registers.
162
163Examples
164--------
165
166The following definitions have been made for the examples below:
167
168ovl0=/sys/devices/platform/omapdss/overlay0
169ovl1=/sys/devices/platform/omapdss/overlay1
170ovl2=/sys/devices/platform/omapdss/overlay2
171
172mgr0=/sys/devices/platform/omapdss/manager0
173mgr1=/sys/devices/platform/omapdss/manager1
174
175lcd=/sys/devices/platform/omapdss/display0
176dvi=/sys/devices/platform/omapdss/display1
177tv=/sys/devices/platform/omapdss/display2
178
179fb0=/sys/class/graphics/fb0
180fb1=/sys/class/graphics/fb1
181fb2=/sys/class/graphics/fb2
182
183Default setup on OMAP3 SDP
184--------------------------
185
186Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
187and TV-out are not in use. The columns from left to right are:
188framebuffers, overlays, overlay managers, displays. Framebuffers are
189handled by omapfb, and the rest by the DSS.
190
191FB0 --- GFX -\ DVI
192FB1 --- VID1 --+- LCD ---- LCD
193FB2 --- VID2 -/ TV ----- TV
194
195Example: Switch from LCD to DVI
196----------------------
197
198w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
199h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
200
201echo "0" > $lcd/enabled
202echo "" > $mgr0/display
203fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
204# at this point you have to switch the dvi/lcd dip-switch from the omap board
205echo "dvi" > $mgr0/display
206echo "1" > $dvi/enabled
207
208After this the configuration looks like:
209
210FB0 --- GFX -\ -- DVI
211FB1 --- VID1 --+- LCD -/ LCD
212FB2 --- VID2 -/ TV ----- TV
213
214Example: Clone GFX overlay to LCD and TV
215-------------------------------
216
217w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
218h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
219
220echo "0" > $ovl0/enabled
221echo "0" > $ovl1/enabled
222
223echo "" > $fb1/overlays
224echo "0,1" > $fb0/overlays
225
226echo "$w,$h" > $ovl1/output_size
227echo "tv" > $ovl1/manager
228
229echo "1" > $ovl0/enabled
230echo "1" > $ovl1/enabled
231
232echo "1" > $tv/enabled
233
234After this the configuration looks like (only relevant parts shown):
235
236FB0 +-- GFX ---- LCD ---- LCD
237 \- VID1 ---- TV ---- TV
238
239Misc notes
240----------
241
242OMAP FB allocates the framebuffer memory using the OMAP VRAM allocator.
243
244Using DSI DPLL to generate pixel clock it is possible produce the pixel clock
245of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI.
246
247Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB
248does not support mirroring.
249
250VRFB rotation requires much more memory than non-rotated framebuffer, so you
251probably need to increase your vram setting before using VRFB rotation. Also,
252many applications may not work with VRFB if they do not pay attention to all
253framebuffer parameters.
254
255Kernel boot arguments
256---------------------
257
258vram=<size>
259 - Amount of total VRAM to preallocate. For example, "10M". omapfb
260 allocates memory for framebuffers from VRAM.
261
262omapfb.mode=<display>:<mode>[,...]
263 - Default video mode for specified displays. For example,
264 "dvi:800x400MR-24@60". See drivers/video/modedb.c.
265 There are also two special modes: "pal" and "ntsc" that
266 can be used to tv out.
267
268omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]
269 - VRAM allocated for a framebuffer. Normally omapfb allocates vram
270 depending on the display size. With this you can manually allocate
271 more or define the physical address of each framebuffer. For example,
272 "1:4M" to allocate 4M for fb1.
273
274omapfb.debug=<y|n>
275 - Enable debug printing. You have to have OMAPFB debug support enabled
276 in kernel config.
277
278omapfb.test=<y|n>
279 - Draw test pattern to framebuffer whenever framebuffer settings change.
280 You need to have OMAPFB debug support enabled in kernel config.
281
282omapfb.vrfb=<y|n>
283 - Use VRFB rotation for all framebuffers.
284
285omapfb.rotate=<angle>
286 - Default rotation applied to all framebuffers.
287 0 - 0 degree rotation
288 1 - 90 degree rotation
289 2 - 180 degree rotation
290 3 - 270 degree rotation
291
292omapfb.mirror=<y|n>
293 - Default mirror for all framebuffers. Only works with DMA rotation.
294
295omapdss.def_disp=<display>
296 - Name of default display, to which all overlays will be connected.
297 Common examples are "lcd" or "tv".
298
299omapdss.debug=<y|n>
300 - Enable debug printing. You have to have DSS debug support enabled in
301 kernel config.
302
303TODO
304----
305
306DSS locking
307
308Error checking
309- Lots of checks are missing or implemented just as BUG()
310
311System DMA update for DSI
312- Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
313 to skip the empty byte?)
314
315OMAP1 support
316- Not sure if needed
317
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
index 76b3a11e90be..fa968aa99d67 100644
--- a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
+++ b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
@@ -14,8 +14,8 @@ Introduction
14 how the clocks are arranged. The first implementation used as single 14 how the clocks are arranged. The first implementation used as single
15 PLL to feed the ARM, memory and peripherals via a series of dividers 15 PLL to feed the ARM, memory and peripherals via a series of dividers
16 and muxes and this is the implementation that is documented here. A 16 and muxes and this is the implementation that is documented here. A
17 newer version where there is a seperate PLL and clock divider for the 17 newer version where there is a separate PLL and clock divider for the
18 ARM core is available as a seperate driver. 18 ARM core is available as a separate driver.
19 19
20 20
21Layout 21Layout
diff --git a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
index 26422f0f9080..b87292e05f2f 100644
--- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
+++ b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
@@ -55,4 +55,4 @@ Maintainers
55 This board is maintained by Simtec Electronics. 55 This board is maintained by Simtec Electronics.
56 56
57 57
58(c) 2004 Ben Dooks, Simtec Electronics 58Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 948c8718d967..2af2cf39915f 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -134,4 +134,4 @@ Authour
134 134
135 135
136Ben Dooks, 03 October 2004 136Ben Dooks, 03 October 2004
137(c) 2004 Ben Dooks, Simtec Electronics 137Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt
index cff6227b4484..081892df4fda 100644
--- a/Documentation/arm/Samsung-S3C24XX/Overview.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt
@@ -299,4 +299,4 @@ Port Contributors
299Document Author 299Document Author
300--------------- 300---------------
301 301
302Ben Dooks, (c) 2004-2005,2006 Simtec Electronics 302Ben Dooks, Copyright 2004-2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
index 295d971a15ed..f057876b920b 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
+++ b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
@@ -117,4 +117,4 @@ ATA
117Document Author 117Document Author
118--------------- 118---------------
119 119
120Ben Dooks, (c) 2006 Simtec Electronics 120Ben Dooks, Copyright 2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
index ab2a88858f12..909bdc7dd7b5 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
+++ b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
@@ -18,4 +18,4 @@ Camera Interface
18Document Author 18Document Author
19--------------- 19---------------
20 20
21Ben Dooks, (c) 2006 Simtec Electronics 21Ben Dooks, Copyright 2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/Suspend.txt b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
index a30fe510572b..7edd0e2e6c5b 100644
--- a/Documentation/arm/Samsung-S3C24XX/Suspend.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
@@ -133,5 +133,5 @@ Configuration
133Document Author 133Document Author
134--------------- 134---------------
135 135
136Ben Dooks, (c) 2004 Simtec Electronics 136Ben Dooks, Copyright 2004 Simtec Electronics
137 137
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
index 67671eba4231..f82b1faefad5 100644
--- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
+++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
@@ -90,4 +90,4 @@ Platform Data
90Document Author 90Document Author
91--------------- 91---------------
92 92
93Ben Dooks, (c) 2005 Simtec Electronics 93Ben Dooks, Copyright 2005 Simtec Electronics
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/Samsung/Overview.txt
new file mode 100644
index 000000000000..7cced1fea9c3
--- /dev/null
+++ b/Documentation/arm/Samsung/Overview.txt
@@ -0,0 +1,86 @@
1 Samsung ARM Linux Overview
2 ==========================
3
4Introduction
5------------
6
7 The Samsung range of ARM SoCs spans many similar devices, from the initial
8 ARM9 through to the newest ARM cores. This document shows an overview of
9 the current kernel support, how to use it and where to find the code
10 that supports this.
11
12 The currently supported SoCs are:
13
14 - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list
15 - S3C64XX: S3C6400 and S3C6410
16 - S5PC6440
17
18 S5PC100 and S5PC110 support is currently being merged
19
20
21S3C24XX Systems
22---------------
23
24 There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which
25 deals with the architecture and drivers specific to these devices.
26
27 See Documentation/arm/Samsung-S3C24XX/Overview.txt for more information
28 on the implementation details and specific support.
29
30
31Configuration
32-------------
33
34 A number of configurations are supplied, as there is no current way of
35 unifying all the SoCs into one kernel.
36
37 s5p6440_defconfig - S5P6440 specific default configuration
38 s5pc100_defconfig - S5PC100 specific default configuration
39
40
41Layout
42------
43
44 The directory layout is currently being restructured, and consists of
45 several platform directories and then the machine specific directories
46 of the CPUs being built for.
47
48 plat-samsung provides the base for all the implementations, and is the
49 last in the line of include directories that are processed for the build
50 specific information. It contains the base clock, GPIO and device definitions
51 to get the system running.
52
53 plat-s3c is the s3c24xx/s3c64xx platform directory, although it is currently
54 involved in other builds this will be phased out once the relevant code is
55 moved elsewhere.
56
57 plat-s3c24xx is for s3c24xx specific builds, see the S3C24XX docs.
58
59 plat-s3c64xx is for the s3c64xx specific bits, see the S3C24XX docs.
60
61 plat-s5p is for s5p specific builds, more to be added.
62
63
64 [ to finish ]
65
66
67Port Contributors
68-----------------
69
70 Ben Dooks (BJD)
71 Vincent Sanders
72 Herbert Potzl
73 Arnaud Patard (RTP)
74 Roc Wu
75 Klaus Fetscher
76 Dimitry Andric
77 Shannon Holland
78 Guillaume Gourat (NexVision)
79 Christer Weinigel (wingel) (Acer N30)
80 Lucas Correia Villa Real (S3C2400 port)
81
82
83Document Author
84---------------
85
86Copyright 2009-2010 Ben Dooks <ben-linux@fluff.org>
diff --git a/Documentation/arm/Samsung/clksrc-change-registers.awk b/Documentation/arm/Samsung/clksrc-change-registers.awk
new file mode 100755
index 000000000000..0c50220851fb
--- /dev/null
+++ b/Documentation/arm/Samsung/clksrc-change-registers.awk
@@ -0,0 +1,167 @@
1#!/usr/bin/awk -f
2#
3# Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4#
5# Released under GPLv2
6
7# example usage
8# ./clksrc-change-registers.awk arch/arm/plat-s5pc1xx/include/plat/regs-clock.h < src > dst
9
10function extract_value(s)
11{
12 eqat = index(s, "=")
13 comat = index(s, ",")
14 return substr(s, eqat+2, (comat-eqat)-2)
15}
16
17function remove_brackets(b)
18{
19 return substr(b, 2, length(b)-2)
20}
21
22function splitdefine(l, p)
23{
24 r = split(l, tp)
25
26 p[0] = tp[2]
27 p[1] = remove_brackets(tp[3])
28}
29
30function find_length(f)
31{
32 if (0)
33 printf "find_length " f "\n" > "/dev/stderr"
34
35 if (f ~ /0x1/)
36 return 1
37 else if (f ~ /0x3/)
38 return 2
39 else if (f ~ /0x7/)
40 return 3
41 else if (f ~ /0xf/)
42 return 4
43
44 printf "unknown legnth " f "\n" > "/dev/stderr"
45 exit
46}
47
48function find_shift(s)
49{
50 id = index(s, "<")
51 if (id <= 0) {
52 printf "cannot find shift " s "\n" > "/dev/stderr"
53 exit
54 }
55
56 return substr(s, id+2)
57}
58
59
60BEGIN {
61 if (ARGC < 2) {
62 print "too few arguments" > "/dev/stderr"
63 exit
64 }
65
66# read the header file and find the mask values that we will need
67# to replace and create an associative array of values
68
69 while (getline line < ARGV[1] > 0) {
70 if (line ~ /\#define.*_MASK/ &&
71 !(line ~ /S5PC100_EPLL_MASK/) &&
72 !(line ~ /USB_SIG_MASK/)) {
73 splitdefine(line, fields)
74 name = fields[0]
75 if (0)
76 printf "MASK " line "\n" > "/dev/stderr"
77 dmask[name,0] = find_length(fields[1])
78 dmask[name,1] = find_shift(fields[1])
79 if (0)
80 printf "=> '" name "' LENGTH=" dmask[name,0] " SHIFT=" dmask[name,1] "\n" > "/dev/stderr"
81 } else {
82 }
83 }
84
85 delete ARGV[1]
86}
87
88/clksrc_clk.*=.*{/ {
89 shift=""
90 mask=""
91 divshift=""
92 reg_div=""
93 reg_src=""
94 indent=1
95
96 print $0
97
98 for(; indent >= 1;) {
99 if ((getline line) <= 0) {
100 printf "unexpected end of file" > "/dev/stderr"
101 exit 1;
102 }
103
104 if (line ~ /\.shift/) {
105 shift = extract_value(line)
106 } else if (line ~ /\.mask/) {
107 mask = extract_value(line)
108 } else if (line ~ /\.reg_divider/) {
109 reg_div = extract_value(line)
110 } else if (line ~ /\.reg_source/) {
111 reg_src = extract_value(line)
112 } else if (line ~ /\.divider_shift/) {
113 divshift = extract_value(line)
114 } else if (line ~ /{/) {
115 indent++
116 print line
117 } else if (line ~ /}/) {
118 indent--
119
120 if (indent == 0) {
121 if (0) {
122 printf "shift '" shift "' ='" dmask[shift,0] "'\n" > "/dev/stderr"
123 printf "mask '" mask "'\n" > "/dev/stderr"
124 printf "dshft '" divshift "'\n" > "/dev/stderr"
125 printf "rdiv '" reg_div "'\n" > "/dev/stderr"
126 printf "rsrc '" reg_src "'\n" > "/dev/stderr"
127 }
128
129 generated = mask
130 sub(reg_src, reg_div, generated)
131
132 if (0) {
133 printf "/* rsrc " reg_src " */\n"
134 printf "/* rdiv " reg_div " */\n"
135 printf "/* shift " shift " */\n"
136 printf "/* mask " mask " */\n"
137 printf "/* generated " generated " */\n"
138 }
139
140 if (reg_div != "") {
141 printf "\t.reg_div = { "
142 printf ".reg = " reg_div ", "
143 printf ".shift = " dmask[generated,1] ", "
144 printf ".size = " dmask[generated,0] ", "
145 printf "},\n"
146 }
147
148 printf "\t.reg_src = { "
149 printf ".reg = " reg_src ", "
150 printf ".shift = " dmask[mask,1] ", "
151 printf ".size = " dmask[mask,0] ", "
152
153 printf "},\n"
154
155 }
156
157 print line
158 } else {
159 print line
160 }
161
162 if (0)
163 printf indent ":" line "\n" > "/dev/stderr"
164 }
165}
166
167// && ! /clksrc_clk.*=.*{/ { print $0 }
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 9d58c7c5eddd..eb0fae18ffb1 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -59,7 +59,11 @@ PAGE_OFFSET high_memory-1 Kernel direct-mapped RAM region.
59 This maps the platforms RAM, and typically 59 This maps the platforms RAM, and typically
60 maps all platform RAM in a 1:1 relationship. 60 maps all platform RAM in a 1:1 relationship.
61 61
62TASK_SIZE PAGE_OFFSET-1 Kernel module space 62PKMAP_BASE PAGE_OFFSET-1 Permanent kernel mappings
63 One way of mapping HIGHMEM pages into kernel
64 space.
65
66MODULES_VADDR MODULES_END-1 Kernel module space
63 Kernel modules inserted via insmod are 67 Kernel modules inserted via insmod are
64 placed here using dynamic mappings. 68 placed here using dynamic mappings.
65 69
diff --git a/Documentation/arm/tcm.txt b/Documentation/arm/tcm.txt
index 074f4be6667f..77fd9376e6d7 100644
--- a/Documentation/arm/tcm.txt
+++ b/Documentation/arm/tcm.txt
@@ -29,11 +29,13 @@ TCM location and size. Notice that this is not a MMU table: you
29actually move the physical location of the TCM around. At the 29actually move the physical location of the TCM around. At the
30place you put it, it will mask any underlying RAM from the 30place you put it, it will mask any underlying RAM from the
31CPU so it is usually wise not to overlap any physical RAM with 31CPU so it is usually wise not to overlap any physical RAM with
32the TCM. The TCM memory exists totally outside the MMU and will 32the TCM.
33override any MMU mappings.
34 33
35Code executing inside the ITCM does not "see" any MMU mappings 34The TCM memory can then be remapped to another address again using
36and e.g. register accesses must be made to physical addresses. 35the MMU, but notice that the TCM if often used in situations where
36the MMU is turned off. To avoid confusion the current Linux
37implementation will map the TCM 1 to 1 from physical to virtual
38memory in the location specified by the machine.
37 39
38TCM is used for a few things: 40TCM is used for a few things:
39 41
diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX
index d6840a91e1e1..c34e12440fec 100644
--- a/Documentation/blackfin/00-INDEX
+++ b/Documentation/blackfin/00-INDEX
@@ -1,9 +1,6 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3 3
4cache-lock.txt
5 - HOWTO for blackfin cache locking.
6
7cachefeatures.txt 4cachefeatures.txt
8 - Supported cache features. 5 - Supported cache features.
9 6
diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile
new file mode 100644
index 000000000000..773dbb103f1c
--- /dev/null
+++ b/Documentation/blackfin/Makefile
@@ -0,0 +1,6 @@
1obj-m := gptimers-example.o
2
3all: modules
4
5modules clean:
6 $(MAKE) -C ../.. SUBDIRS=$(PWD) $@
diff --git a/Documentation/blackfin/cache-lock.txt b/Documentation/blackfin/cache-lock.txt
deleted file mode 100644
index 88ba1e6c31c3..000000000000
--- a/Documentation/blackfin/cache-lock.txt
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * File: Documentation/blackfin/cache-lock.txt
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: This file contains the simple DMA Implementation for Blackfin
8 *
9 * Rev: $Id: cache-lock.txt 2384 2006-11-01 04:12:43Z magicyang $
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 */
17
18How to lock your code in cache in uClinux/blackfin
19--------------------------------------------------
20
21There are only a few steps required to lock your code into the cache.
22Currently you can lock the code by Way.
23
24Below are the interface provided for locking the cache.
25
26
271. cache_grab_lock(int Ways);
28
29This function grab the lock for locking your code into the cache specified
30by Ways.
31
32
332. cache_lock(int Ways);
34
35This function should be called after your critical code has been executed.
36Once the critical code exits, the code is now loaded into the cache. This
37function locks the code into the cache.
38
39
40So, the example sequence will be:
41
42 cache_grab_lock(WAY0_L); /* Grab the lock */
43
44 critical_code(); /* Execute the code of interest */
45
46 cache_lock(WAY0_L); /* Lock the cache */
47
48Where WAY0_L signifies WAY0 locking.
diff --git a/Documentation/blackfin/cachefeatures.txt b/Documentation/blackfin/cachefeatures.txt
index 0fbec23becb5..75de51f94515 100644
--- a/Documentation/blackfin/cachefeatures.txt
+++ b/Documentation/blackfin/cachefeatures.txt
@@ -41,16 +41,6 @@
41 icplb_flush(); 41 icplb_flush();
42 dcplb_flush(); 42 dcplb_flush();
43 43
44 - Locking the cache.
45
46 cache_grab_lock();
47 cache_lock();
48
49 Please refer linux-2.6.x/Documentation/blackfin/cache-lock.txt for how to
50 lock the cache.
51
52 Locking the cache is optional feature.
53
54 - Miscellaneous cache functions. 44 - Miscellaneous cache functions.
55 45
56 flush_cache_all(); 46 flush_cache_all();
diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/blackfin/gptimers-example.c
new file mode 100644
index 000000000000..b1bd6340e748
--- /dev/null
+++ b/Documentation/blackfin/gptimers-example.c
@@ -0,0 +1,83 @@
1/*
2 * Simple gptimers example
3 * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
4 *
5 * Copyright 2007-2009 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#include <linux/interrupt.h>
11#include <linux/module.h>
12
13#include <asm/gptimers.h>
14#include <asm/portmux.h>
15
16/* ... random driver includes ... */
17
18#define DRIVER_NAME "gptimer_example"
19
20struct gptimer_data {
21 uint32_t period, width;
22};
23static struct gptimer_data data;
24
25/* ... random driver state ... */
26
27static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
28{
29 struct gptimer_data *data = dev_id;
30
31 /* make sure it was our timer which caused the interrupt */
32 if (!get_gptimer_intr(TIMER5_id))
33 return IRQ_NONE;
34
35 /* read the width/period values that were captured for the waveform */
36 data->width = get_gptimer_pwidth(TIMER5_id);
37 data->period = get_gptimer_period(TIMER5_id);
38
39 /* acknowledge the interrupt */
40 clear_gptimer_intr(TIMER5_id);
41
42 /* tell the upper layers we took care of things */
43 return IRQ_HANDLED;
44}
45
46/* ... random driver code ... */
47
48static int __init gptimer_example_init(void)
49{
50 int ret;
51
52 /* grab the peripheral pins */
53 ret = peripheral_request(P_TMR5, DRIVER_NAME);
54 if (ret) {
55 printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
56 return ret;
57 }
58
59 /* grab the IRQ for the timer */
60 ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data);
61 if (ret) {
62 printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
63 peripheral_free(P_TMR5);
64 return ret;
65 }
66
67 /* setup the timer and enable it */
68 set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
69 enable_gptimers(TIMER5bit);
70
71 return 0;
72}
73module_init(gptimer_example_init);
74
75static void __exit gptimer_example_exit(void)
76{
77 disable_gptimers(TIMER5bit);
78 free_irq(IRQ_TIMER5, &data);
79 peripheral_free(P_TMR5);
80}
81module_exit(gptimer_example_exit);
82
83MODULE_LICENSE("BSD");
diff --git a/Documentation/block/00-INDEX b/Documentation/block/00-INDEX
index 961a0513f8c3..a406286f6f3e 100644
--- a/Documentation/block/00-INDEX
+++ b/Documentation/block/00-INDEX
@@ -1,7 +1,5 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3as-iosched.txt
4 - Anticipatory IO scheduler
5barrier.txt 3barrier.txt
6 - I/O Barriers 4 - I/O Barriers
7biodoc.txt 5biodoc.txt
diff --git a/Documentation/block/as-iosched.txt b/Documentation/block/as-iosched.txt
deleted file mode 100644
index 738b72be128e..000000000000
--- a/Documentation/block/as-iosched.txt
+++ /dev/null
@@ -1,172 +0,0 @@
1Anticipatory IO scheduler
2-------------------------
3Nick Piggin <piggin@cyberone.com.au> 13 Sep 2003
4
5Attention! Database servers, especially those using "TCQ" disks should
6investigate performance with the 'deadline' IO scheduler. Any system with high
7disk performance requirements should do so, in fact.
8
9If you see unusual performance characteristics of your disk systems, or you
10see big performance regressions versus the deadline scheduler, please email
11me. Database users don't bother unless you're willing to test a lot of patches
12from me ;) its a known issue.
13
14Also, users with hardware RAID controllers, doing striping, may find
15highly variable performance results with using the as-iosched. The
16as-iosched anticipatory implementation is based on the notion that a disk
17device has only one physical seeking head. A striped RAID controller
18actually has a head for each physical device in the logical RAID device.
19
20However, setting the antic_expire (see tunable parameters below) produces
21very similar behavior to the deadline IO scheduler.
22
23Selecting IO schedulers
24-----------------------
25Refer to Documentation/block/switching-sched.txt for information on
26selecting an io scheduler on a per-device basis.
27
28Anticipatory IO scheduler Policies
29----------------------------------
30The as-iosched implementation implements several layers of policies
31to determine when an IO request is dispatched to the disk controller.
32Here are the policies outlined, in order of application.
33
341. one-way Elevator algorithm.
35
36The elevator algorithm is similar to that used in deadline scheduler, with
37the addition that it allows limited backward movement of the elevator
38(i.e. seeks backwards). A seek backwards can occur when choosing between
39two IO requests where one is behind the elevator's current position, and
40the other is in front of the elevator's position. If the seek distance to
41the request in back of the elevator is less than half the seek distance to
42the request in front of the elevator, then the request in back can be chosen.
43Backward seeks are also limited to a maximum of MAXBACK (1024*1024) sectors.
44This favors forward movement of the elevator, while allowing opportunistic
45"short" backward seeks.
46
472. FIFO expiration times for reads and for writes.
48
49This is again very similar to the deadline IO scheduler. The expiration
50times for requests on these lists is tunable using the parameters read_expire
51and write_expire discussed below. When a read or a write expires in this way,
52the IO scheduler will interrupt its current elevator sweep or read anticipation
53to service the expired request.
54
553. Read and write request batching
56
57A batch is a collection of read requests or a collection of write
58requests. The as scheduler alternates dispatching read and write batches
59to the driver. In the case a read batch, the scheduler submits read
60requests to the driver as long as there are read requests to submit, and
61the read batch time limit has not been exceeded (read_batch_expire).
62The read batch time limit begins counting down only when there are
63competing write requests pending.
64
65In the case of a write batch, the scheduler submits write requests to
66the driver as long as there are write requests available, and the
67write batch time limit has not been exceeded (write_batch_expire).
68However, the length of write batches will be gradually shortened
69when read batches frequently exceed their time limit.
70
71When changing between batch types, the scheduler waits for all requests
72from the previous batch to complete before scheduling requests for the
73next batch.
74
75The read and write fifo expiration times described in policy 2 above
76are checked only when in scheduling IO of a batch for the corresponding
77(read/write) type. So for example, the read FIFO timeout values are
78tested only during read batches. Likewise, the write FIFO timeout
79values are tested only during write batches. For this reason,
80it is generally not recommended for the read batch time
81to be longer than the write expiration time, nor for the write batch
82time to exceed the read expiration time (see tunable parameters below).
83
84When the IO scheduler changes from a read to a write batch,
85it begins the elevator from the request that is on the head of the
86write expiration FIFO. Likewise, when changing from a write batch to
87a read batch, scheduler begins the elevator from the first entry
88on the read expiration FIFO.
89
904. Read anticipation.
91
92Read anticipation occurs only when scheduling a read batch.
93This implementation of read anticipation allows only one read request
94to be dispatched to the disk controller at a time. In
95contrast, many write requests may be dispatched to the disk controller
96at a time during a write batch. It is this characteristic that can make
97the anticipatory scheduler perform anomalously with controllers supporting
98TCQ, or with hardware striped RAID devices. Setting the antic_expire
99queue parameter (see below) to zero disables this behavior, and the
100anticipatory scheduler behaves essentially like the deadline scheduler.
101
102When read anticipation is enabled (antic_expire is not zero), reads
103are dispatched to the disk controller one at a time.
104At the end of each read request, the IO scheduler examines its next
105candidate read request from its sorted read list. If that next request
106is from the same process as the request that just completed,
107or if the next request in the queue is "very close" to the
108just completed request, it is dispatched immediately. Otherwise,
109statistics (average think time, average seek distance) on the process
110that submitted the just completed request are examined. If it seems
111likely that that process will submit another request soon, and that
112request is likely to be near the just completed request, then the IO
113scheduler will stop dispatching more read requests for up to (antic_expire)
114milliseconds, hoping that process will submit a new request near the one
115that just completed. If such a request is made, then it is dispatched
116immediately. If the antic_expire wait time expires, then the IO scheduler
117will dispatch the next read request from the sorted read queue.
118
119To decide whether an anticipatory wait is worthwhile, the scheduler
120maintains statistics for each process that can be used to compute
121mean "think time" (the time between read requests), and mean seek
122distance for that process. One observation is that these statistics
123are associated with each process, but those statistics are not associated
124with a specific IO device. So for example, if a process is doing IO
125on several file systems on separate devices, the statistics will be
126a combination of IO behavior from all those devices.
127
128
129Tuning the anticipatory IO scheduler
130------------------------------------
131When using 'as', the anticipatory IO scheduler there are 5 parameters under
132/sys/block/*/queue/iosched/. All are units of milliseconds.
133
134The parameters are:
135* read_expire
136 Controls how long until a read request becomes "expired". It also controls the
137 interval between which expired requests are served, so set to 50, a request
138 might take anywhere < 100ms to be serviced _if_ it is the next on the
139 expired list. Obviously request expiration strategies won't make the disk
140 go faster. The result basically equates to the timeslice a single reader
141 gets in the presence of other IO. 100*((seek time / read_expire) + 1) is
142 very roughly the % streaming read efficiency your disk should get with
143 multiple readers.
144
145* read_batch_expire
146 Controls how much time a batch of reads is given before pending writes are
147 served. A higher value is more efficient. This might be set below read_expire
148 if writes are to be given higher priority than reads, but reads are to be
149 as efficient as possible when there are no writes. Generally though, it
150 should be some multiple of read_expire.
151
152* write_expire, and
153* write_batch_expire are equivalent to the above, for writes.
154
155* antic_expire
156 Controls the maximum amount of time we can anticipate a good read (one
157 with a short seek distance from the most recently completed request) before
158 giving up. Many other factors may cause anticipation to be stopped early,
159 or some processes will not be "anticipated" at all. Should be a bit higher
160 for big seek time devices though not a linear correspondence - most
161 processes have only a few ms thinktime.
162
163In addition to the tunables above there is a read-only file named est_time
164which, when read, will show:
165
166 - The probability of a task exiting without a cooperating task
167 submitting an anticipated IO.
168
169 - The current mean think time.
170
171 - The seek distance used to determine if an incoming IO is better.
172
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt
index 8d2158a1c6aa..6fab97ea7e6b 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.txt
@@ -186,7 +186,7 @@ a virtual address mapping (unlike the earlier scheme of virtual address
186do not have a corresponding kernel virtual address space mapping) and 186do not have a corresponding kernel virtual address space mapping) and
187low-memory pages. 187low-memory pages.
188 188
189Note: Please refer to Documentation/DMA-mapping.txt for a discussion 189Note: Please refer to Documentation/PCI/PCI-DMA-mapping.txt for a discussion
190on PCI high mem DMA aspects and mapping of scatter gather lists, and support 190on PCI high mem DMA aspects and mapping of scatter gather lists, and support
191for 64 bit PCI. 191for 64 bit PCI.
192 192
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt
index e164403f60e1..f65274081c8d 100644
--- a/Documentation/block/queue-sysfs.txt
+++ b/Documentation/block/queue-sysfs.txt
@@ -25,11 +25,11 @@ size allowed by the hardware.
25 25
26nomerges (RW) 26nomerges (RW)
27------------- 27-------------
28This enables the user to disable the lookup logic involved with IO merging 28This enables the user to disable the lookup logic involved with IO
29requests in the block layer. Merging may still occur through a direct 29merging requests in the block layer. By default (0) all merges are
301-hit cache, since that comes for (almost) free. The IO scheduler will not 30enabled. When set to 1 only simple one-hit merges will be tried. When
31waste cycles doing tree/hash lookups for merges if nomerges is 1. Defaults 31set to 2 no merge algorithms will be tried (including one-hit or more
32to 0, enabling all merges. 32complex tree/hash lookups).
33 33
34nr_requests (RW) 34nr_requests (RW)
35---------------- 35----------------
diff --git a/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg b/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg
new file mode 100644
index 000000000000..f87cfa0dc2fb
--- /dev/null
+++ b/Documentation/blockdev/drbd/DRBD-8.3-data-packets.svg
@@ -0,0 +1,588 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg
4 xmlns:svg="http://www.w3.org/2000/svg"
5 xmlns="http://www.w3.org/2000/svg"
6 version="1.0"
7 width="210mm"
8 height="297mm"
9 viewBox="0 0 21000 29700"
10 id="svg2"
11 style="fill-rule:evenodd">
12 <defs
13 id="defs4" />
14 <g
15 id="Default"
16 style="visibility:visible">
17 <desc
18 id="desc180">Master slide</desc>
19 </g>
20 <path
21 d="M 11999,8601 L 11899,8301 L 12099,8301 L 11999,8601 z"
22 id="path193"
23 style="fill:#008000;visibility:visible" />
24 <path
25 d="M 11999,7801 L 11999,8361"
26 id="path197"
27 style="fill:none;stroke:#008000;visibility:visible" />
28 <path
29 d="M 7999,10401 L 7899,10101 L 8099,10101 L 7999,10401 z"
30 id="path209"
31 style="fill:#008000;visibility:visible" />
32 <path
33 d="M 7999,9601 L 7999,10161"
34 id="path213"
35 style="fill:none;stroke:#008000;visibility:visible" />
36 <path
37 d="M 11999,7801 L 11685,7840 L 11724,7644 L 11999,7801 z"
38 id="path225"
39 style="fill:#008000;visibility:visible" />
40 <path
41 d="M 7999,7001 L 11764,7754"
42 id="path229"
43 style="fill:none;stroke:#008000;visibility:visible" />
44 <g
45 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-1244.4792,1416.5139)"
46 id="g245"
47 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
48 <text
49 id="text247">
50 <tspan
51 x="9139 9368 9579 9808 9986 10075 10252 10481 10659 10837 10909"
52 y="9284"
53 id="tspan249">RSDataReply</tspan>
54 </text>
55 </g>
56 <path
57 d="M 7999,9601 L 8281,9458 L 8311,9655 L 7999,9601 z"
58 id="path259"
59 style="fill:#008000;visibility:visible" />
60 <path
61 d="M 11999,9001 L 8236,9565"
62 id="path263"
63 style="fill:none;stroke:#008000;visibility:visible" />
64 <g
65 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,1620.9382,-1639.4947)"
66 id="g279"
67 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
68 <text
69 id="text281">
70 <tspan
71 x="8743 8972 9132 9310 9573 9801 10013 10242 10419 10597 10775 10953 11114"
72 y="7023"
73 id="tspan283">CsumRSRequest</tspan>
74 </text>
75 </g>
76 <text
77 id="text297"
78 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
79 <tspan
80 x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692"
81 y="5707"
82 id="tspan299">w_make_resync_request()</tspan>
83 </text>
84 <text
85 id="text313"
86 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
87 <tspan
88 x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378"
89 y="7806"
90 id="tspan315">receive_DataRequest()</tspan>
91 </text>
92 <text
93 id="text329"
94 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
95 <tspan
96 x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399"
97 y="8606"
98 id="tspan331">drbd_endio_read_sec()</tspan>
99 </text>
100 <text
101 id="text345"
102 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
103 <tspan
104 x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13825 13986 14164 14426 14604 14710 14871 15049 15154 15332 15510 15616"
105 y="9007"
106 id="tspan347">w_e_end_csum_rs_req()</tspan>
107 </text>
108 <text
109 id="text361"
110 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
111 <tspan
112 x="4444 4550 4728 4889 5066 5138 5299 5477 5655 5883 6095 6324 6501 6590 6768 6997 7175 7352 7424 7585 7691"
113 y="9507"
114 id="tspan363">receive_RSDataReply()</tspan>
115 </text>
116 <text
117 id="text377"
118 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
119 <tspan
120 x="4457 4635 4741 4918 5096 5274 5452 5630 5807 5879 6057 6235 6464 6569 6641 6730 6908 7086 7247 7425 7585 7691"
121 y="10407"
122 id="tspan379">drbd_endio_write_sec()</tspan>
123 </text>
124 <text
125 id="text393"
126 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
127 <tspan
128 x="4647 4825 5003 5180 5358 5536 5714 5820 5997 6158 6319 6497 6658 6836 7013 7085 7263 7424 7585 7691"
129 y="10907"
130 id="tspan395">e_end_resync_block()</tspan>
131 </text>
132 <path
133 d="M 11999,11601 L 11685,11640 L 11724,11444 L 11999,11601 z"
134 id="path405"
135 style="fill:#000080;visibility:visible" />
136 <path
137 d="M 7999,10801 L 11764,11554"
138 id="path409"
139 style="fill:none;stroke:#000080;visibility:visible" />
140 <g
141 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,2434.7562,-1674.649)"
142 id="g425"
143 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
144 <text
145 id="text427">
146 <tspan
147 x="9320 9621 9726 9798 9887 10065 10277 10438"
148 y="10943"
149 id="tspan429">WriteAck</tspan>
150 </text>
151 </g>
152 <text
153 id="text443"
154 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
155 <tspan
156 x="12199 12377 12555 12644 12821 13033 13105 13283 13444 13604 13816 13977 14138 14244"
157 y="11559"
158 id="tspan445">got_BlockAck()</tspan>
159 </text>
160 <text
161 id="text459"
162 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
163 <tspan
164 x="7999 8304 8541 8778 8990 9201 9413 9650 10001 10120 10357 10594 10806 11043 11280 11398 11703 11940 12152 12364 12601 12812 12931 13049 13261 13498 13710 13947 14065 14302 14540 14658 14777 14870 15107 15225 15437 15649 15886"
165 y="4877"
166 id="tspan461">Checksum based Resync, case not in sync</tspan>
167 </text>
168 <text
169 id="text475"
170 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
171 <tspan
172 x="6961 7266 7571 7854 8159 8299 8536 8654 8891 9010 9247 9484 9603 9840 9958 10077 10170 10407"
173 y="2806"
174 id="tspan477">DRBD-8.3 data flow</tspan>
175 </text>
176 <text
177 id="text491"
178 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
179 <tspan
180 x="5190 5419 5596 5774 5952 6113 6291 6468 6646 6824 6985 7146 7324 7586 7692"
181 y="7005"
182 id="tspan493">w_e_send_csum()</tspan>
183 </text>
184 <path
185 d="M 11999,17601 L 11899,17301 L 12099,17301 L 11999,17601 z"
186 id="path503"
187 style="fill:#008000;visibility:visible" />
188 <path
189 d="M 11999,16801 L 11999,17361"
190 id="path507"
191 style="fill:none;stroke:#008000;visibility:visible" />
192 <path
193 d="M 11999,16801 L 11685,16840 L 11724,16644 L 11999,16801 z"
194 id="path519"
195 style="fill:#008000;visibility:visible" />
196 <path
197 d="M 7999,16001 L 11764,16754"
198 id="path523"
199 style="fill:none;stroke:#008000;visibility:visible" />
200 <g
201 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-2539.5806,1529.3491)"
202 id="g539"
203 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
204 <text
205 id="text541">
206 <tspan
207 x="9269 9498 9709 9798 9959 10048 10226 10437 10598 10776"
208 y="18265"
209 id="tspan543">RSIsInSync</tspan>
210 </text>
211 </g>
212 <path
213 d="M 7999,18601 L 8281,18458 L 8311,18655 L 7999,18601 z"
214 id="path553"
215 style="fill:#000080;visibility:visible" />
216 <path
217 d="M 11999,18001 L 8236,18565"
218 id="path557"
219 style="fill:none;stroke:#000080;visibility:visible" />
220 <g
221 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,3461.4027,-1449.3012)"
222 id="g573"
223 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
224 <text
225 id="text575">
226 <tspan
227 x="8743 8972 9132 9310 9573 9801 10013 10242 10419 10597 10775 10953 11114"
228 y="16023"
229 id="tspan577">CsumRSRequest</tspan>
230 </text>
231 </g>
232 <text
233 id="text591"
234 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
235 <tspan
236 x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378"
237 y="16806"
238 id="tspan593">receive_DataRequest()</tspan>
239 </text>
240 <text
241 id="text607"
242 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
243 <tspan
244 x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399"
245 y="17606"
246 id="tspan609">drbd_endio_read_sec()</tspan>
247 </text>
248 <text
249 id="text623"
250 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
251 <tspan
252 x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13825 13986 14164 14426 14604 14710 14871 15049 15154 15332 15510 15616"
253 y="18007"
254 id="tspan625">w_e_end_csum_rs_req()</tspan>
255 </text>
256 <text
257 id="text639"
258 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
259 <tspan
260 x="5735 5913 6091 6180 6357 6446 6607 6696 6874 7085 7246 7424 7585 7691"
261 y="18507"
262 id="tspan641">got_IsInSync()</tspan>
263 </text>
264 <text
265 id="text655"
266 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
267 <tspan
268 x="7999 8304 8541 8778 8990 9201 9413 9650 10001 10120 10357 10594 10806 11043 11280 11398 11703 11940 12152 12364 12601 12812 12931 13049 13261 13498 13710 13947 14065 14159 14396 14514 14726 14937 15175"
269 y="13877"
270 id="tspan657">Checksum based Resync, case in sync</tspan>
271 </text>
272 <path
273 d="M 12000,24601 L 11900,24301 L 12100,24301 L 12000,24601 z"
274 id="path667"
275 style="fill:#008000;visibility:visible" />
276 <path
277 d="M 12000,23801 L 12000,24361"
278 id="path671"
279 style="fill:none;stroke:#008000;visibility:visible" />
280 <path
281 d="M 8000,26401 L 7900,26101 L 8100,26101 L 8000,26401 z"
282 id="path683"
283 style="fill:#008000;visibility:visible" />
284 <path
285 d="M 8000,25601 L 8000,26161"
286 id="path687"
287 style="fill:none;stroke:#008000;visibility:visible" />
288 <path
289 d="M 12000,23801 L 11686,23840 L 11725,23644 L 12000,23801 z"
290 id="path699"
291 style="fill:#008000;visibility:visible" />
292 <path
293 d="M 8000,23001 L 11765,23754"
294 id="path703"
295 style="fill:none;stroke:#008000;visibility:visible" />
296 <g
297 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,-3543.8452,1630.5143)"
298 id="g719"
299 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
300 <text
301 id="text721">
302 <tspan
303 x="9464 9710 9921 10150 10328 10505 10577"
304 y="25236"
305 id="tspan723">OVReply</tspan>
306 </text>
307 </g>
308 <path
309 d="M 8000,25601 L 8282,25458 L 8312,25655 L 8000,25601 z"
310 id="path733"
311 style="fill:#008000;visibility:visible" />
312 <path
313 d="M 12000,25001 L 8237,25565"
314 id="path737"
315 style="fill:none;stroke:#008000;visibility:visible" />
316 <g
317 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,4918.2801,-1381.2128)"
318 id="g753"
319 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
320 <text
321 id="text755">
322 <tspan
323 x="9142 9388 9599 9828 10006 10183 10361 10539 10700"
324 y="23106"
325 id="tspan757">OVRequest</tspan>
326 </text>
327 </g>
328 <text
329 id="text771"
330 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
331 <tspan
332 x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13656 13868 14097 14274 14452 14630 14808 14969 15058 15163"
333 y="23806"
334 id="tspan773">receive_OVRequest()</tspan>
335 </text>
336 <text
337 id="text787"
338 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
339 <tspan
340 x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14084 14262 14439 14617 14795 14956 15134 15295 15400"
341 y="24606"
342 id="tspan789">drbd_endio_read_sec()</tspan>
343 </text>
344 <text
345 id="text803"
346 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
347 <tspan
348 x="12192 12421 12598 12776 12954 13132 13310 13487 13665 13843 14004 14182 14288 14465 14643 14749"
349 y="25007"
350 id="tspan805">w_e_end_ov_req()</tspan>
351 </text>
352 <text
353 id="text819"
354 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
355 <tspan
356 x="5101 5207 5385 5546 5723 5795 5956 6134 6312 6557 6769 6998 7175 7353 7425 7586 7692"
357 y="25507"
358 id="tspan821">receive_OVReply()</tspan>
359 </text>
360 <text
361 id="text835"
362 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
363 <tspan
364 x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692"
365 y="26407"
366 id="tspan837">drbd_endio_read_sec()</tspan>
367 </text>
368 <text
369 id="text851"
370 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
371 <tspan
372 x="4902 5131 5308 5486 5664 5842 6020 6197 6375 6553 6714 6892 6998 7175 7353 7425 7586 7692"
373 y="26907"
374 id="tspan853">w_e_end_ov_reply()</tspan>
375 </text>
376 <path
377 d="M 12000,27601 L 11686,27640 L 11725,27444 L 12000,27601 z"
378 id="path863"
379 style="fill:#000080;visibility:visible" />
380 <path
381 d="M 8000,26801 L 11765,27554"
382 id="path867"
383 style="fill:none;stroke:#000080;visibility:visible" />
384 <g
385 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,5704.1907,-1328.312)"
386 id="g883"
387 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
388 <text
389 id="text885">
390 <tspan
391 x="9279 9525 9736 9965 10143 10303 10481 10553"
392 y="26935"
393 id="tspan887">OVResult</tspan>
394 </text>
395 </g>
396 <text
397 id="text901"
398 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
399 <tspan
400 x="12200 12378 12556 12645 12822 13068 13280 13508 13686 13847 14025 14097 14185 14291"
401 y="27559"
402 id="tspan903">got_OVResult()</tspan>
403 </text>
404 <text
405 id="text917"
406 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
407 <tspan
408 x="8000 8330 8567 8660 8754 8991 9228 9346 9558 9795 9935 10028 10146"
409 y="21877"
410 id="tspan919">Online verify</tspan>
411 </text>
412 <text
413 id="text933"
414 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
415 <tspan
416 x="4641 4870 5047 5310 5488 5649 5826 6004 6182 6343 6521 6626 6804 6982 7160 7338 7499 7587 7693"
417 y="23005"
418 id="tspan935">w_make_ov_request()</tspan>
419 </text>
420 <path
421 d="M 8000,6500 L 7900,6200 L 8100,6200 L 8000,6500 z"
422 id="path945"
423 style="fill:#008000;visibility:visible" />
424 <path
425 d="M 8000,5700 L 8000,6260"
426 id="path949"
427 style="fill:none;stroke:#008000;visibility:visible" />
428 <path
429 d="M 3900,5500 L 3700,5500 L 3700,11000 L 3900,11000"
430 id="path961"
431 style="fill:none;stroke:#000000;visibility:visible" />
432 <path
433 d="M 3900,14500 L 3700,14500 L 3700,18600 L 3900,18600"
434 id="path973"
435 style="fill:none;stroke:#000000;visibility:visible" />
436 <path
437 d="M 3900,22800 L 3700,22800 L 3700,26900 L 3900,26900"
438 id="path985"
439 style="fill:none;stroke:#000000;visibility:visible" />
440 <text
441 id="text1001"
442 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
443 <tspan
444 x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692"
445 y="6506"
446 id="tspan1003">drbd_endio_read_sec()</tspan>
447 </text>
448 <text
449 id="text1017"
450 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
451 <tspan
452 x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692"
453 y="14708"
454 id="tspan1019">w_make_resync_request()</tspan>
455 </text>
456 <text
457 id="text1033"
458 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
459 <tspan
460 x="5190 5419 5596 5774 5952 6113 6291 6468 6646 6824 6985 7146 7324 7586 7692"
461 y="16006"
462 id="tspan1035">w_e_send_csum()</tspan>
463 </text>
464 <path
465 d="M 8000,15501 L 7900,15201 L 8100,15201 L 8000,15501 z"
466 id="path1045"
467 style="fill:#008000;visibility:visible" />
468 <path
469 d="M 8000,14701 L 8000,15261"
470 id="path1049"
471 style="fill:none;stroke:#008000;visibility:visible" />
472 <text
473 id="text1065"
474 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
475 <tspan
476 x="4492 4670 4776 4953 5131 5309 5487 5665 5842 5914 6092 6270 6376 6554 6731 6909 7087 7248 7426 7587 7692"
477 y="15507"
478 id="tspan1067">drbd_endio_read_sec()</tspan>
479 </text>
480 <path
481 d="M 16100,9000 L 16300,9000 L 16300,7500 L 16100,7500"
482 id="path1077"
483 style="fill:none;stroke:#000000;visibility:visible" />
484 <path
485 d="M 16100,18000 L 16300,18000 L 16300,16500 L 16100,16500"
486 id="path1089"
487 style="fill:none;stroke:#000000;visibility:visible" />
488 <path
489 d="M 16100,25000 L 16300,25000 L 16300,23500 L 16100,23500"
490 id="path1101"
491 style="fill:none;stroke:#000000;visibility:visible" />
492 <text
493 id="text1117"
494 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
495 <tspan
496 x="2026 2132 2293 2471 2648 2826 3004 3076 3254 3431 3503 3681 3787"
497 y="5402"
498 id="tspan1119">rs_begin_io()</tspan>
499 </text>
500 <text
501 id="text1133"
502 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
503 <tspan
504 x="2027 2133 2294 2472 2649 2827 3005 3077 3255 3432 3504 3682 3788"
505 y="14402"
506 id="tspan1135">rs_begin_io()</tspan>
507 </text>
508 <text
509 id="text1149"
510 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
511 <tspan
512 x="2026 2132 2293 2471 2648 2826 3004 3076 3254 3431 3503 3681 3787"
513 y="22602"
514 id="tspan1151">rs_begin_io()</tspan>
515 </text>
516 <text
517 id="text1165"
518 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
519 <tspan
520 x="1426 1532 1693 1871 2031 2209 2472 2649 2721 2899 2988 3166 3344 3416 3593 3699"
521 y="11302"
522 id="tspan1167">rs_complete_io()</tspan>
523 </text>
524 <text
525 id="text1181"
526 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
527 <tspan
528 x="1526 1632 1793 1971 2131 2309 2572 2749 2821 2999 3088 3266 3444 3516 3693 3799"
529 y="18931"
530 id="tspan1183">rs_complete_io()</tspan>
531 </text>
532 <text
533 id="text1197"
534 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
535 <tspan
536 x="1526 1632 1793 1971 2131 2309 2572 2749 2821 2999 3088 3266 3444 3516 3693 3799"
537 y="27231"
538 id="tspan1199">rs_complete_io()</tspan>
539 </text>
540 <text
541 id="text1213"
542 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
543 <tspan
544 x="16126 16232 16393 16571 16748 16926 17104 17176 17354 17531 17603 17781 17887"
545 y="7402"
546 id="tspan1215">rs_begin_io()</tspan>
547 </text>
548 <text
549 id="text1229"
550 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
551 <tspan
552 x="16127 16233 16394 16572 16749 16927 17105 17177 17355 17532 17604 17782 17888"
553 y="16331"
554 id="tspan1231">rs_begin_io()</tspan>
555 </text>
556 <text
557 id="text1245"
558 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
559 <tspan
560 x="16127 16233 16394 16572 16749 16927 17105 17177 17355 17532 17604 17782 17888"
561 y="23302"
562 id="tspan1247">rs_begin_io()</tspan>
563 </text>
564 <text
565 id="text1261"
566 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
567 <tspan
568 x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388"
569 y="9302"
570 id="tspan1263">rs_complete_io()</tspan>
571 </text>
572 <text
573 id="text1277"
574 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
575 <tspan
576 x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388"
577 y="18331"
578 id="tspan1279">rs_complete_io()</tspan>
579 </text>
580 <text
581 id="text1293"
582 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
583 <tspan
584 x="16126 16232 16393 16571 16731 16909 17172 17349 17421 17599 17688 17866 18044 18116 18293 18399"
585 y="25302"
586 id="tspan1295">rs_complete_io()</tspan>
587 </text>
588</svg>
diff --git a/Documentation/blockdev/drbd/DRBD-data-packets.svg b/Documentation/blockdev/drbd/DRBD-data-packets.svg
new file mode 100644
index 000000000000..48a1e2165fec
--- /dev/null
+++ b/Documentation/blockdev/drbd/DRBD-data-packets.svg
@@ -0,0 +1,459 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg
4 xmlns:svg="http://www.w3.org/2000/svg"
5 xmlns="http://www.w3.org/2000/svg"
6 version="1.0"
7 width="210mm"
8 height="297mm"
9 viewBox="0 0 21000 29700"
10 id="svg2"
11 style="fill-rule:evenodd">
12 <defs
13 id="defs4" />
14 <g
15 id="Default"
16 style="visibility:visible">
17 <desc
18 id="desc176">Master slide</desc>
19 </g>
20 <path
21 d="M 11999,19601 L 11899,19301 L 12099,19301 L 11999,19601 z"
22 id="path189"
23 style="fill:#008000;visibility:visible" />
24 <path
25 d="M 11999,18801 L 11999,19361"
26 id="path193"
27 style="fill:none;stroke:#008000;visibility:visible" />
28 <path
29 d="M 7999,21401 L 7899,21101 L 8099,21101 L 7999,21401 z"
30 id="path205"
31 style="fill:#008000;visibility:visible" />
32 <path
33 d="M 7999,20601 L 7999,21161"
34 id="path209"
35 style="fill:none;stroke:#008000;visibility:visible" />
36 <path
37 d="M 11999,18801 L 11685,18840 L 11724,18644 L 11999,18801 z"
38 id="path221"
39 style="fill:#008000;visibility:visible" />
40 <path
41 d="M 7999,18001 L 11764,18754"
42 id="path225"
43 style="fill:none;stroke:#008000;visibility:visible" />
44 <text
45 x="-3023.845"
46 y="1106.8124"
47 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)"
48 id="text243"
49 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
50 <tspan
51 x="6115.1553 6344.1553 6555.1553 6784.1553 6962.1553 7051.1553 7228.1553 7457.1553 7635.1553 7813.1553 7885.1553"
52 y="21390.812"
53 id="tspan245">RSDataReply</tspan>
54 </text>
55 <path
56 d="M 7999,20601 L 8281,20458 L 8311,20655 L 7999,20601 z"
57 id="path255"
58 style="fill:#008000;visibility:visible" />
59 <path
60 d="M 11999,20001 L 8236,20565"
61 id="path259"
62 style="fill:none;stroke:#008000;visibility:visible" />
63 <text
64 x="3502.5356"
65 y="-2184.6621"
66 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)"
67 id="text277"
68 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
69 <tspan
70 x="12321.536 12550.536 12761.536 12990.536 13168.536 13257.536 13434.536 13663.536 13841.536 14019.536 14196.536 14374.536 14535.536"
71 y="15854.338"
72 id="tspan279">RSDataRequest</tspan>
73 </text>
74 <text
75 id="text293"
76 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
77 <tspan
78 x="4034 4263 4440 4703 4881 5042 5219 5397 5503 5681 5842 6003 6180 6341 6519 6625 6803 6980 7158 7336 7497 7586 7692"
79 y="17807"
80 id="tspan295">w_make_resync_request()</tspan>
81 </text>
82 <text
83 id="text309"
84 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
85 <tspan
86 x="12199 12305 12483 12644 12821 12893 13054 13232 13410 13638 13816 13905 14083 14311 14489 14667 14845 15023 15184 15272 15378"
87 y="18806"
88 id="tspan311">receive_DataRequest()</tspan>
89 </text>
90 <text
91 id="text325"
92 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
93 <tspan
94 x="12199 12377 12483 12660 12838 13016 13194 13372 13549 13621 13799 13977 14083 14261 14438 14616 14794 14955 15133 15294 15399"
95 y="19606"
96 id="tspan327">drbd_endio_read_sec()</tspan>
97 </text>
98 <text
99 id="text341"
100 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
101 <tspan
102 x="12191 12420 12597 12775 12953 13131 13309 13486 13664 13770 13931 14109 14287 14375 14553 14731 14837 15015 15192 15298"
103 y="20007"
104 id="tspan343">w_e_end_rsdata_req()</tspan>
105 </text>
106 <text
107 id="text357"
108 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
109 <tspan
110 x="4444 4550 4728 4889 5066 5138 5299 5477 5655 5883 6095 6324 6501 6590 6768 6997 7175 7352 7424 7585 7691"
111 y="20507"
112 id="tspan359">receive_RSDataReply()</tspan>
113 </text>
114 <text
115 id="text373"
116 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
117 <tspan
118 x="4457 4635 4741 4918 5096 5274 5452 5630 5807 5879 6057 6235 6464 6569 6641 6730 6908 7086 7247 7425 7585 7691"
119 y="21407"
120 id="tspan375">drbd_endio_write_sec()</tspan>
121 </text>
122 <text
123 id="text389"
124 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
125 <tspan
126 x="4647 4825 5003 5180 5358 5536 5714 5820 5997 6158 6319 6497 6658 6836 7013 7085 7263 7424 7585 7691"
127 y="21907"
128 id="tspan391">e_end_resync_block()</tspan>
129 </text>
130 <path
131 d="M 11999,22601 L 11685,22640 L 11724,22444 L 11999,22601 z"
132 id="path401"
133 style="fill:#000080;visibility:visible" />
134 <path
135 d="M 7999,21801 L 11764,22554"
136 id="path405"
137 style="fill:none;stroke:#000080;visibility:visible" />
138 <text
139 x="4290.3008"
140 y="-2369.6162"
141 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)"
142 id="text423"
143 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
144 <tspan
145 x="13610.301 13911.301 14016.301 14088.301 14177.301 14355.301 14567.301 14728.301"
146 y="19573.385"
147 id="tspan425">WriteAck</tspan>
148 </text>
149 <text
150 id="text439"
151 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
152 <tspan
153 x="12199 12377 12555 12644 12821 13033 13105 13283 13444 13604 13816 13977 14138 14244"
154 y="22559"
155 id="tspan441">got_BlockAck()</tspan>
156 </text>
157 <text
158 id="text455"
159 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
160 <tspan
161 x="7999 8304 8541 8753 8964 9201 9413 9531 9769 9862 10099 10310 10522 10734 10852 10971 11208 11348 11585 11822"
162 y="16877"
163 id="tspan457">Resync blocks, 4-32K</tspan>
164 </text>
165 <path
166 d="M 12000,7601 L 11900,7301 L 12100,7301 L 12000,7601 z"
167 id="path467"
168 style="fill:#008000;visibility:visible" />
169 <path
170 d="M 12000,6801 L 12000,7361"
171 id="path471"
172 style="fill:none;stroke:#008000;visibility:visible" />
173 <path
174 d="M 12000,6801 L 11686,6840 L 11725,6644 L 12000,6801 z"
175 id="path483"
176 style="fill:#008000;visibility:visible" />
177 <path
178 d="M 8000,6001 L 11765,6754"
179 id="path487"
180 style="fill:none;stroke:#008000;visibility:visible" />
181 <text
182 x="-1288.1796"
183 y="1279.7666"
184 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)"
185 id="text505"
186 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
187 <tspan
188 x="8174.8208 8475.8203 8580.8203 8652.8203 8741.8203 8919.8203 9131.8203 9292.8203"
189 y="9516.7666"
190 id="tspan507">WriteAck</tspan>
191 </text>
192 <path
193 d="M 8000,8601 L 8282,8458 L 8312,8655 L 8000,8601 z"
194 id="path517"
195 style="fill:#000080;visibility:visible" />
196 <path
197 d="M 12000,8001 L 8237,8565"
198 id="path521"
199 style="fill:none;stroke:#000080;visibility:visible" />
200 <text
201 x="1065.6655"
202 y="-2097.7664"
203 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)"
204 id="text539"
205 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
206 <tspan
207 x="10682.666 10911.666 11088.666 11177.666"
208 y="4107.2339"
209 id="tspan541">Data</tspan>
210 </text>
211 <text
212 id="text555"
213 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
214 <tspan
215 x="4746 4924 5030 5207 5385 5563 5826 6003 6164 6342 6520 6626 6803 6981 7159 7337 7498 7587 7692"
216 y="5505"
217 id="tspan557">drbd_make_request()</tspan>
218 </text>
219 <text
220 id="text571"
221 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
222 <tspan
223 x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13639 13817 13906 14084 14190"
224 y="6806"
225 id="tspan573">receive_Data()</tspan>
226 </text>
227 <text
228 id="text587"
229 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
230 <tspan
231 x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14207 14312 14384 14473 14651 14829 14990 15168 15328 15434"
232 y="7606"
233 id="tspan589">drbd_endio_write_sec()</tspan>
234 </text>
235 <text
236 id="text603"
237 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
238 <tspan
239 x="12192 12370 12548 12725 12903 13081 13259 13437 13509 13686 13847 14008 14114"
240 y="8007"
241 id="tspan605">e_end_block()</tspan>
242 </text>
243 <text
244 id="text619"
245 style="font-size:318px;font-weight:400;fill:#000080;visibility:visible;font-family:Helvetica embedded">
246 <tspan
247 x="5647 5825 6003 6092 6269 6481 6553 6731 6892 7052 7264 7425 7586 7692"
248 y="8606"
249 id="tspan621">got_BlockAck()</tspan>
250 </text>
251 <text
252 id="text635"
253 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
254 <tspan
255 x="8000 8305 8542 8779 9016 9109 9346 9486 9604 9956 10049 10189 10328 10565 10705 10942 11179 11298 11603 11742 11835 11954 12191 12310 12428 12665 12902 13139 13279 13516 13753"
256 y="4877"
257 id="tspan637">Regular mirrored write, 512-32K</tspan>
258 </text>
259 <text
260 id="text651"
261 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
262 <tspan
263 x="5381 5610 5787 5948 6126 6304 6482 6659 6837 7015 7087 7265 7426 7587 7692"
264 y="6003"
265 id="tspan653">w_send_dblock()</tspan>
266 </text>
267 <path
268 d="M 8000,6800 L 7900,6500 L 8100,6500 L 8000,6800 z"
269 id="path663"
270 style="fill:#008000;visibility:visible" />
271 <path
272 d="M 8000,6000 L 8000,6560"
273 id="path667"
274 style="fill:none;stroke:#008000;visibility:visible" />
275 <text
276 id="text683"
277 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
278 <tspan
279 x="4602 4780 4886 5063 5241 5419 5597 5775 5952 6024 6202 6380 6609 6714 6786 6875 7053 7231 7409 7515 7587 7692"
280 y="6905"
281 id="tspan685">drbd_endio_write_pri()</tspan>
282 </text>
283 <path
284 d="M 12000,13602 L 11900,13302 L 12100,13302 L 12000,13602 z"
285 id="path695"
286 style="fill:#008000;visibility:visible" />
287 <path
288 d="M 12000,12802 L 12000,13362"
289 id="path699"
290 style="fill:none;stroke:#008000;visibility:visible" />
291 <path
292 d="M 12000,12802 L 11686,12841 L 11725,12645 L 12000,12802 z"
293 id="path711"
294 style="fill:#008000;visibility:visible" />
295 <path
296 d="M 8000,12002 L 11765,12755"
297 id="path715"
298 style="fill:none;stroke:#008000;visibility:visible" />
299 <text
300 x="-2155.5266"
301 y="1201.5964"
302 transform="matrix(0.9895258,-0.1443562,0.1443562,0.9895258,0,0)"
303 id="text733"
304 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
305 <tspan
306 x="7202.4736 7431.4736 7608.4736 7697.4736 7875.4736 8104.4736 8282.4736 8459.4736 8531.4736"
307 y="15454.597"
308 id="tspan735">DataReply</tspan>
309 </text>
310 <path
311 d="M 8000,14602 L 8282,14459 L 8312,14656 L 8000,14602 z"
312 id="path745"
313 style="fill:#008000;visibility:visible" />
314 <path
315 d="M 12000,14002 L 8237,14566"
316 id="path749"
317 style="fill:none;stroke:#008000;visibility:visible" />
318 <text
319 x="2280.3804"
320 y="-2103.2141"
321 transform="matrix(0.9788674,0.2044961,-0.2044961,0.9788674,0,0)"
322 id="text767"
323 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
324 <tspan
325 x="11316.381 11545.381 11722.381 11811.381 11989.381 12218.381 12396.381 12573.381 12751.381 12929.381 13090.381"
326 y="9981.7861"
327 id="tspan769">DataRequest</tspan>
328 </text>
329 <text
330 id="text783"
331 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
332 <tspan
333 x="4746 4924 5030 5207 5385 5563 5826 6003 6164 6342 6520 6626 6803 6981 7159 7337 7498 7587 7692"
334 y="11506"
335 id="tspan785">drbd_make_request()</tspan>
336 </text>
337 <text
338 id="text799"
339 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
340 <tspan
341 x="12200 12306 12484 12645 12822 12894 13055 13233 13411 13639 13817 13906 14084 14312 14490 14668 14846 15024 15185 15273 15379"
342 y="12807"
343 id="tspan801">receive_DataRequest()</tspan>
344 </text>
345 <text
346 id="text815"
347 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
348 <tspan
349 x="12200 12378 12484 12661 12839 13017 13195 13373 13550 13622 13800 13978 14084 14262 14439 14617 14795 14956 15134 15295 15400"
350 y="13607"
351 id="tspan817">drbd_endio_read_sec()</tspan>
352 </text>
353 <text
354 id="text831"
355 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
356 <tspan
357 x="12192 12421 12598 12776 12954 13132 13310 13487 13665 13843 14021 14110 14288 14465 14571 14749 14927 15033"
358 y="14008"
359 id="tspan833">w_e_end_data_req()</tspan>
360 </text>
361 <g
362 id="g835"
363 style="visibility:visible">
364 <desc
365 id="desc837">Drawing</desc>
366 <text
367 id="text847"
368 style="font-size:318px;font-weight:400;fill:#008000;font-family:Helvetica embedded">
369 <tspan
370 x="4885 4991 5169 5330 5507 5579 5740 5918 6096 6324 6502 6591 6769 6997 7175 7353 7425 7586 7692"
371 y="14607"
372 id="tspan849">receive_DataReply()</tspan>
373 </text>
374 </g>
375 <text
376 id="text863"
377 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
378 <tspan
379 x="8000 8305 8398 8610 8821 8914 9151 9363 9575 9693 9833 10070 10307 10544 10663 10781 11018 11255 11493 11632 11869 12106"
380 y="10878"
381 id="tspan865">Diskless read, 512-32K</tspan>
382 </text>
383 <text
384 id="text879"
385 style="font-size:318px;font-weight:400;fill:#008000;visibility:visible;font-family:Helvetica embedded">
386 <tspan
387 x="5029 5258 5435 5596 5774 5952 6130 6307 6413 6591 6769 6947 7125 7230 7408 7586 7692"
388 y="12004"
389 id="tspan881">w_send_read_req()</tspan>
390 </text>
391 <text
392 id="text895"
393 style="font-size:423px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
394 <tspan
395 x="6961 7266 7571 7854 8159 8278 8515 8633 8870 9107 9226 9463 9581 9700 9793 10030"
396 y="2806"
397 id="tspan897">DRBD 8 data flow</tspan>
398 </text>
399 <path
400 d="M 3900,5300 L 3700,5300 L 3700,7000 L 3900,7000"
401 id="path907"
402 style="fill:none;stroke:#000000;visibility:visible" />
403 <path
404 d="M 3900,17600 L 3700,17600 L 3700,22000 L 3900,22000"
405 id="path919"
406 style="fill:none;stroke:#000000;visibility:visible" />
407 <path
408 d="M 16100,20000 L 16300,20000 L 16300,18500 L 16100,18500"
409 id="path931"
410 style="fill:none;stroke:#000000;visibility:visible" />
411 <text
412 id="text947"
413 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
414 <tspan
415 x="2126 2304 2376 2554 2731 2909 3087 3159 3337 3515 3587 3764 3870"
416 y="5202"
417 id="tspan949">al_begin_io()</tspan>
418 </text>
419 <text
420 id="text963"
421 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
422 <tspan
423 x="1632 1810 1882 2060 2220 2398 2661 2839 2910 3088 3177 3355 3533 3605 3783 3888"
424 y="7331"
425 id="tspan965">al_complete_io()</tspan>
426 </text>
427 <text
428 id="text979"
429 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
430 <tspan
431 x="2126 2232 2393 2571 2748 2926 3104 3176 3354 3531 3603 3781 3887"
432 y="17431"
433 id="tspan981">rs_begin_io()</tspan>
434 </text>
435 <text
436 id="text995"
437 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
438 <tspan
439 x="1626 1732 1893 2071 2231 2409 2672 2849 2921 3099 3188 3366 3544 3616 3793 3899"
440 y="22331"
441 id="tspan997">rs_complete_io()</tspan>
442 </text>
443 <text
444 id="text1011"
445 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
446 <tspan
447 x="16027 16133 16294 16472 16649 16827 17005 17077 17255 17432 17504 17682 17788"
448 y="18402"
449 id="tspan1013">rs_begin_io()</tspan>
450 </text>
451 <text
452 id="text1027"
453 style="font-size:318px;font-weight:400;fill:#000000;visibility:visible;font-family:Helvetica embedded">
454 <tspan
455 x="16115 16221 16382 16560 16720 16898 17161 17338 17410 17588 17677 17855 18033 18105 18282 18388"
456 y="20331"
457 id="tspan1029">rs_complete_io()</tspan>
458 </text>
459</svg>
diff --git a/Documentation/blockdev/drbd/README.txt b/Documentation/blockdev/drbd/README.txt
new file mode 100644
index 000000000000..627b0a1bf35e
--- /dev/null
+++ b/Documentation/blockdev/drbd/README.txt
@@ -0,0 +1,16 @@
1Description
2
3 DRBD is a shared-nothing, synchronously replicated block device. It
4 is designed to serve as a building block for high availability
5 clusters and in this context, is a "drop-in" replacement for shared
6 storage. Simplistically, you could see it as a network RAID 1.
7
8 Please visit http://www.drbd.org to find out more.
9
10The here included files are intended to help understand the implementation
11
12DRBD-8.3-data-packets.svg, DRBD-data-packets.svg
13 relates some functions, and write packets.
14
15conn-states-8.dot, disk-states-8.dot, node-states-8.dot
16 The sub graphs of DRBD's state transitions
diff --git a/Documentation/blockdev/drbd/conn-states-8.dot b/Documentation/blockdev/drbd/conn-states-8.dot
new file mode 100644
index 000000000000..025e8cf5e64a
--- /dev/null
+++ b/Documentation/blockdev/drbd/conn-states-8.dot
@@ -0,0 +1,18 @@
1digraph conn_states {
2 StandAllone -> WFConnection [ label = "ioctl_set_net()" ]
3 WFConnection -> Unconnected [ label = "unable to bind()" ]
4 WFConnection -> WFReportParams [ label = "in connect() after accept" ]
5 WFReportParams -> StandAllone [ label = "checks in receive_param()" ]
6 WFReportParams -> Connected [ label = "in receive_param()" ]
7 WFReportParams -> WFBitMapS [ label = "sync_handshake()" ]
8 WFReportParams -> WFBitMapT [ label = "sync_handshake()" ]
9 WFBitMapS -> SyncSource [ label = "receive_bitmap()" ]
10 WFBitMapT -> SyncTarget [ label = "receive_bitmap()" ]
11 SyncSource -> Connected
12 SyncTarget -> Connected
13 SyncSource -> PausedSyncS
14 SyncTarget -> PausedSyncT
15 PausedSyncS -> SyncSource
16 PausedSyncT -> SyncTarget
17 Connected -> WFConnection [ label = "* on network error" ]
18}
diff --git a/Documentation/blockdev/drbd/disk-states-8.dot b/Documentation/blockdev/drbd/disk-states-8.dot
new file mode 100644
index 000000000000..d06cfb46fb98
--- /dev/null
+++ b/Documentation/blockdev/drbd/disk-states-8.dot
@@ -0,0 +1,16 @@
1digraph disk_states {
2 Diskless -> Inconsistent [ label = "ioctl_set_disk()" ]
3 Diskless -> Consistent [ label = "ioctl_set_disk()" ]
4 Diskless -> Outdated [ label = "ioctl_set_disk()" ]
5 Consistent -> Outdated [ label = "receive_param()" ]
6 Consistent -> UpToDate [ label = "receive_param()" ]
7 Consistent -> Inconsistent [ label = "start resync" ]
8 Outdated -> Inconsistent [ label = "start resync" ]
9 UpToDate -> Inconsistent [ label = "ioctl_replicate" ]
10 Inconsistent -> UpToDate [ label = "resync completed" ]
11 Consistent -> Failed [ label = "io completion error" ]
12 Outdated -> Failed [ label = "io completion error" ]
13 UpToDate -> Failed [ label = "io completion error" ]
14 Inconsistent -> Failed [ label = "io completion error" ]
15 Failed -> Diskless [ label = "sending notify to peer" ]
16}
diff --git a/Documentation/blockdev/drbd/drbd-connection-state-overview.dot b/Documentation/blockdev/drbd/drbd-connection-state-overview.dot
new file mode 100644
index 000000000000..6d9cf0a7b11d
--- /dev/null
+++ b/Documentation/blockdev/drbd/drbd-connection-state-overview.dot
@@ -0,0 +1,85 @@
1// vim: set sw=2 sts=2 :
2digraph {
3 rankdir=BT
4 bgcolor=white
5
6 node [shape=plaintext]
7 node [fontcolor=black]
8
9 StandAlone [ style=filled,fillcolor=gray,label=StandAlone ]
10
11 node [fontcolor=lightgray]
12
13 Unconnected [ label=Unconnected ]
14
15 CommTrouble [ shape=record,
16 label="{communication loss|{Timeout|BrokenPipe|NetworkFailure}}" ]
17
18 node [fontcolor=gray]
19
20 subgraph cluster_try_connect {
21 label="try to connect, handshake"
22 rank=max
23 WFConnection [ label=WFConnection ]
24 WFReportParams [ label=WFReportParams ]
25 }
26
27 TearDown [ label=TearDown ]
28
29 Connected [ label=Connected,style=filled,fillcolor=green,fontcolor=black ]
30
31 node [fontcolor=lightblue]
32
33 StartingSyncS [ label=StartingSyncS ]
34 StartingSyncT [ label=StartingSyncT ]
35
36 subgraph cluster_bitmap_exchange {
37 node [fontcolor=red]
38 fontcolor=red
39 label="new application (WRITE?) requests blocked\lwhile bitmap is exchanged"
40
41 WFBitMapT [ label=WFBitMapT ]
42 WFSyncUUID [ label=WFSyncUUID ]
43 WFBitMapS [ label=WFBitMapS ]
44 }
45
46 node [fontcolor=blue]
47
48 cluster_resync [ shape=record,label="{<any>resynchronisation process running\l'concurrent' application requests allowed|{{<T>PausedSyncT\nSyncTarget}|{<S>PausedSyncS\nSyncSource}}}" ]
49
50 node [shape=box,fontcolor=black]
51
52 // drbdadm [label="drbdadm connect"]
53 // handshake [label="drbd_connect()\ndrbd_do_handshake\ndrbd_sync_handshake() etc."]
54 // comm_error [label="communication trouble"]
55
56 //
57 // edges
58 // --------------------------------------
59
60 StandAlone -> Unconnected [ label="drbdadm connect" ]
61 Unconnected -> StandAlone [ label="drbdadm disconnect\lor serious communication trouble" ]
62 Unconnected -> WFConnection [ label="receiver thread is started" ]
63 WFConnection -> WFReportParams [ headlabel="accept()\land/or \lconnect()\l" ]
64
65 WFReportParams -> StandAlone [ label="during handshake\lpeers do not agree\labout something essential" ]
66 WFReportParams -> Connected [ label="data identical\lno sync needed",color=green,fontcolor=green ]
67
68 WFReportParams -> WFBitMapS
69 WFReportParams -> WFBitMapT
70 WFBitMapT -> WFSyncUUID [minlen=0.1,constraint=false]
71
72 WFBitMapS -> cluster_resync:S
73 WFSyncUUID -> cluster_resync:T
74
75 edge [color=green]
76 cluster_resync:any -> Connected [ label="resnyc done",fontcolor=green ]
77
78 edge [color=red]
79 WFReportParams -> CommTrouble
80 Connected -> CommTrouble
81 cluster_resync:any -> CommTrouble
82 edge [color=black]
83 CommTrouble -> Unconnected [label="receiver thread is stopped" ]
84
85}
diff --git a/Documentation/blockdev/drbd/node-states-8.dot b/Documentation/blockdev/drbd/node-states-8.dot
new file mode 100644
index 000000000000..4a2b00c23547
--- /dev/null
+++ b/Documentation/blockdev/drbd/node-states-8.dot
@@ -0,0 +1,14 @@
1digraph node_states {
2 Secondary -> Primary [ label = "ioctl_set_state()" ]
3 Primary -> Secondary [ label = "ioctl_set_state()" ]
4}
5
6digraph peer_states {
7 Secondary -> Primary [ label = "recv state packet" ]
8 Primary -> Secondary [ label = "recv state packet" ]
9 Primary -> Unknown [ label = "connection lost" ]
10 Secondary -> Unknown [ label = "connection lost" ]
11 Unknown -> Primary [ label = "connected" ]
12 Unknown -> Secondary [ label = "connected" ]
13}
14
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
index da42ab414c48..2b5f823abd03 100644
--- a/Documentation/cachetlb.txt
+++ b/Documentation/cachetlb.txt
@@ -88,12 +88,12 @@ changes occur:
88 This is used primarily during fault processing. 88 This is used primarily during fault processing.
89 89
905) void update_mmu_cache(struct vm_area_struct *vma, 905) void update_mmu_cache(struct vm_area_struct *vma,
91 unsigned long address, pte_t pte) 91 unsigned long address, pte_t *ptep)
92 92
93 At the end of every page fault, this routine is invoked to 93 At the end of every page fault, this routine is invoked to
94 tell the architecture specific code that a translation 94 tell the architecture specific code that a translation
95 described by "pte" now exists at virtual address "address" 95 now exists at virtual address "address" for address space
96 for address space "vma->vm_mm", in the software page tables. 96 "vma->vm_mm", in the software page tables.
97 97
98 A port may use this information in any way it so chooses. 98 A port may use this information in any way it so chooses.
99 For example, it could use this event to pre-load TLB 99 For example, it could use this event to pre-load TLB
@@ -377,3 +377,27 @@ maps this page at its virtual address.
377 All the functionality of flush_icache_page can be implemented in 377 All the functionality of flush_icache_page can be implemented in
378 flush_dcache_page and update_mmu_cache. In 2.7 the hope is to 378 flush_dcache_page and update_mmu_cache. In 2.7 the hope is to
379 remove this interface completely. 379 remove this interface completely.
380
381The final category of APIs is for I/O to deliberately aliased address
382ranges inside the kernel. Such aliases are set up by use of the
383vmap/vmalloc API. Since kernel I/O goes via physical pages, the I/O
384subsystem assumes that the user mapping and kernel offset mapping are
385the only aliases. This isn't true for vmap aliases, so anything in
386the kernel trying to do I/O to vmap areas must manually manage
387coherency. It must do this by flushing the vmap range before doing
388I/O and invalidating it after the I/O returns.
389
390 void flush_kernel_vmap_range(void *vaddr, int size)
391 flushes the kernel cache for a given virtual address range in
392 the vmap area. This is to make sure that any data the kernel
393 modified in the vmap range is made visible to the physical
394 page. The design is to make this area safe to perform I/O on.
395 Note that this API does *not* also flush the offset map alias
396 of the area.
397
398 void invalidate_kernel_vmap_range(void *vaddr, int size) invalidates
399 the cache for a given virtual address range in the vmap area
400 which prevents the processor from making the cache stale by
401 speculatively reading data while the I/O was occurring to the
402 physical pages. This is only necessary for data reads into the
403 vmap area.
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd
index 2c558cd6c1ef..f4dc9de2694e 100644
--- a/Documentation/cdrom/ide-cd
+++ b/Documentation/cdrom/ide-cd
@@ -159,42 +159,7 @@ two arguments: the CDROM device, and the slot number to which you wish
159to change. If the slot number is -1, the drive is unloaded. 159to change. If the slot number is -1, the drive is unloaded.
160 160
161 161
1624. Compilation options 1624. Common problems
163----------------------
164
165There are a few additional options which can be set when compiling the
166driver. Most people should not need to mess with any of these; they
167are listed here simply for completeness. A compilation option can be
168enabled by adding a line of the form `#define <option> 1' to the top
169of ide-cd.c. All these options are disabled by default.
170
171VERBOSE_IDE_CD_ERRORS
172 If this is set, ATAPI error codes will be translated into textual
173 descriptions. In addition, a dump is made of the command which
174 provoked the error. This is off by default to save the memory used
175 by the (somewhat long) table of error descriptions.
176
177STANDARD_ATAPI
178 If this is set, the code needed to deal with certain drives which do
179 not properly implement the ATAPI spec will be disabled. If you know
180 your drive implements ATAPI properly, you can turn this on to get a
181 slightly smaller kernel.
182
183NO_DOOR_LOCKING
184 If this is set, the driver will never attempt to lock the door of
185 the drive.
186
187CDROM_NBLOCKS_BUFFER
188 This sets the size of the buffer to be used for a CDROMREADAUDIO
189 ioctl. The default is 8.
190
191TEST
192 This currently enables an additional ioctl which enables a user-mode
193 program to execute an arbitrary packet command. See the source for
194 details. This should be left off unless you know what you're doing.
195
196
1975. Common problems
198------------------ 163------------------
199 164
200This section discusses some common problems encountered when trying to 165This section discusses some common problems encountered when trying to
@@ -371,7 +336,7 @@ f. Data corruption.
371 expense of low system performance. 336 expense of low system performance.
372 337
373 338
3746. cdchange.c 3395. cdchange.c
375------------- 340-------------
376 341
377/* 342/*
diff --git a/Documentation/cgroups/blkio-controller.txt b/Documentation/cgroups/blkio-controller.txt
new file mode 100644
index 000000000000..630879cd9a42
--- /dev/null
+++ b/Documentation/cgroups/blkio-controller.txt
@@ -0,0 +1,135 @@
1 Block IO Controller
2 ===================
3Overview
4========
5cgroup subsys "blkio" implements the block io controller. There seems to be
6a need of various kinds of IO control policies (like proportional BW, max BW)
7both at leaf nodes as well as at intermediate nodes in a storage hierarchy.
8Plan is to use the same cgroup based management interface for blkio controller
9and based on user options switch IO policies in the background.
10
11In the first phase, this patchset implements proportional weight time based
12division of disk policy. It is implemented in CFQ. Hence this policy takes
13effect only on leaf nodes when CFQ is being used.
14
15HOWTO
16=====
17You can do a very simple testing of running two dd threads in two different
18cgroups. Here is what you can do.
19
20- Enable group scheduling in CFQ
21 CONFIG_CFQ_GROUP_IOSCHED=y
22
23- Compile and boot into kernel and mount IO controller (blkio).
24
25 mount -t cgroup -o blkio none /cgroup
26
27- Create two cgroups
28 mkdir -p /cgroup/test1/ /cgroup/test2
29
30- Set weights of group test1 and test2
31 echo 1000 > /cgroup/test1/blkio.weight
32 echo 500 > /cgroup/test2/blkio.weight
33
34- Create two same size files (say 512MB each) on same disk (file1, file2) and
35 launch two dd threads in different cgroup to read those files.
36
37 sync
38 echo 3 > /proc/sys/vm/drop_caches
39
40 dd if=/mnt/sdb/zerofile1 of=/dev/null &
41 echo $! > /cgroup/test1/tasks
42 cat /cgroup/test1/tasks
43
44 dd if=/mnt/sdb/zerofile2 of=/dev/null &
45 echo $! > /cgroup/test2/tasks
46 cat /cgroup/test2/tasks
47
48- At macro level, first dd should finish first. To get more precise data, keep
49 on looking at (with the help of script), at blkio.disk_time and
50 blkio.disk_sectors files of both test1 and test2 groups. This will tell how
51 much disk time (in milli seconds), each group got and how many secotors each
52 group dispatched to the disk. We provide fairness in terms of disk time, so
53 ideally io.disk_time of cgroups should be in proportion to the weight.
54
55Various user visible config options
56===================================
57CONFIG_CFQ_GROUP_IOSCHED
58 - Enables group scheduling in CFQ. Currently only 1 level of group
59 creation is allowed.
60
61CONFIG_DEBUG_CFQ_IOSCHED
62 - Enables some debugging messages in blktrace. Also creates extra
63 cgroup file blkio.dequeue.
64
65Config options selected automatically
66=====================================
67These config options are not user visible and are selected/deselected
68automatically based on IO scheduler configuration.
69
70CONFIG_BLK_CGROUP
71 - Block IO controller. Selected by CONFIG_CFQ_GROUP_IOSCHED.
72
73CONFIG_DEBUG_BLK_CGROUP
74 - Debug help. Selected by CONFIG_DEBUG_CFQ_IOSCHED.
75
76Details of cgroup files
77=======================
78- blkio.weight
79 - Specifies per cgroup weight.
80
81 Currently allowed range of weights is from 100 to 1000.
82
83- blkio.time
84 - disk time allocated to cgroup per device in milliseconds. First
85 two fields specify the major and minor number of the device and
86 third field specifies the disk time allocated to group in
87 milliseconds.
88
89- blkio.sectors
90 - number of sectors transferred to/from disk by the group. First
91 two fields specify the major and minor number of the device and
92 third field specifies the number of sectors transferred by the
93 group to/from the device.
94
95- blkio.dequeue
96 - Debugging aid only enabled if CONFIG_DEBUG_CFQ_IOSCHED=y. This
97 gives the statistics about how many a times a group was dequeued
98 from service tree of the device. First two fields specify the major
99 and minor number of the device and third field specifies the number
100 of times a group was dequeued from a particular device.
101
102CFQ sysfs tunable
103=================
104/sys/block/<disk>/queue/iosched/group_isolation
105
106If group_isolation=1, it provides stronger isolation between groups at the
107expense of throughput. By default group_isolation is 0. In general that
108means that if group_isolation=0, expect fairness for sequential workload
109only. Set group_isolation=1 to see fairness for random IO workload also.
110
111Generally CFQ will put random seeky workload in sync-noidle category. CFQ
112will disable idling on these queues and it does a collective idling on group
113of such queues. Generally these are slow moving queues and if there is a
114sync-noidle service tree in each group, that group gets exclusive access to
115disk for certain period. That means it will bring the throughput down if
116group does not have enough IO to drive deeper queue depths and utilize disk
117capacity to the fullest in the slice allocated to it. But the flip side is
118that even a random reader should get better latencies and overall throughput
119if there are lots of sequential readers/sync-idle workload running in the
120system.
121
122If group_isolation=0, then CFQ automatically moves all the random seeky queues
123in the root group. That means there will be no service differentiation for
124that kind of workload. This leads to better throughput as we do collective
125idling on root sync-noidle tree.
126
127By default one should run with group_isolation=0. If that is not sufficient
128and one wants stronger isolation between groups, then set group_isolation=1
129but this will come at cost of reduced throughput.
130
131What works
132==========
133- Currently only sync IO queues are support. All the buffered writes are
134 still system wide and not per group. Hence we will not see service
135 differentiation between buffered writes between groups.
diff --git a/Documentation/cgroups/cgroup_event_listener.c b/Documentation/cgroups/cgroup_event_listener.c
new file mode 100644
index 000000000000..8c2bfc4a6358
--- /dev/null
+++ b/Documentation/cgroups/cgroup_event_listener.c
@@ -0,0 +1,110 @@
1/*
2 * cgroup_event_listener.c - Simple listener of cgroup events
3 *
4 * Copyright (C) Kirill A. Shutemov <kirill@shutemov.name>
5 */
6
7#include <assert.h>
8#include <errno.h>
9#include <fcntl.h>
10#include <libgen.h>
11#include <limits.h>
12#include <stdio.h>
13#include <string.h>
14#include <unistd.h>
15
16#include <sys/eventfd.h>
17
18#define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>\n"
19
20int main(int argc, char **argv)
21{
22 int efd = -1;
23 int cfd = -1;
24 int event_control = -1;
25 char event_control_path[PATH_MAX];
26 char line[LINE_MAX];
27 int ret;
28
29 if (argc != 3) {
30 fputs(USAGE_STR, stderr);
31 return 1;
32 }
33
34 cfd = open(argv[1], O_RDONLY);
35 if (cfd == -1) {
36 fprintf(stderr, "Cannot open %s: %s\n", argv[1],
37 strerror(errno));
38 goto out;
39 }
40
41 ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control",
42 dirname(argv[1]));
43 if (ret >= PATH_MAX) {
44 fputs("Path to cgroup.event_control is too long\n", stderr);
45 goto out;
46 }
47
48 event_control = open(event_control_path, O_WRONLY);
49 if (event_control == -1) {
50 fprintf(stderr, "Cannot open %s: %s\n", event_control_path,
51 strerror(errno));
52 goto out;
53 }
54
55 efd = eventfd(0, 0);
56 if (efd == -1) {
57 perror("eventfd() failed");
58 goto out;
59 }
60
61 ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]);
62 if (ret >= LINE_MAX) {
63 fputs("Arguments string is too long\n", stderr);
64 goto out;
65 }
66
67 ret = write(event_control, line, strlen(line) + 1);
68 if (ret == -1) {
69 perror("Cannot write to cgroup.event_control");
70 goto out;
71 }
72
73 while (1) {
74 uint64_t result;
75
76 ret = read(efd, &result, sizeof(result));
77 if (ret == -1) {
78 if (errno == EINTR)
79 continue;
80 perror("Cannot read from eventfd");
81 break;
82 }
83 assert(ret == sizeof(result));
84
85 ret = access(event_control_path, W_OK);
86 if ((ret == -1) && (errno == ENOENT)) {
87 puts("The cgroup seems to have removed.");
88 ret = 0;
89 break;
90 }
91
92 if (ret == -1) {
93 perror("cgroup.event_control "
94 "is not accessable any more");
95 break;
96 }
97
98 printf("%s %s: crossed\n", argv[1], argv[2]);
99 }
100
101out:
102 if (efd >= 0)
103 close(efd);
104 if (event_control >= 0)
105 close(event_control);
106 if (cfd >= 0)
107 close(cfd);
108
109 return (ret != 0);
110}
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 455d4e6d346d..fd588ff0e296 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -22,6 +22,8 @@ CONTENTS:
222. Usage Examples and Syntax 222. Usage Examples and Syntax
23 2.1 Basic Usage 23 2.1 Basic Usage
24 2.2 Attaching processes 24 2.2 Attaching processes
25 2.3 Mounting hierarchies by name
26 2.4 Notification API
253. Kernel API 273. Kernel API
26 3.1 Overview 28 3.1 Overview
27 3.2 Synchronization 29 3.2 Synchronization
@@ -227,7 +229,14 @@ as the path relative to the root of the cgroup file system.
227Each cgroup is represented by a directory in the cgroup file system 229Each cgroup is represented by a directory in the cgroup file system
228containing the following files describing that cgroup: 230containing the following files describing that cgroup:
229 231
230 - tasks: list of tasks (by pid) attached to that cgroup 232 - tasks: list of tasks (by pid) attached to that cgroup. This list
233 is not guaranteed to be sorted. Writing a thread id into this file
234 moves the thread into this cgroup.
235 - cgroup.procs: list of tgids in the cgroup. This list is not
236 guaranteed to be sorted or free of duplicate tgids, and userspace
237 should sort/uniquify the list if this property is required.
238 Writing a tgid into this file moves all threads with that tgid into
239 this cgroup.
231 - notify_on_release flag: run the release agent on exit? 240 - notify_on_release flag: run the release agent on exit?
232 - release_agent: the path to use for release notifications (this file 241 - release_agent: the path to use for release notifications (this file
233 exists in the top cgroup only) 242 exists in the top cgroup only)
@@ -374,7 +383,7 @@ Now you want to do something with this cgroup.
374 383
375In this directory you can find several files: 384In this directory you can find several files:
376# ls 385# ls
377notify_on_release tasks 386cgroup.procs notify_on_release tasks
378(plus whatever files added by the attached subsystems) 387(plus whatever files added by the attached subsystems)
379 388
380Now attach your shell to this cgroup: 389Now attach your shell to this cgroup:
@@ -427,6 +436,25 @@ you give a subsystem a name.
427The name of the subsystem appears as part of the hierarchy description 436The name of the subsystem appears as part of the hierarchy description
428in /proc/mounts and /proc/<pid>/cgroups. 437in /proc/mounts and /proc/<pid>/cgroups.
429 438
4392.4 Notification API
440--------------------
441
442There is mechanism which allows to get notifications about changing
443status of a cgroup.
444
445To register new notification handler you need:
446 - create a file descriptor for event notification using eventfd(2);
447 - open a control file to be monitored (e.g. memory.usage_in_bytes);
448 - write "<event_fd> <control_fd> <args>" to cgroup.event_control.
449 Interpretation of args is defined by control file implementation;
450
451eventfd will be woken up by control file implementation or when the
452cgroup is removed.
453
454To unregister notification handler just close eventfd.
455
456NOTE: Support of notifications should be implemented for the control
457file. See documentation for the subsystem.
430 458
4313. Kernel API 4593. Kernel API
432============= 460=============
@@ -481,6 +509,11 @@ Each subsystem should:
481- add an entry in linux/cgroup_subsys.h 509- add an entry in linux/cgroup_subsys.h
482- define a cgroup_subsys object called <name>_subsys 510- define a cgroup_subsys object called <name>_subsys
483 511
512If a subsystem can be compiled as a module, it should also have in its
513module initcall a call to cgroup_load_subsys(), and in its exitcall a
514call to cgroup_unload_subsys(). It should also set its_subsys.module =
515THIS_MODULE in its .c file.
516
484Each subsystem may export the following methods. The only mandatory 517Each subsystem may export the following methods. The only mandatory
485methods are create/destroy. Any others that are null are presumed to 518methods are create/destroy. Any others that are null are presumed to
486be successful no-ops. 519be successful no-ops.
@@ -529,10 +562,21 @@ returns an error, this will abort the attach operation. If a NULL
529task is passed, then a successful result indicates that *any* 562task is passed, then a successful result indicates that *any*
530unspecified task can be moved into the cgroup. Note that this isn't 563unspecified task can be moved into the cgroup. Note that this isn't
531called on a fork. If this method returns 0 (success) then this should 564called on a fork. If this method returns 0 (success) then this should
532remain valid while the caller holds cgroup_mutex. If threadgroup is 565remain valid while the caller holds cgroup_mutex and it is ensured that either
566attach() or cancel_attach() will be called in future. If threadgroup is
533true, then a successful result indicates that all threads in the given 567true, then a successful result indicates that all threads in the given
534thread's threadgroup can be moved together. 568thread's threadgroup can be moved together.
535 569
570void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
571 struct task_struct *task, bool threadgroup)
572(cgroup_mutex held by caller)
573
574Called when a task attach operation has failed after can_attach() has succeeded.
575A subsystem whose can_attach() has some side-effects should provide this
576function, so that the subsytem can implement a rollback. If not, not necessary.
577This will be called only about subsystems whose can_attach() operation have
578succeeded.
579
536void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 580void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
537 struct cgroup *old_cgrp, struct task_struct *task, 581 struct cgroup *old_cgrp, struct task_struct *task,
538 bool threadgroup) 582 bool threadgroup)
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt
index 1d7e9784439a..4160df82b3f5 100644
--- a/Documentation/cgroups/cpusets.txt
+++ b/Documentation/cgroups/cpusets.txt
@@ -168,20 +168,20 @@ Each cpuset is represented by a directory in the cgroup file system
168containing (on top of the standard cgroup files) the following 168containing (on top of the standard cgroup files) the following
169files describing that cpuset: 169files describing that cpuset:
170 170
171 - cpus: list of CPUs in that cpuset 171 - cpuset.cpus: list of CPUs in that cpuset
172 - mems: list of Memory Nodes in that cpuset 172 - cpuset.mems: list of Memory Nodes in that cpuset
173 - memory_migrate flag: if set, move pages to cpusets nodes 173 - cpuset.memory_migrate flag: if set, move pages to cpusets nodes
174 - cpu_exclusive flag: is cpu placement exclusive? 174 - cpuset.cpu_exclusive flag: is cpu placement exclusive?
175 - mem_exclusive flag: is memory placement exclusive? 175 - cpuset.mem_exclusive flag: is memory placement exclusive?
176 - mem_hardwall flag: is memory allocation hardwalled 176 - cpuset.mem_hardwall flag: is memory allocation hardwalled
177 - memory_pressure: measure of how much paging pressure in cpuset 177 - cpuset.memory_pressure: measure of how much paging pressure in cpuset
178 - memory_spread_page flag: if set, spread page cache evenly on allowed nodes 178 - cpuset.memory_spread_page flag: if set, spread page cache evenly on allowed nodes
179 - memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes 179 - cpuset.memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes
180 - sched_load_balance flag: if set, load balance within CPUs on that cpuset 180 - cpuset.sched_load_balance flag: if set, load balance within CPUs on that cpuset
181 - sched_relax_domain_level: the searching range when migrating tasks 181 - cpuset.sched_relax_domain_level: the searching range when migrating tasks
182 182
183In addition, the root cpuset only has the following file: 183In addition, the root cpuset only has the following file:
184 - memory_pressure_enabled flag: compute memory_pressure? 184 - cpuset.memory_pressure_enabled flag: compute memory_pressure?
185 185
186New cpusets are created using the mkdir system call or shell 186New cpusets are created using the mkdir system call or shell
187command. The properties of a cpuset, such as its flags, allowed 187command. The properties of a cpuset, such as its flags, allowed
@@ -229,7 +229,7 @@ If a cpuset is cpu or mem exclusive, no other cpuset, other than
229a direct ancestor or descendant, may share any of the same CPUs or 229a direct ancestor or descendant, may share any of the same CPUs or
230Memory Nodes. 230Memory Nodes.
231 231
232A cpuset that is mem_exclusive *or* mem_hardwall is "hardwalled", 232A cpuset that is cpuset.mem_exclusive *or* cpuset.mem_hardwall is "hardwalled",
233i.e. it restricts kernel allocations for page, buffer and other data 233i.e. it restricts kernel allocations for page, buffer and other data
234commonly shared by the kernel across multiple users. All cpusets, 234commonly shared by the kernel across multiple users. All cpusets,
235whether hardwalled or not, restrict allocations of memory for user 235whether hardwalled or not, restrict allocations of memory for user
@@ -304,15 +304,15 @@ times 1000.
304--------------------------- 304---------------------------
305There are two boolean flag files per cpuset that control where the 305There are two boolean flag files per cpuset that control where the
306kernel allocates pages for the file system buffers and related in 306kernel allocates pages for the file system buffers and related in
307kernel data structures. They are called 'memory_spread_page' and 307kernel data structures. They are called 'cpuset.memory_spread_page' and
308'memory_spread_slab'. 308'cpuset.memory_spread_slab'.
309 309
310If the per-cpuset boolean flag file 'memory_spread_page' is set, then 310If the per-cpuset boolean flag file 'cpuset.memory_spread_page' is set, then
311the kernel will spread the file system buffers (page cache) evenly 311the kernel will spread the file system buffers (page cache) evenly
312over all the nodes that the faulting task is allowed to use, instead 312over all the nodes that the faulting task is allowed to use, instead
313of preferring to put those pages on the node where the task is running. 313of preferring to put those pages on the node where the task is running.
314 314
315If the per-cpuset boolean flag file 'memory_spread_slab' is set, 315If the per-cpuset boolean flag file 'cpuset.memory_spread_slab' is set,
316then the kernel will spread some file system related slab caches, 316then the kernel will spread some file system related slab caches,
317such as for inodes and dentries evenly over all the nodes that the 317such as for inodes and dentries evenly over all the nodes that the
318faulting task is allowed to use, instead of preferring to put those 318faulting task is allowed to use, instead of preferring to put those
@@ -337,21 +337,21 @@ their containing tasks memory spread settings. If memory spreading
337is turned off, then the currently specified NUMA mempolicy once again 337is turned off, then the currently specified NUMA mempolicy once again
338applies to memory page allocations. 338applies to memory page allocations.
339 339
340Both 'memory_spread_page' and 'memory_spread_slab' are boolean flag 340Both 'cpuset.memory_spread_page' and 'cpuset.memory_spread_slab' are boolean flag
341files. By default they contain "0", meaning that the feature is off 341files. By default they contain "0", meaning that the feature is off
342for that cpuset. If a "1" is written to that file, then that turns 342for that cpuset. If a "1" is written to that file, then that turns
343the named feature on. 343the named feature on.
344 344
345The implementation is simple. 345The implementation is simple.
346 346
347Setting the flag 'memory_spread_page' turns on a per-process flag 347Setting the flag 'cpuset.memory_spread_page' turns on a per-process flag
348PF_SPREAD_PAGE for each task that is in that cpuset or subsequently 348PF_SPREAD_PAGE for each task that is in that cpuset or subsequently
349joins that cpuset. The page allocation calls for the page cache 349joins that cpuset. The page allocation calls for the page cache
350is modified to perform an inline check for this PF_SPREAD_PAGE task 350is modified to perform an inline check for this PF_SPREAD_PAGE task
351flag, and if set, a call to a new routine cpuset_mem_spread_node() 351flag, and if set, a call to a new routine cpuset_mem_spread_node()
352returns the node to prefer for the allocation. 352returns the node to prefer for the allocation.
353 353
354Similarly, setting 'memory_spread_slab' turns on the flag 354Similarly, setting 'cpuset.memory_spread_slab' turns on the flag
355PF_SPREAD_SLAB, and appropriately marked slab caches will allocate 355PF_SPREAD_SLAB, and appropriately marked slab caches will allocate
356pages from the node returned by cpuset_mem_spread_node(). 356pages from the node returned by cpuset_mem_spread_node().
357 357
@@ -404,24 +404,24 @@ the following two situations:
404 system overhead on those CPUs, including avoiding task load 404 system overhead on those CPUs, including avoiding task load
405 balancing if that is not needed. 405 balancing if that is not needed.
406 406
407When the per-cpuset flag "sched_load_balance" is enabled (the default 407When the per-cpuset flag "cpuset.sched_load_balance" is enabled (the default
408setting), it requests that all the CPUs in that cpusets allowed 'cpus' 408setting), it requests that all the CPUs in that cpusets allowed 'cpuset.cpus'
409be contained in a single sched domain, ensuring that load balancing 409be contained in a single sched domain, ensuring that load balancing
410can move a task (not otherwised pinned, as by sched_setaffinity) 410can move a task (not otherwised pinned, as by sched_setaffinity)
411from any CPU in that cpuset to any other. 411from any CPU in that cpuset to any other.
412 412
413When the per-cpuset flag "sched_load_balance" is disabled, then the 413When the per-cpuset flag "cpuset.sched_load_balance" is disabled, then the
414scheduler will avoid load balancing across the CPUs in that cpuset, 414scheduler will avoid load balancing across the CPUs in that cpuset,
415--except-- in so far as is necessary because some overlapping cpuset 415--except-- in so far as is necessary because some overlapping cpuset
416has "sched_load_balance" enabled. 416has "sched_load_balance" enabled.
417 417
418So, for example, if the top cpuset has the flag "sched_load_balance" 418So, for example, if the top cpuset has the flag "cpuset.sched_load_balance"
419enabled, then the scheduler will have one sched domain covering all 419enabled, then the scheduler will have one sched domain covering all
420CPUs, and the setting of the "sched_load_balance" flag in any other 420CPUs, and the setting of the "cpuset.sched_load_balance" flag in any other
421cpusets won't matter, as we're already fully load balancing. 421cpusets won't matter, as we're already fully load balancing.
422 422
423Therefore in the above two situations, the top cpuset flag 423Therefore in the above two situations, the top cpuset flag
424"sched_load_balance" should be disabled, and only some of the smaller, 424"cpuset.sched_load_balance" should be disabled, and only some of the smaller,
425child cpusets have this flag enabled. 425child cpusets have this flag enabled.
426 426
427When doing this, you don't usually want to leave any unpinned tasks in 427When doing this, you don't usually want to leave any unpinned tasks in
@@ -433,7 +433,7 @@ scheduler might not consider the possibility of load balancing that
433task to that underused CPU. 433task to that underused CPU.
434 434
435Of course, tasks pinned to a particular CPU can be left in a cpuset 435Of course, tasks pinned to a particular CPU can be left in a cpuset
436that disables "sched_load_balance" as those tasks aren't going anywhere 436that disables "cpuset.sched_load_balance" as those tasks aren't going anywhere
437else anyway. 437else anyway.
438 438
439There is an impedance mismatch here, between cpusets and sched domains. 439There is an impedance mismatch here, between cpusets and sched domains.
@@ -443,19 +443,19 @@ overlap and each CPU is in at most one sched domain.
443It is necessary for sched domains to be flat because load balancing 443It is necessary for sched domains to be flat because load balancing
444across partially overlapping sets of CPUs would risk unstable dynamics 444across partially overlapping sets of CPUs would risk unstable dynamics
445that would be beyond our understanding. So if each of two partially 445that would be beyond our understanding. So if each of two partially
446overlapping cpusets enables the flag 'sched_load_balance', then we 446overlapping cpusets enables the flag 'cpuset.sched_load_balance', then we
447form a single sched domain that is a superset of both. We won't move 447form a single sched domain that is a superset of both. We won't move
448a task to a CPU outside it cpuset, but the scheduler load balancing 448a task to a CPU outside it cpuset, but the scheduler load balancing
449code might waste some compute cycles considering that possibility. 449code might waste some compute cycles considering that possibility.
450 450
451This mismatch is why there is not a simple one-to-one relation 451This mismatch is why there is not a simple one-to-one relation
452between which cpusets have the flag "sched_load_balance" enabled, 452between which cpusets have the flag "cpuset.sched_load_balance" enabled,
453and the sched domain configuration. If a cpuset enables the flag, it 453and the sched domain configuration. If a cpuset enables the flag, it
454will get balancing across all its CPUs, but if it disables the flag, 454will get balancing across all its CPUs, but if it disables the flag,
455it will only be assured of no load balancing if no other overlapping 455it will only be assured of no load balancing if no other overlapping
456cpuset enables the flag. 456cpuset enables the flag.
457 457
458If two cpusets have partially overlapping 'cpus' allowed, and only 458If two cpusets have partially overlapping 'cpuset.cpus' allowed, and only
459one of them has this flag enabled, then the other may find its 459one of them has this flag enabled, then the other may find its
460tasks only partially load balanced, just on the overlapping CPUs. 460tasks only partially load balanced, just on the overlapping CPUs.
461This is just the general case of the top_cpuset example given a few 461This is just the general case of the top_cpuset example given a few
@@ -468,23 +468,23 @@ load balancing to the other CPUs.
4681.7.1 sched_load_balance implementation details. 4681.7.1 sched_load_balance implementation details.
469------------------------------------------------ 469------------------------------------------------
470 470
471The per-cpuset flag 'sched_load_balance' defaults to enabled (contrary 471The per-cpuset flag 'cpuset.sched_load_balance' defaults to enabled (contrary
472to most cpuset flags.) When enabled for a cpuset, the kernel will 472to most cpuset flags.) When enabled for a cpuset, the kernel will
473ensure that it can load balance across all the CPUs in that cpuset 473ensure that it can load balance across all the CPUs in that cpuset
474(makes sure that all the CPUs in the cpus_allowed of that cpuset are 474(makes sure that all the CPUs in the cpus_allowed of that cpuset are
475in the same sched domain.) 475in the same sched domain.)
476 476
477If two overlapping cpusets both have 'sched_load_balance' enabled, 477If two overlapping cpusets both have 'cpuset.sched_load_balance' enabled,
478then they will be (must be) both in the same sched domain. 478then they will be (must be) both in the same sched domain.
479 479
480If, as is the default, the top cpuset has 'sched_load_balance' enabled, 480If, as is the default, the top cpuset has 'cpuset.sched_load_balance' enabled,
481then by the above that means there is a single sched domain covering 481then by the above that means there is a single sched domain covering
482the whole system, regardless of any other cpuset settings. 482the whole system, regardless of any other cpuset settings.
483 483
484The kernel commits to user space that it will avoid load balancing 484The kernel commits to user space that it will avoid load balancing
485where it can. It will pick as fine a granularity partition of sched 485where it can. It will pick as fine a granularity partition of sched
486domains as it can while still providing load balancing for any set 486domains as it can while still providing load balancing for any set
487of CPUs allowed to a cpuset having 'sched_load_balance' enabled. 487of CPUs allowed to a cpuset having 'cpuset.sched_load_balance' enabled.
488 488
489The internal kernel cpuset to scheduler interface passes from the 489The internal kernel cpuset to scheduler interface passes from the
490cpuset code to the scheduler code a partition of the load balanced 490cpuset code to the scheduler code a partition of the load balanced
@@ -495,9 +495,9 @@ all the CPUs that must be load balanced.
495The cpuset code builds a new such partition and passes it to the 495The cpuset code builds a new such partition and passes it to the
496scheduler sched domain setup code, to have the sched domains rebuilt 496scheduler sched domain setup code, to have the sched domains rebuilt
497as necessary, whenever: 497as necessary, whenever:
498 - the 'sched_load_balance' flag of a cpuset with non-empty CPUs changes, 498 - the 'cpuset.sched_load_balance' flag of a cpuset with non-empty CPUs changes,
499 - or CPUs come or go from a cpuset with this flag enabled, 499 - or CPUs come or go from a cpuset with this flag enabled,
500 - or 'sched_relax_domain_level' value of a cpuset with non-empty CPUs 500 - or 'cpuset.sched_relax_domain_level' value of a cpuset with non-empty CPUs
501 and with this flag enabled changes, 501 and with this flag enabled changes,
502 - or a cpuset with non-empty CPUs and with this flag enabled is removed, 502 - or a cpuset with non-empty CPUs and with this flag enabled is removed,
503 - or a cpu is offlined/onlined. 503 - or a cpu is offlined/onlined.
@@ -542,7 +542,7 @@ As the result, task B on CPU X need to wait task A or wait load balance
542on the next tick. For some applications in special situation, waiting 542on the next tick. For some applications in special situation, waiting
5431 tick may be too long. 5431 tick may be too long.
544 544
545The 'sched_relax_domain_level' file allows you to request changing 545The 'cpuset.sched_relax_domain_level' file allows you to request changing
546this searching range as you like. This file takes int value which 546this searching range as you like. This file takes int value which
547indicates size of searching range in levels ideally as follows, 547indicates size of searching range in levels ideally as follows,
548otherwise initial value -1 that indicates the cpuset has no request. 548otherwise initial value -1 that indicates the cpuset has no request.
@@ -559,8 +559,8 @@ The system default is architecture dependent. The system default
559can be changed using the relax_domain_level= boot parameter. 559can be changed using the relax_domain_level= boot parameter.
560 560
561This file is per-cpuset and affect the sched domain where the cpuset 561This file is per-cpuset and affect the sched domain where the cpuset
562belongs to. Therefore if the flag 'sched_load_balance' of a cpuset 562belongs to. Therefore if the flag 'cpuset.sched_load_balance' of a cpuset
563is disabled, then 'sched_relax_domain_level' have no effect since 563is disabled, then 'cpuset.sched_relax_domain_level' have no effect since
564there is no sched domain belonging the cpuset. 564there is no sched domain belonging the cpuset.
565 565
566If multiple cpusets are overlapping and hence they form a single sched 566If multiple cpusets are overlapping and hence they form a single sched
@@ -607,9 +607,9 @@ from one cpuset to another, then the kernel will adjust the tasks
607memory placement, as above, the next time that the kernel attempts 607memory placement, as above, the next time that the kernel attempts
608to allocate a page of memory for that task. 608to allocate a page of memory for that task.
609 609
610If a cpuset has its 'cpus' modified, then each task in that cpuset 610If a cpuset has its 'cpuset.cpus' modified, then each task in that cpuset
611will have its allowed CPU placement changed immediately. Similarly, 611will have its allowed CPU placement changed immediately. Similarly,
612if a tasks pid is written to another cpusets 'tasks' file, then its 612if a tasks pid is written to another cpusets 'cpuset.tasks' file, then its
613allowed CPU placement is changed immediately. If such a task had been 613allowed CPU placement is changed immediately. If such a task had been
614bound to some subset of its cpuset using the sched_setaffinity() call, 614bound to some subset of its cpuset using the sched_setaffinity() call,
615the task will be allowed to run on any CPU allowed in its new cpuset, 615the task will be allowed to run on any CPU allowed in its new cpuset,
@@ -622,8 +622,8 @@ and the processor placement is updated immediately.
622Normally, once a page is allocated (given a physical page 622Normally, once a page is allocated (given a physical page
623of main memory) then that page stays on whatever node it 623of main memory) then that page stays on whatever node it
624was allocated, so long as it remains allocated, even if the 624was allocated, so long as it remains allocated, even if the
625cpusets memory placement policy 'mems' subsequently changes. 625cpusets memory placement policy 'cpuset.mems' subsequently changes.
626If the cpuset flag file 'memory_migrate' is set true, then when 626If the cpuset flag file 'cpuset.memory_migrate' is set true, then when
627tasks are attached to that cpuset, any pages that task had 627tasks are attached to that cpuset, any pages that task had
628allocated to it on nodes in its previous cpuset are migrated 628allocated to it on nodes in its previous cpuset are migrated
629to the tasks new cpuset. The relative placement of the page within 629to the tasks new cpuset. The relative placement of the page within
@@ -631,12 +631,12 @@ the cpuset is preserved during these migration operations if possible.
631For example if the page was on the second valid node of the prior cpuset 631For example if the page was on the second valid node of the prior cpuset
632then the page will be placed on the second valid node of the new cpuset. 632then the page will be placed on the second valid node of the new cpuset.
633 633
634Also if 'memory_migrate' is set true, then if that cpusets 634Also if 'cpuset.memory_migrate' is set true, then if that cpusets
635'mems' file is modified, pages allocated to tasks in that 635'cpuset.mems' file is modified, pages allocated to tasks in that
636cpuset, that were on nodes in the previous setting of 'mems', 636cpuset, that were on nodes in the previous setting of 'cpuset.mems',
637will be moved to nodes in the new setting of 'mems.' 637will be moved to nodes in the new setting of 'mems.'
638Pages that were not in the tasks prior cpuset, or in the cpusets 638Pages that were not in the tasks prior cpuset, or in the cpusets
639prior 'mems' setting, will not be moved. 639prior 'cpuset.mems' setting, will not be moved.
640 640
641There is an exception to the above. If hotplug functionality is used 641There is an exception to the above. If hotplug functionality is used
642to remove all the CPUs that are currently assigned to a cpuset, 642to remove all the CPUs that are currently assigned to a cpuset,
@@ -678,8 +678,8 @@ and then start a subshell 'sh' in that cpuset:
678 cd /dev/cpuset 678 cd /dev/cpuset
679 mkdir Charlie 679 mkdir Charlie
680 cd Charlie 680 cd Charlie
681 /bin/echo 2-3 > cpus 681 /bin/echo 2-3 > cpuset.cpus
682 /bin/echo 1 > mems 682 /bin/echo 1 > cpuset.mems
683 /bin/echo $$ > tasks 683 /bin/echo $$ > tasks
684 sh 684 sh
685 # The subshell 'sh' is now running in cpuset Charlie 685 # The subshell 'sh' is now running in cpuset Charlie
@@ -725,10 +725,13 @@ Now you want to do something with this cpuset.
725 725
726In this directory you can find several files: 726In this directory you can find several files:
727# ls 727# ls
728cpu_exclusive memory_migrate mems tasks 728cpuset.cpu_exclusive cpuset.memory_spread_slab
729cpus memory_pressure notify_on_release 729cpuset.cpus cpuset.mems
730mem_exclusive memory_spread_page sched_load_balance 730cpuset.mem_exclusive cpuset.sched_load_balance
731mem_hardwall memory_spread_slab sched_relax_domain_level 731cpuset.mem_hardwall cpuset.sched_relax_domain_level
732cpuset.memory_migrate notify_on_release
733cpuset.memory_pressure tasks
734cpuset.memory_spread_page
732 735
733Reading them will give you information about the state of this cpuset: 736Reading them will give you information about the state of this cpuset:
734the CPUs and Memory Nodes it can use, the processes that are using 737the CPUs and Memory Nodes it can use, the processes that are using
@@ -736,13 +739,13 @@ it, its properties. By writing to these files you can manipulate
736the cpuset. 739the cpuset.
737 740
738Set some flags: 741Set some flags:
739# /bin/echo 1 > cpu_exclusive 742# /bin/echo 1 > cpuset.cpu_exclusive
740 743
741Add some cpus: 744Add some cpus:
742# /bin/echo 0-7 > cpus 745# /bin/echo 0-7 > cpuset.cpus
743 746
744Add some mems: 747Add some mems:
745# /bin/echo 0-7 > mems 748# /bin/echo 0-7 > cpuset.mems
746 749
747Now attach your shell to this cpuset: 750Now attach your shell to this cpuset:
748# /bin/echo $$ > tasks 751# /bin/echo $$ > tasks
@@ -774,28 +777,28 @@ echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent
774This is the syntax to use when writing in the cpus or mems files 777This is the syntax to use when writing in the cpus or mems files
775in cpuset directories: 778in cpuset directories:
776 779
777# /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 780# /bin/echo 1-4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4
778# /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 781# /bin/echo 1,2,3,4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4
779 782
780To add a CPU to a cpuset, write the new list of CPUs including the 783To add a CPU to a cpuset, write the new list of CPUs including the
781CPU to be added. To add 6 to the above cpuset: 784CPU to be added. To add 6 to the above cpuset:
782 785
783# /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6 786# /bin/echo 1-4,6 > cpuset.cpus -> set cpus list to cpus 1,2,3,4,6
784 787
785Similarly to remove a CPU from a cpuset, write the new list of CPUs 788Similarly to remove a CPU from a cpuset, write the new list of CPUs
786without the CPU to be removed. 789without the CPU to be removed.
787 790
788To remove all the CPUs: 791To remove all the CPUs:
789 792
790# /bin/echo "" > cpus -> clear cpus list 793# /bin/echo "" > cpuset.cpus -> clear cpus list
791 794
7922.3 Setting flags 7952.3 Setting flags
793----------------- 796-----------------
794 797
795The syntax is very simple: 798The syntax is very simple:
796 799
797# /bin/echo 1 > cpu_exclusive -> set flag 'cpu_exclusive' 800# /bin/echo 1 > cpuset.cpu_exclusive -> set flag 'cpuset.cpu_exclusive'
798# /bin/echo 0 > cpu_exclusive -> unset flag 'cpu_exclusive' 801# /bin/echo 0 > cpuset.cpu_exclusive -> unset flag 'cpuset.cpu_exclusive'
799 802
8002.4 Attaching processes 8032.4 Attaching processes
801----------------------- 804-----------------------
diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt
index 72db89ed0609..f7f68b2ac199 100644
--- a/Documentation/cgroups/memcg_test.txt
+++ b/Documentation/cgroups/memcg_test.txt
@@ -1,6 +1,6 @@
1Memory Resource Controller(Memcg) Implementation Memo. 1Memory Resource Controller(Memcg) Implementation Memo.
2Last Updated: 2009/1/20 2Last Updated: 2010/2
3Base Kernel Version: based on 2.6.29-rc2. 3Base Kernel Version: based on 2.6.33-rc7-mm(candidate for 34).
4 4
5Because VM is getting complex (one of reasons is memcg...), memcg's behavior 5Because VM is getting complex (one of reasons is memcg...), memcg's behavior
6is complex. This is a document for memcg's internal behavior. 6is complex. This is a document for memcg's internal behavior.
@@ -337,7 +337,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
337 race and lock dependency with other cgroup subsystems. 337 race and lock dependency with other cgroup subsystems.
338 338
339 example) 339 example)
340 # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices 340 # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices
341 341
342 and do task move, mkdir, rmdir etc...under this. 342 and do task move, mkdir, rmdir etc...under this.
343 343
@@ -348,7 +348,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
348 348
349 For example, test like following is good. 349 For example, test like following is good.
350 (Shell-A) 350 (Shell-A)
351 # mount -t cgroup none /cgroup -t memory 351 # mount -t cgroup none /cgroup -o memory
352 # mkdir /cgroup/test 352 # mkdir /cgroup/test
353 # echo 40M > /cgroup/test/memory.limit_in_bytes 353 # echo 40M > /cgroup/test/memory.limit_in_bytes
354 # echo 0 > /cgroup/test/tasks 354 # echo 0 > /cgroup/test/tasks
@@ -378,3 +378,42 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
378 #echo 50M > memory.limit_in_bytes 378 #echo 50M > memory.limit_in_bytes
379 #echo 50M > memory.memsw.limit_in_bytes 379 #echo 50M > memory.memsw.limit_in_bytes
380 run 51M of malloc 380 run 51M of malloc
381
382 9.9 Move charges at task migration
383 Charges associated with a task can be moved along with task migration.
384
385 (Shell-A)
386 #mkdir /cgroup/A
387 #echo $$ >/cgroup/A/tasks
388 run some programs which uses some amount of memory in /cgroup/A.
389
390 (Shell-B)
391 #mkdir /cgroup/B
392 #echo 1 >/cgroup/B/memory.move_charge_at_immigrate
393 #echo "pid of the program running in group A" >/cgroup/B/tasks
394
395 You can see charges have been moved by reading *.usage_in_bytes or
396 memory.stat of both A and B.
397 See 8.2 of Documentation/cgroups/memory.txt to see what value should be
398 written to move_charge_at_immigrate.
399
400 9.10 Memory thresholds
401 Memory controler implements memory thresholds using cgroups notification
402 API. You can use Documentation/cgroups/cgroup_event_listener.c to test
403 it.
404
405 (Shell-A) Create cgroup and run event listener
406 # mkdir /cgroup/A
407 # ./cgroup_event_listener /cgroup/A/memory.usage_in_bytes 5M
408
409 (Shell-B) Add task to cgroup and try to allocate and free memory
410 # echo $$ >/cgroup/A/tasks
411 # a="$(dd if=/dev/zero bs=1M count=10)"
412 # a=
413
414 You will see message from cgroup_event_listener every time you cross
415 the thresholds.
416
417 Use /cgroup/A/memory.memsw.usage_in_bytes to test memsw thresholds.
418
419 It's good idea to test root cgroup as well.
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index b871f2552b45..f8bc802d70b9 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -182,6 +182,8 @@ list.
182NOTE: Reclaim does not work for the root cgroup, since we cannot set any 182NOTE: Reclaim does not work for the root cgroup, since we cannot set any
183limits on the root cgroup. 183limits on the root cgroup.
184 184
185Note2: When panic_on_oom is set to "2", the whole system will panic.
186
1852. Locking 1872. Locking
186 188
187The memory controller uses the following hierarchy 189The memory controller uses the following hierarchy
@@ -262,10 +264,12 @@ some of the pages cached in the cgroup (page cache pages).
2624.2 Task migration 2644.2 Task migration
263 265
264When a task migrates from one cgroup to another, it's charge is not 266When a task migrates from one cgroup to another, it's charge is not
265carried forward. The pages allocated from the original cgroup still 267carried forward by default. The pages allocated from the original cgroup still
266remain charged to it, the charge is dropped when the page is freed or 268remain charged to it, the charge is dropped when the page is freed or
267reclaimed. 269reclaimed.
268 270
271Note: You can move charges of a task along with task migration. See 8.
272
2694.3 Removing a cgroup 2734.3 Removing a cgroup
270 274
271A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a 275A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
@@ -377,7 +381,8 @@ The feature can be disabled by
377NOTE1: Enabling/disabling will fail if the cgroup already has other 381NOTE1: Enabling/disabling will fail if the cgroup already has other
378cgroups created below it. 382cgroups created below it.
379 383
380NOTE2: This feature can be enabled/disabled per subtree. 384NOTE2: When panic_on_oom is set to "2", the whole system will panic in
385case of an oom event in any cgroup.
381 386
3827. Soft limits 3877. Soft limits
383 388
@@ -414,7 +419,76 @@ NOTE1: Soft limits take effect over a long period of time, since they involve
414NOTE2: It is recommended to set the soft limit always below the hard limit, 419NOTE2: It is recommended to set the soft limit always below the hard limit,
415 otherwise the hard limit will take precedence. 420 otherwise the hard limit will take precedence.
416 421
4178. TODO 4228. Move charges at task migration
423
424Users can move charges associated with a task along with task migration, that
425is, uncharge task's pages from the old cgroup and charge them to the new cgroup.
426This feature is not supported in !CONFIG_MMU environments because of lack of
427page tables.
428
4298.1 Interface
430
431This feature is disabled by default. It can be enabled(and disabled again) by
432writing to memory.move_charge_at_immigrate of the destination cgroup.
433
434If you want to enable it:
435
436# echo (some positive value) > memory.move_charge_at_immigrate
437
438Note: Each bits of move_charge_at_immigrate has its own meaning about what type
439 of charges should be moved. See 8.2 for details.
440Note: Charges are moved only when you move mm->owner, IOW, a leader of a thread
441 group.
442Note: If we cannot find enough space for the task in the destination cgroup, we
443 try to make space by reclaiming memory. Task migration may fail if we
444 cannot make enough space.
445Note: It can take several seconds if you move charges in giga bytes order.
446
447And if you want disable it again:
448
449# echo 0 > memory.move_charge_at_immigrate
450
4518.2 Type of charges which can be move
452
453Each bits of move_charge_at_immigrate has its own meaning about what type of
454charges should be moved.
455
456 bit | what type of charges would be moved ?
457 -----+------------------------------------------------------------------------
458 0 | A charge of an anonymous page(or swap of it) used by the target task.
459 | Those pages and swaps must be used only by the target task. You must
460 | enable Swap Extension(see 2.4) to enable move of swap charges.
461
462Note: Those pages and swaps must be charged to the old cgroup.
463Note: More type of pages(e.g. file cache, shmem,) will be supported by other
464 bits in future.
465
4668.3 TODO
467
468- Add support for other types of pages(e.g. file cache, shmem, etc.).
469- Implement madvise(2) to let users decide the vma to be moved or not to be
470 moved.
471- All of moving charge operations are done under cgroup_mutex. It's not good
472 behavior to hold the mutex too long, so we may need some trick.
473
4749. Memory thresholds
475
476Memory controler implements memory thresholds using cgroups notification
477API (see cgroups.txt). It allows to register multiple memory and memsw
478thresholds and gets notifications when it crosses.
479
480To register a threshold application need:
481 - create an eventfd using eventfd(2);
482 - open memory.usage_in_bytes or memory.memsw.usage_in_bytes;
483 - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to
484 cgroup.event_control.
485
486Application will be notified through eventfd when memory usage crosses
487threshold in any direction.
488
489It's applicable for root and non-root cgroup.
490
49110. TODO
418 492
4191. Add support for accounting huge pages (as a separate controller) 4931. Add support for accounting huge pages (as a separate controller)
4202. Make per-cgroup scanner reclaim not-shared pages first 4942. Make per-cgroup scanner reclaim not-shared pages first
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
index 1711adc33373..b07add3467f1 100644
--- a/Documentation/connector/cn_test.c
+++ b/Documentation/connector/cn_test.c
@@ -34,7 +34,7 @@ static char cn_test_name[] = "cn_test";
34static struct sock *nls; 34static struct sock *nls;
35static struct timer_list cn_test_timer; 35static struct timer_list cn_test_timer;
36 36
37static void cn_test_callback(struct cn_msg *msg) 37static void cn_test_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
38{ 38{
39 pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n", 39 pr_info("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n",
40 __func__, jiffies, msg->id.idx, msg->id.val, 40 __func__, jiffies, msg->id.idx, msg->id.val,
diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt
index 81e6bf6ead57..78c9466a9aa8 100644
--- a/Documentation/connector/connector.txt
+++ b/Documentation/connector/connector.txt
@@ -23,7 +23,7 @@ handling, etc... The Connector driver allows any kernelspace agents to use
23netlink based networking for inter-process communication in a significantly 23netlink based networking for inter-process communication in a significantly
24easier way: 24easier way:
25 25
26int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); 26int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
27void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask); 27void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask);
28 28
29struct cb_id 29struct cb_id
@@ -53,15 +53,15 @@ struct cn_msg
53Connector interfaces. 53Connector interfaces.
54/*****************************************/ 54/*****************************************/
55 55
56int cn_add_callback(struct cb_id *id, char *name, void (*callback) (void *)); 56int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
57 57
58 Registers new callback with connector core. 58 Registers new callback with connector core.
59 59
60 struct cb_id *id - unique connector's user identifier. 60 struct cb_id *id - unique connector's user identifier.
61 It must be registered in connector.h for legal in-kernel users. 61 It must be registered in connector.h for legal in-kernel users.
62 char *name - connector's callback symbolic name. 62 char *name - connector's callback symbolic name.
63 void (*callback) (void *) - connector's callback. 63 void (*callback) (struct cn..) - connector's callback.
64 Argument must be dereferenced to struct cn_msg *. 64 cn_msg and the sender's credentials
65 65
66 66
67void cn_del_callback(struct cb_id *id); 67void cn_del_callback(struct cb_id *id);
diff --git a/Documentation/console/console.txt b/Documentation/console/console.txt
index 877a1b26cc3d..926cf1b5e63e 100644
--- a/Documentation/console/console.txt
+++ b/Documentation/console/console.txt
@@ -74,7 +74,7 @@ driver takes over the consoles vacated by the driver. Binding, on the other
74hand, will bind the driver to the consoles that are currently occupied by a 74hand, will bind the driver to the consoles that are currently occupied by a
75system driver. 75system driver.
76 76
77NOTE1: Binding and binding must be selected in Kconfig. It's under: 77NOTE1: Binding and unbinding must be selected in Kconfig. It's under:
78 78
79Device Drivers -> Character devices -> Support for binding and unbinding 79Device Drivers -> Character devices -> Support for binding and unbinding
80console drivers 80console drivers
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
index 75a58d14d3cf..6c30e930c122 100644
--- a/Documentation/cpu-freq/cpu-drivers.txt
+++ b/Documentation/cpu-freq/cpu-drivers.txt
@@ -92,9 +92,9 @@ policy->cpuinfo.max_freq - the minimum and maximum frequency
92 (in kHz) which is supported by 92 (in kHz) which is supported by
93 this CPU 93 this CPU
94policy->cpuinfo.transition_latency the time it takes on this CPU to 94policy->cpuinfo.transition_latency the time it takes on this CPU to
95 switch between two frequencies (if 95 switch between two frequencies in
96 appropriate, else specify 96 nanoseconds (if appropriate, else
97 CPUFREQ_ETERNAL) 97 specify CPUFREQ_ETERNAL)
98 98
99policy->cur The current operating frequency of 99policy->cur The current operating frequency of
100 this CPU (if appropriate) 100 this CPU (if appropriate)
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index aed082f49d09..737988fca64d 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -145,8 +145,8 @@ show_sampling_rate_max: THIS INTERFACE IS DEPRECATED, DON'T USE IT.
145up_threshold: defines what the average CPU usage between the samplings 145up_threshold: defines what the average CPU usage between the samplings
146of 'sampling_rate' needs to be for the kernel to make a decision on 146of 'sampling_rate' needs to be for the kernel to make a decision on
147whether it should increase the frequency. For example when it is set 147whether it should increase the frequency. For example when it is set
148to its default value of '80' it means that between the checking 148to its default value of '95' it means that between the checking
149intervals the CPU needs to be on average more than 80% in use to then 149intervals the CPU needs to be on average more than 95% in use to then
150decide that the CPU frequency needs to be increased. 150decide that the CPU frequency needs to be increased.
151 151
152ignore_nice_load: this parameter takes a value of '0' or '1'. When 152ignore_nice_load: this parameter takes a value of '0' or '1'. When
diff --git a/Documentation/cpu-freq/pcc-cpufreq.txt b/Documentation/cpu-freq/pcc-cpufreq.txt
new file mode 100644
index 000000000000..9e3c3b33514c
--- /dev/null
+++ b/Documentation/cpu-freq/pcc-cpufreq.txt
@@ -0,0 +1,207 @@
1/*
2 * pcc-cpufreq.txt - PCC interface documentation
3 *
4 * Copyright (C) 2009 Red Hat, Matthew Garrett <mjg@redhat.com>
5 * Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
6 * Nagananda Chumbalkar <nagananda.chumbalkar@hp.com>
7 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or NON
17 * INFRINGEMENT. See the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 */
25
26
27 Processor Clocking Control Driver
28 ---------------------------------
29
30Contents:
31---------
321. Introduction
331.1 PCC interface
341.1.1 Get Average Frequency
351.1.2 Set Desired Frequency
361.2 Platforms affected
372. Driver and /sys details
382.1 scaling_available_frequencies
392.2 cpuinfo_transition_latency
402.3 cpuinfo_cur_freq
412.4 related_cpus
423. Caveats
43
441. Introduction:
45----------------
46Processor Clocking Control (PCC) is an interface between the platform
47firmware and OSPM. It is a mechanism for coordinating processor
48performance (ie: frequency) between the platform firmware and the OS.
49
50The PCC driver (pcc-cpufreq) allows OSPM to take advantage of the PCC
51interface.
52
53OS utilizes the PCC interface to inform platform firmware what frequency the
54OS wants for a logical processor. The platform firmware attempts to achieve
55the requested frequency. If the request for the target frequency could not be
56satisfied by platform firmware, then it usually means that power budget
57conditions are in place, and "power capping" is taking place.
58
591.1 PCC interface:
60------------------
61The complete PCC specification is available here:
62http://www.acpica.org/download/Processor-Clocking-Control-v1p0.pdf
63
64PCC relies on a shared memory region that provides a channel for communication
65between the OS and platform firmware. PCC also implements a "doorbell" that
66is used by the OS to inform the platform firmware that a command has been
67sent.
68
69The ACPI PCCH() method is used to discover the location of the PCC shared
70memory region. The shared memory region header contains the "command" and
71"status" interface. PCCH() also contains details on how to access the platform
72doorbell.
73
74The following commands are supported by the PCC interface:
75* Get Average Frequency
76* Set Desired Frequency
77
78The ACPI PCCP() method is implemented for each logical processor and is
79used to discover the offsets for the input and output buffers in the shared
80memory region.
81
82When PCC mode is enabled, the platform will not expose processor performance
83or throttle states (_PSS, _TSS and related ACPI objects) to OSPM. Therefore,
84the native P-state driver (such as acpi-cpufreq for Intel, powernow-k8 for
85AMD) will not load.
86
87However, OSPM remains in control of policy. The governor (eg: "ondemand")
88computes the required performance for each processor based on server workload.
89The PCC driver fills in the command interface, and the input buffer and
90communicates the request to the platform firmware. The platform firmware is
91responsible for delivering the requested performance.
92
93Each PCC command is "global" in scope and can affect all the logical CPUs in
94the system. Therefore, PCC is capable of performing "group" updates. With PCC
95the OS is capable of getting/setting the frequency of all the logical CPUs in
96the system with a single call to the BIOS.
97
981.1.1 Get Average Frequency:
99----------------------------
100This command is used by the OSPM to query the running frequency of the
101processor since the last time this command was completed. The output buffer
102indicates the average unhalted frequency of the logical processor expressed as
103a percentage of the nominal (ie: maximum) CPU frequency. The output buffer
104also signifies if the CPU frequency is limited by a power budget condition.
105
1061.1.2 Set Desired Frequency:
107----------------------------
108This command is used by the OSPM to communicate to the platform firmware the
109desired frequency for a logical processor. The output buffer is currently
110ignored by OSPM. The next invocation of "Get Average Frequency" will inform
111OSPM if the desired frequency was achieved or not.
112
1131.2 Platforms affected:
114-----------------------
115The PCC driver will load on any system where the platform firmware:
116* supports the PCC interface, and the associated PCCH() and PCCP() methods
117* assumes responsibility for managing the hardware clocking controls in order
118to deliver the requested processor performance
119
120Currently, certain HP ProLiant platforms implement the PCC interface. On those
121platforms PCC is the "default" choice.
122
123However, it is possible to disable this interface via a BIOS setting. In
124such an instance, as is also the case on platforms where the PCC interface
125is not implemented, the PCC driver will fail to load silently.
126
1272. Driver and /sys details:
128---------------------------
129When the driver loads, it merely prints the lowest and the highest CPU
130frequencies supported by the platform firmware.
131
132The PCC driver loads with a message such as:
133pcc-cpufreq: (v1.00.00) driver loaded with frequency limits: 1600 MHz, 2933
134MHz
135
136This means that the OPSM can request the CPU to run at any frequency in
137between the limits (1600 MHz, and 2933 MHz) specified in the message.
138
139Internally, there is no need for the driver to convert the "target" frequency
140to a corresponding P-state.
141
142The VERSION number for the driver will be of the format v.xy.ab.
143eg: 1.00.02
144 ----- --
145 | |
146 | -- this will increase with bug fixes/enhancements to the driver
147 |-- this is the version of the PCC specification the driver adheres to
148
149
150The following is a brief discussion on some of the fields exported via the
151/sys filesystem and how their values are affected by the PCC driver:
152
1532.1 scaling_available_frequencies:
154----------------------------------
155scaling_available_frequencies is not created in /sys. No intermediate
156frequencies need to be listed because the BIOS will try to achieve any
157frequency, within limits, requested by the governor. A frequency does not have
158to be strictly associated with a P-state.
159
1602.2 cpuinfo_transition_latency:
161-------------------------------
162The cpuinfo_transition_latency field is 0. The PCC specification does
163not include a field to expose this value currently.
164
1652.3 cpuinfo_cur_freq:
166---------------------
167A) Often cpuinfo_cur_freq will show a value different than what is declared
168in the scaling_available_frequencies or scaling_cur_freq, or scaling_max_freq.
169This is due to "turbo boost" available on recent Intel processors. If certain
170conditions are met the BIOS can achieve a slightly higher speed than requested
171by OSPM. An example:
172
173scaling_cur_freq : 2933000
174cpuinfo_cur_freq : 3196000
175
176B) There is a round-off error associated with the cpuinfo_cur_freq value.
177Since the driver obtains the current frequency as a "percentage" (%) of the
178nominal frequency from the BIOS, sometimes, the values displayed by
179scaling_cur_freq and cpuinfo_cur_freq may not match. An example:
180
181scaling_cur_freq : 1600000
182cpuinfo_cur_freq : 1583000
183
184In this example, the nominal frequency is 2933 MHz. The driver obtains the
185current frequency, cpuinfo_cur_freq, as 54% of the nominal frequency:
186
187 54% of 2933 MHz = 1583 MHz
188
189Nominal frequency is the maximum frequency of the processor, and it usually
190corresponds to the frequency of the P0 P-state.
191
1922.4 related_cpus:
193-----------------
194The related_cpus field is identical to affected_cpus.
195
196affected_cpus : 4
197related_cpus : 4
198
199Currently, the PCC driver does not evaluate _PSD. The platforms that support
200PCC do not implement SW_ALL. So OSPM doesn't need to perform any coordination
201to ensure that the same frequency is requested of all dependent CPUs.
202
2033. Caveats:
204-----------
205The "cpufreq_stats" module in its present form cannot be loaded and
206expected to work with the PCC driver. Since the "cpufreq_stats" module
207provides information wrt each P-state, it is not applicable to the PCC driver.
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt
index 2a5b850847c0..04f6b32993e6 100644
--- a/Documentation/cpu-freq/user-guide.txt
+++ b/Documentation/cpu-freq/user-guide.txt
@@ -203,6 +203,17 @@ scaling_cur_freq : Current frequency of the CPU as determined by
203 the frequency the kernel thinks the CPU runs 203 the frequency the kernel thinks the CPU runs
204 at. 204 at.
205 205
206bios_limit : If the BIOS tells the OS to limit a CPU to
207 lower frequencies, the user can read out the
208 maximum available frequency from this file.
209 This typically can happen through (often not
210 intended) BIOS settings, restrictions
211 triggered through a service processor or other
212 BIOS/HW based implementations.
213 This does not cover thermal ACPI limitations
214 which can be detected through the generic
215 thermal driver.
216
206If you have selected the "userspace" governor which allows you to 217If you have selected the "userspace" governor which allows you to
207set the CPU operating frequency to a specific value, you can read out 218set the CPU operating frequency to a specific value, you can read out
208the current frequency in 219the current frequency in
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index 9d620c153b04..a99d7031cdf9 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -49,6 +49,12 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets 49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets
50 cpu_possible_map = cpu_present_map + additional_cpus 50 cpu_possible_map = cpu_present_map + additional_cpus
51 51
52cede_offline={"off","on"} Use this option to disable/enable putting offlined
53 processors to an extended H_CEDE state on
54 supported pseries platforms.
55 If nothing is specified,
56 cede_offline is set to "on".
57
52(*) Option valid only for following architectures 58(*) Option valid only for following architectures
53- ia64 59- ia64
54 60
@@ -309,41 +315,26 @@ A: The following are what is required for CPU hotplug infrastructure to work
309 315
310Q: I need to ensure that a particular cpu is not removed when there is some 316Q: I need to ensure that a particular cpu is not removed when there is some
311 work specific to this cpu is in progress. 317 work specific to this cpu is in progress.
312A: First switch the current thread context to preferred cpu 318A: There are two ways. If your code can be run in interrupt context, use
319 smp_call_function_single(), otherwise use work_on_cpu(). Note that
320 work_on_cpu() is slow, and can fail due to out of memory:
313 321
314 int my_func_on_cpu(int cpu) 322 int my_func_on_cpu(int cpu)
315 { 323 {
316 cpumask_t saved_mask, new_mask = CPU_MASK_NONE; 324 int err;
317 int curr_cpu, err = 0; 325 get_online_cpus();
318 326 if (!cpu_online(cpu))
319 saved_mask = current->cpus_allowed; 327 err = -EINVAL;
320 cpu_set(cpu, new_mask); 328 else
321 err = set_cpus_allowed(current, new_mask); 329#if NEEDS_BLOCKING
322 330 err = work_on_cpu(cpu, __my_func_on_cpu, NULL);
323 if (err) 331#else
324 return err; 332 smp_call_function_single(cpu, __my_func_on_cpu, &err,
325 333 true);
326 /* 334#endif
327 * If we got scheduled out just after the return from 335 put_online_cpus();
328 * set_cpus_allowed() before running the work, this ensures 336 return err;
329 * we stay locked. 337 }
330 */
331 curr_cpu = get_cpu();
332
333 if (curr_cpu != cpu) {
334 err = -EAGAIN;
335 goto ret;
336 } else {
337 /*
338 * Do work : But cant sleep, since get_cpu() disables preempt
339 */
340 }
341 ret:
342 put_cpu();
343 set_cpus_allowed(current, saved_mask);
344 return err;
345 }
346
347 338
348Q: How do we determine how many CPUs are available for hotplug. 339Q: How do we determine how many CPUs are available for hotplug.
349A: There is no clear spec defined way from ACPI that can give us that 340A: There is no clear spec defined way from ACPI that can give us that
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt
index b41f3e58aefa..f1c5c4bccd3e 100644
--- a/Documentation/cputopology.txt
+++ b/Documentation/cputopology.txt
@@ -1,15 +1,28 @@
1 1
2Export cpu topology info via sysfs. Items (attributes) are similar 2Export CPU topology info via sysfs. Items (attributes) are similar
3to /proc/cpuinfo. 3to /proc/cpuinfo.
4 4
51) /sys/devices/system/cpu/cpuX/topology/physical_package_id: 51) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
6represent the physical package id of cpu X; 6
7 physical package id of cpuX. Typically corresponds to a physical
8 socket number, but the actual value is architecture and platform
9 dependent.
10
72) /sys/devices/system/cpu/cpuX/topology/core_id: 112) /sys/devices/system/cpu/cpuX/topology/core_id:
8represent the cpu core id to cpu X; 12
13 the CPU core ID of cpuX. Typically it is the hardware platform's
14 identifier (rather than the kernel's). The actual value is
15 architecture and platform dependent.
16
93) /sys/devices/system/cpu/cpuX/topology/thread_siblings: 173) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
10represent the thread siblings to cpu X in the same core; 18
19 internel kernel map of cpuX's hardware threads within the same
20 core as cpuX
21
114) /sys/devices/system/cpu/cpuX/topology/core_siblings: 224) /sys/devices/system/cpu/cpuX/topology/core_siblings:
12represent the thread siblings to cpu X in the same physical package; 23
24 internal kernel map of cpuX's hardware threads within the same
25 physical_package_id.
13 26
14To implement it in an architecture-neutral way, a new source file, 27To implement it in an architecture-neutral way, a new source file,
15drivers/base/topology.c, is to export the 4 attributes. 28drivers/base/topology.c, is to export the 4 attributes.
@@ -32,32 +45,32 @@ not defined by include/asm-XXX/topology.h:
323) thread_siblings: just the given CPU 453) thread_siblings: just the given CPU
334) core_siblings: just the given CPU 464) core_siblings: just the given CPU
34 47
35Additionally, cpu topology information is provided under 48Additionally, CPU topology information is provided under
36/sys/devices/system/cpu and includes these files. The internal 49/sys/devices/system/cpu and includes these files. The internal
37source for the output is in brackets ("[]"). 50source for the output is in brackets ("[]").
38 51
39 kernel_max: the maximum cpu index allowed by the kernel configuration. 52 kernel_max: the maximum CPU index allowed by the kernel configuration.
40 [NR_CPUS-1] 53 [NR_CPUS-1]
41 54
42 offline: cpus that are not online because they have been 55 offline: CPUs that are not online because they have been
43 HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit 56 HOTPLUGGED off (see cpu-hotplug.txt) or exceed the limit
44 of cpus allowed by the kernel configuration (kernel_max 57 of CPUs allowed by the kernel configuration (kernel_max
45 above). [~cpu_online_mask + cpus >= NR_CPUS] 58 above). [~cpu_online_mask + cpus >= NR_CPUS]
46 59
47 online: cpus that are online and being scheduled [cpu_online_mask] 60 online: CPUs that are online and being scheduled [cpu_online_mask]
48 61
49 possible: cpus that have been allocated resources and can be 62 possible: CPUs that have been allocated resources and can be
50 brought online if they are present. [cpu_possible_mask] 63 brought online if they are present. [cpu_possible_mask]
51 64
52 present: cpus that have been identified as being present in the 65 present: CPUs that have been identified as being present in the
53 system. [cpu_present_mask] 66 system. [cpu_present_mask]
54 67
55The format for the above output is compatible with cpulist_parse() 68The format for the above output is compatible with cpulist_parse()
56[see <linux/cpumask.h>]. Some examples follow. 69[see <linux/cpumask.h>]. Some examples follow.
57 70
58In this example, there are 64 cpus in the system but cpus 32-63 exceed 71In this example, there are 64 CPUs in the system but cpus 32-63 exceed
59the kernel max which is limited to 0..31 by the NR_CPUS config option 72the kernel max which is limited to 0..31 by the NR_CPUS config option
60being 32. Note also that cpus 2 and 4-31 are not online but could be 73being 32. Note also that CPUs 2 and 4-31 are not online but could be
61brought online as they are both present and possible. 74brought online as they are both present and possible.
62 75
63 kernel_max: 31 76 kernel_max: 31
@@ -67,8 +80,8 @@ brought online as they are both present and possible.
67 present: 0-31 80 present: 0-31
68 81
69In this example, the NR_CPUS config option is 128, but the kernel was 82In this example, the NR_CPUS config option is 128, but the kernel was
70started with possible_cpus=144. There are 4 cpus in the system and cpu2 83started with possible_cpus=144. There are 4 CPUs in the system and cpu2
71was manually taken offline (and is the only cpu that can be brought 84was manually taken offline (and is the only CPU that can be brought
72online.) 85online.)
73 86
74 kernel_max: 127 87 kernel_max: 127
@@ -78,4 +91,4 @@ online.)
78 present: 0-3 91 present: 0-3
79 92
80See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter 93See cpu-hotplug.txt for the possible_cpus=NUM kernel start parameter
81as well as more information on the various cpumask's. 94as well as more information on the various cpumasks.
diff --git a/Documentation/debugging-via-ohci1394.txt b/Documentation/debugging-via-ohci1394.txt
index 59a91e5c6909..611f5a5499b1 100644
--- a/Documentation/debugging-via-ohci1394.txt
+++ b/Documentation/debugging-via-ohci1394.txt
@@ -64,14 +64,14 @@ be used to view the printk buffer of a remote machine, even with live update.
64 64
65Bernhard Kaindl enhanced firescope to support accessing 64-bit machines 65Bernhard Kaindl enhanced firescope to support accessing 64-bit machines
66from 32-bit firescope and vice versa: 66from 32-bit firescope and vice versa:
67- ftp://ftp.suse.de/private/bk/firewire/tools/firescope-0.2.2.tar.bz2 67- http://halobates.de/firewire/firescope-0.2.2.tar.bz2
68 68
69and he implemented fast system dump (alpha version - read README.txt): 69and he implemented fast system dump (alpha version - read README.txt):
70- ftp://ftp.suse.de/private/bk/firewire/tools/firedump-0.1.tar.bz2 70- http://halobates.de/firewire/firedump-0.1.tar.bz2
71 71
72There is also a gdb proxy for firewire which allows to use gdb to access 72There is also a gdb proxy for firewire which allows to use gdb to access
73data which can be referenced from symbols found by gdb in vmlinux: 73data which can be referenced from symbols found by gdb in vmlinux:
74- ftp://ftp.suse.de/private/bk/firewire/tools/fireproxy-0.33.tar.bz2 74- http://halobates.de/firewire/fireproxy-0.33.tar.bz2
75 75
76The latest version of this gdb proxy (fireproxy-0.34) can communicate (not 76The latest version of this gdb proxy (fireproxy-0.34) can communicate (not
77yet stable) with kgdb over an memory-based communication module (kgdbom). 77yet stable) with kgdb over an memory-based communication module (kgdbom).
@@ -178,7 +178,7 @@ Step-by-step instructions for using firescope with early OHCI initialization:
178 178
179Notes 179Notes
180----- 180-----
181Documentation and specifications: ftp://ftp.suse.de/private/bk/firewire/docs 181Documentation and specifications: http://halobates.de/firewire/
182 182
183FireWire is a trademark of Apple Inc. - for more information please refer to: 183FireWire is a trademark of Apple Inc. - for more information please refer to:
184http://en.wikipedia.org/wiki/FireWire 184http://en.wikipedia.org/wiki/FireWire
diff --git a/Documentation/device-mapper/snapshot.txt b/Documentation/device-mapper/snapshot.txt
index a5009c8300f3..0d5bc46dc167 100644
--- a/Documentation/device-mapper/snapshot.txt
+++ b/Documentation/device-mapper/snapshot.txt
@@ -8,13 +8,19 @@ the block device which are also writable without interfering with the
8original content; 8original content;
9*) To create device "forks", i.e. multiple different versions of the 9*) To create device "forks", i.e. multiple different versions of the
10same data stream. 10same data stream.
11*) To merge a snapshot of a block device back into the snapshot's origin
12device.
11 13
14In the first two cases, dm copies only the chunks of data that get
15changed and uses a separate copy-on-write (COW) block device for
16storage.
12 17
13In both cases, dm copies only the chunks of data that get changed and 18For snapshot merge the contents of the COW storage are merged back into
14uses a separate copy-on-write (COW) block device for storage. 19the origin device.
15 20
16 21
17There are two dm targets available: snapshot and snapshot-origin. 22There are three dm targets available:
23snapshot, snapshot-origin, and snapshot-merge.
18 24
19*) snapshot-origin <origin> 25*) snapshot-origin <origin>
20 26
@@ -40,8 +46,25 @@ The difference is that for transient snapshots less metadata must be
40saved on disk - they can be kept in memory by the kernel. 46saved on disk - they can be kept in memory by the kernel.
41 47
42 48
43How this is used by LVM2 49* snapshot-merge <origin> <COW device> <persistent> <chunksize>
44======================== 50
51takes the same table arguments as the snapshot target except it only
52works with persistent snapshots. This target assumes the role of the
53"snapshot-origin" target and must not be loaded if the "snapshot-origin"
54is still present for <origin>.
55
56Creates a merging snapshot that takes control of the changed chunks
57stored in the <COW device> of an existing snapshot, through a handover
58procedure, and merges these chunks back into the <origin>. Once merging
59has started (in the background) the <origin> may be opened and the merge
60will continue while I/O is flowing to it. Changes to the <origin> are
61deferred until the merging snapshot's corresponding chunk(s) have been
62merged. Once merging has started the snapshot device, associated with
63the "snapshot" target, will return -EIO when accessed.
64
65
66How snapshot is used by LVM2
67============================
45When you create the first LVM2 snapshot of a volume, four dm devices are used: 68When you create the first LVM2 snapshot of a volume, four dm devices are used:
46 69
471) a device containing the original mapping table of the source volume; 701) a device containing the original mapping table of the source volume;
@@ -72,3 +95,74 @@ brw------- 1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow
72brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap 95brw------- 1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap
73brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base 96brw------- 1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base
74 97
98
99How snapshot-merge is used by LVM2
100==================================
101A merging snapshot assumes the role of the "snapshot-origin" while
102merging. As such the "snapshot-origin" is replaced with
103"snapshot-merge". The "-real" device is not changed and the "-cow"
104device is renamed to <origin name>-cow to aid LVM2's cleanup of the
105merging snapshot after it completes. The "snapshot" that hands over its
106COW device to the "snapshot-merge" is deactivated (unless using lvchange
107--refresh); but if it is left active it will simply return I/O errors.
108
109A snapshot will merge into its origin with the following command:
110
111lvconvert --merge volumeGroup/snap
112
113we'll now have this situation:
114
115# dmsetup table|grep volumeGroup
116
117volumeGroup-base-real: 0 2097152 linear 8:19 384
118volumeGroup-base-cow: 0 204800 linear 8:19 2097536
119volumeGroup-base: 0 2097152 snapshot-merge 254:11 254:12 P 16
120
121# ls -lL /dev/mapper/volumeGroup-*
122brw------- 1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real
123brw------- 1 root root 254, 12 29 ago 18:16 /dev/mapper/volumeGroup-base-cow
124brw------- 1 root root 254, 10 29 ago 18:16 /dev/mapper/volumeGroup-base
125
126
127How to determine when a merging is complete
128===========================================
129The snapshot-merge and snapshot status lines end with:
130 <sectors_allocated>/<total_sectors> <metadata_sectors>
131
132Both <sectors_allocated> and <total_sectors> include both data and metadata.
133During merging, the number of sectors allocated gets smaller and
134smaller. Merging has finished when the number of sectors holding data
135is zero, in other words <sectors_allocated> == <metadata_sectors>.
136
137Here is a practical example (using a hybrid of lvm and dmsetup commands):
138
139# lvs
140 LV VG Attr LSize Origin Snap% Move Log Copy% Convert
141 base volumeGroup owi-a- 4.00g
142 snap volumeGroup swi-a- 1.00g base 18.97
143
144# dmsetup status volumeGroup-snap
1450 8388608 snapshot 397896/2097152 1560
146 ^^^^ metadata sectors
147
148# lvconvert --merge -b volumeGroup/snap
149 Merging of volume snap started.
150
151# lvs volumeGroup/snap
152 LV VG Attr LSize Origin Snap% Move Log Copy% Convert
153 base volumeGroup Owi-a- 4.00g 17.23
154
155# dmsetup status volumeGroup-base
1560 8388608 snapshot-merge 281688/2097152 1104
157
158# dmsetup status volumeGroup-base
1590 8388608 snapshot-merge 180480/2097152 712
160
161# dmsetup status volumeGroup-base
1620 8388608 snapshot-merge 16/2097152 16
163
164Merging has finished.
165
166# lvs
167 LV VG Attr LSize Origin Snap% Move Log Copy% Convert
168 base volumeGroup owi-a- 4.00g
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index e1efc400bed6..d9bcffd59433 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -65,10 +65,10 @@ aicdb.h*
65asm-offsets.h 65asm-offsets.h
66asm_offsets.h 66asm_offsets.h
67autoconf.h* 67autoconf.h*
68av_permissions.h
68bbootsect 69bbootsect
69bin2c 70bin2c
70binkernel.spec 71binkernel.spec
71binoffset
72bootsect 72bootsect
73bounds.h 73bounds.h
74bsetup 74bsetup
@@ -95,12 +95,15 @@ docproc
95elf2ecoff 95elf2ecoff
96elfconfig.h* 96elfconfig.h*
97fixdep 97fixdep
98flask.h
98fore200e_mkfirm 99fore200e_mkfirm
99fore200e_pca_fw.c* 100fore200e_pca_fw.c*
100gconf 101gconf
101gen-devlist 102gen-devlist
102gen_crc32table 103gen_crc32table
103gen_init_cpio 104gen_init_cpio
105generated
106genheaders
104genksyms 107genksyms
105*_gray256.c 108*_gray256.c
106ihex2fw 109ihex2fw
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index 60120fb3b961..d2cd6fb8ba9e 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -226,5 +226,5 @@ struct driver_attribute driver_attr_debug;
226This can then be used to add and remove the attribute from the 226This can then be used to add and remove the attribute from the
227driver's directory using: 227driver's directory using:
228 228
229int driver_create_file(struct device_driver *, struct driver_attribute *); 229int driver_create_file(struct device_driver *, const struct driver_attribute *);
230void driver_remove_file(struct device_driver *, struct driver_attribute *); 230void driver_remove_file(struct device_driver *, const struct driver_attribute *);
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt
index 2e2c2ea90ceb..41f41632ee55 100644
--- a/Documentation/driver-model/platform.txt
+++ b/Documentation/driver-model/platform.txt
@@ -192,7 +192,7 @@ command line. This will execute all matching early_param() callbacks.
192User specified early platform devices will be registered at this point. 192User specified early platform devices will be registered at this point.
193For the early serial console case the user can specify port on the 193For the early serial console case the user can specify port on the
194kernel command line as "earlyprintk=serial.0" where "earlyprintk" is 194kernel command line as "earlyprintk=serial.0" where "earlyprintk" is
195the class string, "serial" is the name of the platfrom driver and 195the class string, "serial" is the name of the platform driver and
1960 is the platform device id. If the id is -1 then the dot and the 1960 is the platform device id. If the id is -1 then the dot and the
197id can be omitted. 197id can be omitted.
198 198
diff --git a/Documentation/dvb/README.dvb-usb b/Documentation/dvb/README.dvb-usb
index bf2a9cdfe7bb..c8238e44ed6b 100644
--- a/Documentation/dvb/README.dvb-usb
+++ b/Documentation/dvb/README.dvb-usb
@@ -85,7 +85,7 @@ http://www.linuxtv.org/wiki/index.php/DVB_USB
85 - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems 85 - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems
86 better settled there (added xfer_ops-struct) 86 better settled there (added xfer_ops-struct)
87 - created a common files for frontends (mc/p/mb) 87 - created a common files for frontends (mc/p/mb)
88 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek) 88 2004-09-28 - added support for a new device (Unknown, vendor ID is Hyper-Paltek)
89 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks 89 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks
90 to Amaury Demol for reporting 90 to Amaury Demol for reporting
91 - changed usb TS transfer method (several urbs, stopping transfer 91 - changed usb TS transfer method (several urbs, stopping transfer
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 14b7b5a3bcb9..239cbdbf4d12 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -26,7 +26,7 @@ use IO::Handle;
26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", 26 "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
27 "or51211", "or51132_qam", "or51132_vsb", "bluebird", 27 "or51211", "or51132_qam", "or51132_vsb", "bluebird",
28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", 28 "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
29 "af9015"); 29 "af9015", "ngene");
30 30
31# Check args 31# Check args
32syntax() if (scalar(@ARGV) != 1); 32syntax() if (scalar(@ARGV) != 1);
@@ -39,7 +39,7 @@ for ($i=0; $i < scalar(@components); $i++) {
39 die $@ if $@; 39 die $@ if $@;
40 print STDERR <<EOF; 40 print STDERR <<EOF;
41Firmware(s) $outfile extracted successfully. 41Firmware(s) $outfile extracted successfully.
42Now copy it(they) to either /usr/lib/hotplug/firmware or /lib/firmware 42Now copy it(them) to either /usr/lib/hotplug/firmware or /lib/firmware
43(depending on configuration of firmware hotplug). 43(depending on configuration of firmware hotplug).
44EOF 44EOF
45 exit(0); 45 exit(0);
@@ -549,6 +549,24 @@ sub af9015 {
549 close INFILE; 549 close INFILE;
550} 550}
551 551
552sub ngene {
553 my $url = "http://www.digitaldevices.de/download/";
554 my $file1 = "ngene_15.fw";
555 my $hash1 = "d798d5a757121174f0dbc5f2833c0c85";
556 my $file2 = "ngene_17.fw";
557 my $hash2 = "26b687136e127b8ac24b81e0eeafc20b";
558
559 checkstandard();
560
561 wgetfile($file1, $url . $file1);
562 verify($file1, $hash1);
563
564 wgetfile($file2, $url . $file2);
565 verify($file2, $hash2);
566
567 "$file1, $file2";
568}
569
552# --------------------------------------------------------------- 570# ---------------------------------------------------------------
553# Utilities 571# Utilities
554 572
@@ -667,6 +685,7 @@ sub delzero{
667sub syntax() { 685sub syntax() {
668 print STDERR "syntax: get_dvb_firmware <component>\n"; 686 print STDERR "syntax: get_dvb_firmware <component>\n";
669 print STDERR "Supported components:\n"; 687 print STDERR "Supported components:\n";
688 @components = sort @components;
670 for($i=0; $i < scalar(@components); $i++) { 689 for($i=0; $i < scalar(@components); $i++) {
671 print STDERR "\t" . $components[$i] . "\n"; 690 print STDERR "\t" . $components[$i] . "\n";
672 } 691 }
diff --git a/Documentation/edac.txt b/Documentation/edac.txt
index 06f8f46692dc..79c533223762 100644
--- a/Documentation/edac.txt
+++ b/Documentation/edac.txt
@@ -80,7 +80,7 @@ is:
80 80
81 broken_parity_status 81 broken_parity_status
82 82
83as is located in /sys/devices/pci<XXX>/0000:XX:YY.Z directorys for 83as is located in /sys/devices/pci<XXX>/0000:XX:YY.Z directories for
84PCI devices. 84PCI devices.
85 85
86FUTURE HARDWARE SCANNING 86FUTURE HARDWARE SCANNING
@@ -288,9 +288,8 @@ Total UE count that had no information attribute fileY:
288 288
289 'ue_noinfo_count' 289 'ue_noinfo_count'
290 290
291 This attribute file displays the number of UEs that 291 This attribute file displays the number of UEs that have occurred
292 have occurred have occurred with no informations as to which DIMM 292 with no information as to which DIMM slot is having errors.
293 slot is having errors.
294 293
295 294
296Total Correctable Errors count attribute file: 295Total Correctable Errors count attribute file:
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt
index 60e361ba08c0..f297fc1202ae 100644
--- a/Documentation/eisa.txt
+++ b/Documentation/eisa.txt
@@ -171,7 +171,7 @@ device.
171virtual_root.force_probe : 171virtual_root.force_probe :
172 172
173Force the probing code to probe EISA slots even when it cannot find an 173Force the probing code to probe EISA slots even when it cannot find an
174EISA compliant mainboard (nothing appears on slot 0). Defaultd to 0 174EISA compliant mainboard (nothing appears on slot 0). Defaults to 0
175(don't force), and set to 1 (force probing) when either 175(don't force), and set to 1 (force probing) when either
176CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. 176CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.
177 177
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
index a618efab7b15..945ff3fda433 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -216,26 +216,14 @@ Works. Use "Insert file..." or external editor.
216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217Gmail (Web GUI) 217Gmail (Web GUI)
218 218
219If you just have to use Gmail to send patches, it CAN be made to work. It 219Does not work for sending patches.
220requires a bit of external help, though. 220
221 221Gmail web client converts tabs to spaces automatically.
222The first problem is that Gmail converts tabs to spaces. This will 222
223totally break your patches. To prevent this, you have to use a different 223At the same time it wraps lines every 78 chars with CRLF style line breaks
224editor. There is a firefox extension called "ViewSourceWith" 224although tab2space problem can be solved with external editor.
225(https://addons.mozilla.org/en-US/firefox/addon/394) which allows you to 225
226edit any text box in the editor of your choice. Configure it to launch 226Another problem is that Gmail will base64-encode any message that has a
227your favorite editor. When you want to send a patch, use this technique. 227non-ASCII character. That includes things like European names.
228Once you have crafted your messsage + patch, save and exit the editor,
229which should reload the Gmail edit box. GMAIL WILL PRESERVE THE TABS.
230Hoorah. Apparently you can cut-n-paste literal tabs, but Gmail will
231convert those to spaces upon sending!
232
233The second problem is that Gmail converts tabs to spaces on replies. If
234you reply to a patch, don't expect to be able to apply it as a patch.
235
236The last problem is that Gmail will base64-encode any message that has a
237non-ASCII character. That includes things like European names. Be aware.
238
239Gmail is not convenient for lkml patches, but CAN be made to work.
240 228
241 ### 229 ###
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt
index 079305640790..7be15e44d481 100644
--- a/Documentation/fault-injection/fault-injection.txt
+++ b/Documentation/fault-injection/fault-injection.txt
@@ -143,8 +143,8 @@ o provide a way to configure fault attributes
143 failslab, fail_page_alloc, and fail_make_request use this way. 143 failslab, fail_page_alloc, and fail_make_request use this way.
144 Helper functions: 144 Helper functions:
145 145
146 init_fault_attr_entries(entries, attr, name); 146 init_fault_attr_dentries(entries, attr, name);
147 void cleanup_fault_attr_entries(entries); 147 void cleanup_fault_attr_dentries(entries);
148 148
149- module parameters 149- module parameters
150 150
diff --git a/Documentation/fault-injection/provoke-crashes.txt b/Documentation/fault-injection/provoke-crashes.txt
new file mode 100644
index 000000000000..7a9d3d81525b
--- /dev/null
+++ b/Documentation/fault-injection/provoke-crashes.txt
@@ -0,0 +1,38 @@
1The lkdtm module provides an interface to crash or injure the kernel at
2predefined crashpoints to evaluate the reliability of crash dumps obtained
3using different dumping solutions. The module uses KPROBEs to instrument
4crashing points, but can also crash the kernel directly without KRPOBE
5support.
6
7
8You can provide the way either through module arguments when inserting
9the module, or through a debugfs interface.
10
11Usage: insmod lkdtm.ko [recur_count={>0}] cpoint_name=<> cpoint_type=<>
12 [cpoint_count={>0}]
13
14 recur_count : Recursion level for the stack overflow test. Default is 10.
15
16 cpoint_name : Crash point where the kernel is to be crashed. It can be
17 one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY,
18 FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD,
19 IDE_CORE_CP, DIRECT
20
21 cpoint_type : Indicates the action to be taken on hitting the crash point.
22 It can be one of PANIC, BUG, EXCEPTION, LOOP, OVERFLOW,
23 CORRUPT_STACK, UNALIGNED_LOAD_STORE_WRITE, OVERWRITE_ALLOCATION,
24 WRITE_AFTER_FREE,
25
26 cpoint_count : Indicates the number of times the crash point is to be hit
27 to trigger an action. The default is 10.
28
29You can also induce failures by mounting debugfs and writing the type to
30<mountpoint>/provoke-crash/<crashpoint>. E.g.,
31
32 mount -t debugfs debugfs /mnt
33 echo EXCEPTION > /mnt/provoke-crash/INT_HARDWARE_ENTRY
34
35
36A special file is `DIRECT' which will induce the crash directly without
37KPROBE instrumentation. This mode is the only one available when the module
38is built on a kernel without KPROBEs support.
diff --git a/Documentation/fb/framebuffer.txt b/Documentation/fb/framebuffer.txt
index b3e3a0356839..fe79e3c8847d 100644
--- a/Documentation/fb/framebuffer.txt
+++ b/Documentation/fb/framebuffer.txt
@@ -312,10 +312,8 @@ and to the following documentation:
3128. Mailing list 3128. Mailing list
313--------------- 313---------------
314 314
315There are several frame buffer device related mailing lists at SourceForge: 315There is a frame buffer device related mailing list at kernel.org:
316 - linux-fbdev-announce@lists.sourceforge.net, for announcements, 316linux-fbdev@vger.kernel.org.
317 - linux-fbdev-user@lists.sourceforge.net, for generic user support,
318 - linux-fbdev-devel@lists.sourceforge.net, for project developers.
319 317
320Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for 318Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for
321subscription information and archive browsing. 319subscription information and archive browsing.
diff --git a/Documentation/fb/viafb.txt b/Documentation/fb/viafb.txt
index 67dbf442b0b6..f3e046a6a987 100644
--- a/Documentation/fb/viafb.txt
+++ b/Documentation/fb/viafb.txt
@@ -7,7 +7,7 @@
7 VIA UniChrome Family(CLE266, PM800 / CN400 / CN300, 7 VIA UniChrome Family(CLE266, PM800 / CN400 / CN300,
8 P4M800CE / P4M800Pro / CN700 / VN800, 8 P4M800CE / P4M800Pro / CN700 / VN800,
9 CX700 / VX700, K8M890, P4M890, 9 CX700 / VX700, K8M890, P4M890,
10 CN896 / P4M900, VX800) 10 CN896 / P4M900, VX800, VX855)
11 11
12[Driver features] 12[Driver features]
13------------------------ 13------------------------
@@ -154,13 +154,6 @@
154 0 : No Dual Edge Panel (default) 154 0 : No Dual Edge Panel (default)
155 1 : Dual Edge Panel 155 1 : Dual Edge Panel
156 156
157 viafb_video_dev:
158 This option is used to specify video output devices(CRT, DVI, LCD) for
159 duoview case.
160 For example:
161 To output video on DVI, we should use:
162 modprobe viafb viafb_video_dev=DVI...
163
164 viafb_lcd_port: 157 viafb_lcd_port:
165 This option is used to specify LCD output port, 158 This option is used to specify LCD output port,
166 available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW". 159 available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW".
@@ -181,9 +174,6 @@ Notes:
181 and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE 174 and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE
182 instead of calling common ioctl function FBIOPUT_VSCREENINFO since 175 instead of calling common ioctl function FBIOPUT_VSCREENINFO since
183 viafb doesn't support multi-head well, or it will cause screen crush. 176 viafb doesn't support multi-head well, or it will cause screen crush.
184 4. VX800 2D accelerator hasn't been supported in this driver yet. When
185 using driver on VX800, the driver will disable the acceleration
186 function as default.
187 177
188 178
189[Configure viafb with "fbset" tool] 179[Configure viafb with "fbset" tool]
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 89a47b5aff07..ed511af0f79a 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -49,6 +49,17 @@ Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com>
49 49
50--------------------------- 50---------------------------
51 51
52What: Deprecated snapshot ioctls
53When: 2.6.36
54
55Why: The ioctls in kernel/power/user.c were marked as deprecated long time
56 ago. Now they notify users about that so that they need to replace
57 their userspace. After some more time, remove them completely.
58
59Who: Jiri Slaby <jirislaby@gmail.com>
60
61---------------------------
62
52What: The ieee80211_regdom module parameter 63What: The ieee80211_regdom module parameter
53When: March 2010 / desktop catchup 64When: March 2010 / desktop catchup
54 65
@@ -73,27 +84,6 @@ Who: Luis R. Rodriguez <lrodriguez@atheros.com>
73 84
74--------------------------- 85---------------------------
75 86
76What: CONFIG_WIRELESS_OLD_REGULATORY - old static regulatory information
77When: March 2010 / desktop catchup
78
79Why: The old regulatory infrastructure has been replaced with a new one
80 which does not require statically defined regulatory domains. We do
81 not want to keep static regulatory domains in the kernel due to the
82 the dynamic nature of regulatory law and localization. We kept around
83 the old static definitions for the regulatory domains of:
84
85 * US
86 * JP
87 * EU
88
89 and used by default the US when CONFIG_WIRELESS_OLD_REGULATORY was
90 set. We will remove this option once the standard Linux desktop catches
91 up with the new userspace APIs we have implemented.
92
93Who: Luis R. Rodriguez <lrodriguez@atheros.com>
94
95---------------------------
96
97What: dev->power.power_state 87What: dev->power.power_state
98When: July 2007 88When: July 2007
99Why: Broken design for runtime control over driver power states, confusing 89Why: Broken design for runtime control over driver power states, confusing
@@ -127,19 +117,25 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org>
127--------------------------- 117---------------------------
128 118
129What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) 119What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
130When: November 2005 120When: 2.6.35/2.6.36
131Files: drivers/pcmcia/: pcmcia_ioctl.c 121Files: drivers/pcmcia/: pcmcia_ioctl.c
132Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a 122Why: With the 16-bit PCMCIA subsystem now behaving (almost) like a
133 normal hotpluggable bus, and with it using the default kernel 123 normal hotpluggable bus, and with it using the default kernel
134 infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA 124 infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA
135 control ioctl needed by cardmgr and cardctl from pcmcia-cs is 125 control ioctl needed by cardmgr and cardctl from pcmcia-cs is
136 unnecessary, and makes further cleanups and integration of the 126 unnecessary and potentially harmful (it does not provide for
127 proper locking), and makes further cleanups and integration of the
137 PCMCIA subsystem into the Linux kernel device driver model more 128 PCMCIA subsystem into the Linux kernel device driver model more
138 difficult. The features provided by cardmgr and cardctl are either 129 difficult. The features provided by cardmgr and cardctl are either
139 handled by the kernel itself now or are available in the new 130 handled by the kernel itself now or are available in the new
140 pcmciautils package available at 131 pcmciautils package available at
141 http://kernel.org/pub/linux/utils/kernel/pcmcia/ 132 http://kernel.org/pub/linux/utils/kernel/pcmcia/
142Who: Dominik Brodowski <linux@brodo.de> 133
134 For all architectures except ARM, the associated config symbol
135 has been removed from kernel 2.6.34; for ARM, it will be likely
136 be removed from kernel 2.6.35. The actual code will then likely
137 be removed from kernel 2.6.36.
138Who: Dominik Brodowski <linux@dominikbrodowski.net>
143 139
144--------------------------- 140---------------------------
145 141
@@ -276,22 +272,6 @@ Who: Michael Buesch <mb@bu3sch.de>
276 272
277--------------------------- 273---------------------------
278 274
279What: usedac i386 kernel parameter
280When: 2.6.27
281Why: replaced by allowdac and no dac combination
282Who: Glauber Costa <gcosta@redhat.com>
283
284---------------------------
285
286What: print_fn_descriptor_symbol()
287When: October 2009
288Why: The %pF vsprintf format provides the same functionality in a
289 simpler way. print_fn_descriptor_symbol() is deprecated but
290 still present to give out-of-tree modules time to change.
291Who: Bjorn Helgaas <bjorn.helgaas@hp.com>
292
293---------------------------
294
295What: /sys/o2cb symlink 275What: /sys/o2cb symlink
296When: January 2010 276When: January 2010
297Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb 277Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
@@ -302,18 +282,6 @@ Who: ocfs2-devel@oss.oracle.com
302 282
303--------------------------- 283---------------------------
304 284
305What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
306 SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD
307When: June 2009
308Why: A newer version of the options have been introduced in 2005 that
309 removes the limitions of the old API. The sctp library has been
310 converted to use these new options at the same time. Any user
311 space app that directly uses the old options should convert to using
312 the new options.
313Who: Vlad Yasevich <vladislav.yasevich@hp.com>
314
315---------------------------
316
317What: Ability for non root users to shm_get hugetlb pages based on mlock 285What: Ability for non root users to shm_get hugetlb pages based on mlock
318 resource limits 286 resource limits
319When: 2.6.31 287When: 2.6.31
@@ -404,20 +372,19 @@ Who: Alex Chiang <achiang@hp.com>
404 372
405--------------------------- 373---------------------------
406 374
407What: i2c-voodoo3 driver
408When: October 2009
409Why: Superseded by tdfxfb. I2C/DDC support used to live in a separate
410 driver but this caused driver conflicts.
411Who: Jean Delvare <khali@linux-fr.org>
412 Krzysztof Helt <krzysztof.h1@wp.pl>
413
414---------------------------
415
416What: CONFIG_RFKILL_INPUT 375What: CONFIG_RFKILL_INPUT
417When: 2.6.33 376When: 2.6.33
418Why: Should be implemented in userspace, policy daemon. 377Why: Should be implemented in userspace, policy daemon.
419Who: Johannes Berg <johannes@sipsolutions.net> 378Who: Johannes Berg <johannes@sipsolutions.net>
420 379
380---------------------------
381
382What: CONFIG_INOTIFY
383When: 2.6.33
384Why: last user (audit) will be converted to the newer more generic
385 and more easily maintained fsnotify subsystem
386Who: Eric Paris <eparis@redhat.com>
387
421---------------------------- 388----------------------------
422 389
423What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be 390What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be
@@ -451,3 +418,174 @@ Why: OSS sound_core grabs all legacy minors (0-255) of SOUND_MAJOR
451 will also allow making ALSA OSS emulation independent of 418 will also allow making ALSA OSS emulation independent of
452 sound_core. The dependency will be broken then too. 419 sound_core. The dependency will be broken then too.
453Who: Tejun Heo <tj@kernel.org> 420Who: Tejun Heo <tj@kernel.org>
421
422----------------------------
423
424What: Support for VMware's guest paravirtuliazation technique [VMI] will be
425 dropped.
426When: 2.6.37 or earlier.
427Why: With the recent innovations in CPU hardware acceleration technologies
428 from Intel and AMD, VMware ran a few experiments to compare these
429 techniques to guest paravirtualization technique on VMware's platform.
430 These hardware assisted virtualization techniques have outperformed the
431 performance benefits provided by VMI in most of the workloads. VMware
432 expects that these hardware features will be ubiquitous in a couple of
433 years, as a result, VMware has started a phased retirement of this
434 feature from the hypervisor. We will be removing this feature from the
435 Kernel too. Right now we are targeting 2.6.37 but can retire earlier if
436 technical reasons (read opportunity to remove major chunk of pvops)
437 arise.
438
439 Please note that VMI has always been an optimization and non-VMI kernels
440 still work fine on VMware's platform.
441 Latest versions of VMware's product which support VMI are,
442 Workstation 7.0 and VSphere 4.0 on ESX side, future maintainence
443 releases for these products will continue supporting VMI.
444
445 For more details about VMI retirement take a look at this,
446 http://blogs.vmware.com/guestosguide/2009/09/vmi-retirement.html
447
448Who: Alok N Kataria <akataria@vmware.com>
449
450----------------------------
451
452What: Support for lcd_switch and display_get in asus-laptop driver
453When: March 2010
454Why: These two features use non-standard interfaces. There are the
455 only features that really need multiple path to guess what's
456 the right method name on a specific laptop.
457
458 Removing them will allow to remove a lot of code an significantly
459 clean the drivers.
460
461 This will affect the backlight code which won't be able to know
462 if the backlight is on or off. The platform display file will also be
463 write only (like the one in eeepc-laptop).
464
465 This should'nt affect a lot of user because they usually know
466 when their display is on or off.
467
468Who: Corentin Chary <corentin.chary@gmail.com>
469
470----------------------------
471
472What: usbvideo quickcam_messenger driver
473When: 2.6.35
474Files: drivers/media/video/usbvideo/quickcam_messenger.[ch]
475Why: obsolete v4l1 driver replaced by gspca_stv06xx
476Who: Hans de Goede <hdegoede@redhat.com>
477
478----------------------------
479
480What: ov511 v4l1 driver
481When: 2.6.35
482Files: drivers/media/video/ov511.[ch]
483Why: obsolete v4l1 driver replaced by gspca_ov519
484Who: Hans de Goede <hdegoede@redhat.com>
485
486----------------------------
487
488What: w9968cf v4l1 driver
489When: 2.6.35
490Files: drivers/media/video/w9968cf*.[ch]
491Why: obsolete v4l1 driver replaced by gspca_ov519
492Who: Hans de Goede <hdegoede@redhat.com>
493
494----------------------------
495
496What: ovcamchip sensor framework
497When: 2.6.35
498Files: drivers/media/video/ovcamchip/*
499Why: Only used by obsoleted v4l1 drivers
500Who: Hans de Goede <hdegoede@redhat.com>
501
502----------------------------
503
504What: stv680 v4l1 driver
505When: 2.6.35
506Files: drivers/media/video/stv680.[ch]
507Why: obsolete v4l1 driver replaced by gspca_stv0680
508Who: Hans de Goede <hdegoede@redhat.com>
509
510----------------------------
511
512What: zc0301 v4l driver
513When: 2.6.35
514Files: drivers/media/video/zc0301/*
515Why: Duplicate functionality with the gspca_zc3xx driver, zc0301 only
516 supports 2 USB-ID's (because it only supports a limited set of
517 sensors) wich are also supported by the gspca_zc3xx driver
518 (which supports 53 USB-ID's in total)
519Who: Hans de Goede <hdegoede@redhat.com>
520
521----------------------------
522
523What: corgikbd, spitzkbd, tosakbd driver
524When: 2.6.35
525Files: drivers/input/keyboard/{corgi,spitz,tosa}kbd.c
526Why: We now have a generic GPIO based matrix keyboard driver that
527 are fully capable of handling all the keys on these devices.
528 The original drivers manipulate the GPIO registers directly
529 and so are difficult to maintain.
530Who: Eric Miao <eric.y.miao@gmail.com>
531
532----------------------------
533
534What: corgi_ssp and corgi_ts driver
535When: 2.6.35
536Files: arch/arm/mach-pxa/corgi_ssp.c, drivers/input/touchscreen/corgi_ts.c
537Why: The corgi touchscreen is now deprecated in favour of the generic
538 ads7846.c driver. The noise reduction technique used in corgi_ts.c,
539 that's to wait till vsync before ADC sampling, is also integrated into
540 ads7846 driver now. Provided that the original driver is not generic
541 and is difficult to maintain, it will be removed later.
542Who: Eric Miao <eric.y.miao@gmail.com>
543
544----------------------------
545
546What: capifs
547When: February 2011
548Files: drivers/isdn/capi/capifs.*
549Why: udev fully replaces this special file system that only contains CAPI
550 NCCI TTY device nodes. User space (pppdcapiplugin) works without
551 noticing the difference.
552Who: Jan Kiszka <jan.kiszka@web.de>
553
554----------------------------
555
556What: KVM memory aliases support
557When: July 2010
558Why: Memory aliasing support is used for speeding up guest vga access
559 through the vga windows.
560
561 Modern userspace no longer uses this feature, so it's just bitrotted
562 code and can be removed with no impact.
563Who: Avi Kivity <avi@redhat.com>
564
565----------------------------
566
567What: KVM kernel-allocated memory slots
568When: July 2010
569Why: Since 2.6.25, kvm supports user-allocated memory slots, which are
570 much more flexible than kernel-allocated slots. All current userspace
571 supports the newer interface and this code can be removed with no
572 impact.
573Who: Avi Kivity <avi@redhat.com>
574
575----------------------------
576
577What: KVM paravirt mmu host support
578When: January 2011
579Why: The paravirt mmu host support is slower than non-paravirt mmu, both
580 on newer and older hardware. It is already not exposed to the guest,
581 and kept only for live migration purposes.
582Who: Avi Kivity <avi@redhat.com>
583
584----------------------------
585
586What: "acpi=ht" boot option
587When: 2.6.35
588Why: Useful in 2003, implementation is a hack.
589 Generally invoked by accident today.
590 Seen as doing more harm than good.
591Who: Len Brown <len.brown@intel.com>
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index f15621ee5599..3bae418c6ad3 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -1,7 +1,5 @@
100-INDEX 100-INDEX
2 - this file (info on some of the filesystems supported by linux). 2 - this file (info on some of the filesystems supported by linux).
3Exporting
4 - explanation of how to make filesystems exportable.
5Locking 3Locking
6 - info on locking rules as they pertain to Linux VFS. 4 - info on locking rules as they pertain to Linux VFS.
79p.txt 59p.txt
@@ -34,8 +32,12 @@ dlmfs.txt
34 - info on the userspace interface to the OCFS2 DLM. 32 - info on the userspace interface to the OCFS2 DLM.
35dnotify.txt 33dnotify.txt
36 - info about directory notification in Linux. 34 - info about directory notification in Linux.
35dnotify_test.c
36 - example program for dnotify
37ecryptfs.txt 37ecryptfs.txt
38 - docs on eCryptfs: stacked cryptographic filesystem for Linux. 38 - docs on eCryptfs: stacked cryptographic filesystem for Linux.
39exofs.txt
40 - info, usage, mount options, design about EXOFS.
39ext2.txt 41ext2.txt
40 - info, mount options and specifications for the Ext2 filesystem. 42 - info, mount options and specifications for the Ext2 filesystem.
41ext3.txt 43ext3.txt
@@ -62,16 +64,14 @@ jfs.txt
62 - info and mount options for the JFS filesystem. 64 - info and mount options for the JFS filesystem.
63locks.txt 65locks.txt
64 - info on file locking implementations, flock() vs. fcntl(), etc. 66 - info on file locking implementations, flock() vs. fcntl(), etc.
67logfs.txt
68 - info on the LogFS flash filesystem.
65mandatory-locking.txt 69mandatory-locking.txt
66 - info on the Linux implementation of Sys V mandatory file locking. 70 - info on the Linux implementation of Sys V mandatory file locking.
67ncpfs.txt 71ncpfs.txt
68 - info on Novell Netware(tm) filesystem using NCP protocol. 72 - info on Novell Netware(tm) filesystem using NCP protocol.
69nfs41-server.txt 73nfs/
70 - info on the Linux server implementation of NFSv4 minor version 1. 74 - nfs-related documentation.
71nfs-rdma.txt
72 - how to install and setup the Linux NFS/RDMA client and server software.
73nfsroot.txt
74 - short guide on setting up a diskless box with NFS root filesystem.
75nilfs2.txt 75nilfs2.txt
76 - info and mount options for the NILFS2 filesystem. 76 - info and mount options for the NILFS2 filesystem.
77ntfs.txt 77ntfs.txt
@@ -90,8 +90,6 @@ relay.txt
90 - info on relay, for efficient streaming from kernel to user space. 90 - info on relay, for efficient streaming from kernel to user space.
91romfs.txt 91romfs.txt
92 - description of the ROMFS filesystem. 92 - description of the ROMFS filesystem.
93rpc-cache.txt
94 - introduction to the caching mechanisms in the sunrpc layer.
95seq_file.txt 93seq_file.txt
96 - how to use the seq_file API 94 - how to use the seq_file API
97sharedsubtree.txt 95sharedsubtree.txt
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 18b9d0ca0630..06bbbed71206 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -460,13 +460,6 @@ in sys_read() and friends.
460 460
461--------------------------- dquot_operations ------------------------------- 461--------------------------- dquot_operations -------------------------------
462prototypes: 462prototypes:
463 int (*initialize) (struct inode *, int);
464 int (*drop) (struct inode *);
465 int (*alloc_space) (struct inode *, qsize_t, int);
466 int (*alloc_inode) (const struct inode *, unsigned long);
467 int (*free_space) (struct inode *, qsize_t);
468 int (*free_inode) (const struct inode *, unsigned long);
469 int (*transfer) (struct inode *, struct iattr *);
470 int (*write_dquot) (struct dquot *); 463 int (*write_dquot) (struct dquot *);
471 int (*acquire_dquot) (struct dquot *); 464 int (*acquire_dquot) (struct dquot *);
472 int (*release_dquot) (struct dquot *); 465 int (*release_dquot) (struct dquot *);
@@ -479,13 +472,6 @@ a proper locking wrt the filesystem and call the generic quota operations.
479What filesystem should expect from the generic quota functions: 472What filesystem should expect from the generic quota functions:
480 473
481 FS recursion Held locks when called 474 FS recursion Held locks when called
482initialize: yes maybe dqonoff_sem
483drop: yes -
484alloc_space: ->mark_dirty() -
485alloc_inode: ->mark_dirty() -
486free_space: ->mark_dirty() -
487free_inode: ->mark_dirty() -
488transfer: yes -
489write_dquot: yes dqonoff_sem or dqptr_sem 475write_dquot: yes dqonoff_sem or dqptr_sem
490acquire_dquot: yes dqonoff_sem or dqptr_sem 476acquire_dquot: yes dqonoff_sem or dqptr_sem
491release_dquot: yes dqonoff_sem or dqptr_sem 477release_dquot: yes dqonoff_sem or dqptr_sem
@@ -495,10 +481,6 @@ write_info: yes dqonoff_sem
495FS recursion means calling ->quota_read() and ->quota_write() from superblock 481FS recursion means calling ->quota_read() and ->quota_write() from superblock
496operations. 482operations.
497 483
498->alloc_space(), ->alloc_inode(), ->free_space(), ->free_inode() are called
499only directly by the filesystem and do not call any fs functions only
500the ->mark_dirty() operation.
501
502More details about quota locking can be found in fs/dquot.c. 484More details about quota locking can be found in fs/dquot.c.
503 485
504--------------------------- vm_operations_struct ----------------------------- 486--------------------------- vm_operations_struct -----------------------------
diff --git a/Documentation/filesystems/Makefile b/Documentation/filesystems/Makefile
new file mode 100644
index 000000000000..a5dd114da14f
--- /dev/null
+++ b/Documentation/filesystems/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := dnotify_test
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/filesystems/caching/fscache.txt b/Documentation/filesystems/caching/fscache.txt
index 9e94b9491d89..a91e2e2095b0 100644
--- a/Documentation/filesystems/caching/fscache.txt
+++ b/Documentation/filesystems/caching/fscache.txt
@@ -235,6 +235,7 @@ proc files.
235 neg=N Number of negative lookups made 235 neg=N Number of negative lookups made
236 pos=N Number of positive lookups made 236 pos=N Number of positive lookups made
237 crt=N Number of objects created by lookup 237 crt=N Number of objects created by lookup
238 tmo=N Number of lookups timed out and requeued
238 Updates n=N Number of update cookie requests seen 239 Updates n=N Number of update cookie requests seen
239 nul=N Number of upd reqs given a NULL parent 240 nul=N Number of upd reqs given a NULL parent
240 run=N Number of upd reqs granted CPU time 241 run=N Number of upd reqs granted CPU time
@@ -250,8 +251,10 @@ proc files.
250 ok=N Number of successful alloc reqs 251 ok=N Number of successful alloc reqs
251 wt=N Number of alloc reqs that waited on lookup completion 252 wt=N Number of alloc reqs that waited on lookup completion
252 nbf=N Number of alloc reqs rejected -ENOBUFS 253 nbf=N Number of alloc reqs rejected -ENOBUFS
254 int=N Number of alloc reqs aborted -ERESTARTSYS
253 ops=N Number of alloc reqs submitted 255 ops=N Number of alloc reqs submitted
254 owt=N Number of alloc reqs waited for CPU time 256 owt=N Number of alloc reqs waited for CPU time
257 abt=N Number of alloc reqs aborted due to object death
255 Retrvls n=N Number of retrieval (read) requests seen 258 Retrvls n=N Number of retrieval (read) requests seen
256 ok=N Number of successful retr reqs 259 ok=N Number of successful retr reqs
257 wt=N Number of retr reqs that waited on lookup completion 260 wt=N Number of retr reqs that waited on lookup completion
@@ -261,6 +264,7 @@ proc files.
261 oom=N Number of retr reqs failed -ENOMEM 264 oom=N Number of retr reqs failed -ENOMEM
262 ops=N Number of retr reqs submitted 265 ops=N Number of retr reqs submitted
263 owt=N Number of retr reqs waited for CPU time 266 owt=N Number of retr reqs waited for CPU time
267 abt=N Number of retr reqs aborted due to object death
264 Stores n=N Number of storage (write) requests seen 268 Stores n=N Number of storage (write) requests seen
265 ok=N Number of successful store reqs 269 ok=N Number of successful store reqs
266 agn=N Number of store reqs on a page already pending storage 270 agn=N Number of store reqs on a page already pending storage
@@ -268,12 +272,37 @@ proc files.
268 oom=N Number of store reqs failed -ENOMEM 272 oom=N Number of store reqs failed -ENOMEM
269 ops=N Number of store reqs submitted 273 ops=N Number of store reqs submitted
270 run=N Number of store reqs granted CPU time 274 run=N Number of store reqs granted CPU time
275 pgs=N Number of pages given store req processing time
276 rxd=N Number of store reqs deleted from tracking tree
277 olm=N Number of store reqs over store limit
278 VmScan nos=N Number of release reqs against pages with no pending store
279 gon=N Number of release reqs against pages stored by time lock granted
280 bsy=N Number of release reqs ignored due to in-progress store
281 can=N Number of page stores cancelled due to release req
271 Ops pend=N Number of times async ops added to pending queues 282 Ops pend=N Number of times async ops added to pending queues
272 run=N Number of times async ops given CPU time 283 run=N Number of times async ops given CPU time
273 enq=N Number of times async ops queued for processing 284 enq=N Number of times async ops queued for processing
285 can=N Number of async ops cancelled
286 rej=N Number of async ops rejected due to object lookup/create failure
274 dfr=N Number of async ops queued for deferred release 287 dfr=N Number of async ops queued for deferred release
275 rel=N Number of async ops released 288 rel=N Number of async ops released
276 gc=N Number of deferred-release async ops garbage collected 289 gc=N Number of deferred-release async ops garbage collected
290 CacheOp alo=N Number of in-progress alloc_object() cache ops
291 luo=N Number of in-progress lookup_object() cache ops
292 luc=N Number of in-progress lookup_complete() cache ops
293 gro=N Number of in-progress grab_object() cache ops
294 upo=N Number of in-progress update_object() cache ops
295 dro=N Number of in-progress drop_object() cache ops
296 pto=N Number of in-progress put_object() cache ops
297 syn=N Number of in-progress sync_cache() cache ops
298 atc=N Number of in-progress attr_changed() cache ops
299 rap=N Number of in-progress read_or_alloc_page() cache ops
300 ras=N Number of in-progress read_or_alloc_pages() cache ops
301 alp=N Number of in-progress allocate_page() cache ops
302 als=N Number of in-progress allocate_pages() cache ops
303 wrp=N Number of in-progress write_page() cache ops
304 ucp=N Number of in-progress uncache_page() cache ops
305 dsp=N Number of in-progress dissociate_pages() cache ops
277 306
278 307
279 (*) /proc/fs/fscache/histogram 308 (*) /proc/fs/fscache/histogram
@@ -299,6 +328,87 @@ proc files.
299 jiffy range covered, and the SECS field the equivalent number of seconds. 328 jiffy range covered, and the SECS field the equivalent number of seconds.
300 329
301 330
331===========
332OBJECT LIST
333===========
334
335If CONFIG_FSCACHE_OBJECT_LIST is enabled, the FS-Cache facility will maintain a
336list of all the objects currently allocated and allow them to be viewed
337through:
338
339 /proc/fs/fscache/objects
340
341This will look something like:
342
343 [root@andromeda ~]# head /proc/fs/fscache/objects
344 OBJECT PARENT STAT CHLDN OPS OOP IPR EX READS EM EV F S | NETFS_COOKIE_DEF TY FL NETFS_DATA OBJECT_KEY, AUX_DATA
345 ======== ======== ==== ===== === === === == ===== == == = = | ================ == == ================ ================
346 17e4b 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88001dd82820 010006017edcf8bbc93b43298fdfbe71e50b57b13a172c0117f38472, e567634700000000000000000000000063f2404a000000000000000000000000c9030000000000000000000063f2404a
347 1693a 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88002db23380 010006017edcf8bbc93b43298fdfbe71e50b57b1e0162c01a2df0ea6, 420ebc4a000000000000000000000000420ebc4a0000000000000000000000000e1801000000000000000000420ebc4a
348
349where the first set of columns before the '|' describe the object:
350
351 COLUMN DESCRIPTION
352 ======= ===============================================================
353 OBJECT Object debugging ID (appears as OBJ%x in some debug messages)
354 PARENT Debugging ID of parent object
355 STAT Object state
356 CHLDN Number of child objects of this object
357 OPS Number of outstanding operations on this object
358 OOP Number of outstanding child object management operations
359 IPR
360 EX Number of outstanding exclusive operations
361 READS Number of outstanding read operations
362 EM Object's event mask
363 EV Events raised on this object
364 F Object flags
365 S Object slow-work work item flags
366
367and the second set of columns describe the object's cookie, if present:
368
369 COLUMN DESCRIPTION
370 =============== =======================================================
371 NETFS_COOKIE_DEF Name of netfs cookie definition
372 TY Cookie type (IX - index, DT - data, hex - special)
373 FL Cookie flags
374 NETFS_DATA Netfs private data stored in the cookie
375 OBJECT_KEY Object key } 1 column, with separating comma
376 AUX_DATA Object aux data } presence may be configured
377
378The data shown may be filtered by attaching the a key to an appropriate keyring
379before viewing the file. Something like:
380
381 keyctl add user fscache:objlist <restrictions> @s
382
383where <restrictions> are a selection of the following letters:
384
385 K Show hexdump of object key (don't show if not given)
386 A Show hexdump of object aux data (don't show if not given)
387
388and the following paired letters:
389
390 C Show objects that have a cookie
391 c Show objects that don't have a cookie
392 B Show objects that are busy
393 b Show objects that aren't busy
394 W Show objects that have pending writes
395 w Show objects that don't have pending writes
396 R Show objects that have outstanding reads
397 r Show objects that don't have outstanding reads
398 S Show objects that have slow work queued
399 s Show objects that don't have slow work queued
400
401If neither side of a letter pair is given, then both are implied. For example:
402
403 keyctl add user fscache:objlist KB @s
404
405shows objects that are busy, and lists their object keys, but does not dump
406their auxiliary data. It also implies "CcWwRrSs", but as 'B' is given, 'b' is
407not implied.
408
409By default all objects and all fields will be shown.
410
411
302========= 412=========
303DEBUGGING 413DEBUGGING
304========= 414=========
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt
index 2666b1ed5e9e..1902c57b72ef 100644
--- a/Documentation/filesystems/caching/netfs-api.txt
+++ b/Documentation/filesystems/caching/netfs-api.txt
@@ -641,7 +641,7 @@ data file must be retired (see the relinquish cookie function below).
641 641
642Furthermore, note that this does not cancel the asynchronous read or write 642Furthermore, note that this does not cancel the asynchronous read or write
643operation started by the read/alloc and write functions, so the page 643operation started by the read/alloc and write functions, so the page
644invalidation and release functions must use: 644invalidation functions must use:
645 645
646 bool fscache_check_page_write(struct fscache_cookie *cookie, 646 bool fscache_check_page_write(struct fscache_cookie *cookie,
647 struct page *page); 647 struct page *page);
@@ -654,6 +654,25 @@ to see if a page is being written to the cache, and:
654to wait for it to finish if it is. 654to wait for it to finish if it is.
655 655
656 656
657When releasepage() is being implemented, a special FS-Cache function exists to
658manage the heuristics of coping with vmscan trying to eject pages, which may
659conflict with the cache trying to write pages to the cache (which may itself
660need to allocate memory):
661
662 bool fscache_maybe_release_page(struct fscache_cookie *cookie,
663 struct page *page,
664 gfp_t gfp);
665
666This takes the netfs cookie, and the page and gfp arguments as supplied to
667releasepage(). It will return false if the page cannot be released yet for
668some reason and if it returns true, the page has been uncached and can now be
669released.
670
671To make a page available for release, this function may wait for an outstanding
672storage request to complete, or it may attempt to cancel the storage request -
673in which case the page will not be stored in the cache this time.
674
675
657========================== 676==========================
658INDEX AND DATA FILE UPDATE 677INDEX AND DATA FILE UPDATE
659========================== 678==========================
diff --git a/Documentation/filesystems/dentry-locking.txt b/Documentation/filesystems/dentry-locking.txt
index 4c0c575a4012..79334ed5daa7 100644
--- a/Documentation/filesystems/dentry-locking.txt
+++ b/Documentation/filesystems/dentry-locking.txt
@@ -62,7 +62,8 @@ changes are :
622. Insertion of a dentry into the hash table is done using 622. Insertion of a dentry into the hash table is done using
63 hlist_add_head_rcu() which take care of ordering the writes - the 63 hlist_add_head_rcu() which take care of ordering the writes - the
64 writes to the dentry must be visible before the dentry is 64 writes to the dentry must be visible before the dentry is
65 inserted. This works in conjunction with hlist_for_each_rcu() while 65 inserted. This works in conjunction with hlist_for_each_rcu(),
66 which has since been replaced by hlist_for_each_entry_rcu(), while
66 walking the hash chain. The only requirement is that all 67 walking the hash chain. The only requirement is that all
67 initialization to the dentry must be done before 68 initialization to the dentry must be done before
68 hlist_add_head_rcu() since we don't have dcache_lock protection 69 hlist_add_head_rcu() since we don't have dcache_lock protection
diff --git a/Documentation/filesystems/dnotify.txt b/Documentation/filesystems/dnotify.txt
index 9f5d338ddbb8..6baf88f46859 100644
--- a/Documentation/filesystems/dnotify.txt
+++ b/Documentation/filesystems/dnotify.txt
@@ -62,38 +62,9 @@ disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL.
62 62
63Example 63Example
64------- 64-------
65See Documentation/filesystems/dnotify_test.c for an example.
65 66
66 #define _GNU_SOURCE /* needed to get the defines */ 67NOTE
67 #include <fcntl.h> /* in glibc 2.2 this has the needed 68----
68 values defined */ 69Beginning with Linux 2.6.13, dnotify has been replaced by inotify.
69 #include <signal.h> 70See Documentation/filesystems/inotify.txt for more information on it.
70 #include <stdio.h>
71 #include <unistd.h>
72
73 static volatile int event_fd;
74
75 static void handler(int sig, siginfo_t *si, void *data)
76 {
77 event_fd = si->si_fd;
78 }
79
80 int main(void)
81 {
82 struct sigaction act;
83 int fd;
84
85 act.sa_sigaction = handler;
86 sigemptyset(&act.sa_mask);
87 act.sa_flags = SA_SIGINFO;
88 sigaction(SIGRTMIN + 1, &act, NULL);
89
90 fd = open(".", O_RDONLY);
91 fcntl(fd, F_SETSIG, SIGRTMIN + 1);
92 fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT);
93 /* we will now be notified if any of the files
94 in "." is modified or new files are created */
95 while (1) {
96 pause();
97 printf("Got event on fd=%d\n", event_fd);
98 }
99 }
diff --git a/Documentation/filesystems/dnotify_test.c b/Documentation/filesystems/dnotify_test.c
new file mode 100644
index 000000000000..8b37b4a1e18d
--- /dev/null
+++ b/Documentation/filesystems/dnotify_test.c
@@ -0,0 +1,34 @@
1#define _GNU_SOURCE /* needed to get the defines */
2#include <fcntl.h> /* in glibc 2.2 this has the needed
3 values defined */
4#include <signal.h>
5#include <stdio.h>
6#include <unistd.h>
7
8static volatile int event_fd;
9
10static void handler(int sig, siginfo_t *si, void *data)
11{
12 event_fd = si->si_fd;
13}
14
15int main(void)
16{
17 struct sigaction act;
18 int fd;
19
20 act.sa_sigaction = handler;
21 sigemptyset(&act.sa_mask);
22 act.sa_flags = SA_SIGINFO;
23 sigaction(SIGRTMIN + 1, &act, NULL);
24
25 fd = open(".", O_RDONLY);
26 fcntl(fd, F_SETSIG, SIGRTMIN + 1);
27 fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT);
28 /* we will now be notified if any of the files
29 in "." is modified or new files are created */
30 while (1) {
31 pause();
32 printf("Got event on fd=%d\n", event_fd);
33 }
34}
diff --git a/Documentation/filesystems/exofs.txt b/Documentation/filesystems/exofs.txt
index 0ced74c2f73c..abd2a9b5b787 100644
--- a/Documentation/filesystems/exofs.txt
+++ b/Documentation/filesystems/exofs.txt
@@ -60,13 +60,13 @@ USAGE
60 60
61 mkfs.exofs --pid=65536 --format /dev/osd0 61 mkfs.exofs --pid=65536 --format /dev/osd0
62 62
63 The --format is optional if not specified no OSD_FORMAT will be 63 The --format is optional. If not specified, no OSD_FORMAT will be
64 preformed and a clean file system will be created in the specified pid, 64 performed and a clean file system will be created in the specified pid,
65 in the available space of the target. (Use --format=size_in_meg to limit 65 in the available space of the target. (Use --format=size_in_meg to limit
66 the total LUN space available) 66 the total LUN space available)
67 67
68 If pid already exist it will be deleted and a new one will be created in it's 68 If pid already exists, it will be deleted and a new one will be created in
69 place. Be careful. 69 its place. Be careful.
70 70
71 An exofs lives inside a single OSD partition. You can create multiple exofs 71 An exofs lives inside a single OSD partition. You can create multiple exofs
72 filesystems on the same device using multiple pids. 72 filesystems on the same device using multiple pids.
@@ -81,7 +81,7 @@ USAGE
81 81
827. For reference (See do-exofs example script): 827. For reference (See do-exofs example script):
83 do-exofs start - an example of how to perform the above steps. 83 do-exofs start - an example of how to perform the above steps.
84 do-exofs stop - an example of how to unmount the file system. 84 do-exofs stop - an example of how to unmount the file system.
85 do-exofs format - an example of how to format and mkfs a new exofs. 85 do-exofs format - an example of how to format and mkfs a new exofs.
86 86
878. Extra compilation flags (uncomment in fs/exofs/Kbuild): 878. Extra compilation flags (uncomment in fs/exofs/Kbuild):
@@ -104,8 +104,8 @@ Where:
104 exofs specific options: Options are separated by commas (,) 104 exofs specific options: Options are separated by commas (,)
105 pid=<integer> - The partition number to mount/create as 105 pid=<integer> - The partition number to mount/create as
106 container of the filesystem. 106 container of the filesystem.
107 This option is mandatory 107 This option is mandatory.
108 to=<integer> - Timeout in ticks for a single command 108 to=<integer> - Timeout in ticks for a single command.
109 default is (60 * HZ) [for debugging only] 109 default is (60 * HZ) [for debugging only]
110 110
111=============================================================================== 111===============================================================================
@@ -116,7 +116,7 @@ DESIGN
116 with a special ID (defined in common.h). 116 with a special ID (defined in common.h).
117 Information included in the file system control block is used to fill the 117 Information included in the file system control block is used to fill the
118 in-memory superblock structure at mount time. This object is created before 118 in-memory superblock structure at mount time. This object is created before
119 the file system is used by mkexofs.c It contains information such as: 119 the file system is used by mkexofs.c. It contains information such as:
120 - The file system's magic number 120 - The file system's magic number
121 - The next inode number to be allocated 121 - The next inode number to be allocated
122 122
@@ -134,8 +134,8 @@ DESIGN
134 attributes. This applies to both regular files and other types (directories, 134 attributes. This applies to both regular files and other types (directories,
135 device files, symlinks, etc.). 135 device files, symlinks, etc.).
136 136
137* Credentials are generated per object (inode and superblock) when they is 137* Credentials are generated per object (inode and superblock) when they are
138 created in memory (read off disk or created). The credential works for all 138 created in memory (read from disk or created). The credential works for all
139 operations and is used as long as the object remains in memory. 139 operations and is used as long as the object remains in memory.
140 140
141* Async OSD operations are used whenever possible, but the target may execute 141* Async OSD operations are used whenever possible, but the target may execute
@@ -145,7 +145,8 @@ DESIGN
145 from executing in reverse order: 145 from executing in reverse order:
146 - The following are handled with the OBJ_CREATED and OBJ_2BCREATED 146 - The following are handled with the OBJ_CREATED and OBJ_2BCREATED
147 flags. OBJ_CREATED is set when we know the object exists on the OSD - 147 flags. OBJ_CREATED is set when we know the object exists on the OSD -
148 in create's callback function, and when we successfully do a read_inode. 148 in create's callback function, and when we successfully do a
149 read_inode.
149 OBJ_2BCREATED is set in the beginning of the create function, so we 150 OBJ_2BCREATED is set in the beginning of the create function, so we
150 know that we should wait. 151 know that we should wait.
151 - create/delete: delete should wait until the object is created 152 - create/delete: delete should wait until the object is created
diff --git a/Documentation/filesystems/ext3.txt b/Documentation/filesystems/ext3.txt
index 570f9bd9be2b..867c5b50cb42 100644
--- a/Documentation/filesystems/ext3.txt
+++ b/Documentation/filesystems/ext3.txt
@@ -32,8 +32,8 @@ journal_dev=devnum When the external journal device's major/minor numbers
32 identified through its new major/minor numbers encoded 32 identified through its new major/minor numbers encoded
33 in devnum. 33 in devnum.
34 34
35noload Don't load the journal on mounting. Note that this forces 35norecovery Don't load the journal on mounting. Note that this forces
36 mount of inconsistent filesystem, which can lead to 36noload mount of inconsistent filesystem, which can lead to
37 various problems. 37 various problems.
38 38
39data=journal All data are committed into the journal prior to being 39data=journal All data are committed into the journal prior to being
@@ -123,10 +123,18 @@ resuid=n The user ID which may use the reserved blocks.
123 123
124sb=n Use alternate superblock at this location. 124sb=n Use alternate superblock at this location.
125 125
126quota 126quota These options are ignored by the filesystem. They
127noquota 127noquota are used only by quota tools to recognize volumes
128grpquota 128grpquota where quota should be turned on. See documentation
129usrquota 129usrquota in the quota-tools package for more details
130 (http://sourceforge.net/projects/linuxquota).
131
132jqfmt=<quota type> These options tell filesystem details about quota
133usrjquota=<file> so that quota information can be properly updated
134grpjquota=<file> during journal replay. They replace the above
135 quota options. See documentation in the quota-tools
136 package for more details
137 (http://sourceforge.net/projects/linuxquota).
130 138
131bh (*) ext3 associates buffer heads to data pages to 139bh (*) ext3 associates buffer heads to data pages to
132nobh (a) cache disk block mapping information 140nobh (a) cache disk block mapping information
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 18b5ec8cea45..e1def1786e50 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -134,9 +134,15 @@ ro Mount filesystem read only. Note that ext4 will
134 mount options "ro,noload" can be used to prevent 134 mount options "ro,noload" can be used to prevent
135 writes to the filesystem. 135 writes to the filesystem.
136 136
137journal_checksum Enable checksumming of the journal transactions.
138 This will allow the recovery code in e2fsck and the
139 kernel to detect corruption in the kernel. It is a
140 compatible change and will be ignored by older kernels.
141
137journal_async_commit Commit block can be written to disk without waiting 142journal_async_commit Commit block can be written to disk without waiting
138 for descriptor blocks. If enabled older kernels cannot 143 for descriptor blocks. If enabled older kernels cannot
139 mount the device. 144 mount the device. This will enable 'journal_checksum'
145 internally.
140 146
141journal=update Update the ext4 file system's journal to the current 147journal=update Update the ext4 file system's journal to the current
142 format. 148 format.
@@ -147,8 +153,8 @@ journal_dev=devnum When the external journal device's major/minor numbers
147 identified through its new major/minor numbers encoded 153 identified through its new major/minor numbers encoded
148 in devnum. 154 in devnum.
149 155
150noload Don't load the journal on mounting. Note that 156norecovery Don't load the journal on mounting. Note that
151 if the filesystem was not unmounted cleanly, 157noload if the filesystem was not unmounted cleanly,
152 skipping the journal replay will lead to the 158 skipping the journal replay will lead to the
153 filesystem containing inconsistencies that can 159 filesystem containing inconsistencies that can
154 lead to any number of problems. 160 lead to any number of problems.
@@ -190,7 +196,7 @@ nobarrier This also requires an IO stack which can support
190 also be used to enable or disable barriers, for 196 also be used to enable or disable barriers, for
191 consistency with other ext4 mount options. 197 consistency with other ext4 mount options.
192 198
193inode_readahead=n This tuning parameter controls the maximum 199inode_readahead_blks=n This tuning parameter controls the maximum
194 number of inode table blocks that ext4's inode 200 number of inode table blocks that ext4's inode
195 table readahead algorithm will pre-read into 201 table readahead algorithm will pre-read into
196 the buffer cache. The default value is 32 blocks. 202 the buffer cache. The default value is 32 blocks.
@@ -282,9 +288,16 @@ stripe=n Number of filesystem blocks that mballoc will try
282 to use for allocation size and alignment. For RAID5/6 288 to use for allocation size and alignment. For RAID5/6
283 systems this should be the number of data 289 systems this should be the number of data
284 disks * RAID chunk size in file system blocks. 290 disks * RAID chunk size in file system blocks.
285delalloc (*) Deferring block allocation until write-out time. 291
286nodelalloc Disable delayed allocation. Blocks are allocation 292delalloc (*) Defer block allocation until just before ext4
287 when data is copied from user to page cache. 293 writes out the block(s) in question. This
294 allows ext4 to better allocation decisions
295 more efficiently.
296nodelalloc Disable delayed allocation. Blocks are allocated
297 when the data is copied from userspace to the
298 page cache, either via the write(2) system call
299 or when an mmap'ed page which was previously
300 unallocated is written for the first time.
288 301
289max_batch_time=usec Maximum amount of time ext4 should wait for 302max_batch_time=usec Maximum amount of time ext4 should wait for
290 additional filesystem operations to be batch 303 additional filesystem operations to be batch
@@ -340,6 +353,12 @@ noauto_da_alloc replacing existing files via patterns such as
340 system crashes before the delayed allocation 353 system crashes before the delayed allocation
341 blocks are forced to disk. 354 blocks are forced to disk.
342 355
356discard Controls whether ext4 should issue discard/TRIM
357nodiscard(*) commands to the underlying block device when
358 blocks are freed. This is useful for SSD devices
359 and sparse/thinly-provisioned LUNs, but it is off
360 by default until sufficient testing has been done.
361
343Data Mode 362Data Mode
344========= 363=========
345There are 3 different data modes: 364There are 3 different data modes:
diff --git a/Documentation/filesystems/logfs.txt b/Documentation/filesystems/logfs.txt
new file mode 100644
index 000000000000..e64c94ba401a
--- /dev/null
+++ b/Documentation/filesystems/logfs.txt
@@ -0,0 +1,241 @@
1
2The LogFS Flash Filesystem
3==========================
4
5Specification
6=============
7
8Superblocks
9-----------
10
11Two superblocks exist at the beginning and end of the filesystem.
12Each superblock is 256 Bytes large, with another 3840 Bytes reserved
13for future purposes, making a total of 4096 Bytes.
14
15Superblock locations may differ for MTD and block devices. On MTD the
16first non-bad block contains a superblock in the first 4096 Bytes and
17the last non-bad block contains a superblock in the last 4096 Bytes.
18On block devices, the first 4096 Bytes of the device contain the first
19superblock and the last aligned 4096 Byte-block contains the second
20superblock.
21
22For the most part, the superblocks can be considered read-only. They
23are written only to correct errors detected within the superblocks,
24move the journal and change the filesystem parameters through tunefs.
25As a result, the superblock does not contain any fields that require
26constant updates, like the amount of free space, etc.
27
28Segments
29--------
30
31The space in the device is split up into equal-sized segments.
32Segments are the primary write unit of LogFS. Within each segments,
33writes happen from front (low addresses) to back (high addresses. If
34only a partial segment has been written, the segment number, the
35current position within and optionally a write buffer are stored in
36the journal.
37
38Segments are erased as a whole. Therefore Garbage Collection may be
39required to completely free a segment before doing so.
40
41Journal
42--------
43
44The journal contains all global information about the filesystem that
45is subject to frequent change. At mount time, it has to be scanned
46for the most recent commit entry, which contains a list of pointers to
47all currently valid entries.
48
49Object Store
50------------
51
52All space except for the superblocks and journal is part of the object
53store. Each segment contains a segment header and a number of
54objects, each consisting of the object header and the payload.
55Objects are either inodes, directory entries (dentries), file data
56blocks or indirect blocks.
57
58Levels
59------
60
61Garbage collection (GC) may fail if all data is written
62indiscriminately. One requirement of GC is that data is seperated
63roughly according to the distance between the tree root and the data.
64Effectively that means all file data is on level 0, indirect blocks
65are on levels 1, 2, 3 4 or 5 for 1x, 2x, 3x, 4x or 5x indirect blocks,
66respectively. Inode file data is on level 6 for the inodes and 7-11
67for indirect blocks.
68
69Each segment contains objects of a single level only. As a result,
70each level requires its own seperate segment to be open for writing.
71
72Inode File
73----------
74
75All inodes are stored in a special file, the inode file. Single
76exception is the inode file's inode (master inode) which for obvious
77reasons is stored in the journal instead. Instead of data blocks, the
78leaf nodes of the inode files are inodes.
79
80Aliases
81-------
82
83Writes in LogFS are done by means of a wandering tree. A naïve
84implementation would require that for each write or a block, all
85parent blocks are written as well, since the block pointers have
86changed. Such an implementation would not be very efficient.
87
88In LogFS, the block pointer changes are cached in the journal by means
89of alias entries. Each alias consists of its logical address - inode
90number, block index, level and child number (index into block) - and
91the changed data. Any 8-byte word can be changes in this manner.
92
93Currently aliases are used for block pointers, file size, file used
94bytes and the height of an inodes indirect tree.
95
96Segment Aliases
97---------------
98
99Related to regular aliases, these are used to handle bad blocks.
100Initially, bad blocks are handled by moving the affected segment
101content to a spare segment and noting this move in the journal with a
102segment alias, a simple (to, from) tupel. GC will later empty this
103segment and the alias can be removed again. This is used on MTD only.
104
105Vim
106---
107
108By cleverly predicting the life time of data, it is possible to
109seperate long-living data from short-living data and thereby reduce
110the GC overhead later. Each type of distinc life expectency (vim) can
111have a seperate segment open for writing. Each (level, vim) tupel can
112be open just once. If an open segment with unknown vim is encountered
113at mount time, it is closed and ignored henceforth.
114
115Indirect Tree
116-------------
117
118Inodes in LogFS are similar to FFS-style filesystems with direct and
119indirect block pointers. One difference is that LogFS uses a single
120indirect pointer that can be either a 1x, 2x, etc. indirect pointer.
121A height field in the inode defines the height of the indirect tree
122and thereby the indirection of the pointer.
123
124Another difference is the addressing of indirect blocks. In LogFS,
125the first 16 pointers in the first indirect block are left empty,
126corresponding to the 16 direct pointers in the inode. In ext2 (maybe
127others as well) the first pointer in the first indirect block
128corresponds to logical block 12, skipping the 12 direct pointers.
129So where ext2 is using arithmetic to better utilize space, LogFS keeps
130arithmetic simple and uses compression to save space.
131
132Compression
133-----------
134
135Both file data and metadata can be compressed. Compression for file
136data can be enabled with chattr +c and disabled with chattr -c. Doing
137so has no effect on existing data, but new data will be stored
138accordingly. New inodes will inherit the compression flag of the
139parent directory.
140
141Metadata is always compressed. However, the space accounting ignores
142this and charges for the uncompressed size. Failing to do so could
143result in GC failures when, after moving some data, indirect blocks
144compress worse than previously. Even on a 100% full medium, GC may
145not consume any extra space, so the compression gains are lost space
146to the user.
147
148However, they are not lost space to the filesystem internals. By
149cheating the user for those bytes, the filesystem gained some slack
150space and GC will run less often and faster.
151
152Garbage Collection and Wear Leveling
153------------------------------------
154
155Garbage collection is invoked whenever the number of free segments
156falls below a threshold. The best (known) candidate is picked based
157on the least amount of valid data contained in the segment. All
158remaining valid data is copied elsewhere, thereby invalidating it.
159
160The GC code also checks for aliases and writes then back if their
161number gets too large.
162
163Wear leveling is done by occasionally picking a suboptimal segment for
164garbage collection. If a stale segments erase count is significantly
165lower than the active segments' erase counts, it will be picked. Wear
166leveling is rate limited, so it will never monopolize the device for
167more than one segment worth at a time.
168
169Values for "occasionally", "significantly lower" are compile time
170constants.
171
172Hashed directories
173------------------
174
175To satisfy efficient lookup(), directory entries are hashed and
176located based on the hash. In order to both support large directories
177and not be overly inefficient for small directories, several hash
178tables of increasing size are used. For each table, the hash value
179modulo the table size gives the table index.
180
181Tables sizes are chosen to limit the number of indirect blocks with a
182fully populated table to 0, 1, 2 or 3 respectively. So the first
183table contains 16 entries, the second 512-16, etc.
184
185The last table is special in several ways. First its size depends on
186the effective 32bit limit on telldir/seekdir cookies. Since logfs
187uses the upper half of the address space for indirect blocks, the size
188is limited to 2^31. Secondly the table contains hash buckets with 16
189entries each.
190
191Using single-entry buckets would result in birthday "attacks". At
192just 2^16 used entries, hash collisions would be likely (P >= 0.5).
193My math skills are insufficient to do the combinatorics for the 17x
194collisions necessary to overflow a bucket, but testing showed that in
19510,000 runs the lowest directory fill before a bucket overflow was
196188,057,130 entries with an average of 315,149,915 entries. So for
197directory sizes of up to a million, bucket overflows should be
198virtually impossible under normal circumstances.
199
200With carefully chosen filenames, it is obviously possible to cause an
201overflow with just 21 entries (4 higher tables + 16 entries + 1). So
202there may be a security concern if a malicious user has write access
203to a directory.
204
205Open For Discussion
206===================
207
208Device Address Space
209--------------------
210
211A device address space is used for caching. Both block devices and
212MTD provide functions to either read a single page or write a segment.
213Partial segments may be written for data integrity, but where possible
214complete segments are written for performance on simple block device
215flash media.
216
217Meta Inodes
218-----------
219
220Inodes are stored in the inode file, which is just a regular file for
221most purposes. At umount time, however, the inode file needs to
222remain open until all dirty inodes are written. So
223generic_shutdown_super() may not close this inode, but shouldn't
224complain about remaining inodes due to the inode file either. Same
225goes for mapping inode of the device address space.
226
227Currently logfs uses a hack that essentially copies part of fs/inode.c
228code over. A general solution would be preferred.
229
230Indirect block mapping
231----------------------
232
233With compression, the block device (or mapping inode) cannot be used
234to cache indirect blocks. Some other place is required. Currently
235logfs uses the top half of each inode's address space. The low 8TB
236(on 32bit) are filled with file data, the high 8TB are used for
237indirect blocks.
238
239One problem is that 16TB files created on 64bit systems actually have
240data in the top 8TB. But files >16TB would cause problems anyway, so
241only the limit has changed.
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX
new file mode 100644
index 000000000000..2f68cd688769
--- /dev/null
+++ b/Documentation/filesystems/nfs/00-INDEX
@@ -0,0 +1,16 @@
100-INDEX
2 - this file (nfs-related documentation).
3Exporting
4 - explanation of how to make filesystems exportable.
5knfsd-stats.txt
6 - statistics which the NFS server makes available to user space.
7nfs.txt
8 - nfs client, and DNS resolution for fs_locations.
9nfs41-server.txt
10 - info on the Linux server implementation of NFSv4 minor version 1.
11nfs-rdma.txt
12 - how to install and setup the Linux NFS/RDMA client and server software
13nfsroot.txt
14 - short guide on setting up a diskless box with NFS root filesystem.
15rpc-cache.txt
16 - introduction to the caching mechanisms in the sunrpc layer.
diff --git a/Documentation/filesystems/Exporting b/Documentation/filesystems/nfs/Exporting
index 87019d2b5981..87019d2b5981 100644
--- a/Documentation/filesystems/Exporting
+++ b/Documentation/filesystems/nfs/Exporting
diff --git a/Documentation/filesystems/knfsd-stats.txt b/Documentation/filesystems/nfs/knfsd-stats.txt
index 64ced5149d37..64ced5149d37 100644
--- a/Documentation/filesystems/knfsd-stats.txt
+++ b/Documentation/filesystems/nfs/knfsd-stats.txt
diff --git a/Documentation/filesystems/nfs-rdma.txt b/Documentation/filesystems/nfs/nfs-rdma.txt
index e386f7e4bcee..e386f7e4bcee 100644
--- a/Documentation/filesystems/nfs-rdma.txt
+++ b/Documentation/filesystems/nfs/nfs-rdma.txt
diff --git a/Documentation/filesystems/nfs.txt b/Documentation/filesystems/nfs/nfs.txt
index f50f26ce6cd0..f50f26ce6cd0 100644
--- a/Documentation/filesystems/nfs.txt
+++ b/Documentation/filesystems/nfs/nfs.txt
diff --git a/Documentation/filesystems/nfs41-server.txt b/Documentation/filesystems/nfs/nfs41-server.txt
index 5920fe26e6ff..6a53a84afc72 100644
--- a/Documentation/filesystems/nfs41-server.txt
+++ b/Documentation/filesystems/nfs/nfs41-server.txt
@@ -17,8 +17,7 @@ kernels must turn 4.1 on or off *before* turning support for version 4
17on or off; rpc.nfsd does this correctly.) 17on or off; rpc.nfsd does this correctly.)
18 18
19The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based 19The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based
20on the latest NFSv4.1 Internet Draft: 20on RFC 5661.
21http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-29
22 21
23From the many new features in NFSv4.1 the current implementation 22From the many new features in NFSv4.1 the current implementation
24focuses on the mandatory-to-implement NFSv4.1 Sessions, providing 23focuses on the mandatory-to-implement NFSv4.1 Sessions, providing
@@ -41,10 +40,10 @@ interoperability problems with future clients. Known issues:
41 conformant with the spec (for example, we don't use kerberos 40 conformant with the spec (for example, we don't use kerberos
42 on the backchannel correctly). 41 on the backchannel correctly).
43 - no trunking support: no clients currently take advantage of 42 - no trunking support: no clients currently take advantage of
44 trunking, but this is a mandatory failure, and its use is 43 trunking, but this is a mandatory feature, and its use is
45 recommended to clients in a number of places. (E.g. to ensure 44 recommended to clients in a number of places. (E.g. to ensure
46 timely renewal in case an existing connection's retry timeouts 45 timely renewal in case an existing connection's retry timeouts
47 have gotten too long; see section 8.3 of the draft.) 46 have gotten too long; see section 8.3 of the RFC.)
48 Therefore, lack of this feature may cause future clients to 47 Therefore, lack of this feature may cause future clients to
49 fail. 48 fail.
50 - Incomplete backchannel support: incomplete backchannel gss 49 - Incomplete backchannel support: incomplete backchannel gss
@@ -213,3 +212,10 @@ The following cases aren't supported yet:
213 DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID. 212 DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID.
214* DESTROY_SESSION MUST be the final operation in the COMPOUND request. 213* DESTROY_SESSION MUST be the final operation in the COMPOUND request.
215 214
215Nonstandard compound limitations:
216* No support for a sessions fore channel RPC compound that requires both a
217 ca_maxrequestsize request and a ca_maxresponsesize reply, so we may
218 fail to live up to the promise we made in CREATE_SESSION fore channel
219 negotiation.
220* No more than one IO operation (read, write, readdir) allowed per
221 compound.
diff --git a/Documentation/filesystems/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
index 3ba0b945aaf8..3ba0b945aaf8 100644
--- a/Documentation/filesystems/nfsroot.txt
+++ b/Documentation/filesystems/nfs/nfsroot.txt
diff --git a/Documentation/filesystems/rpc-cache.txt b/Documentation/filesystems/nfs/rpc-cache.txt
index 8a382bea6808..8a382bea6808 100644
--- a/Documentation/filesystems/rpc-cache.txt
+++ b/Documentation/filesystems/nfs/rpc-cache.txt
diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt
index 01539f410676..cf6d0d85ca82 100644
--- a/Documentation/filesystems/nilfs2.txt
+++ b/Documentation/filesystems/nilfs2.txt
@@ -28,7 +28,7 @@ described in the man pages included in the package.
28Project web page: http://www.nilfs.org/en/ 28Project web page: http://www.nilfs.org/en/
29Download page: http://www.nilfs.org/en/download.html 29Download page: http://www.nilfs.org/en/download.html
30Git tree web page: http://www.nilfs.org/git/ 30Git tree web page: http://www.nilfs.org/git/
31NILFS mailing lists: http://www.nilfs.org/mailman/listinfo/users 31List info: http://vger.kernel.org/vger-lists.html#linux-nilfs
32 32
33Caveats 33Caveats
34======= 34=======
@@ -49,8 +49,7 @@ Mount options
49NILFS2 supports the following mount options: 49NILFS2 supports the following mount options:
50(*) == default 50(*) == default
51 51
52barrier=on(*) This enables/disables barriers. barrier=off disables 52nobarrier Disables barriers.
53 it, barrier=on enables it.
54errors=continue(*) Keep going on a filesystem error. 53errors=continue(*) Keep going on a filesystem error.
55errors=remount-ro Remount the filesystem read-only on an error. 54errors=remount-ro Remount the filesystem read-only on an error.
56errors=panic Panic and halt the machine if an error occurs. 55errors=panic Panic and halt the machine if an error occurs.
@@ -71,6 +70,13 @@ order=strict Apply strict in-order semantics that preserves sequence
71 blocks. That means, it is guaranteed that no 70 blocks. That means, it is guaranteed that no
72 overtaking of events occurs in the recovered file 71 overtaking of events occurs in the recovered file
73 system after a crash. 72 system after a crash.
73norecovery Disable recovery of the filesystem on mount.
74 This disables every write access on the device for
75 read-only mounts or snapshots. This option will fail
76 for r/w mounts on an unclean volume.
77discard Issue discard/TRIM commands to the underlying block
78 device when blocks are freed. This is useful for SSD
79 devices and sparse/thinly-provisioned LUNs.
74 80
75NILFS2 usage 81NILFS2 usage
76============ 82============
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index c2a0871280a0..c58b9f5ba002 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -20,15 +20,16 @@ Lots of code taken from ext3 and other projects.
20Authors in alphabetical order: 20Authors in alphabetical order:
21Joel Becker <joel.becker@oracle.com> 21Joel Becker <joel.becker@oracle.com>
22Zach Brown <zach.brown@oracle.com> 22Zach Brown <zach.brown@oracle.com>
23Mark Fasheh <mark.fasheh@oracle.com> 23Mark Fasheh <mfasheh@suse.com>
24Kurt Hackel <kurt.hackel@oracle.com> 24Kurt Hackel <kurt.hackel@oracle.com>
25Tao Ma <tao.ma@oracle.com>
25Sunil Mushran <sunil.mushran@oracle.com> 26Sunil Mushran <sunil.mushran@oracle.com>
26Manish Singh <manish.singh@oracle.com> 27Manish Singh <manish.singh@oracle.com>
28Tiger Yang <tiger.yang@oracle.com>
27 29
28Caveats 30Caveats
29======= 31=======
30Features which OCFS2 does not support yet: 32Features which OCFS2 does not support yet:
31 - quotas
32 - Directory change notification (F_NOTIFY) 33 - Directory change notification (F_NOTIFY)
33 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) 34 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
34 35
@@ -70,7 +71,6 @@ commit=nrsec (*) Ocfs2 can be told to sync all its data and metadata
70 performance. 71 performance.
71localalloc=8(*) Allows custom localalloc size in MB. If the value is too 72localalloc=8(*) Allows custom localalloc size in MB. If the value is too
72 large, the fs will silently revert it to the default. 73 large, the fs will silently revert it to the default.
73 Localalloc is not enabled for local mounts.
74localflocks This disables cluster aware flock. 74localflocks This disables cluster aware flock.
75inode64 Indicates that Ocfs2 is allowed to create inodes at 75inode64 Indicates that Ocfs2 is allowed to create inodes at
76 any location in the filesystem, including those which 76 any location in the filesystem, including those which
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 92b888d540a6..a7e9746ee7ea 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -140,7 +140,7 @@ Callers of notify_change() need ->i_mutex now.
140New super_block field "struct export_operations *s_export_op" for 140New super_block field "struct export_operations *s_export_op" for
141explicit support for exporting, e.g. via NFS. The structure is fully 141explicit support for exporting, e.g. via NFS. The structure is fully
142documented at its declaration in include/linux/fs.h, and in 142documented at its declaration in include/linux/fs.h, and in
143Documentation/filesystems/Exporting. 143Documentation/filesystems/nfs/Exporting.
144 144
145Briefly it allows for the definition of decode_fh and encode_fh operations 145Briefly it allows for the definition of decode_fh and encode_fh operations
146to encode and decode filehandles, and allows the filesystem to use 146to encode and decode filehandles, and allows the filesystem to use
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index b5aee7838a00..a4f30faa4f1f 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -38,6 +38,7 @@ Table of Contents
38 3.3 /proc/<pid>/io - Display the IO accounting fields 38 3.3 /proc/<pid>/io - Display the IO accounting fields
39 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings 39 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
40 3.5 /proc/<pid>/mountinfo - Information about mounts 40 3.5 /proc/<pid>/mountinfo - Information about mounts
41 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
41 42
42 43
43------------------------------------------------------------------------------ 44------------------------------------------------------------------------------
@@ -163,6 +164,7 @@ read the file /proc/PID/status:
163 VmExe: 68 kB 164 VmExe: 68 kB
164 VmLib: 1412 kB 165 VmLib: 1412 kB
165 VmPTE: 20 kb 166 VmPTE: 20 kb
167 VmSwap: 0 kB
166 Threads: 1 168 Threads: 1
167 SigQ: 0/28578 169 SigQ: 0/28578
168 SigPnd: 0000000000000000 170 SigPnd: 0000000000000000
@@ -176,7 +178,6 @@ read the file /proc/PID/status:
176 CapBnd: ffffffffffffffff 178 CapBnd: ffffffffffffffff
177 voluntary_ctxt_switches: 0 179 voluntary_ctxt_switches: 0
178 nonvoluntary_ctxt_switches: 1 180 nonvoluntary_ctxt_switches: 1
179 Stack usage: 12 kB
180 181
181This shows you nearly the same information you would get if you viewed it with 182This shows you nearly the same information you would get if you viewed it with
182the ps command. In fact, ps uses the proc file system to obtain its 183the ps command. In fact, ps uses the proc file system to obtain its
@@ -188,7 +189,13 @@ memory usage. Its seven fields are explained in Table 1-3. The stat file
188contains details information about the process itself. Its fields are 189contains details information about the process itself. Its fields are
189explained in Table 1-4. 190explained in Table 1-4.
190 191
191Table 1-2: Contents of the statm files (as of 2.6.30-rc7) 192(for SMP CONFIG users)
193For making accounting scalable, RSS related information are handled in
194asynchronous manner and the vaule may not be very precise. To see a precise
195snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table.
196It's slow but very precise.
197
198Table 1-2: Contents of the status files (as of 2.6.30-rc7)
192.............................................................................. 199..............................................................................
193 Field Content 200 Field Content
194 Name filename of the executable 201 Name filename of the executable
@@ -213,6 +220,7 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7)
213 VmExe size of text segment 220 VmExe size of text segment
214 VmLib size of shared library code 221 VmLib size of shared library code
215 VmPTE size of page table entries 222 VmPTE size of page table entries
223 VmSwap size of swap usage (the number of referred swapents)
216 Threads number of threads 224 Threads number of threads
217 SigQ number of signals queued/max. number for queue 225 SigQ number of signals queued/max. number for queue
218 SigPnd bitmap of pending signals for the thread 226 SigPnd bitmap of pending signals for the thread
@@ -230,7 +238,6 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7)
230 Mems_allowed_list Same as previous, but in "list format" 238 Mems_allowed_list Same as previous, but in "list format"
231 voluntary_ctxt_switches number of voluntary context switches 239 voluntary_ctxt_switches number of voluntary context switches
232 nonvoluntary_ctxt_switches number of non voluntary context switches 240 nonvoluntary_ctxt_switches number of non voluntary context switches
233 Stack usage: stack usage high water mark (round up to page size)
234.............................................................................. 241..............................................................................
235 242
236Table 1-3: Contents of the statm files (as of 2.6.8-rc3) 243Table 1-3: Contents of the statm files (as of 2.6.8-rc3)
@@ -431,6 +438,7 @@ Table 1-5: Kernel info in /proc
431 modules List of loaded modules 438 modules List of loaded modules
432 mounts Mounted filesystems 439 mounts Mounted filesystems
433 net Networking info (see text) 440 net Networking info (see text)
441 pagetypeinfo Additional page allocator information (see text) (2.5)
434 partitions Table of partitions known to the system 442 partitions Table of partitions known to the system
435 pci Deprecated info of PCI bus (new way -> /proc/bus/pci/, 443 pci Deprecated info of PCI bus (new way -> /proc/bus/pci/,
436 decoupled by lspci (2.4) 444 decoupled by lspci (2.4)
@@ -585,7 +593,7 @@ Node 0, zone DMA 0 4 5 4 4 3 ...
585Node 0, zone Normal 1 0 0 1 101 8 ... 593Node 0, zone Normal 1 0 0 1 101 8 ...
586Node 0, zone HighMem 2 0 0 1 1 0 ... 594Node 0, zone HighMem 2 0 0 1 1 0 ...
587 595
588Memory fragmentation is a problem under some workloads, and buddyinfo is a 596External fragmentation is a problem under some workloads, and buddyinfo is a
589useful tool for helping diagnose these problems. Buddyinfo will give you a 597useful tool for helping diagnose these problems. Buddyinfo will give you a
590clue as to how big an area you can safely allocate, or why a previous 598clue as to how big an area you can safely allocate, or why a previous
591allocation failed. 599allocation failed.
@@ -595,6 +603,48 @@ available. In this case, there are 0 chunks of 2^0*PAGE_SIZE available in
595ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE 603ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE
596available in ZONE_NORMAL, etc... 604available in ZONE_NORMAL, etc...
597 605
606More information relevant to external fragmentation can be found in
607pagetypeinfo.
608
609> cat /proc/pagetypeinfo
610Page block order: 9
611Pages per block: 512
612
613Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10
614Node 0, zone DMA, type Unmovable 0 0 0 1 1 1 1 1 1 1 0
615Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0
616Node 0, zone DMA, type Movable 1 1 2 1 2 1 1 0 1 0 2
617Node 0, zone DMA, type Reserve 0 0 0 0 0 0 0 0 0 1 0
618Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0
619Node 0, zone DMA32, type Unmovable 103 54 77 1 1 1 11 8 7 1 9
620Node 0, zone DMA32, type Reclaimable 0 0 2 1 0 0 0 0 1 0 0
621Node 0, zone DMA32, type Movable 169 152 113 91 77 54 39 13 6 1 452
622Node 0, zone DMA32, type Reserve 1 2 2 2 2 0 1 1 1 1 0
623Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0
624
625Number of blocks type Unmovable Reclaimable Movable Reserve Isolate
626Node 0, zone DMA 2 0 5 1 0
627Node 0, zone DMA32 41 6 967 2 0
628
629Fragmentation avoidance in the kernel works by grouping pages of different
630migrate types into the same contiguous regions of memory called page blocks.
631A page block is typically the size of the default hugepage size e.g. 2MB on
632X86-64. By keeping pages grouped based on their ability to move, the kernel
633can reclaim pages within a page block to satisfy a high-order allocation.
634
635The pagetypinfo begins with information on the size of a page block. It
636then gives the same type of information as buddyinfo except broken down
637by migrate-type and finishes with details on how many page blocks of each
638type exist.
639
640If min_free_kbytes has been tuned correctly (recommendations made by hugeadm
641from libhugetlbfs http://sourceforge.net/projects/libhugetlbfs/), one can
642make an estimate of the likely number of huge pages that can be allocated
643at a given point in time. All the "Movable" blocks should be allocatable
644unless memory has been mlock()'d. Some of the Reclaimable blocks should
645also be allocatable although a lot of filesystem metadata may have to be
646reclaimed to achieve this.
647
598.............................................................................. 648..............................................................................
599 649
600meminfo: 650meminfo:
@@ -1072,7 +1122,8 @@ second). The meanings of the columns are as follows, from left to right:
1072- irq: servicing interrupts 1122- irq: servicing interrupts
1073- softirq: servicing softirqs 1123- softirq: servicing softirqs
1074- steal: involuntary wait 1124- steal: involuntary wait
1075- guest: running a guest 1125- guest: running a normal guest
1126- guest_nice: running a niced guest
1076 1127
1077The "intr" line gives counts of interrupts serviced since boot time, for each 1128The "intr" line gives counts of interrupts serviced since boot time, for each
1078of the possible system interrupts. The first column is the total of all 1129of the possible system interrupts. The first column is the total of all
@@ -1088,8 +1139,8 @@ The "processes" line gives the number of processes and threads created, which
1088includes (but is not limited to) those created by calls to the fork() and 1139includes (but is not limited to) those created by calls to the fork() and
1089clone() system calls. 1140clone() system calls.
1090 1141
1091The "procs_running" line gives the number of processes currently running on 1142The "procs_running" line gives the total number of threads that are
1092CPUs. 1143running or ready to run (i.e., the total number of runnable threads).
1093 1144
1094The "procs_blocked" line gives the number of processes currently blocked, 1145The "procs_blocked" line gives the number of processes currently blocked,
1095waiting for I/O to complete. 1146waiting for I/O to complete.
@@ -1113,7 +1164,6 @@ Table 1-12: Files in /proc/fs/ext4/<devname>
1113.............................................................................. 1164..............................................................................
1114 File Content 1165 File Content
1115 mb_groups details of multiblock allocator buddy cache of free blocks 1166 mb_groups details of multiblock allocator buddy cache of free blocks
1116 mb_history multiblock allocation history
1117.............................................................................. 1167..............................................................................
1118 1168
1119 1169
@@ -1409,3 +1459,11 @@ For more information on mount propagation see:
1409 1459
1410 Documentation/filesystems/sharedsubtree.txt 1460 Documentation/filesystems/sharedsubtree.txt
1411 1461
1462
14633.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
1464--------------------------------------------------------
1465These files provide a method to access a tasks comm value. It also allows for
1466a task to set its own or one of its thread siblings comm value. The comm value
1467is limited in size compared to the cmdline value, so writing anything longer
1468then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
1469comm value.
diff --git a/Documentation/filesystems/seq_file.txt b/Documentation/filesystems/seq_file.txt
index 0d15ebccf5b0..a1e2e0dda907 100644
--- a/Documentation/filesystems/seq_file.txt
+++ b/Documentation/filesystems/seq_file.txt
@@ -248,9 +248,7 @@ code, that is done in the initialization code in the usual way:
248 { 248 {
249 struct proc_dir_entry *entry; 249 struct proc_dir_entry *entry;
250 250
251 entry = create_proc_entry("sequence", 0, NULL); 251 proc_create("sequence", 0, NULL, &ct_file_ops);
252 if (entry)
253 entry->proc_fops = &ct_file_ops;
254 return 0; 252 return 0;
255 } 253 }
256 254
diff --git a/Documentation/filesystems/sharedsubtree.txt b/Documentation/filesystems/sharedsubtree.txt
index 23a181074f94..fc0e39af43c3 100644
--- a/Documentation/filesystems/sharedsubtree.txt
+++ b/Documentation/filesystems/sharedsubtree.txt
@@ -837,6 +837,9 @@ replicas continue to be exactly same.
837 individual lists does not affect propagation or the way propagation 837 individual lists does not affect propagation or the way propagation
838 tree is modified by operations. 838 tree is modified by operations.
839 839
840 All vfsmounts in a peer group have the same ->mnt_master. If it is
841 non-NULL, they form a contiguous (ordered) segment of slave list.
842
840 A example propagation tree looks as shown in the figure below. 843 A example propagation tree looks as shown in the figure below.
841 [ NOTE: Though it looks like a forest, if we consider all the shared 844 [ NOTE: Though it looks like a forest, if we consider all the shared
842 mounts as a conceptual entity called 'pnode', it becomes a tree] 845 mounts as a conceptual entity called 'pnode', it becomes a tree]
@@ -874,8 +877,19 @@ replicas continue to be exactly same.
874 877
875 NOTE: The propagation tree is orthogonal to the mount tree. 878 NOTE: The propagation tree is orthogonal to the mount tree.
876 879
8808B Locking:
881
882 ->mnt_share, ->mnt_slave, ->mnt_slave_list, ->mnt_master are protected
883 by namespace_sem (exclusive for modifications, shared for reading).
884
885 Normally we have ->mnt_flags modifications serialized by vfsmount_lock.
886 There are two exceptions: do_add_mount() and clone_mnt().
887 The former modifies a vfsmount that has not been visible in any shared
888 data structures yet.
889 The latter holds namespace_sem and the only references to vfsmount
890 are in lists that can't be traversed without namespace_sem.
877 891
8788B Algorithm: 8928C Algorithm:
879 893
880 The crux of the implementation resides in rbind/move operation. 894 The crux of the implementation resides in rbind/move operation.
881 895
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index b245d524d568..931c806642c5 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -91,8 +91,8 @@ struct device_attribute {
91 const char *buf, size_t count); 91 const char *buf, size_t count);
92}; 92};
93 93
94int device_create_file(struct device *, struct device_attribute *); 94int device_create_file(struct device *, const struct device_attribute *);
95void device_remove_file(struct device *, struct device_attribute *); 95void device_remove_file(struct device *, const struct device_attribute *);
96 96
97It also defines this helper for defining device attributes: 97It also defines this helper for defining device attributes:
98 98
@@ -316,8 +316,8 @@ DEVICE_ATTR(_name, _mode, _show, _store);
316 316
317Creation/Removal: 317Creation/Removal:
318 318
319int device_create_file(struct device *device, struct device_attribute * attr); 319int device_create_file(struct device *dev, const struct device_attribute * attr);
320void device_remove_file(struct device * dev, struct device_attribute * attr); 320void device_remove_file(struct device *dev, const struct device_attribute * attr);
321 321
322 322
323- bus drivers (include/linux/device.h) 323- bus drivers (include/linux/device.h)
@@ -358,7 +358,7 @@ DRIVER_ATTR(_name, _mode, _show, _store)
358 358
359Creation/Removal: 359Creation/Removal:
360 360
361int driver_create_file(struct device_driver *, struct driver_attribute *); 361int driver_create_file(struct device_driver *, const struct driver_attribute *);
362void driver_remove_file(struct device_driver *, struct driver_attribute *); 362void driver_remove_file(struct device_driver *, const struct driver_attribute *);
363 363
364 364
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index b58b84b50fa2..eed520fd0c8e 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -102,7 +102,7 @@ shortname=lower|win95|winnt|mixed
102 winnt: emulate the Windows NT rule for display/create. 102 winnt: emulate the Windows NT rule for display/create.
103 mixed: emulate the Windows NT rule for display, 103 mixed: emulate the Windows NT rule for display,
104 emulate the Windows 95 rule for create. 104 emulate the Windows 95 rule for create.
105 Default setting is `lower'. 105 Default setting is `mixed'.
106 106
107tz=UTC -- Interpret timestamps as UTC rather than local time. 107tz=UTC -- Interpret timestamps as UTC rather than local time.
108 This option disables the conversion of timestamps 108 This option disables the conversion of timestamps
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 623f094c9d8d..3de2f32edd90 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -472,7 +472,7 @@ __sync_single_inode) to check if ->writepages has been successful in
472writing out the whole address_space. 472writing out the whole address_space.
473 473
474The Writeback tag is used by filemap*wait* and sync_page* functions, 474The Writeback tag is used by filemap*wait* and sync_page* functions,
475via wait_on_page_writeback_range, to wait for all writeback to 475via filemap_fdatawait_range, to wait for all writeback to
476complete. While waiting ->sync_page (if defined) will be called on 476complete. While waiting ->sync_page (if defined) will be called on
477each page that is found to require writeback. 477each page that is found to require writeback.
478 478
diff --git a/Documentation/flexible-arrays.txt b/Documentation/flexible-arrays.txt
index 84eb26808dee..cb8a3a00cc92 100644
--- a/Documentation/flexible-arrays.txt
+++ b/Documentation/flexible-arrays.txt
@@ -1,5 +1,5 @@
1Using flexible arrays in the kernel 1Using flexible arrays in the kernel
2Last updated for 2.6.31 2Last updated for 2.6.32
3Jonathan Corbet <corbet@lwn.net> 3Jonathan Corbet <corbet@lwn.net>
4 4
5Large contiguous memory allocations can be unreliable in the Linux kernel. 5Large contiguous memory allocations can be unreliable in the Linux kernel.
@@ -40,6 +40,13 @@ argument is passed directly to the internal memory allocation calls. With
40the current code, using flags to ask for high memory is likely to lead to 40the current code, using flags to ask for high memory is likely to lead to
41notably unpleasant side effects. 41notably unpleasant side effects.
42 42
43It is also possible to define flexible arrays at compile time with:
44
45 DEFINE_FLEX_ARRAY(name, element_size, total);
46
47This macro will result in a definition of an array with the given name; the
48element size and total will be checked for validity at compile time.
49
43Storing data into a flexible array is accomplished with a call to: 50Storing data into a flexible array is accomplished with a call to:
44 51
45 int flex_array_put(struct flex_array *array, unsigned int element_nr, 52 int flex_array_put(struct flex_array *array, unsigned int element_nr,
@@ -76,16 +83,30 @@ particular element has never been allocated.
76Note that it is possible to get back a valid pointer for an element which 83Note that it is possible to get back a valid pointer for an element which
77has never been stored in the array. Memory for array elements is allocated 84has never been stored in the array. Memory for array elements is allocated
78one page at a time; a single allocation could provide memory for several 85one page at a time; a single allocation could provide memory for several
79adjacent elements. The flexible array code does not know if a specific 86adjacent elements. Flexible array elements are normally initialized to the
80element has been written; it only knows if the associated memory is 87value FLEX_ARRAY_FREE (defined as 0x6c in <linux/poison.h>), so errors
81present. So a flex_array_get() call on an element which was never stored 88involving that number probably result from use of unstored array entries.
82in the array has the potential to return a pointer to random data. If the 89Note that, if array elements are allocated with __GFP_ZERO, they will be
83caller does not have a separate way to know which elements were actually 90initialized to zero and this poisoning will not happen.
84stored, it might be wise, at least, to add GFP_ZERO to the flags argument 91
85to ensure that all elements are zeroed. 92Individual elements in the array can be cleared with:
86 93
87There is no way to remove a single element from the array. It is possible, 94 int flex_array_clear(struct flex_array *array, unsigned int element_nr);
88though, to remove all elements with a call to: 95
96This function will set the given element to FLEX_ARRAY_FREE and return
97zero. If storage for the indicated element is not allocated for the array,
98flex_array_clear() will return -EINVAL instead. Note that clearing an
99element does not release the storage associated with it; to reduce the
100allocated size of an array, call:
101
102 int flex_array_shrink(struct flex_array *array);
103
104The return value will be the number of pages of memory actually freed.
105This function works by scanning the array for pages containing nothing but
106FLEX_ARRAY_FREE bytes, so (1) it can be expensive, and (2) it will not work
107if the array's pages are allocated with __GFP_ZERO.
108
109It is possible to remove all elements of an array with a call to:
89 110
90 void flex_array_free_parts(struct flex_array *array); 111 void flex_array_free_parts(struct flex_array *array);
91 112
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index fa4dc077ae0e..c2c6e9b39bbe 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -253,6 +253,70 @@ pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown).
253Also note that it's your responsibility to have stopped using a GPIO 253Also note that it's your responsibility to have stopped using a GPIO
254before you free it. 254before you free it.
255 255
256Considering in most cases GPIOs are actually configured right after they
257are claimed, three additional calls are defined:
258
259 /* request a single GPIO, with initial configuration specified by
260 * 'flags', identical to gpio_request() wrt other arguments and
261 * return value
262 */
263 int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
264
265 /* request multiple GPIOs in a single call
266 */
267 int gpio_request_array(struct gpio *array, size_t num);
268
269 /* release multiple GPIOs in a single call
270 */
271 void gpio_free_array(struct gpio *array, size_t num);
272
273where 'flags' is currently defined to specify the following properties:
274
275 * GPIOF_DIR_IN - to configure direction as input
276 * GPIOF_DIR_OUT - to configure direction as output
277
278 * GPIOF_INIT_LOW - as output, set initial level to LOW
279 * GPIOF_INIT_HIGH - as output, set initial level to HIGH
280
281since GPIOF_INIT_* are only valid when configured as output, so group valid
282combinations as:
283
284 * GPIOF_IN - configure as input
285 * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW
286 * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH
287
288In the future, these flags can be extended to support more properties such
289as open-drain status.
290
291Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is
292introduced to encapsulate all three fields as:
293
294 struct gpio {
295 unsigned gpio;
296 unsigned long flags;
297 const char *label;
298 };
299
300A typical example of usage:
301
302 static struct gpio leds_gpios[] = {
303 { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */
304 { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* default to OFF */
305 { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* default to OFF */
306 { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* default to OFF */
307 { ... },
308 };
309
310 err = gpio_request_one(31, GPIOF_IN, "Reset Button");
311 if (err)
312 ...
313
314 err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios));
315 if (err)
316 ...
317
318 gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios));
319
256 320
257GPIOs mapped to IRQs 321GPIOs mapped to IRQs
258-------------------- 322--------------------
@@ -380,7 +444,7 @@ rare; use gpiochip_remove() when it is unavoidable.
380 444
381Most often a gpio_chip is part of an instance-specific structure with state 445Most often a gpio_chip is part of an instance-specific structure with state
382not exposed by the GPIO interfaces, such as addressing, power management, 446not exposed by the GPIO interfaces, such as addressing, power management,
383and more. Chips such as codecs will have complex non-GPIO state, 447and more. Chips such as codecs will have complex non-GPIO state.
384 448
385Any debugfs dump method should normally ignore signals which haven't been 449Any debugfs dump method should normally ignore signals which haven't been
386requested as GPIOs. They can use gpiochip_is_requested(), which returns 450requested as GPIOs. They can use gpiochip_is_requested(), which returns
@@ -531,7 +595,14 @@ and have the following read/write attributes:
531 This file exists only if the pin can be configured as an 595 This file exists only if the pin can be configured as an
532 interrupt generating input pin. 596 interrupt generating input pin.
533 597
534GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the 598 "active_low" ... reads as either 0 (false) or 1 (true). Write
599 any nonzero value to invert the value attribute both
600 for reading and writing. Existing and subsequent
601 poll(2) support configuration via the edge attribute
602 for "rising" and "falling" edges will follow this
603 setting.
604
605GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
535controller implementing GPIOs starting at #42) and have the following 606controller implementing GPIOs starting at #42) and have the following
536read-only attributes: 607read-only attributes:
537 608
@@ -566,6 +637,8 @@ requested using gpio_request():
566 int gpio_export_link(struct device *dev, const char *name, 637 int gpio_export_link(struct device *dev, const char *name,
567 unsigned gpio) 638 unsigned gpio)
568 639
640 /* change the polarity of a GPIO node in sysfs */
641 int gpio_sysfs_set_active_low(unsigned gpio, int value);
569 642
570After a kernel driver requests a GPIO, it may only be made available in 643After a kernel driver requests a GPIO, it may only be made available in
571the sysfs interface by gpio_export(). The driver can control whether the 644the sysfs interface by gpio_export(). The driver can control whether the
@@ -580,3 +653,9 @@ After the GPIO has been exported, gpio_export_link() allows creating
580symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can 653symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can
581use this to provide the interface under their own device in sysfs with 654use this to provide the interface under their own device in sysfs with
582a descriptive name. 655a descriptive name.
656
657Drivers can use gpio_sysfs_set_active_low() to hide GPIO line polarity
658differences between boards from user space. This only affects the
659sysfs interface. Polarity change can be done both before and after
660gpio_export(), and previously enabled poll(2) support for either
661rising or falling edge will be reconfigured to follow this setting.
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru
index 87ffa0f5ec70..5eb3b9d5f0d5 100644
--- a/Documentation/hwmon/abituguru
+++ b/Documentation/hwmon/abituguru
@@ -30,7 +30,7 @@ Supported chips:
30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
31 You may also need to specify the fan_sensors option for these boards 31 You may also need to specify the fan_sensors option for these boards
32 fan_sensors=5 32 fan_sensors=5
33 2) There is a seperate abituguru3 driver for these motherboards, 33 2) There is a separate abituguru3 driver for these motherboards,
34 the abituguru (without the 3 !) driver will not work on these 34 the abituguru (without the 3 !) driver will not work on these
35 motherboards (and visa versa)! 35 motherboards (and visa versa)!
36 36
diff --git a/Documentation/hwmon/adt7411 b/Documentation/hwmon/adt7411
new file mode 100644
index 000000000000..1632960f9745
--- /dev/null
+++ b/Documentation/hwmon/adt7411
@@ -0,0 +1,42 @@
1Kernel driver adt7411
2=====================
3
4Supported chips:
5 * Analog Devices ADT7411
6 Prefix: 'adt7411'
7 Addresses scanned: 0x48, 0x4a, 0x4b
8 Datasheet: Publicly available at the Analog Devices website
9
10Author: Wolfram Sang (based on adt7470 by Darrick J. Wong)
11
12Description
13-----------
14
15This driver implements support for the Analog Devices ADT7411 chip. There may
16be other chips that implement this interface.
17
18The ADT7411 can use an I2C/SMBus compatible 2-wire interface or an
19SPI-compatible 4-wire interface. It provides a 10-bit analog to digital
20converter which measures 1 temperature, vdd and 8 input voltages. It has an
21internal temperature sensor, but an external one can also be connected (one
22loses 2 inputs then). There are high- and low-limit registers for all inputs.
23
24Check the datasheet for details.
25
26sysfs-Interface
27---------------
28
29in0_input - vdd voltage input
30in[1-8]_input - analog 1-8 input
31temp1_input - temperature input
32
33Besides standard interfaces, this driver adds (0 = off, 1 = on):
34
35 adc_ref_vdd - Use vdd as reference instead of 2.25 V
36 fast_sampling - Sample at 22.5 kHz instead of 1.4 kHz, but drop filters
37 no_average - Turn off averaging over 16 samples
38
39Notes
40-----
41
42SPI, external temperature sensor and limit registers are not supported yet.
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473
deleted file mode 100644
index 1cbf671822e2..000000000000
--- a/Documentation/hwmon/adt7473
+++ /dev/null
@@ -1,72 +0,0 @@
1Kernel driver adt7473
2======================
3
4Supported chips:
5 * Analog Devices ADT7473
6 Prefix: 'adt7473'
7 Addresses scanned: I2C 0x2C, 0x2D, 0x2E
8 Datasheet: Publicly available at the Analog Devices website
9
10Author: Darrick J. Wong
11
12Description
13-----------
14
15This driver implements support for the Analog Devices ADT7473 chip family.
16
17The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0
18specification. Using an analog to digital converter it measures three (3)
19temperatures and two (2) voltages. It has four (4) 16-bit counters for
20measuring fan speed. There are three (3) PWM outputs that can be used
21to control fan speed.
22
23A sophisticated control system for the PWM outputs is designed into the
24ADT7473 that allows fan speed to be adjusted automatically based on any of the
25three temperature sensors. Each PWM output is individually adjustable and
26programmable. Once configured, the ADT7473 will adjust the PWM outputs in
27response to the measured temperatures without further host intervention.
28This feature can also be disabled for manual control of the PWM's.
29
30Each of the measured inputs (voltage, temperature, fan speed) has
31corresponding high/low limit values. The ADT7473 will signal an ALARM if
32any measured value exceeds either limit.
33
34The ADT7473 samples all inputs continuously. The driver will not read
35the registers more often than once every other second. Further,
36configuration data is only read once per minute.
37
38Special Features
39----------------
40
41The ADT7473 have a 10-bit ADC and can therefore measure temperatures
42with 0.25 degC resolution. Temperature readings can be configured either
43for twos complement format or "Offset 64" format, wherein 63 is subtracted
44from the raw value to get the temperature value.
45
46The Analog Devices datasheet is very detailed and describes a procedure for
47determining an optimal configuration for the automatic PWM control.
48
49Configuration Notes
50-------------------
51
52Besides standard interfaces driver adds the following:
53
54* PWM Control
55
56* pwm#_auto_point1_pwm and temp#_auto_point1_temp and
57* pwm#_auto_point2_pwm and temp#_auto_point2_temp -
58
59point1: Set the pwm speed at a lower temperature bound.
60point2: Set the pwm speed at a higher temperature bound.
61
62The ADT7473 will scale the pwm between the lower and higher pwm speed when
63the temperature is between the two temperature boundaries. PWM values range
64from 0 (off) to 255 (full speed). Fan speed will be set to maximum when the
65temperature sensor associated with the PWM control exceeds temp#_max.
66
67Notes
68-----
69
70The NVIDIA binary driver presents an ADT7473 chip via an on-card i2c bus.
71Unfortunately, they fail to set the i2c adapter class, so this driver may
72fail to find the chip until the nvidia driver is patched.
diff --git a/Documentation/hwmon/adt7475 b/Documentation/hwmon/adt7475
index a2b1abec850e..0502f2b464e1 100644
--- a/Documentation/hwmon/adt7475
+++ b/Documentation/hwmon/adt7475
@@ -1,87 +1,117 @@
1This describes the interface for the ADT7475 driver: 1Kernel driver adt7475
2 2=====================
3(there are 4 fans, numbered fan1 to fan4): 3
4 4Supported chips:
5fanX_input Read the current speed of the fan (in RPMs) 5 * Analog Devices ADT7473
6fanX_min Read/write the minimum speed of the fan. Dropping 6 Prefix: 'adt7473'
7 below this sets an alarm. 7 Addresses scanned: I2C 0x2C, 0x2D, 0x2E
8 8 Datasheet: Publicly available at the On Semiconductors website
9(there are three PWMs, numbered pwm1 to pwm3): 9 * Analog Devices ADT7475
10 10 Prefix: 'adt7475'
11pwmX Read/write the current duty cycle of the PWM. Writes 11 Addresses scanned: I2C 0x2E
12 only have effect when auto mode is turned off (see 12 Datasheet: Publicly available at the On Semiconductors website
13 below). Range is 0 - 255. 13 * Analog Devices ADT7476
14 14 Prefix: 'adt7476'
15pwmX_enable Fan speed control method: 15 Addresses scanned: I2C 0x2C, 0x2D, 0x2E
16 16 Datasheet: Publicly available at the On Semiconductors website
17 0 - No control (fan at full speed) 17 * Analog Devices ADT7490
18 1 - Manual fan speed control (using pwm[1-*]) 18 Prefix: 'adt7490'
19 2 - Automatic fan speed control 19 Addresses scanned: I2C 0x2C, 0x2D, 0x2E
20 20 Datasheet: Publicly available at the On Semiconductors website
21pwmX_auto_channels_temp Select which channels affect this PWM 21
22 22Authors:
23 1 - TEMP1 controls PWM 23 Jordan Crouse
24 2 - TEMP2 controls PWM 24 Hans de Goede
25 4 - TEMP3 controls PWM 25 Darrick J. Wong (documentation)
26 6 - TEMP2 and TEMP3 control PWM 26 Jean Delvare
27 7 - All three inputs control PWM 27
28 28
29pwmX_freq Read/write the PWM frequency in Hz. The number 29Description
30 should be one of the following: 30-----------
31 31
32 11 Hz 32This driver implements support for the Analog Devices ADT7473, ADT7475,
33 14 Hz 33ADT7476 and ADT7490 chip family. The ADT7473 and ADT7475 differ only in
34 22 Hz 34minor details. The ADT7476 has additional features, including extra voltage
35 29 Hz 35measurement inputs and VID support. The ADT7490 also has additional
36 35 Hz 36features, including extra voltage measurement inputs and PECI support. All
37 44 Hz 37the supported chips will be collectively designed by the name "ADT747x" in
38 58 Hz 38the rest of this document.
39 88 Hz 39
40 40The ADT747x uses the 2-wire interface compatible with the SMBus 2.0
41pwmX_auto_point1_pwm Read/write the minimum PWM duty cycle in automatic mode 41specification. Using an analog to digital converter it measures three (3)
42 42temperatures and two (2) or more voltages. It has four (4) 16-bit counters
43pwmX_auto_point2_pwm Read/write the maximum PWM duty cycle in automatic mode 43for measuring fan speed. There are three (3) PWM outputs that can be used
44 44to control fan speed.
45(there are three temperature settings numbered temp1 to temp3): 45
46 46A sophisticated control system for the PWM outputs is designed into the
47tempX_input Read the current temperature. The value is in milli 47ADT747x that allows fan speed to be adjusted automatically based on any of the
48 degrees of Celsius. 48three temperature sensors. Each PWM output is individually adjustable and
49 49programmable. Once configured, the ADT747x will adjust the PWM outputs in
50tempX_max Read/write the upper temperature limit - exceeding this 50response to the measured temperatures without further host intervention.
51 will cause an alarm. 51This feature can also be disabled for manual control of the PWM's.
52 52
53tempX_min Read/write the lower temperature limit - exceeding this 53Each of the measured inputs (voltage, temperature, fan speed) has
54 will cause an alarm. 54corresponding high/low limit values. The ADT747x will signal an ALARM if
55 55any measured value exceeds either limit.
56tempX_offset Read/write the temperature adjustment offset 56
57 57The ADT747x samples all inputs continuously. The driver will not read
58tempX_crit Read/write the THERM limit for remote1. 58the registers more often than once every other second. Further,
59 59configuration data is only read once per minute.
60tempX_crit_hyst Set the temperature value below crit where the 60
61 fans will stay on - this helps drive the temperature 61Chip Differences Summary
62 low enough so it doesn't stay near the edge and 62------------------------
63 cause THERM to keep tripping. 63
64 64ADT7473:
65tempX_auto_point1_temp Read/write the minimum temperature where the fans will 65 * 2 voltage inputs
66 turn on in automatic mode. 66 * system acoustics optimizations (not implemented)
67 67
68tempX_auto_point2_temp Read/write the maximum temperature over which the fans 68ADT7475:
69 will run in automatic mode. tempX_auto_point1_temp 69 * 2 voltage inputs
70 and tempX_auto_point2_temp together define the 70
71 range of automatic control. 71ADT7476:
72 72 * 5 voltage inputs
73tempX_alarm Read a 1 if the max/min alarm is set 73 * VID support
74tempX_fault Read a 1 if either temp1 or temp3 diode has a fault 74
75 75ADT7490:
76(There are two voltage settings, in1 and in2): 76 * 6 voltage inputs
77 77 * 1 Imon input (not implemented)
78inX_input Read the current voltage on VCC. Value is in 78 * PECI support (not implemented)
79 millivolts. 79 * 2 GPIO pins (not implemented)
80 80 * system acoustics optimizations (not implemented)
81inX_min read/write the minimum voltage limit. 81
82 Dropping below this causes an alarm. 82Special Features
83 83----------------
84inX_max read/write the maximum voltage limit. 84
85 Exceeding this causes an alarm. 85The ADT747x has a 10-bit ADC and can therefore measure temperatures
86 86with a resolution of 0.25 degree Celsius. Temperature readings can be
87inX_alarm Read a 1 if the max/min alarm is set. 87configured either for two's complement format or "Offset 64" format,
88wherein 64 is subtracted from the raw value to get the temperature value.
89
90The datasheet is very detailed and describes a procedure for determining
91an optimal configuration for the automatic PWM control.
92
93Fan Speed Control
94-----------------
95
96The driver exposes two trip points per PWM channel.
97
98point1: Set the PWM speed at the lower temperature bound
99point2: Set the PWM speed at the higher temperature bound
100
101The ADT747x will scale the PWM linearly between the lower and higher PWM
102speed when the temperature is between the two temperature boundaries.
103Temperature boundaries are associated to temperature channels rather than
104PWM outputs, and a given PWM output can be controlled by several temperature
105channels. As a result, the ADT747x may compute more than one PWM value
106for a channel at a given time, in which case the maximum value (fastest
107fan speed) is applied. PWM values range from 0 (off) to 255 (full speed).
108
109Fan speed may be set to maximum when the temperature sensor associated with
110the PWM control exceeds temp#_max.
111
112Notes
113-----
114
115The nVidia binary driver presents an ADT7473 chip via an on-card i2c bus.
116Unfortunately, they fail to set the i2c adapter class, so this driver may
117fail to find the chip until the nvidia driver is patched.
diff --git a/Documentation/hwmon/amc6821 b/Documentation/hwmon/amc6821
new file mode 100644
index 000000000000..ced8359c50f8
--- /dev/null
+++ b/Documentation/hwmon/amc6821
@@ -0,0 +1,102 @@
1Kernel driver amc6821
2=====================
3
4Supported chips:
5 Texas Instruments AMC6821
6 Prefix: 'amc6821'
7 Addresses scanned: 0x18, 0x19, 0x1a, 0x2c, 0x2d, 0x2e, 0x4c, 0x4d, 0x4e
8 Datasheet: http://focus.ti.com/docs/prod/folders/print/amc6821.html
9
10Authors:
11 Tomaz Mertelj <tomaz.mertelj@guest.arnes.si>
12
13
14Description
15-----------
16
17This driver implements support for the Texas Instruments amc6821 chip.
18The chip has one on-chip and one remote temperature sensor and one pwm fan
19regulator.
20The pwm can be controlled either from software or automatically.
21
22The driver provides the following sensor accesses in sysfs:
23
24temp1_input ro on-chip temperature
25temp1_min rw "
26temp1_max rw "
27temp1_crit rw "
28temp1_min_alarm ro "
29temp1_max_alarm ro "
30temp1_crit_alarm ro "
31
32temp2_input ro remote temperature
33temp2_min rw "
34temp2_max rw "
35temp2_crit rw "
36temp2_min_alarm ro "
37temp2_max_alarm ro "
38temp2_crit_alarm ro "
39temp2_fault ro "
40
41fan1_input ro tachometer speed
42fan1_min rw "
43fan1_max rw "
44fan1_fault ro "
45fan1_div rw Fan divisor can be either 2 or 4.
46
47pwm1 rw pwm1
48pwm1_enable rw regulator mode, 1=open loop, 2=fan controlled
49 by remote temperature, 3=fan controlled by
50 combination of the on-chip temperature and
51 remote-sensor temperature,
52pwm1_auto_channels_temp ro 1 if pwm_enable==2, 3 if pwm_enable==3
53pwm1_auto_point1_pwm ro Hardwired to 0, shared for both
54 temperature channels.
55pwm1_auto_point2_pwm rw This value is shared for both temperature
56 channels.
57pwm1_auto_point3_pwm rw Hardwired to 255, shared for both
58 temperature channels.
59
60temp1_auto_point1_temp ro Hardwired to temp2_auto_point1_temp
61 which is rw. Below this temperature fan stops.
62temp1_auto_point2_temp rw The low-temperature limit of the proportional
63 range. Below this temperature
64 pwm1 = pwm1_auto_point2_pwm. It can go from
65 0 degree C to 124 degree C in steps of
66 4 degree C. Read it out after writing to get
67 the actual value.
68temp1_auto_point3_temp rw Above this temperature fan runs at maximum
69 speed. It can go from temp1_auto_point2_temp.
70 It can only have certain discrete values
71 which depend on temp1_auto_point2_temp and
72 pwm1_auto_point2_pwm. Read it out after
73 writing to get the actual value.
74
75temp2_auto_point1_temp rw Must be between 0 degree C and 63 degree C and
76 it defines the passive cooling temperature.
77 Below this temperature the fan stops in
78 the closed loop mode.
79temp2_auto_point2_temp rw The low-temperature limit of the proportional
80 range. Below this temperature
81 pwm1 = pwm1_auto_point2_pwm. It can go from
82 0 degree C to 124 degree C in steps
83 of 4 degree C.
84
85temp2_auto_point3_temp rw Above this temperature fan runs at maximum
86 speed. It can only have certain discrete
87 values which depend on temp2_auto_point2_temp
88 and pwm1_auto_point2_pwm. Read it out after
89 writing to get actual value.
90
91
92Module parameters
93-----------------
94
95If your board has a BIOS that initializes the amc6821 correctly, you should
96load the module with: init=0.
97
98If your board BIOS doesn't initialize the chip, or you want
99different settings, you can set the following parameters:
100init=1,
101pwminv: 0 default pwm output, 1 inverts pwm output.
102
diff --git a/Documentation/hwmon/asc7621 b/Documentation/hwmon/asc7621
new file mode 100644
index 000000000000..7287be7e1f21
--- /dev/null
+++ b/Documentation/hwmon/asc7621
@@ -0,0 +1,296 @@
1Kernel driver asc7621
2==================
3
4Supported chips:
5 Andigilog aSC7621 and aSC7621a
6 Prefix: 'asc7621'
7 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
8 Datasheet: http://www.fairview5.com/linux/asc7621/asc7621.pdf
9
10Author:
11 George Joseph
12
13Description provided by Dave Pivin @ Andigilog:
14
15Andigilog has both the PECI and pre-PECI versions of the Heceta-6, as
16Intel calls them. Heceta-6e has high frequency PWM and Heceta-6p has
17added PECI and a 4th thermal zone. The Andigilog aSC7611 is the
18Heceta-6e part and aSC7621 is the Heceta-6p part. They are both in
19volume production, shipping to Intel and their subs.
20
21We have enhanced both parts relative to the governing Intel
22specification. First enhancement is temperature reading resolution. We
23have used registers below 20h for vendor-specific functions in addition
24to those in the Intel-specified vendor range.
25
26Our conversion process produces a result that is reported as two bytes.
27The fan speed control uses this finer value to produce a "step-less" fan
28PWM output. These two bytes are "read-locked" to guarantee that once a
29high or low byte is read, the other byte is locked-in until after the
30next read of any register. So to get an atomic reading, read high or low
31byte, then the very next read should be the opposite byte. Our data
32sheet says 10-bits of resolution, although you may find the lower bits
33are active, they are not necessarily reliable or useful externally. We
34chose not to mask them.
35
36We employ significant filtering that is user tunable as described in the
37data sheet. Our temperature reports and fan PWM outputs are very smooth
38when compared to the competition, in addition to the higher resolution
39temperature reports. The smoother PWM output does not require user
40intervention.
41
42We offer GPIO features on the former VID pins. These are open-drain
43outputs or inputs and may be used as general purpose I/O or as alarm
44outputs that are based on temperature limits. These are in 19h and 1Ah.
45
46We offer flexible mapping of temperature readings to thermal zones. Any
47temperature may be mapped to any zone, which has a default assignment
48that follows Intel's specs.
49
50Since there is a fan to zone assignment that allows for the "hotter" of
51a set of zones to control the PWM of an individual fan, but there is no
52indication to the user, we have added an indicator that shows which zone
53is currently controlling the PWM for a given fan. This is in register
5400h.
55
56Both remote diode temperature readings may be given an offset value such
57that the reported reading as well as the temperature used to determine
58PWM may be offset for system calibration purposes.
59
60PECI Extended configuration allows for having more than two domains per
61PECI address and also provides an enabling function for each PECI
62address. One could use our flexible zone assignment to have a zone
63assigned to up to 4 PECI addresses. This is not possible in the default
64Intel configuration. This would be useful in multi-CPU systems with
65individual fans on each that would benefit from individual fan control.
66This is in register 0Eh.
67
68The tachometer measurement system is flexible and able to adapt to many
69fan types. We can also support pulse-stretched PWM so that 3-wire fans
70may be used. These characteristics are in registers 04h to 07h.
71
72Finally, we have added a tach disable function that turns off the tach
73measurement system for individual tachs in order to save power. That is
74in register 75h.
75
76--
77aSC7621 Product Description
78
79The aSC7621 has a two wire digital interface compatible with SMBus 2.0.
80Using a 10-bit ADC, the aSC7621 measures the temperature of two remote diode
81connected transistors as well as its own die. Support for Platform
82Environmental Control Interface (PECI) is included.
83
84Using temperature information from these four zones, an automatic fan speed
85control algorithm is employed to minimize acoustic impact while achieving
86recommended CPU temperature under varying operational loads.
87
88To set fan speed, the aSC7621 has three independent pulse width modulation
89(PWM) outputs that are controlled by one, or a combination of three,
90temperature zones. Both high- and low-frequency PWM ranges are supported.
91
92The aSC7621 also includes a digital filter that can be invoked to smooth
93temperature readings for better control of fan speed and minimum acoustic
94impact.
95
96The aSC7621 has tachometer inputs to measure fan speed on up to four fans.
97Limit and status registers for all measured values are included to alert
98the system host that any measurements are outside of programmed limits
99via status registers.
100
101System voltages of VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard power are
102monitored efficiently with internal scaling resistors.
103
104Features
105- Supports PECI interface and monitors internal and remote thermal diodes
106- 2-wire, SMBus 2.0 compliant, serial interface
107- 10-bit ADC
108- Monitors VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard/processor supplies
109- Programmable autonomous fan control based on temperature readings
110- Noise filtering of temperature reading for fan speed control
111- 0.25C digital temperature sensor resolution
112- 3 PWM fan speed control outputs for 2-, 3- or 4-wire fans and up to 4 fan
113 tachometer inputs
114- Enhanced measured temperature to Temperature Zone assignment.
115- Provides high and low PWM frequency ranges
116- 3 GPIO pins for custom use
117- 24-Lead QSOP package
118
119Configuration Notes
120===================
121
122Except where noted below, the sysfs entries created by this driver follow
123the standards defined in "sysfs-interface".
124
125temp1_source
126 0 (default) peci_legacy = 0, Remote 1 Temperature
127 peci_legacy = 1, PECI Processor Temperature 0
128 1 Remote 1 Temperature
129 2 Remote 2 Temperature
130 3 Internal Temperature
131 4 PECI Processor Temperature 0
132 5 PECI Processor Temperature 1
133 6 PECI Processor Temperature 2
134 7 PECI Processor Temperature 3
135
136temp2_source
137 0 (default) Internal Temperature
138 1 Remote 1 Temperature
139 2 Remote 2 Temperature
140 3 Internal Temperature
141 4 PECI Processor Temperature 0
142 5 PECI Processor Temperature 1
143 6 PECI Processor Temperature 2
144 7 PECI Processor Temperature 3
145
146temp3_source
147 0 (default) Remote 2 Temperature
148 1 Remote 1 Temperature
149 2 Remote 2 Temperature
150 3 Internal Temperature
151 4 PECI Processor Temperature 0
152 5 PECI Processor Temperature 1
153 6 PECI Processor Temperature 2
154 7 PECI Processor Temperature 3
155
156temp4_source
157 0 (default) peci_legacy = 0, PECI Processor Temperature 0
158 peci_legacy = 1, Remote 1 Temperature
159 1 Remote 1 Temperature
160 2 Remote 2 Temperature
161 3 Internal Temperature
162 4 PECI Processor Temperature 0
163 5 PECI Processor Temperature 1
164 6 PECI Processor Temperature 2
165 7 PECI Processor Temperature 3
166
167temp[1-4]_smoothing_enable
168temp[1-4]_smoothing_time
169 Smooths spikes in temp readings caused by noise.
170 Valid values in milliseconds are:
171 35000
172 17600
173 11800
174 7000
175 4400
176 3000
177 1600
178 800
179
180temp[1-4]_crit
181 When the corresponding zone temperature reaches this value,
182 ALL pwm outputs will got to 100%.
183
184temp[5-8]_input
185temp[5-8]_enable
186 The aSC7621 can also read temperatures provided by the processor
187 via the PECI bus. Usually these are "core" temps and are relative
188 to the point where the automatic thermal control circuit starts
189 throttling. This means that these are usually negative numbers.
190
191pwm[1-3]_enable
192 0 Fan off.
193 1 Fan on manual control.
194 2 Fan on automatic control and will run at the minimum pwm
195 if the temperature for the zone is below the minimum.
196 3 Fan on automatic control but will be off if the temperature
197 for the zone is below the minimum.
198 4-254 Ignored.
199 255 Fan on full.
200
201pwm[1-3]_auto_channels
202 Bitmap as described in sysctl-interface with the following
203 exceptions...
204 Only the following combination of zones (and their corresponding masks)
205 are valid:
206 1
207 2
208 3
209 2,3
210 1,2,3
211 4
212 1,2,3,4
213
214 Special values:
215 0 Disabled.
216 16 Fan on manual control.
217 31 Fan on full.
218
219
220pwm[1-3]_invert
221 When set, inverts the meaning of pwm[1-3].
222 i.e. when pwm = 0, the fan will be on full and
223 when pwm = 255 the fan will be off.
224
225pwm[1-3]_freq
226 PWM frequency in Hz
227 Valid values in Hz are:
228
229 10
230 15
231 23
232 30 (default)
233 38
234 47
235 62
236 94
237 23000
238 24000
239 25000
240 26000
241 27000
242 28000
243 29000
244 30000
245
246 Setting any other value will be ignored.
247
248peci_enable
249 Enables or disables PECI
250
251peci_avg
252 Input filter average time.
253
254 0 0 Sec. (no Smoothing) (default)
255 1 0.25 Sec.
256 2 0.5 Sec.
257 3 1.0 Sec.
258 4 2.0 Sec.
259 5 4.0 Sec.
260 6 8.0 Sec.
261 7 0.0 Sec.
262
263peci_legacy
264
265 0 Standard Mode (default)
266 Remote Diode 1 reading is associated with
267 Temperature Zone 1, PECI is associated with
268 Zone 4
269
270 1 Legacy Mode
271 PECI is associated with Temperature Zone 1,
272 Remote Diode 1 is associated with Zone 4
273
274peci_diode
275 Diode filter
276
277 0 0.25 Sec.
278 1 1.1 Sec.
279 2 2.4 Sec. (default)
280 3 3.4 Sec.
281 4 5.0 Sec.
282 5 6.8 Sec.
283 6 10.2 Sec.
284 7 16.4 Sec.
285
286peci_4domain
287 Four domain enable
288
289 0 1 or 2 Domains for enabled processors (default)
290 1 3 or 4 Domains for enabled processors
291
292peci_domain
293 Domain
294
295 0 Processor contains a single domain (0) (default)
296 1 Processor contains two domains (0,1)
diff --git a/Documentation/hwmon/f71882fg b/Documentation/hwmon/f71882fg
index bee4c30bc1e2..a7952c2bd959 100644
--- a/Documentation/hwmon/f71882fg
+++ b/Documentation/hwmon/f71882fg
@@ -14,6 +14,10 @@ Supported chips:
14 Prefix: 'f71882fg' 14 Prefix: 'f71882fg'
15 Addresses scanned: none, address read from Super I/O config space 15 Addresses scanned: none, address read from Super I/O config space
16 Datasheet: Available from the Fintek website 16 Datasheet: Available from the Fintek website
17 * Fintek F71889FG
18 Prefix: 'f71889fg'
19 Addresses scanned: none, address read from Super I/O config space
20 Datasheet: Should become available on the Fintek website soon
17 * Fintek F8000 21 * Fintek F8000
18 Prefix: 'f8000' 22 Prefix: 'f8000'
19 Addresses scanned: none, address read from Super I/O config space 23 Addresses scanned: none, address read from Super I/O config space
@@ -51,6 +55,12 @@ supported. The right one to use depends on external circuitry on the
51motherboard, so the driver assumes that the BIOS set the method 55motherboard, so the driver assumes that the BIOS set the method
52properly. 56properly.
53 57
58Note that the lowest numbered temperature zone trip point corresponds to
59to the border between the highest and one but highest temperature zones, and
60vica versa. So the temperature zone trip points 1-4 (or 1-2) go from high temp
61to low temp! This is how things are implemented in the IC, and the driver
62mimicks this.
63
54There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC 64There are 2 modes to specify the speed of the fan, PWM duty cycle (or DC
55voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM 65voltage) mode, where 0-100% duty cycle (0-100% of 12V) is specified. And RPM
56mode where the actual RPM of the fan (as measured) is controlled and the speed 66mode where the actual RPM of the fan (as measured) is controlled and the speed
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index 659315d98e00..8d08bf0d38ed 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -5,31 +5,23 @@ Supported chips:
5 * IT8705F 5 * IT8705F
6 Prefix: 'it87' 6 Prefix: 'it87'
7 Addresses scanned: from Super I/O config space (8 I/O ports) 7 Addresses scanned: from Super I/O config space (8 I/O ports)
8 Datasheet: Publicly available at the ITE website 8 Datasheet: Once publicly available at the ITE website, but no longer
9 http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf
10 * IT8712F 9 * IT8712F
11 Prefix: 'it8712' 10 Prefix: 'it8712'
12 Addresses scanned: from Super I/O config space (8 I/O ports) 11 Addresses scanned: from Super I/O config space (8 I/O ports)
13 Datasheet: Publicly available at the ITE website 12 Datasheet: Once publicly available at the ITE website, but no longer
14 http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.1.pdf
15 http://www.ite.com.tw/product_info/file/pc/Errata%20V0.1%20for%20IT8712F%20V0.9.1.pdf
16 http://www.ite.com.tw/product_info/file/pc/IT8712F_V0.9.3.pdf
17 * IT8716F/IT8726F 13 * IT8716F/IT8726F
18 Prefix: 'it8716' 14 Prefix: 'it8716'
19 Addresses scanned: from Super I/O config space (8 I/O ports) 15 Addresses scanned: from Super I/O config space (8 I/O ports)
20 Datasheet: Publicly available at the ITE website 16 Datasheet: Once publicly available at the ITE website, but no longer
21 http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP
22 http://www.ite.com.tw/product_info/file/pc/IT8726F_V0.3.pdf
23 * IT8718F 17 * IT8718F
24 Prefix: 'it8718' 18 Prefix: 'it8718'
25 Addresses scanned: from Super I/O config space (8 I/O ports) 19 Addresses scanned: from Super I/O config space (8 I/O ports)
26 Datasheet: Publicly available at the ITE website 20 Datasheet: Once publicly available at the ITE website, but no longer
27 http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip
28 http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip
29 * IT8720F 21 * IT8720F
30 Prefix: 'it8720' 22 Prefix: 'it8720'
31 Addresses scanned: from Super I/O config space (8 I/O ports) 23 Addresses scanned: from Super I/O config space (8 I/O ports)
32 Datasheet: Not yet publicly available. 24 Datasheet: Not publicly available
33 * SiS950 [clone of IT8705F] 25 * SiS950 [clone of IT8705F]
34 Prefix: 'it87' 26 Prefix: 'it87'
35 Addresses scanned: from Super I/O config space (8 I/O ports) 27 Addresses scanned: from Super I/O config space (8 I/O ports)
@@ -86,7 +78,6 @@ The IT8712F and IT8716F additionally feature VID inputs, used to report
86the Vcore voltage of the processor. The early IT8712F have 5 VID pins, 78the Vcore voltage of the processor. The early IT8712F have 5 VID pins,
87the IT8716F and late IT8712F have 6. They are shared with other functions 79the IT8716F and late IT8712F have 6. They are shared with other functions
88though, so the functionality may not be available on a given system. 80though, so the functionality may not be available on a given system.
89The driver dumbly assume it is there.
90 81
91The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value 82The IT8718F and IT8720F also features VID inputs (up to 8 pins) but the value
92is stored in the Super-I/O configuration space. Due to technical limitations, 83is stored in the Super-I/O configuration space. Due to technical limitations,
@@ -137,6 +128,10 @@ registers are read whenever any data is read (unless it is less than 1.5
137seconds since the last update). This means that you can easily miss 128seconds since the last update). This means that you can easily miss
138once-only alarms. 129once-only alarms.
139 130
131Out-of-limit readings can also result in beeping, if the chip is properly
132wired and configured. Beeping can be enabled or disabled per sensor type
133(temperatures, voltages and fans.)
134
140The IT87xx only updates its values each 1.5 seconds; reading it more often 135The IT87xx only updates its values each 1.5 seconds; reading it more often
141will do no harm, but will return 'old' values. 136will do no harm, but will return 'old' values.
142 137
@@ -151,11 +146,38 @@ Fan speed control
151----------------- 146-----------------
152 147
153The fan speed control features are limited to manual PWM mode. Automatic 148The fan speed control features are limited to manual PWM mode. Automatic
154"Smart Guardian" mode control handling is not implemented. However 149"Smart Guardian" mode control handling is only implemented for older chips
155if you want to go for "manual mode" just write 1 to pwmN_enable. 150(see below.) However if you want to go for "manual mode" just write 1 to
151pwmN_enable.
156 152
157If you are only able to control the fan speed with very small PWM values, 153If you are only able to control the fan speed with very small PWM values,
158try lowering the PWM base frequency (pwm1_freq). Depending on the fan, 154try lowering the PWM base frequency (pwm1_freq). Depending on the fan,
159it may give you a somewhat greater control range. The same frequency is 155it may give you a somewhat greater control range. The same frequency is
160used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are 156used to drive all fan outputs, which is why pwm2_freq and pwm3_freq are
161read-only. 157read-only.
158
159
160Automatic fan speed control (old interface)
161-------------------------------------------
162
163The driver supports the old interface to automatic fan speed control
164which is implemented by IT8705F chips up to revision F and IT8712F
165chips up to revision G.
166
167This interface implements 4 temperature vs. PWM output trip points.
168The PWM output of trip point 4 is always the maximum value (fan running
169at full speed) while the PWM output of the other 3 trip points can be
170freely chosen. The temperature of all 4 trip points can be freely chosen.
171Additionally, trip point 1 has an hysteresis temperature attached, to
172prevent fast switching between fan on and off.
173
174The chip automatically computes the PWM output value based on the input
175temperature, based on this simple rule: if the temperature value is
176between trip point N and trip point N+1 then the PWM output value is
177the one of trip point N. The automatic control mode is less flexible
178than the manual control mode, but it reacts faster, is more robust and
179doesn't use CPU cycles.
180
181Trip points must be set properly before switching to automatic fan speed
182control mode. The driver will perform basic integrity checks before
183actually switching to automatic control mode.
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
new file mode 100644
index 000000000000..6526eee525a6
--- /dev/null
+++ b/Documentation/hwmon/k10temp
@@ -0,0 +1,65 @@
1Kernel driver k10temp
2=====================
3
4Supported chips:
5* AMD Family 10h processors:
6 Socket F: Quad-Core/Six-Core/Embedded Opteron (but see below)
7 Socket AM2+: Quad-Core Opteron, Phenom (II) X3/X4, Athlon X2 (but see below)
8 Socket AM3: Quad-Core Opteron, Athlon/Phenom II X2/X3/X4, Sempron II
9 Socket S1G3: Athlon II, Sempron, Turion II
10* AMD Family 11h processors:
11 Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
12
13 Prefix: 'k10temp'
14 Addresses scanned: PCI space
15 Datasheets:
16 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 10h Processors:
17 http://support.amd.com/us/Processor_TechDocs/31116.pdf
18 BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors:
19 http://support.amd.com/us/Processor_TechDocs/41256.pdf
20 Revision Guide for AMD Family 10h Processors:
21 http://support.amd.com/us/Processor_TechDocs/41322.pdf
22 Revision Guide for AMD Family 11h Processors:
23 http://support.amd.com/us/Processor_TechDocs/41788.pdf
24 AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks:
25 http://support.amd.com/us/Processor_TechDocs/43373.pdf
26 AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet:
27 http://support.amd.com/us/Processor_TechDocs/43374.pdf
28 AMD Family 10h Desktop Processor Power and Thermal Data Sheet:
29 http://support.amd.com/us/Processor_TechDocs/43375.pdf
30
31Author: Clemens Ladisch <clemens@ladisch.de>
32
33Description
34-----------
35
36This driver permits reading of the internal temperature sensor of AMD
37Family 10h and 11h processors.
38
39All these processors have a sensor, but on those for Socket F or AM2+,
40the sensor may return inconsistent values (erratum 319). The driver
41will refuse to load on these revisions unless you specify the "force=1"
42module parameter.
43
44Due to technical reasons, the driver can detect only the mainboard's
45socket type, not the processor's actual capabilities. Therefore, if you
46are using an AM3 processor on an AM2+ mainboard, you can safely use the
47"force=1" parameter.
48
49There is one temperature measurement value, available as temp1_input in
50sysfs. It is measured in degrees Celsius with a resolution of 1/8th degree.
51Please note that it is defined as a relative value; to quote the AMD manual:
52
53 Tctl is the processor temperature control value, used by the platform to
54 control cooling systems. Tctl is a non-physical temperature on an
55 arbitrary scale measured in degrees. It does _not_ represent an actual
56 physical temperature like die or case temperature. Instead, it specifies
57 the processor temperature relative to the point at which the system must
58 supply the maximum cooling for the processor's specified maximum case
59 temperature and maximum thermal power dissipation.
60
61The maximum value for Tctl is available in the file temp1_max.
62
63If the BIOS has enabled hardware temperature control, the threshold at
64which the processor will throttle itself to avoid damage is available in
65temp1_crit and temp1_crit_hyst.
diff --git a/Documentation/hwmon/lis3lv02d b/Documentation/hwmon/lis3lv02d
index effe949a7282..06534f25e643 100644
--- a/Documentation/hwmon/lis3lv02d
+++ b/Documentation/hwmon/lis3lv02d
@@ -3,7 +3,8 @@ Kernel driver lis3lv02d
3 3
4Supported chips: 4Supported chips:
5 5
6 * STMicroelectronics LIS3LV02DL and LIS3LV02DQ 6 * STMicroelectronics LIS3LV02DL, LIS3LV02DQ (12 bits precision)
7 * STMicroelectronics LIS302DL, LIS3L02DQ, LIS331DL (8 bits)
7 8
8Authors: 9Authors:
9 Yan Burman <burman.yan@gmail.com> 10 Yan Burman <burman.yan@gmail.com>
@@ -13,32 +14,52 @@ Authors:
13Description 14Description
14----------- 15-----------
15 16
16This driver provides support for the accelerometer found in various HP 17This driver provides support for the accelerometer found in various HP laptops
17laptops sporting the feature officially called "HP Mobile Data 18sporting the feature officially called "HP Mobile Data Protection System 3D" or
18Protection System 3D" or "HP 3D DriveGuard". It detects automatically 19"HP 3D DriveGuard". It detects automatically laptops with this sensor. Known
19laptops with this sensor. Known models (for now the HP 2133, nc6420, 20models (full list can be found in drivers/hwmon/hp_accel.c) will have their
20nc2510, nc8510, nc84x0, nw9440 and nx9420) will have their axis 21axis automatically oriented on standard way (eg: you can directly play
21automatically oriented on standard way (eg: you can directly play 22neverball). The accelerometer data is readable via
22neverball). The accelerometer data is readable via 23/sys/devices/platform/lis3lv02d. Reported values are scaled
23/sys/devices/platform/lis3lv02d. 24to mg values (1/1000th of earth gravity).
24 25
25Sysfs attributes under /sys/devices/platform/lis3lv02d/: 26Sysfs attributes under /sys/devices/platform/lis3lv02d/:
26position - 3D position that the accelerometer reports. Format: "(x,y,z)" 27position - 3D position that the accelerometer reports. Format: "(x,y,z)"
27calibrate - read: values (x, y, z) that are used as the base for input 28rate - read reports the sampling rate of the accelerometer device in HZ.
28 class device operation. 29 write changes sampling rate of the accelerometer device.
29 write: forces the base to be recalibrated with the current 30 Only values which are supported by HW are accepted.
30 position. 31selftest - performs selftest for the chip as specified by chip manufacturer.
31rate - reports the sampling rate of the accelerometer device in HZ
32 32
33This driver also provides an absolute input class device, allowing 33This driver also provides an absolute input class device, allowing
34the laptop to act as a pinball machine-esque joystick. 34the laptop to act as a pinball machine-esque joystick. Joystick device can be
35calibrated. Joystick device can be in two different modes.
36By default output values are scaled between -32768 .. 32767. In joystick raw
37mode, joystick and sysfs position entry have the same scale. There can be
38small difference due to input system fuzziness feature.
39Events are also available as input event device.
40
41Selftest is meant only for hardware diagnostic purposes. It is not meant to be
42used during normal operations. Position data is not corrupted during selftest
43but interrupt behaviour is not guaranteed to work reliably. In test mode, the
44sensing element is internally moved little bit. Selftest measures difference
45between normal mode and test mode. Chip specifications tell the acceptance
46limit for each type of the chip. Limits are provided via platform data
47to allow adjustment of the limits without a change to the actual driver.
48Seltest returns either "OK x y z" or "FAIL x y z" where x, y and z are
49measured difference between modes. Axes are not remapped in selftest mode.
50Measurement values are provided to help HW diagnostic applications to make
51final decision.
52
53On HP laptops, if the led infrastructure is activated, support for a led
54indicating disk protection will be provided as /sys/class/leds/hp::hddprotect.
35 55
36Another feature of the driver is misc device called "freefall" that 56Another feature of the driver is misc device called "freefall" that
37acts similar to /dev/rtc and reacts on free-fall interrupts received 57acts similar to /dev/rtc and reacts on free-fall interrupts received
38from the device. It supports blocking operations, poll/select and 58from the device. It supports blocking operations, poll/select and
39fasync operation modes. You must read 1 bytes from the device. The 59fasync operation modes. You must read 1 bytes from the device. The
40result is number of free-fall interrupts since the last successful 60result is number of free-fall interrupts since the last successful
41read (or 255 if number of interrupts would not fit). 61read (or 255 if number of interrupts would not fit). See the hpfall.c
62file for an example on using the device.
42 63
43 64
44Axes orientation 65Axes orientation
@@ -55,7 +76,7 @@ the accelerometer are converted into a "standard" organisation of the axes
55 * If the laptop is put upside-down, Z becomes negative 76 * If the laptop is put upside-down, Z becomes negative
56 77
57If your laptop model is not recognized (cf "dmesg"), you can send an 78If your laptop model is not recognized (cf "dmesg"), you can send an
58email to the authors to add it to the database. When reporting a new 79email to the maintainer to add it to the database. When reporting a new
59laptop, please include the output of "dmidecode" plus the value of 80laptop, please include the output of "dmidecode" plus the value of
60/sys/devices/platform/lis3lv02d/position in these four cases. 81/sys/devices/platform/lis3lv02d/position in these four cases.
61 82
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index 93d8e3d55150..6a03dd4bcc94 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -84,6 +84,10 @@ Supported chips:
84 Addresses scanned: I2C 0x4c 84 Addresses scanned: I2C 0x4c
85 Datasheet: Publicly available at the Maxim website 85 Datasheet: Publicly available at the Maxim website
86 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500 86 http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500
87 * Winbond/Nuvoton W83L771AWG/ASG
88 Prefix: 'w83l771'
89 Addresses scanned: I2C 0x4c
90 Datasheet: Not publicly available, can be requested from Nuvoton
87 91
88 92
89Author: Jean Delvare <khali@linux-fr.org> 93Author: Jean Delvare <khali@linux-fr.org>
@@ -147,6 +151,12 @@ MAX6680 and MAX6681:
147 * Selectable address 151 * Selectable address
148 * Remote sensor type selection 152 * Remote sensor type selection
149 153
154W83L771AWG/ASG
155 * The AWG and ASG variants only differ in package format.
156 * Filter and alert configuration register at 0xBF
157 * Diode ideality factor configuration (remote sensor) at 0xE3
158 * Moving average (depending on conversion rate)
159
150All temperature values are given in degrees Celsius. Resolution 160All temperature values are given in degrees Celsius. Resolution
151is 1.0 degree for the local temperature, 0.125 degree for the remote 161is 1.0 degree for the local temperature, 0.125 degree for the remote
152temperature, except for the MAX6657, MAX6658 and MAX6659 which have a 162temperature, except for the MAX6657, MAX6658 and MAX6659 which have a
@@ -163,6 +173,18 @@ The lm90 driver will not update its values more frequently than every
163other second; reading them more often will do no harm, but will return 173other second; reading them more often will do no harm, but will return
164'old' values. 174'old' values.
165 175
176SMBus Alert Support
177-------------------
178
179This driver has basic support for SMBus alert. When an alert is received,
180the status register is read and the faulty temperature channel is logged.
181
182The Analog Devices chips (ADM1032 and ADT7461) do not implement the SMBus
183alert protocol properly so additional care is needed: the ALERT output is
184disabled when an alert is received, and is re-enabled only when the alarm
185is gone. Otherwise the chip would block alerts from other chips in the bus
186as long as the alarm is active.
187
166PEC Support 188PEC Support
167----------- 189-----------
168 190
diff --git a/Documentation/hwmon/ltc4215 b/Documentation/hwmon/ltc4215
index 2e6a21eb656c..c196a1846259 100644
--- a/Documentation/hwmon/ltc4215
+++ b/Documentation/hwmon/ltc4215
@@ -22,12 +22,13 @@ Usage Notes
22----------- 22-----------
23 23
24This driver does not probe for LTC4215 devices, due to the fact that some 24This driver does not probe for LTC4215 devices, due to the fact that some
25of the possible addresses are unfriendly to probing. You will need to use 25of the possible addresses are unfriendly to probing. You will have to
26the "force" parameter to tell the driver where to find the device. 26instantiate the devices explicitly.
27 27
28Example: the following will load the driver for an LTC4215 at address 0x44 28Example: the following will load the driver for an LTC4215 at address 0x44
29on I2C bus #0: 29on I2C bus #0:
30$ modprobe ltc4215 force=0,0x44 30$ modprobe ltc4215
31$ echo ltc4215 0x44 > /sys/bus/i2c/devices/i2c-0/new_device
31 32
32 33
33Sysfs entries 34Sysfs entries
diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245
index bae7a3adc5d8..02838a47d862 100644
--- a/Documentation/hwmon/ltc4245
+++ b/Documentation/hwmon/ltc4245
@@ -23,12 +23,13 @@ Usage Notes
23----------- 23-----------
24 24
25This driver does not probe for LTC4245 devices, due to the fact that some 25This driver does not probe for LTC4245 devices, due to the fact that some
26of the possible addresses are unfriendly to probing. You will need to use 26of the possible addresses are unfriendly to probing. You will have to
27the "force" parameter to tell the driver where to find the device. 27instantiate the devices explicitly.
28 28
29Example: the following will load the driver for an LTC4245 at address 0x23 29Example: the following will load the driver for an LTC4245 at address 0x23
30on I2C bus #1: 30on I2C bus #1:
31$ modprobe ltc4245 force=1,0x23 31$ modprobe ltc4245
32$ echo ltc4245 0x23 > /sys/bus/i2c/devices/i2c-1/new_device
32 33
33 34
34Sysfs entries 35Sysfs entries
diff --git a/Documentation/hwmon/mc13783-adc b/Documentation/hwmon/mc13783-adc
new file mode 100644
index 000000000000..044531a86405
--- /dev/null
+++ b/Documentation/hwmon/mc13783-adc
@@ -0,0 +1,50 @@
1Kernel driver mc13783-adc
2=========================
3
4Supported chips:
5 * Freescale Atlas MC13783
6 Prefix: 'mc13783_adc'
7 Datasheet: http://www.freescale.com/files/rf_if/doc/data_sheet/MC13783.pdf?fsrch=1
8
9Authors:
10 Sascha Hauer <s.hauer@pengutronix.de>
11 Luotao Fu <l.fu@pengutronix.de>
12
13Description
14-----------
15
16The Freescale MC13783 is a Power Management and Audio Circuit. Among
17other things it contains a 10-bit A/D converter. The converter has 16
18channels which can be used in different modes.
19The A/D converter has a resolution of 2.25mV. Channels 0-4 have
20a dedicated meaning with chip internal scaling applied. Channels 5-7
21can be used as general purpose inputs or alternatively in a dedicated
22mode. Channels 12-15 are occupied by the touchscreen if it's active.
23
24Currently the driver only supports channels 2 and 5-15 with no alternative
25modes for channels 5-7.
26
27See this table for the meaning of the different channels and their chip
28internal scaling:
29
30Channel Signal Input Range Scaling
31-------------------------------------------------------------------------------
320 Battery Voltage (BATT) 2.50 - 4.65V -2.40V
331 Battery Current (BATT - BATTISNS) -50 - 50 mV x20
342 Application Supply (BP) 2.50 - 4.65V -2.40V
353 Charger Voltage (CHRGRAW) 0 - 10V / /5
36 0 - 20V /10
374 Charger Current (CHRGISNSP-CHRGISNSN) -0.25V - 0.25V x4
385 General Purpose ADIN5 / Battery Pack Thermistor 0 - 2.30V No
396 General Purpose ADIN6 / Backup Voltage (LICELL) 0 - 2.30V / No /
40 1.50 - 3.50V -1.20V
417 General Purpose ADIN7 / UID / Die Temperature 0 - 2.30V / No /
42 0 - 2.55V / x0.9 / No
438 General Purpose ADIN8 0 - 2.30V No
449 General Purpose ADIN9 0 - 2.30V No
4510 General Purpose ADIN10 0 - 2.30V No
4611 General Purpose ADIN11 0 - 2.30V No
4712 General Purpose TSX1 / Touchscreen X-plate 1 0 - 2.30V No
4813 General Purpose TSX2 / Touchscreen X-plate 2 0 - 2.30V No
4914 General Purpose TSY1 / Touchscreen Y-plate 1 0 - 2.30V No
5015 General Purpose TSY2 / Touchscreen Y-plate 2 0 - 2.30V No
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index dcbd502c8792..3de6b0bcb147 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -225,8 +225,6 @@ pwm[1-*]_auto_point[1-*]_temp_hyst
225 to PWM output channels. 225 to PWM output channels.
226 RW 226 RW
227 227
228OR
229
230temp[1-*]_auto_point[1-*]_pwm 228temp[1-*]_auto_point[1-*]_pwm
231temp[1-*]_auto_point[1-*]_temp 229temp[1-*]_auto_point[1-*]_temp
232temp[1-*]_auto_point[1-*]_temp_hyst 230temp[1-*]_auto_point[1-*]_temp_hyst
@@ -235,6 +233,15 @@ temp[1-*]_auto_point[1-*]_temp_hyst
235 to temperature channels. 233 to temperature channels.
236 RW 234 RW
237 235
236There is a third case where trip points are associated to both PWM output
237channels and temperature channels: the PWM values are associated to PWM
238output channels while the temperature values are associated to temperature
239channels. In that case, the result is determined by the mapping between
240temperature inputs and PWM outputs. When several temperature inputs are
241mapped to a given PWM output, this leads to several candidate PWM values.
242The actual result is up to the chip, but in general the highest candidate
243value (fastest fan speed) wins.
244
238 245
239**************** 246****************
240* Temperatures * 247* Temperatures *
@@ -353,10 +360,20 @@ power[1-*]_average Average power use
353 Unit: microWatt 360 Unit: microWatt
354 RO 361 RO
355 362
356power[1-*]_average_interval Power use averaging interval 363power[1-*]_average_interval Power use averaging interval. A poll
364 notification is sent to this file if the
365 hardware changes the averaging interval.
357 Unit: milliseconds 366 Unit: milliseconds
358 RW 367 RW
359 368
369power[1-*]_average_interval_max Maximum power use averaging interval
370 Unit: milliseconds
371 RO
372
373power[1-*]_average_interval_min Minimum power use averaging interval
374 Unit: milliseconds
375 RO
376
360power[1-*]_average_highest Historical average maximum power use 377power[1-*]_average_highest Historical average maximum power use
361 Unit: microWatt 378 Unit: microWatt
362 RO 379 RO
@@ -365,6 +382,18 @@ power[1-*]_average_lowest Historical average minimum power use
365 Unit: microWatt 382 Unit: microWatt
366 RO 383 RO
367 384
385power[1-*]_average_max A poll notification is sent to
386 power[1-*]_average when power use
387 rises above this value.
388 Unit: microWatt
389 RW
390
391power[1-*]_average_min A poll notification is sent to
392 power[1-*]_average when power use
393 sinks below this value.
394 Unit: microWatt
395 RW
396
368power[1-*]_input Instantaneous power use 397power[1-*]_input Instantaneous power use
369 Unit: microWatt 398 Unit: microWatt
370 RO 399 RO
@@ -381,6 +410,39 @@ power[1-*]_reset_history Reset input_highest, input_lowest,
381 average_highest and average_lowest. 410 average_highest and average_lowest.
382 WO 411 WO
383 412
413power[1-*]_accuracy Accuracy of the power meter.
414 Unit: Percent
415 RO
416
417power[1-*]_alarm 1 if the system is drawing more power than the
418 cap allows; 0 otherwise. A poll notification is
419 sent to this file when the power use exceeds the
420 cap. This file only appears if the cap is known
421 to be enforced by hardware.
422 RO
423
424power[1-*]_cap If power use rises above this limit, the
425 system should take action to reduce power use.
426 A poll notification is sent to this file if the
427 cap is changed by the hardware. The *_cap
428 files only appear if the cap is known to be
429 enforced by hardware.
430 Unit: microWatt
431 RW
432
433power[1-*]_cap_hyst Margin of hysteresis built around capping and
434 notification.
435 Unit: microWatt
436 RW
437
438power[1-*]_cap_max Maximum cap that can be set.
439 Unit: microWatt
440 RO
441
442power[1-*]_cap_min Minimum cap that can be set.
443 Unit: microWatt
444 RO
445
384********** 446**********
385* Energy * 447* Energy *
386********** 448**********
diff --git a/Documentation/hwmon/w83627ehf b/Documentation/hwmon/w83627ehf
index 02b74899edaf..b7e42ec4b26b 100644
--- a/Documentation/hwmon/w83627ehf
+++ b/Documentation/hwmon/w83627ehf
@@ -81,8 +81,14 @@ pwm[1-4] - this file stores PWM duty cycle or DC value (fan speed) in range:
81 0 (stop) to 255 (full) 81 0 (stop) to 255 (full)
82 82
83pwm[1-4]_enable - this file controls mode of fan/temperature control: 83pwm[1-4]_enable - this file controls mode of fan/temperature control:
84 * 1 Manual Mode, write to pwm file any value 0-255 (full speed) 84 * 1 Manual mode, write to pwm file any value 0-255 (full speed)
85 * 2 Thermal Cruise 85 * 2 "Thermal Cruise" mode
86 * 3 "Fan Speed Cruise" mode
87 * 4 "Smart Fan III" mode
88
89pwm[1-4]_mode - controls if output is PWM or DC level
90 * 0 DC output (0 - 12v)
91 * 1 PWM output
86 92
87Thermal Cruise mode 93Thermal Cruise mode
88------------------- 94-------------------
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf
index 6ee36dbafd64..44dd2bcc72bd 100644
--- a/Documentation/hwmon/w83627hf
+++ b/Documentation/hwmon/w83627hf
@@ -32,8 +32,6 @@ Authors:
32Module Parameters 32Module Parameters
33----------------- 33-----------------
34 34
35* force_addr: int
36 Initialize the ISA address of the sensors
37* force_i2c: int 35* force_i2c: int
38 Initialize the I2C address of the sensors 36 Initialize the I2C address of the sensors
39* init: int 37* init: int
@@ -70,3 +68,30 @@ doesn't help, you may just ignore the bogus VID reading with no harm done.
70For further information on this driver see the w83781d driver documentation. 68For further information on this driver see the w83781d driver documentation.
71 69
72[1] http://www.lm-sensors.org/browser/lm-sensors/trunk/doc/vid 70[1] http://www.lm-sensors.org/browser/lm-sensors/trunk/doc/vid
71
72Forcing the address
73-------------------
74
75The driver used to have a module parameter named force_addr, which could
76be used to force the base I/O address of the hardware monitoring block.
77This was meant as a workaround for mainboards with a broken BIOS. This
78module parameter is gone for technical reasons. If you need this feature,
79you can obtain the same result by using the isaset tool (part of
80lm-sensors) before loading the driver:
81
82# Enter the Super I/O config space
83isaset -y -f 0x2e 0x87
84isaset -y -f 0x2e 0x87
85
86# Select the hwmon logical device
87isaset -y 0x2e 0x2f 0x07 0x0b
88
89# Set the base I/O address (to 0x290 in this example)
90isaset -y 0x2e 0x2f 0x60 0x02
91isaset -y 0x2e 0x2f 0x61 0x90
92
93# Exit the Super-I/O config space
94isaset -y -f 0x2e 0xaa
95
96The above sequence assumes a Super-I/O config space at 0x2e/0x2f, but
970x4e/0x4f is also possible.
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801
index 81c0c59a60ea..e1bb5b261693 100644
--- a/Documentation/i2c/busses/i2c-i801
+++ b/Documentation/i2c/busses/i2c-i801
@@ -15,7 +15,8 @@ Supported adapters:
15 * Intel 82801I (ICH9) 15 * Intel 82801I (ICH9)
16 * Intel EP80579 (Tolapai) 16 * Intel EP80579 (Tolapai)
17 * Intel 82801JI (ICH10) 17 * Intel 82801JI (ICH10)
18 * Intel PCH 18 * Intel 3400/5 Series (PCH)
19 * Intel Cougar Point (PCH)
19 Datasheets: Publicly available at the Intel website 20 Datasheets: Publicly available at the Intel website
20 21
21Authors: 22Authors:
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport
index dceaba1ad930..2461c7b53b2c 100644
--- a/Documentation/i2c/busses/i2c-parport
+++ b/Documentation/i2c/busses/i2c-parport
@@ -29,6 +29,9 @@ can be easily added when needed.
29Earlier kernels defaulted to type=0 (Philips). But now, if the type 29Earlier kernels defaulted to type=0 (Philips). But now, if the type
30parameter is missing, the driver will simply fail to initialize. 30parameter is missing, the driver will simply fail to initialize.
31 31
32SMBus alert support is available on adapters which have this line properly
33connected to the parallel port's interrupt pin.
34
32 35
33Building your own adapter 36Building your own adapter
34------------------------- 37-------------------------
diff --git a/Documentation/i2c/busses/i2c-parport-light b/Documentation/i2c/busses/i2c-parport-light
index 287436478520..bdc9cbb2e0f2 100644
--- a/Documentation/i2c/busses/i2c-parport-light
+++ b/Documentation/i2c/busses/i2c-parport-light
@@ -9,3 +9,14 @@ parport handling is not an option. The drawback is a reduced portability
9and the impossibility to daisy-chain other parallel port devices. 9and the impossibility to daisy-chain other parallel port devices.
10 10
11Please see i2c-parport for documentation. 11Please see i2c-parport for documentation.
12
13Module parameters:
14
15* type: type of adapter (see i2c-parport or modinfo)
16
17* base: base I/O address
18 Default is 0x378 which is fairly common for parallel ports, at least on PC.
19
20* irq: optional IRQ
21 This must be passed if you want SMBus alert support, assuming your adapter
22 actually supports this.
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4
index c5b37c570554..ac540c71c7eb 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -8,7 +8,7 @@ Supported adapters:
8 Datasheet: Only available via NDA from ServerWorks 8 Datasheet: Only available via NDA from ServerWorks
9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges 9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
10 Datasheet: Not publicly available 10 Datasheet: Not publicly available
11 * AMD SB900 11 * AMD Hudson-2
12 Datasheet: Not publicly available 12 Datasheet: Not publicly available
13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge 13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
14 Datasheet: Publicly available at the SMSC website http://www.smsc.com 14 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/Documentation/i2c/busses/i2c-voodoo3 b/Documentation/i2c/busses/i2c-voodoo3
deleted file mode 100644
index 62d90a454d39..000000000000
--- a/Documentation/i2c/busses/i2c-voodoo3
+++ /dev/null
@@ -1,62 +0,0 @@
1Kernel driver i2c-voodoo3
2
3Supported adapters:
4 * 3dfx Voodoo3 based cards
5 * Voodoo Banshee based cards
6
7Authors:
8 Frodo Looijaard <frodol@dds.nl>,
9 Philip Edelbrock <phil@netroedge.com>,
10 Ralph Metzler <rjkm@thp.uni-koeln.de>,
11 Mark D. Studebaker <mdsxyz123@yahoo.com>
12
13Main contact: Philip Edelbrock <phil@netroedge.com>
14
15The code is based upon Ralph's test code (he did the hard stuff ;')
16
17Description
18-----------
19
20The 3dfx Voodoo3 chip contains two I2C interfaces (aka a I2C 'master' or
21'host').
22
23The first interface is used for DDC (Data Display Channel) which is a
24serial channel through the VGA monitor connector to a DDC-compliant
25monitor. This interface is defined by the Video Electronics Standards
26Association (VESA). The standards are available for purchase at
27http://www.vesa.org .
28
29The second interface is a general-purpose I2C bus. The intent by 3dfx was
30to allow manufacturers to add extra chips to the video card such as a
31TV-out chip such as the BT869 or possibly even I2C based temperature
32sensors like the ADM1021 or LM75.
33
34Stability
35---------
36
37Seems to be stable on the test machine, but needs more testing on other
38machines. Simultaneous accesses of the DDC and I2C busses may cause errors.
39
40Supported Devices
41-----------------
42
43Specifically, this driver was written and tested on the '3dfx Voodoo3 AGP
443000' which has a tv-out feature (s-video or composite). According to the
45docs and discussions, this code should work for any Voodoo3 based cards as
46well as Voodoo Banshee based cards. The DDC interface has been tested on a
47Voodoo Banshee card.
48
49Issues
50------
51
52Probably many, but it seems to work OK on my system. :')
53
54
55External Device Connection
56--------------------------
57
58The digital video input jumpers give availability to the I2C bus.
59Specifically, pins 13 and 25 (bottom row middle, and bottom right-end) are
60the I2C clock and I2C data lines, respectively. +5V and GND are probably
61also easily available making the addition of extra I2C/SMBus devices easy
62to implement.
diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub
index 0d8be1c20c16..fa4b669c166b 100644
--- a/Documentation/i2c/i2c-stub
+++ b/Documentation/i2c/i2c-stub
@@ -2,9 +2,9 @@ MODULE: i2c-stub
2 2
3DESCRIPTION: 3DESCRIPTION:
4 4
5This module is a very simple fake I2C/SMBus driver. It implements four 5This module is a very simple fake I2C/SMBus driver. It implements five
6types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, and 6types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, (r/w)
7(r/w) word data. 7word data, and (r/w) I2C block data.
8 8
9You need to provide chip addresses as a module parameter when loading this 9You need to provide chip addresses as a module parameter when loading this
10driver, which will then only react to SMBus commands to these addresses. 10driver, which will then only react to SMBus commands to these addresses.
@@ -21,8 +21,8 @@ EEPROMs, among others.
21 21
22The typical use-case is like this: 22The typical use-case is like this:
23 1. load this module 23 1. load this module
24 2. use i2cset (from lm_sensors project) to pre-load some data 24 2. use i2cset (from the i2c-tools project) to pre-load some data
25 3. load the target sensors chip driver module 25 3. load the target chip driver module
26 4. observe its behavior in the kernel log 26 4. observe its behavior in the kernel log
27 27
28There's a script named i2c-stub-from-dump in the i2c-tools package which 28There's a script named i2c-stub-from-dump in the i2c-tools package which
@@ -33,6 +33,12 @@ PARAMETERS:
33int chip_addr[10]: 33int chip_addr[10]:
34 The SMBus addresses to emulate chips at. 34 The SMBus addresses to emulate chips at.
35 35
36unsigned long functionality:
37 Functionality override, to disable some commands. See I2C_FUNC_*
38 constants in <linux/i2c.h> for the suitable values. For example,
39 value 0x1f0000 would only enable the quick, byte and byte data
40 commands.
41
36CAVEATS: 42CAVEATS:
37 43
38If your target driver polls some byte or word waiting for it to change, the 44If your target driver polls some byte or word waiting for it to change, the
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices
index c740b7b41088..e89490270aba 100644
--- a/Documentation/i2c/instantiating-devices
+++ b/Documentation/i2c/instantiating-devices
@@ -188,7 +188,7 @@ segment, the address is sufficient to uniquely identify the device to be
188deleted. 188deleted.
189 189
190Example: 190Example:
191# echo eeprom 0x50 > /sys/class/i2c-adapter/i2c-3/new_device 191# echo eeprom 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
192 192
193While this interface should only be used when in-kernel device declaration 193While this interface should only be used when in-kernel device declaration
194can't be done, there is a variety of cases where it can be helpful: 194can't be done, there is a variety of cases where it can be helpful:
diff --git a/Documentation/i2c/old-module-parameters b/Documentation/i2c/old-module-parameters
new file mode 100644
index 000000000000..8e2b629d533c
--- /dev/null
+++ b/Documentation/i2c/old-module-parameters
@@ -0,0 +1,44 @@
1I2C device driver binding control from user-space
2=================================================
3
4Up to kernel 2.6.32, many i2c drivers used helper macros provided by
5<linux/i2c.h> which created standard module parameters to let the user
6control how the driver would probe i2c buses and attach to devices. These
7parameters were known as "probe" (to let the driver probe for an extra
8address), "force" (to forcibly attach the driver to a given device) and
9"ignore" (to prevent a driver from probing a given address).
10
11With the conversion of the i2c subsystem to the standard device driver
12binding model, it became clear that these per-module parameters were no
13longer needed, and that a centralized implementation was possible. The new,
14sysfs-based interface is described in the documentation file
15"instantiating-devices", section "Method 4: Instantiate from user-space".
16
17Below is a mapping from the old module parameters to the new interface.
18
19Attaching a driver to an I2C device
20-----------------------------------
21
22Old method (module parameters):
23# modprobe <driver> probe=1,0x2d
24# modprobe <driver> force=1,0x2d
25# modprobe <driver> force_<device>=1,0x2d
26
27New method (sysfs interface):
28# echo <device> 0x2d > /sys/bus/i2c/devices/i2c-1/new_device
29
30Preventing a driver from attaching to an I2C device
31---------------------------------------------------
32
33Old method (module parameters):
34# modprobe <driver> ignore=1,0x2f
35
36New method (sysfs interface):
37# echo dummy 0x2f > /sys/bus/i2c/devices/i2c-1/new_device
38# modprobe <driver>
39
40Of course, it is important to instantiate the "dummy" device before loading
41the driver. The dummy device will be handled by i2c-core itself, preventing
42other drivers from binding to it later on. If there is a real device at the
43problematic address, and you want another driver to bind to it, then simply
44pass the name of the device in question instead of "dummy".
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol
index 9df47441f0e7..7c19d1a2bea0 100644
--- a/Documentation/i2c/smbus-protocol
+++ b/Documentation/i2c/smbus-protocol
@@ -185,6 +185,22 @@ the protocol. All ARP communications use slave address 0x61 and
185require PEC checksums. 185require PEC checksums.
186 186
187 187
188SMBus Alert
189===========
190
191SMBus Alert was introduced in Revision 1.0 of the specification.
192
193The SMBus alert protocol allows several SMBus slave devices to share a
194single interrupt pin on the SMBus master, while still allowing the master
195to know which slave triggered the interrupt.
196
197This is implemented the following way in the Linux kernel:
198* I2C bus drivers which support SMBus alert should call
199 i2c_setup_smbus_alert() to setup SMBus alert support.
200* I2C drivers for devices which can trigger SMBus alerts should implement
201 the optional alert() callback.
202
203
188I2C Block Transactions 204I2C Block Transactions
189====================== 205======================
190 206
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 7860aafb483d..3219ee0dbfef 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -44,7 +44,7 @@ static struct i2c_driver foo_driver = {
44 /* if device autodetection is needed: */ 44 /* if device autodetection is needed: */
45 .class = I2C_CLASS_SOMETHING, 45 .class = I2C_CLASS_SOMETHING,
46 .detect = foo_detect, 46 .detect = foo_detect,
47 .address_data = &addr_data, 47 .address_list = normal_i2c,
48 48
49 .shutdown = foo_shutdown, /* optional */ 49 .shutdown = foo_shutdown, /* optional */
50 .suspend = foo_suspend, /* optional */ 50 .suspend = foo_suspend, /* optional */
@@ -318,8 +318,9 @@ Plain I2C communication
318These routines read and write some bytes from/to a client. The client 318These routines read and write some bytes from/to a client. The client
319contains the i2c address, so you do not have to include it. The second 319contains the i2c address, so you do not have to include it. The second
320parameter contains the bytes to read/write, the third the number of bytes 320parameter contains the bytes to read/write, the third the number of bytes
321to read/write (must be less than the length of the buffer.) Returned is 321to read/write (must be less than the length of the buffer, also should be
322the actual number of bytes read/written. 322less than 64k since msg.len is u16.) Returned is the actual number of bytes
323read/written.
323 324
324 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, 325 int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg,
325 int num); 326 int num);
diff --git a/Documentation/infiniband/ipoib.txt b/Documentation/infiniband/ipoib.txt
index 6d40f00b358c..64eeb55d0c09 100644
--- a/Documentation/infiniband/ipoib.txt
+++ b/Documentation/infiniband/ipoib.txt
@@ -36,11 +36,11 @@ Datagram vs Connected modes
36 fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes. 36 fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes.
37 37
38 In connected mode, the IB RC (Reliable Connected) transport is used. 38 In connected mode, the IB RC (Reliable Connected) transport is used.
39 Connected mode is to takes advantage of the connected nature of the 39 Connected mode takes advantage of the connected nature of the IB
40 IB transport and allows an MTU up to the maximal IP packet size of 40 transport and allows an MTU up to the maximal IP packet size of 64K,
41 64K, which reduces the number of IP packets needed for handling 41 which reduces the number of IP packets needed for handling large UDP
42 large UDP datagrams, TCP segments, etc and increases the performance 42 datagrams, TCP segments, etc and increases the performance for large
43 for large messages. 43 messages.
44 44
45 In connected mode, the interface's UD QP is still used for multicast 45 In connected mode, the interface's UD QP is still used for multicast
46 and communication with peers that don't support connected mode. In 46 and communication with peers that don't support connected mode. In
diff --git a/Documentation/infiniband/user_mad.txt b/Documentation/infiniband/user_mad.txt
index 744687dd195b..8a366959f5cc 100644
--- a/Documentation/infiniband/user_mad.txt
+++ b/Documentation/infiniband/user_mad.txt
@@ -128,8 +128,8 @@ Setting IsSM Capability Bit
128 To create the appropriate character device files automatically with 128 To create the appropriate character device files automatically with
129 udev, a rule like 129 udev, a rule like
130 130
131 KERNEL="umad*", NAME="infiniband/%k" 131 KERNEL=="umad*", NAME="infiniband/%k"
132 KERNEL="issm*", NAME="infiniband/%k" 132 KERNEL=="issm*", NAME="infiniband/%k"
133 133
134 can be used. This will create device nodes named 134 can be used. This will create device nodes named
135 135
diff --git a/Documentation/infiniband/user_verbs.txt b/Documentation/infiniband/user_verbs.txt
index f847501e50b5..afe3f8da9018 100644
--- a/Documentation/infiniband/user_verbs.txt
+++ b/Documentation/infiniband/user_verbs.txt
@@ -58,7 +58,7 @@ Memory pinning
58 To create the appropriate character device files automatically with 58 To create the appropriate character device files automatically with
59 udev, a rule like 59 udev, a rule like
60 60
61 KERNEL="uverbs*", NAME="infiniband/%k" 61 KERNEL=="uverbs*", NAME="infiniband/%k"
62 62
63 can be used. This will create device nodes named 63 can be used. This will create device nodes named
64 64
diff --git a/Documentation/init.txt b/Documentation/init.txt
new file mode 100644
index 000000000000..535ad5e82b98
--- /dev/null
+++ b/Documentation/init.txt
@@ -0,0 +1,49 @@
1Explaining the dreaded "No init found." boot hang message
2=========================================================
3
4OK, so you've got this pretty unintuitive message (currently located
5in init/main.c) and are wondering what the H*** went wrong.
6Some high-level reasons for failure (listed roughly in order of execution)
7to load the init binary are:
8A) Unable to mount root FS
9B) init binary doesn't exist on rootfs
10C) broken console device
11D) binary exists but dependencies not available
12E) binary cannot be loaded
13
14Detailed explanations:
150) Set "debug" kernel parameter (in bootloader config file or CONFIG_CMDLINE)
16 to get more detailed kernel messages.
17A) make sure you have the correct root FS type
18 (and root= kernel parameter points to the correct partition),
19 required drivers such as storage hardware (such as SCSI or USB!)
20 and filesystem (ext3, jffs2 etc.) are builtin (alternatively as modules,
21 to be pre-loaded by an initrd)
22C) Possibly a conflict in console= setup --> initial console unavailable.
23 E.g. some serial consoles are unreliable due to serial IRQ issues (e.g.
24 missing interrupt-based configuration).
25 Try using a different console= device or e.g. netconsole= .
26D) e.g. required library dependencies of the init binary such as
27 /lib/ld-linux.so.2 missing or broken. Use readelf -d <INIT>|grep NEEDED
28 to find out which libraries are required.
29E) make sure the binary's architecture matches your hardware.
30 E.g. i386 vs. x86_64 mismatch, or trying to load x86 on ARM hardware.
31 In case you tried loading a non-binary file here (shell script?),
32 you should make sure that the script specifies an interpreter in its shebang
33 header line (#!/...) that is fully working (including its library
34 dependencies). And before tackling scripts, better first test a simple
35 non-script binary such as /bin/sh and confirm its successful execution.
36 To find out more, add code to init/main.c to display kernel_execve()s
37 return values.
38
39Please extend this explanation whenever you find new failure causes
40(after all loading the init binary is a CRITICAL and hard transition step
41which needs to be made as painless as possible), then submit patch to LKML.
42Further TODOs:
43- Implement the various run_init_process() invocations via a struct array
44 which can then store the kernel_execve() result value and on failure
45 log it all by iterating over _all_ results (very important usability fix).
46- try to make the implementation itself more helpful in general,
47 e.g. by providing additional error messages at affected places.
48
49Andreas Mohr <andi at lisas period de>
diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index a12ea3b586e6..8490480ce432 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -27,12 +27,30 @@ set of events/packets.
27 27
28A set of ABS_MT events with the desired properties is defined. The events 28A set of ABS_MT events with the desired properties is defined. The events
29are divided into categories, to allow for partial implementation. The 29are divided into categories, to allow for partial implementation. The
30minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and 30minimum set consists of ABS_MT_POSITION_X and ABS_MT_POSITION_Y, which
31ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked. If the 31allows for multiple fingers to be tracked. If the device supports it, the
32device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide the size 32ABS_MT_TOUCH_MAJOR and ABS_MT_WIDTH_MAJOR may be used to provide the size
33of the approaching finger. Anisotropy and direction may be specified with 33of the contact area and approaching finger, respectively.
34ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and ABS_MT_ORIENTATION. The 34
35ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a 35The TOUCH and WIDTH parameters have a geometrical interpretation; imagine
36looking through a window at someone gently holding a finger against the
37glass. You will see two regions, one inner region consisting of the part
38of the finger actually touching the glass, and one outer region formed by
39the perimeter of the finger. The diameter of the inner region is the
40ABS_MT_TOUCH_MAJOR, the diameter of the outer region is
41ABS_MT_WIDTH_MAJOR. Now imagine the person pressing the finger harder
42against the glass. The inner region will increase, and in general, the
43ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
44unity, is related to the finger pressure. For pressure-based devices,
45ABS_MT_PRESSURE may be used to provide the pressure on the contact area
46instead.
47
48In addition to the MAJOR parameters, the oval shape of the finger can be
49described by adding the MINOR parameters, such that MAJOR and MINOR are the
50major and minor axis of an ellipse. Finally, the orientation of the oval
51shape can be describe with the ORIENTATION parameter.
52
53The ABS_MT_TOOL_TYPE may be used to specify whether the touching tool is a
36finger or a pen or something else. Devices with more granular information 54finger or a pen or something else. Devices with more granular information
37may specify general shapes as blobs, i.e., as a sequence of rectangular 55may specify general shapes as blobs, i.e., as a sequence of rectangular
38shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices 56shapes grouped together by an ABS_MT_BLOB_ID. Finally, for the few devices
@@ -42,11 +60,9 @@ report finger tracking from hardware [5].
42Here is what a minimal event sequence for a two-finger touch would look 60Here is what a minimal event sequence for a two-finger touch would look
43like: 61like:
44 62
45 ABS_MT_TOUCH_MAJOR
46 ABS_MT_POSITION_X 63 ABS_MT_POSITION_X
47 ABS_MT_POSITION_Y 64 ABS_MT_POSITION_Y
48 SYN_MT_REPORT 65 SYN_MT_REPORT
49 ABS_MT_TOUCH_MAJOR
50 ABS_MT_POSITION_X 66 ABS_MT_POSITION_X
51 ABS_MT_POSITION_Y 67 ABS_MT_POSITION_Y
52 SYN_MT_REPORT 68 SYN_MT_REPORT
@@ -87,6 +103,12 @@ the contact. The ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR approximates
87the notion of pressure. The fingers of the hand and the palm all have 103the notion of pressure. The fingers of the hand and the palm all have
88different characteristic widths [1]. 104different characteristic widths [1].
89 105
106ABS_MT_PRESSURE
107
108The pressure, in arbitrary units, on the contact area. May be used instead
109of TOUCH and WIDTH for pressure-based devices or any device with a spatial
110signal intensity distribution.
111
90ABS_MT_ORIENTATION 112ABS_MT_ORIENTATION
91 113
92The orientation of the ellipse. The value should describe a signed quarter 114The orientation of the ellipse. The value should describe a signed quarter
@@ -170,6 +192,16 @@ There are a few devices that support trackingID in hardware. User space can
170make use of these native identifiers to reduce bandwidth and cpu usage. 192make use of these native identifiers to reduce bandwidth and cpu usage.
171 193
172 194
195Gestures
196--------
197
198In the specific application of creating gesture events, the TOUCH and WIDTH
199parameters can be used to, e.g., approximate finger pressure or distinguish
200between index finger and thumb. With the addition of the MINOR parameters,
201one can also distinguish between a sweeping finger and a pointing finger,
202and with ORIENTATION, one can detect twisting of fingers.
203
204
173Notes 205Notes
174----- 206-----
175 207
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt
index 3a6aec40c0b0..8b4129de1d2d 100644
--- a/Documentation/input/rotary-encoder.txt
+++ b/Documentation/input/rotary-encoder.txt
@@ -75,7 +75,7 @@ and the number of steps or will clamp at the maximum and zero depending on
75the configuration. 75the configuration.
76 76
77Because GPIO to IRQ mapping is platform specific, this information must 77Because GPIO to IRQ mapping is platform specific, this information must
78be given in seperately to the driver. See the example below. 78be given in separately to the driver. See the example below.
79 79
80---------<snip>--------- 80---------<snip>---------
81 81
diff --git a/Documentation/input/sentelic.txt b/Documentation/input/sentelic.txt
index f7160a2fb6a2..b35affd5c649 100644
--- a/Documentation/input/sentelic.txt
+++ b/Documentation/input/sentelic.txt
@@ -1,5 +1,5 @@
1Copyright (C) 2002-2008 Sentelic Corporation. 1Copyright (C) 2002-2010 Sentelic Corporation.
2Last update: Oct-31-2008 2Last update: Jan-13-2010
3 3
4============================================================================== 4==============================================================================
5* Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) 5* Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons)
@@ -44,7 +44,7 @@ B) MSID 6: Horizontal and Vertical scrolling.
44Packet 1 44Packet 1
45 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 45 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
46BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| 46BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
47 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|l|r|u|d| 47 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|r|l|u|d|
48 |---------------| |---------------| |---------------| |---------------| 48 |---------------| |---------------| |---------------| |---------------|
49 49
50Byte 1: Bit7 => Y overflow 50Byte 1: Bit7 => Y overflow
@@ -59,15 +59,15 @@ Byte 2: X Movement(9-bit 2's complement integers)
59Byte 3: Y Movement(9-bit 2's complement integers) 59Byte 3: Y Movement(9-bit 2's complement integers)
60Byte 4: Bit0 => the Vertical scrolling movement downward. 60Byte 4: Bit0 => the Vertical scrolling movement downward.
61 Bit1 => the Vertical scrolling movement upward. 61 Bit1 => the Vertical scrolling movement upward.
62 Bit2 => the Vertical scrolling movement rightward. 62 Bit2 => the Horizontal scrolling movement leftward.
63 Bit3 => the Vertical scrolling movement leftward. 63 Bit3 => the Horizontal scrolling movement rightward.
64 Bit4 => 1 = 4th mouse button is pressed, Forward one page. 64 Bit4 => 1 = 4th mouse button is pressed, Forward one page.
65 0 = 4th mouse button is not pressed. 65 0 = 4th mouse button is not pressed.
66 Bit5 => 1 = 5th mouse button is pressed, Backward one page. 66 Bit5 => 1 = 5th mouse button is pressed, Backward one page.
67 0 = 5th mouse button is not pressed. 67 0 = 5th mouse button is not pressed.
68 68
69C) MSID 7: 69C) MSID 7:
70# FSP uses 2 packets(8 Bytes) data to represent Absolute Position 70# FSP uses 2 packets (8 Bytes) to represent Absolute Position.
71 so we have PACKET NUMBER to identify packets. 71 so we have PACKET NUMBER to identify packets.
72 If PACKET NUMBER is 0, the packet is Packet 1. 72 If PACKET NUMBER is 0, the packet is Packet 1.
73 If PACKET NUMBER is 1, the packet is Packet 2. 73 If PACKET NUMBER is 1, the packet is Packet 2.
@@ -129,7 +129,7 @@ Byte 3: Message Type => 0x00 (Disabled)
129Byte 4: Bit7~Bit0 => Don't Care 129Byte 4: Bit7~Bit0 => Don't Care
130 130
131============================================================================== 131==============================================================================
132* Absolute position for STL3888-A0. 132* Absolute position for STL3888-Ax.
133============================================================================== 133==============================================================================
134Packet 1 (ABSOLUTE POSITION) 134Packet 1 (ABSOLUTE POSITION)
135 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 135 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
@@ -179,14 +179,14 @@ Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
179 Bit5~Bit4 => y2_g 179 Bit5~Bit4 => y2_g
180 Bit7~Bit6 => x2_g 180 Bit7~Bit6 => x2_g
181 181
182Notify Packet for STL3888-A0 182Notify Packet for STL3888-Ax
183 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 183 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
184BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| 184BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
185 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0| 185 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0|
186 |---------------| |---------------| |---------------| |---------------| 186 |---------------| |---------------| |---------------| |---------------|
187 187
188Byte 1: Bit7~Bit6 => 00, Normal data packet 188Byte 1: Bit7~Bit6 => 00, Normal data packet
189 => 01, Absolute coordination packet 189 => 01, Absolute coordinates packet
190 => 10, Notify packet 190 => 10, Notify packet
191 Bit5 => 1 191 Bit5 => 1
192 Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): 192 Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
@@ -205,15 +205,106 @@ Byte 4: Bit7 => scroll right button
205 Bit6 => scroll left button 205 Bit6 => scroll left button
206 Bit5 => scroll down button 206 Bit5 => scroll down button
207 Bit4 => scroll up button 207 Bit4 => scroll up button
208 * Note that if gesture and additional button (Bit4~Bit7) 208 * Note that if gesture and additional buttoni (Bit4~Bit7)
209 happen at the same time, the button information will not 209 happen at the same time, the button information will not
210 be sent. 210 be sent.
211 Bit3~Bit0 => Reserved
212
213Sample sequence of Multi-finger, Multi-coordinate mode:
214
215 notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
216 abs pkt 2, ..., notify packet (valid bit == 0)
217
218==============================================================================
219* Absolute position for STL3888-B0.
220==============================================================================
221Packet 1(ABSOLUTE POSITION)
222 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
223BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
224 1 |0|1|V|F|1|0|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y|
225 |---------------| |---------------| |---------------| |---------------|
226
227Byte 1: Bit7~Bit6 => 00, Normal data packet
228 => 01, Absolute coordinates packet
229 => 10, Notify packet
230 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
231 When both fingers are up, the last two reports have zero valid
232 bit.
233 Bit4 => finger up/down information. 1: finger down, 0: finger up.
234 Bit3 => 1
235 Bit2 => finger index, 0 is the first finger, 1 is the second finger.
236 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
237 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
238Byte 2: X coordinate (xpos[9:2])
239Byte 3: Y coordinate (ypos[9:2])
240Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
241 Bit3~Bit2 => X coordinate (ypos[1:0])
242 Bit4 => scroll down button
243 Bit5 => scroll up button
244 Bit6 => scroll left button
245 Bit7 => scroll right button
246
247Packet 2 (ABSOLUTE POSITION)
248 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
249BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
250 1 |0|1|V|F|1|1|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y|
251 |---------------| |---------------| |---------------| |---------------|
252
253Byte 1: Bit7~Bit6 => 00, Normal data packet
254 => 01, Absolute coordination packet
255 => 10, Notify packet
256 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
257 When both fingers are up, the last two reports have zero valid
258 bit.
259 Bit4 => finger up/down information. 1: finger down, 0: finger up.
260 Bit3 => 1
261 Bit2 => finger index, 0 is the first finger, 1 is the second finger.
262 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
263 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
264Byte 2: X coordinate (xpos[9:2])
265Byte 3: Y coordinate (ypos[9:2])
266Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
267 Bit3~Bit2 => X coordinate (ypos[1:0])
268 Bit4 => scroll down button
269 Bit5 => scroll up button
270 Bit6 => scroll left button
271 Bit7 => scroll right button
272
273Notify Packet for STL3888-B0
274 Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
275BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
276 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0|
277 |---------------| |---------------| |---------------| |---------------|
278
279Byte 1: Bit7~Bit6 => 00, Normal data packet
280 => 01, Absolute coordination packet
281 => 10, Notify packet
282 Bit5 => 1
283 Bit4 => when in absolute coordinate mode (valid when EN_PKT_GO is 1):
284 0: left button is generated by the on-pad command
285 1: left button is generated by the external button
286 Bit3 => 1
287 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
288 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
289 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
290Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
291Byte 3: Bit7~Bit6 => Don't care
292 Bit5~Bit4 => Number of fingers
293 Bit3~Bit1 => Reserved
294 Bit0 => 1: enter gesture mode; 0: leaving gesture mode
295Byte 4: Bit7 => scroll right button
296 Bit6 => scroll left button
297 Bit5 => scroll up button
298 Bit4 => scroll down button
299 * Note that if gesture and additional button(Bit4~Bit7)
300 happen at the same time, the button information will not
301 be sent.
211 Bit3~Bit0 => Reserved 302 Bit3~Bit0 => Reserved
212 303
213Sample sequence of Multi-finger, Multi-coordinate mode: 304Sample sequence of Multi-finger, Multi-coordinate mode:
214 305
215 notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, 306 notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
216 abs pkt 2, ..., notify packet(valid bit == 0) 307 abs pkt 2, ..., notify packet (valid bit == 0)
217 308
218============================================================================== 309==============================================================================
219* FSP Enable/Disable packet 310* FSP Enable/Disable packet
@@ -409,7 +500,8 @@ offset width default r/w name
409 0: read only, 1: read/write enable 500 0: read only, 1: read/write enable
410 (Note that following registers does not require clock gating being 501 (Note that following registers does not require clock gating being
411 enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e 502 enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
412 40 41 42 43.) 503 40 41 42 43. In addition to that, this bit must be 1 when gesture
504 mode is enabled)
413 505
4140x31 RW on-pad command detection 5060x31 RW on-pad command detection
415 bit7 0 RW on-pad command left button down tag 507 bit7 0 RW on-pad command left button down tag
@@ -463,6 +555,10 @@ offset width default r/w name
463 absolute coordinates; otherwise, host only receives packets with 555 absolute coordinates; otherwise, host only receives packets with
464 relative coordinate.) 556 relative coordinate.)
465 557
558 bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd
559 finger packet enable
560 0: disable, 1: enable
561
4660x43 RW on-pad control 5620x43 RW on-pad control
467 bit0 0 RW on-pad control enable 563 bit0 0 RW on-pad control enable
468 0: disable, 1: enable 564 0: disable, 1: enable
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
index 91cfdd76131e..dd5806f4fcc4 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -56,10 +56,11 @@ Following this convention is good because:
56(5) When following the convention, the driver code can use generic 56(5) When following the convention, the driver code can use generic
57 code to copy the parameters between user and kernel space. 57 code to copy the parameters between user and kernel space.
58 58
59This table lists ioctls visible from user land for Linux/i386. It contains 59This table lists ioctls visible from user land for Linux/x86. It contains
60most drivers up to 2.3.14, but I know I am missing some. 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/.
61 62
62Code Seq# Include File Comments 63Code Seq#(hex) Include File Comments
63======================================================== 64========================================================
640x00 00-1F linux/fs.h conflict! 650x00 00-1F linux/fs.h conflict!
650x00 00-1F scsi/scsi_ioctl.h conflict! 660x00 00-1F scsi/scsi_ioctl.h conflict!
@@ -69,120 +70,228 @@ Code Seq# Include File Comments
690x03 all linux/hdreg.h 700x03 all linux/hdreg.h
700x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these. 710x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
710x06 all linux/lp.h 720x06 all linux/lp.h
720x09 all linux/md.h 730x09 all linux/raid/md_u.h
740x10 00-0F drivers/char/s390/vmcp.h
730x12 all linux/fs.h 750x12 all linux/fs.h
74 linux/blkpg.h 76 linux/blkpg.h
750x1b all InfiniBand Subsystem <http://www.openib.org/> 770x1b all InfiniBand Subsystem <http://www.openib.org/>
760x20 all drivers/cdrom/cm206.h 780x20 all drivers/cdrom/cm206.h
770x22 all scsi/sg.h 790x22 all scsi/sg.h
78'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem 80'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
81'$' 00-0F linux/perf_counter.h, linux/perf_event.h
79'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl 82'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
80 <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/> 83 <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
84'2' 01-04 linux/i2o.h
85'3' 00-0F drivers/s390/char/raw3270.h conflict!
86'3' 00-1F linux/suspend_ioctls.h conflict!
87 and kernel/power/user.c
81'8' all SNP8023 advanced NIC card 88'8' all SNP8023 advanced NIC card
82 <mailto:mcr@solidum.com> 89 <mailto:mcr@solidum.com>
83'A' 00-1F linux/apm_bios.h 90'@' 00-0F linux/radeonfb.h conflict!
91'@' 00-0F drivers/video/aty/aty128fb.c conflict!
92'A' 00-1F linux/apm_bios.h conflict!
93'A' 00-0F linux/agpgart.h conflict!
94 and drivers/char/agp/compat_ioctl.h
95'A' 00-7F sound/asound.h conflict!
96'B' 00-1F linux/cciss_ioctl.h conflict!
97'B' 00-0F include/linux/pmu.h conflict!
84'B' C0-FF advanced bbus 98'B' C0-FF advanced bbus
85 <mailto:maassen@uni-freiburg.de> 99 <mailto:maassen@uni-freiburg.de>
86'C' all linux/soundcard.h 100'C' all linux/soundcard.h conflict!
101'C' 01-2F linux/capi.h conflict!
102'C' F0-FF drivers/net/wan/cosa.h conflict!
87'D' all arch/s390/include/asm/dasd.h 103'D' all arch/s390/include/asm/dasd.h
88'E' all linux/input.h 104'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
89'F' all linux/fb.h 105'D' 05 drivers/scsi/pmcraid.h
90'H' all linux/hiddev.h 106'E' all linux/input.h conflict!
91'I' all linux/isdn.h 107'E' 00-0F xen/evtchn.h conflict!
108'F' all linux/fb.h conflict!
109'F' 01-02 drivers/scsi/pmcraid.h conflict!
110'F' 20 drivers/video/fsl-diu-fb.h conflict!
111'F' 20 drivers/video/intelfb/intelfb.h conflict!
112'F' 20 linux/ivtvfb.h conflict!
113'F' 20 linux/matroxfb.h conflict!
114'F' 20 drivers/video/aty/atyfb_base.c conflict!
115'F' 00-0F video/da8xx-fb.h conflict!
116'F' 80-8F linux/arcfb.h conflict!
117'F' DD video/sstfb.h conflict!
118'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
119'G' 00-0F linux/gigaset_dev.h conflict!
120'H' 00-7F linux/hiddev.h conflict!
121'H' 00-0F linux/hidraw.h conflict!
122'H' 00-0F sound/asound.h conflict!
123'H' 20-40 sound/asound_fm.h conflict!
124'H' 80-8F sound/sfnt_info.h conflict!
125'H' 10-8F sound/emu10k1.h conflict!
126'H' 10-1F sound/sb16_csp.h conflict!
127'H' 10-1F sound/hda_hwdep.h conflict!
128'H' 40-4F sound/hdspm.h conflict!
129'H' 40-4F sound/hdsp.h conflict!
130'H' 90 sound/usb/usx2y/usb_stream.h
131'H' C0-F0 net/bluetooth/hci.h conflict!
132'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
133'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
134'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
135'I' all linux/isdn.h conflict!
136'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
137'I' 40-4F linux/mISDNif.h conflict!
92'J' 00-1F drivers/scsi/gdth_ioctl.h 138'J' 00-1F drivers/scsi/gdth_ioctl.h
93'K' all linux/kd.h 139'K' all linux/kd.h
94'L' 00-1F linux/loop.h 140'L' 00-1F linux/loop.h conflict!
95'L' 20-2F driver/usb/misc/vstusb.h 141'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict!
96'L' E0-FF linux/ppdd.h encrypted disk device driver 142'L' E0-FF linux/ppdd.h encrypted disk device driver
97 <http://linux01.gwdg.de/~alatham/ppdd.html> 143 <http://linux01.gwdg.de/~alatham/ppdd.html>
98'M' all linux/soundcard.h 144'M' all linux/soundcard.h conflict!
145'M' 01-16 mtd/mtd-abi.h conflict!
146 and drivers/mtd/mtdchar.c
147'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
148'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
99'N' 00-1F drivers/usb/scanner.h 149'N' 00-1F drivers/usb/scanner.h
100'O' 00-02 include/mtd/ubi-user.h UBI 150'O' 00-06 mtd/ubi-user.h UBI
101'P' all linux/soundcard.h 151'P' all linux/soundcard.h conflict!
152'P' 60-6F sound/sscape_ioctl.h conflict!
153'P' 00-0F drivers/usb/class/usblp.c conflict!
102'Q' all linux/soundcard.h 154'Q' all linux/soundcard.h
103'R' 00-1F linux/random.h 155'R' 00-1F linux/random.h conflict!
156'R' 01 linux/rfkill.h conflict!
157'R' 01-0F media/rds.h conflict!
158'R' C0-DF net/bluetooth/rfcomm.h
104'S' all linux/cdrom.h conflict! 159'S' all linux/cdrom.h conflict!
105'S' 80-81 scsi/scsi_ioctl.h conflict! 160'S' 80-81 scsi/scsi_ioctl.h conflict!
106'S' 82-FF scsi/scsi.h conflict! 161'S' 82-FF scsi/scsi.h conflict!
162'S' 00-7F sound/asequencer.h conflict!
107'T' all linux/soundcard.h conflict! 163'T' all linux/soundcard.h conflict!
164'T' 00-AF sound/asound.h conflict!
108'T' all arch/x86/include/asm/ioctls.h conflict! 165'T' all arch/x86/include/asm/ioctls.h conflict!
109'U' 00-EF linux/drivers/usb/usb.h 166'T' C0-DF linux/if_tun.h conflict!
110'V' all linux/vt.h 167'U' all sound/asound.h conflict!
168'U' 00-0F drivers/media/video/uvc/uvcvideo.h conflict!
169'U' 00-CF linux/uinput.h conflict!
170'U' 00-EF linux/usbdevice_fs.h
171'U' C0-CF drivers/bluetooth/hci_uart.h
172'V' all linux/vt.h conflict!
173'V' all linux/videodev2.h conflict!
174'V' C0 linux/ivtvfb.h conflict!
175'V' C0 linux/ivtv.h conflict!
176'V' C0 media/davinci/vpfe_capture.h conflict!
177'V' C0 media/si4713.h conflict!
178'V' C0-CF drivers/media/video/mxb.h conflict!
111'W' 00-1F linux/watchdog.h conflict! 179'W' 00-1F linux/watchdog.h conflict!
112'W' 00-1F linux/wanrouter.h conflict! 180'W' 00-1F linux/wanrouter.h conflict!
113'X' all linux/xfs_fs.h 181'W' 00-3F sound/asound.h conflict!
182'X' all fs/xfs/xfs_fs.h conflict!
183 and fs/xfs/linux-2.6/xfs_ioctl32.h
184 and include/linux/falloc.h
185 and linux/fs.h
186'X' all fs/ocfs2/ocfs_fs.h conflict!
187'X' 01 linux/pktcdvd.h conflict!
114'Y' all linux/cyclades.h 188'Y' all linux/cyclades.h
115'[' 00-07 linux/usb/usbtmc.h USB Test and Measurement Devices 189'Z' 14-15 drivers/message/fusion/mptctl.h
190'[' 00-07 linux/usb/tmc.h USB Test and Measurement Devices
116 <mailto:gregkh@suse.de> 191 <mailto:gregkh@suse.de>
117'a' all ATM on linux 192'a' all linux/atm*.h, linux/sonet.h ATM on linux
118 <http://lrcwww.epfl.ch/linux-atm/magic.html> 193 <http://lrcwww.epfl.ch/linux-atm/magic.html>
119'b' 00-FF bit3 vme host bridge 194'b' 00-FF conflict! bit3 vme host bridge
120 <mailto:natalia@nikhefk.nikhef.nl> 195 <mailto:natalia@nikhefk.nikhef.nl>
196'b' 00-0F media/bt819.h conflict!
197'c' all linux/cm4000_cs.h conflict!
121'c' 00-7F linux/comstats.h conflict! 198'c' 00-7F linux/comstats.h conflict!
122'c' 00-7F linux/coda.h conflict! 199'c' 00-7F linux/coda.h conflict!
123'c' 80-9F arch/s390/include/asm/chsc.h 200'c' 00-1F linux/chio.h conflict!
124'c' A0-AF arch/x86/include/asm/msr.h 201'c' 80-9F arch/s390/include/asm/chsc.h conflict!
202'c' A0-AF arch/x86/include/asm/msr.h conflict!
125'd' 00-FF linux/char/drm/drm/h conflict! 203'd' 00-FF linux/char/drm/drm/h conflict!
204'd' 02-40 pcmcia/ds.h conflict!
205'd' 10-3F drivers/media/video/dabusb.h conflict!
206'd' C0-CF drivers/media/video/saa7191.h conflict!
126'd' F0-FF linux/digi1.h 207'd' F0-FF linux/digi1.h
127'e' all linux/digi1.h conflict! 208'e' all linux/digi1.h conflict!
128'e' 00-1F net/irda/irtty.h conflict! 209'e' 00-1F drivers/net/irda/irtty-sir.h conflict!
129'f' 00-1F linux/ext2_fs.h 210'f' 00-1F linux/ext2_fs.h conflict!
130'h' 00-7F Charon filesystem 211'f' 00-1F linux/ext3_fs.h conflict!
212'f' 00-0F fs/jfs/jfs_dinode.h conflict!
213'f' 00-0F fs/ext4/ext4.h conflict!
214'f' 00-0F linux/fs.h conflict!
215'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
216'g' 00-0F linux/usb/gadgetfs.h
217'g' 20-2F linux/usb/g_printer.h
218'h' 00-7F conflict! Charon filesystem
131 <mailto:zapman@interlan.net> 219 <mailto:zapman@interlan.net>
132'i' 00-3F linux/i2o.h 220'h' 00-1F linux/hpet.h conflict!
221'i' 00-3F linux/i2o-dev.h conflict!
222'i' 0B-1F linux/ipmi.h conflict!
223'i' 80-8F linux/i8k.h
133'j' 00-3F linux/joystick.h 224'j' 00-3F linux/joystick.h
225'k' 00-0F linux/spi/spidev.h conflict!
226'k' 00-05 video/kyro.h conflict!
134'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system 227'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
135 <http://mikonos.dia.unisa.it/tcfs> 228 <http://mikonos.dia.unisa.it/tcfs>
136'l' 40-7F linux/udf_fs_i.h in development: 229'l' 40-7F linux/udf_fs_i.h in development:
137 <http://sourceforge.net/projects/linux-udf/> 230 <http://sourceforge.net/projects/linux-udf/>
138'm' 00-09 linux/mmtimer.h 231'm' 00-09 linux/mmtimer.h conflict!
139'm' all linux/mtio.h conflict! 232'm' all linux/mtio.h conflict!
140'm' all linux/soundcard.h conflict! 233'm' all linux/soundcard.h conflict!
141'm' all linux/synclink.h conflict! 234'm' all linux/synclink.h conflict!
235'm' 00-19 drivers/message/fusion/mptctl.h conflict!
236'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
142'm' 00-1F net/irda/irmod.h conflict! 237'm' 00-1F net/irda/irmod.h conflict!
143'n' 00-7F linux/ncp_fs.h 238'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
144'n' 80-8F linux/nilfs2_fs.h NILFS2 239'n' 80-8F linux/nilfs2_fs.h NILFS2
145'n' E0-FF video/matrox.h matroxfb 240'n' E0-FF linux/matroxfb.h matroxfb
146'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2 241'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
147'o' 00-03 include/mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps) 242'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
148'o' 40-41 include/mtd/ubi-user.h UBI 243'o' 40-41 mtd/ubi-user.h UBI
149'o' 01-A1 include/linux/dvb/*.h DVB 244'o' 01-A1 linux/dvb/*.h DVB
150'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this) 245'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
246'p' 00-1F linux/rtc.h conflict!
151'p' 00-3F linux/mc146818rtc.h conflict! 247'p' 00-3F linux/mc146818rtc.h conflict!
152'p' 40-7F linux/nvram.h 248'p' 40-7F linux/nvram.h
153'p' 80-9F user-space parport 249'p' 80-9F linux/ppdev.h user-space parport
154 <mailto:tim@cyberelk.net> 250 <mailto:tim@cyberelk.net>
155'p' a1-a4 linux/pps.h LinuxPPS 251'p' A1-A4 linux/pps.h LinuxPPS
156 <mailto:giometti@linux.it> 252 <mailto:giometti@linux.it>
157'q' 00-1F linux/serio.h 253'q' 00-1F linux/serio.h
158'q' 80-FF Internet PhoneJACK, Internet LineJACK 254'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
159 <http://www.quicknet.net> 255 linux/ixjuser.h <http://www.quicknet.net>
160'r' 00-1F linux/msdos_fs.h 256'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
161's' all linux/cdk.h 257's' all linux/cdk.h
162't' 00-7F linux/if_ppp.h 258't' 00-7F linux/if_ppp.h
163't' 80-8F linux/isdn_ppp.h 259't' 80-8F linux/isdn_ppp.h
260't' 90 linux/toshiba.h
164'u' 00-1F linux/smb_fs.h 261'u' 00-1F linux/smb_fs.h
165'v' 00-1F linux/ext2_fs.h conflict!
166'v' all linux/videodev.h conflict! 262'v' all linux/videodev.h conflict!
263'v' 00-1F linux/ext2_fs.h conflict!
264'v' 00-1F linux/fs.h conflict!
265'v' 00-0F linux/sonypi.h conflict!
266'v' C0-CF drivers/media/video/ov511.h conflict!
267'v' C0-DF media/pwc-ioctl.h conflict!
268'v' C0-FF linux/meye.h conflict!
269'v' C0-CF drivers/media/video/zoran/zoran.h conflict!
270'v' D0-DF drivers/media/video/cpia2/cpia2dev.h conflict!
167'w' all CERN SCI driver 271'w' all CERN SCI driver
168'y' 00-1F packet based user level communications 272'y' 00-1F packet based user level communications
169 <mailto:zapman@interlan.net> 273 <mailto:zapman@interlan.net>
170'z' 00-3F CAN bus card 274'z' 00-3F CAN bus card conflict!
171 <mailto:hdstich@connectu.ulm.circular.de> 275 <mailto:hdstich@connectu.ulm.circular.de>
172'z' 40-7F CAN bus card 276'z' 40-7F CAN bus card conflict!
173 <mailto:oe@port.de> 277 <mailto:oe@port.de>
278'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
1740x80 00-1F linux/fb.h 2790x80 00-1F linux/fb.h
1750x81 00-1F linux/videotext.h 2800x81 00-1F linux/videotext.h
2810x88 00-3F media/ovcamchip.h
1760x89 00-06 arch/x86/include/asm/sockios.h 2820x89 00-06 arch/x86/include/asm/sockios.h
1770x89 0B-DF linux/sockios.h 2830x89 0B-DF linux/sockios.h
1780x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range 2840x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
2850x89 E0-EF linux/dn.h PROTOPRIVATE range
1790x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range 2860x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
1800x8B all linux/wireless.h 2870x8B all linux/wireless.h
1810x8C 00-3F WiNRADiO driver 2880x8C 00-3F WiNRADiO driver
182 <http://www.proximity.com.au/~brian/winradio/> 289 <http://www.proximity.com.au/~brian/winradio/>
1830x90 00 drivers/cdrom/sbpcd.h 2900x90 00 drivers/cdrom/sbpcd.h
2910x92 00-0F drivers/usb/mon/mon_bin.c
1840x93 60-7F linux/auto_fs.h 2920x93 60-7F linux/auto_fs.h
1850x97 00-7F fs/ceph/ioctl.h Ceph file system 2930x94 all fs/btrfs/ioctl.h
2940x97 00-7F fs/ceph/ioctl.h Ceph file system
1860x99 00-0F 537-Addinboard driver 2950x99 00-0F 537-Addinboard driver
187 <mailto:buk@buks.ipn.de> 296 <mailto:buk@buks.ipn.de>
1880xA0 all linux/sdp/sdp.h Industrial Device Project 2970xA0 all linux/sdp/sdp.h Industrial Device Project
@@ -193,17 +302,22 @@ Code Seq# Include File Comments
1930xAB 00-1F linux/nbd.h 3020xAB 00-1F linux/nbd.h
1940xAC 00-1F linux/raw.h 3030xAC 00-1F linux/raw.h
1950xAD 00 Netfilter device in development: 3040xAD 00 Netfilter device in development:
196 <mailto:rusty@rustcorp.com.au> 305 <mailto:rusty@rustcorp.com.au>
1970xAE all linux/kvm.h Kernel-based Virtual Machine 3060xAE all linux/kvm.h Kernel-based Virtual Machine
198 <mailto:kvm@vger.kernel.org> 307 <mailto:kvm@vger.kernel.org>
1990xB0 all RATIO devices in development: 3080xB0 all RATIO devices in development:
200 <mailto:vgo@ratio.de> 309 <mailto:vgo@ratio.de>
2010xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> 3100xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca>
3110xC0 00-0F linux/usb/iowarrior.h
2020xCB 00-1F CBM serial IEC bus in development: 3120xCB 00-1F CBM serial IEC bus in development:
203 <mailto:michael.klein@puffin.lb.shuttle.de> 313 <mailto:michael.klein@puffin.lb.shuttle.de>
3140xCD 01 linux/reiserfs_fs.h
3150xCF 02 fs/cifs/ioctl.c
3160xDB 00-0F drivers/char/mwave/mwavepub.h
2040xDD 00-3F ZFCP device driver see drivers/s390/scsi/ 3170xDD 00-3F ZFCP device driver see drivers/s390/scsi/
205 <mailto:aherrman@de.ibm.com> 318 <mailto:aherrman@de.ibm.com>
2060xF3 00-3F video/sisfb.h sisfb (in development) 3190xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
207 <mailto:thomas@winischhofer.net> 320 <mailto:thomas@winischhofer.net>
2080xF4 00-1F video/mbxfb.h mbxfb 3210xF4 00-1F video/mbxfb.h mbxfb
209 <mailto:raph@8d.com> 322 <mailto:raph@8d.com>
3230xFD all linux/dm-ioctl.h
diff --git a/Documentation/isdn/INTERFACE.CAPI b/Documentation/isdn/INTERFACE.CAPI
index 686e107923ec..f172091fb7cd 100644
--- a/Documentation/isdn/INTERFACE.CAPI
+++ b/Documentation/isdn/INTERFACE.CAPI
@@ -60,10 +60,9 @@ open() operation on regular files or character devices.
60 60
61After a successful return from register_appl(), CAPI messages from the 61After a successful return from register_appl(), CAPI messages from the
62application may be passed to the driver for the device via calls to the 62application may be passed to the driver for the device via calls to the
63send_message() callback function. The CAPI message to send is stored in the 63send_message() callback function. Conversely, the driver may call Kernel
64data portion of an skb. Conversely, the driver may call Kernel CAPI's 64CAPI's capi_ctr_handle_message() function to pass a received CAPI message to
65capi_ctr_handle_message() function to pass a received CAPI message to Kernel 65Kernel CAPI for forwarding to an application, specifying its ApplID.
66CAPI for forwarding to an application, specifying its ApplID.
67 66
68Deregistration requests (CAPI operation CAPI_RELEASE) from applications are 67Deregistration requests (CAPI operation CAPI_RELEASE) from applications are
69forwarded as calls to the release_appl() callback function, passing the same 68forwarded as calls to the release_appl() callback function, passing the same
@@ -142,6 +141,7 @@ u16 (*send_message)(struct capi_ctr *ctrlr, struct sk_buff *skb)
142 to accepting or queueing the message. Errors occurring during the 141 to accepting or queueing the message. Errors occurring during the
143 actual processing of the message should be signaled with an 142 actual processing of the message should be signaled with an
144 appropriate reply message. 143 appropriate reply message.
144 May be called in process or interrupt context.
145 Calls to this function are not serialized by Kernel CAPI, ie. it must 145 Calls to this function are not serialized by Kernel CAPI, ie. it must
146 be prepared to be re-entered. 146 be prepared to be re-entered.
147 147
@@ -149,12 +149,14 @@ char *(*procinfo)(struct capi_ctr *ctrlr)
149 pointer to a callback function returning the entry for the device in 149 pointer to a callback function returning the entry for the device in
150 the CAPI controller info table, /proc/capi/controller 150 the CAPI controller info table, /proc/capi/controller
151 151
152read_proc_t *ctr_read_proc 152const struct file_operations *proc_fops
153 pointer to the read_proc callback function for the device's proc file 153 pointers to callback functions for the device's proc file
154 system entry, /proc/capi/controllers/<n>; will be called with a 154 system entry, /proc/capi/controllers/<n>; pointer to the device's
155 pointer to the device's capi_ctr structure as the last (data) argument 155 capi_ctr structure is available from struct proc_dir_entry::data
156 which is available from struct inode.
156 157
157Note: Callback functions are never called in interrupt context. 158Note: Callback functions except send_message() are never called in interrupt
159context.
158 160
159- to be filled in before calling capi_ctr_ready(): 161- to be filled in before calling capi_ctr_ready():
160 162
@@ -171,14 +173,40 @@ u8 serial[CAPI_SERIAL_LEN]
171 value to return for CAPI_GET_SERIAL 173 value to return for CAPI_GET_SERIAL
172 174
173 175
1744.3 The _cmsg Structure 1764.3 SKBs
177
178CAPI messages are passed between Kernel CAPI and the driver via send_message()
179and capi_ctr_handle_message(), stored in the data portion of a socket buffer
180(skb). Each skb contains a single CAPI message coded according to the CAPI 2.0
181standard.
182
183For the data transfer messages, DATA_B3_REQ and DATA_B3_IND, the actual
184payload data immediately follows the CAPI message itself within the same skb.
185The Data and Data64 parameters are not used for processing. The Data64
186parameter may be omitted by setting the length field of the CAPI message to 22
187instead of 30.
188
189
1904.4 The _cmsg Structure
175 191
176(declared in <linux/isdn/capiutil.h>) 192(declared in <linux/isdn/capiutil.h>)
177 193
178The _cmsg structure stores the contents of a CAPI 2.0 message in an easily 194The _cmsg structure stores the contents of a CAPI 2.0 message in an easily
179accessible form. It contains members for all possible CAPI 2.0 parameters, of 195accessible form. It contains members for all possible CAPI 2.0 parameters,
180which only those appearing in the message type currently being processed are 196including subparameters of the Additional Info and B Protocol structured
181actually used. Unused members should be set to zero. 197parameters, with the following exceptions:
198
199* second Calling party number (CONNECT_IND)
200
201* Data64 (DATA_B3_REQ and DATA_B3_IND)
202
203* Sending complete (subparameter of Additional Info, CONNECT_REQ and INFO_REQ)
204
205* Global Configuration (subparameter of B Protocol, CONNECT_REQ, CONNECT_RESP
206 and SELECT_B_PROTOCOL_REQ)
207
208Only those parameters appearing in the message type currently being processed
209are actually used. Unused members should be set to zero.
182 210
183Members are named after the CAPI 2.0 standard names of the parameters they 211Members are named after the CAPI 2.0 standard names of the parameters they
184represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data 212represent. See <linux/isdn/capiutil.h> for the exact spelling. Member data
@@ -190,18 +218,19 @@ u16 for CAPI parameters of type 'word'
190 218
191u32 for CAPI parameters of type 'dword' 219u32 for CAPI parameters of type 'dword'
192 220
193_cstruct for CAPI parameters of type 'struct' not containing any 221_cstruct for CAPI parameters of type 'struct'
194 variably-sized (struct) subparameters (eg. 'Called Party Number')
195 The member is a pointer to a buffer containing the parameter in 222 The member is a pointer to a buffer containing the parameter in
196 CAPI encoding (length + content). It may also be NULL, which will 223 CAPI encoding (length + content). It may also be NULL, which will
197 be taken to represent an empty (zero length) parameter. 224 be taken to represent an empty (zero length) parameter.
225 Subparameters are stored in encoded form within the content part.
198 226
199_cmstruct for CAPI parameters of type 'struct' containing 'struct' 227_cmstruct alternative representation for CAPI parameters of type 'struct'
200 subparameters ('Additional Info' and 'B Protocol') 228 (used only for the 'Additional Info' and 'B Protocol' parameters)
201 The representation is a single byte containing one of the values: 229 The representation is a single byte containing one of the values:
202 CAPI_DEFAULT: the parameter is empty 230 CAPI_DEFAULT: The parameter is empty/absent.
203 CAPI_COMPOSE: the values of the subparameters are stored 231 CAPI_COMPOSE: The parameter is present.
204 individually in the corresponding _cmsg structure members 232 Subparameter values are stored individually in the corresponding
233 _cmsg structure members.
205 234
206Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert 235Functions capi_cmsg2message() and capi_message2cmsg() are provided to convert
207messages between their transport encoding described in the CAPI 2.0 standard 236messages between their transport encoding described in the CAPI 2.0 standard
@@ -297,3 +326,26 @@ char *capi_cmd2str(u8 Command, u8 Subcommand)
297 be NULL if the command/subcommand is not one of those defined in the 326 be NULL if the command/subcommand is not one of those defined in the
298 CAPI 2.0 standard. 327 CAPI 2.0 standard.
299 328
329
3307. Debugging
331
332The module kernelcapi has a module parameter showcapimsgs controlling some
333debugging output produced by the module. It can only be set when the module is
334loaded, via a parameter "showcapimsgs=<n>" to the modprobe command, either on
335the command line or in the configuration file.
336
337If the lowest bit of showcapimsgs is set, kernelcapi logs controller and
338application up and down events.
339
340In addition, every registered CAPI controller has an associated traceflag
341parameter controlling how CAPI messages sent from and to tha controller are
342logged. The traceflag parameter is initialized with the value of the
343showcapimsgs parameter when the controller is registered, but can later be
344changed via the MANUFACTURER_REQ command KCAPI_CMD_TRACE.
345
346If the value of traceflag is non-zero, CAPI messages are logged.
347DATA_B3 messages are only logged if the value of traceflag is > 2.
348
349If the lowest bit of traceflag is set, only the command/subcommand and message
350length are logged. Otherwise, kernelcapi logs a readable representation of
351the entire message.
diff --git a/Documentation/isdn/README.gigaset b/Documentation/isdn/README.gigaset
index f9963103ae3d..e472df842323 100644
--- a/Documentation/isdn/README.gigaset
+++ b/Documentation/isdn/README.gigaset
@@ -5,7 +5,7 @@ GigaSet 307x Device Driver
5 ------------ 5 ------------
61.1. Hardware 61.1. Hardware
7 -------- 7 --------
8 This release supports the connection of the Gigaset 307x/417x family of 8 This driver supports the connection of the Gigaset 307x/417x family of
9 ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB 9 ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB
10 connection. The following devices are reported to be compatible: 10 connection. The following devices are reported to be compatible:
11 11
@@ -33,7 +33,7 @@ GigaSet 307x Device Driver
33 http://gigaset307x.sourceforge.net/ 33 http://gigaset307x.sourceforge.net/
34 34
35 We had also reports from users of Gigaset M105 who could use the drivers 35 We had also reports from users of Gigaset M105 who could use the drivers
36 with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.4.) 36 with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.5.)
37 If you have another device that works with our driver, please let us know. 37 If you have another device that works with our driver, please let us know.
38 38
39 Chances of getting an USB device to work are good if the output of 39 Chances of getting an USB device to work are good if the output of
@@ -49,7 +49,7 @@ GigaSet 307x Device Driver
49 -------- 49 --------
50 The driver works with ISDN4linux and so can be used with any software 50 The driver works with ISDN4linux and so can be used with any software
51 which is able to use ISDN4linux for ISDN connections (voice or data). 51 which is able to use ISDN4linux for ISDN connections (voice or data).
52 CAPI4Linux support is planned but not yet available. 52 Experimental Kernel CAPI support is available as a compilation option.
53 53
54 There are some user space tools available at 54 There are some user space tools available at
55 http://sourceforge.net/projects/gigaset307x/ 55 http://sourceforge.net/projects/gigaset307x/
@@ -68,22 +68,38 @@ GigaSet 307x Device Driver
68 for troubleshooting or to pass module parameters. 68 for troubleshooting or to pass module parameters.
69 69
70 The module ser_gigaset provides a serial line discipline N_GIGASET_M101 70 The module ser_gigaset provides a serial line discipline N_GIGASET_M101
71 which drives the device through the regular serial line driver. It must 71 which uses the regular serial port driver to access the device, and must
72 be attached to the serial line to which the M101 is connected with the 72 therefore be attached to the serial device to which the M101 is connected.
73 ldattach(8) command (requires util-linux-ng release 2.14 or later), for 73 The ldattach(8) command (included in util-linux-ng release 2.14 or later)
74 example: 74 can be used for that purpose, for example:
75 ldattach GIGASET_M101 /dev/ttyS1 75 ldattach GIGASET_M101 /dev/ttyS1
76 This will open the device file, attach the line discipline to it, and 76 This will open the device file, attach the line discipline to it, and
77 then sleep in the background, keeping the device open so that the line 77 then sleep in the background, keeping the device open so that the line
78 discipline remains active. To deactivate it, kill the daemon, for example 78 discipline remains active. To deactivate it, kill the daemon, for example
79 with 79 with
80 killall ldattach 80 killall ldattach
81 before disconnecting the device. To have this happen automatically at 81 before disconnecting the device. To have this happen automatically at
82 system startup/shutdown on an LSB compatible system, create and activate 82 system startup/shutdown on an LSB compatible system, create and activate
83 an appropriate LSB startup script /etc/init.d/gigaset. (The init name 83 an appropriate LSB startup script /etc/init.d/gigaset. (The init name
84 'gigaset' is officially assigned to this project by LANANA.) 84 'gigaset' is officially assigned to this project by LANANA.)
85 Alternatively, just add the 'ldattach' command line to /etc/rc.local. 85 Alternatively, just add the 'ldattach' command line to /etc/rc.local.
86 86
87 The modules accept the following parameters:
88
89 Module Parameter Meaning
90
91 gigaset debug debug level (see section 3.2.)
92
93 startmode initial operation mode (see section 2.5.):
94 bas_gigaset ) 1=ISDN4linux/CAPI (default), 0=Unimodem
95 ser_gigaset )
96 usb_gigaset ) cidmode initial Call-ID mode setting (see section
97 2.5.): 1=on (default), 0=off
98
99 Depending on your distribution you may want to create a separate module
100 configuration file /etc/modprobe.d/gigaset for these, or add them to a
101 custom file like /etc/modprobe.conf.local.
102
872.2. Device nodes for user space programs 1032.2. Device nodes for user space programs
88 ------------------------------------ 104 ------------------------------------
89 The device can be accessed from user space (eg. by the user space tools 105 The device can be accessed from user space (eg. by the user space tools
@@ -93,29 +109,83 @@ GigaSet 307x Device Driver
93 - /dev/ttyGU0 for M105 (USB data boxes) 109 - /dev/ttyGU0 for M105 (USB data boxes)
94 - /dev/ttyGB0 for the base driver (direct USB connection) 110 - /dev/ttyGB0 for the base driver (direct USB connection)
95 111
96 You can also select a "default device" which is used by the frontends when 112 If you connect more than one device of a type, they will get consecutive
113 device nodes, eg. /dev/ttyGU1 for a second M105.
114
115 You can also set a "default device" for the user space tools to use when
97 no device node is given as parameter, by creating a symlink /dev/ttyG to 116 no device node is given as parameter, by creating a symlink /dev/ttyG to
98 one of them, eg.: 117 one of them, eg.:
99 118
100 ln -s /dev/ttyGB0 /dev/ttyG 119 ln -s /dev/ttyGB0 /dev/ttyG
120
121 The devices accept the following device specific ioctl calls
122 (defined in gigaset_dev.h):
123
124 ioctl(int fd, GIGASET_REDIR, int *cmd);
125 If cmd==1, the device is set to be controlled exclusively through the
126 character device node; access from the ISDN subsystem is blocked.
127 If cmd==0, the device is set to be used from the ISDN subsystem and does
128 not communicate through the character device node.
129
130 ioctl(int fd, GIGASET_CONFIG, int *cmd);
131 (ser_gigaset and usb_gigaset only)
132 If cmd==1, the device is set to adapter configuration mode where commands
133 are interpreted by the M10x DECT adapter itself instead of being
134 forwarded to the base station. In this mode, the device accepts the
135 commands described in Siemens document "AT-Kommando Alignment M10x Data"
136 for setting the operation mode, associating with a base station and
137 querying parameters like field strengh and signal quality.
138 Note that there is no ioctl command for leaving adapter configuration
139 mode and returning to regular operation. In order to leave adapter
140 configuration mode, write the command ATO to the device.
141
142 ioctl(int fd, GIGASET_BRKCHARS, unsigned char brkchars[6]);
143 (usb_gigaset only)
144 Set the break characters on an M105's internal serial adapter to the six
145 bytes stored in brkchars[]. Unused bytes should be set to zero.
146
147 ioctl(int fd, GIGASET_VERSION, unsigned version[4]);
148 Retrieve version information from the driver. version[0] must be set to
149 one of:
150 - GIGVER_DRIVER: retrieve driver version
151 - GIGVER_COMPAT: retrieve interface compatibility version
152 - GIGVER_FWBASE: retrieve the firmware version of the base
153 Upon return, version[] is filled with the requested version information.
101 154
1022.3. ISDN4linux 1552.3. ISDN4linux
103 ---------- 156 ----------
104 This is the "normal" mode of operation. After loading the module you can 157 This is the "normal" mode of operation. After loading the module you can
105 set up the ISDN system just as you'd do with any ISDN card. 158 set up the ISDN system just as you'd do with any ISDN card supported by
106 Your distribution should provide some configuration utility. 159 the ISDN4Linux subsystem. Most distributions provide some configuration
107 If not, you can use some HOWTOs like 160 utility. If not, you can use some HOWTOs like
108 http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html 161 http://www.linuxhaven.de/dlhp/HOWTO/DE-ISDN-HOWTO-5.html
109 If this doesn't work, because you have some recent device like SX100 where 162 If this doesn't work, because you have some device like SX100 where
110 debug output (see section 3.2.) shows something like this when dialing 163 debug output (see section 3.2.) shows something like this when dialing
111 CMD Received: ERROR 164 CMD Received: ERROR
112 Available Params: 0 165 Available Params: 0
113 Connection State: 0, Response: -1 166 Connection State: 0, Response: -1
114 gigaset_process_response: resp_code -1 in ConState 0 ! 167 gigaset_process_response: resp_code -1 in ConState 0 !
115 Timeout occurred 168 Timeout occurred
116 you might need to use unimodem mode: 169 you probably need to use unimodem mode. (see section 2.5.)
117 170
1182.4. Unimodem mode 1712.4. CAPI
172 ----
173 If the driver is compiled with CAPI support (kernel configuration option
174 GIGASET_CAPI, experimental) it can also be used with CAPI 2.0 kernel and
175 user space applications. For user space access, the module capi.ko must
176 be loaded. The capiinit command (included in the capi4k-utils package)
177 does this for you.
178
179 The CAPI variant of the driver supports legacy ISDN4Linux applications
180 via the capidrv compatibility driver. The kernel module capidrv.ko must
181 be loaded explicitly with the command
182 modprobe capidrv
183 if needed, and cannot be unloaded again without unloading the driver
184 first. (These are limitations of capidrv.)
185
186 The note about unimodem mode in the preceding section applies here, too.
187
1882.5. Unimodem mode
119 ------------- 189 -------------
120 This is needed for some devices [e.g. SX100] as they have problems with 190 This is needed for some devices [e.g. SX100] as they have problems with
121 the "normal" commands. 191 the "normal" commands.
@@ -126,9 +196,14 @@ GigaSet 307x Device Driver
126 You can switch back using 196 You can switch back using
127 gigacontr --mode isdn 197 gigacontr --mode isdn
128 198
129 You can also load the driver using e.g. 199 You can also put the driver directly into Unimodem mode when it's loaded,
130 modprobe usb_gigaset startmode=0 200 by passing the module parameter startmode=0 to the hardware specific
131 to prevent the driver from starting in "isdn4linux mode". 201 module, e.g.
202 modprobe usb_gigaset startmode=0
203 or by adding a line like
204 options usb_gigaset startmode=0
205 to an appropriate module configuration file, like /etc/modprobe.d/gigaset
206 or /etc/modprobe.conf.local.
132 207
133 In this mode the device works like a modem connected to a serial port 208 In this mode the device works like a modem connected to a serial port
134 (the /dev/ttyGU0, ... mentioned above) which understands the commands 209 (the /dev/ttyGU0, ... mentioned above) which understands the commands
@@ -156,11 +231,10 @@ GigaSet 307x Device Driver
156 231
157 options ppp_async flag_time=0 232 options ppp_async flag_time=0
158 233
159 to /etc/modprobe.conf. If your distribution has some local module 234 to an appropriate module configuration file, like /etc/modprobe.d/gigaset
160 configuration file like /etc/modprobe.conf.local, 235 or /etc/modprobe.conf.local.
161 using that should be preferred.
162 236
1632.5. Call-ID (CID) mode 2372.6. Call-ID (CID) mode
164 ------------------ 238 ------------------
165 Call-IDs are numbers used to tag commands to, and responses from, the 239 Call-IDs are numbers used to tag commands to, and responses from, the
166 Gigaset base in order to support the simultaneous handling of multiple 240 Gigaset base in order to support the simultaneous handling of multiple
@@ -181,14 +255,15 @@ GigaSet 307x Device Driver
181 settings (CID mode). 255 settings (CID mode).
182 - If you have several DECT data devices (M10x) which you want to use 256 - If you have several DECT data devices (M10x) which you want to use
183 in turn, select Unimodem mode by passing the parameter "cidmode=0" to 257 in turn, select Unimodem mode by passing the parameter "cidmode=0" to
184 the driver ("modprobe usb_gigaset cidmode=0" or modprobe.conf). 258 the appropriate driver module (ser_gigaset or usb_gigaset).
185 259
186 If you want both of these at once, you are out of luck. 260 If you want both of these at once, you are out of luck.
187 261
188 You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode 262 You can also use the tty class parameter "cidmode" of the device to
189 setting (ttyGxy is ttyGU0 or ttyGB0). 263 change its CID mode while the driver is loaded, eg.
264 echo 0 > /sys/class/tty/ttyGU0/cidmode
190 265
1912.6. Unregistered Wireless Devices (M101/M105) 2662.7. Unregistered Wireless Devices (M101/M105)
192 ----------------------------------------- 267 -----------------------------------------
193 The main purpose of the ser_gigaset and usb_gigaset drivers is to allow 268 The main purpose of the ser_gigaset and usb_gigaset drivers is to allow
194 the M101 and M105 wireless devices to be used as ISDN devices for ISDN 269 the M101 and M105 wireless devices to be used as ISDN devices for ISDN
@@ -200,7 +275,7 @@ GigaSet 307x Device Driver
200 driver. In that situation, a restricted set of functions is available 275 driver. In that situation, a restricted set of functions is available
201 which includes, in particular, those necessary for registering the device 276 which includes, in particular, those necessary for registering the device
202 to a base or for switching it between Fixed Part and Portable Part 277 to a base or for switching it between Fixed Part and Portable Part
203 modes. 278 modes. See the gigacontr(8) manpage for details.
204 279
2053. Troubleshooting 2803. Troubleshooting
206 --------------- 281 ---------------
@@ -214,21 +289,19 @@ GigaSet 307x Device Driver
214 289
215 options isdn dialtimeout=15 290 options isdn dialtimeout=15
216 291
217 to /etc/modprobe.conf. If your distribution has some local module 292 to /etc/modprobe.d/gigaset, /etc/modprobe.conf.local or a similar file.
218 configuration file like /etc/modprobe.conf.local,
219 using that should be preferred.
220 293
221 Problem: 294 Problem:
222 Your isdn script aborts with a message about isdnlog. 295 The isdnlog program emits error messages or just doesn't work.
223 Solution: 296 Solution:
224 Try deactivating (or commenting out) isdnlog. This driver does not 297 Isdnlog supports only the HiSax driver. Do not attempt to use it with
225 support it. 298 other drivers such as Gigaset.
226 299
227 Problem: 300 Problem:
228 You have two or more DECT data adapters (M101/M105) and only the 301 You have two or more DECT data adapters (M101/M105) and only the
229 first one you turn on works. 302 first one you turn on works.
230 Solution: 303 Solution:
231 Select Unimodem mode for all DECT data adapters. (see section 2.4.) 304 Select Unimodem mode for all DECT data adapters. (see section 2.5.)
232 305
233 Problem: 306 Problem:
234 Messages like this: 307 Messages like this:
@@ -236,7 +309,7 @@ GigaSet 307x Device Driver
236 appear in your syslog. 309 appear in your syslog.
237 Solution: 310 Solution:
238 Check whether your M10x wireless device is correctly registered to the 311 Check whether your M10x wireless device is correctly registered to the
239 Gigaset base. (see section 2.6.) 312 Gigaset base. (see section 2.7.)
240 313
2413.2. Telling the driver to provide more information 3143.2. Telling the driver to provide more information
242 ---------------------------------------------- 315 ----------------------------------------------
@@ -248,15 +321,16 @@ GigaSet 307x Device Driver
248 writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g. 321 writing an appropriate value to /sys/module/gigaset/parameters/debug, e.g.
249 echo 0 > /sys/module/gigaset/parameters/debug 322 echo 0 > /sys/module/gigaset/parameters/debug
250 switches off debugging output completely, 323 switches off debugging output completely,
251 echo 0x10a020 > /sys/module/gigaset/parameters/debug 324 echo 0x302020 > /sys/module/gigaset/parameters/debug
252 enables the standard set of debugging output messages. These values are 325 enables a reasonable set of debugging output messages. These values are
253 bit patterns where every bit controls a certain type of debugging output. 326 bit patterns where every bit controls a certain type of debugging output.
254 See the constants DEBUG_* in the source file gigaset.h for details. 327 See the constants DEBUG_* in the source file gigaset.h for details.
255 328
256 The initial value can be set using the debug parameter when loading the 329 The initial value can be set using the debug parameter when loading the
257 module "gigaset", e.g. by adding a line 330 module "gigaset", e.g. by adding a line
258 options gigaset debug=0 331 options gigaset debug=0
259 to /etc/modprobe.conf, ... 332 to your module configuration file, eg. /etc/modprobe.d/gigaset or
333 /etc/modprobe.conf.local.
260 334
261 Generated debugging information can be found 335 Generated debugging information can be found
262 - as output of the command 336 - as output of the command
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index bb3bf38f03da..6f8c1cabbc5d 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -1,3 +1,17 @@
1Output files
2
3modules.order
4--------------------------------------------------
5This file records the order in which modules appear in Makefiles. This
6is used by modprobe to deterministically resolve aliases that match
7multiple modules.
8
9modules.builtin
10--------------------------------------------------
11This file lists all modules that are built into the kernel. This is used
12by modprobe to not fail when trying to load something builtin.
13
14
1Environment variables 15Environment variables
2 16
3KCPPFLAGS 17KCPPFLAGS
diff --git a/Documentation/kbuild/kconfig.txt b/Documentation/kbuild/kconfig.txt
index 849b5e56d06f..49efae703979 100644
--- a/Documentation/kbuild/kconfig.txt
+++ b/Documentation/kbuild/kconfig.txt
@@ -103,10 +103,16 @@ KCONFIG_AUTOCONFIG
103This environment variable can be set to specify the path & name of the 103This environment variable can be set to specify the path & name of the
104"auto.conf" file. Its default value is "include/config/auto.conf". 104"auto.conf" file. Its default value is "include/config/auto.conf".
105 105
106KCONFIG_TRISTATE
107--------------------------------------------------
108This environment variable can be set to specify the path & name of the
109"tristate.conf" file. Its default value is "include/config/tristate.conf".
110
106KCONFIG_AUTOHEADER 111KCONFIG_AUTOHEADER
107-------------------------------------------------- 112--------------------------------------------------
108This environment variable can be set to specify the path & name of the 113This environment variable can be set to specify the path & name of the
109"autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". 114"autoconf.h" (header) file.
115Its default value is "include/generated/autoconf.h".
110 116
111 117
112====================================================================== 118======================================================================
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt
index 348b9e5e28fc..27a52b35d55b 100644
--- a/Documentation/kernel-doc-nano-HOWTO.txt
+++ b/Documentation/kernel-doc-nano-HOWTO.txt
@@ -214,11 +214,13 @@ The format of the block comment is like this:
214 * (section header: (section description)? )* 214 * (section header: (section description)? )*
215(*)?*/ 215(*)?*/
216 216
217The short function description ***cannot be multiline***, but the other 217All "description" text can span multiple lines, although the
218descriptions can be (and they can contain blank lines). If you continue 218function_name & its short description are traditionally on a single line.
219that initial short description onto a second line, that second line will 219Description text may also contain blank lines (i.e., lines that contain
220appear further down at the beginning of the description section, which is 220only a "*").
221almost certainly not what you had in mind. 221
222"section header:" names must be unique per function (or struct,
223union, typedef, enum).
222 224
223Avoid putting a spurious blank line after the function name, or else the 225Avoid putting a spurious blank line after the function name, or else the
224description will be repeated! 226description will be repeated!
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6fa7292947e5..e4cbca58536c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -54,6 +54,7 @@ parameter is applicable:
54 IMA Integrity measurement architecture is enabled. 54 IMA Integrity measurement architecture is enabled.
55 IOSCHED More than one I/O scheduler is enabled. 55 IOSCHED More than one I/O scheduler is enabled.
56 IP_PNP IP DHCP, BOOTP, or RARP is enabled. 56 IP_PNP IP DHCP, BOOTP, or RARP is enabled.
57 IPV6 IPv6 support is enabled.
57 ISAPNP ISA PnP code is enabled. 58 ISAPNP ISA PnP code is enabled.
58 ISDN Appropriate ISDN support is enabled. 59 ISDN Appropriate ISDN support is enabled.
59 JOY Appropriate joystick support is enabled. 60 JOY Appropriate joystick support is enabled.
@@ -85,7 +86,6 @@ parameter is applicable:
85 PPT Parallel port support is enabled. 86 PPT Parallel port support is enabled.
86 PS2 Appropriate PS/2 support is enabled. 87 PS2 Appropriate PS/2 support is enabled.
87 RAM RAM disk support is enabled. 88 RAM RAM disk support is enabled.
88 ROOTPLUG The example Root Plug LSM is enabled.
89 S390 S390 architecture is enabled. 89 S390 S390 architecture is enabled.
90 SCSI Appropriate SCSI support is enabled. 90 SCSI Appropriate SCSI support is enabled.
91 A lot of drivers has their options described inside of 91 A lot of drivers has their options described inside of
@@ -241,7 +241,7 @@ and is between 256 and 4096 characters. It is defined in the file
241 241
242 acpi_sleep= [HW,ACPI] Sleep options 242 acpi_sleep= [HW,ACPI] Sleep options
243 Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, 243 Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
244 old_ordering, s4_nonvs } 244 old_ordering, s4_nonvs, sci_force_enable }
245 See Documentation/power/video.txt for information on 245 See Documentation/power/video.txt for information on
246 s3_bios and s3_mode. 246 s3_bios and s3_mode.
247 s3_beep is for debugging; it makes the PC's speaker beep 247 s3_beep is for debugging; it makes the PC's speaker beep
@@ -254,6 +254,9 @@ and is between 256 and 4096 characters. It is defined in the file
254 of _PTS is used by default). 254 of _PTS is used by default).
255 s4_nonvs prevents the kernel from saving/restoring the 255 s4_nonvs prevents the kernel from saving/restoring the
256 ACPI NVS memory during hibernation. 256 ACPI NVS memory during hibernation.
257 sci_force_enable causes the kernel to set SCI_EN directly
258 on resume from S1/S3 (which is against the ACPI spec,
259 but some broken systems don't work without it).
257 260
258 acpi_use_timer_override [HW,ACPI] 261 acpi_use_timer_override [HW,ACPI]
259 Use timer override. For some broken Nvidia NF5 boards 262 Use timer override. For some broken Nvidia NF5 boards
@@ -309,6 +312,11 @@ and is between 256 and 4096 characters. It is defined in the file
309 aic79xx= [HW,SCSI] 312 aic79xx= [HW,SCSI]
310 See Documentation/scsi/aic79xx.txt. 313 See Documentation/scsi/aic79xx.txt.
311 314
315 alignment= [KNL,ARM]
316 Allow the default userspace alignment fault handler
317 behaviour to be specified. Bit 0 enables warnings,
318 bit 1 enables fixups, and bit 2 sends a segfault.
319
312 amd_iommu= [HW,X86-84] 320 amd_iommu= [HW,X86-84]
313 Pass parameters to the AMD IOMMU driver in the system. 321 Pass parameters to the AMD IOMMU driver in the system.
314 Possible values are: 322 Possible values are:
@@ -345,6 +353,18 @@ and is between 256 and 4096 characters. It is defined in the file
345 Change the amount of debugging information output 353 Change the amount of debugging information output
346 when initialising the APIC and IO-APIC components. 354 when initialising the APIC and IO-APIC components.
347 355
356 autoconf= [IPV6]
357 See Documentation/networking/ipv6.txt.
358
359 show_lapic= [APIC,X86] Advanced Programmable Interrupt Controller
360 Limit apic dumping. The parameter defines the maximal
361 number of local apics being dumped. Also it is possible
362 to set it to "all" by meaning -- no limit here.
363 Format: { 1 (default) | 2 | ... | all }.
364 The parameter valid if only apic=debug or
365 apic=verbose is specified.
366 Example: apic=debug show_lapic=all
367
348 apm= [APM] Advanced Power Management 368 apm= [APM] Advanced Power Management
349 See header of arch/x86/kernel/apm_32.c. 369 See header of arch/x86/kernel/apm_32.c.
350 370
@@ -618,6 +638,12 @@ and is between 256 and 4096 characters. It is defined in the file
618 See drivers/char/README.epca and 638 See drivers/char/README.epca and
619 Documentation/serial/digiepca.txt. 639 Documentation/serial/digiepca.txt.
620 640
641 disable= [IPV6]
642 See Documentation/networking/ipv6.txt.
643
644 disable_ipv6= [IPV6]
645 See Documentation/networking/ipv6.txt.
646
621 disable_mtrr_cleanup [X86] 647 disable_mtrr_cleanup [X86]
622 The kernel tries to adjust MTRR layout from continuous 648 The kernel tries to adjust MTRR layout from continuous
623 to discrete, to make X server driver able to add WB 649 to discrete, to make X server driver able to add WB
@@ -671,6 +697,7 @@ and is between 256 and 4096 characters. It is defined in the file
671 earlyprintk= [X86,SH,BLACKFIN] 697 earlyprintk= [X86,SH,BLACKFIN]
672 earlyprintk=vga 698 earlyprintk=vga
673 earlyprintk=serial[,ttySn[,baudrate]] 699 earlyprintk=serial[,ttySn[,baudrate]]
700 earlyprintk=ttySn[,baudrate]
674 earlyprintk=dbgp[debugController#] 701 earlyprintk=dbgp[debugController#]
675 702
676 Append ",keep" to not disable it when the real console 703 Append ",keep" to not disable it when the real console
@@ -778,6 +805,13 @@ and is between 256 and 4096 characters. It is defined in the file
778 by the set_ftrace_notrace file in the debugfs 805 by the set_ftrace_notrace file in the debugfs
779 tracing directory. 806 tracing directory.
780 807
808 ftrace_graph_filter=[function-list]
809 [FTRACE] Limit the top level callers functions traced
810 by the function graph tracer at boot up.
811 function-list is a comma separated list of functions
812 that can be changed at run time by the
813 set_graph_function file in the debugfs tracing directory.
814
781 gamecon.map[2|3]= 815 gamecon.map[2|3]=
782 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad 816 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
783 support via parallel port (up to 5 devices per port) 817 support via parallel port (up to 5 devices per port)
@@ -1016,7 +1050,7 @@ and is between 256 and 4096 characters. It is defined in the file
1016 No delay 1050 No delay
1017 1051
1018 ip= [IP_PNP] 1052 ip= [IP_PNP]
1019 See Documentation/filesystems/nfsroot.txt. 1053 See Documentation/filesystems/nfs/nfsroot.txt.
1020 1054
1021 ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards 1055 ip2= [HW] Set IO/IRQ pairs for up to 4 IntelliPort boards
1022 See comment before ip2_setup() in 1056 See comment before ip2_setup() in
@@ -1537,10 +1571,10 @@ and is between 256 and 4096 characters. It is defined in the file
1537 going to be removed in 2.6.29. 1571 going to be removed in 2.6.29.
1538 1572
1539 nfsaddrs= [NFS] 1573 nfsaddrs= [NFS]
1540 See Documentation/filesystems/nfsroot.txt. 1574 See Documentation/filesystems/nfs/nfsroot.txt.
1541 1575
1542 nfsroot= [NFS] nfs root filesystem for disk-less boxes. 1576 nfsroot= [NFS] nfs root filesystem for disk-less boxes.
1543 See Documentation/filesystems/nfsroot.txt. 1577 See Documentation/filesystems/nfs/nfsroot.txt.
1544 1578
1545 nfs.callback_tcpport= 1579 nfs.callback_tcpport=
1546 [NFS] set the TCP port on which the NFSv4 callback 1580 [NFS] set the TCP port on which the NFSv4 callback
@@ -1710,6 +1744,9 @@ and is between 256 and 4096 characters. It is defined in the file
1710 nomfgpt [X86-32] Disable Multi-Function General Purpose 1744 nomfgpt [X86-32] Disable Multi-Function General Purpose
1711 Timer usage (for AMD Geode machines). 1745 Timer usage (for AMD Geode machines).
1712 1746
1747 nopat [X86] Disable PAT (page attribute table extension of
1748 pagetables) support.
1749
1713 norandmaps Don't use address space randomization. Equivalent to 1750 norandmaps Don't use address space randomization. Equivalent to
1714 echo 0 > /proc/sys/kernel/randomize_va_space 1751 echo 0 > /proc/sys/kernel/randomize_va_space
1715 1752
@@ -1753,6 +1790,12 @@ and is between 256 and 4096 characters. It is defined in the file
1753 purges which is reported from either PAL_VM_SUMMARY or 1790 purges which is reported from either PAL_VM_SUMMARY or
1754 SAL PALO. 1791 SAL PALO.
1755 1792
1793 nr_cpus= [SMP] Maximum number of processors that an SMP kernel
1794 could support. nr_cpus=n : n >= 1 limits the kernel to
1795 supporting 'n' processors. Later in runtime you can not
1796 use hotplug cpu feature to put more cpu back to online.
1797 just like you compile the kernel NR_CPUS=n
1798
1756 nr_uarts= [SERIAL] maximum number of UARTs to be registered. 1799 nr_uarts= [SERIAL] maximum number of UARTs to be registered.
1757 1800
1758 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA. 1801 numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
@@ -1771,6 +1814,11 @@ and is between 256 and 4096 characters. It is defined in the file
1771 waiting for the ACK, so if this is set too high 1814 waiting for the ACK, so if this is set too high
1772 interrupts *may* be lost! 1815 interrupts *may* be lost!
1773 1816
1817 omap_mux= [OMAP] Override bootloader pin multiplexing.
1818 Format: <mux_mode0.mode_name=value>...
1819 For example, to override I2C bus2:
1820 omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100
1821
1774 opl3= [HW,OSS] 1822 opl3= [HW,OSS]
1775 Format: <io> 1823 Format: <io>
1776 1824
@@ -1915,8 +1963,12 @@ and is between 256 and 4096 characters. It is defined in the file
1915 IRQ routing is enabled. 1963 IRQ routing is enabled.
1916 noacpi [X86] Do not use ACPI for IRQ routing 1964 noacpi [X86] Do not use ACPI for IRQ routing
1917 or for PCI scanning. 1965 or for PCI scanning.
1918 use_crs [X86] Use _CRS for PCI resource 1966 use_crs [X86] Use PCI host bridge window information
1919 allocation. 1967 from ACPI. On BIOSes from 2008 or later, this
1968 is enabled by default. If you need to use this,
1969 please report a bug.
1970 nocrs [X86] Ignore PCI host bridge windows from ACPI.
1971 If you need to use this, please report a bug.
1920 routeirq Do IRQ routing for all PCI devices. 1972 routeirq Do IRQ routing for all PCI devices.
1921 This is normally done in pci_enable_device(), 1973 This is normally done in pci_enable_device(),
1922 so this option is a temporary workaround 1974 so this option is a temporary workaround
@@ -1965,6 +2017,14 @@ and is between 256 and 4096 characters. It is defined in the file
1965 force Enable ASPM even on devices that claim not to support it. 2017 force Enable ASPM even on devices that claim not to support it.
1966 WARNING: Forcing ASPM on may cause system lockups. 2018 WARNING: Forcing ASPM on may cause system lockups.
1967 2019
2020 pcie_pme= [PCIE,PM] Native PCIe PME signaling options:
2021 off Do not use native PCIe PME signaling.
2022 force Use native PCIe PME signaling even if the BIOS refuses
2023 to allow the kernel to control the relevant PCIe config
2024 registers.
2025 nomsi Do not use MSI for native PCIe PME signaling (this makes
2026 all PCIe root ports use INTx for everything).
2027
1968 pcmv= [HW,PCMCIA] BadgePAD 4 2028 pcmv= [HW,PCMCIA] BadgePAD 4
1969 2029
1970 pd. [PARIDE] 2030 pd. [PARIDE]
@@ -2031,8 +2091,15 @@ and is between 256 and 4096 characters. It is defined in the file
2031 2091
2032 print-fatal-signals= 2092 print-fatal-signals=
2033 [KNL] debug: print fatal signals 2093 [KNL] debug: print fatal signals
2034 print-fatal-signals=1: print segfault info to 2094
2035 the kernel console. 2095 If enabled, warn about various signal handling
2096 related application anomalies: too many signals,
2097 too many POSIX.1 timers, fatal signals causing a
2098 coredump - etc.
2099
2100 If you hit the warning due to signal overflow,
2101 you might want to try "ulimit -i unlimited".
2102
2036 default: off. 2103 default: off.
2037 2104
2038 printk.time= Show timing data prefixed to each printk message line 2105 printk.time= Show timing data prefixed to each printk message line
@@ -2163,15 +2230,6 @@ and is between 256 and 4096 characters. It is defined in the file
2163 Useful for devices that are detected asynchronously 2230 Useful for devices that are detected asynchronously
2164 (e.g. USB and MMC devices). 2231 (e.g. USB and MMC devices).
2165 2232
2166 root_plug.vendor_id=
2167 [ROOTPLUG] Override the default vendor ID
2168
2169 root_plug.product_id=
2170 [ROOTPLUG] Override the default product ID
2171
2172 root_plug.debug=
2173 [ROOTPLUG] Enable debugging output
2174
2175 rw [KNL] Mount root device read-write on boot 2233 rw [KNL] Mount root device read-write on boot
2176 2234
2177 S [KNL] Run init in single mode 2235 S [KNL] Run init in single mode
@@ -2181,6 +2239,8 @@ and is between 256 and 4096 characters. It is defined in the file
2181 2239
2182 sbni= [NET] Granch SBNI12 leased line adapter 2240 sbni= [NET] Granch SBNI12 leased line adapter
2183 2241
2242 sched_debug [KNL] Enables verbose scheduler debug messages.
2243
2184 sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver 2244 sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver
2185 Format: <io>[,<timeout>[,<isapnp>]] 2245 Format: <io>[,<timeout>[,<isapnp>]]
2186 2246
@@ -2589,6 +2649,9 @@ and is between 256 and 4096 characters. It is defined in the file
2589 uart6850= [HW,OSS] 2649 uart6850= [HW,OSS]
2590 Format: <io>,<irq> 2650 Format: <io>,<irq>
2591 2651
2652 uhash_entries= [KNL,NET]
2653 Set number of hash buckets for UDP/UDP-Lite connections
2654
2592 uhci-hcd.ignore_oc= 2655 uhci-hcd.ignore_oc=
2593 [USB] Ignore overcurrent events (default N). 2656 [USB] Ignore overcurrent events (default N).
2594 Some badly-designed motherboards generate lots of 2657 Some badly-designed motherboards generate lots of
@@ -2644,6 +2707,8 @@ and is between 256 and 4096 characters. It is defined in the file
2644 to a common usb-storage quirk flag as follows: 2707 to a common usb-storage quirk flag as follows:
2645 a = SANE_SENSE (collect more than 18 bytes 2708 a = SANE_SENSE (collect more than 18 bytes
2646 of sense data); 2709 of sense data);
2710 b = BAD_SENSE (don't collect more than 18
2711 bytes of sense data);
2647 c = FIX_CAPACITY (decrease the reported 2712 c = FIX_CAPACITY (decrease the reported
2648 device capacity by one sector); 2713 device capacity by one sector);
2649 h = CAPACITY_HEURISTICS (decrease the 2714 h = CAPACITY_HEURISTICS (decrease the
@@ -2665,6 +2730,13 @@ and is between 256 and 4096 characters. It is defined in the file
2665 medium is write-protected). 2730 medium is write-protected).
2666 Example: quirks=0419:aaf5:rl,0421:0433:rc 2731 Example: quirks=0419:aaf5:rl,0421:0433:rc
2667 2732
2733 userpte=
2734 [X86] Flags controlling user PTE allocations.
2735
2736 nohigh = do not allocate PTE pages in
2737 HIGHMEM regardless of setting
2738 of CONFIG_HIGHPTE.
2739
2668 vdso= [X86,SH] 2740 vdso= [X86,SH]
2669 vdso=2: enable compat VDSO (default with COMPAT_VDSO) 2741 vdso=2: enable compat VDSO (default with COMPAT_VDSO)
2670 vdso=1: enable VDSO (default) 2742 vdso=1: enable VDSO (default)
@@ -2703,6 +2775,11 @@ and is between 256 and 4096 characters. It is defined in the file
2703 vmpoff= [KNL,S390] Perform z/VM CP command after power off. 2775 vmpoff= [KNL,S390] Perform z/VM CP command after power off.
2704 Format: <command> 2776 Format: <command>
2705 2777
2778 vt.cur_default= [VT] Default cursor shape.
2779 Format: 0xCCBBAA, where AA, BB, and CC are the same as
2780 the parameters of the <Esc>[?A;B;Cc escape sequence;
2781 see VGA-softcursor.txt. Default: 2 = underline.
2782
2706 vt.default_blu= [VT] 2783 vt.default_blu= [VT]
2707 Format: <blue0>,<blue1>,<blue2>,...,<blue15> 2784 Format: <blue0>,<blue1>,<blue2>,...,<blue15>
2708 Change the default blue palette of the console. 2785 Change the default blue palette of the console.
@@ -2728,6 +2805,15 @@ and is between 256 and 4096 characters. It is defined in the file
2728 Default is 1, i.e. UTF-8 mode is enabled for all 2805 Default is 1, i.e. UTF-8 mode is enabled for all
2729 newly opened terminals. 2806 newly opened terminals.
2730 2807
2808 vt.global_cursor_default=
2809 [VT]
2810 Format=<-1|0|1>
2811 Set system-wide default for whether a cursor
2812 is shown on new VTs. Default is -1,
2813 i.e. cursors will be created by default unless
2814 overridden by individual drivers. 0 will hide
2815 cursors, 1 will display them.
2816
2731 waveartist= [HW,OSS] 2817 waveartist= [HW,OSS]
2732 Format: <io>,<irq>,<dma>,<dma2> 2818 Format: <io>,<irq>,<dma>,<dma2>
2733 2819
@@ -2744,6 +2830,12 @@ and is between 256 and 4096 characters. It is defined in the file
2744 default x2apic cluster mode on platforms 2830 default x2apic cluster mode on platforms
2745 supporting x2apic. 2831 supporting x2apic.
2746 2832
2833 x86_mrst_timer= [X86-32,APBT]
2834 Choose timer option for x86 Moorestown MID platform.
2835 Two valid options are apbt timer only and lapic timer
2836 plus one apbt timer for broadcast timer.
2837 x86_mrst_timer=apbt_only | lapic_and_apbt
2838
2747 xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. 2839 xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks.
2748 xd_geo= See header of drivers/block/xd.c. 2840 xd_geo= See header of drivers/block/xd.c.
2749 2841
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index c79ab996dada..bdb13817e1e9 100644
--- a/Documentation/kobject.txt
+++ b/Documentation/kobject.txt
@@ -266,7 +266,7 @@ kobj_type:
266 266
267 struct kobj_type { 267 struct kobj_type {
268 void (*release)(struct kobject *); 268 void (*release)(struct kobject *);
269 struct sysfs_ops *sysfs_ops; 269 const struct sysfs_ops *sysfs_ops;
270 struct attribute **default_attrs; 270 struct attribute **default_attrs;
271 }; 271 };
272 272
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 053037a1fe6d..2f9115c0ae62 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -1,6 +1,7 @@
1Title : Kernel Probes (Kprobes) 1Title : Kernel Probes (Kprobes)
2Authors : Jim Keniston <jkenisto@us.ibm.com> 2Authors : Jim Keniston <jkenisto@us.ibm.com>
3 : Prasanna S Panchamukhi <prasanna@in.ibm.com> 3 : Prasanna S Panchamukhi <prasanna.panchamukhi@gmail.com>
4 : Masami Hiramatsu <mhiramat@redhat.com>
4 5
5CONTENTS 6CONTENTS
6 7
@@ -15,6 +16,7 @@ CONTENTS
159. Jprobes Example 169. Jprobes Example
1610. Kretprobes Example 1710. Kretprobes Example
17Appendix A: The kprobes debugfs interface 18Appendix A: The kprobes debugfs interface
19Appendix B: The kprobes sysctl interface
18 20
191. Concepts: Kprobes, Jprobes, Return Probes 211. Concepts: Kprobes, Jprobes, Return Probes
20 22
@@ -42,13 +44,13 @@ registration/unregistration of a group of *probes. These functions
42can speed up unregistration process when you have to unregister 44can speed up unregistration process when you have to unregister
43a lot of probes at once. 45a lot of probes at once.
44 46
45The next three subsections explain how the different types of 47The next four subsections explain how the different types of
46probes work. They explain certain things that you'll need to 48probes work and how jump optimization works. They explain certain
47know in order to make the best use of Kprobes -- e.g., the 49things that you'll need to know in order to make the best use of
48difference between a pre_handler and a post_handler, and how 50Kprobes -- e.g., the difference between a pre_handler and
49to use the maxactive and nmissed fields of a kretprobe. But 51a post_handler, and how to use the maxactive and nmissed fields of
50if you're in a hurry to start using Kprobes, you can skip ahead 52a kretprobe. But if you're in a hurry to start using Kprobes, you
51to section 2. 53can skip ahead to section 2.
52 54
531.1 How Does a Kprobe Work? 551.1 How Does a Kprobe Work?
54 56
@@ -161,13 +163,125 @@ In case probed function is entered but there is no kretprobe_instance
161object available, then in addition to incrementing the nmissed count, 163object available, then in addition to incrementing the nmissed count,
162the user entry_handler invocation is also skipped. 164the user entry_handler invocation is also skipped.
163 165
1661.4 How Does Jump Optimization Work?
167
168If you configured your kernel with CONFIG_OPTPROBES=y (currently
169this option is supported on x86/x86-64, non-preemptive kernel) and
170the "debug.kprobes_optimization" kernel parameter is set to 1 (see
171sysctl(8)), Kprobes tries to reduce probe-hit overhead by using a jump
172instruction instead of a breakpoint instruction at each probepoint.
173
1741.4.1 Init a Kprobe
175
176When a probe is registered, before attempting this optimization,
177Kprobes inserts an ordinary, breakpoint-based kprobe at the specified
178address. So, even if it's not possible to optimize this particular
179probepoint, there'll be a probe there.
180
1811.4.2 Safety Check
182
183Before optimizing a probe, Kprobes performs the following safety checks:
184
185- Kprobes verifies that the region that will be replaced by the jump
186instruction (the "optimized region") lies entirely within one function.
187(A jump instruction is multiple bytes, and so may overlay multiple
188instructions.)
189
190- Kprobes analyzes the entire function and verifies that there is no
191jump into the optimized region. Specifically:
192 - the function contains no indirect jump;
193 - the function contains no instruction that causes an exception (since
194 the fixup code triggered by the exception could jump back into the
195 optimized region -- Kprobes checks the exception tables to verify this);
196 and
197 - there is no near jump to the optimized region (other than to the first
198 byte).
199
200- For each instruction in the optimized region, Kprobes verifies that
201the instruction can be executed out of line.
202
2031.4.3 Preparing Detour Buffer
204
205Next, Kprobes prepares a "detour" buffer, which contains the following
206instruction sequence:
207- code to push the CPU's registers (emulating a breakpoint trap)
208- a call to the trampoline code which calls user's probe handlers.
209- code to restore registers
210- the instructions from the optimized region
211- a jump back to the original execution path.
212
2131.4.4 Pre-optimization
214
215After preparing the detour buffer, Kprobes verifies that none of the
216following situations exist:
217- The probe has either a break_handler (i.e., it's a jprobe) or a
218post_handler.
219- Other instructions in the optimized region are probed.
220- The probe is disabled.
221In any of the above cases, Kprobes won't start optimizing the probe.
222Since these are temporary situations, Kprobes tries to start
223optimizing it again if the situation is changed.
224
225If the kprobe can be optimized, Kprobes enqueues the kprobe to an
226optimizing list, and kicks the kprobe-optimizer workqueue to optimize
227it. If the to-be-optimized probepoint is hit before being optimized,
228Kprobes returns control to the original instruction path by setting
229the CPU's instruction pointer to the copied code in the detour buffer
230-- thus at least avoiding the single-step.
231
2321.4.5 Optimization
233
234The Kprobe-optimizer doesn't insert the jump instruction immediately;
235rather, it calls synchronize_sched() for safety first, because it's
236possible for a CPU to be interrupted in the middle of executing the
237optimized region(*). As you know, synchronize_sched() can ensure
238that all interruptions that were active when synchronize_sched()
239was called are done, but only if CONFIG_PREEMPT=n. So, this version
240of kprobe optimization supports only kernels with CONFIG_PREEMPT=n.(**)
241
242After that, the Kprobe-optimizer calls stop_machine() to replace
243the optimized region with a jump instruction to the detour buffer,
244using text_poke_smp().
245
2461.4.6 Unoptimization
247
248When an optimized kprobe is unregistered, disabled, or blocked by
249another kprobe, it will be unoptimized. If this happens before
250the optimization is complete, the kprobe is just dequeued from the
251optimized list. If the optimization has been done, the jump is
252replaced with the original code (except for an int3 breakpoint in
253the first byte) by using text_poke_smp().
254
255(*)Please imagine that the 2nd instruction is interrupted and then
256the optimizer replaces the 2nd instruction with the jump *address*
257while the interrupt handler is running. When the interrupt
258returns to original address, there is no valid instruction,
259and it causes an unexpected result.
260
261(**)This optimization-safety checking may be replaced with the
262stop-machine method that ksplice uses for supporting a CONFIG_PREEMPT=y
263kernel.
264
265NOTE for geeks:
266The jump optimization changes the kprobe's pre_handler behavior.
267Without optimization, the pre_handler can change the kernel's execution
268path by changing regs->ip and returning 1. However, when the probe
269is optimized, that modification is ignored. Thus, if you want to
270tweak the kernel's execution path, you need to suppress optimization,
271using one of the following techniques:
272- Specify an empty function for the kprobe's post_handler or break_handler.
273 or
274- Config CONFIG_OPTPROBES=n.
275 or
276- Execute 'sysctl -w debug.kprobes_optimization=n'
277
1642. Architectures Supported 2782. Architectures Supported
165 279
166Kprobes, jprobes, and return probes are implemented on the following 280Kprobes, jprobes, and return probes are implemented on the following
167architectures: 281architectures:
168 282
169- i386 283- i386 (Supports jump optimization)
170- x86_64 (AMD-64, EM64T) 284- x86_64 (AMD-64, EM64T) (Supports jump optimization)
171- ppc64 285- ppc64
172- ia64 (Does not support probes on instruction slot1.) 286- ia64 (Does not support probes on instruction slot1.)
173- sparc64 (Return probes not yet implemented.) 287- sparc64 (Return probes not yet implemented.)
@@ -193,6 +307,10 @@ it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO),
193so you can use "objdump -d -l vmlinux" to see the source-to-object 307so you can use "objdump -d -l vmlinux" to see the source-to-object
194code mapping. 308code mapping.
195 309
310If you want to reduce probing overhead, set "Kprobes jump optimization
311support" (CONFIG_OPTPROBES) to "y". You can find this option under the
312"Kprobes" line.
313
1964. API Reference 3144. API Reference
197 315
198The Kprobes API includes a "register" function and an "unregister" 316The Kprobes API includes a "register" function and an "unregister"
@@ -389,7 +507,10 @@ the probe which has been registered.
389 507
390Kprobes allows multiple probes at the same address. Currently, 508Kprobes allows multiple probes at the same address. Currently,
391however, there cannot be multiple jprobes on the same function at 509however, there cannot be multiple jprobes on the same function at
392the same time. 510the same time. Also, a probepoint for which there is a jprobe or
511a post_handler cannot be optimized. So if you install a jprobe,
512or a kprobe with a post_handler, at an optimized probepoint, the
513probepoint will be unoptimized automatically.
393 514
394In general, you can install a probe anywhere in the kernel. 515In general, you can install a probe anywhere in the kernel.
395In particular, you can probe interrupt handlers. Known exceptions 516In particular, you can probe interrupt handlers. Known exceptions
@@ -453,6 +574,38 @@ reason, Kprobes doesn't support return probes (or kprobes or jprobes)
453on the x86_64 version of __switch_to(); the registration functions 574on the x86_64 version of __switch_to(); the registration functions
454return -EINVAL. 575return -EINVAL.
455 576
577On x86/x86-64, since the Jump Optimization of Kprobes modifies
578instructions widely, there are some limitations to optimization. To
579explain it, we introduce some terminology. Imagine a 3-instruction
580sequence consisting of a two 2-byte instructions and one 3-byte
581instruction.
582
583 IA
584 |
585[-2][-1][0][1][2][3][4][5][6][7]
586 [ins1][ins2][ ins3 ]
587 [<- DCR ->]
588 [<- JTPR ->]
589
590ins1: 1st Instruction
591ins2: 2nd Instruction
592ins3: 3rd Instruction
593IA: Insertion Address
594JTPR: Jump Target Prohibition Region
595DCR: Detoured Code Region
596
597The instructions in DCR are copied to the out-of-line buffer
598of the kprobe, because the bytes in DCR are replaced by
599a 5-byte jump instruction. So there are several limitations.
600
601a) The instructions in DCR must be relocatable.
602b) The instructions in DCR must not include a call instruction.
603c) JTPR must not be targeted by any jump or call instruction.
604d) DCR must not straddle the border betweeen functions.
605
606Anyway, these limitations are checked by the in-kernel instruction
607decoder, so you don't need to worry about that.
608
4566. Probe Overhead 6096. Probe Overhead
457 610
458On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 611On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0
@@ -476,6 +629,19 @@ k = 0.49 usec; j = 0.76; r = 0.80; kr = 0.82; jr = 1.07
476ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) 629ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU)
477k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 630k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99
478 631
6326.1 Optimized Probe Overhead
633
634Typically, an optimized kprobe hit takes 0.07 to 0.1 microseconds to
635process. Here are sample overhead figures (in usec) for x86 architectures.
636k = unoptimized kprobe, b = boosted (single-step skipped), o = optimized kprobe,
637r = unoptimized kretprobe, rb = boosted kretprobe, ro = optimized kretprobe.
638
639i386: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips
640k = 0.80 usec; b = 0.33; o = 0.05; r = 1.10; rb = 0.61; ro = 0.33
641
642x86-64: Intel(R) Xeon(R) E5410, 2.33GHz, 4656.90 bogomips
643k = 0.99 usec; b = 0.43; o = 0.06; r = 1.24; rb = 0.68; ro = 0.30
644
4797. TODO 6457. TODO
480 646
481a. SystemTap (http://sourceware.org/systemtap): Provides a simplified 647a. SystemTap (http://sourceware.org/systemtap): Provides a simplified
@@ -523,7 +689,8 @@ is also specified. Following columns show probe status. If the probe is on
523a virtual address that is no longer valid (module init sections, module 689a virtual address that is no longer valid (module init sections, module
524virtual addresses that correspond to modules that've been unloaded), 690virtual addresses that correspond to modules that've been unloaded),
525such probes are marked with [GONE]. If the probe is temporarily disabled, 691such probes are marked with [GONE]. If the probe is temporarily disabled,
526such probes are marked with [DISABLED]. 692such probes are marked with [DISABLED]. If the probe is optimized, it is
693marked with [OPTIMIZED].
527 694
528/sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. 695/sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly.
529 696
@@ -533,3 +700,19 @@ registered probes will be disarmed, till such time a "1" is echoed to this
533file. Note that this knob just disarms and arms all kprobes and doesn't 700file. Note that this knob just disarms and arms all kprobes and doesn't
534change each probe's disabling state. This means that disabled kprobes (marked 701change each probe's disabling state. This means that disabled kprobes (marked
535[DISABLED]) will be not enabled if you turn ON all kprobes by this knob. 702[DISABLED]) will be not enabled if you turn ON all kprobes by this knob.
703
704
705Appendix B: The kprobes sysctl interface
706
707/proc/sys/debug/kprobes-optimization: Turn kprobes optimization ON/OFF.
708
709When CONFIG_OPTPROBES=y, this sysctl interface appears and it provides
710a knob to globally and forcibly turn jump optimization (see section
7111.4) ON or OFF. By default, jump optimization is allowed (ON).
712If you echo "0" to this file or set "debug.kprobes_optimization" to
7130 via sysctl, all optimized probes will be unoptimized, and any new
714probes registered after that will not be optimized. Note that this
715knob *changes* the optimized state. This means that optimized probes
716(marked [OPTIMIZED]) will be unoptimized ([OPTIMIZED] tag will be
717removed). If the knob is turned on, they will be optimized again.
718
diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
index 5a4bc8cf6d04..c6416a398163 100644
--- a/Documentation/kvm/api.txt
+++ b/Documentation/kvm/api.txt
@@ -23,12 +23,12 @@ of a virtual machine. The ioctls belong to three classes
23 Only run vcpu ioctls from the same thread that was used to create the 23 Only run vcpu ioctls from the same thread that was used to create the
24 vcpu. 24 vcpu.
25 25
262. File descritpors 262. File descriptors
27 27
28The kvm API is centered around file descriptors. An initial 28The kvm API is centered around file descriptors. An initial
29open("/dev/kvm") obtains a handle to the kvm subsystem; this handle 29open("/dev/kvm") obtains a handle to the kvm subsystem; this handle
30can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this 30can be used to issue system ioctls. A KVM_CREATE_VM ioctl on this
31handle will create a VM file descripror which can be used to issue VM 31handle will create a VM file descriptor which can be used to issue VM
32ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu 32ioctls. A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu
33and return a file descriptor pointing to it. Finally, ioctls on a vcpu 33and return a file descriptor pointing to it. Finally, ioctls on a vcpu
34fd can be used to control the vcpu, including the important task of 34fd can be used to control the vcpu, including the important task of
@@ -593,6 +593,123 @@ struct kvm_irqchip {
593 } chip; 593 } chip;
594}; 594};
595 595
5964.27 KVM_XEN_HVM_CONFIG
597
598Capability: KVM_CAP_XEN_HVM
599Architectures: x86
600Type: vm ioctl
601Parameters: struct kvm_xen_hvm_config (in)
602Returns: 0 on success, -1 on error
603
604Sets the MSR that the Xen HVM guest uses to initialize its hypercall
605page, and provides the starting address and size of the hypercall
606blobs in userspace. When the guest writes the MSR, kvm copies one
607page of a blob (32- or 64-bit, depending on the vcpu mode) to guest
608memory.
609
610struct kvm_xen_hvm_config {
611 __u32 flags;
612 __u32 msr;
613 __u64 blob_addr_32;
614 __u64 blob_addr_64;
615 __u8 blob_size_32;
616 __u8 blob_size_64;
617 __u8 pad2[30];
618};
619
6204.27 KVM_GET_CLOCK
621
622Capability: KVM_CAP_ADJUST_CLOCK
623Architectures: x86
624Type: vm ioctl
625Parameters: struct kvm_clock_data (out)
626Returns: 0 on success, -1 on error
627
628Gets the current timestamp of kvmclock as seen by the current guest. In
629conjunction with KVM_SET_CLOCK, it is used to ensure monotonicity on scenarios
630such as migration.
631
632struct kvm_clock_data {
633 __u64 clock; /* kvmclock current value */
634 __u32 flags;
635 __u32 pad[9];
636};
637
6384.28 KVM_SET_CLOCK
639
640Capability: KVM_CAP_ADJUST_CLOCK
641Architectures: x86
642Type: vm ioctl
643Parameters: struct kvm_clock_data (in)
644Returns: 0 on success, -1 on error
645
646Sets the current timestamp of kvmclock to the value specified in its parameter.
647In conjunction with KVM_GET_CLOCK, it is used to ensure monotonicity on scenarios
648such as migration.
649
650struct kvm_clock_data {
651 __u64 clock; /* kvmclock current value */
652 __u32 flags;
653 __u32 pad[9];
654};
655
6564.29 KVM_GET_VCPU_EVENTS
657
658Capability: KVM_CAP_VCPU_EVENTS
659Architectures: x86
660Type: vm ioctl
661Parameters: struct kvm_vcpu_event (out)
662Returns: 0 on success, -1 on error
663
664Gets currently pending exceptions, interrupts, and NMIs as well as related
665states of the vcpu.
666
667struct kvm_vcpu_events {
668 struct {
669 __u8 injected;
670 __u8 nr;
671 __u8 has_error_code;
672 __u8 pad;
673 __u32 error_code;
674 } exception;
675 struct {
676 __u8 injected;
677 __u8 nr;
678 __u8 soft;
679 __u8 pad;
680 } interrupt;
681 struct {
682 __u8 injected;
683 __u8 pending;
684 __u8 masked;
685 __u8 pad;
686 } nmi;
687 __u32 sipi_vector;
688 __u32 flags;
689};
690
6914.30 KVM_SET_VCPU_EVENTS
692
693Capability: KVM_CAP_VCPU_EVENTS
694Architectures: x86
695Type: vm ioctl
696Parameters: struct kvm_vcpu_event (in)
697Returns: 0 on success, -1 on error
698
699Set pending exceptions, interrupts, and NMIs as well as related states of the
700vcpu.
701
702See KVM_GET_VCPU_EVENTS for the data structure.
703
704Fields that may be modified asynchronously by running VCPUs can be excluded
705from the update. These fields are nmi.pending and sipi_vector. Keep the
706corresponding bits in the flags field cleared to suppress overwriting the
707current in-kernel state. The bits are:
708
709KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel
710KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector
711
712
5965. The kvm_run structure 7135. The kvm_run structure
597 714
598Application code obtains a pointer to the kvm_run structure by 715Application code obtains a pointer to the kvm_run structure by
@@ -678,11 +795,11 @@ Unused.
678 __u64 data_offset; /* relative to kvm_run start */ 795 __u64 data_offset; /* relative to kvm_run start */
679 } io; 796 } io;
680 797
681If exit_reason is KVM_EXIT_IO_IN or KVM_EXIT_IO_OUT, then the vcpu has 798If exit_reason is KVM_EXIT_IO, then the vcpu has
682executed a port I/O instruction which could not be satisfied by kvm. 799executed a port I/O instruction which could not be satisfied by kvm.
683data_offset describes where the data is located (KVM_EXIT_IO_OUT) or 800data_offset describes where the data is located (KVM_EXIT_IO_OUT) or
684where kvm expects application code to place the data for the next 801where kvm expects application code to place the data for the next
685KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a patcked array. 802KVM_RUN invocation (KVM_EXIT_IO_IN). Data format is a packed array.
686 803
687 struct { 804 struct {
688 struct kvm_debug_exit_arch arch; 805 struct kvm_debug_exit_arch arch;
@@ -698,7 +815,7 @@ Unused.
698 __u8 is_write; 815 __u8 is_write;
699 } mmio; 816 } mmio;
700 817
701If exit_reason is KVM_EXIT_MMIO or KVM_EXIT_IO_OUT, then the vcpu has 818If exit_reason is KVM_EXIT_MMIO, then the vcpu has
702executed a memory-mapped I/O instruction which could not be satisfied 819executed a memory-mapped I/O instruction which could not be satisfied
703by kvm. The 'data' member contains the written data if 'is_write' is 820by kvm. The 'data' member contains the written data if 'is_write' is
704true, and should be filled by application code otherwise. 821true, and should be filled by application code otherwise.
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX
index ee5692b26dd4..fa688538e757 100644
--- a/Documentation/laptops/00-INDEX
+++ b/Documentation/laptops/00-INDEX
@@ -2,6 +2,12 @@
2 - This file 2 - This file
3acer-wmi.txt 3acer-wmi.txt
4 - information on the Acer Laptop WMI Extras driver. 4 - information on the Acer Laptop WMI Extras driver.
5asus-laptop.txt
6 - information on the Asus Laptop Extras driver.
7disk-shock-protection.txt
8 - information on hard disk shock protection.
9dslm.c
10 - Simple Disk Sleep Monitor program
5laptop-mode.txt 11laptop-mode.txt
6 - how to conserve battery power using laptop-mode. 12 - how to conserve battery power using laptop-mode.
7sony-laptop.txt 13sony-laptop.txt
diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makefile
new file mode 100644
index 000000000000..5cb144af3c09
--- /dev/null
+++ b/Documentation/laptops/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := dslm
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/laptops/dslm.c b/Documentation/laptops/dslm.c
new file mode 100644
index 000000000000..72ff290c5fc6
--- /dev/null
+++ b/Documentation/laptops/dslm.c
@@ -0,0 +1,166 @@
1/*
2 * dslm.c
3 * Simple Disk Sleep Monitor
4 * by Bartek Kania
5 * Licenced under the GPL
6 */
7#include <unistd.h>
8#include <stdlib.h>
9#include <stdio.h>
10#include <fcntl.h>
11#include <errno.h>
12#include <time.h>
13#include <string.h>
14#include <signal.h>
15#include <sys/ioctl.h>
16#include <linux/hdreg.h>
17
18#ifdef DEBUG
19#define D(x) x
20#else
21#define D(x)
22#endif
23
24int endit = 0;
25
26/* Check if the disk is in powersave-mode
27 * Most of the code is stolen from hdparm.
28 * 1 = active, 0 = standby/sleep, -1 = unknown */
29static int check_powermode(int fd)
30{
31 unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
32 int state;
33
34 if (ioctl(fd, HDIO_DRIVE_CMD, &args)
35 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
36 && ioctl(fd, HDIO_DRIVE_CMD, &args)) {
37 if (errno != EIO || args[0] != 0 || args[1] != 0) {
38 state = -1; /* "unknown"; */
39 } else
40 state = 0; /* "sleeping"; */
41 } else {
42 state = (args[2] == 255) ? 1 : 0;
43 }
44 D(printf(" drive state is: %d\n", state));
45
46 return state;
47}
48
49static char *state_name(int i)
50{
51 if (i == -1) return "unknown";
52 if (i == 0) return "sleeping";
53 if (i == 1) return "active";
54
55 return "internal error";
56}
57
58static char *myctime(time_t time)
59{
60 char *ts = ctime(&time);
61 ts[strlen(ts) - 1] = 0;
62
63 return ts;
64}
65
66static void measure(int fd)
67{
68 time_t start_time;
69 int last_state;
70 time_t last_time;
71 int curr_state;
72 time_t curr_time = 0;
73 time_t time_diff;
74 time_t active_time = 0;
75 time_t sleep_time = 0;
76 time_t unknown_time = 0;
77 time_t total_time = 0;
78 int changes = 0;
79 float tmp;
80
81 printf("Starting measurements\n");
82
83 last_state = check_powermode(fd);
84 start_time = last_time = time(0);
85 printf(" System is in state %s\n\n", state_name(last_state));
86
87 while(!endit) {
88 sleep(1);
89 curr_state = check_powermode(fd);
90
91 if (curr_state != last_state || endit) {
92 changes++;
93 curr_time = time(0);
94 time_diff = curr_time - last_time;
95
96 if (last_state == 1) active_time += time_diff;
97 else if (last_state == 0) sleep_time += time_diff;
98 else unknown_time += time_diff;
99
100 last_state = curr_state;
101 last_time = curr_time;
102
103 printf("%s: State-change to %s\n", myctime(curr_time),
104 state_name(curr_state));
105 }
106 }
107 changes--; /* Compensate for SIGINT */
108
109 total_time = time(0) - start_time;
110 printf("\nTotal running time: %lus\n", curr_time - start_time);
111 printf(" State changed %d times\n", changes);
112
113 tmp = (float)sleep_time / (float)total_time * 100;
114 printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp);
115 tmp = (float)active_time / (float)total_time * 100;
116 printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp);
117 tmp = (float)unknown_time / (float)total_time * 100;
118 printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp);
119}
120
121static void ender(int s)
122{
123 endit = 1;
124}
125
126static void usage(void)
127{
128 puts("usage: dslm [-w <time>] <disk>");
129 exit(0);
130}
131
132int main(int argc, char **argv)
133{
134 int fd;
135 char *disk = 0;
136 int settle_time = 60;
137
138 /* Parse the simple command-line */
139 if (argc == 2)
140 disk = argv[1];
141 else if (argc == 4) {
142 settle_time = atoi(argv[2]);
143 disk = argv[3];
144 } else
145 usage();
146
147 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) {
148 printf("Can't open %s, because: %s\n", disk, strerror(errno));
149 exit(-1);
150 }
151
152 if (settle_time) {
153 printf("Waiting %d seconds for the system to settle down to "
154 "'normal'\n", settle_time);
155 sleep(settle_time);
156 } else
157 puts("Not waiting for system to settle down");
158
159 signal(SIGINT, ender);
160
161 measure(fd);
162
163 close(fd);
164
165 return 0;
166}
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt
index eeedee11c8c2..2c3c35093023 100644
--- a/Documentation/laptops/laptop-mode.txt
+++ b/Documentation/laptops/laptop-mode.txt
@@ -779,172 +779,4 @@ Monitoring tool
779--------------- 779---------------
780 780
781Bartek Kania submitted this, it can be used to measure how much time your disk 781Bartek Kania submitted this, it can be used to measure how much time your disk
782spends spun up/down. 782spends spun up/down. See Documentation/laptops/dslm.c
783
784---------------------------dslm.c BEGIN-----------------------------------------
785/*
786 * Simple Disk Sleep Monitor
787 * by Bartek Kania
788 * Licenced under the GPL
789 */
790#include <unistd.h>
791#include <stdlib.h>
792#include <stdio.h>
793#include <fcntl.h>
794#include <errno.h>
795#include <time.h>
796#include <string.h>
797#include <signal.h>
798#include <sys/ioctl.h>
799#include <linux/hdreg.h>
800
801#ifdef DEBUG
802#define D(x) x
803#else
804#define D(x)
805#endif
806
807int endit = 0;
808
809/* Check if the disk is in powersave-mode
810 * Most of the code is stolen from hdparm.
811 * 1 = active, 0 = standby/sleep, -1 = unknown */
812int check_powermode(int fd)
813{
814 unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
815 int state;
816
817 if (ioctl(fd, HDIO_DRIVE_CMD, &args)
818 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
819 && ioctl(fd, HDIO_DRIVE_CMD, &args)) {
820 if (errno != EIO || args[0] != 0 || args[1] != 0) {
821 state = -1; /* "unknown"; */
822 } else
823 state = 0; /* "sleeping"; */
824 } else {
825 state = (args[2] == 255) ? 1 : 0;
826 }
827 D(printf(" drive state is: %d\n", state));
828
829 return state;
830}
831
832char *state_name(int i)
833{
834 if (i == -1) return "unknown";
835 if (i == 0) return "sleeping";
836 if (i == 1) return "active";
837
838 return "internal error";
839}
840
841char *myctime(time_t time)
842{
843 char *ts = ctime(&time);
844 ts[strlen(ts) - 1] = 0;
845
846 return ts;
847}
848
849void measure(int fd)
850{
851 time_t start_time;
852 int last_state;
853 time_t last_time;
854 int curr_state;
855 time_t curr_time = 0;
856 time_t time_diff;
857 time_t active_time = 0;
858 time_t sleep_time = 0;
859 time_t unknown_time = 0;
860 time_t total_time = 0;
861 int changes = 0;
862 float tmp;
863
864 printf("Starting measurements\n");
865
866 last_state = check_powermode(fd);
867 start_time = last_time = time(0);
868 printf(" System is in state %s\n\n", state_name(last_state));
869
870 while(!endit) {
871 sleep(1);
872 curr_state = check_powermode(fd);
873
874 if (curr_state != last_state || endit) {
875 changes++;
876 curr_time = time(0);
877 time_diff = curr_time - last_time;
878
879 if (last_state == 1) active_time += time_diff;
880 else if (last_state == 0) sleep_time += time_diff;
881 else unknown_time += time_diff;
882
883 last_state = curr_state;
884 last_time = curr_time;
885
886 printf("%s: State-change to %s\n", myctime(curr_time),
887 state_name(curr_state));
888 }
889 }
890 changes--; /* Compensate for SIGINT */
891
892 total_time = time(0) - start_time;
893 printf("\nTotal running time: %lus\n", curr_time - start_time);
894 printf(" State changed %d times\n", changes);
895
896 tmp = (float)sleep_time / (float)total_time * 100;
897 printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp);
898 tmp = (float)active_time / (float)total_time * 100;
899 printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp);
900 tmp = (float)unknown_time / (float)total_time * 100;
901 printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp);
902}
903
904void ender(int s)
905{
906 endit = 1;
907}
908
909void usage()
910{
911 puts("usage: dslm [-w <time>] <disk>");
912 exit(0);
913}
914
915int main(int argc, char **argv)
916{
917 int fd;
918 char *disk = 0;
919 int settle_time = 60;
920
921 /* Parse the simple command-line */
922 if (argc == 2)
923 disk = argv[1];
924 else if (argc == 4) {
925 settle_time = atoi(argv[2]);
926 disk = argv[3];
927 } else
928 usage();
929
930 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) {
931 printf("Can't open %s, because: %s\n", disk, strerror(errno));
932 exit(-1);
933 }
934
935 if (settle_time) {
936 printf("Waiting %d seconds for the system to settle down to "
937 "'normal'\n", settle_time);
938 sleep(settle_time);
939 } else
940 puts("Not waiting for system to settle down");
941
942 signal(SIGINT, ender);
943
944 measure(fd);
945
946 close(fd);
947
948 return 0;
949}
950---------------------------dslm.c END-------------------------------------------
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index aafcaa634191..39c0a09d0105 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1,7 +1,7 @@
1 ThinkPad ACPI Extras Driver 1 ThinkPad ACPI Extras Driver
2 2
3 Version 0.23 3 Version 0.24
4 April 10th, 2009 4 December 11th, 2009
5 5
6 Borislav Deianov <borislav@users.sf.net> 6 Borislav Deianov <borislav@users.sf.net>
7 Henrique de Moraes Holschuh <hmh@hmh.eng.br> 7 Henrique de Moraes Holschuh <hmh@hmh.eng.br>
@@ -460,6 +460,8 @@ event code Key Notes
460 For Lenovo ThinkPads with a new 460 For Lenovo ThinkPads with a new
461 BIOS, it has to be handled either 461 BIOS, it has to be handled either
462 by the ACPI OSI, or by userspace. 462 by the ACPI OSI, or by userspace.
463 The driver does the right thing,
464 never mess with this.
4630x1011 0x10 FN+END Brightness down. See brightness 4650x1011 0x10 FN+END Brightness down. See brightness
464 up for details. 466 up for details.
465 467
@@ -582,46 +584,15 @@ with hotkey_report_mode.
582 584
583Brightness hotkey notes: 585Brightness hotkey notes:
584 586
585These are the current sane choices for brightness key mapping in 587Don't mess with the brightness hotkeys in a Thinkpad. If you want
586thinkpad-acpi: 588notifications for OSD, use the sysfs backlight class event support.
587 589
588For IBM and Lenovo models *without* ACPI backlight control (the ones on 590The driver will issue KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN events
589which thinkpad-acpi will autoload its backlight interface by default, 591automatically for the cases were userspace has to do something to
590and on which ACPI video does not export a backlight interface): 592implement brightness changes. When you override these events, you will
591 593either fail to handle properly the ThinkPads that require explicit
5921. Don't enable or map the brightness hotkeys in thinkpad-acpi, as 594action to change backlight brightness, or the ThinkPads that require
593 these older firmware versions unfortunately won't respect the hotkey 595that no action be taken to work properly.
594 mask for brightness keys anyway, and always reacts to them. This
595 usually work fine, unless X.org drivers are doing something to block
596 the BIOS. In that case, use (3) below. This is the default mode of
597 operation.
598
5992. Enable the hotkeys, but map them to something else that is NOT
600 KEY_BRIGHTNESS_UP/DOWN or any other keycode that would cause
601 userspace to try to change the backlight level, and use that as an
602 on-screen-display hint.
603
6043. IF AND ONLY IF X.org drivers find a way to block the firmware from
605 automatically changing the brightness, enable the hotkeys and map
606 them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN, and feed that to
607 something that calls xbacklight. thinkpad-acpi will not be able to
608 change brightness in that case either, so you should disable its
609 backlight interface.
610
611For Lenovo models *with* ACPI backlight control:
612
6131. Load up ACPI video and use that. ACPI video will report ACPI
614 events for brightness change keys. Do not mess with thinkpad-acpi
615 defaults in this case. thinkpad-acpi should not have anything to do
616 with backlight events in a scenario where ACPI video is loaded:
617 brightness hotkeys must be disabled, and the backlight interface is
618 to be kept disabled as well. This is the default mode of operation.
619
6202. Do *NOT* load up ACPI video, enable the hotkeys in thinkpad-acpi,
621 and map them to KEY_BRIGHTNESS_UP and KEY_BRIGHTNESS_DOWN. Process
622 these keys on userspace somehow (e.g. by calling xbacklight).
623 The driver will do this automatically if it detects that ACPI video
624 has been disabled.
625 596
626 597
627Bluetooth 598Bluetooth
@@ -679,6 +650,10 @@ LCD, CRT or DVI (if available). The following commands are available:
679 echo expand_toggle > /proc/acpi/ibm/video 650 echo expand_toggle > /proc/acpi/ibm/video
680 echo video_switch > /proc/acpi/ibm/video 651 echo video_switch > /proc/acpi/ibm/video
681 652
653NOTE: Access to this feature is restricted to processes owning the
654CAP_SYS_ADMIN capability for safety reasons, as it can interact badly
655enough with some versions of X.org to crash it.
656
682Each video output device can be enabled or disabled individually. 657Each video output device can be enabled or disabled individually.
683Reading /proc/acpi/ibm/video shows the status of each device. 658Reading /proc/acpi/ibm/video shows the status of each device.
684 659
@@ -1121,25 +1096,103 @@ WARNING:
1121 its level up and down at every change. 1096 its level up and down at every change.
1122 1097
1123 1098
1124Volume control -- /proc/acpi/ibm/volume 1099Volume control (Console Audio control)
1125--------------------------------------- 1100--------------------------------------
1101
1102procfs: /proc/acpi/ibm/volume
1103ALSA: "ThinkPad Console Audio Control", default ID: "ThinkPadEC"
1104
1105NOTE: by default, the volume control interface operates in read-only
1106mode, as it is supposed to be used for on-screen-display purposes.
1107The read/write mode can be enabled through the use of the
1108"volume_control=1" module parameter.
1109
1110NOTE: distros are urged to not enable volume_control by default, this
1111should be done by the local admin only. The ThinkPad UI is for the
1112console audio control to be done through the volume keys only, and for
1113the desktop environment to just provide on-screen-display feedback.
1114Software volume control should be done only in the main AC97/HDA
1115mixer.
1116
1117
1118About the ThinkPad Console Audio control:
1119
1120ThinkPads have a built-in amplifier and muting circuit that drives the
1121console headphone and speakers. This circuit is after the main AC97
1122or HDA mixer in the audio path, and under exclusive control of the
1123firmware.
1124
1125ThinkPads have three special hotkeys to interact with the console
1126audio control: volume up, volume down and mute.
1127
1128It is worth noting that the normal way the mute function works (on
1129ThinkPads that do not have a "mute LED") is:
1126 1130
1127This feature allows volume control on ThinkPad models which don't have 11311. Press mute to mute. It will *always* mute, you can press it as
1128a hardware volume knob. The available commands are: 1132 many times as you want, and the sound will remain mute.
1133
11342. Press either volume key to unmute the ThinkPad (it will _not_
1135 change the volume, it will just unmute).
1136
1137This is a very superior design when compared to the cheap software-only
1138mute-toggle solution found on normal consumer laptops: you can be
1139absolutely sure the ThinkPad will not make noise if you press the mute
1140button, no matter the previous state.
1141
1142The IBM ThinkPads, and the earlier Lenovo ThinkPads have variable-gain
1143amplifiers driving the speakers and headphone output, and the firmware
1144also handles volume control for the headphone and speakers on these
1145ThinkPads without any help from the operating system (this volume
1146control stage exists after the main AC97 or HDA mixer in the audio
1147path).
1148
1149The newer Lenovo models only have firmware mute control, and depend on
1150the main HDA mixer to do volume control (which is done by the operating
1151system). In this case, the volume keys are filtered out for unmute
1152key press (there are some firmware bugs in this area) and delivered as
1153normal key presses to the operating system (thinkpad-acpi is not
1154involved).
1155
1156
1157The ThinkPad-ACPI volume control:
1158
1159The preferred way to interact with the Console Audio control is the
1160ALSA interface.
1161
1162The legacy procfs interface allows one to read the current state,
1163and if volume control is enabled, accepts the following commands:
1129 1164
1130 echo up >/proc/acpi/ibm/volume 1165 echo up >/proc/acpi/ibm/volume
1131 echo down >/proc/acpi/ibm/volume 1166 echo down >/proc/acpi/ibm/volume
1132 echo mute >/proc/acpi/ibm/volume 1167 echo mute >/proc/acpi/ibm/volume
1168 echo unmute >/proc/acpi/ibm/volume
1133 echo 'level <level>' >/proc/acpi/ibm/volume 1169 echo 'level <level>' >/proc/acpi/ibm/volume
1134 1170
1135The <level> number range is 0 to 15 although not all of them may be 1171The <level> number range is 0 to 14 although not all of them may be
1136distinct. The unmute the volume after the mute command, use either the 1172distinct. To unmute the volume after the mute command, use either the
1137up or down command (the level command will not unmute the volume). 1173up or down command (the level command will not unmute the volume), or
1138The current volume level and mute state is shown in the file. 1174the unmute command.
1175
1176You can use the volume_capabilities parameter to tell the driver
1177whether your thinkpad has volume control or mute-only control:
1178volume_capabilities=1 for mixers with mute and volume control,
1179volume_capabilities=2 for mixers with only mute control.
1180
1181If the driver misdetects the capabilities for your ThinkPad model,
1182please report this to ibm-acpi-devel@lists.sourceforge.net, so that we
1183can update the driver.
1184
1185There are two strategies for volume control. To select which one
1186should be used, use the volume_mode module parameter: volume_mode=1
1187selects EC mode, and volume_mode=3 selects EC mode with NVRAM backing
1188(so that volume/mute changes are remembered across shutdown/reboot).
1139 1189
1140The ALSA mixer interface to this feature is still missing, but patches 1190The driver will operate in volume_mode=3 by default. If that does not
1141to add it exist. That problem should be addressed in the not so 1191work well on your ThinkPad model, please report this to
1142distant future. 1192ibm-acpi-devel@lists.sourceforge.net.
1193
1194The driver supports the standard ALSA module parameters. If the ALSA
1195mixer is disabled, the driver will disable all volume functionality.
1143 1196
1144 1197
1145Fan control and monitoring: fan speed, fan enable/disable 1198Fan control and monitoring: fan speed, fan enable/disable
@@ -1405,6 +1458,7 @@ to enable more than one output class, just add their values.
1405 0x0008 HKEY event interface, hotkeys 1458 0x0008 HKEY event interface, hotkeys
1406 0x0010 Fan control 1459 0x0010 Fan control
1407 0x0020 Backlight brightness 1460 0x0020 Backlight brightness
1461 0x0040 Audio mixer/volume control
1408 1462
1409There is also a kernel build option to enable more debugging 1463There is also a kernel build option to enable more debugging
1410information, which may be necessary to debug driver problems. 1464information, which may be necessary to debug driver problems.
@@ -1465,3 +1519,9 @@ Sysfs interface changelog:
1465 and it is always able to disable hot keys. Very old 1519 and it is always able to disable hot keys. Very old
1466 thinkpads are properly supported. hotkey_bios_mask 1520 thinkpads are properly supported. hotkey_bios_mask
1467 is deprecated and marked for removal. 1521 is deprecated and marked for removal.
1522
15230x020600: Marker for backlight change event support.
1524
15250x020700: Support for mute-only mixers.
1526 Volume control in read-only mode by default.
1527 Marker for ALSA mixer support.
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index ba9373f82ab5..3119f5db75bd 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -34,7 +34,6 @@
34#include <sys/uio.h> 34#include <sys/uio.h>
35#include <termios.h> 35#include <termios.h>
36#include <getopt.h> 36#include <getopt.h>
37#include <zlib.h>
38#include <assert.h> 37#include <assert.h>
39#include <sched.h> 38#include <sched.h>
40#include <limits.h> 39#include <limits.h>
@@ -42,7 +41,6 @@
42#include <signal.h> 41#include <signal.h>
43#include "linux/lguest_launcher.h" 42#include "linux/lguest_launcher.h"
44#include "linux/virtio_config.h" 43#include "linux/virtio_config.h"
45#include <linux/virtio_ids.h>
46#include "linux/virtio_net.h" 44#include "linux/virtio_net.h"
47#include "linux/virtio_blk.h" 45#include "linux/virtio_blk.h"
48#include "linux/virtio_console.h" 46#include "linux/virtio_console.h"
@@ -305,7 +303,7 @@ static void *map_zeroed_pages(unsigned int num)
305 addr = mmap(NULL, getpagesize() * num, 303 addr = mmap(NULL, getpagesize() * num,
306 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 304 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
307 if (addr == MAP_FAILED) 305 if (addr == MAP_FAILED)
308 err(1, "Mmaping %u pages of /dev/zero", num); 306 err(1, "Mmapping %u pages of /dev/zero", num);
309 307
310 /* 308 /*
311 * One neat mmap feature is that you can close the fd, and it 309 * One neat mmap feature is that you can close the fd, and it
diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt
index 9cb9138f7a79..65f4c795015d 100644
--- a/Documentation/lockstat.txt
+++ b/Documentation/lockstat.txt
@@ -62,8 +62,20 @@ applicable).
62It also tracks 4 contention points per class. A contention point is a call site 62It also tracks 4 contention points per class. A contention point is a call site
63that had to wait on lock acquisition. 63that had to wait on lock acquisition.
64 64
65 - CONFIGURATION
66
67Lock statistics are enabled via CONFIG_LOCK_STATS.
68
65 - USAGE 69 - USAGE
66 70
71Enable collection of statistics:
72
73# echo 1 >/proc/sys/kernel/lock_stat
74
75Disable collection of statistics:
76
77# echo 0 >/proc/sys/kernel/lock_stat
78
67Look at the current lock statistics: 79Look at the current lock statistics:
68 80
69( line numbers not part of actual output, done for clarity in the explanation 81( line numbers not part of actual output, done for clarity in the explanation
diff --git a/Documentation/md.txt b/Documentation/md.txt
index 4edd39ec7db9..188f4768f1d5 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -233,9 +233,9 @@ All md devices contain:
233 233
234 resync_start 234 resync_start
235 The point at which resync should start. If no resync is needed, 235 The point at which resync should start. If no resync is needed,
236 this will be a very large number. At array creation it will 236 this will be a very large number (or 'none' since 2.6.30-rc1). At
237 default to 0, though starting the array as 'clean' will 237 array creation it will default to 0, though starting the array as
238 set it much larger. 238 'clean' will set it much larger.
239 239
240 new_dev 240 new_dev
241 This file can be written but not read. The value written should 241 This file can be written but not read. The value written should
@@ -296,6 +296,51 @@ All md devices contain:
296 active-idle 296 active-idle
297 like active, but no writes have been seen for a while (safe_mode_delay). 297 like active, but no writes have been seen for a while (safe_mode_delay).
298 298
299 bitmap/location
300 This indicates where the write-intent bitmap for the array is
301 stored.
302 It can be one of "none", "file" or "[+-]N".
303 "file" may later be extended to "file:/file/name"
304 "[+-]N" means that many sectors from the start of the metadata.
305 This is replicated on all devices. For arrays with externally
306 managed metadata, the offset is from the beginning of the
307 device.
308 bitmap/chunksize
309 The size, in bytes, of the chunk which will be represented by a
310 single bit. For RAID456, it is a portion of an individual
311 device. For RAID10, it is a portion of the array. For RAID1, it
312 is both (they come to the same thing).
313 bitmap/time_base
314 The time, in seconds, between looking for bits in the bitmap to
315 be cleared. In the current implementation, a bit will be cleared
316 between 2 and 3 times "time_base" after all the covered blocks
317 are known to be in-sync.
318 bitmap/backlog
319 When write-mostly devices are active in a RAID1, write requests
320 to those devices proceed in the background - the filesystem (or
321 other user of the device) does not have to wait for them.
322 'backlog' sets a limit on the number of concurrent background
323 writes. If there are more than this, new writes will by
324 synchronous.
325 bitmap/metadata
326 This can be either 'internal' or 'external'.
327 'internal' is the default and means the metadata for the bitmap
328 is stored in the first 256 bytes of the allocated space and is
329 managed by the md module.
330 'external' means that bitmap metadata is managed externally to
331 the kernel (i.e. by some userspace program)
332 bitmap/can_clear
333 This is either 'true' or 'false'. If 'true', then bits in the
334 bitmap will be cleared when the corresponding blocks are thought
335 to be in-sync. If 'false', bits will never be cleared.
336 This is automatically set to 'false' if a write happens on a
337 degraded array, or if the array becomes degraded during a write.
338 When metadata is managed externally, it should be set to true
339 once the array becomes non-degraded, and this fact has been
340 recorded in the metadata.
341
342
343
299 344
300As component devices are added to an md array, they appear in the 'md' 345As component devices are added to an md array, they appear in the 'md'
301directory as new directories named 346directory as new directories named
@@ -334,8 +379,9 @@ Each directory contains:
334 Writing "writemostly" sets the writemostly flag. 379 Writing "writemostly" sets the writemostly flag.
335 Writing "-writemostly" clears the writemostly flag. 380 Writing "-writemostly" clears the writemostly flag.
336 Writing "blocked" sets the "blocked" flag. 381 Writing "blocked" sets the "blocked" flag.
337 Writing "-blocked" clear the "blocked" flag and allows writes 382 Writing "-blocked" clears the "blocked" flag and allows writes
338 to complete. 383 to complete.
384 Writing "in_sync" sets the in_sync flag.
339 385
340 This file responds to select/poll. Any change to 'faulty' 386 This file responds to select/poll. Any change to 'faulty'
341 or 'blocked' causes an event. 387 or 'blocked' causes an event.
@@ -372,6 +418,24 @@ Each directory contains:
372 array. If a value less than the current component_size is 418 array. If a value less than the current component_size is
373 written, it will be rejected. 419 written, it will be rejected.
374 420
421 recovery_start
422
423 When the device is not 'in_sync', this records the number of
424 sectors from the start of the device which are known to be
425 correct. This is normally zero, but during a recovery
426 operation is will steadily increase, and if the recovery is
427 interrupted, restoring this value can cause recovery to
428 avoid repeating the earlier blocks. With v1.x metadata, this
429 value is saved and restored automatically.
430
431 This can be set whenever the device is not an active member of
432 the array, either before the array is activated, or before
433 the 'slot' is set.
434
435 Setting this to 'none' is equivalent to setting 'in_sync'.
436 Setting to any other value also clears the 'in_sync' flag.
437
438
375 439
376An active md device will also contain and entry for each active device 440An active md device will also contain and entry for each active device
377in the array. These are named 441in the array. These are named
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
index bbc8a6a36921..57e7e9cc1870 100644
--- a/Documentation/memory-hotplug.txt
+++ b/Documentation/memory-hotplug.txt
@@ -160,12 +160,15 @@ Under each section, you can see 4 files.
160NOTE: 160NOTE:
161 These directories/files appear after physical memory hotplug phase. 161 These directories/files appear after physical memory hotplug phase.
162 162
163If CONFIG_NUMA is enabled the 163If CONFIG_NUMA is enabled the memoryXXX/ directories can also be accessed
164/sys/devices/system/memory/memoryXXX memory section 164via symbolic links located in the /sys/devices/system/node/node* directories.
165directories can also be accessed via symbolic links located in 165
166the /sys/devices/system/node/node* directories. For example: 166For example:
167/sys/devices/system/node/node0/memory9 -> ../../memory/memory9 167/sys/devices/system/node/node0/memory9 -> ../../memory/memory9
168 168
169A backlink will also be created:
170/sys/devices/system/memory/memory9/node0 -> ../../node/node0
171
169-------------------------------- 172--------------------------------
1704. Physical memory hot-add phase 1734. Physical memory hot-add phase
171-------------------------------- 174--------------------------------
diff --git a/Documentation/misc-devices/ad525x_dpot.txt b/Documentation/misc-devices/ad525x_dpot.txt
new file mode 100644
index 000000000000..0c9413b1cbf3
--- /dev/null
+++ b/Documentation/misc-devices/ad525x_dpot.txt
@@ -0,0 +1,57 @@
1---------------------------------
2 AD525x Digital Potentiometers
3---------------------------------
4
5The ad525x_dpot driver exports a simple sysfs interface. This allows you to
6work with the immediate resistance settings as well as update the saved startup
7settings. Access to the factory programmed tolerance is also provided, but
8interpretation of this settings is required by the end application according to
9the specific part in use.
10
11---------
12 Files
13---------
14
15Each dpot device will have a set of eeprom, rdac, and tolerance files. How
16many depends on the actual part you have, as will the range of allowed values.
17
18The eeprom files are used to program the startup value of the device.
19
20The rdac files are used to program the immediate value of the device.
21
22The tolerance files are the read-only factory programmed tolerance settings
23and may vary greatly on a part-by-part basis. For exact interpretation of
24this field, please consult the datasheet for your part. This is presented
25as a hex file for easier parsing.
26
27-----------
28 Example
29-----------
30
31Locate the device in your sysfs tree. This is probably easiest by going into
32the common i2c directory and locating the device by the i2c slave address.
33
34 # ls /sys/bus/i2c/devices/
35 0-0022 0-0027 0-002f
36
37So assuming the device in question is on the first i2c bus and has the slave
38address of 0x2f, we descend (unrelated sysfs entries have been trimmed).
39
40 # ls /sys/bus/i2c/devices/0-002f/
41 eeprom0 rdac0 tolerance0
42
43You can use simple reads/writes to access these files:
44
45 # cd /sys/bus/i2c/devices/0-002f/
46
47 # cat eeprom0
48 0
49 # echo 10 > eeprom0
50 # cat eeprom0
51 10
52
53 # cat rdac0
54 5
55 # echo 3 > rdac0
56 # cat rdac0
57 3
diff --git a/Documentation/c2port.txt b/Documentation/misc-devices/c2port.txt
index d9bf93ea4398..d9bf93ea4398 100644
--- a/Documentation/c2port.txt
+++ b/Documentation/misc-devices/c2port.txt
diff --git a/Documentation/i2c/chips/eeprom b/Documentation/misc-devices/eeprom
index f7e8104b5764..f7e8104b5764 100644
--- a/Documentation/i2c/chips/eeprom
+++ b/Documentation/misc-devices/eeprom
diff --git a/Documentation/ics932s401 b/Documentation/misc-devices/ics932s401
index 07a739f406d8..07a739f406d8 100644
--- a/Documentation/ics932s401
+++ b/Documentation/misc-devices/ics932s401
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/misc-devices/max6875
index 10ca43cd1a72..1e89ee3ccc1b 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/misc-devices/max6875
@@ -42,10 +42,12 @@ General Remarks
42 42
43Valid addresses for the MAX6875 are 0x50 and 0x52. 43Valid addresses for the MAX6875 are 0x50 and 0x52.
44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56. 44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
45The driver does not probe any address, so you must force the address. 45The driver does not probe any address, so you explicitly instantiate the
46devices.
46 47
47Example: 48Example:
48$ modprobe max6875 force=0,0x50 49$ modprobe max6875
50$ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device
49 51
50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple 52The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51addresses. For example, for address 0x50, it also reserves 0x51. 53addresses. For example, for address 0x50, it also reserves 0x51.
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX
index 50189bf07d53..fe5c099b8fc8 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -32,6 +32,8 @@ cs89x0.txt
32 - the Crystal LAN (CS8900/20-based) Ethernet ISA adapter driver 32 - the Crystal LAN (CS8900/20-based) Ethernet ISA adapter driver
33cxacru.txt 33cxacru.txt
34 - Conexant AccessRunner USB ADSL Modem 34 - Conexant AccessRunner USB ADSL Modem
35cxacru-cf.py
36 - Conexant AccessRunner USB ADSL Modem configuration file parser
35de4x5.txt 37de4x5.txt
36 - the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver 38 - the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver
37decnet.txt 39decnet.txt
diff --git a/Documentation/networking/3c509.txt b/Documentation/networking/3c509.txt
index 0643e3b7168c..3c45d5dcd63b 100644
--- a/Documentation/networking/3c509.txt
+++ b/Documentation/networking/3c509.txt
@@ -48,11 +48,11 @@ for LILO parameters for doing this:
48This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and 48This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
49transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts 49transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
50with other card types when overriding the I/O address. When the driver is 50with other card types when overriding the I/O address. When the driver is
51loaded as a module, only the IRQ and transceiver setting may be overridden. 51loaded as a module, only the IRQ may be overridden. For example,
52For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using 52setting two cards to IRQ10 and IRQ11 is done by using the irq module
53the xcvr and irq module options: 53option:
54 54
55 options 3c509 xcvr=3,1 irq=10,11 55 options 3c509 irq=10,11
56 56
57 57
58(2) Full-duplex mode 58(2) Full-duplex mode
@@ -77,6 +77,8 @@ operation.
77itself full-duplex capable. This is almost certainly one of two things: a full- 77itself full-duplex capable. This is almost certainly one of two things: a full-
78duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on 78duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
79another system that's connected directly to the 3c509B via a crossover cable. 79another system that's connected directly to the 3c509B via a crossover cable.
80
81Full-duplex mode can be enabled using 'ethtool'.
80 82
81/////Extremely important caution concerning full-duplex mode///// 83/////Extremely important caution concerning full-duplex mode/////
82Understand that the 3c509B's hardware's full-duplex support is much more 84Understand that the 3c509B's hardware's full-duplex support is much more
@@ -113,6 +115,8 @@ This insured that merely upgrading the driver from an earlier version would
113never automatically enable full-duplex mode in an existing installation; 115never automatically enable full-duplex mode in an existing installation;
114it must always be explicitly enabled via one of these code in order to be 116it must always be explicitly enabled via one of these code in order to be
115activated. 117activated.
118
119The transceiver type can be changed using 'ethtool'.
116 120
117 121
118(4a) Interpretation of error messages and common problems 122(4a) Interpretation of error messages and common problems
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile
index 6d8af1ac56c4..5aba7a33aeeb 100644
--- a/Documentation/networking/Makefile
+++ b/Documentation/networking/Makefile
@@ -6,3 +6,5 @@ hostprogs-y := ifenslave
6 6
7# Tell kbuild to always build the programs 7# Tell kbuild to always build the programs
8always := $(hostprogs-y) 8always := $(hostprogs-y)
9
10obj-m := timestamping/
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index d5181ce9ff62..61f516b135b4 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -1,7 +1,7 @@
1 1
2 Linux Ethernet Bonding Driver HOWTO 2 Linux Ethernet Bonding Driver HOWTO
3 3
4 Latest update: 12 November 2007 4 Latest update: 23 September 2009
5 5
6Initial release : Thomas Davis <tadavis at lbl.gov> 6Initial release : Thomas Davis <tadavis at lbl.gov>
7Corrections, HA extensions : 2000/10/03-15 : 7Corrections, HA extensions : 2000/10/03-15 :
@@ -614,6 +614,46 @@ primary
614 614
615 The primary option is only valid for active-backup mode. 615 The primary option is only valid for active-backup mode.
616 616
617primary_reselect
618
619 Specifies the reselection policy for the primary slave. This
620 affects how the primary slave is chosen to become the active slave
621 when failure of the active slave or recovery of the primary slave
622 occurs. This option is designed to prevent flip-flopping between
623 the primary slave and other slaves. Possible values are:
624
625 always or 0 (default)
626
627 The primary slave becomes the active slave whenever it
628 comes back up.
629
630 better or 1
631
632 The primary slave becomes the active slave when it comes
633 back up, if the speed and duplex of the primary slave is
634 better than the speed and duplex of the current active
635 slave.
636
637 failure or 2
638
639 The primary slave becomes the active slave only if the
640 current active slave fails and the primary slave is up.
641
642 The primary_reselect setting is ignored in two cases:
643
644 If no slaves are active, the first slave to recover is
645 made the active slave.
646
647 When initially enslaved, the primary slave is always made
648 the active slave.
649
650 Changing the primary_reselect policy via sysfs will cause an
651 immediate selection of the best active slave according to the new
652 policy. This may or may not result in a change of the active
653 slave, depending upon the circumstances.
654
655 This option was added for bonding version 3.6.0.
656
617updelay 657updelay
618 658
619 Specifies the time, in milliseconds, to wait before enabling a 659 Specifies the time, in milliseconds, to wait before enabling a
diff --git a/Documentation/networking/cxacru-cf.py b/Documentation/networking/cxacru-cf.py
new file mode 100644
index 000000000000..b41d298398c8
--- /dev/null
+++ b/Documentation/networking/cxacru-cf.py
@@ -0,0 +1,48 @@
1#!/usr/bin/env python
2# Copyright 2009 Simon Arlott
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the Free
6# Software Foundation; either version 2 of the License, or (at your option)
7# any later version.
8#
9# This program is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12# more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# this program; if not, write to the Free Software Foundation, Inc., 59
16# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17#
18# Usage: cxacru-cf.py < cxacru-cf.bin
19# Output: values string suitable for the sysfs adsl_config attribute
20#
21# Warning: cxacru-cf.bin with MD5 hash cdbac2689969d5ed5d4850f117702110
22# contains mis-aligned values which will stop the modem from being able
23# to make a connection. If the first and last two bytes are removed then
24# the values become valid, but the modulation will be forced to ANSI
25# T1.413 only which may not be appropriate.
26#
27# The original binary format is a packed list of le32 values.
28
29import sys
30import struct
31
32i = 0
33while True:
34 buf = sys.stdin.read(4)
35
36 if len(buf) == 0:
37 break
38 elif len(buf) != 4:
39 sys.stdout.write("\n")
40 sys.stderr.write("Error: read {0} not 4 bytes\n".format(len(buf)))
41 sys.exit(1)
42
43 if i > 0:
44 sys.stdout.write(" ")
45 sys.stdout.write("{0:x}={1}".format(i, struct.unpack("<I", buf)[0]))
46 i += 1
47
48sys.stdout.write("\n")
diff --git a/Documentation/networking/cxacru.txt b/Documentation/networking/cxacru.txt
index b074681a963e..2cce04457b4d 100644
--- a/Documentation/networking/cxacru.txt
+++ b/Documentation/networking/cxacru.txt
@@ -4,6 +4,12 @@ While it is capable of managing/maintaining the ADSL connection without the
4module loaded, the device will sometimes stop responding after unloading the 4module loaded, the device will sometimes stop responding after unloading the
5driver and it is necessary to unplug/remove power to the device to fix this. 5driver and it is necessary to unplug/remove power to the device to fix this.
6 6
7Note: support for cxacru-cf.bin has been removed. It was not loaded correctly
8so it had no effect on the device configuration. Fixing it could have stopped
9existing devices working when an invalid configuration is supplied.
10
11There is a script cxacru-cf.py to convert an existing file to the sysfs form.
12
7Detected devices will appear as ATM devices named "cxacru". In /sys/class/atm/ 13Detected devices will appear as ATM devices named "cxacru". In /sys/class/atm/
8these are directories named cxacruN where N is the device number. A symlink 14these are directories named cxacruN where N is the device number. A symlink
9named device points to the USB interface device's directory which contains 15named device points to the USB interface device's directory which contains
@@ -15,6 +21,15 @@ several sysfs attribute files for retrieving device statistics:
15* adsl_headend_environment 21* adsl_headend_environment
16 Information about the remote headend. 22 Information about the remote headend.
17 23
24* adsl_config
25 Configuration writing interface.
26 Write parameters in hexadecimal format <index>=<value>,
27 separated by whitespace, e.g.:
28 "1=0 a=5"
29 Up to 7 parameters at a time will be sent and the modem will restart
30 the ADSL connection when any value is set. These are logged for future
31 reference.
32
18* downstream_attenuation (dB) 33* downstream_attenuation (dB)
19* downstream_bits_per_frame 34* downstream_bits_per_frame
20* downstream_rate (kbps) 35* downstream_rate (kbps)
@@ -61,6 +76,7 @@ several sysfs attribute files for retrieving device statistics:
61* mac_address 76* mac_address
62 77
63* modulation 78* modulation
79 "" (when not connected)
64 "ANSI T1.413" 80 "ANSI T1.413"
65 "ITU-T G.992.1 (G.DMT)" 81 "ITU-T G.992.1 (G.DMT)"
66 "ITU-T G.992.2 (G.LITE)" 82 "ITU-T G.992.2 (G.LITE)"
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt
index b132e4a3cf0f..a62fdf7a6bff 100644
--- a/Documentation/networking/dccp.txt
+++ b/Documentation/networking/dccp.txt
@@ -58,8 +58,10 @@ DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet
58size (application payload size) in bytes, see RFC 4340, section 14. 58size (application payload size) in bytes, see RFC 4340, section 14.
59 59
60DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs 60DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs
61supported by the endpoint (see include/linux/dccp.h for symbolic constants). 61supported by the endpoint. The option value is an array of type uint8_t whose
62The caller needs to provide a sufficiently large (> 2) array of type uint8_t. 62size is passed as option length. The minimum array size is 4 elements, the
63value returned in the optlen argument always reflects the true number of
64built-in CCIDs.
63 65
64DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same 66DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same
65time, combining the operation of the next two socket options. This option is 67time, combining the operation of the next two socket options. This option is
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index fbe427a6580c..8b72c88ba213 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -164,6 +164,14 @@ tcp_congestion_control - STRING
164 additional choices may be available based on kernel configuration. 164 additional choices may be available based on kernel configuration.
165 Default is set as part of kernel configuration. 165 Default is set as part of kernel configuration.
166 166
167tcp_cookie_size - INTEGER
168 Default size of TCP Cookie Transactions (TCPCT) option, that may be
169 overridden on a per socket basis by the TCPCT socket option.
170 Values greater than the maximum (16) are interpreted as the maximum.
171 Values greater than zero and less than the minimum (8) are interpreted
172 as the minimum. Odd values are interpreted as the next even value.
173 Default: 0 (off).
174
167tcp_dsack - BOOLEAN 175tcp_dsack - BOOLEAN
168 Allows TCP to send "duplicate" SACKs. 176 Allows TCP to send "duplicate" SACKs.
169 177
@@ -479,6 +487,30 @@ tcp_dma_copybreak - INTEGER
479 and CONFIG_NET_DMA is enabled. 487 and CONFIG_NET_DMA is enabled.
480 Default: 4096 488 Default: 4096
481 489
490tcp_thin_linear_timeouts - BOOLEAN
491 Enable dynamic triggering of linear timeouts for thin streams.
492 If set, a check is performed upon retransmission by timeout to
493 determine if the stream is thin (less than 4 packets in flight).
494 As long as the stream is found to be thin, up to 6 linear
495 timeouts may be performed before exponential backoff mode is
496 initiated. This improves retransmission latency for
497 non-aggressive thin streams, often found to be time-dependent.
498 For more information on thin streams, see
499 Documentation/networking/tcp-thin.txt
500 Default: 0
501
502tcp_thin_dupack - BOOLEAN
503 Enable dynamic triggering of retransmissions after one dupACK
504 for thin streams. If set, a check is performed upon reception
505 of a dupACK to determine if the stream is thin (less than 4
506 packets in flight). As long as the stream is found to be thin,
507 data is retransmitted on the first received dupACK. This
508 improves retransmission latency for non-aggressive thin
509 streams, often found to be time-dependent.
510 For more information on thin streams, see
511 Documentation/networking/tcp-thin.txt
512 Default: 0
513
482UDP variables: 514UDP variables:
483 515
484udp_mem - vector of 3 INTEGERs: min, pressure, max 516udp_mem - vector of 3 INTEGERs: min, pressure, max
@@ -684,6 +716,25 @@ proxy_arp - BOOLEAN
684 conf/{all,interface}/proxy_arp is set to TRUE, 716 conf/{all,interface}/proxy_arp is set to TRUE,
685 it will be disabled otherwise 717 it will be disabled otherwise
686 718
719proxy_arp_pvlan - BOOLEAN
720 Private VLAN proxy arp.
721 Basically allow proxy arp replies back to the same interface
722 (from which the ARP request/solicitation was received).
723
724 This is done to support (ethernet) switch features, like RFC
725 3069, where the individual ports are NOT allowed to
726 communicate with each other, but they are allowed to talk to
727 the upstream router. As described in RFC 3069, it is possible
728 to allow these hosts to communicate through the upstream
729 router by proxy_arp'ing. Don't need to be used together with
730 proxy_arp.
731
732 This technology is known by different names:
733 In RFC 3069 it is called VLAN Aggregation.
734 Cisco and Allied Telesyn call it Private VLAN.
735 Hewlett-Packard call it Source-Port filtering or port-isolation.
736 Ericsson call it MAC-Forced Forwarding (RFC Draft).
737
687shared_media - BOOLEAN 738shared_media - BOOLEAN
688 Send(router) or accept(host) RFC1620 shared media redirects. 739 Send(router) or accept(host) RFC1620 shared media redirects.
689 Overrides ip_secure_redirects. 740 Overrides ip_secure_redirects.
@@ -723,6 +774,12 @@ accept_source_route - BOOLEAN
723 default TRUE (router) 774 default TRUE (router)
724 FALSE (host) 775 FALSE (host)
725 776
777accept_local - BOOLEAN
778 Accept packets with local source addresses. In combination with
779 suitable routing, this can be used to direct packets between two
780 local interfaces over the wire and have them accepted properly.
781 default FALSE
782
726rp_filter - INTEGER 783rp_filter - INTEGER
727 0 - No source validation. 784 0 - No source validation.
728 1 - Strict mode as defined in RFC3704 Strict Reverse Path 785 1 - Strict mode as defined in RFC3704 Strict Reverse Path
@@ -738,8 +795,8 @@ rp_filter - INTEGER
738 to prevent IP spoofing from DDos attacks. If using asymmetric routing 795 to prevent IP spoofing from DDos attacks. If using asymmetric routing
739 or other complicated routing, then loose mode is recommended. 796 or other complicated routing, then loose mode is recommended.
740 797
741 conf/all/rp_filter must also be set to non-zero to do source validation 798 The max value from conf/{all,interface}/rp_filter is used
742 on the interface 799 when doing source validation on the {interface}.
743 800
744 Default value is 0. Note that some distributions enable it 801 Default value is 0. Note that some distributions enable it
745 in startup scripts. 802 in startup scripts.
@@ -819,9 +876,18 @@ arp_notify - BOOLEAN
819 or hardware address changes. 876 or hardware address changes.
820 877
821arp_accept - BOOLEAN 878arp_accept - BOOLEAN
822 Define behavior when gratuitous arp replies are received: 879 Define behavior for gratuitous ARP frames who's IP is not
823 0 - drop gratuitous arp frames 880 already present in the ARP table:
824 1 - accept gratuitous arp frames 881 0 - don't create new entries in the ARP table
882 1 - create new entries in the ARP table
883
884 Both replies and requests type gratuitous arp will trigger the
885 ARP table to be updated, if this setting is on.
886
887 If the ARP table already contains the IP address of the
888 gratuitous arp frame, the arp table will be updated regardless
889 if this setting is on or off.
890
825 891
826app_solicit - INTEGER 892app_solicit - INTEGER
827 The maximum number of probes to send to the user space ARP daemon 893 The maximum number of probes to send to the user space ARP daemon
@@ -1060,10 +1126,10 @@ regen_max_retry - INTEGER
1060 Default: 5 1126 Default: 5
1061 1127
1062max_addresses - INTEGER 1128max_addresses - INTEGER
1063 Number of maximum addresses per interface. 0 disables limitation. 1129 Maximum number of autoconfigured addresses per interface. Setting
1064 It is recommended not set too large value (or 0) because it would 1130 to zero disables the limitation. It is not recommended to set this
1065 be too easy way to crash kernel to allow to create too much of 1131 value too large (or to zero) because it would be an easy way to
1066 autoconfigured addresses. 1132 crash the kernel by allowing too many addresses to be created.
1067 Default: 16 1133 Default: 16
1068 1134
1069disable_ipv6 - BOOLEAN 1135disable_ipv6 - BOOLEAN
@@ -1086,6 +1152,24 @@ accept_dad - INTEGER
1086 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate 1152 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
1087 link-local address has been found. 1153 link-local address has been found.
1088 1154
1155force_tllao - BOOLEAN
1156 Enable sending the target link-layer address option even when
1157 responding to a unicast neighbor solicitation.
1158 Default: FALSE
1159
1160 Quoting from RFC 2461, section 4.4, Target link-layer address:
1161
1162 "The option MUST be included for multicast solicitations in order to
1163 avoid infinite Neighbor Solicitation "recursion" when the peer node
1164 does not have a cache entry to return a Neighbor Advertisements
1165 message. When responding to unicast solicitations, the option can be
1166 omitted since the sender of the solicitation has the correct link-
1167 layer address; otherwise it would not have be able to send the unicast
1168 solicitation in the first place. However, including the link-layer
1169 address in this case adds little overhead and eliminates a potential
1170 race condition where the sender deletes the cached link-layer address
1171 prior to receiving a response to a previous solicitation."
1172
1089icmp/*: 1173icmp/*:
1090ratelimit - INTEGER 1174ratelimit - INTEGER
1091 Limit the maximal rates for sending ICMPv6 packets. 1175 Limit the maximal rates for sending ICMPv6 packets.
diff --git a/Documentation/networking/ixgbevf.txt b/Documentation/networking/ixgbevf.txt
new file mode 100755
index 000000000000..19015de6725f
--- /dev/null
+++ b/Documentation/networking/ixgbevf.txt
@@ -0,0 +1,90 @@
1Linux* Base Driver for Intel(R) Network Connection
2==================================================
3
4November 24, 2009
5
6Contents
7========
8
9- In This Release
10- Identifying Your Adapter
11- Known Issues/Troubleshooting
12- Support
13
14In This Release
15===============
16
17This file describes the ixgbevf Linux* Base Driver for Intel Network
18Connection.
19
20The ixgbevf driver supports 82599-based virtual function devices that can only
21be activated on kernels with CONFIG_PCI_IOV enabled.
22
23The ixgbevf driver supports virtual functions generated by the ixgbe driver
24with a max_vfs value of 1 or greater.
25
26The guest OS loading the ixgbevf driver must support MSI-X interrupts.
27
28VLANs: There is a limit of a total of 32 shared VLANs to 1 or more VFs.
29
30Identifying Your Adapter
31========================
32
33For more information on how to identify your adapter, go to the Adapter &
34Driver ID Guide at:
35
36 http://support.intel.com/support/network/sb/CS-008441.htm
37
38Known Issues/Troubleshooting
39============================
40
41 Unloading Physical Function (PF) Driver Causes System Reboots When VM is
42 Running and VF is Loaded on the VM
43 ------------------------------------------------------------------------
44 Do not unload the PF driver (ixgbe) while VFs are assigned to guests.
45
46Support
47=======
48
49For general information, go to the Intel support website at:
50
51 http://support.intel.com
52
53or the Intel Wired Networking project hosted by Sourceforge at:
54
55 http://sourceforge.net/projects/e1000
56
57If an issue is identified with the released source code on the supported
58kernel with a supported adapter, email the specific information related
59to the issue to e1000-devel@lists.sf.net
60
61License
62=======
63
64Intel 10 Gigabit Linux driver.
65Copyright(c) 1999 - 2009 Intel Corporation.
66
67This program is free software; you can redistribute it and/or modify it
68under the terms and conditions of the GNU General Public License,
69version 2, as published by the Free Software Foundation.
70
71This program is distributed in the hope it will be useful, but WITHOUT
72ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
73FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
74more details.
75
76You should have received a copy of the GNU General Public License along with
77this program; if not, write to the Free Software Foundation, Inc.,
7851 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
79
80The full GNU General Public License is included in this distribution in
81the file called "COPYING".
82
83Trademarks
84==========
85
86Intel, Itanium, and Pentium are trademarks or registered trademarks of
87Intel Corporation or its subsidiaries in the United States and other
88countries.
89
90* Other names and brands may be claimed as the property of others.
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index a22fd85e3796..09ab0d290326 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -2,7 +2,7 @@
2+ ABSTRACT 2+ ABSTRACT
3-------------------------------------------------------------------------------- 3--------------------------------------------------------------------------------
4 4
5This file documents the CONFIG_PACKET_MMAP option available with the PACKET 5This file documents the mmap() facility available with the PACKET
6socket interface on 2.4 and 2.6 kernels. This type of sockets is used for 6socket interface on 2.4 and 2.6 kernels. This type of sockets is used for
7capture network traffic with utilities like tcpdump or any other that needs 7capture network traffic with utilities like tcpdump or any other that needs
8raw access to network interface. 8raw access to network interface.
@@ -44,7 +44,7 @@ enabled. For transmission, check the MTU (Maximum Transmission Unit) used and
44supported by devices of your network. 44supported by devices of your network.
45 45
46-------------------------------------------------------------------------------- 46--------------------------------------------------------------------------------
47+ How to use CONFIG_PACKET_MMAP to improve capture process 47+ How to use mmap() to improve capture process
48-------------------------------------------------------------------------------- 48--------------------------------------------------------------------------------
49 49
50From the user standpoint, you should use the higher level libpcap library, which 50From the user standpoint, you should use the higher level libpcap library, which
@@ -64,7 +64,7 @@ the low level details or want to improve libpcap by including PACKET_MMAP
64support. 64support.
65 65
66-------------------------------------------------------------------------------- 66--------------------------------------------------------------------------------
67+ How to use CONFIG_PACKET_MMAP directly to improve capture process 67+ How to use mmap() directly to improve capture process
68-------------------------------------------------------------------------------- 68--------------------------------------------------------------------------------
69 69
70From the system calls stand point, the use of PACKET_MMAP involves 70From the system calls stand point, the use of PACKET_MMAP involves
@@ -105,7 +105,7 @@ also the mapping of the circular buffer in the user process and
105the use of this buffer. 105the use of this buffer.
106 106
107-------------------------------------------------------------------------------- 107--------------------------------------------------------------------------------
108+ How to use CONFIG_PACKET_MMAP directly to improve transmission process 108+ How to use mmap() directly to improve transmission process
109-------------------------------------------------------------------------------- 109--------------------------------------------------------------------------------
110Transmission process is similar to capture as shown below. 110Transmission process is similar to capture as shown below.
111 111
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index c6cf4a3c16e0..61bb645d50e0 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -90,6 +90,11 @@ Examples:
90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address 90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address 91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address
92 92
93 pgset "queue_map_min 0" Sets the min value of tx queue interval
94 pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices
95 To select queue 1 of a given device,
96 use queue_map_min=1 and queue_map_max=1
97
93 pgset "src_mac_count 1" Sets the number of MACs we'll range through. 98 pgset "src_mac_count 1" Sets the number of MACs we'll range through.
94 The 'minimum' MAC is what you set with srcmac. 99 The 'minimum' MAC is what you set with srcmac.
95 100
@@ -101,6 +106,9 @@ Examples:
101 IPDST_RND, UDPSRC_RND, 106 IPDST_RND, UDPSRC_RND,
102 UDPDST_RND, MACSRC_RND, MACDST_RND 107 UDPDST_RND, MACSRC_RND, MACDST_RND
103 MPLS_RND, VID_RND, SVID_RND 108 MPLS_RND, VID_RND, SVID_RND
109 QUEUE_MAP_RND # queue map random
110 QUEUE_MAP_CPU # queue map mirrors smp_processor_id()
111
104 112
105 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then 113 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
106 cycle through the port range. 114 cycle through the port range.
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt
index ee31369e9e5b..9551622d0a7b 100644
--- a/Documentation/networking/regulatory.txt
+++ b/Documentation/networking/regulatory.txt
@@ -188,3 +188,27 @@ Then in some part of your code after your wiphy has been registered:
188 &mydriver_jp_regdom.reg_rules[i], 188 &mydriver_jp_regdom.reg_rules[i],
189 sizeof(struct ieee80211_reg_rule)); 189 sizeof(struct ieee80211_reg_rule));
190 regulatory_struct_hint(rd); 190 regulatory_struct_hint(rd);
191
192Statically compiled regulatory database
193---------------------------------------
194
195In most situations the userland solution using CRDA as described
196above is the preferred solution. However in some cases a set of
197rules built into the kernel itself may be desirable. To account
198for this situation, a configuration option has been provided
199(i.e. CONFIG_CFG80211_INTERNAL_REGDB). With this option enabled,
200the wireless database information contained in net/wireless/db.txt is
201used to generate a data structure encoded in net/wireless/regdb.c.
202That option also enables code in net/wireless/reg.c which queries
203the data in regdb.c as an alternative to using CRDA.
204
205The file net/wireless/db.txt should be kept up-to-date with the db.txt
206file available in the git repository here:
207
208 git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
209
210Again, most users in most situations should be using the CRDA package
211provided with their distribution, and in most other situations users
212should be building and using CRDA on their own rather than using
213this option. If you are not absolutely sure that you should be using
214CONFIG_CFG80211_INTERNAL_REGDB then _DO_NOT_USE_IT_.
diff --git a/Documentation/networking/skfp.txt b/Documentation/networking/skfp.txt
index abfddf81e34a..203ec66c9fb4 100644
--- a/Documentation/networking/skfp.txt
+++ b/Documentation/networking/skfp.txt
@@ -68,7 +68,7 @@ Compaq adapters (not tested):
68======================= 68=======================
69 69
70From v2.01 on, the driver is integrated in the linux kernel sources. 70From v2.01 on, the driver is integrated in the linux kernel sources.
71Therefor, the installation is the same as for any other adapter 71Therefore, the installation is the same as for any other adapter
72supported by the kernel. 72supported by the kernel.
73Refer to the manual of your distribution about the installation 73Refer to the manual of your distribution about the installation
74of network adapters. 74of network adapters.
diff --git a/Documentation/networking/tcp-thin.txt b/Documentation/networking/tcp-thin.txt
new file mode 100644
index 000000000000..151e229980f1
--- /dev/null
+++ b/Documentation/networking/tcp-thin.txt
@@ -0,0 +1,47 @@
1Thin-streams and TCP
2====================
3A wide range of Internet-based services that use reliable transport
4protocols display what we call thin-stream properties. This means
5that the application sends data with such a low rate that the
6retransmission mechanisms of the transport protocol are not fully
7effective. In time-dependent scenarios (like online games, control
8systems, stock trading etc.) where the user experience depends
9on the data delivery latency, packet loss can be devastating for
10the service quality. Extreme latencies are caused by TCP's
11dependency on the arrival of new data from the application to trigger
12retransmissions effectively through fast retransmit instead of
13waiting for long timeouts.
14
15After analysing a large number of time-dependent interactive
16applications, we have seen that they often produce thin streams
17and also stay with this traffic pattern throughout its entire
18lifespan. The combination of time-dependency and the fact that the
19streams provoke high latencies when using TCP is unfortunate.
20
21In order to reduce application-layer latency when packets are lost,
22a set of mechanisms has been made, which address these latency issues
23for thin streams. In short, if the kernel detects a thin stream,
24the retransmission mechanisms are modified in the following manner:
25
261) If the stream is thin, fast retransmit on the first dupACK.
272) If the stream is thin, do not apply exponential backoff.
28
29These enhancements are applied only if the stream is detected as
30thin. This is accomplished by defining a threshold for the number
31of packets in flight. If there are less than 4 packets in flight,
32fast retransmissions can not be triggered, and the stream is prone
33to experience high retransmission latencies.
34
35Since these mechanisms are targeted at time-dependent applications,
36they must be specifically activated by the application using the
37TCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the
38tcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both
39modifications are turned off by default.
40
41References
42==========
43More information on the modifications, as well as a wide range of
44experimental data can be found here:
45"Improving latency for interactive, thin-stream applications over
46reliable transport"
47http://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file
diff --git a/Documentation/networking/timestamping/Makefile b/Documentation/networking/timestamping/Makefile
index 2a1489fdc036..e79973443e9f 100644
--- a/Documentation/networking/timestamping/Makefile
+++ b/Documentation/networking/timestamping/Makefile
@@ -1,6 +1,13 @@
1CPPFLAGS = -I../../../include 1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
2 3
3timestamping: timestamping.c 4# List of programs to build
5hostprogs-y := timestamping
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
9
10HOSTCFLAGS_timestamping.o += -I$(objtree)/usr/include
4 11
5clean: 12clean:
6 rm -f timestamping 13 rm -f timestamping
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c
index 43d143104210..8ba82bfe6a33 100644
--- a/Documentation/networking/timestamping/timestamping.c
+++ b/Documentation/networking/timestamping/timestamping.c
@@ -41,9 +41,9 @@
41#include <arpa/inet.h> 41#include <arpa/inet.h>
42#include <net/if.h> 42#include <net/if.h>
43 43
44#include "asm/types.h" 44#include <asm/types.h>
45#include "linux/net_tstamp.h" 45#include <linux/net_tstamp.h>
46#include "linux/errqueue.h" 46#include <linux/errqueue.h>
47 47
48#ifndef SO_TIMESTAMPING 48#ifndef SO_TIMESTAMPING
49# define SO_TIMESTAMPING 37 49# define SO_TIMESTAMPING 37
@@ -164,7 +164,7 @@ static void printpacket(struct msghdr *msg, int res,
164 164
165 gettimeofday(&now, 0); 165 gettimeofday(&now, 0);
166 166
167 printf("%ld.%06ld: received %s data, %d bytes from %s, %d bytes control messages\n", 167 printf("%ld.%06ld: received %s data, %d bytes from %s, %zu bytes control messages\n",
168 (long)now.tv_sec, (long)now.tv_usec, 168 (long)now.tv_sec, (long)now.tv_usec,
169 (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular", 169 (recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular",
170 res, 170 res,
@@ -173,7 +173,7 @@ static void printpacket(struct msghdr *msg, int res,
173 for (cmsg = CMSG_FIRSTHDR(msg); 173 for (cmsg = CMSG_FIRSTHDR(msg);
174 cmsg; 174 cmsg;
175 cmsg = CMSG_NXTHDR(msg, cmsg)) { 175 cmsg = CMSG_NXTHDR(msg, cmsg)) {
176 printf(" cmsg len %d: ", cmsg->cmsg_len); 176 printf(" cmsg len %zu: ", cmsg->cmsg_len);
177 switch (cmsg->cmsg_level) { 177 switch (cmsg->cmsg_level) {
178 case SOL_SOCKET: 178 case SOL_SOCKET:
179 printf("SOL_SOCKET "); 179 printf("SOL_SOCKET ");
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
370 } 370 }
371 371
372 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); 372 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
373 if (socket < 0) 373 if (sock < 0)
374 bail("socket"); 374 bail("socket");
375 375
376 memset(&device, 0, sizeof(device)); 376 memset(&device, 0, sizeof(device));
@@ -381,7 +381,7 @@ int main(int argc, char **argv)
381 memset(&hwtstamp, 0, sizeof(hwtstamp)); 381 memset(&hwtstamp, 0, sizeof(hwtstamp));
382 strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name)); 382 strncpy(hwtstamp.ifr_name, interface, sizeof(hwtstamp.ifr_name));
383 hwtstamp.ifr_data = (void *)&hwconfig; 383 hwtstamp.ifr_data = (void *)&hwconfig;
384 memset(&hwconfig, 0, sizeof(&hwconfig)); 384 memset(&hwconfig, 0, sizeof(hwconfig));
385 hwconfig.tx_type = 385 hwconfig.tx_type =
386 (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ? 386 (so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ?
387 HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; 387 HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
diff --git a/Documentation/nommu-mmap.txt b/Documentation/nommu-mmap.txt
index b565e8279d13..8e1ddec2c78a 100644
--- a/Documentation/nommu-mmap.txt
+++ b/Documentation/nommu-mmap.txt
@@ -119,6 +119,32 @@ FURTHER NOTES ON NO-MMU MMAP
119 granule but will only discard the excess if appropriately configured as 119 granule but will only discard the excess if appropriately configured as
120 this has an effect on fragmentation. 120 this has an effect on fragmentation.
121 121
122 (*) The memory allocated by a request for an anonymous mapping will normally
123 be cleared by the kernel before being returned in accordance with the
124 Linux man pages (ver 2.22 or later).
125
126 In the MMU case this can be achieved with reasonable performance as
127 regions are backed by virtual pages, with the contents only being mapped
128 to cleared physical pages when a write happens on that specific page
129 (prior to which, the pages are effectively mapped to the global zero page
130 from which reads can take place). This spreads out the time it takes to
131 initialize the contents of a page - depending on the write-usage of the
132 mapping.
133
134 In the no-MMU case, however, anonymous mappings are backed by physical
135 pages, and the entire map is cleared at allocation time. This can cause
136 significant delays during a userspace malloc() as the C library does an
137 anonymous mapping and the kernel then does a memset for the entire map.
138
139 However, for memory that isn't required to be precleared - such as that
140 returned by malloc() - mmap() can take a MAP_UNINITIALIZED flag to
141 indicate to the kernel that it shouldn't bother clearing the memory before
142 returning it. Note that CONFIG_MMAP_ALLOW_UNINITIALIZED must be enabled
143 to permit this, otherwise the flag will be ignored.
144
145 uClibc uses this to speed up malloc(), and the ELF-FDPIC binfmt uses this
146 to allocate the brk and stack region.
147
122 (*) A list of all the private copy and anonymous mappings on the system is 148 (*) A list of all the private copy and anonymous mappings on the system is
123 visible through /proc/maps in no-MMU mode. 149 visible through /proc/maps in no-MMU mode.
124 150
diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
index b152e81da592..c10c022b911c 100644
--- a/Documentation/oops-tracing.txt
+++ b/Documentation/oops-tracing.txt
@@ -257,6 +257,8 @@ characters, each representing a particular tainted value.
257 257
258 10: 'W' if a warning has previously been issued by the kernel. 258 10: 'W' if a warning has previously been issued by the kernel.
259 259
260 11: 'C' if a staging driver has been loaded.
261
260The primary reason for the 'Tainted: ' string is to tell kernel 262The primary reason for the 'Tainted: ' string is to tell kernel
261debuggers if this is a clean kernel or if anything unusual has 263debuggers if this is a clean kernel or if anything unusual has
262occurred. Tainting is permanent: even if an offending module is 264occurred. Tainting is permanent: even if an offending module is
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 059934363caf..446f43b309df 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,5 +1,17 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2 2
3* no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
4 Instead of the cs_error() callback or the CS_CHECK() macro, please use
5 Linux-style checking of return values, and -- if necessary -- debug
6 messages using "dev_dbg()" or "pr_debug()".
7
8* New CIS tuple access (as of 2.6.33)
9 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
10 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
11 only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is
12 interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE,
13 a new helper "pcmcia_get_mac_from_cis()" was added.
14
3* New configuration loop helper (as of 2.6.28) 15* New configuration loop helper (as of 2.6.28)
4 By calling pcmcia_loop_config(), a driver can iterate over all available 16 By calling pcmcia_loop_config(), a driver can iterate over all available
5 configuration options. During a driver's probe() phase, one doesn't need 17 configuration options. During a driver's probe() phase, one doesn't need
diff --git a/Documentation/pcmcia/locking.txt b/Documentation/pcmcia/locking.txt
new file mode 100644
index 000000000000..68f622bc4064
--- /dev/null
+++ b/Documentation/pcmcia/locking.txt
@@ -0,0 +1,118 @@
1This file explains the locking and exclusion scheme used in the PCCARD
2and PCMCIA subsystems.
3
4
5A) Overview, Locking Hierarchy:
6===============================
7
8pcmcia_socket_list_rwsem - protects only the list of sockets
9- skt_mutex - serializes card insert / ejection
10 - ops_mutex - serializes socket operation
11
12
13B) Exclusion
14============
15
16The following functions and callbacks to struct pcmcia_socket must
17be called with "skt_mutex" held:
18
19 socket_detect_change()
20 send_event()
21 socket_reset()
22 socket_shutdown()
23 socket_setup()
24 socket_remove()
25 socket_insert()
26 socket_early_resume()
27 socket_late_resume()
28 socket_resume()
29 socket_suspend()
30
31 struct pcmcia_callback *callback
32
33The following functions and callbacks to struct pcmcia_socket must
34be called with "ops_mutex" held:
35
36 socket_reset()
37 socket_setup()
38
39 struct pccard_operations *ops
40 struct pccard_resource_ops *resource_ops;
41
42Note that send_event() and struct pcmcia_callback *callback must not be
43called with "ops_mutex" held.
44
45
46C) Protection
47=============
48
491. Global Data:
50---------------
51struct list_head pcmcia_socket_list;
52
53protected by pcmcia_socket_list_rwsem;
54
55
562. Per-Socket Data:
57-------------------
58The resource_ops and their data are protected by ops_mutex.
59
60The "main" struct pcmcia_socket is protected as follows (read-only fields
61or single-use fields not mentioned):
62
63- by pcmcia_socket_list_rwsem:
64 struct list_head socket_list;
65
66- by thread_lock:
67 unsigned int thread_events;
68
69- by skt_mutex:
70 u_int suspended_state;
71 void (*tune_bridge);
72 struct pcmcia_callback *callback;
73 int resume_status;
74
75- by ops_mutex:
76 socket_state_t socket;
77 u_int state;
78 u_short lock_count;
79 pccard_mem_map cis_mem;
80 void __iomem *cis_virt;
81 struct { } irq;
82 io_window_t io[];
83 pccard_mem_map win[];
84 struct list_head cis_cache;
85 size_t fake_cis_len;
86 u8 *fake_cis;
87 u_int irq_mask;
88 void (*zoom_video);
89 int (*power_hook);
90 u8 resource...;
91 struct list_head devices_list;
92 u8 device_count;
93 struct pcmcia_state;
94
95
963. Per PCMCIA-device Data:
97--------------------------
98
99The "main" struct pcmcia_devie is protected as follows (read-only fields
100or single-use fields not mentioned):
101
102
103- by pcmcia_socket->ops_mutex:
104 struct list_head socket_device_list;
105 struct config_t *function_config;
106 u16 _irq:1;
107 u16 _io:1;
108 u16 _win:4;
109 u16 _locked:1;
110 u16 allow_func_id_match:1;
111 u16 suspended:1;
112 u16 _removed:1;
113
114- by the PCMCIA driver:
115 io_req_t io;
116 irq_req_t irq;
117 config_req_t conf;
118 window_handle_t win;
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt
index a327db67782a..763e4659bf18 100644
--- a/Documentation/pnp.txt
+++ b/Documentation/pnp.txt
@@ -57,7 +57,7 @@ PC standard floppy disk controller
57# cat resources 57# cat resources
58DISABLED 58DISABLED
59 59
60- Notice the string "DISABLED". THis means the device is not active. 60- Notice the string "DISABLED". This means the device is not active.
61 61
623.) check the device's possible configurations (optional) 623.) check the device's possible configurations (optional)
63# cat options 63# cat options
@@ -139,7 +139,7 @@ Plug and Play but it is planned to be in the near future.
139 139
140Requirements for a Linux PnP protocol: 140Requirements for a Linux PnP protocol:
1411.) the protocol must use EISA IDs 1411.) the protocol must use EISA IDs
1422.) the protocol must inform the PnP Layer of a devices current configuration 1422.) the protocol must inform the PnP Layer of a device's current configuration
143- the ability to set resources is optional but preferred. 143- the ability to set resources is optional but preferred.
144 144
145The following are PnP protocol related functions: 145The following are PnP protocol related functions:
@@ -158,7 +158,7 @@ pnp_remove_device
158- automatically will free mem used by the device and related structures 158- automatically will free mem used by the device and related structures
159 159
160pnp_add_id 160pnp_add_id
161- adds a EISA ID to the list of supported IDs for the specified device 161- adds an EISA ID to the list of supported IDs for the specified device
162 162
163For more information consult the source of a protocol such as 163For more information consult the source of a protocol such as
164/drivers/pnp/pnpbios/core.c. 164/drivers/pnp/pnpbios/core.c.
@@ -167,7 +167,7 @@ For more information consult the source of a protocol such as
167 167
168Linux Plug and Play Drivers 168Linux Plug and Play Drivers
169--------------------------- 169---------------------------
170 This section contains information for linux PnP driver developers. 170 This section contains information for Linux PnP driver developers.
171 171
172The New Way 172The New Way
173........... 173...........
@@ -235,11 +235,10 @@ static int __init serial8250_pnp_init(void)
235The Old Way 235The Old Way
236........... 236...........
237 237
238a series of compatibility functions have been created to make it easy to convert 238A series of compatibility functions have been created to make it easy to convert
239
240ISAPNP drivers. They should serve as a temporary solution only. 239ISAPNP drivers. They should serve as a temporary solution only.
241 240
242they are as follows: 241They are as follows:
243 242
244struct pnp_card *pnp_find_card(unsigned short vendor, 243struct pnp_card *pnp_find_card(unsigned short vendor,
245 unsigned short device, 244 unsigned short device,
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt
index 5f83fd24ea84..cdebb5145c25 100644
--- a/Documentation/power/regulator/consumer.txt
+++ b/Documentation/power/regulator/consumer.txt
@@ -104,7 +104,7 @@ to set the limit to 500mA when supplying power.
104 104
105Consumers can control their supply current limit by calling :- 105Consumers can control their supply current limit by calling :-
106 106
107int regulator_set_current_limit(regulator, min_uV, max_uV); 107int regulator_set_current_limit(regulator, min_uA, max_uA);
108 108
109Where min_uA and max_uA are the minimum and maximum acceptable current limit in 109Where min_uA and max_uA are the minimum and maximum acceptable current limit in
110microamps. 110microamps.
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index f49a33b704d2..55b859b3bc72 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -38,83 +38,85 @@ struct dev_pm_ops {
38 ... 38 ...
39 int (*runtime_suspend)(struct device *dev); 39 int (*runtime_suspend)(struct device *dev);
40 int (*runtime_resume)(struct device *dev); 40 int (*runtime_resume)(struct device *dev);
41 void (*runtime_idle)(struct device *dev); 41 int (*runtime_idle)(struct device *dev);
42 ... 42 ...
43}; 43};
44 44
45The ->runtime_suspend() callback is executed by the PM core for the bus type of 45The ->runtime_suspend(), ->runtime_resume() and ->runtime_idle() callbacks are
46the device being suspended. The bus type's callback is then _entirely_ 46executed by the PM core for either the bus type, or device type (if the bus
47_responsible_ for handling the device as appropriate, which may, but need not 47type's callback is not defined), or device class (if the bus type's and device
48include executing the device driver's own ->runtime_suspend() callback (from the 48type's callbacks are not defined) of given device. The bus type, device type
49and device class callbacks are referred to as subsystem-level callbacks in what
50follows.
51
52The subsystem-level suspend callback is _entirely_ _responsible_ for handling
53the suspend of the device as appropriate, which may, but need not include
54executing the device driver's own ->runtime_suspend() callback (from the
49PM core's point of view it is not necessary to implement a ->runtime_suspend() 55PM core's point of view it is not necessary to implement a ->runtime_suspend()
50callback in a device driver as long as the bus type's ->runtime_suspend() knows 56callback in a device driver as long as the subsystem-level suspend callback
51what to do to handle the device). 57knows what to do to handle the device).
52 58
53 * Once the bus type's ->runtime_suspend() callback has completed successfully 59 * Once the subsystem-level suspend callback has completed successfully
54 for given device, the PM core regards the device as suspended, which need 60 for given device, the PM core regards the device as suspended, which need
55 not mean that the device has been put into a low power state. It is 61 not mean that the device has been put into a low power state. It is
56 supposed to mean, however, that the device will not process data and will 62 supposed to mean, however, that the device will not process data and will
57 not communicate with the CPU(s) and RAM until its bus type's 63 not communicate with the CPU(s) and RAM until the subsystem-level resume
58 ->runtime_resume() callback is executed for it. The run-time PM status of 64 callback is executed for it. The run-time PM status of a device after
59 a device after successful execution of its bus type's ->runtime_suspend() 65 successful execution of the subsystem-level suspend callback is 'suspended'.
60 callback is 'suspended'. 66
61 67 * If the subsystem-level suspend callback returns -EBUSY or -EAGAIN,
62 * If the bus type's ->runtime_suspend() callback returns -EBUSY or -EAGAIN, 68 the device's run-time PM status is 'active', which means that the device
63 the device's run-time PM status is supposed to be 'active', which means that 69 _must_ be fully operational afterwards.
64 the device _must_ be fully operational afterwards. 70
65 71 * If the subsystem-level suspend callback returns an error code different
66 * If the bus type's ->runtime_suspend() callback returns an error code 72 from -EBUSY or -EAGAIN, the PM core regards this as a fatal error and will
67 different from -EBUSY or -EAGAIN, the PM core regards this as a fatal 73 refuse to run the helper functions described in Section 4 for the device,
68 error and will refuse to run the helper functions described in Section 4 74 until the status of it is directly set either to 'active', or to 'suspended'
69 for the device, until the status of it is directly set either to 'active' 75 (the PM core provides special helper functions for this purpose).
70 or to 'suspended' (the PM core provides special helper functions for this 76
71 purpose). 77In particular, if the driver requires remote wake-up capability (i.e. hardware
72 78mechanism allowing the device to request a change of its power state, such as
73In particular, if the driver requires remote wakeup capability for proper 79PCI PME) for proper functioning and device_run_wake() returns 'false' for the
74functioning and device_may_wakeup() returns 'false' for the device, then 80device, then ->runtime_suspend() should return -EBUSY. On the other hand, if
75->runtime_suspend() should return -EBUSY. On the other hand, if 81device_run_wake() returns 'true' for the device and the device is put into a low
76device_may_wakeup() returns 'true' for the device and the device is put 82power state during the execution of the subsystem-level suspend callback, it is
77into a low power state during the execution of its bus type's 83expected that remote wake-up will be enabled for the device. Generally, remote
78->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism 84wake-up should be enabled for all input devices put into a low power state at
79allowing the device to request a change of its power state, such as PCI PME) 85run time.
80will be enabled for the device. Generally, remote wake-up should be enabled 86
81for all input devices put into a low power state at run time. 87The subsystem-level resume callback is _entirely_ _responsible_ for handling the
82 88resume of the device as appropriate, which may, but need not include executing
83The ->runtime_resume() callback is executed by the PM core for the bus type of 89the device driver's own ->runtime_resume() callback (from the PM core's point of
84the device being woken up. The bus type's callback is then _entirely_ 90view it is not necessary to implement a ->runtime_resume() callback in a device
85_responsible_ for handling the device as appropriate, which may, but need not 91driver as long as the subsystem-level resume callback knows what to do to handle
86include executing the device driver's own ->runtime_resume() callback (from the 92the device).
87PM core's point of view it is not necessary to implement a ->runtime_resume() 93
88callback in a device driver as long as the bus type's ->runtime_resume() knows 94 * Once the subsystem-level resume callback has completed successfully, the PM
89what to do to handle the device). 95 core regards the device as fully operational, which means that the device
90 96 _must_ be able to complete I/O operations as needed. The run-time PM status
91 * Once the bus type's ->runtime_resume() callback has completed successfully, 97 of the device is then 'active'.
92 the PM core regards the device as fully operational, which means that the 98
93 device _must_ be able to complete I/O operations as needed. The run-time 99 * If the subsystem-level resume callback returns an error code, the PM core
94 PM status of the device is then 'active'. 100 regards this as a fatal error and will refuse to run the helper functions
95 101 described in Section 4 for the device, until its status is directly set
96 * If the bus type's ->runtime_resume() callback returns an error code, the PM 102 either to 'active' or to 'suspended' (the PM core provides special helper
97 core regards this as a fatal error and will refuse to run the helper 103 functions for this purpose).
98 functions described in Section 4 for the device, until its status is 104
99 directly set either to 'active' or to 'suspended' (the PM core provides 105The subsystem-level idle callback is executed by the PM core whenever the device
100 special helper functions for this purpose). 106appears to be idle, which is indicated to the PM core by two counters, the
101 107device's usage counter and the counter of 'active' children of the device.
102The ->runtime_idle() callback is executed by the PM core for the bus type of
103given device whenever the device appears to be idle, which is indicated to the
104PM core by two counters, the device's usage counter and the counter of 'active'
105children of the device.
106 108
107 * If any of these counters is decreased using a helper function provided by 109 * If any of these counters is decreased using a helper function provided by
108 the PM core and it turns out to be equal to zero, the other counter is 110 the PM core and it turns out to be equal to zero, the other counter is
109 checked. If that counter also is equal to zero, the PM core executes the 111 checked. If that counter also is equal to zero, the PM core executes the
110 device bus type's ->runtime_idle() callback (with the device as an 112 subsystem-level idle callback with the device as an argument.
111 argument).
112 113
113The action performed by a bus type's ->runtime_idle() callback is totally 114The action performed by a subsystem-level idle callback is totally dependent on
114dependent on the bus type in question, but the expected and recommended action 115the subsystem in question, but the expected and recommended action is to check
115is to check if the device can be suspended (i.e. if all of the conditions 116if the device can be suspended (i.e. if all of the conditions necessary for
116necessary for suspending the device are satisfied) and to queue up a suspend 117suspending the device are satisfied) and to queue up a suspend request for the
117request for the device in that case. 118device in that case. The value returned by this callback is ignored by the PM
119core.
118 120
119The helper functions provided by the PM core, described in Section 4, guarantee 121The helper functions provided by the PM core, described in Section 4, guarantee
120that the following constraints are met with respect to the bus type's run-time 122that the following constraints are met with respect to the bus type's run-time
@@ -214,11 +216,20 @@ defined in include/linux/pm.h:
214 being executed for that device and it is not practical to wait for the 216 being executed for that device and it is not practical to wait for the
215 suspend to complete; means "start a resume as soon as you've suspended" 217 suspend to complete; means "start a resume as soon as you've suspended"
216 218
219 unsigned int run_wake;
220 - set if the device is capable of generating run-time wake-up events
221
217 enum rpm_status runtime_status; 222 enum rpm_status runtime_status;
218 - the run-time PM status of the device; this field's initial value is 223 - the run-time PM status of the device; this field's initial value is
219 RPM_SUSPENDED, which means that each device is initially regarded by the 224 RPM_SUSPENDED, which means that each device is initially regarded by the
220 PM core as 'suspended', regardless of its real hardware status 225 PM core as 'suspended', regardless of its real hardware status
221 226
227 unsigned int runtime_auto;
228 - if set, indicates that the user space has allowed the device driver to
229 power manage the device at run time via the /sys/devices/.../power/control
230 interface; it may only be modified with the help of the pm_runtime_allow()
231 and pm_runtime_forbid() helper functions
232
222All of the above fields are members of the 'power' member of 'struct device'. 233All of the above fields are members of the 'power' member of 'struct device'.
223 234
2244. Run-time PM Device Helper Functions 2354. Run-time PM Device Helper Functions
@@ -234,41 +245,41 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
234 removing the device from device hierarchy 245 removing the device from device hierarchy
235 246
236 int pm_runtime_idle(struct device *dev); 247 int pm_runtime_idle(struct device *dev);
237 - execute ->runtime_idle() for the device's bus type; returns 0 on success 248 - execute the subsystem-level idle callback for the device; returns 0 on
238 or error code on failure, where -EINPROGRESS means that ->runtime_idle() 249 success or error code on failure, where -EINPROGRESS means that
239 is already being executed 250 ->runtime_idle() is already being executed
240 251
241 int pm_runtime_suspend(struct device *dev); 252 int pm_runtime_suspend(struct device *dev);
242 - execute ->runtime_suspend() for the device's bus type; returns 0 on 253 - execute the subsystem-level suspend callback for the device; returns 0 on
243 success, 1 if the device's run-time PM status was already 'suspended', or 254 success, 1 if the device's run-time PM status was already 'suspended', or
244 error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt 255 error code on failure, where -EAGAIN or -EBUSY means it is safe to attempt
245 to suspend the device again in future 256 to suspend the device again in future
246 257
247 int pm_runtime_resume(struct device *dev); 258 int pm_runtime_resume(struct device *dev);
248 - execute ->runtime_resume() for the device's bus type; returns 0 on 259 - execute the subsystem-level resume callback for the device; returns 0 on
249 success, 1 if the device's run-time PM status was already 'active' or 260 success, 1 if the device's run-time PM status was already 'active' or
250 error code on failure, where -EAGAIN means it may be safe to attempt to 261 error code on failure, where -EAGAIN means it may be safe to attempt to
251 resume the device again in future, but 'power.runtime_error' should be 262 resume the device again in future, but 'power.runtime_error' should be
252 checked additionally 263 checked additionally
253 264
254 int pm_request_idle(struct device *dev); 265 int pm_request_idle(struct device *dev);
255 - submit a request to execute ->runtime_idle() for the device's bus type 266 - submit a request to execute the subsystem-level idle callback for the
256 (the request is represented by a work item in pm_wq); returns 0 on success 267 device (the request is represented by a work item in pm_wq); returns 0 on
257 or error code if the request has not been queued up 268 success or error code if the request has not been queued up
258 269
259 int pm_schedule_suspend(struct device *dev, unsigned int delay); 270 int pm_schedule_suspend(struct device *dev, unsigned int delay);
260 - schedule the execution of ->runtime_suspend() for the device's bus type 271 - schedule the execution of the subsystem-level suspend callback for the
261 in future, where 'delay' is the time to wait before queuing up a suspend 272 device in future, where 'delay' is the time to wait before queuing up a
262 work item in pm_wq, in milliseconds (if 'delay' is zero, the work item is 273 suspend work item in pm_wq, in milliseconds (if 'delay' is zero, the work
263 queued up immediately); returns 0 on success, 1 if the device's PM 274 item is queued up immediately); returns 0 on success, 1 if the device's PM
264 run-time status was already 'suspended', or error code if the request 275 run-time status was already 'suspended', or error code if the request
265 hasn't been scheduled (or queued up if 'delay' is 0); if the execution of 276 hasn't been scheduled (or queued up if 'delay' is 0); if the execution of
266 ->runtime_suspend() is already scheduled and not yet expired, the new 277 ->runtime_suspend() is already scheduled and not yet expired, the new
267 value of 'delay' will be used as the time to wait 278 value of 'delay' will be used as the time to wait
268 279
269 int pm_request_resume(struct device *dev); 280 int pm_request_resume(struct device *dev);
270 - submit a request to execute ->runtime_resume() for the device's bus type 281 - submit a request to execute the subsystem-level resume callback for the
271 (the request is represented by a work item in pm_wq); returns 0 on 282 device (the request is represented by a work item in pm_wq); returns 0 on
272 success, 1 if the device's run-time PM status was already 'active', or 283 success, 1 if the device's run-time PM status was already 'active', or
273 error code if the request hasn't been queued up 284 error code if the request hasn't been queued up
274 285
@@ -299,12 +310,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
299 run-time PM callbacks described in Section 2 310 run-time PM callbacks described in Section 2
300 311
301 int pm_runtime_disable(struct device *dev); 312 int pm_runtime_disable(struct device *dev);
302 - prevent the run-time PM helper functions from running the device bus 313 - prevent the run-time PM helper functions from running subsystem-level
303 type's run-time PM callbacks, make sure that all of the pending run-time 314 run-time PM callbacks for the device, make sure that all of the pending
304 PM operations on the device are either completed or canceled; returns 315 run-time PM operations on the device are either completed or canceled;
305 1 if there was a resume request pending and it was necessary to execute 316 returns 1 if there was a resume request pending and it was necessary to
306 ->runtime_resume() for the device's bus type to satisfy that request, 317 execute the subsystem-level resume callback for the device to satisfy that
307 otherwise 0 is returned 318 request, otherwise 0 is returned
308 319
309 void pm_suspend_ignore_children(struct device *dev, bool enable); 320 void pm_suspend_ignore_children(struct device *dev, bool enable);
310 - set/unset the power.ignore_children flag of the device 321 - set/unset the power.ignore_children flag of the device
@@ -324,6 +335,20 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
324 'power.runtime_error' is set or 'power.disable_depth' is greater than 335 'power.runtime_error' is set or 'power.disable_depth' is greater than
325 zero) 336 zero)
326 337
338 bool pm_runtime_suspended(struct device *dev);
339 - return true if the device's runtime PM status is 'suspended', or false
340 otherwise
341
342 void pm_runtime_allow(struct device *dev);
343 - set the power.runtime_auto flag for the device and decrease its usage
344 counter (used by the /sys/devices/.../power/control interface to
345 effectively allow the device to be power managed at run time)
346
347 void pm_runtime_forbid(struct device *dev);
348 - unset the power.runtime_auto flag for the device and increase its usage
349 counter (used by the /sys/devices/.../power/control interface to
350 effectively prevent the device from being power managed at run time)
351
327It is safe to execute the following helper functions from interrupt context: 352It is safe to execute the following helper functions from interrupt context:
328 353
329pm_request_idle() 354pm_request_idle()
@@ -374,5 +399,128 @@ pm_runtime_suspend() or pm_runtime_idle() or their asynchronous counterparts,
374they will fail returning -EAGAIN, because the device's usage counter is 399they will fail returning -EAGAIN, because the device's usage counter is
375incremented by the core before executing ->probe() and ->remove(). Still, it 400incremented by the core before executing ->probe() and ->remove(). Still, it
376may be desirable to suspend the device as soon as ->probe() or ->remove() has 401may be desirable to suspend the device as soon as ->probe() or ->remove() has
377finished, so the PM core uses pm_runtime_idle_sync() to invoke the device bus 402finished, so the PM core uses pm_runtime_idle_sync() to invoke the
378type's ->runtime_idle() callback at that time. 403subsystem-level idle callback for the device at that time.
404
405The user space can effectively disallow the driver of the device to power manage
406it at run time by changing the value of its /sys/devices/.../power/control
407attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
408this mechanism may also be used by the driver to effectively turn off the
409run-time power management of the device until the user space turns it on.
410Namely, during the initialization the driver can make sure that the run-time PM
411status of the device is 'active' and call pm_runtime_forbid(). It should be
412noted, however, that if the user space has already intentionally changed the
413value of /sys/devices/.../power/control to "auto" to allow the driver to power
414manage the device at run time, the driver may confuse it by using
415pm_runtime_forbid() this way.
416
4176. Run-time PM and System Sleep
418
419Run-time PM and system sleep (i.e., system suspend and hibernation, also known
420as suspend-to-RAM and suspend-to-disk) interact with each other in a couple of
421ways. If a device is active when a system sleep starts, everything is
422straightforward. But what should happen if the device is already suspended?
423
424The device may have different wake-up settings for run-time PM and system sleep.
425For example, remote wake-up may be enabled for run-time suspend but disallowed
426for system sleep (device_may_wakeup(dev) returns 'false'). When this happens,
427the subsystem-level system suspend callback is responsible for changing the
428device's wake-up setting (it may leave that to the device driver's system
429suspend routine). It may be necessary to resume the device and suspend it again
430in order to do so. The same is true if the driver uses different power levels
431or other settings for run-time suspend and system sleep.
432
433During system resume, devices generally should be brought back to full power,
434even if they were suspended before the system sleep began. There are several
435reasons for this, including:
436
437 * The device might need to switch power levels, wake-up settings, etc.
438
439 * Remote wake-up events might have been lost by the firmware.
440
441 * The device's children may need the device to be at full power in order
442 to resume themselves.
443
444 * The driver's idea of the device state may not agree with the device's
445 physical state. This can happen during resume from hibernation.
446
447 * The device might need to be reset.
448
449 * Even though the device was suspended, if its usage counter was > 0 then most
450 likely it would need a run-time resume in the near future anyway.
451
452 * Always going back to full power is simplest.
453
454If the device was suspended before the sleep began, then its run-time PM status
455will have to be updated to reflect the actual post-system sleep status. The way
456to do this is:
457
458 pm_runtime_disable(dev);
459 pm_runtime_set_active(dev);
460 pm_runtime_enable(dev);
461
462The PM core always increments the run-time usage counter before calling the
463->prepare() callback and decrements it after calling the ->complete() callback.
464Hence disabling run-time PM temporarily like this will not cause any run-time
465suspend callbacks to be lost.
466
4677. Generic subsystem callbacks
468
469Subsystems may wish to conserve code space by using the set of generic power
470management callbacks provided by the PM core, defined in
471driver/base/power/generic_ops.c:
472
473 int pm_generic_runtime_idle(struct device *dev);
474 - invoke the ->runtime_idle() callback provided by the driver of this
475 device, if defined, and call pm_runtime_suspend() for this device if the
476 return value is 0 or the callback is not defined
477
478 int pm_generic_runtime_suspend(struct device *dev);
479 - invoke the ->runtime_suspend() callback provided by the driver of this
480 device and return its result, or return -EINVAL if not defined
481
482 int pm_generic_runtime_resume(struct device *dev);
483 - invoke the ->runtime_resume() callback provided by the driver of this
484 device and return its result, or return -EINVAL if not defined
485
486 int pm_generic_suspend(struct device *dev);
487 - if the device has not been suspended at run time, invoke the ->suspend()
488 callback provided by its driver and return its result, or return 0 if not
489 defined
490
491 int pm_generic_resume(struct device *dev);
492 - invoke the ->resume() callback provided by the driver of this device and,
493 if successful, change the device's runtime PM status to 'active'
494
495 int pm_generic_freeze(struct device *dev);
496 - if the device has not been suspended at run time, invoke the ->freeze()
497 callback provided by its driver and return its result, or return 0 if not
498 defined
499
500 int pm_generic_thaw(struct device *dev);
501 - if the device has not been suspended at run time, invoke the ->thaw()
502 callback provided by its driver and return its result, or return 0 if not
503 defined
504
505 int pm_generic_poweroff(struct device *dev);
506 - if the device has not been suspended at run time, invoke the ->poweroff()
507 callback provided by its driver and return its result, or return 0 if not
508 defined
509
510 int pm_generic_restore(struct device *dev);
511 - invoke the ->restore() callback provided by the driver of this device and,
512 if successful, change the device's runtime PM status to 'active'
513
514These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(),
515->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(),
516or ->restore() callback pointers in the subsystem-level dev_pm_ops structures.
517
518If a subsystem wishes to use all of them at the same time, it can simply assign
519the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
520dev_pm_ops structure pointer.
521
522Device drivers that wish to use the same function as a system suspend, freeze,
523poweroff and run-time suspend callback, and similarly for system resume, thaw,
524restore, and run-time resume, can achieve this with the help of the
525UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
526last argument to NULL).
diff --git a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt b/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt
new file mode 100644
index 000000000000..515ebcf1b97d
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt
@@ -0,0 +1,93 @@
1PPC440SPe DMA/XOR (DMA Controller and XOR Accelerator)
2
3Device nodes needed for operation of the ppc440spe-adma driver
4are specified hereby. These are I2O/DMA, DMA and XOR nodes
5for DMA engines and Memory Queue Module node. The latter is used
6by ADMA driver for configuration of RAID-6 H/W capabilities of
7the PPC440SPe. In addition to the nodes and properties described
8below, the ranges property of PLB node must specify ranges for
9DMA devices.
10
11 i) The I2O node
12
13 Required properties:
14
15 - compatible : "ibm,i2o-440spe";
16 - reg : <registers mapping>
17 - dcr-reg : <DCR registers range>
18
19 Example:
20
21 I2O: i2o@400100000 {
22 compatible = "ibm,i2o-440spe";
23 reg = <0x00000004 0x00100000 0x100>;
24 dcr-reg = <0x060 0x020>;
25 };
26
27
28 ii) The DMA node
29
30 Required properties:
31
32 - compatible : "ibm,dma-440spe";
33 - cell-index : 1 cell, hardware index of the DMA engine
34 (typically 0x0 and 0x1 for DMA0 and DMA1)
35 - reg : <registers mapping>
36 - dcr-reg : <DCR registers range>
37 - interrupts : <interrupt mapping for DMA0/1 interrupts sources:
38 2 sources: DMAx CS FIFO Needs Service IRQ (on UIC0)
39 and DMA Error IRQ (on UIC1). The latter is common
40 for both DMA engines>.
41 - interrupt-parent : needed for interrupt mapping
42
43 Example:
44
45 DMA0: dma0@400100100 {
46 compatible = "ibm,dma-440spe";
47 cell-index = <0>;
48 reg = <0x00000004 0x00100100 0x100>;
49 dcr-reg = <0x060 0x020>;
50 interrupt-parent = <&DMA0>;
51 interrupts = <0 1>;
52 #interrupt-cells = <1>;
53 #address-cells = <0>;
54 #size-cells = <0>;
55 interrupt-map = <
56 0 &UIC0 0x14 4
57 1 &UIC1 0x16 4>;
58 };
59
60
61 iii) XOR Accelerator node
62
63 Required properties:
64
65 - compatible : "amcc,xor-accelerator";
66 - reg : <registers mapping>
67 - interrupts : <interrupt mapping for XOR interrupt source>
68 - interrupt-parent : for interrupt mapping
69
70 Example:
71
72 xor-accel@400200000 {
73 compatible = "amcc,xor-accelerator";
74 reg = <0x00000004 0x00200000 0x400>;
75 interrupt-parent = <&UIC1>;
76 interrupts = <0x1f 4>;
77 };
78
79
80 iv) Memory Queue Module node
81
82 Required properties:
83
84 - compatible : "ibm,mq-440spe";
85 - dcr-reg : <DCR registers range>
86
87 Example:
88
89 MQ0: mq {
90 compatible = "ibm,mq-440spe";
91 dcr-reg = <0x040 0x020>;
92 };
93
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt
index e8b5bc24d0ac..39e941515a36 100644
--- a/Documentation/powerpc/dts-bindings/fsl/board.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/board.txt
@@ -20,12 +20,16 @@ Required properities:
20- compatible : should be "fsl,fpga-pixis". 20- compatible : should be "fsl,fpga-pixis".
21- reg : should contain the address and the length of the FPPGA register 21- reg : should contain the address and the length of the FPPGA register
22 set. 22 set.
23- interrupt-parent: should specify phandle for the interrupt controller.
24- interrupts : should specify event (wakeup) IRQ.
23 25
24Example (MPC8610HPCD): 26Example (MPC8610HPCD):
25 27
26 board-control@e8000000 { 28 board-control@e8000000 {
27 compatible = "fsl,fpga-pixis"; 29 compatible = "fsl,fpga-pixis";
28 reg = <0xe8000000 32>; 30 reg = <0xe8000000 32>;
31 interrupt-parent = <&mpic>;
32 interrupts = <8 8>;
29 }; 33 };
30 34
31* Freescale BCSR GPIO banks 35* Freescale BCSR GPIO banks
diff --git a/Documentation/powerpc/dts-bindings/fsl/can.txt b/Documentation/powerpc/dts-bindings/fsl/can.txt
new file mode 100644
index 000000000000..2fa4fcd38fd6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/can.txt
@@ -0,0 +1,53 @@
1CAN Device Tree Bindings
2------------------------
3
4(c) 2006-2009 Secret Lab Technologies Ltd
5Grant Likely <grant.likely@secretlab.ca>
6
7fsl,mpc5200-mscan nodes
8-----------------------
9In addition to the required compatible-, reg- and interrupt-properties, you can
10also specify which clock source shall be used for the controller:
11
12- fsl,mscan-clock-source : a string describing the clock source. Valid values
13 are: "ip" for ip bus clock
14 "ref" for reference clock (XTAL)
15 "ref" is default in case this property is not
16 present.
17
18fsl,mpc5121-mscan nodes
19-----------------------
20In addition to the required compatible-, reg- and interrupt-properties, you can
21also specify which clock source and divider shall be used for the controller:
22
23- fsl,mscan-clock-source : a string describing the clock source. Valid values
24 are: "ip" for ip bus clock
25 "ref" for reference clock
26 "sys" for system clock
27 If this property is not present, an optimal CAN
28 clock source and frequency based on the system
29 clock will be selected. If this is not possible,
30 the reference clock will be used.
31
32- fsl,mscan-clock-divider: for the reference and system clock, an additional
33 clock divider can be specified. By default, a
34 value of 1 is used.
35
36Note that the MPC5121 Rev. 1 processor is not supported.
37
38Examples:
39 can@1300 {
40 compatible = "fsl,mpc5121-mscan";
41 interrupts = <12 0x8>;
42 interrupt-parent = <&ipic>;
43 reg = <0x1300 0x80>;
44 };
45
46 can@1380 {
47 compatible = "fsl,mpc5121-mscan";
48 interrupts = <13 0x8>;
49 interrupt-parent = <&ipic>;
50 reg = <0x1380 0x80>;
51 fsl,mscan-clock-source = "ref";
52 fsl,mscan-clock-divider = <3>;
53 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/powerpc/dts-bindings/fsl/dma.txt
index 0732cdd05ba1..2a4b4bce6110 100644
--- a/Documentation/powerpc/dts-bindings/fsl/dma.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/dma.txt
@@ -44,21 +44,29 @@ Example:
44 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; 44 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
45 cell-index = <0>; 45 cell-index = <0>;
46 reg = <0 0x80>; 46 reg = <0 0x80>;
47 interrupt-parent = <&ipic>;
48 interrupts = <71 8>;
47 }; 49 };
48 dma-channel@80 { 50 dma-channel@80 {
49 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; 51 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
50 cell-index = <1>; 52 cell-index = <1>;
51 reg = <0x80 0x80>; 53 reg = <0x80 0x80>;
54 interrupt-parent = <&ipic>;
55 interrupts = <71 8>;
52 }; 56 };
53 dma-channel@100 { 57 dma-channel@100 {
54 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; 58 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
55 cell-index = <2>; 59 cell-index = <2>;
56 reg = <0x100 0x80>; 60 reg = <0x100 0x80>;
61 interrupt-parent = <&ipic>;
62 interrupts = <71 8>;
57 }; 63 };
58 dma-channel@180 { 64 dma-channel@180 {
59 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel"; 65 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
60 cell-index = <3>; 66 cell-index = <3>;
61 reg = <0x180 0x80>; 67 reg = <0x180 0x80>;
68 interrupt-parent = <&ipic>;
69 interrupts = <71 8>;
62 }; 70 };
63 }; 71 };
64 72
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
index b6d2e21474f9..50da20310585 100644
--- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
@@ -2,15 +2,14 @@
2 2
3Required properties : 3Required properties :
4 4
5 - device_type : Should be "i2c"
6 - reg : Offset and length of the register set for the device 5 - reg : Offset and length of the register set for the device
6 - compatible : should be "fsl,CHIP-i2c" where CHIP is the name of a
7 compatible processor, e.g. mpc8313, mpc8543, mpc8544, mpc5121,
8 mpc5200 or mpc5200b. For the mpc5121, an additional node
9 "fsl,mpc5121-i2c-ctrl" is required as shown in the example below.
7 10
8Recommended properties : 11Recommended properties :
9 12
10 - compatible : compatibility list with 2 entries, the first should
11 be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor,
12 e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
13 should be "fsl-i2c".
14 - interrupts : <a b> where a is the interrupt number and b is a 13 - interrupts : <a b> where a is the interrupt number and b is a
15 field that represents an encoding of the sense and level 14 field that represents an encoding of the sense and level
16 information for the interrupt. This should be encoded based on 15 information for the interrupt. This should be encoded based on
@@ -24,25 +23,40 @@ Recommended properties :
24 23
25Examples : 24Examples :
26 25
26 /* MPC5121 based board */
27 i2c@1740 {
28 #address-cells = <1>;
29 #size-cells = <0>;
30 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
31 reg = <0x1740 0x20>;
32 interrupts = <11 0x8>;
33 interrupt-parent = <&ipic>;
34 clock-frequency = <100000>;
35 };
36
37 i2ccontrol@1760 {
38 compatible = "fsl,mpc5121-i2c-ctrl";
39 reg = <0x1760 0x8>;
40 };
41
42 /* MPC5200B based board */
27 i2c@3d00 { 43 i2c@3d00 {
28 #address-cells = <1>; 44 #address-cells = <1>;
29 #size-cells = <0>; 45 #size-cells = <0>;
30 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c"; 46 compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
31 cell-index = <0>;
32 reg = <0x3d00 0x40>; 47 reg = <0x3d00 0x40>;
33 interrupts = <2 15 0>; 48 interrupts = <2 15 0>;
34 interrupt-parent = <&mpc5200_pic>; 49 interrupt-parent = <&mpc5200_pic>;
35 fsl,preserve-clocking; 50 fsl,preserve-clocking;
36 }; 51 };
37 52
53 /* MPC8544 base board */
38 i2c@3100 { 54 i2c@3100 {
39 #address-cells = <1>; 55 #address-cells = <1>;
40 #size-cells = <0>; 56 #size-cells = <0>;
41 cell-index = <1>;
42 compatible = "fsl,mpc8544-i2c", "fsl-i2c"; 57 compatible = "fsl,mpc8544-i2c", "fsl-i2c";
43 reg = <0x3100 0x100>; 58 reg = <0x3100 0x100>;
44 interrupts = <43 2>; 59 interrupts = <43 2>;
45 interrupt-parent = <&mpic>; 60 interrupt-parent = <&mpic>;
46 clock-frequency = <400000>; 61 clock-frequency = <400000>;
47 }; 62 };
48
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt
new file mode 100644
index 000000000000..8832e8798912
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt
@@ -0,0 +1,70 @@
1MPC5121 PSC Device Tree Bindings
2
3PSC in UART mode
4----------------
5
6For PSC in UART mode the needed PSC serial devices
7are specified by fsl,mpc5121-psc-uart nodes in the
8fsl,mpc5121-immr SoC node. Additionally the PSC FIFO
9Controller node fsl,mpc5121-psc-fifo is requered there:
10
11fsl,mpc5121-psc-uart nodes
12--------------------------
13
14Required properties :
15 - compatible : Should contain "fsl,mpc5121-psc-uart" and "fsl,mpc5121-psc"
16 - cell-index : Index of the PSC in hardware
17 - reg : Offset and length of the register set for the PSC device
18 - interrupts : <a b> where a is the interrupt number of the
19 PSC FIFO Controller and b is a field that represents an
20 encoding of the sense and level information for the interrupt.
21 - interrupt-parent : the phandle for the interrupt controller that
22 services interrupts for this device.
23
24Recommended properties :
25 - fsl,rx-fifo-size : the size of the RX fifo slice (a multiple of 4)
26 - fsl,tx-fifo-size : the size of the TX fifo slice (a multiple of 4)
27
28
29fsl,mpc5121-psc-fifo node
30-------------------------
31
32Required properties :
33 - compatible : Should be "fsl,mpc5121-psc-fifo"
34 - reg : Offset and length of the register set for the PSC
35 FIFO Controller
36 - interrupts : <a b> where a is the interrupt number of the
37 PSC FIFO Controller and b is a field that represents an
38 encoding of the sense and level information for the interrupt.
39 - interrupt-parent : the phandle for the interrupt controller that
40 services interrupts for this device.
41
42
43Example for a board using PSC0 and PSC1 devices in serial mode:
44
45serial@11000 {
46 compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
47 cell-index = <0>;
48 reg = <0x11000 0x100>;
49 interrupts = <40 0x8>;
50 interrupt-parent = < &ipic >;
51 fsl,rx-fifo-size = <16>;
52 fsl,tx-fifo-size = <16>;
53};
54
55serial@11100 {
56 compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
57 cell-index = <1>;
58 reg = <0x11100 0x100>;
59 interrupts = <40 0x8>;
60 interrupt-parent = < &ipic >;
61 fsl,rx-fifo-size = <16>;
62 fsl,tx-fifo-size = <16>;
63};
64
65pscfifo@11f00 {
66 compatible = "fsl,mpc5121-psc-fifo";
67 reg = <0x11f00 0x100>;
68 interrupts = <40 0x8>;
69 interrupt-parent = < &ipic >;
70};
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt b/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
index 8447fd7090d0..4ccb2cd5df94 100644
--- a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
@@ -103,7 +103,22 @@ fsl,mpc5200-gpt nodes
103--------------------- 103---------------------
104On the mpc5200 and 5200b, GPT0 has a watchdog timer function. If the board 104On the mpc5200 and 5200b, GPT0 has a watchdog timer function. If the board
105design supports the internal wdt, then the device node for GPT0 should 105design supports the internal wdt, then the device node for GPT0 should
106include the empty property 'fsl,has-wdt'. 106include the empty property 'fsl,has-wdt'. Note that this does not activate
107the watchdog. The timer will function as a GPT if the timer api is used, and
108it will function as watchdog if the watchdog device is used. The watchdog
109mode has priority over the gpt mode, i.e. if the watchdog is activated, any
110gpt api call to this timer will fail with -EBUSY.
111
112If you add the property
113 fsl,wdt-on-boot = <n>;
114GPT0 will be marked as in-use watchdog, i.e. blocking every gpt access to it.
115If n>0, the watchdog is started with a timeout of n seconds. If n=0, the
116configuration of the watchdog is not touched. This is useful in two cases:
117- just mark GPT0 as watchdog, blocking gpt accesses, and configure it later;
118- do not touch a configuration assigned by the boot loader which supervises
119 the boot process itself.
120
121The watchdog will respect the CONFIG_WATCHDOG_NOWAYOUT option.
107 122
108An mpc5200-gpt can be used as a single line GPIO controller. To do so, 123An mpc5200-gpt can be used as a single line GPIO controller. To do so,
109add the following properties to the gpt node: 124add the following properties to the gpt node:
@@ -178,3 +193,6 @@ External interrupts:
178 external irq3: interrupts = <1 3 n>; 193 external irq3: interrupts = <1 3 n>;
179'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low) 194'n' is sense (0: level high, 1: edge rising, 2: edge falling 3: level low)
180 195
196fsl,mpc5200-mscan nodes
197-----------------------
198See file can.txt in this directory.
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpic.txt b/Documentation/powerpc/dts-bindings/fsl/mpic.txt
new file mode 100644
index 000000000000..71e39cf3215b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/mpic.txt
@@ -0,0 +1,42 @@
1* OpenPIC and its interrupt numbers on Freescale's e500/e600 cores
2
3The OpenPIC specification does not specify which interrupt source has to
4become which interrupt number. This is up to the software implementation
5of the interrupt controller. The only requirement is that every
6interrupt source has to have an unique interrupt number / vector number.
7To accomplish this the current implementation assigns the number zero to
8the first source, the number one to the second source and so on until
9all interrupt sources have their unique number.
10Usually the assigned vector number equals the interrupt number mentioned
11in the documentation for a given core / CPU. This is however not true
12for the e500 cores (MPC85XX CPUs) where the documentation distinguishes
13between internal and external interrupt sources and starts counting at
14zero for both of them.
15
16So what to write for external interrupt source X or internal interrupt
17source Y into the device tree? Here is an example:
18
19The memory map for the interrupt controller in the MPC8544[0] shows,
20that the first interrupt source starts at 0x5_0000 (PIC Register Address
21Map-Interrupt Source Configuration Registers). This source becomes the
22number zero therefore:
23 External interrupt 0 = interrupt number 0
24 External interrupt 1 = interrupt number 1
25 External interrupt 2 = interrupt number 2
26 ...
27Every interrupt number allocates 0x20 bytes register space. So to get
28its number it is sufficient to shift the lower 16bits to right by five.
29So for the external interrupt 10 we have:
30 0x0140 >> 5 = 10
31
32After the external sources, the internal sources follow. The in core I2C
33controller on the MPC8544 for instance has the internal source number
3427. Oo obtain its interrupt number we take the lower 16bits of its memory
35address (0x5_0560) and shift it right:
36 0x0560 >> 5 = 43
37
38Therefore the I2C device node for the MPC8544 CPU has to have the
39interrupt number 43 specified in the device tree.
40
41[0] MPC8544E PowerQUICCTM III, Integrated Host Processor Family Reference Manual
42 MPC8544ERM Rev. 1 10/2007
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
index e7d9a344c4f4..80510c018eea 100644
--- a/Documentation/powerpc/dts-bindings/fsl/spi.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -13,6 +13,11 @@ Required properties:
13- interrupt-parent : the phandle for the interrupt controller that 13- interrupt-parent : the phandle for the interrupt controller that
14 services interrupts for this device. 14 services interrupts for this device.
15 15
16Optional properties:
17- gpios : specifies the gpio pins to be used for chipselects.
18 The gpios will be referred to as reg = <index> in the SPI child nodes.
19 If unspecified, a single SPI device without a chip select can be used.
20
16Example: 21Example:
17 spi@4c0 { 22 spi@4c0 {
18 cell-index = <0>; 23 cell-index = <0>;
@@ -21,4 +26,6 @@ Example:
21 interrupts = <82 0>; 26 interrupts = <82 0>;
22 interrupt-parent = <700>; 27 interrupt-parent = <700>;
23 mode = "cpu"; 28 mode = "cpu";
29 gpios = <&gpio 18 1 // device reg=<0>
30 &gpio 19 1>; // device reg=<1>
24 }; 31 };
diff --git a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt b/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt
new file mode 100644
index 000000000000..b558585b1aaf
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt
@@ -0,0 +1,109 @@
1
2Nintendo GameCube device tree
3=============================
4
51) The "flipper" node
6
7 This node represents the multi-function "Flipper" chip, which packages
8 many of the devices found in the Nintendo GameCube.
9
10 Required properties:
11
12 - compatible : Should be "nintendo,flipper"
13
141.a) The Video Interface (VI) node
15
16 Represents the interface between the graphics processor and a external
17 video encoder.
18
19 Required properties:
20
21 - compatible : should be "nintendo,flipper-vi"
22 - reg : should contain the VI registers location and length
23 - interrupts : should contain the VI interrupt
24
251.b) The Processor Interface (PI) node
26
27 Represents the data and control interface between the main processor
28 and graphics and audio processor.
29
30 Required properties:
31
32 - compatible : should be "nintendo,flipper-pi"
33 - reg : should contain the PI registers location and length
34
351.b.i) The "Flipper" interrupt controller node
36
37 Represents the interrupt controller within the "Flipper" chip.
38 The node for the "Flipper" interrupt controller must be placed under
39 the PI node.
40
41 Required properties:
42
43 - compatible : should be "nintendo,flipper-pic"
44
451.c) The Digital Signal Procesor (DSP) node
46
47 Represents the digital signal processor interface, designed to offload
48 audio related tasks.
49
50 Required properties:
51
52 - compatible : should be "nintendo,flipper-dsp"
53 - reg : should contain the DSP registers location and length
54 - interrupts : should contain the DSP interrupt
55
561.c.i) The Auxiliary RAM (ARAM) node
57
58 Represents the non cpu-addressable ram designed mainly to store audio
59 related information.
60 The ARAM node must be placed under the DSP node.
61
62 Required properties:
63
64 - compatible : should be "nintendo,flipper-aram"
65 - reg : should contain the ARAM start (zero-based) and length
66
671.d) The Disk Interface (DI) node
68
69 Represents the interface used to communicate with mass storage devices.
70
71 Required properties:
72
73 - compatible : should be "nintendo,flipper-di"
74 - reg : should contain the DI registers location and length
75 - interrupts : should contain the DI interrupt
76
771.e) The Audio Interface (AI) node
78
79 Represents the interface to the external 16-bit stereo digital-to-analog
80 converter.
81
82 Required properties:
83
84 - compatible : should be "nintendo,flipper-ai"
85 - reg : should contain the AI registers location and length
86 - interrupts : should contain the AI interrupt
87
881.f) The Serial Interface (SI) node
89
90 Represents the interface to the four single bit serial interfaces.
91 The SI is a proprietary serial interface used normally to control gamepads.
92 It's NOT a RS232-type interface.
93
94 Required properties:
95
96 - compatible : should be "nintendo,flipper-si"
97 - reg : should contain the SI registers location and length
98 - interrupts : should contain the SI interrupt
99
1001.g) The External Interface (EXI) node
101
102 Represents the multi-channel SPI-like interface.
103
104 Required properties:
105
106 - compatible : should be "nintendo,flipper-exi"
107 - reg : should contain the EXI registers location and length
108 - interrupts : should contain the EXI interrupt
109
diff --git a/Documentation/powerpc/dts-bindings/nintendo/wii.txt b/Documentation/powerpc/dts-bindings/nintendo/wii.txt
new file mode 100644
index 000000000000..a7e155a023b8
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/nintendo/wii.txt
@@ -0,0 +1,184 @@
1
2Nintendo Wii device tree
3========================
4
50) The root node
6
7 This node represents the Nintendo Wii video game console.
8
9 Required properties:
10
11 - model : Should be "nintendo,wii"
12 - compatible : Should be "nintendo,wii"
13
141) The "hollywood" node
15
16 This node represents the multi-function "Hollywood" chip, which packages
17 many of the devices found in the Nintendo Wii.
18
19 Required properties:
20
21 - compatible : Should be "nintendo,hollywood"
22
231.a) The Video Interface (VI) node
24
25 Represents the interface between the graphics processor and a external
26 video encoder.
27
28 Required properties:
29
30 - compatible : should be "nintendo,hollywood-vi","nintendo,flipper-vi"
31 - reg : should contain the VI registers location and length
32 - interrupts : should contain the VI interrupt
33
341.b) The Processor Interface (PI) node
35
36 Represents the data and control interface between the main processor
37 and graphics and audio processor.
38
39 Required properties:
40
41 - compatible : should be "nintendo,hollywood-pi","nintendo,flipper-pi"
42 - reg : should contain the PI registers location and length
43
441.b.i) The "Flipper" interrupt controller node
45
46 Represents the "Flipper" interrupt controller within the "Hollywood" chip.
47 The node for the "Flipper" interrupt controller must be placed under
48 the PI node.
49
50 Required properties:
51
52 - #interrupt-cells : <1>
53 - compatible : should be "nintendo,flipper-pic"
54 - interrupt-controller
55
561.c) The Digital Signal Procesor (DSP) node
57
58 Represents the digital signal processor interface, designed to offload
59 audio related tasks.
60
61 Required properties:
62
63 - compatible : should be "nintendo,hollywood-dsp","nintendo,flipper-dsp"
64 - reg : should contain the DSP registers location and length
65 - interrupts : should contain the DSP interrupt
66
671.d) The Serial Interface (SI) node
68
69 Represents the interface to the four single bit serial interfaces.
70 The SI is a proprietary serial interface used normally to control gamepads.
71 It's NOT a RS232-type interface.
72
73 Required properties:
74
75 - compatible : should be "nintendo,hollywood-si","nintendo,flipper-si"
76 - reg : should contain the SI registers location and length
77 - interrupts : should contain the SI interrupt
78
791.e) The Audio Interface (AI) node
80
81 Represents the interface to the external 16-bit stereo digital-to-analog
82 converter.
83
84 Required properties:
85
86 - compatible : should be "nintendo,hollywood-ai","nintendo,flipper-ai"
87 - reg : should contain the AI registers location and length
88 - interrupts : should contain the AI interrupt
89
901.f) The External Interface (EXI) node
91
92 Represents the multi-channel SPI-like interface.
93
94 Required properties:
95
96 - compatible : should be "nintendo,hollywood-exi","nintendo,flipper-exi"
97 - reg : should contain the EXI registers location and length
98 - interrupts : should contain the EXI interrupt
99
1001.g) The Open Host Controller Interface (OHCI) nodes
101
102 Represent the USB 1.x Open Host Controller Interfaces.
103
104 Required properties:
105
106 - compatible : should be "nintendo,hollywood-usb-ohci","usb-ohci"
107 - reg : should contain the OHCI registers location and length
108 - interrupts : should contain the OHCI interrupt
109
1101.h) The Enhanced Host Controller Interface (EHCI) node
111
112 Represents the USB 2.0 Enhanced Host Controller Interface.
113
114 Required properties:
115
116 - compatible : should be "nintendo,hollywood-usb-ehci","usb-ehci"
117 - reg : should contain the EHCI registers location and length
118 - interrupts : should contain the EHCI interrupt
119
1201.i) The Secure Digital Host Controller Interface (SDHCI) nodes
121
122 Represent the Secure Digital Host Controller Interfaces.
123
124 Required properties:
125
126 - compatible : should be "nintendo,hollywood-sdhci","sdhci"
127 - reg : should contain the SDHCI registers location and length
128 - interrupts : should contain the SDHCI interrupt
129
1301.j) The Inter-Processsor Communication (IPC) node
131
132 Represent the Inter-Processor Communication interface. This interface
133 enables communications between the Broadway and the Starlet processors.
134
135 - compatible : should be "nintendo,hollywood-ipc"
136 - reg : should contain the IPC registers location and length
137 - interrupts : should contain the IPC interrupt
138
1391.k) The "Hollywood" interrupt controller node
140
141 Represents the "Hollywood" interrupt controller within the
142 "Hollywood" chip.
143
144 Required properties:
145
146 - #interrupt-cells : <1>
147 - compatible : should be "nintendo,hollywood-pic"
148 - reg : should contain the controller registers location and length
149 - interrupt-controller
150 - interrupts : should contain the cascade interrupt of the "flipper" pic
151 - interrupt-parent: should contain the phandle of the "flipper" pic
152
1531.l) The General Purpose I/O (GPIO) controller node
154
155 Represents the dual access 32 GPIO controller interface.
156
157 Required properties:
158
159 - #gpio-cells : <2>
160 - compatible : should be "nintendo,hollywood-gpio"
161 - reg : should contain the IPC registers location and length
162 - gpio-controller
163
1641.m) The control node
165
166 Represents the control interface used to setup several miscellaneous
167 settings of the "Hollywood" chip like boot memory mappings, resets,
168 disk interface mode, etc.
169
170 Required properties:
171
172 - compatible : should be "nintendo,hollywood-control"
173 - reg : should contain the control registers location and length
174
1751.n) The Disk Interface (DI) node
176
177 Represents the interface used to communicate with mass storage devices.
178
179 Required properties:
180
181 - compatible : should be "nintendo,hollywood-di"
182 - reg : should contain the DI registers location and length
183 - interrupts : should contain the DI interrupt
184
diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/powerpc/dts-bindings/xilinx.txt
index 80339fe4300b..ea68046bb9cb 100644
--- a/Documentation/powerpc/dts-bindings/xilinx.txt
+++ b/Documentation/powerpc/dts-bindings/xilinx.txt
@@ -292,4 +292,15 @@
292 - reg-offset : A value of 3 is required 292 - reg-offset : A value of 3 is required
293 - reg-shift : A value of 2 is required 293 - reg-shift : A value of 2 is required
294 294
295 vii) Xilinx USB Host controller
296
297 The Xilinx USB host controller is EHCI compatible but with a different
298 base address for the EHCI registers, and it is always a big-endian
299 USB Host controller. The hardware can be configured as high speed only,
300 or high speed/full speed hybrid.
301
302 Required properties:
303 - xlnx,support-usb-fs: A value 0 means the core is built as high speed
304 only. A value 1 means the core also supports
305 full speed devices.
295 306
diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt
new file mode 100644
index 000000000000..f4a5499b7bc6
--- /dev/null
+++ b/Documentation/powerpc/ptrace.txt
@@ -0,0 +1,134 @@
1GDB intends to support the following hardware debug features of BookE
2processors:
3
44 hardware breakpoints (IAC)
52 hardware watchpoints (read, write and read-write) (DAC)
62 value conditions for the hardware watchpoints (DVC)
7
8For that, we need to extend ptrace so that GDB can query and set these
9resources. Since we're extending, we're trying to create an interface
10that's extendable and that covers both BookE and server processors, so
11that GDB doesn't need to special-case each of them. We added the
12following 3 new ptrace requests.
13
141. PTRACE_PPC_GETHWDEBUGINFO
15
16Query for GDB to discover the hardware debug features. The main info to
17be returned here is the minimum alignment for the hardware watchpoints.
18BookE processors don't have restrictions here, but server processors have
19an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid
20adding special cases to GDB based on what it sees in AUXV.
21
22Since we're at it, we added other useful info that the kernel can return to
23GDB: this query will return the number of hardware breakpoints, hardware
24watchpoints and whether it supports a range of addresses and a condition.
25The query will fill the following structure provided by the requesting process:
26
27struct ppc_debug_info {
28 unit32_t version;
29 unit32_t num_instruction_bps;
30 unit32_t num_data_bps;
31 unit32_t num_condition_regs;
32 unit32_t data_bp_alignment;
33 unit32_t sizeof_condition; /* size of the DVC register */
34 uint64_t features; /* bitmask of the individual flags */
35};
36
37features will have bits indicating whether there is support for:
38
39#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1
40#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2
41#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4
42#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8
43
442. PTRACE_SETHWDEBUG
45
46Sets a hardware breakpoint or watchpoint, according to the provided structure:
47
48struct ppc_hw_breakpoint {
49 uint32_t version;
50#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1
51#define PPC_BREAKPOINT_TRIGGER_READ 0x2
52#define PPC_BREAKPOINT_TRIGGER_WRITE 0x4
53 uint32_t trigger_type; /* only some combinations allowed */
54#define PPC_BREAKPOINT_MODE_EXACT 0x0
55#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1
56#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2
57#define PPC_BREAKPOINT_MODE_MASK 0x3
58 uint32_t addr_mode; /* address match mode */
59
60#define PPC_BREAKPOINT_CONDITION_MODE 0x3
61#define PPC_BREAKPOINT_CONDITION_NONE 0x0
62#define PPC_BREAKPOINT_CONDITION_AND 0x1
63#define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */
64#define PPC_BREAKPOINT_CONDITION_OR 0x2
65#define PPC_BREAKPOINT_CONDITION_AND_OR 0x3
66#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */
67#define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16))
68 uint32_t condition_mode; /* break/watchpoint condition flags */
69
70 uint64_t addr;
71 uint64_t addr2;
72 uint64_t condition_value;
73};
74
75A request specifies one event, not necessarily just one register to be set.
76For instance, if the request is for a watchpoint with a condition, both the
77DAC and DVC registers will be set in the same request.
78
79With this GDB can ask for all kinds of hardware breakpoints and watchpoints
80that the BookE supports. COMEFROM breakpoints available in server processors
81are not contemplated, but that is out of the scope of this work.
82
83ptrace will return an integer (handle) uniquely identifying the breakpoint or
84watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG
85request to ask for its removal. Return -ENOSPC if the requested breakpoint
86can't be allocated on the registers.
87
88Some examples of using the structure to:
89
90- set a breakpoint in the first breakpoint register
91
92 p.version = PPC_DEBUG_CURRENT_VERSION;
93 p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE;
94 p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
95 p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
96 p.addr = (uint64_t) address;
97 p.addr2 = 0;
98 p.condition_value = 0;
99
100- set a watchpoint which triggers on reads in the second watchpoint register
101
102 p.version = PPC_DEBUG_CURRENT_VERSION;
103 p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ;
104 p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
105 p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
106 p.addr = (uint64_t) address;
107 p.addr2 = 0;
108 p.condition_value = 0;
109
110- set a watchpoint which triggers only with a specific value
111
112 p.version = PPC_DEBUG_CURRENT_VERSION;
113 p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ;
114 p.addr_mode = PPC_BREAKPOINT_MODE_EXACT;
115 p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL;
116 p.addr = (uint64_t) address;
117 p.addr2 = 0;
118 p.condition_value = (uint64_t) condition;
119
120- set a ranged hardware breakpoint
121
122 p.version = PPC_DEBUG_CURRENT_VERSION;
123 p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE;
124 p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE;
125 p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE;
126 p.addr = (uint64_t) begin_range;
127 p.addr2 = (uint64_t) end_range;
128 p.condition_value = 0;
129
1303. PTRACE_DELHWDEBUG
131
132Takes an integer which identifies an existing breakpoint or watchpoint
133(i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the
134corresponding breakpoint or watchpoint..
diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO
index 339207d11d95..d378cba66456 100644
--- a/Documentation/s390/CommonIO
+++ b/Documentation/s390/CommonIO
@@ -87,6 +87,12 @@ Command line parameters
87 compatibility, by the device number in hexadecimal (0xabcd or abcd). Device 87 compatibility, by the device number in hexadecimal (0xabcd or abcd). Device
88 numbers given as 0xabcd will be interpreted as 0.0.abcd. 88 numbers given as 0xabcd will be interpreted as 0.0.abcd.
89 89
90* /proc/cio_settle
91
92 A write request to this file is blocked until all queued cio actions are
93 handled. This will allow userspace to wait for pending work affecting
94 device availability after changing cio_ignore or the hardware configuration.
95
90* For some of the information present in the /proc filesystem in 2.4 (namely, 96* For some of the information present in the /proc filesystem in 2.4 (namely,
91 /proc/subchannels and /proc/chpids), see driver-model.txt. 97 /proc/subchannels and /proc/chpids), see driver-model.txt.
92 Information formerly in /proc/irq_count is now in /proc/interrupts. 98 Information formerly in /proc/irq_count is now in /proc/interrupts.
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt
index bde473df748d..ed265cf54cde 100644
--- a/Documentation/s390/driver-model.txt
+++ b/Documentation/s390/driver-model.txt
@@ -223,8 +223,8 @@ touched by the driver - it should use the ccwgroup device's driver_data for its
223private data. 223private data.
224 224
225To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in 225To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in
226mind that most drivers will need to implement both a ccwgroup and a ccw driver 226mind that most drivers will need to implement both a ccwgroup and a ccw
227(unless you have a meta ccw driver, like cu3088 for lcs and ctc). 227driver.
228 228
229 229
2302. Channel paths 2302. Channel paths
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt
index 6f5ceb0f09fc..85f3280d7ef6 100644
--- a/Documentation/s390/kvm.txt
+++ b/Documentation/s390/kvm.txt
@@ -102,7 +102,7 @@ args: unsigned long
102see also: include/linux/kvm.h 102see also: include/linux/kvm.h
103This ioctl stores the state of the cpu at the guest real address given as 103This ioctl stores the state of the cpu at the guest real address given as
104argument, unless one of the following values defined in include/linux/kvm.h 104argument, unless one of the following values defined in include/linux/kvm.h
105is given as arguement: 105is given as argument:
106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in 106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in
107absolute lowcore as defined by the principles of operation 107absolute lowcore as defined by the principles of operation
108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in 108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc
index ff19a52fe004..2ffc1148eb95 100644
--- a/Documentation/scsi/ChangeLog.lpfc
+++ b/Documentation/scsi/ChangeLog.lpfc
@@ -989,8 +989,8 @@ Changes from 20040709 to 20040716
989 * Remove redundant port_cmp != 2 check in if 989 * Remove redundant port_cmp != 2 check in if
990 (!port_cmp) { .... if (port_cmp != 2).... } 990 (!port_cmp) { .... if (port_cmp != 2).... }
991 * Clock changes: removed struct clk_data and timerList. 991 * Clock changes: removed struct clk_data and timerList.
992 * Clock changes: seperate nodev_tmo and els_retry_delay into 2 992 * Clock changes: separate nodev_tmo and els_retry_delay into 2
993 seperate timers and convert to 1 argument changed 993 separate timers and convert to 1 argument changed
994 LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert 994 LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert
995 ipfarp_tmo to 1 argument convert target struct tmofunc and 995 ipfarp_tmo to 1 argument convert target struct tmofunc and
996 rtplunfunc to 1 argument * cr_count, cr_delay and 996 rtplunfunc to 1 argument * cr_count, cr_delay and
@@ -1514,7 +1514,7 @@ Changes from 20040402 to 20040409
1514 * Remove unused elxclock declaration in elx_sli.h. 1514 * Remove unused elxclock declaration in elx_sli.h.
1515 * Since everywhere IOCB_ENTRY is used, the return value is cast, 1515 * Since everywhere IOCB_ENTRY is used, the return value is cast,
1516 move the cast into the macro. 1516 move the cast into the macro.
1517 * Split ioctls out into seperate files 1517 * Split ioctls out into separate files
1518 1518
1519Changes from 20040326 to 20040402 1519Changes from 20040326 to 20040402
1520 1520
@@ -1534,7 +1534,7 @@ Changes from 20040326 to 20040402
1534 * Unused variable cleanup 1534 * Unused variable cleanup
1535 * Use Linux list macros for DMABUF_t 1535 * Use Linux list macros for DMABUF_t
1536 * Break up ioctls into 3 sections, dfc, util, hbaapi 1536 * Break up ioctls into 3 sections, dfc, util, hbaapi
1537 rearranged code so this could be easily seperated into a 1537 rearranged code so this could be easily separated into a
1538 differnet module later All 3 are currently turned on by 1538 differnet module later All 3 are currently turned on by
1539 defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, 1539 defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL,
1540 LPFC_HBAAPI_IOCTL 1540 LPFC_HBAAPI_IOCTL
@@ -1551,7 +1551,7 @@ Changes from 20040326 to 20040402
1551 started by lpfc_online(). lpfc_offline() only stopped 1551 started by lpfc_online(). lpfc_offline() only stopped
1552 els_timeout routine. It now stops all timeout routines 1552 els_timeout routine. It now stops all timeout routines
1553 associated with that hba. 1553 associated with that hba.
1554 * Replace seperate next and prev pointers in struct 1554 * Replace separate next and prev pointers in struct
1555 lpfc_bindlist with list_head type. In elxHBA_t, replace 1555 lpfc_bindlist with list_head type. In elxHBA_t, replace
1556 fc_nlpbind_start and _end with fc_nlpbind_list and use 1556 fc_nlpbind_start and _end with fc_nlpbind_list and use
1557 list_head macros to access it. 1557 list_head macros to access it.
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index c851ef497795..30023568805e 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,81 @@
11 Release Date : Thur. Oct 29, 2009 09:12:45 PST 2009 -
2 (emaild-id:megaraidlinux@lsi.com)
3 Bo Yang
4
52 Current Version : 00.00.04.17.1-rc1
63 Older Version : 00.00.04.12
7
81. Add the pad_0 in mfi frame structure to 0 to fix the
9 context value larger than 32bit value issue.
10
112. Add the logic drive list to the driver. Driver will
12 keep the logic drive list internal after driver load.
13
143. driver fixed the device update issue after get the AEN
15 PD delete/ADD, LD add/delete from FW.
16
171 Release Date : Tues. July 28, 2009 10:12:45 PST 2009 -
18 (emaild-id:megaraidlinux@lsi.com)
19 Bo Yang
20
212 Current Version : 00.00.04.12
223 Older Version : 00.00.04.10
23
241. Change the AEN sys PD update from scsi_scan to
25 scsi_add_device and scsi_remove_device.
262. Takeoff the debug print-out in aen_polling routine.
27
281 Release Date : Thur. July 02, 2009 10:12:45 PST 2009 -
29 (emaild-id:megaraidlinux@lsi.com)
30 Bo Yang
31
322 Current Version : 00.00.04.10
333 Older Version : 00.00.04.08
34
351. Add the 3 mins timeout during the controller initialize.
362. Add the fix for 64bit sense date errors.
37
381 Release Date : Tues. May 05, 2009 10:12:45 PST 2009 -
39 (emaild-id:megaraidlinux@lsi.com)
40 Bo Yang
41
422 Current Version : 00.00.04.08
433 Older Version : 00.00.04.06
44
451. Add the fix of pending in FW after deleted the logic drives.
462. Add the fix of deallocating memory after get pdlist.
47
481 Release Date : Tues. March 26, 2009 10:12:45 PST 2009 -
49 (emaild-id:megaraidlinux@lsi.com)
50 Bo Yang
51
522 Current Version : 00.00.04.06
533 Older Version : 00.00.04.04
54
551. Add the fix of the driver cmd empty fix of the driver cmd empty.
562. Add the fix of the driver MSM AEN CMD cause the system slow.
57
581 Release Date : Tues. March 03, 2009 10:12:45 PST 2009 -
59 (emaild-id:megaraidlinux@lsi.com)
60 Bo Yang
61
622 Current Version : 00.00.04.04
633 Older Version : 00.00.04.01
64
651. Add the Tape drive fix to the driver: If the command is for
66 the tape device, set the pthru timeout to the os layer timeout value.
67
682. Add Poll_wait mechanism to Gen-2 Linux driv.
69 In the aen handler, driver needs to wakeup poll handler similar to
70 the way it raises SIGIO.
71
723. Add new controller new SAS2 support to the driver.
73
744. Report the unconfigured PD (system PD) to OS.
75
765. Add the IEEE SGL support to the driver
77
786. Reasign the Application cmds to SAS2 controller
1 79
21 Release Date : Thur.July. 24 11:41:51 PST 2008 - 801 Release Date : Thur.July. 24 11:41:51 PST 2008 -
3 (emaild-id:megaraidlinux@lsi.com) 81 (emaild-id:megaraidlinux@lsi.com)
@@ -185,7 +263,7 @@ ii. FW enables WCE bit in Mode Sense cmd for drives that are configured
185 Disks are exposed with WCE=1. User is advised to enable Write Back 263 Disks are exposed with WCE=1. User is advised to enable Write Back
186 mode only when the controller has battery backup. At this time 264 mode only when the controller has battery backup. At this time
187 Synhronize cache is not supported by the FW. Driver will short-cycle 265 Synhronize cache is not supported by the FW. Driver will short-cycle
188 the cmd and return sucess without sending down to FW. 266 the cmd and return success without sending down to FW.
189 267
1901 Release Date : Sun Jan. 14 11:21:32 PDT 2007 - 2681 Release Date : Sun Jan. 14 11:21:32 PDT 2007 -
191 Sumant Patro <Sumant.Patro@lsil.com>/Bo Yang 269 Sumant Patro <Sumant.Patro@lsil.com>/Bo Yang
diff --git a/Documentation/scsi/hptiop.txt b/Documentation/scsi/hptiop.txt
index a6eb4add1be6..9605179711f4 100644
--- a/Documentation/scsi/hptiop.txt
+++ b/Documentation/scsi/hptiop.txt
@@ -3,6 +3,25 @@ HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop)
3Controller Register Map 3Controller Register Map
4------------------------- 4-------------------------
5 5
6For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2:
7
8 BAR0 offset Register
9 0x11C5C Link Interface IRQ Set
10 0x11C60 Link Interface IRQ Clear
11
12 BAR2 offset Register
13 0x10 Inbound Message Register 0
14 0x14 Inbound Message Register 1
15 0x18 Outbound Message Register 0
16 0x1C Outbound Message Register 1
17 0x20 Inbound Doorbell Register
18 0x24 Inbound Interrupt Status Register
19 0x28 Inbound Interrupt Mask Register
20 0x30 Outbound Interrupt Status Register
21 0x34 Outbound Interrupt Mask Register
22 0x40 Inbound Queue Port
23 0x44 Outbound Queue Port
24
6For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0: 25For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
7 26
8 BAR0 offset Register 27 BAR0 offset Register
@@ -93,7 +112,7 @@ The driver exposes following sysfs attributes:
93 112
94 113
95----------------------------------------------------------------------------- 114-----------------------------------------------------------------------------
96Copyright (C) 2006-2007 HighPoint Technologies, Inc. All Rights Reserved. 115Copyright (C) 2006-2009 HighPoint Technologies, Inc. All Rights Reserved.
97 116
98 This file is distributed in the hope that it will be useful, 117 This file is distributed in the hope that it will be useful,
99 but WITHOUT ANY WARRANTY; without even the implied warranty of 118 but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/Documentation/serial/hayes-esp.txt b/Documentation/serial/hayes-esp.txt
deleted file mode 100644
index 09b5d5856758..000000000000
--- a/Documentation/serial/hayes-esp.txt
+++ /dev/null
@@ -1,154 +0,0 @@
1HAYES ESP DRIVER VERSION 2.1
2
3A big thanks to the people at Hayes, especially Alan Adamson. Their support
4has enabled me to provide enhancements to the driver.
5
6Please report your experiences with this driver to me (arobinso@nyx.net). I
7am looking for both positive and negative feedback.
8
9*** IMPORTANT CHANGES FOR 2.1 ***
10Support for PIO mode. Five situations will cause PIO mode to be used:
111) A multiport card is detected. PIO mode will always be used. (8 port cards
12do not support DMA).
132) The DMA channel is set to an invalid value (anything other than 1 or 3).
143) The DMA buffer/channel could not be allocated. The port will revert to PIO
15mode until it is reopened.
164) Less than a specified number of bytes need to be transferred to/from the
17FIFOs. PIO mode will be used for that transfer only.
185) A port needs to do a DMA transfer and another port is already using the
19DMA channel. PIO mode will be used for that transfer only.
20
21Since the Hayes ESP seems to conflict with other cards (notably sound cards)
22when using DMA, DMA is turned off by default. To use DMA, it must be turned
23on explicitly, either with the "dma=" option described below or with
24setserial. A multiport card can be forced into DMA mode by using setserial;
25however, most multiport cards don't support DMA.
26
27The latest version of setserial allows the enhanced configuration of the ESP
28card to be viewed and modified.
29***
30
31This package contains the files needed to compile a module to support the Hayes
32ESP card. The drivers are basically a modified version of the serial drivers.
33
34Features:
35
36- Uses the enhanced mode of the ESP card, allowing a wider range of
37 interrupts and features than compatibility mode
38- Uses DMA and 16 bit PIO mode to transfer data to and from the ESP's FIFOs,
39 reducing CPU load
40- Supports primary and secondary ports
41
42
43If the driver is compiled as a module, the IRQs to use can be specified by
44using the irq= option. The format is:
45
46irq=[0x100],[0x140],[0x180],[0x200],[0x240],[0x280],[0x300],[0x380]
47
48The address in brackets is the base address of the card. The IRQ of
49nonexistent cards can be set to 0. If an IRQ of a card that does exist is set
50to 0, the driver will attempt to guess at the correct IRQ. For example, to set
51the IRQ of the card at address 0x300 to 12, the insmod command would be:
52
53insmod esp irq=0,0,0,0,0,0,12,0
54
55The custom divisor can be set by using the divisor= option. The format is the
56same as for the irq= option. Each divisor value is a series of hex digits,
57with each digit representing the divisor to use for a corresponding port. The
58divisor value is constructed RIGHT TO LEFT. Specifying a nonzero divisor value
59will automatically set the spd_cust flag. To calculate the divisor to use for
60a certain baud rate, divide the port's base baud (generally 921600) by the
61desired rate. For example, to set the divisor of the primary port at 0x300 to
624 and the divisor of the secondary port at 0x308 to 8, the insmod command would
63be:
64
65insmod esp divisor=0,0,0,0,0,0,0x84,0
66
67The dma= option can be used to set the DMA channel. The channel can be either
681 or 3. Specifying any other value will force the driver to use PIO mode.
69For example, to set the DMA channel to 3, the insmod command would be:
70
71insmod esp dma=3
72
73The rx_trigger= and tx_trigger= options can be used to set the FIFO trigger
74levels. They specify when the ESP card should send an interrupt. Larger
75values will decrease the number of interrupts; however, a value too high may
76result in data loss. Valid values are 1 through 1023, with 768 being the
77default. For example, to set the receive trigger level to 512 bytes and the
78transmit trigger level to 700 bytes, the insmod command would be:
79
80insmod esp rx_trigger=512 tx_trigger=700
81
82The flow_off= and flow_on= options can be used to set the hardware flow off/
83flow on levels. The flow on level must be lower than the flow off level, and
84the flow off level should be higher than rx_trigger. Valid values are 1
85through 1023, with 1016 being the default flow off level and 944 being the
86default flow on level. For example, to set the flow off level to 1000 bytes
87and the flow on level to 935 bytes, the insmod command would be:
88
89insmod esp flow_off=1000 flow_on=935
90
91The rx_timeout= option can be used to set the receive timeout value. This
92value indicates how long after receiving the last character that the ESP card
93should wait before signalling an interrupt. Valid values are 0 though 255,
94with 128 being the default. A value too high will increase latency, and a
95value too low will cause unnecessary interrupts. For example, to set the
96receive timeout to 255, the insmod command would be:
97
98insmod esp rx_timeout=255
99
100The pio_threshold= option sets the threshold (in number of characters) for
101using PIO mode instead of DMA mode. For example, if this value is 32,
102transfers of 32 bytes or less will always use PIO mode.
103
104insmod esp pio_threshold=32
105
106Multiple options can be listed on the insmod command line by separating each
107option with a space. For example:
108
109insmod esp dma=3 trigger=512
110
111The esp module can be automatically loaded when needed. To cause this to
112happen, add the following lines to /etc/modprobe.conf (replacing the last line
113with options for your configuration):
114
115alias char-major-57 esp
116alias char-major-58 esp
117options esp irq=0,0,0,0,0,0,3,0 divisor=0,0,0,0,0,0,0x4,0
118
119You may also need to run 'depmod -a'.
120
121Devices must be created manually. To create the devices, note the output from
122the module after it is inserted. The output will appear in the location where
123kernel messages usually appear (usually /var/adm/messages). Create two devices
124for each 'tty' mentioned, one with major of 57 and the other with major of 58.
125The minor number should be the same as the tty number reported. The commands
126would be (replace ? with the tty number):
127
128mknod /dev/ttyP? c 57 ?
129mknod /dev/cup? c 58 ?
130
131For example, if the following line appears:
132
133Oct 24 18:17:23 techno kernel: ttyP8 at 0x0140 (irq = 3) is an ESP primary port
134
135...two devices should be created:
136
137mknod /dev/ttyP8 c 57 8
138mknod /dev/cup8 c 58 8
139
140You may need to set the permissions on the devices:
141
142chmod 666 /dev/ttyP*
143chmod 666 /dev/cup*
144
145The ESP module and the serial module should not conflict (they can be used at
146the same time). After the ESP module has been loaded the ports on the ESP card
147will no longer be accessible by the serial driver.
148
149If I/O errors are experienced when accessing the port, check for IRQ and DMA
150conflicts ('cat /proc/interrupts' and 'cat /proc/dma' for a list of IRQs and
151DMAs currently in use).
152
153Enjoy!
154Andrew J. Robinson <arobinso@nyx.net>
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt
index 8e65c4498c52..7c900507279f 100644
--- a/Documentation/serial/tty.txt
+++ b/Documentation/serial/tty.txt
@@ -42,7 +42,8 @@ TTY side interfaces:
42open() - Called when the line discipline is attached to 42open() - Called when the line discipline is attached to
43 the terminal. No other call into the line 43 the terminal. No other call into the line
44 discipline for this tty will occur until it 44 discipline for this tty will occur until it
45 completes successfully. Can sleep. 45 completes successfully. Returning an error will
46 prevent the ldisc from being attached. Can sleep.
46 47
47close() - This is called on a terminal when the line 48close() - This is called on a terminal when the line
48 discipline is being unplugged. At the point of 49 discipline is being unplugged. At the point of
@@ -52,7 +53,7 @@ close() - This is called on a terminal when the line
52hangup() - Called when the tty line is hung up. 53hangup() - Called when the tty line is hung up.
53 The line discipline should cease I/O to the tty. 54 The line discipline should cease I/O to the tty.
54 No further calls into the ldisc code will occur. 55 No further calls into the ldisc code will occur.
55 Can sleep. 56 The return value is ignored. Can sleep.
56 57
57write() - A process is writing data through the line 58write() - A process is writing data through the line
58 discipline. Multiple write calls are serialized 59 discipline. Multiple write calls are serialized
@@ -83,6 +84,10 @@ ioctl() - Called when an ioctl is handed to the tty layer
83 that might be for the ldisc. Multiple ioctl calls 84 that might be for the ldisc. Multiple ioctl calls
84 may occur in parallel. May sleep. 85 may occur in parallel. May sleep.
85 86
87compat_ioctl() - Called when a 32 bit ioctl is handed to the tty layer
88 that might be for the ldisc. Multiple ioctl calls
89 may occur in parallel. May sleep.
90
86Driver Side Interfaces: 91Driver Side Interfaces:
87 92
88receive_buf() - Hand buffers of bytes from the driver to the ldisc 93receive_buf() - Hand buffers of bytes from the driver to the ldisc
@@ -100,6 +105,10 @@ write_wakeup() - May be called at any point between open and close.
100 is permitted to call the driver write method from 105 is permitted to call the driver write method from
101 this function. In such a situation defer it. 106 this function. In such a situation defer it.
102 107
108dcd_change() - Report to the tty line the current DCD pin status
109 changes and the relative timestamp. The timestamp
110 can be NULL.
111
103 112
104Driver Access 113Driver Access
105 114
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt
index ebc50f808ea4..9dbf4470c7e1 100644
--- a/Documentation/slow-work.txt
+++ b/Documentation/slow-work.txt
@@ -41,6 +41,13 @@ expand files, provided the time taken to do so isn't too long.
41Operations of both types may sleep during execution, thus tying up the thread 41Operations of both types may sleep during execution, thus tying up the thread
42loaned to it. 42loaned to it.
43 43
44A further class of work item is available, based on the slow work item class:
45
46 (*) Delayed slow work items.
47
48These are slow work items that have a timer to defer queueing of the item for
49a while.
50
44 51
45THREAD-TO-CLASS ALLOCATION 52THREAD-TO-CLASS ALLOCATION
46-------------------------- 53--------------------------
@@ -64,9 +71,11 @@ USING SLOW WORK ITEMS
64Firstly, a module or subsystem wanting to make use of slow work items must 71Firstly, a module or subsystem wanting to make use of slow work items must
65register its interest: 72register its interest:
66 73
67 int ret = slow_work_register_user(); 74 int ret = slow_work_register_user(struct module *module);
68 75
69This will return 0 if successful, or a -ve error upon failure. 76This will return 0 if successful, or a -ve error upon failure. The module
77pointer should be the module interested in using this facility (almost
78certainly THIS_MODULE).
70 79
71 80
72Slow work items may then be set up by: 81Slow work items may then be set up by:
@@ -93,6 +102,10 @@ Slow work items may then be set up by:
93 102
94 or: 103 or:
95 104
105 delayed_slow_work_init(&myitem, &myitem_ops);
106
107 or:
108
96 vslow_work_init(&myitem, &myitem_ops); 109 vslow_work_init(&myitem, &myitem_ops);
97 110
98 depending on its class. 111 depending on its class.
@@ -102,15 +115,92 @@ A suitably set up work item can then be enqueued for processing:
102 int ret = slow_work_enqueue(&myitem); 115 int ret = slow_work_enqueue(&myitem);
103 116
104This will return a -ve error if the thread pool is unable to gain a reference 117This will return a -ve error if the thread pool is unable to gain a reference
105on the item, 0 otherwise. 118on the item, 0 otherwise, or (for delayed work):
119
120 int ret = delayed_slow_work_enqueue(&myitem, my_jiffy_delay);
106 121
107 122
108The items are reference counted, so there ought to be no need for a flush 123The items are reference counted, so there ought to be no need for a flush
109operation. When all a module's slow work items have been processed, and the 124operation. But as the reference counting is optional, means to cancel
125existing work items are also included:
126
127 cancel_slow_work(&myitem);
128 cancel_delayed_slow_work(&myitem);
129
130can be used to cancel pending work. The above cancel function waits for
131existing work to have been executed (or prevent execution of them, depending
132on timing).
133
134
135When all a module's slow work items have been processed, and the
110module has no further interest in the facility, it should unregister its 136module has no further interest in the facility, it should unregister its
111interest: 137interest:
112 138
113 slow_work_unregister_user(); 139 slow_work_unregister_user(struct module *module);
140
141The module pointer is used to wait for all outstanding work items for that
142module before completing the unregistration. This prevents the put_ref() code
143from being taken away before it completes. module should almost certainly be
144THIS_MODULE.
145
146
147================
148HELPER FUNCTIONS
149================
150
151The slow-work facility provides a function by which it can be determined
152whether or not an item is queued for later execution:
153
154 bool queued = slow_work_is_queued(struct slow_work *work);
155
156If it returns false, then the item is not on the queue (it may be executing
157with a requeue pending). This can be used to work out whether an item on which
158another depends is on the queue, thus allowing a dependent item to be queued
159after it.
160
161If the above shows an item on which another depends not to be queued, then the
162owner of the dependent item might need to wait. However, to avoid locking up
163the threads unnecessarily be sleeping in them, it can make sense under some
164circumstances to return the work item to the queue, thus deferring it until
165some other items have had a chance to make use of the yielded thread.
166
167To yield a thread and defer an item, the work function should simply enqueue
168the work item again and return. However, this doesn't work if there's nothing
169actually on the queue, as the thread just vacated will jump straight back into
170the item's work function, thus busy waiting on a CPU.
171
172Instead, the item should use the thread to wait for the dependency to go away,
173but rather than using schedule() or schedule_timeout() to sleep, it should use
174the following function:
175
176 bool requeue = slow_work_sleep_till_thread_needed(
177 struct slow_work *work,
178 signed long *_timeout);
179
180This will add a second wait and then sleep, such that it will be woken up if
181either something appears on the queue that could usefully make use of the
182thread - and behind which this item can be queued, or if the event the caller
183set up to wait for happens. True will be returned if something else appeared
184on the queue and this work function should perhaps return, of false if
185something else woke it up. The timeout is as for schedule_timeout().
186
187For example:
188
189 wq = bit_waitqueue(&my_flags, MY_BIT);
190 init_wait(&wait);
191 requeue = false;
192 do {
193 prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
194 if (!test_bit(MY_BIT, &my_flags))
195 break;
196 requeue = slow_work_sleep_till_thread_needed(&my_work,
197 &timeout);
198 } while (timeout > 0 && !requeue);
199 finish_wait(wq, &wait);
200 if (!test_bit(MY_BIT, &my_flags)
201 goto do_my_thing;
202 if (requeue)
203 return; // to slow_work
114 204
115 205
116=============== 206===============
@@ -118,7 +208,8 @@ ITEM OPERATIONS
118=============== 208===============
119 209
120Each work item requires a table of operations of type struct slow_work_ops. 210Each work item requires a table of operations of type struct slow_work_ops.
121All members are required: 211Only ->execute() is required; the getting and putting of a reference and the
212describing of an item are all optional.
122 213
123 (*) Get a reference on an item: 214 (*) Get a reference on an item:
124 215
@@ -148,6 +239,16 @@ All members are required:
148 This should perform the work required of the item. It may sleep, it may 239 This should perform the work required of the item. It may sleep, it may
149 perform disk I/O and it may wait for locks. 240 perform disk I/O and it may wait for locks.
150 241
242 (*) View an item through /proc:
243
244 void (*desc)(struct slow_work *work, struct seq_file *m);
245
246 If supplied, this should print to 'm' a small string describing the work
247 the item is to do. This should be no more than about 40 characters, and
248 shouldn't include a newline character.
249
250 See the 'Viewing executing and queued items' section below.
251
151 252
152================== 253==================
153POOL CONFIGURATION 254POOL CONFIGURATION
@@ -172,3 +273,50 @@ The slow-work thread pool has a number of configurables:
172 is bounded to between 1 and one fewer than the number of active threads. 273 is bounded to between 1 and one fewer than the number of active threads.
173 This ensures there is always at least one thread that can process very 274 This ensures there is always at least one thread that can process very
174 slow work items, and always at least one thread that won't. 275 slow work items, and always at least one thread that won't.
276
277
278==================================
279VIEWING EXECUTING AND QUEUED ITEMS
280==================================
281
282If CONFIG_SLOW_WORK_DEBUG is enabled, a debugfs file is made available:
283
284 /sys/kernel/debug/slow_work/runqueue
285
286through which the list of work items being executed and the queues of items to
287be executed may be viewed. The owner of a work item is given the chance to
288add some information of its own.
289
290The contents look something like the following:
291
292 THR PID ITEM ADDR FL MARK DESC
293 === ===== ================ == ===== ==========
294 0 3005 ffff880023f52348 a 952ms FSC: OBJ17d3: LOOK
295 1 3006 ffff880024e33668 2 160ms FSC: OBJ17e5 OP60d3b: Write1/Store fl=2
296 2 3165 ffff8800296dd180 a 424ms FSC: OBJ17e4: LOOK
297 3 4089 ffff8800262c8d78 a 212ms FSC: OBJ17ea: CRTN
298 4 4090 ffff88002792bed8 2 388ms FSC: OBJ17e8 OP60d36: Write1/Store fl=2
299 5 4092 ffff88002a0ef308 2 388ms FSC: OBJ17e7 OP60d2e: Write1/Store fl=2
300 6 4094 ffff88002abaf4b8 2 132ms FSC: OBJ17e2 OP60d4e: Write1/Store fl=2
301 7 4095 ffff88002bb188e0 a 388ms FSC: OBJ17e9: CRTN
302 vsq - ffff880023d99668 1 308ms FSC: OBJ17e0 OP60f91: Write1/EnQ fl=2
303 vsq - ffff8800295d1740 1 212ms FSC: OBJ16be OP4d4b6: Write1/EnQ fl=2
304 vsq - ffff880025ba3308 1 160ms FSC: OBJ179a OP58dec: Write1/EnQ fl=2
305 vsq - ffff880024ec83e0 1 160ms FSC: OBJ17ae OP599f2: Write1/EnQ fl=2
306 vsq - ffff880026618e00 1 160ms FSC: OBJ17e6 OP60d33: Write1/EnQ fl=2
307 vsq - ffff880025a2a4b8 1 132ms FSC: OBJ16a2 OP4d583: Write1/EnQ fl=2
308 vsq - ffff880023cbe6d8 9 212ms FSC: OBJ17eb: LOOK
309 vsq - ffff880024d37590 9 212ms FSC: OBJ17ec: LOOK
310 vsq - ffff880027746cb0 9 212ms FSC: OBJ17ed: LOOK
311 vsq - ffff880024d37ae8 9 212ms FSC: OBJ17ee: LOOK
312 vsq - ffff880024d37cb0 9 212ms FSC: OBJ17ef: LOOK
313 vsq - ffff880025036550 9 212ms FSC: OBJ17f0: LOOK
314 vsq - ffff8800250368e0 9 212ms FSC: OBJ17f1: LOOK
315 vsq - ffff880025036aa8 9 212ms FSC: OBJ17f2: LOOK
316
317In the 'THR' column, executing items show the thread they're occupying and
318queued threads indicate which queue they're on. 'PID' shows the process ID of
319a slow-work thread that's executing something. 'FL' shows the work item flags.
320'MARK' indicates how long since an item was queued or began executing. Lastly,
321the 'DESC' column permits the owner of an item to give some information.
322
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 1c8eb4518ce0..bfcbbf88c44d 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -482,6 +482,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
482 482
483 reference_rate - reference sample rate, 44100 or 48000 (default) 483 reference_rate - reference sample rate, 44100 or 48000 (default)
484 multiple - multiple to ref. sample rate, 1 or 2 (default) 484 multiple - multiple to ref. sample rate, 1 or 2 (default)
485 subsystem - override the PCI SSID for probing; the value
486 consists of SSVID << 16 | SSDID. The default is
487 zero, which means no override.
485 488
486 This module supports multiple cards. 489 This module supports multiple cards.
487 490
@@ -522,7 +525,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
522 pcm_devs - Number of PCM devices assigned to each card 525 pcm_devs - Number of PCM devices assigned to each card
523 (default = 1, up to 4) 526 (default = 1, up to 4)
524 pcm_substreams - Number of PCM substreams assigned to each PCM 527 pcm_substreams - Number of PCM substreams assigned to each PCM
525 (default = 8, up to 16) 528 (default = 8, up to 128)
526 hrtimer - Use hrtimer (=1, default) or system timer (=0) 529 hrtimer - Use hrtimer (=1, default) or system timer (=0)
527 fake_buffer - Fake buffer allocations (default = 1) 530 fake_buffer - Fake buffer allocations (default = 1)
528 531
@@ -798,6 +801,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
798 setup before initializing the codecs. This option is 801 setup before initializing the codecs. This option is
799 available only when CONFIG_SND_HDA_PATCH_LOADER=y is set. 802 available only when CONFIG_SND_HDA_PATCH_LOADER=y is set.
800 See HD-Audio.txt for details. 803 See HD-Audio.txt for details.
804 beep_mode - Selects the beep registration mode (0=off, 1=on, 2=
805 dynamic registration via mute switch on/off); the default
806 value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig.
801 807
802 [Single (global) options] 808 [Single (global) options]
803 single_cmd - Use single immediate commands to communicate with 809 single_cmd - Use single immediate commands to communicate with
@@ -1120,6 +1126,21 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1120 1126
1121 This module supports multiple cards, autoprobe and ISA PnP. 1127 This module supports multiple cards, autoprobe and ISA PnP.
1122 1128
1129 Module snd-jazz16
1130 -------------------
1131
1132 Module for Media Vision Jazz16 chipset. The chipset consists of 3 chips:
1133 MVD1216 + MVA416 + MVA514.
1134
1135 port - port # for SB DSP chip (0x210,0x220,0x230,0x240,0x250,0x260)
1136 irq - IRQ # for SB DSP chip (3,5,7,9,10,15)
1137 dma8 - DMA # for SB DSP chip (1,3)
1138 dma16 - DMA # for SB DSP chip (5,7)
1139 mpu_port - MPU-401 port # (0x300,0x310,0x320,0x330)
1140 mpu_irq - MPU-401 irq # (2,3,5,7)
1141
1142 This module supports multiple cards.
1143
1123 Module snd-korg1212 1144 Module snd-korg1212
1124 ------------------- 1145 -------------------
1125 1146
@@ -1454,6 +1475,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1454 1475
1455 Module for internal PC-Speaker. 1476 Module for internal PC-Speaker.
1456 1477
1478 nopcm - Disable PC-Speaker PCM sound. Only beeps remain.
1457 nforce_wa - enable NForce chipset workaround. Expect bad sound. 1479 nforce_wa - enable NForce chipset workaround. Expect bad sound.
1458 1480
1459 This module supports system beeps, some kind of PCM playback and 1481 This module supports system beeps, some kind of PCM playback and
@@ -1631,7 +1653,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1631 Module snd-sscape 1653 Module snd-sscape
1632 ----------------- 1654 -----------------
1633 1655
1634 Module for ENSONIQ SoundScape PnP cards. 1656 Module for ENSONIQ SoundScape cards.
1635 1657
1636 port - Port # (PnP setup) 1658 port - Port # (PnP setup)
1637 wss_port - WSS Port # (PnP setup) 1659 wss_port - WSS Port # (PnP setup)
@@ -1639,10 +1661,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1639 mpu_irq - MPU-401 IRQ # (PnP setup) 1661 mpu_irq - MPU-401 IRQ # (PnP setup)
1640 dma - DMA # (PnP setup) 1662 dma - DMA # (PnP setup)
1641 dma2 - 2nd DMA # (PnP setup, -1 to disable) 1663 dma2 - 2nd DMA # (PnP setup, -1 to disable)
1664 joystick - Enable gameport - 0 = disable (default), 1 = enable
1642 1665
1643 This module supports multiple cards. ISA PnP must be enabled. 1666 This module supports multiple cards.
1644 You need sscape_ctl tool in alsa-tools package for loading 1667
1645 the microcode. 1668 The driver requires the firmware loader support on kernel.
1646 1669
1647 Module snd-sun-amd7930 (on sparc only) 1670 Module snd-sun-amd7930 (on sparc only)
1648 -------------------------------------- 1671 --------------------------------------
@@ -1786,6 +1809,13 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1786 1809
1787 The power-management is supported. 1810 The power-management is supported.
1788 1811
1812 Module snd-ua101
1813 ----------------
1814
1815 Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces.
1816
1817 This module supports multiple devices, autoprobe and hotplugging.
1818
1789 Module snd-usb-audio 1819 Module snd-usb-audio
1790 -------------------- 1820 --------------------
1791 1821
@@ -1918,7 +1948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1918 ------------------- 1948 -------------------
1919 1949
1920 Module for sound cards based on the Asus AV100/AV200 chips, 1950 Module for sound cards based on the Asus AV100/AV200 chips,
1921 i.e., Xonar D1, DX, D2, D2X, HDAV1.3 (Deluxe), Essence ST 1951 i.e., Xonar D1, DX, D2, D2X, DS, HDAV1.3 (Deluxe), Essence ST
1922 (Deluxe) and Essence STX. 1952 (Deluxe) and Essence STX.
1923 1953
1924 This module supports autoprobe and multiple cards. 1954 This module supports autoprobe and multiple cards.
diff --git a/Documentation/sound/alsa/ControlNames.txt b/Documentation/sound/alsa/ControlNames.txt
index 5b18298e9495..fea65bb6269e 100644
--- a/Documentation/sound/alsa/ControlNames.txt
+++ b/Documentation/sound/alsa/ControlNames.txt
@@ -18,8 +18,9 @@ SOURCE:
18 Master 18 Master
19 Master Mono 19 Master Mono
20 Hardware Master 20 Hardware Master
21 Speaker (internal speaker)
21 Headphone 22 Headphone
22 PC Speaker 23 Beep (beep generator)
23 Phone 24 Phone
24 Phone Input 25 Phone Input
25 Phone Output 26 Phone Output
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
index f1708b79f963..1d38b0dfba95 100644
--- a/Documentation/sound/alsa/HD-Audio-Models.txt
+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
@@ -124,8 +124,11 @@ ALC882/883/885/888/889
124 asus-a7m ASUS A7M 124 asus-a7m ASUS A7M
125 macpro MacPro support 125 macpro MacPro support
126 mb5 Macbook 5,1 126 mb5 Macbook 5,1
127 macmini3 Macmini 3,1
128 mba21 Macbook Air 2,1
127 mbp3 Macbook Pro rev3 129 mbp3 Macbook Pro rev3
128 imac24 iMac 24'' with jack detection 130 imac24 iMac 24'' with jack detection
131 imac91 iMac 9,1
129 w2jc ASUS W2JC 132 w2jc ASUS W2JC
130 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883) 133 3stack-2ch-dig 3-jack with SPDIF I/O (ALC883)
131 alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883) 134 alc883-6stack-dig 6-jack digital with SPDIF I/O (ALC883)
@@ -209,6 +212,7 @@ AD1884A / AD1883 / AD1984A / AD1984B
209 laptop laptop with HP jack sensing 212 laptop laptop with HP jack sensing
210 mobile mobile devices with HP jack sensing 213 mobile mobile devices with HP jack sensing
211 thinkpad Lenovo Thinkpad X300 214 thinkpad Lenovo Thinkpad X300
215 touchsmart HP Touchsmart
212 216
213AD1884 217AD1884
214====== 218======
@@ -277,13 +281,16 @@ Conexant 5051
277 laptop Basic Laptop config (default) 281 laptop Basic Laptop config (default)
278 hp HP Spartan laptop 282 hp HP Spartan laptop
279 hp-dv6736 HP dv6736 283 hp-dv6736 HP dv6736
284 hp-f700 HP Compaq Presario F700
280 lenovo-x200 Lenovo X200 laptop 285 lenovo-x200 Lenovo X200 laptop
286 toshiba Toshiba Satellite M300
281 287
282Conexant 5066 288Conexant 5066
283============= 289=============
284 laptop Basic Laptop config (default) 290 laptop Basic Laptop config (default)
285 dell-laptop Dell laptops 291 dell-laptop Dell laptops
286 olpc-xo-1_5 OLPC XO 1.5 292 olpc-xo-1_5 OLPC XO 1.5
293 ideapad Lenovo IdeaPad U150
287 294
288STAC9200 295STAC9200
289======== 296========
@@ -358,6 +365,7 @@ STAC9227/9228/9229/927x
358 5stack-no-fp D965 5stack without front panel 365 5stack-no-fp D965 5stack without front panel
359 dell-3stack Dell Dimension E520 366 dell-3stack Dell Dimension E520
360 dell-bios Fixes with Dell BIOS setup 367 dell-bios Fixes with Dell BIOS setup
368 volknob Fixes with volume-knob widget 0x24
361 auto BIOS setup (default) 369 auto BIOS setup (default)
362 370
363STAC92HD71B* 371STAC92HD71B*
@@ -389,6 +397,7 @@ STAC92HD83*
389 ref Reference board 397 ref Reference board
390 mic-ref Reference board with power management for ports 398 mic-ref Reference board with power management for ports
391 dell-s14 Dell laptop 399 dell-s14 Dell laptop
400 hp HP laptops with (inverted) mute-LED
392 auto BIOS setup (default) 401 auto BIOS setup (default)
393 402
394STAC9872 403STAC9872
@@ -399,4 +408,5 @@ STAC9872
399Cirrus Logic CS4206/4207 408Cirrus Logic CS4206/4207
400======================== 409========================
401 mbp55 MacBook Pro 5,5 410 mbp55 MacBook Pro 5,5
411 imac27 IMac 27 Inch
402 auto BIOS setup (default) 412 auto BIOS setup (default)
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt
index 7b8a5f947d1d..f4dd3bf99d12 100644
--- a/Documentation/sound/alsa/HD-Audio.txt
+++ b/Documentation/sound/alsa/HD-Audio.txt
@@ -452,6 +452,33 @@ Similarly, the lines after `[verb]` are parsed as `init_verbs`
452sysfs entries, and the lines after `[hint]` are parsed as `hints` 452sysfs entries, and the lines after `[hint]` are parsed as `hints`
453sysfs entries, respectively. 453sysfs entries, respectively.
454 454
455Another example to override the codec vendor id from 0x12345678 to
4560xdeadbeef is like below:
457------------------------------------------------------------------------
458 [codec]
459 0x12345678 0xabcd1234 2
460
461 [vendor_id]
462 0xdeadbeef
463------------------------------------------------------------------------
464
465In the similar way, you can override the codec subsystem_id via
466`[subsystem_id]`, the revision id via `[revision_id]` line.
467Also, the codec chip name can be rewritten via `[chip_name]` line.
468------------------------------------------------------------------------
469 [codec]
470 0x12345678 0xabcd1234 2
471
472 [subsystem_id]
473 0xffff1111
474
475 [revision_id]
476 0x10
477
478 [chip_name]
479 My-own NEWS-0002
480------------------------------------------------------------------------
481
455The hd-audio driver reads the file via request_firmware(). Thus, 482The hd-audio driver reads the file via request_firmware(). Thus,
456a patch file has to be located on the appropriate firmware path, 483a patch file has to be located on the appropriate firmware path,
457typically, /lib/firmware. For example, when you pass the option 484typically, /lib/firmware. For example, when you pass the option
@@ -624,11 +651,13 @@ hda-verb. The program gives you an easy-to-use GUI stuff for showing
624the widget information and adjusting the amp values, as well as the 651the widget information and adjusting the amp values, as well as the
625proc-compatible output. 652proc-compatible output.
626 653
627The hda-analyzer is a part of alsa.git repository in 654The hda-analyzer:
628alsa-project.org:
629 655
630- http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer 656- http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer
631 657
658is a part of alsa.git repository in alsa-project.org:
659
660- git://git.alsa-project.org/alsa.git
632 661
633Codecgraph 662Codecgraph
634~~~~~~~~~~ 663~~~~~~~~~~
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/alsa/Procfile.txt
index 719a819f8cc2..07301de12cc4 100644
--- a/Documentation/sound/alsa/Procfile.txt
+++ b/Documentation/sound/alsa/Procfile.txt
@@ -95,7 +95,7 @@ card*/pcm*/xrun_debug
95 It takes an integer value, can be changed by writing to this 95 It takes an integer value, can be changed by writing to this
96 file, such as 96 file, such as
97 97
98 # cat 5 > /proc/asound/card0/pcm0p/xrun_debug 98 # echo 5 > /proc/asound/card0/pcm0p/xrun_debug
99 99
100 The value consists of the following bit flags: 100 The value consists of the following bit flags:
101 bit 0 = Enable XRUN/jiffies debug messages 101 bit 0 = Enable XRUN/jiffies debug messages
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index deab51ddc33e..4884cb33845d 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -538,7 +538,7 @@ SPI MESSAGE QUEUE
538The bulk of the driver will be managing the I/O queue fed by transfer(). 538The bulk of the driver will be managing the I/O queue fed by transfer().
539 539
540That queue could be purely conceptual. For example, a driver used only 540That queue could be purely conceptual. For example, a driver used only
541for low-frequency sensor acess might be fine using synchronous PIO. 541for low-frequency sensor access might be fine using synchronous PIO.
542 542
543But the queue will probably be very real, using message->queue, PIO, 543But the queue will probably be very real, using message->queue, PIO,
544often DMA (especially if the root filesystem is in SPI flash), and 544often DMA (especially if the root filesystem is in SPI flash), and
diff --git a/Documentation/spinlocks.txt b/Documentation/spinlocks.txt
index 619699dde593..178c831b907d 100644
--- a/Documentation/spinlocks.txt
+++ b/Documentation/spinlocks.txt
@@ -1,73 +1,8 @@
1SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and 1Lesson 1: Spin locks
2are hence deprecated.
3 2
4Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or 3The most basic primitive for locking is spinlock.
5__SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static
6initialization.
7
8Most of the time, you can simply turn:
9
10 static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
11
12into:
13
14 static DEFINE_SPINLOCK(xxx_lock);
15
16Static structure member variables go from:
17
18 struct foo bar {
19 .lock = SPIN_LOCK_UNLOCKED;
20 };
21
22to:
23
24 struct foo bar {
25 .lock = __SPIN_LOCK_UNLOCKED(bar.lock);
26 };
27
28Declaration of static rw_locks undergo a similar transformation.
29
30Dynamic initialization, when necessary, may be performed as
31demonstrated below.
32
33 spinlock_t xxx_lock;
34 rwlock_t xxx_rw_lock;
35
36 static int __init xxx_init(void)
37 {
38 spin_lock_init(&xxx_lock);
39 rwlock_init(&xxx_rw_lock);
40 ...
41 }
42
43 module_init(xxx_init);
44
45The following discussion is still valid, however, with the dynamic
46initialization of spinlocks or with DEFINE_SPINLOCK, etc., used
47instead of SPIN_LOCK_UNLOCKED.
48
49-----------------------
50
51On Fri, 2 Jan 1998, Doug Ledford wrote:
52>
53> I'm working on making the aic7xxx driver more SMP friendly (as well as
54> importing the latest FreeBSD sequencer code to have 7895 support) and wanted
55> to get some info from you. The goal here is to make the various routines
56> SMP safe as well as UP safe during interrupts and other manipulating
57> routines. So far, I've added a spin_lock variable to things like my queue
58> structs. Now, from what I recall, there are some spin lock functions I can
59> use to lock these spin locks from other use as opposed to a (nasty)
60> save_flags(); cli(); stuff; restore_flags(); construct. Where do I find
61> these routines and go about making use of them? Do they only lock on a
62> per-processor basis or can they also lock say an interrupt routine from
63> mucking with a queue if the queue routine was manipulating it when the
64> interrupt occurred, or should I still use a cli(); based construct on that
65> one?
66
67See <asm/spinlock.h>. The basic version is:
68
69 spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
70 4
5static DEFINE_SPINLOCK(xxx_lock);
71 6
72 unsigned long flags; 7 unsigned long flags;
73 8
@@ -75,13 +10,11 @@ See <asm/spinlock.h>. The basic version is:
75 ... critical section here .. 10 ... critical section here ..
76 spin_unlock_irqrestore(&xxx_lock, flags); 11 spin_unlock_irqrestore(&xxx_lock, flags);
77 12
78and the above is always safe. It will disable interrupts _locally_, but the 13The above is always safe. It will disable interrupts _locally_, but the
79spinlock itself will guarantee the global lock, so it will guarantee that 14spinlock itself will guarantee the global lock, so it will guarantee that
80there is only one thread-of-control within the region(s) protected by that 15there is only one thread-of-control within the region(s) protected by that
81lock. 16lock. This works well even under UP. The above sequence under UP
82 17essentially is just the same as doing
83Note that it works well even under UP - the above sequence under UP
84essentially is just the same as doing a
85 18
86 unsigned long flags; 19 unsigned long flags;
87 20
@@ -91,15 +24,13 @@ essentially is just the same as doing a
91 24
92so the code does _not_ need to worry about UP vs SMP issues: the spinlocks 25so the code does _not_ need to worry about UP vs SMP issues: the spinlocks
93work correctly under both (and spinlocks are actually more efficient on 26work correctly under both (and spinlocks are actually more efficient on
94architectures that allow doing the "save_flags + cli" in one go because I 27architectures that allow doing the "save_flags + cli" in one operation).
95don't export that interface normally). 28
29 NOTE! Implications of spin_locks for memory are further described in:
96 30
97NOTE NOTE NOTE! The reason the spinlock is so much faster than a global 31 Documentation/memory-barriers.txt
98interrupt lock under SMP is exactly because it disables interrupts only on 32 (5) LOCK operations.
99the local CPU. The spin-lock is safe only when you _also_ use the lock 33 (6) UNLOCK operations.
100itself to do locking across CPU's, which implies that EVERYTHING that
101touches a shared variable has to agree about the spinlock they want to
102use.
103 34
104The above is usually pretty simple (you usually need and want only one 35The above is usually pretty simple (you usually need and want only one
105spinlock for most things - using more than one spinlock can make things a 36spinlock for most things - using more than one spinlock can make things a
@@ -120,20 +51,24 @@ and another sequence that does
120then they are NOT mutually exclusive, and the critical regions can happen 51then they are NOT mutually exclusive, and the critical regions can happen
121at the same time on two different CPU's. That's fine per se, but the 52at the same time on two different CPU's. That's fine per se, but the
122critical regions had better be critical for different things (ie they 53critical regions had better be critical for different things (ie they
123can't stomp on each other). 54can't stomp on each other).
124 55
125The above is a problem mainly if you end up mixing code - for example the 56The above is a problem mainly if you end up mixing code - for example the
126routines in ll_rw_block() tend to use cli/sti to protect the atomicity of 57routines in ll_rw_block() tend to use cli/sti to protect the atomicity of
127their actions, and if a driver uses spinlocks instead then you should 58their actions, and if a driver uses spinlocks instead then you should
128think about issues like the above.. 59think about issues like the above.
129 60
130This is really the only really hard part about spinlocks: once you start 61This is really the only really hard part about spinlocks: once you start
131using spinlocks they tend to expand to areas you might not have noticed 62using spinlocks they tend to expand to areas you might not have noticed
132before, because you have to make sure the spinlocks correctly protect the 63before, because you have to make sure the spinlocks correctly protect the
133shared data structures _everywhere_ they are used. The spinlocks are most 64shared data structures _everywhere_ they are used. The spinlocks are most
134easily added to places that are completely independent of other code (ie 65easily added to places that are completely independent of other code (for
135internal driver data structures that nobody else ever touches, for 66example, internal driver data structures that nobody else ever touches).
136example). 67
68 NOTE! The spin-lock is safe only when you _also_ use the lock itself
69 to do locking across CPU's, which implies that EVERYTHING that
70 touches a shared variable has to agree about the spinlock they want
71 to use.
137 72
138---- 73----
139 74
@@ -141,13 +76,17 @@ Lesson 2: reader-writer spinlocks.
141 76
142If your data accesses have a very natural pattern where you usually tend 77If your data accesses have a very natural pattern where you usually tend
143to mostly read from the shared variables, the reader-writer locks 78to mostly read from the shared variables, the reader-writer locks
144(rw_lock) versions of the spinlocks are often nicer. They allow multiple 79(rw_lock) versions of the spinlocks are sometimes useful. They allow multiple
145readers to be in the same critical region at once, but if somebody wants 80readers to be in the same critical region at once, but if somebody wants
146to change the variables it has to get an exclusive write lock. The 81to change the variables it has to get an exclusive write lock.
147routines look the same as above:
148 82
149 rwlock_t xxx_lock = RW_LOCK_UNLOCKED; 83 NOTE! reader-writer locks require more atomic memory operations than
84 simple spinlocks. Unless the reader critical section is long, you
85 are better off just using spinlocks.
150 86
87The routines look the same as above:
88
89 rwlock_t xxx_lock = RW_LOCK_UNLOCKED;
151 90
152 unsigned long flags; 91 unsigned long flags;
153 92
@@ -159,18 +98,21 @@ routines look the same as above:
159 .. read and write exclusive access to the info ... 98 .. read and write exclusive access to the info ...
160 write_unlock_irqrestore(&xxx_lock, flags); 99 write_unlock_irqrestore(&xxx_lock, flags);
161 100
162The above kind of lock is useful for complex data structures like linked 101The above kind of lock may be useful for complex data structures like
163lists etc, especially when you know that most of the work is to just 102linked lists, especially searching for entries without changing the list
164traverse the list searching for entries without changing the list itself, 103itself. The read lock allows many concurrent readers. Anything that
165for example. Then you can use the read lock for that kind of list 104_changes_ the list will have to get the write lock.
166traversal, which allows many concurrent readers. Anything that _changes_ 105
167the list will have to get the write lock. 106 NOTE! RCU is better for list traversal, but requires careful
107 attention to design detail (see Documentation/RCU/listRCU.txt).
168 108
169Note: you cannot "upgrade" a read-lock to a write-lock, so if you at _any_ 109Also, you cannot "upgrade" a read-lock to a write-lock, so if you at _any_
170time need to do any changes (even if you don't do it every time), you have 110time need to do any changes (even if you don't do it every time), you have
171to get the write-lock at the very beginning. I could fairly easily add a 111to get the write-lock at the very beginning.
172primitive to create a "upgradeable" read-lock, but it hasn't been an issue 112
173yet. Tell me if you'd want one. 113 NOTE! We are working hard to remove reader-writer spinlocks in most
114 cases, so please don't add a new one without consensus. (Instead, see
115 Documentation/RCU/rcu.txt for complete information.)
174 116
175---- 117----
176 118
@@ -233,4 +175,46 @@ indeed), while write-locks need to protect themselves against interrupts.
233 175
234 Linus 176 Linus
235 177
178----
179
180Reference information:
181
182For dynamic initialization, use spin_lock_init() or rwlock_init() as
183appropriate:
184
185 spinlock_t xxx_lock;
186 rwlock_t xxx_rw_lock;
187
188 static int __init xxx_init(void)
189 {
190 spin_lock_init(&xxx_lock);
191 rwlock_init(&xxx_rw_lock);
192 ...
193 }
194
195 module_init(xxx_init);
196
197For static initialization, use DEFINE_SPINLOCK() / DEFINE_RWLOCK() or
198__SPIN_LOCK_UNLOCKED() / __RW_LOCK_UNLOCKED() as appropriate.
199
200SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED are deprecated. These interfere
201with lockdep state tracking.
202
203Most of the time, you can simply turn:
204 static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED;
205into:
206 static DEFINE_SPINLOCK(xxx_lock);
207
208Static structure member variables go from:
209
210 struct foo bar {
211 .lock = SPIN_LOCK_UNLOCKED;
212 };
213
214to:
236 215
216 struct foo bar {
217 .lock = __SPIN_LOCK_UNLOCKED(bar.lock);
218 };
219
220Declaration of static rw_locks undergo a similar transformation.
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt
index a452227361b1..5effa5bd993b 100644
--- a/Documentation/stable_kernel_rules.txt
+++ b/Documentation/stable_kernel_rules.txt
@@ -26,13 +26,33 @@ Procedure for submitting patches to the -stable tree:
26 26
27 - Send the patch, after verifying that it follows the above rules, to 27 - Send the patch, after verifying that it follows the above rules, to
28 stable@kernel.org. 28 stable@kernel.org.
29 - To have the patch automatically included in the stable tree, add the
30 the tag
31 Cc: stable@kernel.org
32 in the sign-off area. Once the patch is merged it will be applied to
33 the stable tree without anything else needing to be done by the author
34 or subsystem maintainer.
35 - If the patch requires other patches as prerequisites which can be
36 cherry-picked than this can be specified in the following format in
37 the sign-off area:
38
39 Cc: <stable@kernel.org> # .32.x: a1f84a3: sched: Check for idle
40 Cc: <stable@kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle
41 Cc: <stable@kernel.org> # .32.x: fd21073: sched: Fix affinity logic
42 Cc: <stable@kernel.org> # .32.x
43 Signed-off-by: Ingo Molnar <mingo@elte.hu>
44
45 The tag sequence has the meaning of:
46 git cherry-pick a1f84a3
47 git cherry-pick 1b9508f
48 git cherry-pick fd21073
49 git cherry-pick <this commit>
50
29 - The sender will receive an ACK when the patch has been accepted into the 51 - The sender will receive an ACK when the patch has been accepted into the
30 queue, or a NAK if the patch is rejected. This response might take a few 52 queue, or a NAK if the patch is rejected. This response might take a few
31 days, according to the developer's schedules. 53 days, according to the developer's schedules.
32 - If accepted, the patch will be added to the -stable queue, for review by 54 - If accepted, the patch will be added to the -stable queue, for review by
33 other developers and by the relevant subsystem maintainer. 55 other developers and by the relevant subsystem maintainer.
34 - If the stable@kernel.org address is added to a patch, when it goes into
35 Linus's tree it will automatically be emailed to the stable team.
36 - Security patches should not be sent to this alias, but instead to the 56 - Security patches should not be sent to this alias, but instead to the
37 documented security@kernel.org address. 57 documented security@kernel.org address.
38 58
diff --git a/Documentation/sysctl/ctl_unnumbered.txt b/Documentation/sysctl/ctl_unnumbered.txt
deleted file mode 100644
index 23003a8ea3e7..000000000000
--- a/Documentation/sysctl/ctl_unnumbered.txt
+++ /dev/null
@@ -1,22 +0,0 @@
1
2Except for a few extremely rare exceptions user space applications do not use
3the binary sysctl interface. Instead everyone uses /proc/sys/... with
4readable ascii names.
5
6Recently the kernel has started supporting setting the binary sysctl value to
7CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow
8sysctls to show up in /proc/sys.
9
10Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h,
11breaking of the user space ABI (because of those conflicts), and maintenance
12problems. A complete pass through all of the sysctl users revealed multiple
13instances where the sysctl binary interface was broken and had gone undetected
14for years.
15
16So please do not add new binary sysctl numbers. They are unneeded and
17problematic.
18
19If you really need a new binary sysctl number please first merge your sysctl
20into the kernel and then as a separate patch allocate a binary sysctl number.
21
22(ebiederm@xmission.com, June 2007)
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index a028b92001ed..3894eaa23486 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -19,6 +19,8 @@ Currently, these files might (depending on your configuration)
19show up in /proc/sys/kernel: 19show up in /proc/sys/kernel:
20- acpi_video_flags 20- acpi_video_flags
21- acct 21- acct
22- bootloader_type [ X86 only ]
23- bootloader_version [ X86 only ]
22- callhome [ S390 only ] 24- callhome [ S390 only ]
23- auto_msgmni 25- auto_msgmni
24- core_pattern 26- core_pattern
@@ -93,6 +95,35 @@ valid for 30 seconds.
93 95
94============================================================== 96==============================================================
95 97
98bootloader_type:
99
100x86 bootloader identification
101
102This gives the bootloader type number as indicated by the bootloader,
103shifted left by 4, and OR'd with the low four bits of the bootloader
104version. The reason for this encoding is that this used to match the
105type_of_loader field in the kernel header; the encoding is kept for
106backwards compatibility. That is, if the full bootloader type number
107is 0x15 and the full version number is 0x234, this file will contain
108the value 340 = 0x154.
109
110See the type_of_loader and ext_loader_type fields in
111Documentation/x86/boot.txt for additional information.
112
113==============================================================
114
115bootloader_version:
116
117x86 bootloader version
118
119The complete bootloader version number. In the example above, this
120file will contain the value 564 = 0x234.
121
122See the type_of_loader and ext_loader_ver fields in
123Documentation/x86/boot.txt for additional information.
124
125==============================================================
126
96callhome: 127callhome:
97 128
98Controls the kernel's callhome behavior in case of a kernel panic. 129Controls the kernel's callhome behavior in case of a kernel panic.
@@ -139,9 +170,9 @@ core_pattern is used to specify a core dumpfile pattern name.
139core_pipe_limit: 170core_pipe_limit:
140 171
141This sysctl is only applicable when core_pattern is configured to pipe core 172This sysctl is only applicable when core_pattern is configured to pipe core
142files to user space helper a (when the first character of core_pattern is a '|', 173files to a user space helper (when the first character of core_pattern is a '|',
143see above). When collecting cores via a pipe to an application, it is 174see above). When collecting cores via a pipe to an application, it is
144occasionally usefull for the collecting application to gather data about the 175occasionally useful for the collecting application to gather data about the
145crashing process from its /proc/pid directory. In order to do this safely, the 176crashing process from its /proc/pid directory. In order to do this safely, the
146kernel must wait for the collecting process to exit, so as not to remove the 177kernel must wait for the collecting process to exit, so as not to remove the
147crashing processes proc files prematurely. This in turn creates the possibility 178crashing processes proc files prematurely. This in turn creates the possibility
@@ -152,7 +183,7 @@ applications in parallel. If this value is exceeded, then those crashing
152processes above that value are noted via the kernel log and their cores are 183processes above that value are noted via the kernel log and their cores are
153skipped. 0 is a special value, indicating that unlimited processes may be 184skipped. 0 is a special value, indicating that unlimited processes may be
154captured in parallel, but that no waiting will take place (i.e. the collecting 185captured in parallel, but that no waiting will take place (i.e. the collecting
155process is not guaranteed access to /proc/<crahing pid>/). This value defaults 186process is not guaranteed access to /proc/<crashing pid>/). This value defaults
156to 0. 187to 0.
157 188
158============================================================== 189==============================================================
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index a6e360d2055c..6c7d18c53f84 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -370,7 +370,7 @@ The default is 1 percent.
370mmap_min_addr 370mmap_min_addr
371 371
372This file indicates the amount of address space which a user process will 372This file indicates the amount of address space which a user process will
373be restricted from mmaping. Since kernel null dereference bugs could 373be restricted from mmapping. Since kernel null dereference bugs could
374accidentally operate based on the information in the first couple of pages 374accidentally operate based on the information in the first couple of pages
375of memory userspace processes should not be allowed to write to them. By 375of memory userspace processes should not be allowed to write to them. By
376default this value is set to 0 and no protections will be enforced by the 376default this value is set to 0 and no protections will be enforced by the
@@ -573,11 +573,14 @@ Because other nodes' memory may be free. This means system total status
573may be not fatal yet. 573may be not fatal yet.
574 574
575If this is set to 2, the kernel panics compulsorily even on the 575If this is set to 2, the kernel panics compulsorily even on the
576above-mentioned. 576above-mentioned. Even oom happens under memory cgroup, the whole
577system panics.
577 578
578The default value is 0. 579The default value is 0.
5791 and 2 are for failover of clustering. Please select either 5801 and 2 are for failover of clustering. Please select either
580according to your policy of failover. 581according to your policy of failover.
582panic_on_oom=2+kdump gives you very strong tool to investigate
583why oom happens. You can get snapshot.
581 584
582============================================================= 585=============================================================
583 586
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 70d68ce8640a..cb3d15bc1aeb 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -1,5 +1,5 @@
1Generic Thermal Sysfs driver How To 1Generic Thermal Sysfs driver How To
2========================= 2===================================
3 3
4Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com> 4Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com>
5 5
@@ -10,20 +10,20 @@ Copyright (c) 2008 Intel Corporation
10 10
110. Introduction 110. Introduction
12 12
13The generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) 13The generic thermal sysfs provides a set of interfaces for thermal zone
14and thermal cooling devices (fan, processor...) to register with the thermal management 14devices (sensors) and thermal cooling devices (fan, processor...) to register
15solution and to be a part of it. 15with the thermal management solution and to be a part of it.
16 16
17This how-to focuses on enabling new thermal zone and cooling devices to participate 17This how-to focuses on enabling new thermal zone and cooling devices to
18in thermal management. 18participate in thermal management.
19This solution is platform independent and any type of thermal zone devices and 19This solution is platform independent and any type of thermal zone devices
20cooling devices should be able to make use of the infrastructure. 20and cooling devices should be able to make use of the infrastructure.
21 21
22The main task of the thermal sysfs driver is to expose thermal zone attributes as well 22The main task of the thermal sysfs driver is to expose thermal zone attributes
23as cooling device attributes to the user space. 23as well as cooling device attributes to the user space.
24An intelligent thermal management application can make decisions based on inputs 24An intelligent thermal management application can make decisions based on
25from thermal zone attributes (the current temperature and trip point temperature) 25inputs from thermal zone attributes (the current temperature and trip point
26and throttle appropriate devices. 26temperature) and throttle appropriate devices.
27 27
28[0-*] denotes any positive number starting from 0 28[0-*] denotes any positive number starting from 0
29[1-*] denotes any positive number starting from 1 29[1-*] denotes any positive number starting from 1
@@ -31,77 +31,77 @@ and throttle appropriate devices.
311. thermal sysfs driver interface functions 311. thermal sysfs driver interface functions
32 32
331.1 thermal zone device interface 331.1 thermal zone device interface
341.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, int trips, 341.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name,
35 void *devdata, struct thermal_zone_device_ops *ops) 35 int trips, void *devdata, struct thermal_zone_device_ops *ops)
36 36
37 This interface function adds a new thermal zone device (sensor) to 37 This interface function adds a new thermal zone device (sensor) to
38 /sys/class/thermal folder as thermal_zone[0-*]. 38 /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
39 It tries to bind all the thermal cooling devices registered at the same time. 39 thermal cooling devices registered at the same time.
40 40
41 name: the thermal zone name. 41 name: the thermal zone name.
42 trips: the total number of trip points this thermal zone supports. 42 trips: the total number of trip points this thermal zone supports.
43 devdata: device private data 43 devdata: device private data
44 ops: thermal zone device call-backs. 44 ops: thermal zone device call-backs.
45 .bind: bind the thermal zone device with a thermal cooling device. 45 .bind: bind the thermal zone device with a thermal cooling device.
46 .unbind: unbind the thermal zone device with a thermal cooling device. 46 .unbind: unbind the thermal zone device with a thermal cooling device.
47 .get_temp: get the current temperature of the thermal zone. 47 .get_temp: get the current temperature of the thermal zone.
48 .get_mode: get the current mode (user/kernel) of the thermal zone. 48 .get_mode: get the current mode (user/kernel) of the thermal zone.
49 "kernel" means thermal management is done in kernel. 49 - "kernel" means thermal management is done in kernel.
50 "user" will prevent kernel thermal driver actions upon trip points 50 - "user" will prevent kernel thermal driver actions upon trip points
51 so that user applications can take charge of thermal management. 51 so that user applications can take charge of thermal management.
52 .set_mode: set the mode (user/kernel) of the thermal zone. 52 .set_mode: set the mode (user/kernel) of the thermal zone.
53 .get_trip_type: get the type of certain trip point. 53 .get_trip_type: get the type of certain trip point.
54 .get_trip_temp: get the temperature above which the certain trip point 54 .get_trip_temp: get the temperature above which the certain trip point
55 will be fired. 55 will be fired.
56 56
571.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz) 571.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
58 58
59 This interface function removes the thermal zone device. 59 This interface function removes the thermal zone device.
60 It deletes the corresponding entry form /sys/class/thermal folder and unbind all 60 It deletes the corresponding entry form /sys/class/thermal folder and
61 the thermal cooling devices it uses. 61 unbind all the thermal cooling devices it uses.
62 62
631.2 thermal cooling device interface 631.2 thermal cooling device interface
641.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name, 641.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name,
65 void *devdata, struct thermal_cooling_device_ops *) 65 void *devdata, struct thermal_cooling_device_ops *)
66 66
67 This interface function adds a new thermal cooling device (fan/processor/...) to 67 This interface function adds a new thermal cooling device (fan/processor/...)
68 /sys/class/thermal/ folder as cooling_device[0-*]. 68 to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
69 It tries to bind itself to all the thermal zone devices register at the same time. 69 to all the thermal zone devices register at the same time.
70 name: the cooling device name. 70 name: the cooling device name.
71 devdata: device private data. 71 devdata: device private data.
72 ops: thermal cooling devices call-backs. 72 ops: thermal cooling devices call-backs.
73 .get_max_state: get the Maximum throttle state of the cooling device. 73 .get_max_state: get the Maximum throttle state of the cooling device.
74 .get_cur_state: get the Current throttle state of the cooling device. 74 .get_cur_state: get the Current throttle state of the cooling device.
75 .set_cur_state: set the Current throttle state of the cooling device. 75 .set_cur_state: set the Current throttle state of the cooling device.
76 76
771.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) 771.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
78 78
79 This interface function remove the thermal cooling device. 79 This interface function remove the thermal cooling device.
80 It deletes the corresponding entry form /sys/class/thermal folder and unbind 80 It deletes the corresponding entry form /sys/class/thermal folder and
81 itself from all the thermal zone devices using it. 81 unbind itself from all the thermal zone devices using it.
82 82
831.3 interface for binding a thermal zone device with a thermal cooling device 831.3 interface for binding a thermal zone device with a thermal cooling device
841.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, 841.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
85 int trip, struct thermal_cooling_device *cdev); 85 int trip, struct thermal_cooling_device *cdev);
86 86
87 This interface function bind a thermal cooling device to the certain trip point 87 This interface function bind a thermal cooling device to the certain trip
88 of a thermal zone device. 88 point of a thermal zone device.
89 This function is usually called in the thermal zone device .bind callback. 89 This function is usually called in the thermal zone device .bind callback.
90 tz: the thermal zone device 90 tz: the thermal zone device
91 cdev: thermal cooling device 91 cdev: thermal cooling device
92 trip: indicates which trip point the cooling devices is associated with 92 trip: indicates which trip point the cooling devices is associated with
93 in this thermal zone. 93 in this thermal zone.
94 94
951.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, 951.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
96 int trip, struct thermal_cooling_device *cdev); 96 int trip, struct thermal_cooling_device *cdev);
97 97
98 This interface function unbind a thermal cooling device from the certain trip point 98 This interface function unbind a thermal cooling device from the certain
99 of a thermal zone device. 99 trip point of a thermal zone device. This function is usually called in
100 This function is usually called in the thermal zone device .unbind callback. 100 the thermal zone device .unbind callback.
101 tz: the thermal zone device 101 tz: the thermal zone device
102 cdev: thermal cooling device 102 cdev: thermal cooling device
103 trip: indicates which trip point the cooling devices is associated with 103 trip: indicates which trip point the cooling devices is associated with
104 in this thermal zone. 104 in this thermal zone.
105 105
1062. sysfs attributes structure 1062. sysfs attributes structure
107 107
@@ -114,153 +114,167 @@ if hwmon is compiled in or built as a module.
114 114
115Thermal zone device sys I/F, created once it's registered: 115Thermal zone device sys I/F, created once it's registered:
116/sys/class/thermal/thermal_zone[0-*]: 116/sys/class/thermal/thermal_zone[0-*]:
117 |-----type: Type of the thermal zone 117 |---type: Type of the thermal zone
118 |-----temp: Current temperature 118 |---temp: Current temperature
119 |-----mode: Working mode of the thermal zone 119 |---mode: Working mode of the thermal zone
120 |-----trip_point_[0-*]_temp: Trip point temperature 120 |---trip_point_[0-*]_temp: Trip point temperature
121 |-----trip_point_[0-*]_type: Trip point type 121 |---trip_point_[0-*]_type: Trip point type
122 122
123Thermal cooling device sys I/F, created once it's registered: 123Thermal cooling device sys I/F, created once it's registered:
124/sys/class/thermal/cooling_device[0-*]: 124/sys/class/thermal/cooling_device[0-*]:
125 |-----type : Type of the cooling device(processor/fan/...) 125 |---type: Type of the cooling device(processor/fan/...)
126 |-----max_state: Maximum cooling state of the cooling device 126 |---max_state: Maximum cooling state of the cooling device
127 |-----cur_state: Current cooling state of the cooling device 127 |---cur_state: Current cooling state of the cooling device
128 128
129 129
130These two dynamic attributes are created/removed in pairs. 130Then next two dynamic attributes are created/removed in pairs. They represent
131They represent the relationship between a thermal zone and its associated cooling device. 131the relationship between a thermal zone and its associated cooling device.
132They are created/removed for each 132They are created/removed for each successful execution of
133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. 133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
134 134
135/sys/class/thermal/thermal_zone[0-*] 135/sys/class/thermal/thermal_zone[0-*]:
136 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 136 |---cdev[0-*]: [0-*]th cooling device in current thermal zone
137 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with 137 |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
138 138
139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, 139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
140the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of 140the generic thermal driver also creates a hwmon sysfs I/F for each _type_
141thermal zone device. E.g. the generic thermal driver registers one hwmon class device 141of thermal zone device. E.g. the generic thermal driver registers one hwmon
142and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones. 142class device and build the associated hwmon sysfs I/F for all the registered
143ACPI thermal zones.
144
143/sys/class/hwmon/hwmon[0-*]: 145/sys/class/hwmon/hwmon[0-*]:
144 |-----name: The type of the thermal zone devices. 146 |---name: The type of the thermal zone devices
145 |-----temp[1-*]_input: The current temperature of thermal zone [1-*]. 147 |---temp[1-*]_input: The current temperature of thermal zone [1-*]
146 |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*]. 148 |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
149
147Please read Documentation/hwmon/sysfs-interface for additional information. 150Please read Documentation/hwmon/sysfs-interface for additional information.
148 151
149*************************** 152***************************
150* Thermal zone attributes * 153* Thermal zone attributes *
151*************************** 154***************************
152 155
153type Strings which represent the thermal zone type. 156type
154 This is given by thermal zone driver as part of registration. 157 Strings which represent the thermal zone type.
155 Eg: "acpitz" indicates it's an ACPI thermal device. 158 This is given by thermal zone driver as part of registration.
156 In order to keep it consistent with hwmon sys attribute, 159 E.g: "acpitz" indicates it's an ACPI thermal device.
157 this should be a short, lowercase string, 160 In order to keep it consistent with hwmon sys attribute; this should
158 not containing spaces nor dashes. 161 be a short, lowercase string, not containing spaces nor dashes.
159 RO 162 RO, Required
160 Required 163
161 164temp
162temp Current temperature as reported by thermal zone (sensor) 165 Current temperature as reported by thermal zone (sensor).
163 Unit: millidegree Celsius 166 Unit: millidegree Celsius
164 RO 167 RO, Required
165 Required 168
166 169mode
167mode One of the predefined values in [kernel, user] 170 One of the predefined values in [kernel, user].
168 This file gives information about the algorithm 171 This file gives information about the algorithm that is currently
169 that is currently managing the thermal zone. 172 managing the thermal zone. It can be either default kernel based
170 It can be either default kernel based algorithm 173 algorithm or user space application.
171 or user space application. 174 kernel = Thermal management in kernel thermal zone driver.
172 RW 175 user = Preventing kernel thermal zone driver actions upon
173 Optional 176 trip points so that user application can take full
174 kernel = Thermal management in kernel thermal zone driver. 177 charge of the thermal management.
175 user = Preventing kernel thermal zone driver actions upon 178 RW, Optional
176 trip points so that user application can take full 179
177 charge of the thermal management. 180trip_point_[0-*]_temp
178 181 The temperature above which trip point will be fired.
179trip_point_[0-*]_temp The temperature above which trip point will be fired 182 Unit: millidegree Celsius
180 Unit: millidegree Celsius 183 RO, Optional
181 RO 184
182 Optional 185trip_point_[0-*]_type
183 186 Strings which indicate the type of the trip point.
184trip_point_[0-*]_type Strings which indicate the type of the trip point 187 E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
185 E.g. it can be one of critical, hot, passive, 188 thermal zone.
186 active[0-*] for ACPI thermal zone. 189 RO, Optional
187 RO 190
188 Optional 191cdev[0-*]
189 192 Sysfs link to the thermal cooling device node where the sys I/F
190cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F 193 for cooling device throttling control represents.
191 for cooling device throttling control represents. 194 RO, Optional
192 RO 195
193 Optional 196cdev[0-*]_trip_point
194 197 The trip point with which cdev[0-*] is associated in this thermal
195cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone 198 zone; -1 means the cooling device is not associated with any trip
196 -1 means the cooling device is not associated with any trip point. 199 point.
197 RO 200 RO, Optional
198 Optional 201
199 202passive
200****************************** 203 Attribute is only present for zones in which the passive cooling
201* Cooling device attributes * 204 policy is not supported by native thermal driver. Default is zero
202****************************** 205 and can be set to a temperature (in millidegrees) to enable a
203 206 passive trip point for the zone. Activation is done by polling with
204type String which represents the type of device 207 an interval of 1 second.
205 eg: For generic ACPI: this should be "Fan", 208 Unit: millidegrees Celsius
206 "Processor" or "LCD" 209 Valid values: 0 (disabled) or greater than 1000
207 eg. For memory controller device on intel_menlow platform: 210 RW, Optional
208 this should be "Memory controller" 211
209 RO 212*****************************
210 Required 213* Cooling device attributes *
211 214*****************************
212max_state The maximum permissible cooling state of this cooling device. 215
213 RO 216type
214 Required 217 String which represents the type of device, e.g:
215 218 - for generic ACPI: should be "Fan", "Processor" or "LCD"
216cur_state The current cooling state of this cooling device. 219 - for memory controller device on intel_menlow platform:
217 the value can any integer numbers between 0 and max_state, 220 should be "Memory controller".
218 cur_state == 0 means no cooling 221 RO, Required
219 cur_state == max_state means the maximum cooling. 222
220 RW 223max_state
221 Required 224 The maximum permissible cooling state of this cooling device.
225 RO, Required
226
227cur_state
228 The current cooling state of this cooling device.
229 The value can any integer numbers between 0 and max_state:
230 - cur_state == 0 means no cooling
231 - cur_state == max_state means the maximum cooling.
232 RW, Required
222 233
2233. A simple implementation 2343. A simple implementation
224 235
225ACPI thermal zone may support multiple trip points like critical/hot/passive/active. 236ACPI thermal zone may support multiple trip points like critical, hot,
226If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, 237passive, active. If an ACPI thermal zone supports critical, passive,
227it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. 238active[0] and active[1] at the same time, it may register itself as a
228It has one processor and one fan, which are both registered as thermal_cooling_device. 239thermal_zone_device (thermal_zone1) with 4 trip points in all.
229If the processor is listed in _PSL method, and the fan is listed in _AL0 method, 240It has one processor and one fan, which are both registered as
230the sys I/F structure will be built like this: 241thermal_cooling_device.
242
243If the processor is listed in _PSL method, and the fan is listed in _AL0
244method, the sys I/F structure will be built like this:
231 245
232/sys/class/thermal: 246/sys/class/thermal:
233 247
234|thermal_zone1: 248|thermal_zone1:
235 |-----type: acpitz 249 |---type: acpitz
236 |-----temp: 37000 250 |---temp: 37000
237 |-----mode: kernel 251 |---mode: kernel
238 |-----trip_point_0_temp: 100000 252 |---trip_point_0_temp: 100000
239 |-----trip_point_0_type: critical 253 |---trip_point_0_type: critical
240 |-----trip_point_1_temp: 80000 254 |---trip_point_1_temp: 80000
241 |-----trip_point_1_type: passive 255 |---trip_point_1_type: passive
242 |-----trip_point_2_temp: 70000 256 |---trip_point_2_temp: 70000
243 |-----trip_point_2_type: active0 257 |---trip_point_2_type: active0
244 |-----trip_point_3_temp: 60000 258 |---trip_point_3_temp: 60000
245 |-----trip_point_3_type: active1 259 |---trip_point_3_type: active1
246 |-----cdev0: --->/sys/class/thermal/cooling_device0 260 |---cdev0: --->/sys/class/thermal/cooling_device0
247 |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ 261 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */
248 |-----cdev1: --->/sys/class/thermal/cooling_device3 262 |---cdev1: --->/sys/class/thermal/cooling_device3
249 |-----cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ 263 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
250 264
251|cooling_device0: 265|cooling_device0:
252 |-----type: Processor 266 |---type: Processor
253 |-----max_state: 8 267 |---max_state: 8
254 |-----cur_state: 0 268 |---cur_state: 0
255 269
256|cooling_device3: 270|cooling_device3:
257 |-----type: Fan 271 |---type: Fan
258 |-----max_state: 2 272 |---max_state: 2
259 |-----cur_state: 0 273 |---cur_state: 0
260 274
261/sys/class/hwmon: 275/sys/class/hwmon:
262 276
263|hwmon0: 277|hwmon0:
264 |-----name: acpitz 278 |---name: acpitz
265 |-----temp1_input: 37000 279 |---temp1_input: 37000
266 |-----temp1_crit: 100000 280 |---temp1_crit: 100000
diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX
index 397dc35e1323..a9248da5cdbc 100644
--- a/Documentation/timers/00-INDEX
+++ b/Documentation/timers/00-INDEX
@@ -4,6 +4,8 @@ highres.txt
4 - High resolution timers and dynamic ticks design notes 4 - High resolution timers and dynamic ticks design notes
5hpet.txt 5hpet.txt
6 - High Precision Event Timer Driver for Linux 6 - High Precision Event Timer Driver for Linux
7hpet_example.c
8 - sample hpet timer test program
7hrtimers.txt 9hrtimers.txt
8 - subsystem for high-resolution kernel timers 10 - subsystem for high-resolution kernel timers
9timer_stats.txt 11timer_stats.txt
diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile
new file mode 100644
index 000000000000..c85625f4ab25
--- /dev/null
+++ b/Documentation/timers/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := hpet_example
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/timers/hpet.txt b/Documentation/timers/hpet.txt
index 04763a325520..767392ffd31e 100644
--- a/Documentation/timers/hpet.txt
+++ b/Documentation/timers/hpet.txt
@@ -3,7 +3,7 @@
3The High Precision Event Timer (HPET) hardware follows a specification 3The High Precision Event Timer (HPET) hardware follows a specification
4by Intel and Microsoft which can be found at 4by Intel and Microsoft which can be found at
5 5
6 http://www.intel.com/technology/architecture/hpetspec.htm 6 http://www.intel.com/hardwaredesign/hpetspec_1.pdf
7 7
8Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision") 8Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision")
9and up to 32 comparators. Normally three or more comparators are provided, 9and up to 32 comparators. Normally three or more comparators are provided,
@@ -26,274 +26,5 @@ initialization. An example of this initialization can be found in
26arch/x86/kernel/hpet.c. 26arch/x86/kernel/hpet.c.
27 27
28The driver provides a userspace API which resembles the API found in the 28The driver provides a userspace API which resembles the API found in the
29RTC driver framework. An example user space program is provided below. 29RTC driver framework. An example user space program is provided in
30 30file:Documentation/timers/hpet_example.c
31#include <stdio.h>
32#include <stdlib.h>
33#include <unistd.h>
34#include <fcntl.h>
35#include <string.h>
36#include <memory.h>
37#include <malloc.h>
38#include <time.h>
39#include <ctype.h>
40#include <sys/types.h>
41#include <sys/wait.h>
42#include <signal.h>
43#include <fcntl.h>
44#include <errno.h>
45#include <sys/time.h>
46#include <linux/hpet.h>
47
48
49extern void hpet_open_close(int, const char **);
50extern void hpet_info(int, const char **);
51extern void hpet_poll(int, const char **);
52extern void hpet_fasync(int, const char **);
53extern void hpet_read(int, const char **);
54
55#include <sys/poll.h>
56#include <sys/ioctl.h>
57#include <signal.h>
58
59struct hpet_command {
60 char *command;
61 void (*func)(int argc, const char ** argv);
62} hpet_command[] = {
63 {
64 "open-close",
65 hpet_open_close
66 },
67 {
68 "info",
69 hpet_info
70 },
71 {
72 "poll",
73 hpet_poll
74 },
75 {
76 "fasync",
77 hpet_fasync
78 },
79};
80
81int
82main(int argc, const char ** argv)
83{
84 int i;
85
86 argc--;
87 argv++;
88
89 if (!argc) {
90 fprintf(stderr, "-hpet: requires command\n");
91 return -1;
92 }
93
94
95 for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++)
96 if (!strcmp(argv[0], hpet_command[i].command)) {
97 argc--;
98 argv++;
99 fprintf(stderr, "-hpet: executing %s\n",
100 hpet_command[i].command);
101 hpet_command[i].func(argc, argv);
102 return 0;
103 }
104
105 fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]);
106
107 return -1;
108}
109
110void
111hpet_open_close(int argc, const char **argv)
112{
113 int fd;
114
115 if (argc != 1) {
116 fprintf(stderr, "hpet_open_close: device-name\n");
117 return;
118 }
119
120 fd = open(argv[0], O_RDONLY);
121 if (fd < 0)
122 fprintf(stderr, "hpet_open_close: open failed\n");
123 else
124 close(fd);
125
126 return;
127}
128
129void
130hpet_info(int argc, const char **argv)
131{
132}
133
134void
135hpet_poll(int argc, const char **argv)
136{
137 unsigned long freq;
138 int iterations, i, fd;
139 struct pollfd pfd;
140 struct hpet_info info;
141 struct timeval stv, etv;
142 struct timezone tz;
143 long usec;
144
145 if (argc != 3) {
146 fprintf(stderr, "hpet_poll: device-name freq iterations\n");
147 return;
148 }
149
150 freq = atoi(argv[1]);
151 iterations = atoi(argv[2]);
152
153 fd = open(argv[0], O_RDONLY);
154
155 if (fd < 0) {
156 fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
157 return;
158 }
159
160 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
161 fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n");
162 goto out;
163 }
164
165 if (ioctl(fd, HPET_INFO, &info) < 0) {
166 fprintf(stderr, "hpet_poll: failed to get info\n");
167 goto out;
168 }
169
170 fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags);
171
172 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
173 fprintf(stderr, "hpet_poll: HPET_EPI failed\n");
174 goto out;
175 }
176
177 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
178 fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n");
179 goto out;
180 }
181
182 pfd.fd = fd;
183 pfd.events = POLLIN;
184
185 for (i = 0; i < iterations; i++) {
186 pfd.revents = 0;
187 gettimeofday(&stv, &tz);
188 if (poll(&pfd, 1, -1) < 0)
189 fprintf(stderr, "hpet_poll: poll failed\n");
190 else {
191 long data;
192
193 gettimeofday(&etv, &tz);
194 usec = stv.tv_sec * 1000000 + stv.tv_usec;
195 usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec;
196
197 fprintf(stderr,
198 "hpet_poll: expired time = 0x%lx\n", usec);
199
200 fprintf(stderr, "hpet_poll: revents = 0x%x\n",
201 pfd.revents);
202
203 if (read(fd, &data, sizeof(data)) != sizeof(data)) {
204 fprintf(stderr, "hpet_poll: read failed\n");
205 }
206 else
207 fprintf(stderr, "hpet_poll: data 0x%lx\n",
208 data);
209 }
210 }
211
212out:
213 close(fd);
214 return;
215}
216
217static int hpet_sigio_count;
218
219static void
220hpet_sigio(int val)
221{
222 fprintf(stderr, "hpet_sigio: called\n");
223 hpet_sigio_count++;
224}
225
226void
227hpet_fasync(int argc, const char **argv)
228{
229 unsigned long freq;
230 int iterations, i, fd, value;
231 sig_t oldsig;
232 struct hpet_info info;
233
234 hpet_sigio_count = 0;
235 fd = -1;
236
237 if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) {
238 fprintf(stderr, "hpet_fasync: failed to set signal handler\n");
239 return;
240 }
241
242 if (argc != 3) {
243 fprintf(stderr, "hpet_fasync: device-name freq iterations\n");
244 goto out;
245 }
246
247 fd = open(argv[0], O_RDONLY);
248
249 if (fd < 0) {
250 fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
251 return;
252 }
253
254
255 if ((fcntl(fd, F_SETOWN, getpid()) == 1) ||
256 ((value = fcntl(fd, F_GETFL)) == 1) ||
257 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) {
258 fprintf(stderr, "hpet_fasync: fcntl failed\n");
259 goto out;
260 }
261
262 freq = atoi(argv[1]);
263 iterations = atoi(argv[2]);
264
265 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
266 fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n");
267 goto out;
268 }
269
270 if (ioctl(fd, HPET_INFO, &info) < 0) {
271 fprintf(stderr, "hpet_fasync: failed to get info\n");
272 goto out;
273 }
274
275 fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags);
276
277 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
278 fprintf(stderr, "hpet_fasync: HPET_EPI failed\n");
279 goto out;
280 }
281
282 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
283 fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n");
284 goto out;
285 }
286
287 for (i = 0; i < iterations; i++) {
288 (void) pause();
289 fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count);
290 }
291
292out:
293 signal(SIGIO, oldsig);
294
295 if (fd >= 0)
296 close(fd);
297
298 return;
299}
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
new file mode 100644
index 000000000000..f9ce2d9fdfd5
--- /dev/null
+++ b/Documentation/timers/hpet_example.c
@@ -0,0 +1,269 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <fcntl.h>
5#include <string.h>
6#include <memory.h>
7#include <malloc.h>
8#include <time.h>
9#include <ctype.h>
10#include <sys/types.h>
11#include <sys/wait.h>
12#include <signal.h>
13#include <fcntl.h>
14#include <errno.h>
15#include <sys/time.h>
16#include <linux/hpet.h>
17
18
19extern void hpet_open_close(int, const char **);
20extern void hpet_info(int, const char **);
21extern void hpet_poll(int, const char **);
22extern void hpet_fasync(int, const char **);
23extern void hpet_read(int, const char **);
24
25#include <sys/poll.h>
26#include <sys/ioctl.h>
27#include <signal.h>
28
29struct hpet_command {
30 char *command;
31 void (*func)(int argc, const char ** argv);
32} hpet_command[] = {
33 {
34 "open-close",
35 hpet_open_close
36 },
37 {
38 "info",
39 hpet_info
40 },
41 {
42 "poll",
43 hpet_poll
44 },
45 {
46 "fasync",
47 hpet_fasync
48 },
49};
50
51int
52main(int argc, const char ** argv)
53{
54 int i;
55
56 argc--;
57 argv++;
58
59 if (!argc) {
60 fprintf(stderr, "-hpet: requires command\n");
61 return -1;
62 }
63
64
65 for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++)
66 if (!strcmp(argv[0], hpet_command[i].command)) {
67 argc--;
68 argv++;
69 fprintf(stderr, "-hpet: executing %s\n",
70 hpet_command[i].command);
71 hpet_command[i].func(argc, argv);
72 return 0;
73 }
74
75 fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]);
76
77 return -1;
78}
79
80void
81hpet_open_close(int argc, const char **argv)
82{
83 int fd;
84
85 if (argc != 1) {
86 fprintf(stderr, "hpet_open_close: device-name\n");
87 return;
88 }
89
90 fd = open(argv[0], O_RDONLY);
91 if (fd < 0)
92 fprintf(stderr, "hpet_open_close: open failed\n");
93 else
94 close(fd);
95
96 return;
97}
98
99void
100hpet_info(int argc, const char **argv)
101{
102}
103
104void
105hpet_poll(int argc, const char **argv)
106{
107 unsigned long freq;
108 int iterations, i, fd;
109 struct pollfd pfd;
110 struct hpet_info info;
111 struct timeval stv, etv;
112 struct timezone tz;
113 long usec;
114
115 if (argc != 3) {
116 fprintf(stderr, "hpet_poll: device-name freq iterations\n");
117 return;
118 }
119
120 freq = atoi(argv[1]);
121 iterations = atoi(argv[2]);
122
123 fd = open(argv[0], O_RDONLY);
124
125 if (fd < 0) {
126 fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
127 return;
128 }
129
130 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
131 fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n");
132 goto out;
133 }
134
135 if (ioctl(fd, HPET_INFO, &info) < 0) {
136 fprintf(stderr, "hpet_poll: failed to get info\n");
137 goto out;
138 }
139
140 fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags);
141
142 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
143 fprintf(stderr, "hpet_poll: HPET_EPI failed\n");
144 goto out;
145 }
146
147 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
148 fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n");
149 goto out;
150 }
151
152 pfd.fd = fd;
153 pfd.events = POLLIN;
154
155 for (i = 0; i < iterations; i++) {
156 pfd.revents = 0;
157 gettimeofday(&stv, &tz);
158 if (poll(&pfd, 1, -1) < 0)
159 fprintf(stderr, "hpet_poll: poll failed\n");
160 else {
161 long data;
162
163 gettimeofday(&etv, &tz);
164 usec = stv.tv_sec * 1000000 + stv.tv_usec;
165 usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec;
166
167 fprintf(stderr,
168 "hpet_poll: expired time = 0x%lx\n", usec);
169
170 fprintf(stderr, "hpet_poll: revents = 0x%x\n",
171 pfd.revents);
172
173 if (read(fd, &data, sizeof(data)) != sizeof(data)) {
174 fprintf(stderr, "hpet_poll: read failed\n");
175 }
176 else
177 fprintf(stderr, "hpet_poll: data 0x%lx\n",
178 data);
179 }
180 }
181
182out:
183 close(fd);
184 return;
185}
186
187static int hpet_sigio_count;
188
189static void
190hpet_sigio(int val)
191{
192 fprintf(stderr, "hpet_sigio: called\n");
193 hpet_sigio_count++;
194}
195
196void
197hpet_fasync(int argc, const char **argv)
198{
199 unsigned long freq;
200 int iterations, i, fd, value;
201 sig_t oldsig;
202 struct hpet_info info;
203
204 hpet_sigio_count = 0;
205 fd = -1;
206
207 if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) {
208 fprintf(stderr, "hpet_fasync: failed to set signal handler\n");
209 return;
210 }
211
212 if (argc != 3) {
213 fprintf(stderr, "hpet_fasync: device-name freq iterations\n");
214 goto out;
215 }
216
217 fd = open(argv[0], O_RDONLY);
218
219 if (fd < 0) {
220 fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
221 return;
222 }
223
224
225 if ((fcntl(fd, F_SETOWN, getpid()) == 1) ||
226 ((value = fcntl(fd, F_GETFL)) == 1) ||
227 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) {
228 fprintf(stderr, "hpet_fasync: fcntl failed\n");
229 goto out;
230 }
231
232 freq = atoi(argv[1]);
233 iterations = atoi(argv[2]);
234
235 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
236 fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n");
237 goto out;
238 }
239
240 if (ioctl(fd, HPET_INFO, &info) < 0) {
241 fprintf(stderr, "hpet_fasync: failed to get info\n");
242 goto out;
243 }
244
245 fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags);
246
247 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
248 fprintf(stderr, "hpet_fasync: HPET_EPI failed\n");
249 goto out;
250 }
251
252 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
253 fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n");
254 goto out;
255 }
256
257 for (i = 0; i < iterations; i++) {
258 (void) pause();
259 fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count);
260 }
261
262out:
263 signal(SIGIO, oldsig);
264
265 if (fd >= 0)
266 close(fd);
267
268 return;
269}
diff --git a/Documentation/trace/events-kmem.txt b/Documentation/trace/events-kmem.txt
index 6ef2a8652e17..aa82ee4a5a87 100644
--- a/Documentation/trace/events-kmem.txt
+++ b/Documentation/trace/events-kmem.txt
@@ -1,7 +1,7 @@
1 Subsystem Trace Points: kmem 1 Subsystem Trace Points: kmem
2 2
3The tracing system kmem captures events related to object and page allocation 3The kmem tracing system captures events related to object and page allocation
4within the kernel. Broadly speaking there are four major subheadings. 4within the kernel. Broadly speaking there are five major subheadings.
5 5
6 o Slab allocation of small objects of unknown type (kmalloc) 6 o Slab allocation of small objects of unknown type (kmalloc)
7 o Slab allocation of small objects of known type 7 o Slab allocation of small objects of known type
@@ -9,7 +9,7 @@ within the kernel. Broadly speaking there are four major subheadings.
9 o Per-CPU Allocator Activity 9 o Per-CPU Allocator Activity
10 o External Fragmentation 10 o External Fragmentation
11 11
12This document will describe what each of the tracepoints are and why they 12This document describes what each of the tracepoints is and why they
13might be useful. 13might be useful.
14 14
151. Slab allocation of small objects of unknown type 151. Slab allocation of small objects of unknown type
@@ -34,7 +34,7 @@ kmem_cache_free call_site=%lx ptr=%p
34These events are similar in usage to the kmalloc-related events except that 34These events are similar in usage to the kmalloc-related events except that
35it is likely easier to pin the event down to a specific cache. At the time 35it is likely easier to pin the event down to a specific cache. At the time
36of writing, no information is available on what slab is being allocated from, 36of writing, no information is available on what slab is being allocated from,
37but the call_site can usually be used to extrapolate that information 37but the call_site can usually be used to extrapolate that information.
38 38
393. Page allocation 393. Page allocation
40================== 40==================
@@ -80,9 +80,9 @@ event indicating whether it is for a percpu_refill or not.
80When the per-CPU list is too full, a number of pages are freed, each one 80When the per-CPU list is too full, a number of pages are freed, each one
81which triggers a mm_page_pcpu_drain event. 81which triggers a mm_page_pcpu_drain event.
82 82
83The individual nature of the events are so that pages can be tracked 83The individual nature of the events is so that pages can be tracked
84between allocation and freeing. A number of drain or refill pages that occur 84between allocation and freeing. A number of drain or refill pages that occur
85consecutively imply the zone->lock being taken once. Large amounts of PCP 85consecutively imply the zone->lock being taken once. Large amounts of per-CPU
86refills and drains could imply an imbalance between CPUs where too much work 86refills and drains could imply an imbalance between CPUs where too much work
87is being concentrated in one place. It could also indicate that the per-CPU 87is being concentrated in one place. It could also indicate that the per-CPU
88lists should be a larger size. Finally, large amounts of refills on one CPU 88lists should be a larger size. Finally, large amounts of refills on one CPU
@@ -102,6 +102,6 @@ is important.
102 102
103Large numbers of this event implies that memory is fragmenting and 103Large numbers of this event implies that memory is fragmenting and
104high-order allocations will start failing at some time in the future. One 104high-order allocations will start failing at some time in the future. One
105means of reducing the occurange of this event is to increase the size of 105means of reducing the occurrence of this event is to increase the size of
106min_free_kbytes in increments of 3*pageblock_size*nr_online_nodes where 106min_free_kbytes in increments of 3*pageblock_size*nr_online_nodes where
107pageblock_size is usually the size of the default hugepage size. 107pageblock_size is usually the size of the default hugepage size.
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt
index 7003e10f10f5..f1f81afee8a0 100644
--- a/Documentation/trace/ftrace-design.txt
+++ b/Documentation/trace/ftrace-design.txt
@@ -1,5 +1,6 @@
1 function tracer guts 1 function tracer guts
2 ==================== 2 ====================
3 By Mike Frysinger
3 4
4Introduction 5Introduction
5------------ 6------------
@@ -53,14 +54,14 @@ size of the mcount call that is embedded in the function).
53For example, if the function foo() calls bar(), when the bar() function calls 54For example, if the function foo() calls bar(), when the bar() function calls
54mcount(), the arguments mcount() will pass to the tracer are: 55mcount(), the arguments mcount() will pass to the tracer are:
55 "frompc" - the address bar() will use to return to foo() 56 "frompc" - the address bar() will use to return to foo()
56 "selfpc" - the address bar() (with _mcount() size adjustment) 57 "selfpc" - the address bar() (with mcount() size adjustment)
57 58
58Also keep in mind that this mcount function will be called *a lot*, so 59Also keep in mind that this mcount function will be called *a lot*, so
59optimizing for the default case of no tracer will help the smooth running of 60optimizing for the default case of no tracer will help the smooth running of
60your system when tracing is disabled. So the start of the mcount function is 61your system when tracing is disabled. So the start of the mcount function is
61typically the bare min with checking things before returning. That also means 62typically the bare minimum with checking things before returning. That also
62the code flow should usually kept linear (i.e. no branching in the nop case). 63means the code flow should usually be kept linear (i.e. no branching in the nop
63This is of course an optimization and not a hard requirement. 64case). This is of course an optimization and not a hard requirement.
64 65
65Here is some pseudo code that should help (these functions should actually be 66Here is some pseudo code that should help (these functions should actually be
66implemented in assembly): 67implemented in assembly):
@@ -131,10 +132,10 @@ some functions to save (hijack) and restore the return address.
131 132
132The mcount function should check the function pointers ftrace_graph_return 133The mcount function should check the function pointers ftrace_graph_return
133(compare to ftrace_stub) and ftrace_graph_entry (compare to 134(compare to ftrace_stub) and ftrace_graph_entry (compare to
134ftrace_graph_entry_stub). If either of those are not set to the relevant stub 135ftrace_graph_entry_stub). If either of those is not set to the relevant stub
135function, call the arch-specific function ftrace_graph_caller which in turn 136function, call the arch-specific function ftrace_graph_caller which in turn
136calls the arch-specific function prepare_ftrace_return. Neither of these 137calls the arch-specific function prepare_ftrace_return. Neither of these
137function names are strictly required, but you should use them anyways to stay 138function names is strictly required, but you should use them anyway to stay
138consistent across the architecture ports -- easier to compare & contrast 139consistent across the architecture ports -- easier to compare & contrast
139things. 140things.
140 141
@@ -144,7 +145,7 @@ but the first argument should be a pointer to the "frompc". Typically this is
144located on the stack. This allows the function to hijack the return address 145located on the stack. This allows the function to hijack the return address
145temporarily to have it point to the arch-specific function return_to_handler. 146temporarily to have it point to the arch-specific function return_to_handler.
146That function will simply call the common ftrace_return_to_handler function and 147That function will simply call the common ftrace_return_to_handler function and
147that will return the original return address with which, you can return to the 148that will return the original return address with which you can return to the
148original call site. 149original call site.
149 150
150Here is the updated mcount pseudo code: 151Here is the updated mcount pseudo code:
@@ -173,14 +174,16 @@ void ftrace_graph_caller(void)
173 174
174 unsigned long *frompc = &...; 175 unsigned long *frompc = &...;
175 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE; 176 unsigned long selfpc = <return address> - MCOUNT_INSN_SIZE;
176 prepare_ftrace_return(frompc, selfpc); 177 /* passing frame pointer up is optional -- see below */
178 prepare_ftrace_return(frompc, selfpc, frame_pointer);
177 179
178 /* restore all state needed by the ABI */ 180 /* restore all state needed by the ABI */
179} 181}
180#endif 182#endif
181 183
182For information on how to implement prepare_ftrace_return(), simply look at 184For information on how to implement prepare_ftrace_return(), simply look at the
183the x86 version. The only architecture-specific piece in it is the setup of 185x86 version (the frame pointer passing is optional; see the next section for
186more information). The only architecture-specific piece in it is the setup of
184the fault recovery table (the asm(...) code). The rest should be the same 187the fault recovery table (the asm(...) code). The rest should be the same
185across architectures. 188across architectures.
186 189
@@ -205,6 +208,23 @@ void return_to_handler(void)
205#endif 208#endif
206 209
207 210
211HAVE_FUNCTION_GRAPH_FP_TEST
212---------------------------
213
214An arch may pass in a unique value (frame pointer) to both the entering and
215exiting of a function. On exit, the value is compared and if it does not
216match, then it will panic the kernel. This is largely a sanity check for bad
217code generation with gcc. If gcc for your port sanely updates the frame
218pointer under different opitmization levels, then ignore this option.
219
220However, adding support for it isn't terribly difficult. In your assembly code
221that calls prepare_ftrace_return(), pass the frame pointer as the 3rd argument.
222Then in the C version of that function, do what the x86 port does and pass it
223along to ftrace_push_return_trace() instead of a stub value of 0.
224
225Similarly, when you call ftrace_return_to_handler(), pass it the frame pointer.
226
227
208HAVE_FTRACE_NMI_ENTER 228HAVE_FTRACE_NMI_ENTER
209--------------------- 229---------------------
210 230
@@ -213,10 +233,18 @@ If you can't trace NMI functions, then skip this option.
213<details to be filled> 233<details to be filled>
214 234
215 235
216HAVE_FTRACE_SYSCALLS 236HAVE_SYSCALL_TRACEPOINTS
217--------------------- 237---------------------
218 238
219<details to be filled> 239You need very few things to get the syscalls tracing in an arch.
240
241- Support HAVE_ARCH_TRACEHOOK (see arch/Kconfig).
242- Have a NR_syscalls variable in <asm/unistd.h> that provides the number
243 of syscalls supported by the arch.
244- Support the TIF_SYSCALL_TRACEPOINT thread flags.
245- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
246 in the ptrace syscalls tracing path.
247- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
220 248
221 249
222HAVE_FTRACE_MCOUNT_RECORD 250HAVE_FTRACE_MCOUNT_RECORD
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 957b22fde2df..03485bfbd797 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -1231,6 +1231,7 @@ something like this simple program:
1231#include <sys/stat.h> 1231#include <sys/stat.h>
1232#include <fcntl.h> 1232#include <fcntl.h>
1233#include <unistd.h> 1233#include <unistd.h>
1234#include <string.h>
1234 1235
1235#define _STR(x) #x 1236#define _STR(x) #x
1236#define STR(x) _STR(x) 1237#define STR(x) _STR(x)
@@ -1265,6 +1266,7 @@ const char *find_debugfs(void)
1265 return NULL; 1266 return NULL;
1266 } 1267 }
1267 1268
1269 strcat(debugfs, "/tracing/");
1268 debugfs_found = 1; 1270 debugfs_found = 1;
1269 1271
1270 return debugfs; 1272 return debugfs;
@@ -1586,7 +1588,7 @@ module author does not need to worry about it.
1586 1588
1587When tracing is enabled, kstop_machine is called to prevent 1589When tracing is enabled, kstop_machine is called to prevent
1588races with the CPUS executing code being modified (which can 1590races with the CPUS executing code being modified (which can
1589cause the CPU to do undesireable things), and the nops are 1591cause the CPU to do undesirable things), and the nops are
1590patched back to calls. But this time, they do not call mcount 1592patched back to calls. But this time, they do not call mcount
1591(which is just a function stub). They now call into the ftrace 1593(which is just a function stub). They now call into the ftrace
1592infrastructure. 1594infrastructure.
@@ -1623,7 +1625,7 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt:
1623 1625
1624 # echo sys_nanosleep hrtimer_interrupt \ 1626 # echo sys_nanosleep hrtimer_interrupt \
1625 > set_ftrace_filter 1627 > set_ftrace_filter
1626 # echo ftrace > current_tracer 1628 # echo function > current_tracer
1627 # echo 1 > tracing_enabled 1629 # echo 1 > tracing_enabled
1628 # usleep 1 1630 # usleep 1
1629 # echo 0 > tracing_enabled 1631 # echo 0 > tracing_enabled
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
new file mode 100644
index 000000000000..a9100b28eb84
--- /dev/null
+++ b/Documentation/trace/kprobetrace.txt
@@ -0,0 +1,156 @@
1 Kprobe-based Event Tracing
2 ==========================
3
4 Documentation is written by Masami Hiramatsu
5
6
7Overview
8--------
9These events are similar to tracepoint based events. Instead of Tracepoint,
10this is based on kprobes (kprobe and kretprobe). So it can probe wherever
11kprobes can probe (this means, all functions body except for __kprobes
12functions). Unlike the Tracepoint based event, this can be added and removed
13dynamically, on the fly.
14
15To enable this feature, build your kernel with CONFIG_KPROBE_TRACING=y.
16
17Similar to the events tracer, this doesn't need to be activated via
18current_tracer. Instead of that, add probe points via
19/sys/kernel/debug/tracing/kprobe_events, and enable it via
20/sys/kernel/debug/tracing/events/kprobes/<EVENT>/enabled.
21
22
23Synopsis of kprobe_events
24-------------------------
25 p[:[GRP/]EVENT] SYMBOL[+offs]|MEMADDR [FETCHARGS] : Set a probe
26 r[:[GRP/]EVENT] SYMBOL[+0] [FETCHARGS] : Set a return probe
27 -:[GRP/]EVENT : Clear a probe
28
29 GRP : Group name. If omitted, use "kprobes" for it.
30 EVENT : Event name. If omitted, the event name is generated
31 based on SYMBOL+offs or MEMADDR.
32 SYMBOL[+offs] : Symbol+offset where the probe is inserted.
33 MEMADDR : Address where the probe is inserted.
34
35 FETCHARGS : Arguments. Each probe can have up to 128 args.
36 %REG : Fetch register REG
37 @ADDR : Fetch memory at ADDR (ADDR should be in kernel)
38 @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol)
39 $stackN : Fetch Nth entry of stack (N >= 0)
40 $stack : Fetch stack address.
41 $retval : Fetch return value.(*)
42 +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**)
43 NAME=FETCHARG: Set NAME as the argument name of FETCHARG.
44
45 (*) only for return probe.
46 (**) this is useful for fetching a field of data structures.
47
48
49Per-Probe Event Filtering
50-------------------------
51 Per-probe event filtering feature allows you to set different filter on each
52probe and gives you what arguments will be shown in trace buffer. If an event
53name is specified right after 'p:' or 'r:' in kprobe_events, it adds an event
54under tracing/events/kprobes/<EVENT>, at the directory you can see 'id',
55'enabled', 'format' and 'filter'.
56
57enabled:
58 You can enable/disable the probe by writing 1 or 0 on it.
59
60format:
61 This shows the format of this probe event.
62
63filter:
64 You can write filtering rules of this event.
65
66id:
67 This shows the id of this probe event.
68
69
70Event Profiling
71---------------
72 You can check the total number of probe hits and probe miss-hits via
73/sys/kernel/debug/tracing/kprobe_profile.
74 The first column is event name, the second is the number of probe hits,
75the third is the number of probe miss-hits.
76
77
78Usage examples
79--------------
80To add a probe as a new event, write a new definition to kprobe_events
81as below.
82
83 echo 'p:myprobe do_sys_open dfd=%ax filename=%dx flags=%cx mode=+4($stack)' > /sys/kernel/debug/tracing/kprobe_events
84
85 This sets a kprobe on the top of do_sys_open() function with recording
861st to 4th arguments as "myprobe" event. Note, which register/stack entry is
87assigned to each function argument depends on arch-specific ABI. If you unsure
88the ABI, please try to use probe subcommand of perf-tools (you can find it
89under tools/perf/).
90As this example shows, users can choose more familiar names for each arguments.
91
92 echo 'r:myretprobe do_sys_open $retval' >> /sys/kernel/debug/tracing/kprobe_events
93
94 This sets a kretprobe on the return point of do_sys_open() function with
95recording return value as "myretprobe" event.
96 You can see the format of these events via
97/sys/kernel/debug/tracing/events/kprobes/<EVENT>/format.
98
99 cat /sys/kernel/debug/tracing/events/kprobes/myprobe/format
100name: myprobe
101ID: 780
102format:
103 field:unsigned short common_type; offset:0; size:2; signed:0;
104 field:unsigned char common_flags; offset:2; size:1; signed:0;
105 field:unsigned char common_preempt_count; offset:3; size:1;signed:0;
106 field:int common_pid; offset:4; size:4; signed:1;
107 field:int common_lock_depth; offset:8; size:4; signed:1;
108
109 field:unsigned long __probe_ip; offset:12; size:4; signed:0;
110 field:int __probe_nargs; offset:16; size:4; signed:1;
111 field:unsigned long dfd; offset:20; size:4; signed:0;
112 field:unsigned long filename; offset:24; size:4; signed:0;
113 field:unsigned long flags; offset:28; size:4; signed:0;
114 field:unsigned long mode; offset:32; size:4; signed:0;
115
116
117print fmt: "(%lx) dfd=%lx filename=%lx flags=%lx mode=%lx", REC->__probe_ip,
118REC->dfd, REC->filename, REC->flags, REC->mode
119
120 You can see that the event has 4 arguments as in the expressions you specified.
121
122 echo > /sys/kernel/debug/tracing/kprobe_events
123
124 This clears all probe points.
125
126 Or,
127
128 echo -:myprobe >> kprobe_events
129
130 This clears probe points selectively.
131
132 Right after definition, each event is disabled by default. For tracing these
133events, you need to enable it.
134
135 echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable
136 echo 1 > /sys/kernel/debug/tracing/events/kprobes/myretprobe/enable
137
138 And you can see the traced information via /sys/kernel/debug/tracing/trace.
139
140 cat /sys/kernel/debug/tracing/trace
141# tracer: nop
142#
143# TASK-PID CPU# TIMESTAMP FUNCTION
144# | | | | |
145 <...>-1447 [001] 1038282.286875: myprobe: (do_sys_open+0x0/0xd6) dfd=3 filename=7fffd1ec4440 flags=8000 mode=0
146 <...>-1447 [001] 1038282.286878: myretprobe: (sys_openat+0xc/0xe <- do_sys_open) $retval=fffffffffffffffe
147 <...>-1447 [001] 1038282.286885: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=40413c flags=8000 mode=1b6
148 <...>-1447 [001] 1038282.286915: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3
149 <...>-1447 [001] 1038282.286969: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=4041c6 flags=98800 mode=10
150 <...>-1447 [001] 1038282.286976: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3
151
152
153 Each line shows when the kernel hits an event, and <- SYMBOL means kernel
154returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel
155returns from do_sys_open to sys_open+0x1b).
156
diff --git a/Documentation/trace/mmiotrace.txt b/Documentation/trace/mmiotrace.txt
index 162effbfbdec..664e7386d89e 100644
--- a/Documentation/trace/mmiotrace.txt
+++ b/Documentation/trace/mmiotrace.txt
@@ -44,7 +44,8 @@ Check for lost events.
44Usage 44Usage
45----- 45-----
46 46
47Make sure debugfs is mounted to /sys/kernel/debug. If not, (requires root privileges) 47Make sure debugfs is mounted to /sys/kernel/debug.
48If not (requires root privileges):
48$ mount -t debugfs debugfs /sys/kernel/debug 49$ mount -t debugfs debugfs /sys/kernel/debug
49 50
50Check that the driver you are about to trace is not loaded. 51Check that the driver you are about to trace is not loaded.
@@ -91,7 +92,7 @@ $ dmesg > dmesg.txt
91$ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt 92$ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt
92and then send the .tar.gz file. The trace compresses considerably. Replace 93and then send the .tar.gz file. The trace compresses considerably. Replace
93"pciid" and "nick" with the PCI ID or model name of your piece of hardware 94"pciid" and "nick" with the PCI ID or model name of your piece of hardware
94under investigation and your nick name. 95under investigation and your nickname.
95 96
96 97
97How Mmiotrace Works 98How Mmiotrace Works
@@ -100,7 +101,7 @@ How Mmiotrace Works
100Access to hardware IO-memory is gained by mapping addresses from PCI bus by 101Access to hardware IO-memory is gained by mapping addresses from PCI bus by
101calling one of the ioremap_*() functions. Mmiotrace is hooked into the 102calling one of the ioremap_*() functions. Mmiotrace is hooked into the
102__ioremap() function and gets called whenever a mapping is created. Mapping is 103__ioremap() function and gets called whenever a mapping is created. Mapping is
103an event that is recorded into the trace log. Note, that ISA range mappings 104an event that is recorded into the trace log. Note that ISA range mappings
104are not caught, since the mapping always exists and is returned directly. 105are not caught, since the mapping always exists and is returned directly.
105 106
106MMIO accesses are recorded via page faults. Just before __ioremap() returns, 107MMIO accesses are recorded via page faults. Just before __ioremap() returns,
@@ -122,11 +123,11 @@ Trace Log Format
122---------------- 123----------------
123 124
124The raw log is text and easily filtered with e.g. grep and awk. One record is 125The raw log is text and easily filtered with e.g. grep and awk. One record is
125one line in the log. A record starts with a keyword, followed by keyword 126one line in the log. A record starts with a keyword, followed by keyword-
126dependant arguments. Arguments are separated by a space, or continue until the 127dependent arguments. Arguments are separated by a space, or continue until the
127end of line. The format for version 20070824 is as follows: 128end of line. The format for version 20070824 is as follows:
128 129
129Explanation Keyword Space separated arguments 130Explanation Keyword Space-separated arguments
130--------------------------------------------------------------------------- 131---------------------------------------------------------------------------
131 132
132read event R width, timestamp, map id, physical, value, PC, PID 133read event R width, timestamp, map id, physical, value, PC, PID
@@ -136,7 +137,7 @@ iounmap event UNMAP timestamp, map id, PC, PID
136marker MARK timestamp, text 137marker MARK timestamp, text
137version VERSION the string "20070824" 138version VERSION the string "20070824"
138info for reader LSPCI one line from lspci -v 139info for reader LSPCI one line from lspci -v
139PCI address map PCIDEV space separated /proc/bus/pci/devices data 140PCI address map PCIDEV space-separated /proc/bus/pci/devices data
140unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID 141unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID
141 142
142Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual 143Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual
diff --git a/Documentation/trace/ring-buffer-design.txt b/Documentation/trace/ring-buffer-design.txt
index 5b1d23d604c5..d299ff31df57 100644
--- a/Documentation/trace/ring-buffer-design.txt
+++ b/Documentation/trace/ring-buffer-design.txt
@@ -33,9 +33,9 @@ head_page - a pointer to the page that the reader will use next
33 33
34tail_page - a pointer to the page that will be written to next 34tail_page - a pointer to the page that will be written to next
35 35
36commit_page - a pointer to the page with the last finished non nested write. 36commit_page - a pointer to the page with the last finished non-nested write.
37 37
38cmpxchg - hardware assisted atomic transaction that performs the following: 38cmpxchg - hardware-assisted atomic transaction that performs the following:
39 39
40 A = B iff previous A == C 40 A = B iff previous A == C
41 41
@@ -52,15 +52,15 @@ The Generic Ring Buffer
52The ring buffer can be used in either an overwrite mode or in 52The ring buffer can be used in either an overwrite mode or in
53producer/consumer mode. 53producer/consumer mode.
54 54
55Producer/consumer mode is where the producer were to fill up the 55Producer/consumer mode is where if the producer were to fill up the
56buffer before the consumer could free up anything, the producer 56buffer before the consumer could free up anything, the producer
57will stop writing to the buffer. This will lose most recent events. 57will stop writing to the buffer. This will lose most recent events.
58 58
59Overwrite mode is where the produce were to fill up the buffer 59Overwrite mode is where if the producer were to fill up the buffer
60before the consumer could free up anything, the producer will 60before the consumer could free up anything, the producer will
61overwrite the older data. This will lose the oldest events. 61overwrite the older data. This will lose the oldest events.
62 62
63No two writers can write at the same time (on the same per cpu buffer), 63No two writers can write at the same time (on the same per-cpu buffer),
64but a writer may interrupt another writer, but it must finish writing 64but a writer may interrupt another writer, but it must finish writing
65before the previous writer may continue. This is very important to the 65before the previous writer may continue. This is very important to the
66algorithm. The writers act like a "stack". The way interrupts works 66algorithm. The writers act like a "stack". The way interrupts works
@@ -79,16 +79,16 @@ the interrupt doing a write as well.
79 79
80Readers can happen at any time. But no two readers may run at the 80Readers can happen at any time. But no two readers may run at the
81same time, nor can a reader preempt/interrupt another reader. A reader 81same time, nor can a reader preempt/interrupt another reader. A reader
82can not preempt/interrupt a writer, but it may read/consume from the 82cannot preempt/interrupt a writer, but it may read/consume from the
83buffer at the same time as a writer is writing, but the reader must be 83buffer at the same time as a writer is writing, but the reader must be
84on another processor to do so. A reader may read on its own processor 84on another processor to do so. A reader may read on its own processor
85and can be preempted by a writer. 85and can be preempted by a writer.
86 86
87A writer can preempt a reader, but a reader can not preempt a writer. 87A writer can preempt a reader, but a reader cannot preempt a writer.
88But a reader can read the buffer at the same time (on another processor) 88But a reader can read the buffer at the same time (on another processor)
89as a writer. 89as a writer.
90 90
91The ring buffer is made up of a list of pages held together by a link list. 91The ring buffer is made up of a list of pages held together by a linked list.
92 92
93At initialization a reader page is allocated for the reader that is not 93At initialization a reader page is allocated for the reader that is not
94part of the ring buffer. 94part of the ring buffer.
@@ -102,7 +102,7 @@ the head page.
102 102
103The reader has its own page to use. At start up time, this page is 103The reader has its own page to use. At start up time, this page is
104allocated but is not attached to the list. When the reader wants 104allocated but is not attached to the list. When the reader wants
105to read from the buffer, if its page is empty (like it is on start up) 105to read from the buffer, if its page is empty (like it is on start-up),
106it will swap its page with the head_page. The old reader page will 106it will swap its page with the head_page. The old reader page will
107become part of the ring buffer and the head_page will be removed. 107become part of the ring buffer and the head_page will be removed.
108The page after the inserted page (old reader_page) will become the 108The page after the inserted page (old reader_page) will become the
@@ -206,7 +206,7 @@ The main pointers:
206 206
207 commit page - the page that last finished a write. 207 commit page - the page that last finished a write.
208 208
209The commit page only is updated by the outer most writer in the 209The commit page only is updated by the outermost writer in the
210writer stack. A writer that preempts another writer will not move the 210writer stack. A writer that preempts another writer will not move the
211commit page. 211commit page.
212 212
@@ -281,7 +281,7 @@ with the previous write.
281The commit pointer points to the last write location that was 281The commit pointer points to the last write location that was
282committed without preempting another write. When a write that 282committed without preempting another write. When a write that
283preempted another write is committed, it only becomes a pending commit 283preempted another write is committed, it only becomes a pending commit
284and will not be a full commit till all writes have been committed. 284and will not be a full commit until all writes have been committed.
285 285
286The commit page points to the page that has the last full commit. 286The commit page points to the page that has the last full commit.
287The tail page points to the page with the last write (before 287The tail page points to the page with the last write (before
@@ -292,7 +292,7 @@ be several pages ahead. If the tail page catches up to the commit
292page then no more writes may take place (regardless of the mode 292page then no more writes may take place (regardless of the mode
293of the ring buffer: overwrite and produce/consumer). 293of the ring buffer: overwrite and produce/consumer).
294 294
295The order of pages are: 295The order of pages is:
296 296
297 head page 297 head page
298 commit page 298 commit page
@@ -311,7 +311,7 @@ Possible scenario:
311There is a special case that the head page is after either the commit page 311There is a special case that the head page is after either the commit page
312and possibly the tail page. That is when the commit (and tail) page has been 312and possibly the tail page. That is when the commit (and tail) page has been
313swapped with the reader page. This is because the head page is always 313swapped with the reader page. This is because the head page is always
314part of the ring buffer, but the reader page is not. When ever there 314part of the ring buffer, but the reader page is not. Whenever there
315has been less than a full page that has been committed inside the ring buffer, 315has been less than a full page that has been committed inside the ring buffer,
316and a reader swaps out a page, it will be swapping out the commit page. 316and a reader swaps out a page, it will be swapping out the commit page.
317 317
@@ -338,7 +338,7 @@ and a reader swaps out a page, it will be swapping out the commit page.
338In this case, the head page will not move when the tail and commit 338In this case, the head page will not move when the tail and commit
339move back into the ring buffer. 339move back into the ring buffer.
340 340
341The reader can not swap a page into the ring buffer if the commit page 341The reader cannot swap a page into the ring buffer if the commit page
342is still on that page. If the read meets the last commit (real commit 342is still on that page. If the read meets the last commit (real commit
343not pending or reserved), then there is nothing more to read. 343not pending or reserved), then there is nothing more to read.
344The buffer is considered empty until another full commit finishes. 344The buffer is considered empty until another full commit finishes.
@@ -395,7 +395,7 @@ The main idea behind the lockless algorithm is to combine the moving
395of the head_page pointer with the swapping of pages with the reader. 395of the head_page pointer with the swapping of pages with the reader.
396State flags are placed inside the pointer to the page. To do this, 396State flags are placed inside the pointer to the page. To do this,
397each page must be aligned in memory by 4 bytes. This will allow the 2 397each page must be aligned in memory by 4 bytes. This will allow the 2
398least significant bits of the address to be used as flags. Since 398least significant bits of the address to be used as flags, since
399they will always be zero for the address. To get the address, 399they will always be zero for the address. To get the address,
400simply mask out the flags. 400simply mask out the flags.
401 401
@@ -460,7 +460,7 @@ When the reader tries to swap the page with the ring buffer, it
460will also use cmpxchg. If the flag bit in the pointer to the 460will also use cmpxchg. If the flag bit in the pointer to the
461head page does not have the HEADER flag set, the compare will fail 461head page does not have the HEADER flag set, the compare will fail
462and the reader will need to look for the new head page and try again. 462and the reader will need to look for the new head page and try again.
463Note, the flag UPDATE and HEADER are never set at the same time. 463Note, the flags UPDATE and HEADER are never set at the same time.
464 464
465The reader swaps the reader page as follows: 465The reader swaps the reader page as follows:
466 466
@@ -539,7 +539,7 @@ updated to the reader page.
539 | +-----------------------------+ | 539 | +-----------------------------+ |
540 +------------------------------------+ 540 +------------------------------------+
541 541
542Another important point. The page that the reader page points back to 542Another important point: The page that the reader page points back to
543by its previous pointer (the one that now points to the new head page) 543by its previous pointer (the one that now points to the new head page)
544never points back to the reader page. That is because the reader page is 544never points back to the reader page. That is because the reader page is
545not part of the ring buffer. Traversing the ring buffer via the next pointers 545not part of the ring buffer. Traversing the ring buffer via the next pointers
@@ -572,7 +572,7 @@ not be able to swap the head page from the buffer, nor will it be able to
572move the head page, until the writer is finished with the move. 572move the head page, until the writer is finished with the move.
573 573
574This eliminates any races that the reader can have on the writer. The reader 574This eliminates any races that the reader can have on the writer. The reader
575must spin, and this is why the reader can not preempt the writer. 575must spin, and this is why the reader cannot preempt the writer.
576 576
577 tail page 577 tail page
578 | 578 |
@@ -659,9 +659,9 @@ before pushing the head page. If it is, then it can be assumed that the
659tail page wrapped the buffer, and we must drop new writes. 659tail page wrapped the buffer, and we must drop new writes.
660 660
661This is not a race condition, because the commit page can only be moved 661This is not a race condition, because the commit page can only be moved
662by the outter most writer (the writer that was preempted). 662by the outermost writer (the writer that was preempted).
663This means that the commit will not move while a writer is moving the 663This means that the commit will not move while a writer is moving the
664tail page. The reader can not swap the reader page if it is also being 664tail page. The reader cannot swap the reader page if it is also being
665used as the commit page. The reader can simply check that the commit 665used as the commit page. The reader can simply check that the commit
666is off the reader page. Once the commit page leaves the reader page 666is off the reader page. Once the commit page leaves the reader page
667it will never go back on it unless a reader does another swap with the 667it will never go back on it unless a reader does another swap with the
@@ -733,7 +733,7 @@ The write converts the head page pointer to UPDATE.
733--->| |<---| |<---| |<---| |<--- 733--->| |<---| |<---| |<---| |<---
734 +---+ +---+ +---+ +---+ 734 +---+ +---+ +---+ +---+
735 735
736But if a nested writer preempts here. It will see that the next 736But if a nested writer preempts here, it will see that the next
737page is a head page, but it is also nested. It will detect that 737page is a head page, but it is also nested. It will detect that
738it is nested and will save that information. The detection is the 738it is nested and will save that information. The detection is the
739fact that it sees the UPDATE flag instead of a HEADER or NORMAL 739fact that it sees the UPDATE flag instead of a HEADER or NORMAL
@@ -761,7 +761,7 @@ to NORMAL.
761--->| |<---| |<---| |<---| |<--- 761--->| |<---| |<---| |<---| |<---
762 +---+ +---+ +---+ +---+ 762 +---+ +---+ +---+ +---+
763 763
764After the nested writer finishes, the outer most writer will convert 764After the nested writer finishes, the outermost writer will convert
765the UPDATE pointer to NORMAL. 765the UPDATE pointer to NORMAL.
766 766
767 767
@@ -812,7 +812,7 @@ head page.
812 +---+ +---+ +---+ +---+ 812 +---+ +---+ +---+ +---+
813 813
814The nested writer moves the tail page forward. But does not set the old 814The nested writer moves the tail page forward. But does not set the old
815update page to NORMAL because it is not the outer most writer. 815update page to NORMAL because it is not the outermost writer.
816 816
817 tail page 817 tail page
818 | 818 |
@@ -892,7 +892,7 @@ It will return to the first writer.
892--->| |<---| |<---| |<---| |<--- 892--->| |<---| |<---| |<---| |<---
893 +---+ +---+ +---+ +---+ 893 +---+ +---+ +---+ +---+
894 894
895The first writer can not know atomically test if the tail page moved 895The first writer cannot know atomically if the tail page moved
896while it updates the HEAD page. It will then update the head page to 896while it updates the HEAD page. It will then update the head page to
897what it thinks is the new head page. 897what it thinks is the new head page.
898 898
@@ -923,9 +923,9 @@ if the tail page is either where it use to be or on the next page:
923--->| |<---| |<---| |<---| |<--- 923--->| |<---| |<---| |<---| |<---
924 +---+ +---+ +---+ +---+ 924 +---+ +---+ +---+ +---+
925 925
926If tail page != A and tail page does not equal B, then it must reset the 926If tail page != A and tail page != B, then it must reset the pointer
927pointer back to NORMAL. The fact that it only needs to worry about 927back to NORMAL. The fact that it only needs to worry about nested
928nested writers, it only needs to check this after setting the HEAD page. 928writers means that it only needs to check this after setting the HEAD page.
929 929
930 930
931(first writer) 931(first writer)
@@ -939,7 +939,7 @@ nested writers, it only needs to check this after setting the HEAD page.
939 +---+ +---+ +---+ +---+ 939 +---+ +---+ +---+ +---+
940 940
941Now the writer can update the head page. This is also why the head page must 941Now the writer can update the head page. This is also why the head page must
942remain in UPDATE and only reset by the outer most writer. This prevents 942remain in UPDATE and only reset by the outermost writer. This prevents
943the reader from seeing the incorrect head page. 943the reader from seeing the incorrect head page.
944 944
945 945
diff --git a/Documentation/trace/tracepoint-analysis.txt b/Documentation/trace/tracepoint-analysis.txt
index 5eb4e487e667..87bee3c129ba 100644
--- a/Documentation/trace/tracepoint-analysis.txt
+++ b/Documentation/trace/tracepoint-analysis.txt
@@ -10,8 +10,8 @@ Tracepoints (see Documentation/trace/tracepoints.txt) can be used without
10creating custom kernel modules to register probe functions using the event 10creating custom kernel modules to register probe functions using the event
11tracing infrastructure. 11tracing infrastructure.
12 12
13Simplistically, tracepoints will represent an important event that when can 13Simplistically, tracepoints represent important events that can be
14be taken in conjunction with other tracepoints to build a "Big Picture" of 14taken in conjunction with other tracepoints to build a "Big Picture" of
15what is going on within the system. There are a large number of methods for 15what is going on within the system. There are a large number of methods for
16gathering and interpreting these events. Lacking any current Best Practises, 16gathering and interpreting these events. Lacking any current Best Practises,
17this document describes some of the methods that can be used. 17this document describes some of the methods that can be used.
@@ -33,12 +33,12 @@ calling
33 33
34will give a fair indication of the number of events available. 34will give a fair indication of the number of events available.
35 35
362.2 PCL 362.2 PCL (Performance Counters for Linux)
37------- 37-------
38 38
39Discovery and enumeration of all counters and events, including tracepoints 39Discovery and enumeration of all counters and events, including tracepoints,
40are available with the perf tool. Getting a list of available events is a 40are available with the perf tool. Getting a list of available events is a
41simple case of 41simple case of:
42 42
43 $ perf list 2>&1 | grep Tracepoint 43 $ perf list 2>&1 | grep Tracepoint
44 ext4:ext4_free_inode [Tracepoint event] 44 ext4:ext4_free_inode [Tracepoint event]
@@ -49,19 +49,19 @@ simple case of
49 [ .... remaining output snipped .... ] 49 [ .... remaining output snipped .... ]
50 50
51 51
522. Enabling Events 523. Enabling Events
53================== 53==================
54 54
552.1 System-Wide Event Enabling 553.1 System-Wide Event Enabling
56------------------------------ 56------------------------------
57 57
58See Documentation/trace/events.txt for a proper description on how events 58See Documentation/trace/events.txt for a proper description on how events
59can be enabled system-wide. A short example of enabling all events related 59can be enabled system-wide. A short example of enabling all events related
60to page allocation would look something like 60to page allocation would look something like:
61 61
62 $ for i in `find /sys/kernel/debug/tracing/events -name "enable" | grep mm_`; do echo 1 > $i; done 62 $ for i in `find /sys/kernel/debug/tracing/events -name "enable" | grep mm_`; do echo 1 > $i; done
63 63
642.2 System-Wide Event Enabling with SystemTap 643.2 System-Wide Event Enabling with SystemTap
65--------------------------------------------- 65---------------------------------------------
66 66
67In SystemTap, tracepoints are accessible using the kernel.trace() function 67In SystemTap, tracepoints are accessible using the kernel.trace() function
@@ -86,7 +86,7 @@ were allocating the pages.
86 print_count() 86 print_count()
87 } 87 }
88 88
892.3 System-Wide Event Enabling with PCL 893.3 System-Wide Event Enabling with PCL
90--------------------------------------- 90---------------------------------------
91 91
92By specifying the -a switch and analysing sleep, the system-wide events 92By specifying the -a switch and analysing sleep, the system-wide events
@@ -107,16 +107,16 @@ for a duration of time can be examined.
107Similarly, one could execute a shell and exit it as desired to get a report 107Similarly, one could execute a shell and exit it as desired to get a report
108at that point. 108at that point.
109 109
1102.4 Local Event Enabling 1103.4 Local Event Enabling
111------------------------ 111------------------------
112 112
113Documentation/trace/ftrace.txt describes how to enable events on a per-thread 113Documentation/trace/ftrace.txt describes how to enable events on a per-thread
114basis using set_ftrace_pid. 114basis using set_ftrace_pid.
115 115
1162.5 Local Event Enablement with PCL 1163.5 Local Event Enablement with PCL
117----------------------------------- 117-----------------------------------
118 118
119Events can be activate and tracked for the duration of a process on a local 119Events can be activated and tracked for the duration of a process on a local
120basis using PCL such as follows. 120basis using PCL such as follows.
121 121
122 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 122 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
@@ -131,18 +131,18 @@ basis using PCL such as follows.
131 131
132 0.973913387 seconds time elapsed 132 0.973913387 seconds time elapsed
133 133
1343. Event Filtering 1344. Event Filtering
135================== 135==================
136 136
137Documentation/trace/ftrace.txt covers in-depth how to filter events in 137Documentation/trace/ftrace.txt covers in-depth how to filter events in
138ftrace. Obviously using grep and awk of trace_pipe is an option as well 138ftrace. Obviously using grep and awk of trace_pipe is an option as well
139as any script reading trace_pipe. 139as any script reading trace_pipe.
140 140
1414. Analysing Event Variances with PCL 1415. Analysing Event Variances with PCL
142===================================== 142=====================================
143 143
144Any workload can exhibit variances between runs and it can be important 144Any workload can exhibit variances between runs and it can be important
145to know what the standard deviation in. By and large, this is left to the 145to know what the standard deviation is. By and large, this is left to the
146performance analyst to do it by hand. In the event that the discrete event 146performance analyst to do it by hand. In the event that the discrete event
147occurrences are useful to the performance analyst, then perf can be used. 147occurrences are useful to the performance analyst, then perf can be used.
148 148
@@ -166,7 +166,7 @@ In the event that some higher-level event is required that depends on some
166aggregation of discrete events, then a script would need to be developed. 166aggregation of discrete events, then a script would need to be developed.
167 167
168Using --repeat, it is also possible to view how events are fluctuating over 168Using --repeat, it is also possible to view how events are fluctuating over
169time on a system wide basis using -a and sleep. 169time on a system-wide basis using -a and sleep.
170 170
171 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 171 $ perf stat -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
172 -e kmem:mm_pagevec_free \ 172 -e kmem:mm_pagevec_free \
@@ -180,7 +180,7 @@ time on a system wide basis using -a and sleep.
180 180
181 1.002251757 seconds time elapsed ( +- 0.005% ) 181 1.002251757 seconds time elapsed ( +- 0.005% )
182 182
1835. Higher-Level Analysis with Helper Scripts 1836. Higher-Level Analysis with Helper Scripts
184============================================ 184============================================
185 185
186When events are enabled the events that are triggering can be read from 186When events are enabled the events that are triggering can be read from
@@ -190,11 +190,11 @@ be gathered on-line as appropriate. Examples of post-processing might include
190 190
191 o Reading information from /proc for the PID that triggered the event 191 o Reading information from /proc for the PID that triggered the event
192 o Deriving a higher-level event from a series of lower-level events. 192 o Deriving a higher-level event from a series of lower-level events.
193 o Calculate latencies between two events 193 o Calculating latencies between two events
194 194
195Documentation/trace/postprocess/trace-pagealloc-postprocess.pl is an example 195Documentation/trace/postprocess/trace-pagealloc-postprocess.pl is an example
196script that can read trace_pipe from STDIN or a copy of a trace. When used 196script that can read trace_pipe from STDIN or a copy of a trace. When used
197on-line, it can be interrupted once to generate a report without existing 197on-line, it can be interrupted once to generate a report without exiting
198and twice to exit. 198and twice to exit.
199 199
200Simplistically, the script just reads STDIN and counts up events but it 200Simplistically, the script just reads STDIN and counts up events but it
@@ -212,12 +212,12 @@ also can do more such as
212 processes, the parent process responsible for creating all the helpers 212 processes, the parent process responsible for creating all the helpers
213 can be identified 213 can be identified
214 214
2156. Lower-Level Analysis with PCL 2157. Lower-Level Analysis with PCL
216================================ 216================================
217 217
218There may also be a requirement to identify what functions with a program 218There may also be a requirement to identify what functions within a program
219were generating events within the kernel. To begin this sort of analysis, the 219were generating events within the kernel. To begin this sort of analysis, the
220data must be recorded. At the time of writing, this required root 220data must be recorded. At the time of writing, this required root:
221 221
222 $ perf record -c 1 \ 222 $ perf record -c 1 \
223 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 223 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
@@ -253,11 +253,11 @@ perf report.
253 # (For more details, try: perf report --sort comm,dso,symbol) 253 # (For more details, try: perf report --sort comm,dso,symbol)
254 # 254 #
255 255
256According to this, the vast majority of events occured triggered on events 256According to this, the vast majority of events triggered on events
257within the VDSO. With simple binaries, this will often be the case so lets 257within the VDSO. With simple binaries, this will often be the case so let's
258take a slightly different example. In the course of writing this, it was 258take a slightly different example. In the course of writing this, it was
259noticed that X was generating an insane amount of page allocations so lets look 259noticed that X was generating an insane amount of page allocations so let's look
260at it 260at it:
261 261
262 $ perf record -c 1 -f \ 262 $ perf record -c 1 -f \
263 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \ 263 -e kmem:mm_page_alloc -e kmem:mm_page_free_direct \
@@ -280,8 +280,8 @@ This was interrupted after a few seconds and
280 # (For more details, try: perf report --sort comm,dso,symbol) 280 # (For more details, try: perf report --sort comm,dso,symbol)
281 # 281 #
282 282
283So, almost half of the events are occuring in a library. To get an idea which 283So, almost half of the events are occurring in a library. To get an idea which
284symbol. 284symbol:
285 285
286 $ perf report --sort comm,dso,symbol 286 $ perf report --sort comm,dso,symbol
287 # Samples: 27666 287 # Samples: 27666
@@ -297,7 +297,7 @@ symbol.
297 0.01% Xorg /opt/gfx-test/lib/libpixman-1.so.0.13.1 [.] get_fast_path 297 0.01% Xorg /opt/gfx-test/lib/libpixman-1.so.0.13.1 [.] get_fast_path
298 0.00% Xorg [kernel] [k] ftrace_trace_userstack 298 0.00% Xorg [kernel] [k] ftrace_trace_userstack
299 299
300To see where within the function pixmanFillsse2 things are going wrong 300To see where within the function pixmanFillsse2 things are going wrong:
301 301
302 $ perf annotate pixmanFillsse2 302 $ perf annotate pixmanFillsse2
303 [ ... ] 303 [ ... ]
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt
index 9cf83e8c27b8..d83703ea74b2 100644
--- a/Documentation/usb/error-codes.txt
+++ b/Documentation/usb/error-codes.txt
@@ -41,8 +41,8 @@ USB-specific:
41 41
42-EFBIG Host controller driver can't schedule that many ISO frames. 42-EFBIG Host controller driver can't schedule that many ISO frames.
43 43
44-EPIPE Specified endpoint is stalled. For non-control endpoints, 44-EPIPE The pipe type specified in the URB doesn't match the
45 reset this status with usb_clear_halt(). 45 endpoint's actual type.
46 46
47-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable 47-EMSGSIZE (a) endpoint maxpacket size is zero; it is not usable
48 in the current interface altsetting. 48 in the current interface altsetting.
@@ -60,6 +60,8 @@ USB-specific:
60 60
61-EHOSTUNREACH URB was rejected because the device is suspended. 61-EHOSTUNREACH URB was rejected because the device is suspended.
62 62
63-ENOEXEC A control URB doesn't contain a Setup packet.
64
63 65
64************************************************************************** 66**************************************************************************
65* Error codes returned by in urb->status * 67* Error codes returned by in urb->status *
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index ad642615ad4c..2790ad48cfc2 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -2,7 +2,7 @@
2 2
3 Alan Stern <stern@rowland.harvard.edu> 3 Alan Stern <stern@rowland.harvard.edu>
4 4
5 October 5, 2007 5 December 11, 2009
6 6
7 7
8 8
@@ -29,9 +29,9 @@ covered to some extent (see Documentation/power/*.txt for more
29information about system PM). 29information about system PM).
30 30
31Note: Dynamic PM support for USB is present only if the kernel was 31Note: Dynamic PM support for USB is present only if the kernel was
32built with CONFIG_USB_SUSPEND enabled. System PM support is present 32built with CONFIG_USB_SUSPEND enabled (which depends on
33only if the kernel was built with CONFIG_SUSPEND or CONFIG_HIBERNATION 33CONFIG_PM_RUNTIME). System PM support is present only if the kernel
34enabled. 34was built with CONFIG_SUSPEND or CONFIG_HIBERNATION enabled.
35 35
36 36
37 What is Remote Wakeup? 37 What is Remote Wakeup?
@@ -71,12 +71,10 @@ being accessed through sysfs, then it definitely is idle.
71 Forms of dynamic PM 71 Forms of dynamic PM
72 ------------------- 72 -------------------
73 73
74Dynamic suspends can occur in two ways: manual and automatic. 74Dynamic suspends occur when the kernel decides to suspend an idle
75"Manual" means that the user has told the kernel to suspend a device, 75device. This is called "autosuspend" for short. In general, a device
76whereas "automatic" means that the kernel has decided all by itself to 76won't be autosuspended unless it has been idle for some minimum period
77suspend a device. Automatic suspend is called "autosuspend" for 77of time, the so-called idle-delay time.
78short. In general, a device won't be autosuspended unless it has been
79idle for some minimum period of time, the so-called idle-delay time.
80 78
81Of course, nothing the kernel does on its own initiative should 79Of course, nothing the kernel does on its own initiative should
82prevent the computer or its devices from working properly. If a 80prevent the computer or its devices from working properly. If a
@@ -96,10 +94,11 @@ idle.
96We can categorize power management events in two broad classes: 94We can categorize power management events in two broad classes:
97external and internal. External events are those triggered by some 95external and internal. External events are those triggered by some
98agent outside the USB stack: system suspend/resume (triggered by 96agent outside the USB stack: system suspend/resume (triggered by
99userspace), manual dynamic suspend/resume (also triggered by 97userspace), manual dynamic resume (also triggered by userspace), and
100userspace), and remote wakeup (triggered by the device). Internal 98remote wakeup (triggered by the device). Internal events are those
101events are those triggered within the USB stack: autosuspend and 99triggered within the USB stack: autosuspend and autoresume. Note that
102autoresume. 100all dynamic suspend events are internal; external agents are not
101allowed to issue dynamic suspends.
103 102
104 103
105 The user interface for dynamic PM 104 The user interface for dynamic PM
@@ -123,9 +122,9 @@ relevant attribute files are: wakeup, level, and autosuspend.
123 122
124 power/level 123 power/level
125 124
126 This file contains one of three words: "on", "auto", 125 This file contains one of two words: "on" or "auto".
127 or "suspend". You can write those words to the file 126 You can write those words to the file to change the
128 to change the device's setting. 127 device's setting.
129 128
130 "on" means that the device should be resumed and 129 "on" means that the device should be resumed and
131 autosuspend is not allowed. (Of course, system 130 autosuspend is not allowed. (Of course, system
@@ -134,10 +133,10 @@ relevant attribute files are: wakeup, level, and autosuspend.
134 "auto" is the normal state in which the kernel is 133 "auto" is the normal state in which the kernel is
135 allowed to autosuspend and autoresume the device. 134 allowed to autosuspend and autoresume the device.
136 135
137 "suspend" means that the device should remain 136 (In kernels up to 2.6.32, you could also specify
138 suspended, and autoresume is not allowed. (But remote 137 "suspend", meaning that the device should remain
139 wakeup may still be allowed, since it is controlled 138 suspended and autoresume was not allowed. This
140 separately by the power/wakeup attribute.) 139 setting is no longer supported.)
141 140
142 power/autosuspend 141 power/autosuspend
143 142
@@ -145,9 +144,9 @@ relevant attribute files are: wakeup, level, and autosuspend.
145 number of seconds the device should remain idle before 144 number of seconds the device should remain idle before
146 the kernel will autosuspend it (the idle-delay time). 145 the kernel will autosuspend it (the idle-delay time).
147 The default is 2. 0 means to autosuspend as soon as 146 The default is 2. 0 means to autosuspend as soon as
148 the device becomes idle, and -1 means never to 147 the device becomes idle, and negative values mean
149 autosuspend. You can write a number to the file to 148 never to autosuspend. You can write a number to the
150 change the autosuspend idle-delay time. 149 file to change the autosuspend idle-delay time.
151 150
152Writing "-1" to power/autosuspend and writing "on" to power/level do 151Writing "-1" to power/autosuspend and writing "on" to power/level do
153essentially the same thing -- they both prevent the device from being 152essentially the same thing -- they both prevent the device from being
@@ -230,6 +229,11 @@ necessary operations by hand or add them to a udev script. You can
230also change the idle-delay time; 2 seconds is not the best choice for 229also change the idle-delay time; 2 seconds is not the best choice for
231every device. 230every device.
232 231
232If a driver knows that its device has proper suspend/resume support,
233it can enable autosuspend all by itself. For example, the video
234driver for a laptop's webcam might do this, since these devices are
235rarely used and so should normally be autosuspended.
236
233Sometimes it turns out that even when a device does work okay with 237Sometimes it turns out that even when a device does work okay with
234autosuspend there are still problems. For example, there are 238autosuspend there are still problems. For example, there are
235experimental patches adding autosuspend support to the usbhid driver, 239experimental patches adding autosuspend support to the usbhid driver,
@@ -313,82 +317,90 @@ three of the methods listed above. In addition, a driver indicates
313that it supports autosuspend by setting the .supports_autosuspend flag 317that it supports autosuspend by setting the .supports_autosuspend flag
314in its usb_driver structure. It is then responsible for informing the 318in its usb_driver structure. It is then responsible for informing the
315USB core whenever one of its interfaces becomes busy or idle. The 319USB core whenever one of its interfaces becomes busy or idle. The
316driver does so by calling these five functions: 320driver does so by calling these six functions:
317 321
318 int usb_autopm_get_interface(struct usb_interface *intf); 322 int usb_autopm_get_interface(struct usb_interface *intf);
319 void usb_autopm_put_interface(struct usb_interface *intf); 323 void usb_autopm_put_interface(struct usb_interface *intf);
320 int usb_autopm_set_interface(struct usb_interface *intf);
321 int usb_autopm_get_interface_async(struct usb_interface *intf); 324 int usb_autopm_get_interface_async(struct usb_interface *intf);
322 void usb_autopm_put_interface_async(struct usb_interface *intf); 325 void usb_autopm_put_interface_async(struct usb_interface *intf);
326 void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
327 void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
323 328
324The functions work by maintaining a counter in the usb_interface 329The functions work by maintaining a usage counter in the
325structure. When intf->pm_usage_count is > 0 then the interface is 330usb_interface's embedded device structure. When the counter is > 0
326deemed to be busy, and the kernel will not autosuspend the interface's 331then the interface is deemed to be busy, and the kernel will not
327device. When intf->pm_usage_count is <= 0 then the interface is 332autosuspend the interface's device. When the usage counter is = 0
328considered to be idle, and the kernel may autosuspend the device. 333then the interface is considered to be idle, and the kernel may
334autosuspend the device.
329 335
330(There is a similar pm_usage_count field in struct usb_device, 336(There is a similar usage counter field in struct usb_device,
331associated with the device itself rather than any of its interfaces. 337associated with the device itself rather than any of its interfaces.
332This field is used only by the USB core.) 338This counter is used only by the USB core.)
333 339
334The driver owns intf->pm_usage_count; it can modify the value however 340Drivers need not be concerned about balancing changes to the usage
335and whenever it likes. A nice aspect of the non-async usb_autopm_* 341counter; the USB core will undo any remaining "get"s when a driver
336routines is that the changes they make are protected by the usb_device 342is unbound from its interface. As a corollary, drivers must not call
337structure's PM mutex (udev->pm_mutex); however drivers may change 343any of the usb_autopm_* functions after their diconnect() routine has
338pm_usage_count without holding the mutex. Drivers using the async 344returned.
339routines are responsible for their own synchronization and mutual
340exclusion.
341 345
342 usb_autopm_get_interface() increments pm_usage_count and 346Drivers using the async routines are responsible for their own
343 attempts an autoresume if the new value is > 0 and the 347synchronization and mutual exclusion.
344 device is suspended.
345 348
346 usb_autopm_put_interface() decrements pm_usage_count and 349 usb_autopm_get_interface() increments the usage counter and
347 attempts an autosuspend if the new value is <= 0 and the 350 does an autoresume if the device is suspended. If the
348 device isn't suspended. 351 autoresume fails, the counter is decremented back.
349 352
350 usb_autopm_set_interface() leaves pm_usage_count alone. 353 usb_autopm_put_interface() decrements the usage counter and
351 It attempts an autoresume if the value is > 0 and the device 354 attempts an autosuspend if the new value is = 0.
352 is suspended, and it attempts an autosuspend if the value is
353 <= 0 and the device isn't suspended.
354 355
355 usb_autopm_get_interface_async() and 356 usb_autopm_get_interface_async() and
356 usb_autopm_put_interface_async() do almost the same things as 357 usb_autopm_put_interface_async() do almost the same things as
357 their non-async counterparts. The differences are: they do 358 their non-async counterparts. The big difference is that they
358 not acquire the PM mutex, and they use a workqueue to do their 359 use a workqueue to do the resume or suspend part of their
359 jobs. As a result they can be called in an atomic context, 360 jobs. As a result they can be called in an atomic context,
360 such as an URB's completion handler, but when they return the 361 such as an URB's completion handler, but when they return the
361 device will not generally not yet be in the desired state. 362 device will generally not yet be in the desired state.
362
363There also are a couple of utility routines drivers can use:
364
365 usb_autopm_enable() sets pm_usage_cnt to 0 and then calls
366 usb_autopm_set_interface(), which will attempt an autosuspend.
367 363
368 usb_autopm_disable() sets pm_usage_cnt to 1 and then calls 364 usb_autopm_get_interface_no_resume() and
369 usb_autopm_set_interface(), which will attempt an autoresume. 365 usb_autopm_put_interface_no_suspend() merely increment or
366 decrement the usage counter; they do not attempt to carry out
367 an autoresume or an autosuspend. Hence they can be called in
368 an atomic context.
370 369
371The conventional usage pattern is that a driver calls 370The simplest usage pattern is that a driver calls
372usb_autopm_get_interface() in its open routine and 371usb_autopm_get_interface() in its open routine and
373usb_autopm_put_interface() in its close or release routine. But 372usb_autopm_put_interface() in its close or release routine. But other
374other patterns are possible. 373patterns are possible.
375 374
376The autosuspend attempts mentioned above will often fail for one 375The autosuspend attempts mentioned above will often fail for one
377reason or another. For example, the power/level attribute might be 376reason or another. For example, the power/level attribute might be
378set to "on", or another interface in the same device might not be 377set to "on", or another interface in the same device might not be
379idle. This is perfectly normal. If the reason for failure was that 378idle. This is perfectly normal. If the reason for failure was that
380the device hasn't been idle for long enough, a delayed workqueue 379the device hasn't been idle for long enough, a timer is scheduled to
381routine is automatically set up to carry out the operation when the 380carry out the operation automatically when the autosuspend idle-delay
382autosuspend idle-delay has expired. 381has expired.
383 382
384Autoresume attempts also can fail. This will happen if power/level is 383Autoresume attempts also can fail, although failure would mean that
385set to "suspend" or if the device doesn't manage to resume properly. 384the device is no longer present or operating properly. Unlike
386Unlike autosuspend, there's no delay for an autoresume. 385autosuspend, there's no idle-delay for an autoresume.
387 386
388 387
389 Other parts of the driver interface 388 Other parts of the driver interface
390 ----------------------------------- 389 -----------------------------------
391 390
391Drivers can enable autosuspend for their devices by calling
392
393 usb_enable_autosuspend(struct usb_device *udev);
394
395in their probe() routine, if they know that the device is capable of
396suspending and resuming correctly. This is exactly equivalent to
397writing "auto" to the device's power/level attribute. Likewise,
398drivers can disable autosuspend by calling
399
400 usb_disable_autosuspend(struct usb_device *udev);
401
402This is exactly the same as writing "on" to the power/level attribute.
403
392Sometimes a driver needs to make sure that remote wakeup is enabled 404Sometimes a driver needs to make sure that remote wakeup is enabled
393during autosuspend. For example, there's not much point 405during autosuspend. For example, there's not much point
394autosuspending a keyboard if the user can't cause the keyboard to do a 406autosuspending a keyboard if the user can't cause the keyboard to do a
@@ -400,101 +412,51 @@ though, setting this flag won't cause the kernel to autoresume it.
400Normally a driver would set this flag in its probe method, at which 412Normally a driver would set this flag in its probe method, at which
401time the device is guaranteed not to be autosuspended.) 413time the device is guaranteed not to be autosuspended.)
402 414
403The usb_autopm_* routines have to run in a sleepable process context; 415If a driver does its I/O asynchronously in interrupt context, it
404they must not be called from an interrupt handler or while holding a 416should call usb_autopm_get_interface_async() before starting output and
405spinlock. In fact, the entire autosuspend mechanism is not well geared 417usb_autopm_put_interface_async() when the output queue drains. When
406toward interrupt-driven operation. However there is one thing a 418it receives an input event, it should call
407driver can do in an interrupt handler:
408 419
409 usb_mark_last_busy(struct usb_device *udev); 420 usb_mark_last_busy(struct usb_device *udev);
410 421
411This sets udev->last_busy to the current time. udev->last_busy is the 422in the event handler. This sets udev->last_busy to the current time.
412field used for idle-delay calculations; updating it will cause any 423udev->last_busy is the field used for idle-delay calculations;
413pending autosuspend to be moved back. The usb_autopm_* routines will 424updating it will cause any pending autosuspend to be moved back. Most
414also set the last_busy field to the current time. 425of the usb_autopm_* routines will also set the last_busy field to the
415 426current time.
416Calling urb_mark_last_busy() from within an URB completion handler is 427
417subject to races: The kernel may have just finished deciding the 428Asynchronous operation is always subject to races. For example, a
418device has been idle for long enough but not yet gotten around to 429driver may call one of the usb_autopm_*_interface_async() routines at
419calling the driver's suspend method. The driver would have to be 430a time when the core has just finished deciding the device has been
420responsible for synchronizing its suspend method with its URB 431idle for long enough but not yet gotten around to calling the driver's
421completion handler and causing the autosuspend to fail with -EBUSY if 432suspend method. The suspend method must be responsible for
422an URB had completed too recently. 433synchronizing with the output request routine and the URB completion
434handler; it should cause autosuspends to fail with -EBUSY if the
435driver needs to use the device.
423 436
424External suspend calls should never be allowed to fail in this way, 437External suspend calls should never be allowed to fail in this way,
425only autosuspend calls. The driver can tell them apart by checking 438only autosuspend calls. The driver can tell them apart by checking
426udev->auto_pm; this flag will be set to 1 for internal PM events 439the PM_EVENT_AUTO bit in the message.event argument to the suspend
427(autosuspend or autoresume) and 0 for external PM events. 440method; this bit will be set for internal PM events (autosuspend) and
428 441clear for external PM events.
429Many of the ingredients in the autosuspend framework are oriented
430towards interfaces: The usb_interface structure contains the
431pm_usage_cnt field, and the usb_autopm_* routines take an interface
432pointer as their argument. But somewhat confusingly, a few of the
433pieces (usb_mark_last_busy() and udev->auto_pm) use the usb_device
434structure instead. Drivers need to keep this straight; they can call
435interface_to_usbdev() to find the device structure for a given
436interface.
437
438
439 Locking requirements
440 --------------------
441
442All three suspend/resume methods are always called while holding the
443usb_device's PM mutex. For external events -- but not necessarily for
444autosuspend or autoresume -- the device semaphore (udev->dev.sem) will
445also be held. This implies that external suspend/resume events are
446mutually exclusive with calls to probe, disconnect, pre_reset, and
447post_reset; the USB core guarantees that this is true of internal
448suspend/resume events as well.
449
450If a driver wants to block all suspend/resume calls during some
451critical section, it can simply acquire udev->pm_mutex. Note that
452calls to resume may be triggered indirectly. Block IO due to memory
453allocations can make the vm subsystem resume a device. Thus while
454holding this lock you must not allocate memory with GFP_KERNEL or
455GFP_NOFS.
456
457Alternatively, if the critical section might call some of the
458usb_autopm_* routines, the driver can avoid deadlock by doing:
459
460 down(&udev->dev.sem);
461 rc = usb_autopm_get_interface(intf);
462
463and at the end of the critical section:
464
465 if (!rc)
466 usb_autopm_put_interface(intf);
467 up(&udev->dev.sem);
468 442
469Holding the device semaphore will block all external PM calls, and the
470usb_autopm_get_interface() will prevent any internal PM calls, even if
471it fails. (Exercise: Why?)
472 443
473The rules for locking order are: 444 Mutual exclusion
445 ----------------
474 446
475 Never acquire any device semaphore while holding any PM mutex. 447For external events -- but not necessarily for autosuspend or
448autoresume -- the device semaphore (udev->dev.sem) will be held when a
449suspend or resume method is called. This implies that external
450suspend/resume events are mutually exclusive with calls to probe,
451disconnect, pre_reset, and post_reset; the USB core guarantees that
452this is true of autosuspend/autoresume events as well.
476 453
477 Never acquire udev->pm_mutex while holding the PM mutex for 454If a driver wants to block all suspend/resume calls during some
478 a device that isn't a descendant of udev. 455critical section, the best way is to lock the device and call
479 456usb_autopm_get_interface() (and do the reverse at the end of the
480In other words, PM mutexes should only be acquired going up the device 457critical section). Holding the device semaphore will block all
481tree, and they should be acquired only after locking all the device 458external PM calls, and the usb_autopm_get_interface() will prevent any
482semaphores you need to hold. These rules don't matter to drivers very 459internal PM calls, even if it fails. (Exercise: Why?)
483much; they usually affect just the USB core.
484
485Still, drivers do need to be careful. For example, many drivers use a
486private mutex to synchronize their normal I/O activities with their
487disconnect method. Now if the driver supports autosuspend then it
488must call usb_autopm_put_interface() from somewhere -- maybe from its
489close method. It should make the call while holding the private mutex,
490since a driver shouldn't call any of the usb_autopm_* functions for an
491interface from which it has been unbound.
492
493But the usb_autpm_* routines always acquire the device's PM mutex, and
494consequently the locking order has to be: private mutex first, PM
495mutex second. Since the suspend method is always called with the PM
496mutex held, it mustn't try to acquire the private mutex. It has to
497synchronize with the driver's I/O activities in some other way.
498 460
499 461
500 Interaction between dynamic PM and system PM 462 Interaction between dynamic PM and system PM
@@ -503,22 +465,11 @@ synchronize with the driver's I/O activities in some other way.
503Dynamic power management and system power management can interact in 465Dynamic power management and system power management can interact in
504a couple of ways. 466a couple of ways.
505 467
506Firstly, a device may already be manually suspended or autosuspended 468Firstly, a device may already be autosuspended when a system suspend
507when a system suspend occurs. Since system suspends are supposed to 469occurs. Since system suspends are supposed to be as transparent as
508be as transparent as possible, the device should remain suspended 470possible, the device should remain suspended following the system
509following the system resume. The 2.6.23 kernel obeys this principle 471resume. But this theory may not work out well in practice; over time
510for manually suspended devices but not for autosuspended devices; they 472the kernel's behavior in this regard has changed.
511do get resumed when the system wakes up. (Presumably they will be
512autosuspended again after their idle-delay time expires.) In later
513kernels this behavior will be fixed.
514
515(There is an exception. If a device would undergo a reset-resume
516instead of a normal resume, and the device is enabled for remote
517wakeup, then the reset-resume takes place even if the device was
518already suspended when the system suspend began. The justification is
519that a reset-resume is a kind of remote-wakeup event. Or to put it
520another way, a device which needs a reset won't be able to generate
521normal remote-wakeup signals, so it ought to be resumed immediately.)
522 473
523Secondly, a dynamic power-management event may occur as a system 474Secondly, a dynamic power-management event may occur as a system
524suspend is underway. The window for this is short, since system 475suspend is underway. The window for this is short, since system
@@ -530,13 +481,3 @@ succeed, it may still remain active and thus cause the system to
530resume as soon as the system suspend is complete. Or the remote 481resume as soon as the system suspend is complete. Or the remote
531wakeup may fail and get lost. Which outcome occurs depends on timing 482wakeup may fail and get lost. Which outcome occurs depends on timing
532and on the hardware and firmware design. 483and on the hardware and firmware design.
533
534More interestingly, a device might undergo a manual resume or
535autoresume during system suspend. With current kernels this shouldn't
536happen, because manual resumes must be initiated by userspace and
537autoresumes happen in response to I/O requests, but all user processes
538and I/O should be quiescent during a system suspend -- thanks to the
539freezer. However there are plans to do away with the freezer, which
540would mean these things would become possible. If and when this comes
541about, the USB core will carefully arrange matters so that either type
542of resume will block until the entire system has resumed.
diff --git a/Documentation/vgaarbiter.txt b/Documentation/vgaarbiter.txt
index 987f9b0a5ece..43a9b0694fdd 100644
--- a/Documentation/vgaarbiter.txt
+++ b/Documentation/vgaarbiter.txt
@@ -103,7 +103,7 @@ I.2 libpciaccess
103---------------- 103----------------
104 104
105To use the vga arbiter char device it was implemented an API inside the 105To use the vga arbiter char device it was implemented an API inside the
106libpciaccess library. One fieldd was added to struct pci_device (each device 106libpciaccess library. One field was added to struct pci_device (each device
107on the system): 107on the system):
108 108
109 /* the type of resource decoded by the device */ 109 /* the type of resource decoded by the device */
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index 5f33d8486102..16ca030e1185 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -24,3 +24,6 @@
24 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657] 24 23 -> Magic-Pro ProHDTV Extreme 2 [14f1:8657]
25 24 -> Hauppauge WinTV-HVR1850 [0070:8541] 25 24 -> Hauppauge WinTV-HVR1850 [0070:8541]
26 25 -> Compro VideoMate E800 [1858:e800] 26 25 -> Compro VideoMate E800 [1858:e800]
27 26 -> Hauppauge WinTV-HVR1290 [0070:8551]
28 27 -> Mygica X8558 PRO DMB-TH [14f1:8578]
29 28 -> LEADTEK WinFast PxTV1200 [107d:6f22]
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88
index 3385f8b094a5..7ec3c4e4b60f 100644
--- a/Documentation/video4linux/CARDLIST.cx88
+++ b/Documentation/video4linux/CARDLIST.cx88
@@ -81,3 +81,4 @@
81 80 -> Hauppauge WinTV-IR Only [0070:9290] 81 80 -> Hauppauge WinTV-IR Only [0070:9290]
82 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654] 82 81 -> Leadtek WinFast DTV1800 Hybrid [107d:6654]
83 82 -> WinFast DTV2000 H rev. J [107d:6f2b] 83 82 -> WinFast DTV2000 H rev. J [107d:6f2b]
84 83 -> Prof 7301 DVB-S/S2 [b034:3034]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index b8afef4c0e01..0c166ff003a0 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -1,5 +1,5 @@
1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800] 1 0 -> Unknown EM2800 video grabber (em2800) [eb1a:2800]
2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868] 2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2710,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2862,eb1a:2870,eb1a:2881,eb1a:2883,eb1a:2868]
3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036] 3 2 -> Terratec Cinergy 250 USB (em2820/em2840) [0ccd:0036]
4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208] 4 3 -> Pinnacle PCTV USB 2 (em2820/em2840) [2304:0208]
5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201] 5 4 -> Hauppauge WinTV USB 2 (em2820/em2840) [2040:4200,2040:4201]
@@ -69,3 +69,4 @@
69 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840) 69 71 -> Silvercrest Webcam 1.3mpix (em2820/em2840)
70 72 -> Gadmei UTV330+ (em2861) 70 72 -> Gadmei UTV330+ (em2861)
71 73 -> Reddo DVB-C USB TV Box (em2870) 71 73 -> Reddo DVB-C USB TV Box (em2870)
72 74 -> Actionmaster/LinXcel/Digitus VC211A (em2800)
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 2620d60341ee..b4a767060ed7 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -172,3 +172,6 @@
172171 -> Beholder BeholdTV X7 [5ace:7595] 172171 -> Beholder BeholdTV X7 [5ace:7595]
173172 -> RoverMedia TV Link Pro FM [19d1:0138] 173172 -> RoverMedia TV Link Pro FM [19d1:0138]
174173 -> Zolid Hybrid TV Tuner PCI [1131:2004] 174173 -> Zolid Hybrid TV Tuner PCI [1131:2004]
175174 -> Asus Europa Hybrid OEM [1043:4847]
176175 -> Leadtek Winfast DTV1000S [107d:6655]
177176 -> Beholder BeholdTV 505 RDS [0000:5051]
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner
index e0d298fe8830..9b2e0dd6017e 100644
--- a/Documentation/video4linux/CARDLIST.tuner
+++ b/Documentation/video4linux/CARDLIST.tuner
@@ -81,3 +81,4 @@ tuner=80 - Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
81tuner=81 - Partsnic (Daewoo) PTI-5NF05 81tuner=81 - Partsnic (Daewoo) PTI-5NF05
82tuner=82 - Philips CU1216L 82tuner=82 - Philips CU1216L
83tuner=83 - NXP TDA18271 83tuner=83 - NXP TDA18271
84tuner=84 - Sony BTF-Pxn01Z
diff --git a/Documentation/video4linux/README.tlg2300 b/Documentation/video4linux/README.tlg2300
new file mode 100644
index 000000000000..416ccb93d8c9
--- /dev/null
+++ b/Documentation/video4linux/README.tlg2300
@@ -0,0 +1,47 @@
1tlg2300 release notes
2====================
3
4This is a v4l2/dvb device driver for the tlg2300 chip.
5
6
7current status
8==============
9
10video
11 - support mmap and read().(no overlay)
12
13audio
14 - The driver will register a ALSA card for the audio input.
15
16vbi
17 - Works for almost TV norms.
18
19dvb-t
20 - works for DVB-T
21
22FM
23 - Works for radio.
24
25---------------------------------------------------------------------------
26TESTED APPLICATIONS:
27
28-VLC1.0.4 test the video and dvb. The GUI is friendly to use.
29
30-Mplayer test the video.
31
32-Mplayer test the FM. The mplayer should be compiled with --enable-radio and
33 --enable-radio-capture.
34 The command runs as this(The alsa audio registers to card 1):
35 #mplayer radio://103.7/capture/ -radio adevice=hw=1,0:arate=48000 \
36 -rawaudio rate=48000:channels=2
37
38---------------------------------------------------------------------------
39KNOWN PROBLEMS:
40about preemphasis:
41 You can set the preemphasis for radio by the following command:
42 #v4l2-ctl -d /dev/radio0 --set-ctrl=pre_emphasis_settings=1
43
44 "pre_emphasis_settings=1" means that you select the 50us. If you want
45 to select the 75us, please use "pre_emphasis_settings=2"
46
47
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
index 3f61825be499..181b9e6fd984 100644
--- a/Documentation/video4linux/gspca.txt
+++ b/Documentation/video4linux/gspca.txt
@@ -6,11 +6,13 @@ The modules are:
6 6
7xxxx vend:prod 7xxxx vend:prod
8---- 8----
9spca501 0000:0000 MystFromOri Unknow Camera 9spca501 0000:0000 MystFromOri Unknown Camera
10spca508 0130:0130 Clone Digital Webcam 11043
10m5602 0402:5602 ALi Video Camera Controller 11m5602 0402:5602 ALi Video Camera Controller
11spca501 040a:0002 Kodak DVC-325 12spca501 040a:0002 Kodak DVC-325
12spca500 040a:0300 Kodak EZ200 13spca500 040a:0300 Kodak EZ200
13zc3xx 041e:041e Creative WebCam Live! 14zc3xx 041e:041e Creative WebCam Live!
15ov519 041e:4003 Video Blaster WebCam Go Plus
14spca500 041e:400a Creative PC-CAM 300 16spca500 041e:400a Creative PC-CAM 300
15sunplus 041e:400b Creative PC-CAM 600 17sunplus 041e:400b Creative PC-CAM 600
16sunplus 041e:4012 PC-Cam350 18sunplus 041e:4012 PC-Cam350
@@ -37,8 +39,10 @@ ov519 041e:405f Creative Live! VISTA VF0330
37ov519 041e:4060 Creative Live! VISTA VF0350 39ov519 041e:4060 Creative Live! VISTA VF0350
38ov519 041e:4061 Creative Live! VISTA VF0400 40ov519 041e:4061 Creative Live! VISTA VF0400
39ov519 041e:4064 Creative Live! VISTA VF0420 41ov519 041e:4064 Creative Live! VISTA VF0420
42ov519 041e:4067 Creative Live! Cam Video IM (VF0350)
40ov519 041e:4068 Creative Live! VISTA VF0470 43ov519 041e:4068 Creative Live! VISTA VF0470
41spca561 0458:7004 Genius VideoCAM Express V2 44spca561 0458:7004 Genius VideoCAM Express V2
45sn9c2028 0458:7005 Genius Smart 300, version 2
42sunplus 0458:7006 Genius Dsc 1.3 Smart 46sunplus 0458:7006 Genius Dsc 1.3 Smart
43zc3xx 0458:7007 Genius VideoCam V2 47zc3xx 0458:7007 Genius VideoCam V2
44zc3xx 0458:700c Genius VideoCam V3 48zc3xx 0458:700c Genius VideoCam V3
@@ -68,12 +72,12 @@ zc3xx 046d:08a3 Logitech QC Chat
68zc3xx 046d:08a6 Logitech QCim 72zc3xx 046d:08a6 Logitech QCim
69zc3xx 046d:08a7 Logitech QuickCam Image 73zc3xx 046d:08a7 Logitech QuickCam Image
70zc3xx 046d:08a9 Logitech Notebook Deluxe 74zc3xx 046d:08a9 Logitech Notebook Deluxe
71zc3xx 046d:08aa Labtec Webcam Notebook 75zc3xx 046d:08aa Labtec Webcam Notebook
72zc3xx 046d:08ac Logitech QuickCam Cool 76zc3xx 046d:08ac Logitech QuickCam Cool
73zc3xx 046d:08ad Logitech QCCommunicate STX 77zc3xx 046d:08ad Logitech QCCommunicate STX
74zc3xx 046d:08ae Logitech QuickCam for Notebooks 78zc3xx 046d:08ae Logitech QuickCam for Notebooks
75zc3xx 046d:08af Logitech QuickCam Cool 79zc3xx 046d:08af Logitech QuickCam Cool
76zc3xx 046d:08b9 Logitech QC IM ??? 80zc3xx 046d:08b9 Logitech QuickCam Express
77zc3xx 046d:08d7 Logitech QCam STX 81zc3xx 046d:08d7 Logitech QCam STX
78zc3xx 046d:08d9 Logitech QuickCam IM/Connect 82zc3xx 046d:08d9 Logitech QuickCam IM/Connect
79zc3xx 046d:08d8 Logitech Notebook Deluxe 83zc3xx 046d:08d8 Logitech Notebook Deluxe
@@ -82,7 +86,7 @@ zc3xx 046d:08dd Logitech QuickCam for Notebooks
82spca500 046d:0900 Logitech Inc. ClickSmart 310 86spca500 046d:0900 Logitech Inc. ClickSmart 310
83spca500 046d:0901 Logitech Inc. ClickSmart 510 87spca500 046d:0901 Logitech Inc. ClickSmart 510
84sunplus 046d:0905 Logitech ClickSmart 820 88sunplus 046d:0905 Logitech ClickSmart 820
85tv8532 046d:0920 QC Express 89tv8532 046d:0920 Logitech QuickCam Express
86tv8532 046d:0921 Labtec Webcam 90tv8532 046d:0921 Labtec Webcam
87spca561 046d:0928 Logitech QC Express Etch2 91spca561 046d:0928 Logitech QC Express Etch2
88spca561 046d:0929 Labtec Webcam Elch2 92spca561 046d:0929 Labtec Webcam Elch2
@@ -91,7 +95,7 @@ spca561 046d:092b Labtec Webcam Plus
91spca561 046d:092c Logitech QC chat Elch2 95spca561 046d:092c Logitech QC chat Elch2
92spca561 046d:092d Logitech QC Elch2 96spca561 046d:092d Logitech QC Elch2
93spca561 046d:092e Logitech QC Elch2 97spca561 046d:092e Logitech QC Elch2
94spca561 046d:092f Logitech QuickCam Express Plus 98spca561 046d:092f Logitech QuickCam Express Plus
95sunplus 046d:0960 Logitech ClickSmart 420 99sunplus 046d:0960 Logitech ClickSmart 420
96sunplus 0471:0322 Philips DMVC1300K 100sunplus 0471:0322 Philips DMVC1300K
97zc3xx 0471:0325 Philips SPC 200 NC 101zc3xx 0471:0325 Philips SPC 200 NC
@@ -106,6 +110,7 @@ sunplus 04a5:3003 Benq DC 1300
106sunplus 04a5:3008 Benq DC 1500 110sunplus 04a5:3008 Benq DC 1500
107sunplus 04a5:300a Benq DC 3410 111sunplus 04a5:300a Benq DC 3410
108spca500 04a5:300c Benq DC 1016 112spca500 04a5:300c Benq DC 1016
113benq 04a5:3035 Benq DC E300
109finepix 04cb:0104 Fujifilm FinePix 4800 114finepix 04cb:0104 Fujifilm FinePix 4800
110finepix 04cb:0109 Fujifilm FinePix A202 115finepix 04cb:0109 Fujifilm FinePix A202
111finepix 04cb:010b Fujifilm FinePix A203 116finepix 04cb:010b Fujifilm FinePix A203
@@ -139,6 +144,7 @@ sunplus 04fc:5360 Sunplus Generic
139spca500 04fc:7333 PalmPixDC85 144spca500 04fc:7333 PalmPixDC85
140sunplus 04fc:ffff Pure DigitalDakota 145sunplus 04fc:ffff Pure DigitalDakota
141spca501 0506:00df 3Com HomeConnect Lite 146spca501 0506:00df 3Com HomeConnect Lite
147sunplus 052b:1507 Megapixel 5 Pretec DC-1007
142sunplus 052b:1513 Megapix V4 148sunplus 052b:1513 Megapix V4
143sunplus 052b:1803 MegaImage VI 149sunplus 052b:1803 MegaImage VI
144tv8532 0545:808b Veo Stingray 150tv8532 0545:808b Veo Stingray
@@ -148,6 +154,7 @@ sunplus 0546:3191 Polaroid Ion 80
148sunplus 0546:3273 Polaroid PDC2030 154sunplus 0546:3273 Polaroid PDC2030
149ov519 054c:0154 Sonny toy4 155ov519 054c:0154 Sonny toy4
150ov519 054c:0155 Sonny toy5 156ov519 054c:0155 Sonny toy5
157cpia1 0553:0002 CPIA CPiA (version1) based cameras
151zc3xx 055f:c005 Mustek Wcam300A 158zc3xx 055f:c005 Mustek Wcam300A
152spca500 055f:c200 Mustek Gsmart 300 159spca500 055f:c200 Mustek Gsmart 300
153sunplus 055f:c211 Kowa Bs888e Microcamera 160sunplus 055f:c211 Kowa Bs888e Microcamera
@@ -166,10 +173,14 @@ sunplus 055f:c650 Mustek MDC5500Z
166zc3xx 055f:d003 Mustek WCam300A 173zc3xx 055f:d003 Mustek WCam300A
167zc3xx 055f:d004 Mustek WCam300 AN 174zc3xx 055f:d004 Mustek WCam300 AN
168conex 0572:0041 Creative Notebook cx11646 175conex 0572:0041 Creative Notebook cx11646
176ov519 05a9:0511 Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Camera
177ov519 05a9:0518 Creative WebCam
169ov519 05a9:0519 OV519 Microphone 178ov519 05a9:0519 OV519 Microphone
170ov519 05a9:0530 OmniVision 179ov519 05a9:0530 OmniVision
180ov519 05a9:2800 OmniVision SuperCAM
171ov519 05a9:4519 Webcam Classic 181ov519 05a9:4519 Webcam Classic
172ov519 05a9:8519 OmniVision 182ov519 05a9:8519 OmniVision
183ov519 05a9:a511 D-Link USB Digital Video Camera
173ov519 05a9:a518 D-Link DSB-C310 Webcam 184ov519 05a9:a518 D-Link DSB-C310 Webcam
174sunplus 05da:1018 Digital Dream Enigma 1.3 185sunplus 05da:1018 Digital Dream Enigma 1.3
175stk014 05e1:0893 Syntek DV4000 186stk014 05e1:0893 Syntek DV4000
@@ -181,13 +192,11 @@ spca500 06bd:0404 Agfa CL20
181spca500 06be:0800 Optimedia 192spca500 06be:0800 Optimedia
182sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom 193sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
183spca506 06e1:a190 ADS Instant VCD 194spca506 06e1:a190 ADS Instant VCD
184ov534 06f8:3002 Hercules Blog Webcam 195ov534_9 06f8:3003 Hercules Dualpix HD Weblog
185ov534 06f8:3003 Hercules Dualpix HD Weblog
186sonixj 06f8:3004 Hercules Classic Silver 196sonixj 06f8:3004 Hercules Classic Silver
187sonixj 06f8:3008 Hercules Deluxe Optical Glass 197sonixj 06f8:3008 Hercules Deluxe Optical Glass
188pac7311 06f8:3009 Hercules Classic Link 198pac7302 06f8:3009 Hercules Classic Link
189spca508 0733:0110 ViewQuest VQ110 199spca508 0733:0110 ViewQuest VQ110
190spca508 0130:0130 Clone Digital Webcam 11043
191spca501 0733:0401 Intel Create and Share 200spca501 0733:0401 Intel Create and Share
192spca501 0733:0402 ViewQuest M318B 201spca501 0733:0402 ViewQuest M318B
193spca505 0733:0430 Intel PC Camera Pro 202spca505 0733:0430 Intel PC Camera Pro
@@ -198,10 +207,13 @@ sunplus 0733:2221 Mercury Digital Pro 3.1p
198sunplus 0733:3261 Concord 3045 spca536a 207sunplus 0733:3261 Concord 3045 spca536a
199sunplus 0733:3281 Cyberpix S550V 208sunplus 0733:3281 Cyberpix S550V
200spca506 0734:043b 3DeMon USB Capture aka 209spca506 0734:043b 3DeMon USB Capture aka
210cpia1 0813:0001 QX3 camera
211ov519 0813:0002 Dual Mode USB Camera Plus
201spca500 084d:0003 D-Link DSC-350 212spca500 084d:0003 D-Link DSC-350
202spca500 08ca:0103 Aiptek PocketDV 213spca500 08ca:0103 Aiptek PocketDV
203sunplus 08ca:0104 Aiptek PocketDVII 1.3 214sunplus 08ca:0104 Aiptek PocketDVII 1.3
204sunplus 08ca:0106 Aiptek Pocket DV3100+ 215sunplus 08ca:0106 Aiptek Pocket DV3100+
216mr97310a 08ca:0110 Trust Spyc@m 100
205mr97310a 08ca:0111 Aiptek PenCam VGA+ 217mr97310a 08ca:0111 Aiptek PenCam VGA+
206sunplus 08ca:2008 Aiptek Mini PenCam 2 M 218sunplus 08ca:2008 Aiptek Mini PenCam 2 M
207sunplus 08ca:2010 Aiptek PocketCam 3M 219sunplus 08ca:2010 Aiptek PocketCam 3M
@@ -217,12 +229,13 @@ sunplus 08ca:2050 Medion MD 41437
217sunplus 08ca:2060 Aiptek PocketDV5300 229sunplus 08ca:2060 Aiptek PocketDV5300
218tv8532 0923:010f ICM532 cams 230tv8532 0923:010f ICM532 cams
219mars 093a:050f Mars-Semi Pc-Camera 231mars 093a:050f Mars-Semi Pc-Camera
220mr97310a 093a:010f Sakar Digital no. 77379 232mr97310a 093a:010e All known CIF cams with this ID
233mr97310a 093a:010f All known VGA cams with this ID
221pac207 093a:2460 Qtec Webcam 100 234pac207 093a:2460 Qtec Webcam 100
222pac207 093a:2461 HP Webcam 235pac207 093a:2461 HP Webcam
223pac207 093a:2463 Philips SPC 220 NC 236pac207 093a:2463 Philips SPC 220 NC
224pac207 093a:2464 Labtec Webcam 1200 237pac207 093a:2464 Labtec Webcam 1200
225pac207 093a:2468 PAC207 238pac207 093a:2468 Webcam WB-1400T
226pac207 093a:2470 Genius GF112 239pac207 093a:2470 Genius GF112
227pac207 093a:2471 Genius VideoCam ge111 240pac207 093a:2471 Genius VideoCam ge111
228pac207 093a:2472 Genius VideoCam ge110 241pac207 093a:2472 Genius VideoCam ge110
@@ -230,18 +243,19 @@ pac207 093a:2474 Genius iLook 111
230pac207 093a:2476 Genius e-Messenger 112 243pac207 093a:2476 Genius e-Messenger 112
231pac7311 093a:2600 PAC7311 Typhoon 244pac7311 093a:2600 PAC7311 Typhoon
232pac7311 093a:2601 Philips SPC 610 NC 245pac7311 093a:2601 Philips SPC 610 NC
233pac7311 093a:2603 PAC7312 246pac7311 093a:2603 Philips SPC 500 NC
234pac7311 093a:2608 Trust WB-3300p 247pac7311 093a:2608 Trust WB-3300p
235pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 248pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
236pac7311 093a:260f SnakeCam 249pac7311 093a:260f SnakeCam
237pac7311 093a:2620 Apollo AC-905 250pac7302 093a:2620 Apollo AC-905
238pac7311 093a:2621 PAC731x 251pac7302 093a:2621 PAC731x
239pac7311 093a:2622 Genius Eye 312 252pac7302 093a:2622 Genius Eye 312
240pac7311 093a:2624 PAC7302 253pac7302 093a:2624 PAC7302
241pac7311 093a:2626 Labtec 2200 254pac7302 093a:2626 Labtec 2200
242pac7311 093a:2629 Genious iSlim 300 255pac7302 093a:2628 Genius iLook 300
243pac7311 093a:262a Webcam 300k 256pac7302 093a:2629 Genious iSlim 300
244pac7311 093a:262c Philips SPC 230 NC 257pac7302 093a:262a Webcam 300k
258pac7302 093a:262c Philips SPC 230 NC
245jeilinj 0979:0280 Sakar 57379 259jeilinj 0979:0280 Sakar 57379
246zc3xx 0ac8:0302 Z-star Vimicro zc0302 260zc3xx 0ac8:0302 Z-star Vimicro zc0302
247vc032x 0ac8:0321 Vimicro generic vc0321 261vc032x 0ac8:0321 Vimicro generic vc0321
@@ -250,12 +264,13 @@ vc032x 0ac8:0328 A4Tech PK-130MG
250zc3xx 0ac8:301b Z-Star zc301b 264zc3xx 0ac8:301b Z-Star zc301b
251zc3xx 0ac8:303b Vimicro 0x303b 265zc3xx 0ac8:303b Vimicro 0x303b
252zc3xx 0ac8:305b Z-star Vimicro zc0305b 266zc3xx 0ac8:305b Z-star Vimicro zc0305b
253zc3xx 0ac8:307b Ldlc VC302+Ov7620 267zc3xx 0ac8:307b PC Camera (ZS0211)
254vc032x 0ac8:c001 Sony embedded vimicro 268vc032x 0ac8:c001 Sony embedded vimicro
255vc032x 0ac8:c002 Sony embedded vimicro 269vc032x 0ac8:c002 Sony embedded vimicro
256vc032x 0ac8:c301 Samsung Q1 Ultra Premium 270vc032x 0ac8:c301 Samsung Q1 Ultra Premium
257spca508 0af9:0010 Hama USB Sightcam 100 271spca508 0af9:0010 Hama USB Sightcam 100
258spca508 0af9:0011 Hama USB Sightcam 100 272spca508 0af9:0011 Hama USB Sightcam 100
273ov519 0b62:0059 iBOT2 Webcam
259sonixb 0c45:6001 Genius VideoCAM NB 274sonixb 0c45:6001 Genius VideoCAM NB
260sonixb 0c45:6005 Microdia Sweex Mini Webcam 275sonixb 0c45:6005 Microdia Sweex Mini Webcam
261sonixb 0c45:6007 Sonix sn9c101 + Tas5110D 276sonixb 0c45:6007 Sonix sn9c101 + Tas5110D
@@ -292,6 +307,7 @@ sonixj 0c45:613b Surfer SN-206
292sonixj 0c45:613c Sonix Pccam168 307sonixj 0c45:613c Sonix Pccam168
293sonixj 0c45:6143 Sonix Pccam168 308sonixj 0c45:6143 Sonix Pccam168
294sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia 309sonixj 0c45:6148 Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia
310sonixj 0c45:614a Frontech E-Ccam (JIL-2225)
295sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) 311sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001)
296sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) 312sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111)
297sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) 313sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655)
@@ -314,9 +330,15 @@ sn9c20x 0c45:62b0 PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112)
314sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655) 330sn9c20x 0c45:62b3 PC Camera (SN9C202 + OV9655)
315sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660) 331sn9c20x 0c45:62bb PC Camera (SN9C202 + OV7660)
316sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R) 332sn9c20x 0c45:62bc PC Camera (SN9C202 + HV7131R)
333sn9c2028 0c45:8001 Wild Planet Digital Spy Camera
334sn9c2028 0c45:8003 Sakar #11199, #6637x, #67480 keychain cams
335sn9c2028 0c45:8008 Mini-Shotz ms-350
336sn9c2028 0c45:800a Vivitar Vivicam 3350B
317sunplus 0d64:0303 Sunplus FashionCam DXG 337sunplus 0d64:0303 Sunplus FashionCam DXG
338ov519 0e96:c001 TRUST 380 USB2 SPACEC@M
318etoms 102c:6151 Qcam Sangha CIF 339etoms 102c:6151 Qcam Sangha CIF
319etoms 102c:6251 Qcam xxxxxx VGA 340etoms 102c:6251 Qcam xxxxxx VGA
341ov519 1046:9967 W9967CF/W9968CF WebCam IC, Video Blaster WebCam Go
320zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 342zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
321spca561 10fd:7e50 FlyCam Usb 100 343spca561 10fd:7e50 FlyCam Usb 100
322zc3xx 10fd:8050 Typhoon Webshot II USB 300k 344zc3xx 10fd:8050 Typhoon Webshot II USB 300k
@@ -329,7 +351,13 @@ spca501 1776:501c Arowana 300K CMOS Camera
329t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops 351t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
330vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC 352vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
331pac207 2001:f115 D-Link DSB-C120 353pac207 2001:f115 D-Link DSB-C120
354sq905c 2770:9050 Disney pix micro (CIF)
355sq905c 2770:9052 Disney pix micro 2 (VGA)
356sq905c 2770:905c All 11 known cameras with this ID
357sq905 2770:9120 All 24 known cameras with this ID
358sq905c 2770:913d All 4 known cameras with this ID
332spca500 2899:012c Toptro Industrial 359spca500 2899:012c Toptro Industrial
360ov519 8020:ef04 ov519
333spca508 8086:0110 Intel Easy PC Camera 361spca508 8086:0110 Intel Easy PC Camera
334spca500 8086:0630 Intel Pocket PC Camera 362spca500 8086:0630 Intel Pocket PC Camera
335spca506 99fa:8988 Grandtec V.cap 363spca506 99fa:8988 Grandtec V.cap
diff --git a/Documentation/video4linux/sh_mobile_ceu_camera.txt b/Documentation/video4linux/sh_mobile_ceu_camera.txt
new file mode 100644
index 000000000000..2ae16349a78d
--- /dev/null
+++ b/Documentation/video4linux/sh_mobile_ceu_camera.txt
@@ -0,0 +1,157 @@
1 Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
2 =======================================================================
3
4Terminology
5-----------
6
7sensor scales: horizontal and vertical scales, configured by the sensor driver
8host scales: -"- host driver
9combined scales: sensor_scale * host_scale
10
11
12Generic scaling / cropping scheme
13---------------------------------
14
15-1--
16|
17-2-- -\
18| --\
19| --\
20+-5-- -\ -- -3--
21| ---\
22| --- -4-- -\
23| -\
24| - -6--
25|
26| - -6'-
27| -/
28| --- -4'- -/
29| ---/
30+-5'- -/
31| -- -3'-
32| --/
33| --/
34-2'- -/
35|
36|
37-1'-
38
39Produced by user requests:
40
41S_CROP(left / top = (5) - (1), width / height = (5') - (5))
42S_FMT(width / height = (6') - (6))
43
44Here:
45
46(1) to (1') - whole max width or height
47(1) to (2) - sensor cropped left or top
48(2) to (2') - sensor cropped width or height
49(3) to (3') - sensor scale
50(3) to (4) - CEU cropped left or top
51(4) to (4') - CEU cropped width or height
52(5) to (5') - reverse sensor scale applied to CEU cropped width or height
53(2) to (5) - reverse sensor scale applied to CEU cropped left or top
54(6) to (6') - CEU scale - user window
55
56
57S_FMT
58-----
59
60Do not touch input rectangle - it is already optimal.
61
621. Calculate current sensor scales:
63
64 scale_s = ((3') - (3)) / ((2') - (2))
65
662. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
67current sensor scales onto input window - this is user S_CROP:
68
69 width_u = (5') - (5) = ((4') - (4)) * scale_s
70
713. Calculate new combined scales from "effective" input window to requested user
72window:
73
74 scale_comb = width_u / ((6') - (6))
75
764. Calculate sensor output window by applying combined scales to real input
77window:
78
79 width_s_out = ((2') - (2)) / scale_comb
80
815. Apply iterative sensor S_FMT for sensor output window.
82
83 subdev->video_ops->s_fmt(.width = width_s_out)
84
856. Retrieve sensor output window (g_fmt)
86
877. Calculate new sensor scales:
88
89 scale_s_new = ((3')_new - (3)_new) / ((2') - (2))
90
918. Calculate new CEU crop - apply sensor scales to previously calculated
92"effective" crop:
93
94 width_ceu = (4')_new - (4)_new = width_u / scale_s_new
95 left_ceu = (4)_new - (3)_new = ((5) - (2)) / scale_s_new
96
979. Use CEU cropping to crop to the new window:
98
99 ceu_crop(.width = width_ceu, .left = left_ceu)
100
10110. Use CEU scaling to scale to the requested user window:
102
103 scale_ceu = width_ceu / width
104
105
106S_CROP
107------
108
109If old scale applied to new crop is invalid produce nearest new scale possible
110
1111. Calculate current combined scales.
112
113 scale_comb = (((4') - (4)) / ((6') - (6))) * (((2') - (2)) / ((3') - (3)))
114
1152. Apply iterative sensor S_CROP for new input window.
116
1173. If old combined scales applied to new crop produce an impossible user window,
118adjust scales to produce nearest possible window.
119
120 width_u_out = ((5') - (5)) / scale_comb
121
122 if (width_u_out > max)
123 scale_comb = ((5') - (5)) / max;
124 else if (width_u_out < min)
125 scale_comb = ((5') - (5)) / min;
126
1274. Issue G_CROP to retrieve actual input window.
128
1295. Using actual input window and calculated combined scales calculate sensor
130target output window.
131
132 width_s_out = ((3') - (3)) = ((2') - (2)) / scale_comb
133
1346. Apply iterative S_FMT for new sensor target output window.
135
1367. Issue G_FMT to retrieve the actual sensor output window.
137
1388. Calculate sensor scales.
139
140 scale_s = ((3') - (3)) / ((2') - (2))
141
1429. Calculate sensor output subwindow to be cropped on CEU by applying sensor
143scales to the requested window.
144
145 width_ceu = ((5') - (5)) / scale_s
146
14710. Use CEU cropping for above calculated window.
148
14911. Calculate CEU scales from sensor scales from results of (10) and user window
150from (3)
151
152 scale_ceu = calc_scale(((5') - (5)), &width_u_out)
153
15412. Apply CEU scales.
155
156--
157Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
diff --git a/Documentation/video4linux/si4713.txt b/Documentation/video4linux/si4713.txt
index 25abdb78209d..2e7392a4fee1 100644
--- a/Documentation/video4linux/si4713.txt
+++ b/Documentation/video4linux/si4713.txt
@@ -164,7 +164,7 @@ Stereo/Mono and RDS subchannels
164 164
165The device can also be configured using the available sub channels for 165The device can also be configured using the available sub channels for
166transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly. 166transmission. To do that use S/G_MODULATOR ioctl and configure txsubchans properly.
167Refer to v4l2-spec for proper use of this ioctl. 167Refer to the V4L2 API specification for proper use of this ioctl.
168 168
169Testing 169Testing
170======= 170=======
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index b806edaf3e75..5155700c206b 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -561,6 +561,8 @@ video_device helper functions
561 561
562There are a few useful helper functions: 562There are a few useful helper functions:
563 563
564- file/video_device private data
565
564You can set/get driver private data in the video_device struct using: 566You can set/get driver private data in the video_device struct using:
565 567
566void *video_get_drvdata(struct video_device *vdev); 568void *video_get_drvdata(struct video_device *vdev);
@@ -575,8 +577,7 @@ struct video_device *video_devdata(struct file *file);
575 577
576returns the video_device belonging to the file struct. 578returns the video_device belonging to the file struct.
577 579
578The final helper function combines video_get_drvdata with 580The video_drvdata function combines video_get_drvdata with video_devdata:
579video_devdata:
580 581
581void *video_drvdata(struct file *file); 582void *video_drvdata(struct file *file);
582 583
@@ -584,102 +585,27 @@ You can go from a video_device struct to the v4l2_device struct using:
584 585
585struct v4l2_device *v4l2_dev = vdev->v4l2_dev; 586struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
586 587
588- Device node name
589
590The video_device node kernel name can be retrieved using
591
592const char *video_device_node_name(struct video_device *vdev);
593
594The name is used as a hint by userspace tools such as udev. The function
595should be used where possible instead of accessing the video_device::num and
596video_device::minor fields.
597
598
587video buffer helper functions 599video buffer helper functions
588----------------------------- 600-----------------------------
589 601
590The v4l2 core API provides a standard method for dealing with video 602The v4l2 core API provides a set of standard methods (called "videobuf")
591buffers. Those methods allow a driver to implement read(), mmap() and 603for dealing with video buffers. Those methods allow a driver to implement
592overlay() on a consistent way. 604read(), mmap() and overlay() in a consistent way. There are currently
593 605methods for using video buffers on devices that supports DMA with
594There are currently methods for using video buffers on devices that 606scatter/gather method (videobuf-dma-sg), DMA with linear access
595supports DMA with scatter/gather method (videobuf-dma-sg), DMA with 607(videobuf-dma-contig), and vmalloced buffers, mostly used on USB drivers
596linear access (videobuf-dma-contig), and vmalloced buffers, mostly 608(videobuf-vmalloc).
597used on USB drivers (videobuf-vmalloc). 609
598 610Please see Documentation/video4linux/videobuf for more information on how
599Any driver using videobuf should provide operations (callbacks) for 611to use the videobuf layer.
600four handlers:
601
602ops->buf_setup - calculates the size of the video buffers and avoid they
603 to waste more than some maximum limit of RAM;
604ops->buf_prepare - fills the video buffer structs and calls
605 videobuf_iolock() to alloc and prepare mmaped memory;
606ops->buf_queue - advices the driver that another buffer were
607 requested (by read() or by QBUF);
608ops->buf_release - frees any buffer that were allocated.
609
610In order to use it, the driver need to have a code (generally called at
611interrupt context) that will properly handle the buffer request lists,
612announcing that a new buffer were filled.
613
614The irq handling code should handle the videobuf task lists, in order
615to advice videobuf that a new frame were filled, in order to honor to a
616request. The code is generally like this one:
617 if (list_empty(&dma_q->active))
618 return;
619
620 buf = list_entry(dma_q->active.next, struct vbuffer, vb.queue);
621
622 if (!waitqueue_active(&buf->vb.done))
623 return;
624
625 /* Some logic to handle the buf may be needed here */
626
627 list_del(&buf->vb.queue);
628 do_gettimeofday(&buf->vb.ts);
629 wake_up(&buf->vb.done);
630
631Those are the videobuffer functions used on drivers, implemented on
632videobuf-core:
633
634- Videobuf init functions
635 videobuf_queue_sg_init()
636 Initializes the videobuf infrastructure. This function should be
637 called before any other videobuf function on drivers that uses DMA
638 Scatter/Gather buffers.
639
640 videobuf_queue_dma_contig_init
641 Initializes the videobuf infrastructure. This function should be
642 called before any other videobuf function on drivers that need DMA
643 contiguous buffers.
644
645 videobuf_queue_vmalloc_init()
646 Initializes the videobuf infrastructure. This function should be
647 called before any other videobuf function on USB (and other drivers)
648 that need a vmalloced type of videobuf.
649
650- videobuf_iolock()
651 Prepares the videobuf memory for the proper method (read, mmap, overlay).
652
653- videobuf_queue_is_busy()
654 Checks if a videobuf is streaming.
655
656- videobuf_queue_cancel()
657 Stops video handling.
658
659- videobuf_mmap_free()
660 frees mmap buffers.
661
662- videobuf_stop()
663 Stops video handling, ends mmap and frees mmap and other buffers.
664
665- V4L2 api functions. Those functions correspond to VIDIOC_foo ioctls:
666 videobuf_reqbufs(), videobuf_querybuf(), videobuf_qbuf(),
667 videobuf_dqbuf(), videobuf_streamon(), videobuf_streamoff().
668
669- V4L1 api function (corresponds to VIDIOCMBUF ioctl):
670 videobuf_cgmbuf()
671 This function is used to provide backward compatibility with V4L1
672 API.
673
674- Some help functions for read()/poll() operations:
675 videobuf_read_stream()
676 For continuous stream read()
677 videobuf_read_one()
678 For snapshot read()
679 videobuf_poll_stream()
680 polling help function
681
682The better way to understand it is to take a look at vivi driver. One
683of the main reasons for vivi is to be a videobuf usage example. the
684vivi_thread_tick() does the task that the IRQ callback would do on PCI
685drivers (or the irq callback on USB).
diff --git a/Documentation/video4linux/videobuf b/Documentation/video4linux/videobuf
new file mode 100644
index 000000000000..17a1f9abf260
--- /dev/null
+++ b/Documentation/video4linux/videobuf
@@ -0,0 +1,360 @@
1An introduction to the videobuf layer
2Jonathan Corbet <corbet@lwn.net>
3Current as of 2.6.33
4
5The videobuf layer functions as a sort of glue layer between a V4L2 driver
6and user space. It handles the allocation and management of buffers for
7the storage of video frames. There is a set of functions which can be used
8to implement many of the standard POSIX I/O system calls, including read(),
9poll(), and, happily, mmap(). Another set of functions can be used to
10implement the bulk of the V4L2 ioctl() calls related to streaming I/O,
11including buffer allocation, queueing and dequeueing, and streaming
12control. Using videobuf imposes a few design decisions on the driver
13author, but the payback comes in the form of reduced code in the driver and
14a consistent implementation of the V4L2 user-space API.
15
16Buffer types
17
18Not all video devices use the same kind of buffers. In fact, there are (at
19least) three common variations:
20
21 - Buffers which are scattered in both the physical and (kernel) virtual
22 address spaces. (Almost) all user-space buffers are like this, but it
23 makes great sense to allocate kernel-space buffers this way as well when
24 it is possible. Unfortunately, it is not always possible; working with
25 this kind of buffer normally requires hardware which can do
26 scatter/gather DMA operations.
27
28 - Buffers which are physically scattered, but which are virtually
29 contiguous; buffers allocated with vmalloc(), in other words. These
30 buffers are just as hard to use for DMA operations, but they can be
31 useful in situations where DMA is not available but virtually-contiguous
32 buffers are convenient.
33
34 - Buffers which are physically contiguous. Allocation of this kind of
35 buffer can be unreliable on fragmented systems, but simpler DMA
36 controllers cannot deal with anything else.
37
38Videobuf can work with all three types of buffers, but the driver author
39must pick one at the outset and design the driver around that decision.
40
41[It's worth noting that there's a fourth kind of buffer: "overlay" buffers
42which are located within the system's video memory. The overlay
43functionality is considered to be deprecated for most use, but it still
44shows up occasionally in system-on-chip drivers where the performance
45benefits merit the use of this technique. Overlay buffers can be handled
46as a form of scattered buffer, but there are very few implementations in
47the kernel and a description of this technique is currently beyond the
48scope of this document.]
49
50Data structures, callbacks, and initialization
51
52Depending on which type of buffers are being used, the driver should
53include one of the following files:
54
55 <media/videobuf-dma-sg.h> /* Physically scattered */
56 <media/videobuf-vmalloc.h> /* vmalloc() buffers */
57 <media/videobuf-dma-contig.h> /* Physically contiguous */
58
59The driver's data structure describing a V4L2 device should include a
60struct videobuf_queue instance for the management of the buffer queue,
61along with a list_head for the queue of available buffers. There will also
62need to be an interrupt-safe spinlock which is used to protect (at least)
63the queue.
64
65The next step is to write four simple callbacks to help videobuf deal with
66the management of buffers:
67
68 struct videobuf_queue_ops {
69 int (*buf_setup)(struct videobuf_queue *q,
70 unsigned int *count, unsigned int *size);
71 int (*buf_prepare)(struct videobuf_queue *q,
72 struct videobuf_buffer *vb,
73 enum v4l2_field field);
74 void (*buf_queue)(struct videobuf_queue *q,
75 struct videobuf_buffer *vb);
76 void (*buf_release)(struct videobuf_queue *q,
77 struct videobuf_buffer *vb);
78 };
79
80buf_setup() is called early in the I/O process, when streaming is being
81initiated; its purpose is to tell videobuf about the I/O stream. The count
82parameter will be a suggested number of buffers to use; the driver should
83check it for rationality and adjust it if need be. As a practical rule, a
84minimum of two buffers are needed for proper streaming, and there is
85usually a maximum (which cannot exceed 32) which makes sense for each
86device. The size parameter should be set to the expected (maximum) size
87for each frame of data.
88
89Each buffer (in the form of a struct videobuf_buffer pointer) will be
90passed to buf_prepare(), which should set the buffer's size, width, height,
91and field fields properly. If the buffer's state field is
92VIDEOBUF_NEEDS_INIT, the driver should pass it to:
93
94 int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb,
95 struct v4l2_framebuffer *fbuf);
96
97Among other things, this call will usually allocate memory for the buffer.
98Finally, the buf_prepare() function should set the buffer's state to
99VIDEOBUF_PREPARED.
100
101When a buffer is queued for I/O, it is passed to buf_queue(), which should
102put it onto the driver's list of available buffers and set its state to
103VIDEOBUF_QUEUED. Note that this function is called with the queue spinlock
104held; if it tries to acquire it as well things will come to a screeching
105halt. Yes, this is the voice of experience. Note also that videobuf may
106wait on the first buffer in the queue; placing other buffers in front of it
107could again gum up the works. So use list_add_tail() to enqueue buffers.
108
109Finally, buf_release() is called when a buffer is no longer intended to be
110used. The driver should ensure that there is no I/O active on the buffer,
111then pass it to the appropriate free routine(s):
112
113 /* Scatter/gather drivers */
114 int videobuf_dma_unmap(struct videobuf_queue *q,
115 struct videobuf_dmabuf *dma);
116 int videobuf_dma_free(struct videobuf_dmabuf *dma);
117
118 /* vmalloc drivers */
119 void videobuf_vmalloc_free (struct videobuf_buffer *buf);
120
121 /* Contiguous drivers */
122 void videobuf_dma_contig_free(struct videobuf_queue *q,
123 struct videobuf_buffer *buf);
124
125One way to ensure that a buffer is no longer under I/O is to pass it to:
126
127 int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
128
129Here, vb is the buffer, non_blocking indicates whether non-blocking I/O
130should be used (it should be zero in the buf_release() case), and intr
131controls whether an interruptible wait is used.
132
133File operations
134
135At this point, much of the work is done; much of the rest is slipping
136videobuf calls into the implementation of the other driver callbacks. The
137first step is in the open() function, which must initialize the
138videobuf queue. The function to use depends on the type of buffer used:
139
140 void videobuf_queue_sg_init(struct videobuf_queue *q,
141 struct videobuf_queue_ops *ops,
142 struct device *dev,
143 spinlock_t *irqlock,
144 enum v4l2_buf_type type,
145 enum v4l2_field field,
146 unsigned int msize,
147 void *priv);
148
149 void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
150 struct videobuf_queue_ops *ops,
151 struct device *dev,
152 spinlock_t *irqlock,
153 enum v4l2_buf_type type,
154 enum v4l2_field field,
155 unsigned int msize,
156 void *priv);
157
158 void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
159 struct videobuf_queue_ops *ops,
160 struct device *dev,
161 spinlock_t *irqlock,
162 enum v4l2_buf_type type,
163 enum v4l2_field field,
164 unsigned int msize,
165 void *priv);
166
167In each case, the parameters are the same: q is the queue structure for the
168device, ops is the set of callbacks as described above, dev is the device
169structure for this video device, irqlock is an interrupt-safe spinlock to
170protect access to the data structures, type is the buffer type used by the
171device (cameras will use V4L2_BUF_TYPE_VIDEO_CAPTURE, for example), field
172describes which field is being captured (often V4L2_FIELD_NONE for
173progressive devices), msize is the size of any containing structure used
174around struct videobuf_buffer, and priv is a private data pointer which
175shows up in the priv_data field of struct videobuf_queue. Note that these
176are void functions which, evidently, are immune to failure.
177
178V4L2 capture drivers can be written to support either of two APIs: the
179read() system call and the rather more complicated streaming mechanism. As
180a general rule, it is necessary to support both to ensure that all
181applications have a chance of working with the device. Videobuf makes it
182easy to do that with the same code. To implement read(), the driver need
183only make a call to one of:
184
185 ssize_t videobuf_read_one(struct videobuf_queue *q,
186 char __user *data, size_t count,
187 loff_t *ppos, int nonblocking);
188
189 ssize_t videobuf_read_stream(struct videobuf_queue *q,
190 char __user *data, size_t count,
191 loff_t *ppos, int vbihack, int nonblocking);
192
193Either one of these functions will read frame data into data, returning the
194amount actually read; the difference is that videobuf_read_one() will only
195read a single frame, while videobuf_read_stream() will read multiple frames
196if they are needed to satisfy the count requested by the application. A
197typical driver read() implementation will start the capture engine, call
198one of the above functions, then stop the engine before returning (though a
199smarter implementation might leave the engine running for a little while in
200anticipation of another read() call happening in the near future).
201
202The poll() function can usually be implemented with a direct call to:
203
204 unsigned int videobuf_poll_stream(struct file *file,
205 struct videobuf_queue *q,
206 poll_table *wait);
207
208Note that the actual wait queue eventually used will be the one associated
209with the first available buffer.
210
211When streaming I/O is done to kernel-space buffers, the driver must support
212the mmap() system call to enable user space to access the data. In many
213V4L2 drivers, the often-complex mmap() implementation simplifies to a
214single call to:
215
216 int videobuf_mmap_mapper(struct videobuf_queue *q,
217 struct vm_area_struct *vma);
218
219Everything else is handled by the videobuf code.
220
221The release() function requires two separate videobuf calls:
222
223 void videobuf_stop(struct videobuf_queue *q);
224 int videobuf_mmap_free(struct videobuf_queue *q);
225
226The call to videobuf_stop() terminates any I/O in progress - though it is
227still up to the driver to stop the capture engine. The call to
228videobuf_mmap_free() will ensure that all buffers have been unmapped; if
229so, they will all be passed to the buf_release() callback. If buffers
230remain mapped, videobuf_mmap_free() returns an error code instead. The
231purpose is clearly to cause the closing of the file descriptor to fail if
232buffers are still mapped, but every driver in the 2.6.32 kernel cheerfully
233ignores its return value.
234
235ioctl() operations
236
237The V4L2 API includes a very long list of driver callbacks to respond to
238the many ioctl() commands made available to user space. A number of these
239- those associated with streaming I/O - turn almost directly into videobuf
240calls. The relevant helper functions are:
241
242 int videobuf_reqbufs(struct videobuf_queue *q,
243 struct v4l2_requestbuffers *req);
244 int videobuf_querybuf(struct videobuf_queue *q, struct v4l2_buffer *b);
245 int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b);
246 int videobuf_dqbuf(struct videobuf_queue *q, struct v4l2_buffer *b,
247 int nonblocking);
248 int videobuf_streamon(struct videobuf_queue *q);
249 int videobuf_streamoff(struct videobuf_queue *q);
250 int videobuf_cgmbuf(struct videobuf_queue *q, struct video_mbuf *mbuf,
251 int count);
252
253So, for example, a VIDIOC_REQBUFS call turns into a call to the driver's
254vidioc_reqbufs() callback which, in turn, usually only needs to locate the
255proper struct videobuf_queue pointer and pass it to videobuf_reqbufs().
256These support functions can replace a great deal of buffer management
257boilerplate in a lot of V4L2 drivers.
258
259The vidioc_streamon() and vidioc_streamoff() functions will be a bit more
260complex, of course, since they will also need to deal with starting and
261stopping the capture engine. videobuf_cgmbuf(), called from the driver's
262vidiocgmbuf() function, only exists if the V4L1 compatibility module has
263been selected with CONFIG_VIDEO_V4L1_COMPAT, so its use must be surrounded
264with #ifdef directives.
265
266Buffer allocation
267
268Thus far, we have talked about buffers, but have not looked at how they are
269allocated. The scatter/gather case is the most complex on this front. For
270allocation, the driver can leave buffer allocation entirely up to the
271videobuf layer; in this case, buffers will be allocated as anonymous
272user-space pages and will be very scattered indeed. If the application is
273using user-space buffers, no allocation is needed; the videobuf layer will
274take care of calling get_user_pages() and filling in the scatterlist array.
275
276If the driver needs to do its own memory allocation, it should be done in
277the vidioc_reqbufs() function, *after* calling videobuf_reqbufs(). The
278first step is a call to:
279
280 struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
281
282The returned videobuf_dmabuf structure (defined in
283<media/videobuf-dma-sg.h>) includes a couple of relevant fields:
284
285 struct scatterlist *sglist;
286 int sglen;
287
288The driver must allocate an appropriately-sized scatterlist array and
289populate it with pointers to the pieces of the allocated buffer; sglen
290should be set to the length of the array.
291
292Drivers using the vmalloc() method need not (and cannot) concern themselves
293with buffer allocation at all; videobuf will handle those details. The
294same is normally true of contiguous-DMA drivers as well; videobuf will
295allocate the buffers (with dma_alloc_coherent()) when it sees fit. That
296means that these drivers may be trying to do high-order allocations at any
297time, an operation which is not always guaranteed to work. Some drivers
298play tricks by allocating DMA space at system boot time; videobuf does not
299currently play well with those drivers.
300
301As of 2.6.31, contiguous-DMA drivers can work with a user-supplied buffer,
302as long as that buffer is physically contiguous. Normal user-space
303allocations will not meet that criterion, but buffers obtained from other
304kernel drivers, or those contained within huge pages, will work with these
305drivers.
306
307Filling the buffers
308
309The final part of a videobuf implementation has no direct callback - it's
310the portion of the code which actually puts frame data into the buffers,
311usually in response to interrupts from the device. For all types of
312drivers, this process works approximately as follows:
313
314 - Obtain the next available buffer and make sure that somebody is actually
315 waiting for it.
316
317 - Get a pointer to the memory and put video data there.
318
319 - Mark the buffer as done and wake up the process waiting for it.
320
321Step (1) above is done by looking at the driver-managed list_head structure
322- the one which is filled in the buf_queue() callback. Because starting
323the engine and enqueueing buffers are done in separate steps, it's possible
324for the engine to be running without any buffers available - in the
325vmalloc() case especially. So the driver should be prepared for the list
326to be empty. It is equally possible that nobody is yet interested in the
327buffer; the driver should not remove it from the list or fill it until a
328process is waiting on it. That test can be done by examining the buffer's
329done field (a wait_queue_head_t structure) with waitqueue_active().
330
331A buffer's state should be set to VIDEOBUF_ACTIVE before being mapped for
332DMA; that ensures that the videobuf layer will not try to do anything with
333it while the device is transferring data.
334
335For scatter/gather drivers, the needed memory pointers will be found in the
336scatterlist structure described above. Drivers using the vmalloc() method
337can get a memory pointer with:
338
339 void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
340
341For contiguous DMA drivers, the function to use is:
342
343 dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
344
345The contiguous DMA API goes out of its way to hide the kernel-space address
346of the DMA buffer from drivers.
347
348The final step is to set the size field of the relevant videobuf_buffer
349structure to the actual size of the captured image, set state to
350VIDEOBUF_DONE, then call wake_up() on the done queue. At this point, the
351buffer is owned by the videobuf layer and the driver should not touch it
352again.
353
354Developers who are interested in more information can go into the relevant
355header files; there are a few low-level functions declared there which have
356not been talked about here. Also worthwhile is the vivi driver
357(drivers/media/video/vivi.c), which is maintained as an example of how V4L2
358drivers should be written. Vivi only uses the vmalloc() API, but it's good
359enough to get started with. Note also that all of these calls are exported
360GPL-only, so they will not be available to non-GPL kernel modules.
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/video4linux/zr364xx.txt
index 7f3d1955d214..d98e4d302977 100644
--- a/Documentation/video4linux/zr364xx.txt
+++ b/Documentation/video4linux/zr364xx.txt
@@ -66,3 +66,4 @@ Vendor Product Distributor Model
660x0a17 0x004e Pentax Optio 50 660x0a17 0x004e Pentax Optio 50
670x041e 0x405d Creative DiVi CAM 516 670x041e 0x405d Creative DiVi CAM 516
680x08ca 0x2102 Aiptek DV T300 680x08ca 0x2102 Aiptek DV T300
690x06d6 0x003d Trust Powerc@m 910Z
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX
index e57d6a9dd32b..dca82d7c83d8 100644
--- a/Documentation/vm/00-INDEX
+++ b/Documentation/vm/00-INDEX
@@ -4,23 +4,35 @@ active_mm.txt
4 - An explanation from Linus about tsk->active_mm vs tsk->mm. 4 - An explanation from Linus about tsk->active_mm vs tsk->mm.
5balance 5balance
6 - various information on memory balancing. 6 - various information on memory balancing.
7hugepage-mmap.c
8 - Example app using huge page memory with the mmap system call.
9hugepage-shm.c
10 - Example app using huge page memory with Sys V shared memory system calls.
7hugetlbpage.txt 11hugetlbpage.txt
8 - a brief summary of hugetlbpage support in the Linux kernel. 12 - a brief summary of hugetlbpage support in the Linux kernel.
13hwpoison.txt
14 - explains what hwpoison is
9ksm.txt 15ksm.txt
10 - how to use the Kernel Samepage Merging feature. 16 - how to use the Kernel Samepage Merging feature.
11locking 17locking
12 - info on how locking and synchronization is done in the Linux vm code. 18 - info on how locking and synchronization is done in the Linux vm code.
19map_hugetlb.c
20 - an example program that uses the MAP_HUGETLB mmap flag.
13numa 21numa
14 - information about NUMA specific code in the Linux vm. 22 - information about NUMA specific code in the Linux vm.
15numa_memory_policy.txt 23numa_memory_policy.txt
16 - documentation of concepts and APIs of the 2.6 memory policy support. 24 - documentation of concepts and APIs of the 2.6 memory policy support.
17overcommit-accounting 25overcommit-accounting
18 - description of the Linux kernels overcommit handling modes. 26 - description of the Linux kernels overcommit handling modes.
27page-types.c
28 - Tool for querying page flags
19page_migration 29page_migration
20 - description of page migration in NUMA systems. 30 - description of page migration in NUMA systems.
31pagemap.txt
32 - pagemap, from the userspace perspective
21slabinfo.c 33slabinfo.c
22 - source code for a tool to get reports about slabs. 34 - source code for a tool to get reports about slabs.
23slub.txt 35slub.txt
24 - a short users guide for SLUB. 36 - a short users guide for SLUB.
25map_hugetlb.c 37unevictable-lru.txt
26 - an example program that uses the MAP_HUGETLB mmap flag. 38 - Unevictable LRU infrastructure
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
index 5bd269b3731a..9dcff328b964 100644
--- a/Documentation/vm/Makefile
+++ b/Documentation/vm/Makefile
@@ -2,7 +2,7 @@
2obj- := dummy.o 2obj- := dummy.o
3 3
4# List of programs to build 4# List of programs to build
5hostprogs-y := slabinfo page-types 5hostprogs-y := slabinfo page-types hugepage-mmap hugepage-shm map_hugetlb
6 6
7# Tell kbuild to always build the programs 7# Tell kbuild to always build the programs
8always := $(hostprogs-y) 8always := $(hostprogs-y)
diff --git a/Documentation/vm/hugepage-mmap.c b/Documentation/vm/hugepage-mmap.c
new file mode 100644
index 000000000000..db0dd9a33d54
--- /dev/null
+++ b/Documentation/vm/hugepage-mmap.c
@@ -0,0 +1,91 @@
1/*
2 * hugepage-mmap:
3 *
4 * Example of using huge page memory in a user application using the mmap
5 * system call. Before running this application, make sure that the
6 * administrator has mounted the hugetlbfs filesystem (on some directory
7 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
8 * example, the app is requesting memory of size 256MB that is backed by
9 * huge pages.
10 *
11 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
12 * huge pages. That means that if one requires a fixed address, a huge page
13 * aligned address starting with 0x800000... will be required. If a fixed
14 * address is not required, the kernel will select an address in the proper
15 * range.
16 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
17 */
18
19#include <stdlib.h>
20#include <stdio.h>
21#include <unistd.h>
22#include <sys/mman.h>
23#include <fcntl.h>
24
25#define FILE_NAME "/mnt/hugepagefile"
26#define LENGTH (256UL*1024*1024)
27#define PROTECTION (PROT_READ | PROT_WRITE)
28
29/* Only ia64 requires this */
30#ifdef __ia64__
31#define ADDR (void *)(0x8000000000000000UL)
32#define FLAGS (MAP_SHARED | MAP_FIXED)
33#else
34#define ADDR (void *)(0x0UL)
35#define FLAGS (MAP_SHARED)
36#endif
37
38static void check_bytes(char *addr)
39{
40 printf("First hex is %x\n", *((unsigned int *)addr));
41}
42
43static void write_bytes(char *addr)
44{
45 unsigned long i;
46
47 for (i = 0; i < LENGTH; i++)
48 *(addr + i) = (char)i;
49}
50
51static void read_bytes(char *addr)
52{
53 unsigned long i;
54
55 check_bytes(addr);
56 for (i = 0; i < LENGTH; i++)
57 if (*(addr + i) != (char)i) {
58 printf("Mismatch at %lu\n", i);
59 break;
60 }
61}
62
63int main(void)
64{
65 void *addr;
66 int fd;
67
68 fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
69 if (fd < 0) {
70 perror("Open failed");
71 exit(1);
72 }
73
74 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
75 if (addr == MAP_FAILED) {
76 perror("mmap");
77 unlink(FILE_NAME);
78 exit(1);
79 }
80
81 printf("Returned address is %p\n", addr);
82 check_bytes(addr);
83 write_bytes(addr);
84 read_bytes(addr);
85
86 munmap(addr, LENGTH);
87 close(fd);
88 unlink(FILE_NAME);
89
90 return 0;
91}
diff --git a/Documentation/vm/hugepage-shm.c b/Documentation/vm/hugepage-shm.c
new file mode 100644
index 000000000000..07956d8592c9
--- /dev/null
+++ b/Documentation/vm/hugepage-shm.c
@@ -0,0 +1,98 @@
1/*
2 * hugepage-shm:
3 *
4 * Example of using huge page memory in a user application using Sys V shared
5 * memory system calls. In this example the app is requesting 256MB of
6 * memory that is backed by huge pages. The application uses the flag
7 * SHM_HUGETLB in the shmget system call to inform the kernel that it is
8 * requesting huge pages.
9 *
10 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
11 * huge pages. That means that if one requires a fixed address, a huge page
12 * aligned address starting with 0x800000... will be required. If a fixed
13 * address is not required, the kernel will select an address in the proper
14 * range.
15 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
16 *
17 * Note: The default shared memory limit is quite low on many kernels,
18 * you may need to increase it via:
19 *
20 * echo 268435456 > /proc/sys/kernel/shmmax
21 *
22 * This will increase the maximum size per shared memory segment to 256MB.
23 * The other limit that you will hit eventually is shmall which is the
24 * total amount of shared memory in pages. To set it to 16GB on a system
25 * with a 4kB pagesize do:
26 *
27 * echo 4194304 > /proc/sys/kernel/shmall
28 */
29
30#include <stdlib.h>
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/ipc.h>
34#include <sys/shm.h>
35#include <sys/mman.h>
36
37#ifndef SHM_HUGETLB
38#define SHM_HUGETLB 04000
39#endif
40
41#define LENGTH (256UL*1024*1024)
42
43#define dprintf(x) printf(x)
44
45/* Only ia64 requires this */
46#ifdef __ia64__
47#define ADDR (void *)(0x8000000000000000UL)
48#define SHMAT_FLAGS (SHM_RND)
49#else
50#define ADDR (void *)(0x0UL)
51#define SHMAT_FLAGS (0)
52#endif
53
54int main(void)
55{
56 int shmid;
57 unsigned long i;
58 char *shmaddr;
59
60 if ((shmid = shmget(2, LENGTH,
61 SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
62 perror("shmget");
63 exit(1);
64 }
65 printf("shmid: 0x%x\n", shmid);
66
67 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
68 if (shmaddr == (char *)-1) {
69 perror("Shared memory attach failure");
70 shmctl(shmid, IPC_RMID, NULL);
71 exit(2);
72 }
73 printf("shmaddr: %p\n", shmaddr);
74
75 dprintf("Starting the writes:\n");
76 for (i = 0; i < LENGTH; i++) {
77 shmaddr[i] = (char)(i);
78 if (!(i % (1024 * 1024)))
79 dprintf(".");
80 }
81 dprintf("\n");
82
83 dprintf("Starting the Check...");
84 for (i = 0; i < LENGTH; i++)
85 if (shmaddr[i] != (char)i)
86 printf("\nIndex %lu mismatched\n", i);
87 dprintf("Done.\n");
88
89 if (shmdt((const void *)shmaddr) != 0) {
90 perror("Detach failure");
91 shmctl(shmid, IPC_RMID, NULL);
92 exit(3);
93 }
94
95 shmctl(shmid, IPC_RMID, NULL);
96
97 return 0;
98}
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 82a7bd1800b2..457634c1e03e 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -11,23 +11,21 @@ This optimization is more critical now as bigger and bigger physical memories
11(several GBs) are more readily available. 11(several GBs) are more readily available.
12 12
13Users can use the huge page support in Linux kernel by either using the mmap 13Users can use the huge page support in Linux kernel by either using the mmap
14system call or standard SYSv shared memory system calls (shmget, shmat). 14system call or standard SYSV shared memory system calls (shmget, shmat).
15 15
16First the Linux kernel needs to be built with the CONFIG_HUGETLBFS 16First the Linux kernel needs to be built with the CONFIG_HUGETLBFS
17(present under "File systems") and CONFIG_HUGETLB_PAGE (selected 17(present under "File systems") and CONFIG_HUGETLB_PAGE (selected
18automatically when CONFIG_HUGETLBFS is selected) configuration 18automatically when CONFIG_HUGETLBFS is selected) configuration
19options. 19options.
20 20
21The kernel built with huge page support should show the number of configured 21The /proc/meminfo file provides information about the total number of
22huge pages in the system by running the "cat /proc/meminfo" command. 22persistent hugetlb pages in the kernel's huge page pool. It also displays
23information about the number of free, reserved and surplus huge pages and the
24default huge page size. The huge page size is needed for generating the
25proper alignment and size of the arguments to system calls that map huge page
26regions.
23 27
24/proc/meminfo also provides information about the total number of hugetlb 28The output of "cat /proc/meminfo" will include lines like:
25pages configured in the kernel. It also displays information about the
26number of free hugetlb pages at any time. It also displays information about
27the configured huge page size - this is needed for generating the proper
28alignment and size of the arguments to the above system calls.
29
30The output of "cat /proc/meminfo" will have lines like:
31 29
32..... 30.....
33HugePages_Total: vvv 31HugePages_Total: vvv
@@ -53,59 +51,63 @@ HugePages_Surp is short for "surplus," and is the number of huge pages in
53/proc/filesystems should also show a filesystem of type "hugetlbfs" configured 51/proc/filesystems should also show a filesystem of type "hugetlbfs" configured
54in the kernel. 52in the kernel.
55 53
56/proc/sys/vm/nr_hugepages indicates the current number of configured hugetlb 54/proc/sys/vm/nr_hugepages indicates the current number of "persistent" huge
57pages in the kernel. Super user can dynamically request more (or free some 55pages in the kernel's huge page pool. "Persistent" huge pages will be
58pre-configured) huge pages. 56returned to the huge page pool when freed by a task. A user with root
59The allocation (or deallocation) of hugetlb pages is possible only if there are 57privileges can dynamically allocate more or free some persistent huge pages
60enough physically contiguous free pages in system (freeing of huge pages is 58by increasing or decreasing the value of 'nr_hugepages'.
61possible only if there are enough hugetlb pages free that can be transferred
62back to regular memory pool).
63 59
64Pages that are used as hugetlb pages are reserved inside the kernel and cannot 60Pages that are used as huge pages are reserved inside the kernel and cannot
65be used for other purposes. 61be used for other purposes. Huge pages cannot be swapped out under
62memory pressure.
66 63
67Once the kernel with Hugetlb page support is built and running, a user can 64Once a number of huge pages have been pre-allocated to the kernel huge page
68use either the mmap system call or shared memory system calls to start using 65pool, a user with appropriate privilege can use either the mmap system call
69the huge pages. It is required that the system administrator preallocate 66or shared memory system calls to use the huge pages. See the discussion of
70enough memory for huge page purposes. 67Using Huge Pages, below.
71 68
72The administrator can preallocate huge pages on the kernel boot command line by 69The administrator can allocate persistent huge pages on the kernel boot
73specifying the "hugepages=N" parameter, where 'N' = the number of huge pages 70command line by specifying the "hugepages=N" parameter, where 'N' = the
74requested. This is the most reliable method for preallocating huge pages as 71number of huge pages requested. This is the most reliable method of
75memory has not yet become fragmented. 72allocating huge pages as memory has not yet become fragmented.
76 73
77Some platforms support multiple huge page sizes. To preallocate huge pages 74Some platforms support multiple huge page sizes. To allocate huge pages
78of a specific size, one must preceed the huge pages boot command parameters 75of a specific size, one must preceed the huge pages boot command parameters
79with a huge page size selection parameter "hugepagesz=<size>". <size> must 76with a huge page size selection parameter "hugepagesz=<size>". <size> must
80be specified in bytes with optional scale suffix [kKmMgG]. The default huge 77be specified in bytes with optional scale suffix [kKmMgG]. The default huge
81page size may be selected with the "default_hugepagesz=<size>" boot parameter. 78page size may be selected with the "default_hugepagesz=<size>" boot parameter.
82 79
83/proc/sys/vm/nr_hugepages indicates the current number of configured [default 80When multiple huge page sizes are supported, /proc/sys/vm/nr_hugepages
84size] hugetlb pages in the kernel. Super user can dynamically request more 81indicates the current number of pre-allocated huge pages of the default size.
85(or free some pre-configured) huge pages. 82Thus, one can use the following command to dynamically allocate/deallocate
86 83default sized persistent huge pages:
87Use the following command to dynamically allocate/deallocate default sized
88huge pages:
89 84
90 echo 20 > /proc/sys/vm/nr_hugepages 85 echo 20 > /proc/sys/vm/nr_hugepages
91 86
92This command will try to configure 20 default sized huge pages in the system. 87This command will try to adjust the number of default sized huge pages in the
88huge page pool to 20, allocating or freeing huge pages, as required.
89
93On a NUMA platform, the kernel will attempt to distribute the huge page pool 90On a NUMA platform, the kernel will attempt to distribute the huge page pool
94over the all on-line nodes. These huge pages, allocated when nr_hugepages 91over all the set of allowed nodes specified by the NUMA memory policy of the
95is increased, are called "persistent huge pages". 92task that modifies nr_hugepages. The default for the allowed nodes--when the
93task has default memory policy--is all on-line nodes with memory. Allowed
94nodes with insufficient available, contiguous memory for a huge page will be
95silently skipped when allocating persistent huge pages. See the discussion
96below of the interaction of task memory policy, cpusets and per node attributes
97with the allocation and freeing of persistent huge pages.
96 98
97The success or failure of huge page allocation depends on the amount of 99The success or failure of huge page allocation depends on the amount of
98physically contiguous memory that is preset in system at the time of the 100physically contiguous memory that is present in system at the time of the
99allocation attempt. If the kernel is unable to allocate huge pages from 101allocation attempt. If the kernel is unable to allocate huge pages from
100some nodes in a NUMA system, it will attempt to make up the difference by 102some nodes in a NUMA system, it will attempt to make up the difference by
101allocating extra pages on other nodes with sufficient available contiguous 103allocating extra pages on other nodes with sufficient available contiguous
102memory, if any. 104memory, if any.
103 105
104System administrators may want to put this command in one of the local rc init 106System administrators may want to put this command in one of the local rc
105files. This will enable the kernel to request huge pages early in the boot 107init files. This will enable the kernel to allocate huge pages early in
106process when the possibility of getting physical contiguous pages is still 108the boot process when the possibility of getting physical contiguous pages
107very high. Administrators can verify the number of huge pages actually 109is still very high. Administrators can verify the number of huge pages
108allocated by checking the sysctl or meminfo. To check the per node 110actually allocated by checking the sysctl or meminfo. To check the per node
109distribution of huge pages in a NUMA system, use: 111distribution of huge pages in a NUMA system, use:
110 112
111 cat /sys/devices/system/node/node*/meminfo | fgrep Huge 113 cat /sys/devices/system/node/node*/meminfo | fgrep Huge
@@ -113,45 +115,47 @@ distribution of huge pages in a NUMA system, use:
113/proc/sys/vm/nr_overcommit_hugepages specifies how large the pool of 115/proc/sys/vm/nr_overcommit_hugepages specifies how large the pool of
114huge pages can grow, if more huge pages than /proc/sys/vm/nr_hugepages are 116huge pages can grow, if more huge pages than /proc/sys/vm/nr_hugepages are
115requested by applications. Writing any non-zero value into this file 117requested by applications. Writing any non-zero value into this file
116indicates that the hugetlb subsystem is allowed to try to obtain "surplus" 118indicates that the hugetlb subsystem is allowed to try to obtain that
117huge pages from the buddy allocator, when the normal pool is exhausted. As 119number of "surplus" huge pages from the kernel's normal page pool, when the
118these surplus huge pages go out of use, they are freed back to the buddy 120persistent huge page pool is exhausted. As these surplus huge pages become
119allocator. 121unused, they are freed back to the kernel's normal page pool.
120 122
121When increasing the huge page pool size via nr_hugepages, any surplus 123When increasing the huge page pool size via nr_hugepages, any existing surplus
122pages will first be promoted to persistent huge pages. Then, additional 124pages will first be promoted to persistent huge pages. Then, additional
123huge pages will be allocated, if necessary and if possible, to fulfill 125huge pages will be allocated, if necessary and if possible, to fulfill
124the new huge page pool size. 126the new persistent huge page pool size.
125 127
126The administrator may shrink the pool of preallocated huge pages for 128The administrator may shrink the pool of persistent huge pages for
127the default huge page size by setting the nr_hugepages sysctl to a 129the default huge page size by setting the nr_hugepages sysctl to a
128smaller value. The kernel will attempt to balance the freeing of huge pages 130smaller value. The kernel will attempt to balance the freeing of huge pages
129across all on-line nodes. Any free huge pages on the selected nodes will 131across all nodes in the memory policy of the task modifying nr_hugepages.
130be freed back to the buddy allocator. 132Any free huge pages on the selected nodes will be freed back to the kernel's
131 133normal page pool.
132Caveat: Shrinking the pool via nr_hugepages such that it becomes less 134
133than the number of huge pages in use will convert the balance to surplus 135Caveat: Shrinking the persistent huge page pool via nr_hugepages such that
134huge pages even if it would exceed the overcommit value. As long as 136it becomes less than the number of huge pages in use will convert the balance
135this condition holds, however, no more surplus huge pages will be 137of the in-use huge pages to surplus huge pages. This will occur even if
136allowed on the system until one of the two sysctls are increased 138the number of surplus pages it would exceed the overcommit value. As long as
137sufficiently, or the surplus huge pages go out of use and are freed. 139this condition holds--that is, until nr_hugepages+nr_overcommit_hugepages is
140increased sufficiently, or the surplus huge pages go out of use and are freed--
141no more surplus huge pages will be allowed to be allocated.
138 142
139With support for multiple huge page pools at run-time available, much of 143With support for multiple huge page pools at run-time available, much of
140the huge page userspace interface has been duplicated in sysfs. The above 144the huge page userspace interface in /proc/sys/vm has been duplicated in sysfs.
141information applies to the default huge page size which will be 145The /proc interfaces discussed above have been retained for backwards
142controlled by the /proc interfaces for backwards compatibility. The root 146compatibility. The root huge page control directory in sysfs is:
143huge page control directory in sysfs is:
144 147
145 /sys/kernel/mm/hugepages 148 /sys/kernel/mm/hugepages
146 149
147For each huge page size supported by the running kernel, a subdirectory 150For each huge page size supported by the running kernel, a subdirectory
148will exist, of the form 151will exist, of the form:
149 152
150 hugepages-${size}kB 153 hugepages-${size}kB
151 154
152Inside each of these directories, the same set of files will exist: 155Inside each of these directories, the same set of files will exist:
153 156
154 nr_hugepages 157 nr_hugepages
158 nr_hugepages_mempolicy
155 nr_overcommit_hugepages 159 nr_overcommit_hugepages
156 free_hugepages 160 free_hugepages
157 resv_hugepages 161 resv_hugepages
@@ -159,6 +163,102 @@ Inside each of these directories, the same set of files will exist:
159 163
160which function as described above for the default huge page-sized case. 164which function as described above for the default huge page-sized case.
161 165
166
167Interaction of Task Memory Policy with Huge Page Allocation/Freeing
168
169Whether huge pages are allocated and freed via the /proc interface or
170the /sysfs interface using the nr_hugepages_mempolicy attribute, the NUMA
171nodes from which huge pages are allocated or freed are controlled by the
172NUMA memory policy of the task that modifies the nr_hugepages_mempolicy
173sysctl or attribute. When the nr_hugepages attribute is used, mempolicy
174is ignored.
175
176The recommended method to allocate or free huge pages to/from the kernel
177huge page pool, using the nr_hugepages example above, is:
178
179 numactl --interleave <node-list> echo 20 \
180 >/proc/sys/vm/nr_hugepages_mempolicy
181
182or, more succinctly:
183
184 numactl -m <node-list> echo 20 >/proc/sys/vm/nr_hugepages_mempolicy
185
186This will allocate or free abs(20 - nr_hugepages) to or from the nodes
187specified in <node-list>, depending on whether number of persistent huge pages
188is initially less than or greater than 20, respectively. No huge pages will be
189allocated nor freed on any node not included in the specified <node-list>.
190
191When adjusting the persistent hugepage count via nr_hugepages_mempolicy, any
192memory policy mode--bind, preferred, local or interleave--may be used. The
193resulting effect on persistent huge page allocation is as follows:
194
1951) Regardless of mempolicy mode [see Documentation/vm/numa_memory_policy.txt],
196 persistent huge pages will be distributed across the node or nodes
197 specified in the mempolicy as if "interleave" had been specified.
198 However, if a node in the policy does not contain sufficient contiguous
199 memory for a huge page, the allocation will not "fallback" to the nearest
200 neighbor node with sufficient contiguous memory. To do this would cause
201 undesirable imbalance in the distribution of the huge page pool, or
202 possibly, allocation of persistent huge pages on nodes not allowed by
203 the task's memory policy.
204
2052) One or more nodes may be specified with the bind or interleave policy.
206 If more than one node is specified with the preferred policy, only the
207 lowest numeric id will be used. Local policy will select the node where
208 the task is running at the time the nodes_allowed mask is constructed.
209 For local policy to be deterministic, the task must be bound to a cpu or
210 cpus in a single node. Otherwise, the task could be migrated to some
211 other node at any time after launch and the resulting node will be
212 indeterminate. Thus, local policy is not very useful for this purpose.
213 Any of the other mempolicy modes may be used to specify a single node.
214
2153) The nodes allowed mask will be derived from any non-default task mempolicy,
216 whether this policy was set explicitly by the task itself or one of its
217 ancestors, such as numactl. This means that if the task is invoked from a
218 shell with non-default policy, that policy will be used. One can specify a
219 node list of "all" with numactl --interleave or --membind [-m] to achieve
220 interleaving over all nodes in the system or cpuset.
221
2224) Any task mempolicy specifed--e.g., using numactl--will be constrained by
223 the resource limits of any cpuset in which the task runs. Thus, there will
224 be no way for a task with non-default policy running in a cpuset with a
225 subset of the system nodes to allocate huge pages outside the cpuset
226 without first moving to a cpuset that contains all of the desired nodes.
227
2285) Boot-time huge page allocation attempts to distribute the requested number
229 of huge pages over all on-lines nodes with memory.
230
231Per Node Hugepages Attributes
232
233A subset of the contents of the root huge page control directory in sysfs,
234described above, will be replicated under each the system device of each
235NUMA node with memory in:
236
237 /sys/devices/system/node/node[0-9]*/hugepages/
238
239Under this directory, the subdirectory for each supported huge page size
240contains the following attribute files:
241
242 nr_hugepages
243 free_hugepages
244 surplus_hugepages
245
246The free_' and surplus_' attribute files are read-only. They return the number
247of free and surplus [overcommitted] huge pages, respectively, on the parent
248node.
249
250The nr_hugepages attribute returns the total number of huge pages on the
251specified node. When this attribute is written, the number of persistent huge
252pages on the parent node will be adjusted to the specified value, if sufficient
253resources exist, regardless of the task's mempolicy or cpuset constraints.
254
255Note that the number of overcommit and reserve pages remain global quantities,
256as we don't know until fault time, when the faulting task's mempolicy is
257applied, from which node the huge page allocation will be attempted.
258
259
260Using Huge Pages
261
162If the user applications are going to request huge pages using mmap system 262If the user applications are going to request huge pages using mmap system
163call, then it is required that system administrator mount a file system of 263call, then it is required that system administrator mount a file system of
164type hugetlbfs: 264type hugetlbfs:
@@ -199,184 +299,11 @@ map_hugetlb.c.
199******************************************************************* 299*******************************************************************
200 300
201/* 301/*
202 * Example of using huge page memory in a user application using Sys V shared 302 * hugepage-shm: see Documentation/vm/hugepage-shm.c
203 * memory system calls. In this example the app is requesting 256MB of
204 * memory that is backed by huge pages. The application uses the flag
205 * SHM_HUGETLB in the shmget system call to inform the kernel that it is
206 * requesting huge pages.
207 *
208 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
209 * huge pages. That means the addresses starting with 0x800000... will need
210 * to be specified. Specifying a fixed address is not required on ppc64,
211 * i386 or x86_64.
212 *
213 * Note: The default shared memory limit is quite low on many kernels,
214 * you may need to increase it via:
215 *
216 * echo 268435456 > /proc/sys/kernel/shmmax
217 *
218 * This will increase the maximum size per shared memory segment to 256MB.
219 * The other limit that you will hit eventually is shmall which is the
220 * total amount of shared memory in pages. To set it to 16GB on a system
221 * with a 4kB pagesize do:
222 *
223 * echo 4194304 > /proc/sys/kernel/shmall
224 */ 303 */
225#include <stdlib.h>
226#include <stdio.h>
227#include <sys/types.h>
228#include <sys/ipc.h>
229#include <sys/shm.h>
230#include <sys/mman.h>
231
232#ifndef SHM_HUGETLB
233#define SHM_HUGETLB 04000
234#endif
235
236#define LENGTH (256UL*1024*1024)
237
238#define dprintf(x) printf(x)
239
240/* Only ia64 requires this */
241#ifdef __ia64__
242#define ADDR (void *)(0x8000000000000000UL)
243#define SHMAT_FLAGS (SHM_RND)
244#else
245#define ADDR (void *)(0x0UL)
246#define SHMAT_FLAGS (0)
247#endif
248
249int main(void)
250{
251 int shmid;
252 unsigned long i;
253 char *shmaddr;
254
255 if ((shmid = shmget(2, LENGTH,
256 SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
257 perror("shmget");
258 exit(1);
259 }
260 printf("shmid: 0x%x\n", shmid);
261
262 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
263 if (shmaddr == (char *)-1) {
264 perror("Shared memory attach failure");
265 shmctl(shmid, IPC_RMID, NULL);
266 exit(2);
267 }
268 printf("shmaddr: %p\n", shmaddr);
269
270 dprintf("Starting the writes:\n");
271 for (i = 0; i < LENGTH; i++) {
272 shmaddr[i] = (char)(i);
273 if (!(i % (1024 * 1024)))
274 dprintf(".");
275 }
276 dprintf("\n");
277
278 dprintf("Starting the Check...");
279 for (i = 0; i < LENGTH; i++)
280 if (shmaddr[i] != (char)i)
281 printf("\nIndex %lu mismatched\n", i);
282 dprintf("Done.\n");
283
284 if (shmdt((const void *)shmaddr) != 0) {
285 perror("Detach failure");
286 shmctl(shmid, IPC_RMID, NULL);
287 exit(3);
288 }
289
290 shmctl(shmid, IPC_RMID, NULL);
291
292 return 0;
293}
294 304
295******************************************************************* 305*******************************************************************
296 306
297/* 307/*
298 * Example of using huge page memory in a user application using the mmap 308 * hugepage-mmap: see Documentation/vm/hugepage-mmap.c
299 * system call. Before running this application, make sure that the
300 * administrator has mounted the hugetlbfs filesystem (on some directory
301 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
302 * example, the app is requesting memory of size 256MB that is backed by
303 * huge pages.
304 *
305 * For ia64 architecture, Linux kernel reserves Region number 4 for huge pages.
306 * That means the addresses starting with 0x800000... will need to be
307 * specified. Specifying a fixed address is not required on ppc64, i386
308 * or x86_64.
309 */ 309 */
310#include <stdlib.h>
311#include <stdio.h>
312#include <unistd.h>
313#include <sys/mman.h>
314#include <fcntl.h>
315
316#define FILE_NAME "/mnt/hugepagefile"
317#define LENGTH (256UL*1024*1024)
318#define PROTECTION (PROT_READ | PROT_WRITE)
319
320/* Only ia64 requires this */
321#ifdef __ia64__
322#define ADDR (void *)(0x8000000000000000UL)
323#define FLAGS (MAP_SHARED | MAP_FIXED)
324#else
325#define ADDR (void *)(0x0UL)
326#define FLAGS (MAP_SHARED)
327#endif
328
329void check_bytes(char *addr)
330{
331 printf("First hex is %x\n", *((unsigned int *)addr));
332}
333
334void write_bytes(char *addr)
335{
336 unsigned long i;
337
338 for (i = 0; i < LENGTH; i++)
339 *(addr + i) = (char)i;
340}
341
342void read_bytes(char *addr)
343{
344 unsigned long i;
345
346 check_bytes(addr);
347 for (i = 0; i < LENGTH; i++)
348 if (*(addr + i) != (char)i) {
349 printf("Mismatch at %lu\n", i);
350 break;
351 }
352}
353
354int main(void)
355{
356 void *addr;
357 int fd;
358
359 fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
360 if (fd < 0) {
361 perror("Open failed");
362 exit(1);
363 }
364
365 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
366 if (addr == MAP_FAILED) {
367 perror("mmap");
368 unlink(FILE_NAME);
369 exit(1);
370 }
371
372 printf("Returned address is %p\n", addr);
373 check_bytes(addr);
374 write_bytes(addr);
375 read_bytes(addr);
376
377 munmap(addr, LENGTH);
378 close(fd);
379 unlink(FILE_NAME);
380
381 return 0;
382}
diff --git a/Documentation/vm/hwpoison.txt b/Documentation/vm/hwpoison.txt
new file mode 100644
index 000000000000..12f9ba20ccb7
--- /dev/null
+++ b/Documentation/vm/hwpoison.txt
@@ -0,0 +1,182 @@
1What is hwpoison?
2
3Upcoming Intel CPUs have support for recovering from some memory errors
4(``MCA recovery''). This requires the OS to declare a page "poisoned",
5kill the processes associated with it and avoid using it in the future.
6
7This patchkit implements the necessary infrastructure in the VM.
8
9To quote the overview comment:
10
11 * High level machine check handler. Handles pages reported by the
12 * hardware as being corrupted usually due to a 2bit ECC memory or cache
13 * failure.
14 *
15 * This focusses on pages detected as corrupted in the background.
16 * When the current CPU tries to consume corruption the currently
17 * running process can just be killed directly instead. This implies
18 * that if the error cannot be handled for some reason it's safe to
19 * just ignore it because no corruption has been consumed yet. Instead
20 * when that happens another machine check will happen.
21 *
22 * Handles page cache pages in various states. The tricky part
23 * here is that we can access any page asynchronous to other VM
24 * users, because memory failures could happen anytime and anywhere,
25 * possibly violating some of their assumptions. This is why this code
26 * has to be extremely careful. Generally it tries to use normal locking
27 * rules, as in get the standard locks, even if that means the
28 * error handling takes potentially a long time.
29 *
30 * Some of the operations here are somewhat inefficient and have non
31 * linear algorithmic complexity, because the data structures have not
32 * been optimized for this case. This is in particular the case
33 * for the mapping from a vma to a process. Since this case is expected
34 * to be rare we hope we can get away with this.
35
36The code consists of a the high level handler in mm/memory-failure.c,
37a new page poison bit and various checks in the VM to handle poisoned
38pages.
39
40The main target right now is KVM guests, but it works for all kinds
41of applications. KVM support requires a recent qemu-kvm release.
42
43For the KVM use there was need for a new signal type so that
44KVM can inject the machine check into the guest with the proper
45address. This in theory allows other applications to handle
46memory failures too. The expection is that near all applications
47won't do that, but some very specialized ones might.
48
49---
50
51There are two (actually three) modi memory failure recovery can be in:
52
53vm.memory_failure_recovery sysctl set to zero:
54 All memory failures cause a panic. Do not attempt recovery.
55 (on x86 this can be also affected by the tolerant level of the
56 MCE subsystem)
57
58early kill
59 (can be controlled globally and per process)
60 Send SIGBUS to the application as soon as the error is detected
61 This allows applications who can process memory errors in a gentle
62 way (e.g. drop affected object)
63 This is the mode used by KVM qemu.
64
65late kill
66 Send SIGBUS when the application runs into the corrupted page.
67 This is best for memory error unaware applications and default
68 Note some pages are always handled as late kill.
69
70---
71
72User control:
73
74vm.memory_failure_recovery
75 See sysctl.txt
76
77vm.memory_failure_early_kill
78 Enable early kill mode globally
79
80PR_MCE_KILL
81 Set early/late kill mode/revert to system default
82 arg1: PR_MCE_KILL_CLEAR: Revert to system default
83 arg1: PR_MCE_KILL_SET: arg2 defines thread specific mode
84 PR_MCE_KILL_EARLY: Early kill
85 PR_MCE_KILL_LATE: Late kill
86 PR_MCE_KILL_DEFAULT: Use system global default
87PR_MCE_KILL_GET
88 return current mode
89
90
91---
92
93Testing:
94
95madvise(MADV_HWPOISON, ....)
96 (as root)
97 Poison a page in the process for testing
98
99
100hwpoison-inject module through debugfs
101
102/sys/debug/hwpoison/
103
104corrupt-pfn
105
106Inject hwpoison fault at PFN echoed into this file. This does
107some early filtering to avoid corrupted unintended pages in test suites.
108
109unpoison-pfn
110
111Software-unpoison page at PFN echoed into this file. This
112way a page can be reused again.
113This only works for Linux injected failures, not for real
114memory failures.
115
116Note these injection interfaces are not stable and might change between
117kernel versions
118
119corrupt-filter-dev-major
120corrupt-filter-dev-minor
121
122Only handle memory failures to pages associated with the file system defined
123by block device major/minor. -1U is the wildcard value.
124This should be only used for testing with artificial injection.
125
126corrupt-filter-memcg
127
128Limit injection to pages owned by memgroup. Specified by inode number
129of the memcg.
130
131Example:
132 mkdir /cgroup/hwpoison
133
134 usemem -m 100 -s 1000 &
135 echo `jobs -p` > /cgroup/hwpoison/tasks
136
137 memcg_ino=$(ls -id /cgroup/hwpoison | cut -f1 -d' ')
138 echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg
139
140 page-types -p `pidof init` --hwpoison # shall do nothing
141 page-types -p `pidof usemem` --hwpoison # poison its pages
142
143corrupt-filter-flags-mask
144corrupt-filter-flags-value
145
146When specified, only poison pages if ((page_flags & mask) == value).
147This allows stress testing of many kinds of pages. The page_flags
148are the same as in /proc/kpageflags. The flag bits are defined in
149include/linux/kernel-page-flags.h and documented in
150Documentation/vm/pagemap.txt
151
152Architecture specific MCE injector
153
154x86 has mce-inject, mce-test
155
156Some portable hwpoison test programs in mce-test, see blow.
157
158---
159
160References:
161
162http://halobates.de/mce-lc09-2.pdf
163 Overview presentation from LinuxCon 09
164
165git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git
166 Test suite (hwpoison specific portable tests in tsrc)
167
168git://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git
169 x86 specific injector
170
171
172---
173
174Limitations:
175
176- Not all page types are supported and never will. Most kernel internal
177objects cannot be recovered, only LRU pages for now.
178- Right now hugepage support is missing.
179
180---
181Andi Kleen, Oct 2009
182
diff --git a/Documentation/vm/ksm.txt b/Documentation/vm/ksm.txt
index 72a22f65960e..b392e496f816 100644
--- a/Documentation/vm/ksm.txt
+++ b/Documentation/vm/ksm.txt
@@ -16,9 +16,9 @@ by sharing the data common between them. But it can be useful to any
16application which generates many instances of the same data. 16application which generates many instances of the same data.
17 17
18KSM only merges anonymous (private) pages, never pagecache (file) pages. 18KSM only merges anonymous (private) pages, never pagecache (file) pages.
19KSM's merged pages are at present locked into kernel memory for as long 19KSM's merged pages were originally locked into kernel memory, but can now
20as they are shared: so cannot be swapped out like the user pages they 20be swapped out just like other user pages (but sharing is broken when they
21replace (but swapping KSM pages should follow soon in a later release). 21are swapped back in: ksmd must rediscover their identity and merge again).
22 22
23KSM only operates on those areas of address space which an application 23KSM only operates on those areas of address space which an application
24has advised to be likely candidates for merging, by using the madvise(2) 24has advised to be likely candidates for merging, by using the madvise(2)
@@ -44,23 +44,15 @@ includes unmapped gaps (though working on the intervening mapped areas),
44and might fail with EAGAIN if not enough memory for internal structures. 44and might fail with EAGAIN if not enough memory for internal structures.
45 45
46Applications should be considerate in their use of MADV_MERGEABLE, 46Applications should be considerate in their use of MADV_MERGEABLE,
47restricting its use to areas likely to benefit. KSM's scans may use 47restricting its use to areas likely to benefit. KSM's scans may use a lot
48a lot of processing power, and its kernel-resident pages are a limited 48of processing power: some installations will disable KSM for that reason.
49resource. Some installations will disable KSM for these reasons.
50 49
51The KSM daemon is controlled by sysfs files in /sys/kernel/mm/ksm/, 50The KSM daemon is controlled by sysfs files in /sys/kernel/mm/ksm/,
52readable by all but writable only by root: 51readable by all but writable only by root:
53 52
54max_kernel_pages - set to maximum number of kernel pages that KSM may use
55 e.g. "echo 2000 > /sys/kernel/mm/ksm/max_kernel_pages"
56 Value 0 imposes no limit on the kernel pages KSM may use;
57 but note that any process using MADV_MERGEABLE can cause
58 KSM to allocate these pages, unswappable until it exits.
59 Default: 2000 (chosen for demonstration purposes)
60
61pages_to_scan - how many present pages to scan before ksmd goes to sleep 53pages_to_scan - how many present pages to scan before ksmd goes to sleep
62 e.g. "echo 200 > /sys/kernel/mm/ksm/pages_to_scan" 54 e.g. "echo 100 > /sys/kernel/mm/ksm/pages_to_scan"
63 Default: 200 (chosen for demonstration purposes) 55 Default: 100 (chosen for demonstration purposes)
64 56
65sleep_millisecs - how many milliseconds ksmd should sleep before next scan 57sleep_millisecs - how many milliseconds ksmd should sleep before next scan
66 e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs" 58 e.g. "echo 20 > /sys/kernel/mm/ksm/sleep_millisecs"
@@ -70,11 +62,12 @@ run - set 0 to stop ksmd from running but keep merged pages,
70 set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run", 62 set 1 to run ksmd e.g. "echo 1 > /sys/kernel/mm/ksm/run",
71 set 2 to stop ksmd and unmerge all pages currently merged, 63 set 2 to stop ksmd and unmerge all pages currently merged,
72 but leave mergeable areas registered for next run 64 but leave mergeable areas registered for next run
73 Default: 1 (for immediate use by apps which register) 65 Default: 0 (must be changed to 1 to activate KSM,
66 except if CONFIG_SYSFS is disabled)
74 67
75The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: 68The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/:
76 69
77pages_shared - how many shared unswappable kernel pages KSM is using 70pages_shared - how many shared pages are being used
78pages_sharing - how many more sites are sharing them i.e. how much saved 71pages_sharing - how many more sites are sharing them i.e. how much saved
79pages_unshared - how many pages unique but repeatedly checked for merging 72pages_unshared - how many pages unique but repeatedly checked for merging
80pages_volatile - how many pages changing too fast to be placed in a tree 73pages_volatile - how many pages changing too fast to be placed in a tree
@@ -86,4 +79,4 @@ pages_volatile embraces several different kinds of activity, but a high
86proportion there would also indicate poor use of madvise MADV_MERGEABLE. 79proportion there would also indicate poor use of madvise MADV_MERGEABLE.
87 80
88Izik Eidus, 81Izik Eidus,
89Hugh Dickins, 30 July 2009 82Hugh Dickins, 17 Nov 2009
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c
index e2bdae37f499..9969c7d9f985 100644
--- a/Documentation/vm/map_hugetlb.c
+++ b/Documentation/vm/map_hugetlb.c
@@ -31,12 +31,12 @@
31#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) 31#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)
32#endif 32#endif
33 33
34void check_bytes(char *addr) 34static void check_bytes(char *addr)
35{ 35{
36 printf("First hex is %x\n", *((unsigned int *)addr)); 36 printf("First hex is %x\n", *((unsigned int *)addr));
37} 37}
38 38
39void write_bytes(char *addr) 39static void write_bytes(char *addr)
40{ 40{
41 unsigned long i; 41 unsigned long i;
42 42
@@ -44,7 +44,7 @@ void write_bytes(char *addr)
44 *(addr + i) = (char)i; 44 *(addr + i) = (char)i;
45} 45}
46 46
47void read_bytes(char *addr) 47static void read_bytes(char *addr)
48{ 48{
49 unsigned long i; 49 unsigned long i;
50 50
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index fa1a30d9e9d5..66e9358e2144 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -1,8 +1,22 @@
1/* 1/*
2 * page-types: Tool for querying page flags 2 * page-types: Tool for querying page flags
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should find a copy of v2 of the GNU General Public License somewhere on
14 * your Linux system; if not, write to the Free Software Foundation, Inc., 59
15 * Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16 *
4 * Copyright (C) 2009 Intel corporation 17 * Copyright (C) 2009 Intel corporation
5 * Copyright (C) 2009 Wu Fengguang <fengguang.wu@intel.com> 18 *
19 * Authors: Wu Fengguang <fengguang.wu@intel.com>
6 */ 20 */
7 21
8#define _LARGEFILE64_SOURCE 22#define _LARGEFILE64_SOURCE
@@ -69,7 +83,9 @@
69#define KPF_COMPOUND_TAIL 16 83#define KPF_COMPOUND_TAIL 16
70#define KPF_HUGE 17 84#define KPF_HUGE 17
71#define KPF_UNEVICTABLE 18 85#define KPF_UNEVICTABLE 18
86#define KPF_HWPOISON 19
72#define KPF_NOPAGE 20 87#define KPF_NOPAGE 20
88#define KPF_KSM 21
73 89
74/* [32-] kernel hacking assistances */ 90/* [32-] kernel hacking assistances */
75#define KPF_RESERVED 32 91#define KPF_RESERVED 32
@@ -95,7 +111,7 @@
95#define BIT(name) (1ULL << KPF_##name) 111#define BIT(name) (1ULL << KPF_##name)
96#define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL)) 112#define BITS_COMPOUND (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL))
97 113
98static char *page_flag_names[] = { 114static const char *page_flag_names[] = {
99 [KPF_LOCKED] = "L:locked", 115 [KPF_LOCKED] = "L:locked",
100 [KPF_ERROR] = "E:error", 116 [KPF_ERROR] = "E:error",
101 [KPF_REFERENCED] = "R:referenced", 117 [KPF_REFERENCED] = "R:referenced",
@@ -116,7 +132,9 @@ static char *page_flag_names[] = {
116 [KPF_COMPOUND_TAIL] = "T:compound_tail", 132 [KPF_COMPOUND_TAIL] = "T:compound_tail",
117 [KPF_HUGE] = "G:huge", 133 [KPF_HUGE] = "G:huge",
118 [KPF_UNEVICTABLE] = "u:unevictable", 134 [KPF_UNEVICTABLE] = "u:unevictable",
135 [KPF_HWPOISON] = "X:hwpoison",
119 [KPF_NOPAGE] = "n:nopage", 136 [KPF_NOPAGE] = "n:nopage",
137 [KPF_KSM] = "x:ksm",
120 138
121 [KPF_RESERVED] = "r:reserved", 139 [KPF_RESERVED] = "r:reserved",
122 [KPF_MLOCKED] = "m:mlocked", 140 [KPF_MLOCKED] = "m:mlocked",
@@ -152,9 +170,6 @@ static unsigned long opt_size[MAX_ADDR_RANGES];
152static int nr_vmas; 170static int nr_vmas;
153static unsigned long pg_start[MAX_VMAS]; 171static unsigned long pg_start[MAX_VMAS];
154static unsigned long pg_end[MAX_VMAS]; 172static unsigned long pg_end[MAX_VMAS];
155static unsigned long voffset;
156
157static int pagemap_fd;
158 173
159#define MAX_BIT_FILTERS 64 174#define MAX_BIT_FILTERS 64
160static int nr_bit_filters; 175static int nr_bit_filters;
@@ -163,9 +178,16 @@ static uint64_t opt_bits[MAX_BIT_FILTERS];
163 178
164static int page_size; 179static int page_size;
165 180
166#define PAGES_BATCH (64 << 10) /* 64k pages */ 181static int pagemap_fd;
167static int kpageflags_fd; 182static int kpageflags_fd;
168 183
184static int opt_hwpoison;
185static int opt_unpoison;
186
187static const char hwpoison_debug_fs[] = "/debug/hwpoison";
188static int hwpoison_inject_fd;
189static int hwpoison_forget_fd;
190
169#define HASH_SHIFT 13 191#define HASH_SHIFT 13
170#define HASH_SIZE (1 << HASH_SHIFT) 192#define HASH_SIZE (1 << HASH_SHIFT)
171#define HASH_MASK (HASH_SIZE - 1) 193#define HASH_MASK (HASH_SIZE - 1)
@@ -207,6 +229,74 @@ static void fatal(const char *x, ...)
207 exit(EXIT_FAILURE); 229 exit(EXIT_FAILURE);
208} 230}
209 231
232static int checked_open(const char *pathname, int flags)
233{
234 int fd = open(pathname, flags);
235
236 if (fd < 0) {
237 perror(pathname);
238 exit(EXIT_FAILURE);
239 }
240
241 return fd;
242}
243
244/*
245 * pagemap/kpageflags routines
246 */
247
248static unsigned long do_u64_read(int fd, char *name,
249 uint64_t *buf,
250 unsigned long index,
251 unsigned long count)
252{
253 long bytes;
254
255 if (index > ULONG_MAX / 8)
256 fatal("index overflow: %lu\n", index);
257
258 if (lseek(fd, index * 8, SEEK_SET) < 0) {
259 perror(name);
260 exit(EXIT_FAILURE);
261 }
262
263 bytes = read(fd, buf, count * 8);
264 if (bytes < 0) {
265 perror(name);
266 exit(EXIT_FAILURE);
267 }
268 if (bytes % 8)
269 fatal("partial read: %lu bytes\n", bytes);
270
271 return bytes / 8;
272}
273
274static unsigned long kpageflags_read(uint64_t *buf,
275 unsigned long index,
276 unsigned long pages)
277{
278 return do_u64_read(kpageflags_fd, PROC_KPAGEFLAGS, buf, index, pages);
279}
280
281static unsigned long pagemap_read(uint64_t *buf,
282 unsigned long index,
283 unsigned long pages)
284{
285 return do_u64_read(pagemap_fd, "/proc/pid/pagemap", buf, index, pages);
286}
287
288static unsigned long pagemap_pfn(uint64_t val)
289{
290 unsigned long pfn;
291
292 if (val & PM_PRESENT)
293 pfn = PM_PFRAME(val);
294 else
295 pfn = 0;
296
297 return pfn;
298}
299
210 300
211/* 301/*
212 * page flag names 302 * page flag names
@@ -222,7 +312,7 @@ static char *page_flag_name(uint64_t flags)
222 present = (flags >> i) & 1; 312 present = (flags >> i) & 1;
223 if (!page_flag_names[i]) { 313 if (!page_flag_names[i]) {
224 if (present) 314 if (present)
225 fatal("unkown flag bit %d\n", i); 315 fatal("unknown flag bit %d\n", i);
226 continue; 316 continue;
227 } 317 }
228 buf[j++] = present ? page_flag_names[i][0] : '_'; 318 buf[j++] = present ? page_flag_names[i][0] : '_';
@@ -255,7 +345,8 @@ static char *page_flag_longname(uint64_t flags)
255 * page list and summary 345 * page list and summary
256 */ 346 */
257 347
258static void show_page_range(unsigned long offset, uint64_t flags) 348static void show_page_range(unsigned long voffset,
349 unsigned long offset, uint64_t flags)
259{ 350{
260 static uint64_t flags0; 351 static uint64_t flags0;
261 static unsigned long voff; 352 static unsigned long voff;
@@ -281,7 +372,8 @@ static void show_page_range(unsigned long offset, uint64_t flags)
281 count = 1; 372 count = 1;
282} 373}
283 374
284static void show_page(unsigned long offset, uint64_t flags) 375static void show_page(unsigned long voffset,
376 unsigned long offset, uint64_t flags)
285{ 377{
286 if (opt_pid) 378 if (opt_pid)
287 printf("%lx\t", voffset); 379 printf("%lx\t", voffset);
@@ -362,6 +454,62 @@ static uint64_t well_known_flags(uint64_t flags)
362 return flags; 454 return flags;
363} 455}
364 456
457static uint64_t kpageflags_flags(uint64_t flags)
458{
459 flags = expand_overloaded_flags(flags);
460
461 if (!opt_raw)
462 flags = well_known_flags(flags);
463
464 return flags;
465}
466
467/*
468 * page actions
469 */
470
471static void prepare_hwpoison_fd(void)
472{
473 char buf[100];
474
475 if (opt_hwpoison && !hwpoison_inject_fd) {
476 sprintf(buf, "%s/corrupt-pfn", hwpoison_debug_fs);
477 hwpoison_inject_fd = checked_open(buf, O_WRONLY);
478 }
479
480 if (opt_unpoison && !hwpoison_forget_fd) {
481 sprintf(buf, "%s/renew-pfn", hwpoison_debug_fs);
482 hwpoison_forget_fd = checked_open(buf, O_WRONLY);
483 }
484}
485
486static int hwpoison_page(unsigned long offset)
487{
488 char buf[100];
489 int len;
490
491 len = sprintf(buf, "0x%lx\n", offset);
492 len = write(hwpoison_inject_fd, buf, len);
493 if (len < 0) {
494 perror("hwpoison inject");
495 return len;
496 }
497 return 0;
498}
499
500static int unpoison_page(unsigned long offset)
501{
502 char buf[100];
503 int len;
504
505 len = sprintf(buf, "0x%lx\n", offset);
506 len = write(hwpoison_forget_fd, buf, len);
507 if (len < 0) {
508 perror("hwpoison forget");
509 return len;
510 }
511 return 0;
512}
365 513
366/* 514/*
367 * page frame walker 515 * page frame walker
@@ -394,104 +542,83 @@ static int hash_slot(uint64_t flags)
394 exit(EXIT_FAILURE); 542 exit(EXIT_FAILURE);
395} 543}
396 544
397static void add_page(unsigned long offset, uint64_t flags) 545static void add_page(unsigned long voffset,
546 unsigned long offset, uint64_t flags)
398{ 547{
399 flags = expand_overloaded_flags(flags); 548 flags = kpageflags_flags(flags);
400
401 if (!opt_raw)
402 flags = well_known_flags(flags);
403 549
404 if (!bit_mask_ok(flags)) 550 if (!bit_mask_ok(flags))
405 return; 551 return;
406 552
553 if (opt_hwpoison)
554 hwpoison_page(offset);
555 if (opt_unpoison)
556 unpoison_page(offset);
557
407 if (opt_list == 1) 558 if (opt_list == 1)
408 show_page_range(offset, flags); 559 show_page_range(voffset, offset, flags);
409 else if (opt_list == 2) 560 else if (opt_list == 2)
410 show_page(offset, flags); 561 show_page(voffset, offset, flags);
411 562
412 nr_pages[hash_slot(flags)]++; 563 nr_pages[hash_slot(flags)]++;
413 total_pages++; 564 total_pages++;
414} 565}
415 566
416static void walk_pfn(unsigned long index, unsigned long count) 567#define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */
568static void walk_pfn(unsigned long voffset,
569 unsigned long index,
570 unsigned long count)
417{ 571{
572 uint64_t buf[KPAGEFLAGS_BATCH];
418 unsigned long batch; 573 unsigned long batch;
419 unsigned long n; 574 long pages;
420 unsigned long i; 575 unsigned long i;
421 576
422 if (index > ULONG_MAX / KPF_BYTES)
423 fatal("index overflow: %lu\n", index);
424
425 lseek(kpageflags_fd, index * KPF_BYTES, SEEK_SET);
426
427 while (count) { 577 while (count) {
428 uint64_t kpageflags_buf[KPF_BYTES * PAGES_BATCH]; 578 batch = min_t(unsigned long, count, KPAGEFLAGS_BATCH);
429 579 pages = kpageflags_read(buf, index, batch);
430 batch = min_t(unsigned long, count, PAGES_BATCH); 580 if (pages == 0)
431 n = read(kpageflags_fd, kpageflags_buf, batch * KPF_BYTES);
432 if (n == 0)
433 break; 581 break;
434 if (n < 0) {
435 perror(PROC_KPAGEFLAGS);
436 exit(EXIT_FAILURE);
437 }
438 582
439 if (n % KPF_BYTES != 0) 583 for (i = 0; i < pages; i++)
440 fatal("partial read: %lu bytes\n", n); 584 add_page(voffset + i, index + i, buf[i]);
441 n = n / KPF_BYTES;
442 585
443 for (i = 0; i < n; i++) 586 index += pages;
444 add_page(index + i, kpageflags_buf[i]); 587 count -= pages;
445
446 index += batch;
447 count -= batch;
448 } 588 }
449} 589}
450 590
451 591#define PAGEMAP_BATCH (64 << 10)
452#define PAGEMAP_BATCH 4096 592static void walk_vma(unsigned long index, unsigned long count)
453static unsigned long task_pfn(unsigned long pgoff)
454{ 593{
455 static uint64_t buf[PAGEMAP_BATCH]; 594 uint64_t buf[PAGEMAP_BATCH];
456 static unsigned long start; 595 unsigned long batch;
457 static long count; 596 unsigned long pages;
458 uint64_t pfn; 597 unsigned long pfn;
598 unsigned long i;
459 599
460 if (pgoff < start || pgoff >= start + count) { 600 while (count) {
461 if (lseek64(pagemap_fd, 601 batch = min_t(unsigned long, count, PAGEMAP_BATCH);
462 (uint64_t)pgoff * PM_ENTRY_BYTES, 602 pages = pagemap_read(buf, index, batch);
463 SEEK_SET) < 0) { 603 if (pages == 0)
464 perror("pagemap seek"); 604 break;
465 exit(EXIT_FAILURE);
466 }
467 count = read(pagemap_fd, buf, sizeof(buf));
468 if (count == 0)
469 return 0;
470 if (count < 0) {
471 perror("pagemap read");
472 exit(EXIT_FAILURE);
473 }
474 if (count % PM_ENTRY_BYTES) {
475 fatal("pagemap read not aligned.\n");
476 exit(EXIT_FAILURE);
477 }
478 count /= PM_ENTRY_BYTES;
479 start = pgoff;
480 }
481 605
482 pfn = buf[pgoff - start]; 606 for (i = 0; i < pages; i++) {
483 if (pfn & PM_PRESENT) 607 pfn = pagemap_pfn(buf[i]);
484 pfn = PM_PFRAME(pfn); 608 if (pfn)
485 else 609 walk_pfn(index + i, pfn, 1);
486 pfn = 0; 610 }
487 611
488 return pfn; 612 index += pages;
613 count -= pages;
614 }
489} 615}
490 616
491static void walk_task(unsigned long index, unsigned long count) 617static void walk_task(unsigned long index, unsigned long count)
492{ 618{
493 int i = 0;
494 const unsigned long end = index + count; 619 const unsigned long end = index + count;
620 unsigned long start;
621 int i = 0;
495 622
496 while (index < end) { 623 while (index < end) {
497 624
@@ -501,15 +628,11 @@ static void walk_task(unsigned long index, unsigned long count)
501 if (pg_start[i] >= end) 628 if (pg_start[i] >= end)
502 return; 629 return;
503 630
504 voffset = max_t(unsigned long, pg_start[i], index); 631 start = max_t(unsigned long, pg_start[i], index);
505 index = min_t(unsigned long, pg_end[i], end); 632 index = min_t(unsigned long, pg_end[i], end);
506 633
507 assert(voffset < index); 634 assert(start < index);
508 for (; voffset < index; voffset++) { 635 walk_vma(start, index - start);
509 unsigned long pfn = task_pfn(voffset);
510 if (pfn)
511 walk_pfn(pfn, 1);
512 }
513 } 636 }
514} 637}
515 638
@@ -527,18 +650,14 @@ static void walk_addr_ranges(void)
527{ 650{
528 int i; 651 int i;
529 652
530 kpageflags_fd = open(PROC_KPAGEFLAGS, O_RDONLY); 653 kpageflags_fd = checked_open(PROC_KPAGEFLAGS, O_RDONLY);
531 if (kpageflags_fd < 0) {
532 perror(PROC_KPAGEFLAGS);
533 exit(EXIT_FAILURE);
534 }
535 654
536 if (!nr_addr_ranges) 655 if (!nr_addr_ranges)
537 add_addr_range(0, ULONG_MAX); 656 add_addr_range(0, ULONG_MAX);
538 657
539 for (i = 0; i < nr_addr_ranges; i++) 658 for (i = 0; i < nr_addr_ranges; i++)
540 if (!opt_pid) 659 if (!opt_pid)
541 walk_pfn(opt_offset[i], opt_size[i]); 660 walk_pfn(0, opt_offset[i], opt_size[i]);
542 else 661 else
543 walk_task(opt_offset[i], opt_size[i]); 662 walk_task(opt_offset[i], opt_size[i]);
544 663
@@ -565,28 +684,35 @@ static void usage(void)
565 684
566 printf( 685 printf(
567"page-types [options]\n" 686"page-types [options]\n"
568" -r|--raw Raw mode, for kernel developers\n" 687" -r|--raw Raw mode, for kernel developers\n"
569" -a|--addr addr-spec Walk a range of pages\n" 688" -d|--describe flags Describe flags\n"
570" -b|--bits bits-spec Walk pages with specified bits\n" 689" -a|--addr addr-spec Walk a range of pages\n"
571" -p|--pid pid Walk process address space\n" 690" -b|--bits bits-spec Walk pages with specified bits\n"
691" -p|--pid pid Walk process address space\n"
572#if 0 /* planned features */ 692#if 0 /* planned features */
573" -f|--file filename Walk file address space\n" 693" -f|--file filename Walk file address space\n"
574#endif 694#endif
575" -l|--list Show page details in ranges\n" 695" -l|--list Show page details in ranges\n"
576" -L|--list-each Show page details one by one\n" 696" -L|--list-each Show page details one by one\n"
577" -N|--no-summary Don't show summay info\n" 697" -N|--no-summary Don't show summay info\n"
578" -h|--help Show this usage message\n" 698" -X|--hwpoison hwpoison pages\n"
699" -x|--unpoison unpoison pages\n"
700" -h|--help Show this usage message\n"
701"flags:\n"
702" 0x10 bitfield format, e.g.\n"
703" anon bit-name, e.g.\n"
704" 0x10,anon comma-separated list, e.g.\n"
579"addr-spec:\n" 705"addr-spec:\n"
580" N one page at offset N (unit: pages)\n" 706" N one page at offset N (unit: pages)\n"
581" N+M pages range from N to N+M-1\n" 707" N+M pages range from N to N+M-1\n"
582" N,M pages range from N to M-1\n" 708" N,M pages range from N to M-1\n"
583" N, pages range from N to end\n" 709" N, pages range from N to end\n"
584" ,M pages range from 0 to M-1\n" 710" ,M pages range from 0 to M-1\n"
585"bits-spec:\n" 711"bits-spec:\n"
586" bit1,bit2 (flags & (bit1|bit2)) != 0\n" 712" bit1,bit2 (flags & (bit1|bit2)) != 0\n"
587" bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n" 713" bit1,bit2=bit1 (flags & (bit1|bit2)) == bit1\n"
588" bit1,~bit2 (flags & (bit1|bit2)) == bit1\n" 714" bit1,~bit2 (flags & (bit1|bit2)) == bit1\n"
589" =bit1,bit2 flags == (bit1|bit2)\n" 715" =bit1,bit2 flags == (bit1|bit2)\n"
590"bit-names:\n" 716"bit-names:\n"
591 ); 717 );
592 718
@@ -624,11 +750,7 @@ static void parse_pid(const char *str)
624 opt_pid = parse_number(str); 750 opt_pid = parse_number(str);
625 751
626 sprintf(buf, "/proc/%d/pagemap", opt_pid); 752 sprintf(buf, "/proc/%d/pagemap", opt_pid);
627 pagemap_fd = open(buf, O_RDONLY); 753 pagemap_fd = checked_open(buf, O_RDONLY);
628 if (pagemap_fd < 0) {
629 perror(buf);
630 exit(EXIT_FAILURE);
631 }
632 754
633 sprintf(buf, "/proc/%d/maps", opt_pid); 755 sprintf(buf, "/proc/%d/maps", opt_pid);
634 file = fopen(buf, "r"); 756 file = fopen(buf, "r");
@@ -778,16 +900,28 @@ static void parse_bits_mask(const char *optarg)
778 add_bits_filter(mask, bits); 900 add_bits_filter(mask, bits);
779} 901}
780 902
903static void describe_flags(const char *optarg)
904{
905 uint64_t flags = parse_flag_names(optarg, 0);
906
907 printf("0x%016llx\t%s\t%s\n",
908 (unsigned long long)flags,
909 page_flag_name(flags),
910 page_flag_longname(flags));
911}
781 912
782static struct option opts[] = { 913static const struct option opts[] = {
783 { "raw" , 0, NULL, 'r' }, 914 { "raw" , 0, NULL, 'r' },
784 { "pid" , 1, NULL, 'p' }, 915 { "pid" , 1, NULL, 'p' },
785 { "file" , 1, NULL, 'f' }, 916 { "file" , 1, NULL, 'f' },
786 { "addr" , 1, NULL, 'a' }, 917 { "addr" , 1, NULL, 'a' },
787 { "bits" , 1, NULL, 'b' }, 918 { "bits" , 1, NULL, 'b' },
919 { "describe" , 1, NULL, 'd' },
788 { "list" , 0, NULL, 'l' }, 920 { "list" , 0, NULL, 'l' },
789 { "list-each" , 0, NULL, 'L' }, 921 { "list-each" , 0, NULL, 'L' },
790 { "no-summary", 0, NULL, 'N' }, 922 { "no-summary", 0, NULL, 'N' },
923 { "hwpoison" , 0, NULL, 'X' },
924 { "unpoison" , 0, NULL, 'x' },
791 { "help" , 0, NULL, 'h' }, 925 { "help" , 0, NULL, 'h' },
792 { NULL , 0, NULL, 0 } 926 { NULL , 0, NULL, 0 }
793}; 927};
@@ -799,7 +933,7 @@ int main(int argc, char *argv[])
799 page_size = getpagesize(); 933 page_size = getpagesize();
800 934
801 while ((c = getopt_long(argc, argv, 935 while ((c = getopt_long(argc, argv,
802 "rp:f:a:b:lLNh", opts, NULL)) != -1) { 936 "rp:f:a:b:d:lLNXxh", opts, NULL)) != -1) {
803 switch (c) { 937 switch (c) {
804 case 'r': 938 case 'r':
805 opt_raw = 1; 939 opt_raw = 1;
@@ -816,6 +950,9 @@ int main(int argc, char *argv[])
816 case 'b': 950 case 'b':
817 parse_bits_mask(optarg); 951 parse_bits_mask(optarg);
818 break; 952 break;
953 case 'd':
954 describe_flags(optarg);
955 exit(0);
819 case 'l': 956 case 'l':
820 opt_list = 1; 957 opt_list = 1;
821 break; 958 break;
@@ -825,6 +962,14 @@ int main(int argc, char *argv[])
825 case 'N': 962 case 'N':
826 opt_no_summary = 1; 963 opt_no_summary = 1;
827 break; 964 break;
965 case 'X':
966 opt_hwpoison = 1;
967 prepare_hwpoison_fd();
968 break;
969 case 'x':
970 opt_unpoison = 1;
971 prepare_hwpoison_fd();
972 break;
828 case 'h': 973 case 'h':
829 usage(); 974 usage();
830 exit(0); 975 exit(0);
@@ -844,7 +989,7 @@ int main(int argc, char *argv[])
844 walk_addr_ranges(); 989 walk_addr_ranges();
845 990
846 if (opt_list == 1) 991 if (opt_list == 1)
847 show_page_range(0, 0); /* drain the buffer */ 992 show_page_range(0, 0, 0); /* drain the buffer */
848 993
849 if (opt_no_summary) 994 if (opt_no_summary)
850 return 0; 995 return 0;
diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt
index 600a304a828c..df09b9650a81 100644
--- a/Documentation/vm/pagemap.txt
+++ b/Documentation/vm/pagemap.txt
@@ -57,7 +57,9 @@ There are three components to pagemap:
57 16. COMPOUND_TAIL 57 16. COMPOUND_TAIL
58 16. HUGE 58 16. HUGE
59 18. UNEVICTABLE 59 18. UNEVICTABLE
60 19. HWPOISON
60 20. NOPAGE 61 20. NOPAGE
62 21. KSM
61 63
62Short descriptions to the page flags: 64Short descriptions to the page flags:
63 65
@@ -86,9 +88,15 @@ Short descriptions to the page flags:
8617. HUGE 8817. HUGE
87 this is an integral part of a HugeTLB page 89 this is an integral part of a HugeTLB page
88 90
9119. HWPOISON
92 hardware detected memory corruption on this page: don't touch the data!
93
8920. NOPAGE 9420. NOPAGE
90 no page frame exists at the requested address 95 no page frame exists at the requested address
91 96
9721. KSM
98 identical memory pages dynamically shared between one or more processes
99
92 [IO related page flags] 100 [IO related page flags]
93 1. ERROR IO error occurred 101 1. ERROR IO error occurred
94 3. UPTODATE page has up-to-date data 102 3. UPTODATE page has up-to-date data
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index 510917ff59ed..07375e73981a 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -41,6 +41,7 @@ Possible debug options are
41 P Poisoning (object and padding) 41 P Poisoning (object and padding)
42 U User tracking (free and alloc) 42 U User tracking (free and alloc)
43 T Trace (please only use on single slabs) 43 T Trace (please only use on single slabs)
44 A Toggle failslab filter mark for the cache
44 O Switch debugging off for caches that would have 45 O Switch debugging off for caches that would have
45 caused higher minimum slab orders 46 caused higher minimum slab orders
46 - Switch all debugging off (useful if the kernel is 47 - Switch all debugging off (useful if the kernel is
@@ -245,7 +246,7 @@ been overwritten. Here a string of 8 characters was written into a slab that
245has the length of 8 characters. However, a 8 character string needs a 246has the length of 8 characters. However, a 8 character string needs a
246terminating 0. That zero has overwritten the first byte of the Redzone field. 247terminating 0. That zero has overwritten the first byte of the Redzone field.
247After reporting the details of the issue encountered the FIX SLUB message 248After reporting the details of the issue encountered the FIX SLUB message
248tell us that SLUB has restored the Redzone to its proper value and then 249tells us that SLUB has restored the Redzone to its proper value and then
249system operations continue. 250system operations continue.
250 251
251Emergency operations: 252Emergency operations:
diff --git a/Documentation/voyager.txt b/Documentation/voyager.txt
deleted file mode 100644
index 2749af552cdf..000000000000
--- a/Documentation/voyager.txt
+++ /dev/null
@@ -1,95 +0,0 @@
1Running Linux on the Voyager Architecture
2=========================================
3
4For full details and current project status, see
5
6http://www.hansenpartnership.com/voyager
7
8The voyager architecture was designed by NCR in the mid 80s to be a
9fully SMP capable RAS computing architecture built around intel's 486
10chip set. The voyager came in three levels of architectural
11sophistication: 3,4 and 5 --- 1 and 2 never made it out of prototype.
12The linux patches support only the Level 5 voyager architecture (any
13machine class 3435 and above).
14
15The Voyager Architecture
16------------------------
17
18Voyager machines consist of a Baseboard with a 386 diagnostic
19processor, a Power Supply Interface (PSI) a Primary and possibly
20Secondary Microchannel bus and between 2 and 20 voyager slots. The
21voyager slots can be populated with memory and cpu cards (up to 4GB
22memory and from 1 486 to 32 Pentium Pro processors). Internally, the
23voyager has a dual arbitrated system bus and a configuration and test
24bus (CAT). The voyager bus speed is 40MHz. Therefore (since all
25voyager cards are dual ported for each system bus) the maximum
26transfer rate is 320Mb/s but only if you have your slot configuration
27tuned (only memory cards can communicate with both busses at once, CPU
28cards utilise them one at a time).
29
30Voyager SMP
31-----------
32
33Since voyager was the first intel based SMP system, it is slightly
34more primitive than the Intel IO-APIC approach to SMP. Voyager allows
35arbitrary interrupt routing (including processor affinity routing) of
36all 16 PC type interrupts. However it does this by using a modified
375259 master/slave chip set instead of an APIC bus. Additionally,
38voyager supports Cross Processor Interrupts (CPI) equivalent to the
39APIC IPIs. There are two routed voyager interrupt lines provided to
40each slot.
41
42Processor Cards
43---------------
44
45These come in single, dyadic and quad configurations (the quads are
46problematic--see later). The maximum configuration is 8 quad cards
47for 32 way SMP.
48
49Quad Processors
50---------------
51
52Because voyager only supplies two interrupt lines to each Processor
53card, the Quad processors have to be configured (and Bootstrapped) in
54as a pair of Master/Slave processors.
55
56In fact, most Quad cards only accept one VIC interrupt line, so they
57have one interrupt handling processor (called the VIC extended
58processor) and three non-interrupt handling processors.
59
60Current Status
61--------------
62
63The System will boot on Mono, Dyad and Quad cards. There was
64originally a Quad boot problem which has been fixed by proper gdt
65alignment in the initial boot loader. If you still cannot get your
66voyager system to boot, email me at:
67
68<J.E.J.Bottomley@HansenPartnership.com>
69
70
71The Quad cards now support using the separate Quad CPI vectors instead
72of going through the VIC mailbox system.
73
74The Level 4 architecture (3430 and 3360 Machines) should also work
75fine.
76
77Dump Switch
78-----------
79
80The voyager dump switch sends out a broadcast NMI which the voyager
81code intercepts and does a task dump.
82
83Power Switch
84------------
85
86The front panel power switch is intercepted by the kernel and should
87cause a system shutdown and power off.
88
89A Note About Mixed CPU Systems
90------------------------------
91
92Linux isn't designed to handle mixed CPU systems very well. In order
93to get everything going you *must* make sure that your lowest
94capability CPU is used for booting. Also, mixing CPU classes
95(e.g. 486 and 586) is really not going to work very well at all.
diff --git a/Documentation/w1/masters/ds2482 b/Documentation/w1/masters/ds2482
index 9210d6fa5024..299b91c7609f 100644
--- a/Documentation/w1/masters/ds2482
+++ b/Documentation/w1/masters/ds2482
@@ -24,8 +24,8 @@ General Remarks
24 24
25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b. 25Valid addresses are 0x18, 0x19, 0x1a, and 0x1b.
26However, the device cannot be detected without writing to the i2c bus, so no 26However, the device cannot be detected without writing to the i2c bus, so no
27detection is done. 27detection is done. You should instantiate the device explicitly.
28You should force the device address.
29 28
30$ modprobe ds2482 force=0,0x18 29$ modprobe ds2482
30$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
31 31
diff --git a/Documentation/x86/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index 29a6ff8bc7d3..7fbbaf85f5b7 100644
--- a/Documentation/x86/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -166,19 +166,13 @@ NUMA
166 166
167 numa=noacpi Don't parse the SRAT table for NUMA setup 167 numa=noacpi Don't parse the SRAT table for NUMA setup
168 168
169 numa=fake=CMDLINE 169 numa=fake=<size>[MG]
170 If a number, fakes CMDLINE nodes and ignores NUMA setup of the 170 If given as a memory unit, fills all system RAM with nodes of
171 actual machine. Otherwise, system memory is configured 171 size interleaved over physical nodes.
172 depending on the sizes and coefficients listed. For example: 172
173 numa=fake=2*512,1024,4*256,*128 173 numa=fake=<N>
174 gives two 512M nodes, a 1024M node, four 256M nodes, and the 174 If given as an integer, fills all system RAM with N fake nodes
175 rest split into 128M chunks. If the last character of CMDLINE 175 interleaved over physical nodes.
176 is a *, the remaining memory is divided up equally among its
177 coefficient:
178 numa=fake=2*512,2*
179 gives two 512M nodes and the rest split into two nodes.
180 Otherwise, the remaining system RAM is allocated to an
181 additional node.
182 176
183ACPI 177ACPI
184 178