aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/00-INDEX6
-rw-r--r--Documentation/ABI/testing/sysfs-block34
-rw-r--r--Documentation/ABI/testing/sysfs-bus-css35
-rw-r--r--Documentation/ABI/testing/sysfs-class-regulator315
-rw-r--r--Documentation/ABI/testing/sysfs-dev20
-rw-r--r--Documentation/ABI/testing/sysfs-devices-memory24
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-acpi127
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-memmap71
-rw-r--r--Documentation/ABI/testing/sysfs-firmware-sgi_uv27
-rw-r--r--Documentation/ABI/testing/sysfs-gpio26
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-mm6
-rw-r--r--Documentation/ABI/testing/sysfs-kernel-mm-hugepages15
-rw-r--r--Documentation/CodingStyle42
-rw-r--r--Documentation/DMA-API.txt6
-rw-r--r--Documentation/DMA-attributes.txt9
-rw-r--r--Documentation/DMA-mapping.txt2
-rw-r--r--Documentation/DocBook/Makefile9
-rw-r--r--Documentation/DocBook/gadget.tmpl38
-rw-r--r--Documentation/DocBook/kernel-api.tmpl5
-rw-r--r--Documentation/DocBook/kernel-locking.tmpl57
-rw-r--r--Documentation/DocBook/kgdb.tmpl38
-rw-r--r--Documentation/DocBook/mac80211.tmpl12
-rw-r--r--Documentation/DocBook/procfs-guide.tmpl4
-rw-r--r--Documentation/DocBook/procfs_example.c4
-rw-r--r--Documentation/DocBook/s390-drivers.tmpl8
-rw-r--r--Documentation/DocBook/sh.tmpl105
-rw-r--r--Documentation/DocBook/uio-howto.tmpl63
-rw-r--r--Documentation/DocBook/videobook.tmpl2
-rw-r--r--Documentation/DocBook/z8530book.tmpl38
-rw-r--r--Documentation/HOWTO7
-rw-r--r--Documentation/IRQ-affinity.txt37
-rw-r--r--Documentation/Intel-IOMMU.txt4
-rw-r--r--Documentation/Makefile3
-rw-r--r--Documentation/RCU/NMI-RCU.txt3
-rw-r--r--Documentation/RCU/RTFP.txt108
-rw-r--r--Documentation/RCU/checklist.txt89
-rw-r--r--Documentation/RCU/rcuref.txt16
-rw-r--r--Documentation/RCU/torture.txt48
-rw-r--r--Documentation/RCU/whatisRCU.txt58
-rw-r--r--Documentation/SELinux.txt27
-rw-r--r--Documentation/SubmitChecklist2
-rw-r--r--Documentation/SubmittingPatches26
-rw-r--r--Documentation/accounting/Makefile10
-rw-r--r--Documentation/accounting/delay-accounting.txt11
-rw-r--r--Documentation/accounting/getdelays.c29
-rw-r--r--Documentation/accounting/taskstats-struct.txt15
-rw-r--r--Documentation/arm/IXP4xx2
-rw-r--r--Documentation/arm/Interrupts12
-rw-r--r--Documentation/arm/README4
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt23
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Overview.txt37
-rw-r--r--Documentation/arm/Samsung-S3C24XX/USB-Host.txt2
-rw-r--r--Documentation/auxdisplay/Makefile10
-rw-r--r--Documentation/auxdisplay/cfag12864b4
-rw-r--r--Documentation/auxdisplay/cfag12864b-example.c2
-rw-r--r--Documentation/auxdisplay/ks01084
-rw-r--r--Documentation/block/data-integrity.txt327
-rw-r--r--Documentation/block/deadline-iosched.txt14
-rw-r--r--Documentation/bt8xxgpio.txt67
-rw-r--r--Documentation/cciss.txt21
-rw-r--r--Documentation/cdrom/ide-cd3
-rw-r--r--Documentation/cgroups.txt4
-rw-r--r--Documentation/cli-sti-removal.txt133
-rw-r--r--Documentation/connector/Makefile11
-rw-r--r--Documentation/controllers/devices.txt8
-rw-r--r--Documentation/controllers/memory.txt3
-rw-r--r--Documentation/cpu-freq/governors.txt2
-rw-r--r--Documentation/cpu-freq/index.txt10
-rw-r--r--Documentation/cpu-hotplug.txt5
-rw-r--r--Documentation/cpusets.txt29
-rw-r--r--Documentation/cputopology.txt26
-rw-r--r--Documentation/devices.txt3
-rw-r--r--Documentation/dontdiff2
-rw-r--r--Documentation/edac.txt153
-rw-r--r--Documentation/fb/sh7760fb.txt131
-rw-r--r--Documentation/fb/tridentfb.txt46
-rw-r--r--Documentation/feature-removal-schedule.txt143
-rw-r--r--Documentation/filesystems/Locking22
-rw-r--r--Documentation/filesystems/bfs.txt10
-rw-r--r--Documentation/filesystems/configfs/Makefile3
-rw-r--r--Documentation/filesystems/configfs/configfs.txt17
-rw-r--r--Documentation/filesystems/configfs/configfs_example_explicit.c (renamed from Documentation/filesystems/configfs/configfs_example.c)22
-rw-r--r--Documentation/filesystems/configfs/configfs_example_macros.c448
-rw-r--r--Documentation/filesystems/ext4.txt135
-rw-r--r--Documentation/filesystems/fiemap.txt228
-rw-r--r--Documentation/filesystems/gfs2-glocks.txt114
-rw-r--r--Documentation/filesystems/nfs-rdma.txt103
-rw-r--r--Documentation/filesystems/ntfs.txt4
-rw-r--r--Documentation/filesystems/omfs.txt106
-rw-r--r--Documentation/filesystems/proc.txt163
-rw-r--r--Documentation/filesystems/quota.txt22
-rw-r--r--Documentation/filesystems/relay.txt10
-rw-r--r--Documentation/filesystems/sysfs.txt6
-rw-r--r--Documentation/filesystems/ubifs.txt164
-rw-r--r--Documentation/filesystems/vfat.txt8
-rw-r--r--Documentation/filesystems/vfs.txt6
-rw-r--r--Documentation/ftrace.txt1361
-rw-r--r--Documentation/gpio.txt135
-rw-r--r--Documentation/hwmon/adt747318
-rw-r--r--Documentation/hwmon/dme173757
-rw-r--r--Documentation/hwmon/ibmaem33
-rw-r--r--Documentation/hwmon/it8713
-rw-r--r--Documentation/hwmon/lm8511
-rw-r--r--Documentation/hwmon/sysfs-interface45
-rw-r--r--Documentation/hwmon/w83627hf4
-rw-r--r--Documentation/hwmon/w83791d6
-rw-r--r--Documentation/i2c/busses/i2c-i81047
-rw-r--r--Documentation/i2c/busses/i2c-prosavage23
-rw-r--r--Documentation/i2c/busses/i2c-savage426
-rw-r--r--Documentation/i2c/chips/max68752
-rw-r--r--Documentation/i2c/chips/pca953910
-rw-r--r--Documentation/i2c/chips/pcf857412
-rw-r--r--Documentation/i2c/chips/pcf85759
-rw-r--r--Documentation/i2c/fault-codes127
-rw-r--r--Documentation/i2c/smbus-protocol4
-rw-r--r--Documentation/i2c/upgrading-clients281
-rw-r--r--Documentation/i2c/writing-clients69
-rw-r--r--Documentation/ia64/Makefile8
-rw-r--r--Documentation/ia64/kvm.txt8
-rw-r--r--Documentation/ia64/paravirt_ops.txt137
-rw-r--r--Documentation/input/cs461x.txt2
-rw-r--r--Documentation/input/gameport-programming.txt2
-rw-r--r--Documentation/input/input.txt1
-rw-r--r--Documentation/input/joystick-api.txt2
-rw-r--r--Documentation/input/joystick-parport.txt1
-rw-r--r--Documentation/input/joystick.txt1
-rw-r--r--Documentation/ioctl-number.txt2
-rw-r--r--Documentation/ioctl/cdrom.txt4
-rw-r--r--Documentation/ioctl/hdio.txt7
-rw-r--r--Documentation/ioctl/ioctl-decoding.txt4
-rw-r--r--Documentation/iostats.txt2
-rw-r--r--Documentation/isdn/README.mISDN6
-rw-r--r--Documentation/ja_JP/HOWTO67
-rw-r--r--Documentation/ja_JP/SubmitChecklist111
-rw-r--r--Documentation/kdump/kdump.txt22
-rw-r--r--Documentation/kernel-doc-nano-HOWTO.txt4
-rw-r--r--Documentation/kernel-parameters.txt191
-rw-r--r--Documentation/keys.txt2
-rw-r--r--Documentation/kprobes.txt1
-rw-r--r--Documentation/laptops/acer-wmi.txt2
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt37
-rw-r--r--Documentation/leds-class.txt2
-rw-r--r--Documentation/lguest/lguest.c522
-rw-r--r--Documentation/local_ops.txt2
-rw-r--r--Documentation/md.txt30
-rw-r--r--Documentation/moxa-smartio392
-rw-r--r--Documentation/networking/LICENSE.qlge46
-rw-r--r--Documentation/networking/Makefile8
-rw-r--r--Documentation/networking/bonding.txt112
-rw-r--r--Documentation/networking/can.txt48
-rw-r--r--Documentation/networking/dm9000.txt167
-rw-r--r--Documentation/networking/e1000.txt14
-rw-r--r--Documentation/networking/ifenslave.c2
-rw-r--r--Documentation/networking/ip-sysctl.txt289
-rw-r--r--Documentation/networking/ixgb.txt419
-rw-r--r--Documentation/networking/mac80211_hwsim/README67
-rw-r--r--Documentation/networking/mac80211_hwsim/hostapd.conf11
-rw-r--r--Documentation/networking/mac80211_hwsim/wpa_supplicant.conf10
-rw-r--r--Documentation/networking/multiqueue.txt100
-rw-r--r--Documentation/networking/packet_mmap.txt2
-rw-r--r--Documentation/networking/phonet.txt175
-rw-r--r--Documentation/networking/regulatory.txt194
-rw-r--r--Documentation/networking/s2io.txt13
-rw-r--r--Documentation/networking/tc-actions-env-rules.txt15
-rw-r--r--Documentation/networking/tproxy.txt85
-rw-r--r--Documentation/networking/udplite.txt2
-rw-r--r--Documentation/nmi_watchdog.txt16
-rw-r--r--Documentation/pcmcia/Makefile10
-rw-r--r--Documentation/pcmcia/crc32hash.c2
-rw-r--r--Documentation/power/00-INDEX4
-rw-r--r--Documentation/power/apm-acpi.txt32
-rw-r--r--Documentation/power/pm.txt257
-rw-r--r--Documentation/power/pm_qos_interface.txt7
-rw-r--r--Documentation/power/power_supply_class.txt4
-rw-r--r--Documentation/power/regulator/consumer.txt182
-rw-r--r--Documentation/power/regulator/machine.txt101
-rw-r--r--Documentation/power/regulator/overview.txt171
-rw-r--r--Documentation/power/regulator/regulator.txt30
-rw-r--r--Documentation/powerpc/00-INDEX2
-rw-r--r--Documentation/powerpc/SBC8260_memory_mapping.txt197
-rw-r--r--Documentation/powerpc/booting-without-of.txt1304
-rw-r--r--Documentation/powerpc/bootwrapper.txt141
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/board.txt29
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt67
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt21
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt41
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt18
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt15
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt38
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt45
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt58
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt24
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt51
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt60
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt70
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt37
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt32
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/diu.txt18
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/dma.txt127
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/gtm.txt31
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/guts.txt25
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/i2c.txt32
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/lbc.txt35
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt17
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/msi-pic.txt36
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/pmc.txt63
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/sata.txt29
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/sec.txt68
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/spi.txt24
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/ssi.txt38
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/tsec.txt62
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/upm-nand.txt28
-rw-r--r--Documentation/powerpc/dts-bindings/fsl/usb.txt59
-rw-r--r--Documentation/powerpc/dts-bindings/gpio/led.txt15
-rw-r--r--Documentation/powerpc/eeh-pci-error-recovery.txt2
-rw-r--r--Documentation/powerpc/qe_firmware.txt2
-rw-r--r--Documentation/rfkill.txt588
-rw-r--r--Documentation/s390/CommonIO11
-rw-r--r--Documentation/s390/driver-model.txt2
-rw-r--r--Documentation/scheduler/sched-design-CFS.txt395
-rw-r--r--Documentation/scheduler/sched-domains.txt7
-rw-r--r--Documentation/scheduler/sched-rt-group.txt4
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas23
-rw-r--r--Documentation/scsi/aacraid.txt24
-rw-r--r--Documentation/scsi/ibmmca.txt6
-rw-r--r--Documentation/scsi/lpfc.txt2
-rw-r--r--Documentation/scsi/scsi_fc_transport.txt42
-rw-r--r--Documentation/serial/driver11
-rw-r--r--Documentation/sh/clk.txt2
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt88
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt10
-rw-r--r--Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl2
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl66
-rw-r--r--Documentation/sound/alsa/hda_codec.txt2
-rw-r--r--Documentation/sound/alsa/soc/dapm.txt14
-rw-r--r--Documentation/sparse.txt8
-rw-r--r--Documentation/specialix.txt8
-rw-r--r--Documentation/spi/Makefile11
-rw-r--r--Documentation/spi/pxa2xx4
-rw-r--r--Documentation/spi/spi-summary4
-rw-r--r--Documentation/sysctl/kernel.txt7
-rw-r--r--Documentation/sysctl/vm.txt2
-rw-r--r--Documentation/sysfs-rules.txt5
-rw-r--r--Documentation/telephony/ixj.txt13
-rw-r--r--Documentation/timers/highres.txt2
-rw-r--r--Documentation/tracers/mmiotrace.txt164
-rw-r--r--Documentation/unaligned-memory-access.txt32
-rw-r--r--Documentation/usb/anchors.txt12
-rw-r--r--Documentation/usb/auerswald.txt30
-rw-r--r--Documentation/usb/authorization.txt2
-rw-r--r--Documentation/usb/gadget_serial.txt35
-rw-r--r--Documentation/usb/persist.txt7
-rw-r--r--Documentation/usb/power-management.txt7
-rw-r--r--Documentation/usb/uhci.txt165
-rw-r--r--Documentation/video4linux/CARDLIST.au08284
-rw-r--r--Documentation/video4linux/CARDLIST.cx238851
-rw-r--r--Documentation/video4linux/CARDLIST.em28xx50
-rw-r--r--Documentation/video4linux/CARDLIST.saa71348
-rw-r--r--Documentation/video4linux/Makefile8
-rw-r--r--Documentation/video4linux/cx18.txt36
-rw-r--r--Documentation/video4linux/gspca.txt248
-rw-r--r--Documentation/video4linux/sn9c102.txt2
-rw-r--r--Documentation/video4linux/w9968cf.txt3
-rw-r--r--Documentation/vm/Makefile8
-rw-r--r--Documentation/vm/hugetlbpage.txt25
-rw-r--r--Documentation/vm/numa_memory_policy.txt4
-rw-r--r--Documentation/vm/page_migration9
-rw-r--r--Documentation/vm/slabinfo.c4
-rw-r--r--Documentation/vm/slub.txt2
-rw-r--r--Documentation/volatile-considered-harmful.txt2
-rw-r--r--Documentation/watchdog/src/Makefile8
-rw-r--r--Documentation/x86/00-INDEX4
-rw-r--r--Documentation/x86/boot.txt (renamed from Documentation/i386/boot.txt)81
-rw-r--r--Documentation/x86/i386/IO-APIC.txt (renamed from Documentation/i386/IO-APIC.txt)0
-rw-r--r--Documentation/x86/mtrr.txt (renamed from Documentation/mtrr.txt)4
-rw-r--r--Documentation/x86/pat.txt54
-rw-r--r--Documentation/x86/usb-legacy-support.txt (renamed from Documentation/i386/usb-legacy-support.txt)0
-rw-r--r--Documentation/x86/x86_64/00-INDEX (renamed from Documentation/x86_64/00-INDEX)0
-rw-r--r--Documentation/x86/x86_64/boot-options.txt (renamed from Documentation/x86_64/boot-options.txt)4
-rw-r--r--Documentation/x86/x86_64/cpu-hotplug-spec (renamed from Documentation/x86_64/cpu-hotplug-spec)0
-rw-r--r--Documentation/x86/x86_64/fake-numa-for-cpusets (renamed from Documentation/x86_64/fake-numa-for-cpusets)0
-rw-r--r--Documentation/x86/x86_64/kernel-stacks (renamed from Documentation/x86_64/kernel-stacks)0
-rw-r--r--Documentation/x86/x86_64/machinecheck (renamed from Documentation/x86_64/machinecheck)0
-rw-r--r--Documentation/x86/x86_64/mm.txt (renamed from Documentation/x86_64/mm.txt)5
-rw-r--r--Documentation/x86/x86_64/uefi.txt (renamed from Documentation/x86_64/uefi.txt)4
-rw-r--r--Documentation/x86/zero-page.txt (renamed from Documentation/i386/zero-page.txt)0
286 files changed, 12370 insertions, 3919 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 1977fab38656..73060819ed99 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -89,8 +89,6 @@ cciss.txt
89 - info, major/minor #'s for Compaq's SMART Array Controllers. 89 - info, major/minor #'s for Compaq's SMART Array Controllers.
90cdrom/ 90cdrom/
91 - directory with information on the CD-ROM drivers that Linux has. 91 - directory with information on the CD-ROM drivers that Linux has.
92cli-sti-removal.txt
93 - cli()/sti() removal guide.
94computone.txt 92computone.txt
95 - info on Computone Intelliport II/Plus Multiport Serial Driver. 93 - info on Computone Intelliport II/Plus Multiport Serial Driver.
96connector/ 94connector/
@@ -253,8 +251,6 @@ mono.txt
253 - how to execute Mono-based .NET binaries with the help of BINFMT_MISC. 251 - how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
254moxa-smartio 252moxa-smartio
255 - file with info on installing/using Moxa multiport serial driver. 253 - file with info on installing/using Moxa multiport serial driver.
256mtrr.txt
257 - how to use PPro Memory Type Range Registers to increase performance.
258mutex-design.txt 254mutex-design.txt
259 - info on the generic mutex subsystem. 255 - info on the generic mutex subsystem.
260namespaces/ 256namespaces/
@@ -361,8 +357,6 @@ telephony/
361 - directory with info on telephony (e.g. voice over IP) support. 357 - directory with info on telephony (e.g. voice over IP) support.
362time_interpolators.txt 358time_interpolators.txt
363 - info on time interpolators. 359 - info on time interpolators.
364tipar.txt
365 - information about Parallel link cable for Texas Instruments handhelds.
366tty.txt 360tty.txt
367 - guide to the locking policies of the tty layer. 361 - guide to the locking policies of the tty layer.
368uml/ 362uml/
diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI/testing/sysfs-block
index 4bd9ea539129..44f52a4f5903 100644
--- a/Documentation/ABI/testing/sysfs-block
+++ b/Documentation/ABI/testing/sysfs-block
@@ -26,3 +26,37 @@ Description:
26 I/O statistics of partition <part>. The format is the 26 I/O statistics of partition <part>. The format is the
27 same as the above-written /sys/block/<disk>/stat 27 same as the above-written /sys/block/<disk>/stat
28 format. 28 format.
29
30
31What: /sys/block/<disk>/integrity/format
32Date: June 2008
33Contact: Martin K. Petersen <martin.petersen@oracle.com>
34Description:
35 Metadata format for integrity capable block device.
36 E.g. T10-DIF-TYPE1-CRC.
37
38
39What: /sys/block/<disk>/integrity/read_verify
40Date: June 2008
41Contact: Martin K. Petersen <martin.petersen@oracle.com>
42Description:
43 Indicates whether the block layer should verify the
44 integrity of read requests serviced by devices that
45 support sending integrity metadata.
46
47
48What: /sys/block/<disk>/integrity/tag_size
49Date: June 2008
50Contact: Martin K. Petersen <martin.petersen@oracle.com>
51Description:
52 Number of bytes of integrity tag space available per
53 512 bytes of data.
54
55
56What: /sys/block/<disk>/integrity/write_generate
57Date: June 2008
58Contact: Martin K. Petersen <martin.petersen@oracle.com>
59Description:
60 Indicates whether the block layer should automatically
61 generate checksums for write requests bound for
62 devices that support receiving integrity metadata.
diff --git a/Documentation/ABI/testing/sysfs-bus-css b/Documentation/ABI/testing/sysfs-bus-css
new file mode 100644
index 000000000000..b585ec258a08
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-css
@@ -0,0 +1,35 @@
1What: /sys/bus/css/devices/.../type
2Date: March 2008
3Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
4 linux-s390@vger.kernel.org
5Description: Contains the subchannel type, as reported by the hardware.
6 This attribute is present for all subchannel types.
7
8What: /sys/bus/css/devices/.../modalias
9Date: March 2008
10Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
11 linux-s390@vger.kernel.org
12Description: Contains the module alias as reported with uevents.
13 It is of the format css:t<type> and present for all
14 subchannel types.
15
16What: /sys/bus/css/drivers/io_subchannel/.../chpids
17Date: December 2002
18Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
19 linux-s390@vger.kernel.org
20Description: Contains the ids of the channel paths used by this
21 subchannel, as reported by the channel subsystem
22 during subchannel recognition.
23 Note: This is an I/O-subchannel specific attribute.
24Users: s390-tools, HAL
25
26What: /sys/bus/css/drivers/io_subchannel/.../pimpampom
27Date: December 2002
28Contact: Cornelia Huck <cornelia.huck@de.ibm.com>
29 linux-s390@vger.kernel.org
30Description: Contains the PIM/PAM/POM values, as reported by the
31 channel subsystem when last queried by the common I/O
32 layer (this implies that this attribute is not neccessarily
33 in sync with the values current in the channel subsystem).
34 Note: This is an I/O-subchannel specific attribute.
35Users: s390-tools, HAL
diff --git a/Documentation/ABI/testing/sysfs-class-regulator b/Documentation/ABI/testing/sysfs-class-regulator
new file mode 100644
index 000000000000..79a4a75b2d2c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-regulator
@@ -0,0 +1,315 @@
1What: /sys/class/regulator/.../state
2Date: April 2008
3KernelVersion: 2.6.26
4Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
5Description:
6 Each regulator directory will contain a field called
7 state. This holds the regulator output state.
8
9 This will be one of the following strings:
10
11 'enabled'
12 'disabled'
13 'unknown'
14
15 'enabled' means the regulator output is ON and is supplying
16 power to the system.
17
18 'disabled' means the regulator output is OFF and is not
19 supplying power to the system..
20
21 'unknown' means software cannot determine the state.
22
23 NOTE: this field can be used in conjunction with microvolts
24 and microamps to determine regulator output levels.
25
26
27What: /sys/class/regulator/.../type
28Date: April 2008
29KernelVersion: 2.6.26
30Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
31Description:
32 Each regulator directory will contain a field called
33 type. This holds the regulator type.
34
35 This will be one of the following strings:
36
37 'voltage'
38 'current'
39 'unknown'
40
41 'voltage' means the regulator output voltage can be controlled
42 by software.
43
44 'current' means the regulator output current limit can be
45 controlled by software.
46
47 'unknown' means software cannot control either voltage or
48 current limit.
49
50
51What: /sys/class/regulator/.../microvolts
52Date: April 2008
53KernelVersion: 2.6.26
54Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
55Description:
56 Each regulator directory will contain a field called
57 microvolts. This holds the regulator output voltage setting
58 measured in microvolts (i.e. E-6 Volts).
59
60 NOTE: This value should not be used to determine the regulator
61 output voltage level as this value is the same regardless of
62 whether the regulator is enabled or disabled.
63
64
65What: /sys/class/regulator/.../microamps
66Date: April 2008
67KernelVersion: 2.6.26
68Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
69Description:
70 Each regulator directory will contain a field called
71 microamps. This holds the regulator output current limit
72 setting measured in microamps (i.e. E-6 Amps).
73
74 NOTE: This value should not be used to determine the regulator
75 output current level as this value is the same regardless of
76 whether the regulator is enabled or disabled.
77
78
79What: /sys/class/regulator/.../opmode
80Date: April 2008
81KernelVersion: 2.6.26
82Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
83Description:
84 Each regulator directory will contain a field called
85 opmode. This holds the regulator operating mode setting.
86
87 The opmode value can be one of the following strings:
88
89 'fast'
90 'normal'
91 'idle'
92 'standby'
93 'unknown'
94
95 The modes are described in include/linux/regulator/regulator.h
96
97 NOTE: This value should not be used to determine the regulator
98 output operating mode as this value is the same regardless of
99 whether the regulator is enabled or disabled.
100
101
102What: /sys/class/regulator/.../min_microvolts
103Date: April 2008
104KernelVersion: 2.6.26
105Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
106Description:
107 Each regulator directory will contain a field called
108 min_microvolts. This holds the minimum safe working regulator
109 output voltage setting for this domain measured in microvolts.
110
111 NOTE: this will return the string 'constraint not defined' if
112 the power domain has no min microvolts constraint defined by
113 platform code.
114
115
116What: /sys/class/regulator/.../max_microvolts
117Date: April 2008
118KernelVersion: 2.6.26
119Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
120Description:
121 Each regulator directory will contain a field called
122 max_microvolts. This holds the maximum safe working regulator
123 output voltage setting for this domain measured in microvolts.
124
125 NOTE: this will return the string 'constraint not defined' if
126 the power domain has no max microvolts constraint defined by
127 platform code.
128
129
130What: /sys/class/regulator/.../min_microamps
131Date: April 2008
132KernelVersion: 2.6.26
133Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
134Description:
135 Each regulator directory will contain a field called
136 min_microamps. This holds the minimum safe working regulator
137 output current limit setting for this domain measured in
138 microamps.
139
140 NOTE: this will return the string 'constraint not defined' if
141 the power domain has no min microamps constraint defined by
142 platform code.
143
144
145What: /sys/class/regulator/.../max_microamps
146Date: April 2008
147KernelVersion: 2.6.26
148Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
149Description:
150 Each regulator directory will contain a field called
151 max_microamps. This holds the maximum safe working regulator
152 output current limit setting for this domain measured in
153 microamps.
154
155 NOTE: this will return the string 'constraint not defined' if
156 the power domain has no max microamps constraint defined by
157 platform code.
158
159
160What: /sys/class/regulator/.../num_users
161Date: April 2008
162KernelVersion: 2.6.26
163Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
164Description:
165 Each regulator directory will contain a field called
166 num_users. This holds the number of consumer devices that
167 have called regulator_enable() on this regulator.
168
169
170What: /sys/class/regulator/.../requested_microamps
171Date: April 2008
172KernelVersion: 2.6.26
173Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
174Description:
175 Each regulator directory will contain a field called
176 requested_microamps. This holds the total requested load
177 current in microamps for this regulator from all its consumer
178 devices.
179
180
181What: /sys/class/regulator/.../parent
182Date: April 2008
183KernelVersion: 2.6.26
184Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
185Description:
186 Some regulator directories will contain a link called parent.
187 This points to the parent or supply regulator if one exists.
188
189What: /sys/class/regulator/.../suspend_mem_microvolts
190Date: May 2008
191KernelVersion: 2.6.26
192Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
193Description:
194 Each regulator directory will contain a field called
195 suspend_mem_microvolts. This holds the regulator output
196 voltage setting for this domain measured in microvolts when
197 the system is suspended to memory.
198
199 NOTE: this will return the string 'not defined' if
200 the power domain has no suspend to memory voltage defined by
201 platform code.
202
203What: /sys/class/regulator/.../suspend_disk_microvolts
204Date: May 2008
205KernelVersion: 2.6.26
206Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
207Description:
208 Each regulator directory will contain a field called
209 suspend_disk_microvolts. This holds the regulator output
210 voltage setting for this domain measured in microvolts when
211 the system is suspended to disk.
212
213 NOTE: this will return the string 'not defined' if
214 the power domain has no suspend to disk voltage defined by
215 platform code.
216
217What: /sys/class/regulator/.../suspend_standby_microvolts
218Date: May 2008
219KernelVersion: 2.6.26
220Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
221Description:
222 Each regulator directory will contain a field called
223 suspend_standby_microvolts. This holds the regulator output
224 voltage setting for this domain measured in microvolts when
225 the system is suspended to standby.
226
227 NOTE: this will return the string 'not defined' if
228 the power domain has no suspend to standby voltage defined by
229 platform code.
230
231What: /sys/class/regulator/.../suspend_mem_mode
232Date: May 2008
233KernelVersion: 2.6.26
234Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
235Description:
236 Each regulator directory will contain a field called
237 suspend_mem_mode. This holds the regulator operating mode
238 setting for this domain when the system is suspended to
239 memory.
240
241 NOTE: this will return the string 'not defined' if
242 the power domain has no suspend to memory mode defined by
243 platform code.
244
245What: /sys/class/regulator/.../suspend_disk_mode
246Date: May 2008
247KernelVersion: 2.6.26
248Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
249Description:
250 Each regulator directory will contain a field called
251 suspend_disk_mode. This holds the regulator operating mode
252 setting for this domain when the system is suspended to disk.
253
254 NOTE: this will return the string 'not defined' if
255 the power domain has no suspend to disk mode defined by
256 platform code.
257
258What: /sys/class/regulator/.../suspend_standby_mode
259Date: May 2008
260KernelVersion: 2.6.26
261Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
262Description:
263 Each regulator directory will contain a field called
264 suspend_standby_mode. This holds the regulator operating mode
265 setting for this domain when the system is suspended to
266 standby.
267
268 NOTE: this will return the string 'not defined' if
269 the power domain has no suspend to standby mode defined by
270 platform code.
271
272What: /sys/class/regulator/.../suspend_mem_state
273Date: May 2008
274KernelVersion: 2.6.26
275Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
276Description:
277 Each regulator directory will contain a field called
278 suspend_mem_state. This holds the regulator operating state
279 when suspended to memory.
280
281 This will be one of the following strings:
282
283 'enabled'
284 'disabled'
285 'not defined'
286
287What: /sys/class/regulator/.../suspend_disk_state
288Date: May 2008
289KernelVersion: 2.6.26
290Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
291Description:
292 Each regulator directory will contain a field called
293 suspend_disk_state. This holds the regulator operating state
294 when suspended to disk.
295
296 This will be one of the following strings:
297
298 'enabled'
299 'disabled'
300 'not defined'
301
302What: /sys/class/regulator/.../suspend_standby_state
303Date: May 2008
304KernelVersion: 2.6.26
305Contact: Liam Girdwood <lg@opensource.wolfsonmicro.com>
306Description:
307 Each regulator directory will contain a field called
308 suspend_standby_state. This holds the regulator operating
309 state when suspended to standby.
310
311 This will be one of the following strings:
312
313 'enabled'
314 'disabled'
315 'not defined'
diff --git a/Documentation/ABI/testing/sysfs-dev b/Documentation/ABI/testing/sysfs-dev
new file mode 100644
index 000000000000..a9f2b8b0530f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-dev
@@ -0,0 +1,20 @@
1What: /sys/dev
2Date: April 2008
3KernelVersion: 2.6.26
4Contact: Dan Williams <dan.j.williams@intel.com>
5Description: The /sys/dev tree provides a method to look up the sysfs
6 path for a device using the information returned from
7 stat(2). There are two directories, 'block' and 'char',
8 beneath /sys/dev containing symbolic links with names of
9 the form "<major>:<minor>". These links point to the
10 corresponding sysfs path for the given device.
11
12 Example:
13 $ readlink /sys/dev/block/8:32
14 ../../block/sdc
15
16 Entries in /sys/dev/char and /sys/dev/block will be
17 dynamically created and destroyed as devices enter and
18 leave the system.
19
20Users: mdadm <linux-raid@vger.kernel.org>
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory
new file mode 100644
index 000000000000..7a16fe1e2270
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-devices-memory
@@ -0,0 +1,24 @@
1What: /sys/devices/system/memory
2Date: June 2008
3Contact: Badari Pulavarty <pbadari@us.ibm.com>
4Description:
5 The /sys/devices/system/memory contains a snapshot of the
6 internal state of the kernel memory blocks. Files could be
7 added or removed dynamically to represent hot-add/remove
8 operations.
9
10Users: hotplug memory add/remove tools
11 https://w3.opensource.ibm.com/projects/powerpc-utils/
12
13What: /sys/devices/system/memory/memoryX/removable
14Date: June 2008
15Contact: Badari Pulavarty <pbadari@us.ibm.com>
16Description:
17 The file /sys/devices/system/memory/memoryX/removable
18 indicates whether this memory block is removable or not.
19 This is useful for a user-level agent to determine
20 identify removable sections of the memory before attempting
21 potentially expensive hot-remove memory operation
22
23Users: hotplug memory remove tools
24 https://w3.opensource.ibm.com/projects/powerpc-utils/
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi
index 9470ed9afcc0..f27be7d1a49f 100644
--- a/Documentation/ABI/testing/sysfs-firmware-acpi
+++ b/Documentation/ABI/testing/sysfs-firmware-acpi
@@ -29,46 +29,46 @@ Description:
29 29
30 $ cd /sys/firmware/acpi/interrupts 30 $ cd /sys/firmware/acpi/interrupts
31 $ grep . * 31 $ grep . *
32 error:0 32 error: 0
33 ff_gbl_lock:0 33 ff_gbl_lock: 0 enable
34 ff_pmtimer:0 34 ff_pmtimer: 0 invalid
35 ff_pwr_btn:0 35 ff_pwr_btn: 0 enable
36 ff_rt_clk:0 36 ff_rt_clk: 2 disable
37 ff_slp_btn:0 37 ff_slp_btn: 0 invalid
38 gpe00:0 38 gpe00: 0 invalid
39 gpe01:0 39 gpe01: 0 enable
40 gpe02:0 40 gpe02: 108 enable
41 gpe03:0 41 gpe03: 0 invalid
42 gpe04:0 42 gpe04: 0 invalid
43 gpe05:0 43 gpe05: 0 invalid
44 gpe06:0 44 gpe06: 0 enable
45 gpe07:0 45 gpe07: 0 enable
46 gpe08:0 46 gpe08: 0 invalid
47 gpe09:174 47 gpe09: 0 invalid
48 gpe0A:0 48 gpe0A: 0 invalid
49 gpe0B:0 49 gpe0B: 0 invalid
50 gpe0C:0 50 gpe0C: 0 invalid
51 gpe0D:0 51 gpe0D: 0 invalid
52 gpe0E:0 52 gpe0E: 0 invalid
53 gpe0F:0 53 gpe0F: 0 invalid
54 gpe10:0 54 gpe10: 0 invalid
55 gpe11:60 55 gpe11: 0 invalid
56 gpe12:0 56 gpe12: 0 invalid
57 gpe13:0 57 gpe13: 0 invalid
58 gpe14:0 58 gpe14: 0 invalid
59 gpe15:0 59 gpe15: 0 invalid
60 gpe16:0 60 gpe16: 0 invalid
61 gpe17:0 61 gpe17: 1084 enable
62 gpe18:0 62 gpe18: 0 enable
63 gpe19:7 63 gpe19: 0 invalid
64 gpe1A:0 64 gpe1A: 0 invalid
65 gpe1B:0 65 gpe1B: 0 invalid
66 gpe1C:0 66 gpe1C: 0 invalid
67 gpe1D:0 67 gpe1D: 0 invalid
68 gpe1E:0 68 gpe1E: 0 invalid
69 gpe1F:0 69 gpe1F: 0 invalid
70 gpe_all:241 70 gpe_all: 1192
71 sci:241 71 sci: 1194
72 72
73 sci - The total number of times the ACPI SCI 73 sci - The total number of times the ACPI SCI
74 has claimed an interrupt. 74 has claimed an interrupt.
@@ -89,6 +89,13 @@ Description:
89 89
90 error - an interrupt that can't be accounted for above. 90 error - an interrupt that can't be accounted for above.
91 91
92 invalid: it's either a wakeup GPE or a GPE/Fixed Event that
93 doesn't have an event handler.
94
95 disable: the GPE/Fixed Event is valid but disabled.
96
97 enable: the GPE/Fixed Event is valid and enabled.
98
92 Root has permission to clear any of these counters. Eg. 99 Root has permission to clear any of these counters. Eg.
93 # echo 0 > gpe11 100 # echo 0 > gpe11
94 101
@@ -97,3 +104,43 @@ Description:
97 104
98 None of these counters has an effect on the function 105 None of these counters has an effect on the function
99 of the system, they are simply statistics. 106 of the system, they are simply statistics.
107
108 Besides this, user can also write specific strings to these files
109 to enable/disable/clear ACPI interrupts in user space, which can be
110 used to debug some ACPI interrupt storm issues.
111
112 Note that only writting to VALID GPE/Fixed Event is allowed,
113 i.e. user can only change the status of runtime GPE and
114 Fixed Event with event handler installed.
115
116 Let's take power button fixed event for example, please kill acpid
117 and other user space applications so that the machine won't shutdown
118 when pressing the power button.
119 # cat ff_pwr_btn
120 0
121 # press the power button for 3 times;
122 # cat ff_pwr_btn
123 3
124 # echo disable > ff_pwr_btn
125 # cat ff_pwr_btn
126 disable
127 # press the power button for 3 times;
128 # cat ff_pwr_btn
129 disable
130 # echo enable > ff_pwr_btn
131 # cat ff_pwr_btn
132 4
133 /*
134 * this is because the status bit is set even if the enable bit is cleared,
135 * and it triggers an ACPI fixed event when the enable bit is set again
136 */
137 # press the power button for 3 times;
138 # cat ff_pwr_btn
139 7
140 # echo disable > ff_pwr_btn
141 # press the power button for 3 times;
142 # echo clear > ff_pwr_btn /* clear the status bit */
143 # echo disable > ff_pwr_btn
144 # cat ff_pwr_btn
145 7
146
diff --git a/Documentation/ABI/testing/sysfs-firmware-memmap b/Documentation/ABI/testing/sysfs-firmware-memmap
new file mode 100644
index 000000000000..0d99ee6ae02e
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-memmap
@@ -0,0 +1,71 @@
1What: /sys/firmware/memmap/
2Date: June 2008
3Contact: Bernhard Walle <bwalle@suse.de>
4Description:
5 On all platforms, the firmware provides a memory map which the
6 kernel reads. The resources from that memory map are registered
7 in the kernel resource tree and exposed to userspace via
8 /proc/iomem (together with other resources).
9
10 However, on most architectures that firmware-provided memory
11 map is modified afterwards by the kernel itself, either because
12 the kernel merges that memory map with other information or
13 just because the user overwrites that memory map via command
14 line.
15
16 kexec needs the raw firmware-provided memory map to setup the
17 parameter segment of the kernel that should be booted with
18 kexec. Also, the raw memory map is useful for debugging. For
19 that reason, /sys/firmware/memmap is an interface that provides
20 the raw memory map to userspace.
21
22 The structure is as follows: Under /sys/firmware/memmap there
23 are subdirectories with the number of the entry as their name:
24
25 /sys/firmware/memmap/0
26 /sys/firmware/memmap/1
27 /sys/firmware/memmap/2
28 /sys/firmware/memmap/3
29 ...
30
31 The maximum depends on the number of memory map entries provided
32 by the firmware. The order is just the order that the firmware
33 provides.
34
35 Each directory contains three files:
36
37 start : The start address (as hexadecimal number with the
38 '0x' prefix).
39 end : The end address, inclusive (regardless whether the
40 firmware provides inclusive or exclusive ranges).
41 type : Type of the entry as string. See below for a list of
42 valid types.
43
44 So, for example:
45
46 /sys/firmware/memmap/0/start
47 /sys/firmware/memmap/0/end
48 /sys/firmware/memmap/0/type
49 /sys/firmware/memmap/1/start
50 ...
51
52 Currently following types exist:
53
54 - System RAM
55 - ACPI Tables
56 - ACPI Non-volatile Storage
57 - reserved
58
59 Following shell snippet can be used to display that memory
60 map in a human-readable format:
61
62 -------------------- 8< ----------------------------------------
63 #!/bin/bash
64 cd /sys/firmware/memmap
65 for dir in * ; do
66 start=$(cat $dir/start)
67 end=$(cat $dir/end)
68 type=$(cat $dir/type)
69 printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
70 done
71 -------------------- >8 ----------------------------------------
diff --git a/Documentation/ABI/testing/sysfs-firmware-sgi_uv b/Documentation/ABI/testing/sysfs-firmware-sgi_uv
new file mode 100644
index 000000000000..4573fd4b7876
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-firmware-sgi_uv
@@ -0,0 +1,27 @@
1What: /sys/firmware/sgi_uv/
2Date: August 2008
3Contact: Russ Anderson <rja@sgi.com>
4Description:
5 The /sys/firmware/sgi_uv directory contains information
6 about the SGI UV platform.
7
8 Under that directory are a number of files:
9
10 partition_id
11 coherence_id
12
13 The partition_id entry contains the partition id.
14 SGI UV systems can be partitioned into multiple physical
15 machines, which each partition running a unique copy
16 of the operating system. Each partition will have a unique
17 partition id. To display the partition id, use the command:
18
19 cat /sys/firmware/sgi_uv/partition_id
20
21 The coherence_id entry contains the coherence id.
22 A partitioned SGI UV system can have one or more coherence
23 domain. The coherence id indicates which coherence domain
24 this partition is in. To display the coherence id, use the
25 command:
26
27 cat /sys/firmware/sgi_uv/coherence_id
diff --git a/Documentation/ABI/testing/sysfs-gpio b/Documentation/ABI/testing/sysfs-gpio
new file mode 100644
index 000000000000..8aab8092ad35
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-gpio
@@ -0,0 +1,26 @@
1What: /sys/class/gpio/
2Date: July 2008
3KernelVersion: 2.6.27
4Contact: David Brownell <dbrownell@users.sourceforge.net>
5Description:
6
7 As a Kconfig option, individual GPIO signals may be accessed from
8 userspace. GPIOs are only made available to userspace by an explicit
9 "export" operation. If a given GPIO is not claimed for use by
10 kernel code, it may be exported by userspace (and unexported later).
11 Kernel code may export it for complete or partial access.
12
13 GPIOs are identified as they are inside the kernel, using integers in
14 the range 0..INT_MAX. See Documentation/gpio.txt for more information.
15
16 /sys/class/gpio
17 /export ... asks the kernel to export a GPIO to userspace
18 /unexport ... to return a GPIO to the kernel
19 /gpioN ... for each exported GPIO #N
20 /value ... always readable, writes fail for input GPIOs
21 /direction ... r/w as: in, out (default low); write: high, low
22 /gpiochipN ... for each gpiochip; #N is its first GPIO
23 /base ... (r/o) same as N
24 /label ... (r/o) descriptive, not necessarily unique
25 /ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1)
26
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm b/Documentation/ABI/testing/sysfs-kernel-mm
new file mode 100644
index 000000000000..190d523ac159
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-mm
@@ -0,0 +1,6 @@
1What: /sys/kernel/mm
2Date: July 2008
3Contact: Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers
4Description:
5 /sys/kernel/mm/ should contain any and all VM
6 related information in /sys/kernel/.
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-hugepages b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
new file mode 100644
index 000000000000..e21c00571cf4
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
@@ -0,0 +1,15 @@
1What: /sys/kernel/mm/hugepages/
2Date: June 2008
3Contact: Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
4Description:
5 /sys/kernel/mm/hugepages/ contains a number of subdirectories
6 of the form hugepages-<size>kB, where <size> is the page size
7 of the hugepages supported by the kernel/CPU combination.
8
9 Under these directories are a number of files:
10 nr_hugepages
11 nr_overcommit_hugepages
12 free_hugepages
13 surplus_hugepages
14 resv_hugepages
15 See Documentation/vm/hugetlbpage.txt for details.
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 6caa14615578..1875e502f872 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -474,25 +474,29 @@ make a good program).
474So, you can either get rid of GNU emacs, or change it to use saner 474So, you can either get rid of GNU emacs, or change it to use saner
475values. To do the latter, you can stick the following in your .emacs file: 475values. To do the latter, you can stick the following in your .emacs file:
476 476
477(defun linux-c-mode () 477(defun c-lineup-arglist-tabs-only (ignored)
478 "C mode with adjusted defaults for use with the Linux kernel." 478 "Line up argument lists by tabs, not spaces"
479 (interactive) 479 (let* ((anchor (c-langelem-pos c-syntactic-element))
480 (c-mode) 480 (column (c-langelem-2nd-pos c-syntactic-element))
481 (c-set-style "K&R") 481 (offset (- (1+ column) anchor))
482 (setq tab-width 8) 482 (steps (floor offset c-basic-offset)))
483 (setq indent-tabs-mode t) 483 (* (max steps 1)
484 (setq c-basic-offset 8)) 484 c-basic-offset)))
485 485
486This will define the M-x linux-c-mode command. When hacking on a 486(add-hook 'c-mode-hook
487module, if you put the string -*- linux-c -*- somewhere on the first 487 (lambda ()
488two lines, this mode will be automatically invoked. Also, you may want 488 (let ((filename (buffer-file-name)))
489to add 489 ;; Enable kernel mode for the appropriate files
490 490 (when (and filename
491(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode) 491 (string-match "~/src/linux-trees" filename))
492 auto-mode-alist)) 492 (setq indent-tabs-mode t)
493 493 (c-set-style "linux")
494to your .emacs file if you want to have linux-c-mode switched on 494 (c-set-offset 'arglist-cont-nonempty
495automagically when you edit source files under /usr/src/linux. 495 '(c-lineup-gcc-asm-reg
496 c-lineup-arglist-tabs-only))))))
497
498This will make emacs go better with the kernel coding style for C
499files below ~/src/linux-trees.
496 500
497But even if you fail in getting emacs to do sane formatting, not 501But even if you fail in getting emacs to do sane formatting, not
498everything is lost: use "indent". 502everything is lost: use "indent".
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 80d150458c80..b8e86460046e 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -298,10 +298,10 @@ recommended that you never use these unless you really know what the
298cache width is. 298cache width is.
299 299
300int 300int
301dma_mapping_error(dma_addr_t dma_addr) 301dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
302 302
303int 303int
304pci_dma_mapping_error(dma_addr_t dma_addr) 304pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)
305 305
306In some circumstances dma_map_single and dma_map_page will fail to create 306In some circumstances dma_map_single and dma_map_page will fail to create
307a mapping. A driver can check for these errors by testing the returned 307a mapping. A driver can check for these errors by testing the returned
@@ -337,7 +337,7 @@ With scatterlists, you use the resulting mapping like this:
337 int i, count = dma_map_sg(dev, sglist, nents, direction); 337 int i, count = dma_map_sg(dev, sglist, nents, direction);
338 struct scatterlist *sg; 338 struct scatterlist *sg;
339 339
340 for (i = 0, sg = sglist; i < count; i++, sg++) { 340 for_each_sg(sglist, sg, count, i) {
341 hw_address[i] = sg_dma_address(sg); 341 hw_address[i] = sg_dma_address(sg);
342 hw_len[i] = sg_dma_len(sg); 342 hw_len[i] = sg_dma_len(sg);
343 } 343 }
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index 6d772f84b477..b768cc0e402b 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -22,3 +22,12 @@ ready and available in memory. The DMA of the "completion indication"
22could race with data DMA. Mapping the memory used for completion 22could race with data DMA. Mapping the memory used for completion
23indications with DMA_ATTR_WRITE_BARRIER would prevent the race. 23indications with DMA_ATTR_WRITE_BARRIER would prevent the race.
24 24
25DMA_ATTR_WEAK_ORDERING
26----------------------
27
28DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping
29may be weakly ordered, that is that reads and writes may pass each other.
30
31Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING,
32those that do not will simply ignore the attribute and exhibit default
33behavior.
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index b463ecd0c7ce..c74fec8c2351 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -740,7 +740,7 @@ failure can be determined by:
740 dma_addr_t dma_handle; 740 dma_addr_t dma_handle;
741 741
742 dma_handle = pci_map_single(pdev, addr, size, direction); 742 dma_handle = pci_map_single(pdev, addr, size, direction);
743 if (pci_dma_mapping_error(dma_handle)) { 743 if (pci_dma_mapping_error(pdev, dma_handle)) {
744 /* 744 /*
745 * reduce current DMA mapping usage, 745 * reduce current DMA mapping usage,
746 * delay and try again later or 746 * delay and try again later or
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 0eb0d027eb32..1615350b7b53 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.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 \
15 mac80211.xml debugobjects.xml 15 mac80211.xml debugobjects.xml sh.xml
16 16
17### 17###
18# The build process is as follows (targets): 18# The build process is as follows (targets):
@@ -102,6 +102,13 @@ C-procfs-example = procfs_example.xml
102C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example)) 102C-procfs-example2 = $(addprefix $(obj)/,$(C-procfs-example))
103$(obj)/procfs-guide.xml: $(C-procfs-example2) 103$(obj)/procfs-guide.xml: $(C-procfs-example2)
104 104
105# List of programs to build
106##oops, this is a kernel module::hostprogs-y := procfs_example
107obj-m += procfs_example.o
108
109# Tell kbuild to always build the programs
110always := $(hostprogs-y)
111
105notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \ 112notfoundtemplate = echo "*** You have to install docbook-utils or xmlto ***"; \
106 exit 1 113 exit 1
107db2xtemplate = db2TYPE -o $(dir $@) $< 114db2xtemplate = db2TYPE -o $(dir $@) $<
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl
index 5a8ffa761e09..ea3bc9565e6a 100644
--- a/Documentation/DocBook/gadget.tmpl
+++ b/Documentation/DocBook/gadget.tmpl
@@ -524,6 +524,44 @@ These utilities include endpoint autoconfiguration.
524<!-- !Edrivers/usb/gadget/epautoconf.c --> 524<!-- !Edrivers/usb/gadget/epautoconf.c -->
525</sect1> 525</sect1>
526 526
527<sect1 id="composite"><title>Composite Device Framework</title>
528
529<para>The core API is sufficient for writing drivers for composite
530USB devices (with more than one function in a given configuration),
531and also multi-configuration devices (also more than one function,
532but not necessarily sharing a given configuration).
533There is however an optional framework which makes it easier to
534reuse and combine functions.
535</para>
536
537<para>Devices using this framework provide a <emphasis>struct
538usb_composite_driver</emphasis>, which in turn provides one or
539more <emphasis>struct usb_configuration</emphasis> instances.
540Each such configuration includes at least one
541<emphasis>struct usb_function</emphasis>, which packages a user
542visible role such as "network link" or "mass storage device".
543Management functions may also exist, such as "Device Firmware
544Upgrade".
545</para>
546
547!Iinclude/linux/usb/composite.h
548!Edrivers/usb/gadget/composite.c
549
550</sect1>
551
552<sect1 id="functions"><title>Composite Device Functions</title>
553
554<para>At this writing, a few of the current gadget drivers have
555been converted to this framework.
556Near-term plans include converting all of them, except for "gadgetfs".
557</para>
558
559!Edrivers/usb/gadget/f_acm.c
560!Edrivers/usb/gadget/f_serial.c
561
562</sect1>
563
564
527</chapter> 565</chapter>
528 566
529<chapter id="controllers"><title>Peripheral Controller Drivers</title> 567<chapter id="controllers"><title>Peripheral Controller Drivers</title>
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl
index b7b1482f6e04..9d0058e788e5 100644
--- a/Documentation/DocBook/kernel-api.tmpl
+++ b/Documentation/DocBook/kernel-api.tmpl
@@ -283,6 +283,7 @@ X!Earch/x86/kernel/mca_32.c
283 <chapter id="security"> 283 <chapter id="security">
284 <title>Security Framework</title> 284 <title>Security Framework</title>
285!Isecurity/security.c 285!Isecurity/security.c
286!Esecurity/inode.c
286 </chapter> 287 </chapter>
287 288
288 <chapter id="audit"> 289 <chapter id="audit">
@@ -364,6 +365,10 @@ X!Edrivers/pnp/system.c
364!Eblock/blk-barrier.c 365!Eblock/blk-barrier.c
365!Eblock/blk-tag.c 366!Eblock/blk-tag.c
366!Iblock/blk-tag.c 367!Iblock/blk-tag.c
368!Eblock/blk-integrity.c
369!Iblock/blktrace.c
370!Iblock/genhd.c
371!Eblock/genhd.c
367 </chapter> 372 </chapter>
368 373
369 <chapter id="chrdev"> 374 <chapter id="chrdev">
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
index 2510763295d0..084f6ad7b7a0 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -219,10 +219,10 @@
219 </para> 219 </para>
220 220
221 <sect1 id="lock-intro"> 221 <sect1 id="lock-intro">
222 <title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title> 222 <title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title>
223 223
224 <para> 224 <para>
225 There are three main types of kernel locks. The fundamental type 225 There are two main types of kernel locks. The fundamental type
226 is the spinlock 226 is the spinlock
227 (<filename class="headerfile">include/asm/spinlock.h</filename>), 227 (<filename class="headerfile">include/asm/spinlock.h</filename>),
228 which is a very simple single-holder lock: if you can't get the 228 which is a very simple single-holder lock: if you can't get the
@@ -240,14 +240,6 @@
240 use a spinlock instead. 240 use a spinlock instead.
241 </para> 241 </para>
242 <para> 242 <para>
243 The third type is a semaphore
244 (<filename class="headerfile">include/linux/semaphore.h</filename>): it
245 can have more than one holder at any time (the number decided at
246 initialization time), although it is most commonly used as a
247 single-holder lock (a mutex). If you can't get a semaphore, your
248 task will be suspended and later on woken up - just like for mutexes.
249 </para>
250 <para>
251 Neither type of lock is recursive: see 243 Neither type of lock is recursive: see
252 <xref linkend="deadlock"/>. 244 <xref linkend="deadlock"/>.
253 </para> 245 </para>
@@ -278,7 +270,7 @@
278 </para> 270 </para>
279 271
280 <para> 272 <para>
281 Semaphores still exist, because they are required for 273 Mutexes still exist, because they are required for
282 synchronization between <firstterm linkend="gloss-usercontext">user 274 synchronization between <firstterm linkend="gloss-usercontext">user
283 contexts</firstterm>, as we will see below. 275 contexts</firstterm>, as we will see below.
284 </para> 276 </para>
@@ -289,18 +281,17 @@
289 281
290 <para> 282 <para>
291 If you have a data structure which is only ever accessed from 283 If you have a data structure which is only ever accessed from
292 user context, then you can use a simple semaphore 284 user context, then you can use a simple mutex
293 (<filename>linux/linux/semaphore.h</filename>) to protect it. This 285 (<filename>include/linux/mutex.h</filename>) to protect it. This
294 is the most trivial case: you initialize the semaphore to the number 286 is the most trivial case: you initialize the mutex. Then you can
295 of resources available (usually 1), and call 287 call <function>mutex_lock_interruptible()</function> to grab the mutex,
296 <function>down_interruptible()</function> to grab the semaphore, and 288 and <function>mutex_unlock()</function> to release it. There is also a
297 <function>up()</function> to release it. There is also a 289 <function>mutex_lock()</function>, which should be avoided, because it
298 <function>down()</function>, which should be avoided, because it
299 will not return if a signal is received. 290 will not return if a signal is received.
300 </para> 291 </para>
301 292
302 <para> 293 <para>
303 Example: <filename>linux/net/core/netfilter.c</filename> allows 294 Example: <filename>net/netfilter/nf_sockopt.c</filename> allows
304 registration of new <function>setsockopt()</function> and 295 registration of new <function>setsockopt()</function> and
305 <function>getsockopt()</function> calls, with 296 <function>getsockopt()</function> calls, with
306 <function>nf_register_sockopt()</function>. Registration and 297 <function>nf_register_sockopt()</function>. Registration and
@@ -515,7 +506,7 @@
515 <listitem> 506 <listitem>
516 <para> 507 <para>
517 If you are in a process context (any syscall) and want to 508 If you are in a process context (any syscall) and want to
518 lock other process out, use a semaphore. You can take a semaphore 509 lock other process out, use a mutex. You can take a mutex
519 and sleep (<function>copy_from_user*(</function> or 510 and sleep (<function>copy_from_user*(</function> or
520 <function>kmalloc(x,GFP_KERNEL)</function>). 511 <function>kmalloc(x,GFP_KERNEL)</function>).
521 </para> 512 </para>
@@ -662,7 +653,7 @@
662<entry>SLBH</entry> 653<entry>SLBH</entry>
663<entry>SLBH</entry> 654<entry>SLBH</entry>
664<entry>SLBH</entry> 655<entry>SLBH</entry>
665<entry>DI</entry> 656<entry>MLI</entry>
666<entry>None</entry> 657<entry>None</entry>
667</row> 658</row>
668 659
@@ -692,8 +683,8 @@
692<entry>spin_lock_bh</entry> 683<entry>spin_lock_bh</entry>
693</row> 684</row>
694<row> 685<row>
695<entry>DI</entry> 686<entry>MLI</entry>
696<entry>down_interruptible</entry> 687<entry>mutex_lock_interruptible</entry>
697</row> 688</row>
698 689
699</tbody> 690</tbody>
@@ -1310,7 +1301,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
1310 <para> 1301 <para>
1311 There is a coding bug where a piece of code tries to grab a 1302 There is a coding bug where a piece of code tries to grab a
1312 spinlock twice: it will spin forever, waiting for the lock to 1303 spinlock twice: it will spin forever, waiting for the lock to
1313 be released (spinlocks, rwlocks and semaphores are not 1304 be released (spinlocks, rwlocks and mutexes are not
1314 recursive in Linux). This is trivial to diagnose: not a 1305 recursive in Linux). This is trivial to diagnose: not a
1315 stay-up-five-nights-talk-to-fluffy-code-bunnies kind of 1306 stay-up-five-nights-talk-to-fluffy-code-bunnies kind of
1316 problem. 1307 problem.
@@ -1335,7 +1326,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
1335 1326
1336 <para> 1327 <para>
1337 This complete lockup is easy to diagnose: on SMP boxes the 1328 This complete lockup is easy to diagnose: on SMP boxes the
1338 watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set 1329 watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set
1339 (<filename>include/linux/spinlock.h</filename>) will show this up 1330 (<filename>include/linux/spinlock.h</filename>) will show this up
1340 immediately when it happens. 1331 immediately when it happens.
1341 </para> 1332 </para>
@@ -1558,7 +1549,7 @@ the amount of locking which needs to be done.
1558 <title>Read/Write Lock Variants</title> 1549 <title>Read/Write Lock Variants</title>
1559 1550
1560 <para> 1551 <para>
1561 Both spinlocks and semaphores have read/write variants: 1552 Both spinlocks and mutexes have read/write variants:
1562 <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>. 1553 <type>rwlock_t</type> and <structname>struct rw_semaphore</structname>.
1563 These divide users into two classes: the readers and the writers. If 1554 These divide users into two classes: the readers and the writers. If
1564 you are only reading the data, you can get a read lock, but to write to 1555 you are only reading the data, you can get a read lock, but to write to
@@ -1681,7 +1672,7 @@ the amount of locking which needs to be done.
1681 #include &lt;linux/slab.h&gt; 1672 #include &lt;linux/slab.h&gt;
1682 #include &lt;linux/string.h&gt; 1673 #include &lt;linux/string.h&gt;
1683+#include &lt;linux/rcupdate.h&gt; 1674+#include &lt;linux/rcupdate.h&gt;
1684 #include &lt;linux/semaphore.h&gt; 1675 #include &lt;linux/mutex.h&gt;
1685 #include &lt;asm/errno.h&gt; 1676 #include &lt;asm/errno.h&gt;
1686 1677
1687 struct object 1678 struct object
@@ -1913,7 +1904,7 @@ machines due to caching.
1913 </listitem> 1904 </listitem>
1914 <listitem> 1905 <listitem>
1915 <para> 1906 <para>
1916 <function> put_user()</function> 1907 <function>put_user()</function>
1917 </para> 1908 </para>
1918 </listitem> 1909 </listitem>
1919 </itemizedlist> 1910 </itemizedlist>
@@ -1927,13 +1918,13 @@ machines due to caching.
1927 1918
1928 <listitem> 1919 <listitem>
1929 <para> 1920 <para>
1930 <function>down_interruptible()</function> and 1921 <function>mutex_lock_interruptible()</function> and
1931 <function>down()</function> 1922 <function>mutex_lock()</function>
1932 </para> 1923 </para>
1933 <para> 1924 <para>
1934 There is a <function>down_trylock()</function> which can be 1925 There is a <function>mutex_trylock()</function> which can be
1935 used inside interrupt context, as it will not sleep. 1926 used inside interrupt context, as it will not sleep.
1936 <function>up()</function> will also never sleep. 1927 <function>mutex_unlock()</function> will also never sleep.
1937 </para> 1928 </para>
1938 </listitem> 1929 </listitem>
1939 </itemizedlist> 1930 </itemizedlist>
@@ -2023,7 +2014,7 @@ machines due to caching.
2023 <para> 2014 <para>
2024 Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is 2015 Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is
2025 unset, processes in user context inside the kernel would not 2016 unset, processes in user context inside the kernel would not
2026 preempt each other (ie. you had that CPU until you have it up, 2017 preempt each other (ie. you had that CPU until you gave it up,
2027 except for interrupts). With the addition of 2018 except for interrupts). With the addition of
2028 <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when 2019 <symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when
2029 in user context, higher priority tasks can "cut in": spinlocks 2020 in user context, higher priority tasks can "cut in": spinlocks
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl
index 028a8444d95e..372dec20c8da 100644
--- a/Documentation/DocBook/kgdb.tmpl
+++ b/Documentation/DocBook/kgdb.tmpl
@@ -84,10 +84,9 @@
84 runs an instance of gdb against the vmlinux file which contains 84 runs an instance of gdb against the vmlinux file which contains
85 the symbols (not boot image such as bzImage, zImage, uImage...). 85 the symbols (not boot image such as bzImage, zImage, uImage...).
86 In gdb the developer specifies the connection parameters and 86 In gdb the developer specifies the connection parameters and
87 connects to kgdb. Depending on which kgdb I/O modules exist in 87 connects to kgdb. The type of connection a developer makes with
88 the kernel for a given architecture, it may be possible to debug 88 gdb depends on the availability of kgdb I/O modules compiled as
89 the test machine's kernel with the development machine using a 89 builtin's or kernel modules in the test machine's kernel.
90 rs232 or ethernet connection.
91 </para> 90 </para>
92 </chapter> 91 </chapter>
93 <chapter id="CompilingAKernel"> 92 <chapter id="CompilingAKernel">
@@ -99,6 +98,24 @@
99 "Kernel debugging" select "KGDB: kernel debugging with remote gdb". 98 "Kernel debugging" select "KGDB: kernel debugging with remote gdb".
100 </para> 99 </para>
101 <para> 100 <para>
101 It is advised, but not required that you turn on the
102 CONFIG_FRAME_POINTER kernel option. This option inserts code to
103 into the compiled executable which saves the frame information in
104 registers or on the stack at different points which will allow a
105 debugger such as gdb to more accurately construct stack back traces
106 while debugging the kernel.
107 </para>
108 <para>
109 If the architecture that you are using supports the kernel option
110 CONFIG_DEBUG_RODATA, you should consider turning it off. This
111 option will prevent the use of software breakpoints because it
112 marks certain regions of the kernel's memory space as read-only.
113 If kgdb supports it for the architecture you are using, you can
114 use hardware breakpoints if you desire to run with the
115 CONFIG_DEBUG_RODATA option turned on, else you need to turn off
116 this option.
117 </para>
118 <para>
102 Next you should choose one of more I/O drivers to interconnect debugging 119 Next you should choose one of more I/O drivers to interconnect debugging
103 host and debugged target. Early boot debugging requires a KGDB 120 host and debugged target. Early boot debugging requires a KGDB
104 I/O driver that supports early debugging and the driver must be 121 I/O driver that supports early debugging and the driver must be
@@ -223,7 +240,7 @@
223 </para> 240 </para>
224 <para> 241 <para>
225 IMPORTANT NOTE: Using this option with kgdb over the console 242 IMPORTANT NOTE: Using this option with kgdb over the console
226 (kgdboc) or kgdb over ethernet (kgdboe) is not supported. 243 (kgdboc) is not supported.
227 </para> 244 </para>
228 </sect1> 245 </sect1>
229 </chapter> 246 </chapter>
@@ -249,18 +266,11 @@
249 (gdb) target remote /dev/ttyS0 266 (gdb) target remote /dev/ttyS0
250 </programlisting> 267 </programlisting>
251 <para> 268 <para>
252 Example (kgdb to a terminal server): 269 Example (kgdb to a terminal server on tcp port 2012):
253 </para>
254 <programlisting>
255 % gdb ./vmlinux
256 (gdb) target remote udp:192.168.2.2:6443
257 </programlisting>
258 <para>
259 Example (kgdb over ethernet):
260 </para> 270 </para>
261 <programlisting> 271 <programlisting>
262 % gdb ./vmlinux 272 % gdb ./vmlinux
263 (gdb) target remote udp:192.168.2.2:6443 273 (gdb) target remote 192.168.2.2:2012
264 </programlisting> 274 </programlisting>
265 <para> 275 <para>
266 Once connected, you can debug a kernel the way you would debug an 276 Once connected, you can debug a kernel the way you would debug an
diff --git a/Documentation/DocBook/mac80211.tmpl b/Documentation/DocBook/mac80211.tmpl
index b651e0a4b1c0..77c3c202991b 100644
--- a/Documentation/DocBook/mac80211.tmpl
+++ b/Documentation/DocBook/mac80211.tmpl
@@ -145,7 +145,6 @@ usage should require reading the full document.
145 this though and the recommendation to allow only a single 145 this though and the recommendation to allow only a single
146 interface in STA mode at first! 146 interface in STA mode at first!
147 </para> 147 </para>
148!Finclude/net/mac80211.h ieee80211_if_types
149!Finclude/net/mac80211.h ieee80211_if_init_conf 148!Finclude/net/mac80211.h ieee80211_if_init_conf
150!Finclude/net/mac80211.h ieee80211_if_conf 149!Finclude/net/mac80211.h ieee80211_if_conf
151 </chapter> 150 </chapter>
@@ -177,8 +176,7 @@ usage should require reading the full document.
177 <title>functions/definitions</title> 176 <title>functions/definitions</title>
178!Finclude/net/mac80211.h ieee80211_rx_status 177!Finclude/net/mac80211.h ieee80211_rx_status
179!Finclude/net/mac80211.h mac80211_rx_flags 178!Finclude/net/mac80211.h mac80211_rx_flags
180!Finclude/net/mac80211.h ieee80211_tx_control 179!Finclude/net/mac80211.h ieee80211_tx_info
181!Finclude/net/mac80211.h ieee80211_tx_status_flags
182!Finclude/net/mac80211.h ieee80211_rx 180!Finclude/net/mac80211.h ieee80211_rx
183!Finclude/net/mac80211.h ieee80211_rx_irqsafe 181!Finclude/net/mac80211.h ieee80211_rx_irqsafe
184!Finclude/net/mac80211.h ieee80211_tx_status 182!Finclude/net/mac80211.h ieee80211_tx_status
@@ -189,12 +187,11 @@ usage should require reading the full document.
189!Finclude/net/mac80211.h ieee80211_ctstoself_duration 187!Finclude/net/mac80211.h ieee80211_ctstoself_duration
190!Finclude/net/mac80211.h ieee80211_generic_frame_duration 188!Finclude/net/mac80211.h ieee80211_generic_frame_duration
191!Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb 189!Finclude/net/mac80211.h ieee80211_get_hdrlen_from_skb
192!Finclude/net/mac80211.h ieee80211_get_hdrlen 190!Finclude/net/mac80211.h ieee80211_hdrlen
193!Finclude/net/mac80211.h ieee80211_wake_queue 191!Finclude/net/mac80211.h ieee80211_wake_queue
194!Finclude/net/mac80211.h ieee80211_stop_queue 192!Finclude/net/mac80211.h ieee80211_stop_queue
195!Finclude/net/mac80211.h ieee80211_start_queues
196!Finclude/net/mac80211.h ieee80211_stop_queues
197!Finclude/net/mac80211.h ieee80211_wake_queues 193!Finclude/net/mac80211.h ieee80211_wake_queues
194!Finclude/net/mac80211.h ieee80211_stop_queues
198 </sect1> 195 </sect1>
199 </chapter> 196 </chapter>
200 197
@@ -230,8 +227,7 @@ usage should require reading the full document.
230 <title>Multiple queues and QoS support</title> 227 <title>Multiple queues and QoS support</title>
231 <para>TBD</para> 228 <para>TBD</para>
232!Finclude/net/mac80211.h ieee80211_tx_queue_params 229!Finclude/net/mac80211.h ieee80211_tx_queue_params
233!Finclude/net/mac80211.h ieee80211_tx_queue_stats_data 230!Finclude/net/mac80211.h ieee80211_tx_queue_stats
234!Finclude/net/mac80211.h ieee80211_tx_queue
235 </chapter> 231 </chapter>
236 232
237 <chapter id="AP"> 233 <chapter id="AP">
diff --git a/Documentation/DocBook/procfs-guide.tmpl b/Documentation/DocBook/procfs-guide.tmpl
index 1fd6a1ec7591..8a5dc6e021ff 100644
--- a/Documentation/DocBook/procfs-guide.tmpl
+++ b/Documentation/DocBook/procfs-guide.tmpl
@@ -29,12 +29,12 @@
29 29
30 <revhistory> 30 <revhistory>
31 <revision> 31 <revision>
32 <revnumber>1.0&nbsp;</revnumber> 32 <revnumber>1.0</revnumber>
33 <date>May 30, 2001</date> 33 <date>May 30, 2001</date>
34 <revremark>Initial revision posted to linux-kernel</revremark> 34 <revremark>Initial revision posted to linux-kernel</revremark>
35 </revision> 35 </revision>
36 <revision> 36 <revision>
37 <revnumber>1.1&nbsp;</revnumber> 37 <revnumber>1.1</revnumber>
38 <date>June 3, 2001</date> 38 <date>June 3, 2001</date>
39 <revremark>Revised after comments from linux-kernel</revremark> 39 <revremark>Revised after comments from linux-kernel</revremark>
40 </revision> 40 </revision>
diff --git a/Documentation/DocBook/procfs_example.c b/Documentation/DocBook/procfs_example.c
index 7064084c1c5e..2f3de0fb8365 100644
--- a/Documentation/DocBook/procfs_example.c
+++ b/Documentation/DocBook/procfs_example.c
@@ -189,8 +189,6 @@ static int __init init_procfs_example(void)
189 return 0; 189 return 0;
190 190
191no_symlink: 191no_symlink:
192 remove_proc_entry("tty", example_dir);
193no_tty:
194 remove_proc_entry("bar", example_dir); 192 remove_proc_entry("bar", example_dir);
195no_bar: 193no_bar:
196 remove_proc_entry("foo", example_dir); 194 remove_proc_entry("foo", example_dir);
@@ -206,7 +204,6 @@ out:
206static void __exit cleanup_procfs_example(void) 204static void __exit cleanup_procfs_example(void)
207{ 205{
208 remove_proc_entry("jiffies_too", example_dir); 206 remove_proc_entry("jiffies_too", example_dir);
209 remove_proc_entry("tty", example_dir);
210 remove_proc_entry("bar", example_dir); 207 remove_proc_entry("bar", example_dir);
211 remove_proc_entry("foo", example_dir); 208 remove_proc_entry("foo", example_dir);
212 remove_proc_entry("jiffies", example_dir); 209 remove_proc_entry("jiffies", example_dir);
@@ -222,3 +219,4 @@ module_exit(cleanup_procfs_example);
222 219
223MODULE_AUTHOR("Erik Mouw"); 220MODULE_AUTHOR("Erik Mouw");
224MODULE_DESCRIPTION("procfs examples"); 221MODULE_DESCRIPTION("procfs examples");
222MODULE_LICENSE("GPL");
diff --git a/Documentation/DocBook/s390-drivers.tmpl b/Documentation/DocBook/s390-drivers.tmpl
index 4acc73240a6d..95bfc12e5439 100644
--- a/Documentation/DocBook/s390-drivers.tmpl
+++ b/Documentation/DocBook/s390-drivers.tmpl
@@ -100,7 +100,7 @@
100 the hardware structures represented here, please consult the Principles 100 the hardware structures represented here, please consult the Principles
101 of Operation. 101 of Operation.
102 </para> 102 </para>
103!Iinclude/asm-s390/cio.h 103!Iarch/s390/include/asm/cio.h
104 </sect1> 104 </sect1>
105 <sect1 id="ccwdev"> 105 <sect1 id="ccwdev">
106 <title>ccw devices</title> 106 <title>ccw devices</title>
@@ -114,7 +114,7 @@
114 ccw device structure. Device drivers must not bypass those functions 114 ccw device structure. Device drivers must not bypass those functions
115 or strange side effects may happen. 115 or strange side effects may happen.
116 </para> 116 </para>
117!Iinclude/asm-s390/ccwdev.h 117!Iarch/s390/include/asm/ccwdev.h
118!Edrivers/s390/cio/device.c 118!Edrivers/s390/cio/device.c
119!Edrivers/s390/cio/device_ops.c 119!Edrivers/s390/cio/device_ops.c
120 </sect1> 120 </sect1>
@@ -125,7 +125,7 @@
125 measurement data which is made available by the channel subsystem 125 measurement data which is made available by the channel subsystem
126 for each channel attached device. 126 for each channel attached device.
127 </para> 127 </para>
128!Iinclude/asm-s390/cmb.h 128!Iarch/s390/include/asm/cmb.h
129!Edrivers/s390/cio/cmf.c 129!Edrivers/s390/cio/cmf.c
130 </sect1> 130 </sect1>
131 </chapter> 131 </chapter>
@@ -142,7 +142,7 @@
142 </para> 142 </para>
143 <sect1 id="ccwgroupdevices"> 143 <sect1 id="ccwgroupdevices">
144 <title>ccw group devices</title> 144 <title>ccw group devices</title>
145!Iinclude/asm-s390/ccwgroup.h 145!Iarch/s390/include/asm/ccwgroup.h
146!Edrivers/s390/cio/ccwgroup.c 146!Edrivers/s390/cio/ccwgroup.c
147 </sect1> 147 </sect1>
148 </chapter> 148 </chapter>
diff --git a/Documentation/DocBook/sh.tmpl b/Documentation/DocBook/sh.tmpl
new file mode 100644
index 000000000000..0c3dc4c69dd1
--- /dev/null
+++ b/Documentation/DocBook/sh.tmpl
@@ -0,0 +1,105 @@
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
5<book id="sh-drivers">
6 <bookinfo>
7 <title>SuperH Interfaces Guide</title>
8
9 <authorgroup>
10 <author>
11 <firstname>Paul</firstname>
12 <surname>Mundt</surname>
13 <affiliation>
14 <address>
15 <email>lethal@linux-sh.org</email>
16 </address>
17 </affiliation>
18 </author>
19 </authorgroup>
20
21 <copyright>
22 <year>2008</year>
23 <holder>Paul Mundt</holder>
24 </copyright>
25 <copyright>
26 <year>2008</year>
27 <holder>Renesas Technology Corp.</holder>
28 </copyright>
29
30 <legalnotice>
31 <para>
32 This documentation is free software; you can redistribute
33 it and/or modify it under the terms of the GNU General Public
34 License version 2 as published by the Free Software Foundation.
35 </para>
36
37 <para>
38 This program is distributed in the hope that it will be
39 useful, but WITHOUT ANY WARRANTY; without even the implied
40 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
41 See the GNU General Public License for more details.
42 </para>
43
44 <para>
45 You should have received a copy of the GNU General Public
46 License along with this program; if not, write to the Free
47 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
48 MA 02111-1307 USA
49 </para>
50
51 <para>
52 For more details see the file COPYING in the source
53 distribution of Linux.
54 </para>
55 </legalnotice>
56 </bookinfo>
57
58<toc></toc>
59
60 <chapter id="mm">
61 <title>Memory Management</title>
62 <sect1 id="sh4">
63 <title>SH-4</title>
64 <sect2 id="sq">
65 <title>Store Queue API</title>
66!Earch/sh/kernel/cpu/sh4/sq.c
67 </sect2>
68 </sect1>
69 <sect1 id="sh5">
70 <title>SH-5</title>
71 <sect2 id="tlb">
72 <title>TLB Interfaces</title>
73!Iarch/sh/mm/tlb-sh5.c
74!Iarch/sh/include/asm/tlb_64.h
75 </sect2>
76 </sect1>
77 </chapter>
78 <chapter id="clk">
79 <title>Clock Framework Extensions</title>
80!Iarch/sh/include/asm/clock.h
81 </chapter>
82 <chapter id="mach">
83 <title>Machine Specific Interfaces</title>
84 <sect1 id="dreamcast">
85 <title>mach-dreamcast</title>
86!Iarch/sh/boards/mach-dreamcast/rtc.c
87 </sect1>
88 <sect1 id="x3proto">
89 <title>mach-x3proto</title>
90!Earch/sh/boards/mach-x3proto/ilsel.c
91 </sect1>
92 </chapter>
93 <chapter id="busses">
94 <title>Busses</title>
95 <sect1 id="superhyway">
96 <title>SuperHyway</title>
97!Edrivers/sh/superhyway/superhyway.c
98 </sect1>
99
100 <sect1 id="maple">
101 <title>Maple</title>
102!Edrivers/sh/maple/maple.c
103 </sect1>
104 </chapter>
105</book>
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl
index fdd7f4f887b7..df87d1b93605 100644
--- a/Documentation/DocBook/uio-howto.tmpl
+++ b/Documentation/DocBook/uio-howto.tmpl
@@ -21,6 +21,18 @@
21 </affiliation> 21 </affiliation>
22</author> 22</author>
23 23
24<copyright>
25 <year>2006-2008</year>
26 <holder>Hans-Jürgen Koch.</holder>
27</copyright>
28
29<legalnotice>
30<para>
31This documentation is Free Software licensed under the terms of the
32GPL version 2.
33</para>
34</legalnotice>
35
24<pubdate>2006-12-11</pubdate> 36<pubdate>2006-12-11</pubdate>
25 37
26<abstract> 38<abstract>
@@ -30,6 +42,12 @@
30 42
31<revhistory> 43<revhistory>
32 <revision> 44 <revision>
45 <revnumber>0.5</revnumber>
46 <date>2008-05-22</date>
47 <authorinitials>hjk</authorinitials>
48 <revremark>Added description of write() function.</revremark>
49 </revision>
50 <revision>
33 <revnumber>0.4</revnumber> 51 <revnumber>0.4</revnumber>
34 <date>2007-11-26</date> 52 <date>2007-11-26</date>
35 <authorinitials>hjk</authorinitials> 53 <authorinitials>hjk</authorinitials>
@@ -57,20 +75,9 @@
57</bookinfo> 75</bookinfo>
58 76
59<chapter id="aboutthisdoc"> 77<chapter id="aboutthisdoc">
60<?dbhtml filename="about.html"?> 78<?dbhtml filename="aboutthis.html"?>
61<title>About this document</title> 79<title>About this document</title>
62 80
63<sect1 id="copyright">
64<?dbhtml filename="copyright.html"?>
65<title>Copyright and License</title>
66<para>
67 Copyright (c) 2006 by Hans-Jürgen Koch.</para>
68<para>
69This documentation is Free Software licensed under the terms of the
70GPL version 2.
71</para>
72</sect1>
73
74<sect1 id="translations"> 81<sect1 id="translations">
75<?dbhtml filename="translations.html"?> 82<?dbhtml filename="translations.html"?>
76<title>Translations</title> 83<title>Translations</title>
@@ -189,6 +196,30 @@ interested in translating it, please email me
189 represents the total interrupt count. You can use this number 196 represents the total interrupt count. You can use this number
190 to figure out if you missed some interrupts. 197 to figure out if you missed some interrupts.
191 </para> 198 </para>
199 <para>
200 For some hardware that has more than one interrupt source internally,
201 but not separate IRQ mask and status registers, there might be
202 situations where userspace cannot determine what the interrupt source
203 was if the kernel handler disables them by writing to the chip's IRQ
204 register. In such a case, the kernel has to disable the IRQ completely
205 to leave the chip's register untouched. Now the userspace part can
206 determine the cause of the interrupt, but it cannot re-enable
207 interrupts. Another cornercase is chips where re-enabling interrupts
208 is a read-modify-write operation to a combined IRQ status/acknowledge
209 register. This would be racy if a new interrupt occurred
210 simultaneously.
211 </para>
212 <para>
213 To address these problems, UIO also implements a write() function. It
214 is normally not used and can be ignored for hardware that has only a
215 single interrupt source or has separate IRQ mask and status registers.
216 If you need it, however, a write to <filename>/dev/uioX</filename>
217 will call the <function>irqcontrol()</function> function implemented
218 by the driver. You have to write a 32-bit value that is usually either
219 0 or 1 to disable or enable interrupts. If a driver does not implement
220 <function>irqcontrol()</function>, <function>write()</function> will
221 return with <varname>-ENOSYS</varname>.
222 </para>
192 223
193 <para> 224 <para>
194 To handle interrupts properly, your custom kernel module can 225 To handle interrupts properly, your custom kernel module can
@@ -362,6 +393,14 @@ device is actually used.
362<function>open()</function>, you will probably also want a custom 393<function>open()</function>, you will probably also want a custom
363<function>release()</function> function. 394<function>release()</function> function.
364</para></listitem> 395</para></listitem>
396
397<listitem><para>
398<varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on)
399</varname>: Optional. If you need to be able to enable or disable
400interrupts from userspace by writing to <filename>/dev/uioX</filename>,
401you can implement this function. The parameter <varname>irq_on</varname>
402will be 0 to disable interrupts and 1 to enable them.
403</para></listitem>
365</itemizedlist> 404</itemizedlist>
366 405
367<para> 406<para>
diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl
index 89817795e668..0bc25949b668 100644
--- a/Documentation/DocBook/videobook.tmpl
+++ b/Documentation/DocBook/videobook.tmpl
@@ -1648,7 +1648,7 @@ static struct video_buffer capture_fb;
1648 1648
1649 <chapter id="pubfunctions"> 1649 <chapter id="pubfunctions">
1650 <title>Public Functions Provided</title> 1650 <title>Public Functions Provided</title>
1651!Edrivers/media/video/videodev.c 1651!Edrivers/media/video/v4l2-dev.c
1652 </chapter> 1652 </chapter>
1653 1653
1654</book> 1654</book>
diff --git a/Documentation/DocBook/z8530book.tmpl b/Documentation/DocBook/z8530book.tmpl
index 42c75ba71ba2..a42a8a4c7689 100644
--- a/Documentation/DocBook/z8530book.tmpl
+++ b/Documentation/DocBook/z8530book.tmpl
@@ -69,12 +69,6 @@
69 device to be used as both a tty interface and as a synchronous 69 device to be used as both a tty interface and as a synchronous
70 controller is a project for Linux post the 2.4 release 70 controller is a project for Linux post the 2.4 release
71 </para> 71 </para>
72 <para>
73 The support code handles most common card configurations and
74 supports running both Cisco HDLC and Synchronous PPP. With extra
75 glue the frame relay and X.25 protocols can also be used with this
76 driver.
77 </para>
78 </chapter> 72 </chapter>
79 73
80 <chapter id="Driver_Modes"> 74 <chapter id="Driver_Modes">
@@ -179,35 +173,27 @@
179 <para> 173 <para>
180 If you wish to use the network interface facilities of the driver, 174 If you wish to use the network interface facilities of the driver,
181 then you need to attach a network device to each channel that is 175 then you need to attach a network device to each channel that is
182 present and in use. In addition to use the SyncPPP and Cisco HDLC 176 present and in use. In addition to use the generic HDLC
183 you need to follow some additional plumbing rules. They may seem 177 you need to follow some additional plumbing rules. They may seem
184 complex but a look at the example hostess_sv11 driver should 178 complex but a look at the example hostess_sv11 driver should
185 reassure you. 179 reassure you.
186 </para> 180 </para>
187 <para> 181 <para>
188 The network device used for each channel should be pointed to by 182 The network device used for each channel should be pointed to by
189 the netdevice field of each channel. The dev-&gt; priv field of the 183 the netdevice field of each channel. The hdlc-&gt; priv field of the
190 network device points to your private data - you will need to be 184 network device points to your private data - you will need to be
191 able to find your ppp device from this. In addition to use the 185 able to find your private data from this.
192 sync ppp layer the private data must start with a void * pointer
193 to the syncppp structures.
194 </para> 186 </para>
195 <para> 187 <para>
196 The way most drivers approach this particular problem is to 188 The way most drivers approach this particular problem is to
197 create a structure holding the Z8530 device definition and 189 create a structure holding the Z8530 device definition and
198 put that and the syncppp pointer into the private field of 190 put that into the private field of the network device. The
199 the network device. The network device fields of the channels 191 network device fields of the channels then point back to the
200 then point back to the network devices. The ppp_device can also 192 network devices.
201 be put in the private structure conveniently.
202 </para> 193 </para>
203 <para> 194 <para>
204 If you wish to use the synchronous ppp then you need to attach 195 If you wish to use the generic HDLC then you need to register
205 the syncppp layer to the network device. You should do this before 196 the HDLC device.
206 you register the network device. The
207 <function>sppp_attach</function> requires that the first void *
208 pointer in your private data is pointing to an empty struct
209 ppp_device. The function fills in the initial data for the
210 ppp/hdlc layer.
211 </para> 197 </para>
212 <para> 198 <para>
213 Before you register your network device you will also need to 199 Before you register your network device you will also need to
@@ -314,10 +300,10 @@
314 buffer in sk_buff format and queues it for transmission. The 300 buffer in sk_buff format and queues it for transmission. The
315 caller must provide the entire packet with the exception of the 301 caller must provide the entire packet with the exception of the
316 bitstuffing and CRC. This is normally done by the caller via 302 bitstuffing and CRC. This is normally done by the caller via
317 the syncppp interface layer. It returns 0 if the buffer has been 303 the generic HDLC interface layer. It returns 0 if the buffer has been
318 queued and non zero values for queue full. If the function accepts 304 queued and non zero values for queue full. If the function accepts
319 the buffer it becomes property of the Z8530 layer and the caller 305 the buffer it becomes property of the Z8530 layer and the caller
320 should not free it. 306 should not free it.
321 </para> 307 </para>
322 <para> 308 <para>
323 The function <function>z8530_get_stats</function> returns a pointer 309 The function <function>z8530_get_stats</function> returns a pointer
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 0291ade44c17..48a3955f05fc 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -77,7 +77,8 @@ documentation files are also added which explain how to use the feature.
77When a kernel change causes the interface that the kernel exposes to 77When a kernel change causes the interface that the kernel exposes to
78userspace to change, it is recommended that you send the information or 78userspace to change, it is recommended that you send the information or
79a patch to the manual pages explaining the change to the manual pages 79a patch to the manual pages explaining the change to the manual pages
80maintainer at mtk.manpages@gmail.com. 80maintainer at mtk.manpages@gmail.com, and CC the list
81linux-api@vger.kernel.org.
81 82
82Here is a list of files that are in the kernel source tree that are 83Here is a list of files that are in the kernel source tree that are
83required reading: 84required reading:
@@ -358,7 +359,7 @@ Here is a list of some of the different kernel trees available:
358 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> 359 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
359 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 360 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
360 361
361 - SCSI, James Bottomley <James.Bottomley@SteelEye.com> 362 - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
362 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 363 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
363 364
364 - x86, Ingo Molnar <mingo@elte.hu> 365 - x86, Ingo Molnar <mingo@elte.hu>
@@ -377,7 +378,7 @@ Bug Reporting
377bugzilla.kernel.org is where the Linux kernel developers track kernel 378bugzilla.kernel.org is where the Linux kernel developers track kernel
378bugs. Users are encouraged to report all bugs that they find in this 379bugs. Users are encouraged to report all bugs that they find in this
379tool. For details on how to use the kernel bugzilla, please see: 380tool. For details on how to use the kernel bugzilla, please see:
380 http://test.kernel.org/bugzilla/faq.html 381 http://bugzilla.kernel.org/page.cgi?id=faq.html
381 382
382The file REPORTING-BUGS in the main kernel source directory has a good 383The file REPORTING-BUGS in the main kernel source directory has a good
383template for how to report a possible kernel bug, and details what kind 384template for how to report a possible kernel bug, and details what kind
diff --git a/Documentation/IRQ-affinity.txt b/Documentation/IRQ-affinity.txt
index 938d7dd05490..b4a615b78403 100644
--- a/Documentation/IRQ-affinity.txt
+++ b/Documentation/IRQ-affinity.txt
@@ -1,17 +1,26 @@
1ChangeLog:
2 Started by Ingo Molnar <mingo@redhat.com>
3 Update by Max Krasnyansky <maxk@qualcomm.com>
1 4
2SMP IRQ affinity, started by Ingo Molnar <mingo@redhat.com> 5SMP IRQ affinity
3
4 6
5/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted 7/proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted
6for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed 8for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed
7to turn off all CPUs, and if an IRQ controller does not support IRQ 9to turn off all CPUs, and if an IRQ controller does not support IRQ
8affinity then the value will not change from the default 0xffffffff. 10affinity then the value will not change from the default 0xffffffff.
9 11
12/proc/irq/default_smp_affinity specifies default affinity mask that applies
13to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask
14will be set to the default mask. It can then be changed as described above.
15Default mask is 0xffffffff.
16
10Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting 17Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting
11the IRQ to CPU4-7 (this is an 8-CPU SMP box): 18it to CPU4-7 (this is an 8-CPU SMP box):
12 19
20[root@moon 44]# cd /proc/irq/44
13[root@moon 44]# cat smp_affinity 21[root@moon 44]# cat smp_affinity
14ffffffff 22ffffffff
23
15[root@moon 44]# echo 0f > smp_affinity 24[root@moon 44]# echo 0f > smp_affinity
16[root@moon 44]# cat smp_affinity 25[root@moon 44]# cat smp_affinity
170000000f 260000000f
@@ -21,17 +30,27 @@ PING hell (195.4.7.3): 56 data bytes
21--- hell ping statistics --- 30--- hell ping statistics ---
226029 packets transmitted, 6027 packets received, 0% packet loss 316029 packets transmitted, 6027 packets received, 0% packet loss
23round-trip min/avg/max = 0.1/0.1/0.4 ms 32round-trip min/avg/max = 0.1/0.1/0.4 ms
24[root@moon 44]# cat /proc/interrupts | grep 44: 33[root@moon 44]# cat /proc/interrupts | grep 'CPU\|44:'
25 44: 0 1785 1785 1783 1783 1 34 CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
261 0 IO-APIC-level eth1 35 44: 1068 1785 1785 1783 0 0 0 0 IO-APIC-level eth1
36
37As can be seen from the line above IRQ44 was delivered only to the first four
38processors (0-3).
39Now lets restrict that IRQ to CPU(4-7).
40
27[root@moon 44]# echo f0 > smp_affinity 41[root@moon 44]# echo f0 > smp_affinity
42[root@moon 44]# cat smp_affinity
43000000f0
28[root@moon 44]# ping -f h 44[root@moon 44]# ping -f h
29PING hell (195.4.7.3): 56 data bytes 45PING hell (195.4.7.3): 56 data bytes
30.. 46..
31--- hell ping statistics --- 47--- hell ping statistics ---
322779 packets transmitted, 2777 packets received, 0% packet loss 482779 packets transmitted, 2777 packets received, 0% packet loss
33round-trip min/avg/max = 0.1/0.5/585.4 ms 49round-trip min/avg/max = 0.1/0.5/585.4 ms
34[root@moon 44]# cat /proc/interrupts | grep 44: 50[root@moon 44]# cat /proc/interrupts | 'CPU\|44:'
35 44: 1068 1785 1785 1784 1784 1069 1070 1069 IO-APIC-level eth1 51 CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
36[root@moon 44]# 52 44: 1068 1785 1785 1783 1784 1069 1070 1069 IO-APIC-level eth1
53
54This time around IRQ44 was delivered only to the last four processors.
55i.e counters for the CPU0-3 did not change.
37 56
diff --git a/Documentation/Intel-IOMMU.txt b/Documentation/Intel-IOMMU.txt
index c2321903aa09..21bc416d887e 100644
--- a/Documentation/Intel-IOMMU.txt
+++ b/Documentation/Intel-IOMMU.txt
@@ -48,7 +48,7 @@ IOVA generation is pretty generic. We used the same technique as vmalloc()
48but these are not global address spaces, but separate for each domain. 48but these are not global address spaces, but separate for each domain.
49Different DMA engines may support different number of domains. 49Different DMA engines may support different number of domains.
50 50
51We also allocate gaurd pages with each mapping, so we can attempt to catch 51We also allocate guard pages with each mapping, so we can attempt to catch
52any overflow that might happen. 52any overflow that might happen.
53 53
54 54
@@ -112,4 +112,4 @@ TBD
112 112
113- For compatibility testing, could use unity map domain for all devices, just 113- For compatibility testing, could use unity map domain for all devices, just
114 provide a 1-1 for all useful memory under a single domain for all devices. 114 provide a 1-1 for all useful memory under a single domain for all devices.
115- API for paravirt ops for abstracting functionlity for VMM folks. 115- API for paravirt ops for abstracting functionality for VMM folks.
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 000000000000..94b945733534
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,3 @@
1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
2 filesystems/configfs/ ia64/ networking/ \
3 pcmcia/ spi/ video4linux/ vm/ watchdog/src/
diff --git a/Documentation/RCU/NMI-RCU.txt b/Documentation/RCU/NMI-RCU.txt
index c64158ecde43..a6d32e65d222 100644
--- a/Documentation/RCU/NMI-RCU.txt
+++ b/Documentation/RCU/NMI-RCU.txt
@@ -93,6 +93,9 @@ Since NMI handlers disable preemption, synchronize_sched() is guaranteed
93not to return until all ongoing NMI handlers exit. It is therefore safe 93not to return until all ongoing NMI handlers exit. It is therefore safe
94to free up the handler's data as soon as synchronize_sched() returns. 94to free up the handler's data as soon as synchronize_sched() returns.
95 95
96Important note: for this to work, the architecture in question must
97invoke irq_enter() and irq_exit() on NMI entry and exit, respectively.
98
96 99
97Answer to Quick Quiz 100Answer to Quick Quiz
98 101
diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt
index 39ad8f56783a..9f711d2df91b 100644
--- a/Documentation/RCU/RTFP.txt
+++ b/Documentation/RCU/RTFP.txt
@@ -52,6 +52,10 @@ of each iteration. Unfortunately, chaotic relaxation requires highly
52structured data, such as the matrices used in scientific programs, and 52structured data, such as the matrices used in scientific programs, and
53is thus inapplicable to most data structures in operating-system kernels. 53is thus inapplicable to most data structures in operating-system kernels.
54 54
55In 1992, Henry (now Alexia) Massalin completed a dissertation advising
56parallel programmers to defer processing when feasible to simplify
57synchronization. RCU makes extremely heavy use of this advice.
58
55In 1993, Jacobson [Jacobson93] verbally described what is perhaps the 59In 1993, Jacobson [Jacobson93] verbally described what is perhaps the
56simplest deferred-free technique: simply waiting a fixed amount of time 60simplest deferred-free technique: simply waiting a fixed amount of time
57before freeing blocks awaiting deferred free. Jacobson did not describe 61before freeing blocks awaiting deferred free. Jacobson did not describe
@@ -138,6 +142,13 @@ blocking in read-side critical sections appeared [PaulEMcKenney2006c],
138Robert Olsson described an RCU-protected trie-hash combination 142Robert Olsson described an RCU-protected trie-hash combination
139[RobertOlsson2006a]. 143[RobertOlsson2006a].
140 144
1452007 saw the journal version of the award-winning RCU paper from 2006
146[ThomasEHart2007a], as well as a paper demonstrating use of Promela
147and Spin to mechanically verify an optimization to Oleg Nesterov's
148QRCU [PaulEMcKenney2007QRCUspin], a design document describing
149preemptible RCU [PaulEMcKenney2007PreemptibleRCU], and the three-part
150LWN "What is RCU?" series [PaulEMcKenney2007WhatIsRCUFundamentally,
151PaulEMcKenney2008WhatIsRCUUsage, and PaulEMcKenney2008WhatIsRCUAPI].
141 152
142Bibtex Entries 153Bibtex Entries
143 154
@@ -202,6 +213,20 @@ Bibtex Entries
202,Year="1991" 213,Year="1991"
203} 214}
204 215
216@phdthesis{HMassalinPhD
217,author="H. Massalin"
218,title="Synthesis: An Efficient Implementation of Fundamental Operating
219System Services"
220,school="Columbia University"
221,address="New York, NY"
222,year="1992"
223,annotation="
224 Mondo optimizing compiler.
225 Wait-free stuff.
226 Good advice: defer work to avoid synchronization.
227"
228}
229
205@unpublished{Jacobson93 230@unpublished{Jacobson93
206,author="Van Jacobson" 231,author="Van Jacobson"
207,title="Avoid Read-Side Locking Via Delayed Free" 232,title="Avoid Read-Side Locking Via Delayed Free"
@@ -635,3 +660,86 @@ Revised:
635" 660"
636} 661}
637 662
663@unpublished{PaulEMcKenney2007PreemptibleRCU
664,Author="Paul E. McKenney"
665,Title="The design of preemptible read-copy-update"
666,month="October"
667,day="8"
668,year="2007"
669,note="Available:
670\url{http://lwn.net/Articles/253651/}
671[Viewed October 25, 2007]"
672,annotation="
673 LWN article describing the design of preemptible RCU.
674"
675}
676
677########################################################################
678#
679# "What is RCU?" LWN series.
680#
681
682@unpublished{PaulEMcKenney2007WhatIsRCUFundamentally
683,Author="Paul E. McKenney and Jonathan Walpole"
684,Title="What is {RCU}, Fundamentally?"
685,month="December"
686,day="17"
687,year="2007"
688,note="Available:
689\url{http://lwn.net/Articles/262464/}
690[Viewed December 27, 2007]"
691,annotation="
692 Lays out the three basic components of RCU: (1) publish-subscribe,
693 (2) wait for pre-existing readers to complete, and (2) maintain
694 multiple versions.
695"
696}
697
698@unpublished{PaulEMcKenney2008WhatIsRCUUsage
699,Author="Paul E. McKenney"
700,Title="What is {RCU}? Part 2: Usage"
701,month="January"
702,day="4"
703,year="2008"
704,note="Available:
705\url{http://lwn.net/Articles/263130/}
706[Viewed January 4, 2008]"
707,annotation="
708 Lays out six uses of RCU:
709 1. RCU is a Reader-Writer Lock Replacement
710 2. RCU is a Restricted Reference-Counting Mechanism
711 3. RCU is a Bulk Reference-Counting Mechanism
712 4. RCU is a Poor Man's Garbage Collector
713 5. RCU is a Way of Providing Existence Guarantees
714 6. RCU is a Way of Waiting for Things to Finish
715"
716}
717
718@unpublished{PaulEMcKenney2008WhatIsRCUAPI
719,Author="Paul E. McKenney"
720,Title="{RCU} part 3: the {RCU} {API}"
721,month="January"
722,day="17"
723,year="2008"
724,note="Available:
725\url{http://lwn.net/Articles/264090/}
726[Viewed January 10, 2008]"
727,annotation="
728 Gives an overview of the Linux-kernel RCU API and a brief annotated RCU
729 bibliography.
730"
731}
732
733@article{DinakarGuniguntala2008IBMSysJ
734,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}"
736,Year="2008"
737,Month="April"
738,journal="IBM Systems Journal"
739,volume="47"
740,number="2"
741,pages="@@-@@"
742,annotation="
743 RCU, realtime RCU, sleepable RCU, performance.
744"
745}
diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
index 42b01bc2e1b4..6e253407b3dc 100644
--- a/Documentation/RCU/checklist.txt
+++ b/Documentation/RCU/checklist.txt
@@ -13,10 +13,13 @@ over a rather long period of time, but improvements are always welcome!
13 detailed performance measurements show that RCU is nonetheless 13 detailed performance measurements show that RCU is nonetheless
14 the right tool for the job. 14 the right tool for the job.
15 15
16 The other exception would be where performance is not an issue, 16 Another exception is where performance is not an issue, and RCU
17 and RCU provides a simpler implementation. An example of this 17 provides a simpler implementation. An example of this situation
18 situation is the dynamic NMI code in the Linux 2.6 kernel, 18 is the dynamic NMI code in the Linux 2.6 kernel, at least on
19 at least on architectures where NMIs are rare. 19 architectures where NMIs are rare.
20
21 Yet another exception is where the low real-time latency of RCU's
22 read-side primitives is critically important.
20 23
211. Does the update code have proper mutual exclusion? 241. Does the update code have proper mutual exclusion?
22 25
@@ -39,9 +42,10 @@ over a rather long period of time, but improvements are always welcome!
39 42
402. Do the RCU read-side critical sections make proper use of 432. Do the RCU read-side critical sections make proper use of
41 rcu_read_lock() and friends? These primitives are needed 44 rcu_read_lock() and friends? These primitives are needed
42 to suppress preemption (or bottom halves, in the case of 45 to prevent grace periods from ending prematurely, which
43 rcu_read_lock_bh()) in the read-side critical sections, 46 could result in data being unceremoniously freed out from
44 and are also an excellent aid to readability. 47 under your read-side code, which can greatly increase the
48 actuarial risk of your kernel.
45 49
46 As a rough rule of thumb, any dereference of an RCU-protected 50 As a rough rule of thumb, any dereference of an RCU-protected
47 pointer must be covered by rcu_read_lock() or rcu_read_lock_bh() 51 pointer must be covered by rcu_read_lock() or rcu_read_lock_bh()
@@ -54,15 +58,30 @@ over a rather long period of time, but improvements are always welcome!
54 be running while updates are in progress. There are a number 58 be running while updates are in progress. There are a number
55 of ways to handle this concurrency, depending on the situation: 59 of ways to handle this concurrency, depending on the situation:
56 60
57 a. Make updates appear atomic to readers. For example, 61 a. Use the RCU variants of the list and hlist update
62 primitives to add, remove, and replace elements on an
63 RCU-protected list. Alternatively, use the RCU-protected
64 trees that have been added to the Linux kernel.
65
66 This is almost always the best approach.
67
68 b. Proceed as in (a) above, but also maintain per-element
69 locks (that are acquired by both readers and writers)
70 that guard per-element state. Of course, fields that
71 the readers refrain from accessing can be guarded by the
72 update-side lock.
73
74 This works quite well, also.
75
76 c. Make updates appear atomic to readers. For example,
58 pointer updates to properly aligned fields will appear 77 pointer updates to properly aligned fields will appear
59 atomic, as will individual atomic primitives. Operations 78 atomic, as will individual atomic primitives. Operations
60 performed under a lock and sequences of multiple atomic 79 performed under a lock and sequences of multiple atomic
61 primitives will -not- appear to be atomic. 80 primitives will -not- appear to be atomic.
62 81
63 This is almost always the best approach. 82 This can work, but is starting to get a bit tricky.
64 83
65 b. Carefully order the updates and the reads so that 84 d. Carefully order the updates and the reads so that
66 readers see valid data at all phases of the update. 85 readers see valid data at all phases of the update.
67 This is often more difficult than it sounds, especially 86 This is often more difficult than it sounds, especially
68 given modern CPUs' tendency to reorder memory references. 87 given modern CPUs' tendency to reorder memory references.
@@ -123,18 +142,22 @@ over a rather long period of time, but improvements are always welcome!
123 when publicizing a pointer to a structure that can 142 when publicizing a pointer to a structure that can
124 be traversed by an RCU read-side critical section. 143 be traversed by an RCU read-side critical section.
125 144
1265. If call_rcu(), or a related primitive such as call_rcu_bh(), 1455. If call_rcu(), or a related primitive such as call_rcu_bh() or
127 is used, the callback function must be written to be called 146 call_rcu_sched(), is used, the callback function must be
128 from softirq context. In particular, it cannot block. 147 written to be called from softirq context. In particular,
148 it cannot block.
129 149
1306. Since synchronize_rcu() can block, it cannot be called from 1506. Since synchronize_rcu() can block, it cannot be called from
131 any sort of irq context. 151 any sort of irq context. Ditto for synchronize_sched() and
152 synchronize_srcu().
132 153
1337. If the updater uses call_rcu(), then the corresponding readers 1547. If the updater uses call_rcu(), then the corresponding readers
134 must use rcu_read_lock() and rcu_read_unlock(). If the updater 155 must use rcu_read_lock() and rcu_read_unlock(). If the updater
135 uses call_rcu_bh(), then the corresponding readers must use 156 uses call_rcu_bh(), then the corresponding readers must use
136 rcu_read_lock_bh() and rcu_read_unlock_bh(). Mixing things up 157 rcu_read_lock_bh() and rcu_read_unlock_bh(). If the updater
137 will result in confusion and broken kernels. 158 uses call_rcu_sched(), then the corresponding readers must
159 disable preemption. Mixing things up will result in confusion
160 and broken kernels.
138 161
139 One exception to this rule: rcu_read_lock() and rcu_read_unlock() 162 One exception to this rule: rcu_read_lock() and rcu_read_unlock()
140 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh() 163 may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh()
@@ -143,9 +166,9 @@ over a rather long period of time, but improvements are always welcome!
143 such cases is a must, of course! And the jury is still out on 166 such cases is a must, of course! And the jury is still out on
144 whether the increased speed is worth it. 167 whether the increased speed is worth it.
145 168
1468. Although synchronize_rcu() is a bit slower than is call_rcu(), 1698. Although synchronize_rcu() is slower than is call_rcu(), it
147 it usually results in simpler code. So, unless update 170 usually results in simpler code. So, unless update performance
148 performance is critically important or the updaters cannot block, 171 is critically important or the updaters cannot block,
149 synchronize_rcu() should be used in preference to call_rcu(). 172 synchronize_rcu() should be used in preference to call_rcu().
150 173
151 An especially important property of the synchronize_rcu() 174 An especially important property of the synchronize_rcu()
@@ -187,23 +210,23 @@ over a rather long period of time, but improvements are always welcome!
187 number of updates per grace period. 210 number of updates per grace period.
188 211
1899. All RCU list-traversal primitives, which include 2129. All RCU list-traversal primitives, which include
190 list_for_each_rcu(), list_for_each_entry_rcu(), 213 rcu_dereference(), list_for_each_entry_rcu(),
191 list_for_each_continue_rcu(), and list_for_each_safe_rcu(), 214 list_for_each_continue_rcu(), and list_for_each_safe_rcu(),
192 must be within an RCU read-side critical section. RCU 215 must be either within an RCU read-side critical section or
216 must be protected by appropriate update-side locks. RCU
193 read-side critical sections are delimited by rcu_read_lock() 217 read-side critical sections are delimited by rcu_read_lock()
194 and rcu_read_unlock(), or by similar primitives such as 218 and rcu_read_unlock(), or by similar primitives such as
195 rcu_read_lock_bh() and rcu_read_unlock_bh(). 219 rcu_read_lock_bh() and rcu_read_unlock_bh().
196 220
197 Use of the _rcu() list-traversal primitives outside of an 221 The reason that it is permissible to use RCU list-traversal
198 RCU read-side critical section causes no harm other than 222 primitives when the update-side lock is held is that doing so
199 a slight performance degradation on Alpha CPUs. It can 223 can be quite helpful in reducing code bloat when common code is
200 also be quite helpful in reducing code bloat when common 224 shared between readers and updaters.
201 code is shared between readers and updaters.
202 225
20310. Conversely, if you are in an RCU read-side critical section, 22610. Conversely, if you are in an RCU read-side critical section,
204 you -must- use the "_rcu()" variants of the list macros. 227 and you don't hold the appropriate update-side lock, you -must-
205 Failing to do so will break Alpha and confuse people reading 228 use the "_rcu()" variants of the list macros. Failing to do so
206 your code. 229 will break Alpha and confuse people reading your code.
207 230
20811. Note that synchronize_rcu() -only- guarantees to wait until 23111. Note that synchronize_rcu() -only- guarantees to wait until
209 all currently executing rcu_read_lock()-protected RCU read-side 232 all currently executing rcu_read_lock()-protected RCU read-side
@@ -230,6 +253,14 @@ over a rather long period of time, but improvements are always welcome!
230 must use whatever locking or other synchronization is required 253 must use whatever locking or other synchronization is required
231 to safely access and/or modify that data structure. 254 to safely access and/or modify that data structure.
232 255
256 RCU callbacks are -usually- executed on the same CPU that executed
257 the corresponding call_rcu(), call_rcu_bh(), or call_rcu_sched(),
258 but are by -no- means guaranteed to be. For example, if a given
259 CPU goes offline while having an RCU callback pending, then that
260 RCU callback will execute on some surviving CPU. (If this was
261 not the case, a self-spawning RCU callback would prevent the
262 victim CPU from ever going offline.)
263
23314. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu()) 26414. SRCU (srcu_read_lock(), srcu_read_unlock(), and synchronize_srcu())
234 may only be invoked from process context. Unlike other forms of 265 may only be invoked from process context. Unlike other forms of
235 RCU, it -is- permissible to block in an SRCU read-side critical 266 RCU, it -is- permissible to block in an SRCU read-side critical
diff --git a/Documentation/RCU/rcuref.txt b/Documentation/RCU/rcuref.txt
index 451de2ad8329..4202ad093130 100644
--- a/Documentation/RCU/rcuref.txt
+++ b/Documentation/RCU/rcuref.txt
@@ -29,9 +29,9 @@ release_referenced() delete()
29 } 29 }
30 30
31If this list/array is made lock free using RCU as in changing the 31If this list/array is made lock free using RCU as in changing the
32write_lock() in add() and delete() to spin_lock and changing read_lock 32write_lock() in add() and delete() to spin_lock() and changing read_lock()
33in search_and_reference to rcu_read_lock(), the atomic_get in 33in search_and_reference() to rcu_read_lock(), the atomic_inc() in
34search_and_reference could potentially hold reference to an element which 34search_and_reference() could potentially hold reference to an element which
35has already been deleted from the list/array. Use atomic_inc_not_zero() 35has already been deleted from the list/array. Use atomic_inc_not_zero()
36in this scenario as follows: 36in this scenario as follows:
37 37
@@ -40,20 +40,20 @@ add() search_and_reference()
40{ { 40{ {
41 alloc_object rcu_read_lock(); 41 alloc_object rcu_read_lock();
42 ... search_for_element 42 ... search_for_element
43 atomic_set(&el->rc, 1); if (atomic_inc_not_zero(&el->rc)) { 43 atomic_set(&el->rc, 1); if (!atomic_inc_not_zero(&el->rc)) {
44 write_lock(&list_lock); rcu_read_unlock(); 44 spin_lock(&list_lock); rcu_read_unlock();
45 return FAIL; 45 return FAIL;
46 add_element } 46 add_element }
47 ... ... 47 ... ...
48 write_unlock(&list_lock); rcu_read_unlock(); 48 spin_unlock(&list_lock); rcu_read_unlock();
49} } 49} }
503. 4. 503. 4.
51release_referenced() delete() 51release_referenced() delete()
52{ { 52{ {
53 ... write_lock(&list_lock); 53 ... spin_lock(&list_lock);
54 if (atomic_dec_and_test(&el->rc)) ... 54 if (atomic_dec_and_test(&el->rc)) ...
55 call_rcu(&el->head, el_free); delete_element 55 call_rcu(&el->head, el_free); delete_element
56 ... write_unlock(&list_lock); 56 ... spin_unlock(&list_lock);
57} ... 57} ...
58 if (atomic_dec_and_test(&el->rc)) 58 if (atomic_dec_and_test(&el->rc))
59 call_rcu(&el->head, el_free); 59 call_rcu(&el->head, el_free);
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt
index 2967a65269d8..a342b6e1cc10 100644
--- a/Documentation/RCU/torture.txt
+++ b/Documentation/RCU/torture.txt
@@ -10,23 +10,30 @@ status messages via printk(), which can be examined via the dmesg
10command (perhaps grepping for "torture"). The test is started 10command (perhaps grepping for "torture"). The test is started
11when the module is loaded, and stops when the module is unloaded. 11when the module is loaded, and stops when the module is unloaded.
12 12
13However, actually setting this config option to "y" results in the system 13CONFIG_RCU_TORTURE_TEST_RUNNABLE
14running the test immediately upon boot, and ending only when the system 14
15is taken down. Normally, one will instead want to build the system 15It is also possible to specify CONFIG_RCU_TORTURE_TEST=y, which will
16with CONFIG_RCU_TORTURE_TEST=m and to use modprobe and rmmod to control 16result in the tests being loaded into the base kernel. In this case,
17the test, perhaps using a script similar to the one shown at the end of 17the CONFIG_RCU_TORTURE_TEST_RUNNABLE config option is used to specify
18this document. Note that you will need CONFIG_MODULE_UNLOAD in order 18whether the RCU torture tests are to be started immediately during
19to be able to end the test. 19boot or whether the /proc/sys/kernel/rcutorture_runnable file is used
20to enable them. This /proc file can be used to repeatedly pause and
21restart the tests, regardless of the initial state specified by the
22CONFIG_RCU_TORTURE_TEST_RUNNABLE config option.
23
24You will normally -not- want to start the RCU torture tests during boot
25(and thus the default is CONFIG_RCU_TORTURE_TEST_RUNNABLE=n), but doing
26this can sometimes be useful in finding boot-time bugs.
20 27
21 28
22MODULE PARAMETERS 29MODULE PARAMETERS
23 30
24This module has the following parameters: 31This module has the following parameters:
25 32
26nreaders This is the number of RCU reading threads supported. 33irqreaders Says to invoke RCU readers from irq level. This is currently
27 The default is twice the number of CPUs. Why twice? 34 done via timers. Defaults to "1" for variants of RCU that
28 To properly exercise RCU implementations with preemptible 35 permit this. (Or, more accurately, variants of RCU that do
29 read-side critical sections. 36 -not- permit this know to ignore this variable.)
30 37
31nfakewriters This is the number of RCU fake writer threads to run. Fake 38nfakewriters This is the number of RCU fake writer threads to run. Fake
32 writer threads repeatedly use the synchronous "wait for 39 writer threads repeatedly use the synchronous "wait for
@@ -37,6 +44,16 @@ nfakewriters This is the number of RCU fake writer threads to run. Fake
37 to trigger special cases caused by multiple writers, such as 44 to trigger special cases caused by multiple writers, such as
38 the synchronize_srcu() early return optimization. 45 the synchronize_srcu() early return optimization.
39 46
47nreaders This is the number of RCU reading threads supported.
48 The default is twice the number of CPUs. Why twice?
49 To properly exercise RCU implementations with preemptible
50 read-side critical sections.
51
52shuffle_interval
53 The number of seconds to keep the test threads affinitied
54 to a particular subset of the CPUs, defaults to 3 seconds.
55 Used in conjunction with test_no_idle_hz.
56
40stat_interval The number of seconds between output of torture 57stat_interval The number of seconds between output of torture
41 statistics (via printk()). Regardless of the interval, 58 statistics (via printk()). Regardless of the interval,
42 statistics are printed when the module is unloaded. 59 statistics are printed when the module is unloaded.
@@ -44,10 +61,11 @@ stat_interval The number of seconds between output of torture
44 be printed -only- when the module is unloaded, and this 61 be printed -only- when the module is unloaded, and this
45 is the default. 62 is the default.
46 63
47shuffle_interval 64stutter The length of time to run the test before pausing for this
48 The number of seconds to keep the test threads affinitied 65 same period of time. Defaults to "stutter=5", so as
49 to a particular subset of the CPUs, defaults to 5 seconds. 66 to run and pause for (roughly) five-second intervals.
50 Used in conjunction with test_no_idle_hz. 67 Specifying "stutter=0" causes the test to run continuously
68 without pausing, which is the old default behavior.
51 69
52test_no_idle_hz Whether or not to test the ability of RCU to operate in 70test_no_idle_hz Whether or not to test the ability of RCU to operate in
53 a kernel that disables the scheduling-clock interrupt to 71 a kernel that disables the scheduling-clock interrupt to
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index e0d6d99b8f9b..96170824a717 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -1,3 +1,11 @@
1Please note that the "What is RCU?" LWN series is an excellent place
2to start learning about RCU:
3
41. What is RCU, Fundamentally? http://lwn.net/Articles/262464/
52. What is RCU? Part 2: Usage http://lwn.net/Articles/263130/
63. RCU part 3: the RCU API http://lwn.net/Articles/264090/
7
8
1What is RCU? 9What is RCU?
2 10
3RCU is a synchronization mechanism that was added to the Linux kernel 11RCU is a synchronization mechanism that was added to the Linux kernel
@@ -772,26 +780,16 @@ Linux-kernel source code, but it helps to have a full list of the
772APIs, since there does not appear to be a way to categorize them 780APIs, since there does not appear to be a way to categorize them
773in docbook. Here is the list, by category. 781in docbook. Here is the list, by category.
774 782
775Markers for RCU read-side critical sections:
776
777 rcu_read_lock
778 rcu_read_unlock
779 rcu_read_lock_bh
780 rcu_read_unlock_bh
781 srcu_read_lock
782 srcu_read_unlock
783
784RCU pointer/list traversal: 783RCU pointer/list traversal:
785 784
786 rcu_dereference 785 rcu_dereference
787 list_for_each_rcu (to be deprecated in favor of
788 list_for_each_entry_rcu)
789 list_for_each_entry_rcu 786 list_for_each_entry_rcu
787 hlist_for_each_entry_rcu
788
790 list_for_each_continue_rcu (to be deprecated in favor of new 789 list_for_each_continue_rcu (to be deprecated in favor of new
791 list_for_each_entry_continue_rcu) 790 list_for_each_entry_continue_rcu)
792 hlist_for_each_entry_rcu
793 791
794RCU pointer update: 792RCU pointer/list update:
795 793
796 rcu_assign_pointer 794 rcu_assign_pointer
797 list_add_rcu 795 list_add_rcu
@@ -799,16 +797,36 @@ RCU pointer update:
799 list_del_rcu 797 list_del_rcu
800 list_replace_rcu 798 list_replace_rcu
801 hlist_del_rcu 799 hlist_del_rcu
800 hlist_add_after_rcu
801 hlist_add_before_rcu
802 hlist_add_head_rcu 802 hlist_add_head_rcu
803 hlist_replace_rcu
804 list_splice_init_rcu()
805
806RCU: Critical sections Grace period Barrier
803 807
804RCU grace period: 808 rcu_read_lock synchronize_net rcu_barrier
809 rcu_read_unlock synchronize_rcu
810 call_rcu
811
812
813bh: Critical sections Grace period Barrier
814
815 rcu_read_lock_bh call_rcu_bh rcu_barrier_bh
816 rcu_read_unlock_bh
817
818
819sched: Critical sections Grace period Barrier
820
821 [preempt_disable] synchronize_sched rcu_barrier_sched
822 [and friends] call_rcu_sched
823
824
825SRCU: Critical sections Grace period Barrier
826
827 srcu_read_lock synchronize_srcu N/A
828 srcu_read_unlock
805 829
806 synchronize_net
807 synchronize_sched
808 synchronize_rcu
809 synchronize_srcu
810 call_rcu
811 call_rcu_bh
812 830
813See the comment headers in the source code (or the docbook generated 831See the comment headers in the source code (or the docbook generated
814from them) for more information. 832from them) for more information.
diff --git a/Documentation/SELinux.txt b/Documentation/SELinux.txt
new file mode 100644
index 000000000000..07eae00f3314
--- /dev/null
+++ b/Documentation/SELinux.txt
@@ -0,0 +1,27 @@
1If you want to use SELinux, chances are you will want
2to use the distro-provided policies, or install the
3latest reference policy release from
4 http://oss.tresys.com/projects/refpolicy
5
6However, if you want to install a dummy policy for
7testing, you can do using 'mdp' provided under
8scripts/selinux. Note that this requires the selinux
9userspace to be installed - in particular you will
10need checkpolicy to compile a kernel, and setfiles and
11fixfiles to label the filesystem.
12
13 1. Compile the kernel with selinux enabled.
14 2. Type 'make' to compile mdp.
15 3. Make sure that you are not running with
16 SELinux enabled and a real policy. If
17 you are, reboot with selinux disabled
18 before continuing.
19 4. Run install_policy.sh:
20 cd scripts/selinux
21 sh install_policy.sh
22
23Step 4 will create a new dummy policy valid for your
24kernel, with a single selinux user, role, and type.
25It will compile the policy, will set your SELINUXTYPE to
26dummy in /etc/selinux/config, install the compiled policy
27as 'dummy', and relabel your filesystem.
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index da10e0714241..21f0795af20f 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -67,6 +67,8 @@ kernel patches.
67 67
6819: All new userspace interfaces are documented in Documentation/ABI/. 6819: All new userspace interfaces are documented in Documentation/ABI/.
69 See Documentation/ABI/README for more information. 69 See Documentation/ABI/README for more information.
70 Patches that change userspace interfaces should be CCed to
71 linux-api@vger.kernel.org.
70 72
7120: Check that it all passes `make headers_check'. 7320: Check that it all passes `make headers_check'.
72 74
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 118ca6e9404f..f79ad9ff6031 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -528,7 +528,33 @@ See more details on the proper patch format in the following
528references. 528references.
529 529
530 530
53116) Sending "git pull" requests (from Linus emails)
531 532
533Please write the git repo address and branch name alone on the same line
534so that I can't even by mistake pull from the wrong branch, and so
535that a triple-click just selects the whole thing.
536
537So the proper format is something along the lines of:
538
539 "Please pull from
540
541 git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus
542
543 to get these changes:"
544
545so that I don't have to hunt-and-peck for the address and inevitably
546get it wrong (actually, I've only gotten it wrong a few times, and
547checking against the diffstat tells me when I get it wrong, but I'm
548just a lot more comfortable when I don't have to "look for" the right
549thing to pull, and double-check that I have the right branch-name).
550
551
552Please use "git diff -M --stat --summary" to generate the diffstat:
553the -M enables rename detection, and the summary enables a summary of
554new/deleted or renamed files.
555
556With rename detection, the statistics are rather different [...]
557because git will notice that a fair number of the changes are renames.
532 558
533----------------------------------- 559-----------------------------------
534SECTION 2 - HINTS, TIPS, AND TRICKS 560SECTION 2 - HINTS, TIPS, AND TRICKS
diff --git a/Documentation/accounting/Makefile b/Documentation/accounting/Makefile
new file mode 100644
index 000000000000..31929eb875b1
--- /dev/null
+++ b/Documentation/accounting/Makefile
@@ -0,0 +1,10 @@
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 := getdelays
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
9
10HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include
diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt
index 1443cd71d263..8a12f0730c94 100644
--- a/Documentation/accounting/delay-accounting.txt
+++ b/Documentation/accounting/delay-accounting.txt
@@ -11,6 +11,7 @@ the delays experienced by a task while
11a) waiting for a CPU (while being runnable) 11a) waiting for a CPU (while being runnable)
12b) completion of synchronous block I/O initiated by the task 12b) completion of synchronous block I/O initiated by the task
13c) swapping in pages 13c) swapping in pages
14d) memory reclaim
14 15
15and makes these statistics available to userspace through 16and makes these statistics available to userspace through
16the taskstats interface. 17the taskstats interface.
@@ -41,7 +42,7 @@ this structure. See
41 include/linux/taskstats.h 42 include/linux/taskstats.h
42for a description of the fields pertaining to delay accounting. 43for a description of the fields pertaining to delay accounting.
43It will generally be in the form of counters returning the cumulative 44It will generally be in the form of counters returning the cumulative
44delay seen for cpu, sync block I/O, swapin etc. 45delay seen for cpu, sync block I/O, swapin, memory reclaim etc.
45 46
46Taking the difference of two successive readings of a given 47Taking the difference of two successive readings of a given
47counter (say cpu_delay_total) for a task will give the delay 48counter (say cpu_delay_total) for a task will give the delay
@@ -94,7 +95,9 @@ CPU count real total virtual total delay total
94 7876 92005750 100000000 24001500 95 7876 92005750 100000000 24001500
95IO count delay total 96IO count delay total
96 0 0 97 0 0
97MEM count delay total 98SWAP count delay total
99 0 0
100RECLAIM count delay total
98 0 0 101 0 0
99 102
100Get delays seen in executing a given simple command 103Get delays seen in executing a given simple command
@@ -108,5 +111,7 @@ CPU count real total virtual total delay total
108 6 4000250 4000000 0 111 6 4000250 4000000 0
109IO count delay total 112IO count delay total
110 0 0 113 0 0
111MEM count delay total 114SWAP count delay total
115 0 0
116RECLAIM count delay total
112 0 0 117 0 0
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index 40121b5cca14..cc49400b4af8 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -196,14 +196,24 @@ void print_delayacct(struct taskstats *t)
196 " %15llu%15llu%15llu%15llu\n" 196 " %15llu%15llu%15llu%15llu\n"
197 "IO %15s%15s\n" 197 "IO %15s%15s\n"
198 " %15llu%15llu\n" 198 " %15llu%15llu\n"
199 "MEM %15s%15s\n" 199 "SWAP %15s%15s\n"
200 " %15llu%15llu\n"
201 "RECLAIM %12s%15s\n"
200 " %15llu%15llu\n", 202 " %15llu%15llu\n",
201 "count", "real total", "virtual total", "delay total", 203 "count", "real total", "virtual total", "delay total",
202 t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total, 204 (unsigned long long)t->cpu_count,
203 t->cpu_delay_total, 205 (unsigned long long)t->cpu_run_real_total,
206 (unsigned long long)t->cpu_run_virtual_total,
207 (unsigned long long)t->cpu_delay_total,
208 "count", "delay total",
209 (unsigned long long)t->blkio_count,
210 (unsigned long long)t->blkio_delay_total,
211 "count", "delay total",
212 (unsigned long long)t->swapin_count,
213 (unsigned long long)t->swapin_delay_total,
204 "count", "delay total", 214 "count", "delay total",
205 t->blkio_count, t->blkio_delay_total, 215 (unsigned long long)t->freepages_count,
206 "count", "delay total", t->swapin_count, t->swapin_delay_total); 216 (unsigned long long)t->freepages_delay_total);
207} 217}
208 218
209void task_context_switch_counts(struct taskstats *t) 219void task_context_switch_counts(struct taskstats *t)
@@ -211,14 +221,17 @@ void task_context_switch_counts(struct taskstats *t)
211 printf("\n\nTask %15s%15s\n" 221 printf("\n\nTask %15s%15s\n"
212 " %15llu%15llu\n", 222 " %15llu%15llu\n",
213 "voluntary", "nonvoluntary", 223 "voluntary", "nonvoluntary",
214 t->nvcsw, t->nivcsw); 224 (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
215} 225}
216 226
217void print_cgroupstats(struct cgroupstats *c) 227void print_cgroupstats(struct cgroupstats *c)
218{ 228{
219 printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " 229 printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
220 "uninterruptible %llu\n", c->nr_sleeping, c->nr_io_wait, 230 "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
221 c->nr_running, c->nr_stopped, c->nr_uninterruptible); 231 (unsigned long long)c->nr_io_wait,
232 (unsigned long long)c->nr_running,
233 (unsigned long long)c->nr_stopped,
234 (unsigned long long)c->nr_uninterruptible);
222} 235}
223 236
224 237
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt
index 8aa7529f8258..e7512c061c15 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.txt
@@ -6,7 +6,7 @@ This document contains an explanation of the struct taskstats fields.
6There are three different groups of fields in the struct taskstats: 6There are three different groups of fields in the struct taskstats:
7 7
81) Common and basic accounting fields 81) Common and basic accounting fields
9 If CONFIG_TASKSTATS is set, the taskstats inteface is enabled and 9 If CONFIG_TASKSTATS is set, the taskstats interface is enabled and
10 the common fields and basic accounting fields are collected for 10 the common fields and basic accounting fields are collected for
11 delivery at do_exit() of a task. 11 delivery at do_exit() of a task.
122) Delay accounting fields 122) Delay accounting fields
@@ -24,6 +24,10 @@ There are three different groups of fields in the struct taskstats:
24 24
254) Per-task and per-thread context switch count statistics 254) Per-task and per-thread context switch count statistics
26 26
275) Time accounting for SMT machines
28
296) Extended delay accounting fields for memory reclaim
30
27Future extension should add fields to the end of the taskstats struct, and 31Future extension should add fields to the end of the taskstats struct, and
28should not change the relative position of each field within the struct. 32should not change the relative position of each field within the struct.
29 33
@@ -164,4 +168,13 @@ struct taskstats {
164 __u64 nvcsw; /* Context voluntary switch counter */ 168 __u64 nvcsw; /* Context voluntary switch counter */
165 __u64 nivcsw; /* Context involuntary switch counter */ 169 __u64 nivcsw; /* Context involuntary switch counter */
166 170
1715) Time accounting for SMT machines
172 __u64 ac_utimescaled; /* utime scaled on frequency etc */
173 __u64 ac_stimescaled; /* stime scaled on frequency etc */
174 __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */
175
1766) Extended delay accounting fields for memory reclaim
177 /* Delay waiting for memory reclaim */
178 __u64 freepages_count;
179 __u64 freepages_delay_total;
167} 180}
diff --git a/Documentation/arm/IXP4xx b/Documentation/arm/IXP4xx
index 43edb4ecf27d..72fbcc4fcab0 100644
--- a/Documentation/arm/IXP4xx
+++ b/Documentation/arm/IXP4xx
@@ -32,7 +32,7 @@ Linux currently supports the following features on the IXP4xx chips:
32- Flash access (MTD/JFFS) 32- Flash access (MTD/JFFS)
33- I2C through GPIO on IXP42x 33- I2C through GPIO on IXP42x
34- GPIO for input/output/interrupts 34- GPIO for input/output/interrupts
35 See include/asm-arm/arch-ixp4xx/platform.h for access functions. 35 See arch/arm/mach-ixp4xx/include/mach/platform.h for access functions.
36- Timers (watchdog, OS) 36- Timers (watchdog, OS)
37 37
38The following components of the chips are not supported by Linux and 38The following components of the chips are not supported by Linux and
diff --git a/Documentation/arm/Interrupts b/Documentation/arm/Interrupts
index 0d3dbf1099bc..f09ab1b90ef1 100644
--- a/Documentation/arm/Interrupts
+++ b/Documentation/arm/Interrupts
@@ -138,14 +138,8 @@ So, what's changed?
138 138
139 Set active the IRQ edge(s)/level. This replaces the 139 Set active the IRQ edge(s)/level. This replaces the
140 SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() 140 SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge()
141 function. Type should be one of the following: 141 function. Type should be one of IRQ_TYPE_xxx defined in
142 142 <linux/irq.h>
143 #define IRQT_NOEDGE (0)
144 #define IRQT_RISING (__IRQT_RISEDGE)
145 #define IRQT_FALLING (__IRQT_FALEDGE)
146 #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
147 #define IRQT_LOW (__IRQT_LOWLVL)
148 #define IRQT_HIGH (__IRQT_HIGHLVL)
149 143
1503. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. 1443. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type.
151 145
@@ -164,7 +158,7 @@ So, what's changed?
164 be re-checked for pending events. (see the Neponset IRQ handler for 158 be re-checked for pending events. (see the Neponset IRQ handler for
165 details). 159 details).
166 160
1677. fixup_irq() is gone, as is include/asm-arm/arch-*/irq.h 1617. fixup_irq() is gone, as is arch/arm/mach-*/include/mach/irq.h
168 162
169Please note that this will not solve all problems - some of them are 163Please note that this will not solve all problems - some of them are
170hardware based. Mixing level-based and edge-based IRQs on the same 164hardware based. Mixing level-based and edge-based IRQs on the same
diff --git a/Documentation/arm/README b/Documentation/arm/README
index 9b9c8226fdc4..d98783fbe0c7 100644
--- a/Documentation/arm/README
+++ b/Documentation/arm/README
@@ -79,7 +79,7 @@ Machine/Platform support
79 To this end, we now have arch/arm/mach-$(MACHINE) directories which are 79 To this end, we now have arch/arm/mach-$(MACHINE) directories which are
80 designed to house the non-driver files for a particular machine (eg, PCI, 80 designed to house the non-driver files for a particular machine (eg, PCI,
81 memory management, architecture definitions etc). For all future 81 memory management, architecture definitions etc). For all future
82 machines, there should be a corresponding include/asm-arm/arch-$(MACHINE) 82 machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach
83 directory. 83 directory.
84 84
85 85
@@ -176,7 +176,7 @@ Kernel entry (head.S)
176 class typically based around one or more system on a chip devices, and 176 class typically based around one or more system on a chip devices, and
177 acts as a natural container around the actual implementations. These 177 acts as a natural container around the actual implementations. These
178 classes are given directories - arch/arm/mach-<class> and 178 classes are given directories - arch/arm/mach-<class> and
179 include/asm-arm/arch-<class> - which contain the source files to 179 arch/arm/mach-<class> - which contain the source files to/include/mach
180 support the machine class. This directories also contain any machine 180 support the machine class. This directories also contain any machine
181 specific supporting code. 181 specific supporting code.
182 182
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 8caea8c237ee..ea7ccfc4b274 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -13,16 +13,31 @@ Introduction
13 data-sheet/users manual to find out the complete list. 13 data-sheet/users manual to find out the complete list.
14 14
15 15
16GPIOLIB
17-------
18
19 With the event of the GPIOLIB in drivers/gpio, support for some
20 of the GPIO functions such as reading and writing a pin will
21 be removed in favour of this common access method.
22
23 Once all the extant drivers have been converted, the functions
24 listed below will be removed (they may be marked as __deprecated
25 in the near future).
26
27 - s3c2410_gpio_getpin
28 - s3c2410_gpio_setpin
29
30
16Headers 31Headers
17------- 32-------
18 33
19 See include/asm-arm/arch-s3c2410/regs-gpio.h for the list 34 See arch/arm/mach-s3c2410/include/mach/regs-gpio.h for the list
20 of GPIO pins, and the configuration values for them. This 35 of GPIO pins, and the configuration values for them. This
21 is included by using #include <asm/arch/regs-gpio.h> 36 is included by using #include <mach/regs-gpio.h>
22 37
23 The GPIO management functions are defined in the hardware 38 The GPIO management functions are defined in the hardware
24 header include/asm-arm/arch-s3c2410/hardware.h which can be 39 header arch/arm/mach-s3c2410/include/mach/hardware.h which can be
25 included by #include <asm/arch/hardware.h> 40 included by #include <mach/hardware.h>
26 41
27 A useful amount of documentation can be found in the hardware 42 A useful amount of documentation can be found in the hardware
28 header on how the GPIO functions (and others) work. 43 header on how the GPIO functions (and others) work.
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt
index d04e1e30c47f..cff6227b4484 100644
--- a/Documentation/arm/Samsung-S3C24XX/Overview.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt
@@ -8,9 +8,10 @@ Introduction
8 8
9 The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported 9 The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported
10 by the 's3c2410' architecture of ARM Linux. Currently the S3C2410, 10 by the 's3c2410' architecture of ARM Linux. Currently the S3C2410,
11 S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported. 11 S3C2412, S3C2413, S3C2440, S3C2442 and S3C2443 devices are supported.
12
13 Support for the S3C2400 and S3C24A0 series are in progress.
12 14
13 Support for the S3C2400 series is in progress.
14 15
15Configuration 16Configuration
16------------- 17-------------
@@ -36,7 +37,23 @@ Layout
36 in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440 37 in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440
37 38
38 Register, kernel and platform data definitions are held in the 39 Register, kernel and platform data definitions are held in the
39 include/asm-arm/arch-s3c2410 directory. 40 arch/arm/mach-s3c2410 directory./include/mach
41
42arch/arm/plat-s3c24xx:
43
44 Files in here are either common to all the s3c24xx family,
45 or are common to only some of them with names to indicate this
46 status. The files that are not common to all are generally named
47 with the initial cpu they support in the series to ensure a short
48 name without any possibility of confusion with newer devices.
49
50 As an example, initially s3c244x would cover s3c2440 and s3c2442, but
51 with the s3c2443 which does not share many of the same drivers in
52 this directory, the name becomes invalid. We stick to s3c2440-<x>
53 to indicate a driver that is s3c2440 and s3c2442 compatible.
54
55 This does mean that to find the status of any given SoC, a number
56 of directories may need to be searched.
40 57
41 58
42Machines 59Machines
@@ -159,6 +176,17 @@ NAND
159 For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt 176 For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt
160 177
161 178
179SD/MMC
180------
181
182 The SD/MMC hardware pre S3C2443 is supported in the current
183 kernel, the driver is drivers/mmc/host/s3cmci.c and supports
184 1 and 4 bit SD or MMC cards.
185
186 The SDIO behaviour of this driver has not been fully tested. There is no
187 current support for hardware SDIO interrupts.
188
189
162Serial 190Serial
163------ 191------
164 192
@@ -178,6 +206,9 @@ GPIO
178 The core contains support for manipulating the GPIO, see the 206 The core contains support for manipulating the GPIO, see the
179 documentation in GPIO.txt in the same directory as this file. 207 documentation in GPIO.txt in the same directory as this file.
180 208
209 Newer kernels carry GPIOLIB, and support is being moved towards
210 this with some of the older support in line to be removed.
211
181 212
182Clock Management 213Clock Management
183---------------- 214----------------
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
index b93b68e2b143..67671eba4231 100644
--- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
+++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
@@ -49,7 +49,7 @@ Board Support
49Platform Data 49Platform Data
50------------- 50-------------
51 51
52 See linux/include/asm-arm/arch-s3c2410/usb-control.h for the 52 See arch/arm/mach-s3c2410/include/mach/usb-control.h for the
53 descriptions of the platform device data. An implementation 53 descriptions of the platform device data. An implementation
54 can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . 54 can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c .
55 55
diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay/Makefile
new file mode 100644
index 000000000000..51fe23332c81
--- /dev/null
+++ b/Documentation/auxdisplay/Makefile
@@ -0,0 +1,10 @@
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 := cfag12864b-example
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
9
10HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include
diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b
index b714183d4125..eb7be393a510 100644
--- a/Documentation/auxdisplay/cfag12864b
+++ b/Documentation/auxdisplay/cfag12864b
@@ -3,7 +3,7 @@
3 =================================== 3 ===================================
4 4
5License: GPLv2 5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> 6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27 7Date: 2006-10-27
8 8
9 9
@@ -22,7 +22,7 @@ Date: 2006-10-27
221. DRIVER INFORMATION 221. DRIVER INFORMATION
23--------------------- 23---------------------
24 24
25This driver support one cfag12864b display at time. 25This driver supports a cfag12864b LCD.
26 26
27 27
28--------------------- 28---------------------
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c
index 7bfac354d4c9..2caeea5e4993 100644
--- a/Documentation/auxdisplay/cfag12864b-example.c
+++ b/Documentation/auxdisplay/cfag12864b-example.c
@@ -4,7 +4,7 @@
4 * Description: cfag12864b LCD userspace example program 4 * Description: cfag12864b LCD userspace example program
5 * License: GPLv2 5 * License: GPLv2
6 * 6 *
7 * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> 7 * Author: Copyright (C) Miguel Ojeda Sandonis
8 * Date: 2006-10-31 8 * Date: 2006-10-31
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
diff --git a/Documentation/auxdisplay/ks0108 b/Documentation/auxdisplay/ks0108
index 92b03b60c613..8ddda0c8ceef 100644
--- a/Documentation/auxdisplay/ks0108
+++ b/Documentation/auxdisplay/ks0108
@@ -3,7 +3,7 @@
3 ========================================== 3 ==========================================
4 4
5License: GPLv2 5License: GPLv2
6Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> 6Author & Maintainer: Miguel Ojeda Sandonis
7Date: 2006-10-27 7Date: 2006-10-27
8 8
9 9
@@ -21,7 +21,7 @@ Date: 2006-10-27
211. DRIVER INFORMATION 211. DRIVER INFORMATION
22--------------------- 22---------------------
23 23
24This driver support the ks0108 LCD controller. 24This driver supports the ks0108 LCD controller.
25 25
26 26
27--------------------- 27---------------------
diff --git a/Documentation/block/data-integrity.txt b/Documentation/block/data-integrity.txt
new file mode 100644
index 000000000000..e9dc8d86adc7
--- /dev/null
+++ b/Documentation/block/data-integrity.txt
@@ -0,0 +1,327 @@
1----------------------------------------------------------------------
21. INTRODUCTION
3
4Modern filesystems feature checksumming of data and metadata to
5protect against data corruption. However, the detection of the
6corruption is done at read time which could potentially be months
7after the data was written. At that point the original data that the
8application tried to write is most likely lost.
9
10The solution is to ensure that the disk is actually storing what the
11application meant it to. Recent additions to both the SCSI family
12protocols (SBC Data Integrity Field, SCC protection proposal) as well
13as SATA/T13 (External Path Protection) try to remedy this by adding
14support for appending integrity metadata to an I/O. The integrity
15metadata (or protection information in SCSI terminology) includes a
16checksum for each sector as well as an incrementing counter that
17ensures the individual sectors are written in the right order. And
18for some protection schemes also that the I/O is written to the right
19place on disk.
20
21Current storage controllers and devices implement various protective
22measures, for instance checksumming and scrubbing. But these
23technologies are working in their own isolated domains or at best
24between adjacent nodes in the I/O path. The interesting thing about
25DIF and the other integrity extensions is that the protection format
26is well defined and every node in the I/O path can verify the
27integrity of the I/O and reject it if corruption is detected. This
28allows not only corruption prevention but also isolation of the point
29of failure.
30
31----------------------------------------------------------------------
322. THE DATA INTEGRITY EXTENSIONS
33
34As written, the protocol extensions only protect the path between
35controller and storage device. However, many controllers actually
36allow the operating system to interact with the integrity metadata
37(IMD). We have been working with several FC/SAS HBA vendors to enable
38the protection information to be transferred to and from their
39controllers.
40
41The SCSI Data Integrity Field works by appending 8 bytes of protection
42information to each sector. The data + integrity metadata is stored
43in 520 byte sectors on disk. Data + IMD are interleaved when
44transferred between the controller and target. The T13 proposal is
45similar.
46
47Because it is highly inconvenient for operating systems to deal with
48520 (and 4104) byte sectors, we approached several HBA vendors and
49encouraged them to allow separation of the data and integrity metadata
50scatter-gather lists.
51
52The controller will interleave the buffers on write and split them on
53read. This means that the Linux can DMA the data buffers to and from
54host memory without changes to the page cache.
55
56Also, the 16-bit CRC checksum mandated by both the SCSI and SATA specs
57is somewhat heavy to compute in software. Benchmarks found that
58calculating this checksum had a significant impact on system
59performance for a number of workloads. Some controllers allow a
60lighter-weight checksum to be used when interfacing with the operating
61system. Emulex, for instance, supports the TCP/IP checksum instead.
62The IP checksum received from the OS is converted to the 16-bit CRC
63when writing and vice versa. This allows the integrity metadata to be
64generated by Linux or the application at very low cost (comparable to
65software RAID5).
66
67The IP checksum is weaker than the CRC in terms of detecting bit
68errors. However, the strength is really in the separation of the data
69buffers and the integrity metadata. These two distinct buffers much
70match up for an I/O to complete.
71
72The separation of the data and integrity metadata buffers as well as
73the choice in checksums is referred to as the Data Integrity
74Extensions. As these extensions are outside the scope of the protocol
75bodies (T10, T13), Oracle and its partners are trying to standardize
76them within the Storage Networking Industry Association.
77
78----------------------------------------------------------------------
793. KERNEL CHANGES
80
81The data integrity framework in Linux enables protection information
82to be pinned to I/Os and sent to/received from controllers that
83support it.
84
85The advantage to the integrity extensions in SCSI and SATA is that
86they enable us to protect the entire path from application to storage
87device. However, at the same time this is also the biggest
88disadvantage. It means that the protection information must be in a
89format that can be understood by the disk.
90
91Generally Linux/POSIX applications are agnostic to the intricacies of
92the storage devices they are accessing. The virtual filesystem switch
93and the block layer make things like hardware sector size and
94transport protocols completely transparent to the application.
95
96However, this level of detail is required when preparing the
97protection information to send to a disk. Consequently, the very
98concept of an end-to-end protection scheme is a layering violation.
99It is completely unreasonable for an application to be aware whether
100it is accessing a SCSI or SATA disk.
101
102The data integrity support implemented in Linux attempts to hide this
103from the application. As far as the application (and to some extent
104the kernel) is concerned, the integrity metadata is opaque information
105that's attached to the I/O.
106
107The current implementation allows the block layer to automatically
108generate the protection information for any I/O. Eventually the
109intent is to move the integrity metadata calculation to userspace for
110user data. Metadata and other I/O that originates within the kernel
111will still use the automatic generation interface.
112
113Some storage devices allow each hardware sector to be tagged with a
11416-bit value. The owner of this tag space is the owner of the block
115device. I.e. the filesystem in most cases. The filesystem can use
116this extra space to tag sectors as they see fit. Because the tag
117space is limited, the block interface allows tagging bigger chunks by
118way of interleaving. This way, 8*16 bits of information can be
119attached to a typical 4KB filesystem block.
120
121This also means that applications such as fsck and mkfs will need
122access to manipulate the tags from user space. A passthrough
123interface for this is being worked on.
124
125
126----------------------------------------------------------------------
1274. BLOCK LAYER IMPLEMENTATION DETAILS
128
1294.1 BIO
130
131The data integrity patches add a new field to struct bio when
132CONFIG_BLK_DEV_INTEGRITY is enabled. bio->bi_integrity is a pointer
133to a struct bip which contains the bio integrity payload. Essentially
134a bip is a trimmed down struct bio which holds a bio_vec containing
135the integrity metadata and the required housekeeping information (bvec
136pool, vector count, etc.)
137
138A kernel subsystem can enable data integrity protection on a bio by
139calling bio_integrity_alloc(bio). This will allocate and attach the
140bip to the bio.
141
142Individual pages containing integrity metadata can subsequently be
143attached using bio_integrity_add_page().
144
145bio_free() will automatically free the bip.
146
147
1484.2 BLOCK DEVICE
149
150Because the format of the protection data is tied to the physical
151disk, each block device has been extended with a block integrity
152profile (struct blk_integrity). This optional profile is registered
153with the block layer using blk_integrity_register().
154
155The profile contains callback functions for generating and verifying
156the protection data, as well as getting and setting application tags.
157The profile also contains a few constants to aid in completing,
158merging and splitting the integrity metadata.
159
160Layered block devices will need to pick a profile that's appropriate
161for all subdevices. blk_integrity_compare() can help with that. DM
162and MD linear, RAID0 and RAID1 are currently supported. RAID4/5/6
163will require extra work due to the application tag.
164
165
166----------------------------------------------------------------------
1675.0 BLOCK LAYER INTEGRITY API
168
1695.1 NORMAL FILESYSTEM
170
171 The normal filesystem is unaware that the underlying block device
172 is capable of sending/receiving integrity metadata. The IMD will
173 be automatically generated by the block layer at submit_bio() time
174 in case of a WRITE. A READ request will cause the I/O integrity
175 to be verified upon completion.
176
177 IMD generation and verification can be toggled using the
178
179 /sys/block/<bdev>/integrity/write_generate
180
181 and
182
183 /sys/block/<bdev>/integrity/read_verify
184
185 flags.
186
187
1885.2 INTEGRITY-AWARE FILESYSTEM
189
190 A filesystem that is integrity-aware can prepare I/Os with IMD
191 attached. It can also use the application tag space if this is
192 supported by the block device.
193
194
195 int bdev_integrity_enabled(block_device, int rw);
196
197 bdev_integrity_enabled() will return 1 if the block device
198 supports integrity metadata transfer for the data direction
199 specified in 'rw'.
200
201 bdev_integrity_enabled() honors the write_generate and
202 read_verify flags in sysfs and will respond accordingly.
203
204
205 int bio_integrity_prep(bio);
206
207 To generate IMD for WRITE and to set up buffers for READ, the
208 filesystem must call bio_integrity_prep(bio).
209
210 Prior to calling this function, the bio data direction and start
211 sector must be set, and the bio should have all data pages
212 added. It is up to the caller to ensure that the bio does not
213 change while I/O is in progress.
214
215 bio_integrity_prep() should only be called if
216 bio_integrity_enabled() returned 1.
217
218
219 int bio_integrity_tag_size(bio);
220
221 If the filesystem wants to use the application tag space it will
222 first have to find out how much storage space is available.
223 Because tag space is generally limited (usually 2 bytes per
224 sector regardless of sector size), the integrity framework
225 supports interleaving the information between the sectors in an
226 I/O.
227
228 Filesystems can call bio_integrity_tag_size(bio) to find out how
229 many bytes of storage are available for that particular bio.
230
231 Another option is bdev_get_tag_size(block_device) which will
232 return the number of available bytes per hardware sector.
233
234
235 int bio_integrity_set_tag(bio, void *tag_buf, len);
236
237 After a successful return from bio_integrity_prep(),
238 bio_integrity_set_tag() can be used to attach an opaque tag
239 buffer to a bio. Obviously this only makes sense if the I/O is
240 a WRITE.
241
242
243 int bio_integrity_get_tag(bio, void *tag_buf, len);
244
245 Similarly, at READ I/O completion time the filesystem can
246 retrieve the tag buffer using bio_integrity_get_tag().
247
248
2496.3 PASSING EXISTING INTEGRITY METADATA
250
251 Filesystems that either generate their own integrity metadata or
252 are capable of transferring IMD from user space can use the
253 following calls:
254
255
256 struct bip * bio_integrity_alloc(bio, gfp_mask, nr_pages);
257
258 Allocates the bio integrity payload and hangs it off of the bio.
259 nr_pages indicate how many pages of protection data need to be
260 stored in the integrity bio_vec list (similar to bio_alloc()).
261
262 The integrity payload will be freed at bio_free() time.
263
264
265 int bio_integrity_add_page(bio, page, len, offset);
266
267 Attaches a page containing integrity metadata to an existing
268 bio. The bio must have an existing bip,
269 i.e. bio_integrity_alloc() must have been called. For a WRITE,
270 the integrity metadata in the pages must be in a format
271 understood by the target device with the notable exception that
272 the sector numbers will be remapped as the request traverses the
273 I/O stack. This implies that the pages added using this call
274 will be modified during I/O! The first reference tag in the
275 integrity metadata must have a value of bip->bip_sector.
276
277 Pages can be added using bio_integrity_add_page() as long as
278 there is room in the bip bio_vec array (nr_pages).
279
280 Upon completion of a READ operation, the attached pages will
281 contain the integrity metadata received from the storage device.
282 It is up to the receiver to process them and verify data
283 integrity upon completion.
284
285
2866.4 REGISTERING A BLOCK DEVICE AS CAPABLE OF EXCHANGING INTEGRITY
287 METADATA
288
289 To enable integrity exchange on a block device the gendisk must be
290 registered as capable:
291
292 int blk_integrity_register(gendisk, blk_integrity);
293
294 The blk_integrity struct is a template and should contain the
295 following:
296
297 static struct blk_integrity my_profile = {
298 .name = "STANDARDSBODY-TYPE-VARIANT-CSUM",
299 .generate_fn = my_generate_fn,
300 .verify_fn = my_verify_fn,
301 .get_tag_fn = my_get_tag_fn,
302 .set_tag_fn = my_set_tag_fn,
303 .tuple_size = sizeof(struct my_tuple_size),
304 .tag_size = <tag bytes per hw sector>,
305 };
306
307 'name' is a text string which will be visible in sysfs. This is
308 part of the userland API so chose it carefully and never change
309 it. The format is standards body-type-variant.
310 E.g. T10-DIF-TYPE1-IP or T13-EPP-0-CRC.
311
312 'generate_fn' generates appropriate integrity metadata (for WRITE).
313
314 'verify_fn' verifies that the data buffer matches the integrity
315 metadata.
316
317 'tuple_size' must be set to match the size of the integrity
318 metadata per sector. I.e. 8 for DIF and EPP.
319
320 'tag_size' must be set to identify how many bytes of tag space
321 are available per hardware sector. For DIF this is either 2 or
322 0 depending on the value of the Control Mode Page ATO bit.
323
324 See 6.2 for a description of get_tag_fn and set_tag_fn.
325
326----------------------------------------------------------------------
3272007-12-24 Martin K. Petersen <martin.petersen@oracle.com>
diff --git a/Documentation/block/deadline-iosched.txt b/Documentation/block/deadline-iosched.txt
index c23cab13c3d1..72576769e0f4 100644
--- a/Documentation/block/deadline-iosched.txt
+++ b/Documentation/block/deadline-iosched.txt
@@ -30,12 +30,18 @@ write_expire (in ms)
30Similar to read_expire mentioned above, but for writes. 30Similar to read_expire mentioned above, but for writes.
31 31
32 32
33fifo_batch 33fifo_batch (number of requests)
34---------- 34----------
35 35
36When a read request expires its deadline, we must move some requests from 36Requests are grouped into ``batches'' of a particular data direction (read or
37the sorted io scheduler list to the block device dispatch queue. fifo_batch 37write) which are serviced in increasing sector order. To limit extra seeking,
38controls how many requests we move. 38deadline expiries are only checked between batches. fifo_batch controls the
39maximum number of requests per batch.
40
41This parameter tunes the balance between per-request latency and aggregate
42throughput. When low latency is the primary concern, smaller is better (where
43a value of 1 yields first-come first-served behaviour). Increasing fifo_batch
44generally improves throughput, at the cost of latency variation.
39 45
40 46
41writes_starved (number of dispatches) 47writes_starved (number of dispatches)
diff --git a/Documentation/bt8xxgpio.txt b/Documentation/bt8xxgpio.txt
new file mode 100644
index 000000000000..d8297e4ebd26
--- /dev/null
+++ b/Documentation/bt8xxgpio.txt
@@ -0,0 +1,67 @@
1===============================================================
2== BT8XXGPIO driver ==
3== ==
4== A driver for a selfmade cheap BT8xx based PCI GPIO-card ==
5== ==
6== For advanced documentation, see ==
7== http://www.bu3sch.de/btgpio.php ==
8===============================================================
9
10
11A generic digital 24-port PCI GPIO card can be built out of an ordinary
12Brooktree bt848, bt849, bt878 or bt879 based analog TV tuner card. The
13Brooktree chip is used in old analog Hauppauge WinTV PCI cards. You can easily
14find them used for low prices on the net.
15
16The bt8xx chip does have 24 digital GPIO ports.
17These ports are accessible via 24 pins on the SMD chip package.
18
19
20==============================================
21== How to physically access the GPIO pins ==
22==============================================
23
24The are several ways to access these pins. One might unsolder the whole chip
25and put it on a custom PCI board, or one might only unsolder each individual
26GPIO pin and solder that to some tiny wire. As the chip package really is tiny
27there are some advanced soldering skills needed in any case.
28
29The physical pinouts are drawn in the following ASCII art.
30The GPIO pins are marked with G00-G23
31
32 G G G G G G G G G G G G G G G G G G
33 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
34 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
35 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
36 ---------------------------------------------------------------------------
37 --| ^ ^ |--
38 --| pin 86 pin 67 |--
39 --| |--
40 --| pin 61 > |-- G18
41 --| |-- G19
42 --| |-- G20
43 --| |-- G21
44 --| |-- G22
45 --| pin 56 > |-- G23
46 --| |--
47 --| Brooktree 878/879 |--
48 --| |--
49 --| |--
50 --| |--
51 --| |--
52 --| |--
53 --| |--
54 --| |--
55 --| |--
56 --| |--
57 --| |--
58 --| |--
59 --| |--
60 --| |--
61 --| O |--
62 --| |--
63 ---------------------------------------------------------------------------
64 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
65 ^
66 This is pin 1
67
diff --git a/Documentation/cciss.txt b/Documentation/cciss.txt
index 63e59b8847c5..8244c6442faa 100644
--- a/Documentation/cciss.txt
+++ b/Documentation/cciss.txt
@@ -112,27 +112,18 @@ Hot plug support for SCSI tape drives
112 112
113Hot plugging of SCSI tape drives is supported, with some caveats. 113Hot plugging of SCSI tape drives is supported, with some caveats.
114The cciss driver must be informed that changes to the SCSI bus 114The cciss driver must be informed that changes to the SCSI bus
115have been made, in addition to and prior to informing the SCSI 115have been made. This may be done via the /proc filesystem.
116mid layer. This may be done via the /proc filesystem. For example: 116For example:
117 117
118 echo "rescan" > /proc/scsi/cciss0/1 118 echo "rescan" > /proc/scsi/cciss0/1
119 119
120This causes the adapter to query the adapter about changes to the 120This causes the driver to query the adapter about changes to the
121physical SCSI buses and/or fibre channel arbitrated loop and the 121physical SCSI buses and/or fibre channel arbitrated loop and the
122driver to make note of any new or removed sequential access devices 122driver to make note of any new or removed sequential access devices
123or medium changers. The driver will output messages indicating what 123or medium changers. The driver will output messages indicating what
124devices have been added or removed and the controller, bus, target and 124devices have been added or removed and the controller, bus, target and
125lun used to address the device. Once this is done, the SCSI mid layer 125lun used to address the device. It then notifies the SCSI mid layer
126can be informed of changes to the virtual SCSI bus which the driver 126of these changes.
127presents to it in the usual way. For example:
128
129 echo scsi add-single-device 3 2 1 0 > /proc/scsi/scsi
130
131to add a device on controller 3, bus 2, target 1, lun 0. Note that
132the driver makes an effort to preserve the devices positions
133in the virtual SCSI bus, so if you are only moving tape drives
134around on the same adapter and not adding or removing tape drives
135from the adapter, informing the SCSI mid layer may not be necessary.
136 127
137Note that the naming convention of the /proc filesystem entries 128Note that the naming convention of the /proc filesystem entries
138contains a number in addition to the driver name. (E.g. "cciss0" 129contains a number in addition to the driver name. (E.g. "cciss0"
diff --git a/Documentation/cdrom/ide-cd b/Documentation/cdrom/ide-cd
index 91c0dcc6fa5c..2c558cd6c1ef 100644
--- a/Documentation/cdrom/ide-cd
+++ b/Documentation/cdrom/ide-cd
@@ -145,8 +145,7 @@ useful for reading photocds.
145 145
146To play an audio CD, you should first unmount and remove any data 146To play an audio CD, you should first unmount and remove any data
147CDROM. Any of the CDROM player programs should then work (workman, 147CDROM. Any of the CDROM player programs should then work (workman,
148workbone, cdplayer, etc.). Lacking anything else, you could use the 148workbone, cdplayer, etc.).
149cdtester program in Documentation/cdrom/sbpcd.
150 149
151On a few drives, you can read digital audio directly using a program 150On a few drives, you can read digital audio directly using a program
152such as cdda2wav. The only types of drive which I've heard support 151such as cdda2wav. The only types of drive which I've heard support
diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 824fc0274471..d9014aa0eb68 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -390,6 +390,10 @@ If you have several tasks to attach, you have to do it one after another:
390 ... 390 ...
391# /bin/echo PIDn > tasks 391# /bin/echo PIDn > tasks
392 392
393You can attach the current shell task by echoing 0:
394
395# echo 0 > tasks
396
3933. Kernel API 3973. Kernel API
394============= 398=============
395 399
diff --git a/Documentation/cli-sti-removal.txt b/Documentation/cli-sti-removal.txt
deleted file mode 100644
index 60932b02fcb3..000000000000
--- a/Documentation/cli-sti-removal.txt
+++ /dev/null
@@ -1,133 +0,0 @@
1
2#### cli()/sti() removal guide, started by Ingo Molnar <mingo@redhat.com>
3
4
5as of 2.5.28, five popular macros have been removed on SMP, and
6are being phased out on UP:
7
8 cli(), sti(), save_flags(flags), save_flags_cli(flags), restore_flags(flags)
9
10until now it was possible to protect driver code against interrupt
11handlers via a cli(), but from now on other, more lightweight methods
12have to be used for synchronization, such as spinlocks or semaphores.
13
14for example, driver code that used to do something like:
15
16 struct driver_data;
17
18 irq_handler (...)
19 {
20 ....
21 driver_data.finish = 1;
22 driver_data.new_work = 0;
23 ....
24 }
25
26 ...
27
28 ioctl_func (...)
29 {
30 ...
31 cli();
32 ...
33 driver_data.finish = 0;
34 driver_data.new_work = 2;
35 ...
36 sti();
37 ...
38 }
39
40was SMP-correct because the cli() function ensured that no
41interrupt handler (amongst them the above irq_handler()) function
42would execute while the cli()-ed section is executing.
43
44but from now on a more direct method of locking has to be used:
45
46 DEFINE_SPINLOCK(driver_lock);
47 struct driver_data;
48
49 irq_handler (...)
50 {
51 unsigned long flags;
52 ....
53 spin_lock_irqsave(&driver_lock, flags);
54 ....
55 driver_data.finish = 1;
56 driver_data.new_work = 0;
57 ....
58 spin_unlock_irqrestore(&driver_lock, flags);
59 ....
60 }
61
62 ...
63
64 ioctl_func (...)
65 {
66 ...
67 spin_lock_irq(&driver_lock);
68 ...
69 driver_data.finish = 0;
70 driver_data.new_work = 2;
71 ...
72 spin_unlock_irq(&driver_lock);
73 ...
74 }
75
76the above code has a number of advantages:
77
78- the locking relation is easier to understand - actual lock usage
79 pinpoints the critical sections. cli() usage is too opaque.
80 Easier to understand means it's easier to debug.
81
82- it's faster, because spinlocks are faster to acquire than the
83 potentially heavily-used IRQ lock. Furthermore, your driver does
84 not have to wait eg. for a big heavy SCSI interrupt to finish,
85 because the driver_lock spinlock is only used by your driver.
86 cli() on the other hand was used by many drivers, and extended
87 the critical section to the whole IRQ handler function - creating
88 serious lock contention.
89
90
91to make the transition easier, we've still kept the cli(), sti(),
92save_flags(), save_flags_cli() and restore_flags() macros defined
93on UP systems - but their usage will be phased out until 2.6 is
94released.
95
96drivers that want to disable local interrupts (interrupts on the
97current CPU), can use the following five macros:
98
99 local_irq_disable(), local_irq_enable(), local_save_flags(flags),
100 local_irq_save(flags), local_irq_restore(flags)
101
102but beware, their meaning and semantics are much simpler, far from
103that of the old cli(), sti(), save_flags(flags) and restore_flags(flags)
104SMP meaning:
105
106 local_irq_disable() => turn local IRQs off
107
108 local_irq_enable() => turn local IRQs on
109
110 local_save_flags(flags) => save the current IRQ state into flags. The
111 state can be on or off. (on some
112 architectures there's even more bits in it.)
113
114 local_irq_save(flags) => save the current IRQ state into flags and
115 disable interrupts.
116
117 local_irq_restore(flags) => restore the IRQ state from flags.
118
119(local_irq_save can save both irqs on and irqs off state, and
120local_irq_restore can restore into both irqs on and irqs off state.)
121
122another related change is that synchronize_irq() now takes a parameter:
123synchronize_irq(irq). This change too has the purpose of making SMP
124synchronization more lightweight - this way you can wait for your own
125interrupt handler to finish, no need to wait for other IRQ sources.
126
127
128why were these changes done? The main reason was the architectural burden
129of maintaining the cli()/sti() interface - it became a real problem. The
130new interrupt system is much more streamlined, easier to understand, debug,
131and it's also a bit faster - the same happened to it that will happen to
132cli()/sti() using drivers once they convert to spinlocks :-)
133
diff --git a/Documentation/connector/Makefile b/Documentation/connector/Makefile
new file mode 100644
index 000000000000..8df1a7285a06
--- /dev/null
+++ b/Documentation/connector/Makefile
@@ -0,0 +1,11 @@
1ifneq ($(CONFIG_CONNECTOR),)
2obj-m += cn_test.o
3endif
4
5# List of programs to build
6hostprogs-y := ucon
7
8# Tell kbuild to always build the programs
9always := $(hostprogs-y)
10
11HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
diff --git a/Documentation/controllers/devices.txt b/Documentation/controllers/devices.txt
index 4dcea42432c2..7cc6e6a60672 100644
--- a/Documentation/controllers/devices.txt
+++ b/Documentation/controllers/devices.txt
@@ -13,7 +13,7 @@ either an integer or * for all. Access is a composition of r
13The root device cgroup starts with rwm to 'all'. A child device 13The root device cgroup starts with rwm to 'all'. A child device
14cgroup gets a copy of the parent. Administrators can then remove 14cgroup gets a copy of the parent. Administrators can then remove
15devices from the whitelist or add new entries. A child cgroup can 15devices from the whitelist or add new entries. A child cgroup can
16never receive a device access which is denied its parent. However 16never receive a device access which is denied by its parent. However
17when a device access is removed from a parent it will not also be 17when a device access is removed from a parent it will not also be
18removed from the child(ren). 18removed from the child(ren).
19 19
@@ -29,7 +29,11 @@ allows cgroup 1 to read and mknod the device usually known as
29 29
30 echo a > /cgroups/1/devices.deny 30 echo a > /cgroups/1/devices.deny
31 31
32will remove the default 'a *:* mrw' entry. 32will remove the default 'a *:* rwm' entry. Doing
33
34 echo a > /cgroups/1/devices.allow
35
36will add the 'a *:* rwm' entry to the whitelist.
33 37
343. Security 383. Security
35 39
diff --git a/Documentation/controllers/memory.txt b/Documentation/controllers/memory.txt
index 866b9cd9a959..9b53d5827361 100644
--- a/Documentation/controllers/memory.txt
+++ b/Documentation/controllers/memory.txt
@@ -242,8 +242,7 @@ rmdir() if there are no tasks.
2421. Add support for accounting huge pages (as a separate controller) 2421. Add support for accounting huge pages (as a separate controller)
2432. Make per-cgroup scanner reclaim not-shared pages first 2432. Make per-cgroup scanner reclaim not-shared pages first
2443. Teach controller to account for shared-pages 2443. Teach controller to account for shared-pages
2454. Start reclamation when the limit is lowered 2454. Start reclamation in the background when the limit is
2465. Start reclamation in the background when the limit is
247 not yet hit but the usage is getting closer 246 not yet hit but the usage is getting closer
248 247
249Summary 248Summary
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
index dcec0564d040..5b0cfa67aff9 100644
--- a/Documentation/cpu-freq/governors.txt
+++ b/Documentation/cpu-freq/governors.txt
@@ -122,7 +122,7 @@ around '10000' or more.
122show_sampling_rate_(min|max): the minimum and maximum sampling rates 122show_sampling_rate_(min|max): the minimum and maximum sampling rates
123available that you may set 'sampling_rate' to. 123available that you may set 'sampling_rate' to.
124 124
125up_threshold: defines what the average CPU usaged between the samplings 125up_threshold: defines what the average CPU usage between the samplings
126of 'sampling_rate' needs to be for the kernel to make a decision on 126of 'sampling_rate' needs to be for the kernel to make a decision on
127whether it should increase the frequency. For example when it is set 127whether it should increase the frequency. For example when it is set
128to its default value of '80' it means that between the checking 128to its default value of '80' it means that between the checking
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt
index ffdb5323df37..3d0b915035b9 100644
--- a/Documentation/cpu-freq/index.txt
+++ b/Documentation/cpu-freq/index.txt
@@ -35,11 +35,9 @@ Mailing List
35------------ 35------------
36There is a CPU frequency changing CVS commit and general list where 36There is a CPU frequency changing CVS commit and general list where
37you can report bugs, problems or submit patches. To post a message, 37you can report bugs, problems or submit patches. To post a message,
38send an email to cpufreq@lists.linux.org.uk, to subscribe go to 38send an email to cpufreq@vger.kernel.org, to subscribe go to
39http://lists.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the 39http://vger.kernel.org/vger-lists.html#cpufreq and follow the
40mailing list are available to subscribers at 40instructions there.
41http://lists.linux.org.uk/mailman/private/cpufreq/.
42
43 41
44Links 42Links
45----- 43-----
@@ -50,7 +48,7 @@ how to access the CVS repository:
50* http://cvs.arm.linux.org.uk/ 48* http://cvs.arm.linux.org.uk/
51 49
52the CPUFreq Mailing list: 50the CPUFreq Mailing list:
53* http://lists.linux.org.uk/mailman/listinfo/cpufreq 51* http://vger.kernel.org/vger-lists.html#cpufreq
54 52
55Clock and voltage scaling for the SA-1100: 53Clock and voltage scaling for the SA-1100:
56* http://www.lartmaker.nl/projects/scaling 54* http://www.lartmaker.nl/projects/scaling
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index ba0aacde94fb..94bbc27ddd4f 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -59,15 +59,10 @@ apicid values in those tables for disabled apics. In the event BIOS doesn't
59mark such hot-pluggable cpus as disabled entries, one could use this 59mark such hot-pluggable cpus as disabled entries, one could use this
60parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map. 60parameter "additional_cpus=x" to represent those cpus in the cpu_possible_map.
61 61
62s390 uses the number of cpus it detects at IPL time to also the number of bits
63in cpu_possible_map. If it is desired to add additional cpus at a later time
64the number should be specified using this option or the possible_cpus option.
65
66possible_cpus=n [s390 only] use this to set hotpluggable cpus. 62possible_cpus=n [s390 only] use this to set hotpluggable cpus.
67 This option sets possible_cpus bits in 63 This option sets possible_cpus bits in
68 cpu_possible_map. Thus keeping the numbers of bits set 64 cpu_possible_map. Thus keeping the numbers of bits set
69 constant even if the machine gets rebooted. 65 constant even if the machine gets rebooted.
70 This option overrides additional_cpus.
71 66
72CPU maps and such 67CPU maps and such
73----------------- 68-----------------
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt
index d803c5c68ab5..47e568a9370a 100644
--- a/Documentation/cpusets.txt
+++ b/Documentation/cpusets.txt
@@ -154,13 +154,15 @@ browsing and modifying the cpusets presently known to the kernel. No
154new system calls are added for cpusets - all support for querying and 154new system calls are added for cpusets - all support for querying and
155modifying cpusets is via this cpuset file system. 155modifying cpusets is via this cpuset file system.
156 156
157The /proc/<pid>/status file for each task has two added lines, 157The /proc/<pid>/status file for each task has four added lines,
158displaying the tasks cpus_allowed (on which CPUs it may be scheduled) 158displaying the tasks cpus_allowed (on which CPUs it may be scheduled)
159and mems_allowed (on which Memory Nodes it may obtain memory), 159and mems_allowed (on which Memory Nodes it may obtain memory),
160in the format seen in the following example: 160in the two formats seen in the following example:
161 161
162 Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff 162 Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff
163 Cpus_allowed_list: 0-127
163 Mems_allowed: ffffffff,ffffffff 164 Mems_allowed: ffffffff,ffffffff
165 Mems_allowed_list: 0-63
164 166
165Each cpuset is represented by a directory in the cgroup file system 167Each cpuset is represented by a directory in the cgroup file system
166containing (on top of the standard cgroup files) the following 168containing (on top of the standard cgroup files) the following
@@ -542,7 +544,10 @@ otherwise initial value -1 that indicates the cpuset has no request.
542 2 : search cores in a package. 544 2 : search cores in a package.
543 3 : search cpus in a node [= system wide on non-NUMA system] 545 3 : search cpus in a node [= system wide on non-NUMA system]
544 ( 4 : search nodes in a chunk of node [on NUMA system] ) 546 ( 4 : search nodes in a chunk of node [on NUMA system] )
545 ( 5~ : search system wide [on NUMA system]) 547 ( 5 : search system wide [on NUMA system] )
548
549The system default is architecture dependent. The system default
550can be changed using the relax_domain_level= boot parameter.
546 551
547This file is per-cpuset and affect the sched domain where the cpuset 552This file is per-cpuset and affect the sched domain where the cpuset
548belongs to. Therefore if the flag 'sched_load_balance' of a cpuset 553belongs to. Therefore if the flag 'sched_load_balance' of a cpuset
@@ -630,14 +635,16 @@ prior 'mems' setting, will not be moved.
630 635
631There is an exception to the above. If hotplug functionality is used 636There is an exception to the above. If hotplug functionality is used
632to remove all the CPUs that are currently assigned to a cpuset, 637to remove all the CPUs that are currently assigned to a cpuset,
633then the kernel will automatically update the cpus_allowed of all 638then all the tasks in that cpuset will be moved to the nearest ancestor
634tasks attached to CPUs in that cpuset to allow all CPUs. When memory 639with non-empty cpus. But the moving of some (or all) tasks might fail if
635hotplug functionality for removing Memory Nodes is available, a 640cpuset is bound with another cgroup subsystem which has some restrictions
636similar exception is expected to apply there as well. In general, 641on task attaching. In this failing case, those tasks will stay
637the kernel prefers to violate cpuset placement, over starving a task 642in the original cpuset, and the kernel will automatically update
638that has had all its allowed CPUs or Memory Nodes taken offline. User 643their cpus_allowed to allow all online CPUs. When memory hotplug
639code should reconfigure cpusets to only refer to online CPUs and Memory 644functionality for removing Memory Nodes is available, a similar exception
640Nodes when using hotplug to add or remove such resources. 645is expected to apply there as well. In general, the kernel prefers to
646violate cpuset placement, over starving a task that has had all
647its allowed CPUs or Memory Nodes taken offline.
641 648
642There is a second exception to the above. GFP_ATOMIC requests are 649There is a second exception to the above. GFP_ATOMIC requests are
643kernel internal allocations that must be satisfied, immediately. 650kernel internal allocations that must be satisfied, immediately.
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt
index b61cb9564023..bd699da24666 100644
--- a/Documentation/cputopology.txt
+++ b/Documentation/cputopology.txt
@@ -14,9 +14,8 @@ represent the thread siblings to cpu X in the same physical package;
14To implement it in an architecture-neutral way, a new source file, 14To implement it in an architecture-neutral way, a new source file,
15drivers/base/topology.c, is to export the 4 attributes. 15drivers/base/topology.c, is to export the 4 attributes.
16 16
17If one architecture wants to support this feature, it just needs to 17For an architecture to support this feature, it must define some of
18implement 4 defines, typically in file include/asm-XXX/topology.h. 18these macros in include/asm-XXX/topology.h:
19The 4 defines are:
20#define topology_physical_package_id(cpu) 19#define topology_physical_package_id(cpu)
21#define topology_core_id(cpu) 20#define topology_core_id(cpu)
22#define topology_thread_siblings(cpu) 21#define topology_thread_siblings(cpu)
@@ -25,17 +24,10 @@ The 4 defines are:
25The type of **_id is int. 24The type of **_id is int.
26The type of siblings is cpumask_t. 25The type of siblings is cpumask_t.
27 26
28To be consistent on all architectures, the 4 attributes should have 27To be consistent on all architectures, include/linux/topology.h
29default values if their values are unavailable. Below is the rule. 28provides default definitions for any of the above macros that are
301) physical_package_id: If cpu has no physical package id, -1 is the 29not defined by include/asm-XXX/topology.h:
31default value. 301) physical_package_id: -1
322) core_id: If cpu doesn't support multi-core, its core id is 0. 312) core_id: 0
333) thread_siblings: Just include itself, if the cpu doesn't support 323) thread_siblings: just the given CPU
34HT/multi-thread. 334) core_siblings: just the given CPU
354) core_siblings: Just include itself, if the cpu doesn't support
36multi-core and HT/Multi-thread.
37
38So be careful when declaring the 4 defines in include/asm-XXX/topology.h.
39
40If an attribute isn't defined on an architecture, it won't be exported.
41
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index e6244cde26e9..05c80645e4ee 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -2560,9 +2560,6 @@ Your cooperation is appreciated.
2560 96 = /dev/usb/hiddev0 1st USB HID device 2560 96 = /dev/usb/hiddev0 1st USB HID device
2561 ... 2561 ...
2562 111 = /dev/usb/hiddev15 16th USB HID device 2562 111 = /dev/usb/hiddev15 16th USB HID device
2563 112 = /dev/usb/auer0 1st auerswald ISDN device
2564 ...
2565 127 = /dev/usb/auer15 16th auerswald ISDN device
2566 128 = /dev/usb/brlvgr0 First Braille Voyager device 2563 128 = /dev/usb/brlvgr0 First Braille Voyager device
2567 ... 2564 ...
2568 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device 2565 131 = /dev/usb/brlvgr3 Fourth Braille Voyager device
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 881e6dd03aea..27809357da58 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -5,6 +5,8 @@
5*.css 5*.css
6*.dvi 6*.dvi
7*.eps 7*.eps
8*.fw.gen.S
9*.fw
8*.gif 10*.gif
9*.grep 11*.grep
10*.grp 12*.grp
diff --git a/Documentation/edac.txt b/Documentation/edac.txt
index a5c36842ecef..8eda3fb66416 100644
--- a/Documentation/edac.txt
+++ b/Documentation/edac.txt
@@ -222,74 +222,9 @@ both csrow2 and csrow3 are populated, this indicates a dual ranked
222set of DIMMs for channels 0 and 1. 222set of DIMMs for channels 0 and 1.
223 223
224 224
225Within each of the 'mc','mcX' and 'csrowX' directories are several 225Within each of the 'mcX' and 'csrowX' directories are several
226EDAC control and attribute files. 226EDAC control and attribute files.
227 227
228
229============================================================================
230DIRECTORY 'mc'
231
232In directory 'mc' are EDAC system overall control and attribute files:
233
234
235Panic on UE control file:
236
237 'edac_mc_panic_on_ue'
238
239 An uncorrectable error will cause a machine panic. This is usually
240 desirable. It is a bad idea to continue when an uncorrectable error
241 occurs - it is indeterminate what was uncorrected and the operating
242 system context might be so mangled that continuing will lead to further
243 corruption. If the kernel has MCE configured, then EDAC will never
244 notice the UE.
245
246 LOAD TIME: module/kernel parameter: panic_on_ue=[0|1]
247
248 RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_panic_on_ue
249
250
251Log UE control file:
252
253 'edac_mc_log_ue'
254
255 Generate kernel messages describing uncorrectable errors. These errors
256 are reported through the system message log system. UE statistics
257 will be accumulated even when UE logging is disabled.
258
259 LOAD TIME: module/kernel parameter: log_ue=[0|1]
260
261 RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ue
262
263
264Log CE control file:
265
266 'edac_mc_log_ce'
267
268 Generate kernel messages describing correctable errors. These
269 errors are reported through the system message log system.
270 CE statistics will be accumulated even when CE logging is disabled.
271
272 LOAD TIME: module/kernel parameter: log_ce=[0|1]
273
274 RUN TIME: echo "1" >/sys/devices/system/edac/mc/edac_mc_log_ce
275
276
277Polling period control file:
278
279 'edac_mc_poll_msec'
280
281 The time period, in milliseconds, for polling for error information.
282 Too small a value wastes resources. Too large a value might delay
283 necessary handling of errors and might loose valuable information for
284 locating the error. 1000 milliseconds (once each second) is the current
285 default. Systems which require all the bandwidth they can get, may
286 increase this.
287
288 LOAD TIME: module/kernel parameter: poll_msec=[0|1]
289
290 RUN TIME: echo "1000" >/sys/devices/system/edac/mc/edac_mc_poll_msec
291
292
293============================================================================ 228============================================================================
294'mcX' DIRECTORIES 229'mcX' DIRECTORIES
295 230
@@ -392,7 +327,7 @@ Sdram memory scrubbing rate:
392 'sdram_scrub_rate' 327 'sdram_scrub_rate'
393 328
394 Read/Write attribute file that controls memory scrubbing. The scrubbing 329 Read/Write attribute file that controls memory scrubbing. The scrubbing
395 rate is set by writing a minimum bandwith in bytes/sec to the attribute 330 rate is set by writing a minimum bandwidth in bytes/sec to the attribute
396 file. The rate will be translated to an internal value that gives at 331 file. The rate will be translated to an internal value that gives at
397 least the specified rate. 332 least the specified rate.
398 333
@@ -537,7 +472,6 @@ Channel 1 DIMM Label control file:
537 motherboard specific and determination of this information 472 motherboard specific and determination of this information
538 must occur in userland at this time. 473 must occur in userland at this time.
539 474
540
541============================================================================ 475============================================================================
542SYSTEM LOGGING 476SYSTEM LOGGING
543 477
@@ -570,7 +504,6 @@ error type, a notice of "no info" and then an optional,
570driver-specific error message. 504driver-specific error message.
571 505
572 506
573
574============================================================================ 507============================================================================
575PCI Bus Parity Detection 508PCI Bus Parity Detection
576 509
@@ -604,6 +537,74 @@ Enable/Disable PCI Parity checking control file:
604 echo "0" >/sys/devices/system/edac/pci/check_pci_parity 537 echo "0" >/sys/devices/system/edac/pci/check_pci_parity
605 538
606 539
540Parity Count:
541
542 'pci_parity_count'
543
544 This attribute file will display the number of parity errors that
545 have been detected.
546
547
548============================================================================
549MODULE PARAMETERS
550
551Panic on UE control file:
552
553 'edac_mc_panic_on_ue'
554
555 An uncorrectable error will cause a machine panic. This is usually
556 desirable. It is a bad idea to continue when an uncorrectable error
557 occurs - it is indeterminate what was uncorrected and the operating
558 system context might be so mangled that continuing will lead to further
559 corruption. If the kernel has MCE configured, then EDAC will never
560 notice the UE.
561
562 LOAD TIME: module/kernel parameter: edac_mc_panic_on_ue=[0|1]
563
564 RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_panic_on_ue
565
566
567Log UE control file:
568
569 'edac_mc_log_ue'
570
571 Generate kernel messages describing uncorrectable errors. These errors
572 are reported through the system message log system. UE statistics
573 will be accumulated even when UE logging is disabled.
574
575 LOAD TIME: module/kernel parameter: edac_mc_log_ue=[0|1]
576
577 RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ue
578
579
580Log CE control file:
581
582 'edac_mc_log_ce'
583
584 Generate kernel messages describing correctable errors. These
585 errors are reported through the system message log system.
586 CE statistics will be accumulated even when CE logging is disabled.
587
588 LOAD TIME: module/kernel parameter: edac_mc_log_ce=[0|1]
589
590 RUN TIME: echo "1" > /sys/module/edac_core/parameters/edac_mc_log_ce
591
592
593Polling period control file:
594
595 'edac_mc_poll_msec'
596
597 The time period, in milliseconds, for polling for error information.
598 Too small a value wastes resources. Too large a value might delay
599 necessary handling of errors and might loose valuable information for
600 locating the error. 1000 milliseconds (once each second) is the current
601 default. Systems which require all the bandwidth they can get, may
602 increase this.
603
604 LOAD TIME: module/kernel parameter: edac_mc_poll_msec=[0|1]
605
606 RUN TIME: echo "1000" > /sys/module/edac_core/parameters/edac_mc_poll_msec
607
607 608
608Panic on PCI PARITY Error: 609Panic on PCI PARITY Error:
609 610
@@ -614,21 +615,13 @@ Panic on PCI PARITY Error:
614 error has been detected. 615 error has been detected.
615 616
616 617
617 module/kernel parameter: panic_on_pci_parity=[0|1] 618 module/kernel parameter: edac_panic_on_pci_pe=[0|1]
618 619
619 Enable: 620 Enable:
620 echo "1" >/sys/devices/system/edac/pci/panic_on_pci_parity 621 echo "1" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe
621 622
622 Disable: 623 Disable:
623 echo "0" >/sys/devices/system/edac/pci/panic_on_pci_parity 624 echo "0" > /sys/module/edac_core/parameters/edac_panic_on_pci_pe
624
625
626Parity Count:
627
628 'pci_parity_count'
629
630 This attribute file will display the number of parity errors that
631 have been detected.
632 625
633 626
634 627
diff --git a/Documentation/fb/sh7760fb.txt b/Documentation/fb/sh7760fb.txt
new file mode 100644
index 000000000000..c87bfe5c630a
--- /dev/null
+++ b/Documentation/fb/sh7760fb.txt
@@ -0,0 +1,131 @@
1SH7760/SH7763 integrated LCDC Framebuffer driver
2================================================
3
40. Overwiew
5-----------
6The SH7760/SH7763 have an integrated LCD Display controller (LCDC) which
7supports (in theory) resolutions ranging from 1x1 to 1024x1024,
8with color depths ranging from 1 to 16 bits, on STN, DSTN and TFT Panels.
9
10Caveats:
11* Framebuffer memory must be a large chunk allocated at the top
12 of Area3 (HW requirement). Because of this requirement you should NOT
13 make the driver a module since at runtime it may become impossible to
14 get a large enough contiguous chunk of memory.
15
16* The driver does not support changing resolution while loaded
17 (displays aren't hotpluggable anyway)
18
19* Heavy flickering may be observed
20 a) if you're using 15/16bit color modes at >= 640x480 px resolutions,
21 b) during PCMCIA (or any other slow bus) activity.
22
23* Rotation works only 90degress clockwise, and only if horizontal
24 resolution is <= 320 pixels.
25
26files: drivers/video/sh7760fb.c
27 include/asm-sh/sh7760fb.h
28 Documentation/fb/sh7760fb.txt
29
301. Platform setup
31-----------------
32SH7760:
33 Video data is fetched via the DMABRG DMA engine, so you have to
34 configure the SH DMAC for DMABRG mode (write 0x94808080 to the
35 DMARSRA register somewhere at boot).
36
37 PFC registers PCCR and PCDR must be set to peripheral mode.
38 (write zeros to both).
39
40The driver does NOT do the above for you since board setup is, well, job
41of the board setup code.
42
432. Panel definitions
44--------------------
45The LCDC must explicitly be told about the type of LCD panel
46attached. Data must be wrapped in a "struct sh7760fb_platdata" and
47passed to the driver as platform_data.
48
49Suggest you take a closer look at the SH7760 Manual, Section 30.
50(http://documentation.renesas.com/eng/products/mpumcu/e602291_sh7760.pdf)
51
52The following code illustrates what needs to be done to
53get the framebuffer working on a 640x480 TFT:
54
55====================== cut here ======================================
56
57#include <linux/fb.h>
58#include <asm/sh7760fb.h>
59
60/*
61 * NEC NL6440bc26-01 640x480 TFT
62 * dotclock 25175 kHz
63 * Xres 640 Yres 480
64 * Htotal 800 Vtotal 525
65 * HsynStart 656 VsynStart 490
66 * HsynLenn 30 VsynLenn 2
67 *
68 * The linux framebuffer layer does not use the syncstart/synclen
69 * values but right/left/upper/lower margin values. The comments
70 * for the x_margin explain how to calculate those from given
71 * panel sync timings.
72 */
73static struct fb_videomode nl6448bc26 = {
74 .name = "NL6448BC26",
75 .refresh = 60,
76 .xres = 640,
77 .yres = 480,
78 .pixclock = 39683, /* in picoseconds! */
79 .hsync_len = 30,
80 .vsync_len = 2,
81 .left_margin = 114, /* HTOT - (HSYNSLEN + HSYNSTART) */
82 .right_margin = 16, /* HSYNSTART - XRES */
83 .upper_margin = 33, /* VTOT - (VSYNLEN + VSYNSTART) */
84 .lower_margin = 10, /* VSYNSTART - YRES */
85 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
86 .vmode = FB_VMODE_NONINTERLACED,
87 .flag = 0,
88};
89
90static struct sh7760fb_platdata sh7760fb_nl6448 = {
91 .def_mode = &nl6448bc26,
92 .ldmtr = LDMTR_TFT_COLOR_16, /* 16bit TFT panel */
93 .lddfr = LDDFR_8BPP, /* we want 8bit output */
94 .ldpmmr = 0x0070,
95 .ldpspr = 0x0500,
96 .ldaclnr = 0,
97 .ldickr = LDICKR_CLKSRC(LCDC_CLKSRC_EXTERNAL) |
98 LDICKR_CLKDIV(1),
99 .rotate = 0,
100 .novsync = 1,
101 .blank = NULL,
102};
103
104/* SH7760:
105 * 0xFE300800: 256 * 4byte xRGB palette ram
106 * 0xFE300C00: 42 bytes ctrl registers
107 */
108static struct resource sh7760_lcdc_res[] = {
109 [0] = {
110 .start = 0xFE300800,
111 .end = 0xFE300CFF,
112 .flags = IORESOURCE_MEM,
113 },
114 [1] = {
115 .start = 65,
116 .end = 65,
117 .flags = IORESOURCE_IRQ,
118 },
119};
120
121static struct platform_device sh7760_lcdc_dev = {
122 .dev = {
123 .platform_data = &sh7760fb_nl6448,
124 },
125 .name = "sh7760-lcdc",
126 .id = -1,
127 .resource = sh7760_lcdc_res,
128 .num_resources = ARRAY_SIZE(sh7760_lcdc_res),
129};
130
131====================== cut here ======================================
diff --git a/Documentation/fb/tridentfb.txt b/Documentation/fb/tridentfb.txt
index 8a6c8a43e6a3..45d9de5b13a3 100644
--- a/Documentation/fb/tridentfb.txt
+++ b/Documentation/fb/tridentfb.txt
@@ -3,11 +3,25 @@ Tridentfb is a framebuffer driver for some Trident chip based cards.
3The following list of chips is thought to be supported although not all are 3The following list of chips is thought to be supported although not all are
4tested: 4tested:
5 5
6those from the Image series with Cyber in their names - accelerated 6those from the TGUI series 9440/96XX and with Cyber in their names
7those with Blade in their names (Blade3D,CyberBlade...) - accelerated 7those from the Image series and with Cyber in their names
8the newer CyberBladeXP family - nonaccelerated 8those with Blade in their names (Blade3D,CyberBlade...)
9 9the newer CyberBladeXP family
10Only PCI/AGP based cards are supported, none of the older Tridents. 10
11All families are accelerated. Only PCI/AGP based cards are supported,
12none of the older Tridents.
13The driver supports 8, 16 and 32 bits per pixel depths.
14The TGUI family requires a line length to be power of 2 if acceleration
15is enabled. This means that range of possible resolutions and bpp is
16limited comparing to the range if acceleration is disabled (see list
17of parameters below).
18
19Known bugs:
201. The driver randomly locks up on 3DImage975 chip with acceleration
21 enabled. The same happens in X11 (Xorg).
222. The ramdac speeds require some more fine tuning. It is possible to
23 switch resolution which the chip does not support at some depths for
24 older chips.
11 25
12How to use it? 26How to use it?
13============== 27==============
@@ -17,12 +31,11 @@ video=tridentfb
17 31
18The parameters for tridentfb are concatenated with a ':' as in this example. 32The parameters for tridentfb are concatenated with a ':' as in this example.
19 33
20video=tridentfb:800x600,bpp=16,noaccel 34video=tridentfb:800x600-16@75,noaccel
21 35
22The second level parameters that tridentfb understands are: 36The second level parameters that tridentfb understands are:
23 37
24noaccel - turns off acceleration (when it doesn't work for your card) 38noaccel - turns off acceleration (when it doesn't work for your card)
25accel - force text acceleration (for boards which by default are noacceled)
26 39
27fp - use flat panel related stuff 40fp - use flat panel related stuff
28crt - assume monitor is present instead of fp 41crt - assume monitor is present instead of fp
@@ -31,21 +44,24 @@ center - for flat panels and resolutions smaller than native size center the
31 image, otherwise use 44 image, otherwise use
32stretch 45stretch
33 46
34memsize - integer value in Kb, use if your card's memory size is misdetected. 47memsize - integer value in KB, use if your card's memory size is misdetected.
35 look at the driver output to see what it says when initializing. 48 look at the driver output to see what it says when initializing.
36memdiff - integer value in Kb,should be nonzero if your card reports 49
37 more memory than it actually has.For instance mine is 192K less than 50memdiff - integer value in KB, should be nonzero if your card reports
51 more memory than it actually has. For instance mine is 192K less than
38 detection says in all three BIOS selectable situations 2M, 4M, 8M. 52 detection says in all three BIOS selectable situations 2M, 4M, 8M.
39 Only use if your video memory is taken from main memory hence of 53 Only use if your video memory is taken from main memory hence of
40 configurable size.Otherwise use memsize. 54 configurable size. Otherwise use memsize.
41 If in some modes which barely fit the memory you see garbage at the bottom 55 If in some modes which barely fit the memory you see garbage
42 this might help by not letting change to that mode anymore. 56 at the bottom this might help by not letting change to that mode
57 anymore.
43 58
44nativex - the width in pixels of the flat panel.If you know it (usually 1024 59nativex - the width in pixels of the flat panel.If you know it (usually 1024
45 800 or 1280) and it is not what the driver seems to detect use it. 60 800 or 1280) and it is not what the driver seems to detect use it.
46 61
47bpp - bits per pixel (8,16 or 32) 62bpp - bits per pixel (8,16 or 32)
48mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt) 63mode - a mode name like 800x600-8@75 as described in
64 Documentation/fb/modedb.txt
49 65
50Using insane values for the above parameters will probably result in driver 66Using insane values for the above parameters will probably result in driver
51misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or 67misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 5b3f31faed56..3d2d0c29f027 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -6,6 +6,24 @@ be removed from this file.
6 6
7--------------------------- 7---------------------------
8 8
9What: old static regulatory information and ieee80211_regdom module parameter
10When: 2.6.29
11Why: The old regulatory infrastructure has been replaced with a new one
12 which does not require statically defined regulatory domains. We do
13 not want to keep static regulatory domains in the kernel due to the
14 the dynamic nature of regulatory law and localization. We kept around
15 the old static definitions for the regulatory domains of:
16 * US
17 * JP
18 * EU
19 and used by default the US when CONFIG_WIRELESS_OLD_REGULATORY was
20 set. We also kept around the ieee80211_regdom module parameter in case
21 some applications were relying on it. Changing regulatory domains
22 can now be done instead by using nl80211, as is done with iw.
23Who: Luis R. Rodriguez <lrodriguez@atheros.com>
24
25---------------------------
26
9What: dev->power.power_state 27What: dev->power.power_state
10When: July 2007 28When: July 2007
11Why: Broken design for runtime control over driver power states, confusing 29Why: Broken design for runtime control over driver power states, confusing
@@ -19,15 +37,6 @@ Who: Pavel Machek <pavel@suse.cz>
19 37
20--------------------------- 38---------------------------
21 39
22What: old NCR53C9x driver
23When: October 2007
24Why: Replaced by the much better esp_scsi driver. Actual low-level
25 driver can be ported over almost trivially.
26Who: David Miller <davem@davemloft.net>
27 Christoph Hellwig <hch@lst.de>
28
29---------------------------
30
31What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. 40What: Video4Linux API 1 ioctls and video_decoder.h from Video devices.
32When: December 2008 41When: December 2008
33Files: include/linux/video_decoder.h include/linux/videodev.h 42Files: include/linux/video_decoder.h include/linux/videodev.h
@@ -47,6 +56,30 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org>
47 56
48--------------------------- 57---------------------------
49 58
59What: old tuner-3036 i2c driver
60When: 2.6.28
61Why: This driver is for VERY old i2c-over-parallel port teletext receiver
62 boxes. Rather then spending effort on converting this driver to V4L2,
63 and since it is extremely unlikely that anyone still uses one of these
64 devices, it was decided to drop it.
65Who: Hans Verkuil <hverkuil@xs4all.nl>
66 Mauro Carvalho Chehab <mchehab@infradead.org>
67
68 ---------------------------
69
70What: V4L2 dpc7146 driver
71When: 2.6.28
72Why: Old driver for the dpc7146 demonstration board that is no longer
73 relevant. The last time this was tested on actual hardware was
74 probably around 2002. Since this is a driver for a demonstration
75 board the decision was made to remove it rather than spending a
76 lot of effort continually updating this driver to stay in sync
77 with the latest internal V4L2 or I2C API.
78Who: Hans Verkuil <hverkuil@xs4all.nl>
79 Mauro Carvalho Chehab <mchehab@infradead.org>
80
81---------------------------
82
50What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) 83What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
51When: November 2005 84When: November 2005
52Files: drivers/pcmcia/: pcmcia_ioctl.c 85Files: drivers/pcmcia/: pcmcia_ioctl.c
@@ -138,24 +171,6 @@ Who: Kay Sievers <kay.sievers@suse.de>
138 171
139--------------------------- 172---------------------------
140 173
141What: find_task_by_pid
142When: 2.6.26
143Why: With pid namespaces, calling this funciton will return the
144 wrong task when called from inside a namespace.
145
146 The best way to save a task pid and find a task by this
147 pid later, is to find this task's struct pid pointer (or get
148 it directly from the task) and call pid_task() later.
149
150 If someone really needs to get a task by its pid_t, then
151 he most likely needs the find_task_by_vpid() to get the
152 task from the same namespace as the current task is in, but
153 this may be not so in general.
154
155Who: Pavel Emelyanov <xemul@openvz.org>
156
157---------------------------
158
159What: ACPI procfs interface 174What: ACPI procfs interface
160When: July 2008 175When: July 2008
161Why: ACPI sysfs conversion should be finished by January 2008. 176Why: ACPI sysfs conversion should be finished by January 2008.
@@ -199,19 +214,6 @@ Who: Tejun Heo <htejun@gmail.com>
199 214
200--------------------------- 215---------------------------
201 216
202What: The arch/ppc and include/asm-ppc directories
203When: Jun 2008
204Why: The arch/powerpc tree is the merged architecture for ppc32 and ppc64
205 platforms. Currently there are efforts underway to port the remaining
206 arch/ppc platforms to the merged tree. New submissions to the arch/ppc
207 tree have been frozen with the 2.6.22 kernel release and that tree will
208 remain in bug-fix only mode until its scheduled removal. Platforms
209 that are not ported by June 2008 will be removed due to the lack of an
210 interested maintainer.
211Who: linuxppc-dev@ozlabs.org
212
213---------------------------
214
215What: i386/x86_64 bzImage symlinks 217What: i386/x86_64 bzImage symlinks
216When: April 2010 218When: April 2010
217 219
@@ -222,13 +224,6 @@ Who: Thomas Gleixner <tglx@linutronix.de>
222 224
223--------------------------- 225---------------------------
224 226
225What: i2c-i810, i2c-prosavage and i2c-savage4
226When: May 2008
227Why: These drivers are superseded by i810fb, intelfb and savagefb.
228Who: Jean Delvare <khali@linux-fr.org>
229
230---------------------------
231
232What (Why): 227What (Why):
233 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files 228 - include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files
234 (superseded by xt_TOS/xt_tos target & match) 229 (superseded by xt_TOS/xt_tos target & match)
@@ -255,6 +250,9 @@ What (Why):
255 - xt_mark match revision 0 250 - xt_mark match revision 0
256 (superseded by xt_mark match revision 1) 251 (superseded by xt_mark match revision 1)
257 252
253 - xt_recent: the old ipt_recent proc dir
254 (superseded by /proc/net/xt_recent)
255
258When: January 2009 or Linux 2.7.0, whichever comes first 256When: January 2009 or Linux 2.7.0, whichever comes first
259Why: Superseded by newer revisions or modules 257Why: Superseded by newer revisions or modules
260Who: Jan Engelhardt <jengelh@computergmbh.de> 258Who: Jan Engelhardt <jengelh@computergmbh.de>
@@ -307,8 +305,49 @@ Who: ocfs2-devel@oss.oracle.com
307 305
308--------------------------- 306---------------------------
309 307
310What: asm/semaphore.h 308What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
311When: 2.6.26 309 SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD
312Why: Implementation became generic; users should now include 310When: June 2009
313 linux/semaphore.h instead. 311Why: A newer version of the options have been introduced in 2005 that
314Who: Matthew Wilcox <willy@linux.intel.com> 312 removes the limitions of the old API. The sctp library has been
313 converted to use these new options at the same time. Any user
314 space app that directly uses the old options should convert to using
315 the new options.
316Who: Vlad Yasevich <vladislav.yasevich@hp.com>
317
318---------------------------
319
320What: CONFIG_THERMAL_HWMON
321When: January 2009
322Why: This option was introduced just to allow older lm-sensors userspace
323 to keep working over the upgrade to 2.6.26. At the scheduled time of
324 removal fixed lm-sensors (2.x or 3.x) should be readily available.
325Who: Rene Herman <rene.herman@gmail.com>
326
327---------------------------
328
329What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS
330 (in net/core/net-sysfs.c)
331When: After the only user (hal) has seen a release with the patches
332 for enough time, probably some time in 2010.
333Why: Over 1K .text/.data size reduction, data is available in other
334 ways (ioctls)
335Who: Johannes Berg <johannes@sipsolutions.net>
336
337---------------------------
338
339What: CONFIG_NF_CT_ACCT
340When: 2.6.29
341Why: Accounting can now be enabled/disabled without kernel recompilation.
342 Currently used only to set a default value for a feature that is also
343 controlled by a kernel/module/sysfs/sysctl parameter.
344Who: Krzysztof Piotr Oledzki <ole@ans.pl>
345
346---------------------------
347
348What: ide-scsi (BLK_DEV_IDESCSI)
349When: 2.6.29
350Why: The 2.6 kernel supports direct writing to ide CD drives, which
351 eliminates the need for ide-scsi. The new method is more
352 efficient in every way.
353Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 8b22d7d8b991..8362860e21a7 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -144,8 +144,8 @@ prototypes:
144 void (*kill_sb) (struct super_block *); 144 void (*kill_sb) (struct super_block *);
145locking rules: 145locking rules:
146 may block BKL 146 may block BKL
147get_sb yes yes 147get_sb yes no
148kill_sb yes yes 148kill_sb yes no
149 149
150->get_sb() returns error or 0 with locked superblock attached to the vfsmount 150->get_sb() returns error or 0 with locked superblock attached to the vfsmount
151(exclusive on ->s_umount). 151(exclusive on ->s_umount).
@@ -409,12 +409,12 @@ ioctl: yes (see below)
409unlocked_ioctl: no (see below) 409unlocked_ioctl: no (see below)
410compat_ioctl: no 410compat_ioctl: no
411mmap: no 411mmap: no
412open: maybe (see below) 412open: no
413flush: no 413flush: no
414release: no 414release: no
415fsync: no (see below) 415fsync: no (see below)
416aio_fsync: no 416aio_fsync: no
417fasync: yes (see below) 417fasync: no
418lock: yes 418lock: yes
419readv: no 419readv: no
420writev: no 420writev: no
@@ -431,13 +431,6 @@ For many filesystems, it is probably safe to acquire the inode
431semaphore. Note some filesystems (i.e. remote ones) provide no 431semaphore. Note some filesystems (i.e. remote ones) provide no
432protection for i_size so you will need to use the BKL. 432protection for i_size so you will need to use the BKL.
433 433
434->open() locking is in-transit: big lock partially moved into the methods.
435The only exception is ->open() in the instances of file_operations that never
436end up in ->i_fop/->proc_fops, i.e. ones that belong to character devices
437(chrdev_open() takes lock before replacing ->f_op and calling the secondary
438method. As soon as we fix the handling of module reference counters all
439instances of ->open() will be called without the BKL.
440
441Note: ext2_release() was *the* source of contention on fs-intensive 434Note: ext2_release() was *the* source of contention on fs-intensive
442loads and dropping BKL on ->release() helps to get rid of that (we still 435loads and dropping BKL on ->release() helps to get rid of that (we still
443grab BKL for cases when we close a file that had been opened r/w, but that 436grab BKL for cases when we close a file that had been opened r/w, but that
@@ -510,6 +503,7 @@ prototypes:
510 void (*close)(struct vm_area_struct*); 503 void (*close)(struct vm_area_struct*);
511 int (*fault)(struct vm_area_struct*, struct vm_fault *); 504 int (*fault)(struct vm_area_struct*, struct vm_fault *);
512 int (*page_mkwrite)(struct vm_area_struct *, struct page *); 505 int (*page_mkwrite)(struct vm_area_struct *, struct page *);
506 int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
513 507
514locking rules: 508locking rules:
515 BKL mmap_sem PageLocked(page) 509 BKL mmap_sem PageLocked(page)
@@ -517,6 +511,7 @@ open: no yes
517close: no yes 511close: no yes
518fault: no yes 512fault: no yes
519page_mkwrite: no yes no 513page_mkwrite: no yes no
514access: no yes
520 515
521 ->page_mkwrite() is called when a previously read-only page is 516 ->page_mkwrite() is called when a previously read-only page is
522about to become writeable. The file system is responsible for 517about to become writeable. The file system is responsible for
@@ -525,6 +520,11 @@ taking to lock out truncate, the page range should be verified to be
525within i_size. The page mapping should also be checked that it is not 520within i_size. The page mapping should also be checked that it is not
526NULL. 521NULL.
527 522
523 ->access() is called when get_user_pages() fails in
524acces_process_vm(), typically used to debug a process through
525/proc/pid/mem or ptrace. This function is needed only for
526VM_IO | VM_PFNMAP VMAs.
527
528================================================================================ 528================================================================================
529 Dubious stuff 529 Dubious stuff
530 530
diff --git a/Documentation/filesystems/bfs.txt b/Documentation/filesystems/bfs.txt
index ea825e178e79..78043d5a8fc3 100644
--- a/Documentation/filesystems/bfs.txt
+++ b/Documentation/filesystems/bfs.txt
@@ -26,11 +26,11 @@ You can simplify mounting by just typing:
26 26
27this will allocate the first available loopback device (and load loop.o 27this will allocate the first available loopback device (and load loop.o
28kernel module if necessary) automatically. If the loopback driver is not 28kernel module if necessary) automatically. If the loopback driver is not
29loaded automatically, make sure that your kernel is compiled with kmod 29loaded automatically, make sure that you have compiled the module and
30support (CONFIG_KMOD) enabled. Beware that umount will not 30that modprobe is functioning. Beware that umount will not deallocate
31deallocate /dev/loopN device if /etc/mtab file on your system is a 31/dev/loopN device if /etc/mtab file on your system is a symbolic link to
32symbolic link to /proc/mounts. You will need to do it manually using 32/proc/mounts. You will need to do it manually using "-d" switch of
33"-d" switch of losetup(8). Read losetup(8) manpage for more info. 33losetup(8). Read losetup(8) manpage for more info.
34 34
35To create the BFS image under UnixWare you need to find out first which 35To create the BFS image under UnixWare you need to find out first which
36slice contains it. The command prtvtoc(1M) is your friend: 36slice contains it. The command prtvtoc(1M) is your friend:
diff --git a/Documentation/filesystems/configfs/Makefile b/Documentation/filesystems/configfs/Makefile
new file mode 100644
index 000000000000..be7ec5e67dbc
--- /dev/null
+++ b/Documentation/filesystems/configfs/Makefile
@@ -0,0 +1,3 @@
1ifneq ($(CONFIG_CONFIGFS_FS),)
2obj-m += configfs_example_explicit.o configfs_example_macros.o
3endif
diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
index 44c97e6accb2..fabcb0e00f25 100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -311,9 +311,20 @@ the subsystem must be ready for it.
311[An Example] 311[An Example]
312 312
313The best example of these basic concepts is the simple_children 313The best example of these basic concepts is the simple_children
314subsystem/group and the simple_child item in configfs_example.c It 314subsystem/group and the simple_child item in configfs_example_explicit.c
315shows a trivial object displaying and storing an attribute, and a simple 315and configfs_example_macros.c. It shows a trivial object displaying and
316group creating and destroying these children. 316storing an attribute, and a simple group creating and destroying these
317children.
318
319The only difference between configfs_example_explicit.c and
320configfs_example_macros.c is how the attributes of the childless item
321are defined. The childless item has extended attributes, each with
322their own show()/store() operation. This follows a convention commonly
323used in sysfs. configfs_example_explicit.c creates these attributes
324by explicitly defining the structures involved. Conversely
325configfs_example_macros.c uses some convenience macros from configfs.h
326to define the attributes. These macros are similar to their sysfs
327counterparts.
317 328
318[Hierarchy Navigation and the Subsystem Mutex] 329[Hierarchy Navigation and the Subsystem Mutex]
319 330
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example_explicit.c
index 25151fd5c2c6..d428cc9f07f3 100644
--- a/Documentation/filesystems/configfs/configfs_example.c
+++ b/Documentation/filesystems/configfs/configfs_example_explicit.c
@@ -1,8 +1,10 @@
1/* 1/*
2 * vim: noexpandtab ts=8 sts=0 sw=8: 2 * vim: noexpandtab ts=8 sts=0 sw=8:
3 * 3 *
4 * configfs_example.c - This file is a demonstration module containing 4 * configfs_example_explicit.c - This file is a demonstration module
5 * a number of configfs subsystems. 5 * containing a number of configfs subsystems. It explicitly defines
6 * each structure without using the helper macros defined in
7 * configfs.h.
6 * 8 *
7 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public 10 * modify it under the terms of the GNU General Public
@@ -279,8 +281,7 @@ static struct config_item *simple_children_make_item(struct config_group *group,
279 281
280 simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL); 282 simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
281 if (!simple_child) 283 if (!simple_child)
282 return NULL; 284 return ERR_PTR(-ENOMEM);
283
284 285
285 config_item_init_type_name(&simple_child->item, name, 286 config_item_init_type_name(&simple_child->item, name,
286 &simple_child_type); 287 &simple_child_type);
@@ -302,8 +303,8 @@ static struct configfs_attribute *simple_children_attrs[] = {
302}; 303};
303 304
304static ssize_t simple_children_attr_show(struct config_item *item, 305static ssize_t simple_children_attr_show(struct config_item *item,
305 struct configfs_attribute *attr, 306 struct configfs_attribute *attr,
306 char *page) 307 char *page)
307{ 308{
308 return sprintf(page, 309 return sprintf(page,
309"[02-simple-children]\n" 310"[02-simple-children]\n"
@@ -318,7 +319,7 @@ static void simple_children_release(struct config_item *item)
318} 319}
319 320
320static struct configfs_item_operations simple_children_item_ops = { 321static struct configfs_item_operations simple_children_item_ops = {
321 .release = simple_children_release, 322 .release = simple_children_release,
322 .show_attribute = simple_children_attr_show, 323 .show_attribute = simple_children_attr_show,
323}; 324};
324 325
@@ -366,8 +367,7 @@ static struct config_group *group_children_make_group(struct config_group *group
366 simple_children = kzalloc(sizeof(struct simple_children), 367 simple_children = kzalloc(sizeof(struct simple_children),
367 GFP_KERNEL); 368 GFP_KERNEL);
368 if (!simple_children) 369 if (!simple_children)
369 return NULL; 370 return ERR_PTR(-ENOMEM);
370
371 371
372 config_group_init_type_name(&simple_children->group, name, 372 config_group_init_type_name(&simple_children->group, name,
373 &simple_children_type); 373 &simple_children_type);
@@ -387,8 +387,8 @@ static struct configfs_attribute *group_children_attrs[] = {
387}; 387};
388 388
389static ssize_t group_children_attr_show(struct config_item *item, 389static ssize_t group_children_attr_show(struct config_item *item,
390 struct configfs_attribute *attr, 390 struct configfs_attribute *attr,
391 char *page) 391 char *page)
392{ 392{
393 return sprintf(page, 393 return sprintf(page,
394"[03-group-children]\n" 394"[03-group-children]\n"
diff --git a/Documentation/filesystems/configfs/configfs_example_macros.c b/Documentation/filesystems/configfs/configfs_example_macros.c
new file mode 100644
index 000000000000..d8e30a0378aa
--- /dev/null
+++ b/Documentation/filesystems/configfs/configfs_example_macros.c
@@ -0,0 +1,448 @@
1/*
2 * vim: noexpandtab ts=8 sts=0 sw=8:
3 *
4 * configfs_example_macros.c - This file is a demonstration module
5 * containing a number of configfs subsystems. It uses the helper
6 * macros defined by configfs.h
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 021110-1307, USA.
22 *
23 * Based on sysfs:
24 * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
25 *
26 * configfs Copyright (C) 2005 Oracle. All rights reserved.
27 */
28
29#include <linux/init.h>
30#include <linux/module.h>
31#include <linux/slab.h>
32
33#include <linux/configfs.h>
34
35
36
37/*
38 * 01-childless
39 *
40 * This first example is a childless subsystem. It cannot create
41 * any config_items. It just has attributes.
42 *
43 * Note that we are enclosing the configfs_subsystem inside a container.
44 * This is not necessary if a subsystem has no attributes directly
45 * on the subsystem. See the next example, 02-simple-children, for
46 * such a subsystem.
47 */
48
49struct childless {
50 struct configfs_subsystem subsys;
51 int showme;
52 int storeme;
53};
54
55static inline struct childless *to_childless(struct config_item *item)
56{
57 return item ? container_of(to_configfs_subsystem(to_config_group(item)), struct childless, subsys) : NULL;
58}
59
60CONFIGFS_ATTR_STRUCT(childless);
61#define CHILDLESS_ATTR(_name, _mode, _show, _store) \
62struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store)
63#define CHILDLESS_ATTR_RO(_name, _show) \
64struct childless_attribute childless_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show);
65
66static ssize_t childless_showme_read(struct childless *childless,
67 char *page)
68{
69 ssize_t pos;
70
71 pos = sprintf(page, "%d\n", childless->showme);
72 childless->showme++;
73
74 return pos;
75}
76
77static ssize_t childless_storeme_read(struct childless *childless,
78 char *page)
79{
80 return sprintf(page, "%d\n", childless->storeme);
81}
82
83static ssize_t childless_storeme_write(struct childless *childless,
84 const char *page,
85 size_t count)
86{
87 unsigned long tmp;
88 char *p = (char *) page;
89
90 tmp = simple_strtoul(p, &p, 10);
91 if (!p || (*p && (*p != '\n')))
92 return -EINVAL;
93
94 if (tmp > INT_MAX)
95 return -ERANGE;
96
97 childless->storeme = tmp;
98
99 return count;
100}
101
102static ssize_t childless_description_read(struct childless *childless,
103 char *page)
104{
105 return sprintf(page,
106"[01-childless]\n"
107"\n"
108"The childless subsystem is the simplest possible subsystem in\n"
109"configfs. It does not support the creation of child config_items.\n"
110"It only has a few attributes. In fact, it isn't much different\n"
111"than a directory in /proc.\n");
112}
113
114CHILDLESS_ATTR_RO(showme, childless_showme_read);
115CHILDLESS_ATTR(storeme, S_IRUGO | S_IWUSR, childless_storeme_read,
116 childless_storeme_write);
117CHILDLESS_ATTR_RO(description, childless_description_read);
118
119static struct configfs_attribute *childless_attrs[] = {
120 &childless_attr_showme.attr,
121 &childless_attr_storeme.attr,
122 &childless_attr_description.attr,
123 NULL,
124};
125
126CONFIGFS_ATTR_OPS(childless);
127static struct configfs_item_operations childless_item_ops = {
128 .show_attribute = childless_attr_show,
129 .store_attribute = childless_attr_store,
130};
131
132static struct config_item_type childless_type = {
133 .ct_item_ops = &childless_item_ops,
134 .ct_attrs = childless_attrs,
135 .ct_owner = THIS_MODULE,
136};
137
138static struct childless childless_subsys = {
139 .subsys = {
140 .su_group = {
141 .cg_item = {
142 .ci_namebuf = "01-childless",
143 .ci_type = &childless_type,
144 },
145 },
146 },
147};
148
149
150/* ----------------------------------------------------------------- */
151
152/*
153 * 02-simple-children
154 *
155 * This example merely has a simple one-attribute child. Note that
156 * there is no extra attribute structure, as the child's attribute is
157 * known from the get-go. Also, there is no container for the
158 * subsystem, as it has no attributes of its own.
159 */
160
161struct simple_child {
162 struct config_item item;
163 int storeme;
164};
165
166static inline struct simple_child *to_simple_child(struct config_item *item)
167{
168 return item ? container_of(item, struct simple_child, item) : NULL;
169}
170
171static struct configfs_attribute simple_child_attr_storeme = {
172 .ca_owner = THIS_MODULE,
173 .ca_name = "storeme",
174 .ca_mode = S_IRUGO | S_IWUSR,
175};
176
177static struct configfs_attribute *simple_child_attrs[] = {
178 &simple_child_attr_storeme,
179 NULL,
180};
181
182static ssize_t simple_child_attr_show(struct config_item *item,
183 struct configfs_attribute *attr,
184 char *page)
185{
186 ssize_t count;
187 struct simple_child *simple_child = to_simple_child(item);
188
189 count = sprintf(page, "%d\n", simple_child->storeme);
190
191 return count;
192}
193
194static ssize_t simple_child_attr_store(struct config_item *item,
195 struct configfs_attribute *attr,
196 const char *page, size_t count)
197{
198 struct simple_child *simple_child = to_simple_child(item);
199 unsigned long tmp;
200 char *p = (char *) page;
201
202 tmp = simple_strtoul(p, &p, 10);
203 if (!p || (*p && (*p != '\n')))
204 return -EINVAL;
205
206 if (tmp > INT_MAX)
207 return -ERANGE;
208
209 simple_child->storeme = tmp;
210
211 return count;
212}
213
214static void simple_child_release(struct config_item *item)
215{
216 kfree(to_simple_child(item));
217}
218
219static struct configfs_item_operations simple_child_item_ops = {
220 .release = simple_child_release,
221 .show_attribute = simple_child_attr_show,
222 .store_attribute = simple_child_attr_store,
223};
224
225static struct config_item_type simple_child_type = {
226 .ct_item_ops = &simple_child_item_ops,
227 .ct_attrs = simple_child_attrs,
228 .ct_owner = THIS_MODULE,
229};
230
231
232struct simple_children {
233 struct config_group group;
234};
235
236static inline struct simple_children *to_simple_children(struct config_item *item)
237{
238 return item ? container_of(to_config_group(item), struct simple_children, group) : NULL;
239}
240
241static struct config_item *simple_children_make_item(struct config_group *group, const char *name)
242{
243 struct simple_child *simple_child;
244
245 simple_child = kzalloc(sizeof(struct simple_child), GFP_KERNEL);
246 if (!simple_child)
247 return ERR_PTR(-ENOMEM);
248
249 config_item_init_type_name(&simple_child->item, name,
250 &simple_child_type);
251
252 simple_child->storeme = 0;
253
254 return &simple_child->item;
255}
256
257static struct configfs_attribute simple_children_attr_description = {
258 .ca_owner = THIS_MODULE,
259 .ca_name = "description",
260 .ca_mode = S_IRUGO,
261};
262
263static struct configfs_attribute *simple_children_attrs[] = {
264 &simple_children_attr_description,
265 NULL,
266};
267
268static ssize_t simple_children_attr_show(struct config_item *item,
269 struct configfs_attribute *attr,
270 char *page)
271{
272 return sprintf(page,
273"[02-simple-children]\n"
274"\n"
275"This subsystem allows the creation of child config_items. These\n"
276"items have only one attribute that is readable and writeable.\n");
277}
278
279static void simple_children_release(struct config_item *item)
280{
281 kfree(to_simple_children(item));
282}
283
284static struct configfs_item_operations simple_children_item_ops = {
285 .release = simple_children_release,
286 .show_attribute = simple_children_attr_show,
287};
288
289/*
290 * Note that, since no extra work is required on ->drop_item(),
291 * no ->drop_item() is provided.
292 */
293static struct configfs_group_operations simple_children_group_ops = {
294 .make_item = simple_children_make_item,
295};
296
297static struct config_item_type simple_children_type = {
298 .ct_item_ops = &simple_children_item_ops,
299 .ct_group_ops = &simple_children_group_ops,
300 .ct_attrs = simple_children_attrs,
301 .ct_owner = THIS_MODULE,
302};
303
304static struct configfs_subsystem simple_children_subsys = {
305 .su_group = {
306 .cg_item = {
307 .ci_namebuf = "02-simple-children",
308 .ci_type = &simple_children_type,
309 },
310 },
311};
312
313
314/* ----------------------------------------------------------------- */
315
316/*
317 * 03-group-children
318 *
319 * This example reuses the simple_children group from above. However,
320 * the simple_children group is not the subsystem itself, it is a
321 * child of the subsystem. Creation of a group in the subsystem creates
322 * a new simple_children group. That group can then have simple_child
323 * children of its own.
324 */
325
326static struct config_group *group_children_make_group(struct config_group *group, const char *name)
327{
328 struct simple_children *simple_children;
329
330 simple_children = kzalloc(sizeof(struct simple_children),
331 GFP_KERNEL);
332 if (!simple_children)
333 return ERR_PTR(-ENOMEM);
334
335 config_group_init_type_name(&simple_children->group, name,
336 &simple_children_type);
337
338 return &simple_children->group;
339}
340
341static struct configfs_attribute group_children_attr_description = {
342 .ca_owner = THIS_MODULE,
343 .ca_name = "description",
344 .ca_mode = S_IRUGO,
345};
346
347static struct configfs_attribute *group_children_attrs[] = {
348 &group_children_attr_description,
349 NULL,
350};
351
352static ssize_t group_children_attr_show(struct config_item *item,
353 struct configfs_attribute *attr,
354 char *page)
355{
356 return sprintf(page,
357"[03-group-children]\n"
358"\n"
359"This subsystem allows the creation of child config_groups. These\n"
360"groups are like the subsystem simple-children.\n");
361}
362
363static struct configfs_item_operations group_children_item_ops = {
364 .show_attribute = group_children_attr_show,
365};
366
367/*
368 * Note that, since no extra work is required on ->drop_item(),
369 * no ->drop_item() is provided.
370 */
371static struct configfs_group_operations group_children_group_ops = {
372 .make_group = group_children_make_group,
373};
374
375static struct config_item_type group_children_type = {
376 .ct_item_ops = &group_children_item_ops,
377 .ct_group_ops = &group_children_group_ops,
378 .ct_attrs = group_children_attrs,
379 .ct_owner = THIS_MODULE,
380};
381
382static struct configfs_subsystem group_children_subsys = {
383 .su_group = {
384 .cg_item = {
385 .ci_namebuf = "03-group-children",
386 .ci_type = &group_children_type,
387 },
388 },
389};
390
391/* ----------------------------------------------------------------- */
392
393/*
394 * We're now done with our subsystem definitions.
395 * For convenience in this module, here's a list of them all. It
396 * allows the init function to easily register them. Most modules
397 * will only have one subsystem, and will only call register_subsystem
398 * on it directly.
399 */
400static struct configfs_subsystem *example_subsys[] = {
401 &childless_subsys.subsys,
402 &simple_children_subsys,
403 &group_children_subsys,
404 NULL,
405};
406
407static int __init configfs_example_init(void)
408{
409 int ret;
410 int i;
411 struct configfs_subsystem *subsys;
412
413 for (i = 0; example_subsys[i]; i++) {
414 subsys = example_subsys[i];
415
416 config_group_init(&subsys->su_group);
417 mutex_init(&subsys->su_mutex);
418 ret = configfs_register_subsystem(subsys);
419 if (ret) {
420 printk(KERN_ERR "Error %d while registering subsystem %s\n",
421 ret,
422 subsys->su_group.cg_item.ci_namebuf);
423 goto out_unregister;
424 }
425 }
426
427 return 0;
428
429out_unregister:
430 for (; i >= 0; i--) {
431 configfs_unregister_subsystem(example_subsys[i]);
432 }
433
434 return ret;
435}
436
437static void __exit configfs_example_exit(void)
438{
439 int i;
440
441 for (i = 0; example_subsys[i]; i++) {
442 configfs_unregister_subsystem(example_subsys[i]);
443 }
444}
445
446module_init(configfs_example_init);
447module_exit(configfs_example_exit);
448MODULE_LICENSE("GPL");
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt
index 0c5086db8352..74484e696405 100644
--- a/Documentation/filesystems/ext4.txt
+++ b/Documentation/filesystems/ext4.txt
@@ -13,72 +13,99 @@ Mailing list: linux-ext4@vger.kernel.org
131. Quick usage instructions: 131. Quick usage instructions:
14=========================== 14===========================
15 15
16 - Grab updated e2fsprogs from 16 - Compile and install the latest version of e2fsprogs (as of this
17 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs-interim/ 17 writing version 1.41) from:
18 This is a patchset on top of e2fsprogs-1.39, which can be found at 18
19 http://sourceforge.net/project/showfiles.php?group_id=2406
20
21 or
22
19 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/ 23 ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/
20 24
21 - It's still mke2fs -j /dev/hda1 25 or grab the latest git repository from:
26
27 git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
28
29 - Note that it is highly important to install the mke2fs.conf file
30 that comes with the e2fsprogs 1.41.x sources in /etc/mke2fs.conf. If
31 you have edited the /etc/mke2fs.conf file installed on your system,
32 you will need to merge your changes with the version from e2fsprogs
33 1.41.x.
34
35 - Create a new filesystem using the ext4 filesystem type:
36
37 # mke2fs -t ext4 /dev/hda1
38
39 Or configure an existing ext3 filesystem to support extents and set
40 the test_fs flag to indicate that it's ok for an in-development
41 filesystem to touch this filesystem:
22 42
23 - mount /dev/hda1 /wherever -t ext4dev 43 # tune2fs -O extents -E test_fs /dev/hda1
24 44
25 - To enable extents, 45 If the filesystem was created with 128 byte inodes, it can be
46 converted to use 256 byte for greater efficiency via:
26 47
27 mount /dev/hda1 /wherever -t ext4dev -o extents 48 # tune2fs -I 256 /dev/hda1
28 49
29 - The filesystem is compatible with the ext3 driver until you add a file 50 (Note: we currently do not have tools to convert an ext4
30 which has extents (ie: `mount -o extents', then create a file). 51 filesystem back to ext3; so please do not do try this on production
52 filesystems.)
31 53
32 NOTE: The "extents" mount flag is temporary. It will soon go away and 54 - Mounting:
33 extents will be enabled by the "-o extents" flag to mke2fs or tune2fs 55
56 # mount -t ext4 /dev/hda1 /wherever
34 57
35 - When comparing performance with other filesystems, remember that 58 - When comparing performance with other filesystems, remember that
36 ext3/4 by default offers higher data integrity guarantees than most. So 59 ext3/4 by default offers higher data integrity guarantees than most.
37 when comparing with a metadata-only journalling filesystem, use `mount -o 60 So when comparing with a metadata-only journalling filesystem, such
38 data=writeback'. And you might as well use `mount -o nobh' too along 61 as ext3, use `mount -o data=writeback'. And you might as well use
39 with it. Making the journal larger than the mke2fs default often helps 62 `mount -o nobh' too along with it. Making the journal larger than
40 performance with metadata-intensive workloads. 63 the mke2fs default often helps performance with metadata-intensive
64 workloads.
41 65
422. Features 662. Features
43=========== 67===========
44 68
452.1 Currently available 692.1 Currently available
46 70
47* ability to use filesystems > 16TB 71* ability to use filesystems > 16TB (e2fsprogs support not available yet)
48* extent format reduces metadata overhead (RAM, IO for access, transactions) 72* extent format reduces metadata overhead (RAM, IO for access, transactions)
49* extent format more robust in face of on-disk corruption due to magics, 73* extent format more robust in face of on-disk corruption due to magics,
50* internal redunancy in tree 74* internal redunancy in tree
51 75* improved file allocation (multi-block alloc)
522.1 Previously available, soon to be enabled by default by "mkefs.ext4": 76* fix 32000 subdirectory limit
53 77* nsec timestamps for mtime, atime, ctime, create time
54* dir_index and resize inode will be on by default 78* inode version field on disk (NFSv4, Lustre)
55* large inodes will be used by default for fast EAs, nsec timestamps, etc 79* reduced e2fsck time via uninit_bg feature
80* journal checksumming for robustness, performance
81* persistent file preallocation (e.g for streaming media, databases)
82* ability to pack bitmaps and inode tables into larger virtual groups via the
83 flex_bg feature
84* large file support
85* Inode allocation using large virtual block groups via flex_bg
86* delayed allocation
87* large block (up to pagesize) support
88* efficent new ordered mode in JBD2 and ext4(avoid using buffer head to force
89 the ordering)
56 90
572.2 Candidate features for future inclusion 912.2 Candidate features for future inclusion
58 92
59There are several under discussion, whether they all make it in is 93* Online defrag (patches available but not well tested)
60partly a function of how much time everyone has to work on them: 94* reduced mke2fs time via lazy itable initialization in conjuction with
95 the uninit_bg feature (capability to do this is available in e2fsprogs
96 but a kernel thread to do lazy zeroing of unused inode table blocks
97 after filesystem is first mounted is required for safety)
61 98
62* improved file allocation (multi-block alloc, delayed alloc; basically done) 99There are several others under discussion, whether they all make it in is
63* fix 32000 subdirectory limit (patch exists, needs some e2fsck work) 100partly a function of how much time everyone has to work on them. Features like
64* nsec timestamps for mtime, atime, ctime, create time (patch exists, 101metadata checksumming have been discussed and planned for a bit but no patches
65 needs some e2fsck work) 102exist yet so I'm not sure they're in the near-term roadmap.
66* inode version field on disk (NFSv4, Lustre; prototype exists)
67* reduced mke2fs/e2fsck time via uninitialized groups (prototype exists)
68* journal checksumming for robustness, performance (prototype exists)
69* persistent file preallocation (e.g for streaming media, databases)
70 103
71Features like metadata checksumming have been discussed and planned for 104The big performance win will come with mballoc, delalloc and flex_bg
72a bit but no patches exist yet so I'm not sure they're in the near-term 105grouping of bitmaps and inode tables. Some test results available here:
73roadmap.
74 106
75The big performance win will come with mballoc and delalloc. CFS has 107 - http://www.bullopensource.org/ext4/20080530/ffsb-write-2.6.26-rc2.html
76been using mballoc for a few years already with Lustre, and IBM + Bull 108 - http://www.bullopensource.org/ext4/20080530/ffsb-readwrite-2.6.26-rc2.html
77did a lot of benchmarking on it. The reason it isn't in the first set of
78patches is partly a manageability issue, and partly because it doesn't
79directly affect the on-disk format (outside of much better allocation)
80so it isn't critical to get into the first round of changes. I believe
81Alex is working on a new set of patches right now.
82 109
833. Options 1103. Options
84========== 111==========
@@ -150,6 +177,11 @@ barrier=<0|1(*)> This enables/disables the use of write barriers in
150 your disks are battery-backed in one way or another, 177 your disks are battery-backed in one way or another,
151 disabling barriers may safely improve performance. 178 disabling barriers may safely improve performance.
152 179
180inode_readahead=n This tuning parameter controls the maximum
181 number of inode table blocks that ext4's inode
182 table readahead algorithm will pre-read into
183 the buffer cache. The default value is 32 blocks.
184
153orlov (*) This enables the new Orlov block allocator. It is 185orlov (*) This enables the new Orlov block allocator. It is
154 enabled by default. 186 enabled by default.
155 187
@@ -222,9 +254,12 @@ stripe=n Number of filesystem blocks that mballoc will try
222 to use for allocation size and alignment. For RAID5/6 254 to use for allocation size and alignment. For RAID5/6
223 systems this should be the number of data 255 systems this should be the number of data
224 disks * RAID chunk size in file system blocks. 256 disks * RAID chunk size in file system blocks.
257delalloc (*) Deferring block allocation until write-out time.
258nodelalloc Disable delayed allocation. Blocks are allocation
259 when data is copied from user to page cache.
225 260
226Data Mode 261Data Mode
227--------- 262=========
228There are 3 different data modes: 263There are 3 different data modes:
229 264
230* writeback mode 265* writeback mode
@@ -236,10 +271,10 @@ typically provide the best ext4 performance.
236 271
237* ordered mode 272* ordered mode
238In data=ordered mode, ext4 only officially journals metadata, but it logically 273In data=ordered mode, ext4 only officially journals metadata, but it logically
239groups metadata and data blocks into a single unit called a transaction. When 274groups metadata information related to data changes with the data blocks into a
240it's time to write the new metadata out to disk, the associated data blocks 275single unit called a transaction. When it's time to write the new metadata
241are written first. In general, this mode performs slightly slower than 276out to disk, the associated data blocks are written first. In general,
242writeback but significantly faster than journal mode. 277this mode performs slightly slower than writeback but significantly faster than journal mode.
243 278
244* journal mode 279* journal mode
245data=journal mode provides full data and metadata journaling. All new data is 280data=journal mode provides full data and metadata journaling. All new data is
@@ -247,7 +282,8 @@ written to the journal first, and then to its final location.
247In the event of a crash, the journal can be replayed, bringing both data and 282In the event of a crash, the journal can be replayed, bringing both data and
248metadata into a consistent state. This mode is the slowest except when data 283metadata into a consistent state. This mode is the slowest except when data
249needs to be read from and written to disk at the same time where it 284needs to be read from and written to disk at the same time where it
250outperforms all others modes. 285outperforms all others modes. Curently ext4 does not have delayed
286allocation support if this data journalling mode is selected.
251 287
252References 288References
253========== 289==========
@@ -256,7 +292,8 @@ kernel source: <file:fs/ext4/>
256 <file:fs/jbd2/> 292 <file:fs/jbd2/>
257 293
258programs: http://e2fsprogs.sourceforge.net/ 294programs: http://e2fsprogs.sourceforge.net/
259 http://ext2resize.sourceforge.net
260 295
261useful links: http://fedoraproject.org/wiki/ext3-devel 296useful links: http://fedoraproject.org/wiki/ext3-devel
262 http://www.bullopensource.org/ext4/ 297 http://www.bullopensource.org/ext4/
298 http://ext4.wiki.kernel.org/index.php/Main_Page
299 http://fedoraproject.org/wiki/Features/Ext4
diff --git a/Documentation/filesystems/fiemap.txt b/Documentation/filesystems/fiemap.txt
new file mode 100644
index 000000000000..1e3defcfe50b
--- /dev/null
+++ b/Documentation/filesystems/fiemap.txt
@@ -0,0 +1,228 @@
1============
2Fiemap Ioctl
3============
4
5The fiemap ioctl is an efficient method for userspace to get file
6extent mappings. Instead of block-by-block mapping (such as bmap), fiemap
7returns a list of extents.
8
9
10Request Basics
11--------------
12
13A fiemap request is encoded within struct fiemap:
14
15struct fiemap {
16 __u64 fm_start; /* logical offset (inclusive) at
17 * which to start mapping (in) */
18 __u64 fm_length; /* logical length of mapping which
19 * userspace cares about (in) */
20 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
21 __u32 fm_mapped_extents; /* number of extents that were
22 * mapped (out) */
23 __u32 fm_extent_count; /* size of fm_extents array (in) */
24 __u32 fm_reserved;
25 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
26};
27
28
29fm_start, and fm_length specify the logical range within the file
30which the process would like mappings for. Extents returned mirror
31those on disk - that is, the logical offset of the 1st returned extent
32may start before fm_start, and the range covered by the last returned
33extent may end after fm_length. All offsets and lengths are in bytes.
34
35Certain flags to modify the way in which mappings are looked up can be
36set in fm_flags. If the kernel doesn't understand some particular
37flags, it will return EBADR and the contents of fm_flags will contain
38the set of flags which caused the error. If the kernel is compatible
39with all flags passed, the contents of fm_flags will be unmodified.
40It is up to userspace to determine whether rejection of a particular
41flag is fatal to it's operation. This scheme is intended to allow the
42fiemap interface to grow in the future but without losing
43compatibility with old software.
44
45fm_extent_count specifies the number of elements in the fm_extents[] array
46that can be used to return extents. If fm_extent_count is zero, then the
47fm_extents[] array is ignored (no extents will be returned), and the
48fm_mapped_extents count will hold the number of extents needed in
49fm_extents[] to hold the file's current mapping. Note that there is
50nothing to prevent the file from changing between calls to FIEMAP.
51
52The following flags can be set in fm_flags:
53
54* FIEMAP_FLAG_SYNC
55If this flag is set, the kernel will sync the file before mapping extents.
56
57* FIEMAP_FLAG_XATTR
58If this flag is set, the extents returned will describe the inodes
59extended attribute lookup tree, instead of it's data tree.
60
61
62Extent Mapping
63--------------
64
65Extent information is returned within the embedded fm_extents array
66which userspace must allocate along with the fiemap structure. The
67number of elements in the fiemap_extents[] array should be passed via
68fm_extent_count. The number of extents mapped by kernel will be
69returned via fm_mapped_extents. If the number of fiemap_extents
70allocated is less than would be required to map the requested range,
71the maximum number of extents that can be mapped in the fm_extent[]
72array will be returned and fm_mapped_extents will be equal to
73fm_extent_count. In that case, the last extent in the array will not
74complete the requested range and will not have the FIEMAP_EXTENT_LAST
75flag set (see the next section on extent flags).
76
77Each extent is described by a single fiemap_extent structure as
78returned in fm_extents.
79
80struct fiemap_extent {
81 __u64 fe_logical; /* logical offset in bytes for the start of
82 * the extent */
83 __u64 fe_physical; /* physical offset in bytes for the start
84 * of the extent */
85 __u64 fe_length; /* length in bytes for the extent */
86 __u64 fe_reserved64[2];
87 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
88 __u32 fe_reserved[3];
89};
90
91All offsets and lengths are in bytes and mirror those on disk. It is valid
92for an extents logical offset to start before the request or it's logical
93length to extend past the request. Unless FIEMAP_EXTENT_NOT_ALIGNED is
94returned, fe_logical, fe_physical, and fe_length will be aligned to the
95block size of the file system. With the exception of extents flagged as
96FIEMAP_EXTENT_MERGED, adjacent extents will not be merged.
97
98The fe_flags field contains flags which describe the extent returned.
99A special flag, FIEMAP_EXTENT_LAST is always set on the last extent in
100the file so that the process making fiemap calls can determine when no
101more extents are available, without having to call the ioctl again.
102
103Some flags are intentionally vague and will always be set in the
104presence of other more specific flags. This way a program looking for
105a general property does not have to know all existing and future flags
106which imply that property.
107
108For example, if FIEMAP_EXTENT_DATA_INLINE or FIEMAP_EXTENT_DATA_TAIL
109are set, FIEMAP_EXTENT_NOT_ALIGNED will also be set. A program looking
110for inline or tail-packed data can key on the specific flag. Software
111which simply cares not to try operating on non-aligned extents
112however, can just key on FIEMAP_EXTENT_NOT_ALIGNED, and not have to
113worry about all present and future flags which might imply unaligned
114data. Note that the opposite is not true - it would be valid for
115FIEMAP_EXTENT_NOT_ALIGNED to appear alone.
116
117* FIEMAP_EXTENT_LAST
118This is the last extent in the file. A mapping attempt past this
119extent will return nothing.
120
121* FIEMAP_EXTENT_UNKNOWN
122The location of this extent is currently unknown. This may indicate
123the data is stored on an inaccessible volume or that no storage has
124been allocated for the file yet.
125
126* FIEMAP_EXTENT_DELALLOC
127 - This will also set FIEMAP_EXTENT_UNKNOWN.
128Delayed allocation - while there is data for this extent, it's
129physical location has not been allocated yet.
130
131* FIEMAP_EXTENT_ENCODED
132This extent does not consist of plain filesystem blocks but is
133encoded (e.g. encrypted or compressed). Reading the data in this
134extent via I/O to the block device will have undefined results.
135
136Note that it is *always* undefined to try to update the data
137in-place by writing to the indicated location without the
138assistance of the filesystem, or to access the data using the
139information returned by the FIEMAP interface while the filesystem
140is mounted. In other words, user applications may only read the
141extent data via I/O to the block device while the filesystem is
142unmounted, and then only if the FIEMAP_EXTENT_ENCODED flag is
143clear; user applications must not try reading or writing to the
144filesystem via the block device under any other circumstances.
145
146* FIEMAP_EXTENT_DATA_ENCRYPTED
147 - This will also set FIEMAP_EXTENT_ENCODED
148The data in this extent has been encrypted by the file system.
149
150* FIEMAP_EXTENT_NOT_ALIGNED
151Extent offsets and length are not guaranteed to be block aligned.
152
153* FIEMAP_EXTENT_DATA_INLINE
154 This will also set FIEMAP_EXTENT_NOT_ALIGNED
155Data is located within a meta data block.
156
157* FIEMAP_EXTENT_DATA_TAIL
158 This will also set FIEMAP_EXTENT_NOT_ALIGNED
159Data is packed into a block with data from other files.
160
161* FIEMAP_EXTENT_UNWRITTEN
162Unwritten extent - the extent is allocated but it's data has not been
163initialized. This indicates the extent's data will be all zero if read
164through the filesystem but the contents are undefined if read directly from
165the device.
166
167* FIEMAP_EXTENT_MERGED
168This will be set when a file does not support extents, i.e., it uses a block
169based addressing scheme. Since returning an extent for each block back to
170userspace would be highly inefficient, the kernel will try to merge most
171adjacent blocks into 'extents'.
172
173
174VFS -> File System Implementation
175---------------------------------
176
177File systems wishing to support fiemap must implement a ->fiemap callback on
178their inode_operations structure. The fs ->fiemap call is responsible for
179defining it's set of supported fiemap flags, and calling a helper function on
180each discovered extent:
181
182struct inode_operations {
183 ...
184
185 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
186 u64 len);
187
188->fiemap is passed struct fiemap_extent_info which describes the
189fiemap request:
190
191struct fiemap_extent_info {
192 unsigned int fi_flags; /* Flags as passed from user */
193 unsigned int fi_extents_mapped; /* Number of mapped extents */
194 unsigned int fi_extents_max; /* Size of fiemap_extent array */
195 struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent array */
196};
197
198It is intended that the file system should not need to access any of this
199structure directly.
200
201
202Flag checking should be done at the beginning of the ->fiemap callback via the
203fiemap_check_flags() helper:
204
205int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
206
207The struct fieinfo should be passed in as recieved from ioctl_fiemap(). The
208set of fiemap flags which the fs understands should be passed via fs_flags. If
209fiemap_check_flags finds invalid user flags, it will place the bad values in
210fieinfo->fi_flags and return -EBADR. If the file system gets -EBADR, from
211fiemap_check_flags(), it should immediately exit, returning that error back to
212ioctl_fiemap().
213
214
215For each extent in the request range, the file system should call
216the helper function, fiemap_fill_next_extent():
217
218int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
219 u64 phys, u64 len, u32 flags, u32 dev);
220
221fiemap_fill_next_extent() will use the passed values to populate the
222next free extent in the fm_extents array. 'General' extent flags will
223automatically be set from specific flags on behalf of the calling file
224system so that the userspace API is not broken.
225
226fiemap_fill_next_extent() returns 0 on success, and 1 when the
227user-supplied fm_extents array is full. If an error is encountered
228while copying the extent to user memory, -EFAULT will be returned.
diff --git a/Documentation/filesystems/gfs2-glocks.txt b/Documentation/filesystems/gfs2-glocks.txt
new file mode 100644
index 000000000000..4dae9a3840bf
--- /dev/null
+++ b/Documentation/filesystems/gfs2-glocks.txt
@@ -0,0 +1,114 @@
1 Glock internal locking rules
2 ------------------------------
3
4This documents the basic principles of the glock state machine
5internals. Each glock (struct gfs2_glock in fs/gfs2/incore.h)
6has two main (internal) locks:
7
8 1. A spinlock (gl_spin) which protects the internal state such
9 as gl_state, gl_target and the list of holders (gl_holders)
10 2. A non-blocking bit lock, GLF_LOCK, which is used to prevent other
11 threads from making calls to the DLM, etc. at the same time. If a
12 thread takes this lock, it must then call run_queue (usually via the
13 workqueue) when it releases it in order to ensure any pending tasks
14 are completed.
15
16The gl_holders list contains all the queued lock requests (not
17just the holders) associated with the glock. If there are any
18held locks, then they will be contiguous entries at the head
19of the list. Locks are granted in strictly the order that they
20are queued, except for those marked LM_FLAG_PRIORITY which are
21used only during recovery, and even then only for journal locks.
22
23There are three lock states that users of the glock layer can request,
24namely shared (SH), deferred (DF) and exclusive (EX). Those translate
25to the following DLM lock modes:
26
27Glock mode | DLM lock mode
28------------------------------
29 UN | IV/NL Unlocked (no DLM lock associated with glock) or NL
30 SH | PR (Protected read)
31 DF | CW (Concurrent write)
32 EX | EX (Exclusive)
33
34Thus DF is basically a shared mode which is incompatible with the "normal"
35shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
36operations. The glocks are basically a lock plus some routines which deal
37with cache management. The following rules apply for the cache:
38
39Glock mode | Cache data | Cache Metadata | Dirty Data | Dirty Metadata
40--------------------------------------------------------------------------
41 UN | No | No | No | No
42 SH | Yes | Yes | No | No
43 DF | No | Yes | No | No
44 EX | Yes | Yes | Yes | Yes
45
46These rules are implemented using the various glock operations which
47are defined for each type of glock. Not all types of glocks use
48all the modes. Only inode glocks use the DF mode for example.
49
50Table of glock operations and per type constants:
51
52Field | Purpose
53----------------------------------------------------------------------------
54go_xmote_th | Called before remote state change (e.g. to sync dirty data)
55go_xmote_bh | Called after remote state change (e.g. to refill cache)
56go_inval | Called if remote state change requires invalidating the cache
57go_demote_ok | Returns boolean value of whether its ok to demote a glock
58 | (e.g. checks timeout, and that there is no cached data)
59go_lock | Called for the first local holder of a lock
60go_unlock | Called on the final local unlock of a lock
61go_dump | Called to print content of object for debugfs file, or on
62 | error to dump glock to the log.
63go_type; | The type of the glock, LM_TYPE_.....
64go_min_hold_time | The minimum hold time
65
66The minimum hold time for each lock is the time after a remote lock
67grant for which we ignore remote demote requests. This is in order to
68prevent a situation where locks are being bounced around the cluster
69from node to node with none of the nodes making any progress. This
70tends to show up most with shared mmaped files which are being written
71to by multiple nodes. By delaying the demotion in response to a
72remote callback, that gives the userspace program time to make
73some progress before the pages are unmapped.
74
75There is a plan to try and remove the go_lock and go_unlock callbacks
76if possible, in order to try and speed up the fast path though the locking.
77Also, eventually we hope to make the glock "EX" mode locally shared
78such that any local locking will be done with the i_mutex as required
79rather than via the glock.
80
81Locking rules for glock operations:
82
83Operation | GLF_LOCK bit lock held | gl_spin spinlock held
84-----------------------------------------------------------------
85go_xmote_th | Yes | No
86go_xmote_bh | Yes | No
87go_inval | Yes | No
88go_demote_ok | Sometimes | Yes
89go_lock | Yes | No
90go_unlock | Yes | No
91go_dump | Sometimes | Yes
92
93N.B. Operations must not drop either the bit lock or the spinlock
94if its held on entry. go_dump and do_demote_ok must never block.
95Note that go_dump will only be called if the glock's state
96indicates that it is caching uptodate data.
97
98Glock locking order within GFS2:
99
100 1. i_mutex (if required)
101 2. Rename glock (for rename only)
102 3. Inode glock(s)
103 (Parents before children, inodes at "same level" with same parent in
104 lock number order)
105 4. Rgrp glock(s) (for (de)allocation operations)
106 5. Transaction glock (via gfs2_trans_begin) for non-read operations
107 6. Page lock (always last, very important!)
108
109There are two glocks per inode. One deals with access to the inode
110itself (locking order as above), and the other, known as the iopen
111glock is used in conjunction with the i_nlink field in the inode to
112determine the lifetime of the inode in question. Locking of inodes
113is on a per-inode basis. Locking of rgrps is on a per rgrp basis.
114
diff --git a/Documentation/filesystems/nfs-rdma.txt b/Documentation/filesystems/nfs-rdma.txt
index d0ec45ae4e7d..44bd766f2e5d 100644
--- a/Documentation/filesystems/nfs-rdma.txt
+++ b/Documentation/filesystems/nfs-rdma.txt
@@ -5,7 +5,7 @@
5################################################################################ 5################################################################################
6 6
7 Author: NetApp and Open Grid Computing 7 Author: NetApp and Open Grid Computing
8 Date: April 15, 2008 8 Date: May 29, 2008
9 9
10Table of Contents 10Table of Contents
11~~~~~~~~~~~~~~~~~ 11~~~~~~~~~~~~~~~~~
@@ -60,16 +60,18 @@ Installation
60 The procedures described in this document have been tested with 60 The procedures described in this document have been tested with
61 distributions from Red Hat's Fedora Project (http://fedora.redhat.com/). 61 distributions from Red Hat's Fedora Project (http://fedora.redhat.com/).
62 62
63 - Install nfs-utils-1.1.1 or greater on the client 63 - Install nfs-utils-1.1.2 or greater on the client
64 64
65 An NFS/RDMA mount point can only be obtained by using the mount.nfs 65 An NFS/RDMA mount point can be obtained by using the mount.nfs command in
66 command in nfs-utils-1.1.1 or greater. To see which version of mount.nfs 66 nfs-utils-1.1.2 or greater (nfs-utils-1.1.1 was the first nfs-utils
67 you are using, type: 67 version with support for NFS/RDMA mounts, but for various reasons we
68 recommend using nfs-utils-1.1.2 or greater). To see which version of
69 mount.nfs you are using, type:
68 70
69 > /sbin/mount.nfs -V 71 $ /sbin/mount.nfs -V
70 72
71 If the version is less than 1.1.1 or the command does not exist, 73 If the version is less than 1.1.2 or the command does not exist,
72 then you will need to install the latest version of nfs-utils. 74 you should install the latest version of nfs-utils.
73 75
74 Download the latest package from: 76 Download the latest package from:
75 77
@@ -77,22 +79,33 @@ Installation
77 79
78 Uncompress the package and follow the installation instructions. 80 Uncompress the package and follow the installation instructions.
79 81
80 If you will not be using GSS and NFSv4, the installation process 82 If you will not need the idmapper and gssd executables (you do not need
81 can be simplified by disabling these features when running configure: 83 these to create an NFS/RDMA enabled mount command), the installation
84 process can be simplified by disabling these features when running
85 configure:
82 86
83 > ./configure --disable-gss --disable-nfsv4 87 $ ./configure --disable-gss --disable-nfsv4
84 88
85 For more information on this see the package's README and INSTALL files. 89 To build nfs-utils you will need the tcp_wrappers package installed. For
90 more information on this see the package's README and INSTALL files.
86 91
87 After building the nfs-utils package, there will be a mount.nfs binary in 92 After building the nfs-utils package, there will be a mount.nfs binary in
88 the utils/mount directory. This binary can be used to initiate NFS v2, v3, 93 the utils/mount directory. This binary can be used to initiate NFS v2, v3,
89 or v4 mounts. To initiate a v4 mount, the binary must be called mount.nfs4. 94 or v4 mounts. To initiate a v4 mount, the binary must be called
90 The standard technique is to create a symlink called mount.nfs4 to mount.nfs. 95 mount.nfs4. The standard technique is to create a symlink called
96 mount.nfs4 to mount.nfs.
91 97
92 NOTE: mount.nfs and therefore nfs-utils-1.1.1 or greater is only needed 98 This mount.nfs binary should be installed at /sbin/mount.nfs as follows:
99
100 $ sudo cp utils/mount/mount.nfs /sbin/mount.nfs
101
102 In this location, mount.nfs will be invoked automatically for NFS mounts
103 by the system mount commmand.
104
105 NOTE: mount.nfs and therefore nfs-utils-1.1.2 or greater is only needed
93 on the NFS client machine. You do not need this specific version of 106 on the NFS client machine. You do not need this specific version of
94 nfs-utils on the server. Furthermore, only the mount.nfs command from 107 nfs-utils on the server. Furthermore, only the mount.nfs command from
95 nfs-utils-1.1.1 is needed on the client. 108 nfs-utils-1.1.2 is needed on the client.
96 109
97 - Install a Linux kernel with NFS/RDMA 110 - Install a Linux kernel with NFS/RDMA
98 111
@@ -156,8 +169,8 @@ Check RDMA and NFS Setup
156 this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel 169 this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel
157 card: 170 card:
158 171
159 > modprobe ib_mthca 172 $ modprobe ib_mthca
160 > modprobe ib_ipoib 173 $ modprobe ib_ipoib
161 174
162 If you are using InfiniBand, make sure there is a Subnet Manager (SM) 175 If you are using InfiniBand, make sure there is a Subnet Manager (SM)
163 running on the network. If your IB switch has an embedded SM, you can 176 running on the network. If your IB switch has an embedded SM, you can
@@ -166,7 +179,7 @@ Check RDMA and NFS Setup
166 179
167 If an SM is running on your network, you should see the following: 180 If an SM is running on your network, you should see the following:
168 181
169 > cat /sys/class/infiniband/driverX/ports/1/state 182 $ cat /sys/class/infiniband/driverX/ports/1/state
170 4: ACTIVE 183 4: ACTIVE
171 184
172 where driverX is mthca0, ipath5, ehca3, etc. 185 where driverX is mthca0, ipath5, ehca3, etc.
@@ -174,10 +187,10 @@ Check RDMA and NFS Setup
174 To further test the InfiniBand software stack, use IPoIB (this 187 To further test the InfiniBand software stack, use IPoIB (this
175 assumes you have two IB hosts named host1 and host2): 188 assumes you have two IB hosts named host1 and host2):
176 189
177 host1> ifconfig ib0 a.b.c.x 190 host1$ ifconfig ib0 a.b.c.x
178 host2> ifconfig ib0 a.b.c.y 191 host2$ ifconfig ib0 a.b.c.y
179 host1> ping a.b.c.y 192 host1$ ping a.b.c.y
180 host2> ping a.b.c.x 193 host2$ ping a.b.c.x
181 194
182 For other device types, follow the appropriate procedures. 195 For other device types, follow the appropriate procedures.
183 196
@@ -202,11 +215,11 @@ NFS/RDMA Setup
202 /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash) 215 /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash)
203 /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash) 216 /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash)
204 217
205 The IP address(es) is(are) the client's IPoIB address for an InfiniBand HCA or the 218 The IP address(es) is(are) the client's IPoIB address for an InfiniBand
206 cleint's iWARP address(es) for an RNIC. 219 HCA or the cleint's iWARP address(es) for an RNIC.
207 220
208 NOTE: The "insecure" option must be used because the NFS/RDMA client does not 221 NOTE: The "insecure" option must be used because the NFS/RDMA client does
209 use a reserved port. 222 not use a reserved port.
210 223
211 Each time a machine boots: 224 Each time a machine boots:
212 225
@@ -214,43 +227,45 @@ NFS/RDMA Setup
214 227
215 For InfiniBand using a Mellanox adapter: 228 For InfiniBand using a Mellanox adapter:
216 229
217 > modprobe ib_mthca 230 $ modprobe ib_mthca
218 > modprobe ib_ipoib 231 $ modprobe ib_ipoib
219 > ifconfig ib0 a.b.c.d 232 $ ifconfig ib0 a.b.c.d
220 233
221 NOTE: use unique addresses for the client and server 234 NOTE: use unique addresses for the client and server
222 235
223 - Start the NFS server 236 - Start the NFS server
224 237
225 If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config), 238 If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
226 load the RDMA transport module: 239 kernel config), load the RDMA transport module:
227 240
228 > modprobe svcrdma 241 $ modprobe svcrdma
229 242
230 Regardless of how the server was built (module or built-in), start the server: 243 Regardless of how the server was built (module or built-in), start the
244 server:
231 245
232 > /etc/init.d/nfs start 246 $ /etc/init.d/nfs start
233 247
234 or 248 or
235 249
236 > service nfs start 250 $ service nfs start
237 251
238 Instruct the server to listen on the RDMA transport: 252 Instruct the server to listen on the RDMA transport:
239 253
240 > echo rdma 2050 > /proc/fs/nfsd/portlist 254 $ echo rdma 2050 > /proc/fs/nfsd/portlist
241 255
242 - On the client system 256 - On the client system
243 257
244 If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in kernel config), 258 If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
245 load the RDMA client module: 259 kernel config), load the RDMA client module:
246 260
247 > modprobe xprtrdma.ko 261 $ modprobe xprtrdma.ko
248 262
249 Regardless of how the client was built (module or built-in), issue the mount.nfs command: 263 Regardless of how the client was built (module or built-in), use this
264 command to mount the NFS/RDMA server:
250 265
251 > /path/to/your/mount.nfs <IPoIB-server-name-or-address>:/<export> /mnt -i -o rdma,port=2050 266 $ mount -o rdma,port=2050 <IPoIB-server-name-or-address>:/<export> /mnt
252 267
253 To verify that the mount is using RDMA, run "cat /proc/mounts" and check the 268 To verify that the mount is using RDMA, run "cat /proc/mounts" and check
254 "proto" field for the given mount. 269 the "proto" field for the given mount.
255 270
256 Congratulations! You're using NFS/RDMA! 271 Congratulations! You're using NFS/RDMA!
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
index e79ee2db183a..ac2a261c5f7d 100644
--- a/Documentation/filesystems/ntfs.txt
+++ b/Documentation/filesystems/ntfs.txt
@@ -40,7 +40,7 @@ Web site
40======== 40========
41 41
42There is plenty of additional information on the linux-ntfs web site 42There is plenty of additional information on the linux-ntfs web site
43at http://linux-ntfs.sourceforge.net/ 43at http://www.linux-ntfs.org/
44 44
45The web site has a lot of additional information, such as a comprehensive 45The web site has a lot of additional information, such as a comprehensive
46FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS 46FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS
@@ -272,7 +272,7 @@ And you would know that /dev/hda2 has a size of 37768814 - 4209030 + 1 =
272For Win2k and later dynamic disks, you can for example use the ldminfo utility 272For Win2k and later dynamic disks, you can for example use the ldminfo utility
273which is part of the Linux LDM tools (the latest version at the time of 273which is part of the Linux LDM tools (the latest version at the time of
274writing is linux-ldm-0.0.8.tar.bz2). You can download it from: 274writing is linux-ldm-0.0.8.tar.bz2). You can download it from:
275 http://linux-ntfs.sourceforge.net/downloads.html 275 http://www.linux-ntfs.org/
276Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go 276Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go
277into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You 277into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You
278will find the precompiled (i386) ldminfo utility there. NOTE: You will not be 278will find the precompiled (i386) ldminfo utility there. NOTE: You will not be
diff --git a/Documentation/filesystems/omfs.txt b/Documentation/filesystems/omfs.txt
new file mode 100644
index 000000000000..1d0d41ff5c65
--- /dev/null
+++ b/Documentation/filesystems/omfs.txt
@@ -0,0 +1,106 @@
1Optimized MPEG Filesystem (OMFS)
2
3Overview
4========
5
6OMFS is a filesystem created by SonicBlue for use in the ReplayTV DVR
7and Rio Karma MP3 player. The filesystem is extent-based, utilizing
8block sizes from 2k to 8k, with hash-based directories. This
9filesystem driver may be used to read and write disks from these
10devices.
11
12Note, it is not recommended that this FS be used in place of a general
13filesystem for your own streaming media device. Native Linux filesystems
14will likely perform better.
15
16More information is available at:
17
18 http://linux-karma.sf.net/
19
20Various utilities, including mkomfs and omfsck, are included with
21omfsprogs, available at:
22
23 http://bobcopeland.com/karma/
24
25Instructions are included in its README.
26
27Options
28=======
29
30OMFS supports the following mount-time options:
31
32 uid=n - make all files owned by specified user
33 gid=n - make all files owned by specified group
34 umask=xxx - set permission umask to xxx
35 fmask=xxx - set umask to xxx for files
36 dmask=xxx - set umask to xxx for directories
37
38Disk format
39===========
40
41OMFS discriminates between "sysblocks" and normal data blocks. The sysblock
42group consists of super block information, file metadata, directory structures,
43and extents. Each sysblock has a header containing CRCs of the entire
44sysblock, and may be mirrored in successive blocks on the disk. A sysblock may
45have a smaller size than a data block, but since they are both addressed by the
46same 64-bit block number, any remaining space in the smaller sysblock is
47unused.
48
49Sysblock header information:
50
51struct omfs_header {
52 __be64 h_self; /* FS block where this is located */
53 __be32 h_body_size; /* size of useful data after header */
54 __be16 h_crc; /* crc-ccitt of body_size bytes */
55 char h_fill1[2];
56 u8 h_version; /* version, always 1 */
57 char h_type; /* OMFS_INODE_X */
58 u8 h_magic; /* OMFS_IMAGIC */
59 u8 h_check_xor; /* XOR of header bytes before this */
60 __be32 h_fill2;
61};
62
63Files and directories are both represented by omfs_inode:
64
65struct omfs_inode {
66 struct omfs_header i_head; /* header */
67 __be64 i_parent; /* parent containing this inode */
68 __be64 i_sibling; /* next inode in hash bucket */
69 __be64 i_ctime; /* ctime, in milliseconds */
70 char i_fill1[35];
71 char i_type; /* OMFS_[DIR,FILE] */
72 __be32 i_fill2;
73 char i_fill3[64];
74 char i_name[OMFS_NAMELEN]; /* filename */
75 __be64 i_size; /* size of file, in bytes */
76};
77
78Directories in OMFS are implemented as a large hash table. Filenames are
79hashed then prepended into the bucket list beginning at OMFS_DIR_START.
80Lookup requires hashing the filename, then seeking across i_sibling pointers
81until a match is found on i_name. Empty buckets are represented by block
82pointers with all-1s (~0).
83
84A file is an omfs_inode structure followed by an extent table beginning at
85OMFS_EXTENT_START:
86
87struct omfs_extent_entry {
88 __be64 e_cluster; /* start location of a set of blocks */
89 __be64 e_blocks; /* number of blocks after e_cluster */
90};
91
92struct omfs_extent {
93 __be64 e_next; /* next extent table location */
94 __be32 e_extent_count; /* total # extents in this table */
95 __be32 e_fill;
96 struct omfs_extent_entry e_entry; /* start of extent entries */
97};
98
99Each extent holds the block offset followed by number of blocks allocated to
100the extent. The final extent in each table is a terminator with e_cluster
101being ~0 and e_blocks being ones'-complement of the total number of blocks
102in the table.
103
104If this table overflows, a continuation inode is written and pointed to by
105e_next. These have a header but lack the rest of the inode structure.
106
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index dbc3c6a3650f..d831d24d2a6c 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -296,6 +296,7 @@ Table 1-4: Kernel info in /proc
296 uptime System uptime 296 uptime System uptime
297 version Kernel version 297 version Kernel version
298 video bttv info of video resources (2.4) 298 video bttv info of video resources (2.4)
299 vmallocinfo Show vmalloced areas
299.............................................................................. 300..............................................................................
300 301
301You can, for example, check which interrupts are currently in use and what 302You can, for example, check which interrupts are currently in use and what
@@ -380,28 +381,35 @@ i386 and x86_64 platforms support the new IRQ vector displays.
380Of some interest is the introduction of the /proc/irq directory to 2.4. 381Of some interest is the introduction of the /proc/irq directory to 2.4.
381It could be used to set IRQ to CPU affinity, this means that you can "hook" an 382It could be used to set IRQ to CPU affinity, this means that you can "hook" an
382IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the 383IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the
383irq subdir is one subdir for each IRQ, and one file; prof_cpu_mask 384irq subdir is one subdir for each IRQ, and two files; default_smp_affinity and
385prof_cpu_mask.
384 386
385For example 387For example
386 > ls /proc/irq/ 388 > ls /proc/irq/
387 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask 389 0 10 12 14 16 18 2 4 6 8 prof_cpu_mask
388 1 11 13 15 17 19 3 5 7 9 390 1 11 13 15 17 19 3 5 7 9 default_smp_affinity
389 > ls /proc/irq/0/ 391 > ls /proc/irq/0/
390 smp_affinity 392 smp_affinity
391 393
392The contents of the prof_cpu_mask file and each smp_affinity file for each IRQ 394smp_affinity is a bitmask, in which you can specify which CPUs can handle the
393is the same by default: 395IRQ, you can set it by doing:
394 396
395 > cat /proc/irq/0/smp_affinity 397 > echo 1 > /proc/irq/10/smp_affinity
396 ffffffff 398
399This means that only the first CPU will handle the IRQ, but you can also echo
4005 which means that only the first and fourth CPU can handle the IRQ.
397 401
398It's a bitmask, in which you can specify which CPUs can handle the IRQ, you can 402The contents of each smp_affinity file is the same by default:
399set it by doing:
400 403
401 > echo 1 > /proc/irq/prof_cpu_mask 404 > cat /proc/irq/0/smp_affinity
405 ffffffff
402 406
403This means that only the first CPU will handle the IRQ, but you can also echo 5 407The default_smp_affinity mask applies to all non-active IRQs, which are the
404which means that only the first and fourth CPU can handle the IRQ. 408IRQs which have not yet been allocated/activated, and hence which lack a
409/proc/irq/[0-9]* directory.
410
411prof_cpu_mask specifies which CPUs are to be profiled by the system wide
412profiler. Default value is ffffffff (all cpus).
405 413
406The way IRQs are routed is handled by the IO-APIC, and it's Round Robin 414The way IRQs are routed is handled by the IO-APIC, and it's Round Robin
407between all the CPUs which are allowed to handle it. As usual the kernel has 415between all the CPUs which are allowed to handle it. As usual the kernel has
@@ -550,6 +558,49 @@ VmallocTotal: total size of vmalloc memory area
550 VmallocUsed: amount of vmalloc area which is used 558 VmallocUsed: amount of vmalloc area which is used
551VmallocChunk: largest contigious block of vmalloc area which is free 559VmallocChunk: largest contigious block of vmalloc area which is free
552 560
561..............................................................................
562
563vmallocinfo:
564
565Provides information about vmalloced/vmaped areas. One line per area,
566containing the virtual address range of the area, size in bytes,
567caller information of the creator, and optional information depending
568on the kind of area :
569
570 pages=nr number of pages
571 phys=addr if a physical address was specified
572 ioremap I/O mapping (ioremap() and friends)
573 vmalloc vmalloc() area
574 vmap vmap()ed pages
575 user VM_USERMAP area
576 vpages buffer for pages pointers was vmalloced (huge area)
577 N<node>=nr (Only on NUMA kernels)
578 Number of pages allocated on memory node <node>
579
580> cat /proc/vmallocinfo
5810xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ...
582 /0x2c0 pages=512 vmalloc N0=128 N1=128 N2=128 N3=128
5830xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ...
584 /0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64 N3=64
5850xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f...
586 phys=7fee8000 ioremap
5870xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f...
588 phys=7fee7000 ioremap
5890xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210
5900xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ...
591 /0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3
5920xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ...
593 pages=2 vmalloc N1=2
5940xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ...
595 /0x130 [x_tables] pages=4 vmalloc N0=4
5960xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ...
597 pages=14 vmalloc N2=14
5980xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ...
599 pages=4 vmalloc N1=4
6000xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ...
601 pages=2 vmalloc N1=2
6020xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ...
603 pages=10 vmalloc N0=10
553 604
5541.3 IDE devices in /proc/ide 6051.3 IDE devices in /proc/ide
555---------------------------- 606----------------------------
@@ -872,45 +923,44 @@ CPUs.
872The "procs_blocked" line gives the number of processes currently blocked, 923The "procs_blocked" line gives the number of processes currently blocked,
873waiting for I/O to complete. 924waiting for I/O to complete.
874 925
926
8751.9 Ext4 file system parameters 9271.9 Ext4 file system parameters
876------------------------------ 928------------------------------
877Ext4 file system have one directory per partition under /proc/fs/ext4/
878# ls /proc/fs/ext4/hdc/
879group_prealloc max_to_scan mb_groups mb_history min_to_scan order2_req
880stats stream_req
881
882mb_groups:
883This file gives the details of mutiblock allocator buddy cache of free blocks
884
885mb_history:
886Multiblock allocation history.
887
888stats:
889This file indicate whether the multiblock allocator should start collecting
890statistics. The statistics are shown during unmount
891 929
892group_prealloc: 930Information about mounted ext4 file systems can be found in
893The multiblock allocator normalize the block allocation request to 931/proc/fs/ext4. Each mounted filesystem will have a directory in
894group_prealloc filesystem blocks if we don't have strip value set. 932/proc/fs/ext4 based on its device name (i.e., /proc/fs/ext4/hdc or
895The stripe value can be specified at mount time or during mke2fs. 933/proc/fs/ext4/dm-0). The files in each per-device directory are shown
934in Table 1-10, below.
896 935
897max_to_scan: 936Table 1-10: Files in /proc/fs/ext4/<devname>
898How long multiblock allocator can look for a best extent (in found extents) 937..............................................................................
899 938 File Content
900min_to_scan: 939 mb_groups details of multiblock allocator buddy cache of free blocks
901How long multiblock allocator must look for a best extent 940 mb_history multiblock allocation history
902 941 stats controls whether the multiblock allocator should start
903order2_req: 942 collecting statistics, which are shown during the unmount
904Multiblock allocator use 2^N search using buddies only for requests greater 943 group_prealloc the multiblock allocator will round up allocation
905than or equal to order2_req. The request size is specfied in file system 944 requests to a multiple of this tuning parameter if the
906blocks. A value of 2 indicate only if the requests are greater than or equal 945 stripe size is not set in the ext4 superblock
907to 4 blocks. 946 max_to_scan The maximum number of extents the multiblock allocator
947 will search to find the best extent
948 min_to_scan The minimum number of extents the multiblock allocator
949 will search to find the best extent
950 order2_req Tuning parameter which controls the minimum size for
951 requests (as a power of 2) where the buddy cache is
952 used
953 stream_req Files which have fewer blocks than this tunable
954 parameter will have their blocks allocated out of a
955 block group specific preallocation pool, so that small
956 files are packed closely together. Each large file
957 will have its blocks allocated out of its own unique
958 preallocation pool.
959inode_readahead Tuning parameter which controls the maximum number of
960 inode table blocks that ext4's inode table readahead
961 algorithm will pre-read into the buffer cache
962..............................................................................
908 963
909stream_req:
910Files smaller than stream_req are served by the stream allocator, whose
911purpose is to pack requests as close each to other as possible to
912produce smooth I/O traffic. Avalue of 16 indicate that file smaller than 16
913filesystem block size will use group based preallocation.
914 964
915------------------------------------------------------------------------------ 965------------------------------------------------------------------------------
916Summary 966Summary
@@ -1288,6 +1338,25 @@ Enables/Disables the protection of the per-process proc entries "maps" and
1288"smaps". When enabled, the contents of these files are visible only to 1338"smaps". When enabled, the contents of these files are visible only to
1289readers that are allowed to ptrace() the given process. 1339readers that are allowed to ptrace() the given process.
1290 1340
1341msgmni
1342------
1343
1344Maximum number of message queue ids on the system.
1345This value scales to the amount of lowmem. It is automatically recomputed
1346upon memory add/remove or ipc namespace creation/removal.
1347When a value is written into this file, msgmni's value becomes fixed, i.e. it
1348is not recomputed anymore when one of the above events occurs.
1349Use auto_msgmni to change this behavior.
1350
1351auto_msgmni
1352-----------
1353
1354Enables/Disables automatic recomputing of msgmni upon memory add/remove or
1355upon ipc namespace creation/removal (see the msgmni description above).
1356Echoing "1" into this file enables msgmni automatic recomputing.
1357Echoing "0" turns it off.
1358auto_msgmni default value is 1.
1359
1291 1360
12922.4 /proc/sys/vm - The virtual memory subsystem 13612.4 /proc/sys/vm - The virtual memory subsystem
1293----------------------------------------------- 1362-----------------------------------------------
@@ -1423,7 +1492,7 @@ used because pages_free(1355) is smaller than watermark + protection[2]
1423normal page requirement. If requirement is DMA zone(index=0), protection[0] 1492normal page requirement. If requirement is DMA zone(index=0), protection[0]
1424(=0) is used. 1493(=0) is used.
1425 1494
1426zone[i]'s protection[j] is calculated by following exprssion. 1495zone[i]'s protection[j] is calculated by following expression.
1427 1496
1428(i < j): 1497(i < j):
1429 zone[i]->protection[j] 1498 zone[i]->protection[j]
@@ -2343,6 +2412,8 @@ The following 4 memory types are supported:
2343 - (bit 1) anonymous shared memory 2412 - (bit 1) anonymous shared memory
2344 - (bit 2) file-backed private memory 2413 - (bit 2) file-backed private memory
2345 - (bit 3) file-backed shared memory 2414 - (bit 3) file-backed shared memory
2415 - (bit 4) ELF header pages in file-backed private memory areas (it is
2416 effective only if the bit 2 is cleared)
2346 2417
2347 Note that MMIO pages such as frame buffer are never dumped and vDSO pages 2418 Note that MMIO pages such as frame buffer are never dumped and vDSO pages
2348 are always dumped regardless of the bitmask status. 2419 are always dumped regardless of the bitmask status.
diff --git a/Documentation/filesystems/quota.txt b/Documentation/filesystems/quota.txt
index a590c4093eff..5e8de25bf0f1 100644
--- a/Documentation/filesystems/quota.txt
+++ b/Documentation/filesystems/quota.txt
@@ -3,14 +3,14 @@ Quota subsystem
3=============== 3===============
4 4
5Quota subsystem allows system administrator to set limits on used space and 5Quota subsystem allows system administrator to set limits on used space and
6number of used inodes (inode is a filesystem structure which is associated 6number of used inodes (inode is a filesystem structure which is associated with
7with each file or directory) for users and/or groups. For both used space and 7each file or directory) for users and/or groups. For both used space and number
8number of used inodes there are actually two limits. The first one is called 8of used inodes there are actually two limits. The first one is called softlimit
9softlimit and the second one hardlimit. An user can never exceed a hardlimit 9and the second one hardlimit. An user can never exceed a hardlimit for any
10for any resource. User is allowed to exceed softlimit but only for limited 10resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed
11period of time. This period is called "grace period" or "grace time". When 11softlimit but only for limited period of time. This period is called "grace
12grace time is over, user is not able to allocate more space/inodes until he 12period" or "grace time". When grace time is over, user is not able to allocate
13frees enough of them to get below softlimit. 13more space/inodes until he frees enough of them to get below softlimit.
14 14
15Quota limits (and amount of grace time) are set independently for each 15Quota limits (and amount of grace time) are set independently for each
16filesystem. 16filesystem.
@@ -53,6 +53,12 @@ in parentheses):
53 QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded 53 QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded
54 longer than given grace period. 54 longer than given grace period.
55 QUOTA_NL_BSOFTWARN - space (block) softlimit 55 QUOTA_NL_BSOFTWARN - space (block) softlimit
56 - four warnings are also defined for the event when user stops
57 exceeding some limit:
58 QUOTA_NL_IHARDBELOW - inode hardlimit
59 QUOTA_NL_ISOFTBELOW - inode softlimit
60 QUOTA_NL_BHARDBELOW - space (block) hardlimit
61 QUOTA_NL_BSOFTBELOW - space (block) softlimit
56 QUOTA_NL_A_DEV_MAJOR (u32) 62 QUOTA_NL_A_DEV_MAJOR (u32)
57 - major number of a device with the affected filesystem 63 - major number of a device with the affected filesystem
58 QUOTA_NL_A_DEV_MINOR (u32) 64 QUOTA_NL_A_DEV_MINOR (u32)
diff --git a/Documentation/filesystems/relay.txt b/Documentation/filesystems/relay.txt
index 094f2d2f38b1..510b722667ac 100644
--- a/Documentation/filesystems/relay.txt
+++ b/Documentation/filesystems/relay.txt
@@ -294,6 +294,16 @@ user-defined data with a channel, and is immediately available
294(including in create_buf_file()) via chan->private_data or 294(including in create_buf_file()) via chan->private_data or
295buf->chan->private_data. 295buf->chan->private_data.
296 296
297Buffer-only channels
298--------------------
299
300These channels have no files associated and can be created with
301relay_open(NULL, NULL, ...). Such channels are useful in scenarios such
302as when doing early tracing in the kernel, before the VFS is up. In these
303cases, one may open a buffer-only channel and then call
304relay_late_setup_files() when the kernel is ready to handle files,
305to expose the buffered data to the userspace.
306
297Channel 'modes' 307Channel 'modes'
298--------------- 308---------------
299 309
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 7f27b8f840d0..9e9c348275a9 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -248,6 +248,7 @@ The top level sysfs directory looks like:
248block/ 248block/
249bus/ 249bus/
250class/ 250class/
251dev/
251devices/ 252devices/
252firmware/ 253firmware/
253net/ 254net/
@@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each
274filesystem wanting to export attributes must create its own hierarchy 275filesystem wanting to export attributes must create its own hierarchy
275below fs/ (see ./fuse.txt for an example). 276below fs/ (see ./fuse.txt for an example).
276 277
278dev/ contains two directories char/ and block/. Inside these two
279directories there are symlinks named <major>:<minor>. These symlinks
280point to the sysfs directory for the given device. /sys/dev provides a
281quick way to lookup the sysfs interface for a device from the result of
282a stat(2) operation.
277 283
278More information can driver-model specific features can be found in 284More information can driver-model specific features can be found in
279Documentation/driver-model/. 285Documentation/driver-model/.
diff --git a/Documentation/filesystems/ubifs.txt b/Documentation/filesystems/ubifs.txt
new file mode 100644
index 000000000000..6a0d70a22f05
--- /dev/null
+++ b/Documentation/filesystems/ubifs.txt
@@ -0,0 +1,164 @@
1Introduction
2=============
3
4UBIFS file-system stands for UBI File System. UBI stands for "Unsorted
5Block Images". UBIFS is a flash file system, which means it is designed
6to work with flash devices. It is important to understand, that UBIFS
7is completely different to any traditional file-system in Linux, like
8Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems
9which work with MTD devices, not block devices. The other Linux
10file-system of this class is JFFS2.
11
12To make it more clear, here is a small comparison of MTD devices and
13block devices.
14
151 MTD devices represent flash devices and they consist of eraseblocks of
16 rather large size, typically about 128KiB. Block devices consist of
17 small blocks, typically 512 bytes.
182 MTD devices support 3 main operations - read from some offset within an
19 eraseblock, write to some offset within an eraseblock, and erase a whole
20 eraseblock. Block devices support 2 main operations - read a whole
21 block and write a whole block.
223 The whole eraseblock has to be erased before it becomes possible to
23 re-write its contents. Blocks may be just re-written.
244 Eraseblocks become worn out after some number of erase cycles -
25 typically 100K-1G for SLC NAND and NOR flashes, and 1K-10K for MLC
26 NAND flashes. Blocks do not have the wear-out property.
275 Eraseblocks may become bad (only on NAND flashes) and software should
28 deal with this. Blocks on hard drives typically do not become bad,
29 because hardware has mechanisms to substitute bad blocks, at least in
30 modern LBA disks.
31
32It should be quite obvious why UBIFS is very different to traditional
33file-systems.
34
35UBIFS works on top of UBI. UBI is a separate software layer which may be
36found in drivers/mtd/ubi. UBI is basically a volume management and
37wear-leveling layer. It provides so called UBI volumes which is a higher
38level abstraction than a MTD device. The programming model of UBI devices
39is very similar to MTD devices - they still consist of large eraseblocks,
40they have read/write/erase operations, but UBI devices are devoid of
41limitations like wear and bad blocks (items 4 and 5 in the above list).
42
43In a sense, UBIFS is a next generation of JFFS2 file-system, but it is
44very different and incompatible to JFFS2. The following are the main
45differences.
46
47* JFFS2 works on top of MTD devices, UBIFS depends on UBI and works on
48 top of UBI volumes.
49* JFFS2 does not have on-media index and has to build it while mounting,
50 which requires full media scan. UBIFS maintains the FS indexing
51 information on the flash media and does not require full media scan,
52 so it mounts many times faster than JFFS2.
53* JFFS2 is a write-through file-system, while UBIFS supports write-back,
54 which makes UBIFS much faster on writes.
55
56Similarly to JFFS2, UBIFS supports on-the-flight compression which makes
57it possible to fit quite a lot of data to the flash.
58
59Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
60It does not need stuff like fsck.ext2. UBIFS automatically replays its
61journal and recovers from crashes, ensuring that the on-flash data
62structures are consistent.
63
64UBIFS scales logarithmically (most of the data structures it uses are
65trees), so the mount time and memory consumption do not linearly depend
66on the flash size, like in case of JFFS2. This is because UBIFS
67maintains the FS index on the flash media. However, UBIFS depends on
68UBI, which scales linearly. So overall UBI/UBIFS stack scales linearly.
69Nevertheless, UBI/UBIFS scales considerably better than JFFS2.
70
71The authors of UBIFS believe, that it is possible to develop UBI2 which
72would scale logarithmically as well. UBI2 would support the same API as UBI,
73but it would be binary incompatible to UBI. So UBIFS would not need to be
74changed to use UBI2
75
76
77Mount options
78=============
79
80(*) == default.
81
82norm_unmount (*) commit on unmount; the journal is committed
83 when the file-system is unmounted so that the
84 next mount does not have to replay the journal
85 and it becomes very fast;
86fast_unmount do not commit on unmount; this option makes
87 unmount faster, but the next mount slower
88 because of the need to replay the journal.
89
90
91Quick usage instructions
92========================
93
94The UBI volume to mount is specified using "ubiX_Y" or "ubiX:NAME" syntax,
95where "X" is UBI device number, "Y" is UBI volume number, and "NAME" is
96UBI volume name.
97
98Mount volume 0 on UBI device 0 to /mnt/ubifs:
99$ mount -t ubifs ubi0_0 /mnt/ubifs
100
101Mount "rootfs" volume of UBI device 0 to /mnt/ubifs ("rootfs" is volume
102name):
103$ mount -t ubifs ubi0:rootfs /mnt/ubifs
104
105The following is an example of the kernel boot arguments to attach mtd0
106to UBI and mount volume "rootfs":
107ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs
108
109
110Module Parameters for Debugging
111===============================
112
113When UBIFS has been compiled with debugging enabled, there are 3 module
114parameters that are available to control aspects of testing and debugging.
115The parameters are unsigned integers where each bit controls an option.
116The parameters are:
117
118debug_msgs Selects which debug messages to display, as follows:
119
120 Message Type Flag value
121
122 General messages 1
123 Journal messages 2
124 Mount messages 4
125 Commit messages 8
126 LEB search messages 16
127 Budgeting messages 32
128 Garbage collection messages 64
129 Tree Node Cache (TNC) messages 128
130 LEB properties (lprops) messages 256
131 Input/output messages 512
132 Log messages 1024
133 Scan messages 2048
134 Recovery messages 4096
135
136debug_chks Selects extra checks that UBIFS can do while running:
137
138 Check Flag value
139
140 General checks 1
141 Check Tree Node Cache (TNC) 2
142 Check indexing tree size 4
143 Check orphan area 8
144 Check old indexing tree 16
145 Check LEB properties (lprops) 32
146 Check leaf nodes and inodes 64
147
148debug_tsts Selects a mode of testing, as follows:
149
150 Test mode Flag value
151
152 Force in-the-gaps method 2
153 Failure mode for recovery testing 4
154
155For example, set debug_msgs to 5 to display General messages and Mount
156messages.
157
158
159References
160==========
161
162UBIFS documentation and FAQ/HOWTO at the MTD web site:
163http://www.linux-mtd.infradead.org/doc/ubifs.html
164http://www.linux-mtd.infradead.org/faq/ubifs.html
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index 2d5e1e582e13..bbac4f1d9056 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -96,6 +96,14 @@ shortname=lower|win95|winnt|mixed
96 emulate the Windows 95 rule for create. 96 emulate the Windows 95 rule for create.
97 Default setting is `lower'. 97 Default setting is `lower'.
98 98
99tz=UTC -- Interpret timestamps as UTC rather than local time.
100 This option disables the conversion of timestamps
101 between local time (as used by Windows on FAT) and UTC
102 (which Linux uses internally). This is particuluarly
103 useful when mounting devices (like digital cameras)
104 that are set to UTC in order to avoid the pitfalls of
105 local time.
106
99<bool>: 0,1,yes,no,true,false 107<bool>: 0,1,yes,no,true,false
100 108
101TODO 109TODO
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index b7522c6cbae3..c4d348dabe94 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -143,7 +143,7 @@ struct file_system_type {
143 143
144The get_sb() method has the following arguments: 144The get_sb() method has the following arguments:
145 145
146 struct file_system_type *fs_type: decribes the filesystem, partly initialized 146 struct file_system_type *fs_type: describes the filesystem, partly initialized
147 by the specific filesystem code 147 by the specific filesystem code
148 148
149 int flags: mount flags 149 int flags: mount flags
@@ -895,9 +895,9 @@ struct dentry_operations {
895 iput() yourself 895 iput() yourself
896 896
897 d_dname: called when the pathname of a dentry should be generated. 897 d_dname: called when the pathname of a dentry should be generated.
898 Usefull for some pseudo filesystems (sockfs, pipefs, ...) to delay 898 Useful for some pseudo filesystems (sockfs, pipefs, ...) to delay
899 pathname generation. (Instead of doing it when dentry is created, 899 pathname generation. (Instead of doing it when dentry is created,
900 its done only when the path is needed.). Real filesystems probably 900 it's done only when the path is needed.). Real filesystems probably
901 dont want to use it, because their dentries are present in global 901 dont want to use it, because their dentries are present in global
902 dcache hash, so their hash should be an invariant. As no lock is 902 dcache hash, so their hash should be an invariant. As no lock is
903 held, d_dname() should not try to modify the dentry itself, unless 903 held, d_dname() should not try to modify the dentry itself, unless
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
new file mode 100644
index 000000000000..d330fe3103da
--- /dev/null
+++ b/Documentation/ftrace.txt
@@ -0,0 +1,1361 @@
1 ftrace - Function Tracer
2 ========================
3
4Copyright 2008 Red Hat Inc.
5 Author: Steven Rostedt <srostedt@redhat.com>
6 License: The GNU Free Documentation License, Version 1.2
7 (dual licensed under the GPL v2)
8Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton,
9 John Kacur, and David Teigland.
10
11Written for: 2.6.27-rc1
12
13Introduction
14------------
15
16Ftrace is an internal tracer designed to help out developers and
17designers of systems to find what is going on inside the kernel.
18It can be used for debugging or analyzing latencies and performance
19issues that take place outside of user-space.
20
21Although ftrace is the function tracer, it also includes an
22infrastructure that allows for other types of tracing. Some of the
23tracers that are currently in ftrace include a tracer to trace
24context switches, the time it takes for a high priority task to
25run after it was woken up, the time interrupts are disabled, and
26more (ftrace allows for tracer plugins, which means that the list of
27tracers can always grow).
28
29
30The File System
31---------------
32
33Ftrace uses the debugfs file system to hold the control files as well
34as the files to display output.
35
36To mount the debugfs system:
37
38 # mkdir /debug
39 # mount -t debugfs nodev /debug
40
41(Note: it is more common to mount at /sys/kernel/debug, but for simplicity
42 this document will use /debug)
43
44That's it! (assuming that you have ftrace configured into your kernel)
45
46After mounting the debugfs, you can see a directory called
47"tracing". This directory contains the control and output files
48of ftrace. Here is a list of some of the key files:
49
50
51 Note: all time values are in microseconds.
52
53 current_tracer : This is used to set or display the current tracer
54 that is configured.
55
56 available_tracers : This holds the different types of tracers that
57 have been compiled into the kernel. The tracers
58 listed here can be configured by echoing their name
59 into current_tracer.
60
61 tracing_enabled : This sets or displays whether the current_tracer
62 is activated and tracing or not. Echo 0 into this
63 file to disable the tracer or 1 to enable it.
64
65 trace : This file holds the output of the trace in a human readable
66 format (described below).
67
68 latency_trace : This file shows the same trace but the information
69 is organized more to display possible latencies
70 in the system (described below).
71
72 trace_pipe : The output is the same as the "trace" file but this
73 file is meant to be streamed with live tracing.
74 Reads from this file will block until new data
75 is retrieved. Unlike the "trace" and "latency_trace"
76 files, this file is a consumer. This means reading
77 from this file causes sequential reads to display
78 more current data. Once data is read from this
79 file, it is consumed, and will not be read
80 again with a sequential read. The "trace" and
81 "latency_trace" files are static, and if the
82 tracer is not adding more data, they will display
83 the same information every time they are read.
84
85 iter_ctrl : This file lets the user control the amount of data
86 that is displayed in one of the above output
87 files.
88
89 trace_max_latency : Some of the tracers record the max latency.
90 For example, the time interrupts are disabled.
91 This time is saved in this file. The max trace
92 will also be stored, and displayed by either
93 "trace" or "latency_trace". A new max trace will
94 only be recorded if the latency is greater than
95 the value in this file. (in microseconds)
96
97 trace_entries : This sets or displays the number of trace
98 entries each CPU buffer can hold. The tracer buffers
99 are the same size for each CPU. The displayed number
100 is the size of the CPU buffer and not total size. The
101 trace buffers are allocated in pages (blocks of memory
102 that the kernel uses for allocation, usually 4 KB in size).
103 Since each entry is smaller than a page, if the last
104 allocated page has room for more entries than were
105 requested, the rest of the page is used to allocate
106 entries.
107
108 This can only be updated when the current_tracer
109 is set to "none".
110
111 NOTE: It is planned on changing the allocated buffers
112 from being the number of possible CPUS to
113 the number of online CPUS.
114
115 tracing_cpumask : This is a mask that lets the user only trace
116 on specified CPUS. The format is a hex string
117 representing the CPUS.
118
119 set_ftrace_filter : When dynamic ftrace is configured in (see the
120 section below "dynamic ftrace"), the code is dynamically
121 modified (code text rewrite) to disable calling of the
122 function profiler (mcount). This lets tracing be configured
123 in with practically no overhead in performance. This also
124 has a side effect of enabling or disabling specific functions
125 to be traced. Echoing names of functions into this file
126 will limit the trace to only those functions.
127
128 set_ftrace_notrace: This has an effect opposite to that of
129 set_ftrace_filter. Any function that is added here will not
130 be traced. If a function exists in both set_ftrace_filter
131 and set_ftrace_notrace, the function will _not_ be traced.
132
133 available_filter_functions : When a function is encountered the first
134 time by the dynamic tracer, it is recorded and
135 later the call is converted into a nop. This file
136 lists the functions that have been recorded
137 by the dynamic tracer and these functions can
138 be used to set the ftrace filter by the above
139 "set_ftrace_filter" file. (See the section "dynamic ftrace"
140 below for more details).
141
142
143The Tracers
144-----------
145
146Here is the list of current tracers that may be configured.
147
148 ftrace - function tracer that uses mcount to trace all functions.
149
150 sched_switch - traces the context switches between tasks.
151
152 irqsoff - traces the areas that disable interrupts and saves
153 the trace with the longest max latency.
154 See tracing_max_latency. When a new max is recorded,
155 it replaces the old trace. It is best to view this
156 trace via the latency_trace file.
157
158 preemptoff - Similar to irqsoff but traces and records the amount of
159 time for which preemption is disabled.
160
161 preemptirqsoff - Similar to irqsoff and preemptoff, but traces and
162 records the largest time for which irqs and/or preemption
163 is disabled.
164
165 wakeup - Traces and records the max latency that it takes for
166 the highest priority task to get scheduled after
167 it has been woken up.
168
169 none - This is not a tracer. To remove all tracers from tracing
170 simply echo "none" into current_tracer.
171
172
173Examples of using the tracer
174----------------------------
175
176Here are typical examples of using the tracers when controlling them only
177with the debugfs interface (without using any user-land utilities).
178
179Output format:
180--------------
181
182Here is an example of the output format of the file "trace"
183
184 --------
185# tracer: ftrace
186#
187# TASK-PID CPU# TIMESTAMP FUNCTION
188# | | | | |
189 bash-4251 [01] 10152.583854: path_put <-path_walk
190 bash-4251 [01] 10152.583855: dput <-path_put
191 bash-4251 [01] 10152.583855: _atomic_dec_and_lock <-dput
192 --------
193
194A header is printed with the tracer name that is represented by the trace.
195In this case the tracer is "ftrace". Then a header showing the format. Task
196name "bash", the task PID "4251", the CPU that it was running on
197"01", the timestamp in <secs>.<usecs> format, the function name that was
198traced "path_put" and the parent function that called this function
199"path_walk". The timestamp is the time at which the function was
200entered.
201
202The sched_switch tracer also includes tracing of task wakeups and
203context switches.
204
205 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S
206 ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S
207 ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R
208 events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R
209 kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R
210 ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R
211
212Wake ups are represented by a "+" and the context switches are shown as
213"==>". The format is:
214
215 Context switches:
216
217 Previous task Next Task
218
219 <pid>:<prio>:<state> ==> <pid>:<prio>:<state>
220
221 Wake ups:
222
223 Current task Task waking up
224
225 <pid>:<prio>:<state> + <pid>:<prio>:<state>
226
227The prio is the internal kernel priority, which is the inverse of the
228priority that is usually displayed by user-space tools. Zero represents
229the highest priority (99). Prio 100 starts the "nice" priorities with
230100 being equal to nice -20 and 139 being nice 19. The prio "140" is
231reserved for the idle task which is the lowest priority thread (pid 0).
232
233
234Latency trace format
235--------------------
236
237For traces that display latency times, the latency_trace file gives
238somewhat more information to see why a latency happened. Here is a typical
239trace.
240
241# tracer: irqsoff
242#
243irqsoff latency trace v1.1.5 on 2.6.26-rc8
244--------------------------------------------------------------------
245 latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
246 -----------------
247 | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
248 -----------------
249 => started at: apic_timer_interrupt
250 => ended at: do_softirq
251
252# _------=> CPU#
253# / _-----=> irqs-off
254# | / _----=> need-resched
255# || / _---=> hardirq/softirq
256# ||| / _--=> preempt-depth
257# |||| /
258# ||||| delay
259# cmd pid ||||| time | caller
260# \ / ||||| \ | /
261 <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt)
262 <idle>-0 0d.s. 97us : __do_softirq (do_softirq)
263 <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq)
264
265
266
267This shows that the current tracer is "irqsoff" tracing the time for which
268interrupts were disabled. It gives the trace version and the version
269of the kernel upon which this was executed on (2.6.26-rc8). Then it displays
270the max latency in microsecs (97 us). The number of trace entries displayed
271and the total number recorded (both are three: #3/3). The type of
272preemption that was used (PREEMPT). VP, KP, SP, and HP are always zero
273and are reserved for later use. #P is the number of online CPUS (#P:2).
274
275The task is the process that was running when the latency occurred.
276(swapper pid: 0).
277
278The start and stop (the functions in which the interrupts were disabled and
279enabled respectively) that caused the latencies:
280
281 apic_timer_interrupt is where the interrupts were disabled.
282 do_softirq is where they were enabled again.
283
284The next lines after the header are the trace itself. The header
285explains which is which.
286
287 cmd: The name of the process in the trace.
288
289 pid: The PID of that process.
290
291 CPU#: The CPU which the process was running on.
292
293 irqs-off: 'd' interrupts are disabled. '.' otherwise.
294
295 need-resched: 'N' task need_resched is set, '.' otherwise.
296
297 hardirq/softirq:
298 'H' - hard irq occurred inside a softirq.
299 'h' - hard irq is running
300 's' - soft irq is running
301 '.' - normal context.
302
303 preempt-depth: The level of preempt_disabled
304
305The above is mostly meaningful for kernel developers.
306
307 time: This differs from the trace file output. The trace file output
308 includes an absolute timestamp. The timestamp used by the
309 latency_trace file is relative to the start of the trace.
310
311 delay: This is just to help catch your eye a bit better. And
312 needs to be fixed to be only relative to the same CPU.
313 The marks are determined by the difference between this
314 current trace and the next trace.
315 '!' - greater than preempt_mark_thresh (default 100)
316 '+' - greater than 1 microsecond
317 ' ' - less than or equal to 1 microsecond.
318
319 The rest is the same as the 'trace' file.
320
321
322iter_ctrl
323---------
324
325The iter_ctrl file is used to control what gets printed in the trace
326output. To see what is available, simply cat the file:
327
328 cat /debug/tracing/iter_ctrl
329 print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \
330 noblock nostacktrace nosched-tree
331
332To disable one of the options, echo in the option prepended with "no".
333
334 echo noprint-parent > /debug/tracing/iter_ctrl
335
336To enable an option, leave off the "no".
337
338 echo sym-offset > /debug/tracing/iter_ctrl
339
340Here are the available options:
341
342 print-parent - On function traces, display the calling function
343 as well as the function being traced.
344
345 print-parent:
346 bash-4000 [01] 1477.606694: simple_strtoul <-strict_strtoul
347
348 noprint-parent:
349 bash-4000 [01] 1477.606694: simple_strtoul
350
351
352 sym-offset - Display not only the function name, but also the offset
353 in the function. For example, instead of seeing just
354 "ktime_get", you will see "ktime_get+0xb/0x20".
355
356 sym-offset:
357 bash-4000 [01] 1477.606694: simple_strtoul+0x6/0xa0
358
359 sym-addr - this will also display the function address as well as
360 the function name.
361
362 sym-addr:
363 bash-4000 [01] 1477.606694: simple_strtoul <c0339346>
364
365 verbose - This deals with the latency_trace file.
366
367 bash 4000 1 0 00000000 00010a95 [58127d26] 1720.415ms \
368 (+0.000ms): simple_strtoul (strict_strtoul)
369
370 raw - This will display raw numbers. This option is best for use with
371 user applications that can translate the raw numbers better than
372 having it done in the kernel.
373
374 hex - Similar to raw, but the numbers will be in a hexadecimal format.
375
376 bin - This will print out the formats in raw binary.
377
378 block - TBD (needs update)
379
380 stacktrace - This is one of the options that changes the trace itself.
381 When a trace is recorded, so is the stack of functions.
382 This allows for back traces of trace sites.
383
384 sched-tree - TBD (any users??)
385
386
387sched_switch
388------------
389
390This tracer simply records schedule switches. Here is an example
391of how to use it.
392
393 # echo sched_switch > /debug/tracing/current_tracer
394 # echo 1 > /debug/tracing/tracing_enabled
395 # sleep 1
396 # echo 0 > /debug/tracing/tracing_enabled
397 # cat /debug/tracing/trace
398
399# tracer: sched_switch
400#
401# TASK-PID CPU# TIMESTAMP FUNCTION
402# | | | | |
403 bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R
404 bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R
405 sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R
406 bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S
407 bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R
408 sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R
409 bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D
410 bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R
411 <idle>-0 [00] 240.132589: 0:140:R + 4:115:S
412 <idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R
413 ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R
414 <idle>-0 [00] 240.132598: 0:140:R + 4:115:S
415 <idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R
416 ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R
417 sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R
418 [...]
419
420
421As we have discussed previously about this format, the header shows
422the name of the trace and points to the options. The "FUNCTION"
423is a misnomer since here it represents the wake ups and context
424switches.
425
426The sched_switch file only lists the wake ups (represented with '+')
427and context switches ('==>') with the previous task or current task
428first followed by the next task or task waking up. The format for both
429of these is PID:KERNEL-PRIO:TASK-STATE. Remember that the KERNEL-PRIO
430is the inverse of the actual priority with zero (0) being the highest
431priority and the nice values starting at 100 (nice -20). Below is
432a quick chart to map the kernel priority to user land priorities.
433
434 Kernel priority: 0 to 99 ==> user RT priority 99 to 0
435 Kernel priority: 100 to 139 ==> user nice -20 to 19
436 Kernel priority: 140 ==> idle task priority
437
438The task states are:
439
440 R - running : wants to run, may not actually be running
441 S - sleep : process is waiting to be woken up (handles signals)
442 D - disk sleep (uninterruptible sleep) : process must be woken up
443 (ignores signals)
444 T - stopped : process suspended
445 t - traced : process is being traced (with something like gdb)
446 Z - zombie : process waiting to be cleaned up
447 X - unknown
448
449
450ftrace_enabled
451--------------
452
453The following tracers (listed below) give different output depending
454on whether or not the sysctl ftrace_enabled is set. To set ftrace_enabled,
455one can either use the sysctl function or set it via the proc
456file system interface.
457
458 sysctl kernel.ftrace_enabled=1
459
460 or
461
462 echo 1 > /proc/sys/kernel/ftrace_enabled
463
464To disable ftrace_enabled simply replace the '1' with '0' in
465the above commands.
466
467When ftrace_enabled is set the tracers will also record the functions
468that are within the trace. The descriptions of the tracers
469will also show an example with ftrace enabled.
470
471
472irqsoff
473-------
474
475When interrupts are disabled, the CPU can not react to any other
476external event (besides NMIs and SMIs). This prevents the timer
477interrupt from triggering or the mouse interrupt from letting the
478kernel know of a new mouse event. The result is a latency with the
479reaction time.
480
481The irqsoff tracer tracks the time for which interrupts are disabled.
482When a new maximum latency is hit, the tracer saves the trace leading up
483to that latency point so that every time a new maximum is reached, the old
484saved trace is discarded and the new trace is saved.
485
486To reset the maximum, echo 0 into tracing_max_latency. Here is an
487example:
488
489 # echo irqsoff > /debug/tracing/current_tracer
490 # echo 0 > /debug/tracing/tracing_max_latency
491 # echo 1 > /debug/tracing/tracing_enabled
492 # ls -ltr
493 [...]
494 # echo 0 > /debug/tracing/tracing_enabled
495 # cat /debug/tracing/latency_trace
496# tracer: irqsoff
497#
498irqsoff latency trace v1.1.5 on 2.6.26
499--------------------------------------------------------------------
500 latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
501 -----------------
502 | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0)
503 -----------------
504 => started at: sys_setpgid
505 => ended at: sys_setpgid
506
507# _------=> CPU#
508# / _-----=> irqs-off
509# | / _----=> need-resched
510# || / _---=> hardirq/softirq
511# ||| / _--=> preempt-depth
512# |||| /
513# ||||| delay
514# cmd pid ||||| time | caller
515# \ / ||||| \ | /
516 bash-3730 1d... 0us : _write_lock_irq (sys_setpgid)
517 bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid)
518 bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid)
519
520
521Here we see that that we had a latency of 12 microsecs (which is
522very good). The _write_lock_irq in sys_setpgid disabled interrupts.
523The difference between the 12 and the displayed timestamp 14us occurred
524because the clock was incremented between the time of recording the max
525latency and the time of recording the function that had that latency.
526
527Note the above example had ftrace_enabled not set. If we set the
528ftrace_enabled, we get a much larger output:
529
530# tracer: irqsoff
531#
532irqsoff latency trace v1.1.5 on 2.6.26-rc8
533--------------------------------------------------------------------
534 latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
535 -----------------
536 | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0)
537 -----------------
538 => started at: __alloc_pages_internal
539 => ended at: __alloc_pages_internal
540
541# _------=> CPU#
542# / _-----=> irqs-off
543# | / _----=> need-resched
544# || / _---=> hardirq/softirq
545# ||| / _--=> preempt-depth
546# |||| /
547# ||||| delay
548# cmd pid ||||| time | caller
549# \ / ||||| \ | /
550 ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal)
551 ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist)
552 ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk)
553 ls-4339 0d..1 4us : add_preempt_count (_spin_lock)
554 ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk)
555 ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue)
556 ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest)
557 ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk)
558 ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue)
559 ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest)
560 ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk)
561 ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue)
562[...]
563 ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue)
564 ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest)
565 ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk)
566 ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue)
567 ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest)
568 ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk)
569 ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock)
570 ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal)
571 ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal)
572
573
574
575Here we traced a 50 microsecond latency. But we also see all the
576functions that were called during that time. Note that by enabling
577function tracing, we incur an added overhead. This overhead may
578extend the latency times. But nevertheless, this trace has provided
579some very helpful debugging information.
580
581
582preemptoff
583----------
584
585When preemption is disabled, we may be able to receive interrupts but
586the task cannot be preempted and a higher priority task must wait
587for preemption to be enabled again before it can preempt a lower
588priority task.
589
590The preemptoff tracer traces the places that disable preemption.
591Like the irqsoff tracer, it records the maximum latency for which preemption
592was disabled. The control of preemptoff tracer is much like the irqsoff
593tracer.
594
595 # echo preemptoff > /debug/tracing/current_tracer
596 # echo 0 > /debug/tracing/tracing_max_latency
597 # echo 1 > /debug/tracing/tracing_enabled
598 # ls -ltr
599 [...]
600 # echo 0 > /debug/tracing/tracing_enabled
601 # cat /debug/tracing/latency_trace
602# tracer: preemptoff
603#
604preemptoff latency trace v1.1.5 on 2.6.26-rc8
605--------------------------------------------------------------------
606 latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
607 -----------------
608 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
609 -----------------
610 => started at: do_IRQ
611 => ended at: __do_softirq
612
613# _------=> CPU#
614# / _-----=> irqs-off
615# | / _----=> need-resched
616# || / _---=> hardirq/softirq
617# ||| / _--=> preempt-depth
618# |||| /
619# ||||| delay
620# cmd pid ||||| time | caller
621# \ / ||||| \ | /
622 sshd-4261 0d.h. 0us+: irq_enter (do_IRQ)
623 sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq)
624 sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq)
625
626
627This has some more changes. Preemption was disabled when an interrupt
628came in (notice the 'h'), and was enabled while doing a softirq.
629(notice the 's'). But we also see that interrupts have been disabled
630when entering the preempt off section and leaving it (the 'd').
631We do not know if interrupts were enabled in the mean time.
632
633# tracer: preemptoff
634#
635preemptoff latency trace v1.1.5 on 2.6.26-rc8
636--------------------------------------------------------------------
637 latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
638 -----------------
639 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
640 -----------------
641 => started at: remove_wait_queue
642 => ended at: __do_softirq
643
644# _------=> CPU#
645# / _-----=> irqs-off
646# | / _----=> need-resched
647# || / _---=> hardirq/softirq
648# ||| / _--=> preempt-depth
649# |||| /
650# ||||| delay
651# cmd pid ||||| time | caller
652# \ / ||||| \ | /
653 sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue)
654 sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue)
655 sshd-4261 0d..1 2us : do_IRQ (common_interrupt)
656 sshd-4261 0d..1 2us : irq_enter (do_IRQ)
657 sshd-4261 0d..1 2us : idle_cpu (irq_enter)
658 sshd-4261 0d..1 3us : add_preempt_count (irq_enter)
659 sshd-4261 0d.h1 3us : idle_cpu (irq_enter)
660 sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ)
661[...]
662 sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock)
663 sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq)
664 sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq)
665 sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq)
666 sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock)
667 sshd-4261 0d.h1 14us : irq_exit (do_IRQ)
668 sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit)
669 sshd-4261 0d..2 15us : do_softirq (irq_exit)
670 sshd-4261 0d... 15us : __do_softirq (do_softirq)
671 sshd-4261 0d... 16us : __local_bh_disable (__do_softirq)
672 sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable)
673 sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable)
674 sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable)
675 sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable)
676[...]
677 sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable)
678 sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable)
679 sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable)
680 sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable)
681 sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip)
682 sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip)
683 sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable)
684 sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable)
685[...]
686 sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq)
687 sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq)
688
689
690The above is an example of the preemptoff trace with ftrace_enabled
691set. Here we see that interrupts were disabled the entire time.
692The irq_enter code lets us know that we entered an interrupt 'h'.
693Before that, the functions being traced still show that it is not
694in an interrupt, but we can see from the functions themselves that
695this is not the case.
696
697Notice that __do_softirq when called does not have a preempt_count.
698It may seem that we missed a preempt enabling. What really happened
699is that the preempt count is held on the thread's stack and we
700switched to the softirq stack (4K stacks in effect). The code
701does not copy the preempt count, but because interrupts are disabled,
702we do not need to worry about it. Having a tracer like this is good
703for letting people know what really happens inside the kernel.
704
705
706preemptirqsoff
707--------------
708
709Knowing the locations that have interrupts disabled or preemption
710disabled for the longest times is helpful. But sometimes we would
711like to know when either preemption and/or interrupts are disabled.
712
713Consider the following code:
714
715 local_irq_disable();
716 call_function_with_irqs_off();
717 preempt_disable();
718 call_function_with_irqs_and_preemption_off();
719 local_irq_enable();
720 call_function_with_preemption_off();
721 preempt_enable();
722
723The irqsoff tracer will record the total length of
724call_function_with_irqs_off() and
725call_function_with_irqs_and_preemption_off().
726
727The preemptoff tracer will record the total length of
728call_function_with_irqs_and_preemption_off() and
729call_function_with_preemption_off().
730
731But neither will trace the time that interrupts and/or preemption
732is disabled. This total time is the time that we can not schedule.
733To record this time, use the preemptirqsoff tracer.
734
735Again, using this trace is much like the irqsoff and preemptoff tracers.
736
737 # echo preemptirqsoff > /debug/tracing/current_tracer
738 # echo 0 > /debug/tracing/tracing_max_latency
739 # echo 1 > /debug/tracing/tracing_enabled
740 # ls -ltr
741 [...]
742 # echo 0 > /debug/tracing/tracing_enabled
743 # cat /debug/tracing/latency_trace
744# tracer: preemptirqsoff
745#
746preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
747--------------------------------------------------------------------
748 latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
749 -----------------
750 | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0)
751 -----------------
752 => started at: apic_timer_interrupt
753 => ended at: __do_softirq
754
755# _------=> CPU#
756# / _-----=> irqs-off
757# | / _----=> need-resched
758# || / _---=> hardirq/softirq
759# ||| / _--=> preempt-depth
760# |||| /
761# ||||| delay
762# cmd pid ||||| time | caller
763# \ / ||||| \ | /
764 ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt)
765 ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq)
766 ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq)
767
768
769
770The trace_hardirqs_off_thunk is called from assembly on x86 when
771interrupts are disabled in the assembly code. Without the function
772tracing, we do not know if interrupts were enabled within the preemption
773points. We do see that it started with preemption enabled.
774
775Here is a trace with ftrace_enabled set:
776
777
778# tracer: preemptirqsoff
779#
780preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
781--------------------------------------------------------------------
782 latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
783 -----------------
784 | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
785 -----------------
786 => started at: write_chan
787 => ended at: __do_softirq
788
789# _------=> CPU#
790# / _-----=> irqs-off
791# | / _----=> need-resched
792# || / _---=> hardirq/softirq
793# ||| / _--=> preempt-depth
794# |||| /
795# ||||| delay
796# cmd pid ||||| time | caller
797# \ / ||||| \ | /
798 ls-4473 0.N.. 0us : preempt_schedule (write_chan)
799 ls-4473 0dN.1 1us : _spin_lock (schedule)
800 ls-4473 0dN.1 2us : add_preempt_count (_spin_lock)
801 ls-4473 0d..2 2us : put_prev_task_fair (schedule)
802[...]
803 ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts)
804 ls-4473 0d..2 13us : __switch_to (schedule)
805 sshd-4261 0d..2 14us : finish_task_switch (schedule)
806 sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch)
807 sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave)
808 sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set)
809 sshd-4261 0d..2 16us : do_IRQ (common_interrupt)
810 sshd-4261 0d..2 17us : irq_enter (do_IRQ)
811 sshd-4261 0d..2 17us : idle_cpu (irq_enter)
812 sshd-4261 0d..2 18us : add_preempt_count (irq_enter)
813 sshd-4261 0d.h2 18us : idle_cpu (irq_enter)
814 sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ)
815 sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq)
816 sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock)
817 sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq)
818 sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock)
819[...]
820 sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq)
821 sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock)
822 sshd-4261 0d.h2 29us : irq_exit (do_IRQ)
823 sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit)
824 sshd-4261 0d..3 30us : do_softirq (irq_exit)
825 sshd-4261 0d... 30us : __do_softirq (do_softirq)
826 sshd-4261 0d... 31us : __local_bh_disable (__do_softirq)
827 sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable)
828 sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable)
829[...]
830 sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip)
831 sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip)
832 sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt)
833 sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt)
834 sshd-4261 0d.s3 45us : idle_cpu (irq_enter)
835 sshd-4261 0d.s3 46us : add_preempt_count (irq_enter)
836 sshd-4261 0d.H3 46us : idle_cpu (irq_enter)
837 sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt)
838 sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt)
839[...]
840 sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt)
841 sshd-4261 0d.H3 82us : ktime_get (tick_program_event)
842 sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get)
843 sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts)
844 sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts)
845 sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event)
846 sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event)
847 sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt)
848 sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit)
849 sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit)
850 sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable)
851[...]
852 sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action)
853 sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq)
854 sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq)
855 sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq)
856 sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable)
857 sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq)
858 sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq)
859
860
861This is a very interesting trace. It started with the preemption of
862the ls task. We see that the task had the "need_resched" bit set
863via the 'N' in the trace. Interrupts were disabled before the spin_lock
864at the beginning of the trace. We see that a schedule took place to run
865sshd. When the interrupts were enabled, we took an interrupt.
866On return from the interrupt handler, the softirq ran. We took another
867interrupt while running the softirq as we see from the capital 'H'.
868
869
870wakeup
871------
872
873In a Real-Time environment it is very important to know the wakeup
874time it takes for the highest priority task that is woken up to the
875time that it executes. This is also known as "schedule latency".
876I stress the point that this is about RT tasks. It is also important
877to know the scheduling latency of non-RT tasks, but the average
878schedule latency is better for non-RT tasks. Tools like
879LatencyTop are more appropriate for such measurements.
880
881Real-Time environments are interested in the worst case latency.
882That is the longest latency it takes for something to happen, and
883not the average. We can have a very fast scheduler that may only
884have a large latency once in a while, but that would not work well
885with Real-Time tasks. The wakeup tracer was designed to record
886the worst case wakeups of RT tasks. Non-RT tasks are not recorded
887because the tracer only records one worst case and tracing non-RT
888tasks that are unpredictable will overwrite the worst case latency
889of RT tasks.
890
891Since this tracer only deals with RT tasks, we will run this slightly
892differently than we did with the previous tracers. Instead of performing
893an 'ls', we will run 'sleep 1' under 'chrt' which changes the
894priority of the task.
895
896 # echo wakeup > /debug/tracing/current_tracer
897 # echo 0 > /debug/tracing/tracing_max_latency
898 # echo 1 > /debug/tracing/tracing_enabled
899 # chrt -f 5 sleep 1
900 # echo 0 > /debug/tracing/tracing_enabled
901 # cat /debug/tracing/latency_trace
902# tracer: wakeup
903#
904wakeup latency trace v1.1.5 on 2.6.26-rc8
905--------------------------------------------------------------------
906 latency: 4 us, #2/2, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
907 -----------------
908 | task: sleep-4901 (uid:0 nice:0 policy:1 rt_prio:5)
909 -----------------
910
911# _------=> CPU#
912# / _-----=> irqs-off
913# | / _----=> need-resched
914# || / _---=> hardirq/softirq
915# ||| / _--=> preempt-depth
916# |||| /
917# ||||| delay
918# cmd pid ||||| time | caller
919# \ / ||||| \ | /
920 <idle>-0 1d.h4 0us+: try_to_wake_up (wake_up_process)
921 <idle>-0 1d..4 4us : schedule (cpu_idle)
922
923
924
925Running this on an idle system, we see that it only took 4 microseconds
926to perform the task switch. Note, since the trace marker in the
927schedule is before the actual "switch", we stop the tracing when
928the recorded task is about to schedule in. This may change if
929we add a new marker at the end of the scheduler.
930
931Notice that the recorded task is 'sleep' with the PID of 4901 and it
932has an rt_prio of 5. This priority is user-space priority and not
933the internal kernel priority. The policy is 1 for SCHED_FIFO and 2
934for SCHED_RR.
935
936Doing the same with chrt -r 5 and ftrace_enabled set.
937
938# tracer: wakeup
939#
940wakeup latency trace v1.1.5 on 2.6.26-rc8
941--------------------------------------------------------------------
942 latency: 50 us, #60/60, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
943 -----------------
944 | task: sleep-4068 (uid:0 nice:0 policy:2 rt_prio:5)
945 -----------------
946
947# _------=> CPU#
948# / _-----=> irqs-off
949# | / _----=> need-resched
950# || / _---=> hardirq/softirq
951# ||| / _--=> preempt-depth
952# |||| /
953# ||||| delay
954# cmd pid ||||| time | caller
955# \ / ||||| \ | /
956ksoftirq-7 1d.H3 0us : try_to_wake_up (wake_up_process)
957ksoftirq-7 1d.H4 1us : sub_preempt_count (marker_probe_cb)
958ksoftirq-7 1d.H3 2us : check_preempt_wakeup (try_to_wake_up)
959ksoftirq-7 1d.H3 3us : update_curr (check_preempt_wakeup)
960ksoftirq-7 1d.H3 4us : calc_delta_mine (update_curr)
961ksoftirq-7 1d.H3 5us : __resched_task (check_preempt_wakeup)
962ksoftirq-7 1d.H3 6us : task_wake_up_rt (try_to_wake_up)
963ksoftirq-7 1d.H3 7us : _spin_unlock_irqrestore (try_to_wake_up)
964[...]
965ksoftirq-7 1d.H2 17us : irq_exit (smp_apic_timer_interrupt)
966ksoftirq-7 1d.H2 18us : sub_preempt_count (irq_exit)
967ksoftirq-7 1d.s3 19us : sub_preempt_count (irq_exit)
968ksoftirq-7 1..s2 20us : rcu_process_callbacks (__do_softirq)
969[...]
970ksoftirq-7 1..s2 26us : __rcu_process_callbacks (rcu_process_callbacks)
971ksoftirq-7 1d.s2 27us : _local_bh_enable (__do_softirq)
972ksoftirq-7 1d.s2 28us : sub_preempt_count (_local_bh_enable)
973ksoftirq-7 1.N.3 29us : sub_preempt_count (ksoftirqd)
974ksoftirq-7 1.N.2 30us : _cond_resched (ksoftirqd)
975ksoftirq-7 1.N.2 31us : __cond_resched (_cond_resched)
976ksoftirq-7 1.N.2 32us : add_preempt_count (__cond_resched)
977ksoftirq-7 1.N.2 33us : schedule (__cond_resched)
978ksoftirq-7 1.N.2 33us : add_preempt_count (schedule)
979ksoftirq-7 1.N.3 34us : hrtick_clear (schedule)
980ksoftirq-7 1dN.3 35us : _spin_lock (schedule)
981ksoftirq-7 1dN.3 36us : add_preempt_count (_spin_lock)
982ksoftirq-7 1d..4 37us : put_prev_task_fair (schedule)
983ksoftirq-7 1d..4 38us : update_curr (put_prev_task_fair)
984[...]
985ksoftirq-7 1d..5 47us : _spin_trylock (tracing_record_cmdline)
986ksoftirq-7 1d..5 48us : add_preempt_count (_spin_trylock)
987ksoftirq-7 1d..6 49us : _spin_unlock (tracing_record_cmdline)
988ksoftirq-7 1d..6 49us : sub_preempt_count (_spin_unlock)
989ksoftirq-7 1d..4 50us : schedule (__cond_resched)
990
991The interrupt went off while running ksoftirqd. This task runs at
992SCHED_OTHER. Why did not we see the 'N' set early? This may be
993a harmless bug with x86_32 and 4K stacks. On x86_32 with 4K stacks
994configured, the interrupt and softirq run with their own stack.
995Some information is held on the top of the task's stack (need_resched
996and preempt_count are both stored there). The setting of the NEED_RESCHED
997bit is done directly to the task's stack, but the reading of the
998NEED_RESCHED is done by looking at the current stack, which in this case
999is the stack for the hard interrupt. This hides the fact that NEED_RESCHED
1000has been set. We do not see the 'N' until we switch back to the task's
1001assigned stack.
1002
1003ftrace
1004------
1005
1006ftrace is not only the name of the tracing infrastructure, but it
1007is also a name of one of the tracers. The tracer is the function
1008tracer. Enabling the function tracer can be done from the
1009debug file system. Make sure the ftrace_enabled is set otherwise
1010this tracer is a nop.
1011
1012 # sysctl kernel.ftrace_enabled=1
1013 # echo ftrace > /debug/tracing/current_tracer
1014 # echo 1 > /debug/tracing/tracing_enabled
1015 # usleep 1
1016 # echo 0 > /debug/tracing/tracing_enabled
1017 # cat /debug/tracing/trace
1018# tracer: ftrace
1019#
1020# TASK-PID CPU# TIMESTAMP FUNCTION
1021# | | | | |
1022 bash-4003 [00] 123.638713: finish_task_switch <-schedule
1023 bash-4003 [00] 123.638714: _spin_unlock_irq <-finish_task_switch
1024 bash-4003 [00] 123.638714: sub_preempt_count <-_spin_unlock_irq
1025 bash-4003 [00] 123.638715: hrtick_set <-schedule
1026 bash-4003 [00] 123.638715: _spin_lock_irqsave <-hrtick_set
1027 bash-4003 [00] 123.638716: add_preempt_count <-_spin_lock_irqsave
1028 bash-4003 [00] 123.638716: _spin_unlock_irqrestore <-hrtick_set
1029 bash-4003 [00] 123.638717: sub_preempt_count <-_spin_unlock_irqrestore
1030 bash-4003 [00] 123.638717: hrtick_clear <-hrtick_set
1031 bash-4003 [00] 123.638718: sub_preempt_count <-schedule
1032 bash-4003 [00] 123.638718: sub_preempt_count <-preempt_schedule
1033 bash-4003 [00] 123.638719: wait_for_completion <-__stop_machine_run
1034 bash-4003 [00] 123.638719: wait_for_common <-wait_for_completion
1035 bash-4003 [00] 123.638720: _spin_lock_irq <-wait_for_common
1036 bash-4003 [00] 123.638720: add_preempt_count <-_spin_lock_irq
1037[...]
1038
1039
1040Note: ftrace uses ring buffers to store the above entries. The newest data
1041may overwrite the oldest data. Sometimes using echo to stop the trace
1042is not sufficient because the tracing could have overwritten the data
1043that you wanted to record. For this reason, it is sometimes better to
1044disable tracing directly from a program. This allows you to stop the
1045tracing at the point that you hit the part that you are interested in.
1046To disable the tracing directly from a C program, something like following
1047code snippet can be used:
1048
1049int trace_fd;
1050[...]
1051int main(int argc, char *argv[]) {
1052 [...]
1053 trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY);
1054 [...]
1055 if (condition_hit()) {
1056 write(trace_fd, "0", 1);
1057 }
1058 [...]
1059}
1060
1061Note: Here we hard coded the path name. The debugfs mount is not
1062guaranteed to be at /debug (and is more commonly at /sys/kernel/debug).
1063For simple one time traces, the above is sufficent. For anything else,
1064a search through /proc/mounts may be needed to find where the debugfs
1065file-system is mounted.
1066
1067dynamic ftrace
1068--------------
1069
1070If CONFIG_DYNAMIC_FTRACE is set, the system will run with
1071virtually no overhead when function tracing is disabled. The way
1072this works is the mcount function call (placed at the start of
1073every kernel function, produced by the -pg switch in gcc), starts
1074of pointing to a simple return. (Enabling FTRACE will include the
1075-pg switch in the compiling of the kernel.)
1076
1077When dynamic ftrace is initialized, it calls kstop_machine to make
1078the machine act like a uniprocessor so that it can freely modify code
1079without worrying about other processors executing that same code. At
1080initialization, the mcount calls are changed to call a "record_ip"
1081function. After this, the first time a kernel function is called,
1082it has the calling address saved in a hash table.
1083
1084Later on the ftraced kernel thread is awoken and will again call
1085kstop_machine if new functions have been recorded. The ftraced thread
1086will change all calls to mcount to "nop". Just calling mcount
1087and having mcount return has shown a 10% overhead. By converting
1088it to a nop, there is no measurable overhead to the system.
1089
1090One special side-effect to the recording of the functions being
1091traced is that we can now selectively choose which functions we
1092wish to trace and which ones we want the mcount calls to remain as
1093nops.
1094
1095Two files are used, one for enabling and one for disabling the tracing
1096of specified functions. They are:
1097
1098 set_ftrace_filter
1099
1100and
1101
1102 set_ftrace_notrace
1103
1104A list of available functions that you can add to these files is listed
1105in:
1106
1107 available_filter_functions
1108
1109 # cat /debug/tracing/available_filter_functions
1110put_prev_task_idle
1111kmem_cache_create
1112pick_next_task_rt
1113get_online_cpus
1114pick_next_task_fair
1115mutex_lock
1116[...]
1117
1118If I am only interested in sys_nanosleep and hrtimer_interrupt:
1119
1120 # echo sys_nanosleep hrtimer_interrupt \
1121 > /debug/tracing/set_ftrace_filter
1122 # echo ftrace > /debug/tracing/current_tracer
1123 # echo 1 > /debug/tracing/tracing_enabled
1124 # usleep 1
1125 # echo 0 > /debug/tracing/tracing_enabled
1126 # cat /debug/tracing/trace
1127# tracer: ftrace
1128#
1129# TASK-PID CPU# TIMESTAMP FUNCTION
1130# | | | | |
1131 usleep-4134 [00] 1317.070017: hrtimer_interrupt <-smp_apic_timer_interrupt
1132 usleep-4134 [00] 1317.070111: sys_nanosleep <-syscall_call
1133 <idle>-0 [00] 1317.070115: hrtimer_interrupt <-smp_apic_timer_interrupt
1134
1135To see which functions are being traced, you can cat the file:
1136
1137 # cat /debug/tracing/set_ftrace_filter
1138hrtimer_interrupt
1139sys_nanosleep
1140
1141
1142Perhaps this is not enough. The filters also allow simple wild cards.
1143Only the following are currently available
1144
1145 <match>* - will match functions that begin with <match>
1146 *<match> - will match functions that end with <match>
1147 *<match>* - will match functions that have <match> in it
1148
1149These are the only wild cards which are supported.
1150
1151 <match>*<match> will not work.
1152
1153 # echo hrtimer_* > /debug/tracing/set_ftrace_filter
1154
1155Produces:
1156
1157# tracer: ftrace
1158#
1159# TASK-PID CPU# TIMESTAMP FUNCTION
1160# | | | | |
1161 bash-4003 [00] 1480.611794: hrtimer_init <-copy_process
1162 bash-4003 [00] 1480.611941: hrtimer_start <-hrtick_set
1163 bash-4003 [00] 1480.611956: hrtimer_cancel <-hrtick_clear
1164 bash-4003 [00] 1480.611956: hrtimer_try_to_cancel <-hrtimer_cancel
1165 <idle>-0 [00] 1480.612019: hrtimer_get_next_event <-get_next_timer_interrupt
1166 <idle>-0 [00] 1480.612025: hrtimer_get_next_event <-get_next_timer_interrupt
1167 <idle>-0 [00] 1480.612032: hrtimer_get_next_event <-get_next_timer_interrupt
1168 <idle>-0 [00] 1480.612037: hrtimer_get_next_event <-get_next_timer_interrupt
1169 <idle>-0 [00] 1480.612382: hrtimer_get_next_event <-get_next_timer_interrupt
1170
1171
1172Notice that we lost the sys_nanosleep.
1173
1174 # cat /debug/tracing/set_ftrace_filter
1175hrtimer_run_queues
1176hrtimer_run_pending
1177hrtimer_init
1178hrtimer_cancel
1179hrtimer_try_to_cancel
1180hrtimer_forward
1181hrtimer_start
1182hrtimer_reprogram
1183hrtimer_force_reprogram
1184hrtimer_get_next_event
1185hrtimer_interrupt
1186hrtimer_nanosleep
1187hrtimer_wakeup
1188hrtimer_get_remaining
1189hrtimer_get_res
1190hrtimer_init_sleeper
1191
1192
1193This is because the '>' and '>>' act just like they do in bash.
1194To rewrite the filters, use '>'
1195To append to the filters, use '>>'
1196
1197To clear out a filter so that all functions will be recorded again:
1198
1199 # echo > /debug/tracing/set_ftrace_filter
1200 # cat /debug/tracing/set_ftrace_filter
1201 #
1202
1203Again, now we want to append.
1204
1205 # echo sys_nanosleep > /debug/tracing/set_ftrace_filter
1206 # cat /debug/tracing/set_ftrace_filter
1207sys_nanosleep
1208 # echo hrtimer_* >> /debug/tracing/set_ftrace_filter
1209 # cat /debug/tracing/set_ftrace_filter
1210hrtimer_run_queues
1211hrtimer_run_pending
1212hrtimer_init
1213hrtimer_cancel
1214hrtimer_try_to_cancel
1215hrtimer_forward
1216hrtimer_start
1217hrtimer_reprogram
1218hrtimer_force_reprogram
1219hrtimer_get_next_event
1220hrtimer_interrupt
1221sys_nanosleep
1222hrtimer_nanosleep
1223hrtimer_wakeup
1224hrtimer_get_remaining
1225hrtimer_get_res
1226hrtimer_init_sleeper
1227
1228
1229The set_ftrace_notrace prevents those functions from being traced.
1230
1231 # echo '*preempt*' '*lock*' > /debug/tracing/set_ftrace_notrace
1232
1233Produces:
1234
1235# tracer: ftrace
1236#
1237# TASK-PID CPU# TIMESTAMP FUNCTION
1238# | | | | |
1239 bash-4043 [01] 115.281644: finish_task_switch <-schedule
1240 bash-4043 [01] 115.281645: hrtick_set <-schedule
1241 bash-4043 [01] 115.281645: hrtick_clear <-hrtick_set
1242 bash-4043 [01] 115.281646: wait_for_completion <-__stop_machine_run
1243 bash-4043 [01] 115.281647: wait_for_common <-wait_for_completion
1244 bash-4043 [01] 115.281647: kthread_stop <-stop_machine_run
1245 bash-4043 [01] 115.281648: init_waitqueue_head <-kthread_stop
1246 bash-4043 [01] 115.281648: wake_up_process <-kthread_stop
1247 bash-4043 [01] 115.281649: try_to_wake_up <-wake_up_process
1248
1249We can see that there's no more lock or preempt tracing.
1250
1251ftraced
1252-------
1253
1254As mentioned above, when dynamic ftrace is configured in, a kernel
1255thread wakes up once a second and checks to see if there are mcount
1256calls that need to be converted into nops. If there are not any, then
1257it simply goes back to sleep. But if there are some, it will call
1258kstop_machine to convert the calls to nops.
1259
1260There may be a case in which you do not want this added latency.
1261Perhaps you are doing some audio recording and this activity might
1262cause skips in the playback. There is an interface to disable
1263and enable the "ftraced" kernel thread.
1264
1265 # echo 0 > /debug/tracing/ftraced_enabled
1266
1267This will disable the calling of kstop_machine to update the
1268mcount calls to nops. Remember that there is a large overhead
1269to calling mcount. Without this kernel thread, that overhead will
1270exist.
1271
1272If there are recorded calls to mcount, any write to the ftraced_enabled
1273file will cause the kstop_machine to run. This means that a
1274user can manually perform the updates when they want to by simply
1275echoing a '0' into the ftraced_enabled file.
1276
1277The updates are also done at the beginning of enabling a tracer
1278that uses ftrace function recording.
1279
1280
1281trace_pipe
1282----------
1283
1284The trace_pipe outputs the same content as the trace file, but the effect
1285on the tracing is different. Every read from trace_pipe is consumed.
1286This means that subsequent reads will be different. The trace
1287is live.
1288
1289 # echo ftrace > /debug/tracing/current_tracer
1290 # cat /debug/tracing/trace_pipe > /tmp/trace.out &
1291[1] 4153
1292 # echo 1 > /debug/tracing/tracing_enabled
1293 # usleep 1
1294 # echo 0 > /debug/tracing/tracing_enabled
1295 # cat /debug/tracing/trace
1296# tracer: ftrace
1297#
1298# TASK-PID CPU# TIMESTAMP FUNCTION
1299# | | | | |
1300
1301 #
1302 # cat /tmp/trace.out
1303 bash-4043 [00] 41.267106: finish_task_switch <-schedule
1304 bash-4043 [00] 41.267106: hrtick_set <-schedule
1305 bash-4043 [00] 41.267107: hrtick_clear <-hrtick_set
1306 bash-4043 [00] 41.267108: wait_for_completion <-__stop_machine_run
1307 bash-4043 [00] 41.267108: wait_for_common <-wait_for_completion
1308 bash-4043 [00] 41.267109: kthread_stop <-stop_machine_run
1309 bash-4043 [00] 41.267109: init_waitqueue_head <-kthread_stop
1310 bash-4043 [00] 41.267110: wake_up_process <-kthread_stop
1311 bash-4043 [00] 41.267110: try_to_wake_up <-wake_up_process
1312 bash-4043 [00] 41.267111: select_task_rq_rt <-try_to_wake_up
1313
1314
1315Note, reading the trace_pipe file will block until more input is added.
1316By changing the tracer, trace_pipe will issue an EOF. We needed
1317to set the ftrace tracer _before_ cating the trace_pipe file.
1318
1319
1320trace entries
1321-------------
1322
1323Having too much or not enough data can be troublesome in diagnosing
1324an issue in the kernel. The file trace_entries is used to modify
1325the size of the internal trace buffers. The number listed
1326is the number of entries that can be recorded per CPU. To know
1327the full size, multiply the number of possible CPUS with the
1328number of entries.
1329
1330 # cat /debug/tracing/trace_entries
133165620
1332
1333Note, to modify this, you must have tracing completely disabled. To do that,
1334echo "none" into the current_tracer. If the current_tracer is not set
1335to "none", an EINVAL error will be returned.
1336
1337 # echo none > /debug/tracing/current_tracer
1338 # echo 100000 > /debug/tracing/trace_entries
1339 # cat /debug/tracing/trace_entries
1340100045
1341
1342
1343Notice that we echoed in 100,000 but the size is 100,045. The entries
1344are held in individual pages. It allocates the number of pages it takes
1345to fulfill the request. If more entries may fit on the last page
1346then they will be added.
1347
1348 # echo 1 > /debug/tracing/trace_entries
1349 # cat /debug/tracing/trace_entries
135085
1351
1352This shows us that 85 entries can fit in a single page.
1353
1354The number of pages which will be allocated is limited to a percentage
1355of available memory. Allocating too much will produce an error.
1356
1357 # echo 1000000000000 > /debug/tracing/trace_entries
1358-bash: echo: write error: Cannot allocate memory
1359 # cat /debug/tracing/trace_entries
136085
1361
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index c35ca9e40d4c..18022e249c53 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -347,15 +347,12 @@ necessarily be nonportable.
347Dynamic definition of GPIOs is not currently standard; for example, as 347Dynamic definition of GPIOs is not currently standard; for example, as
348a side effect of configuring an add-on board with some GPIO expanders. 348a side effect of configuring an add-on board with some GPIO expanders.
349 349
350These calls are purely for kernel space, but a userspace API could be built
351on top of them.
352
353 350
354GPIO implementor's framework (OPTIONAL) 351GPIO implementor's framework (OPTIONAL)
355======================================= 352=======================================
356As noted earlier, there is an optional implementation framework making it 353As noted earlier, there is an optional implementation framework making it
357easier for platforms to support different kinds of GPIO controller using 354easier for platforms to support different kinds of GPIO controller using
358the same programming interface. 355the same programming interface. This framework is called "gpiolib".
359 356
360As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file 357As a debugging aid, if debugfs is available a /sys/kernel/debug/gpio file
361will be found there. That will list all the controllers registered through 358will be found there. That will list all the controllers registered through
@@ -392,11 +389,21 @@ either NULL or the label associated with that GPIO when it was requested.
392 389
393Platform Support 390Platform Support
394---------------- 391----------------
395To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB" 392To support this framework, a platform's Kconfig will "select" either
393ARCH_REQUIRE_GPIOLIB or ARCH_WANT_OPTIONAL_GPIOLIB
396and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines 394and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines
397three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). 395three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep().
398They may also want to provide a custom value for ARCH_NR_GPIOS. 396They may also want to provide a custom value for ARCH_NR_GPIOS.
399 397
398ARCH_REQUIRE_GPIOLIB means that the gpio-lib code will always get compiled
399into the kernel on that architecture.
400
401ARCH_WANT_OPTIONAL_GPIOLIB means the gpio-lib code defaults to off and the user
402can enable it and build it into the kernel optionally.
403
404If neither of these options are selected, the platform does not support
405GPIOs through GPIO-lib and the code cannot be enabled by the user.
406
400Trivial implementations of those functions can directly use framework 407Trivial implementations of those functions can directly use framework
401code, which always dispatches through the gpio_chip: 408code, which always dispatches through the gpio_chip:
402 409
@@ -439,4 +446,120 @@ becomes available. That may mean the device should not be registered until
439calls for that GPIO can work. One way to address such dependencies is for 446calls for that GPIO can work. One way to address such dependencies is for
440such gpio_chip controllers to provide setup() and teardown() callbacks to 447such gpio_chip controllers to provide setup() and teardown() callbacks to
441board specific code; those board specific callbacks would register devices 448board specific code; those board specific callbacks would register devices
442once all the necessary resources are available. 449once all the necessary resources are available, and remove them later when
450the GPIO controller device becomes unavailable.
451
452
453Sysfs Interface for Userspace (OPTIONAL)
454========================================
455Platforms which use the "gpiolib" implementors framework may choose to
456configure a sysfs user interface to GPIOs. This is different from the
457debugfs interface, since it provides control over GPIO direction and
458value instead of just showing a gpio state summary. Plus, it could be
459present on production systems without debugging support.
460
461Given approprate hardware documentation for the system, userspace could
462know for example that GPIO #23 controls the write protect line used to
463protect boot loader segments in flash memory. System upgrade procedures
464may need to temporarily remove that protection, first importing a GPIO,
465then changing its output state, then updating the code before re-enabling
466the write protection. In normal use, GPIO #23 would never be touched,
467and the kernel would have no need to know about it.
468
469Again depending on appropriate hardware documentation, on some systems
470userspace GPIO can be used to determine system configuration data that
471standard kernels won't know about. And for some tasks, simple userspace
472GPIO drivers could be all that the system really needs.
473
474Note that standard kernel drivers exist for common "LEDs and Buttons"
475GPIO tasks: "leds-gpio" and "gpio_keys", respectively. Use those
476instead of talking directly to the GPIOs; they integrate with kernel
477frameworks better than your userspace code could.
478
479
480Paths in Sysfs
481--------------
482There are three kinds of entry in /sys/class/gpio:
483
484 - Control interfaces used to get userspace control over GPIOs;
485
486 - GPIOs themselves; and
487
488 - GPIO controllers ("gpio_chip" instances).
489
490That's in addition to standard files including the "device" symlink.
491
492The control interfaces are write-only:
493
494 /sys/class/gpio/
495
496 "export" ... Userspace may ask the kernel to export control of
497 a GPIO to userspace by writing its number to this file.
498
499 Example: "echo 19 > export" will create a "gpio19" node
500 for GPIO #19, if that's not requested by kernel code.
501
502 "unexport" ... Reverses the effect of exporting to userspace.
503
504 Example: "echo 19 > unexport" will remove a "gpio19"
505 node exported using the "export" file.
506
507GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42)
508and have the following read/write attributes:
509
510 /sys/class/gpio/gpioN/
511
512 "direction" ... reads as either "in" or "out". This value may
513 normally be written. Writing as "out" defaults to
514 initializing the value as low. To ensure glitch free
515 operation, values "low" and "high" may be written to
516 configure the GPIO as an output with that initial value.
517
518 Note that this attribute *will not exist* if the kernel
519 doesn't support changing the direction of a GPIO, or
520 it was exported by kernel code that didn't explicitly
521 allow userspace to reconfigure this GPIO's direction.
522
523 "value" ... reads as either 0 (low) or 1 (high). If the GPIO
524 is configured as an output, this value may be written;
525 any nonzero value is treated as high.
526
527GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the
528controller implementing GPIOs starting at #42) and have the following
529read-only attributes:
530
531 /sys/class/gpio/gpiochipN/
532
533 "base" ... same as N, the first GPIO managed by this chip
534
535 "label" ... provided for diagnostics (not always unique)
536
537 "ngpio" ... how many GPIOs this manges (N to N + ngpio - 1)
538
539Board documentation should in most cases cover what GPIOs are used for
540what purposes. However, those numbers are not always stable; GPIOs on
541a daughtercard might be different depending on the base board being used,
542or other cards in the stack. In such cases, you may need to use the
543gpiochip nodes (possibly in conjunction with schematics) to determine
544the correct GPIO number to use for a given signal.
545
546
547Exporting from Kernel code
548--------------------------
549Kernel code can explicitly manage exports of GPIOs which have already been
550requested using gpio_request():
551
552 /* export the GPIO to userspace */
553 int gpio_export(unsigned gpio, bool direction_may_change);
554
555 /* reverse gpio_export() */
556 void gpio_unexport();
557
558After a kernel driver requests a GPIO, it may only be made available in
559the sysfs interface by gpio_export(). The driver can control whether the
560signal direction may change. This helps drivers prevent userspace code
561from accidentally clobbering important system state.
562
563This explicit exporting can help with debugging (by making some kinds
564of experiments easier), or can provide an always-there interface that's
565suitable for documenting as part of a board support package.
diff --git a/Documentation/hwmon/adt7473 b/Documentation/hwmon/adt7473
index 2126de34c711..1cbf671822e2 100644
--- a/Documentation/hwmon/adt7473
+++ b/Documentation/hwmon/adt7473
@@ -14,14 +14,14 @@ Description
14 14
15This driver implements support for the Analog Devices ADT7473 chip family. 15This driver implements support for the Analog Devices ADT7473 chip family.
16 16
17The LM85 uses the 2-wire interface compatible with the SMBUS 2.0 17The ADT7473 uses the 2-wire interface compatible with the SMBUS 2.0
18specification. Using an analog to digital converter it measures three (3) 18specification. Using an analog to digital converter it measures three (3)
19temperatures and two (2) voltages. It has three (3) 16-bit counters for 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 20measuring fan speed. There are three (3) PWM outputs that can be used
21to control fan speed. 21to control fan speed.
22 22
23A sophisticated control system for the PWM outputs is designed into the 23A sophisticated control system for the PWM outputs is designed into the
24LM85 that allows fan speed to be adjusted automatically based on any of 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 25three temperature sensors. Each PWM output is individually adjustable and
26programmable. Once configured, the ADT7473 will adjust the PWM outputs in 26programmable. Once configured, the ADT7473 will adjust the PWM outputs in
27response to the measured temperatures without further host intervention. 27response to the measured temperatures without further host intervention.
@@ -46,14 +46,6 @@ from the raw value to get the temperature value.
46The Analog Devices datasheet is very detailed and describes a procedure for 46The Analog Devices datasheet is very detailed and describes a procedure for
47determining an optimal configuration for the automatic PWM control. 47determining an optimal configuration for the automatic PWM control.
48 48
49Hardware Configurations
50-----------------------
51
52The ADT7473 chips have an optional SMBALERT output that can be used to
53signal the chipset in case a limit is exceeded or the temperature sensors
54fail. Individual sensor interrupts can be masked so they won't trigger
55SMBALERT. The SMBALERT output if configured replaces the PWM2 function.
56
57Configuration Notes 49Configuration Notes
58------------------- 50-------------------
59 51
@@ -61,8 +53,8 @@ Besides standard interfaces driver adds the following:
61 53
62* PWM Control 54* PWM Control
63 55
64* pwm#_auto_point1_pwm and pwm#_auto_point1_temp and 56* pwm#_auto_point1_pwm and temp#_auto_point1_temp and
65* pwm#_auto_point2_pwm and pwm#_auto_point2_temp - 57* pwm#_auto_point2_pwm and temp#_auto_point2_temp -
66 58
67point1: Set the pwm speed at a lower temperature bound. 59point1: Set the pwm speed at a lower temperature bound.
68point2: Set the pwm speed at a higher temperature bound. 60point2: Set the pwm speed at a higher temperature bound.
diff --git a/Documentation/hwmon/dme1737 b/Documentation/hwmon/dme1737
index 8f446070e64a..001d2e70bc11 100644
--- a/Documentation/hwmon/dme1737
+++ b/Documentation/hwmon/dme1737
@@ -10,6 +10,10 @@ Supported chips:
10 Prefix: 'sch311x' 10 Prefix: 'sch311x'
11 Addresses scanned: none, address read from Super-I/O config space 11 Addresses scanned: none, address read from Super-I/O config space
12 Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf 12 Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf
13 * SMSC SCH5027
14 Prefix: 'sch5027'
15 Addresses scanned: I2C 0x2c, 0x2d, 0x2e
16 Datasheet: Provided by SMSC upon request and under NDA
13 17
14Authors: 18Authors:
15 Juerg Haefliger <juergh@gmail.com> 19 Juerg Haefliger <juergh@gmail.com>
@@ -22,34 +26,36 @@ Module Parameters
22 and PWM output control functions. Using this parameter 26 and PWM output control functions. Using this parameter
23 shouldn't be required since the BIOS usually takes care 27 shouldn't be required since the BIOS usually takes care
24 of this. 28 of this.
25 29* probe_all_addr: bool Include non-standard LPC addresses 0x162e and 0x164e
26Note that there is no need to use this parameter if the driver loads without 30 when probing for ISA devices. This is required for the
27complaining. The driver will say so if it is necessary. 31 following boards:
32 - VIA EPIA SN18000
28 33
29 34
30Description 35Description
31----------- 36-----------
32 37
33This driver implements support for the hardware monitoring capabilities of the 38This driver implements support for the hardware monitoring capabilities of the
34SMSC DME1737 and Asus A8000 (which are the same) and SMSC SCH311x Super-I/O 39SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, and SMSC
35chips. These chips feature monitoring of 3 temp sensors temp[1-3] (2 remote 40SCH311x Super-I/O chips. These chips feature monitoring of 3 temp sensors
36diodes and 1 internal), 7 voltages in[0-6] (6 external and 1 internal) and up 41temp[1-3] (2 remote diodes and 1 internal), 7 voltages in[0-6] (6 external and
37to 6 fan speeds fan[1-6]. Additionally, the chips implement up to 5 PWM 421 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement
38outputs pwm[1-3,5-6] for controlling fan speeds both manually and 43up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and
39automatically. 44automatically.
40 45
41For the DME1737 and A8000, fan[1-2] and pwm[1-2] are always present. Fan[3-6] 46For the DME1737, A8000 and SCH5027, fan[1-2] and pwm[1-2] are always present.
42and pwm[3,5-6] are optional features and their availability depends on the 47Fan[3-6] and pwm[3,5-6] are optional features and their availability depends on
43configuration of the chip. The driver will detect which features are present 48the configuration of the chip. The driver will detect which features are
44during initialization and create the sysfs attributes accordingly. 49present during initialization and create the sysfs attributes accordingly.
45 50
46For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and 51For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and
47pwm[5-6] don't exist. 52pwm[5-6] don't exist.
48 53
49The hardware monitoring features of the DME1737 and A8000 are only accessible 54The hardware monitoring features of the DME1737, A8000, and SCH5027 are only
50via SMBus, while the SCH311x only provides access via the ISA bus. The driver 55accessible via SMBus, while the SCH311x only provides access via the ISA bus.
51will therefore register itself as an I2C client driver if it detects a DME1737 56The driver will therefore register itself as an I2C client driver if it detects
52or A8000 and as a platform driver if it detects a SCH311x chip. 57a DME1737, A8000, or SCH5027 and as a platform driver if it detects a SCH311x
58chip.
53 59
54 60
55Voltage Monitoring 61Voltage Monitoring
@@ -60,6 +66,7 @@ scaling resistors. The values returned by the driver therefore reflect true
60millivolts and don't need scaling. The voltage inputs are mapped as follows 66millivolts and don't need scaling. The voltage inputs are mapped as follows
61(the last column indicates the input ranges): 67(the last column indicates the input ranges):
62 68
69DME1737, A8000:
63 in0: +5VTR (+5V standby) 0V - 6.64V 70 in0: +5VTR (+5V standby) 0V - 6.64V
64 in1: Vccp (processor core) 0V - 3V 71 in1: Vccp (processor core) 0V - 3V
65 in2: VCC (internal +3.3V) 0V - 4.38V 72 in2: VCC (internal +3.3V) 0V - 4.38V
@@ -68,6 +75,24 @@ millivolts and don't need scaling. The voltage inputs are mapped as follows
68 in5: VTR (+3.3V standby) 0V - 4.38V 75 in5: VTR (+3.3V standby) 0V - 4.38V
69 in6: Vbat (+3.0V) 0V - 4.38V 76 in6: Vbat (+3.0V) 0V - 4.38V
70 77
78SCH311x:
79 in0: +2.5V 0V - 6.64V
80 in1: Vccp (processor core) 0V - 2V
81 in2: VCC (internal +3.3V) 0V - 4.38V
82 in3: +5V 0V - 6.64V
83 in4: +12V 0V - 16V
84 in5: VTR (+3.3V standby) 0V - 4.38V
85 in6: Vbat (+3.0V) 0V - 4.38V
86
87SCH5027:
88 in0: +5VTR (+5V standby) 0V - 6.64V
89 in1: Vccp (processor core) 0V - 3V
90 in2: VCC (internal +3.3V) 0V - 4.38V
91 in3: V2_IN 0V - 1.5V
92 in4: V1_IN 0V - 1.5V
93 in5: VTR (+3.3V standby) 0V - 4.38V
94 in6: Vbat (+3.0V) 0V - 4.38V
95
71Each voltage input has associated min and max limits which trigger an alarm 96Each voltage input has associated min and max limits which trigger an alarm
72when crossed. 97when crossed.
73 98
diff --git a/Documentation/hwmon/ibmaem b/Documentation/hwmon/ibmaem
index 2fefaf582a43..e98bdfea3467 100644
--- a/Documentation/hwmon/ibmaem
+++ b/Documentation/hwmon/ibmaem
@@ -1,8 +1,11 @@
1Kernel driver ibmaem 1Kernel driver ibmaem
2====================== 2======================
3 3
4This driver talks to the IBM Systems Director Active Energy Manager, known
5henceforth as AEM.
6
4Supported systems: 7Supported systems:
5 * Any recent IBM System X server with Active Energy Manager support. 8 * Any recent IBM System X server with AEM support.
6 This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2, 9 This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2,
7 x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface 10 x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface
8 driver ("ipmi-si") needs to be loaded for this driver to do anything. 11 driver ("ipmi-si") needs to be loaded for this driver to do anything.
@@ -14,24 +17,22 @@ Author: Darrick J. Wong
14Description 17Description
15----------- 18-----------
16 19
17This driver implements sensor reading support for the energy and power 20This driver implements sensor reading support for the energy and power meters
18meters available on various IBM System X hardware through the BMC. All 21available on various IBM System X hardware through the BMC. All sensor banks
19sensor banks will be exported as platform devices; this driver can talk 22will be exported as platform devices; this driver can talk to both v1 and v2
20to both v1 and v2 interfaces. This driver is completely separate from the 23interfaces. This driver is completely separate from the older ibmpex driver.
21older ibmpex driver.
22 24
23The v1 AEM interface has a simple set of features to monitor energy use. 25The v1 AEM interface has a simple set of features to monitor energy use. There
24There is a register that displays an estimate of raw energy consumption 26is a register that displays an estimate of raw energy consumption since the
25since the last BMC reset, and a power sensor that returns average power 27last BMC reset, and a power sensor that returns average power use over a
26use over a configurable interval. 28configurable interval.
27 29
28The v2 AEM interface is a bit more sophisticated, being able to present 30The v2 AEM interface is a bit more sophisticated, being able to present a wider
29a wider range of energy and power use registers, the power cap as 31range of energy and power use registers, the power cap as set by the AEM
30set by the AEM software, and temperature sensors. 32software, and temperature sensors.
31 33
32Special Features 34Special Features
33---------------- 35----------------
34 36
35The "power_cap" value displays the current system power cap, as set by 37The "power_cap" value displays the current system power cap, as set by the AEM
36the Active Energy Manager software. Setting the power cap from the host 38software. Setting the power cap from the host is not currently supported.
37is not currently supported.
diff --git a/Documentation/hwmon/it87 b/Documentation/hwmon/it87
index f4ce1fdbeff6..3496b7020e7c 100644
--- a/Documentation/hwmon/it87
+++ b/Documentation/hwmon/it87
@@ -6,12 +6,14 @@ Supported chips:
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: Publicly available at the ITE website
9 http://www.ite.com.tw/ 9 http://www.ite.com.tw/product_info/file/pc/IT8705F_V.0.4.1.pdf
10 * IT8712F 10 * IT8712F
11 Prefix: 'it8712' 11 Prefix: 'it8712'
12 Addresses scanned: from Super I/O config space (8 I/O ports) 12 Addresses scanned: from Super I/O config space (8 I/O ports)
13 Datasheet: Publicly available at the ITE website 13 Datasheet: Publicly available at the ITE website
14 http://www.ite.com.tw/ 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
15 * IT8716F/IT8726F 17 * IT8716F/IT8726F
16 Prefix: 'it8716' 18 Prefix: 'it8716'
17 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)
@@ -90,14 +92,13 @@ upper VID bits share their pins with voltage inputs (in5 and in6) so you
90can't have both on a given board. 92can't have both on a given board.
91 93
92The IT8716F, IT8718F and later IT8712F revisions have support for 94The IT8716F, IT8718F and later IT8712F revisions have support for
932 additional fans. They are supported by the driver for the IT8716F and 952 additional fans. The additional fans are supported by the driver.
94IT8718F but not for the IT8712F
95 96
96The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional 97The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional
9716-bit tachometer counters for fans 1 to 3. This is better (no more fan 9816-bit tachometer counters for fans 1 to 3. This is better (no more fan
98clock divider mess) but not compatible with the older chips and 99clock divider mess) but not compatible with the older chips and
99revisions. For now, the driver only uses the 16-bit mode on the 100revisions. The 16-bit tachometer mode is enabled by the driver when one
100IT8716F and IT8718F. 101of the above chips is detected.
101 102
102The IT8726F is just bit enhanced IT8716F with additional hardware 103The IT8726F is just bit enhanced IT8716F with additional hardware
103for AMD power sequencing. Therefore the chip will appear as IT8716F 104for AMD power sequencing. Therefore the chip will appear as IT8716F
diff --git a/Documentation/hwmon/lm85 b/Documentation/hwmon/lm85
index 9549237530cf..6d41db7f17f8 100644
--- a/Documentation/hwmon/lm85
+++ b/Documentation/hwmon/lm85
@@ -96,11 +96,6 @@ initial testing of the ADM1027 it was 1.00 degC steps. Analog Devices has
96confirmed this "bug". The ADT7463 is reported to work as described in the 96confirmed this "bug". The ADT7463 is reported to work as described in the
97documentation. The current lm85 driver does not show the offset register. 97documentation. The current lm85 driver does not show the offset register.
98 98
99The ADT7463 has a THERM asserted counter. This counter has a 22.76ms
100resolution and a range of 5.8 seconds. The driver implements a 32-bit
101accumulator of the counter value to extend the range to over a year. The
102counter will stay at it's max value until read.
103
104See the vendor datasheets for more information. There is application note 99See the vendor datasheets for more information. There is application note
105from National (AN-1260) with some additional information about the LM85. 100from National (AN-1260) with some additional information about the LM85.
106The Analog Devices datasheet is very detailed and describes a procedure for 101The Analog Devices datasheet is very detailed and describes a procedure for
@@ -206,13 +201,15 @@ Configuration choices:
206 201
207The National LM85's have two vendor specific configuration 202The National LM85's have two vendor specific configuration
208features. Tach. mode and Spinup Control. For more details on these, 203features. Tach. mode and Spinup Control. For more details on these,
209see the LM85 datasheet or Application Note AN-1260. 204see the LM85 datasheet or Application Note AN-1260. These features
205are not currently supported by the lm85 driver.
210 206
211The Analog Devices ADM1027 has several vendor specific enhancements. 207The Analog Devices ADM1027 has several vendor specific enhancements.
212The number of pulses-per-rev of the fans can be set, Tach monitoring 208The number of pulses-per-rev of the fans can be set, Tach monitoring
213can be optimized for PWM operation, and an offset can be applied to 209can be optimized for PWM operation, and an offset can be applied to
214the temperatures to compensate for systemic errors in the 210the temperatures to compensate for systemic errors in the
215measurements. 211measurements. These features are not currently supported by the lm85
212driver.
216 213
217In addition to the ADM1027 features, the ADT7463 also has Tmin control 214In addition to the ADM1027 features, the ADT7463 also has Tmin control
218and THERM asserted counts. Automatic Tmin control acts to adjust the 215and THERM asserted counts. Automatic Tmin control acts to adjust the
diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
index f4a8ebc1ef1a..6dbfd5efd991 100644
--- a/Documentation/hwmon/sysfs-interface
+++ b/Documentation/hwmon/sysfs-interface
@@ -2,17 +2,12 @@ Naming and data format standards for sysfs files
2------------------------------------------------ 2------------------------------------------------
3 3
4The libsensors library offers an interface to the raw sensors data 4The libsensors library offers an interface to the raw sensors data
5through the sysfs interface. See libsensors documentation and source for 5through the sysfs interface. Since lm-sensors 3.0.0, libsensors is
6further information. As of writing this document, libsensors 6completely chip-independent. It assumes that all the kernel drivers
7(from lm_sensors 2.8.3) is heavily chip-dependent. Adding or updating 7implement the standard sysfs interface described in this document.
8support for any given chip requires modifying the library's code. 8This makes adding or updating support for any given chip very easy, as
9This is because libsensors was written for the procfs interface 9libsensors, and applications using it, do not need to be modified.
10older kernel modules were using, which wasn't standardized enough. 10This is a major improvement compared to lm-sensors 2.
11Recent versions of libsensors (from lm_sensors 2.8.2 and later) have
12support for the sysfs interface, though.
13
14The new sysfs interface was designed to be as chip-independent as
15possible.
16 11
17Note that motherboards vary widely in the connections to sensor chips. 12Note that motherboards vary widely in the connections to sensor chips.
18There is no standard that ensures, for example, that the second 13There is no standard that ensures, for example, that the second
@@ -35,19 +30,17 @@ access this data in a simple and consistent way. That said, such programs
35will have to implement conversion, labeling and hiding of inputs. For 30will have to implement conversion, labeling and hiding of inputs. For
36this reason, it is still not recommended to bypass the library. 31this reason, it is still not recommended to bypass the library.
37 32
38If you are developing a userspace application please send us feedback on
39this standard.
40
41Note that this standard isn't completely established yet, so it is subject
42to changes. If you are writing a new hardware monitoring driver those
43features can't seem to fit in this interface, please contact us with your
44extension proposal. Keep in mind that backward compatibility must be
45preserved.
46
47Each chip gets its own directory in the sysfs /sys/devices tree. To 33Each chip gets its own directory in the sysfs /sys/devices tree. To
48find all sensor chips, it is easier to follow the device symlinks from 34find all sensor chips, it is easier to follow the device symlinks from
49/sys/class/hwmon/hwmon*. 35/sys/class/hwmon/hwmon*.
50 36
37Up to lm-sensors 3.0.0, libsensors looks for hardware monitoring attributes
38in the "physical" device directory. Since lm-sensors 3.0.1, attributes found
39in the hwmon "class" device directory are also supported. Complex drivers
40(e.g. drivers for multifunction chips) may want to use this possibility to
41avoid namespace pollution. The only drawback will be that older versions of
42libsensors won't support the driver in question.
43
51All sysfs values are fixed point numbers. 44All sysfs values are fixed point numbers.
52 45
53There is only one value per file, unlike the older /proc specification. 46There is only one value per file, unlike the older /proc specification.
@@ -336,6 +329,10 @@ power[1-*]_average Average power use
336 Unit: microWatt 329 Unit: microWatt
337 RO 330 RO
338 331
332power[1-*]_average_interval Power use averaging interval
333 Unit: milliseconds
334 RW
335
339power[1-*]_average_highest Historical average maximum power use 336power[1-*]_average_highest Historical average maximum power use
340 Unit: microWatt 337 Unit: microWatt
341 RO 338 RO
@@ -361,6 +358,14 @@ power[1-*]_reset_history Reset input_highest, input_lowest,
361 WO 358 WO
362 359
363********** 360**********
361* Energy *
362**********
363
364energy[1-*]_input Cumulative energy use
365 Unit: microJoule
366 RO
367
368**********
364* Alarms * 369* Alarms *
365********** 370**********
366 371
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf
index 880a59f53da9..6ee36dbafd64 100644
--- a/Documentation/hwmon/w83627hf
+++ b/Documentation/hwmon/w83627hf
@@ -40,10 +40,6 @@ Module Parameters
40 (default is 1) 40 (default is 1)
41 Use 'init=0' to bypass initializing the chip. 41 Use 'init=0' to bypass initializing the chip.
42 Try this if your computer crashes when you load the module. 42 Try this if your computer crashes when you load the module.
43* reset: int
44 (default is 0)
45 The driver used to reset the chip on load, but does no more. Use
46 'reset=1' to restore the old behavior. Report if you need to do this.
47 43
48Description 44Description
49----------- 45-----------
diff --git a/Documentation/hwmon/w83791d b/Documentation/hwmon/w83791d
index f153b2f6d62c..a67d3b7a7098 100644
--- a/Documentation/hwmon/w83791d
+++ b/Documentation/hwmon/w83791d
@@ -22,6 +22,7 @@ Credits:
22 22
23Additional contributors: 23Additional contributors:
24 Sven Anders <anders@anduras.de> 24 Sven Anders <anders@anduras.de>
25 Marc Hulsman <m.hulsman@tudelft.nl>
25 26
26Module Parameters 27Module Parameters
27----------------- 28-----------------
@@ -67,9 +68,8 @@ on until the temperature falls below the Hysteresis value.
67 68
68Fan rotation speeds are reported in RPM (rotations per minute). An alarm is 69Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
69triggered if the rotation speed has dropped below a programmable limit. Fan 70triggered if the rotation speed has dropped below a programmable limit. Fan
70readings can be divided by a programmable divider (1, 2, 4, 8 for fan 1/2/3 71readings can be divided by a programmable divider (1, 2, 4, 8, 16,
71and 1, 2, 4, 8, 16, 32, 64 or 128 for fan 4/5) to give the readings more 7232, 64 or 128 for all fans) to give the readings more range or accuracy.
72range or accuracy.
73 73
74Voltage sensors (also known as IN sensors) report their values in millivolts. 74Voltage sensors (also known as IN sensors) report their values in millivolts.
75An alarm is triggered if the voltage has crossed a programmable minimum 75An alarm is triggered if the voltage has crossed a programmable minimum
diff --git a/Documentation/i2c/busses/i2c-i810 b/Documentation/i2c/busses/i2c-i810
deleted file mode 100644
index 778210ee1583..000000000000
--- a/Documentation/i2c/busses/i2c-i810
+++ /dev/null
@@ -1,47 +0,0 @@
1Kernel driver i2c-i810
2
3Supported adapters:
4 * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH)
5 * Intel 82845G (GMCH)
6
7Authors:
8 Frodo Looijaard <frodol@dds.nl>,
9 Philip Edelbrock <phil@netroedge.com>,
10 Kyösti Mälkki <kmalkki@cc.hut.fi>,
11 Ralph Metzler <rjkm@thp.uni-koeln.de>,
12 Mark D. Studebaker <mdsxyz123@yahoo.com>
13
14Main contact: Mark Studebaker <mdsxyz123@yahoo.com>
15
16Description
17-----------
18
19WARNING: If you have an '810' or '815' motherboard, your standard I2C
20temperature sensors are most likely on the 801's I2C bus. You want the
21i2c-i801 driver for those, not this driver.
22
23Now for the i2c-i810...
24
25The GMCH chip contains two I2C interfaces.
26
27The first interface is used for DDC (Data Display Channel) which is a
28serial channel through the VGA monitor connector to a DDC-compliant
29monitor. This interface is defined by the Video Electronics Standards
30Association (VESA). The standards are available for purchase at
31http://www.vesa.org .
32
33The second interface is a general-purpose I2C bus. It may be connected to a
34TV-out chip such as the BT869 or possibly to a digital flat-panel display.
35
36Features
37--------
38
39Both busses use the i2c-algo-bit driver for 'bit banging'
40and support for specific transactions is provided by i2c-algo-bit.
41
42Issues
43------
44
45If you enable bus testing in i2c-algo-bit (insmod i2c-algo-bit bit_test=1),
46the test may fail; if so, the i2c-i810 driver won't be inserted. However,
47we think this has been fixed.
diff --git a/Documentation/i2c/busses/i2c-prosavage b/Documentation/i2c/busses/i2c-prosavage
deleted file mode 100644
index 703687902511..000000000000
--- a/Documentation/i2c/busses/i2c-prosavage
+++ /dev/null
@@ -1,23 +0,0 @@
1Kernel driver i2c-prosavage
2
3Supported adapters:
4
5 S3/VIA KM266/VT8375 aka ProSavage8
6 S3/VIA KM133/VT8365 aka Savage4
7
8Author: Henk Vergonet <henk@god.dyndns.org>
9
10Description
11-----------
12
13The Savage4 chips contain two I2C interfaces (aka a I2C 'master' or
14'host').
15
16The first interface is used for DDC (Data Display Channel) which is a
17serial channel through the VGA monitor connector to a DDC-compliant
18monitor. This interface is defined by the Video Electronics Standards
19Association (VESA). The standards are available for purchase at
20http://www.vesa.org . The second interface is a general-purpose I2C bus.
21
22Usefull for gaining access to the TV Encoder chips.
23
diff --git a/Documentation/i2c/busses/i2c-savage4 b/Documentation/i2c/busses/i2c-savage4
deleted file mode 100644
index 6ecceab618d3..000000000000
--- a/Documentation/i2c/busses/i2c-savage4
+++ /dev/null
@@ -1,26 +0,0 @@
1Kernel driver i2c-savage4
2
3Supported adapters:
4 * Savage4
5 * Savage2000
6
7Authors:
8 Alexander Wold <awold@bigfoot.com>,
9 Mark D. Studebaker <mdsxyz123@yahoo.com>
10
11Description
12-----------
13
14The Savage4 chips contain two I2C interfaces (aka a I2C 'master'
15or 'host').
16
17The first interface is used for DDC (Data Display Channel) which is a
18serial channel through the VGA monitor connector to a DDC-compliant
19monitor. This interface is defined by the Video Electronics Standards
20Association (VESA). The standards are available for purchase at
21http://www.vesa.org . The DDC bus is not yet supported because its register
22is not directly memory-mapped.
23
24The second interface is a general-purpose I2C bus. This is the only
25interface supported by the driver at the moment.
26
diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
index a0cd8af2f408..10ca43cd1a72 100644
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -49,7 +49,7 @@ $ modprobe max6875 force=0,0x50
49 49
50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple 50The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
51addresses. For example, for address 0x50, it also reserves 0x51. 51addresses. For example, for address 0x50, it also reserves 0x51.
52The even-address instance is called 'max6875', the odd one is 'max6875 subclient'. 52The even-address instance is called 'max6875', the odd one is 'dummy'.
53 53
54 54
55Programming the chip using i2c-dev 55Programming the chip using i2c-dev
diff --git a/Documentation/i2c/chips/pca9539 b/Documentation/i2c/chips/pca9539
index 1d81c530c4a5..6aff890088b1 100644
--- a/Documentation/i2c/chips/pca9539
+++ b/Documentation/i2c/chips/pca9539
@@ -7,7 +7,7 @@ drivers/gpio/pca9539.c instead.
7Supported chips: 7Supported chips:
8 * Philips PCA9539 8 * Philips PCA9539
9 Prefix: 'pca9539' 9 Prefix: 'pca9539'
10 Addresses scanned: 0x74 - 0x77 10 Addresses scanned: none
11 Datasheet: 11 Datasheet:
12 http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf 12 http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf
13 13
@@ -23,6 +23,14 @@ The input sense can also be inverted.
23The 16 lines are split between two bytes. 23The 16 lines are split between two bytes.
24 24
25 25
26Detection
27---------
28
29The PCA9539 is difficult to detect and not commonly found in PC machines,
30so you have to pass the I2C bus and address of the installed PCA9539
31devices explicitly to the driver at load time via the force=... parameter.
32
33
26Sysfs entries 34Sysfs entries
27------------- 35-------------
28 36
diff --git a/Documentation/i2c/chips/pcf8574 b/Documentation/i2c/chips/pcf8574
index 5c1ad1376b62..235815c075ff 100644
--- a/Documentation/i2c/chips/pcf8574
+++ b/Documentation/i2c/chips/pcf8574
@@ -4,13 +4,13 @@ Kernel driver pcf8574
4Supported chips: 4Supported chips:
5 * Philips PCF8574 5 * Philips PCF8574
6 Prefix: 'pcf8574' 6 Prefix: 'pcf8574'
7 Addresses scanned: I2C 0x20 - 0x27 7 Addresses scanned: none
8 Datasheet: Publicly available at the Philips Semiconductors website 8 Datasheet: Publicly available at the Philips Semiconductors website
9 http://www.semiconductors.philips.com/pip/PCF8574P.html 9 http://www.semiconductors.philips.com/pip/PCF8574P.html
10 10
11 * Philips PCF8574A 11 * Philips PCF8574A
12 Prefix: 'pcf8574a' 12 Prefix: 'pcf8574a'
13 Addresses scanned: I2C 0x38 - 0x3f 13 Addresses scanned: none
14 Datasheet: Publicly available at the Philips Semiconductors website 14 Datasheet: Publicly available at the Philips Semiconductors website
15 http://www.semiconductors.philips.com/pip/PCF8574P.html 15 http://www.semiconductors.philips.com/pip/PCF8574P.html
16 16
@@ -38,12 +38,10 @@ For more informations see the datasheet.
38Accessing PCF8574(A) via /sys interface 38Accessing PCF8574(A) via /sys interface
39------------------------------------- 39-------------------------------------
40 40
41! Be careful !
42The PCF8574(A) is plainly impossible to detect ! Stupid chip. 41The PCF8574(A) is plainly impossible to detect ! Stupid chip.
43So every chip with address in the interval [20..27] and [38..3f] are 42So, you have to pass the I2C bus and address of the installed PCF857A
44detected as PCF8574(A). If you have other chips in this address 43and PCF8574A devices explicitly to the driver at load time via the
45range, the workaround is to load this module after the one 44force=... parameter.
46for your others chips.
47 45
48On detection (i.e. insmod, modprobe et al.), directories are being 46On detection (i.e. insmod, modprobe et al.), directories are being
49created for each detected PCF8574(A): 47created for each detected PCF8574(A):
diff --git a/Documentation/i2c/chips/pcf8575 b/Documentation/i2c/chips/pcf8575
index 25f5698a61cf..40b268eb276f 100644
--- a/Documentation/i2c/chips/pcf8575
+++ b/Documentation/i2c/chips/pcf8575
@@ -40,12 +40,9 @@ Detection
40--------- 40---------
41 41
42There is no method known to detect whether a chip on a given I2C address is 42There is no method known to detect whether a chip on a given I2C address is
43a PCF8575 or whether it is any other I2C device. So there are two alternatives 43a PCF8575 or whether it is any other I2C device, so you have to pass the I2C
44to let the driver find the installed PCF8575 devices: 44bus and address of the installed PCF8575 devices explicitly to the driver at
45- Load this driver after any other I2C driver for I2C devices with addresses 45load time via the force=... parameter.
46 in the range 0x20 .. 0x27.
47- Pass the I2C bus and address of the installed PCF8575 devices explicitly to
48 the driver at load time via the probe=... or force=... parameters.
49 46
50/sys interface 47/sys interface
51-------------- 48--------------
diff --git a/Documentation/i2c/fault-codes b/Documentation/i2c/fault-codes
new file mode 100644
index 000000000000..045765c0b9b5
--- /dev/null
+++ b/Documentation/i2c/fault-codes
@@ -0,0 +1,127 @@
1This is a summary of the most important conventions for use of fault
2codes in the I2C/SMBus stack.
3
4
5A "Fault" is not always an "Error"
6----------------------------------
7Not all fault reports imply errors; "page faults" should be a familiar
8example. Software often retries idempotent operations after transient
9faults. There may be fancier recovery schemes that are appropriate in
10some cases, such as re-initializing (and maybe resetting). After such
11recovery, triggered by a fault report, there is no error.
12
13In a similar way, sometimes a "fault" code just reports one defined
14result for an operation ... it doesn't indicate that anything is wrong
15at all, just that the outcome wasn't on the "golden path".
16
17In short, your I2C driver code may need to know these codes in order
18to respond correctly. Other code may need to rely on YOUR code reporting
19the right fault code, so that it can (in turn) behave correctly.
20
21
22I2C and SMBus fault codes
23-------------------------
24These are returned as negative numbers from most calls, with zero or
25some positive number indicating a non-fault return. The specific
26numbers associated with these symbols differ between architectures,
27though most Linux systems use <asm-generic/errno*.h> numbering.
28
29Note that the descriptions here are not exhaustive. There are other
30codes that may be returned, and other cases where these codes should
31be returned. However, drivers should not return other codes for these
32cases (unless the hardware doesn't provide unique fault reports).
33
34Also, codes returned by adapter probe methods follow rules which are
35specific to their host bus (such as PCI, or the platform bus).
36
37
38EAGAIN
39 Returned by I2C adapters when they lose arbitration in master
40 transmit mode: some other master was transmitting different
41 data at the same time.
42
43 Also returned when trying to invoke an I2C operation in an
44 atomic context, when some task is already using that I2C bus
45 to execute some other operation.
46
47EBADMSG
48 Returned by SMBus logic when an invalid Packet Error Code byte
49 is received. This code is a CRC covering all bytes in the
50 transaction, and is sent before the terminating STOP. This
51 fault is only reported on read transactions; the SMBus slave
52 may have a way to report PEC mismatches on writes from the
53 host. Note that even if PECs are in use, you should not rely
54 on these as the only way to detect incorrect data transfers.
55
56EBUSY
57 Returned by SMBus adapters when the bus was busy for longer
58 than allowed. This usually indicates some device (maybe the
59 SMBus adapter) needs some fault recovery (such as resetting),
60 or that the reset was attempted but failed.
61
62EINVAL
63 This rather vague error means an invalid parameter has been
64 detected before any I/O operation was started. Use a more
65 specific fault code when you can.
66
67 One example would be a driver trying an SMBus Block Write
68 with block size outside the range of 1-32 bytes.
69
70EIO
71 This rather vague error means something went wrong when
72 performing an I/O operation. Use a more specific fault
73 code when you can.
74
75ENODEV
76 Returned by driver probe() methods. This is a bit more
77 specific than ENXIO, implying the problem isn't with the
78 address, but with the device found there. Driver probes
79 may verify the device returns *correct* responses, and
80 return this as appropriate. (The driver core will warn
81 about probe faults other than ENXIO and ENODEV.)
82
83ENOMEM
84 Returned by any component that can't allocate memory when
85 it needs to do so.
86
87ENXIO
88 Returned by I2C adapters to indicate that the address phase
89 of a transfer didn't get an ACK. While it might just mean
90 an I2C device was temporarily not responding, usually it
91 means there's nothing listening at that address.
92
93 Returned by driver probe() methods to indicate that they
94 found no device to bind to. (ENODEV may also be used.)
95
96EOPNOTSUPP
97 Returned by an adapter when asked to perform an operation
98 that it doesn't, or can't, support.
99
100 For example, this would be returned when an adapter that
101 doesn't support SMBus block transfers is asked to execute
102 one. In that case, the driver making that request should
103 have verified that functionality was supported before it
104 made that block transfer request.
105
106 Similarly, if an I2C adapter can't execute all legal I2C
107 messages, it should return this when asked to perform a
108 transaction it can't. (These limitations can't be seen in
109 the adapter's functionality mask, since the assumption is
110 that if an adapter supports I2C it supports all of I2C.)
111
112EPROTO
113 Returned when slave does not conform to the relevant I2C
114 or SMBus (or chip-specific) protocol specifications. One
115 case is when the length of an SMBus block data response
116 (from the SMBus slave) is outside the range 1-32 bytes.
117
118ETIMEDOUT
119 This is returned by drivers when an operation took too much
120 time, and was aborted before it completed.
121
122 SMBus adapters may return it when an operation took more
123 time than allowed by the SMBus specification; for example,
124 when a slave stretches clocks too far. I2C has no such
125 timeouts, but it's normal for I2C adapters to impose some
126 arbitrary limits (much longer than SMBus!) too.
127
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol
index 03f08fb491cc..24bfb65da17d 100644
--- a/Documentation/i2c/smbus-protocol
+++ b/Documentation/i2c/smbus-protocol
@@ -42,8 +42,8 @@ Count (8 bits): A data byte containing the length of a block operation.
42[..]: Data sent by I2C device, as opposed to data sent by the host adapter. 42[..]: Data sent by I2C device, as opposed to data sent by the host adapter.
43 43
44 44
45SMBus Quick Command: i2c_smbus_write_quick() 45SMBus Quick Command
46============================================= 46===================
47 47
48This sends a single bit to the device, at the place of the Rd/Wr bit. 48This sends a single bit to the device, at the place of the Rd/Wr bit.
49 49
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients
new file mode 100644
index 000000000000..9a45f9bb6a25
--- /dev/null
+++ b/Documentation/i2c/upgrading-clients
@@ -0,0 +1,281 @@
1Upgrading I2C Drivers to the new 2.6 Driver Model
2=================================================
3
4Ben Dooks <ben-linux@fluff.org>
5
6Introduction
7------------
8
9This guide outlines how to alter existing Linux 2.6 client drivers from
10the old to the new new binding methods.
11
12
13Example old-style driver
14------------------------
15
16
17struct example_state {
18 struct i2c_client client;
19 ....
20};
21
22static struct i2c_driver example_driver;
23
24static unsigned short ignore[] = { I2C_CLIENT_END };
25static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END };
26
27I2C_CLIENT_INSMOD;
28
29static int example_attach(struct i2c_adapter *adap, int addr, int kind)
30{
31 struct example_state *state;
32 struct device *dev = &adap->dev; /* to use for dev_ reports */
33 int ret;
34
35 state = kzalloc(sizeof(struct example_state), GFP_KERNEL);
36 if (state == NULL) {
37 dev_err(dev, "failed to create our state\n");
38 return -ENOMEM;
39 }
40
41 example->client.addr = addr;
42 example->client.flags = 0;
43 example->client.adapter = adap;
44
45 i2c_set_clientdata(&state->i2c_client, state);
46 strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE);
47
48 ret = i2c_attach_client(&state->i2c_client);
49 if (ret < 0) {
50 dev_err(dev, "failed to attach client\n");
51 kfree(state);
52 return ret;
53 }
54
55 dev = &state->i2c_client.dev;
56
57 /* rest of the initialisation goes here. */
58
59 dev_info(dev, "example client created\n");
60
61 return 0;
62}
63
64static int __devexit example_detach(struct i2c_client *client)
65{
66 struct example_state *state = i2c_get_clientdata(client);
67
68 i2c_detach_client(client);
69 kfree(state);
70 return 0;
71}
72
73static int example_attach_adapter(struct i2c_adapter *adap)
74{
75 return i2c_probe(adap, &addr_data, example_attach);
76}
77
78static struct i2c_driver example_driver = {
79 .driver = {
80 .owner = THIS_MODULE,
81 .name = "example",
82 },
83 .attach_adapter = example_attach_adapter,
84 .detach_client = __devexit_p(example_detach),
85 .suspend = example_suspend,
86 .resume = example_resume,
87};
88
89
90Updating the client
91-------------------
92
93The new style binding model will check against a list of supported
94devices and their associated address supplied by the code registering
95the busses. This means that the driver .attach_adapter and
96.detach_adapter methods can be removed, along with the addr_data,
97as follows:
98
99- static struct i2c_driver example_driver;
100
101- static unsigned short ignore[] = { I2C_CLIENT_END };
102- static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END };
103
104- I2C_CLIENT_INSMOD;
105
106- static int example_attach_adapter(struct i2c_adapter *adap)
107- {
108- return i2c_probe(adap, &addr_data, example_attach);
109- }
110
111 static struct i2c_driver example_driver = {
112- .attach_adapter = example_attach_adapter,
113- .detach_client = __devexit_p(example_detach),
114 }
115
116Add the probe and remove methods to the i2c_driver, as so:
117
118 static struct i2c_driver example_driver = {
119+ .probe = example_probe,
120+ .remove = __devexit_p(example_remove),
121 }
122
123Change the example_attach method to accept the new parameters
124which include the i2c_client that it will be working with:
125
126- static int example_attach(struct i2c_adapter *adap, int addr, int kind)
127+ static int example_probe(struct i2c_client *client,
128+ const struct i2c_device_id *id)
129
130Change the name of example_attach to example_probe to align it with the
131i2c_driver entry names. The rest of the probe routine will now need to be
132changed as the i2c_client has already been setup for use.
133
134The necessary client fields have already been setup before
135the probe function is called, so the following client setup
136can be removed:
137
138- example->client.addr = addr;
139- example->client.flags = 0;
140- example->client.adapter = adap;
141-
142- strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE);
143
144The i2c_set_clientdata is now:
145
146- i2c_set_clientdata(&state->client, state);
147+ i2c_set_clientdata(client, state);
148
149The call to i2c_attach_client is no longer needed, if the probe
150routine exits successfully, then the driver will be automatically
151attached by the core. Change the probe routine as so:
152
153- ret = i2c_attach_client(&state->i2c_client);
154- if (ret < 0) {
155- dev_err(dev, "failed to attach client\n");
156- kfree(state);
157- return ret;
158- }
159
160
161Remove the storage of 'struct i2c_client' from the 'struct example_state'
162as we are provided with the i2c_client in our example_probe. Instead we
163store a pointer to it for when it is needed.
164
165struct example_state {
166- struct i2c_client client;
167+ struct i2c_client *client;
168
169the new i2c client as so:
170
171- struct device *dev = &adap->dev; /* to use for dev_ reports */
172+ struct device *dev = &i2c_client->dev; /* to use for dev_ reports */
173
174And remove the change after our client is attached, as the driver no
175longer needs to register a new client structure with the core:
176
177- dev = &state->i2c_client.dev;
178
179In the probe routine, ensure that the new state has the client stored
180in it:
181
182static int example_probe(struct i2c_client *i2c_client,
183 const struct i2c_device_id *id)
184{
185 struct example_state *state;
186 struct device *dev = &i2c_client->dev;
187 int ret;
188
189 state = kzalloc(sizeof(struct example_state), GFP_KERNEL);
190 if (state == NULL) {
191 dev_err(dev, "failed to create our state\n");
192 return -ENOMEM;
193 }
194
195+ state->client = i2c_client;
196
197Update the detach method, by changing the name to _remove and
198to delete the i2c_detach_client call. It is possible that you
199can also remove the ret variable as it is not not needed for
200any of the core functions.
201
202- static int __devexit example_detach(struct i2c_client *client)
203+ static int __devexit example_remove(struct i2c_client *client)
204{
205 struct example_state *state = i2c_get_clientdata(client);
206
207- i2c_detach_client(client);
208
209And finally ensure that we have the correct ID table for the i2c-core
210and other utilities:
211
212+ struct i2c_device_id example_idtable[] = {
213+ { "example", 0 },
214+ { }
215+};
216+
217+MODULE_DEVICE_TABLE(i2c, example_idtable);
218
219static struct i2c_driver example_driver = {
220 .driver = {
221 .owner = THIS_MODULE,
222 .name = "example",
223 },
224+ .id_table = example_ids,
225
226
227Our driver should now look like this:
228
229struct example_state {
230 struct i2c_client *client;
231 ....
232};
233
234static int example_probe(struct i2c_client *client,
235 const struct i2c_device_id *id)
236{
237 struct example_state *state;
238 struct device *dev = &client->dev;
239
240 state = kzalloc(sizeof(struct example_state), GFP_KERNEL);
241 if (state == NULL) {
242 dev_err(dev, "failed to create our state\n");
243 return -ENOMEM;
244 }
245
246 state->client = client;
247 i2c_set_clientdata(client, state);
248
249 /* rest of the initialisation goes here. */
250
251 dev_info(dev, "example client created\n");
252
253 return 0;
254}
255
256static int __devexit example_remove(struct i2c_client *client)
257{
258 struct example_state *state = i2c_get_clientdata(client);
259
260 kfree(state);
261 return 0;
262}
263
264static struct i2c_device_id example_idtable[] = {
265 { "example", 0 },
266 { }
267};
268
269MODULE_DEVICE_TABLE(i2c, example_idtable);
270
271static struct i2c_driver example_driver = {
272 .driver = {
273 .owner = THIS_MODULE,
274 .name = "example",
275 },
276 .id_table = example_idtable,
277 .probe = example_probe,
278 .remove = __devexit_p(example_remove),
279 .suspend = example_suspend,
280 .resume = example_resume,
281};
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index ee75cbace28d..6b61b3a2e90b 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -25,14 +25,29 @@ routines, and should be zero-initialized except for fields with data you
25provide. A client structure holds device-specific information like the 25provide. A client structure holds device-specific information like the
26driver model device node, and its I2C address. 26driver model device node, and its I2C address.
27 27
28/* iff driver uses driver model ("new style") binding model: */
29
30static struct i2c_device_id foo_idtable[] = {
31 { "foo", my_id_for_foo },
32 { "bar", my_id_for_bar },
33 { }
34};
35
36MODULE_DEVICE_TABLE(i2c, foo_idtable);
37
28static struct i2c_driver foo_driver = { 38static struct i2c_driver foo_driver = {
29 .driver = { 39 .driver = {
30 .name = "foo", 40 .name = "foo",
31 }, 41 },
32 42
33 /* iff driver uses driver model ("new style") binding model: */ 43 /* iff driver uses driver model ("new style") binding model: */
44 .id_table = foo_ids,
34 .probe = foo_probe, 45 .probe = foo_probe,
35 .remove = foo_remove, 46 .remove = foo_remove,
47 /* if device autodetection is needed: */
48 .class = I2C_CLASS_SOMETHING,
49 .detect = foo_detect,
50 .address_data = &addr_data,
36 51
37 /* else, driver uses "legacy" binding model: */ 52 /* else, driver uses "legacy" binding model: */
38 .attach_adapter = foo_attach_adapter, 53 .attach_adapter = foo_attach_adapter,
@@ -173,10 +188,9 @@ handle may be used during foo_probe(). If foo_probe() reports success
173(zero not a negative status code) it may save the handle and use it until 188(zero not a negative status code) it may save the handle and use it until
174foo_remove() returns. That binding model is used by most Linux drivers. 189foo_remove() returns. That binding model is used by most Linux drivers.
175 190
176Drivers match devices when i2c_client.driver_name and the driver name are 191The probe function is called when an entry in the id_table name field
177the same; this approach is used in several other busses that don't have 192matches the device's name. It is passed the entry that was matched so
178device typing support in the hardware. The driver and module name should 193the driver knows which one in the table matched.
179match, so hotplug/coldplug mechanisms will modprobe the driver.
180 194
181 195
182Device Creation (Standard driver model) 196Device Creation (Standard driver model)
@@ -207,6 +221,31 @@ in the I2C bus driver. You may want to save the returned i2c_client
207reference for later use. 221reference for later use.
208 222
209 223
224Device Detection (Standard driver model)
225----------------------------------------
226
227Sometimes you do not know in advance which I2C devices are connected to
228a given I2C bus. This is for example the case of hardware monitoring
229devices on a PC's SMBus. In that case, you may want to let your driver
230detect supported devices automatically. This is how the legacy model
231was working, and is now available as an extension to the standard
232driver model (so that we can finally get rid of the legacy model.)
233
234You simply have to define a detect callback which will attempt to
235identify supported devices (returning 0 for supported ones and -ENODEV
236for unsupported ones), a list of addresses to probe, and a device type
237(or class) so that only I2C buses which may have that type of device
238connected (and not otherwise enumerated) will be probed. The i2c
239core will then call you back as needed and will instantiate a device
240for you for every successful detection.
241
242Note that this mechanism is purely optional and not suitable for all
243devices. You need some reliable way to identify the supported devices
244(typically using device-specific, dedicated identification registers),
245otherwise misdetections are likely to occur and things can get wrong
246quickly.
247
248
210Device Deletion (Standard driver model) 249Device Deletion (Standard driver model)
211--------------------------------------- 250---------------------------------------
212 251
@@ -559,7 +598,6 @@ SMBus communication
559 in terms of it. Never use this function directly! 598 in terms of it. Never use this function directly!
560 599
561 600
562 extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
563 extern s32 i2c_smbus_read_byte(struct i2c_client * client); 601 extern s32 i2c_smbus_read_byte(struct i2c_client * client);
564 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value); 602 extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
565 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command); 603 extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
@@ -568,30 +606,31 @@ SMBus communication
568 extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 606 extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
569 extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 607 extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
570 u8 command, u16 value); 608 u8 command, u16 value);
609 extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
610 u8 command, u8 *values);
571 extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 611 extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
572 u8 command, u8 length, 612 u8 command, u8 length,
573 u8 *values); 613 u8 *values);
574 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 614 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
575 u8 command, u8 length, u8 *values); 615 u8 command, u8 length, u8 *values);
576
577These ones were removed in Linux 2.6.10 because they had no users, but could
578be added back later if needed:
579
580 extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
581 u8 command, u8 *values);
582 extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 616 extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
583 u8 command, u8 length, 617 u8 command, u8 length,
584 u8 *values); 618 u8 *values);
619
620These ones were removed from i2c-core because they had no users, but could
621be added back later if needed:
622
623 extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
585 extern s32 i2c_smbus_process_call(struct i2c_client * client, 624 extern s32 i2c_smbus_process_call(struct i2c_client * client,
586 u8 command, u16 value); 625 u8 command, u16 value);
587 extern s32 i2c_smbus_block_process_call(struct i2c_client *client, 626 extern s32 i2c_smbus_block_process_call(struct i2c_client *client,
588 u8 command, u8 length, 627 u8 command, u8 length,
589 u8 *values) 628 u8 *values)
590 629
591All these transactions return -1 on failure. The 'write' transactions 630All these transactions return a negative errno value on failure. The 'write'
592return 0 on success; the 'read' transactions return the read value, except 631transactions return 0 on success; the 'read' transactions return the read
593for read_block, which returns the number of values read. The block buffers 632value, except for block transactions, which return the number of values
594need not be longer than 32 bytes. 633read. The block buffers need not be longer than 32 bytes.
595 634
596You can read the file `smbus-protocol' for more information about the 635You can read the file `smbus-protocol' for more information about the
597actual SMBus protocol. 636actual SMBus protocol.
diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile
new file mode 100644
index 000000000000..b75db69ec483
--- /dev/null
+++ b/Documentation/ia64/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 := aliasing-test
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt
index bec9d815da33..914d07f49268 100644
--- a/Documentation/ia64/kvm.txt
+++ b/Documentation/ia64/kvm.txt
@@ -50,9 +50,9 @@ Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qe
50 /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image 50 /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image
51 (xx is the number of virtual processors for the guest, now the maximum value is 4) 51 (xx is the number of virtual processors for the guest, now the maximum value is 4)
52 52
535. Known possibile issue on some platforms with old Firmware. 535. Known possible issue on some platforms with old Firmware.
54 54
55If meet strange host crashe issues, try to solve it through either of the following ways: 55In the event of strange host crash issues, try to solve it through either of the following ways:
56 56
57(1): Upgrade your Firmware to the latest one. 57(1): Upgrade your Firmware to the latest one.
58 58
@@ -65,8 +65,8 @@ index 0b53344..f02b0f7 100644
65 mov ar.pfs = loc1 65 mov ar.pfs = loc1
66 mov rp = loc0 66 mov rp = loc0
67 ;; 67 ;;
68- srlz.d // seralize restoration of psr.l 68- srlz.d // serialize restoration of psr.l
69+ srlz.i // seralize restoration of psr.l 69+ srlz.i // serialize restoration of psr.l
70+ ;; 70+ ;;
71 br.ret.sptk.many b0 71 br.ret.sptk.many b0
72 END(ia64_pal_call_static) 72 END(ia64_pal_call_static)
diff --git a/Documentation/ia64/paravirt_ops.txt b/Documentation/ia64/paravirt_ops.txt
new file mode 100644
index 000000000000..39ded02ec33f
--- /dev/null
+++ b/Documentation/ia64/paravirt_ops.txt
@@ -0,0 +1,137 @@
1Paravirt_ops on IA64
2====================
3 21 May 2008, Isaku Yamahata <yamahata@valinux.co.jp>
4
5
6Introduction
7------------
8The aim of this documentation is to help with maintainability and/or to
9encourage people to use paravirt_ops/IA64.
10
11paravirt_ops (pv_ops in short) is a way for virtualization support of
12Linux kernel on x86. Several ways for virtualization support were
13proposed, paravirt_ops is the winner.
14On the other hand, now there are also several IA64 virtualization
15technologies like kvm/IA64, xen/IA64 and many other academic IA64
16hypervisors so that it is good to add generic virtualization
17infrastructure on Linux/IA64.
18
19
20What is paravirt_ops?
21---------------------
22It has been developed on x86 as virtualization support via API, not ABI.
23It allows each hypervisor to override operations which are important for
24hypervisors at API level. And it allows a single kernel binary to run on
25all supported execution environments including native machine.
26Essentially paravirt_ops is a set of function pointers which represent
27operations corresponding to low level sensitive instructions and high
28level functionalities in various area. But one significant difference
29from usual function pointer table is that it allows optimization with
30binary patch. It is because some of these operations are very
31performance sensitive and indirect call overhead is not negligible.
32With binary patch, indirect C function call can be transformed into
33direct C function call or in-place execution to eliminate the overhead.
34
35Thus, operations of paravirt_ops are classified into three categories.
36- simple indirect call
37 These operations correspond to high level functionality so that the
38 overhead of indirect call isn't very important.
39
40- indirect call which allows optimization with binary patch
41 Usually these operations correspond to low level instructions. They
42 are called frequently and performance critical. So the overhead is
43 very important.
44
45- a set of macros for hand written assembly code
46 Hand written assembly codes (.S files) also need paravirtualization
47 because they include sensitive instructions or some of code paths in
48 them are very performance critical.
49
50
51The relation to the IA64 machine vector
52---------------------------------------
53Linux/IA64 has the IA64 machine vector functionality which allows the
54kernel to switch implementations (e.g. initialization, ipi, dma api...)
55depending on executing platform.
56We can replace some implementations very easily defining a new machine
57vector. Thus another approach for virtualization support would be
58enhancing the machine vector functionality.
59But paravirt_ops approach was taken because
60- virtualization support needs wider support than machine vector does.
61 e.g. low level instruction paravirtualization. It must be
62 initialized very early before platform detection.
63
64- virtualization support needs more functionality like binary patch.
65 Probably the calling overhead might not be very large compared to the
66 emulation overhead of virtualization. However in the native case, the
67 overhead should be eliminated completely.
68 A single kernel binary should run on each environment including native,
69 and the overhead of paravirt_ops on native environment should be as
70 small as possible.
71
72- for full virtualization technology, e.g. KVM/IA64 or
73 Xen/IA64 HVM domain, the result would be
74 (the emulated platform machine vector. probably dig) + (pv_ops).
75 This means that the virtualization support layer should be under
76 the machine vector layer.
77
78Possibly it might be better to move some function pointers from
79paravirt_ops to machine vector. In fact, Xen domU case utilizes both
80pv_ops and machine vector.
81
82
83IA64 paravirt_ops
84-----------------
85In this section, the concrete paravirt_ops will be discussed.
86Because of the architecture difference between ia64 and x86, the
87resulting set of functions is very different from x86 pv_ops.
88
89- C function pointer tables
90They are not very performance critical so that simple C indirect
91function call is acceptable. The following structures are defined at
92this moment. For details see linux/include/asm-ia64/paravirt.h
93 - struct pv_info
94 This structure describes the execution environment.
95 - struct pv_init_ops
96 This structure describes the various initialization hooks.
97 - struct pv_iosapic_ops
98 This structure describes hooks to iosapic operations.
99 - struct pv_irq_ops
100 This structure describes hooks to irq related operations
101 - struct pv_time_op
102 This structure describes hooks to steal time accounting.
103
104- a set of indirect calls which need optimization
105Currently this class of functions correspond to a subset of IA64
106intrinsics. At this moment the optimization with binary patch isn't
107implemented yet.
108struct pv_cpu_op is defined. For details see
109linux/include/asm-ia64/paravirt_privop.h
110Mostly they correspond to ia64 intrinsics 1-to-1.
111Caveat: Now they are defined as C indirect function pointers, but in
112order to support binary patch optimization, they will be changed
113using GCC extended inline assembly code.
114
115- a set of macros for hand written assembly code (.S files)
116For maintenance purpose, the taken approach for .S files is single
117source code and compile multiple times with different macros definitions.
118Each pv_ops instance must define those macros to compile.
119The important thing here is that sensitive, but non-privileged
120instructions must be paravirtualized and that some privileged
121instructions also need paravirtualization for reasonable performance.
122Developers who modify .S files must be aware of that. At this moment
123an easy checker is implemented to detect paravirtualization breakage.
124But it doesn't cover all the cases.
125
126Sometimes this set of macros is called pv_cpu_asm_op. But there is no
127corresponding structure in the source code.
128Those macros mostly 1:1 correspond to a subset of privileged
129instructions. See linux/include/asm-ia64/native/inst.h.
130And some functions written in assembly also need to be overrided so
131that each pv_ops instance have to define some macros. Again see
132linux/include/asm-ia64/native/inst.h.
133
134
135Those structures must be initialized very early before start_kernel.
136Probably initialized in head.S using multi entry point or some other trick.
137For native case implementation see linux/arch/ia64/kernel/paravirt.c.
diff --git a/Documentation/input/cs461x.txt b/Documentation/input/cs461x.txt
index afe0d6543e09..202e9dbacec3 100644
--- a/Documentation/input/cs461x.txt
+++ b/Documentation/input/cs461x.txt
@@ -31,7 +31,7 @@ The driver works with ALSA drivers simultaneously. For example, the xracer
31uses joystick as input device and PCM device as sound output in one time. 31uses joystick as input device and PCM device as sound output in one time.
32There are no sound or input collisions detected. The source code have 32There are no sound or input collisions detected. The source code have
33comments about them; but I've found the joystick can be initialized 33comments about them; but I've found the joystick can be initialized
34separately of ALSA modules. So, you canm use only one joystick driver 34separately of ALSA modules. So, you can use only one joystick driver
35without ALSA drivers. The ALSA drivers are not needed to compile or 35without ALSA drivers. The ALSA drivers are not needed to compile or
36run this driver. 36run this driver.
37 37
diff --git a/Documentation/input/gameport-programming.txt b/Documentation/input/gameport-programming.txt
index 14e0a8b70225..03a74fc3b496 100644
--- a/Documentation/input/gameport-programming.txt
+++ b/Documentation/input/gameport-programming.txt
@@ -1,5 +1,3 @@
1$Id: gameport-programming.txt,v 1.3 2001/04/24 13:51:37 vojtech Exp $
2
3Programming gameport drivers 1Programming gameport drivers
4~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 3
diff --git a/Documentation/input/input.txt b/Documentation/input/input.txt
index ff8cea0225f9..686ee9932dff 100644
--- a/Documentation/input/input.txt
+++ b/Documentation/input/input.txt
@@ -1,7 +1,6 @@
1 Linux Input drivers v1.0 1 Linux Input drivers v1.0
2 (c) 1999-2001 Vojtech Pavlik <vojtech@ucw.cz> 2 (c) 1999-2001 Vojtech Pavlik <vojtech@ucw.cz>
3 Sponsored by SuSE 3 Sponsored by SuSE
4 $Id: input.txt,v 1.8 2002/05/29 03:15:01 bradleym Exp $
5---------------------------------------------------------------------------- 4----------------------------------------------------------------------------
6 5
70. Disclaimer 60. Disclaimer
diff --git a/Documentation/input/joystick-api.txt b/Documentation/input/joystick-api.txt
index acbd32b88454..c507330740cd 100644
--- a/Documentation/input/joystick-api.txt
+++ b/Documentation/input/joystick-api.txt
@@ -5,8 +5,6 @@
5 5
6 7 Aug 1998 6 7 Aug 1998
7 7
8 $Id: joystick-api.txt,v 1.2 2001/05/08 21:21:23 vojtech Exp $
9
101. Initialization 81. Initialization
11~~~~~~~~~~~~~~~~~ 9~~~~~~~~~~~~~~~~~
12 10
diff --git a/Documentation/input/joystick-parport.txt b/Documentation/input/joystick-parport.txt
index ede5f33daad3..1c856f32ff2c 100644
--- a/Documentation/input/joystick-parport.txt
+++ b/Documentation/input/joystick-parport.txt
@@ -2,7 +2,6 @@
2 (c) 1998-2000 Vojtech Pavlik <vojtech@ucw.cz> 2 (c) 1998-2000 Vojtech Pavlik <vojtech@ucw.cz>
3 (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de> 3 (c) 1998 Andree Borrmann <a.borrmann@tu-bs.de>
4 Sponsored by SuSE 4 Sponsored by SuSE
5 $Id: joystick-parport.txt,v 1.6 2001/09/25 09:31:32 vojtech Exp $
6---------------------------------------------------------------------------- 5----------------------------------------------------------------------------
7 6
80. Disclaimer 70. Disclaimer
diff --git a/Documentation/input/joystick.txt b/Documentation/input/joystick.txt
index 389de9bd9878..154d767b2acb 100644
--- a/Documentation/input/joystick.txt
+++ b/Documentation/input/joystick.txt
@@ -1,7 +1,6 @@
1 Linux Joystick driver v2.0.0 1 Linux Joystick driver v2.0.0
2 (c) 1996-2000 Vojtech Pavlik <vojtech@ucw.cz> 2 (c) 1996-2000 Vojtech Pavlik <vojtech@ucw.cz>
3 Sponsored by SuSE 3 Sponsored by SuSE
4 $Id: joystick.txt,v 1.12 2002/03/03 12:13:07 jdeneux Exp $
5---------------------------------------------------------------------------- 4----------------------------------------------------------------------------
6 5
70. Disclaimer 60. Disclaimer
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt
index 240ce7a56c40..1c6b545635a2 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl-number.txt
@@ -105,7 +105,6 @@ Code Seq# Include File Comments
105'T' all linux/soundcard.h conflict! 105'T' all linux/soundcard.h conflict!
106'T' all asm-i386/ioctls.h conflict! 106'T' all asm-i386/ioctls.h conflict!
107'U' 00-EF linux/drivers/usb/usb.h 107'U' 00-EF linux/drivers/usb/usb.h
108'U' F0-FF drivers/usb/auerswald.c
109'V' all linux/vt.h 108'V' all linux/vt.h
110'W' 00-1F linux/watchdog.h conflict! 109'W' 00-1F linux/watchdog.h conflict!
111'W' 00-1F linux/wanrouter.h conflict! 110'W' 00-1F linux/wanrouter.h conflict!
@@ -117,6 +116,7 @@ Code Seq# Include File Comments
117 <mailto:natalia@nikhefk.nikhef.nl> 116 <mailto:natalia@nikhefk.nikhef.nl>
118'c' 00-7F linux/comstats.h conflict! 117'c' 00-7F linux/comstats.h conflict!
119'c' 00-7F linux/coda.h conflict! 118'c' 00-7F linux/coda.h conflict!
119'c' 80-9F asm-s390/chsc.h
120'd' 00-FF linux/char/drm/drm/h conflict! 120'd' 00-FF linux/char/drm/drm/h conflict!
121'd' 00-DF linux/video_decoder.h conflict! 121'd' 00-DF linux/video_decoder.h conflict!
122'd' F0-FF linux/digi1.h 122'd' F0-FF linux/digi1.h
diff --git a/Documentation/ioctl/cdrom.txt b/Documentation/ioctl/cdrom.txt
index 62d4af44ec4a..59df81c8da2b 100644
--- a/Documentation/ioctl/cdrom.txt
+++ b/Documentation/ioctl/cdrom.txt
@@ -271,14 +271,14 @@ CDROMCLOSETRAY pendant of CDROMEJECT
271 271
272 usage: 272 usage:
273 273
274 ioctl(fd, CDROMEJECT, 0); 274 ioctl(fd, CDROMCLOSETRAY, 0);
275 275
276 inputs: none 276 inputs: none
277 277
278 outputs: none 278 outputs: none
279 279
280 error returns: 280 error returns:
281 ENOSYS cd drive not capable of ejecting 281 ENOSYS cd drive not capable of closing the tray
282 EBUSY other processes are accessing drive, or door is locked 282 EBUSY other processes are accessing drive, or door is locked
283 283
284 notes: 284 notes:
diff --git a/Documentation/ioctl/hdio.txt b/Documentation/ioctl/hdio.txt
index c19efdeace2c..91a6ecbae0bb 100644
--- a/Documentation/ioctl/hdio.txt
+++ b/Documentation/ioctl/hdio.txt
@@ -508,12 +508,13 @@ HDIO_DRIVE_RESET execute a device reset
508 508
509 error returns: 509 error returns:
510 EACCES Access denied: requires CAP_SYS_ADMIN 510 EACCES Access denied: requires CAP_SYS_ADMIN
511 ENXIO No such device: phy dead or ctl_addr == 0
512 EIO I/O error: reset timed out or hardware error
511 513
512 notes: 514 notes:
513 515
514 Abort any current command, prevent anything else from being 516 Execute a reset on the device as soon as the current IO
515 queued, execute a reset on the device, and issue BLKRRPART 517 operation has completed.
516 ioctl on the block device.
517 518
518 Executes an ATAPI soft reset if applicable, otherwise 519 Executes an ATAPI soft reset if applicable, otherwise
519 executes an ATA soft reset on the controller. 520 executes an ATA soft reset on the controller.
diff --git a/Documentation/ioctl/ioctl-decoding.txt b/Documentation/ioctl/ioctl-decoding.txt
index bfdf7f3ee4f0..e35efb0cec2e 100644
--- a/Documentation/ioctl/ioctl-decoding.txt
+++ b/Documentation/ioctl/ioctl-decoding.txt
@@ -1,6 +1,6 @@
1To decode a hex IOCTL code: 1To decode a hex IOCTL code:
2 2
3Most architecures use this generic format, but check 3Most architectures use this generic format, but check
4include/ARCH/ioctl.h for specifics, e.g. powerpc 4include/ARCH/ioctl.h for specifics, e.g. powerpc
5uses 3 bits to encode read/write and 13 bits for size. 5uses 3 bits to encode read/write and 13 bits for size.
6 6
@@ -18,7 +18,7 @@ uses 3 bits to encode read/write and 13 bits for size.
18 7-0 function # 18 7-0 function #
19 19
20 20
21 So for example 0x82187201 is a read with arg length of 0x218, 21So for example 0x82187201 is a read with arg length of 0x218,
22character 'r' function 1. Grepping the source reveals this is: 22character 'r' function 1. Grepping the source reveals this is:
23 23
24#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2]) 24#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
diff --git a/Documentation/iostats.txt b/Documentation/iostats.txt
index 5925c3cd030d..59a69ec67c40 100644
--- a/Documentation/iostats.txt
+++ b/Documentation/iostats.txt
@@ -143,7 +143,7 @@ disk and partition statistics are consistent again. Since we still don't
143keep record of the partition-relative address, an operation is attributed to 143keep record of the partition-relative address, an operation is attributed to
144the partition which contains the first sector of the request after the 144the partition which contains the first sector of the request after the
145eventual merges. As requests can be merged across partition, this could lead 145eventual merges. As requests can be merged across partition, this could lead
146to some (probably insignificant) innacuracy. 146to some (probably insignificant) inaccuracy.
147 147
148Additional notes 148Additional notes
149---------------- 149----------------
diff --git a/Documentation/isdn/README.mISDN b/Documentation/isdn/README.mISDN
new file mode 100644
index 000000000000..cd8bf920e77b
--- /dev/null
+++ b/Documentation/isdn/README.mISDN
@@ -0,0 +1,6 @@
1mISDN is a new modular ISDN driver, in the long term it should replace
2the old I4L driver architecture for passiv ISDN cards.
3It was designed to allow a broad range of applications and interfaces
4but only have the basic function in kernel, the interface to the user
5space is based on sockets with a own address family AF_ISDN.
6
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO
index 488c77fa3aae..0775cf4798b2 100644
--- a/Documentation/ja_JP/HOWTO
+++ b/Documentation/ja_JP/HOWTO
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a
11fork. So if you have any comments or updates for this file, please try 11fork. So if you have any comments or updates for this file, please try
12to update the original English file first. 12to update the original English file first.
13 13
14Last Updated: 2007/11/16 14Last Updated: 2008/08/21
15================================== 15==================================
16ã“ã‚Œã¯ã€ 16ã“ã‚Œã¯ã€
17linux-2.6.24/Documentation/HOWTO 17linux-2.6.27/Documentation/HOWTO
18ã®å’Œè¨³ã§ã™ã€‚ 18ã®å’Œè¨³ã§ã™ã€‚
19 19
20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > 20翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
21翻訳日: 2007/11/10 21翻訳日: 2008/8/5
22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> 22翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> 23校正者: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com>
24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> 24 å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
@@ -287,13 +287,15 @@ Linux カーãƒãƒ«ã®é–‹ç™ºãƒ—ロセスã¯ç¾åœ¨å¹¾ã¤ã‹ã®ç•°ãªã‚‹ãƒ¡ã‚¤ãƒ³ã‚
287 ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–­ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–° 287 ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–­ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–°
288 ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚ 288 ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚
289 289
290 - 以下㮠URL ã§å„ -rc リリースã«å­˜åœ¨ã™ã‚‹æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œã®ãƒªã‚¹ãƒˆ
291 ãŒè¿½è·¡ã•ã‚Œã¾ã™-
292 http://kernelnewbies.org/known_regressions
293
294 - ã“ã®ãƒ—ロセスã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾ 290 - ã“ã®ãƒ—ロセスã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾
295 ã™ã€‚ã“ã®ãƒ—ロセスã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚ 291 ã™ã€‚ã“ã®ãƒ—ロセスã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚
296 292
293 - å„リリースã§ã®æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œ(regression: ã“ã®ãƒªãƒªãƒ¼ã‚¹ã®ä¸­ã§æ–°è¦
294 ã«ä½œã‚Šè¾¼ã¾ã‚ŒãŸå•é¡Œã‚’指ã™) ã¯ãã®éƒ½åº¦ Linux-kernel メーリングリスト
295 ã«æŠ•ç¨¿ã•ã‚Œã¾ã™ã€‚ゴールã¨ã—ã¦ã¯ã€ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨å®£è¨€
296 ã™ã‚‹å‰ã«ã“ã®ãƒªã‚¹ãƒˆã®é•·ã•ã‚’ゼロã«æ¸›ã‚‰ã™ã“ã¨ã§ã™ãŒã€ç¾å®Ÿã«ã¯ã€æ•°å€‹ã®
297 後戻りå•é¡ŒãŒãƒªãƒªãƒ¼ã‚¹æ™‚ã«ãŸã³ãŸã³æ®‹ã£ã¦ã—ã¾ã„ã¾ã™ã€‚
298
297Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„ 299Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„
298ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™- 300ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™-
299 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾ 301 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾
@@ -303,18 +305,20 @@ Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã
3032.6.x.y -stable カーãƒãƒ«ãƒ„リー 3052.6.x.y -stable カーãƒãƒ«ãƒ„リー
304--------------------------- 306---------------------------
305 307
306ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«4ã¤ç›®ã®æ•°å­—ãŒã¤ã„ãŸã‚«ãƒ¼ãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚ã“れ㫠308ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ãŒ4ã¤ã®æ•°å­—ã«åˆ†ã‹ã‚Œã¦ã„るカーãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚
307ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£å•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾ã™ã‚‹æ¯” 309ã“ã‚Œã«ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚­ãƒ¥ãƒªãƒ†ã‚£å•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾
308較的å°ã•ã„é‡è¦ãªä¿®æ­£ãŒå«ã¾ã‚Œã¾ã™ã€‚ 310ã™ã‚‹æ¯”較的å°ã•ã„é‡è¦ãªä¿®æ­£ãŒå«ã¾ã‚Œã¾ã™ã€‚
309 311
310ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ã〠312ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ãã€
311最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚ 313最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚
312 314
313ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå­˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x 315ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå­˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x ãŒ
314ãŒæœ€æ–°ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚ 316最新ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚
315 317
3162.6.x.y 㯠"stable" ãƒãƒ¼ãƒ  <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€ã  3182.6.x.y 㯠"stable" ãƒãƒ¼ãƒ  <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€å¿…
317ã„ãŸã„隔週ã§ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¦ã„ã¾ã™ã€‚ 319è¦ã«å¿œã˜ã¦ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚通常ã®ãƒªãƒªãƒ¼ã‚¹æœŸé–“㯠2週間毎ã§ã™ãŒã€å·®ã—è¿«ã£
320ãŸå•é¡ŒãŒãªã‘ã‚Œã°ã‚‚ã†å°‘ã—é•·ããªã‚‹ã“ã¨ã‚‚ã‚ã‚Šã¾ã™ã€‚セキュリティ関連ã®å•é¡Œ
321ã®å ´åˆã¯ã“ã‚Œã«å¯¾ã—ã¦ã ã„ãŸã„ã®å ´åˆã€ã™ãã«ãƒªãƒªãƒ¼ã‚¹ãŒã•ã‚Œã¾ã™ã€‚
318 322
319カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ 323カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ
320イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª 324イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª
@@ -341,7 +345,9 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ
341メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚ 345メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚
342 346
343メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ 347メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ
344ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¾ã™ã€‚ 348ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¦ã„ã¾ã™ã€‚マージウィン
349ドウãŒé–‹ãå‰ã« -mm ツリーã«ç¾ã‚Œãªã‹ã£ãŸãƒ‘ッãƒã¯ãƒ¡ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã«ãƒžãƒ¼ã‚¸ã•
350れるã“ã¨ã¯å›°é›£ã«ãªã‚Šã¾ã™ã€‚
345 351
346ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚ 352ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚
347ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸­ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚ 353ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸­ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚
@@ -395,13 +401,15 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ
395 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> 401 - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
396 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git 402 git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
397 403
398 - SCSI, James Bottomley <James.Bottomley@SteelEye.com> 404 - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
399 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git 405 git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
400 406
407 - x86, Ingo Molnar <mingo@elte.hu>
408 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
409
401 quilt ツリー- 410 quilt ツリー-
402 - USB, PCI ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de> 411 - USB, ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de>
403 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 412 kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
404 - x86-64 㨠i386 ã®ä»²é–“ Andi Kleen <ak@suse.de>
405 413
406 ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ 414 ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ
407 イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ 415 イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚
@@ -412,13 +420,32 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ
412bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹ 420bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹
413場所ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚ 421場所ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚
414ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„- 422ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„-
415 http://test.kernel.org/bugzilla/faq.html 423 http://bugzilla.kernel.org/page.cgi?id=faq.html
416
417メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ 424メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ
418ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å• 425ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å•
419é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³ 426é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³
420ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚ 427ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚
421 428
429ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã®ç®¡ç†
430-------------------
431
432ã‚ãªãŸã®ãƒãƒƒã‚­ãƒ³ã‚°ã®ã‚¹ã‚­ãƒ«ã‚’訓練ã™ã‚‹æœ€é«˜ã®æ–¹æ³•ã®ã²ã¨ã¤ã«ã€ä»–人ãŒãƒ¬ãƒãƒ¼
433トã—ãŸãƒã‚°ã‚’修正ã™ã‚‹ã“ã¨ãŒã‚ã‚Šã¾ã™ã€‚ã‚ãªãŸãŒã‚«ãƒ¼ãƒãƒ«ã‚’より安定化ã•ã›ã‚‹
434ã“ã«å¯„与ã™ã‚‹ã¨ã„ã†ã“ã¨ã ã‘ã§ãªãã€ã‚ãªãŸã¯ ç¾å®Ÿã®å•é¡Œã‚’修正ã™ã‚‹ã“ã¨ã‚’
435å­¦ã³ã€è‡ªåˆ†ã®ã‚¹ã‚­ãƒ«ã‚‚強化ã§ãã€ã¾ãŸä»–ã®é–‹ç™ºè€…ãŒã‚ãªãŸã®å­˜åœ¨ã«æ°—ãŒã¤ã
436ã¾ã™ã€‚ãƒã‚°ã‚’修正ã™ã‚‹ã“ã¨ã¯ã€å¤šãã®é–‹ç™ºè€…ã®ä¸­ã‹ã‚‰è‡ªåˆ†ãŒåŠŸç¸¾ã‚’ã‚ã’る最善
437ã®é“ã§ã™ã€ãªãœãªã‚‰å¤šãã®äººã¯ä»–人ã®ãƒã‚°ã®ä¿®æ­£ã«æ™‚間を浪費ã™ã‚‹ã“ã¨ã‚’好ã¾
438ãªã„ã‹ã‚‰ã§ã™ã€‚
439
440ã™ã§ã«ãƒ¬ãƒãƒ¼ãƒˆã•ã‚ŒãŸãƒã‚°ã®ãŸã‚ã«ä»•äº‹ã‚’ã™ã‚‹ãŸã‚ã«ã¯ã€
441http://bugzilla.kernel.org ã«è¡Œã£ã¦ãã ã•ã„。もã—今後ã®ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã«
442ã¤ã„ã¦ã‚¢ãƒ‰ãƒã‚¤ã‚¹ã‚’å—ã‘ãŸã„ã®ã§ã‚ã‚Œã°ã€bugme-new メーリングリスト(æ–°ã—
443ã„ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã ã‘ãŒã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹) ã¾ãŸã¯ bugme-janitor メーリン
444グリスト(bugzilla ã®å¤‰æ›´æ¯Žã«ã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹)を購読ã§ãã¾ã™ã€‚
445
446 http://lists.linux-foundation.org/mailman/listinfo/bugme-new
447 http://lists.linux-foundation.org/mailman/listinfo/bugme-janitors
448
422メーリングリスト 449メーリングリスト
423------------- 450-------------
424 451
diff --git a/Documentation/ja_JP/SubmitChecklist b/Documentation/ja_JP/SubmitChecklist
new file mode 100644
index 000000000000..6c42e071d723
--- /dev/null
+++ b/Documentation/ja_JP/SubmitChecklist
@@ -0,0 +1,111 @@
1NOTE:
2This is a version of Documentation/SubmitChecklist into Japanese.
3This document is maintained by Takenori Nagano <t-nagano@ah.jp.nec.com>
4and the JF Project team <http://www.linux.or.jp/JF/>.
5If you find any difference between this document and the original file
6or a problem with the translation,
7please contact the maintainer of this file or JF project.
8
9Please also note that the purpose of this file is to be easier to read
10for non English (read: Japanese) speakers and is not intended as a
11fork. So if you have any comments or updates of this file, please try
12to update the original English file first.
13
14Last Updated: 2008/07/14
15==================================
16ã“ã‚Œã¯ã€
17linux-2.6.26/Documentation/SubmitChecklist ã®å’Œè¨³ã§ã™ã€‚
18
19翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
20翻訳日: 2008/07/14
21翻訳者: Takenori Nagano <t-nagano at ah dot jp dot nec dot com>
22校正者: Masanori Kobayashi ã•ã‚“ <zap03216 at nifty dot ne dot jp>
23==================================
24
25
26Linux カーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿è€…å‘ã‘ãƒã‚§ãƒƒã‚¯ãƒªã‚¹ãƒˆ
27~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28
29本書ã§ã¯ã€ãƒ‘ッãƒã‚’より素早ãå–り込んã§ã‚‚らã„ãŸã„開発者ãŒå®Ÿè·µã™ã¹ã基本的ãªäº‹æŸ„
30ã‚’ã„ãã¤ã‹ç´¹ä»‹ã—ã¾ã™ã€‚ã“ã“ã«ã‚ã‚‹å…¨ã¦ã®äº‹æŸ„ã¯ã€Documentation/SubmittingPatches
31ãªã©ã®Linuxカーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿ã«éš›ã—ã¦ã®å¿ƒå¾—を補足ã™ã‚‹ã‚‚ã®ã§ã™ã€‚
32
33 1: 妥当ãªCONFIGオプションや変更ã•ã‚ŒãŸCONFIGオプションã€ã¤ã¾ã‚Š =y, =m, =n
34 å…¨ã¦ã§æ­£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。ãã®éš›ã€gccåŠã³ãƒªãƒ³ã‚«ãŒ
35 warningã‚„errorを出ã—ã¦ã„ãªã„ã“ã¨ã‚‚確èªã—ã¦ãã ã•ã„。
36
37 2: allnoconfig, allmodconfig オプションを用ã„ã¦æ­£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’
38 確èªã—ã¦ãã ã•ã„。
39
40 3: 手許ã®ã‚¯ãƒ­ã‚¹ã‚³ãƒ³ãƒ‘イルツールやOSDLã®PLMã®ã‚ˆã†ãªã‚‚ã®ã‚’用ã„ã¦ã€è¤‡æ•°ã®
41 アーキテクãƒãƒ£ã«ãŠã„ã¦ã‚‚æ­£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。
42
43 4: 64bité•·ã®'unsigned long'を使用ã—ã¦ã„ã‚‹ppc64ã¯ã€ã‚¯ãƒ­ã‚¹ã‚³ãƒ³ãƒ‘イルã§ã®
44 ãƒã‚§ãƒƒã‚¯ã«é©å½“ãªã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§ã™ã€‚
45
46 5: カーãƒãƒ«ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚¹ã‚¿ã‚¤ãƒ«ã«æº–æ‹ ã—ã¦ã„ã‚‹ã‹ã©ã†ã‹ç¢ºèªã—ã¦ãã ã•ã„(!)
47
48 6: CONFIGオプションã®è¿½åŠ ãƒ»å¤‰æ›´ã‚’ã—ãŸå ´åˆã«ã¯ã€CONFIGメニューãŒå£Šã‚Œã¦ã„ãªã„
49 ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。
50
51 7: æ–°ã—ãKconfigã®ã‚ªãƒ—ションを追加ã™ã‚‹éš›ã«ã¯ã€å¿…ãšãã®helpも記述ã—ã¦ãã ã•ã„。
52
53 8: é©åˆ‡ãªKconfigã®ä¾å­˜é–¢ä¿‚を考ãˆãªãŒã‚‰æ…Žé‡ã«ãƒã‚§ãƒƒã‚¯ã—ã¦ãã ã•ã„。
54 ãŸã ã—ã€ã“ã®ä½œæ¥­ã¯ãƒžã‚·ãƒ³ã‚’使ã£ãŸãƒ†ã‚¹ãƒˆã§ãã¡ã‚“ã¨è¡Œã†ã®ãŒã¨ã¦ã‚‚困難ã§ã™ã€‚
55 ã†ã¾ãã‚„ã‚‹ã«ã¯ã€è‡ªåˆ†ã®é ­ã§è€ƒãˆã‚‹ã“ã¨ã§ã™ã€‚
56
57 9: sparseを利用ã—ã¦ã¡ã‚ƒã‚“ã¨ã—ãŸã‚³ãƒ¼ãƒ‰ãƒã‚§ãƒƒã‚¯ã‚’ã—ã¦ãã ã•ã„。
58
5910: 'make checkstack' 㨠'make namespacecheck' を利用ã—ã€å•é¡ŒãŒç™ºè¦‹ã•ã‚ŒãŸã‚‰
60 修正ã—ã¦ãã ã•ã„。'make checkstack' ã¯æ˜Žç¤ºçš„ã«å•é¡Œã‚’示ã—ã¾ã›ã‚“ãŒã€ã©ã‚Œã‹
61 1ã¤ã®é–¢æ•°ãŒ512ãƒã‚¤ãƒˆã‚ˆã‚Šå¤§ãã„スタックを使ã£ã¦ã„ã‚Œã°ã€ä¿®æ­£ã™ã¹ã候補ã¨
62 ãªã‚Šã¾ã™ã€‚
63
6411: グローãƒãƒ«ãªkernel API を説明ã™ã‚‹ kernel-doc をソースã®ä¸­ã«å«ã‚ã¦ãã ã•ã„。
65 ( staticãªé–¢æ•°ã«ãŠã„ã¦ã¯å¿…é ˆã§ã¯ã‚ã‚Šã¾ã›ã‚“ãŒã€å«ã‚ã¦ã‚‚らã£ã¦ã‚‚çµæ§‹ã§ã™ )
66 ãã—ã¦ã€'make htmldocs' ã‚‚ã—ã㯠'make mandocs' を利用ã—ã¦è¿½è¨˜ã—ãŸ
67 ドキュメントã®ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã€å•é¡ŒãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã«ã¯ä¿®æ­£ã‚’è¡Œã£ã¦ãã ã•ã„。
68
6912: CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, CONFIG_DEBUG_SLAB,
70 CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_SPINLOCK,
71 CONFIG_DEBUG_SPINLOCK_SLEEP ã“れら全ã¦ã‚’åŒæ™‚ã«æœ‰åŠ¹ã«ã—ã¦å‹•ä½œç¢ºèªã‚’
72 è¡Œã£ã¦ãã ã•ã„。
73
7413: CONFIG_SMP, CONFIG_PREEMPT を有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§
75 ビルドã—ãŸä¸Šã€å‹•ä½œç¢ºèªã‚’è¡Œã£ã¦ãã ã•ã„。
76
7714: ã‚‚ã—パッãƒãŒãƒ‡ã‚£ã‚¹ã‚¯ã®I/O性能ãªã©ã«å½±éŸ¿ã‚’与ãˆã‚‹ã‚ˆã†ã§ã‚ã‚Œã°ã€
78 'CONFIG_LBD'オプションを有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§
79 テストを実施ã—ã¦ã¿ã¦ãã ã•ã„。
80
8115: lockdepã®æ©Ÿèƒ½ã‚’å…¨ã¦æœ‰åŠ¹ã«ã—ãŸä¸Šã§ã€å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰ãƒ‘スを評価ã—ã¦ãã ã•ã„。
82
8316: /proc ã«æ–°ã—ã„エントリを追加ã—ãŸå ´åˆã«ã¯ã€Documentation/ é…下ã«
84 å¿…ãšãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’追加ã—ã¦ãã ã•ã„。
85
8617: æ–°ã—ã„ブートパラメータを追加ã—ãŸå ´åˆã«ã¯ã€
87 å¿…ãšDocumentation/kernel-parameters.txt ã«èª¬æ˜Žã‚’追加ã—ã¦ãã ã•ã„。
88
8918: æ–°ã—ãmoduleã«ãƒ‘ラメータを追加ã—ãŸå ´åˆã«ã¯ã€MODULE_PARM_DESC()ã‚’
90 利用ã—ã¦å¿…ãšãã®èª¬æ˜Žã‚’記述ã—ã¦ãã ã•ã„。
91
9219: æ–°ã—ã„userspaceインタフェースを作æˆã—ãŸå ´åˆã«ã¯ã€Documentation/ABI/ ã«
93 Documentation/ABI/README ã‚’å‚考ã«ã—ã¦å¿…ãšãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’追加ã—ã¦ãã ã•ã„。
94
9520: 'make headers_check'を実行ã—ã¦å…¨ãå•é¡ŒãŒãªã„ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。
96
9721: å°‘ãªãã¨ã‚‚slabアロケーションã¨pageアロケーションã«å¤±æ•—ã—ãŸå ´åˆã®
98 挙動ã«ã¤ã„ã¦ã€fault-injectionを利用ã—ã¦ç¢ºèªã—ã¦ãã ã•ã„。
99 Documentation/fault-injection/ ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
100
101 追加ã—ãŸã‚³ãƒ¼ãƒ‰ãŒã‹ãªã‚Šã®é‡ã§ã‚ã£ãŸãªã‚‰ã°ã€ã‚µãƒ–システム特有ã®
102 fault-injectionを追加ã—ãŸã»ã†ãŒè‰¯ã„ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。
103
10422: æ–°ãŸã«è¿½åŠ ã—ãŸã‚³ãƒ¼ãƒ‰ã¯ã€`gcc -W'ã§ã‚³ãƒ³ãƒ‘イルã—ã¦ãã ã•ã„。
105 ã“ã®ã‚ªãƒ—ションã¯å¤§é‡ã®ä¸è¦ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã—ã¾ã™ãŒã€
106 "warning: comparison between signed and unsigned" ã®ã‚ˆã†ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã€
107 ãƒã‚°ã‚’見ã¤ã‘ã‚‹ã®ã«å½¹ã«ç«‹ã¡ã¾ã™ã€‚
108
10923: 投稿ã—ãŸãƒ‘ッãƒãŒ -mm パッãƒã‚»ãƒƒãƒˆã«ãƒžãƒ¼ã‚¸ã•ã‚ŒãŸå¾Œã€å…¨ã¦ã®æ—¢å­˜ã®ãƒ‘ッãƒã‚„
110 VM, VFS ãŠã‚ˆã³ãã®ä»–ã®ã‚µãƒ–システムã«é–¢ã™ã‚‹æ§˜ã€…ãªå¤‰æ›´ã¨ã€ç¾æ™‚点ã§ã‚‚共存
111 ã§ãã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãƒ†ã‚¹ãƒˆã‚’è¡Œã£ã¦ãã ã•ã„。
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index b8e52c0355d3..0705040531a5 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -65,26 +65,26 @@ Install kexec-tools
65 65
662) Download the kexec-tools user-space package from the following URL: 662) Download the kexec-tools user-space package from the following URL:
67 67
68http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing.tar.gz 68http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz
69 69
70This is a symlink to the latest version, which at the time of writing is 70This is a symlink to the latest version.
7120061214, the only release of kexec-tools-testing so far. As other versions
72are released, the older ones will remain available at
73http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
74 71
75Note: Latest kexec-tools-testing git tree is available at 72The latest kexec-tools git tree is available at:
76 73
77git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git 74git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git
78or 75or
79http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary 76http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git
77
78More information about kexec-tools can be found at
79http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html
80 80
813) Unpack the tarball with the tar command, as follows: 813) Unpack the tarball with the tar command, as follows:
82 82
83 tar xvpzf kexec-tools-testing.tar.gz 83 tar xvpzf kexec-tools.tar.gz
84 84
854) Change to the kexec-tools directory, as follows: 854) Change to the kexec-tools directory, as follows:
86 86
87 cd kexec-tools-testing-VERSION 87 cd kexec-tools-VERSION
88 88
895) Configure the package, as follows: 895) Configure the package, as follows:
90 90
@@ -109,7 +109,7 @@ There are two possible methods of using Kdump.
1092) Or use the system kernel binary itself as dump-capture kernel and there is 1092) Or use the system kernel binary itself as dump-capture kernel and there is
110 no need to build a separate dump-capture kernel. This is possible 110 no need to build a separate dump-capture kernel. This is possible
111 only with the architecutres which support a relocatable kernel. As 111 only with the architecutres which support a relocatable kernel. As
112 of today i386 and ia64 architectures support relocatable kernel. 112 of today, i386, x86_64 and ia64 architectures support relocatable kernel.
113 113
114Building a relocatable kernel is advantageous from the point of view that 114Building a relocatable kernel is advantageous from the point of view that
115one does not have to build a second kernel for capturing the dump. But 115one does not have to build a second kernel for capturing the dump. But
diff --git a/Documentation/kernel-doc-nano-HOWTO.txt b/Documentation/kernel-doc-nano-HOWTO.txt
index 0bd32748a467..c6841eee9598 100644
--- a/Documentation/kernel-doc-nano-HOWTO.txt
+++ b/Documentation/kernel-doc-nano-HOWTO.txt
@@ -168,10 +168,10 @@ if ($#ARGV < 0) {
168mkdir $ARGV[0],0777; 168mkdir $ARGV[0],0777;
169$state = 0; 169$state = 0;
170while (<STDIN>) { 170while (<STDIN>) {
171 if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) { 171 if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
172 if ($state == 1) { close OUT } 172 if ($state == 1) { close OUT }
173 $state = 1; 173 $state = 1;
174 $fn = "$ARGV[0]/$1.4"; 174 $fn = "$ARGV[0]/$1.9";
175 print STDERR "Creating $fn\n"; 175 print STDERR "Creating $fn\n";
176 open OUT, ">$fn" or die "can't open $fn: $!\n"; 176 open OUT, ">$fn" or die "can't open $fn: $!\n";
177 print OUT $_; 177 print OUT $_;
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index e07c432c731f..2443f5bb4364 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -87,7 +87,8 @@ parameter is applicable:
87 SH SuperH architecture is enabled. 87 SH SuperH architecture is enabled.
88 SMP The kernel is an SMP kernel. 88 SMP The kernel is an SMP kernel.
89 SPARC Sparc architecture is enabled. 89 SPARC Sparc architecture is enabled.
90 SWSUSP Software suspend is enabled. 90 SWSUSP Software suspend (hibernation) is enabled.
91 SUSPEND System suspend states are enabled.
91 TS Appropriate touchscreen support is enabled. 92 TS Appropriate touchscreen support is enabled.
92 USB USB support is enabled. 93 USB USB support is enabled.
93 USBHID USB Human Interface Device support is enabled. 94 USBHID USB Human Interface Device support is enabled.
@@ -147,10 +148,16 @@ and is between 256 and 4096 characters. It is defined in the file
147 default: 0 148 default: 0
148 149
149 acpi_sleep= [HW,ACPI] Sleep options 150 acpi_sleep= [HW,ACPI] Sleep options
150 Format: { s3_bios, s3_mode, s3_beep } 151 Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering }
151 See Documentation/power/video.txt for s3_bios and s3_mode. 152 See Documentation/power/video.txt for s3_bios and s3_mode.
152 s3_beep is for debugging; it makes the PC's speaker beep 153 s3_beep is for debugging; it makes the PC's speaker beep
153 as soon as the kernel's real-mode entry point is called. 154 as soon as the kernel's real-mode entry point is called.
155 s4_nohwsig prevents ACPI hardware signature from being
156 used during resume from hibernation.
157 old_ordering causes the ACPI 1.0 ordering of the _PTS
158 control method, wrt putting devices into low power
159 states, to be enforced (the ACPI 2.0 ordering of _PTS is
160 used by default).
154 161
155 acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode 162 acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
156 Format: { level | edge | high | low } 163 Format: { level | edge | high | low }
@@ -271,6 +278,22 @@ and is between 256 and 4096 characters. It is defined in the file
271 aic79xx= [HW,SCSI] 278 aic79xx= [HW,SCSI]
272 See Documentation/scsi/aic79xx.txt. 279 See Documentation/scsi/aic79xx.txt.
273 280
281 amd_iommu= [HW,X86-84]
282 Pass parameters to the AMD IOMMU driver in the system.
283 Possible values are:
284 isolate - enable device isolation (each device, as far
285 as possible, will get its own protection
286 domain)
287 fullflush - enable flushing of IO/TLB entries when
288 they are unmapped. Otherwise they are
289 flushed before they will be reused, which
290 is a lot of faster
291
292 amd_iommu_size= [HW,X86-64]
293 Define the size of the aperture for the AMD IOMMU
294 driver. Possible values are:
295 '32M', '64M' (default), '128M', '256M', '512M', '1G'
296
274 amijoy.map= [HW,JOY] Amiga joystick support 297 amijoy.map= [HW,JOY] Amiga joystick support
275 Map of devices attached to JOY0DAT and JOY1DAT 298 Map of devices attached to JOY0DAT and JOY1DAT
276 Format: <a>,<b> 299 Format: <a>,<b>
@@ -295,7 +318,7 @@ and is between 256 and 4096 characters. It is defined in the file
295 when initialising the APIC and IO-APIC components. 318 when initialising the APIC and IO-APIC components.
296 319
297 apm= [APM] Advanced Power Management 320 apm= [APM] Advanced Power Management
298 See header of arch/i386/kernel/apm.c. 321 See header of arch/x86/kernel/apm_32.c.
299 322
300 arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards 323 arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
301 Format: <io>,<irq>,<nodeID> 324 Format: <io>,<irq>,<nodeID>
@@ -347,6 +370,8 @@ and is between 256 and 4096 characters. It is defined in the file
347 no delay (0). 370 no delay (0).
348 Format: integer 371 Format: integer
349 372
373 bootmem_debug [KNL] Enable bootmem allocator debug messages.
374
350 bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards) 375 bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards)
351 bttv.radio= Most important insmod options are available as 376 bttv.radio= Most important insmod options are available as
352 kernel args too. 377 kernel args too.
@@ -443,12 +468,6 @@ and is between 256 and 4096 characters. It is defined in the file
443 Range: 0 - 8192 468 Range: 0 - 8192
444 Default: 64 469 Default: 64
445 470
446 disable_8254_timer
447 enable_8254_timer
448 [IA32/X86_64] Disable/Enable interrupt 0 timer routing
449 over the 8254 in addition to over the IO-APIC. The
450 kernel tries to set a sensible default.
451
452 hpet= [X86-32,HPET] option to control HPET usage 471 hpet= [X86-32,HPET] option to control HPET usage
453 Format: { enable (default) | disable | force } 472 Format: { enable (default) | disable | force }
454 disable: disable HPET and use PIT instead 473 disable: disable HPET and use PIT instead
@@ -560,6 +579,8 @@ and is between 256 and 4096 characters. It is defined in the file
560 579
561 debug_objects [KNL] Enable object debugging 580 debug_objects [KNL] Enable object debugging
562 581
582 debugpat [X86] Enable PAT debugging
583
563 decnet.addr= [HW,NET] 584 decnet.addr= [HW,NET]
564 Format: <area>[,<node>] 585 Format: <area>[,<node>]
565 See also Documentation/networking/decnet.txt. 586 See also Documentation/networking/decnet.txt.
@@ -599,6 +620,29 @@ and is between 256 and 4096 characters. It is defined in the file
599 See drivers/char/README.epca and 620 See drivers/char/README.epca and
600 Documentation/digiepca.txt. 621 Documentation/digiepca.txt.
601 622
623 disable_mtrr_cleanup [X86]
624 enable_mtrr_cleanup [X86]
625 The kernel tries to adjust MTRR layout from continuous
626 to discrete, to make X server driver able to add WB
627 entry later. This parameter enables/disables that.
628
629 mtrr_chunk_size=nn[KMG] [X86]
630 used for mtrr cleanup. It is largest continous chunk
631 that could hold holes aka. UC entries.
632
633 mtrr_gran_size=nn[KMG] [X86]
634 Used for mtrr cleanup. It is granularity of mtrr block.
635 Default is 1.
636 Large value could prevent small alignment from
637 using up MTRRs.
638
639 mtrr_spare_reg_nr=n [X86]
640 Format: <integer>
641 Range: 0,7 : spare reg number
642 Default : 1
643 Used for mtrr cleanup. It is spare mtrr entries number.
644 Set to 2 or more if your graphical card needs more.
645
602 disable_mtrr_trim [X86, Intel and AMD only] 646 disable_mtrr_trim [X86, Intel and AMD only]
603 By default the kernel will trim any uncacheable 647 By default the kernel will trim any uncacheable
604 memory out of your available memory pool based on 648 memory out of your available memory pool based on
@@ -614,11 +658,12 @@ and is between 256 and 4096 characters. It is defined in the file
614 earlyprintk= [X86-32,X86-64,SH,BLACKFIN] 658 earlyprintk= [X86-32,X86-64,SH,BLACKFIN]
615 earlyprintk=vga 659 earlyprintk=vga
616 earlyprintk=serial[,ttySn[,baudrate]] 660 earlyprintk=serial[,ttySn[,baudrate]]
661 earlyprintk=dbgp
617 662
618 Append ",keep" to not disable it when the real console 663 Append ",keep" to not disable it when the real console
619 takes over. 664 takes over.
620 665
621 Only vga or serial at a time, not both. 666 Only vga or serial or usb debug port at a time.
622 667
623 Currently only ttyS0 and ttyS1 are supported. 668 Currently only ttyS0 and ttyS1 are supported.
624 669
@@ -638,7 +683,7 @@ and is between 256 and 4096 characters. It is defined in the file
638 683
639 elanfreq= [X86-32] 684 elanfreq= [X86-32]
640 See comment before function elanfreq_setup() in 685 See comment before function elanfreq_setup() in
641 arch/i386/kernel/cpu/cpufreq/elanfreq.c. 686 arch/x86/kernel/cpu/cpufreq/elanfreq.c.
642 687
643 elevator= [IOSCHED] 688 elevator= [IOSCHED]
644 Format: {"anticipatory" | "cfq" | "deadline" | "noop"} 689 Format: {"anticipatory" | "cfq" | "deadline" | "noop"}
@@ -722,9 +767,6 @@ and is between 256 and 4096 characters. It is defined in the file
722 hd= [EIDE] (E)IDE hard drive subsystem geometry 767 hd= [EIDE] (E)IDE hard drive subsystem geometry
723 Format: <cyl>,<head>,<sect> 768 Format: <cyl>,<head>,<sect>
724 769
725 hd?= [HW] (E)IDE subsystem
726 hd?lun= See Documentation/ide/ide.txt.
727
728 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact 770 highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact
729 size of <nn>. This works even on boxes that have no 771 size of <nn>. This works even on boxes that have no
730 highmem otherwise. This also works to reduce highmem 772 highmem otherwise. This also works to reduce highmem
@@ -737,8 +779,22 @@ and is between 256 and 4096 characters. It is defined in the file
737 hisax= [HW,ISDN] 779 hisax= [HW,ISDN]
738 See Documentation/isdn/README.HiSax. 780 See Documentation/isdn/README.HiSax.
739 781
740 hugepages= [HW,X86-32,IA-64] Maximal number of HugeTLB pages. 782 hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot.
741 hugepagesz= [HW,IA-64,PPC] The size of the HugeTLB pages. 783 hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages.
784 On x86-64 and powerpc, this option can be specified
785 multiple times interleaved with hugepages= to reserve
786 huge pages of different sizes. Valid pages sizes on
787 x86-64 are 2M (when the CPU supports "pse") and 1G
788 (when the CPU supports the "pdpe1gb" cpuinfo flag)
789 Note that 1GB pages can only be allocated at boot time
790 using hugepages= and not freed afterwards.
791 default_hugepagesz=
792 [same as hugepagesz=] The size of the default
793 HugeTLB page size. This is the size represented by
794 the legacy /proc/ hugepages APIs, used for SHM, and
795 default size when mounting hugetlbfs filesystems.
796 Defaults to the default architecture's huge page size
797 if not specified.
742 798
743 i8042.direct [HW] Put keyboard port into non-translated mode 799 i8042.direct [HW] Put keyboard port into non-translated mode
744 i8042.dumbkbd [HW] Pretend that controller can only read data from 800 i8042.dumbkbd [HW] Pretend that controller can only read data from
@@ -785,7 +841,7 @@ and is between 256 and 4096 characters. It is defined in the file
785 See Documentation/ide/ide.txt. 841 See Documentation/ide/ide.txt.
786 842
787 idle= [X86] 843 idle= [X86]
788 Format: idle=poll or idle=mwait 844 Format: idle=poll or idle=mwait, idle=halt, idle=nomwait
789 Poll forces a polling idle loop that can slightly improves the performance 845 Poll forces a polling idle loop that can slightly improves the performance
790 of waking up a idle CPU, but will use a lot of power and make the system 846 of waking up a idle CPU, but will use a lot of power and make the system
791 run hot. Not recommended. 847 run hot. Not recommended.
@@ -793,6 +849,9 @@ and is between 256 and 4096 characters. It is defined in the file
793 to not use it because it doesn't save as much power as a normal idle 849 to not use it because it doesn't save as much power as a normal idle
794 loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same 850 loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
795 as idle=poll. 851 as idle=poll.
852 idle=halt. Halt is forced to be used for CPU idle.
853 In such case C2/C3 won't be used again.
854 idle=nomwait. Disable mwait for CPU C-states
796 855
797 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem 856 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
798 Claim all unknown PCI IDE storage controllers. 857 Claim all unknown PCI IDE storage controllers.
@@ -961,6 +1020,10 @@ and is between 256 and 4096 characters. It is defined in the file
961 (only serial suported for now) 1020 (only serial suported for now)
962 Format: <serial_device>[,baud] 1021 Format: <serial_device>[,baud]
963 1022
1023 kmac= [MIPS] korina ethernet MAC address.
1024 Configure the RouterBoard 532 series on-chip
1025 Ethernet adapter MAC address.
1026
964 l2cr= [PPC] 1027 l2cr= [PPC]
965 1028
966 l3cr= [PPC] 1029 l3cr= [PPC]
@@ -1015,6 +1078,9 @@ and is between 256 and 4096 characters. It is defined in the file
1015 1078
1016 * [no]ncq: Turn on or off NCQ. 1079 * [no]ncq: Turn on or off NCQ.
1017 1080
1081 * nohrst, nosrst, norst: suppress hard, soft
1082 and both resets.
1083
1018 If there are multiple matching configurations changing 1084 If there are multiple matching configurations changing
1019 the same attribute, the last one is used. 1085 the same attribute, the last one is used.
1020 1086
@@ -1166,7 +1232,30 @@ and is between 256 and 4096 characters. It is defined in the file
1166 or 1232 or
1167 memmap=0x10000$0x18690000 1233 memmap=0x10000$0x18690000
1168 1234
1169 memtest= [KNL,X86_64] Enable memtest 1235 memory_corruption_check=0/1 [X86]
1236 Some BIOSes seem to corrupt the first 64k of
1237 memory when doing things like suspend/resume.
1238 Setting this option will scan the memory
1239 looking for corruption. Enabling this will
1240 both detect corruption and prevent the kernel
1241 from using the memory being corrupted.
1242 However, its intended as a diagnostic tool; if
1243 repeatable BIOS-originated corruption always
1244 affects the same memory, you can use memmap=
1245 to prevent the kernel from using that memory.
1246
1247 memory_corruption_check_size=size [X86]
1248 By default it checks for corruption in the low
1249 64k, making this memory unavailable for normal
1250 use. Use this parameter to scan for
1251 corruption in more or less memory.
1252
1253 memory_corruption_check_period=seconds [X86]
1254 By default it checks for corruption every 60
1255 seconds. Use this parameter to check at some
1256 other rate. 0 disables periodic checking.
1257
1258 memtest= [KNL,X86] Enable memtest
1170 Format: <integer> 1259 Format: <integer>
1171 range: 0,4 : pattern number 1260 range: 0,4 : pattern number
1172 default : 0 <disable> 1261 default : 0 <disable>
@@ -1185,6 +1274,14 @@ and is between 256 and 4096 characters. It is defined in the file
1185 1274
1186 mga= [HW,DRM] 1275 mga= [HW,DRM]
1187 1276
1277 mminit_loglevel=
1278 [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
1279 parameter allows control of the logging verbosity for
1280 the additional memory initialisation checks. A value
1281 of 0 disables mminit logging and a level of 4 will
1282 log everything. Information is printed at KERN_DEBUG
1283 so loglevel=8 may also need to be specified.
1284
1188 mousedev.tap_time= 1285 mousedev.tap_time=
1189 [MOUSE] Maximum time between finger touching and 1286 [MOUSE] Maximum time between finger touching and
1190 leaving touchpad surface for touch to be considered 1287 leaving touchpad surface for touch to be considered
@@ -1208,6 +1305,11 @@ and is between 256 and 4096 characters. It is defined in the file
1208 mtdparts= [MTD] 1305 mtdparts= [MTD]
1209 See drivers/mtd/cmdlinepart.c. 1306 See drivers/mtd/cmdlinepart.c.
1210 1307
1308 mtdset= [ARM]
1309 ARM/S3C2412 JIVE boot control
1310
1311 See arch/arm/mach-s3c2412/mach-jive.c
1312
1211 mtouchusb.raw_coordinates= 1313 mtouchusb.raw_coordinates=
1212 [HW] Make the MicroTouch USB driver use raw coordinates 1314 [HW] Make the MicroTouch USB driver use raw coordinates
1213 ('y', default) or cooked coordinates ('n') 1315 ('y', default) or cooked coordinates ('n')
@@ -1234,6 +1336,13 @@ and is between 256 and 4096 characters. It is defined in the file
1234 This usage is only documented in each driver source 1336 This usage is only documented in each driver source
1235 file if at all. 1337 file if at all.
1236 1338
1339 nf_conntrack.acct=
1340 [NETFILTER] Enable connection tracking flow accounting
1341 0 to disable accounting
1342 1 to enable accounting
1343 Default value depends on CONFIG_NF_CT_ACCT that is
1344 going to be removed in 2.6.29.
1345
1237 nfsaddrs= [NFS] 1346 nfsaddrs= [NFS]
1238 See Documentation/filesystems/nfsroot.txt. 1347 See Documentation/filesystems/nfsroot.txt.
1239 1348
@@ -1343,6 +1452,12 @@ and is between 256 and 4096 characters. It is defined in the file
1343 1452
1344 nolapic_timer [X86-32,APIC] Do not use the local APIC timer. 1453 nolapic_timer [X86-32,APIC] Do not use the local APIC timer.
1345 1454
1455 nox2apic [X86-64,APIC] Do not enable x2APIC mode.
1456
1457 x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of
1458 default x2apic cluster mode on platforms
1459 supporting x2apic.
1460
1346 noltlbs [PPC] Do not use large page/tlb entries for kernel 1461 noltlbs [PPC] Do not use large page/tlb entries for kernel
1347 lowmem mapping on PPC40x. 1462 lowmem mapping on PPC40x.
1348 1463
@@ -1496,6 +1611,9 @@ and is between 256 and 4096 characters. It is defined in the file
1496 Use with caution as certain devices share 1611 Use with caution as certain devices share
1497 address decoders between ROMs and other 1612 address decoders between ROMs and other
1498 resources. 1613 resources.
1614 norom [X86-32,X86_64] Do not assign address space to
1615 expansion ROMs that do not already have
1616 BIOS assigned address ranges.
1499 irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be 1617 irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be
1500 assigned automatically to PCI devices. You can 1618 assigned automatically to PCI devices. You can
1501 make the kernel exclude IRQs of your ISA cards 1619 make the kernel exclude IRQs of your ISA cards
@@ -1571,6 +1689,10 @@ and is between 256 and 4096 characters. It is defined in the file
1571 Format: { parport<nr> | timid | 0 } 1689 Format: { parport<nr> | timid | 0 }
1572 See also Documentation/parport.txt. 1690 See also Documentation/parport.txt.
1573 1691
1692 pmtmr= [X86] Manual setup of pmtmr I/O Port.
1693 Override pmtimer IOPort with a hex value.
1694 e.g. pmtmr=0x508
1695
1574 pnpacpi= [ACPI] 1696 pnpacpi= [ACPI]
1575 { off } 1697 { off }
1576 1698
@@ -1679,6 +1801,10 @@ and is between 256 and 4096 characters. It is defined in the file
1679 Format: <reboot_mode>[,<reboot_mode2>[,...]] 1801 Format: <reboot_mode>[,<reboot_mode2>[,...]]
1680 See arch/*/kernel/reboot.c or arch/*/kernel/process.c 1802 See arch/*/kernel/reboot.c or arch/*/kernel/process.c
1681 1803
1804 relax_domain_level=
1805 [KNL, SMP] Set scheduler's default relax_domain_level.
1806 See Documentation/cpusets.txt.
1807
1682 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area 1808 reserve= [KNL,BUGS] Force the kernel to ignore some iomem area
1683 1809
1684 reservetop= [X86-32] 1810 reservetop= [X86-32]
@@ -1789,6 +1915,12 @@ and is between 256 and 4096 characters. It is defined in the file
1789 shapers= [NET] 1915 shapers= [NET]
1790 Maximal number of shapers. 1916 Maximal number of shapers.
1791 1917
1918 show_msr= [x86] show boot-time MSR settings
1919 Format: { <integer> }
1920 Show boot-time (BIOS-initialized) MSR settings.
1921 The parameter means the number of CPUs to show,
1922 for example 1 means boot CPU only.
1923
1792 sim710= [SCSI,HW] 1924 sim710= [SCSI,HW]
1793 See header of drivers/scsi/sim710.c. 1925 See header of drivers/scsi/sim710.c.
1794 1926
@@ -1971,6 +2103,9 @@ and is between 256 and 4096 characters. It is defined in the file
1971 2103
1972 snd-ymfpci= [HW,ALSA] 2104 snd-ymfpci= [HW,ALSA]
1973 2105
2106 softlockup_panic=
2107 [KNL] Should the soft-lockup detector generate panics.
2108
1974 sonypi.*= [HW] Sony Programmable I/O Control Device driver 2109 sonypi.*= [HW] Sony Programmable I/O Control Device driver
1975 See Documentation/sonypi.txt 2110 See Documentation/sonypi.txt
1976 2111
@@ -2035,6 +2170,12 @@ and is between 256 and 4096 characters. It is defined in the file
2035 2170
2036 tdfx= [HW,DRM] 2171 tdfx= [HW,DRM]
2037 2172
2173 test_suspend= [SUSPEND]
2174 Specify "mem" (for Suspend-to-RAM) or "standby" (for
2175 standby suspend) as the system sleep state to briefly
2176 enter during system startup. The system is woken from
2177 this state using a wakeup-capable RTC alarm.
2178
2038 thash_entries= [KNL,NET] 2179 thash_entries= [KNL,NET]
2039 Set number of hash buckets for TCP connection 2180 Set number of hash buckets for TCP connection
2040 2181
@@ -2062,13 +2203,6 @@ and is between 256 and 4096 characters. It is defined in the file
2062 <deci-seconds>: poll all this frequency 2203 <deci-seconds>: poll all this frequency
2063 0: no polling (default) 2204 0: no polling (default)
2064 2205
2065 tipar.timeout= [HW,PPT]
2066 Set communications timeout in tenths of a second
2067 (default 15).
2068
2069 tipar.delay= [HW,PPT]
2070 Set inter-bit delay in microseconds (default 10).
2071
2072 tmscsim= [HW,SCSI] 2206 tmscsim= [HW,SCSI]
2073 See comment before function dc390_setup() in 2207 See comment before function dc390_setup() in
2074 drivers/scsi/tmscsim.c. 2208 drivers/scsi/tmscsim.c.
@@ -2102,6 +2236,10 @@ and is between 256 and 4096 characters. It is defined in the file
2102 Note that genuine overcurrent events won't be 2236 Note that genuine overcurrent events won't be
2103 reported either. 2237 reported either.
2104 2238
2239 unknown_nmi_panic
2240 [X86-32,X86-64]
2241 Set unknown_nmi_panic=1 early on boot.
2242
2105 usbcore.autosuspend= 2243 usbcore.autosuspend=
2106 [USB] The autosuspend time delay (in seconds) used 2244 [USB] The autosuspend time delay (in seconds) used
2107 for newly-detected USB devices (default 2). This 2245 for newly-detected USB devices (default 2). This
@@ -2112,6 +2250,9 @@ and is between 256 and 4096 characters. It is defined in the file
2112 usbhid.mousepoll= 2250 usbhid.mousepoll=
2113 [USBHID] The interval which mice are to be polled at. 2251 [USBHID] The interval which mice are to be polled at.
2114 2252
2253 add_efi_memmap [EFI; x86-32,X86-64] Include EFI memory map in
2254 kernel's map of available physical RAM.
2255
2115 vdso= [X86-32,SH,x86-64] 2256 vdso= [X86-32,SH,x86-64]
2116 vdso=2: enable compat VDSO (default with COMPAT_VDSO) 2257 vdso=2: enable compat VDSO (default with COMPAT_VDSO)
2117 vdso=1: enable VDSO (default) 2258 vdso=1: enable VDSO (default)
diff --git a/Documentation/keys.txt b/Documentation/keys.txt
index d5c7a57d1700..b56aacc1fff8 100644
--- a/Documentation/keys.txt
+++ b/Documentation/keys.txt
@@ -864,7 +864,7 @@ payload contents" for more information.
864 request_key_with_auxdata() respectively. 864 request_key_with_auxdata() respectively.
865 865
866 These two functions return with the key potentially still under 866 These two functions return with the key potentially still under
867 construction. To wait for contruction completion, the following should be 867 construction. To wait for construction completion, the following should be
868 called: 868 called:
869 869
870 int wait_for_key_construction(struct key *key, bool intr); 870 int wait_for_key_construction(struct key *key, bool intr);
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 6877e7187113..a79633d702bf 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -172,6 +172,7 @@ architectures:
172- ia64 (Does not support probes on instruction slot1.) 172- ia64 (Does not support probes on instruction slot1.)
173- sparc64 (Return probes not yet implemented.) 173- sparc64 (Return probes not yet implemented.)
174- arm 174- arm
175- ppc
175 176
1763. Configuring Kprobes 1773. Configuring Kprobes
177 178
diff --git a/Documentation/laptops/acer-wmi.txt b/Documentation/laptops/acer-wmi.txt
index 79b7dbd22141..69b5dd4e5a59 100644
--- a/Documentation/laptops/acer-wmi.txt
+++ b/Documentation/laptops/acer-wmi.txt
@@ -174,8 +174,6 @@ The LED is exposed through the LED subsystem, and can be found in:
174The mail LED is autodetected, so if you don't have one, the LED device won't 174The mail LED is autodetected, so if you don't have one, the LED device won't
175be registered. 175be registered.
176 176
177If you have a mail LED that is not green, please report this to me.
178
179Backlight 177Backlight
180********* 178*********
181 179
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 64b3f146e4b0..71f0fe1fc1b0 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.20 3 Version 0.21
4 April 09th, 2008 4 May 29th, 2008
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>
@@ -44,7 +44,7 @@ detailed description):
44 - LCD brightness control 44 - LCD brightness control
45 - Volume control 45 - Volume control
46 - Fan control and monitoring: fan speed, fan enable/disable 46 - Fan control and monitoring: fan speed, fan enable/disable
47 - Experimental: WAN enable and disable 47 - WAN enable and disable
48 48
49A compatibility table by model and feature is maintained on the web 49A compatibility table by model and feature is maintained on the web
50site, http://ibm-acpi.sf.net/. I appreciate any success or failure 50site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -621,7 +621,8 @@ Bluetooth
621--------- 621---------
622 622
623procfs: /proc/acpi/ibm/bluetooth 623procfs: /proc/acpi/ibm/bluetooth
624sysfs device attribute: bluetooth_enable 624sysfs device attribute: bluetooth_enable (deprecated)
625sysfs rfkill class: switch "tpacpi_bluetooth_sw"
625 626
626This feature shows the presence and current state of a ThinkPad 627This feature shows the presence and current state of a ThinkPad
627Bluetooth device in the internal ThinkPad CDC slot. 628Bluetooth device in the internal ThinkPad CDC slot.
@@ -643,8 +644,12 @@ Sysfs notes:
643 0: disables Bluetooth / Bluetooth is disabled 644 0: disables Bluetooth / Bluetooth is disabled
644 1: enables Bluetooth / Bluetooth is enabled. 645 1: enables Bluetooth / Bluetooth is enabled.
645 646
646 Note: this interface will be probably be superseded by the 647 Note: this interface has been superseded by the generic rfkill
647 generic rfkill class, so it is NOT to be considered stable yet. 648 class. It has been deprecated, and it will be removed in year
649 2010.
650
651 rfkill controller switch "tpacpi_bluetooth_sw": refer to
652 Documentation/rfkill.txt for details.
648 653
649Video output control -- /proc/acpi/ibm/video 654Video output control -- /proc/acpi/ibm/video
650-------------------------------------------- 655--------------------------------------------
@@ -1370,16 +1375,12 @@ with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255
1370would be the safest choice, though). 1375would be the safest choice, though).
1371 1376
1372 1377
1373EXPERIMENTAL: WAN 1378WAN
1374----------------- 1379---
1375 1380
1376procfs: /proc/acpi/ibm/wan 1381procfs: /proc/acpi/ibm/wan
1377sysfs device attribute: wwan_enable 1382sysfs device attribute: wwan_enable (deprecated)
1378 1383sysfs rfkill class: switch "tpacpi_wwan_sw"
1379This feature is marked EXPERIMENTAL because the implementation
1380directly accesses hardware registers and may not work as expected. USE
1381WITH CAUTION! To use this feature, you need to supply the
1382experimental=1 parameter when loading the module.
1383 1384
1384This feature shows the presence and current state of a W-WAN (Sierra 1385This feature shows the presence and current state of a W-WAN (Sierra
1385Wireless EV-DO) device. 1386Wireless EV-DO) device.
@@ -1404,8 +1405,12 @@ Sysfs notes:
1404 0: disables WWAN card / WWAN card is disabled 1405 0: disables WWAN card / WWAN card is disabled
1405 1: enables WWAN card / WWAN card is enabled. 1406 1: enables WWAN card / WWAN card is enabled.
1406 1407
1407 Note: this interface will be probably be superseded by the 1408 Note: this interface has been superseded by the generic rfkill
1408 generic rfkill class, so it is NOT to be considered stable yet. 1409 class. It has been deprecated, and it will be removed in year
1410 2010.
1411
1412 rfkill controller switch "tpacpi_wwan_sw": refer to
1413 Documentation/rfkill.txt for details.
1409 1414
1410Multiple Commands, Module Parameters 1415Multiple Commands, Module Parameters
1411------------------------------------ 1416------------------------------------
diff --git a/Documentation/leds-class.txt b/Documentation/leds-class.txt
index 18860ad9935a..6399557cdab3 100644
--- a/Documentation/leds-class.txt
+++ b/Documentation/leds-class.txt
@@ -59,7 +59,7 @@ Hardware accelerated blink of LEDs
59 59
60Some LEDs can be programmed to blink without any CPU interaction. To 60Some LEDs can be programmed to blink without any CPU interaction. To
61support this feature, a LED driver can optionally implement the 61support this feature, a LED driver can optionally implement the
62blink_set() function (see <linux/leds.h>). If implemeted, triggers can 62blink_set() function (see <linux/leds.h>). If implemented, triggers can
63attempt to use it before falling back to software timers. The blink_set() 63attempt to use it before falling back to software timers. The blink_set()
64function should return 0 if the blink setting is supported, or -EINVAL 64function should return 0 if the blink setting is supported, or -EINVAL
65otherwise, which means that LED blinking will be handled by software. 65otherwise, which means that LED blinking will be handled by software.
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 82fafe0429fe..7228369d1014 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -36,11 +36,13 @@
36#include <sched.h> 36#include <sched.h>
37#include <limits.h> 37#include <limits.h>
38#include <stddef.h> 38#include <stddef.h>
39#include <signal.h>
39#include "linux/lguest_launcher.h" 40#include "linux/lguest_launcher.h"
40#include "linux/virtio_config.h" 41#include "linux/virtio_config.h"
41#include "linux/virtio_net.h" 42#include "linux/virtio_net.h"
42#include "linux/virtio_blk.h" 43#include "linux/virtio_blk.h"
43#include "linux/virtio_console.h" 44#include "linux/virtio_console.h"
45#include "linux/virtio_rng.h"
44#include "linux/virtio_ring.h" 46#include "linux/virtio_ring.h"
45#include "asm-x86/bootparam.h" 47#include "asm-x86/bootparam.h"
46/*L:110 We can ignore the 39 include files we need for this program, but I do 48/*L:110 We can ignore the 39 include files we need for this program, but I do
@@ -64,8 +66,8 @@ typedef uint8_t u8;
64#endif 66#endif
65/* We can have up to 256 pages for devices. */ 67/* We can have up to 256 pages for devices. */
66#define DEVICE_PAGES 256 68#define DEVICE_PAGES 256
67/* This will occupy 2 pages: it must be a power of 2. */ 69/* This will occupy 3 pages: it must be a power of 2. */
68#define VIRTQUEUE_NUM 128 70#define VIRTQUEUE_NUM 256
69 71
70/*L:120 verbose is both a global flag and a macro. The C preprocessor allows 72/*L:120 verbose is both a global flag and a macro. The C preprocessor allows
71 * this, and although I wouldn't recommend it, it works quite nicely here. */ 73 * this, and although I wouldn't recommend it, it works quite nicely here. */
@@ -74,12 +76,19 @@ static bool verbose;
74 do { if (verbose) printf(args); } while(0) 76 do { if (verbose) printf(args); } while(0)
75/*:*/ 77/*:*/
76 78
77/* The pipe to send commands to the waker process */ 79/* File descriptors for the Waker. */
78static int waker_fd; 80struct {
81 int pipe[2];
82 int lguest_fd;
83} waker_fds;
84
79/* The pointer to the start of guest memory. */ 85/* The pointer to the start of guest memory. */
80static void *guest_base; 86static void *guest_base;
81/* The maximum guest physical address allowed, and maximum possible. */ 87/* The maximum guest physical address allowed, and maximum possible. */
82static unsigned long guest_limit, guest_max; 88static unsigned long guest_limit, guest_max;
89/* The pipe for signal hander to write to. */
90static int timeoutpipe[2];
91static unsigned int timeout_usec = 500;
83 92
84/* a per-cpu variable indicating whose vcpu is currently running */ 93/* a per-cpu variable indicating whose vcpu is currently running */
85static unsigned int __thread cpu_id; 94static unsigned int __thread cpu_id;
@@ -155,11 +164,14 @@ struct virtqueue
155 /* Last available index we saw. */ 164 /* Last available index we saw. */
156 u16 last_avail_idx; 165 u16 last_avail_idx;
157 166
158 /* The routine to call when the Guest pings us. */ 167 /* The routine to call when the Guest pings us, or timeout. */
159 void (*handle_output)(int fd, struct virtqueue *me); 168 void (*handle_output)(int fd, struct virtqueue *me, bool timeout);
160 169
161 /* Outstanding buffers */ 170 /* Outstanding buffers */
162 unsigned int inflight; 171 unsigned int inflight;
172
173 /* Is this blocked awaiting a timer? */
174 bool blocked;
163}; 175};
164 176
165/* Remember the arguments to the program so we can "reboot" */ 177/* Remember the arguments to the program so we can "reboot" */
@@ -190,6 +202,9 @@ static void *_convert(struct iovec *iov, size_t size, size_t align,
190 return iov->iov_base; 202 return iov->iov_base;
191} 203}
192 204
205/* Wrapper for the last available index. Makes it easier to change. */
206#define lg_last_avail(vq) ((vq)->last_avail_idx)
207
193/* The virtio configuration space is defined to be little-endian. x86 is 208/* The virtio configuration space is defined to be little-endian. x86 is
194 * little-endian too, but it's nice to be explicit so we have these helpers. */ 209 * little-endian too, but it's nice to be explicit so we have these helpers. */
195#define cpu_to_le16(v16) (v16) 210#define cpu_to_le16(v16) (v16)
@@ -199,6 +214,33 @@ static void *_convert(struct iovec *iov, size_t size, size_t align,
199#define le32_to_cpu(v32) (v32) 214#define le32_to_cpu(v32) (v32)
200#define le64_to_cpu(v64) (v64) 215#define le64_to_cpu(v64) (v64)
201 216
217/* Is this iovec empty? */
218static bool iov_empty(const struct iovec iov[], unsigned int num_iov)
219{
220 unsigned int i;
221
222 for (i = 0; i < num_iov; i++)
223 if (iov[i].iov_len)
224 return false;
225 return true;
226}
227
228/* Take len bytes from the front of this iovec. */
229static void iov_consume(struct iovec iov[], unsigned num_iov, unsigned len)
230{
231 unsigned int i;
232
233 for (i = 0; i < num_iov; i++) {
234 unsigned int used;
235
236 used = iov[i].iov_len < len ? iov[i].iov_len : len;
237 iov[i].iov_base += used;
238 iov[i].iov_len -= used;
239 len -= used;
240 }
241 assert(len == 0);
242}
243
202/* The device virtqueue descriptors are followed by feature bitmasks. */ 244/* The device virtqueue descriptors are followed by feature bitmasks. */
203static u8 *get_feature_bits(struct device *dev) 245static u8 *get_feature_bits(struct device *dev)
204{ 246{
@@ -254,6 +296,7 @@ static void *map_zeroed_pages(unsigned int num)
254 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); 296 PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
255 if (addr == MAP_FAILED) 297 if (addr == MAP_FAILED)
256 err(1, "Mmaping %u pages of /dev/zero", num); 298 err(1, "Mmaping %u pages of /dev/zero", num);
299 close(fd);
257 300
258 return addr; 301 return addr;
259} 302}
@@ -540,69 +583,64 @@ static void add_device_fd(int fd)
540 * watch, but handing a file descriptor mask through to the kernel is fairly 583 * watch, but handing a file descriptor mask through to the kernel is fairly
541 * icky. 584 * icky.
542 * 585 *
543 * Instead, we fork off a process which watches the file descriptors and writes 586 * Instead, we clone off a thread which watches the file descriptors and writes
544 * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host 587 * the LHREQ_BREAK command to the /dev/lguest file descriptor to tell the Host
545 * stop running the Guest. This causes the Launcher to return from the 588 * stop running the Guest. This causes the Launcher to return from the
546 * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset 589 * /dev/lguest read with -EAGAIN, where it will write to /dev/lguest to reset
547 * the LHREQ_BREAK and wake us up again. 590 * the LHREQ_BREAK and wake us up again.
548 * 591 *
549 * This, of course, is merely a different *kind* of icky. 592 * This, of course, is merely a different *kind* of icky.
593 *
594 * Given my well-known antipathy to threads, I'd prefer to use processes. But
595 * it's easier to share Guest memory with threads, and trivial to share the
596 * devices.infds as the Launcher changes it.
550 */ 597 */
551static void wake_parent(int pipefd, int lguest_fd) 598static int waker(void *unused)
552{ 599{
553 /* Add the pipe from the Launcher to the fdset in the device_list, so 600 /* Close the write end of the pipe: only the Launcher has it open. */
554 * we watch it, too. */ 601 close(waker_fds.pipe[1]);
555 add_device_fd(pipefd);
556 602
557 for (;;) { 603 for (;;) {
558 fd_set rfds = devices.infds; 604 fd_set rfds = devices.infds;
559 unsigned long args[] = { LHREQ_BREAK, 1 }; 605 unsigned long args[] = { LHREQ_BREAK, 1 };
606 unsigned int maxfd = devices.max_infd;
607
608 /* We also listen to the pipe from the Launcher. */
609 FD_SET(waker_fds.pipe[0], &rfds);
610 if (waker_fds.pipe[0] > maxfd)
611 maxfd = waker_fds.pipe[0];
560 612
561 /* Wait until input is ready from one of the devices. */ 613 /* Wait until input is ready from one of the devices. */
562 select(devices.max_infd+1, &rfds, NULL, NULL, NULL); 614 select(maxfd+1, &rfds, NULL, NULL, NULL);
563 /* Is it a message from the Launcher? */ 615
564 if (FD_ISSET(pipefd, &rfds)) { 616 /* Message from Launcher? */
565 int fd; 617 if (FD_ISSET(waker_fds.pipe[0], &rfds)) {
566 /* If read() returns 0, it means the Launcher has 618 char c;
567 * exited. We silently follow. */ 619 /* If this fails, then assume Launcher has exited.
568 if (read(pipefd, &fd, sizeof(fd)) == 0) 620 * Don't do anything on exit: we're just a thread! */
569 exit(0); 621 if (read(waker_fds.pipe[0], &c, 1) != 1)
570 /* Otherwise it's telling us to change what file 622 _exit(0);
571 * descriptors we're to listen to. Positive means 623 continue;
572 * listen to a new one, negative means stop 624 }
573 * listening. */ 625
574 if (fd >= 0) 626 /* Send LHREQ_BREAK command to snap the Launcher out of it. */
575 FD_SET(fd, &devices.infds); 627 pwrite(waker_fds.lguest_fd, args, sizeof(args), cpu_id);
576 else
577 FD_CLR(-fd - 1, &devices.infds);
578 } else /* Send LHREQ_BREAK command. */
579 pwrite(lguest_fd, args, sizeof(args), cpu_id);
580 } 628 }
629 return 0;
581} 630}
582 631
583/* This routine just sets up a pipe to the Waker process. */ 632/* This routine just sets up a pipe to the Waker process. */
584static int setup_waker(int lguest_fd) 633static void setup_waker(int lguest_fd)
585{ 634{
586 int pipefd[2], child; 635 /* This pipe is closed when Launcher dies, telling Waker. */
587 636 if (pipe(waker_fds.pipe) != 0)
588 /* We create a pipe to talk to the Waker, and also so it knows when the 637 err(1, "Creating pipe for Waker");
589 * Launcher dies (and closes pipe). */ 638
590 pipe(pipefd); 639 /* Waker also needs to know the lguest fd */
591 child = fork(); 640 waker_fds.lguest_fd = lguest_fd;
592 if (child == -1)
593 err(1, "forking");
594
595 if (child == 0) {
596 /* We are the Waker: close the "writing" end of our copy of the
597 * pipe and start waiting for input. */
598 close(pipefd[1]);
599 wake_parent(pipefd[0], lguest_fd);
600 }
601 /* Close the reading end of our copy of the pipe. */
602 close(pipefd[0]);
603 641
604 /* Here is the fd used to talk to the waker. */ 642 if (clone(waker, malloc(4096) + 4096, CLONE_VM | SIGCHLD, NULL) == -1)
605 return pipefd[1]; 643 err(1, "Creating Waker");
606} 644}
607 645
608/* 646/*
@@ -661,19 +699,22 @@ static unsigned get_vq_desc(struct virtqueue *vq,
661 unsigned int *out_num, unsigned int *in_num) 699 unsigned int *out_num, unsigned int *in_num)
662{ 700{
663 unsigned int i, head; 701 unsigned int i, head;
702 u16 last_avail;
664 703
665 /* Check it isn't doing very strange things with descriptor numbers. */ 704 /* Check it isn't doing very strange things with descriptor numbers. */
666 if ((u16)(vq->vring.avail->idx - vq->last_avail_idx) > vq->vring.num) 705 last_avail = lg_last_avail(vq);
706 if ((u16)(vq->vring.avail->idx - last_avail) > vq->vring.num)
667 errx(1, "Guest moved used index from %u to %u", 707 errx(1, "Guest moved used index from %u to %u",
668 vq->last_avail_idx, vq->vring.avail->idx); 708 last_avail, vq->vring.avail->idx);
669 709
670 /* If there's nothing new since last we looked, return invalid. */ 710 /* If there's nothing new since last we looked, return invalid. */
671 if (vq->vring.avail->idx == vq->last_avail_idx) 711 if (vq->vring.avail->idx == last_avail)
672 return vq->vring.num; 712 return vq->vring.num;
673 713
674 /* Grab the next descriptor number they're advertising, and increment 714 /* Grab the next descriptor number they're advertising, and increment
675 * the index we've seen. */ 715 * the index we've seen. */
676 head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num]; 716 head = vq->vring.avail->ring[last_avail % vq->vring.num];
717 lg_last_avail(vq)++;
677 718
678 /* If their number is silly, that's a fatal mistake. */ 719 /* If their number is silly, that's a fatal mistake. */
679 if (head >= vq->vring.num) 720 if (head >= vq->vring.num)
@@ -821,8 +862,8 @@ static bool handle_console_input(int fd, struct device *dev)
821 unsigned long args[] = { LHREQ_BREAK, 0 }; 862 unsigned long args[] = { LHREQ_BREAK, 0 };
822 /* Close the fd so Waker will know it has to 863 /* Close the fd so Waker will know it has to
823 * exit. */ 864 * exit. */
824 close(waker_fd); 865 close(waker_fds.pipe[1]);
825 /* Just in case waker is blocked in BREAK, send 866 /* Just in case Waker is blocked in BREAK, send
826 * unbreak now. */ 867 * unbreak now. */
827 write(fd, args, sizeof(args)); 868 write(fd, args, sizeof(args));
828 exit(2); 869 exit(2);
@@ -839,7 +880,7 @@ static bool handle_console_input(int fd, struct device *dev)
839 880
840/* Handling output for console is simple: we just get all the output buffers 881/* Handling output for console is simple: we just get all the output buffers
841 * and write them to stdout. */ 882 * and write them to stdout. */
842static void handle_console_output(int fd, struct virtqueue *vq) 883static void handle_console_output(int fd, struct virtqueue *vq, bool timeout)
843{ 884{
844 unsigned int head, out, in; 885 unsigned int head, out, in;
845 int len; 886 int len;
@@ -854,6 +895,24 @@ static void handle_console_output(int fd, struct virtqueue *vq)
854 } 895 }
855} 896}
856 897
898/* This is called when we no longer want to hear about Guest changes to a
899 * virtqueue. This is more efficient in high-traffic cases, but it means we
900 * have to set a timer to check if any more changes have occurred. */
901static void block_vq(struct virtqueue *vq)
902{
903 struct itimerval itm;
904
905 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;
906 vq->blocked = true;
907
908 itm.it_interval.tv_sec = 0;
909 itm.it_interval.tv_usec = 0;
910 itm.it_value.tv_sec = 0;
911 itm.it_value.tv_usec = timeout_usec;
912
913 setitimer(ITIMER_REAL, &itm, NULL);
914}
915
857/* 916/*
858 * The Network 917 * The Network
859 * 918 *
@@ -861,22 +920,39 @@ static void handle_console_output(int fd, struct virtqueue *vq)
861 * and write them (ignoring the first element) to this device's file descriptor 920 * and write them (ignoring the first element) to this device's file descriptor
862 * (/dev/net/tun). 921 * (/dev/net/tun).
863 */ 922 */
864static void handle_net_output(int fd, struct virtqueue *vq) 923static void handle_net_output(int fd, struct virtqueue *vq, bool timeout)
865{ 924{
866 unsigned int head, out, in; 925 unsigned int head, out, in, num = 0;
867 int len; 926 int len;
868 struct iovec iov[vq->vring.num]; 927 struct iovec iov[vq->vring.num];
928 static int last_timeout_num;
869 929
870 /* Keep getting output buffers from the Guest until we run out. */ 930 /* Keep getting output buffers from the Guest until we run out. */
871 while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) { 931 while ((head = get_vq_desc(vq, iov, &out, &in)) != vq->vring.num) {
872 if (in) 932 if (in)
873 errx(1, "Input buffers in output queue?"); 933 errx(1, "Input buffers in output queue?");
874 /* Check header, but otherwise ignore it (we told the Guest we 934 len = writev(vq->dev->fd, iov, out);
875 * supported no features, so it shouldn't have anything 935 if (len < 0)
876 * interesting). */ 936 err(1, "Writing network packet to tun");
877 (void)convert(&iov[0], struct virtio_net_hdr);
878 len = writev(vq->dev->fd, iov+1, out-1);
879 add_used_and_trigger(fd, vq, head, len); 937 add_used_and_trigger(fd, vq, head, len);
938 num++;
939 }
940
941 /* Block further kicks and set up a timer if we saw anything. */
942 if (!timeout && num)
943 block_vq(vq);
944
945 /* We never quite know how long should we wait before we check the
946 * queue again for more packets. We start at 500 microseconds, and if
947 * we get fewer packets than last time, we assume we made the timeout
948 * too small and increase it by 10 microseconds. Otherwise, we drop it
949 * by one microsecond every time. It seems to work well enough. */
950 if (timeout) {
951 if (num < last_timeout_num)
952 timeout_usec += 10;
953 else if (timeout_usec > 1)
954 timeout_usec--;
955 last_timeout_num = num;
880 } 956 }
881} 957}
882 958
@@ -887,7 +963,6 @@ static bool handle_tun_input(int fd, struct device *dev)
887 unsigned int head, in_num, out_num; 963 unsigned int head, in_num, out_num;
888 int len; 964 int len;
889 struct iovec iov[dev->vq->vring.num]; 965 struct iovec iov[dev->vq->vring.num];
890 struct virtio_net_hdr *hdr;
891 966
892 /* First we need a network buffer from the Guests's recv virtqueue. */ 967 /* First we need a network buffer from the Guests's recv virtqueue. */
893 head = get_vq_desc(dev->vq, iov, &out_num, &in_num); 968 head = get_vq_desc(dev->vq, iov, &out_num, &in_num);
@@ -896,25 +971,23 @@ static bool handle_tun_input(int fd, struct device *dev)
896 * early, the Guest won't be ready yet. Wait until the device 971 * early, the Guest won't be ready yet. Wait until the device
897 * status says it's ready. */ 972 * status says it's ready. */
898 /* FIXME: Actually want DRIVER_ACTIVE here. */ 973 /* FIXME: Actually want DRIVER_ACTIVE here. */
899 if (dev->desc->status & VIRTIO_CONFIG_S_DRIVER_OK) 974
900 warn("network: no dma buffer!"); 975 /* Now tell it we want to know if new things appear. */
976 dev->vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY;
977 wmb();
978
901 /* We'll turn this back on if input buffers are registered. */ 979 /* We'll turn this back on if input buffers are registered. */
902 return false; 980 return false;
903 } else if (out_num) 981 } else if (out_num)
904 errx(1, "Output buffers in network recv queue?"); 982 errx(1, "Output buffers in network recv queue?");
905 983
906 /* First element is the header: we set it to 0 (no features). */
907 hdr = convert(&iov[0], struct virtio_net_hdr);
908 hdr->flags = 0;
909 hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
910
911 /* Read the packet from the device directly into the Guest's buffer. */ 984 /* Read the packet from the device directly into the Guest's buffer. */
912 len = readv(dev->fd, iov+1, in_num-1); 985 len = readv(dev->fd, iov, in_num);
913 if (len <= 0) 986 if (len <= 0)
914 err(1, "reading network"); 987 err(1, "reading network");
915 988
916 /* Tell the Guest about the new packet. */ 989 /* Tell the Guest about the new packet. */
917 add_used_and_trigger(fd, dev->vq, head, sizeof(*hdr) + len); 990 add_used_and_trigger(fd, dev->vq, head, len);
918 991
919 verbose("tun input packet len %i [%02x %02x] (%s)\n", len, 992 verbose("tun input packet len %i [%02x %02x] (%s)\n", len,
920 ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1], 993 ((u8 *)iov[1].iov_base)[0], ((u8 *)iov[1].iov_base)[1],
@@ -927,11 +1000,18 @@ static bool handle_tun_input(int fd, struct device *dev)
927/*L:215 This is the callback attached to the network and console input 1000/*L:215 This is the callback attached to the network and console input
928 * virtqueues: it ensures we try again, in case we stopped console or net 1001 * virtqueues: it ensures we try again, in case we stopped console or net
929 * delivery because Guest didn't have any buffers. */ 1002 * delivery because Guest didn't have any buffers. */
930static void enable_fd(int fd, struct virtqueue *vq) 1003static void enable_fd(int fd, struct virtqueue *vq, bool timeout)
931{ 1004{
932 add_device_fd(vq->dev->fd); 1005 add_device_fd(vq->dev->fd);
933 /* Tell waker to listen to it again */ 1006 /* Snap the Waker out of its select loop. */
934 write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd)); 1007 write(waker_fds.pipe[1], "", 1);
1008}
1009
1010static void net_enable_fd(int fd, struct virtqueue *vq, bool timeout)
1011{
1012 /* We don't need to know again when Guest refills receive buffer. */
1013 vq->vring.used->flags |= VRING_USED_F_NO_NOTIFY;
1014 enable_fd(fd, vq, timeout);
935} 1015}
936 1016
937/* When the Guest tells us they updated the status field, we handle it. */ 1017/* When the Guest tells us they updated the status field, we handle it. */
@@ -951,7 +1031,7 @@ static void update_device_status(struct device *dev)
951 for (vq = dev->vq; vq; vq = vq->next) { 1031 for (vq = dev->vq; vq; vq = vq->next) {
952 memset(vq->vring.desc, 0, 1032 memset(vq->vring.desc, 0,
953 vring_size(vq->config.num, getpagesize())); 1033 vring_size(vq->config.num, getpagesize()));
954 vq->last_avail_idx = 0; 1034 lg_last_avail(vq) = 0;
955 } 1035 }
956 } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { 1036 } else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) {
957 warnx("Device %s configuration FAILED", dev->name); 1037 warnx("Device %s configuration FAILED", dev->name);
@@ -960,10 +1040,10 @@ static void update_device_status(struct device *dev)
960 1040
961 verbose("Device %s OK: offered", dev->name); 1041 verbose("Device %s OK: offered", dev->name);
962 for (i = 0; i < dev->desc->feature_len; i++) 1042 for (i = 0; i < dev->desc->feature_len; i++)
963 verbose(" %08x", get_feature_bits(dev)[i]); 1043 verbose(" %02x", get_feature_bits(dev)[i]);
964 verbose(", accepted"); 1044 verbose(", accepted");
965 for (i = 0; i < dev->desc->feature_len; i++) 1045 for (i = 0; i < dev->desc->feature_len; i++)
966 verbose(" %08x", get_feature_bits(dev) 1046 verbose(" %02x", get_feature_bits(dev)
967 [dev->desc->feature_len+i]); 1047 [dev->desc->feature_len+i]);
968 1048
969 if (dev->ready) 1049 if (dev->ready)
@@ -1000,7 +1080,7 @@ static void handle_output(int fd, unsigned long addr)
1000 if (strcmp(vq->dev->name, "console") != 0) 1080 if (strcmp(vq->dev->name, "console") != 0)
1001 verbose("Output to %s\n", vq->dev->name); 1081 verbose("Output to %s\n", vq->dev->name);
1002 if (vq->handle_output) 1082 if (vq->handle_output)
1003 vq->handle_output(fd, vq); 1083 vq->handle_output(fd, vq, false);
1004 return; 1084 return;
1005 } 1085 }
1006 } 1086 }
@@ -1014,6 +1094,29 @@ static void handle_output(int fd, unsigned long addr)
1014 strnlen(from_guest_phys(addr), guest_limit - addr)); 1094 strnlen(from_guest_phys(addr), guest_limit - addr));
1015} 1095}
1016 1096
1097static void handle_timeout(int fd)
1098{
1099 char buf[32];
1100 struct device *i;
1101 struct virtqueue *vq;
1102
1103 /* Clear the pipe */
1104 read(timeoutpipe[0], buf, sizeof(buf));
1105
1106 /* Check each device and virtqueue: flush blocked ones. */
1107 for (i = devices.dev; i; i = i->next) {
1108 for (vq = i->vq; vq; vq = vq->next) {
1109 if (!vq->blocked)
1110 continue;
1111
1112 vq->vring.used->flags &= ~VRING_USED_F_NO_NOTIFY;
1113 vq->blocked = false;
1114 if (vq->handle_output)
1115 vq->handle_output(fd, vq, true);
1116 }
1117 }
1118}
1119
1017/* This is called when the Waker wakes us up: check for incoming file 1120/* This is called when the Waker wakes us up: check for incoming file
1018 * descriptors. */ 1121 * descriptors. */
1019static void handle_input(int fd) 1122static void handle_input(int fd)
@@ -1024,16 +1127,20 @@ static void handle_input(int fd)
1024 for (;;) { 1127 for (;;) {
1025 struct device *i; 1128 struct device *i;
1026 fd_set fds = devices.infds; 1129 fd_set fds = devices.infds;
1130 int num;
1027 1131
1132 num = select(devices.max_infd+1, &fds, NULL, NULL, &poll);
1133 /* Could get interrupted */
1134 if (num < 0)
1135 continue;
1028 /* If nothing is ready, we're done. */ 1136 /* If nothing is ready, we're done. */
1029 if (select(devices.max_infd+1, &fds, NULL, NULL, &poll) == 0) 1137 if (num == 0)
1030 break; 1138 break;
1031 1139
1032 /* Otherwise, call the device(s) which have readable file 1140 /* Otherwise, call the device(s) which have readable file
1033 * descriptors and a method of handling them. */ 1141 * descriptors and a method of handling them. */
1034 for (i = devices.dev; i; i = i->next) { 1142 for (i = devices.dev; i; i = i->next) {
1035 if (i->handle_input && FD_ISSET(i->fd, &fds)) { 1143 if (i->handle_input && FD_ISSET(i->fd, &fds)) {
1036 int dev_fd;
1037 if (i->handle_input(fd, i)) 1144 if (i->handle_input(fd, i))
1038 continue; 1145 continue;
1039 1146
@@ -1043,13 +1150,12 @@ static void handle_input(int fd)
1043 * buffers to deliver into. Console also uses 1150 * buffers to deliver into. Console also uses
1044 * it when it discovers that stdin is closed. */ 1151 * it when it discovers that stdin is closed. */
1045 FD_CLR(i->fd, &devices.infds); 1152 FD_CLR(i->fd, &devices.infds);
1046 /* Tell waker to ignore it too, by sending a
1047 * negative fd number (-1, since 0 is a valid
1048 * FD number). */
1049 dev_fd = -i->fd - 1;
1050 write(waker_fd, &dev_fd, sizeof(dev_fd));
1051 } 1153 }
1052 } 1154 }
1155
1156 /* Is this the timeout fd? */
1157 if (FD_ISSET(timeoutpipe[0], &fds))
1158 handle_timeout(fd);
1053 } 1159 }
1054} 1160}
1055 1161
@@ -1098,7 +1204,7 @@ static struct lguest_device_desc *new_dev_desc(u16 type)
1098/* Each device descriptor is followed by the description of its virtqueues. We 1204/* Each device descriptor is followed by the description of its virtqueues. We
1099 * specify how many descriptors the virtqueue is to have. */ 1205 * specify how many descriptors the virtqueue is to have. */
1100static void add_virtqueue(struct device *dev, unsigned int num_descs, 1206static void add_virtqueue(struct device *dev, unsigned int num_descs,
1101 void (*handle_output)(int fd, struct virtqueue *me)) 1207 void (*handle_output)(int, struct virtqueue *, bool))
1102{ 1208{
1103 unsigned int pages; 1209 unsigned int pages;
1104 struct virtqueue **i, *vq = malloc(sizeof(*vq)); 1210 struct virtqueue **i, *vq = malloc(sizeof(*vq));
@@ -1114,6 +1220,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
1114 vq->last_avail_idx = 0; 1220 vq->last_avail_idx = 0;
1115 vq->dev = dev; 1221 vq->dev = dev;
1116 vq->inflight = 0; 1222 vq->inflight = 0;
1223 vq->blocked = false;
1117 1224
1118 /* Initialize the configuration. */ 1225 /* Initialize the configuration. */
1119 vq->config.num = num_descs; 1226 vq->config.num = num_descs;
@@ -1246,6 +1353,24 @@ static void setup_console(void)
1246} 1353}
1247/*:*/ 1354/*:*/
1248 1355
1356static void timeout_alarm(int sig)
1357{
1358 write(timeoutpipe[1], "", 1);
1359}
1360
1361static void setup_timeout(void)
1362{
1363 if (pipe(timeoutpipe) != 0)
1364 err(1, "Creating timeout pipe");
1365
1366 if (fcntl(timeoutpipe[1], F_SETFL,
1367 fcntl(timeoutpipe[1], F_GETFL) | O_NONBLOCK) != 0)
1368 err(1, "Making timeout pipe nonblocking");
1369
1370 add_device_fd(timeoutpipe[0]);
1371 signal(SIGALRM, timeout_alarm);
1372}
1373
1249/*M:010 Inter-guest networking is an interesting area. Simplest is to have a 1374/*M:010 Inter-guest networking is an interesting area. Simplest is to have a
1250 * --sharenet=<name> option which opens or creates a named pipe. This can be 1375 * --sharenet=<name> option which opens or creates a named pipe. This can be
1251 * used to send packets to another guest in a 1:1 manner. 1376 * used to send packets to another guest in a 1:1 manner.
@@ -1264,10 +1389,25 @@ static void setup_console(void)
1264 1389
1265static u32 str2ip(const char *ipaddr) 1390static u32 str2ip(const char *ipaddr)
1266{ 1391{
1267 unsigned int byte[4]; 1392 unsigned int b[4];
1393
1394 if (sscanf(ipaddr, "%u.%u.%u.%u", &b[0], &b[1], &b[2], &b[3]) != 4)
1395 errx(1, "Failed to parse IP address '%s'", ipaddr);
1396 return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
1397}
1268 1398
1269 sscanf(ipaddr, "%u.%u.%u.%u", &byte[0], &byte[1], &byte[2], &byte[3]); 1399static void str2mac(const char *macaddr, unsigned char mac[6])
1270 return (byte[0] << 24) | (byte[1] << 16) | (byte[2] << 8) | byte[3]; 1400{
1401 unsigned int m[6];
1402 if (sscanf(macaddr, "%02x:%02x:%02x:%02x:%02x:%02x",
1403 &m[0], &m[1], &m[2], &m[3], &m[4], &m[5]) != 6)
1404 errx(1, "Failed to parse mac address '%s'", macaddr);
1405 mac[0] = m[0];
1406 mac[1] = m[1];
1407 mac[2] = m[2];
1408 mac[3] = m[3];
1409 mac[4] = m[4];
1410 mac[5] = m[5];
1271} 1411}
1272 1412
1273/* This code is "adapted" from libbridge: it attaches the Host end of the 1413/* This code is "adapted" from libbridge: it attaches the Host end of the
@@ -1288,6 +1428,7 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1288 errx(1, "interface %s does not exist!", if_name); 1428 errx(1, "interface %s does not exist!", if_name);
1289 1429
1290 strncpy(ifr.ifr_name, br_name, IFNAMSIZ); 1430 strncpy(ifr.ifr_name, br_name, IFNAMSIZ);
1431 ifr.ifr_name[IFNAMSIZ-1] = '\0';
1291 ifr.ifr_ifindex = ifidx; 1432 ifr.ifr_ifindex = ifidx;
1292 if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) 1433 if (ioctl(fd, SIOCBRADDIF, &ifr) < 0)
1293 err(1, "can't add %s to bridge %s", if_name, br_name); 1434 err(1, "can't add %s to bridge %s", if_name, br_name);
@@ -1296,64 +1437,75 @@ static void add_to_bridge(int fd, const char *if_name, const char *br_name)
1296/* This sets up the Host end of the network device with an IP address, brings 1437/* This sets up the Host end of the network device with an IP address, brings
1297 * it up so packets will flow, the copies the MAC address into the hwaddr 1438 * it up so packets will flow, the copies the MAC address into the hwaddr
1298 * pointer. */ 1439 * pointer. */
1299static void configure_device(int fd, const char *devname, u32 ipaddr, 1440static void configure_device(int fd, const char *tapif, u32 ipaddr)
1300 unsigned char hwaddr[6])
1301{ 1441{
1302 struct ifreq ifr; 1442 struct ifreq ifr;
1303 struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr; 1443 struct sockaddr_in *sin = (struct sockaddr_in *)&ifr.ifr_addr;
1304 1444
1305 /* Don't read these incantations. Just cut & paste them like I did! */
1306 memset(&ifr, 0, sizeof(ifr)); 1445 memset(&ifr, 0, sizeof(ifr));
1307 strcpy(ifr.ifr_name, devname); 1446 strcpy(ifr.ifr_name, tapif);
1447
1448 /* Don't read these incantations. Just cut & paste them like I did! */
1308 sin->sin_family = AF_INET; 1449 sin->sin_family = AF_INET;
1309 sin->sin_addr.s_addr = htonl(ipaddr); 1450 sin->sin_addr.s_addr = htonl(ipaddr);
1310 if (ioctl(fd, SIOCSIFADDR, &ifr) != 0) 1451 if (ioctl(fd, SIOCSIFADDR, &ifr) != 0)
1311 err(1, "Setting %s interface address", devname); 1452 err(1, "Setting %s interface address", tapif);
1312 ifr.ifr_flags = IFF_UP; 1453 ifr.ifr_flags = IFF_UP;
1313 if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0) 1454 if (ioctl(fd, SIOCSIFFLAGS, &ifr) != 0)
1314 err(1, "Bringing interface %s up", devname); 1455 err(1, "Bringing interface %s up", tapif);
1315
1316 /* SIOC stands for Socket I/O Control. G means Get (vs S for Set
1317 * above). IF means Interface, and HWADDR is hardware address.
1318 * Simple! */
1319 if (ioctl(fd, SIOCGIFHWADDR, &ifr) != 0)
1320 err(1, "getting hw address for %s", devname);
1321 memcpy(hwaddr, ifr.ifr_hwaddr.sa_data, 6);
1322} 1456}
1323 1457
1324/*L:195 Our network is a Host<->Guest network. This can either use bridging or 1458static int get_tun_device(char tapif[IFNAMSIZ])
1325 * routing, but the principle is the same: it uses the "tun" device to inject
1326 * packets into the Host as if they came in from a normal network card. We
1327 * just shunt packets between the Guest and the tun device. */
1328static void setup_tun_net(const char *arg)
1329{ 1459{
1330 struct device *dev;
1331 struct ifreq ifr; 1460 struct ifreq ifr;
1332 int netfd, ipfd; 1461 int netfd;
1333 u32 ip; 1462
1334 const char *br_name = NULL; 1463 /* Start with this zeroed. Messy but sure. */
1335 struct virtio_net_config conf; 1464 memset(&ifr, 0, sizeof(ifr));
1336 1465
1337 /* We open the /dev/net/tun device and tell it we want a tap device. A 1466 /* We open the /dev/net/tun device and tell it we want a tap device. A
1338 * tap device is like a tun device, only somehow different. To tell 1467 * tap device is like a tun device, only somehow different. To tell
1339 * the truth, I completely blundered my way through this code, but it 1468 * the truth, I completely blundered my way through this code, but it
1340 * works now! */ 1469 * works now! */
1341 netfd = open_or_die("/dev/net/tun", O_RDWR); 1470 netfd = open_or_die("/dev/net/tun", O_RDWR);
1342 memset(&ifr, 0, sizeof(ifr)); 1471 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR;
1343 ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
1344 strcpy(ifr.ifr_name, "tap%d"); 1472 strcpy(ifr.ifr_name, "tap%d");
1345 if (ioctl(netfd, TUNSETIFF, &ifr) != 0) 1473 if (ioctl(netfd, TUNSETIFF, &ifr) != 0)
1346 err(1, "configuring /dev/net/tun"); 1474 err(1, "configuring /dev/net/tun");
1475
1476 if (ioctl(netfd, TUNSETOFFLOAD,
1477 TUN_F_CSUM|TUN_F_TSO4|TUN_F_TSO6|TUN_F_TSO_ECN) != 0)
1478 err(1, "Could not set features for tun device");
1479
1347 /* We don't need checksums calculated for packets coming in this 1480 /* We don't need checksums calculated for packets coming in this
1348 * device: trust us! */ 1481 * device: trust us! */
1349 ioctl(netfd, TUNSETNOCSUM, 1); 1482 ioctl(netfd, TUNSETNOCSUM, 1);
1350 1483
1484 memcpy(tapif, ifr.ifr_name, IFNAMSIZ);
1485 return netfd;
1486}
1487
1488/*L:195 Our network is a Host<->Guest network. This can either use bridging or
1489 * routing, but the principle is the same: it uses the "tun" device to inject
1490 * packets into the Host as if they came in from a normal network card. We
1491 * just shunt packets between the Guest and the tun device. */
1492static void setup_tun_net(char *arg)
1493{
1494 struct device *dev;
1495 int netfd, ipfd;
1496 u32 ip = INADDR_ANY;
1497 bool bridging = false;
1498 char tapif[IFNAMSIZ], *p;
1499 struct virtio_net_config conf;
1500
1501 netfd = get_tun_device(tapif);
1502
1351 /* First we create a new network device. */ 1503 /* First we create a new network device. */
1352 dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input); 1504 dev = new_device("net", VIRTIO_ID_NET, netfd, handle_tun_input);
1353 1505
1354 /* Network devices need a receive and a send queue, just like 1506 /* Network devices need a receive and a send queue, just like
1355 * console. */ 1507 * console. */
1356 add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd); 1508 add_virtqueue(dev, VIRTQUEUE_NUM, net_enable_fd);
1357 add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output); 1509 add_virtqueue(dev, VIRTQUEUE_NUM, handle_net_output);
1358 1510
1359 /* We need a socket to perform the magic network ioctls to bring up the 1511 /* We need a socket to perform the magic network ioctls to bring up the
@@ -1364,28 +1516,50 @@ static void setup_tun_net(const char *arg)
1364 1516
1365 /* If the command line was --tunnet=bridge:<name> do bridging. */ 1517 /* If the command line was --tunnet=bridge:<name> do bridging. */
1366 if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) { 1518 if (!strncmp(BRIDGE_PFX, arg, strlen(BRIDGE_PFX))) {
1367 ip = INADDR_ANY; 1519 arg += strlen(BRIDGE_PFX);
1368 br_name = arg + strlen(BRIDGE_PFX); 1520 bridging = true;
1369 add_to_bridge(ipfd, ifr.ifr_name, br_name); 1521 }
1370 } else /* It is an IP address to set up the device with */ 1522
1523 /* A mac address may follow the bridge name or IP address */
1524 p = strchr(arg, ':');
1525 if (p) {
1526 str2mac(p+1, conf.mac);
1527 add_feature(dev, VIRTIO_NET_F_MAC);
1528 *p = '\0';
1529 }
1530
1531 /* arg is now either an IP address or a bridge name */
1532 if (bridging)
1533 add_to_bridge(ipfd, tapif, arg);
1534 else
1371 ip = str2ip(arg); 1535 ip = str2ip(arg);
1372 1536
1373 /* Set up the tun device, and get the mac address for the interface. */ 1537 /* Set up the tun device. */
1374 configure_device(ipfd, ifr.ifr_name, ip, conf.mac); 1538 configure_device(ipfd, tapif, ip);
1375 1539
1376 /* Tell Guest what MAC address to use. */
1377 add_feature(dev, VIRTIO_NET_F_MAC);
1378 add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); 1540 add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
1541 /* Expect Guest to handle everything except UFO */
1542 add_feature(dev, VIRTIO_NET_F_CSUM);
1543 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM);
1544 add_feature(dev, VIRTIO_NET_F_GUEST_TSO4);
1545 add_feature(dev, VIRTIO_NET_F_GUEST_TSO6);
1546 add_feature(dev, VIRTIO_NET_F_GUEST_ECN);
1547 add_feature(dev, VIRTIO_NET_F_HOST_TSO4);
1548 add_feature(dev, VIRTIO_NET_F_HOST_TSO6);
1549 add_feature(dev, VIRTIO_NET_F_HOST_ECN);
1379 set_config(dev, sizeof(conf), &conf); 1550 set_config(dev, sizeof(conf), &conf);
1380 1551
1381 /* We don't need the socket any more; setup is done. */ 1552 /* We don't need the socket any more; setup is done. */
1382 close(ipfd); 1553 close(ipfd);
1383 1554
1384 verbose("device %u: tun net %u.%u.%u.%u\n", 1555 devices.device_num++;
1385 devices.device_num++, 1556
1386 (u8)(ip>>24),(u8)(ip>>16),(u8)(ip>>8),(u8)ip); 1557 if (bridging)
1387 if (br_name) 1558 verbose("device %u: tun %s attached to bridge: %s\n",
1388 verbose("attached to bridge: %s\n", br_name); 1559 devices.device_num, tapif, arg);
1560 else
1561 verbose("device %u: tun %s: %s\n",
1562 devices.device_num, tapif, arg);
1389} 1563}
1390 1564
1391/* Our block (disk) device should be really simple: the Guest asks for a block 1565/* Our block (disk) device should be really simple: the Guest asks for a block
@@ -1550,7 +1724,7 @@ static bool handle_io_finish(int fd, struct device *dev)
1550} 1724}
1551 1725
1552/* When the Guest submits some I/O, we just need to wake the I/O thread. */ 1726/* When the Guest submits some I/O, we just need to wake the I/O thread. */
1553static void handle_virtblk_output(int fd, struct virtqueue *vq) 1727static void handle_virtblk_output(int fd, struct virtqueue *vq, bool timeout)
1554{ 1728{
1555 struct vblk_info *vblk = vq->dev->priv; 1729 struct vblk_info *vblk = vq->dev->priv;
1556 char c = 0; 1730 char c = 0;
@@ -1621,6 +1795,64 @@ static void setup_block_file(const char *filename)
1621 verbose("device %u: virtblock %llu sectors\n", 1795 verbose("device %u: virtblock %llu sectors\n",
1622 devices.device_num, le64_to_cpu(conf.capacity)); 1796 devices.device_num, le64_to_cpu(conf.capacity));
1623} 1797}
1798
1799/* Our random number generator device reads from /dev/random into the Guest's
1800 * input buffers. The usual case is that the Guest doesn't want random numbers
1801 * and so has no buffers although /dev/random is still readable, whereas
1802 * console is the reverse.
1803 *
1804 * The same logic applies, however. */
1805static bool handle_rng_input(int fd, struct device *dev)
1806{
1807 int len;
1808 unsigned int head, in_num, out_num, totlen = 0;
1809 struct iovec iov[dev->vq->vring.num];
1810
1811 /* First we need a buffer from the Guests's virtqueue. */
1812 head = get_vq_desc(dev->vq, iov, &out_num, &in_num);
1813
1814 /* If they're not ready for input, stop listening to this file
1815 * descriptor. We'll start again once they add an input buffer. */
1816 if (head == dev->vq->vring.num)
1817 return false;
1818
1819 if (out_num)
1820 errx(1, "Output buffers in rng?");
1821
1822 /* This is why we convert to iovecs: the readv() call uses them, and so
1823 * it reads straight into the Guest's buffer. We loop to make sure we
1824 * fill it. */
1825 while (!iov_empty(iov, in_num)) {
1826 len = readv(dev->fd, iov, in_num);
1827 if (len <= 0)
1828 err(1, "Read from /dev/random gave %i", len);
1829 iov_consume(iov, in_num, len);
1830 totlen += len;
1831 }
1832
1833 /* Tell the Guest about the new input. */
1834 add_used_and_trigger(fd, dev->vq, head, totlen);
1835
1836 /* Everything went OK! */
1837 return true;
1838}
1839
1840/* And this creates a "hardware" random number device for the Guest. */
1841static void setup_rng(void)
1842{
1843 struct device *dev;
1844 int fd;
1845
1846 fd = open_or_die("/dev/random", O_RDONLY);
1847
1848 /* The device responds to return from I/O thread. */
1849 dev = new_device("rng", VIRTIO_ID_RNG, fd, handle_rng_input);
1850
1851 /* The device has one virtqueue, where the Guest places inbufs. */
1852 add_virtqueue(dev, VIRTQUEUE_NUM, enable_fd);
1853
1854 verbose("device %u: rng\n", devices.device_num++);
1855}
1624/* That's the end of device setup. */ 1856/* That's the end of device setup. */
1625 1857
1626/*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */ 1858/*L:230 Reboot is pretty easy: clean up and exec() the Launcher afresh. */
@@ -1628,11 +1860,12 @@ static void __attribute__((noreturn)) restart_guest(void)
1628{ 1860{
1629 unsigned int i; 1861 unsigned int i;
1630 1862
1631 /* Closing pipes causes the Waker thread and io_threads to die, and 1863 /* Since we don't track all open fds, we simply close everything beyond
1632 * closing /dev/lguest cleans up the Guest. Since we don't track all 1864 * stderr. */
1633 * open fds, we simply close everything beyond stderr. */
1634 for (i = 3; i < FD_SETSIZE; i++) 1865 for (i = 3; i < FD_SETSIZE; i++)
1635 close(i); 1866 close(i);
1867
1868 /* The exec automatically gets rid of the I/O and Waker threads. */
1636 execv(main_args[0], main_args); 1869 execv(main_args[0], main_args);
1637 err(1, "Could not exec %s", main_args[0]); 1870 err(1, "Could not exec %s", main_args[0]);
1638} 1871}
@@ -1663,7 +1896,7 @@ static void __attribute__((noreturn)) run_guest(int lguest_fd)
1663 /* ERESTART means that we need to reboot the guest */ 1896 /* ERESTART means that we need to reboot the guest */
1664 } else if (errno == ERESTART) { 1897 } else if (errno == ERESTART) {
1665 restart_guest(); 1898 restart_guest();
1666 /* EAGAIN means the Waker wanted us to look at some input. 1899 /* EAGAIN means a signal (timeout).
1667 * Anything else means a bug or incompatible change. */ 1900 * Anything else means a bug or incompatible change. */
1668 } else if (errno != EAGAIN) 1901 } else if (errno != EAGAIN)
1669 err(1, "Running guest failed"); 1902 err(1, "Running guest failed");
@@ -1691,13 +1924,14 @@ static struct option opts[] = {
1691 { "verbose", 0, NULL, 'v' }, 1924 { "verbose", 0, NULL, 'v' },
1692 { "tunnet", 1, NULL, 't' }, 1925 { "tunnet", 1, NULL, 't' },
1693 { "block", 1, NULL, 'b' }, 1926 { "block", 1, NULL, 'b' },
1927 { "rng", 0, NULL, 'r' },
1694 { "initrd", 1, NULL, 'i' }, 1928 { "initrd", 1, NULL, 'i' },
1695 { NULL }, 1929 { NULL },
1696}; 1930};
1697static void usage(void) 1931static void usage(void)
1698{ 1932{
1699 errx(1, "Usage: lguest [--verbose] " 1933 errx(1, "Usage: lguest [--verbose] "
1700 "[--tunnet=(<ipaddr>|bridge:<bridgename>)\n" 1934 "[--tunnet=(<ipaddr>:<macaddr>|bridge:<bridgename>:<macaddr>)\n"
1701 "|--block=<filename>|--initrd=<filename>]...\n" 1935 "|--block=<filename>|--initrd=<filename>]...\n"
1702 "<mem-in-mb> vmlinux [args...]"); 1936 "<mem-in-mb> vmlinux [args...]");
1703} 1937}
@@ -1765,6 +1999,9 @@ int main(int argc, char *argv[])
1765 case 'b': 1999 case 'b':
1766 setup_block_file(optarg); 2000 setup_block_file(optarg);
1767 break; 2001 break;
2002 case 'r':
2003 setup_rng();
2004 break;
1768 case 'i': 2005 case 'i':
1769 initrd_name = optarg; 2006 initrd_name = optarg;
1770 break; 2007 break;
@@ -1783,6 +2020,9 @@ int main(int argc, char *argv[])
1783 /* We always have a console device */ 2020 /* We always have a console device */
1784 setup_console(); 2021 setup_console();
1785 2022
2023 /* We can timeout waiting for Guest network transmit. */
2024 setup_timeout();
2025
1786 /* Now we load the kernel */ 2026 /* Now we load the kernel */
1787 start = load_kernel(open_or_die(argv[optind+1], O_RDONLY)); 2027 start = load_kernel(open_or_die(argv[optind+1], O_RDONLY));
1788 2028
@@ -1826,10 +2066,10 @@ int main(int argc, char *argv[])
1826 * /dev/lguest file descriptor. */ 2066 * /dev/lguest file descriptor. */
1827 lguest_fd = tell_kernel(pgdir, start); 2067 lguest_fd = tell_kernel(pgdir, start);
1828 2068
1829 /* We fork off a child process, which wakes the Launcher whenever one 2069 /* We clone off a thread, which wakes the Launcher whenever one of the
1830 * of the input file descriptors needs attention. We call this the 2070 * input file descriptors needs attention. We call this the Waker, and
1831 * Waker, and we'll cover it in a moment. */ 2071 * we'll cover it in a moment. */
1832 waker_fd = setup_waker(lguest_fd); 2072 setup_waker(lguest_fd);
1833 2073
1834 /* Finally, run the Guest. This doesn't return. */ 2074 /* Finally, run the Guest. This doesn't return. */
1835 run_guest(lguest_fd); 2075 run_guest(lguest_fd);
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt
index 4269a1105b37..f4f8b1c6c8ba 100644
--- a/Documentation/local_ops.txt
+++ b/Documentation/local_ops.txt
@@ -36,7 +36,7 @@ It can be done by slightly modifying the standard atomic operations : only
36their UP variant must be kept. It typically means removing LOCK prefix (on 36their UP variant must be kept. It typically means removing LOCK prefix (on
37i386 and x86_64) and any SMP sychronization barrier. If the architecture does 37i386 and x86_64) and any SMP sychronization barrier. If the architecture does
38not have a different behavior between SMP and UP, including asm-generic/local.h 38not have a different behavior between SMP and UP, including asm-generic/local.h
39in your archtecture's local.h is sufficient. 39in your architecture's local.h is sufficient.
40 40
41The local_t type is defined as an opaque signed long by embedding an 41The local_t type is defined as an opaque signed long by embedding an
42atomic_long_t inside a structure. This is made so a cast from this type to a 42atomic_long_t inside a structure. This is made so a cast from this type to a
diff --git a/Documentation/md.txt b/Documentation/md.txt
index a8b430627473..1da9d1b1793f 100644
--- a/Documentation/md.txt
+++ b/Documentation/md.txt
@@ -236,6 +236,11 @@ All md devices contain:
236 writing the word for the desired state, however some states 236 writing the word for the desired state, however some states
237 cannot be explicitly set, and some transitions are not allowed. 237 cannot be explicitly set, and some transitions are not allowed.
238 238
239 Select/poll works on this file. All changes except between
240 active_idle and active (which can be frequent and are not
241 very interesting) are notified. active->active_idle is
242 reported if the metadata is externally managed.
243
239 clear 244 clear
240 No devices, no size, no level 245 No devices, no size, no level
241 Writing is equivalent to STOP_ARRAY ioctl 246 Writing is equivalent to STOP_ARRAY ioctl
@@ -292,6 +297,10 @@ Each directory contains:
292 writemostly - device will only be subject to read 297 writemostly - device will only be subject to read
293 requests if there are no other options. 298 requests if there are no other options.
294 This applies only to raid1 arrays. 299 This applies only to raid1 arrays.
300 blocked - device has failed, metadata is "external",
301 and the failure hasn't been acknowledged yet.
302 Writes that would write to this device if
303 it were not faulty are blocked.
295 spare - device is working, but not a full member. 304 spare - device is working, but not a full member.
296 This includes spares that are in the process 305 This includes spares that are in the process
297 of being recovered to 306 of being recovered to
@@ -301,6 +310,12 @@ Each directory contains:
301 Writing "remove" removes the device from the array. 310 Writing "remove" removes the device from the array.
302 Writing "writemostly" sets the writemostly flag. 311 Writing "writemostly" sets the writemostly flag.
303 Writing "-writemostly" clears the writemostly flag. 312 Writing "-writemostly" clears the writemostly flag.
313 Writing "blocked" sets the "blocked" flag.
314 Writing "-blocked" clear the "blocked" flag and allows writes
315 to complete.
316
317 This file responds to select/poll. Any change to 'faulty'
318 or 'blocked' causes an event.
304 319
305 errors 320 errors
306 An approximate count of read errors that have been detected on 321 An approximate count of read errors that have been detected on
@@ -332,7 +347,7 @@ Each directory contains:
332 for storage of data. This will normally be the same as the 347 for storage of data. This will normally be the same as the
333 component_size. This can be written while assembling an 348 component_size. This can be written while assembling an
334 array. If a value less than the current component_size is 349 array. If a value less than the current component_size is
335 written, component_size will be reduced to this value. 350 written, it will be rejected.
336 351
337 352
338An active md device will also contain and entry for each active device 353An active md device will also contain and entry for each active device
@@ -381,6 +396,19 @@ also have
381 'check' and 'repair' will start the appropriate process 396 'check' and 'repair' will start the appropriate process
382 providing the current state is 'idle'. 397 providing the current state is 'idle'.
383 398
399 This file responds to select/poll. Any important change in the value
400 triggers a poll event. Sometimes the value will briefly be
401 "recover" if a recovery seems to be needed, but cannot be
402 achieved. In that case, the transition to "recover" isn't
403 notified, but the transition away is.
404
405 degraded
406 This contains a count of the number of devices by which the
407 arrays is degraded. So an optimal array with show '0'. A
408 single failed/missing drive will show '1', etc.
409 This file responds to select/poll, any increase or decrease
410 in the count of missing devices will trigger an event.
411
384 mismatch_count 412 mismatch_count
385 When performing 'check' and 'repair', and possibly when 413 When performing 'check' and 'repair', and possibly when
386 performing 'resync', md will count the number of errors that are 414 performing 'resync', md will count the number of errors that are
diff --git a/Documentation/moxa-smartio b/Documentation/moxa-smartio
index fe24ecc6372e..5337e80a5b96 100644
--- a/Documentation/moxa-smartio
+++ b/Documentation/moxa-smartio
@@ -1,14 +1,22 @@
1============================================================================= 1=============================================================================
2 2 MOXA Smartio/Industio Family Device Driver Installation Guide
3 MOXA Smartio Family Device Driver Ver 1.1 Installation Guide 3 for Linux Kernel 2.4.x, 2.6.x
4 for Linux Kernel 2.2.x and 2.0.3x 4 Copyright (C) 2008, Moxa Inc.
5 Copyright (C) 1999, Moxa Technologies Co, Ltd.
6============================================================================= 5=============================================================================
6Date: 01/21/2008
7
7Content 8Content
8 9
91. Introduction 101. Introduction
102. System Requirement 112. System Requirement
113. Installation 123. Installation
13 3.1 Hardware installation
14 3.2 Driver files
15 3.3 Device naming convention
16 3.4 Module driver configuration
17 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x.
18 3.6 Custom configuration
19 3.7 Verify driver installation
124. Utilities 204. Utilities
135. Setserial 215. Setserial
146. Troubleshooting 226. Troubleshooting
@@ -16,27 +24,48 @@ Content
16----------------------------------------------------------------------------- 24-----------------------------------------------------------------------------
171. Introduction 251. Introduction
18 26
19 The Smartio family Linux driver, Ver. 1.1, supports following multiport 27 The Smartio/Industio/UPCI family Linux driver supports following multiport
20 boards. 28 boards.
21 29
22 -C104P/H/HS, C104H/PCI, C104HS/PCI, CI-104J 4 port multiport board. 30 - 2 ports multiport board
23 -C168P/H/HS, C168H/PCI 8 port multiport board. 31 CP-102U, CP-102UL, CP-102UF
24 32 CP-132U-I, CP-132UL,
25 This driver has been modified a little and cleaned up from the Moxa 33 CP-132, CP-132I, CP132S, CP-132IS,
26 contributed driver code and merged into Linux 2.2.14pre. In particular 34 CI-132, CI-132I, CI-132IS,
27 official major/minor numbers have been assigned which are different to 35 (C102H, C102HI, C102HIS, C102P, CP-102, CP-102S)
28 those the original Moxa supplied driver used. 36
37 - 4 ports multiport board
38 CP-104EL,
39 CP-104UL, CP-104JU,
40 CP-134U, CP-134U-I,
41 C104H/PCI, C104HS/PCI,
42 CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL,
43 C104H, C104HS,
44 CI-104J, CI-104JS,
45 CI-134, CI-134I, CI-134IS,
46 (C114HI, CT-114I, C104P)
47 POS-104UL,
48 CB-114,
49 CB-134I
50
51 - 8 ports multiport board
52 CP-118EL, CP-168EL,
53 CP-118U, CP-168U,
54 C168H/PCI,
55 C168H, C168HS,
56 (C168P),
57 CB-108
29 58
30 This driver and installation procedure have been developed upon Linux Kernel 59 This driver and installation procedure have been developed upon Linux Kernel
31 2.2.5 and backward compatible to 2.0.3x. This driver supports Intel x86 and 60 2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order
32 Alpha hardware platform. In order to maintain compatibility, this version 61 to maintain compatibility, this version has also been properly tested with
33 has also been properly tested with RedHat, OpenLinux, TurboLinux and 62 RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem
34 S.u.S.E Linux. However, if compatibility problem occurs, please contact 63 occurs, please contact Moxa at support@moxa.com.tw.
35 Moxa at support@moxa.com.tw.
36 64
37 In addition to device driver, useful utilities are also provided in this 65 In addition to device driver, useful utilities are also provided in this
38 version. They are 66 version. They are
39 - msdiag Diagnostic program for detecting installed Moxa Smartio boards. 67 - msdiag Diagnostic program for displaying installed Moxa
68 Smartio/Industio boards.
40 - msmon Monitor program to observe data count and line status signals. 69 - msmon Monitor program to observe data count and line status signals.
41 - msterm A simple terminal program which is useful in testing serial 70 - msterm A simple terminal program which is useful in testing serial
42 ports. 71 ports.
@@ -47,8 +76,7 @@ Content
47 GNU General Public License in this version. Please refer to GNU General 76 GNU General Public License in this version. Please refer to GNU General
48 Public License announcement in each source code file for more detail. 77 Public License announcement in each source code file for more detail.
49 78
50 In Moxa's ftp sites, you may always find latest driver at 79 In Moxa's Web sites, you may always find latest driver at http://web.moxa.com.
51 ftp://ftp.moxa.com or ftp://ftp.moxa.com.tw.
52 80
53 This version of driver can be installed as Loadable Module (Module driver) 81 This version of driver can be installed as Loadable Module (Module driver)
54 or built-in into kernel (Static driver). You may refer to following 82 or built-in into kernel (Static driver). You may refer to following
@@ -61,8 +89,8 @@ Content
61 89
62----------------------------------------------------------------------------- 90-----------------------------------------------------------------------------
632. System Requirement 912. System Requirement
64 - Hardware platform: Intel x86 or Alpha machine 92 - Hardware platform: Intel x86 machine
65 - Kernel version: 2.0.3x or 2.2.x 93 - Kernel version: 2.4.x or 2.6.x
66 - gcc version 2.72 or later 94 - gcc version 2.72 or later
67 - Maximum 4 boards can be installed in combination 95 - Maximum 4 boards can be installed in combination
68 96
@@ -70,9 +98,18 @@ Content
703. Installation 983. Installation
71 99
72 3.1 Hardware installation 100 3.1 Hardware installation
101 3.2 Driver files
102 3.3 Device naming convention
103 3.4 Module driver configuration
104 3.5 Static driver configuration for Linux kernel 2.4.x, 2.6.x.
105 3.6 Custom configuration
106 3.7 Verify driver installation
107
108
109 3.1 Hardware installation
73 110
74 There are two types of buses, ISA and PCI, for Smartio family multiport 111 There are two types of buses, ISA and PCI, for Smartio/Industio
75 board. 112 family multiport board.
76 113
77 ISA board 114 ISA board
78 --------- 115 ---------
@@ -81,47 +118,57 @@ Content
81 installation procedure in User's Manual before proceed any further. 118 installation procedure in User's Manual before proceed any further.
82 Please make sure the JP1 is open after the ISA board is set properly. 119 Please make sure the JP1 is open after the ISA board is set properly.
83 120
84 PCI board 121 PCI/UPCI board
85 --------- 122 --------------
86 You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict 123 You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict
87 with other ISA devices. Please refer to hardware installation 124 with other ISA devices. Please refer to hardware installation
88 procedure in User's Manual in advance. 125 procedure in User's Manual in advance.
89 126
90 IRQ Sharing 127 PCI IRQ Sharing
91 ----------- 128 -----------
92 Each port within the same multiport board shares the same IRQ. Up to 129 Each port within the same multiport board shares the same IRQ. Up to
93 4 Moxa Smartio Family multiport boards can be installed together on 130 4 Moxa Smartio/Industio PCI Family multiport boards can be installed
94 one system and they can share the same IRQ. 131 together on one system and they can share the same IRQ.
132
95 133
96 3.2 Driver files and device naming convention 134 3.2 Driver files
97 135
98 The driver file may be obtained from ftp, CD-ROM or floppy disk. The 136 The driver file may be obtained from ftp, CD-ROM or floppy disk. The
99 first step, anyway, is to copy driver file "mxser.tgz" into specified 137 first step, anyway, is to copy driver file "mxser.tgz" into specified
100 directory. e.g. /moxa. The execute commands as below. 138 directory. e.g. /moxa. The execute commands as below.
101 139
140 # cd /
141 # mkdir moxa
102 # cd /moxa 142 # cd /moxa
103 # tar xvf /dev/fd0 143 # tar xvf /dev/fd0
144
104 or 145 or
146
147 # cd /
148 # mkdir moxa
105 # cd /moxa 149 # cd /moxa
106 # cp /mnt/cdrom/<driver directory>/mxser.tgz . 150 # cp /mnt/cdrom/<driver directory>/mxser.tgz .
107 # tar xvfz mxser.tgz 151 # tar xvfz mxser.tgz
108 152
153
154 3.3 Device naming convention
155
109 You may find all the driver and utilities files in /moxa/mxser. 156 You may find all the driver and utilities files in /moxa/mxser.
110 Following installation procedure depends on the model you'd like to 157 Following installation procedure depends on the model you'd like to
111 run the driver. If you prefer module driver, please refer to 3.3. 158 run the driver. If you prefer module driver, please refer to 3.4.
112 If static driver is required, please refer to 3.4. 159 If static driver is required, please refer to 3.5.
113 160
114 Dialin and callout port 161 Dialin and callout port
115 ----------------------- 162 -----------------------
116 This driver remains traditional serial device properties. There're 163 This driver remains traditional serial device properties. There are
117 two special file name for each serial port. One is dial-in port 164 two special file name for each serial port. One is dial-in port
118 which is named "ttyMxx". For callout port, the naming convention 165 which is named "ttyMxx". For callout port, the naming convention
119 is "cumxx". 166 is "cumxx".
120 167
121 Device naming when more than 2 boards installed 168 Device naming when more than 2 boards installed
122 ----------------------------------------------- 169 -----------------------------------------------
123 Naming convention for each Smartio multiport board is pre-defined 170 Naming convention for each Smartio/Industio multiport board is
124 as below. 171 pre-defined as below.
125 172
126 Board Num. Dial-in Port Callout port 173 Board Num. Dial-in Port Callout port
127 1st board ttyM0 - ttyM7 cum0 - cum7 174 1st board ttyM0 - ttyM7 cum0 - cum7
@@ -129,6 +176,12 @@ Content
129 3rd board ttyM16 - ttyM23 cum16 - cum23 176 3rd board ttyM16 - ttyM23 cum16 - cum23
130 4th board ttyM24 - ttym31 cum24 - cum31 177 4th board ttyM24 - ttym31 cum24 - cum31
131 178
179
180 !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
181 Under Kernel 2.6 the cum Device is Obsolete. So use ttyM*
182 device instead.
183 !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
184
132 Board sequence 185 Board sequence
133 -------------- 186 --------------
134 This driver will activate ISA boards according to the parameter set 187 This driver will activate ISA boards according to the parameter set
@@ -138,69 +191,131 @@ Content
138 For PCI boards, their sequence will be after ISA boards and C168H/PCI 191 For PCI boards, their sequence will be after ISA boards and C168H/PCI
139 has higher priority than C104H/PCI boards. 192 has higher priority than C104H/PCI boards.
140 193
141 3.3 Module driver configuration 194 3.4 Module driver configuration
142 Module driver is easiest way to install. If you prefer static driver 195 Module driver is easiest way to install. If you prefer static driver
143 installation, please skip this paragraph. 196 installation, please skip this paragraph.
144 1. Find "Makefile" in /moxa/mxser, then run
145 197
146 # make install 198
199 ------------- Prepare to use the MOXA driver--------------------
200 3.4.1 Create tty device with correct major number
201 Before using MOXA driver, your system must have the tty devices
202 which are created with driver's major number. We offer one shell
203 script "msmknod" to simplify the procedure.
204 This step is only needed to be executed once. But you still
205 need to do this procedure when:
206 a. You change the driver's major number. Please refer the "3.7"
207 section.
208 b. Your total installed MOXA boards number is changed. Maybe you
209 add/delete one MOXA board.
210 c. You want to change the tty name. This needs to modify the
211 shell script "msmknod"
212
213 The procedure is:
214 # cd /moxa/mxser/driver
215 # ./msmknod
216
217 This shell script will require the major number for dial-in
218 device and callout device to create tty device. You also need
219 to specify the total installed MOXA board number. Default major
220 numbers for dial-in device and callout device are 30, 35. If
221 you need to change to other number, please refer section "3.7"
222 for more detailed procedure.
223 Msmknod will delete any special files occupying the same device
224 naming.
225
226 3.4.2 Build the MOXA driver and utilities
227 Before using the MOXA driver and utilities, you need compile the
228 all the source code. This step is only need to be executed once.
229 But you still re-compile the source code if you modify the source
230 code. For example, if you change the driver's major number (see
231 "3.7" section), then you need to do this step again.
232
233 Find "Makefile" in /moxa/mxser, then run
234
235 # make clean; make install
236
237 !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!
238 For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1:
239 # make clean; make installsp1
240
241 For Red Hat Enterprise Linux AS4/ES4/WS4:
242 # make clean; make installsp2
243 !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!
147 244
148 The driver files "mxser.o" and utilities will be properly compiled 245 The driver files "mxser.o" and utilities will be properly compiled
149 and copied to system directories respectively.Then run 246 and copied to system directories respectively.
150 247
151 # insmod mxser 248 ------------- Load MOXA driver--------------------
249 3.4.3 Load the MOXA driver
152 250
153 to activate the modular driver. You may run "lsmod" to check 251 # modprobe mxser <argument>
154 if "mxser.o" is activated.
155 252
156 2. Create special files by executing "msmknod". 253 will activate the module driver. You may run "lsmod" to check
157 # cd /moxa/mxser/driver 254 if "mxser" is activated. If the MOXA board is ISA board, the
158 # ./msmknod 255 <argument> is needed. Please refer to section "3.4.5" for more
256 information.
257
258
259 ------------- Load MOXA driver on boot --------------------
260 3.4.4 For the above description, you may manually execute
261 "modprobe mxser" to activate this driver and run
262 "rmmod mxser" to remove it.
263 However, it's better to have a boot time configuration to
264 eliminate manual operation. Boot time configuration can be
265 achieved by rc file. We offer one "rc.mxser" file to simplify
266 the procedure under "moxa/mxser/driver".
159 267
160 Default major numbers for dial-in device and callout device are 268 But if you use ISA board, please modify the "modprobe ..." command
161 174, 175. Msmknod will delete any special files occupying the same 269 to add the argument (see "3.4.5" section). After modifying the
162 device naming. 270 rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser"
271 manually to make sure the modification is ok. If any error
272 encountered, please try to modify again. If the modification is
273 completed, follow the below step.
163 274
164 3. Up to now, you may manually execute "insmod mxser" to activate 275 Run following command for setting rc files.
165 this driver and run "rmmod mxser" to remove it. However, it's
166 better to have a boot time configuration to eliminate manual
167 operation.
168 Boot time configuration can be achieved by rc file. Run following
169 command for setting rc files.
170 276
171 # cd /moxa/mxser/driver 277 # cd /moxa/mxser/driver
172 # cp ./rc.mxser /etc/rc.d 278 # cp ./rc.mxser /etc/rc.d
173 # cd /etc/rc.d 279 # cd /etc/rc.d
174 280
175 You may have to modify part of the content in rc.mxser to specify 281 Check "rc.serial" is existed or not. If "rc.serial" doesn't exist,
176 parameters for ISA board. Please refer to rc.mxser for more detail. 282 create it by vi, run "chmod 755 rc.serial" to change the permission.
177 Find "rc.serial". If "rc.serial" doesn't exist, create it by vi. 283 Add "/etc/rc.d/rc.mxser" in last line,
178 Add "rc.mxser" in last line. Next, open rc.local by vi
179 and append following content.
180 284
181 if [ -f /etc/rc.d/rc.serial ]; then 285 Reboot and check if moxa.o activated by "lsmod" command.
182 sh /etc/rc.d/rc.serial
183 fi
184 286
185 4. Reboot and check if mxser.o activated by "lsmod" command. 287 3.4.5. If you'd like to drive Smartio/Industio ISA boards in the system,
186 5. If you'd like to drive Smartio ISA boards in the system, you'll 288 you'll have to add parameter to specify CAP address of given
187 have to add parameter to specify CAP address of given board while 289 board while activating "mxser.o". The format for parameters are
188 activating "mxser.o". The format for parameters are as follows. 290 as follows.
189 291
190 insmod mxser ioaddr=0x???,0x???,0x???,0x??? 292 modprobe mxser ioaddr=0x???,0x???,0x???,0x???
191 | | | | 293 | | | |
192 | | | +- 4th ISA board 294 | | | +- 4th ISA board
193 | | +------ 3rd ISA board 295 | | +------ 3rd ISA board
194 | +------------ 2nd ISA board 296 | +------------ 2nd ISA board
195 +------------------- 1st ISA board 297 +------------------- 1st ISA board
196 298
197 3.4 Static driver configuration 299 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x
300
301 Note: To use static driver, you must install the linux kernel
302 source package.
303
304 3.5.1 Backup the built-in driver in the kernel.
305 # cd /usr/src/linux/drivers/char
306 # mv mxser.c mxser.c.old
307
308 For Red Hat 7.x user, you need to create link:
309 # cd /usr/src
310 # ln -s linux-2.4 linux
198 311
199 1. Create link 312 3.5.2 Create link
200 # cd /usr/src/linux/drivers/char 313 # cd /usr/src/linux/drivers/char
201 # ln -s /moxa/mxser/driver/mxser.c mxser.c 314 # ln -s /moxa/mxser/driver/mxser.c mxser.c
202 315
203 2. Add CAP address list for ISA boards 316 3.5.3 Add CAP address list for ISA boards. For PCI boards user,
317 please skip this step.
318
204 In module mode, the CAP address for ISA board is given by 319 In module mode, the CAP address for ISA board is given by
205 parameter. In static driver configuration, you'll have to 320 parameter. In static driver configuration, you'll have to
206 assign it within driver's source code. If you will not 321 assign it within driver's source code. If you will not
@@ -222,73 +337,55 @@ Content
222 static int mxserBoardCAP[] 337 static int mxserBoardCAP[]
223 = {0x280, 0x180, 0x00, 0x00}; 338 = {0x280, 0x180, 0x00, 0x00};
224 339
225 3. Modify tty_io.c 340 3.5.4 Setup kernel configuration
226 # cd /usr/src/linux/drivers/char/
227 # vi tty_io.c
228 Find pty_init(), insert "mxser_init()" as
229 341
230 pty_init(); 342 Configure the kernel:
231 mxser_init();
232 343
233 4. Modify tty.h 344 # cd /usr/src/linux
234 # cd /usr/src/linux/include/linux 345 # make menuconfig
235 # vi tty.h
236 Find extern int tty_init(void), insert "mxser_init()" as
237 346
238 extern int tty_init(void); 347 You will go into a menu-driven system. Please select [Character
239 extern int mxser_init(void); 348 devices][Non-standard serial port support], enable the [Moxa
240 349 SmartIO support] driver with "[*]" for built-in (not "[M]"), then
241 5. Modify Makefile 350 select [Exit] to exit this program.
242 # cd /usr/src/linux/drivers/char
243 # vi Makefile
244 Find L_OBJS := tty_io.o ...... random.o, add
245 "mxser.o" at last of this line as
246 L_OBJS := tty_io.o ....... mxser.o
247 351
248 6. Rebuild kernel 352 3.5.5 Rebuild kernel
249 The following are for Linux kernel rebuilding,for your reference only. 353 The following are for Linux kernel rebuilding, for your
354 reference only.
250 For appropriate details, please refer to the Linux document. 355 For appropriate details, please refer to the Linux document.
251 356
252 If 'lilo' utility is installed, please use 'make zlilo' to rebuild
253 kernel. If 'lilo' is not installed, please follow the following steps.
254
255 a. cd /usr/src/linux 357 a. cd /usr/src/linux
256 b. make clean /* take a few minutes */ 358 b. make clean /* take a few minutes */
257 c. make bzImage /* take probably 10-20 minutes */ 359 c. make dep /* take a few minutes */
258 d. Backup original boot kernel. /* optional step */ 360 d. make bzImage /* take probably 10-20 minutes */
259 e. cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz 361 e. make install /* copy boot image to correct position */
260 f. Please make sure the boot kernel (vmlinuz) is in the 362 f. Please make sure the boot kernel (vmlinuz) is in the
261 correct position. If you use 'lilo' utility, you should 363 correct position.
262 check /etc/lilo.conf 'image' item specified the path 364 g. If you use 'lilo' utility, you should check /etc/lilo.conf
263 which is the 'vmlinuz' path, or you will load wrong 365 'image' item specified the path which is the 'vmlinuz' path,
264 (or old) boot kernel image (vmlinuz). 366 or you will load wrong (or old) boot kernel image (vmlinuz).
265 g. chmod 400 /vmlinuz 367 After checking /etc/lilo.conf, please run "lilo".
266 h. lilo 368
267 i. rdev -R /vmlinuz 1 369 Note that if the result of "make bzImage" is ERROR, then you have to
268 j. sync 370 go back to Linux configuration Setup. Type "make menuconfig" in
269 371 directory /usr/src/linux.
270 Note that if the result of "make zImage" is ERROR, then you have to 372
271 go back to Linux configuration Setup. Type "make config" in directory 373
272 /usr/src/linux or "setup". 374 3.5.6 Make tty device and special file
273
274 Since system include file, /usr/src/linux/include/linux/interrupt.h,
275 is modified each time the MOXA driver is installed, kernel rebuilding
276 is inevitable. And it takes about 10 to 20 minutes depends on the
277 machine.
278
279 7. Make utility
280 # cd /moxa/mxser/utility
281 # make install
282
283 8. Make special file
284 # cd /moxa/mxser/driver 375 # cd /moxa/mxser/driver
285 # ./msmknod 376 # ./msmknod
286 377
287 9. Reboot 378 3.5.7 Make utility
379 # cd /moxa/mxser/utility
380 # make clean; make install
381
382 3.5.8 Reboot
288 383
289 3.5 Custom configuration 384
385
386 3.6 Custom configuration
290 Although this driver already provides you default configuration, you 387 Although this driver already provides you default configuration, you
291 still can change the device name and major number.The instruction to 388 still can change the device name and major number. The instruction to
292 change these parameters are shown as below. 389 change these parameters are shown as below.
293 390
294 Change Device name 391 Change Device name
@@ -306,33 +403,37 @@ Content
306 2 free major numbers for this driver. There are 3 steps to change 403 2 free major numbers for this driver. There are 3 steps to change
307 major numbers. 404 major numbers.
308 405
309 1. Find free major numbers 406 3.6.1 Find free major numbers
310 In /proc/devices, you may find all the major numbers occupied 407 In /proc/devices, you may find all the major numbers occupied
311 in the system. Please select 2 major numbers that are available. 408 in the system. Please select 2 major numbers that are available.
312 e.g. 40, 45. 409 e.g. 40, 45.
313 2. Create special files 410 3.6.2 Create special files
314 Run /moxa/mxser/driver/msmknod to create special files with 411 Run /moxa/mxser/driver/msmknod to create special files with
315 specified major numbers. 412 specified major numbers.
316 3. Modify driver with new major number 413 3.6.3 Modify driver with new major number
317 Run vi to open /moxa/mxser/driver/mxser.c. Locate the line 414 Run vi to open /moxa/mxser/driver/mxser.c. Locate the line
318 contains "MXSERMAJOR". Change the content as below. 415 contains "MXSERMAJOR". Change the content as below.
319 #define MXSERMAJOR 40 416 #define MXSERMAJOR 40
320 #define MXSERCUMAJOR 45 417 #define MXSERCUMAJOR 45
321 4. Run # make install in /moxa/mxser/driver. 418 3.6.4 Run "make clean; make install" in /moxa/mxser/driver.
322 419
323 3.6 Verify driver installation 420 3.7 Verify driver installation
324 You may refer to /var/log/messages to check the latest status 421 You may refer to /var/log/messages to check the latest status
325 log reported by this driver whenever it's activated. 422 log reported by this driver whenever it's activated.
423
326----------------------------------------------------------------------------- 424-----------------------------------------------------------------------------
3274. Utilities 4254. Utilities
328 There are 3 utilities contained in this driver. They are msdiag, msmon and 426 There are 3 utilities contained in this driver. They are msdiag, msmon and
329 msterm. These 3 utilities are released in form of source code. They should 427 msterm. These 3 utilities are released in form of source code. They should
330 be compiled into executable file and copied into /usr/bin. 428 be compiled into executable file and copied into /usr/bin.
331 429
430 Before using these utilities, please load driver (refer 3.4 & 3.5) and
431 make sure you had run the "msmknod" utility.
432
332 msdiag - Diagnostic 433 msdiag - Diagnostic
333 -------------------- 434 --------------------
334 This utility provides the function to detect what Moxa Smartio multiport 435 This utility provides the function to display what Moxa Smartio/Industio
335 board exists in the system. 436 board found by driver in the system.
336 437
337 msmon - Port Monitoring 438 msmon - Port Monitoring
338 ----------------------- 439 -----------------------
@@ -353,12 +454,13 @@ Content
353 application, for example, sending AT command to a modem connected to the 454 application, for example, sending AT command to a modem connected to the
354 port or used as a terminal for login purpose. Note that this is only a 455 port or used as a terminal for login purpose. Note that this is only a
355 dumb terminal emulation without handling full screen operation. 456 dumb terminal emulation without handling full screen operation.
457
356----------------------------------------------------------------------------- 458-----------------------------------------------------------------------------
3575. Setserial 4595. Setserial
358 460
359 Supported Setserial parameters are listed as below. 461 Supported Setserial parameters are listed as below.
360 462
361 uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) 463 uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO)
362 close_delay set the amount of time(in 1/100 of a second) that DTR 464 close_delay set the amount of time(in 1/100 of a second) that DTR
363 should be kept low while being closed. 465 should be kept low while being closed.
364 closing_wait set the amount of time(in 1/100 of a second) that the 466 closing_wait set the amount of time(in 1/100 of a second) that the
@@ -366,7 +468,13 @@ Content
366 being closed, before the receiver is disable. 468 being closed, before the receiver is disable.
367 spd_hi Use 57.6kb when the application requests 38.4kb. 469 spd_hi Use 57.6kb when the application requests 38.4kb.
368 spd_vhi Use 115.2kb when the application requests 38.4kb. 470 spd_vhi Use 115.2kb when the application requests 38.4kb.
471 spd_shi Use 230.4kb when the application requests 38.4kb.
472 spd_warp Use 460.8kb when the application requests 38.4kb.
369 spd_normal Use 38.4kb when the application requests 38.4kb. 473 spd_normal Use 38.4kb when the application requests 38.4kb.
474 spd_cust Use the custom divisor to set the speed when the
475 application requests 38.4kb.
476 divisor This option set the custom divison.
477 baud_base This option set the base baud rate.
370 478
371----------------------------------------------------------------------------- 479-----------------------------------------------------------------------------
3726. Troubleshooting 4806. Troubleshooting
@@ -375,8 +483,9 @@ Content
375 possible. If all the possible solutions fail, please contact our technical 483 possible. If all the possible solutions fail, please contact our technical
376 support team to get more help. 484 support team to get more help.
377 485
378 Error msg: More than 4 Moxa Smartio family boards found. Fifth board and 486
379 after are ignored. 487 Error msg: More than 4 Moxa Smartio/Industio family boards found. Fifth board
488 and after are ignored.
380 Solution: 489 Solution:
381 To avoid this problem, please unplug fifth and after board, because Moxa 490 To avoid this problem, please unplug fifth and after board, because Moxa
382 driver supports up to 4 boards. 491 driver supports up to 4 boards.
@@ -384,7 +493,7 @@ Content
384 Error msg: Request_irq fail, IRQ(?) may be conflict with another device. 493 Error msg: Request_irq fail, IRQ(?) may be conflict with another device.
385 Solution: 494 Solution:
386 Other PCI or ISA devices occupy the assigned IRQ. If you are not sure 495 Other PCI or ISA devices occupy the assigned IRQ. If you are not sure
387 which device causes the situation,please check /proc/interrupts to find 496 which device causes the situation, please check /proc/interrupts to find
388 free IRQ and simply change another free IRQ for Moxa board. 497 free IRQ and simply change another free IRQ for Moxa board.
389 498
390 Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. 499 Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid.
@@ -397,15 +506,18 @@ Content
397 Moxa ISA board needs an interrupt vector.Please refer to user's manual 506 Moxa ISA board needs an interrupt vector.Please refer to user's manual
398 "Hardware Installation" chapter to set interrupt vector. 507 "Hardware Installation" chapter to set interrupt vector.
399 508
400 Error msg: Couldn't install MOXA Smartio family driver! 509 Error msg: Couldn't install MOXA Smartio/Industio family driver!
401 Solution: 510 Solution:
402 Load Moxa driver fail, the major number may conflict with other devices. 511 Load Moxa driver fail, the major number may conflict with other devices.
403 Please refer to previous section 3.5 to change a free major number for 512 Please refer to previous section 3.7 to change a free major number for
404 Moxa driver. 513 Moxa driver.
405 514
406 Error msg: Couldn't install MOXA Smartio family callout driver! 515 Error msg: Couldn't install MOXA Smartio/Industio family callout driver!
407 Solution: 516 Solution:
408 Load Moxa callout driver fail, the callout device major number may 517 Load Moxa callout driver fail, the callout device major number may
409 conflict with other devices. Please refer to previous section 3.5 to 518 conflict with other devices. Please refer to previous section 3.7 to
410 change a free callout device major number for Moxa driver. 519 change a free callout device major number for Moxa driver.
520
521
411----------------------------------------------------------------------------- 522-----------------------------------------------------------------------------
523
diff --git a/Documentation/networking/LICENSE.qlge b/Documentation/networking/LICENSE.qlge
new file mode 100644
index 000000000000..123b6edd7f18
--- /dev/null
+++ b/Documentation/networking/LICENSE.qlge
@@ -0,0 +1,46 @@
1Copyright (c) 2003-2008 QLogic Corporation
2QLogic Linux Networking HBA Driver
3
4This program includes a device driver for Linux 2.6 that may be
5distributed with QLogic hardware specific firmware binary file.
6You may modify and redistribute the device driver code under the
7GNU General Public License as published by the Free Software
8Foundation (version 2 or a later version).
9
10You may redistribute the hardware specific firmware binary file
11under the following terms:
12
13 1. Redistribution of source code (only if applicable),
14 must retain the above copyright notice, this list of
15 conditions and the following disclaimer.
16
17 2. Redistribution in binary form must reproduce the above
18 copyright notice, this list of conditions and the
19 following disclaimer in the documentation and/or other
20 materials provided with the distribution.
21
22 3. The name of QLogic Corporation may not be used to
23 endorse or promote products derived from this software
24 without specific prior written permission
25
26REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
27THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
28EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
30PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
31BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
33TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38POSSIBILITY OF SUCH DAMAGE.
39
40USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
41CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
42OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
43TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
44ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
45COMBINATION WITH THIS PROGRAM.
46
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile
new file mode 100644
index 000000000000..6d8af1ac56c4
--- /dev/null
+++ b/Documentation/networking/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 := ifenslave
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index a0cda062bc33..688dfe1e6b70 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -289,35 +289,73 @@ downdelay
289fail_over_mac 289fail_over_mac
290 290
291 Specifies whether active-backup mode should set all slaves to 291 Specifies whether active-backup mode should set all slaves to
292 the same MAC address (the traditional behavior), or, when 292 the same MAC address at enslavement (the traditional
293 enabled, change the bond's MAC address when changing the 293 behavior), or, when enabled, perform special handling of the
294 active interface (i.e., fail over the MAC address itself). 294 bond's MAC address in accordance with the selected policy.
295 295
296 Fail over MAC is useful for devices that cannot ever alter 296 Possible values are:
297 their MAC address, or for devices that refuse incoming 297
298 broadcasts with their own source MAC (which interferes with 298 none or 0
299 the ARP monitor). 299
300 300 This setting disables fail_over_mac, and causes
301 The down side of fail over MAC is that every device on the 301 bonding to set all slaves of an active-backup bond to
302 network must be updated via gratuitous ARP, vs. just updating 302 the same MAC address at enslavement time. This is the
303 a switch or set of switches (which often takes place for any 303 default.
304 traffic, not just ARP traffic, if the switch snoops incoming 304
305 traffic to update its tables) for the traditional method. If 305 active or 1
306 the gratuitous ARP is lost, communication may be disrupted. 306
307 307 The "active" fail_over_mac policy indicates that the
308 When fail over MAC is used in conjuction with the mii monitor, 308 MAC address of the bond should always be the MAC
309 devices which assert link up prior to being able to actually 309 address of the currently active slave. The MAC
310 transmit and receive are particularly susecptible to loss of 310 address of the slaves is not changed; instead, the MAC
311 the gratuitous ARP, and an appropriate updelay setting may be 311 address of the bond changes during a failover.
312 required. 312
313 313 This policy is useful for devices that cannot ever
314 A value of 0 disables fail over MAC, and is the default. A 314 alter their MAC address, or for devices that refuse
315 value of 1 enables fail over MAC. This option is enabled 315 incoming broadcasts with their own source MAC (which
316 automatically if the first slave added cannot change its MAC 316 interferes with the ARP monitor).
317 address. This option may be modified via sysfs only when no 317
318 slaves are present in the bond. 318 The down side of this policy is that every device on
319 319 the network must be updated via gratuitous ARP,
320 This option was added in bonding version 3.2.0. 320 vs. just updating a switch or set of switches (which
321 often takes place for any traffic, not just ARP
322 traffic, if the switch snoops incoming traffic to
323 update its tables) for the traditional method. If the
324 gratuitous ARP is lost, communication may be
325 disrupted.
326
327 When this policy is used in conjuction with the mii
328 monitor, devices which assert link up prior to being
329 able to actually transmit and receive are particularly
330 susecptible to loss of the gratuitous ARP, and an
331 appropriate updelay setting may be required.
332
333 follow or 2
334
335 The "follow" fail_over_mac policy causes the MAC
336 address of the bond to be selected normally (normally
337 the MAC address of the first slave added to the bond).
338 However, the second and subsequent slaves are not set
339 to this MAC address while they are in a backup role; a
340 slave is programmed with the bond's MAC address at
341 failover time (and the formerly active slave receives
342 the newly active slave's MAC address).
343
344 This policy is useful for multiport devices that
345 either become confused or incur a performance penalty
346 when multiple ports are programmed with the same MAC
347 address.
348
349
350 The default policy is none, unless the first slave cannot
351 change its MAC address, in which case the active policy is
352 selected by default.
353
354 This option may be modified via sysfs only when no slaves are
355 present in the bond.
356
357 This option was added in bonding version 3.2.0. The "follow"
358 policy was added in bonding version 3.3.0.
321 359
322lacp_rate 360lacp_rate
323 361
@@ -338,7 +376,8 @@ max_bonds
338 Specifies the number of bonding devices to create for this 376 Specifies the number of bonding devices to create for this
339 instance of the bonding driver. E.g., if max_bonds is 3, and 377 instance of the bonding driver. E.g., if max_bonds is 3, and
340 the bonding driver is not already loaded, then bond0, bond1 378 the bonding driver is not already loaded, then bond0, bond1
341 and bond2 will be created. The default value is 1. 379 and bond2 will be created. The default value is 1. Specifying
380 a value of 0 will load bonding, but will not create any devices.
342 381
343miimon 382miimon
344 383
@@ -501,6 +540,17 @@ mode
501 swapped with the new curr_active_slave that was 540 swapped with the new curr_active_slave that was
502 chosen. 541 chosen.
503 542
543num_grat_arp
544
545 Specifies the number of gratuitous ARPs to be issued after a
546 failover event. One gratuitous ARP is issued immediately after
547 the failover, subsequent ARPs are sent at a rate of one per link
548 monitor interval (arp_interval or miimon, whichever is active).
549
550 The valid range is 0 - 255; the default value is 1. This option
551 affects only the active-backup mode. This option was added for
552 bonding version 3.3.0.
553
504primary 554primary
505 555
506 A string (eth0, eth2, etc) specifying which slave is the 556 A string (eth0, eth2, etc) specifying which slave is the
@@ -581,7 +631,7 @@ xmit_hash_policy
581 in environments where a layer3 gateway device is 631 in environments where a layer3 gateway device is
582 required to reach most destinations. 632 required to reach most destinations.
583 633
584 This algorithm is 802.3ad complient. 634 This algorithm is 802.3ad compliant.
585 635
586 layer3+4 636 layer3+4
587 637
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index 641d2afacffa..2035bc4932f2 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -35,8 +35,9 @@ This file contains
35 6.1 general settings 35 6.1 general settings
36 6.2 local loopback of sent frames 36 6.2 local loopback of sent frames
37 6.3 CAN controller hardware filters 37 6.3 CAN controller hardware filters
38 6.4 currently supported CAN hardware 38 6.4 The virtual CAN driver (vcan)
39 6.5 todo 39 6.5 currently supported CAN hardware
40 6.6 todo
40 41
41 7 Credits 42 7 Credits
42 43
@@ -186,7 +187,7 @@ solution for a couple of reasons:
186 187
187 The Linux network devices (by default) just can handle the 188 The Linux network devices (by default) just can handle the
188 transmission and reception of media dependent frames. Due to the 189 transmission and reception of media dependent frames. Due to the
189 arbritration on the CAN bus the transmission of a low prio CAN-ID 190 arbitration on the CAN bus the transmission of a low prio CAN-ID
190 may be delayed by the reception of a high prio CAN frame. To 191 may be delayed by the reception of a high prio CAN frame. To
191 reflect the correct* traffic on the node the loopback of the sent 192 reflect the correct* traffic on the node the loopback of the sent
192 data has to be performed right after a successful transmission. If 193 data has to be performed right after a successful transmission. If
@@ -481,7 +482,7 @@ solution for a couple of reasons:
481 - stats_timer: To calculate the Socket CAN core statistics 482 - stats_timer: To calculate the Socket CAN core statistics
482 (e.g. current/maximum frames per second) this 1 second timer is 483 (e.g. current/maximum frames per second) this 1 second timer is
483 invoked at can.ko module start time by default. This timer can be 484 invoked at can.ko module start time by default. This timer can be
484 disabled by using stattimer=0 on the module comandline. 485 disabled by using stattimer=0 on the module commandline.
485 486
486 - debug: (removed since SocketCAN SVN r546) 487 - debug: (removed since SocketCAN SVN r546)
487 488
@@ -584,7 +585,42 @@ solution for a couple of reasons:
584 @133MHz with four SJA1000 CAN controllers from 2002 under heavy bus 585 @133MHz with four SJA1000 CAN controllers from 2002 under heavy bus
585 load without any problems ... 586 load without any problems ...
586 587
587 6.4 currently supported CAN hardware (September 2007) 588 6.4 The virtual CAN driver (vcan)
589
590 Similar to the network loopback devices, vcan offers a virtual local
591 CAN interface. A full qualified address on CAN consists of
592
593 - a unique CAN Identifier (CAN ID)
594 - the CAN bus this CAN ID is transmitted on (e.g. can0)
595
596 so in common use cases more than one virtual CAN interface is needed.
597
598 The virtual CAN interfaces allow the transmission and reception of CAN
599 frames without real CAN controller hardware. Virtual CAN network
600 devices are usually named 'vcanX', like vcan0 vcan1 vcan2 ...
601 When compiled as a module the virtual CAN driver module is called vcan.ko
602
603 Since Linux Kernel version 2.6.24 the vcan driver supports the Kernel
604 netlink interface to create vcan network devices. The creation and
605 removal of vcan network devices can be managed with the ip(8) tool:
606
607 - Create a virtual CAN network interface:
608 ip link add type vcan
609
610 - Create a virtual CAN network interface with a specific name 'vcan42':
611 ip link add dev vcan42 type vcan
612
613 - Remove a (virtual CAN) network interface 'vcan42':
614 ip link del vcan42
615
616 The tool 'vcan' from the SocketCAN SVN repository on BerliOS is obsolete.
617
618 Virtual CAN network device creation in older Kernels:
619 In Linux Kernel versions < 2.6.24 the vcan driver creates 4 vcan
620 netdevices at module load time by default. This value can be changed
621 with the module parameter 'numdev'. E.g. 'modprobe vcan numdev=8'
622
623 6.5 currently supported CAN hardware
588 624
589 On the project website http://developer.berlios.de/projects/socketcan 625 On the project website http://developer.berlios.de/projects/socketcan
590 there are different drivers available: 626 there are different drivers available:
@@ -603,7 +639,7 @@ solution for a couple of reasons:
603 639
604 Please check the Mailing Lists on the berlios OSS project website. 640 Please check the Mailing Lists on the berlios OSS project website.
605 641
606 6.5 todo (September 2007) 642 6.6 todo
607 643
608 The configuration interface for CAN network drivers is still an open 644 The configuration interface for CAN network drivers is still an open
609 issue that has not been finalized in the socketcan project. Also the 645 issue that has not been finalized in the socketcan project. Also the
diff --git a/Documentation/networking/dm9000.txt b/Documentation/networking/dm9000.txt
new file mode 100644
index 000000000000..65df3dea5561
--- /dev/null
+++ b/Documentation/networking/dm9000.txt
@@ -0,0 +1,167 @@
1DM9000 Network driver
2=====================
3
4Copyright 2008 Simtec Electronics,
5 Ben Dooks <ben@simtec.co.uk> <ben-linux@fluff.org>
6
7
8Introduction
9------------
10
11This file describes how to use the DM9000 platform-device based network driver
12that is contained in the files drivers/net/dm9000.c and drivers/net/dm9000.h.
13
14The driver supports three DM9000 variants, the DM9000E which is the first chip
15supported as well as the newer DM9000A and DM9000B devices. It is currently
16maintained and tested by Ben Dooks, who should be CC: to any patches for this
17driver.
18
19
20Defining the platform device
21----------------------------
22
23The minimum set of resources attached to the platform device are as follows:
24
25 1) The physical address of the address register
26 2) The physical address of the data register
27 3) The IRQ line the device's interrupt pin is connected to.
28
29These resources should be specified in that order, as the ordering of the
30two address regions is important (the driver expects these to be address
31and then data).
32
33An example from arch/arm/mach-s3c2410/mach-bast.c is:
34
35static struct resource bast_dm9k_resource[] = {
36 [0] = {
37 .start = S3C2410_CS5 + BAST_PA_DM9000,
38 .end = S3C2410_CS5 + BAST_PA_DM9000 + 3,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
43 .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
44 .flags = IORESOURCE_MEM,
45 },
46 [2] = {
47 .start = IRQ_DM9000,
48 .end = IRQ_DM9000,
49 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
50 }
51};
52
53static struct platform_device bast_device_dm9k = {
54 .name = "dm9000",
55 .id = 0,
56 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
57 .resource = bast_dm9k_resource,
58};
59
60Note the setting of the IRQ trigger flag in bast_dm9k_resource[2].flags,
61as this will generate a warning if it is not present. The trigger from
62the flags field will be passed to request_irq() when registering the IRQ
63handler to ensure that the IRQ is setup correctly.
64
65This shows a typical platform device, without the optional configuration
66platform data supplied. The next example uses the same resources, but adds
67the optional platform data to pass extra configuration data:
68
69static struct dm9000_plat_data bast_dm9k_platdata = {
70 .flags = DM9000_PLATF_16BITONLY,
71};
72
73static struct platform_device bast_device_dm9k = {
74 .name = "dm9000",
75 .id = 0,
76 .num_resources = ARRAY_SIZE(bast_dm9k_resource),
77 .resource = bast_dm9k_resource,
78 .dev = {
79 .platform_data = &bast_dm9k_platdata,
80 }
81};
82
83The platform data is defined in include/linux/dm9000.h and described below.
84
85
86Platform data
87-------------
88
89Extra platform data for the DM9000 can describe the IO bus width to the
90device, whether or not an external PHY is attached to the device and
91the availability of an external configuration EEPROM.
92
93The flags for the platform data .flags field are as follows:
94
95DM9000_PLATF_8BITONLY
96
97 The IO should be done with 8bit operations.
98
99DM9000_PLATF_16BITONLY
100
101 The IO should be done with 16bit operations.
102
103DM9000_PLATF_32BITONLY
104
105 The IO should be done with 32bit operations.
106
107DM9000_PLATF_EXT_PHY
108
109 The chip is connected to an external PHY.
110
111DM9000_PLATF_NO_EEPROM
112
113 This can be used to signify that the board does not have an
114 EEPROM, or that the EEPROM should be hidden from the user.
115
116DM9000_PLATF_SIMPLE_PHY
117
118 Switch to using the simpler PHY polling method which does not
119 try and read the MII PHY state regularly. This is only available
120 when using the internal PHY. See the section on link state polling
121 for more information.
122
123 The config symbol DM9000_FORCE_SIMPLE_PHY_POLL, Kconfig entry
124 "Force simple NSR based PHY polling" allows this flag to be
125 forced on at build time.
126
127
128PHY Link state polling
129----------------------
130
131The driver keeps track of the link state and informs the network core
132about link (carrier) availablilty. This is managed by several methods
133depending on the version of the chip and on which PHY is being used.
134
135For the internal PHY, the original (and currently default) method is
136to read the MII state, either when the status changes if we have the
137necessary interrupt support in the chip or every two seconds via a
138periodic timer.
139
140To reduce the overhead for the internal PHY, there is now the option
141of using the DM9000_FORCE_SIMPLE_PHY_POLL config, or DM9000_PLATF_SIMPLE_PHY
142platform data option to read the summary information without the
143expensive MII accesses. This method is faster, but does not print
144as much information.
145
146When using an external PHY, the driver currently has to poll the MII
147link status as there is no method for getting an interrupt on link change.
148
149
150DM9000A / DM9000B
151-----------------
152
153These chips are functionally similar to the DM9000E and are supported easily
154by the same driver. The features are:
155
156 1) Interrupt on internal PHY state change. This means that the periodic
157 polling of the PHY status may be disabled on these devices when using
158 the internal PHY.
159
160 2) TCP/UDP checksum offloading, which the driver does not currently support.
161
162
163ethtool
164-------
165
166The driver supports the ethtool interface for access to the driver
167state information, the PHY state and the EEPROM.
diff --git a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt
index 61b171cf5313..2df71861e578 100644
--- a/Documentation/networking/e1000.txt
+++ b/Documentation/networking/e1000.txt
@@ -513,21 +513,11 @@ Additional Configurations
513 Intel(R) PRO/1000 PT Dual Port Server Connection 513 Intel(R) PRO/1000 PT Dual Port Server Connection
514 Intel(R) PRO/1000 PT Dual Port Server Adapter 514 Intel(R) PRO/1000 PT Dual Port Server Adapter
515 Intel(R) PRO/1000 PF Dual Port Server Adapter 515 Intel(R) PRO/1000 PF Dual Port Server Adapter
516 Intel(R) PRO/1000 PT Quad Port Server Adapter 516 Intel(R) PRO/1000 PT Quad Port Server Adapter
517 517
518 NAPI 518 NAPI
519 ---- 519 ----
520 NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled 520 NAPI (Rx polling mode) is enabled in the e1000 driver.
521 or disabled based on the configuration of the kernel. To override
522 the default, use the following compile-time flags.
523
524 To enable NAPI, compile the driver module, passing in a configuration option:
525
526 make CFLAGS_EXTRA=-DE1000_NAPI install
527
528 To disable NAPI, compile the driver module, passing in a configuration option:
529
530 make CFLAGS_EXTRA=-DE1000_NO_NAPI install
531 521
532 See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. 522 See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
533 523
diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c
index a12059886755..1b96ccda3836 100644
--- a/Documentation/networking/ifenslave.c
+++ b/Documentation/networking/ifenslave.c
@@ -1081,7 +1081,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname)
1081 1081
1082 } 1082 }
1083 1083
1084 ipaddr = ifr.ifr_addr.sa_data; 1084 ipaddr = (unsigned char *)ifr.ifr_addr.sa_data;
1085 v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n", 1085 v_print("Interface '%s': set IP %s to %d.%d.%d.%d\n",
1086 slave_ifname, ifra[i].desc, 1086 slave_ifname, ifra[i].desc,
1087 ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]); 1087 ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 17a6e46fbd43..d84932650fd3 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -81,23 +81,23 @@ inet_peer_minttl - INTEGER
81 Minimum time-to-live of entries. Should be enough to cover fragment 81 Minimum time-to-live of entries. Should be enough to cover fragment
82 time-to-live on the reassembling side. This minimum time-to-live is 82 time-to-live on the reassembling side. This minimum time-to-live is
83 guaranteed if the pool size is less than inet_peer_threshold. 83 guaranteed if the pool size is less than inet_peer_threshold.
84 Measured in jiffies(1). 84 Measured in seconds.
85 85
86inet_peer_maxttl - INTEGER 86inet_peer_maxttl - INTEGER
87 Maximum time-to-live of entries. Unused entries will expire after 87 Maximum time-to-live of entries. Unused entries will expire after
88 this period of time if there is no memory pressure on the pool (i.e. 88 this period of time if there is no memory pressure on the pool (i.e.
89 when the number of entries in the pool is very small). 89 when the number of entries in the pool is very small).
90 Measured in jiffies(1). 90 Measured in seconds.
91 91
92inet_peer_gc_mintime - INTEGER 92inet_peer_gc_mintime - INTEGER
93 Minimum interval between garbage collection passes. This interval is 93 Minimum interval between garbage collection passes. This interval is
94 in effect under high memory pressure on the pool. 94 in effect under high memory pressure on the pool.
95 Measured in jiffies(1). 95 Measured in seconds.
96 96
97inet_peer_gc_maxtime - INTEGER 97inet_peer_gc_maxtime - INTEGER
98 Minimum interval between garbage collection passes. This interval is 98 Minimum interval between garbage collection passes. This interval is
99 in effect under low (or absent) memory pressure on the pool. 99 in effect under low (or absent) memory pressure on the pool.
100 Measured in jiffies(1). 100 Measured in seconds.
101 101
102TCP variables: 102TCP variables:
103 103
@@ -148,9 +148,9 @@ tcp_available_congestion_control - STRING
148 but not loaded. 148 but not loaded.
149 149
150tcp_base_mss - INTEGER 150tcp_base_mss - INTEGER
151 The initial value of search_low to be used by Packetization Layer 151 The initial value of search_low to be used by the packetization layer
152 Path MTU Discovery (MTU probing). If MTU probing is enabled, 152 Path MTU discovery (MTU probing). If MTU probing is enabled,
153 this is the inital MSS used by the connection. 153 this is the initial MSS used by the connection.
154 154
155tcp_congestion_control - STRING 155tcp_congestion_control - STRING
156 Set the congestion control algorithm to be used for new 156 Set the congestion control algorithm to be used for new
@@ -185,10 +185,9 @@ tcp_frto - INTEGER
185 timeouts. It is particularly beneficial in wireless environments 185 timeouts. It is particularly beneficial in wireless environments
186 where packet loss is typically due to random radio interference 186 where packet loss is typically due to random radio interference
187 rather than intermediate router congestion. F-RTO is sender-side 187 rather than intermediate router congestion. F-RTO is sender-side
188 only modification. Therefore it does not require any support from 188 only modification. Therefore it does not require any support from
189 the peer, but in a typical case, however, where wireless link is 189 the peer.
190 the local access link and most of the data flows downlink, the 190
191 faraway servers should have F-RTO enabled to take advantage of it.
192 If set to 1, basic version is enabled. 2 enables SACK enhanced 191 If set to 1, basic version is enabled. 2 enables SACK enhanced
193 F-RTO if flow uses SACK. The basic version can be used also when 192 F-RTO if flow uses SACK. The basic version can be used also when
194 SACK is in use though scenario(s) with it exists where F-RTO 193 SACK is in use though scenario(s) with it exists where F-RTO
@@ -276,7 +275,7 @@ tcp_mem - vector of 3 INTEGERs: min, pressure, max
276 memory. 275 memory.
277 276
278tcp_moderate_rcvbuf - BOOLEAN 277tcp_moderate_rcvbuf - BOOLEAN
279 If set, TCP performs receive buffer autotuning, attempting to 278 If set, TCP performs receive buffer auto-tuning, attempting to
280 automatically size the buffer (no greater than tcp_rmem[2]) to 279 automatically size the buffer (no greater than tcp_rmem[2]) to
281 match the size required by the path for full throughput. Enabled by 280 match the size required by the path for full throughput. Enabled by
282 default. 281 default.
@@ -336,7 +335,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
336 pressure. 335 pressure.
337 Default: 8K 336 Default: 8K
338 337
339 default: default size of receive buffer used by TCP sockets. 338 default: initial size of receive buffer used by TCP sockets.
340 This value overrides net.core.rmem_default used by other protocols. 339 This value overrides net.core.rmem_default used by other protocols.
341 Default: 87380 bytes. This value results in window of 65535 with 340 Default: 87380 bytes. This value results in window of 65535 with
342 default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit 341 default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit
@@ -344,8 +343,10 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
344 343
345 max: maximal size of receive buffer allowed for automatically 344 max: maximal size of receive buffer allowed for automatically
346 selected receiver buffers for TCP socket. This value does not override 345 selected receiver buffers for TCP socket. This value does not override
347 net.core.rmem_max, "static" selection via SO_RCVBUF does not use this. 346 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
348 Default: 87380*2 bytes. 347 automatic tuning of that socket's receive buffer size, in which
348 case this value is ignored.
349 Default: between 87380B and 4MB, depending on RAM size.
349 350
350tcp_sack - BOOLEAN 351tcp_sack - BOOLEAN
351 Enable select acknowledgments (SACKS). 352 Enable select acknowledgments (SACKS).
@@ -358,7 +359,7 @@ tcp_slow_start_after_idle - BOOLEAN
358 Default: 1 359 Default: 1
359 360
360tcp_stdurg - BOOLEAN 361tcp_stdurg - BOOLEAN
361 Use the Host requirements interpretation of the TCP urg pointer field. 362 Use the Host requirements interpretation of the TCP urgent pointer field.
362 Most hosts use the older BSD interpretation, so if you turn this on 363 Most hosts use the older BSD interpretation, so if you turn this on
363 Linux might not communicate correctly with them. 364 Linux might not communicate correctly with them.
364 Default: FALSE 365 Default: FALSE
@@ -371,12 +372,12 @@ tcp_synack_retries - INTEGER
371tcp_syncookies - BOOLEAN 372tcp_syncookies - BOOLEAN
372 Only valid when the kernel was compiled with CONFIG_SYNCOOKIES 373 Only valid when the kernel was compiled with CONFIG_SYNCOOKIES
373 Send out syncookies when the syn backlog queue of a socket 374 Send out syncookies when the syn backlog queue of a socket
374 overflows. This is to prevent against the common 'syn flood attack' 375 overflows. This is to prevent against the common 'SYN flood attack'
375 Default: FALSE 376 Default: FALSE
376 377
377 Note, that syncookies is fallback facility. 378 Note, that syncookies is fallback facility.
378 It MUST NOT be used to help highly loaded servers to stand 379 It MUST NOT be used to help highly loaded servers to stand
379 against legal connection rate. If you see synflood warnings 380 against legal connection rate. If you see SYN flood warnings
380 in your logs, but investigation shows that they occur 381 in your logs, but investigation shows that they occur
381 because of overload with legal connections, you should tune 382 because of overload with legal connections, you should tune
382 another parameters until this warning disappear. 383 another parameters until this warning disappear.
@@ -386,7 +387,7 @@ tcp_syncookies - BOOLEAN
386 to use TCP extensions, can result in serious degradation 387 to use TCP extensions, can result in serious degradation
387 of some services (f.e. SMTP relaying), visible not by you, 388 of some services (f.e. SMTP relaying), visible not by you,
388 but your clients and relays, contacting you. While you see 389 but your clients and relays, contacting you. While you see
389 synflood warnings in logs not being really flooded, your server 390 SYN flood warnings in logs not being really flooded, your server
390 is seriously misconfigured. 391 is seriously misconfigured.
391 392
392tcp_syn_retries - INTEGER 393tcp_syn_retries - INTEGER
@@ -419,19 +420,21 @@ tcp_window_scaling - BOOLEAN
419 Enable window scaling as defined in RFC1323. 420 Enable window scaling as defined in RFC1323.
420 421
421tcp_wmem - vector of 3 INTEGERs: min, default, max 422tcp_wmem - vector of 3 INTEGERs: min, default, max
422 min: Amount of memory reserved for send buffers for TCP socket. 423 min: Amount of memory reserved for send buffers for TCP sockets.
423 Each TCP socket has rights to use it due to fact of its birth. 424 Each TCP socket has rights to use it due to fact of its birth.
424 Default: 4K 425 Default: 4K
425 426
426 default: Amount of memory allowed for send buffers for TCP socket 427 default: initial size of send buffer used by TCP sockets. This
427 by default. This value overrides net.core.wmem_default used 428 value overrides net.core.wmem_default used by other protocols.
428 by other protocols, it is usually lower than net.core.wmem_default. 429 It is usually lower than net.core.wmem_default.
429 Default: 16K 430 Default: 16K
430 431
431 max: Maximal amount of memory allowed for automatically selected 432 max: Maximal amount of memory allowed for automatically tuned
432 send buffers for TCP socket. This value does not override 433 send buffers for TCP sockets. This value does not override
433 net.core.wmem_max, "static" selection via SO_SNDBUF does not use this. 434 net.core.wmem_max. Calling setsockopt() with SO_SNDBUF disables
434 Default: 128K 435 automatic tuning of that socket's send buffer size, in which case
436 this value is ignored.
437 Default: between 64K and 4MB, depending on RAM size.
435 438
436tcp_workaround_signed_windows - BOOLEAN 439tcp_workaround_signed_windows - BOOLEAN
437 If set, assume no receipt of a window scaling option means the 440 If set, assume no receipt of a window scaling option means the
@@ -548,8 +551,9 @@ icmp_echo_ignore_broadcasts - BOOLEAN
548icmp_ratelimit - INTEGER 551icmp_ratelimit - INTEGER
549 Limit the maximal rates for sending ICMP packets whose type matches 552 Limit the maximal rates for sending ICMP packets whose type matches
550 icmp_ratemask (see below) to specific targets. 553 icmp_ratemask (see below) to specific targets.
551 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 554 0 to disable any limiting,
552 Default: 100 555 otherwise the minimal space between responses in milliseconds.
556 Default: 1000
553 557
554icmp_ratemask - INTEGER 558icmp_ratemask - INTEGER
555 Mask made of ICMP types for which rates are being limited. 559 Mask made of ICMP types for which rates are being limited.
@@ -794,10 +798,6 @@ tag - INTEGER
794 Allows you to write a number, which can be used as required. 798 Allows you to write a number, which can be used as required.
795 Default value is 0. 799 Default value is 0.
796 800
797(1) Jiffie: internal timeunit for the kernel. On the i386 1/100s, on the
798Alpha 1/1024s. See the HZ define in /usr/include/asm/param.h for the exact
799value on your system.
800
801Alexey Kuznetsov. 801Alexey Kuznetsov.
802kuznet@ms2.inr.ac.ru 802kuznet@ms2.inr.ac.ru
803 803
@@ -1024,11 +1024,23 @@ max_addresses - INTEGER
1024 autoconfigured addresses. 1024 autoconfigured addresses.
1025 Default: 16 1025 Default: 16
1026 1026
1027disable_ipv6 - BOOLEAN
1028 Disable IPv6 operation.
1029 Default: FALSE (enable IPv6 operation)
1030
1031accept_dad - INTEGER
1032 Whether to accept DAD (Duplicate Address Detection).
1033 0: Disable DAD
1034 1: Enable DAD (default)
1035 2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
1036 link-local address has been found.
1037
1027icmp/*: 1038icmp/*:
1028ratelimit - INTEGER 1039ratelimit - INTEGER
1029 Limit the maximal rates for sending ICMPv6 packets. 1040 Limit the maximal rates for sending ICMPv6 packets.
1030 0 to disable any limiting, otherwise the maximal rate in jiffies(1) 1041 0 to disable any limiting,
1031 Default: 100 1042 otherwise the minimal space between responses in milliseconds.
1043 Default: 1000
1032 1044
1033 1045
1034IPv6 Update by: 1046IPv6 Update by:
@@ -1064,24 +1076,193 @@ bridge-nf-filter-pppoe-tagged - BOOLEAN
1064 Default: 1 1076 Default: 1
1065 1077
1066 1078
1067UNDOCUMENTED: 1079proc/sys/net/sctp/* Variables:
1080
1081addip_enable - BOOLEAN
1082 Enable or disable extension of Dynamic Address Reconfiguration
1083 (ADD-IP) functionality specified in RFC5061. This extension provides
1084 the ability to dynamically add and remove new addresses for the SCTP
1085 associations.
1086
1087 1: Enable extension.
1088
1089 0: Disable extension.
1090
1091 Default: 0
1092
1093addip_noauth_enable - BOOLEAN
1094 Dynamic Address Reconfiguration (ADD-IP) requires the use of
1095 authentication to protect the operations of adding or removing new
1096 addresses. This requirement is mandated so that unauthorized hosts
1097 would not be able to hijack associations. However, older
1098 implementations may not have implemented this requirement while
1099 allowing the ADD-IP extension. For reasons of interoperability,
1100 we provide this variable to control the enforcement of the
1101 authentication requirement.
1102
1103 1: Allow ADD-IP extension to be used without authentication. This
1104 should only be set in a closed environment for interoperability
1105 with older implementations.
1106
1107 0: Enforce the authentication requirement
1108
1109 Default: 0
1110
1111auth_enable - BOOLEAN
1112 Enable or disable Authenticated Chunks extension. This extension
1113 provides the ability to send and receive authenticated chunks and is
1114 required for secure operation of Dynamic Address Reconfiguration
1115 (ADD-IP) extension.
1116
1117 1: Enable this extension.
1118 0: Disable this extension.
1119
1120 Default: 0
1121
1122prsctp_enable - BOOLEAN
1123 Enable or disable the Partial Reliability extension (RFC3758) which
1124 is used to notify peers that a given DATA should no longer be expected.
1125
1126 1: Enable extension
1127 0: Disable
1128
1129 Default: 1
1130
1131max_burst - INTEGER
1132 The limit of the number of new packets that can be initially sent. It
1133 controls how bursty the generated traffic can be.
1134
1135 Default: 4
1136
1137association_max_retrans - INTEGER
1138 Set the maximum number for retransmissions that an association can
1139 attempt deciding that the remote end is unreachable. If this value
1140 is exceeded, the association is terminated.
1141
1142 Default: 10
1143
1144max_init_retransmits - INTEGER
1145 The maximum number of retransmissions of INIT and COOKIE-ECHO chunks
1146 that an association will attempt before declaring the destination
1147 unreachable and terminating.
1148
1149 Default: 8
1150
1151path_max_retrans - INTEGER
1152 The maximum number of retransmissions that will be attempted on a given
1153 path. Once this threshold is exceeded, the path is considered
1154 unreachable, and new traffic will use a different path when the
1155 association is multihomed.
1156
1157 Default: 5
1068 1158
1069dev_weight FIXME 1159rto_initial - INTEGER
1070discovery_slots FIXME 1160 The initial round trip timeout value in milliseconds that will be used
1071discovery_timeout FIXME 1161 in calculating round trip times. This is the initial time interval
1072fast_poll_increase FIXME 1162 for retransmissions.
1073ip6_queue_maxlen FIXME 1163
1074lap_keepalive_time FIXME 1164 Default: 3000
1075lo_cong FIXME 1165
1076max_baud_rate FIXME 1166rto_max - INTEGER
1077max_dgram_qlen FIXME 1167 The maximum value (in milliseconds) of the round trip timeout. This
1078max_noreply_time FIXME 1168 is the largest time interval that can elapse between retransmissions.
1079max_tx_data_size FIXME 1169
1080max_tx_window FIXME 1170 Default: 60000
1081min_tx_turn_time FIXME 1171
1082mod_cong FIXME 1172rto_min - INTEGER
1083no_cong FIXME 1173 The minimum value (in milliseconds) of the round trip timeout. This
1084no_cong_thresh FIXME 1174 is the smallest time interval the can elapse between retransmissions.
1085slot_timeout FIXME 1175
1086warn_noreply_time FIXME 1176 Default: 1000
1177
1178hb_interval - INTEGER
1179 The interval (in milliseconds) between HEARTBEAT chunks. These chunks
1180 are sent at the specified interval on idle paths to probe the state of
1181 a given path between 2 associations.
1182
1183 Default: 30000
1184
1185sack_timeout - INTEGER
1186 The amount of time (in milliseconds) that the implementation will wait
1187 to send a SACK.
1188
1189 Default: 200
1190
1191valid_cookie_life - INTEGER
1192 The default lifetime of the SCTP cookie (in milliseconds). The cookie
1193 is used during association establishment.
1194
1195 Default: 60000
1196
1197cookie_preserve_enable - BOOLEAN
1198 Enable or disable the ability to extend the lifetime of the SCTP cookie
1199 that is used during the establishment phase of SCTP association
1200
1201 1: Enable cookie lifetime extension.
1202 0: Disable
1203
1204 Default: 1
1205
1206rcvbuf_policy - INTEGER
1207 Determines if the receive buffer is attributed to the socket or to
1208 association. SCTP supports the capability to create multiple
1209 associations on a single socket. When using this capability, it is
1210 possible that a single stalled association that's buffering a lot
1211 of data may block other associations from delivering their data by
1212 consuming all of the receive buffer space. To work around this,
1213 the rcvbuf_policy could be set to attribute the receiver buffer space
1214 to each association instead of the socket. This prevents the described
1215 blocking.
1216
1217 1: rcvbuf space is per association
1218 0: recbuf space is per socket
1219
1220 Default: 0
1221
1222sndbuf_policy - INTEGER
1223 Similar to rcvbuf_policy above, this applies to send buffer space.
1224
1225 1: Send buffer is tracked per association
1226 0: Send buffer is tracked per socket.
1227
1228 Default: 0
1229
1230sctp_mem - vector of 3 INTEGERs: min, pressure, max
1231 Number of pages allowed for queueing by all SCTP sockets.
1232
1233 min: Below this number of pages SCTP is not bothered about its
1234 memory appetite. When amount of memory allocated by SCTP exceeds
1235 this number, SCTP starts to moderate memory usage.
1236
1237 pressure: This value was introduced to follow format of tcp_mem.
1238
1239 max: Number of pages allowed for queueing by all SCTP sockets.
1240
1241 Default is calculated at boot time from amount of available memory.
1242
1243sctp_rmem - vector of 3 INTEGERs: min, default, max
1244 See tcp_rmem for a description.
1245
1246sctp_wmem - vector of 3 INTEGERs: min, default, max
1247 See tcp_wmem for a description.
1248
1249UNDOCUMENTED:
1087 1250
1251/proc/sys/net/core/*
1252 dev_weight FIXME
1253
1254/proc/sys/net/unix/*
1255 max_dgram_qlen FIXME
1256
1257/proc/sys/net/irda/*
1258 fast_poll_increase FIXME
1259 warn_noreply_time FIXME
1260 discovery_slots FIXME
1261 slot_timeout FIXME
1262 max_baud_rate FIXME
1263 discovery_timeout FIXME
1264 lap_keepalive_time FIXME
1265 max_noreply_time FIXME
1266 max_tx_data_size FIXME
1267 max_tx_window FIXME
1268 min_tx_turn_time FIXME
diff --git a/Documentation/networking/ixgb.txt b/Documentation/networking/ixgb.txt
index 7c98277777eb..a0d0ffb5e584 100644
--- a/Documentation/networking/ixgb.txt
+++ b/Documentation/networking/ixgb.txt
@@ -1,7 +1,7 @@
1Linux* Base Driver for the Intel(R) PRO/10GbE Family of Adapters 1Linux Base Driver for 10 Gigabit Intel(R) Network Connection
2================================================================ 2=============================================================
3 3
4November 17, 2004 4October 9, 2007
5 5
6 6
7Contents 7Contents
@@ -9,94 +9,151 @@ Contents
9 9
10- In This Release 10- In This Release
11- Identifying Your Adapter 11- Identifying Your Adapter
12- Building and Installation
12- Command Line Parameters 13- Command Line Parameters
13- Improving Performance 14- Improving Performance
15- Additional Configurations
16- Known Issues/Troubleshooting
14- Support 17- Support
15 18
16 19
20
17In This Release 21In This Release
18=============== 22===============
19 23
20This file describes the Linux* Base Driver for the Intel(R) PRO/10GbE Family 24This file describes the ixgb Linux Base Driver for the 10 Gigabit Intel(R)
21of Adapters, version 1.0.x. 25Network Connection. This driver includes support for Itanium(R)2-based
26systems.
27
28For questions related to hardware requirements, refer to the documentation
29supplied with your 10 Gigabit adapter. All hardware requirements listed apply
30to use with Linux.
31
32The following features are available in this kernel:
33 - Native VLANs
34 - Channel Bonding (teaming)
35 - SNMP
36
37Channel Bonding documentation can be found in the Linux kernel source:
38/Documentation/networking/bonding.txt
39
40The driver information previously displayed in the /proc filesystem is not
41supported in this release. Alternatively, you can use ethtool (version 1.6
42or later), lspci, and ifconfig to obtain the same information.
43
44Instructions on updating ethtool can be found in the section "Additional
45Configurations" later in this document.
22 46
23For questions related to hardware requirements, refer to the documentation
24supplied with your Intel PRO/10GbE adapter. All hardware requirements listed
25apply to use with Linux.
26 47
27Identifying Your Adapter 48Identifying Your Adapter
28======================== 49========================
29 50
30To verify your Intel adapter is supported, find the board ID number on the 51The following Intel network adapters are compatible with the drivers in this
31adapter. Look for a label that has a barcode and a number in the format 52release:
32A12345-001. 53
54Controller Adapter Name Physical Layer
55---------- ------------ --------------
5682597EX Intel(R) PRO/10GbE LR/SR/CX4 10G Base-LR (1310 nm optical fiber)
57 Server Adapters 10G Base-SR (850 nm optical fiber)
58 10G Base-CX4(twin-axial copper cabling)
59
60For more information on how to identify your adapter, go to the Adapter &
61Driver ID Guide at:
62
63 http://support.intel.com/support/network/sb/CS-012904.htm
64
65
66Building and Installation
67=========================
68
69select m for "Intel(R) PRO/10GbE support" located at:
70 Location:
71 -> Device Drivers
72 -> Network device support (NETDEVICES [=y])
73 -> Ethernet (10000 Mbit) (NETDEV_10000 [=y])
741. make modules && make modules_install
75
762. Load the module:
77
78    modprobe ixgb <parameter>=<value>
79
80 The insmod command can be used if the full
81 path to the driver module is specified. For example:
82
83 insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/ixgb/ixgb.ko
84
85 With 2.6 based kernels also make sure that older ixgb drivers are
86 removed from the kernel, before loading the new module:
33 87
34Use the above information and the Adapter & Driver ID Guide at: 88 rmmod ixgb; modprobe ixgb
35 89
36 http://support.intel.com/support/network/adapter/pro100/21397.htm 903. Assign an IP address to the interface by entering the following, where
91 x is the interface number:
37 92
38For the latest Intel network drivers for Linux, go to: 93 ifconfig ethx <IP_address>
94
954. Verify that the interface works. Enter the following, where <IP_address>
96 is the IP address for another machine on the same subnet as the interface
97 that is being tested:
98
99 ping <IP_address>
39 100
40 http://downloadfinder.intel.com/scripts-df/support_intel.asp
41 101
42Command Line Parameters 102Command Line Parameters
43======================= 103=======================
44 104
45If the driver is built as a module, the following optional parameters are 105If the driver is built as a module, the following optional parameters are
46used by entering them on the command line with the modprobe or insmod command 106used by entering them on the command line with the modprobe command using
47using this syntax: 107this syntax:
48 108
49 modprobe ixgb [<option>=<VAL1>,<VAL2>,...] 109 modprobe ixgb [<option>=<VAL1>,<VAL2>,...]
50 110
51 insmod ixgb [<option>=<VAL1>,<VAL2>,...] 111For example, with two 10GbE PCI adapters, entering:
52 112
53For example, with two PRO/10GbE PCI adapters, entering: 113 modprobe ixgb TxDescriptors=80,128
54 114
55 insmod ixgb TxDescriptors=80,128 115loads the ixgb driver with 80 TX resources for the first adapter and 128 TX
56
57loads the ixgb driver with 80 TX resources for the first adapter and 128 TX
58resources for the second adapter. 116resources for the second adapter.
59 117
60The default value for each parameter is generally the recommended setting, 118The default value for each parameter is generally the recommended setting,
61unless otherwise noted. Also, if the driver is statically built into the 119unless otherwise noted.
62kernel, the driver is loaded with the default values for all the parameters.
63Ethtool can be used to change some of the parameters at runtime.
64 120
65FlowControl 121FlowControl
66Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx) 122Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
67Default: Read from the EEPROM 123Default: Read from the EEPROM
68 If EEPROM is not detected, default is 3 124 If EEPROM is not detected, default is 1
69 This parameter controls the automatic generation(Tx) and response(Rx) to 125 This parameter controls the automatic generation(Tx) and response(Rx) to
70 Ethernet PAUSE frames. 126 Ethernet PAUSE frames. There are hardware bugs associated with enabling
127 Tx flow control so beware.
71 128
72RxDescriptors 129RxDescriptors
73Valid Range: 64-512 130Valid Range: 64-512
74Default Value: 512 131Default Value: 512
75 This value is the number of receive descriptors allocated by the driver. 132 This value is the number of receive descriptors allocated by the driver.
76 Increasing this value allows the driver to buffer more incoming packets. 133 Increasing this value allows the driver to buffer more incoming packets.
77 Each descriptor is 16 bytes. A receive buffer is also allocated for 134 Each descriptor is 16 bytes. A receive buffer is also allocated for
78 each descriptor and can be either 2048, 4056, 8192, or 16384 bytes, 135 each descriptor and can be either 2048, 4056, 8192, or 16384 bytes,
79 depending on the MTU setting. When the MTU size is 1500 or less, the 136 depending on the MTU setting. When the MTU size is 1500 or less, the
80 receive buffer size is 2048 bytes. When the MTU is greater than 1500 the 137 receive buffer size is 2048 bytes. When the MTU is greater than 1500 the
81 receive buffer size will be either 4056, 8192, or 16384 bytes. The 138 receive buffer size will be either 4056, 8192, or 16384 bytes. The
82 maximum MTU size is 16114. 139 maximum MTU size is 16114.
83 140
84RxIntDelay 141RxIntDelay
85Valid Range: 0-65535 (0=off) 142Valid Range: 0-65535 (0=off)
86Default Value: 6 143Default Value: 72
87 This value delays the generation of receive interrupts in units of 144 This value delays the generation of receive interrupts in units of
88 0.8192 microseconds. Receive interrupt reduction can improve CPU 145 0.8192 microseconds. Receive interrupt reduction can improve CPU
89 efficiency if properly tuned for specific network traffic. Increasing 146 efficiency if properly tuned for specific network traffic. Increasing
90 this value adds extra latency to frame reception and can end up 147 this value adds extra latency to frame reception and can end up
91 decreasing the throughput of TCP traffic. If the system is reporting 148 decreasing the throughput of TCP traffic. If the system is reporting
92 dropped receives, this value may be set too high, causing the driver to 149 dropped receives, this value may be set too high, causing the driver to
93 run out of available receive descriptors. 150 run out of available receive descriptors.
94 151
95TxDescriptors 152TxDescriptors
96Valid Range: 64-4096 153Valid Range: 64-4096
97Default Value: 256 154Default Value: 256
98 This value is the number of transmit descriptors allocated by the driver. 155 This value is the number of transmit descriptors allocated by the driver.
99 Increasing this value allows the driver to queue more transmits. Each 156 Increasing this value allows the driver to queue more transmits. Each
100 descriptor is 16 bytes. 157 descriptor is 16 bytes.
101 158
102XsumRX 159XsumRX
@@ -105,51 +162,49 @@ Default Value: 1
105 A value of '1' indicates that the driver should enable IP checksum 162 A value of '1' indicates that the driver should enable IP checksum
106 offload for received packets (both UDP and TCP) to the adapter hardware. 163 offload for received packets (both UDP and TCP) to the adapter hardware.
107 164
108XsumTX
109Valid Range: 0-1
110Default Value: 1
111 A value of '1' indicates that the driver should enable IP checksum
112 offload for transmitted packets (both UDP and TCP) to the adapter
113 hardware.
114 165
115Improving Performance 166Improving Performance
116===================== 167=====================
117 168
118With the Intel PRO/10 GbE adapter, the default Linux configuration will very 169With the 10 Gigabit server adapters, the default Linux configuration will
119likely limit the total available throughput artificially. There is a set of 170very likely limit the total available throughput artificially. There is a set
120things that when applied together increase the ability of Linux to transmit 171of configuration changes that, when applied together, will increase the ability
121and receive data. The following enhancements were originally acquired from 172of Linux to transmit and receive data. The following enhancements were
122settings published at http://www.spec.org/web99 for various submitted results 173originally acquired from settings published at http://www.spec.org/web99/ for
123using Linux. 174various submitted results using Linux.
124 175
125NOTE: These changes are only suggestions, and serve as a starting point for 176NOTE: These changes are only suggestions, and serve as a starting point for
126tuning your network performance. 177 tuning your network performance.
127 178
128The changes are made in three major ways, listed in order of greatest effect: 179The changes are made in three major ways, listed in order of greatest effect:
129- Use ifconfig to modify the mtu (maximum transmission unit) and the txqueuelen 180- Use ifconfig to modify the mtu (maximum transmission unit) and the txqueuelen
130 parameter. 181 parameter.
131- Use sysctl to modify /proc parameters (essentially kernel tuning) 182- Use sysctl to modify /proc parameters (essentially kernel tuning)
132- Use setpci to modify the MMRBC field in PCI-X configuration space to increase 183- Use setpci to modify the MMRBC field in PCI-X configuration space to increase
133 transmit burst lengths on the bus. 184 transmit burst lengths on the bus.
134 185
135NOTE: setpci modifies the adapter's configuration registers to allow it to read 186NOTE: setpci modifies the adapter's configuration registers to allow it to read
136up to 4k bytes at a time (for transmits). However, for some systems the 187up to 4k bytes at a time (for transmits). However, for some systems the
137behavior after modifying this register may be undefined (possibly errors of some 188behavior after modifying this register may be undefined (possibly errors of
138kind). A power-cycle, hard reset or explicitly setting the e6 register back to 189some kind). A power-cycle, hard reset or explicitly setting the e6 register
13922 (setpci -d 8086:1048 e6.b=22) may be required to get back to a stable 190back to 22 (setpci -d 8086:1a48 e6.b=22) may be required to get back to a
140configuration. 191stable configuration.
141 192
142- COPY these lines and paste them into ixgb_perf.sh: 193- COPY these lines and paste them into ixgb_perf.sh:
143#!/bin/bash 194#!/bin/bash
144echo "configuring network performance , edit this file to change the interface" 195echo "configuring network performance , edit this file to change the interface
196or device ID of 10GbE card"
145# set mmrbc to 4k reads, modify only Intel 10GbE device IDs 197# set mmrbc to 4k reads, modify only Intel 10GbE device IDs
146setpci -d 8086:1048 e6.b=2e 198# replace 1a48 with appropriate 10GbE device's ID installed on the system,
147# set the MTU (max transmission unit) - it requires your switch and clients to change too! 199# if needed.
200setpci -d 8086:1a48 e6.b=2e
201# set the MTU (max transmission unit) - it requires your switch and clients
202# to change as well.
148# set the txqueuelen 203# set the txqueuelen
149# your ixgb adapter should be loaded as eth1 for this to work, change if needed 204# your ixgb adapter should be loaded as eth1 for this to work, change if needed
150ifconfig eth1 mtu 9000 txqueuelen 1000 up 205ifconfig eth1 mtu 9000 txqueuelen 1000 up
151# call the sysctl utility to modify /proc/sys entries 206# call the sysctl utility to modify /proc/sys entries
152sysctl -p ./sysctl_ixgb.conf 207sysctl -p ./sysctl_ixgb.conf
153- END ixgb_perf.sh 208- END ixgb_perf.sh
154 209
155- COPY these lines and paste them into sysctl_ixgb.conf: 210- COPY these lines and paste them into sysctl_ixgb.conf:
@@ -159,54 +214,220 @@ sysctl -p ./sysctl_ixgb.conf
159# several network benchmark tests, your mileage may vary 214# several network benchmark tests, your mileage may vary
160 215
161### IPV4 specific settings 216### IPV4 specific settings
162net.ipv4.tcp_timestamps = 0 # turns TCP timestamp support off, default 1, reduces CPU use 217# turn TCP timestamp support off, default 1, reduces CPU use
163net.ipv4.tcp_sack = 0 # turn SACK support off, default on 218net.ipv4.tcp_timestamps = 0
164# on systems with a VERY fast bus -> memory interface this is the big gainer 219# turn SACK support off, default on
165net.ipv4.tcp_rmem = 10000000 10000000 10000000 # sets min/default/max TCP read buffer, default 4096 87380 174760 220# on systems with a VERY fast bus -> memory interface this is the big gainer
166net.ipv4.tcp_wmem = 10000000 10000000 10000000 # sets min/pressure/max TCP write buffer, default 4096 16384 131072 221net.ipv4.tcp_sack = 0
167net.ipv4.tcp_mem = 10000000 10000000 10000000 # sets min/pressure/max TCP buffer space, default 31744 32256 32768 222# set min/default/max TCP read buffer, default 4096 87380 174760
223net.ipv4.tcp_rmem = 10000000 10000000 10000000
224# set min/pressure/max TCP write buffer, default 4096 16384 131072
225net.ipv4.tcp_wmem = 10000000 10000000 10000000
226# set min/pressure/max TCP buffer space, default 31744 32256 32768
227net.ipv4.tcp_mem = 10000000 10000000 10000000
168 228
169### CORE settings (mostly for socket and UDP effect) 229### CORE settings (mostly for socket and UDP effect)
170net.core.rmem_max = 524287 # maximum receive socket buffer size, default 131071 230# set maximum receive socket buffer size, default 131071
171net.core.wmem_max = 524287 # maximum send socket buffer size, default 131071 231net.core.rmem_max = 524287
172net.core.rmem_default = 524287 # default receive socket buffer size, default 65535 232# set maximum send socket buffer size, default 131071
173net.core.wmem_default = 524287 # default send socket buffer size, default 65535 233net.core.wmem_max = 524287
174net.core.optmem_max = 524287 # maximum amount of option memory buffers, default 10240 234# set default receive socket buffer size, default 65535
175net.core.netdev_max_backlog = 300000 # number of unprocessed input packets before kernel starts dropping them, default 300 235net.core.rmem_default = 524287
236# set default send socket buffer size, default 65535
237net.core.wmem_default = 524287
238# set maximum amount of option memory buffers, default 10240
239net.core.optmem_max = 524287
240# set number of unprocessed input packets before kernel starts dropping them; default 300
241net.core.netdev_max_backlog = 300000
176- END sysctl_ixgb.conf 242- END sysctl_ixgb.conf
177 243
178Edit the ixgb_perf.sh script if necessary to change eth1 to whatever interface 244Edit the ixgb_perf.sh script if necessary to change eth1 to whatever interface
179your ixgb driver is using. 245your ixgb driver is using and/or replace '1a48' with appropriate 10GbE device's
246ID installed on the system.
180 247
181NOTE: Unless these scripts are added to the boot process, these changes will 248NOTE: Unless these scripts are added to the boot process, these changes will
182only last only until the next system reboot. 249 only last only until the next system reboot.
183 250
184 251
185Resolving Slow UDP Traffic 252Resolving Slow UDP Traffic
186-------------------------- 253--------------------------
254If your server does not seem to be able to receive UDP traffic as fast as it
255can receive TCP traffic, it could be because Linux, by default, does not set
256the network stack buffers as large as they need to be to support high UDP
257transfer rates. One way to alleviate this problem is to allow more memory to
258be used by the IP stack to store incoming data.
187 259
188If your server does not seem to be able to receive UDP traffic as fast as it 260For instance, use the commands:
189can receive TCP traffic, it could be because Linux, by default, does not set
190the network stack buffers as large as they need to be to support high UDP
191transfer rates. One way to alleviate this problem is to allow more memory to
192be used by the IP stack to store incoming data.
193
194For instance, use the commands:
195 sysctl -w net.core.rmem_max=262143 261 sysctl -w net.core.rmem_max=262143
196and 262and
197 sysctl -w net.core.rmem_default=262143 263 sysctl -w net.core.rmem_default=262143
198to increase the read buffer memory max and default to 262143 (256k - 1) from 264to increase the read buffer memory max and default to 262143 (256k - 1) from
199defaults of max=131071 (128k - 1) and default=65535 (64k - 1). These variables 265defaults of max=131071 (128k - 1) and default=65535 (64k - 1). These variables
200will increase the amount of memory used by the network stack for receives, and 266will increase the amount of memory used by the network stack for receives, and
201can be increased significantly more if necessary for your application. 267can be increased significantly more if necessary for your application.
202 268
269
270Additional Configurations
271=========================
272
273 Configuring the Driver on Different Distributions
274 -------------------------------------------------
275 Configuring a network driver to load properly when the system is started is
276 distribution dependent. Typically, the configuration process involves adding
277 an alias line to /etc/modprobe.conf as well as editing other system startup
278 scripts and/or configuration files. Many popular Linux distributions ship
279 with tools to make these changes for you. To learn the proper way to
280 configure a network device for your system, refer to your distribution
281 documentation. If during this process you are asked for the driver or module
282 name, the name for the Linux Base Driver for the Intel 10GbE Family of
283 Adapters is ixgb.
284
285 Viewing Link Messages
286 ---------------------
287 Link messages will not be displayed to the console if the distribution is
288 restricting system messages. In order to see network driver link messages on
289 your console, set dmesg to eight by entering the following:
290
291 dmesg -n 8
292
293 NOTE: This setting is not saved across reboots.
294
295
296 Jumbo Frames
297 ------------
298 The driver supports Jumbo Frames for all adapters. Jumbo Frames support is
299 enabled by changing the MTU to a value larger than the default of 1500.
300 The maximum value for the MTU is 16114. Use the ifconfig command to
301 increase the MTU size. For example:
302
303 ifconfig ethx mtu 9000 up
304
305 The maximum MTU setting for Jumbo Frames is 16114. This value coincides
306 with the maximum Jumbo Frames size of 16128.
307
308
309 Ethtool
310 -------
311 The driver utilizes the ethtool interface for driver configuration and
312 diagnostics, as well as displaying statistical information. Ethtool
313 version 1.6 or later is required for this functionality.
314
315 The latest release of ethtool can be found from
316 http://sourceforge.net/projects/gkernel
317
318 NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support
319 for a more complete ethtool feature set can be enabled by upgrading
320 to the latest version.
321
322
323 NAPI
324 ----
325
326 NAPI (Rx polling mode) is supported in the ixgb driver. NAPI is enabled
327 or disabled based on the configuration of the kernel. see CONFIG_IXGB_NAPI
328
329 See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
330
331
332Known Issues/Troubleshooting
333============================
334
335 NOTE: After installing the driver, if your Intel Network Connection is not
336 working, verify in the "In This Release" section of the readme that you have
337 installed the correct driver.
338
339 Intel(R) PRO/10GbE CX4 Server Adapter Cable Interoperability Issue with
340 Fujitsu XENPAK Module in SmartBits Chassis
341 ---------------------------------------------------------------------
342 Excessive CRC errors may be observed if the Intel(R) PRO/10GbE CX4
343 Server adapter is connected to a Fujitsu XENPAK CX4 module in a SmartBits
344 chassis using 15 m/24AWG cable assemblies manufactured by Fujitsu or Leoni.
345 The CRC errors may be received either by the Intel(R) PRO/10GbE CX4
346 Server adapter or the SmartBits. If this situation occurs using a different
347 cable assembly may resolve the issue.
348
349 CX4 Server Adapter Cable Interoperability Issues with HP Procurve 3400cl
350 Switch Port
351 ------------------------------------------------------------------------
352 Excessive CRC errors may be observed if the Intel(R) PRO/10GbE CX4 Server
353 adapter is connected to an HP Procurve 3400cl switch port using short cables
354 (1 m or shorter). If this situation occurs, using a longer cable may resolve
355 the issue.
356
357 Excessive CRC errors may be observed using Fujitsu 24AWG cable assemblies that
358 Are 10 m or longer or where using a Leoni 15 m/24AWG cable assembly. The CRC
359 errors may be received either by the CX4 Server adapter or at the switch. If
360 this situation occurs, using a different cable assembly may resolve the issue.
361
362
363 Jumbo Frames System Requirement
364 -------------------------------
365 Memory allocation failures have been observed on Linux systems with 64 MB
366 of RAM or less that are running Jumbo Frames. If you are using Jumbo
367 Frames, your system may require more than the advertised minimum
368 requirement of 64 MB of system memory.
369
370
371 Performance Degradation with Jumbo Frames
372 -----------------------------------------
373 Degradation in throughput performance may be observed in some Jumbo frames
374 environments. If this is observed, increasing the application's socket buffer
375 size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help.
376 See the specific application manual and /usr/src/linux*/Documentation/
377 networking/ip-sysctl.txt for more details.
378
379
380 Allocating Rx Buffers when Using Jumbo Frames
381 ---------------------------------------------
382 Allocating Rx buffers when using Jumbo Frames on 2.6.x kernels may fail if
383 the available memory is heavily fragmented. This issue may be seen with PCI-X
384 adapters or with packet split disabled. This can be reduced or eliminated
385 by changing the amount of available memory for receive buffer allocation, by
386 increasing /proc/sys/vm/min_free_kbytes.
387
388
389 Multiple Interfaces on Same Ethernet Broadcast Network
390 ------------------------------------------------------
391 Due to the default ARP behavior on Linux, it is not possible to have
392 one system on two IP networks in the same Ethernet broadcast domain
393 (non-partitioned switch) behave as expected. All Ethernet interfaces
394 will respond to IP traffic for any IP address assigned to the system.
395 This results in unbalanced receive traffic.
396
397 If you have multiple interfaces in a server, do either of the following:
398
399 - Turn on ARP filtering by entering:
400 echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
401
402 - Install the interfaces in separate broadcast domains - either in
403 different switches or in a switch partitioned to VLANs.
404
405
406 UDP Stress Test Dropped Packet Issue
407 --------------------------------------
408 Under small packets UDP stress test with 10GbE driver, the Linux system
409 may drop UDP packets due to the fullness of socket buffers. You may want
410 to change the driver's Flow Control variables to the minimum value for
411 controlling packet reception.
412
413
414 Tx Hangs Possible Under Stress
415 ------------------------------
416 Under stress conditions, if TX hangs occur, turning off TSO
417 "ethtool -K eth0 tso off" may resolve the problem.
418
419
203Support 420Support
204======= 421=======
205 422
206For general information and support, go to the Intel support website at: 423For general information, go to the Intel support website at:
207 424
208 http://support.intel.com 425 http://support.intel.com
209 426
427or the Intel Wired Networking project hosted by Sourceforge at:
428
429 http://sourceforge.net/projects/e1000
430
210If an issue is identified with the released source code on the supported 431If an issue is identified with the released source code on the supported
211kernel with a supported adapter, email the specific information related to 432kernel with a supported adapter, email the specific information related
212the issue to linux.nics@intel.com. 433to the issue to e1000-devel@lists.sf.net
diff --git a/Documentation/networking/mac80211_hwsim/README b/Documentation/networking/mac80211_hwsim/README
new file mode 100644
index 000000000000..2ff8ccb8dc37
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/README
@@ -0,0 +1,67 @@
1mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
2Copyright (c) 2008, Jouni Malinen <j@w1.fi>
3
4This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License version 2 as
6published by the Free Software Foundation.
7
8
9Introduction
10
11mac80211_hwsim is a Linux kernel module that can be used to simulate
12arbitrary number of IEEE 802.11 radios for mac80211. It can be used to
13test most of the mac80211 functionality and user space tools (e.g.,
14hostapd and wpa_supplicant) in a way that matches very closely with
15the normal case of using real WLAN hardware. From the mac80211 view
16point, mac80211_hwsim is yet another hardware driver, i.e., no changes
17to mac80211 are needed to use this testing tool.
18
19The main goal for mac80211_hwsim is to make it easier for developers
20to test their code and work with new features to mac80211, hostapd,
21and wpa_supplicant. The simulated radios do not have the limitations
22of real hardware, so it is easy to generate an arbitrary test setup
23and always reproduce the same setup for future tests. In addition,
24since all radio operation is simulated, any channel can be used in
25tests regardless of regulatory rules.
26
27mac80211_hwsim kernel module has a parameter 'radios' that can be used
28to select how many radios are simulated (default 2). This allows
29configuration of both very simply setups (e.g., just a single access
30point and a station) or large scale tests (multiple access points with
31hundreds of stations).
32
33mac80211_hwsim works by tracking the current channel of each virtual
34radio and copying all transmitted frames to all other radios that are
35currently enabled and on the same channel as the transmitting
36radio. Software encryption in mac80211 is used so that the frames are
37actually encrypted over the virtual air interface to allow more
38complete testing of encryption.
39
40A global monitoring netdev, hwsim#, is created independent of
41mac80211. This interface can be used to monitor all transmitted frames
42regardless of channel.
43
44
45Simple example
46
47This example shows how to use mac80211_hwsim to simulate two radios:
48one to act as an access point and the other as a station that
49associates with the AP. hostapd and wpa_supplicant are used to take
50care of WPA2-PSK authentication. In addition, hostapd is also
51processing access point side of association.
52
53Please note that the current Linux kernel does not enable AP mode, so a
54simple patch is needed to enable AP mode selection:
55http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch
56
57
58# Build mac80211_hwsim as part of kernel configuration
59
60# Load the module
61modprobe mac80211_hwsim
62
63# Run hostapd (AP) for wlan0
64hostapd hostapd.conf
65
66# Run wpa_supplicant (station) for wlan1
67wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
diff --git a/Documentation/networking/mac80211_hwsim/hostapd.conf b/Documentation/networking/mac80211_hwsim/hostapd.conf
new file mode 100644
index 000000000000..08cde7e35f2e
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/hostapd.conf
@@ -0,0 +1,11 @@
1interface=wlan0
2driver=nl80211
3
4hw_mode=g
5channel=1
6ssid=mac80211 test
7
8wpa=2
9wpa_key_mgmt=WPA-PSK
10wpa_pairwise=CCMP
11wpa_passphrase=12345678
diff --git a/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
new file mode 100644
index 000000000000..299128cff035
--- /dev/null
+++ b/Documentation/networking/mac80211_hwsim/wpa_supplicant.conf
@@ -0,0 +1,10 @@
1ctrl_interface=/var/run/wpa_supplicant
2
3network={
4 ssid="mac80211 test"
5 psk="12345678"
6 key_mgmt=WPA-PSK
7 proto=WPA2
8 pairwise=CCMP
9 group=CCMP
10}
diff --git a/Documentation/networking/multiqueue.txt b/Documentation/networking/multiqueue.txt
index ea5a42e8f79f..4caa0e314cc2 100644
--- a/Documentation/networking/multiqueue.txt
+++ b/Documentation/networking/multiqueue.txt
@@ -3,19 +3,11 @@
3 =========================================== 3 ===========================================
4 4
5Section 1: Base driver requirements for implementing multiqueue support 5Section 1: Base driver requirements for implementing multiqueue support
6Section 2: Qdisc support for multiqueue devices
7Section 3: Brief howto using PRIO or RR for multiqueue devices
8
9 6
10Intro: Kernel support for multiqueue devices 7Intro: Kernel support for multiqueue devices
11--------------------------------------------------------- 8---------------------------------------------------------
12 9
13Kernel support for multiqueue devices is only an API that is presented to the 10Kernel support for multiqueue devices is always present.
14netdevice layer for base drivers to implement. This feature is part of the
15core networking stack, and all network devices will be running on the
16multiqueue-aware stack. If a base driver only has one queue, then these
17changes are transparent to that driver.
18
19 11
20Section 1: Base driver requirements for implementing multiqueue support 12Section 1: Base driver requirements for implementing multiqueue support
21----------------------------------------------------------------------- 13-----------------------------------------------------------------------
@@ -32,84 +24,56 @@ netif_{start|stop|wake}_subqueue() functions to manage each queue while the
32device is still operational. netdev->queue_lock is still used when the device 24device is still operational. netdev->queue_lock is still used when the device
33comes online or when it's completely shut down (unregister_netdev(), etc.). 25comes online or when it's completely shut down (unregister_netdev(), etc.).
34 26
35Finally, the base driver should indicate that it is a multiqueue device. The
36feature flag NETIF_F_MULTI_QUEUE should be added to the netdev->features
37bitmap on device initialization. Below is an example from e1000:
38
39#ifdef CONFIG_E1000_MQ
40 if ( (adapter->hw.mac.type == e1000_82571) ||
41 (adapter->hw.mac.type == e1000_82572) ||
42 (adapter->hw.mac.type == e1000_80003es2lan))
43 netdev->features |= NETIF_F_MULTI_QUEUE;
44#endif
45
46 27
47Section 2: Qdisc support for multiqueue devices 28Section 2: Qdisc support for multiqueue devices
48-----------------------------------------------
49 29
50Currently two qdiscs support multiqueue devices. A new round-robin qdisc, 30-----------------------------------------------
51sch_rr, and sch_prio. The qdisc is responsible for classifying the skb's to
52bands and queues, and will store the queue mapping into skb->queue_mapping.
53Use this field in the base driver to determine which queue to send the skb
54to.
55 31
56sch_rr has been added for hardware that doesn't want scheduling policies from 32Currently two qdiscs are optimized for multiqueue devices. The first is the
57software, so it's a straight round-robin qdisc. It uses the same syntax and 33default pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue.
58classification priomap that sch_prio uses, so it should be intuitive to 34A new round-robin qdisc, sch_multiq also supports multiple hardware queues. The
59configure for people who've used sch_prio. 35qdisc is responsible for classifying the skb's and then directing the skb's to
36bands and queues based on the value in skb->queue_mapping. Use this field in
37the base driver to determine which queue to send the skb to.
60 38
61In order to utilitize the multiqueue features of the qdiscs, the network 39sch_multiq has been added for hardware that wishes to avoid head-of-line
62device layer needs to enable multiple queue support. This can be done by 40blocking. It will cycle though the bands and verify that the hardware queue
63selecting NETDEVICES_MULTIQUEUE under Drivers. 41associated with the band is not stopped prior to dequeuing a packet.
64 42
65The PRIO qdisc naturally plugs into a multiqueue device. If 43On qdisc load, the number of bands is based on the number of queues on the
66NETDEVICES_MULTIQUEUE is selected, then on qdisc load, the number of 44hardware. Once the association is made, any skb with skb->queue_mapping set,
67bands requested is compared to the number of queues on the hardware. If they 45will be queued to the band associated with the hardware queue.
68are equal, it sets a one-to-one mapping up between the queues and bands. If
69they're not equal, it will not load the qdisc. This is the same behavior
70for RR. Once the association is made, any skb that is classified will have
71skb->queue_mapping set, which will allow the driver to properly queue skb's
72to multiple queues.
73 46
74 47
75Section 3: Brief howto using PRIO and RR for multiqueue devices 48Section 3: Brief howto using MULTIQ for multiqueue devices
76--------------------------------------------------------------- 49---------------------------------------------------------------
77 50
78The userspace command 'tc,' part of the iproute2 package, is used to configure 51The userspace command 'tc,' part of the iproute2 package, is used to configure
79qdiscs. To add the PRIO qdisc to your network device, assuming the device is 52qdiscs. To add the MULTIQ qdisc to your network device, assuming the device
80called eth0, run the following command: 53is called eth0, run the following command:
81 54
82# tc qdisc add dev eth0 root handle 1: prio bands 4 multiqueue 55# tc qdisc add dev eth0 root handle 1: multiq
83 56
84This will create 4 bands, 0 being highest priority, and associate those bands 57The qdisc will allocate the number of bands to equal the number of queues that
85to the queues on your NIC. Assuming eth0 has 4 Tx queues, the band mapping 58the device reports, and bring the qdisc online. Assuming eth0 has 4 Tx
86would look like: 59queues, the band mapping would look like:
87 60
88band 0 => queue 0 61band 0 => queue 0
89band 1 => queue 1 62band 1 => queue 1
90band 2 => queue 2 63band 2 => queue 2
91band 3 => queue 3 64band 3 => queue 3
92 65
93Traffic will begin flowing through each queue if your TOS values are assigning 66Traffic will begin flowing through each queue based on either the simple_tx_hash
94traffic across the various bands. For example, ssh traffic will always try to 67function or based on netdev->select_queue() if you have it defined.
95go out band 0 based on TOS -> Linux priority conversion (realtime traffic),
96so it will be sent out queue 0. ICMP traffic (pings) fall into the "normal"
97traffic classification, which is band 1. Therefore pings will be send out
98queue 1 on the NIC.
99
100Note the use of the multiqueue keyword. This is only in versions of iproute2
101that support multiqueue networking devices; if this is omitted when loading
102a qdisc onto a multiqueue device, the qdisc will load and operate the same
103if it were loaded onto a single-queue device (i.e. - sends all traffic to
104queue 0).
105
106Another alternative to multiqueue band allocation can be done by using the
107multiqueue option and specify 0 bands. If this is the case, the qdisc will
108allocate the number of bands to equal the number of queues that the device
109reports, and bring the qdisc online.
110 68
111The behavior of tc filters remains the same, where it will override TOS priority 69The behavior of tc filters remains the same. However a new tc action,
112classification. 70skbedit, has been added. Assuming you wanted to route all traffic to a
71specific host, for example 192.168.0.3, through a specific queue you could use
72this action and establish a filter such as:
113 73
74tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
75 match ip dst 192.168.0.3 \
76 action skbedit queue_mapping 3
114 77
115Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com> 78Author: Alexander Duyck <alexander.h.duyck@intel.com>
79Original Author: Peter P. Waskiewicz Jr. <peter.p.waskiewicz.jr@intel.com>
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index db0cd5169581..07c53d596035 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -326,7 +326,7 @@ just one call to mmap is needed:
326 mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); 326 mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
327 327
328If tp_frame_size is a divisor of tp_block_size frames will be 328If tp_frame_size is a divisor of tp_block_size frames will be
329contiguosly spaced by tp_frame_size bytes. If not, each 329contiguously spaced by tp_frame_size bytes. If not, each
330tp_block_size/tp_frame_size frames there will be a gap between 330tp_block_size/tp_frame_size frames there will be a gap between
331the frames. This is because a frame cannot be spawn across two 331the frames. This is because a frame cannot be spawn across two
332blocks. 332blocks.
diff --git a/Documentation/networking/phonet.txt b/Documentation/networking/phonet.txt
new file mode 100644
index 000000000000..0e6e592f4f55
--- /dev/null
+++ b/Documentation/networking/phonet.txt
@@ -0,0 +1,175 @@
1Linux Phonet protocol family
2============================
3
4Introduction
5------------
6
7Phonet is a packet protocol used by Nokia cellular modems for both IPC
8and RPC. With the Linux Phonet socket family, Linux host processes can
9receive and send messages from/to the modem, or any other external
10device attached to the modem. The modem takes care of routing.
11
12Phonet packets can be exchanged through various hardware connections
13depending on the device, such as:
14 - USB with the CDC Phonet interface,
15 - infrared,
16 - Bluetooth,
17 - an RS232 serial port (with a dedicated "FBUS" line discipline),
18 - the SSI bus with some TI OMAP processors.
19
20
21Packets format
22--------------
23
24Phonet packets have a common header as follows:
25
26 struct phonethdr {
27 uint8_t pn_media; /* Media type (link-layer identifier) */
28 uint8_t pn_rdev; /* Receiver device ID */
29 uint8_t pn_sdev; /* Sender device ID */
30 uint8_t pn_res; /* Resource ID or function */
31 uint16_t pn_length; /* Big-endian message byte length (minus 6) */
32 uint8_t pn_robj; /* Receiver object ID */
33 uint8_t pn_sobj; /* Sender object ID */
34 };
35
36On Linux, the link-layer header includes the pn_media byte (see below).
37The next 7 bytes are part of the network-layer header.
38
39The device ID is split: the 6 higher-order bits consitute the device
40address, while the 2 lower-order bits are used for multiplexing, as are
41the 8-bit object identifiers. As such, Phonet can be considered as a
42network layer with 6 bits of address space and 10 bits for transport
43protocol (much like port numbers in IP world).
44
45The modem always has address number zero. All other device have a their
46own 6-bit address.
47
48
49Link layer
50----------
51
52Phonet links are always point-to-point links. The link layer header
53consists of a single Phonet media type byte. It uniquely identifies the
54link through which the packet is transmitted, from the modem's
55perspective. Each Phonet network device shall prepend and set the media
56type byte as appropriate. For convenience, a common phonet_header_ops
57link-layer header operations structure is provided. It sets the
58media type according to the network device hardware address.
59
60Linux Phonet network interfaces support a dedicated link layer packets
61type (ETH_P_PHONET) which is out of the Ethernet type range. They can
62only send and receive Phonet packets.
63
64The virtual TUN tunnel device driver can also be used for Phonet. This
65requires IFF_TUN mode, _without_ the IFF_NO_PI flag. In this case,
66there is no link-layer header, so there is no Phonet media type byte.
67
68Note that Phonet interfaces are not allowed to re-order packets, so
69only the (default) Linux FIFO qdisc should be used with them.
70
71
72Network layer
73-------------
74
75The Phonet socket address family maps the Phonet packet header:
76
77 struct sockaddr_pn {
78 sa_family_t spn_family; /* AF_PHONET */
79 uint8_t spn_obj; /* Object ID */
80 uint8_t spn_dev; /* Device ID */
81 uint8_t spn_resource; /* Resource or function */
82 uint8_t spn_zero[...]; /* Padding */
83 };
84
85The resource field is only used when sending and receiving;
86It is ignored by bind() and getsockname().
87
88
89Low-level datagram protocol
90---------------------------
91
92Applications can send Phonet messages using the Phonet datagram socket
93protocol from the PF_PHONET family. Each socket is bound to one of the
942^10 object IDs available, and can send and receive packets with any
95other peer.
96
97 struct sockaddr_pn addr = { .spn_family = AF_PHONET, };
98 ssize_t len;
99 socklen_t addrlen = sizeof(addr);
100 int fd;
101
102 fd = socket(PF_PHONET, SOCK_DGRAM, 0);
103 bind(fd, (struct sockaddr *)&addr, sizeof(addr));
104 /* ... */
105
106 sendto(fd, msg, msglen, 0, (struct sockaddr *)&addr, sizeof(addr));
107 len = recvfrom(fd, buf, sizeof(buf), 0,
108 (struct sockaddr *)&addr, &addrlen);
109
110This protocol follows the SOCK_DGRAM connection-less semantics.
111However, connect() and getpeername() are not supported, as they did
112not seem useful with Phonet usages (could be added easily).
113
114
115Phonet Pipe protocol
116--------------------
117
118The Phonet Pipe protocol is a simple sequenced packets protocol
119with end-to-end congestion control. It uses the passive listening
120socket paradigm. The listening socket is bound to an unique free object
121ID. Each listening socket can handle up to 255 simultaneous
122connections, one per accept()'d socket.
123
124 int lfd, cfd;
125
126 lfd = socket(PF_PHONET, SOCK_SEQPACKET, PN_PROTO_PIPE);
127 listen (lfd, INT_MAX);
128
129 /* ... */
130 cfd = accept(lfd, NULL, NULL);
131 for (;;)
132 {
133 char buf[...];
134 ssize_t len = read(cfd, buf, sizeof(buf));
135
136 /* ... */
137
138 write(cfd, msg, msglen);
139 }
140
141Connections are established between two endpoints by a "third party"
142application. This means that both endpoints are passive; so connect()
143is not possible.
144
145WARNING:
146When polling a connected pipe socket for writability, there is an
147intrinsic race condition whereby writability might be lost between the
148polling and the writing system calls. In this case, the socket will
149block until write because possible again, unless non-blocking mode
150becomes enabled.
151
152
153The pipe protocol provides two socket options at the SOL_PNPIPE level:
154
155 PNPIPE_ENCAP accepts one integer value (int) of:
156
157 PNPIPE_ENCAP_NONE: The socket operates normally (default).
158
159 PNPIPE_ENCAP_IP: The socket is used as a backend for a virtual IP
160 interface. This requires CAP_NET_ADMIN capability. GPRS data
161 support on Nokia modems can use this. Note that the socket cannot
162 be reliably poll()'d or read() from while in this mode.
163
164 PNPIPE_IFINDEX is a read-only integer value. It contains the
165 interface index of the network interface created by PNPIPE_ENCAP,
166 or zero if encapsulation is off.
167
168
169Authors
170-------
171
172Linux Phonet was initially written by Sakari Ailus.
173Other contributors include Mikä Liljeberg, Andras Domokos,
174Carlos Chinea and Rémi Denis-Courmont.
175Copyright (C) 2008 Nokia Corporation.
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt
new file mode 100644
index 000000000000..a96989a8ff35
--- /dev/null
+++ b/Documentation/networking/regulatory.txt
@@ -0,0 +1,194 @@
1Linux wireless regulatory documentation
2---------------------------------------
3
4This document gives a brief review over how the Linux wireless
5regulatory infrastructure works.
6
7More up to date information can be obtained at the project's web page:
8
9http://wireless.kernel.org/en/developers/Regulatory
10
11Keeping regulatory domains in userspace
12---------------------------------------
13
14Due to the dynamic nature of regulatory domains we keep them
15in userspace and provide a framework for userspace to upload
16to the kernel one regulatory domain to be used as the central
17core regulatory domain all wireless devices should adhere to.
18
19How to get regulatory domains to the kernel
20-------------------------------------------
21
22Userspace gets a regulatory domain in the kernel by having
23a userspace agent build it and send it via nl80211. Only
24expected regulatory domains will be respected by the kernel.
25
26A currently available userspace agent which can accomplish this
27is CRDA - central regulatory domain agent. Its documented here:
28
29http://wireless.kernel.org/en/developers/Regulatory/CRDA
30
31Essentially the kernel will send a udev event when it knows
32it needs a new regulatory domain. A udev rule can be put in place
33to trigger crda to send the respective regulatory domain for a
34specific ISO/IEC 3166 alpha2.
35
36Below is an example udev rule which can be used:
37
38# Example file, should be put in /etc/udev/rules.d/regulatory.rules
39KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"
40
41The alpha2 is passed as an environment variable under the variable COUNTRY.
42
43Who asks for regulatory domains?
44--------------------------------
45
46* Users
47
48Users can use iw:
49
50http://wireless.kernel.org/en/users/Documentation/iw
51
52An example:
53
54 # set regulatory domain to "Costa Rica"
55 iw reg set CR
56
57This will request the kernel to set the regulatory domain to
58the specificied alpha2. The kernel in turn will then ask userspace
59to provide a regulatory domain for the alpha2 specified by the user
60by sending a uevent.
61
62* Wireless subsystems for Country Information elements
63
64The kernel will send a uevent to inform userspace a new
65regulatory domain is required. More on this to be added
66as its integration is added.
67
68* Drivers
69
70If drivers determine they need a specific regulatory domain
71set they can inform the wireless core using regulatory_hint().
72They have two options -- they either provide an alpha2 so that
73crda can provide back a regulatory domain for that country or
74they can build their own regulatory domain based on internal
75custom knowledge so the wireless core can respect it.
76
77*Most* drivers will rely on the first mechanism of providing a
78regulatory hint with an alpha2. For these drivers there is an additional
79check that can be used to ensure compliance based on custom EEPROM
80regulatory data. This additional check can be used by drivers by
81registering on its struct wiphy a reg_notifier() callback. This notifier
82is called when the core's regulatory domain has been changed. The driver
83can use this to review the changes made and also review who made them
84(driver, user, country IE) and determine what to allow based on its
85internal EEPROM data. Devices drivers wishing to be capable of world
86roaming should use this callback. More on world roaming will be
87added to this document when its support is enabled.
88
89Device drivers who provide their own built regulatory domain
90do not need a callback as the channels registered by them are
91the only ones that will be allowed and therefore *additional*
92cannels cannot be enabled.
93
94Example code - drivers hinting an alpha2:
95------------------------------------------
96
97This example comes from the zd1211rw device driver. You can start
98by having a mapping of your device's EEPROM country/regulatory
99domain value to to a specific alpha2 as follows:
100
101static struct zd_reg_alpha2_map reg_alpha2_map[] = {
102 { ZD_REGDOMAIN_FCC, "US" },
103 { ZD_REGDOMAIN_IC, "CA" },
104 { ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */
105 { ZD_REGDOMAIN_JAPAN, "JP" },
106 { ZD_REGDOMAIN_JAPAN_ADD, "JP" },
107 { ZD_REGDOMAIN_SPAIN, "ES" },
108 { ZD_REGDOMAIN_FRANCE, "FR" },
109
110Then you can define a routine to map your read EEPROM value to an alpha2,
111as follows:
112
113static int zd_reg2alpha2(u8 regdomain, char *alpha2)
114{
115 unsigned int i;
116 struct zd_reg_alpha2_map *reg_map;
117 for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) {
118 reg_map = &reg_alpha2_map[i];
119 if (regdomain == reg_map->reg) {
120 alpha2[0] = reg_map->alpha2[0];
121 alpha2[1] = reg_map->alpha2[1];
122 return 0;
123 }
124 }
125 return 1;
126}
127
128Lastly, you can then hint to the core of your discovered alpha2, if a match
129was found. You need to do this after you have registered your wiphy. You
130are expected to do this during initialization.
131
132 r = zd_reg2alpha2(mac->regdomain, alpha2);
133 if (!r)
134 regulatory_hint(hw->wiphy, alpha2, NULL);
135
136Example code - drivers providing a built in regulatory domain:
137--------------------------------------------------------------
138
139If you have regulatory information you can obtain from your
140driver and you *need* to use this we let you build a regulatory domain
141structure and pass it to the wireless core. To do this you should
142kmalloc() a structure big enough to hold your regulatory domain
143structure and you should then fill it with your data. Finally you simply
144call regulatory_hint() with the regulatory domain structure in it.
145
146Bellow is a simple example, with a regulatory domain cached using the stack.
147Your implementation may vary (read EEPROM cache instead, for example).
148
149Example cache of some regulatory domain
150
151struct ieee80211_regdomain mydriver_jp_regdom = {
152 .n_reg_rules = 3,
153 .alpha2 = "JP",
154 //.alpha2 = "99", /* If I have no alpha2 to map it to */
155 .reg_rules = {
156 /* IEEE 802.11b/g, channels 1..14 */
157 REG_RULE(2412-20, 2484+20, 40, 6, 20, 0),
158 /* IEEE 802.11a, channels 34..48 */
159 REG_RULE(5170-20, 5240+20, 40, 6, 20,
160 NL80211_RRF_PASSIVE_SCAN),
161 /* IEEE 802.11a, channels 52..64 */
162 REG_RULE(5260-20, 5320+20, 40, 6, 20,
163 NL80211_RRF_NO_IBSS |
164 NL80211_RRF_DFS),
165 }
166};
167
168Then in some part of your code after your wiphy has been registered:
169
170 int r;
171 struct ieee80211_regdomain *rd;
172 int size_of_regd;
173 int num_rules = mydriver_jp_regdom.n_reg_rules;
174 unsigned int i;
175
176 size_of_regd = sizeof(struct ieee80211_regdomain) +
177 (num_rules * sizeof(struct ieee80211_reg_rule));
178
179 rd = kzalloc(size_of_regd, GFP_KERNEL);
180 if (!rd)
181 return -ENOMEM;
182
183 memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain));
184
185 for (i=0; i < num_rules; i++) {
186 memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i],
187 sizeof(struct ieee80211_reg_rule));
188 }
189 r = regulatory_hint(hw->wiphy, NULL, rd);
190 if (r) {
191 kfree(rd);
192 return r;
193 }
194
diff --git a/Documentation/networking/s2io.txt b/Documentation/networking/s2io.txt
index 4bde53e85f3f..c3d6b4d5d014 100644
--- a/Documentation/networking/s2io.txt
+++ b/Documentation/networking/s2io.txt
@@ -52,13 +52,10 @@ d. MSI/MSI-X. Can be enabled on platforms which support this feature
52(IA64, Xeon) resulting in noticeable performance improvement(upto 7% 52(IA64, Xeon) resulting in noticeable performance improvement(upto 7%
53on certain platforms). 53on certain platforms).
54 54
55e. NAPI. Compile-time option(CONFIG_S2IO_NAPI) for better Rx interrupt 55e. Statistics. Comprehensive MAC-level and software statistics displayed
56moderation.
57
58f. Statistics. Comprehensive MAC-level and software statistics displayed
59using "ethtool -S" option. 56using "ethtool -S" option.
60 57
61g. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings, 58f. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings,
62with multiple steering options. 59with multiple steering options.
63 60
644. Command line parameters 614. Command line parameters
@@ -83,9 +80,9 @@ Valid range: Limited by memory on system
83Default: 30 80Default: 30
84 81
85e. intr_type 82e. intr_type
86Specifies interrupt type. Possible values 1(INTA), 2(MSI), 3(MSI-X) 83Specifies interrupt type. Possible values 0(INTA), 2(MSI-X)
87Valid range: 1-3 84Valid values: 0, 2
88Default: 1 85Default: 2
89 86
905. Performance suggestions 875. Performance suggestions
91General: 88General:
diff --git a/Documentation/networking/tc-actions-env-rules.txt b/Documentation/networking/tc-actions-env-rules.txt
index 01e716d185f4..dcadf6f88e34 100644
--- a/Documentation/networking/tc-actions-env-rules.txt
+++ b/Documentation/networking/tc-actions-env-rules.txt
@@ -4,26 +4,27 @@ The "enviromental" rules for authors of any new tc actions are:
41) If you stealeth or borroweth any packet thou shalt be branching 41) If you stealeth or borroweth any packet thou shalt be branching
5from the righteous path and thou shalt cloneth. 5from the righteous path and thou shalt cloneth.
6 6
7For example if your action queues a packet to be processed later 7For example if your action queues a packet to be processed later,
8or intentionaly branches by redirecting a packet then you need to 8or intentionally branches by redirecting a packet, then you need to
9clone the packet. 9clone the packet.
10
10There are certain fields in the skb tc_verd that need to be reset so we 11There are certain fields in the skb tc_verd that need to be reset so we
11avoid loops etc. A few are generic enough so much so that skb_act_clone() 12avoid loops, etc. A few are generic enough that skb_act_clone()
12resets them for you. So invoke skb_act_clone() rather than skb_clone() 13resets them for you, so invoke skb_act_clone() rather than skb_clone().
13 14
142) If you munge any packet thou shalt call pskb_expand_head in the case 152) If you munge any packet thou shalt call pskb_expand_head in the case
15someone else is referencing the skb. After that you "own" the skb. 16someone else is referencing the skb. After that you "own" the skb.
16You must also tell us if it is ok to munge the packet (TC_OK2MUNGE), 17You must also tell us if it is ok to munge the packet (TC_OK2MUNGE),
17this way any action downstream can stomp on the packet. 18this way any action downstream can stomp on the packet.
18 19
193) dropping packets you dont own is a nono. You simply return 203) Dropping packets you don't own is a no-no. You simply return
20TC_ACT_SHOT to the caller and they will drop it. 21TC_ACT_SHOT to the caller and they will drop it.
21 22
22The "enviromental" rules for callers of actions (qdiscs etc) are: 23The "enviromental" rules for callers of actions (qdiscs etc) are:
23 24
24*) thou art responsible for freeing anything returned as being 25*) Thou art responsible for freeing anything returned as being
25TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is 26TC_ACT_SHOT/STOLEN/QUEUED. If none of TC_ACT_SHOT/STOLEN/QUEUED is
26returned then all is great and you dont need to do anything. 27returned, then all is great and you don't need to do anything.
27 28
28Post on netdev if something is unclear. 29Post on netdev if something is unclear.
29 30
diff --git a/Documentation/networking/tproxy.txt b/Documentation/networking/tproxy.txt
new file mode 100644
index 000000000000..7b5996d9357e
--- /dev/null
+++ b/Documentation/networking/tproxy.txt
@@ -0,0 +1,85 @@
1Transparent proxy support
2=========================
3
4This feature adds Linux 2.2-like transparent proxy support to current kernels.
5To use it, enable NETFILTER_TPROXY, the socket match and the TPROXY target in
6your kernel config. You will need policy routing too, so be sure to enable that
7as well.
8
9
101. Making non-local sockets work
11================================
12
13The idea is that you identify packets with destination address matching a local
14socket on your box, set the packet mark to a certain value, and then match on that
15value using policy routing to have those packets delivered locally:
16
17# iptables -t mangle -N DIVERT
18# iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
19# iptables -t mangle -A DIVERT -j MARK --set-mark 1
20# iptables -t mangle -A DIVERT -j ACCEPT
21
22# ip rule add fwmark 1 lookup 100
23# ip route add local 0.0.0.0/0 dev lo table 100
24
25Because of certain restrictions in the IPv4 routing output code you'll have to
26modify your application to allow it to send datagrams _from_ non-local IP
27addresses. All you have to do is enable the (SOL_IP, IP_TRANSPARENT) socket
28option before calling bind:
29
30fd = socket(AF_INET, SOCK_STREAM, 0);
31/* - 8< -*/
32int value = 1;
33setsockopt(fd, SOL_IP, IP_TRANSPARENT, &value, sizeof(value));
34/* - 8< -*/
35name.sin_family = AF_INET;
36name.sin_port = htons(0xCAFE);
37name.sin_addr.s_addr = htonl(0xDEADBEEF);
38bind(fd, &name, sizeof(name));
39
40A trivial patch for netcat is available here:
41http://people.netfilter.org/hidden/tproxy/netcat-ip_transparent-support.patch
42
43
442. Redirecting traffic
45======================
46
47Transparent proxying often involves "intercepting" traffic on a router. This is
48usually done with the iptables REDIRECT target; however, there are serious
49limitations of that method. One of the major issues is that it actually
50modifies the packets to change the destination address -- which might not be
51acceptable in certain situations. (Think of proxying UDP for example: you won't
52be able to find out the original destination address. Even in case of TCP
53getting the original destination address is racy.)
54
55The 'TPROXY' target provides similar functionality without relying on NAT. Simply
56add rules like this to the iptables ruleset above:
57
58# iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY \
59 --tproxy-mark 0x1/0x1 --on-port 50080
60
61Note that for this to work you'll have to modify the proxy to enable (SOL_IP,
62IP_TRANSPARENT) for the listening socket.
63
64
653. Iptables extensions
66======================
67
68To use tproxy you'll need to have the 'socket' and 'TPROXY' modules
69compiled for iptables. A patched version of iptables is available
70here: http://git.balabit.hu/?p=bazsi/iptables-tproxy.git
71
72
734. Application support
74======================
75
764.1. Squid
77----------
78
79Squid 3.HEAD has support built-in. To use it, pass
80'--enable-linux-netfilter' to configure and set the 'tproxy' option on
81the HTTP listener you redirect traffic to with the TPROXY iptables
82target.
83
84For more information please consult the following page on the Squid
85wiki: http://wiki.squid-cache.org/Features/Tproxy4
diff --git a/Documentation/networking/udplite.txt b/Documentation/networking/udplite.txt
index 3870f280280b..855d8da57a23 100644
--- a/Documentation/networking/udplite.txt
+++ b/Documentation/networking/udplite.txt
@@ -148,7 +148,7 @@
148 getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...); 148 getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...);
149 149
150 is meaningless (as in TCP). Packets with a zero checksum field are 150 is meaningless (as in TCP). Packets with a zero checksum field are
151 illegal (cf. RFC 3828, sec. 3.1) will be silently discarded. 151 illegal (cf. RFC 3828, sec. 3.1) and will be silently discarded.
152 152
153 4) Fragmentation 153 4) Fragmentation
154 154
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt
index 757c729ee42e..90aa4531cb67 100644
--- a/Documentation/nmi_watchdog.txt
+++ b/Documentation/nmi_watchdog.txt
@@ -10,7 +10,7 @@ us to generate 'watchdog NMI interrupts'. (NMI: Non Maskable Interrupt
10which get executed even if the system is otherwise locked up hard). 10which get executed even if the system is otherwise locked up hard).
11This can be used to debug hard kernel lockups. By executing periodic 11This can be used to debug hard kernel lockups. By executing periodic
12NMI interrupts, the kernel can monitor whether any CPU has locked up, 12NMI interrupts, the kernel can monitor whether any CPU has locked up,
13and print out debugging messages if so. 13and print out debugging messages if so.
14 14
15In order to use the NMI watchdog, you need to have APIC support in your 15In order to use the NMI watchdog, you need to have APIC support in your
16kernel. For SMP kernels, APIC support gets compiled in automatically. For 16kernel. For SMP kernels, APIC support gets compiled in automatically. For
@@ -22,8 +22,7 @@ CONFIG_X86_UP_IOAPIC is for uniprocessor with an IO-APIC. [Note: certain
22kernel debugging options, such as Kernel Stack Meter or Kernel Tracer, 22kernel debugging options, such as Kernel Stack Meter or Kernel Tracer,
23may implicitly disable the NMI watchdog.] 23may implicitly disable the NMI watchdog.]
24 24
25For x86-64, the needed APIC is always compiled in, and the NMI watchdog is 25For x86-64, the needed APIC is always compiled in.
26always enabled with I/O-APIC mode (nmi_watchdog=1).
27 26
28Using local APIC (nmi_watchdog=2) needs the first performance register, so 27Using local APIC (nmi_watchdog=2) needs the first performance register, so
29you can't use it for other purposes (such as high precision performance 28you can't use it for other purposes (such as high precision performance
@@ -63,16 +62,15 @@ when the system is idle), but if your system locks up on anything but the
63"hlt", then you are out of luck -- the event will not happen at all and the 62"hlt", then you are out of luck -- the event will not happen at all and the
64watchdog won't trigger. This is a shortcoming of the local APIC watchdog 63watchdog won't trigger. This is a shortcoming of the local APIC watchdog
65-- unfortunately there is no "clock ticks" event that would work all the 64-- unfortunately there is no "clock ticks" event that would work all the
66time. The I/O APIC watchdog is driven externally and has no such shortcoming. 65time. The I/O APIC watchdog is driven externally and has no such shortcoming.
67But its NMI frequency is much higher, resulting in a more significant hit 66But its NMI frequency is much higher, resulting in a more significant hit
68to the overall system performance. 67to the overall system performance.
69 68
70NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default, 69On x86 nmi_watchdog is disabled by default so you have to enable it with
71you have to enable it with a boot time parameter. Prior to 2.4.2-ac18 70a boot time parameter.
72the NMI-oopser is enabled unconditionally on x86 SMP boxes.
73 71
74On x86-64 the NMI oopser is on by default. On 64bit Intel CPUs 72NOTE: In kernels prior to 2.4.2-ac18 the NMI-oopser is enabled unconditionally
75it uses IO-APIC by default and on AMD it uses local APIC. 73on x86 SMP boxes.
76 74
77[ feel free to send bug reports, suggestions and patches to 75[ feel free to send bug reports, suggestions and patches to
78 Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing 76 Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing
diff --git a/Documentation/pcmcia/Makefile b/Documentation/pcmcia/Makefile
new file mode 100644
index 000000000000..accde871ae77
--- /dev/null
+++ b/Documentation/pcmcia/Makefile
@@ -0,0 +1,10 @@
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 := crc32hash
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
9
10HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include
diff --git a/Documentation/pcmcia/crc32hash.c b/Documentation/pcmcia/crc32hash.c
index cbc36d299af8..4210e5abab8a 100644
--- a/Documentation/pcmcia/crc32hash.c
+++ b/Documentation/pcmcia/crc32hash.c
@@ -26,7 +26,7 @@ int main(int argc, char **argv) {
26 printf("no string passed as argument\n"); 26 printf("no string passed as argument\n");
27 return -1; 27 return -1;
28 } 28 }
29 result = crc32(argv[1], strlen(argv[1])); 29 result = crc32((unsigned char const *)argv[1], strlen(argv[1]));
30 printf("0x%x\n", result); 30 printf("0x%x\n", result);
31 return 0; 31 return 0;
32} 32}
diff --git a/Documentation/power/00-INDEX b/Documentation/power/00-INDEX
index a55d7f1c836d..fb742c213c9e 100644
--- a/Documentation/power/00-INDEX
+++ b/Documentation/power/00-INDEX
@@ -1,5 +1,7 @@
100-INDEX 100-INDEX
2 - This file 2 - This file
3apm-acpi.txt
4 - basic info about the APM and ACPI support.
3basic-pm-debugging.txt 5basic-pm-debugging.txt
4 - Debugging suspend and resume 6 - Debugging suspend and resume
5devices.txt 7devices.txt
@@ -14,8 +16,6 @@ notifiers.txt
14 - Registering suspend notifiers in device drivers 16 - Registering suspend notifiers in device drivers
15pci.txt 17pci.txt
16 - How the PCI Subsystem Does Power Management 18 - How the PCI Subsystem Does Power Management
17pm.txt
18 - info on Linux power management support.
19pm_qos_interface.txt 19pm_qos_interface.txt
20 - info on Linux PM Quality of Service interface 20 - info on Linux PM Quality of Service interface
21power_supply_class.txt 21power_supply_class.txt
diff --git a/Documentation/power/apm-acpi.txt b/Documentation/power/apm-acpi.txt
new file mode 100644
index 000000000000..1bd799dc17e8
--- /dev/null
+++ b/Documentation/power/apm-acpi.txt
@@ -0,0 +1,32 @@
1APM or ACPI?
2------------
3If you have a relatively recent x86 mobile, desktop, or server system,
4odds are it supports either Advanced Power Management (APM) or
5Advanced Configuration and Power Interface (ACPI). ACPI is the newer
6of the two technologies and puts power management in the hands of the
7operating system, allowing for more intelligent power management than
8is possible with BIOS controlled APM.
9
10The best way to determine which, if either, your system supports is to
11build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is
12enabled by default). If a working ACPI implementation is found, the
13ACPI driver will override and disable APM, otherwise the APM driver
14will be used.
15
16No, sorry, you cannot have both ACPI and APM enabled and running at
17once. Some people with broken ACPI or broken APM implementations
18would like to use both to get a full set of working features, but you
19simply cannot mix and match the two. Only one power management
20interface can be in control of the machine at once. Think about it..
21
22User-space Daemons
23------------------
24Both APM and ACPI rely on user-space daemons, apmd and acpid
25respectively, to be completely functional. Obtain both of these
26daemons from your Linux distribution or from the Internet (see below)
27and be sure that they are started sometime in the system boot process.
28Go ahead and start both. If ACPI or APM is not available on your
29system the associated daemon will exit gracefully.
30
31 apmd: http://worldvisions.ca/~apenwarr/apmd/
32 acpid: http://acpid.sf.net/
diff --git a/Documentation/power/pm.txt b/Documentation/power/pm.txt
deleted file mode 100644
index be841507e43f..000000000000
--- a/Documentation/power/pm.txt
+++ /dev/null
@@ -1,257 +0,0 @@
1 Linux Power Management Support
2
3This document briefly describes how to use power management with your
4Linux system and how to add power management support to Linux drivers.
5
6APM or ACPI?
7------------
8If you have a relatively recent x86 mobile, desktop, or server system,
9odds are it supports either Advanced Power Management (APM) or
10Advanced Configuration and Power Interface (ACPI). ACPI is the newer
11of the two technologies and puts power management in the hands of the
12operating system, allowing for more intelligent power management than
13is possible with BIOS controlled APM.
14
15The best way to determine which, if either, your system supports is to
16build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is
17enabled by default). If a working ACPI implementation is found, the
18ACPI driver will override and disable APM, otherwise the APM driver
19will be used.
20
21No, sorry, you cannot have both ACPI and APM enabled and running at
22once. Some people with broken ACPI or broken APM implementations
23would like to use both to get a full set of working features, but you
24simply cannot mix and match the two. Only one power management
25interface can be in control of the machine at once. Think about it..
26
27User-space Daemons
28------------------
29Both APM and ACPI rely on user-space daemons, apmd and acpid
30respectively, to be completely functional. Obtain both of these
31daemons from your Linux distribution or from the Internet (see below)
32and be sure that they are started sometime in the system boot process.
33Go ahead and start both. If ACPI or APM is not available on your
34system the associated daemon will exit gracefully.
35
36 apmd: http://worldvisions.ca/~apenwarr/apmd/
37 acpid: http://acpid.sf.net/
38
39Driver Interface -- OBSOLETE, DO NOT USE!
40----------------*************************
41
42Note: pm_register(), pm_access(), pm_dev_idle() and friends are
43obsolete. Please do not use them. Instead you should properly hook
44your driver into the driver model, and use its suspend()/resume()
45callbacks to do this kind of stuff.
46
47If you are writing a new driver or maintaining an old driver, it
48should include power management support. Without power management
49support, a single driver may prevent a system with power management
50capabilities from ever being able to suspend (safely).
51
52Overview:
531) Register each instance of a device with "pm_register"
542) Call "pm_access" before accessing the hardware.
55 (this will ensure that the hardware is awake and ready)
563) Your "pm_callback" is called before going into a
57 suspend state (ACPI D1-D3) or after resuming (ACPI D0)
58 from a suspend.
594) Call "pm_dev_idle" when the device is not being used
60 (optional but will improve device idle detection)
615) When unloaded, unregister the device with "pm_unregister"
62
63/*
64 * Description: Register a device with the power-management subsystem
65 *
66 * Parameters:
67 * type - device type (PCI device, system device, ...)
68 * id - instance number or unique identifier
69 * cback - request handler callback (suspend, resume, ...)
70 *
71 * Returns: Registered PM device or NULL on error
72 *
73 * Examples:
74 * dev = pm_register(PM_SYS_DEV, PM_SYS_VGA, vga_callback);
75 *
76 * struct pci_dev *pci_dev = pci_find_dev(...);
77 * dev = pm_register(PM_PCI_DEV, PM_PCI_ID(pci_dev), callback);
78 */
79struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback cback);
80
81/*
82 * Description: Unregister a device with the power management subsystem
83 *
84 * Parameters:
85 * dev - PM device previously returned from pm_register
86 */
87void pm_unregister(struct pm_dev *dev);
88
89/*
90 * Description: Unregister all devices with a matching callback function
91 *
92 * Parameters:
93 * cback - previously registered request callback
94 *
95 * Notes: Provided for easier porting from old APM interface
96 */
97void pm_unregister_all(pm_callback cback);
98
99/*
100 * Power management request callback
101 *
102 * Parameters:
103 * dev - PM device previously returned from pm_register
104 * rqst - request type
105 * data - data, if any, associated with the request
106 *
107 * Returns: 0 if the request is successful
108 * EINVAL if the request is not supported
109 * EBUSY if the device is now busy and cannot handle the request
110 * ENOMEM if the device was unable to handle the request due to memory
111 *
112 * Details: The device request callback will be called before the
113 * device/system enters a suspend state (ACPI D1-D3) or
114 * or after the device/system resumes from suspend (ACPI D0).
115 * For PM_SUSPEND, the ACPI D-state being entered is passed
116 * as the "data" argument to the callback. The device
117 * driver should save (PM_SUSPEND) or restore (PM_RESUME)
118 * device context when the request callback is called.
119 *
120 * Once a driver returns 0 (success) from a suspend
121 * request, it should not process any further requests or
122 * access the device hardware until a call to "pm_access" is made.
123 */
124typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data);
125
126Driver Details
127--------------
128This is just a quick Q&A as a stopgap until a real driver writers'
129power management guide is available.
130
131Q: When is a device suspended?
132
133Devices can be suspended based on direct user request (eg. laptop lid
134closes), system power policy (eg. sleep after 30 minutes of console
135inactivity), or device power policy (eg. power down device after 5
136minutes of inactivity)
137
138Q: Must a driver honor a suspend request?
139
140No, a driver can return -EBUSY from a suspend request and this
141will stop the system from suspending. When a suspend request
142fails, all suspended devices are resumed and the system continues
143to run. Suspend can be retried at a later time.
144
145Q: Can the driver block suspend/resume requests?
146
147Yes, a driver can delay its return from a suspend or resume
148request until the device is ready to handle requests. It
149is advantageous to return as quickly as possible from a
150request as suspend/resume are done serially.
151
152Q: What context is a suspend/resume initiated from?
153
154A suspend or resume is initiated from a kernel thread context.
155It is safe to block, allocate memory, initiate requests
156or anything else you can do within the kernel.
157
158Q: Will requests continue to arrive after a suspend?
159
160Possibly. It is the driver's responsibility to queue(*),
161fail, or drop any requests that arrive after returning
162success to a suspend request. It is important that the
163driver not access its device until after it receives
164a resume request as the device's bus may no longer
165be active.
166
167(*) If a driver queues requests for processing after
168 resume be aware that the device, network, etc.
169 might be in a different state than at suspend time.
170 It's probably better to drop requests unless
171 the driver is a storage device.
172
173Q: Do I have to manage bus-specific power management registers
174
175No. It is the responsibility of the bus driver to manage
176PCI, USB, etc. power management registers. The bus driver
177or the power management subsystem will also enable any
178wake-on functionality that the device has.
179
180Q: So, really, what do I need to do to support suspend/resume?
181
182You need to save any device context that would
183be lost if the device was powered off and then restore
184it at resume time. When ACPI is active, there are
185three levels of device suspend states; D1, D2, and D3.
186(The suspend state is passed as the "data" argument
187to the device callback.) With D3, the device is powered
188off and loses all context, D1 and D2 are shallower power
189states and require less device context to be saved. To
190play it safe, just save everything at suspend and restore
191everything at resume.
192
193Q: Where do I store device context for suspend?
194
195Anywhere in memory, kmalloc a buffer or store it
196in the device descriptor. You are guaranteed that the
197contents of memory will be restored and accessible
198before resume, even when the system suspends to disk.
199
200Q: What do I need to do for ACPI vs. APM vs. etc?
201
202Drivers need not be aware of the specific power management
203technology that is active. They just need to be aware
204of when the overlying power management system requests
205that they suspend or resume.
206
207Q: What about device dependencies?
208
209When a driver registers a device, the power management
210subsystem uses the information provided to build a
211tree of device dependencies (eg. USB device X is on
212USB controller Y which is on PCI bus Z) When power
213management wants to suspend a device, it first sends
214a suspend request to its driver, then the bus driver,
215and so on up to the system bus. Device resumes
216proceed in the opposite direction.
217
218Q: Who do I contact for additional information about
219 enabling power management for my specific driver/device?
220
221ACPI Development mailing list: linux-acpi@vger.kernel.org
222
223System Interface -- OBSOLETE, DO NOT USE!
224----------------*************************
225If you are providing new power management support to Linux (ie.
226adding support for something like APM or ACPI), you should
227communicate with drivers through the existing generic power
228management interface.
229
230/*
231 * Send a request to all devices
232 *
233 * Parameters:
234 * rqst - request type
235 * data - data, if any, associated with the request
236 *
237 * Returns: 0 if the request is successful
238 * See "pm_callback" return for errors
239 *
240 * Details: Walk list of registered devices and call pm_send
241 * for each until complete or an error is encountered.
242 * If an error is encountered for a suspend request,
243 * return all devices to the state they were in before
244 * the suspend request.
245 */
246int pm_send_all(pm_request_t rqst, void *data);
247
248/*
249 * Find a matching device
250 *
251 * Parameters:
252 * type - device type (PCI device, system device, or 0 to match all devices)
253 * from - previous match or NULL to start from the beginning
254 *
255 * Returns: Matching device or NULL if none found
256 */
257struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from);
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt
index 49adb1a33514..c40866e8b957 100644
--- a/Documentation/power/pm_qos_interface.txt
+++ b/Documentation/power/pm_qos_interface.txt
@@ -1,4 +1,4 @@
1PM quality of Service interface. 1PM Quality Of Service Interface.
2 2
3This interface provides a kernel and user mode interface for registering 3This interface provides a kernel and user mode interface for registering
4performance expectations by drivers, subsystems and user space applications on 4performance expectations by drivers, subsystems and user space applications on
@@ -7,6 +7,11 @@ one of the parameters.
7Currently we have {cpu_dma_latency, network_latency, network_throughput} as the 7Currently we have {cpu_dma_latency, network_latency, network_throughput} as the
8initial set of pm_qos parameters. 8initial set of pm_qos parameters.
9 9
10Each parameters have defined units:
11 * latency: usec
12 * timeout: usec
13 * throughput: kbs (kilo bit / sec)
14
10The infrastructure exposes multiple misc device nodes one per implemented 15The infrastructure exposes multiple misc device nodes one per implemented
11parameter. The set of parameters implement is defined by pm_qos_power_init() 16parameter. The set of parameters implement is defined by pm_qos_power_init()
12and pm_qos_params.h. This is done because having the available parameters 17and pm_qos_params.h. This is done because having the available parameters
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index a8686e5a6857..c6cd4956047c 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -101,6 +101,10 @@ of charge when battery became full/empty". It also could mean "value of
101charge when battery considered full/empty at given conditions (temperature, 101charge when battery considered full/empty at given conditions (temperature,
102age)". I.e. these attributes represents real thresholds, not design values. 102age)". I.e. these attributes represents real thresholds, not design values.
103 103
104CHARGE_COUNTER - the current charge counter (in µAh). This could easily
105be negative; there is no empty or full value. It is only useful for
106relative, time-based measurements.
107
104ENERGY_FULL, ENERGY_EMPTY - same as above but for energy. 108ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.
105 109
106CAPACITY - capacity in percents. 110CAPACITY - capacity in percents.
diff --git a/Documentation/power/regulator/consumer.txt b/Documentation/power/regulator/consumer.txt
new file mode 100644
index 000000000000..82b7a43aadba
--- /dev/null
+++ b/Documentation/power/regulator/consumer.txt
@@ -0,0 +1,182 @@
1Regulator Consumer Driver Interface
2===================================
3
4This text describes the regulator interface for consumer device drivers.
5Please see overview.txt for a description of the terms used in this text.
6
7
81. Consumer Regulator Access (static & dynamic drivers)
9=======================================================
10
11A consumer driver can get access to it's supply regulator by calling :-
12
13regulator = regulator_get(dev, "Vcc");
14
15The consumer passes in it's struct device pointer and power supply ID. The core
16then finds the correct regulator by consulting a machine specific lookup table.
17If the lookup is successful then this call will return a pointer to the struct
18regulator that supplies this consumer.
19
20To release the regulator the consumer driver should call :-
21
22regulator_put(regulator);
23
24Consumers can be supplied by more than one regulator e.g. codec consumer with
25analog and digital supplies :-
26
27digital = regulator_get(dev, "Vcc"); /* digital core */
28analog = regulator_get(dev, "Avdd"); /* analog */
29
30The regulator access functions regulator_get() and regulator_put() will
31usually be called in your device drivers probe() and remove() respectively.
32
33
342. Regulator Output Enable & Disable (static & dynamic drivers)
35====================================================================
36
37A consumer can enable it's power supply by calling:-
38
39int regulator_enable(regulator);
40
41NOTE: The supply may already be enabled before regulator_enabled() is called.
42This may happen if the consumer shares the regulator or the regulator has been
43previously enabled by bootloader or kernel board initialization code.
44
45A consumer can determine if a regulator is enabled by calling :-
46
47int regulator_is_enabled(regulator);
48
49This will return > zero when the regulator is enabled.
50
51
52A consumer can disable it's supply when no longer needed by calling :-
53
54int regulator_disable(regulator);
55
56NOTE: This may not disable the supply if it's shared with other consumers. The
57regulator will only be disabled when the enabled reference count is zero.
58
59Finally, a regulator can be forcefully disabled in the case of an emergency :-
60
61int regulator_force_disable(regulator);
62
63NOTE: this will immediately and forcefully shutdown the regulator output. All
64consumers will be powered off.
65
66
673. Regulator Voltage Control & Status (dynamic drivers)
68======================================================
69
70Some consumer drivers need to be able to dynamically change their supply
71voltage to match system operating points. e.g. CPUfreq drivers can scale
72voltage along with frequency to save power, SD drivers may need to select the
73correct card voltage, etc.
74
75Consumers can control their supply voltage by calling :-
76
77int regulator_set_voltage(regulator, min_uV, max_uV);
78
79Where min_uV and max_uV are the minimum and maximum acceptable voltages in
80microvolts.
81
82NOTE: this can be called when the regulator is enabled or disabled. If called
83when enabled, then the voltage changes instantly, otherwise the voltage
84configuration changes and the voltage is physically set when the regulator is
85next enabled.
86
87The regulators configured voltage output can be found by calling :-
88
89int regulator_get_voltage(regulator);
90
91NOTE: get_voltage() will return the configured output voltage whether the
92regulator is enabled or disabled and should NOT be used to determine regulator
93output state. However this can be used in conjunction with is_enabled() to
94determine the regulator physical output voltage.
95
96
974. Regulator Current Limit Control & Status (dynamic drivers)
98===========================================================
99
100Some consumer drivers need to be able to dynamically change their supply
101current limit to match system operating points. e.g. LCD backlight driver can
102change the current limit to vary the backlight brightness, USB drivers may want
103to set the limit to 500mA when supplying power.
104
105Consumers can control their supply current limit by calling :-
106
107int regulator_set_current_limit(regulator, min_uV, max_uV);
108
109Where min_uA and max_uA are the minimum and maximum acceptable current limit in
110microamps.
111
112NOTE: this can be called when the regulator is enabled or disabled. If called
113when enabled, then the current limit changes instantly, otherwise the current
114limit configuration changes and the current limit is physically set when the
115regulator is next enabled.
116
117A regulators current limit can be found by calling :-
118
119int regulator_get_current_limit(regulator);
120
121NOTE: get_current_limit() will return the current limit whether the regulator
122is enabled or disabled and should not be used to determine regulator current
123load.
124
125
1265. Regulator Operating Mode Control & Status (dynamic drivers)
127=============================================================
128
129Some consumers can further save system power by changing the operating mode of
130their supply regulator to be more efficient when the consumers operating state
131changes. e.g. consumer driver is idle and subsequently draws less current
132
133Regulator operating mode can be changed indirectly or directly.
134
135Indirect operating mode control.
136--------------------------------
137Consumer drivers can request a change in their supply regulator operating mode
138by calling :-
139
140int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
141
142This will cause the core to recalculate the total load on the regulator (based
143on all it's consumers) and change operating mode (if necessary and permitted)
144to best match the current operating load.
145
146The load_uA value can be determined from the consumers datasheet. e.g.most
147datasheets have tables showing the max current consumed in certain situations.
148
149Most consumers will use indirect operating mode control since they have no
150knowledge of the regulator or whether the regulator is shared with other
151consumers.
152
153Direct operating mode control.
154------------------------------
155Bespoke or tightly coupled drivers may want to directly control regulator
156operating mode depending on their operating point. This can be achieved by
157calling :-
158
159int regulator_set_mode(struct regulator *regulator, unsigned int mode);
160unsigned int regulator_get_mode(struct regulator *regulator);
161
162Direct mode will only be used by consumers that *know* about the regulator and
163are not sharing the regulator with other consumers.
164
165
1666. Regulator Events
167===================
168Regulators can notify consumers of external events. Events could be received by
169consumers under regulator stress or failure conditions.
170
171Consumers can register interest in regulator events by calling :-
172
173int regulator_register_notifier(struct regulator *regulator,
174 struct notifier_block *nb);
175
176Consumers can uregister interest by calling :-
177
178int regulator_unregister_notifier(struct regulator *regulator,
179 struct notifier_block *nb);
180
181Regulators use the kernel notifier framework to send event to thier interested
182consumers.
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt
new file mode 100644
index 000000000000..c9a35665cf70
--- /dev/null
+++ b/Documentation/power/regulator/machine.txt
@@ -0,0 +1,101 @@
1Regulator Machine Driver Interface
2===================================
3
4The regulator machine driver interface is intended for board/machine specific
5initialisation code to configure the regulator subsystem. Typical things that
6machine drivers would do are :-
7
8 1. Regulator -> Device mapping.
9 2. Regulator supply configuration.
10 3. Power Domain constraint setting.
11
12
13
141. Regulator -> device mapping
15==============================
16Consider the following machine :-
17
18 Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
19 |
20 +-> [Consumer B @ 3.3V]
21
22The drivers for consumers A & B must be mapped to the correct regulator in
23order to control their power supply. This mapping can be achieved in machine
24initialisation code by calling :-
25
26int regulator_set_device_supply(const char *regulator, struct device *dev,
27 const char *supply);
28
29and is shown with the following code :-
30
31regulator_set_device_supply("Regulator-1", devB, "Vcc");
32regulator_set_device_supply("Regulator-2", devA, "Vcc");
33
34This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
35to the 'Vcc' supply for Consumer A.
36
37
382. Regulator supply configuration.
39==================================
40Consider the following machine (again) :-
41
42 Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
43 |
44 +-> [Consumer B @ 3.3V]
45
46Regulator-1 supplies power to Regulator-2. This relationship must be registered
47with the core so that Regulator-1 is also enabled when Consumer A enables it's
48supply (Regulator-2).
49
50This relationship can be register with the core via :-
51
52int regulator_set_supply(const char *regulator, const char *regulator_supply);
53
54In this example we would use the following code :-
55
56regulator_set_supply("Regulator-2", "Regulator-1");
57
58Relationships can be queried by calling :-
59
60const char *regulator_get_supply(const char *regulator);
61
62
633. Power Domain constraint setting.
64===================================
65Each power domain within a system has physical constraints on voltage and
66current. This must be defined in software so that the power domain is always
67operated within specifications.
68
69Consider the following machine (again) :-
70
71 Regulator-1 -+-> Regulator-2 --> [Consumer A @ 1.8 - 2.0V]
72 |
73 +-> [Consumer B @ 3.3V]
74
75This gives us two regulators and two power domains:
76
77 Domain 1: Regulator-2, Consumer B.
78 Domain 2: Consumer A.
79
80Constraints can be registered by calling :-
81
82int regulator_set_platform_constraints(const char *regulator,
83 struct regulation_constraints *constraints);
84
85The example is defined as follows :-
86
87struct regulation_constraints domain_1 = {
88 .min_uV = 3300000,
89 .max_uV = 3300000,
90 .valid_modes_mask = REGULATOR_MODE_NORMAL,
91};
92
93struct regulation_constraints domain_2 = {
94 .min_uV = 1800000,
95 .max_uV = 2000000,
96 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
97 .valid_modes_mask = REGULATOR_MODE_NORMAL,
98};
99
100regulator_set_platform_constraints("Regulator-1", &domain_1);
101regulator_set_platform_constraints("Regulator-2", &domain_2);
diff --git a/Documentation/power/regulator/overview.txt b/Documentation/power/regulator/overview.txt
new file mode 100644
index 000000000000..bdcb332bd7fb
--- /dev/null
+++ b/Documentation/power/regulator/overview.txt
@@ -0,0 +1,171 @@
1Linux voltage and current regulator framework
2=============================================
3
4About
5=====
6
7This framework is designed to provide a standard kernel interface to control
8voltage and current regulators.
9
10The intention is to allow systems to dynamically control regulator power output
11in order to save power and prolong battery life. This applies to both voltage
12regulators (where voltage output is controllable) and current sinks (where
13current limit is controllable).
14
15(C) 2008 Wolfson Microelectronics PLC.
16Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
17
18
19Nomenclature
20============
21
22Some terms used in this document:-
23
24 o Regulator - Electronic device that supplies power to other devices.
25 Most regulators can enable and disable their output whilst
26 some can control their output voltage and or current.
27
28 Input Voltage -> Regulator -> Output Voltage
29
30
31 o PMIC - Power Management IC. An IC that contains numerous regulators
32 and often contains other susbsystems.
33
34
35 o Consumer - Electronic device that is supplied power by a regulator.
36 Consumers can be classified into two types:-
37
38 Static: consumer does not change it's supply voltage or
39 current limit. It only needs to enable or disable it's
40 power supply. It's supply voltage is set by the hardware,
41 bootloader, firmware or kernel board initialisation code.
42
43 Dynamic: consumer needs to change it's supply voltage or
44 current limit to meet operation demands.
45
46
47 o Power Domain - Electronic circuit that is supplied it's input power by the
48 output power of a regulator, switch or by another power
49 domain.
50
51 The supply regulator may be behind a switch(s). i.e.
52
53 Regulator -+-> Switch-1 -+-> Switch-2 --> [Consumer A]
54 | |
55 | +-> [Consumer B], [Consumer C]
56 |
57 +-> [Consumer D], [Consumer E]
58
59 That is one regulator and three power domains:
60
61 Domain 1: Switch-1, Consumers D & E.
62 Domain 2: Switch-2, Consumers B & C.
63 Domain 3: Consumer A.
64
65 and this represents a "supplies" relationship:
66
67 Domain-1 --> Domain-2 --> Domain-3.
68
69 A power domain may have regulators that are supplied power
70 by other regulators. i.e.
71
72 Regulator-1 -+-> Regulator-2 -+-> [Consumer A]
73 |
74 +-> [Consumer B]
75
76 This gives us two regulators and two power domains:
77
78 Domain 1: Regulator-2, Consumer B.
79 Domain 2: Consumer A.
80
81 and a "supplies" relationship:
82
83 Domain-1 --> Domain-2
84
85
86 o Constraints - Constraints are used to define power levels for performance
87 and hardware protection. Constraints exist at three levels:
88
89 Regulator Level: This is defined by the regulator hardware
90 operating parameters and is specified in the regulator
91 datasheet. i.e.
92
93 - voltage output is in the range 800mV -> 3500mV.
94 - regulator current output limit is 20mA @ 5V but is
95 10mA @ 10V.
96
97 Power Domain Level: This is defined in software by kernel
98 level board initialisation code. It is used to constrain a
99 power domain to a particular power range. i.e.
100
101 - Domain-1 voltage is 3300mV
102 - Domain-2 voltage is 1400mV -> 1600mV
103 - Domain-3 current limit is 0mA -> 20mA.
104
105 Consumer Level: This is defined by consumer drivers
106 dynamically setting voltage or current limit levels.
107
108 e.g. a consumer backlight driver asks for a current increase
109 from 5mA to 10mA to increase LCD illumination. This passes
110 to through the levels as follows :-
111
112 Consumer: need to increase LCD brightness. Lookup and
113 request next current mA value in brightness table (the
114 consumer driver could be used on several different
115 personalities based upon the same reference device).
116
117 Power Domain: is the new current limit within the domain
118 operating limits for this domain and system state (e.g.
119 battery power, USB power)
120
121 Regulator Domains: is the new current limit within the
122 regulator operating parameters for input/ouput voltage.
123
124 If the regulator request passes all the constraint tests
125 then the new regulator value is applied.
126
127
128Design
129======
130
131The framework is designed and targeted at SoC based devices but may also be
132relevant to non SoC devices and is split into the following four interfaces:-
133
134
135 1. Consumer driver interface.
136
137 This uses a similar API to the kernel clock interface in that consumer
138 drivers can get and put a regulator (like they can with clocks atm) and
139 get/set voltage, current limit, mode, enable and disable. This should
140 allow consumers complete control over their supply voltage and current
141 limit. This also compiles out if not in use so drivers can be reused in
142 systems with no regulator based power control.
143
144 See Documentation/power/regulator/consumer.txt
145
146 2. Regulator driver interface.
147
148 This allows regulator drivers to register their regulators and provide
149 operations to the core. It also has a notifier call chain for propagating
150 regulator events to clients.
151
152 See Documentation/power/regulator/regulator.txt
153
154 3. Machine interface.
155
156 This interface is for machine specific code and allows the creation of
157 voltage/current domains (with constraints) for each regulator. It can
158 provide regulator constraints that will prevent device damage through
159 overvoltage or over current caused by buggy client drivers. It also
160 allows the creation of a regulator tree whereby some regulators are
161 supplied by others (similar to a clock tree).
162
163 See Documentation/power/regulator/machine.txt
164
165 4. Userspace ABI.
166
167 The framework also exports a lot of useful voltage/current/opmode data to
168 userspace via sysfs. This could be used to help monitor device power
169 consumption and status.
170
171 See Documentation/ABI/testing/regulator-sysfs.txt
diff --git a/Documentation/power/regulator/regulator.txt b/Documentation/power/regulator/regulator.txt
new file mode 100644
index 000000000000..a69050143592
--- /dev/null
+++ b/Documentation/power/regulator/regulator.txt
@@ -0,0 +1,30 @@
1Regulator Driver Interface
2==========================
3
4The regulator driver interface is relatively simple and designed to allow
5regulator drivers to register their services with the core framework.
6
7
8Registration
9============
10
11Drivers can register a regulator by calling :-
12
13struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
14 void *reg_data);
15
16This will register the regulators capabilities and operations the regulator
17core. The core does not touch reg_data (private to regulator driver).
18
19Regulators can be unregistered by calling :-
20
21void regulator_unregister(struct regulator_dev *rdev);
22
23
24Regulator Events
25================
26Regulators can send events (e.g. over temp, under voltage, etc) to consumer
27drivers by calling :-
28
29int regulator_notifier_call_chain(struct regulator_dev *rdev,
30 unsigned long event, void *data);
diff --git a/Documentation/powerpc/00-INDEX b/Documentation/powerpc/00-INDEX
index 3be84aa38dfe..29d839ce7327 100644
--- a/Documentation/powerpc/00-INDEX
+++ b/Documentation/powerpc/00-INDEX
@@ -20,8 +20,6 @@ mpc52xx-device-tree-bindings.txt
20 - MPC5200 Device Tree Bindings 20 - MPC5200 Device Tree Bindings
21ppc_htab.txt 21ppc_htab.txt
22 - info about the Linux/PPC /proc/ppc_htab entry 22 - info about the Linux/PPC /proc/ppc_htab entry
23SBC8260_memory_mapping.txt
24 - EST SBC8260 board info
25smp.txt 23smp.txt
26 - use and state info about Linux/PPC on MP machines 24 - use and state info about Linux/PPC on MP machines
27sound.txt 25sound.txt
diff --git a/Documentation/powerpc/SBC8260_memory_mapping.txt b/Documentation/powerpc/SBC8260_memory_mapping.txt
deleted file mode 100644
index e6e9ee0506c3..000000000000
--- a/Documentation/powerpc/SBC8260_memory_mapping.txt
+++ /dev/null
@@ -1,197 +0,0 @@
1Please mail me (Jon Diekema, diekema_jon@si.com or diekema@cideas.com)
2if you have questions, comments or corrections.
3
4 * EST SBC8260 Linux memory mapping rules
5
6 http://www.estc.com/
7 http://www.estc.com/products/boards/SBC8260-8240_ds.html
8
9 Initial conditions:
10 -------------------
11
12 Tasks that need to be perform by the boot ROM before control is
13 transferred to zImage (compressed Linux kernel):
14
15 - Define the IMMR to 0xf0000000
16
17 - Initialize the memory controller so that RAM is available at
18 physical address 0x00000000. On the SBC8260 is this 16M (64M)
19 SDRAM.
20
21 - The boot ROM should only clear the RAM that it is using.
22
23 The reason for doing this is to enhances the chances of a
24 successful post mortem on a Linux panic. One of the first
25 items to examine is the 16k (LOG_BUF_LEN) circular console
26 buffer called log_buf which is defined in kernel/printk.c.
27
28 - To enhance boot ROM performance, the I-cache can be enabled.
29
30 Date: Mon, 22 May 2000 14:21:10 -0700
31 From: Neil Russell <caret@c-side.com>
32
33 LiMon (LInux MONitor) runs with and starts Linux with MMU
34 off, I-cache enabled, D-cache disabled. The I-cache doesn't
35 need hints from the MMU to work correctly as the D-cache
36 does. No D-cache means no special code to handle devices in
37 the presence of cache (no snooping, etc). The use of the
38 I-cache means that the monitor can run acceptably fast
39 directly from ROM, rather than having to copy it to RAM.
40
41 - Build the board information structure (see
42 include/asm-ppc/est8260.h for its definition)
43
44 - The compressed Linux kernel (zImage) contains a bootstrap loader
45 that is position independent; you can load it into any RAM,
46 ROM or FLASH memory address >= 0x00500000 (above 5 MB), or
47 at its link address of 0x00400000 (4 MB).
48
49 Note: If zImage is loaded at its link address of 0x00400000 (4 MB),
50 then zImage will skip the step of moving itself to
51 its link address.
52
53 - Load R3 with the address of the board information structure
54
55 - Transfer control to zImage
56
57 - The Linux console port is SMC1, and the baud rate is controlled
58 from the bi_baudrate field of the board information structure.
59 On thing to keep in mind when picking the baud rate, is that
60 there is no flow control on the SMC ports. I would stick
61 with something safe and standard like 19200.
62
63 On the EST SBC8260, the SMC1 port is on the COM1 connector of
64 the board.
65
66
67 EST SBC8260 defaults:
68 ---------------------
69
70 Chip
71 Memory Sel Bus Use
72 --------------------- --- --- ----------------------------------
73 0x00000000-0x03FFFFFF CS2 60x (16M or 64M)/64M SDRAM
74 0x04000000-0x04FFFFFF CS4 local 4M/16M SDRAM (soldered to the board)
75 0x21000000-0x21000000 CS7 60x 1B/64K Flash present detect (from the flash SIMM)
76 0x21000001-0x21000001 CS7 60x 1B/64K Switches (read) and LEDs (write)
77 0x22000000-0x2200FFFF CS5 60x 8K/64K EEPROM
78 0xFC000000-0xFCFFFFFF CS6 60x 2M/16M flash (8 bits wide, soldered to the board)
79 0xFE000000-0xFFFFFFFF CS0 60x 4M/16M flash (SIMM)
80
81 Notes:
82 ------
83
84 - The chip selects can map 32K blocks and up (powers of 2)
85
86 - The SDRAM machine can handled up to 128Mbytes per chip select
87
88 - Linux uses the 60x bus memory (the SDRAM DIMM) for the
89 communications buffers.
90
91 - BATs can map 128K-256Mbytes each. There are four data BATs and
92 four instruction BATs. Generally the data and instruction BATs
93 are mapped the same.
94
95 - The IMMR must be set above the kernel virtual memory addresses,
96 which start at 0xC0000000. Otherwise, the kernel may crash as
97 soon as you start any threads or processes due to VM collisions
98 in the kernel or user process space.
99
100
101 Details from Dan Malek <dan_malek@mvista.com> on 10/29/1999:
102
103 The user application virtual space consumes the first 2 Gbytes
104 (0x00000000 to 0x7FFFFFFF). The kernel virtual text starts at
105 0xC0000000, with data following. There is a "protection hole"
106 between the end of kernel data and the start of the kernel
107 dynamically allocated space, but this space is still within
108 0xCxxxxxxx.
109
110 Obviously the kernel can't map any physical addresses 1:1 in
111 these ranges.
112
113
114 Details from Dan Malek <dan_malek@mvista.com> on 5/19/2000:
115
116 During the early kernel initialization, the kernel virtual
117 memory allocator is not operational. Prior to this KVM
118 initialization, we choose to map virtual to physical addresses
119 1:1. That is, the kernel virtual address exactly matches the
120 physical address on the bus. These mappings are typically done
121 in arch/ppc/kernel/head.S, or arch/ppc/mm/init.c. Only
122 absolutely necessary mappings should be done at this time, for
123 example board control registers or a serial uart. Normal device
124 driver initialization should map resources later when necessary.
125
126 Although platform dependent, and certainly the case for embedded
127 8xx, traditionally memory is mapped at physical address zero,
128 and I/O devices above physical address 0x80000000. The lowest
129 and highest (above 0xf0000000) I/O addresses are traditionally
130 used for devices or registers we need to map during kernel
131 initialization and prior to KVM operation. For this reason,
132 and since it followed prior PowerPC platform examples, I chose
133 to map the embedded 8xx kernel to the 0xc0000000 virtual address.
134 This way, we can enable the MMU to map the kernel for proper
135 operation, and still map a few windows before the KVM is operational.
136
137 On some systems, you could possibly run the kernel at the
138 0x80000000 or any other virtual address. It just depends upon
139 mapping that must be done prior to KVM operational. You can never
140 map devices or kernel spaces that overlap with the user virtual
141 space. This is why default IMMR mapping used by most BDM tools
142 won't work. They put the IMMR at something like 0x10000000 or
143 0x02000000 for example. You simply can't map these addresses early
144 in the kernel, and continue proper system operation.
145
146 The embedded 8xx/82xx kernel is mature enough that all you should
147 need to do is map the IMMR someplace at or above 0xf0000000 and it
148 should boot far enough to get serial console messages and KGDB
149 connected on any platform. There are lots of other subtle memory
150 management design features that you simply don't need to worry
151 about. If you are changing functions related to MMU initialization,
152 you are likely breaking things that are known to work and are
153 heading down a path of disaster and frustration. Your changes
154 should be to make the flexibility of the processor fit Linux,
155 not force arbitrary and non-workable memory mappings into Linux.
156
157 - You don't want to change KERNELLOAD or KERNELBASE, otherwise the
158 virtual memory and MMU code will get confused.
159
160 arch/ppc/Makefile:KERNELLOAD = 0xc0000000
161
162 include/asm-ppc/page.h:#define PAGE_OFFSET 0xc0000000
163 include/asm-ppc/page.h:#define KERNELBASE PAGE_OFFSET
164
165 - RAM is at physical address 0x00000000, and gets mapped to
166 virtual address 0xC0000000 for the kernel.
167
168
169 Physical addresses used by the Linux kernel:
170 --------------------------------------------
171
172 0x00000000-0x3FFFFFFF 1GB reserved for RAM
173 0xF0000000-0xF001FFFF 128K IMMR 64K used for dual port memory,
174 64K for 8260 registers
175
176
177 Logical addresses used by the Linux kernel:
178 -------------------------------------------
179
180 0xF0000000-0xFFFFFFFF 256M BAT0 (IMMR: dual port RAM, registers)
181 0xE0000000-0xEFFFFFFF 256M BAT1 (I/O space for custom boards)
182 0xC0000000-0xCFFFFFFF 256M BAT2 (RAM)
183 0xD0000000-0xDFFFFFFF 256M BAT3 (if RAM > 256MByte)
184
185
186 EST SBC8260 Linux mapping:
187 --------------------------
188
189 DBAT0, IBAT0, cache inhibited:
190
191 Chip
192 Memory Sel Use
193 --------------------- --- ---------------------------------
194 0xF0000000-0xF001FFFF n/a IMMR: dual port RAM, registers
195
196 DBAT1, IBAT1, cache inhibited:
197
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 1d2a772506cf..de4063cb4fdc 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -58,6 +58,8 @@ Table of Contents
58 o) Xilinx IP cores 58 o) Xilinx IP cores
59 p) Freescale Synchronous Serial Interface 59 p) Freescale Synchronous Serial Interface
60 q) USB EHCI controllers 60 q) USB EHCI controllers
61 r) MDIO on GPIOs
62 s) SPI busses
61 63
62 VII - Marvell Discovery mv64[345]6x System Controller chips 64 VII - Marvell Discovery mv64[345]6x System Controller chips
63 1) The /system-controller node 65 1) The /system-controller node
@@ -88,10 +90,12 @@ Table of Contents
88 3) OpenPIC Interrupt Controllers 90 3) OpenPIC Interrupt Controllers
89 4) ISA Interrupt Controllers 91 4) ISA Interrupt Controllers
90 92
91 VIII - Specifying GPIO information for devices 93 IX - Specifying GPIO information for devices
92 1) gpios property 94 1) gpios property
93 2) gpio-controller nodes 95 2) gpio-controller nodes
94 96
97 X - Specifying device power management information (sleep property)
98
95 Appendix A - Sample SOC node for MPC8540 99 Appendix A - Sample SOC node for MPC8540
96 100
97 101
@@ -274,7 +278,7 @@ it with special cases.
274 a 64-bit platform. 278 a 64-bit platform.
275 279
276 d) request and get assigned a platform number (see PLATFORM_* 280 d) request and get assigned a platform number (see PLATFORM_*
277 constants in include/asm-powerpc/processor.h 281 constants in arch/powerpc/include/asm/processor.h
278 282
27932-bit embedded kernels: 28332-bit embedded kernels:
280 284
@@ -336,7 +340,7 @@ the block to RAM before passing it to the kernel.
336--------- 340---------
337 341
338 The kernel is entered with r3 pointing to an area of memory that is 342 The kernel is entered with r3 pointing to an area of memory that is
339 roughly described in include/asm-powerpc/prom.h by the structure 343 roughly described in arch/powerpc/include/asm/prom.h by the structure
340 boot_param_header: 344 boot_param_header:
341 345
342struct boot_param_header { 346struct boot_param_header {
@@ -704,7 +708,7 @@ device or bus to be described by the device tree.
704In general, the format of an address for a device is defined by the 708In general, the format of an address for a device is defined by the
705parent bus type, based on the #address-cells and #size-cells 709parent bus type, based on the #address-cells and #size-cells
706properties. Note that the parent's parent definitions of #address-cells 710properties. Note that the parent's parent definitions of #address-cells
707and #size-cells are not inhereted so every node with children must specify 711and #size-cells are not inherited so every node with children must specify
708them. The kernel requires the root node to have those properties defining 712them. The kernel requires the root node to have those properties defining
709addresses format for devices directly mapped on the processor bus. 713addresses format for devices directly mapped on the processor bus.
710 714
@@ -1246,80 +1250,7 @@ descriptions for the SOC devices for which new nodes have been
1246defined; this list will expand as more and more SOC-containing 1250defined; this list will expand as more and more SOC-containing
1247platforms are moved over to use the flattened-device-tree model. 1251platforms are moved over to use the flattened-device-tree model.
1248 1252
1249 a) MDIO IO device 1253 a) PHY nodes
1250
1251 The MDIO is a bus to which the PHY devices are connected. For each
1252 device that exists on this bus, a child node should be created. See
1253 the definition of the PHY node below for an example of how to define
1254 a PHY.
1255
1256 Required properties:
1257 - reg : Offset and length of the register set for the device
1258 - compatible : Should define the compatible device type for the
1259 mdio. Currently, this is most likely to be "fsl,gianfar-mdio"
1260
1261 Example:
1262
1263 mdio@24520 {
1264 reg = <24520 20>;
1265 compatible = "fsl,gianfar-mdio";
1266
1267 ethernet-phy@0 {
1268 ......
1269 };
1270 };
1271
1272
1273 b) Gianfar-compatible ethernet nodes
1274
1275 Required properties:
1276
1277 - device_type : Should be "network"
1278 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
1279 - compatible : Should be "gianfar"
1280 - reg : Offset and length of the register set for the device
1281 - mac-address : List of bytes representing the ethernet address of
1282 this controller
1283 - interrupts : <a b> where a is the interrupt number and b is a
1284 field that represents an encoding of the sense and level
1285 information for the interrupt. This should be encoded based on
1286 the information in section 2) depending on the type of interrupt
1287 controller you have.
1288 - interrupt-parent : the phandle for the interrupt controller that
1289 services interrupts for this device.
1290 - phy-handle : The phandle for the PHY connected to this ethernet
1291 controller.
1292 - fixed-link : <a b c d e> where a is emulated phy id - choose any,
1293 but unique to the all specified fixed-links, b is duplex - 0 half,
1294 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
1295 pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
1296
1297 Recommended properties:
1298
1299 - phy-connection-type : a string naming the controller/PHY interface type,
1300 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
1301 "tbi", or "rtbi". This property is only really needed if the connection
1302 is of type "rgmii-id", as all other connection types are detected by
1303 hardware.
1304
1305
1306 Example:
1307
1308 ethernet@24000 {
1309 #size-cells = <0>;
1310 device_type = "network";
1311 model = "TSEC";
1312 compatible = "gianfar";
1313 reg = <24000 1000>;
1314 mac-address = [ 00 E0 0C 00 73 00 ];
1315 interrupts = <d 3 e 3 12 3>;
1316 interrupt-parent = <40000>;
1317 phy-handle = <2452000>
1318 };
1319
1320
1321
1322 c) PHY nodes
1323 1254
1324 Required properties: 1255 Required properties:
1325 1256
@@ -1347,7 +1278,7 @@ platforms are moved over to use the flattened-device-tree model.
1347 }; 1278 };
1348 1279
1349 1280
1350 d) Interrupt controllers 1281 b) Interrupt controllers
1351 1282
1352 Some SOC devices contain interrupt controllers that are different 1283 Some SOC devices contain interrupt controllers that are different
1353 from the standard Open PIC specification. The SOC device nodes for 1284 from the standard Open PIC specification. The SOC device nodes for
@@ -1360,491 +1291,14 @@ platforms are moved over to use the flattened-device-tree model.
1360 1291
1361 pic@40000 { 1292 pic@40000 {
1362 linux,phandle = <40000>; 1293 linux,phandle = <40000>;
1363 clock-frequency = <0>;
1364 interrupt-controller; 1294 interrupt-controller;
1365 #address-cells = <0>; 1295 #address-cells = <0>;
1366 reg = <40000 40000>; 1296 reg = <40000 40000>;
1367 built-in;
1368 compatible = "chrp,open-pic"; 1297 compatible = "chrp,open-pic";
1369 device_type = "open-pic"; 1298 device_type = "open-pic";
1370 big-endian;
1371 }; 1299 };
1372 1300
1373 1301 c) CFI or JEDEC memory-mapped NOR flash
1374 e) I2C
1375
1376 Required properties :
1377
1378 - device_type : Should be "i2c"
1379 - reg : Offset and length of the register set for the device
1380
1381 Recommended properties :
1382
1383 - compatible : Should be "fsl-i2c" for parts compatible with
1384 Freescale I2C specifications.
1385 - interrupts : <a b> where a is the interrupt number and b is a
1386 field that represents an encoding of the sense and level
1387 information for the interrupt. This should be encoded based on
1388 the information in section 2) depending on the type of interrupt
1389 controller you have.
1390 - interrupt-parent : the phandle for the interrupt controller that
1391 services interrupts for this device.
1392 - dfsrr : boolean; if defined, indicates that this I2C device has
1393 a digital filter sampling rate register
1394 - fsl5200-clocking : boolean; if defined, indicated that this device
1395 uses the FSL 5200 clocking mechanism.
1396
1397 Example :
1398
1399 i2c@3000 {
1400 interrupt-parent = <40000>;
1401 interrupts = <1b 3>;
1402 reg = <3000 18>;
1403 device_type = "i2c";
1404 compatible = "fsl-i2c";
1405 dfsrr;
1406 };
1407
1408
1409 f) Freescale SOC USB controllers
1410
1411 The device node for a USB controller that is part of a Freescale
1412 SOC is as described in the document "Open Firmware Recommended
1413 Practice : Universal Serial Bus" with the following modifications
1414 and additions :
1415
1416 Required properties :
1417 - compatible : Should be "fsl-usb2-mph" for multi port host USB
1418 controllers, or "fsl-usb2-dr" for dual role USB controllers
1419 - phy_type : For multi port host USB controllers, should be one of
1420 "ulpi", or "serial". For dual role USB controllers, should be
1421 one of "ulpi", "utmi", "utmi_wide", or "serial".
1422 - reg : Offset and length of the register set for the device
1423 - port0 : boolean; if defined, indicates port0 is connected for
1424 fsl-usb2-mph compatible controllers. Either this property or
1425 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
1426 controllers.
1427 - port1 : boolean; if defined, indicates port1 is connected for
1428 fsl-usb2-mph compatible controllers. Either this property or
1429 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
1430 controllers.
1431 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
1432 controllers. Can be "host", "peripheral", or "otg". Default to
1433 "host" if not defined for backward compatibility.
1434
1435 Recommended properties :
1436 - interrupts : <a b> where a is the interrupt number and b is a
1437 field that represents an encoding of the sense and level
1438 information for the interrupt. This should be encoded based on
1439 the information in section 2) depending on the type of interrupt
1440 controller you have.
1441 - interrupt-parent : the phandle for the interrupt controller that
1442 services interrupts for this device.
1443
1444 Example multi port host USB controller device node :
1445 usb@22000 {
1446 compatible = "fsl-usb2-mph";
1447 reg = <22000 1000>;
1448 #address-cells = <1>;
1449 #size-cells = <0>;
1450 interrupt-parent = <700>;
1451 interrupts = <27 1>;
1452 phy_type = "ulpi";
1453 port0;
1454 port1;
1455 };
1456
1457 Example dual role USB controller device node :
1458 usb@23000 {
1459 compatible = "fsl-usb2-dr";
1460 reg = <23000 1000>;
1461 #address-cells = <1>;
1462 #size-cells = <0>;
1463 interrupt-parent = <700>;
1464 interrupts = <26 1>;
1465 dr_mode = "otg";
1466 phy = "ulpi";
1467 };
1468
1469
1470 g) Freescale SOC SEC Security Engines
1471
1472 Required properties:
1473
1474 - device_type : Should be "crypto"
1475 - model : Model of the device. Should be "SEC1" or "SEC2"
1476 - compatible : Should be "talitos"
1477 - reg : Offset and length of the register set for the device
1478 - interrupts : <a b> where a is the interrupt number and b is a
1479 field that represents an encoding of the sense and level
1480 information for the interrupt. This should be encoded based on
1481 the information in section 2) depending on the type of interrupt
1482 controller you have.
1483 - interrupt-parent : the phandle for the interrupt controller that
1484 services interrupts for this device.
1485 - num-channels : An integer representing the number of channels
1486 available.
1487 - channel-fifo-len : An integer representing the number of
1488 descriptor pointers each channel fetch fifo can hold.
1489 - exec-units-mask : The bitmask representing what execution units
1490 (EUs) are available. It's a single 32-bit cell. EU information
1491 should be encoded following the SEC's Descriptor Header Dword
1492 EU_SEL0 field documentation, i.e. as follows:
1493
1494 bit 0 = reserved - should be 0
1495 bit 1 = set if SEC has the ARC4 EU (AFEU)
1496 bit 2 = set if SEC has the DES/3DES EU (DEU)
1497 bit 3 = set if SEC has the message digest EU (MDEU)
1498 bit 4 = set if SEC has the random number generator EU (RNG)
1499 bit 5 = set if SEC has the public key EU (PKEU)
1500 bit 6 = set if SEC has the AES EU (AESU)
1501 bit 7 = set if SEC has the Kasumi EU (KEU)
1502
1503 bits 8 through 31 are reserved for future SEC EUs.
1504
1505 - descriptor-types-mask : The bitmask representing what descriptors
1506 are available. It's a single 32-bit cell. Descriptor type
1507 information should be encoded following the SEC's Descriptor
1508 Header Dword DESC_TYPE field documentation, i.e. as follows:
1509
1510 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
1511 bit 1 = set if SEC supports the ipsec_esp descriptor type
1512 bit 2 = set if SEC supports the common_nonsnoop desc. type
1513 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
1514 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
1515 bit 5 = set if SEC supports the srtp descriptor type
1516 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
1517 bit 7 = set if SEC supports the pkeu_assemble descriptor type
1518 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
1519 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
1520 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
1521 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
1522
1523 ..and so on and so forth.
1524
1525 Example:
1526
1527 /* MPC8548E */
1528 crypto@30000 {
1529 device_type = "crypto";
1530 model = "SEC2";
1531 compatible = "talitos";
1532 reg = <30000 10000>;
1533 interrupts = <1d 3>;
1534 interrupt-parent = <40000>;
1535 num-channels = <4>;
1536 channel-fifo-len = <18>;
1537 exec-units-mask = <000000fe>;
1538 descriptor-types-mask = <012b0ebf>;
1539 };
1540
1541 h) Board Control and Status (BCSR)
1542
1543 Required properties:
1544
1545 - device_type : Should be "board-control"
1546 - reg : Offset and length of the register set for the device
1547
1548 Example:
1549
1550 bcsr@f8000000 {
1551 device_type = "board-control";
1552 reg = <f8000000 8000>;
1553 };
1554
1555 i) Freescale QUICC Engine module (QE)
1556 This represents qe module that is installed on PowerQUICC II Pro.
1557
1558 NOTE: This is an interim binding; it should be updated to fit
1559 in with the CPM binding later in this document.
1560
1561 Basically, it is a bus of devices, that could act more or less
1562 as a complete entity (UCC, USB etc ). All of them should be siblings on
1563 the "root" qe node, using the common properties from there.
1564 The description below applies to the qe of MPC8360 and
1565 more nodes and properties would be extended in the future.
1566
1567 i) Root QE device
1568
1569 Required properties:
1570 - compatible : should be "fsl,qe";
1571 - model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
1572 - reg : offset and length of the device registers.
1573 - bus-frequency : the clock frequency for QUICC Engine.
1574
1575 Recommended properties
1576 - brg-frequency : the internal clock source frequency for baud-rate
1577 generators in Hz.
1578
1579 Example:
1580 qe@e0100000 {
1581 #address-cells = <1>;
1582 #size-cells = <1>;
1583 #interrupt-cells = <2>;
1584 compatible = "fsl,qe";
1585 ranges = <0 e0100000 00100000>;
1586 reg = <e0100000 480>;
1587 brg-frequency = <0>;
1588 bus-frequency = <179A7B00>;
1589 }
1590
1591
1592 ii) SPI (Serial Peripheral Interface)
1593
1594 Required properties:
1595 - cell-index : SPI controller index.
1596 - compatible : should be "fsl,spi".
1597 - mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
1598 - reg : Offset and length of the register set for the device
1599 - interrupts : <a b> where a is the interrupt number and b is a
1600 field that represents an encoding of the sense and level
1601 information for the interrupt. This should be encoded based on
1602 the information in section 2) depending on the type of interrupt
1603 controller you have.
1604 - interrupt-parent : the phandle for the interrupt controller that
1605 services interrupts for this device.
1606
1607 Example:
1608 spi@4c0 {
1609 cell-index = <0>;
1610 compatible = "fsl,spi";
1611 reg = <4c0 40>;
1612 interrupts = <82 0>;
1613 interrupt-parent = <700>;
1614 mode = "cpu";
1615 };
1616
1617
1618 iii) USB (Universal Serial Bus Controller)
1619
1620 Required properties:
1621 - compatible : could be "qe_udc" or "fhci-hcd".
1622 - mode : the could be "host" or "slave".
1623 - reg : Offset and length of the register set for the device
1624 - interrupts : <a b> where a is the interrupt number and b is a
1625 field that represents an encoding of the sense and level
1626 information for the interrupt. This should be encoded based on
1627 the information in section 2) depending on the type of interrupt
1628 controller you have.
1629 - interrupt-parent : the phandle for the interrupt controller that
1630 services interrupts for this device.
1631
1632 Example(slave):
1633 usb@6c0 {
1634 compatible = "qe_udc";
1635 reg = <6c0 40>;
1636 interrupts = <8b 0>;
1637 interrupt-parent = <700>;
1638 mode = "slave";
1639 };
1640
1641
1642 iv) UCC (Unified Communications Controllers)
1643
1644 Required properties:
1645 - device_type : should be "network", "hldc", "uart", "transparent"
1646 "bisync", "atm", or "serial".
1647 - compatible : could be "ucc_geth" or "fsl_atm" and so on.
1648 - cell-index : the ucc number(1-8), corresponding to UCCx in UM.
1649 - reg : Offset and length of the register set for the device
1650 - interrupts : <a b> where a is the interrupt number and b is a
1651 field that represents an encoding of the sense and level
1652 information for the interrupt. This should be encoded based on
1653 the information in section 2) depending on the type of interrupt
1654 controller you have.
1655 - interrupt-parent : the phandle for the interrupt controller that
1656 services interrupts for this device.
1657 - pio-handle : The phandle for the Parallel I/O port configuration.
1658 - port-number : for UART drivers, the port number to use, between 0 and 3.
1659 This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
1660 The port number is added to the minor number of the device. Unlike the
1661 CPM UART driver, the port-number is required for the QE UART driver.
1662 - soft-uart : for UART drivers, if specified this means the QE UART device
1663 driver should use "Soft-UART" mode, which is needed on some SOCs that have
1664 broken UART hardware. Soft-UART is provided via a microcode upload.
1665 - rx-clock-name: the UCC receive clock source
1666 "none": clock source is disabled
1667 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1668 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1669 - tx-clock-name: the UCC transmit clock source
1670 "none": clock source is disabled
1671 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
1672 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
1673 The following two properties are deprecated. rx-clock has been replaced
1674 with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
1675 Drivers that currently use the deprecated properties should continue to
1676 do so, in order to support older device trees, but they should be updated
1677 to check for the new properties first.
1678 - rx-clock : represents the UCC receive clock source.
1679 0x00 : clock source is disabled;
1680 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1681 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1682 - tx-clock: represents the UCC transmit clock source;
1683 0x00 : clock source is disabled;
1684 0x1~0x10 : clock source is BRG1~BRG16 respectively;
1685 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
1686
1687 Required properties for network device_type:
1688 - mac-address : list of bytes representing the ethernet address.
1689 - phy-handle : The phandle for the PHY connected to this controller.
1690
1691 Recommended properties:
1692 - phy-connection-type : a string naming the controller/PHY interface type,
1693 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
1694 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
1695 "tbi", or "rtbi".
1696
1697 Example:
1698 ucc@2000 {
1699 device_type = "network";
1700 compatible = "ucc_geth";
1701 cell-index = <1>;
1702 reg = <2000 200>;
1703 interrupts = <a0 0>;
1704 interrupt-parent = <700>;
1705 mac-address = [ 00 04 9f 00 23 23 ];
1706 rx-clock = "none";
1707 tx-clock = "clk9";
1708 phy-handle = <212000>;
1709 phy-connection-type = "gmii";
1710 pio-handle = <140001>;
1711 };
1712
1713
1714 v) Parallel I/O Ports
1715
1716 This node configures Parallel I/O ports for CPUs with QE support.
1717 The node should reside in the "soc" node of the tree. For each
1718 device that using parallel I/O ports, a child node should be created.
1719 See the definition of the Pin configuration nodes below for more
1720 information.
1721
1722 Required properties:
1723 - device_type : should be "par_io".
1724 - reg : offset to the register set and its length.
1725 - num-ports : number of Parallel I/O ports
1726
1727 Example:
1728 par_io@1400 {
1729 reg = <1400 100>;
1730 #address-cells = <1>;
1731 #size-cells = <0>;
1732 device_type = "par_io";
1733 num-ports = <7>;
1734 ucc_pin@01 {
1735 ......
1736 };
1737
1738
1739 vi) Pin configuration nodes
1740
1741 Required properties:
1742 - linux,phandle : phandle of this node; likely referenced by a QE
1743 device.
1744 - pio-map : array of pin configurations. Each pin is defined by 6
1745 integers. The six numbers are respectively: port, pin, dir,
1746 open_drain, assignment, has_irq.
1747 - port : port number of the pin; 0-6 represent port A-G in UM.
1748 - pin : pin number in the port.
1749 - dir : direction of the pin, should encode as follows:
1750
1751 0 = The pin is disabled
1752 1 = The pin is an output
1753 2 = The pin is an input
1754 3 = The pin is I/O
1755
1756 - open_drain : indicates the pin is normal or wired-OR:
1757
1758 0 = The pin is actively driven as an output
1759 1 = The pin is an open-drain driver. As an output, the pin is
1760 driven active-low, otherwise it is three-stated.
1761
1762 - assignment : function number of the pin according to the Pin Assignment
1763 tables in User Manual. Each pin can have up to 4 possible functions in
1764 QE and two options for CPM.
1765 - has_irq : indicates if the pin is used as source of external
1766 interrupts.
1767
1768 Example:
1769 ucc_pin@01 {
1770 linux,phandle = <140001>;
1771 pio-map = <
1772 /* port pin dir open_drain assignment has_irq */
1773 0 3 1 0 1 0 /* TxD0 */
1774 0 4 1 0 1 0 /* TxD1 */
1775 0 5 1 0 1 0 /* TxD2 */
1776 0 6 1 0 1 0 /* TxD3 */
1777 1 6 1 0 3 0 /* TxD4 */
1778 1 7 1 0 1 0 /* TxD5 */
1779 1 9 1 0 2 0 /* TxD6 */
1780 1 a 1 0 2 0 /* TxD7 */
1781 0 9 2 0 1 0 /* RxD0 */
1782 0 a 2 0 1 0 /* RxD1 */
1783 0 b 2 0 1 0 /* RxD2 */
1784 0 c 2 0 1 0 /* RxD3 */
1785 0 d 2 0 1 0 /* RxD4 */
1786 1 1 2 0 2 0 /* RxD5 */
1787 1 0 2 0 2 0 /* RxD6 */
1788 1 4 2 0 2 0 /* RxD7 */
1789 0 7 1 0 1 0 /* TX_EN */
1790 0 8 1 0 1 0 /* TX_ER */
1791 0 f 2 0 1 0 /* RX_DV */
1792 0 10 2 0 1 0 /* RX_ER */
1793 0 0 2 0 1 0 /* RX_CLK */
1794 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
1795 2 8 2 0 1 0>; /* GTX125 - CLK9 */
1796 };
1797
1798 vii) Multi-User RAM (MURAM)
1799
1800 Required properties:
1801 - compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
1802 - mode : the could be "host" or "slave".
1803 - ranges : Should be defined as specified in 1) to describe the
1804 translation of MURAM addresses.
1805 - data-only : sub-node which defines the address area under MURAM
1806 bus that can be allocated as data/parameter
1807
1808 Example:
1809
1810 muram@10000 {
1811 compatible = "fsl,qe-muram", "fsl,cpm-muram";
1812 ranges = <0 00010000 0000c000>;
1813
1814 data-only@0{
1815 compatible = "fsl,qe-muram-data",
1816 "fsl,cpm-muram-data";
1817 reg = <0 c000>;
1818 };
1819 };
1820
1821 viii) Uploaded QE firmware
1822
1823 If a new firwmare has been uploaded to the QE (usually by the
1824 boot loader), then a 'firmware' child node should be added to the QE
1825 node. This node provides information on the uploaded firmware that
1826 device drivers may need.
1827
1828 Required properties:
1829 - id: The string name of the firmware. This is taken from the 'id'
1830 member of the qe_firmware structure of the uploaded firmware.
1831 Device drivers can search this string to determine if the
1832 firmware they want is already present.
1833 - extended-modes: The Extended Modes bitfield, taken from the
1834 firmware binary. It is a 64-bit number represented
1835 as an array of two 32-bit numbers.
1836 - virtual-traps: The virtual traps, taken from the firmware binary.
1837 It is an array of 8 32-bit numbers.
1838
1839 Example:
1840
1841 firmware {
1842 id = "Soft-UART";
1843 extended-modes = <0 0>;
1844 virtual-traps = <0 0 0 0 0 0 0 0>;
1845 }
1846
1847 j) CFI or JEDEC memory-mapped NOR flash
1848 1302
1849 Flash chips (Memory Technology Devices) are often used for solid state 1303 Flash chips (Memory Technology Devices) are often used for solid state
1850 file systems on embedded devices. 1304 file systems on embedded devices.
@@ -1908,268 +1362,7 @@ platforms are moved over to use the flattened-device-tree model.
1908 }; 1362 };
1909 }; 1363 };
1910 1364
1911 k) Global Utilities Block 1365 d) 4xx/Axon EMAC ethernet nodes
1912
1913 The global utilities block controls power management, I/O device
1914 enabling, power-on-reset configuration monitoring, general-purpose
1915 I/O signal configuration, alternate function selection for multiplexed
1916 signals, and clock control.
1917
1918 Required properties:
1919
1920 - compatible : Should define the compatible device type for
1921 global-utilities.
1922 - reg : Offset and length of the register set for the device.
1923
1924 Recommended properties:
1925
1926 - fsl,has-rstcr : Indicates that the global utilities register set
1927 contains a functioning "reset control register" (i.e. the board
1928 is wired to reset upon setting the HRESET_REQ bit in this register).
1929
1930 Example:
1931
1932 global-utilities@e0000 { /* global utilities block */
1933 compatible = "fsl,mpc8548-guts";
1934 reg = <e0000 1000>;
1935 fsl,has-rstcr;
1936 };
1937
1938 l) Freescale Communications Processor Module
1939
1940 NOTE: This is an interim binding, and will likely change slightly,
1941 as more devices are supported. The QE bindings especially are
1942 incomplete.
1943
1944 i) Root CPM node
1945
1946 Properties:
1947 - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
1948 - reg : A 48-byte region beginning with CPCR.
1949
1950 Example:
1951 cpm@119c0 {
1952 #address-cells = <1>;
1953 #size-cells = <1>;
1954 #interrupt-cells = <2>;
1955 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
1956 reg = <119c0 30>;
1957 }
1958
1959 ii) Properties common to mulitple CPM/QE devices
1960
1961 - fsl,cpm-command : This value is ORed with the opcode and command flag
1962 to specify the device on which a CPM command operates.
1963
1964 - fsl,cpm-brg : Indicates which baud rate generator the device
1965 is associated with. If absent, an unused BRG
1966 should be dynamically allocated. If zero, the
1967 device uses an external clock rather than a BRG.
1968
1969 - reg : Unless otherwise specified, the first resource represents the
1970 scc/fcc/ucc registers, and the second represents the device's
1971 parameter RAM region (if it has one).
1972
1973 iii) Serial
1974
1975 Currently defined compatibles:
1976 - fsl,cpm1-smc-uart
1977 - fsl,cpm2-smc-uart
1978 - fsl,cpm1-scc-uart
1979 - fsl,cpm2-scc-uart
1980 - fsl,qe-uart
1981
1982 Example:
1983
1984 serial@11a00 {
1985 device_type = "serial";
1986 compatible = "fsl,mpc8272-scc-uart",
1987 "fsl,cpm2-scc-uart";
1988 reg = <11a00 20 8000 100>;
1989 interrupts = <28 8>;
1990 interrupt-parent = <&PIC>;
1991 fsl,cpm-brg = <1>;
1992 fsl,cpm-command = <00800000>;
1993 };
1994
1995 iii) Network
1996
1997 Currently defined compatibles:
1998 - fsl,cpm1-scc-enet
1999 - fsl,cpm2-scc-enet
2000 - fsl,cpm1-fec-enet
2001 - fsl,cpm2-fcc-enet (third resource is GFEMR)
2002 - fsl,qe-enet
2003
2004 Example:
2005
2006 ethernet@11300 {
2007 device_type = "network";
2008 compatible = "fsl,mpc8272-fcc-enet",
2009 "fsl,cpm2-fcc-enet";
2010 reg = <11300 20 8400 100 11390 1>;
2011 local-mac-address = [ 00 00 00 00 00 00 ];
2012 interrupts = <20 8>;
2013 interrupt-parent = <&PIC>;
2014 phy-handle = <&PHY0>;
2015 fsl,cpm-command = <12000300>;
2016 };
2017
2018 iv) MDIO
2019
2020 Currently defined compatibles:
2021 fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
2022 fsl,cpm2-mdio-bitbang (reg is port C registers)
2023
2024 Properties for fsl,cpm2-mdio-bitbang:
2025 fsl,mdio-pin : pin of port C controlling mdio data
2026 fsl,mdc-pin : pin of port C controlling mdio clock
2027
2028 Example:
2029
2030 mdio@10d40 {
2031 device_type = "mdio";
2032 compatible = "fsl,mpc8272ads-mdio-bitbang",
2033 "fsl,mpc8272-mdio-bitbang",
2034 "fsl,cpm2-mdio-bitbang";
2035 reg = <10d40 14>;
2036 #address-cells = <1>;
2037 #size-cells = <0>;
2038 fsl,mdio-pin = <12>;
2039 fsl,mdc-pin = <13>;
2040 };
2041
2042 v) Baud Rate Generators
2043
2044 Currently defined compatibles:
2045 fsl,cpm-brg
2046 fsl,cpm1-brg
2047 fsl,cpm2-brg
2048
2049 Properties:
2050 - reg : There may be an arbitrary number of reg resources; BRG
2051 numbers are assigned to these in order.
2052 - clock-frequency : Specifies the base frequency driving
2053 the BRG.
2054
2055 Example:
2056
2057 brg@119f0 {
2058 compatible = "fsl,mpc8272-brg",
2059 "fsl,cpm2-brg",
2060 "fsl,cpm-brg";
2061 reg = <119f0 10 115f0 10>;
2062 clock-frequency = <d#25000000>;
2063 };
2064
2065 vi) Interrupt Controllers
2066
2067 Currently defined compatibles:
2068 - fsl,cpm1-pic
2069 - only one interrupt cell
2070 - fsl,pq1-pic
2071 - fsl,cpm2-pic
2072 - second interrupt cell is level/sense:
2073 - 2 is falling edge
2074 - 8 is active low
2075
2076 Example:
2077
2078 interrupt-controller@10c00 {
2079 #interrupt-cells = <2>;
2080 interrupt-controller;
2081 reg = <10c00 80>;
2082 compatible = "mpc8272-pic", "fsl,cpm2-pic";
2083 };
2084
2085 vii) USB (Universal Serial Bus Controller)
2086
2087 Properties:
2088 - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
2089
2090 Example:
2091 usb@11bc0 {
2092 #address-cells = <1>;
2093 #size-cells = <0>;
2094 compatible = "fsl,cpm2-usb";
2095 reg = <11b60 18 8b00 100>;
2096 interrupts = <b 8>;
2097 interrupt-parent = <&PIC>;
2098 fsl,cpm-command = <2e600000>;
2099 };
2100
2101 viii) Multi-User RAM (MURAM)
2102
2103 The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
2104
2105 Ranges must be set up subject to the following restrictions:
2106
2107 - Children's reg nodes must be offsets from the start of all muram, even
2108 if the user-data area does not begin at zero.
2109 - If multiple range entries are used, the difference between the parent
2110 address and the child address must be the same in all, so that a single
2111 mapping can cover them all while maintaining the ability to determine
2112 CPM-side offsets with pointer subtraction. It is recommended that
2113 multiple range entries not be used.
2114 - A child address of zero must be translatable, even if no reg resources
2115 contain it.
2116
2117 A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
2118 indicate the portion of muram that is usable by the OS for arbitrary
2119 purposes. The data node may have an arbitrary number of reg resources,
2120 all of which contribute to the allocatable muram pool.
2121
2122 Example, based on mpc8272:
2123
2124 muram@0 {
2125 #address-cells = <1>;
2126 #size-cells = <1>;
2127 ranges = <0 0 10000>;
2128
2129 data@0 {
2130 compatible = "fsl,cpm-muram-data";
2131 reg = <0 2000 9800 800>;
2132 };
2133 };
2134
2135 m) Chipselect/Local Bus
2136
2137 Properties:
2138 - name : Should be localbus
2139 - #address-cells : Should be either two or three. The first cell is the
2140 chipselect number, and the remaining cells are the
2141 offset into the chipselect.
2142 - #size-cells : Either one or two, depending on how large each chipselect
2143 can be.
2144 - ranges : Each range corresponds to a single chipselect, and cover
2145 the entire access window as configured.
2146
2147 Example:
2148 localbus@f0010100 {
2149 compatible = "fsl,mpc8272-localbus",
2150 "fsl,pq2-localbus";
2151 #address-cells = <2>;
2152 #size-cells = <1>;
2153 reg = <f0010100 40>;
2154
2155 ranges = <0 0 fe000000 02000000
2156 1 0 f4500000 00008000>;
2157
2158 flash@0,0 {
2159 compatible = "jedec-flash";
2160 reg = <0 0 2000000>;
2161 bank-width = <4>;
2162 device-width = <1>;
2163 };
2164
2165 board-control@1,0 {
2166 reg = <1 0 20>;
2167 compatible = "fsl,mpc8272ads-bcsr";
2168 };
2169 };
2170
2171
2172 n) 4xx/Axon EMAC ethernet nodes
2173 1366
2174 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also 1367 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
2175 the Axon bridge. To operate this needs to interact with a ths 1368 the Axon bridge. To operate this needs to interact with a ths
@@ -2317,7 +1510,7 @@ platforms are moved over to use the flattened-device-tree model.
2317 available. 1510 available.
2318 For Axon: 0x0000012a 1511 For Axon: 0x0000012a
2319 1512
2320 o) Xilinx IP cores 1513 e) Xilinx IP cores
2321 1514
2322 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use 1515 The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
2323 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range 1516 in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range
@@ -2584,7 +1777,7 @@ platforms are moved over to use the flattened-device-tree model.
2584 1777
2585 Xilinx uartlite devices are simple fixed speed serial ports. 1778 Xilinx uartlite devices are simple fixed speed serial ports.
2586 1779
2587 Requred properties: 1780 Required properties:
2588 - current-speed : Baud rate of uartlite 1781 - current-speed : Baud rate of uartlite
2589 1782
2590 v) Xilinx hwicap 1783 v) Xilinx hwicap
@@ -2606,211 +1799,12 @@ platforms are moved over to use the flattened-device-tree model.
2606 Xilinx UART 16550 devices are very similar to the NS16550 but with 1799 Xilinx UART 16550 devices are very similar to the NS16550 but with
2607 different register spacing and an offset from the base address. 1800 different register spacing and an offset from the base address.
2608 1801
2609 Requred properties: 1802 Required properties:
2610 - clock-frequency : Frequency of the clock input 1803 - clock-frequency : Frequency of the clock input
2611 - reg-offset : A value of 3 is required 1804 - reg-offset : A value of 3 is required
2612 - reg-shift : A value of 2 is required 1805 - reg-shift : A value of 2 is required
2613 1806
2614 1807 f) USB EHCI controllers
2615 p) Freescale Synchronous Serial Interface
2616
2617 The SSI is a serial device that communicates with audio codecs. It can
2618 be programmed in AC97, I2S, left-justified, or right-justified modes.
2619
2620 Required properties:
2621 - compatible : compatible list, containing "fsl,ssi"
2622 - cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
2623 - reg : offset and length of the register set for the device
2624 - interrupts : <a b> where a is the interrupt number and b is a
2625 field that represents an encoding of the sense and
2626 level information for the interrupt. This should be
2627 encoded based on the information in section 2)
2628 depending on the type of interrupt controller you
2629 have.
2630 - interrupt-parent : the phandle for the interrupt controller that
2631 services interrupts for this device.
2632 - fsl,mode : the operating mode for the SSI interface
2633 "i2s-slave" - I2S mode, SSI is clock slave
2634 "i2s-master" - I2S mode, SSI is clock master
2635 "lj-slave" - left-justified mode, SSI is clock slave
2636 "lj-master" - l.j. mode, SSI is clock master
2637 "rj-slave" - right-justified mode, SSI is clock slave
2638 "rj-master" - r.j., SSI is clock master
2639 "ac97-slave" - AC97 mode, SSI is clock slave
2640 "ac97-master" - AC97 mode, SSI is clock master
2641
2642 Optional properties:
2643 - codec-handle : phandle to a 'codec' node that defines an audio
2644 codec connected to this SSI. This node is typically
2645 a child of an I2C or other control node.
2646
2647 Child 'codec' node required properties:
2648 - compatible : compatible list, contains the name of the codec
2649
2650 Child 'codec' node optional properties:
2651 - clock-frequency : The frequency of the input clock, which typically
2652 comes from an on-board dedicated oscillator.
2653
2654 * Freescale 83xx DMA Controller
2655
2656 Freescale PowerPC 83xx have on chip general purpose DMA controllers.
2657
2658 Required properties:
2659
2660 - compatible : compatible list, contains 2 entries, first is
2661 "fsl,CHIP-dma", where CHIP is the processor
2662 (mpc8349, mpc8360, etc.) and the second is
2663 "fsl,elo-dma"
2664 - reg : <registers mapping for DMA general status reg>
2665 - ranges : Should be defined as specified in 1) to describe the
2666 DMA controller channels.
2667 - cell-index : controller index. 0 for controller @ 0x8100
2668 - interrupts : <interrupt mapping for DMA IRQ>
2669 - interrupt-parent : optional, if needed for interrupt mapping
2670
2671
2672 - DMA channel nodes:
2673 - compatible : compatible list, contains 2 entries, first is
2674 "fsl,CHIP-dma-channel", where CHIP is the processor
2675 (mpc8349, mpc8350, etc.) and the second is
2676 "fsl,elo-dma-channel"
2677 - reg : <registers mapping for channel>
2678 - cell-index : dma channel index starts at 0.
2679
2680 Optional properties:
2681 - interrupts : <interrupt mapping for DMA channel IRQ>
2682 (on 83xx this is expected to be identical to
2683 the interrupts property of the parent node)
2684 - interrupt-parent : optional, if needed for interrupt mapping
2685
2686 Example:
2687 dma@82a8 {
2688 #address-cells = <1>;
2689 #size-cells = <1>;
2690 compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
2691 reg = <82a8 4>;
2692 ranges = <0 8100 1a4>;
2693 interrupt-parent = <&ipic>;
2694 interrupts = <47 8>;
2695 cell-index = <0>;
2696 dma-channel@0 {
2697 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2698 cell-index = <0>;
2699 reg = <0 80>;
2700 };
2701 dma-channel@80 {
2702 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2703 cell-index = <1>;
2704 reg = <80 80>;
2705 };
2706 dma-channel@100 {
2707 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2708 cell-index = <2>;
2709 reg = <100 80>;
2710 };
2711 dma-channel@180 {
2712 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
2713 cell-index = <3>;
2714 reg = <180 80>;
2715 };
2716 };
2717
2718 * Freescale 85xx/86xx DMA Controller
2719
2720 Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
2721
2722 Required properties:
2723
2724 - compatible : compatible list, contains 2 entries, first is
2725 "fsl,CHIP-dma", where CHIP is the processor
2726 (mpc8540, mpc8540, etc.) and the second is
2727 "fsl,eloplus-dma"
2728 - reg : <registers mapping for DMA general status reg>
2729 - cell-index : controller index. 0 for controller @ 0x21000,
2730 1 for controller @ 0xc000
2731 - ranges : Should be defined as specified in 1) to describe the
2732 DMA controller channels.
2733
2734 - DMA channel nodes:
2735 - compatible : compatible list, contains 2 entries, first is
2736 "fsl,CHIP-dma-channel", where CHIP is the processor
2737 (mpc8540, mpc8560, etc.) and the second is
2738 "fsl,eloplus-dma-channel"
2739 - cell-index : dma channel index starts at 0.
2740 - reg : <registers mapping for channel>
2741 - interrupts : <interrupt mapping for DMA channel IRQ>
2742 - interrupt-parent : optional, if needed for interrupt mapping
2743
2744 Example:
2745 dma@21300 {
2746 #address-cells = <1>;
2747 #size-cells = <1>;
2748 compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
2749 reg = <21300 4>;
2750 ranges = <0 21100 200>;
2751 cell-index = <0>;
2752 dma-channel@0 {
2753 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2754 reg = <0 80>;
2755 cell-index = <0>;
2756 interrupt-parent = <&mpic>;
2757 interrupts = <14 2>;
2758 };
2759 dma-channel@80 {
2760 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2761 reg = <80 80>;
2762 cell-index = <1>;
2763 interrupt-parent = <&mpic>;
2764 interrupts = <15 2>;
2765 };
2766 dma-channel@100 {
2767 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2768 reg = <100 80>;
2769 cell-index = <2>;
2770 interrupt-parent = <&mpic>;
2771 interrupts = <16 2>;
2772 };
2773 dma-channel@180 {
2774 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
2775 reg = <180 80>;
2776 cell-index = <3>;
2777 interrupt-parent = <&mpic>;
2778 interrupts = <17 2>;
2779 };
2780 };
2781
2782 * Freescale 8xxx/3.0 Gb/s SATA nodes
2783
2784 SATA nodes are defined to describe on-chip Serial ATA controllers.
2785 Each SATA port should have its own node.
2786
2787 Required properties:
2788 - compatible : compatible list, contains 2 entries, first is
2789 "fsl,CHIP-sata", where CHIP is the processor
2790 (mpc8315, mpc8379, etc.) and the second is
2791 "fsl,pq-sata"
2792 - interrupts : <interrupt mapping for SATA IRQ>
2793 - cell-index : controller index.
2794 1 for controller @ 0x18000
2795 2 for controller @ 0x19000
2796 3 for controller @ 0x1a000
2797 4 for controller @ 0x1b000
2798
2799 Optional properties:
2800 - interrupt-parent : optional, if needed for interrupt mapping
2801 - reg : <registers mapping>
2802
2803 Example:
2804
2805 sata@18000 {
2806 compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
2807 reg = <0x18000 0x1000>;
2808 cell-index = <1>;
2809 interrupts = <2c 8>;
2810 interrupt-parent = < &ipic >;
2811 };
2812
2813 q) USB EHCI controllers
2814 1808
2815 Required properties: 1809 Required properties:
2816 - compatible : should be "usb-ehci". 1810 - compatible : should be "usb-ehci".
@@ -2870,6 +1864,82 @@ platforms are moved over to use the flattened-device-tree model.
2870 reg = <0xe8000000 32>; 1864 reg = <0xe8000000 32>;
2871 }; 1865 };
2872 1866
1867 r) MDIO on GPIOs
1868
1869 Currently defined compatibles:
1870 - virtual,gpio-mdio
1871
1872 MDC and MDIO lines connected to GPIO controllers are listed in the
1873 gpios property as described in section VIII.1 in the following order:
1874
1875 MDC, MDIO.
1876
1877 Example:
1878
1879 mdio {
1880 compatible = "virtual,mdio-gpio";
1881 #address-cells = <1>;
1882 #size-cells = <0>;
1883 gpios = <&qe_pio_a 11
1884 &qe_pio_c 6>;
1885 };
1886
1887 s) SPI (Serial Peripheral Interface) busses
1888
1889 SPI busses can be described with a node for the SPI master device
1890 and a set of child nodes for each SPI slave on the bus. For this
1891 discussion, it is assumed that the system's SPI controller is in
1892 SPI master mode. This binding does not describe SPI controllers
1893 in slave mode.
1894
1895 The SPI master node requires the following properties:
1896 - #address-cells - number of cells required to define a chip select
1897 address on the SPI bus.
1898 - #size-cells - should be zero.
1899 - compatible - name of SPI bus controller following generic names
1900 recommended practice.
1901 No other properties are required in the SPI bus node. It is assumed
1902 that a driver for an SPI bus device will understand that it is an SPI bus.
1903 However, the binding does not attempt to define the specific method for
1904 assigning chip select numbers. Since SPI chip select configuration is
1905 flexible and non-standardized, it is left out of this binding with the
1906 assumption that board specific platform code will be used to manage
1907 chip selects. Individual drivers can define additional properties to
1908 support describing the chip select layout.
1909
1910 SPI slave nodes must be children of the SPI master node and can
1911 contain the following properties.
1912 - reg - (required) chip select address of device.
1913 - compatible - (required) name of SPI device following generic names
1914 recommended practice
1915 - spi-max-frequency - (required) Maximum SPI clocking speed of device in Hz
1916 - spi-cpol - (optional) Empty property indicating device requires
1917 inverse clock polarity (CPOL) mode
1918 - spi-cpha - (optional) Empty property indicating device requires
1919 shifted clock phase (CPHA) mode
1920
1921 SPI example for an MPC5200 SPI bus:
1922 spi@f00 {
1923 #address-cells = <1>;
1924 #size-cells = <0>;
1925 compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
1926 reg = <0xf00 0x20>;
1927 interrupts = <2 13 0 2 14 0>;
1928 interrupt-parent = <&mpc5200_pic>;
1929
1930 ethernet-switch@0 {
1931 compatible = "micrel,ks8995m";
1932 spi-max-frequency = <1000000>;
1933 reg = <0>;
1934 };
1935
1936 codec@1 {
1937 compatible = "ti,tlv320aic26";
1938 spi-max-frequency = <100000>;
1939 reg = <1>;
1940 };
1941 };
1942
2873VII - Marvell Discovery mv64[345]6x System Controller chips 1943VII - Marvell Discovery mv64[345]6x System Controller chips
2874=========================================================== 1944===========================================================
2875 1945
@@ -2883,7 +1953,7 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd.
28831) The /system-controller node 19531) The /system-controller node
2884 1954
2885 This node is used to represent the system-controller and must be 1955 This node is used to represent the system-controller and must be
2886 present when the system uses a system contller chip. The top-level 1956 present when the system uses a system controller chip. The top-level
2887 system-controller node contains information that is global to all 1957 system-controller node contains information that is global to all
2888 devices within the system controller chip. The node name begins 1958 devices within the system controller chip. The node name begins
2889 with "system-controller" followed by the unit address, which is 1959 with "system-controller" followed by the unit address, which is
@@ -3477,8 +2547,8 @@ encodings listed below:
3477 2 = high to low edge sensitive type enabled 2547 2 = high to low edge sensitive type enabled
3478 3 = low to high edge sensitive type enabled 2548 3 = low to high edge sensitive type enabled
3479 2549
3480VIII - Specifying GPIO information for devices 2550IX - Specifying GPIO information for devices
3481============================================== 2551============================================
3482 2552
34831) gpios property 25531) gpios property
3484----------------- 2554-----------------
@@ -3526,119 +2596,151 @@ Example of two SOC GPIO banks defined as gpio-controller nodes:
3526 gpio-controller; 2596 gpio-controller;
3527 }; 2597 };
3528 2598
2599X - Specifying Device Power Management Information (sleep property)
2600===================================================================
2601
2602Devices on SOCs often have mechanisms for placing devices into low-power
2603states that are decoupled from the devices' own register blocks. Sometimes,
2604this information is more complicated than a cell-index property can
2605reasonably describe. Thus, each device controlled in such a manner
2606may contain a "sleep" property which describes these connections.
2607
2608The sleep property consists of one or more sleep resources, each of
2609which consists of a phandle to a sleep controller, followed by a
2610controller-specific sleep specifier of zero or more cells.
2611
2612The semantics of what type of low power modes are possible are defined
2613by the sleep controller. Some examples of the types of low power modes
2614that may be supported are:
2615
2616 - Dynamic: The device may be disabled or enabled at any time.
2617 - System Suspend: The device may request to be disabled or remain
2618 awake during system suspend, but will not be disabled until then.
2619 - Permanent: The device is disabled permanently (until the next hard
2620 reset).
2621
2622Some devices may share a clock domain with each other, such that they should
2623only be suspended when none of the devices are in use. Where reasonable,
2624such nodes should be placed on a virtual bus, where the bus has the sleep
2625property. If the clock domain is shared among devices that cannot be
2626reasonably grouped in this manner, then create a virtual sleep controller
2627(similar to an interrupt nexus, except that defining a standardized
2628sleep-map should wait until its necessity is demonstrated).
2629
3529Appendix A - Sample SOC node for MPC8540 2630Appendix A - Sample SOC node for MPC8540
3530======================================== 2631========================================
3531 2632
3532Note that the #address-cells and #size-cells for the SoC node 2633 soc@e0000000 {
3533in this example have been explicitly listed; these are likely
3534not necessary as they are usually the same as the root node.
3535
3536 soc8540@e0000000 {
3537 #address-cells = <1>; 2634 #address-cells = <1>;
3538 #size-cells = <1>; 2635 #size-cells = <1>;
3539 #interrupt-cells = <2>; 2636 compatible = "fsl,mpc8540-ccsr", "simple-bus";
3540 device_type = "soc"; 2637 device_type = "soc";
3541 ranges = <00000000 e0000000 00100000> 2638 ranges = <0x00000000 0xe0000000 0x00100000>
3542 reg = <e0000000 00003000>;
3543 bus-frequency = <0>; 2639 bus-frequency = <0>;
3544 2640 interrupt-parent = <&pic>;
3545 mdio@24520 {
3546 reg = <24520 20>;
3547 device_type = "mdio";
3548 compatible = "gianfar";
3549
3550 ethernet-phy@0 {
3551 linux,phandle = <2452000>
3552 interrupt-parent = <40000>;
3553 interrupts = <35 1>;
3554 reg = <0>;
3555 device_type = "ethernet-phy";
3556 };
3557
3558 ethernet-phy@1 {
3559 linux,phandle = <2452001>
3560 interrupt-parent = <40000>;
3561 interrupts = <35 1>;
3562 reg = <1>;
3563 device_type = "ethernet-phy";
3564 };
3565
3566 ethernet-phy@3 {
3567 linux,phandle = <2452002>
3568 interrupt-parent = <40000>;
3569 interrupts = <35 1>;
3570 reg = <3>;
3571 device_type = "ethernet-phy";
3572 };
3573
3574 };
3575 2641
3576 ethernet@24000 { 2642 ethernet@24000 {
3577 #size-cells = <0>; 2643 #address-cells = <1>;
2644 #size-cells = <1>;
3578 device_type = "network"; 2645 device_type = "network";
3579 model = "TSEC"; 2646 model = "TSEC";
3580 compatible = "gianfar"; 2647 compatible = "gianfar", "simple-bus";
3581 reg = <24000 1000>; 2648 reg = <0x24000 0x1000>;
3582 mac-address = [ 00 E0 0C 00 73 00 ]; 2649 local-mac-address = [ 00 E0 0C 00 73 00 ];
3583 interrupts = <d 3 e 3 12 3>; 2650 interrupts = <29 2 30 2 34 2>;
3584 interrupt-parent = <40000>; 2651 phy-handle = <&phy0>;
3585 phy-handle = <2452000>; 2652 sleep = <&pmc 00000080>;
2653 ranges;
2654
2655 mdio@24520 {
2656 reg = <0x24520 0x20>;
2657 compatible = "fsl,gianfar-mdio";
2658
2659 phy0: ethernet-phy@0 {
2660 interrupts = <5 1>;
2661 reg = <0>;
2662 device_type = "ethernet-phy";
2663 };
2664
2665 phy1: ethernet-phy@1 {
2666 interrupts = <5 1>;
2667 reg = <1>;
2668 device_type = "ethernet-phy";
2669 };
2670
2671 phy3: ethernet-phy@3 {
2672 interrupts = <7 1>;
2673 reg = <3>;
2674 device_type = "ethernet-phy";
2675 };
2676 };
3586 }; 2677 };
3587 2678
3588 ethernet@25000 { 2679 ethernet@25000 {
3589 #address-cells = <1>;
3590 #size-cells = <0>;
3591 device_type = "network"; 2680 device_type = "network";
3592 model = "TSEC"; 2681 model = "TSEC";
3593 compatible = "gianfar"; 2682 compatible = "gianfar";
3594 reg = <25000 1000>; 2683 reg = <0x25000 0x1000>;
3595 mac-address = [ 00 E0 0C 00 73 01 ]; 2684 local-mac-address = [ 00 E0 0C 00 73 01 ];
3596 interrupts = <13 3 14 3 18 3>; 2685 interrupts = <13 2 14 2 18 2>;
3597 interrupt-parent = <40000>; 2686 phy-handle = <&phy1>;
3598 phy-handle = <2452001>; 2687 sleep = <&pmc 00000040>;
3599 }; 2688 };
3600 2689
3601 ethernet@26000 { 2690 ethernet@26000 {
3602 #address-cells = <1>;
3603 #size-cells = <0>;
3604 device_type = "network"; 2691 device_type = "network";
3605 model = "FEC"; 2692 model = "FEC";
3606 compatible = "gianfar"; 2693 compatible = "gianfar";
3607 reg = <26000 1000>; 2694 reg = <0x26000 0x1000>;
3608 mac-address = [ 00 E0 0C 00 73 02 ]; 2695 local-mac-address = [ 00 E0 0C 00 73 02 ];
3609 interrupts = <19 3>; 2696 interrupts = <41 2>;
3610 interrupt-parent = <40000>; 2697 phy-handle = <&phy3>;
3611 phy-handle = <2452002>; 2698 sleep = <&pmc 00000020>;
3612 }; 2699 };
3613 2700
3614 serial@4500 { 2701 serial@4500 {
3615 device_type = "serial"; 2702 #address-cells = <1>;
3616 compatible = "ns16550"; 2703 #size-cells = <1>;
3617 reg = <4500 100>; 2704 compatible = "fsl,mpc8540-duart", "simple-bus";
3618 clock-frequency = <0>; 2705 sleep = <&pmc 00000002>;
3619 interrupts = <1a 3>; 2706 ranges;
3620 interrupt-parent = <40000>; 2707
2708 serial@4500 {
2709 device_type = "serial";
2710 compatible = "ns16550";
2711 reg = <0x4500 0x100>;
2712 clock-frequency = <0>;
2713 interrupts = <42 2>;
2714 };
2715
2716 serial@4600 {
2717 device_type = "serial";
2718 compatible = "ns16550";
2719 reg = <0x4600 0x100>;
2720 clock-frequency = <0>;
2721 interrupts = <42 2>;
2722 };
3621 }; 2723 };
3622 2724
3623 pic@40000 { 2725 pic: pic@40000 {
3624 linux,phandle = <40000>;
3625 clock-frequency = <0>;
3626 interrupt-controller; 2726 interrupt-controller;
3627 #address-cells = <0>; 2727 #address-cells = <0>;
3628 reg = <40000 40000>; 2728 #interrupt-cells = <2>;
3629 built-in; 2729 reg = <0x40000 0x40000>;
3630 compatible = "chrp,open-pic"; 2730 compatible = "chrp,open-pic";
3631 device_type = "open-pic"; 2731 device_type = "open-pic";
3632 big-endian;
3633 }; 2732 };
3634 2733
3635 i2c@3000 { 2734 i2c@3000 {
3636 interrupt-parent = <40000>; 2735 interrupts = <43 2>;
3637 interrupts = <1b 3>; 2736 reg = <0x3000 0x100>;
3638 reg = <3000 18>;
3639 device_type = "i2c";
3640 compatible = "fsl-i2c"; 2737 compatible = "fsl-i2c";
3641 dfsrr; 2738 dfsrr;
2739 sleep = <&pmc 00000004>;
3642 }; 2740 };
3643 2741
2742 pmc: power@e0070 {
2743 compatible = "fsl,mpc8540-pmc", "fsl,mpc8548-pmc";
2744 reg = <0xe0070 0x20>;
2745 };
3644 }; 2746 };
diff --git a/Documentation/powerpc/bootwrapper.txt b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 000000000000..d60fced5e1cc
--- /dev/null
+++ b/Documentation/powerpc/bootwrapper.txt
@@ -0,0 +1,141 @@
1The PowerPC boot wrapper
2------------------------
3Copyright (C) Secret Lab Technologies Ltd.
4
5PowerPC image targets compresses and wraps the kernel image (vmlinux) with
6a boot wrapper to make it usable by the system firmware. There is no
7standard PowerPC firmware interface, so the boot wrapper is designed to
8be adaptable for each kind of image that needs to be built.
9
10The boot wrapper can be found in the arch/powerpc/boot/ directory. The
11Makefile in that directory has targets for all the available image types.
12The different image types are used to support all of the various firmware
13interfaces found on PowerPC platforms. OpenFirmware is the most commonly
14used firmware type on general purpose PowerPC systems from Apple, IBM and
15others. U-Boot is typically found on embedded PowerPC hardware, but there
16are a handful of other firmware implementations which are also popular. Each
17firmware interface requires a different image format.
18
19The boot wrapper is built from the makefile in arch/powerpc/boot/Makefile and
20it uses the wrapper script (arch/powerpc/boot/wrapper) to generate target
21image. The details of the build system is discussed in the next section.
22Currently, the following image format targets exist:
23
24 cuImage.%: Backwards compatible uImage for older version of
25 U-Boot (for versions that don't understand the device
26 tree). This image embeds a device tree blob inside
27 the image. The boot wrapper, kernel and device tree
28 are all embedded inside the U-Boot uImage file format
29 with boot wrapper code that extracts data from the old
30 bd_info structure and loads the data into the device
31 tree before jumping into the kernel.
32 Because of the series of #ifdefs found in the
33 bd_info structure used in the old U-Boot interfaces,
34 cuImages are platform specific. Each specific
35 U-Boot platform has a different platform init file
36 which populates the embedded device tree with data
37 from the platform specific bd_info file. The platform
38 specific cuImage platform init code can be found in
39 arch/powerpc/boot/cuboot.*.c. Selection of the correct
40 cuImage init code for a specific board can be found in
41 the wrapper structure.
42 dtbImage.%: Similar to zImage, except device tree blob is embedded
43 inside the image instead of provided by firmware. The
44 output image file can be either an elf file or a flat
45 binary depending on the platform.
46 dtbImages are used on systems which do not have an
47 interface for passing a device tree directly.
48 dtbImages are similar to simpleImages except that
49 dtbImages have platform specific code for extracting
50 data from the board firmware, but simpleImages do not
51 talk to the firmware at all.
52 PlayStation 3 support uses dtbImage. So do Embedded
53 Planet boards using the PlanetCore firmware. Board
54 specific initialization code is typically found in a
55 file named arch/powerpc/boot/<platform>.c; but this
56 can be overridden by the wrapper script.
57 simpleImage.%: Firmware independent compressed image that does not
58 depend on any particular firmware interface and embeds
59 a device tree blob. This image is a flat binary that
60 can be loaded to any location in RAM and jumped to.
61 Firmware cannot pass any configuration data to the
62 kernel with this image type and it depends entirely on
63 the embedded device tree for all information.
64 The simpleImage is useful for booting systems with
65 an unknown firmware interface or for booting from
66 a debugger when no firmware is present (such as on
67 the Xilinx Virtex platform). The only assumption that
68 simpleImage makes is that RAM is correctly initialized
69 and that the MMU is either off or has RAM mapped to
70 base address 0.
71 simpleImage also supports inserting special platform
72 specific initialization code to the start of the bootup
73 sequence. The virtex405 platform uses this feature to
74 ensure that the cache is invalidated before caching
75 is enabled. Platform specific initialization code is
76 added as part of the wrapper script and is keyed on
77 the image target name. For example, all
78 simpleImage.virtex405-* targets will add the
79 virtex405-head.S initialization code (This also means
80 that the dts file for virtex405 targets should be
81 named (virtex405-<board>.dts). Search the wrapper
82 script for 'virtex405' and see the file
83 arch/powerpc/boot/virtex405-head.S for details.
84 treeImage.%; Image format for used with OpenBIOS firmware found
85 on some ppc4xx hardware. This image embeds a device
86 tree blob inside the image.
87 uImage: Native image format used by U-Boot. The uImage target
88 does not add any boot code. It just wraps a compressed
89 vmlinux in the uImage data structure. This image
90 requires a version of U-Boot that is able to pass
91 a device tree to the kernel at boot. If using an older
92 version of U-Boot, then you need to use a cuImage
93 instead.
94 zImage.%: Image format which does not embed a device tree.
95 Used by OpenFirmware and other firmware interfaces
96 which are able to supply a device tree. This image
97 expects firmware to provide the device tree at boot.
98 Typically, if you have general purpose PowerPC
99 hardware then you want this image format.
100
101Image types which embed a device tree blob (simpleImage, dtbImage, treeImage,
102and cuImage) all generate the device tree blob from a file in the
103arch/powerpc/boot/dts/ directory. The Makefile selects the correct device
104tree source based on the name of the target. Therefore, if the kernel is
105built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the
106build system will use arch/powerpc/boot/dts/walnut.dts to build
107treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build
108the simpleImage.virtex405-ml403.
109
110Two special targets called 'zImage' and 'zImage.initrd' also exist. These
111targets build all the default images as selected by the kernel configuration.
112Default images are selected by the boot wrapper Makefile
113(arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look
114at the Makefile to see which default image targets are available.
115
116How it is built
117---------------
118arch/powerpc is designed to support multiplatform kernels, which means
119that a single vmlinux image can be booted on many different target boards.
120It also means that the boot wrapper must be able to wrap for many kinds of
121images on a single build. The design decision was made to not use any
122conditional compilation code (#ifdef, etc) in the boot wrapper source code.
123All of the boot wrapper pieces are buildable at any time regardless of the
124kernel configuration. Building all the wrapper bits on every kernel build
125also ensures that obscure parts of the wrapper are at the very least compile
126tested in a large variety of environments.
127
128The wrapper is adapted for different image types at link time by linking in
129just the wrapper bits that are appropriate for the image type. The 'wrapper
130script' (found in arch/powerpc/boot/wrapper) is called by the Makefile and
131is responsible for selecting the correct wrapper bits for the image type.
132The arguments are well documented in the script's comment block, so they
133are not repeated here. However, it is worth mentioning that the script
134uses the -p (platform) argument as the main method of deciding which wrapper
135bits to compile in. Look for the large 'case "$platform" in' block in the
136middle of the script. This is also the place where platform specific fixups
137can be selected by changing the link order.
138
139In particular, care should be taken when working with cuImages. cuImage
140wrapper bits are very board specific and care should be taken to make sure
141the target you are trying to build is supported by the wrapper bits.
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/powerpc/dts-bindings/fsl/board.txt
new file mode 100644
index 000000000000..74ae6f1cd2d6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/board.txt
@@ -0,0 +1,29 @@
1* Board Control and Status (BCSR)
2
3Required properties:
4
5 - device_type : Should be "board-control"
6 - reg : Offset and length of the register set for the device
7
8Example:
9
10 bcsr@f8000000 {
11 device_type = "board-control";
12 reg = <f8000000 8000>;
13 };
14
15* Freescale on board FPGA
16
17This is the memory-mapped registers for on board FPGA.
18
19Required properities:
20- compatible : should be "fsl,fpga-pixis".
21- reg : should contain the address and the lenght of the FPPGA register
22 set.
23
24Example (MPC8610HPCD):
25
26 board-control@e8000000 {
27 compatible = "fsl,fpga-pixis";
28 reg = <0xe8000000 32>;
29 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt
new file mode 100644
index 000000000000..088fc471e03a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt
@@ -0,0 +1,67 @@
1* Freescale Communications Processor Module
2
3NOTE: This is an interim binding, and will likely change slightly,
4as more devices are supported. The QE bindings especially are
5incomplete.
6
7* Root CPM node
8
9Properties:
10- compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
11- reg : A 48-byte region beginning with CPCR.
12
13Example:
14 cpm@119c0 {
15 #address-cells = <1>;
16 #size-cells = <1>;
17 #interrupt-cells = <2>;
18 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
19 reg = <119c0 30>;
20 }
21
22* Properties common to mulitple CPM/QE devices
23
24- fsl,cpm-command : This value is ORed with the opcode and command flag
25 to specify the device on which a CPM command operates.
26
27- fsl,cpm-brg : Indicates which baud rate generator the device
28 is associated with. If absent, an unused BRG
29 should be dynamically allocated. If zero, the
30 device uses an external clock rather than a BRG.
31
32- reg : Unless otherwise specified, the first resource represents the
33 scc/fcc/ucc registers, and the second represents the device's
34 parameter RAM region (if it has one).
35
36* Multi-User RAM (MURAM)
37
38The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
39
40Ranges must be set up subject to the following restrictions:
41
42- Children's reg nodes must be offsets from the start of all muram, even
43 if the user-data area does not begin at zero.
44- If multiple range entries are used, the difference between the parent
45 address and the child address must be the same in all, so that a single
46 mapping can cover them all while maintaining the ability to determine
47 CPM-side offsets with pointer subtraction. It is recommended that
48 multiple range entries not be used.
49- A child address of zero must be translatable, even if no reg resources
50 contain it.
51
52A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
53indicate the portion of muram that is usable by the OS for arbitrary
54purposes. The data node may have an arbitrary number of reg resources,
55all of which contribute to the allocatable muram pool.
56
57Example, based on mpc8272:
58 muram@0 {
59 #address-cells = <1>;
60 #size-cells = <1>;
61 ranges = <0 0 10000>;
62
63 data@0 {
64 compatible = "fsl,cpm-muram-data";
65 reg = <0 2000 9800 800>;
66 };
67 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt
new file mode 100644
index 000000000000..4c7d45eaf025
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt
@@ -0,0 +1,21 @@
1* Baud Rate Generators
2
3Currently defined compatibles:
4fsl,cpm-brg
5fsl,cpm1-brg
6fsl,cpm2-brg
7
8Properties:
9- reg : There may be an arbitrary number of reg resources; BRG
10 numbers are assigned to these in order.
11- clock-frequency : Specifies the base frequency driving
12 the BRG.
13
14Example:
15 brg@119f0 {
16 compatible = "fsl,mpc8272-brg",
17 "fsl,cpm2-brg",
18 "fsl,cpm-brg";
19 reg = <119f0 10 115f0 10>;
20 clock-frequency = <d#25000000>;
21 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt
new file mode 100644
index 000000000000..87bc6048667e
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt
@@ -0,0 +1,41 @@
1* I2C
2
3The I2C controller is expressed as a bus under the CPM node.
4
5Properties:
6- compatible : "fsl,cpm1-i2c", "fsl,cpm2-i2c"
7- reg : On CPM2 devices, the second resource doesn't specify the I2C
8 Parameter RAM itself, but the I2C_BASE field of the CPM2 Parameter RAM
9 (typically 0x8afc 0x2).
10- #address-cells : Should be one. The cell is the i2c device address with
11 the r/w bit set to zero.
12- #size-cells : Should be zero.
13- clock-frequency : Can be used to set the i2c clock frequency. If
14 unspecified, a default frequency of 60kHz is being used.
15The following two properties are deprecated. They are only used by legacy
16i2c drivers to find the bus to probe:
17- linux,i2c-index : Can be used to hard code an i2c bus number. By default,
18 the bus number is dynamically assigned by the i2c core.
19- linux,i2c-class : Can be used to override the i2c class. The class is used
20 by legacy i2c device drivers to find a bus in a specific context like
21 system management, video or sound. By default, I2C_CLASS_HWMON (1) is
22 being used. The definition of the classes can be found in
23 include/i2c/i2c.h
24
25Example, based on mpc823:
26
27 i2c@860 {
28 compatible = "fsl,mpc823-i2c",
29 "fsl,cpm1-i2c";
30 reg = <0x860 0x20 0x3c80 0x30>;
31 interrupts = <16>;
32 interrupt-parent = <&CPM_PIC>;
33 fsl,cpm-command = <0x10>;
34 #address-cells = <1>;
35 #size-cells = <0>;
36
37 rtc@68 {
38 compatible = "dallas,ds1307";
39 reg = <0x68>;
40 };
41 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt
new file mode 100644
index 000000000000..8e3ee1681618
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt
@@ -0,0 +1,18 @@
1* Interrupt Controllers
2
3Currently defined compatibles:
4- fsl,cpm1-pic
5 - only one interrupt cell
6- fsl,pq1-pic
7- fsl,cpm2-pic
8 - second interrupt cell is level/sense:
9 - 2 is falling edge
10 - 8 is active low
11
12Example:
13 interrupt-controller@10c00 {
14 #interrupt-cells = <2>;
15 interrupt-controller;
16 reg = <10c00 80>;
17 compatible = "mpc8272-pic", "fsl,cpm2-pic";
18 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt
new file mode 100644
index 000000000000..74bfda4bb824
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt
@@ -0,0 +1,15 @@
1* USB (Universal Serial Bus Controller)
2
3Properties:
4- compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
5
6Example:
7 usb@11bc0 {
8 #address-cells = <1>;
9 #size-cells = <0>;
10 compatible = "fsl,cpm2-usb";
11 reg = <11b60 18 8b00 100>;
12 interrupts = <b 8>;
13 interrupt-parent = <&PIC>;
14 fsl,cpm-command = <2e600000>;
15 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt
new file mode 100644
index 000000000000..1815dfede1bc
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt
@@ -0,0 +1,38 @@
1Every GPIO controller node must have #gpio-cells property defined,
2this information will be used to translate gpio-specifiers.
3
4On CPM1 devices, all ports are using slightly different register layouts.
5Ports A, C and D are 16bit ports and Ports B and E are 32bit ports.
6
7On CPM2 devices, all ports are 32bit ports and use a common register layout.
8
9Required properties:
10- compatible : "fsl,cpm1-pario-bank-a", "fsl,cpm1-pario-bank-b",
11 "fsl,cpm1-pario-bank-c", "fsl,cpm1-pario-bank-d",
12 "fsl,cpm1-pario-bank-e", "fsl,cpm2-pario-bank"
13- #gpio-cells : Should be two. The first cell is the pin number and the
14 second cell is used to specify optional paramters (currently unused).
15- gpio-controller : Marks the port as GPIO controller.
16
17Example of three SOC GPIO banks defined as gpio-controller nodes:
18
19 CPM1_PIO_A: gpio-controller@950 {
20 #gpio-cells = <2>;
21 compatible = "fsl,cpm1-pario-bank-a";
22 reg = <0x950 0x10>;
23 gpio-controller;
24 };
25
26 CPM1_PIO_B: gpio-controller@ab8 {
27 #gpio-cells = <2>;
28 compatible = "fsl,cpm1-pario-bank-b";
29 reg = <0xab8 0x10>;
30 gpio-controller;
31 };
32
33 CPM1_PIO_E: gpio-controller@ac8 {
34 #gpio-cells = <2>;
35 compatible = "fsl,cpm1-pario-bank-e";
36 reg = <0xac8 0x18>;
37 gpio-controller;
38 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt
new file mode 100644
index 000000000000..0e4269446580
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt
@@ -0,0 +1,45 @@
1* Network
2
3Currently defined compatibles:
4- fsl,cpm1-scc-enet
5- fsl,cpm2-scc-enet
6- fsl,cpm1-fec-enet
7- fsl,cpm2-fcc-enet (third resource is GFEMR)
8- fsl,qe-enet
9
10Example:
11
12 ethernet@11300 {
13 device_type = "network";
14 compatible = "fsl,mpc8272-fcc-enet",
15 "fsl,cpm2-fcc-enet";
16 reg = <11300 20 8400 100 11390 1>;
17 local-mac-address = [ 00 00 00 00 00 00 ];
18 interrupts = <20 8>;
19 interrupt-parent = <&PIC>;
20 phy-handle = <&PHY0>;
21 fsl,cpm-command = <12000300>;
22 };
23
24* MDIO
25
26Currently defined compatibles:
27fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
28fsl,cpm2-mdio-bitbang (reg is port C registers)
29
30Properties for fsl,cpm2-mdio-bitbang:
31fsl,mdio-pin : pin of port C controlling mdio data
32fsl,mdc-pin : pin of port C controlling mdio clock
33
34Example:
35 mdio@10d40 {
36 device_type = "mdio";
37 compatible = "fsl,mpc8272ads-mdio-bitbang",
38 "fsl,mpc8272-mdio-bitbang",
39 "fsl,cpm2-mdio-bitbang";
40 reg = <10d40 14>;
41 #address-cells = <1>;
42 #size-cells = <0>;
43 fsl,mdio-pin = <12>;
44 fsl,mdc-pin = <13>;
45 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt
new file mode 100644
index 000000000000..78790d58dc2c
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt
@@ -0,0 +1,58 @@
1* Freescale QUICC Engine module (QE)
2This represents qe module that is installed on PowerQUICC II Pro.
3
4NOTE: This is an interim binding; it should be updated to fit
5in with the CPM binding later in this document.
6
7Basically, it is a bus of devices, that could act more or less
8as a complete entity (UCC, USB etc ). All of them should be siblings on
9the "root" qe node, using the common properties from there.
10The description below applies to the qe of MPC8360 and
11more nodes and properties would be extended in the future.
12
13i) Root QE device
14
15Required properties:
16- compatible : should be "fsl,qe";
17- model : precise model of the QE, Can be "QE", "CPM", or "CPM2"
18- reg : offset and length of the device registers.
19- bus-frequency : the clock frequency for QUICC Engine.
20
21Recommended properties
22- brg-frequency : the internal clock source frequency for baud-rate
23 generators in Hz.
24
25Example:
26 qe@e0100000 {
27 #address-cells = <1>;
28 #size-cells = <1>;
29 #interrupt-cells = <2>;
30 compatible = "fsl,qe";
31 ranges = <0 e0100000 00100000>;
32 reg = <e0100000 480>;
33 brg-frequency = <0>;
34 bus-frequency = <179A7B00>;
35 }
36
37* Multi-User RAM (MURAM)
38
39Required properties:
40- compatible : should be "fsl,qe-muram", "fsl,cpm-muram".
41- mode : the could be "host" or "slave".
42- ranges : Should be defined as specified in 1) to describe the
43 translation of MURAM addresses.
44- data-only : sub-node which defines the address area under MURAM
45 bus that can be allocated as data/parameter
46
47Example:
48
49 muram@10000 {
50 compatible = "fsl,qe-muram", "fsl,cpm-muram";
51 ranges = <0 00010000 0000c000>;
52
53 data-only@0{
54 compatible = "fsl,qe-muram-data",
55 "fsl,cpm-muram-data";
56 reg = <0 c000>;
57 };
58 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt
new file mode 100644
index 000000000000..6c238f59b2a9
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt
@@ -0,0 +1,24 @@
1* Uploaded QE firmware
2
3 If a new firwmare has been uploaded to the QE (usually by the
4 boot loader), then a 'firmware' child node should be added to the QE
5 node. This node provides information on the uploaded firmware that
6 device drivers may need.
7
8 Required properties:
9 - id: The string name of the firmware. This is taken from the 'id'
10 member of the qe_firmware structure of the uploaded firmware.
11 Device drivers can search this string to determine if the
12 firmware they want is already present.
13 - extended-modes: The Extended Modes bitfield, taken from the
14 firmware binary. It is a 64-bit number represented
15 as an array of two 32-bit numbers.
16 - virtual-traps: The virtual traps, taken from the firmware binary.
17 It is an array of 8 32-bit numbers.
18
19Example:
20 firmware {
21 id = "Soft-UART";
22 extended-modes = <0 0>;
23 virtual-traps = <0 0 0 0 0 0 0 0>;
24 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt
new file mode 100644
index 000000000000..60984260207b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt
@@ -0,0 +1,51 @@
1* Parallel I/O Ports
2
3This node configures Parallel I/O ports for CPUs with QE support.
4The node should reside in the "soc" node of the tree. For each
5device that using parallel I/O ports, a child node should be created.
6See the definition of the Pin configuration nodes below for more
7information.
8
9Required properties:
10- device_type : should be "par_io".
11- reg : offset to the register set and its length.
12- num-ports : number of Parallel I/O ports
13
14Example:
15par_io@1400 {
16 reg = <1400 100>;
17 #address-cells = <1>;
18 #size-cells = <0>;
19 device_type = "par_io";
20 num-ports = <7>;
21 ucc_pin@01 {
22 ......
23 };
24
25Note that "par_io" nodes are obsolete, and should not be used for
26the new device trees. Instead, each Par I/O bank should be represented
27via its own gpio-controller node:
28
29Required properties:
30- #gpio-cells : should be "2".
31- compatible : should be "fsl,<chip>-qe-pario-bank",
32 "fsl,mpc8323-qe-pario-bank".
33- reg : offset to the register set and its length.
34- gpio-controller : node to identify gpio controllers.
35
36Example:
37 qe_pio_a: gpio-controller@1400 {
38 #gpio-cells = <2>;
39 compatible = "fsl,mpc8360-qe-pario-bank",
40 "fsl,mpc8323-qe-pario-bank";
41 reg = <0x1400 0x18>;
42 gpio-controller;
43 };
44
45 qe_pio_e: gpio-controller@1460 {
46 #gpio-cells = <2>;
47 compatible = "fsl,mpc8360-qe-pario-bank",
48 "fsl,mpc8323-qe-pario-bank";
49 reg = <0x1460 0x18>;
50 gpio-controller;
51 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt
new file mode 100644
index 000000000000..c5b43061db3a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt
@@ -0,0 +1,60 @@
1* Pin configuration nodes
2
3Required properties:
4- linux,phandle : phandle of this node; likely referenced by a QE
5 device.
6- pio-map : array of pin configurations. Each pin is defined by 6
7 integers. The six numbers are respectively: port, pin, dir,
8 open_drain, assignment, has_irq.
9 - port : port number of the pin; 0-6 represent port A-G in UM.
10 - pin : pin number in the port.
11 - dir : direction of the pin, should encode as follows:
12
13 0 = The pin is disabled
14 1 = The pin is an output
15 2 = The pin is an input
16 3 = The pin is I/O
17
18 - open_drain : indicates the pin is normal or wired-OR:
19
20 0 = The pin is actively driven as an output
21 1 = The pin is an open-drain driver. As an output, the pin is
22 driven active-low, otherwise it is three-stated.
23
24 - assignment : function number of the pin according to the Pin Assignment
25 tables in User Manual. Each pin can have up to 4 possible functions in
26 QE and two options for CPM.
27 - has_irq : indicates if the pin is used as source of external
28 interrupts.
29
30Example:
31 ucc_pin@01 {
32 linux,phandle = <140001>;
33 pio-map = <
34 /* port pin dir open_drain assignment has_irq */
35 0 3 1 0 1 0 /* TxD0 */
36 0 4 1 0 1 0 /* TxD1 */
37 0 5 1 0 1 0 /* TxD2 */
38 0 6 1 0 1 0 /* TxD3 */
39 1 6 1 0 3 0 /* TxD4 */
40 1 7 1 0 1 0 /* TxD5 */
41 1 9 1 0 2 0 /* TxD6 */
42 1 a 1 0 2 0 /* TxD7 */
43 0 9 2 0 1 0 /* RxD0 */
44 0 a 2 0 1 0 /* RxD1 */
45 0 b 2 0 1 0 /* RxD2 */
46 0 c 2 0 1 0 /* RxD3 */
47 0 d 2 0 1 0 /* RxD4 */
48 1 1 2 0 2 0 /* RxD5 */
49 1 0 2 0 2 0 /* RxD6 */
50 1 4 2 0 2 0 /* RxD7 */
51 0 7 1 0 1 0 /* TX_EN */
52 0 8 1 0 1 0 /* TX_ER */
53 0 f 2 0 1 0 /* RX_DV */
54 0 10 2 0 1 0 /* RX_ER */
55 0 0 2 0 1 0 /* RX_CLK */
56 2 9 1 0 3 0 /* GTX_CLK - CLK10 */
57 2 8 2 0 1 0>; /* GTX125 - CLK9 */
58 };
59
60
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt
new file mode 100644
index 000000000000..e47734bee3f0
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt
@@ -0,0 +1,70 @@
1* UCC (Unified Communications Controllers)
2
3Required properties:
4- device_type : should be "network", "hldc", "uart", "transparent"
5 "bisync", "atm", or "serial".
6- compatible : could be "ucc_geth" or "fsl_atm" and so on.
7- cell-index : the ucc number(1-8), corresponding to UCCx in UM.
8- reg : Offset and length of the register set for the device
9- interrupts : <a b> where a is the interrupt number and b is a
10 field that represents an encoding of the sense and level
11 information for the interrupt. This should be encoded based on
12 the information in section 2) depending on the type of interrupt
13 controller you have.
14- interrupt-parent : the phandle for the interrupt controller that
15 services interrupts for this device.
16- pio-handle : The phandle for the Parallel I/O port configuration.
17- port-number : for UART drivers, the port number to use, between 0 and 3.
18 This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
19 The port number is added to the minor number of the device. Unlike the
20 CPM UART driver, the port-number is required for the QE UART driver.
21- soft-uart : for UART drivers, if specified this means the QE UART device
22 driver should use "Soft-UART" mode, which is needed on some SOCs that have
23 broken UART hardware. Soft-UART is provided via a microcode upload.
24- rx-clock-name: the UCC receive clock source
25 "none": clock source is disabled
26 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
27 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
28- tx-clock-name: the UCC transmit clock source
29 "none": clock source is disabled
30 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
31 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
32The following two properties are deprecated. rx-clock has been replaced
33with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
34Drivers that currently use the deprecated properties should continue to
35do so, in order to support older device trees, but they should be updated
36to check for the new properties first.
37- rx-clock : represents the UCC receive clock source.
38 0x00 : clock source is disabled;
39 0x1~0x10 : clock source is BRG1~BRG16 respectively;
40 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
41- tx-clock: represents the UCC transmit clock source;
42 0x00 : clock source is disabled;
43 0x1~0x10 : clock source is BRG1~BRG16 respectively;
44 0x11~0x28: clock source is QE_CLK1~QE_CLK24 respectively.
45
46Required properties for network device_type:
47- mac-address : list of bytes representing the ethernet address.
48- phy-handle : The phandle for the PHY connected to this controller.
49
50Recommended properties:
51- phy-connection-type : a string naming the controller/PHY interface type,
52 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
53 Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
54 "tbi", or "rtbi".
55
56Example:
57 ucc@2000 {
58 device_type = "network";
59 compatible = "ucc_geth";
60 cell-index = <1>;
61 reg = <2000 200>;
62 interrupts = <a0 0>;
63 interrupt-parent = <700>;
64 mac-address = [ 00 04 9f 00 23 23 ];
65 rx-clock = "none";
66 tx-clock = "clk9";
67 phy-handle = <212000>;
68 phy-connection-type = "gmii";
69 pio-handle = <140001>;
70 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt
new file mode 100644
index 000000000000..9ccd5f30405b
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt
@@ -0,0 +1,37 @@
1Freescale QUICC Engine USB Controller
2
3Required properties:
4- compatible : should be "fsl,<chip>-qe-usb", "fsl,mpc8323-qe-usb".
5- reg : the first two cells should contain usb registers location and
6 length, the next two two cells should contain PRAM location and
7 length.
8- interrupts : should contain USB interrupt.
9- interrupt-parent : interrupt source phandle.
10- fsl,fullspeed-clock : specifies the full speed USB clock source:
11 "none": clock source is disabled
12 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
13 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
14- fsl,lowspeed-clock : specifies the low speed USB clock source:
15 "none": clock source is disabled
16 "brg1" through "brg16": clock source is BRG1-BRG16, respectively
17 "clk1" through "clk24": clock source is CLK1-CLK24, respectively
18- hub-power-budget : USB power budget for the root hub, in mA.
19- gpios : should specify GPIOs in this order: USBOE, USBTP, USBTN, USBRP,
20 USBRN, SPEED (optional), and POWER (optional).
21
22Example:
23
24usb@6c0 {
25 compatible = "fsl,mpc8360-qe-usb", "fsl,mpc8323-qe-usb";
26 reg = <0x6c0 0x40 0x8b00 0x100>;
27 interrupts = <11>;
28 interrupt-parent = <&qeic>;
29 fsl,fullspeed-clock = "clk21";
30 gpios = <&qe_pio_b 2 0 /* USBOE */
31 &qe_pio_b 3 0 /* USBTP */
32 &qe_pio_b 8 0 /* USBTN */
33 &qe_pio_b 9 0 /* USBRP */
34 &qe_pio_b 11 0 /* USBRN */
35 &qe_pio_e 20 0 /* SPEED */
36 &qe_pio_e 21 0 /* POWER */>;
37};
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt
new file mode 100644
index 000000000000..2ea76d9d137c
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt
@@ -0,0 +1,32 @@
1* Serial
2
3Currently defined compatibles:
4- fsl,cpm1-smc-uart
5- fsl,cpm2-smc-uart
6- fsl,cpm1-scc-uart
7- fsl,cpm2-scc-uart
8- fsl,qe-uart
9
10Modem control lines connected to GPIO controllers are listed in the gpios
11property as described in booting-without-of.txt, section IX.1 in the following
12order:
13
14CTS, RTS, DCD, DSR, DTR, and RI.
15
16The gpios property is optional and can be left out when control lines are
17not used.
18
19Example:
20
21 serial@11a00 {
22 device_type = "serial";
23 compatible = "fsl,mpc8272-scc-uart",
24 "fsl,cpm2-scc-uart";
25 reg = <11a00 20 8000 100>;
26 interrupts = <28 8>;
27 interrupt-parent = <&PIC>;
28 fsl,cpm-brg = <1>;
29 fsl,cpm-command = <00800000>;
30 gpios = <&gpio_c 15 0
31 &gpio_d 29 0>;
32 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/diu.txt b/Documentation/powerpc/dts-bindings/fsl/diu.txt
new file mode 100644
index 000000000000..deb35de70988
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/diu.txt
@@ -0,0 +1,18 @@
1* Freescale Display Interface Unit
2
3The Freescale DIU is a LCD controller, with proper hardware, it can also
4drive DVI monitors.
5
6Required properties:
7- compatible : should be "fsl-diu".
8- reg : should contain at least address and length of the DIU register
9 set.
10- Interrupts : one DIU interrupt should be describe here.
11
12Example (MPC8610HPCD):
13 display@2c000 {
14 compatible = "fsl,diu";
15 reg = <0x2c000 100>;
16 interrupts = <72 2>;
17 interrupt-parent = <&mpic>;
18 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/powerpc/dts-bindings/fsl/dma.txt
new file mode 100644
index 000000000000..86826df00e64
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/dma.txt
@@ -0,0 +1,127 @@
1* Freescale 83xx DMA Controller
2
3Freescale PowerPC 83xx have on chip general purpose DMA controllers.
4
5Required properties:
6
7- compatible : compatible list, contains 2 entries, first is
8 "fsl,CHIP-dma", where CHIP is the processor
9 (mpc8349, mpc8360, etc.) and the second is
10 "fsl,elo-dma"
11- reg : <registers mapping for DMA general status reg>
12- ranges : Should be defined as specified in 1) to describe the
13 DMA controller channels.
14- cell-index : controller index. 0 for controller @ 0x8100
15- interrupts : <interrupt mapping for DMA IRQ>
16- interrupt-parent : optional, if needed for interrupt mapping
17
18
19- DMA channel nodes:
20 - compatible : compatible list, contains 2 entries, first is
21 "fsl,CHIP-dma-channel", where CHIP is the processor
22 (mpc8349, mpc8350, etc.) and the second is
23 "fsl,elo-dma-channel"
24 - reg : <registers mapping for channel>
25 - cell-index : dma channel index starts at 0.
26
27Optional properties:
28 - interrupts : <interrupt mapping for DMA channel IRQ>
29 (on 83xx this is expected to be identical to
30 the interrupts property of the parent node)
31 - interrupt-parent : optional, if needed for interrupt mapping
32
33Example:
34 dma@82a8 {
35 #address-cells = <1>;
36 #size-cells = <1>;
37 compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
38 reg = <82a8 4>;
39 ranges = <0 8100 1a4>;
40 interrupt-parent = <&ipic>;
41 interrupts = <47 8>;
42 cell-index = <0>;
43 dma-channel@0 {
44 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
45 cell-index = <0>;
46 reg = <0 80>;
47 };
48 dma-channel@80 {
49 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
50 cell-index = <1>;
51 reg = <80 80>;
52 };
53 dma-channel@100 {
54 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
55 cell-index = <2>;
56 reg = <100 80>;
57 };
58 dma-channel@180 {
59 compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
60 cell-index = <3>;
61 reg = <180 80>;
62 };
63 };
64
65* Freescale 85xx/86xx DMA Controller
66
67Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
68
69Required properties:
70
71- compatible : compatible list, contains 2 entries, first is
72 "fsl,CHIP-dma", where CHIP is the processor
73 (mpc8540, mpc8540, etc.) and the second is
74 "fsl,eloplus-dma"
75- reg : <registers mapping for DMA general status reg>
76- cell-index : controller index. 0 for controller @ 0x21000,
77 1 for controller @ 0xc000
78- ranges : Should be defined as specified in 1) to describe the
79 DMA controller channels.
80
81- DMA channel nodes:
82 - compatible : compatible list, contains 2 entries, first is
83 "fsl,CHIP-dma-channel", where CHIP is the processor
84 (mpc8540, mpc8560, etc.) and the second is
85 "fsl,eloplus-dma-channel"
86 - cell-index : dma channel index starts at 0.
87 - reg : <registers mapping for channel>
88 - interrupts : <interrupt mapping for DMA channel IRQ>
89 - interrupt-parent : optional, if needed for interrupt mapping
90
91Example:
92 dma@21300 {
93 #address-cells = <1>;
94 #size-cells = <1>;
95 compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
96 reg = <21300 4>;
97 ranges = <0 21100 200>;
98 cell-index = <0>;
99 dma-channel@0 {
100 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
101 reg = <0 80>;
102 cell-index = <0>;
103 interrupt-parent = <&mpic>;
104 interrupts = <14 2>;
105 };
106 dma-channel@80 {
107 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
108 reg = <80 80>;
109 cell-index = <1>;
110 interrupt-parent = <&mpic>;
111 interrupts = <15 2>;
112 };
113 dma-channel@100 {
114 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
115 reg = <100 80>;
116 cell-index = <2>;
117 interrupt-parent = <&mpic>;
118 interrupts = <16 2>;
119 };
120 dma-channel@180 {
121 compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
122 reg = <180 80>;
123 cell-index = <3>;
124 interrupt-parent = <&mpic>;
125 interrupts = <17 2>;
126 };
127 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/gtm.txt b/Documentation/powerpc/dts-bindings/fsl/gtm.txt
new file mode 100644
index 000000000000..9a33efded4bc
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/gtm.txt
@@ -0,0 +1,31 @@
1* Freescale General-purpose Timers Module
2
3Required properties:
4 - compatible : should be
5 "fsl,<chip>-gtm", "fsl,gtm" for SOC GTMs
6 "fsl,<chip>-qe-gtm", "fsl,qe-gtm", "fsl,gtm" for QE GTMs
7 "fsl,<chip>-cpm2-gtm", "fsl,cpm2-gtm", "fsl,gtm" for CPM2 GTMs
8 - reg : should contain gtm registers location and length (0x40).
9 - interrupts : should contain four interrupts.
10 - interrupt-parent : interrupt source phandle.
11 - clock-frequency : specifies the frequency driving the timer.
12
13Example:
14
15timer@500 {
16 compatible = "fsl,mpc8360-gtm", "fsl,gtm";
17 reg = <0x500 0x40>;
18 interrupts = <90 8 78 8 84 8 72 8>;
19 interrupt-parent = <&ipic>;
20 /* filled by u-boot */
21 clock-frequency = <0>;
22};
23
24timer@440 {
25 compatible = "fsl,mpc8360-qe-gtm", "fsl,qe-gtm", "fsl,gtm";
26 reg = <0x440 0x40>;
27 interrupts = <12 13 14 15>;
28 interrupt-parent = <&qeic>;
29 /* filled by u-boot */
30 clock-frequency = <0>;
31};
diff --git a/Documentation/powerpc/dts-bindings/fsl/guts.txt b/Documentation/powerpc/dts-bindings/fsl/guts.txt
new file mode 100644
index 000000000000..9e7a2417dac5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/guts.txt
@@ -0,0 +1,25 @@
1* Global Utilities Block
2
3The global utilities block controls power management, I/O device
4enabling, power-on-reset configuration monitoring, general-purpose
5I/O signal configuration, alternate function selection for multiplexed
6signals, and clock control.
7
8Required properties:
9
10 - compatible : Should define the compatible device type for
11 global-utilities.
12 - reg : Offset and length of the register set for the device.
13
14Recommended properties:
15
16 - fsl,has-rstcr : Indicates that the global utilities register set
17 contains a functioning "reset control register" (i.e. the board
18 is wired to reset upon setting the HRESET_REQ bit in this register).
19
20Example:
21 global-utilities@e0000 { /* global utilities block */
22 compatible = "fsl,mpc8548-guts";
23 reg = <e0000 1000>;
24 fsl,has-rstcr;
25 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
new file mode 100644
index 000000000000..d0ab33e21fe6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
@@ -0,0 +1,32 @@
1* I2C
2
3Required properties :
4
5 - device_type : Should be "i2c"
6 - reg : Offset and length of the register set for the device
7
8Recommended properties :
9
10 - compatible : Should be "fsl-i2c" for parts compatible with
11 Freescale I2C specifications.
12 - interrupts : <a b> where a is the interrupt number and b is a
13 field that represents an encoding of the sense and level
14 information for the interrupt. This should be encoded based on
15 the information in section 2) depending on the type of interrupt
16 controller you have.
17 - interrupt-parent : the phandle for the interrupt controller that
18 services interrupts for this device.
19 - dfsrr : boolean; if defined, indicates that this I2C device has
20 a digital filter sampling rate register
21 - fsl5200-clocking : boolean; if defined, indicated that this device
22 uses the FSL 5200 clocking mechanism.
23
24Example :
25 i2c@3000 {
26 interrupt-parent = <40000>;
27 interrupts = <1b 3>;
28 reg = <3000 18>;
29 device_type = "i2c";
30 compatible = "fsl-i2c";
31 dfsrr;
32 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/lbc.txt b/Documentation/powerpc/dts-bindings/fsl/lbc.txt
new file mode 100644
index 000000000000..3300fec501c5
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/lbc.txt
@@ -0,0 +1,35 @@
1* Chipselect/Local Bus
2
3Properties:
4- name : Should be localbus
5- #address-cells : Should be either two or three. The first cell is the
6 chipselect number, and the remaining cells are the
7 offset into the chipselect.
8- #size-cells : Either one or two, depending on how large each chipselect
9 can be.
10- ranges : Each range corresponds to a single chipselect, and cover
11 the entire access window as configured.
12
13Example:
14 localbus@f0010100 {
15 compatible = "fsl,mpc8272-localbus",
16 "fsl,pq2-localbus";
17 #address-cells = <2>;
18 #size-cells = <1>;
19 reg = <f0010100 40>;
20
21 ranges = <0 0 fe000000 02000000
22 1 0 f4500000 00008000>;
23
24 flash@0,0 {
25 compatible = "jedec-flash";
26 reg = <0 0 2000000>;
27 bank-width = <4>;
28 device-width = <1>;
29 };
30
31 board-control@1,0 {
32 reg = <1 0 20>;
33 compatible = "fsl,mpc8272ads-bcsr";
34 };
35 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt
new file mode 100644
index 000000000000..0f766333b6eb
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt
@@ -0,0 +1,17 @@
1Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU)
2
3Required properties:
4- compatible : "fsl,<mcu-chip>-<board>", "fsl,mcu-mpc8349emitx".
5- reg : should specify I2C address (0x0a).
6- #gpio-cells : should be 2.
7- gpio-controller : should be present.
8
9Example:
10
11mcu@0a {
12 #gpio-cells = <2>;
13 compatible = "fsl,mc9s08qg8-mpc8349emitx",
14 "fsl,mcu-mpc8349emitx";
15 reg = <0x0a>;
16 gpio-controller;
17};
diff --git a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt b/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt
new file mode 100644
index 000000000000..b26b91992c55
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt
@@ -0,0 +1,36 @@
1* Freescale MSI interrupt controller
2
3Reguired properities:
4- compatible : compatible list, contains 2 entries,
5 first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
6 etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on
7 the parent type.
8- reg : should contain the address and the length of the shared message
9 interrupt register set.
10- msi-available-ranges: use <start count> style section to define which
11 msi interrupt can be used in the 256 msi interrupts. This property is
12 optional, without this, all the 256 MSI interrupts can be used.
13- interrupts : each one of the interrupts here is one entry per 32 MSIs,
14 and routed to the host interrupt controller. the interrupts should
15 be set as edge sensitive.
16- interrupt-parent: the phandle for the interrupt controller
17 that services interrupts for this device. for 83xx cpu, the interrupts
18 are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed
19 to MPIC.
20
21Example:
22 msi@41600 {
23 compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
24 reg = <0x41600 0x80>;
25 msi-available-ranges = <0 0x100>;
26 interrupts = <
27 0xe0 0
28 0xe1 0
29 0xe2 0
30 0xe3 0
31 0xe4 0
32 0xe5 0
33 0xe6 0
34 0xe7 0>;
35 interrupt-parent = <&mpic>;
36 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/pmc.txt b/Documentation/powerpc/dts-bindings/fsl/pmc.txt
new file mode 100644
index 000000000000..02f6f43ee1b7
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/pmc.txt
@@ -0,0 +1,63 @@
1* Power Management Controller
2
3Properties:
4- compatible: "fsl,<chip>-pmc".
5
6 "fsl,mpc8349-pmc" should be listed for any chip whose PMC is
7 compatible. "fsl,mpc8313-pmc" should also be listed for any chip
8 whose PMC is compatible, and implies deep-sleep capability.
9
10 "fsl,mpc8548-pmc" should be listed for any chip whose PMC is
11 compatible. "fsl,mpc8536-pmc" should also be listed for any chip
12 whose PMC is compatible, and implies deep-sleep capability.
13
14 "fsl,mpc8641d-pmc" should be listed for any chip whose PMC is
15 compatible; all statements below that apply to "fsl,mpc8548-pmc" also
16 apply to "fsl,mpc8641d-pmc".
17
18 Compatibility does not include bit assigments in SCCR/PMCDR/DEVDISR; these
19 bit assigments are indicated via the sleep specifier in each device's
20 sleep property.
21
22- reg: For devices compatible with "fsl,mpc8349-pmc", the first resource
23 is the PMC block, and the second resource is the Clock Configuration
24 block.
25
26 For devices compatible with "fsl,mpc8548-pmc", the first resource
27 is a 32-byte block beginning with DEVDISR.
28
29- interrupts: For "fsl,mpc8349-pmc"-compatible devices, the first
30 resource is the PMC block interrupt.
31
32- fsl,mpc8313-wakeup-timer: For "fsl,mpc8313-pmc"-compatible devices,
33 this is a phandle to an "fsl,gtm" node on which timer 4 can be used as
34 a wakeup source from deep sleep.
35
36Sleep specifiers:
37
38 fsl,mpc8349-pmc: Sleep specifiers consist of one cell. For each bit
39 that is set in the cell, the corresponding bit in SCCR will be saved
40 and cleared on suspend, and restored on resume. This sleep controller
41 supports disabling and resuming devices at any time.
42
43 fsl,mpc8536-pmc: Sleep specifiers consist of three cells, the third of
44 which will be ORed into PMCDR upon suspend, and cleared from PMCDR
45 upon resume. The first two cells are as described for fsl,mpc8578-pmc.
46 This sleep controller only supports disabling devices during system
47 sleep, or permanently.
48
49 fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the
50 first of which will be ORed into DEVDISR (and the second into
51 DEVDISR2, if present -- this cell should be zero or absent if the
52 hardware does not have DEVDISR2) upon a request for permanent device
53 disabling. This sleep controller does not support configuring devices
54 to disable during system sleep (unless supported by another compatible
55 match), or dynamically.
56
57Example:
58
59 power@b00 {
60 compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc";
61 reg = <0xb00 0x100 0xa00 0x100>;
62 interrupts = <80 8>;
63 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/sata.txt b/Documentation/powerpc/dts-bindings/fsl/sata.txt
new file mode 100644
index 000000000000..b46bcf46c3d8
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/sata.txt
@@ -0,0 +1,29 @@
1* Freescale 8xxx/3.0 Gb/s SATA nodes
2
3SATA nodes are defined to describe on-chip Serial ATA controllers.
4Each SATA port should have its own node.
5
6Required properties:
7- compatible : compatible list, contains 2 entries, first is
8 "fsl,CHIP-sata", where CHIP is the processor
9 (mpc8315, mpc8379, etc.) and the second is
10 "fsl,pq-sata"
11- interrupts : <interrupt mapping for SATA IRQ>
12- cell-index : controller index.
13 1 for controller @ 0x18000
14 2 for controller @ 0x19000
15 3 for controller @ 0x1a000
16 4 for controller @ 0x1b000
17
18Optional properties:
19- interrupt-parent : optional, if needed for interrupt mapping
20- reg : <registers mapping>
21
22Example:
23 sata@18000 {
24 compatible = "fsl,mpc8379-sata", "fsl,pq-sata";
25 reg = <0x18000 0x1000>;
26 cell-index = <1>;
27 interrupts = <2c 8>;
28 interrupt-parent = < &ipic >;
29 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/sec.txt b/Documentation/powerpc/dts-bindings/fsl/sec.txt
new file mode 100644
index 000000000000..2b6f2d45c45a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/sec.txt
@@ -0,0 +1,68 @@
1Freescale SoC SEC Security Engines
2
3Required properties:
4
5- compatible : Should contain entries for this and backward compatible
6 SEC versions, high to low, e.g., "fsl,sec2.1", "fsl,sec2.0"
7- reg : Offset and length of the register set for the device
8- interrupts : the SEC's interrupt number
9- fsl,num-channels : An integer representing the number of channels
10 available.
11- fsl,channel-fifo-len : An integer representing the number of
12 descriptor pointers each channel fetch fifo can hold.
13- fsl,exec-units-mask : The bitmask representing what execution units
14 (EUs) are available. It's a single 32-bit cell. EU information
15 should be encoded following the SEC's Descriptor Header Dword
16 EU_SEL0 field documentation, i.e. as follows:
17
18 bit 0 = reserved - should be 0
19 bit 1 = set if SEC has the ARC4 EU (AFEU)
20 bit 2 = set if SEC has the DES/3DES EU (DEU)
21 bit 3 = set if SEC has the message digest EU (MDEU/MDEU-A)
22 bit 4 = set if SEC has the random number generator EU (RNG)
23 bit 5 = set if SEC has the public key EU (PKEU)
24 bit 6 = set if SEC has the AES EU (AESU)
25 bit 7 = set if SEC has the Kasumi EU (KEU)
26 bit 8 = set if SEC has the CRC EU (CRCU)
27 bit 11 = set if SEC has the message digest EU extended alg set (MDEU-B)
28
29remaining bits are reserved for future SEC EUs.
30
31- fsl,descriptor-types-mask : The bitmask representing what descriptors
32 are available. It's a single 32-bit cell. Descriptor type information
33 should be encoded following the SEC's Descriptor Header Dword DESC_TYPE
34 field documentation, i.e. as follows:
35
36 bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
37 bit 1 = set if SEC supports the ipsec_esp descriptor type
38 bit 2 = set if SEC supports the common_nonsnoop desc. type
39 bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
40 bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
41 bit 5 = set if SEC supports the srtp descriptor type
42 bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
43 bit 7 = set if SEC supports the pkeu_assemble descriptor type
44 bit 8 = set if SEC supports the aesu_key_expand_output desc.type
45 bit 9 = set if SEC supports the pkeu_ptmul descriptor type
46 bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
47 bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
48
49 ..and so on and so forth.
50
51Optional properties:
52
53- interrupt-parent : the phandle for the interrupt controller that
54 services interrupts for this device.
55
56Example:
57
58 /* MPC8548E */
59 crypto@30000 {
60 compatible = "fsl,sec2.1", "fsl,sec2.0";
61 reg = <0x30000 0x10000>;
62 interrupts = <29 2>;
63 interrupt-parent = <&mpic>;
64 fsl,num-channels = <4>;
65 fsl,channel-fifo-len = <24>;
66 fsl,exec-units-mask = <0xfe>;
67 fsl,descriptor-types-mask = <0x12b0ebf>;
68 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/powerpc/dts-bindings/fsl/spi.txt
new file mode 100644
index 000000000000..e7d9a344c4f4
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -0,0 +1,24 @@
1* SPI (Serial Peripheral Interface)
2
3Required properties:
4- cell-index : SPI controller index.
5- compatible : should be "fsl,spi".
6- mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
7- reg : Offset and length of the register set for the device
8- interrupts : <a b> where a is the interrupt number and b is a
9 field that represents an encoding of the sense and level
10 information for the interrupt. This should be encoded based on
11 the information in section 2) depending on the type of interrupt
12 controller you have.
13- interrupt-parent : the phandle for the interrupt controller that
14 services interrupts for this device.
15
16Example:
17 spi@4c0 {
18 cell-index = <0>;
19 compatible = "fsl,spi";
20 reg = <4c0 40>;
21 interrupts = <82 0>;
22 interrupt-parent = <700>;
23 mode = "cpu";
24 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/ssi.txt b/Documentation/powerpc/dts-bindings/fsl/ssi.txt
new file mode 100644
index 000000000000..d100555d488a
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/ssi.txt
@@ -0,0 +1,38 @@
1Freescale Synchronous Serial Interface
2
3The SSI is a serial device that communicates with audio codecs. It can
4be programmed in AC97, I2S, left-justified, or right-justified modes.
5
6Required properties:
7- compatible : compatible list, containing "fsl,ssi"
8- cell-index : the SSI, <0> = SSI1, <1> = SSI2, and so on
9- reg : offset and length of the register set for the device
10- interrupts : <a b> where a is the interrupt number and b is a
11 field that represents an encoding of the sense and
12 level information for the interrupt. This should be
13 encoded based on the information in section 2)
14 depending on the type of interrupt controller you
15 have.
16- interrupt-parent : the phandle for the interrupt controller that
17 services interrupts for this device.
18- fsl,mode : the operating mode for the SSI interface
19 "i2s-slave" - I2S mode, SSI is clock slave
20 "i2s-master" - I2S mode, SSI is clock master
21 "lj-slave" - left-justified mode, SSI is clock slave
22 "lj-master" - l.j. mode, SSI is clock master
23 "rj-slave" - right-justified mode, SSI is clock slave
24 "rj-master" - r.j., SSI is clock master
25 "ac97-slave" - AC97 mode, SSI is clock slave
26 "ac97-master" - AC97 mode, SSI is clock master
27
28Optional properties:
29- codec-handle : phandle to a 'codec' node that defines an audio
30 codec connected to this SSI. This node is typically
31 a child of an I2C or other control node.
32
33Child 'codec' node required properties:
34- compatible : compatible list, contains the name of the codec
35
36Child 'codec' node optional properties:
37- clock-frequency : The frequency of the input clock, which typically
38 comes from an on-board dedicated oscillator.
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/powerpc/dts-bindings/fsl/tsec.txt
new file mode 100644
index 000000000000..cf55fa4112d2
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/tsec.txt
@@ -0,0 +1,62 @@
1* MDIO IO device
2
3The MDIO is a bus to which the PHY devices are connected. For each
4device that exists on this bus, a child node should be created. See
5the definition of the PHY node below for an example of how to define
6a PHY.
7
8Required properties:
9 - reg : Offset and length of the register set for the device
10 - compatible : Should define the compatible device type for the
11 mdio. Currently, this is most likely to be "fsl,gianfar-mdio"
12
13Example:
14
15 mdio@24520 {
16 reg = <24520 20>;
17 compatible = "fsl,gianfar-mdio";
18
19 ethernet-phy@0 {
20 ......
21 };
22 };
23
24
25* Gianfar-compatible ethernet nodes
26
27Properties:
28
29 - device_type : Should be "network"
30 - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
31 - compatible : Should be "gianfar"
32 - reg : Offset and length of the register set for the device
33 - local-mac-address : List of bytes representing the ethernet address of
34 this controller
35 - interrupts : For FEC devices, the first interrupt is the device's
36 interrupt. For TSEC and eTSEC devices, the first interrupt is
37 transmit, the second is receive, and the third is error.
38 - phy-handle : The phandle for the PHY connected to this ethernet
39 controller.
40 - fixed-link : <a b c d e> where a is emulated phy id - choose any,
41 but unique to the all specified fixed-links, b is duplex - 0 half,
42 1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
43 pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
44 - phy-connection-type : a string naming the controller/PHY interface type,
45 i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
46 "tbi", or "rtbi". This property is only really needed if the connection
47 is of type "rgmii-id", as all other connection types are detected by
48 hardware.
49 - fsl,magic-packet : If present, indicates that the hardware supports
50 waking up via magic packet.
51
52Example:
53 ethernet@24000 {
54 device_type = "network";
55 model = "TSEC";
56 compatible = "gianfar";
57 reg = <0x24000 0x1000>;
58 local-mac-address = [ 00 E0 0C 00 73 00 ];
59 interrupts = <29 2 30 2 34 2>;
60 interrupt-parent = <&mpic>;
61 phy-handle = <&phy0>
62 };
diff --git a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
new file mode 100644
index 000000000000..84a04d5eb8e6
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
@@ -0,0 +1,28 @@
1Freescale Localbus UPM programmed to work with NAND flash
2
3Required properties:
4- compatible : "fsl,upm-nand".
5- reg : should specify localbus chip select and size used for the chip.
6- fsl,upm-addr-offset : UPM pattern offset for the address latch.
7- fsl,upm-cmd-offset : UPM pattern offset for the command latch.
8- gpios : may specify optional GPIO connected to the Ready-Not-Busy pin.
9
10Example:
11
12upm@1,0 {
13 compatible = "fsl,upm-nand";
14 reg = <1 0 1>;
15 fsl,upm-addr-offset = <16>;
16 fsl,upm-cmd-offset = <8>;
17 gpios = <&qe_pio_e 18 0>;
18
19 flash {
20 #address-cells = <1>;
21 #size-cells = <1>;
22 compatible = "...";
23
24 partition@0 {
25 ...
26 };
27 };
28};
diff --git a/Documentation/powerpc/dts-bindings/fsl/usb.txt b/Documentation/powerpc/dts-bindings/fsl/usb.txt
new file mode 100644
index 000000000000..b00152402694
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/fsl/usb.txt
@@ -0,0 +1,59 @@
1Freescale SOC USB controllers
2
3The device node for a USB controller that is part of a Freescale
4SOC is as described in the document "Open Firmware Recommended
5Practice : Universal Serial Bus" with the following modifications
6and additions :
7
8Required properties :
9 - compatible : Should be "fsl-usb2-mph" for multi port host USB
10 controllers, or "fsl-usb2-dr" for dual role USB controllers
11 - phy_type : For multi port host USB controllers, should be one of
12 "ulpi", or "serial". For dual role USB controllers, should be
13 one of "ulpi", "utmi", "utmi_wide", or "serial".
14 - reg : Offset and length of the register set for the device
15 - port0 : boolean; if defined, indicates port0 is connected for
16 fsl-usb2-mph compatible controllers. Either this property or
17 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
18 controllers.
19 - port1 : boolean; if defined, indicates port1 is connected for
20 fsl-usb2-mph compatible controllers. Either this property or
21 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
22 controllers.
23 - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
24 controllers. Can be "host", "peripheral", or "otg". Default to
25 "host" if not defined for backward compatibility.
26
27Recommended properties :
28 - interrupts : <a b> where a is the interrupt number and b is a
29 field that represents an encoding of the sense and level
30 information for the interrupt. This should be encoded based on
31 the information in section 2) depending on the type of interrupt
32 controller you have.
33 - interrupt-parent : the phandle for the interrupt controller that
34 services interrupts for this device.
35
36Example multi port host USB controller device node :
37 usb@22000 {
38 compatible = "fsl-usb2-mph";
39 reg = <22000 1000>;
40 #address-cells = <1>;
41 #size-cells = <0>;
42 interrupt-parent = <700>;
43 interrupts = <27 1>;
44 phy_type = "ulpi";
45 port0;
46 port1;
47 };
48
49Example dual role USB controller device node :
50 usb@23000 {
51 compatible = "fsl-usb2-dr";
52 reg = <23000 1000>;
53 #address-cells = <1>;
54 #size-cells = <0>;
55 interrupt-parent = <700>;
56 interrupts = <26 1>;
57 dr_mode = "otg";
58 phy = "ulpi";
59 };
diff --git a/Documentation/powerpc/dts-bindings/gpio/led.txt b/Documentation/powerpc/dts-bindings/gpio/led.txt
new file mode 100644
index 000000000000..ff51f4c0fa9d
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/gpio/led.txt
@@ -0,0 +1,15 @@
1LED connected to GPIO
2
3Required properties:
4- compatible : should be "gpio-led".
5- label : (optional) the label for this LED. If omitted, the label is
6 taken from the node name (excluding the unit address).
7- gpios : should specify LED GPIO.
8
9Example:
10
11led@0 {
12 compatible = "gpio-led";
13 label = "hdd";
14 gpios = <&mcu_pio 0 1>;
15};
diff --git a/Documentation/powerpc/eeh-pci-error-recovery.txt b/Documentation/powerpc/eeh-pci-error-recovery.txt
index df7afe43d462..9d4e33df624c 100644
--- a/Documentation/powerpc/eeh-pci-error-recovery.txt
+++ b/Documentation/powerpc/eeh-pci-error-recovery.txt
@@ -133,7 +133,7 @@ error. Given an arbitrary address, the routine
133pci_get_device_by_addr() will find the pci device associated 133pci_get_device_by_addr() will find the pci device associated
134with that address (if any). 134with that address (if any).
135 135
136The default include/asm-powerpc/io.h macros readb(), inb(), insb(), 136The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(),
137etc. include a check to see if the i/o read returned all-0xff's. 137etc. include a check to see if the i/o read returned all-0xff's.
138If so, these make a call to eeh_dn_check_failure(), which in turn 138If so, these make a call to eeh_dn_check_failure(), which in turn
139asks the firmware if the all-ff's value is the sign of a true EEH 139asks the firmware if the all-ff's value is the sign of a true EEH
diff --git a/Documentation/powerpc/qe_firmware.txt b/Documentation/powerpc/qe_firmware.txt
index 896266432d33..06da4d4b44f9 100644
--- a/Documentation/powerpc/qe_firmware.txt
+++ b/Documentation/powerpc/qe_firmware.txt
@@ -217,7 +217,7 @@ Although it is not recommended, you can specify '0' in the soc.model
217field to skip matching SOCs altogether. 217field to skip matching SOCs altogether.
218 218
219The 'model' field is a 16-bit number that matches the actual SOC. The 219The 'model' field is a 16-bit number that matches the actual SOC. The
220'major' and 'minor' fields are the major and minor revision numbrs, 220'major' and 'minor' fields are the major and minor revision numbers,
221respectively, of the SOC. 221respectively, of the SOC.
222 222
223For example, to match the 8323, revision 1.0: 223For example, to match the 8323, revision 1.0:
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt
index a83ff23cd68c..b65f0799df48 100644
--- a/Documentation/rfkill.txt
+++ b/Documentation/rfkill.txt
@@ -1,89 +1,569 @@
1rfkill - RF switch subsystem support 1rfkill - RF switch subsystem support
2==================================== 2====================================
3 3
41 Implementation details 41 Introduction
52 Driver support 52 Implementation details
63 Userspace support 63 Kernel driver guidelines
73.1 wireless device drivers
83.2 platform/switch drivers
93.3 input device drivers
104 Kernel API
115 Userspace support
7 12
8===============================================================================
91: Implementation details
10 13
11The rfkill switch subsystem offers support for keys often found on laptops 141. Introduction:
12to enable wireless devices like WiFi and Bluetooth. 15
16The rfkill switch subsystem exists to add a generic interface to circuitry that
17can enable or disable the signal output of a wireless *transmitter* of any
18type. By far, the most common use is to disable radio-frequency transmitters.
13 19
14This is done by providing the user 3 possibilities: 20Note that disabling the signal output means that the the transmitter is to be
15 1 - The rfkill system handles all events; userspace is not aware of events. 21made to not emit any energy when "blocked". rfkill is not about blocking data
16 2 - The rfkill system handles all events; userspace is informed about the events. 22transmissions, it is about blocking energy emission.
17 3 - The rfkill system does not handle events; userspace handles all events.
18 23
19The buttons to enable and disable the wireless radios are important in 24The rfkill subsystem offers support for keys and switches often found on
25laptops to enable wireless devices like WiFi and Bluetooth, so that these keys
26and switches actually perform an action in all wireless devices of a given type
27attached to the system.
28
29The buttons to enable and disable the wireless transmitters are important in
20situations where the user is for example using his laptop on a location where 30situations where the user is for example using his laptop on a location where
21wireless radios _must_ be disabled (e.g. airplanes). 31radio-frequency transmitters _must_ be disabled (e.g. airplanes).
22Because of this requirement, userspace support for the keys should not be 32
23made mandatory. Because userspace might want to perform some additional smarter 33Because of this requirement, userspace support for the keys should not be made
24tasks when the key is pressed, rfkill still provides userspace the possibility 34mandatory. Because userspace might want to perform some additional smarter
25to take over the task to handle the key events. 35tasks when the key is pressed, rfkill provides userspace the possibility to
36take over the task to handle the key events.
37
38===============================================================================
392: Implementation details
40
41The rfkill subsystem is composed of various components: the rfkill class, the
42rfkill-input module (an input layer handler), and some specific input layer
43events.
44
45The rfkill class provides kernel drivers with an interface that allows them to
46know when they should enable or disable a wireless network device transmitter.
47This is enabled by the CONFIG_RFKILL Kconfig option.
48
49The rfkill class support makes sure userspace will be notified of all state
50changes on rfkill devices through uevents. It provides a notification chain
51for interested parties in the kernel to also get notified of rfkill state
52changes in other drivers. It creates several sysfs entries which can be used
53by userspace. See section "Userspace support".
54
55The rfkill-input module provides the kernel with the ability to implement a
56basic response when the user presses a key or button (or toggles a switch)
57related to rfkill functionality. It is an in-kernel implementation of default
58policy of reacting to rfkill-related input events and neither mandatory nor
59required for wireless drivers to operate. It is enabled by the
60CONFIG_RFKILL_INPUT Kconfig option.
61
62rfkill-input is a rfkill-related events input layer handler. This handler will
63listen to all rfkill key events and will change the rfkill state of the
64wireless devices accordingly. With this option enabled userspace could either
65do nothing or simply perform monitoring tasks.
66
67The rfkill-input module also provides EPO (emergency power-off) functionality
68for all wireless transmitters. This function cannot be overridden, and it is
69always active. rfkill EPO is related to *_RFKILL_ALL input layer events.
70
71
72Important terms for the rfkill subsystem:
73
74In order to avoid confusion, we avoid the term "switch" in rfkill when it is
75referring to an electronic control circuit that enables or disables a
76transmitter. We reserve it for the physical device a human manipulates
77(which is an input device, by the way):
78
79rfkill switch:
80
81 A physical device a human manipulates. Its state can be perceived by
82 the kernel either directly (through a GPIO pin, ACPI GPE) or by its
83 effect on a rfkill line of a wireless device.
84
85rfkill controller:
86
87 A hardware circuit that controls the state of a rfkill line, which a
88 kernel driver can interact with *to modify* that state (i.e. it has
89 either write-only or read/write access).
90
91rfkill line:
92
93 An input channel (hardware or software) of a wireless device, which
94 causes a wireless transmitter to stop emitting energy (BLOCK) when it
95 is active. Point of view is extremely important here: rfkill lines are
96 always seen from the PoV of a wireless device (and its driver).
97
98soft rfkill line/software rfkill line:
99
100 A rfkill line the wireless device driver can directly change the state
101 of. Related to rfkill_state RFKILL_STATE_SOFT_BLOCKED.
102
103hard rfkill line/hardware rfkill line:
104
105 A rfkill line that works fully in hardware or firmware, and that cannot
106 be overridden by the kernel driver. The hardware device or the
107 firmware just exports its status to the driver, but it is read-only.
108 Related to rfkill_state RFKILL_STATE_HARD_BLOCKED.
109
110The enum rfkill_state describes the rfkill state of a transmitter:
111
112When a rfkill line or rfkill controller is in the RFKILL_STATE_UNBLOCKED state,
113the wireless transmitter (radio TX circuit for example) is *enabled*. When the
114it is in the RFKILL_STATE_SOFT_BLOCKED or RFKILL_STATE_HARD_BLOCKED, the
115wireless transmitter is to be *blocked* from operating.
116
117RFKILL_STATE_SOFT_BLOCKED indicates that a call to toggle_radio() can change
118that state. RFKILL_STATE_HARD_BLOCKED indicates that a call to toggle_radio()
119will not be able to change the state and will return with a suitable error if
120attempts are made to set the state to RFKILL_STATE_UNBLOCKED.
121
122RFKILL_STATE_HARD_BLOCKED is used by drivers to signal that the device is
123locked in the BLOCKED state by a hardwire rfkill line (typically an input pin
124that, when active, forces the transmitter to be disabled) which the driver
125CANNOT override.
126
127Full rfkill functionality requires two different subsystems to cooperate: the
128input layer and the rfkill class. The input layer issues *commands* to the
129entire system requesting that devices registered to the rfkill class change
130state. The way this interaction happens is not complex, but it is not obvious
131either:
132
133Kernel Input layer:
134
135 * Generates KEY_WWAN, KEY_WLAN, KEY_BLUETOOTH, SW_RFKILL_ALL, and
136 other such events when the user presses certain keys, buttons, or
137 toggles certain physical switches.
26 138
27The system inside the kernel has been split into 2 separate sections: 139 THE INPUT LAYER IS NEVER USED TO PROPAGATE STATUS, NOTIFICATIONS OR THE
28 1 - RFKILL 140 KIND OF STUFF AN ON-SCREEN-DISPLAY APPLICATION WOULD REPORT. It is
29 2 - RFKILL_INPUT 141 used to issue *commands* for the system to change behaviour, and these
142 commands may or may not be carried out by some kernel driver or
143 userspace application. It follows that doing user feedback based only
144 on input events is broken, as there is no guarantee that an input event
145 will be acted upon.
30 146
31The first option enables rfkill support and will make sure userspace will 147 Most wireless communication device drivers implementing rfkill
32be notified of any events through the input device. It also creates several 148 functionality MUST NOT generate these events, and have no reason to
33sysfs entries which can be used by userspace. See section "Userspace support". 149 register themselves with the input layer. Doing otherwise is a common
150 misconception. There is an API to propagate rfkill status change
151 information, and it is NOT the input layer.
34 152
35The second option provides an rfkill input handler. This handler will 153rfkill class:
36listen to all rfkill key events and will toggle the radio accordingly.
37With this option enabled userspace could either do nothing or simply
38perform monitoring tasks.
39 154
155 * Calls a hook in a driver to effectively change the wireless
156 transmitter state;
157 * Keeps track of the wireless transmitter state (with help from
158 the driver);
159 * Generates userspace notifications (uevents) and a call to a
160 notification chain (kernel) when there is a wireless transmitter
161 state change;
162 * Connects a wireless communications driver with the common rfkill
163 control system, which, for example, allows actions such as
164 "switch all bluetooth devices offline" to be carried out by
165 userspace or by rfkill-input.
166
167 THE RFKILL CLASS NEVER ISSUES INPUT EVENTS. THE RFKILL CLASS DOES
168 NOT LISTEN TO INPUT EVENTS. NO DRIVER USING THE RFKILL CLASS SHALL
169 EVER LISTEN TO, OR ACT ON RFKILL INPUT EVENTS. Doing otherwise is
170 a layering violation.
171
172 Most wireless data communication drivers in the kernel have just to
173 implement the rfkill class API to work properly. Interfacing to the
174 input layer is not often required (and is very often a *bug*) on
175 wireless drivers.
176
177 Platform drivers often have to attach to the input layer to *issue*
178 (but never to listen to) rfkill events for rfkill switches, and also to
179 the rfkill class to export a control interface for the platform rfkill
180 controllers to the rfkill subsystem. This does NOT mean the rfkill
181 switch is attached to a rfkill class (doing so is almost always wrong).
182 It just means the same kernel module is the driver for different
183 devices (rfkill switches and rfkill controllers).
184
185
186Userspace input handlers (uevents) or kernel input handlers (rfkill-input):
187
188 * Implements the policy of what should happen when one of the input
189 layer events related to rfkill operation is received.
190 * Uses the sysfs interface (userspace) or private rfkill API calls
191 to tell the devices registered with the rfkill class to change
192 their state (i.e. translates the input layer event into real
193 action).
194 * rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0
195 (power off all transmitters) in a special way: it ignores any
196 overrides and local state cache and forces all transmitters to the
197 RFKILL_STATE_SOFT_BLOCKED state (including those which are already
198 supposed to be BLOCKED). Note that the opposite event (power on all
199 transmitters) is handled normally.
200
201Userspace uevent handler or kernel platform-specific drivers hooked to the
202rfkill notifier chain:
203
204 * Taps into the rfkill notifier chain or to KOBJ_CHANGE uevents,
205 in order to know when a device that is registered with the rfkill
206 class changes state;
207 * Issues feedback notifications to the user;
208 * In the rare platforms where this is required, synthesizes an input
209 event to command all *OTHER* rfkill devices to also change their
210 statues when a specific rfkill device changes state.
211
212
213===============================================================================
2143: Kernel driver guidelines
215
216Remember: point-of-view is everything for a driver that connects to the rfkill
217subsystem. All the details below must be measured/perceived from the point of
218view of the specific driver being modified.
219
220The first thing one needs to know is whether his driver should be talking to
221the rfkill class or to the input layer. In rare cases (platform drivers), it
222could happen that you need to do both, as platform drivers often handle a
223variety of devices in the same driver.
224
225Do not mistake input devices for rfkill controllers. The only type of "rfkill
226switch" device that is to be registered with the rfkill class are those
227directly controlling the circuits that cause a wireless transmitter to stop
228working (or the software equivalent of them), i.e. what we call a rfkill
229controller. Every other kind of "rfkill switch" is just an input device and
230MUST NOT be registered with the rfkill class.
231
232A driver should register a device with the rfkill class when ALL of the
233following conditions are met (they define a rfkill controller):
234
2351. The device is/controls a data communications wireless transmitter;
236
2372. The kernel can interact with the hardware/firmware to CHANGE the wireless
238 transmitter state (block/unblock TX operation);
239
2403. The transmitter can be made to not emit any energy when "blocked":
241 rfkill is not about blocking data transmissions, it is about blocking
242 energy emission;
243
244A driver should register a device with the input subsystem to issue
245rfkill-related events (KEY_WLAN, KEY_BLUETOOTH, KEY_WWAN, KEY_WIMAX,
246SW_RFKILL_ALL, etc) when ALL of the folowing conditions are met:
247
2481. It is directly related to some physical device the user interacts with, to
249 command the O.S./firmware/hardware to enable/disable a data communications
250 wireless transmitter.
251
252 Examples of the physical device are: buttons, keys and switches the user
253 will press/touch/slide/switch to enable or disable the wireless
254 communication device.
255
2562. It is NOT slaved to another device, i.e. there is no other device that
257 issues rfkill-related input events in preference to this one.
258
259 Please refer to the corner cases and examples section for more details.
260
261When in doubt, do not issue input events. For drivers that should generate
262input events in some platforms, but not in others (e.g. b43), the best solution
263is to NEVER generate input events in the first place. That work should be
264deferred to a platform-specific kernel module (which will know when to generate
265events through the rfkill notifier chain) or to userspace. This avoids the
266usual maintenance problems with DMI whitelisting.
267
268
269Corner cases and examples:
40==================================== 270====================================
412: Driver support
42 271
43To build a driver with rfkill subsystem support, the driver should 2721. If the device is an input device that, because of hardware or firmware,
44depend on the Kconfig symbol RFKILL; it should _not_ depend on 273causes wireless transmitters to be blocked regardless of the kernel's will, it
45RKFILL_INPUT. 274is still just an input device, and NOT to be registered with the rfkill class.
46 275
47Unless key events trigger an interrupt to which the driver listens, polling 2762. If the wireless transmitter switch control is read-only, it is an input
48will be required to determine the key state changes. For this the input 277device and not to be registered with the rfkill class (and maybe not to be made
49layer providers the input-polldev handler. 278an input layer event source either, see below).
50 279
51A driver should implement a few steps to correctly make use of the 2803. If there is some other device driver *closer* to the actual hardware the
52rfkill subsystem. First for non-polling drivers: 281user interacted with (the button/switch/key) to issue an input event, THAT is
282the device driver that should be issuing input events.
53 283
54 - rfkill_allocate() 284E.g:
55 - input_allocate_device() 285 [RFKILL slider switch] -- [GPIO hardware] -- [WLAN card rf-kill input]
56 - rfkill_register() 286 (platform driver) (wireless card driver)
57 - input_register_device() 287
288The user is closer to the RFKILL slide switch plaform driver, so the driver
289which must issue input events is the platform driver looking at the GPIO
290hardware, and NEVER the wireless card driver (which is just a slave). It is
291very likely that there are other leaves than just the WLAN card rf-kill input
292(e.g. a bluetooth card, etc)...
293
294On the other hand, some embedded devices do this:
295
296 [RFKILL slider switch] -- [WLAN card rf-kill input]
297 (wireless card driver)
58 298
59For polling drivers: 299In this situation, the wireless card driver *could* register itself as an input
300device and issue rf-kill related input events... but in order to AVOID the need
301for DMI whitelisting, the wireless card driver does NOT do it. Userspace (HAL)
302or a platform driver (that exists only on these embedded devices) will do the
303dirty job of issuing the input events.
60 304
305
306COMMON MISTAKES in kernel drivers, related to rfkill:
307====================================
308
3091. NEVER confuse input device keys and buttons with input device switches.
310
311 1a. Switches are always set or reset. They report the current state
312 (on position or off position).
313
314 1b. Keys and buttons are either in the pressed or not-pressed state, and
315 that's it. A "button" that latches down when you press it, and
316 unlatches when you press it again is in fact a switch as far as input
317 devices go.
318
319Add the SW_* events you need for switches, do NOT try to emulate a button using
320KEY_* events just because there is no such SW_* event yet. Do NOT try to use,
321for example, KEY_BLUETOOTH when you should be using SW_BLUETOOTH instead.
322
3232. Input device switches (sources of EV_SW events) DO store their current state
324(so you *must* initialize it by issuing a gratuitous input layer event on
325driver start-up and also when resuming from sleep), and that state CAN be
326queried from userspace through IOCTLs. There is no sysfs interface for this,
327but that doesn't mean you should break things trying to hook it to the rfkill
328class to get a sysfs interface :-)
329
3303. Do not issue *_RFKILL_ALL events by default, unless you are sure it is the
331correct event for your switch/button. These events are emergency power-off
332events when they are trying to turn the transmitters off. An example of an
333input device which SHOULD generate *_RFKILL_ALL events is the wireless-kill
334switch in a laptop which is NOT a hotkey, but a real switch that kills radios
335in hardware, even if the O.S. has gone to lunch. An example of an input device
336which SHOULD NOT generate *_RFKILL_ALL events by default, is any sort of hot
337key that does nothing by itself, as well as any hot key that is type-specific
338(e.g. the one for WLAN).
339
340
3413.1 Guidelines for wireless device drivers
342------------------------------------------
343
344(in this text, rfkill->foo means the foo field of struct rfkill).
345
3461. Each independent transmitter in a wireless device (usually there is only one
347transmitter per device) should have a SINGLE rfkill class attached to it.
348
3492. If the device does not have any sort of hardware assistance to allow the
350driver to rfkill the device, the driver should emulate it by taking all actions
351required to silence the transmitter.
352
3533. If it is impossible to silence the transmitter (i.e. it still emits energy,
354even if it is just in brief pulses, when there is no data to transmit and there
355is no hardware support to turn it off) do NOT lie to the users. Do not attach
356it to a rfkill class. The rfkill subsystem does not deal with data
357transmission, it deals with energy emission. If the transmitter is emitting
358energy, it is not blocked in rfkill terms.
359
3604. It doesn't matter if the device has multiple rfkill input lines affecting
361the same transmitter, their combined state is to be exported as a single state
362per transmitter (see rule 1).
363
364This rule exists because users of the rfkill subsystem expect to get (and set,
365when possible) the overall transmitter rfkill state, not of a particular rfkill
366line.
367
3685. The wireless device driver MUST NOT leave the transmitter enabled during
369suspend and hibernation unless:
370
371 5.1. The transmitter has to be enabled for some sort of functionality
372 like wake-on-wireless-packet or autonomous packed forwarding in a mesh
373 network, and that functionality is enabled for this suspend/hibernation
374 cycle.
375
376AND
377
378 5.2. The device was not on a user-requested BLOCKED state before
379 the suspend (i.e. the driver must NOT unblock a device, not even
380 to support wake-on-wireless-packet or remain in the mesh).
381
382In other words, there is absolutely no allowed scenario where a driver can
383automatically take action to unblock a rfkill controller (obviously, this deals
384with scenarios where soft-blocking or both soft and hard blocking is happening.
385Scenarios where hardware rfkill lines are the only ones blocking the
386transmitter are outside of this rule, since the wireless device driver does not
387control its input hardware rfkill lines in the first place).
388
3896. During resume, rfkill will try to restore its previous state.
390
3917. After a rfkill class is suspended, it will *not* call rfkill->toggle_radio
392until it is resumed.
393
394
395Example of a WLAN wireless driver connected to the rfkill subsystem:
396--------------------------------------------------------------------
397
398A certain WLAN card has one input pin that causes it to block the transmitter
399and makes the status of that input pin available (only for reading!) to the
400kernel driver. This is a hard rfkill input line (it cannot be overridden by
401the kernel driver).
402
403The card also has one PCI register that, if manipulated by the driver, causes
404it to block the transmitter. This is a soft rfkill input line.
405
406It has also a thermal protection circuitry that shuts down its transmitter if
407the card overheats, and makes the status of that protection available (only for
408reading!) to the kernel driver. This is also a hard rfkill input line.
409
410If either one of these rfkill lines are active, the transmitter is blocked by
411the hardware and forced offline.
412
413The driver should allocate and attach to its struct device *ONE* instance of
414the rfkill class (there is only one transmitter).
415
416It can implement the get_state() hook, and return RFKILL_STATE_HARD_BLOCKED if
417either one of its two hard rfkill input lines are active. If the two hard
418rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft
419rfkill input line is active. Only if none of the rfkill input lines are
420active, will it return RFKILL_STATE_UNBLOCKED.
421
422Since the device has a hardware rfkill line, it IS subject to state changes
423external to rfkill. Therefore, the driver must make sure that it calls
424rfkill_force_state() to keep the status always up-to-date, and it must do a
425rfkill_force_state() on resume from sleep.
426
427Every time the driver gets a notification from the card that one of its rfkill
428lines changed state (polling might be needed on badly designed cards that don't
429generate interrupts for such events), it recomputes the rfkill state as per
430above, and calls rfkill_force_state() to update it.
431
432The driver should implement the toggle_radio() hook, that:
433
4341. Returns an error if one of the hardware rfkill lines are active, and the
435caller asked for RFKILL_STATE_UNBLOCKED.
436
4372. Activates the soft rfkill line if the caller asked for state
438RFKILL_STATE_SOFT_BLOCKED. It should do this even if one of the hard rfkill
439lines are active, effectively double-blocking the transmitter.
440
4413. Deactivates the soft rfkill line if none of the hardware rfkill lines are
442active and the caller asked for RFKILL_STATE_UNBLOCKED.
443
444===============================================================================
4454: Kernel API
446
447To build a driver with rfkill subsystem support, the driver should depend on
448(or select) the Kconfig symbol RFKILL; it should _not_ depend on RKFILL_INPUT.
449
450The hardware the driver talks to may be write-only (where the current state
451of the hardware is unknown), or read-write (where the hardware can be queried
452about its current state).
453
454The rfkill class will call the get_state hook of a device every time it needs
455to know the *real* current state of the hardware. This can happen often, but
456it does not do any polling, so it is not enough on hardware that is subject
457to state changes outside of the rfkill subsystem.
458
459Therefore, calling rfkill_force_state() when a state change happens is
460mandatory when the device has a hardware rfkill line, or when something else
461like the firmware could cause its state to be changed without going through the
462rfkill class.
463
464Some hardware provides events when its status changes. In these cases, it is
465best for the driver to not provide a get_state hook, and instead register the
466rfkill class *already* with the correct status, and keep it updated using
467rfkill_force_state() when it gets an event from the hardware.
468
469rfkill_force_state() must be used on the device resume handlers to update the
470rfkill status, should there be any chance of the device status changing during
471the sleep.
472
473There is no provision for a statically-allocated rfkill struct. You must
474use rfkill_allocate() to allocate one.
475
476You should:
61 - rfkill_allocate() 477 - rfkill_allocate()
62 - input_allocate_polled_device() 478 - modify rfkill fields (flags, name)
479 - modify state to the current hardware state (THIS IS THE ONLY TIME
480 YOU CAN ACCESS state DIRECTLY)
63 - rfkill_register() 481 - rfkill_register()
64 - input_register_polled_device()
65 482
66When a key event has been detected, the correct event should be 483The only way to set a device to the RFKILL_STATE_HARD_BLOCKED state is through
67sent over the input device which has been registered by the driver. 484a suitable return of get_state() or through rfkill_force_state().
68 485
69==================================== 486When a device is in the RFKILL_STATE_HARD_BLOCKED state, the only way to switch
703: Userspace support 487it to a different state is through a suitable return of get_state() or through
488rfkill_force_state().
71 489
72For each key an input device will be created which will send out the correct 490If toggle_radio() is called to set a device to state RFKILL_STATE_SOFT_BLOCKED
73key event when the rfkill key has been pressed. 491when that device is already at the RFKILL_STATE_HARD_BLOCKED state, it should
492not return an error. Instead, it should try to double-block the transmitter,
493so that its state will change from RFKILL_STATE_HARD_BLOCKED to
494RFKILL_STATE_SOFT_BLOCKED should the hardware blocking cease.
495
496Please refer to the source for more documentation.
497
498===============================================================================
4995: Userspace support
500
501rfkill devices issue uevents (with an action of "change"), with the following
502environment variables set:
503
504RFKILL_NAME
505RFKILL_STATE
506RFKILL_TYPE
507
508The ABI for these variables is defined by the sysfs attributes. It is best
509to take a quick look at the source to make sure of the possible values.
510
511It is expected that HAL will trap those, and bridge them to DBUS, etc. These
512events CAN and SHOULD be used to give feedback to the user about the rfkill
513status of the system.
514
515Input devices may issue events that are related to rfkill. These are the
516various KEY_* events and SW_* events supported by rfkill-input.c.
517
518******IMPORTANT******
519When rfkill-input is ACTIVE, userspace is NOT TO CHANGE THE STATE OF AN RFKILL
520SWITCH IN RESPONSE TO AN INPUT EVENT also handled by rfkill-input, unless it
521has set to true the user_claim attribute for that particular switch. This rule
522is *absolute*; do NOT violate it.
523******IMPORTANT******
524
525Userspace must not assume it is the only source of control for rfkill switches.
526Their state CAN and WILL change due to firmware actions, direct user actions,
527and the rfkill-input EPO override for *_RFKILL_ALL.
528
529When rfkill-input is not active, userspace must initiate a rfkill status
530change by writing to the "state" attribute in order for anything to happen.
531
532Take particular care to implement EV_SW SW_RFKILL_ALL properly. When that
533switch is set to OFF, *every* rfkill device *MUST* be immediately put into the
534RFKILL_STATE_SOFT_BLOCKED state, no questions asked.
74 535
75The following sysfs entries will be created: 536The following sysfs entries will be created:
76 537
77 name: Name assigned by driver to this key (interface or driver name). 538 name: Name assigned by driver to this key (interface or driver name).
78 type: Name of the key type ("wlan", "bluetooth", etc). 539 type: Name of the key type ("wlan", "bluetooth", etc).
79 state: Current state of the key. 1: On, 0: Off. 540 state: Current state of the transmitter
541 0: RFKILL_STATE_SOFT_BLOCKED
542 transmitter is forced off, but one can override it
543 by a write to the state attribute;
544 1: RFKILL_STATE_UNBLOCKED
545 transmiter is NOT forced off, and may operate if
546 all other conditions for such operation are met
547 (such as interface is up and configured, etc);
548 2: RFKILL_STATE_HARD_BLOCKED
549 transmitter is forced off by something outside of
550 the driver's control. One cannot set a device to
551 this state through writes to the state attribute;
80 claim: 1: Userspace handles events, 0: Kernel handles events 552 claim: 1: Userspace handles events, 0: Kernel handles events
81 553
82Both the "state" and "claim" entries are also writable. For the "state" entry 554Both the "state" and "claim" entries are also writable. For the "state" entry
83this means that when 1 or 0 is written all radios, not yet in the requested 555this means that when 1 or 0 is written, the device rfkill state (if not yet in
84state, will be will be toggled accordingly. 556the requested state), will be will be toggled accordingly.
557
85For the "claim" entry writing 1 to it means that the kernel no longer handles 558For the "claim" entry writing 1 to it means that the kernel no longer handles
86key events even though RFKILL_INPUT input was enabled. When "claim" has been 559key events even though RFKILL_INPUT input was enabled. When "claim" has been
87set to 0, userspace should make sure that it listens for the input events or 560set to 0, userspace should make sure that it listens for the input events or
88check the sysfs "state" entry regularly to correctly perform the required 561check the sysfs "state" entry regularly to correctly perform the required tasks
89tasks when the rkfill key is pressed. 562when the rkfill key is pressed.
563
564A note about input devices and EV_SW events:
565
566In order to know the current state of an input device switch (like
567SW_RFKILL_ALL), you will need to use an IOCTL. That information is not
568available through sysfs in a generic way at this time, and it is not available
569through the rfkill class AT ALL.
diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO
index bf0baa19ec24..339207d11d95 100644
--- a/Documentation/s390/CommonIO
+++ b/Documentation/s390/CommonIO
@@ -70,13 +70,19 @@ Command line parameters
70 70
71 Note: While already known devices can be added to the list of devices to be 71 Note: While already known devices can be added to the list of devices to be
72 ignored, there will be no effect on then. However, if such a device 72 ignored, there will be no effect on then. However, if such a device
73 disappears and then reappears, it will then be ignored. 73 disappears and then reappears, it will then be ignored. To make
74 known devices go away, you need the "purge" command (see below).
74 75
75 For example, 76 For example,
76 "echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore" 77 "echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore"
77 will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored 78 will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored
78 devices. 79 devices.
79 80
81 You can remove already known but now ignored devices via
82 "echo purge > /proc/cio_ignore"
83 All devices ignored but still registered and not online (= not in use)
84 will be deregistered and thus removed from the system.
85
80 The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward 86 The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward
81 compatibility, by the device number in hexadecimal (0xabcd or abcd). Device 87 compatibility, by the device number in hexadecimal (0xabcd or abcd). Device
82 numbers given as 0xabcd will be interpreted as 0.0.abcd. 88 numbers given as 0xabcd will be interpreted as 0.0.abcd.
@@ -98,8 +104,7 @@ debugfs entries
98 handling). 104 handling).
99 105
100 - /sys/kernel/debug/s390dbf/cio_msg/sprintf 106 - /sys/kernel/debug/s390dbf/cio_msg/sprintf
101 Various debug messages from the common I/O-layer, including messages 107 Various debug messages from the common I/O-layer.
102 printed when cio_msg=yes.
103 108
104 - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii 109 - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii
105 Logs the calling of functions in the common I/O-layer and, if applicable, 110 Logs the calling of functions in the common I/O-layer and, if applicable,
diff --git a/Documentation/s390/driver-model.txt b/Documentation/s390/driver-model.txt
index e938c442277d..bde473df748d 100644
--- a/Documentation/s390/driver-model.txt
+++ b/Documentation/s390/driver-model.txt
@@ -25,7 +25,7 @@ device 4711 via subchannel 1 in subchannel set 0, and subchannel 2 is a non-I/O
25subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1. 25subchannel. Device 1234 is accessed via subchannel 0 in subchannel set 1.
26 26
27The subchannel named 'defunct' does not represent any real subchannel on the 27The subchannel named 'defunct' does not represent any real subchannel on the
28system; it is a pseudo subchannel where disconnnected ccw devices are moved to 28system; it is a pseudo subchannel where disconnected ccw devices are moved to
29if they are displaced by another ccw device becoming operational on their 29if they are displaced by another ccw device becoming operational on their
30former subchannel. The ccw devices will be moved again to a proper subchannel 30former subchannel. The ccw devices will be moved again to a proper subchannel
31if they become operational again on that subchannel. 31if they become operational again on that subchannel.
diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
index 88bcb8767335..9d8eb553884c 100644
--- a/Documentation/scheduler/sched-design-CFS.txt
+++ b/Documentation/scheduler/sched-design-CFS.txt
@@ -1,151 +1,242 @@
1 =============
2 CFS Scheduler
3 =============
1 4
2This is the CFS scheduler.
3
480% of CFS's design can be summed up in a single sentence: CFS basically
5models an "ideal, precise multi-tasking CPU" on real hardware.
6
7"Ideal multi-tasking CPU" is a (non-existent :-)) CPU that has 100%
8physical power and which can run each task at precise equal speed, in
9parallel, each at 1/nr_running speed. For example: if there are 2 tasks
10running then it runs each at 50% physical power - totally in parallel.
11
12On real hardware, we can run only a single task at once, so while that
13one task runs, the other tasks that are waiting for the CPU are at a
14disadvantage - the current task gets an unfair amount of CPU time. In
15CFS this fairness imbalance is expressed and tracked via the per-task
16p->wait_runtime (nanosec-unit) value. "wait_runtime" is the amount of
17time the task should now run on the CPU for it to become completely fair
18and balanced.
19
20( small detail: on 'ideal' hardware, the p->wait_runtime value would
21 always be zero - no task would ever get 'out of balance' from the
22 'ideal' share of CPU time. )
23
24CFS's task picking logic is based on this p->wait_runtime value and it
25is thus very simple: it always tries to run the task with the largest
26p->wait_runtime value. In other words, CFS tries to run the task with
27the 'gravest need' for more CPU time. So CFS always tries to split up
28CPU time between runnable tasks as close to 'ideal multitasking
29hardware' as possible.
30
31Most of the rest of CFS's design just falls out of this really simple
32concept, with a few add-on embellishments like nice levels,
33multiprocessing and various algorithm variants to recognize sleepers.
34
35In practice it works like this: the system runs a task a bit, and when
36the task schedules (or a scheduler tick happens) the task's CPU usage is
37'accounted for': the (small) time it just spent using the physical CPU
38is deducted from p->wait_runtime. [minus the 'fair share' it would have
39gotten anyway]. Once p->wait_runtime gets low enough so that another
40task becomes the 'leftmost task' of the time-ordered rbtree it maintains
41(plus a small amount of 'granularity' distance relative to the leftmost
42task so that we do not over-schedule tasks and trash the cache) then the
43new leftmost task is picked and the current task is preempted.
44
45The rq->fair_clock value tracks the 'CPU time a runnable task would have
46fairly gotten, had it been runnable during that time'. So by using
47rq->fair_clock values we can accurately timestamp and measure the
48'expected CPU time' a task should have gotten. All runnable tasks are
49sorted in the rbtree by the "rq->fair_clock - p->wait_runtime" key, and
50CFS picks the 'leftmost' task and sticks to it. As the system progresses
51forwards, newly woken tasks are put into the tree more and more to the
52right - slowly but surely giving a chance for every task to become the
53'leftmost task' and thus get on the CPU within a deterministic amount of
54time.
55
56Some implementation details:
57
58 - the introduction of Scheduling Classes: an extensible hierarchy of
59 scheduler modules. These modules encapsulate scheduling policy
60 details and are handled by the scheduler core without the core
61 code assuming about them too much.
62
63 - sched_fair.c implements the 'CFS desktop scheduler': it is a
64 replacement for the vanilla scheduler's SCHED_OTHER interactivity
65 code.
66
67 I'd like to give credit to Con Kolivas for the general approach here:
68 he has proven via RSDL/SD that 'fair scheduling' is possible and that
69 it results in better desktop scheduling. Kudos Con!
70
71 The CFS patch uses a completely different approach and implementation
72 from RSDL/SD. My goal was to make CFS's interactivity quality exceed
73 that of RSDL/SD, which is a high standard to meet :-) Testing
74 feedback is welcome to decide this one way or another. [ and, in any
75 case, all of SD's logic could be added via a kernel/sched_sd.c module
76 as well, if Con is interested in such an approach. ]
77
78 CFS's design is quite radical: it does not use runqueues, it uses a
79 time-ordered rbtree to build a 'timeline' of future task execution,
80 and thus has no 'array switch' artifacts (by which both the vanilla
81 scheduler and RSDL/SD are affected).
82
83 CFS uses nanosecond granularity accounting and does not rely on any
84 jiffies or other HZ detail. Thus the CFS scheduler has no notion of
85 'timeslices' and has no heuristics whatsoever. There is only one
86 central tunable (you have to switch on CONFIG_SCHED_DEBUG):
87
88 /proc/sys/kernel/sched_granularity_ns
89
90 which can be used to tune the scheduler from 'desktop' (low
91 latencies) to 'server' (good batching) workloads. It defaults to a
92 setting suitable for desktop workloads. SCHED_BATCH is handled by the
93 CFS scheduler module too.
94
95 Due to its design, the CFS scheduler is not prone to any of the
96 'attacks' that exist today against the heuristics of the stock
97 scheduler: fiftyp.c, thud.c, chew.c, ring-test.c, massive_intr.c all
98 work fine and do not impact interactivity and produce the expected
99 behavior.
100
101 the CFS scheduler has a much stronger handling of nice levels and
102 SCHED_BATCH: both types of workloads should be isolated much more
103 agressively than under the vanilla scheduler.
104
105 ( another detail: due to nanosec accounting and timeline sorting,
106 sched_yield() support is very simple under CFS, and in fact under
107 CFS sched_yield() behaves much better than under any other
108 scheduler i have tested so far. )
109
110 - sched_rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler
111 way than the vanilla scheduler does. It uses 100 runqueues (for all
112 100 RT priority levels, instead of 140 in the vanilla scheduler)
113 and it needs no expired array.
114
115 - reworked/sanitized SMP load-balancing: the runqueue-walking
116 assumptions are gone from the load-balancing code now, and
117 iterators of the scheduling modules are used. The balancing code got
118 quite a bit simpler as a result.
119
120
121Group scheduler extension to CFS
122================================
123
124Normally the scheduler operates on individual tasks and strives to provide
125fair CPU time to each task. Sometimes, it may be desirable to group tasks
126and provide fair CPU time to each such task group. For example, it may
127be desirable to first provide fair CPU time to each user on the system
128and then to each task belonging to a user.
129
130CONFIG_FAIR_GROUP_SCHED strives to achieve exactly that. It lets
131SCHED_NORMAL/BATCH tasks be be grouped and divides CPU time fairly among such
132groups. At present, there are two (mutually exclusive) mechanisms to group
133tasks for CPU bandwidth control purpose:
134
135 - Based on user id (CONFIG_FAIR_USER_SCHED)
136 In this option, tasks are grouped according to their user id.
137 - Based on "cgroup" pseudo filesystem (CONFIG_FAIR_CGROUP_SCHED)
138 This options lets the administrator create arbitrary groups
139 of tasks, using the "cgroup" pseudo filesystem. See
140 Documentation/cgroups.txt for more information about this
141 filesystem.
142 5
143Only one of these options to group tasks can be chosen and not both. 61. OVERVIEW
7
8CFS stands for "Completely Fair Scheduler," and is the new "desktop" process
9scheduler implemented by Ingo Molnar and merged in Linux 2.6.23. It is the
10replacement for the previous vanilla scheduler's SCHED_OTHER interactivity
11code.
12
1380% of CFS's design can be summed up in a single sentence: CFS basically models
14an "ideal, precise multi-tasking CPU" on real hardware.
15
16"Ideal multi-tasking CPU" is a (non-existent :-)) CPU that has 100% physical
17power and which can run each task at precise equal speed, in parallel, each at
181/nr_running speed. For example: if there are 2 tasks running, then it runs
19each at 50% physical power --- i.e., actually in parallel.
20
21On real hardware, we can run only a single task at once, so we have to
22introduce the concept of "virtual runtime." The virtual runtime of a task
23specifies when its next timeslice would start execution on the ideal
24multi-tasking CPU described above. In practice, the virtual runtime of a task
25is its actual runtime normalized to the total number of running tasks.
26
27
28
292. FEW IMPLEMENTATION DETAILS
30
31In CFS the virtual runtime is expressed and tracked via the per-task
32p->se.vruntime (nanosec-unit) value. This way, it's possible to accurately
33timestamp and measure the "expected CPU time" a task should have gotten.
34
35[ small detail: on "ideal" hardware, at any time all tasks would have the same
36 p->se.vruntime value --- i.e., tasks would execute simultaneously and no task
37 would ever get "out of balance" from the "ideal" share of CPU time. ]
38
39CFS's task picking logic is based on this p->se.vruntime value and it is thus
40very simple: it always tries to run the task with the smallest p->se.vruntime
41value (i.e., the task which executed least so far). CFS always tries to split
42up CPU time between runnable tasks as close to "ideal multitasking hardware" as
43possible.
44
45Most of the rest of CFS's design just falls out of this really simple concept,
46with a few add-on embellishments like nice levels, multiprocessing and various
47algorithm variants to recognize sleepers.
48
49
50
513. THE RBTREE
52
53CFS's design is quite radical: it does not use the old data structures for the
54runqueues, but it uses a time-ordered rbtree to build a "timeline" of future
55task execution, and thus has no "array switch" artifacts (by which both the
56previous vanilla scheduler and RSDL/SD are affected).
57
58CFS also maintains the rq->cfs.min_vruntime value, which is a monotonic
59increasing value tracking the smallest vruntime among all tasks in the
60runqueue. The total amount of work done by the system is tracked using
61min_vruntime; that value is used to place newly activated entities on the left
62side of the tree as much as possible.
63
64The total number of running tasks in the runqueue is accounted through the
65rq->cfs.load value, which is the sum of the weights of the tasks queued on the
66runqueue.
67
68CFS maintains a time-ordered rbtree, where all runnable tasks are sorted by the
69p->se.vruntime key (there is a subtraction using rq->cfs.min_vruntime to
70account for possible wraparounds). CFS picks the "leftmost" task from this
71tree and sticks to it.
72As the system progresses forwards, the executed tasks are put into the tree
73more and more to the right --- slowly but surely giving a chance for every task
74to become the "leftmost task" and thus get on the CPU within a deterministic
75amount of time.
76
77Summing up, CFS works like this: it runs a task a bit, and when the task
78schedules (or a scheduler tick happens) the task's CPU usage is "accounted
79for": the (small) time it just spent using the physical CPU is added to
80p->se.vruntime. Once p->se.vruntime gets high enough so that another task
81becomes the "leftmost task" of the time-ordered rbtree it maintains (plus a
82small amount of "granularity" distance relative to the leftmost task so that we
83do not over-schedule tasks and trash the cache), then the new leftmost task is
84picked and the current task is preempted.
85
86
87
884. SOME FEATURES OF CFS
89
90CFS uses nanosecond granularity accounting and does not rely on any jiffies or
91other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the
92way the previous scheduler had, and has no heuristics whatsoever. There is
93only one central tunable (you have to switch on CONFIG_SCHED_DEBUG):
94
95 /proc/sys/kernel/sched_granularity_ns
96
97which can be used to tune the scheduler from "desktop" (i.e., low latencies) to
98"server" (i.e., good batching) workloads. It defaults to a setting suitable
99for desktop workloads. SCHED_BATCH is handled by the CFS scheduler module too.
100
101Due to its design, the CFS scheduler is not prone to any of the "attacks" that
102exist today against the heuristics of the stock scheduler: fiftyp.c, thud.c,
103chew.c, ring-test.c, massive_intr.c all work fine and do not impact
104interactivity and produce the expected behavior.
105
106The CFS scheduler has a much stronger handling of nice levels and SCHED_BATCH
107than the previous vanilla scheduler: both types of workloads are isolated much
108more aggressively.
109
110SMP load-balancing has been reworked/sanitized: the runqueue-walking
111assumptions are gone from the load-balancing code now, and iterators of the
112scheduling modules are used. The balancing code got quite a bit simpler as a
113result.
114
115
116
1175. Scheduling policies
118
119CFS implements three scheduling policies:
120
121 - SCHED_NORMAL (traditionally called SCHED_OTHER): The scheduling
122 policy that is used for regular tasks.
123
124 - SCHED_BATCH: Does not preempt nearly as often as regular tasks
125 would, thereby allowing tasks to run longer and make better use of
126 caches but at the cost of interactivity. This is well suited for
127 batch jobs.
128
129 - SCHED_IDLE: This is even weaker than nice 19, but its not a true
130 idle timer scheduler in order to avoid to get into priority
131 inversion problems which would deadlock the machine.
132
133SCHED_FIFO/_RR are implemented in sched_rt.c and are as specified by
134POSIX.
135
136The command chrt from util-linux-ng 2.13.1.1 can set all of these except
137SCHED_IDLE.
144 138
145Group scheduler tunables:
146 139
147When CONFIG_FAIR_USER_SCHED is defined, a directory is created in sysfs for 140
148each new user and a "cpu_share" file is added in that directory. 1416. SCHEDULING CLASSES
142
143The new CFS scheduler has been designed in such a way to introduce "Scheduling
144Classes," an extensible hierarchy of scheduler modules. These modules
145encapsulate scheduling policy details and are handled by the scheduler core
146without the core code assuming too much about them.
147
148sched_fair.c implements the CFS scheduler described above.
149
150sched_rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler way than
151the previous vanilla scheduler did. It uses 100 runqueues (for all 100 RT
152priority levels, instead of 140 in the previous scheduler) and it needs no
153expired array.
154
155Scheduling classes are implemented through the sched_class structure, which
156contains hooks to functions that must be called whenever an interesting event
157occurs.
158
159This is the (partial) list of the hooks:
160
161 - enqueue_task(...)
162
163 Called when a task enters a runnable state.
164 It puts the scheduling entity (task) into the red-black tree and
165 increments the nr_running variable.
166
167 - dequeue_tree(...)
168
169 When a task is no longer runnable, this function is called to keep the
170 corresponding scheduling entity out of the red-black tree. It decrements
171 the nr_running variable.
172
173 - yield_task(...)
174
175 This function is basically just a dequeue followed by an enqueue, unless the
176 compat_yield sysctl is turned on; in that case, it places the scheduling
177 entity at the right-most end of the red-black tree.
178
179 - check_preempt_curr(...)
180
181 This function checks if a task that entered the runnable state should
182 preempt the currently running task.
183
184 - pick_next_task(...)
185
186 This function chooses the most appropriate task eligible to run next.
187
188 - set_curr_task(...)
189
190 This function is called when a task changes its scheduling class or changes
191 its task group.
192
193 - task_tick(...)
194
195 This function is mostly called from time tick functions; it might lead to
196 process switch. This drives the running preemption.
197
198 - task_new(...)
199
200 The core scheduler gives the scheduling module an opportunity to manage new
201 task startup. The CFS scheduling module uses it for group scheduling, while
202 the scheduling module for a real-time task does not use it.
203
204
205
2067. GROUP SCHEDULER EXTENSIONS TO CFS
207
208Normally, the scheduler operates on individual tasks and strives to provide
209fair CPU time to each task. Sometimes, it may be desirable to group tasks and
210provide fair CPU time to each such task group. For example, it may be
211desirable to first provide fair CPU time to each user on the system and then to
212each task belonging to a user.
213
214CONFIG_GROUP_SCHED strives to achieve exactly that. It lets tasks to be
215grouped and divides CPU time fairly among such groups.
216
217CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and
218SCHED_RR) tasks.
219
220CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and
221SCHED_BATCH) tasks.
222
223At present, there are two (mutually exclusive) mechanisms to group tasks for
224CPU bandwidth control purposes:
225
226 - Based on user id (CONFIG_USER_SCHED)
227
228 With this option, tasks are grouped according to their user id.
229
230 - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED)
231
232 This options needs CONFIG_CGROUPS to be defined, and lets the administrator
233 create arbitrary groups of tasks, using the "cgroup" pseudo filesystem. See
234 Documentation/cgroups.txt for more information about this filesystem.
235
236Only one of these options to group tasks can be chosen and not both.
237
238When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new
239user and a "cpu_share" file is added in that directory.
149 240
150 # cd /sys/kernel/uids 241 # cd /sys/kernel/uids
151 # cat 512/cpu_share # Display user 512's CPU share 242 # cat 512/cpu_share # Display user 512's CPU share
@@ -155,16 +246,14 @@ each new user and a "cpu_share" file is added in that directory.
155 2048 246 2048
156 # 247 #
157 248
158CPU bandwidth between two users are divided in the ratio of their CPU shares. 249CPU bandwidth between two users is divided in the ratio of their CPU shares.
159For ex: if you would like user "root" to get twice the bandwidth of user 250For example: if you would like user "root" to get twice the bandwidth of user
160"guest", then set the cpu_share for both the users such that "root"'s 251"guest," then set the cpu_share for both the users such that "root"'s cpu_share
161cpu_share is twice "guest"'s cpu_share 252is twice "guest"'s cpu_share.
162
163 253
164When CONFIG_FAIR_CGROUP_SCHED is defined, a "cpu.shares" file is created 254When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each
165for each group created using the pseudo filesystem. See example steps 255group created using the pseudo filesystem. See example steps below to create
166below to create task groups and modify their CPU share using the "cgroups" 256task groups and modify their CPU share using the "cgroups" pseudo filesystem.
167pseudo filesystem
168 257
169 # mkdir /dev/cpuctl 258 # mkdir /dev/cpuctl
170 # mount -t cgroup -ocpu none /dev/cpuctl 259 # mount -t cgroup -ocpu none /dev/cpuctl
diff --git a/Documentation/scheduler/sched-domains.txt b/Documentation/scheduler/sched-domains.txt
index a9e990ab980f..373ceacc367e 100644
--- a/Documentation/scheduler/sched-domains.txt
+++ b/Documentation/scheduler/sched-domains.txt
@@ -61,10 +61,7 @@ builder by #define'ing ARCH_HASH_SCHED_DOMAIN, and exporting your
61arch_init_sched_domains function. This function will attach domains to all 61arch_init_sched_domains function. This function will attach domains to all
62CPUs using cpu_attach_domain. 62CPUs using cpu_attach_domain.
63 63
64Implementors should change the line 64The sched-domains debugging infrastructure can be enabled by enabling
65#undef SCHED_DOMAIN_DEBUG 65CONFIG_SCHED_DEBUG. This enables an error checking parse of the sched domains
66to
67#define SCHED_DOMAIN_DEBUG
68in kernel/sched.c as this enables an error checking parse of the sched domains
69which should catch most possible errors (described above). It also prints out 66which should catch most possible errors (described above). It also prints out
70the domain structure in a visual format. 67the domain structure in a visual format.
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 14f901f639ee..3ef339f491e0 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -51,9 +51,9 @@ needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s =
510.00015s. So this group can be scheduled with a period of 0.005s and a run time 510.00015s. So this group can be scheduled with a period of 0.005s and a run time
52of 0.00015s. 52of 0.00015s.
53 53
54The remaining CPU time will be used for user input and other tass. Because 54The remaining CPU time will be used for user input and other tasks. Because
55realtime tasks have explicitly allocated the CPU time they need to perform 55realtime tasks have explicitly allocated the CPU time they need to perform
56their tasks, buffer underruns in the graphocs or audio can be eliminated. 56their tasks, buffer underruns in the graphics or audio can be eliminated.
57 57
58NOTE: the above example is not fully implemented as of yet (2.6.25). We still 58NOTE: the above example is not fully implemented as of yet (2.6.25). We still
59lack an EDF scheduler to make non-uniform periods usable. 59lack an EDF scheduler to make non-uniform periods usable.
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index 716fcc1cafb5..c851ef497795 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,26 @@
1
21 Release Date : Thur.July. 24 11:41:51 PST 2008 -
3 (emaild-id:megaraidlinux@lsi.com)
4 Sumant Patro
5 Bo Yang
6
72 Current Version : 00.00.04.01
83 Older Version : 00.00.03.22
9
101. Add the new controller (0078, 0079) support to the driver
11 Those controllers are LSI's next generatation(gen2) SAS controllers.
12
131 Release Date : Mon.June. 23 10:12:45 PST 2008 -
14 (emaild-id:megaraidlinux@lsi.com)
15 Sumant Patro
16 Bo Yang
17
182 Current Version : 00.00.03.22
193 Older Version : 00.00.03.20
20
211. Add shutdown DCMD cmd to the shutdown routine to make FW shutdown proper.
222. Unexpected interrupt occurs in HWR Linux driver, add the dumy readl pci flush will fix this issue.
23
11 Release Date : Mon. March 10 11:02:31 PDT 2008 - 241 Release Date : Mon. March 10 11:02:31 PDT 2008 -
2 (emaild-id:megaraidlinux@lsi.com) 25 (emaild-id:megaraidlinux@lsi.com)
3 Sumant Patro 26 Sumant Patro
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt
index d16011a8618e..709ca991a451 100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
@@ -56,19 +56,33 @@ Supported Cards/Chipsets
56 9005:0285:9005:02d1 Adaptec 5405 (Voodoo40) 56 9005:0285:9005:02d1 Adaptec 5405 (Voodoo40)
57 9005:0285:15d9:02d2 SMC AOC-USAS-S8i-LP 57 9005:0285:15d9:02d2 SMC AOC-USAS-S8i-LP
58 9005:0285:15d9:02d3 SMC AOC-USAS-S8iR-LP 58 9005:0285:15d9:02d3 SMC AOC-USAS-S8iR-LP
59 9005:0285:9005:02d4 Adaptec 2045 (Voodoo04 Lite) 59 9005:0285:9005:02d4 Adaptec ASR-2045 (Voodoo04 Lite)
60 9005:0285:9005:02d5 Adaptec 2405 (Voodoo40 Lite) 60 9005:0285:9005:02d5 Adaptec ASR-2405 (Voodoo40 Lite)
61 9005:0285:9005:02d6 Adaptec 2445 (Voodoo44 Lite) 61 9005:0285:9005:02d6 Adaptec ASR-2445 (Voodoo44 Lite)
62 9005:0285:9005:02d7 Adaptec 2805 (Voodoo80 Lite) 62 9005:0285:9005:02d7 Adaptec ASR-2805 (Voodoo80 Lite)
63 9005:0285:9005:02d8 Adaptec 5405G (Voodoo40 PM)
64 9005:0285:9005:02d9 Adaptec 5445G (Voodoo44 PM)
65 9005:0285:9005:02da Adaptec 5805G (Voodoo80 PM)
66 9005:0285:9005:02db Adaptec 5085G (Voodoo08 PM)
67 9005:0285:9005:02dc Adaptec 51245G (Voodoo124 PM)
68 9005:0285:9005:02dd Adaptec 51645G (Voodoo164 PM)
69 9005:0285:9005:02de Adaptec 52445G (Voodoo244 PM)
70 9005:0285:9005:02df Adaptec ASR-2045G (Voodoo04 Lite PM)
71 9005:0285:9005:02e0 Adaptec ASR-2405G (Voodoo40 Lite PM)
72 9005:0285:9005:02e1 Adaptec ASR-2445G (Voodoo44 Lite PM)
73 9005:0285:9005:02e2 Adaptec ASR-2805G (Voodoo80 Lite PM)
63 1011:0046:9005:0364 Adaptec 5400S (Mustang) 74 1011:0046:9005:0364 Adaptec 5400S (Mustang)
75 1011:0046:9005:0365 Adaptec 5400S (Mustang)
64 9005:0287:9005:0800 Adaptec Themisto (Jupiter) 76 9005:0287:9005:0800 Adaptec Themisto (Jupiter)
65 9005:0200:9005:0200 Adaptec Themisto (Jupiter) 77 9005:0200:9005:0200 Adaptec Themisto (Jupiter)
66 9005:0286:9005:0800 Adaptec Callisto (Jupiter) 78 9005:0286:9005:0800 Adaptec Callisto (Jupiter)
67 1011:0046:9005:1364 Dell PERC 2/QC (Quad Channel, Mustang) 79 1011:0046:9005:1364 Dell PERC 2/QC (Quad Channel, Mustang)
80 1011:0046:9005:1365 Dell PERC 2/QC (Quad Channel, Mustang)
68 1028:0001:1028:0001 Dell PERC 2/Si (Iguana) 81 1028:0001:1028:0001 Dell PERC 2/Si (Iguana)
69 1028:0003:1028:0003 Dell PERC 3/Si (SlimFast) 82 1028:0003:1028:0003 Dell PERC 3/Si (SlimFast)
70 1028:0002:1028:0002 Dell PERC 3/Di (Opal) 83 1028:0002:1028:0002 Dell PERC 3/Di (Opal)
71 1028:0004:1028:0004 Dell PERC 3/DiF (Iguana) 84 1028:0004:1028:0004 Dell PERC 3/SiF (Iguana)
85 1028:0004:1028:00d0 Dell PERC 3/DiF (Iguana)
72 1028:0002:1028:00d1 Dell PERC 3/DiV (Viper) 86 1028:0002:1028:00d1 Dell PERC 3/DiV (Viper)
73 1028:0002:1028:00d9 Dell PERC 3/DiL (Lexus) 87 1028:0002:1028:00d9 Dell PERC 3/DiL (Lexus)
74 1028:000a:1028:0106 Dell PERC 3/DiJ (Jaguar) 88 1028:000a:1028:0106 Dell PERC 3/DiJ (Jaguar)
diff --git a/Documentation/scsi/ibmmca.txt b/Documentation/scsi/ibmmca.txt
index a810421f1fb3..3920f28710c4 100644
--- a/Documentation/scsi/ibmmca.txt
+++ b/Documentation/scsi/ibmmca.txt
@@ -524,7 +524,7 @@
524 - Michael Lang 524 - Michael Lang
525 525
526 June 25 1997: (v1.8b) 526 June 25 1997: (v1.8b)
527 1) Some cosmetical changes for the handling of SCSI-device-types. 527 1) Some cosmetic changes for the handling of SCSI-device-types.
528 Now, also CD-Burners / WORMs and SCSI-scanners should work. For 528 Now, also CD-Burners / WORMs and SCSI-scanners should work. For
529 MO-drives I have no experience, therefore not yet supported. 529 MO-drives I have no experience, therefore not yet supported.
530 In logical_devices I changed from different type-variables to one 530 In logical_devices I changed from different type-variables to one
@@ -914,7 +914,7 @@
914 in version 4.0. This was never really necessary, as all troubles were 914 in version 4.0. This was never really necessary, as all troubles were
915 based on non-command related reasons up to now, so bypassing commands 915 based on non-command related reasons up to now, so bypassing commands
916 did not help to avoid any bugs. It is kept in 3.2X for debugging reasons. 916 did not help to avoid any bugs. It is kept in 3.2X for debugging reasons.
917 5) Dynamical reassignment of ldns was again verified and analyzed to be 917 5) Dynamic reassignment of ldns was again verified and analyzed to be
918 completely inoperational. This is corrected and should work now. 918 completely inoperational. This is corrected and should work now.
919 6) All commands that get sent to the SCSI adapter were verified and 919 6) All commands that get sent to the SCSI adapter were verified and
920 completed in such a way, that they are now completely conform to the 920 completed in such a way, that they are now completely conform to the
@@ -1386,7 +1386,7 @@
1386 concerning the Linux-kernel in special, this SCSI-driver comes without any 1386 concerning the Linux-kernel in special, this SCSI-driver comes without any
1387 warranty. Its functionality is tested as good as possible on certain 1387 warranty. Its functionality is tested as good as possible on certain
1388 machines and combinations of computer hardware, which does not exclude, 1388 machines and combinations of computer hardware, which does not exclude,
1389 that dataloss or severe damage of hardware is possible while using this 1389 that data loss or severe damage of hardware is possible while using this
1390 part of software on some arbitrary computer hardware or in combination 1390 part of software on some arbitrary computer hardware or in combination
1391 with other software packages. It is highly recommended to make backup 1391 with other software packages. It is highly recommended to make backup
1392 copies of your data before using this software. Furthermore, personal 1392 copies of your data before using this software. Furthermore, personal
diff --git a/Documentation/scsi/lpfc.txt b/Documentation/scsi/lpfc.txt
index 4dbe41370a6d..5741ea8aa88a 100644
--- a/Documentation/scsi/lpfc.txt
+++ b/Documentation/scsi/lpfc.txt
@@ -36,7 +36,7 @@ Cable pull and temporary device Loss:
36 being removed, a switch rebooting, or a device reboot), the driver could 36 being removed, a switch rebooting, or a device reboot), the driver could
37 hide the disappearance of the device from the midlayer. I/O's issued to 37 hide the disappearance of the device from the midlayer. I/O's issued to
38 the LLDD would simply be queued for a short duration, allowing the device 38 the LLDD would simply be queued for a short duration, allowing the device
39 to reappear or link come back alive, with no inadvertant side effects 39 to reappear or link come back alive, with no inadvertent side effects
40 to the system. If the driver did not hide these conditions, i/o would be 40 to the system. If the driver did not hide these conditions, i/o would be
41 errored by the driver, the mid-layer would exhaust its retries, and the 41 errored by the driver, the mid-layer would exhaust its retries, and the
42 device would be taken offline. Manual intervention would be required to 42 device would be taken offline. Manual intervention would be required to
diff --git a/Documentation/scsi/scsi_fc_transport.txt b/Documentation/scsi/scsi_fc_transport.txt
index d403e46d8463..38d324d62b25 100644
--- a/Documentation/scsi/scsi_fc_transport.txt
+++ b/Documentation/scsi/scsi_fc_transport.txt
@@ -65,7 +65,7 @@ Overview:
65 discussion will concentrate on NPIV. 65 discussion will concentrate on NPIV.
66 66
67 Note: World Wide Name assignment (and uniqueness guarantees) are left 67 Note: World Wide Name assignment (and uniqueness guarantees) are left
68 up to an administrative entity controling the vport. For example, 68 up to an administrative entity controlling the vport. For example,
69 if vports are to be associated with virtual machines, a XEN mgmt 69 if vports are to be associated with virtual machines, a XEN mgmt
70 utility would be responsible for creating wwpn/wwnn's for the vport, 70 utility would be responsible for creating wwpn/wwnn's for the vport,
71 using it's own naming authority and OUI. (Note: it already does this 71 using it's own naming authority and OUI. (Note: it already does this
@@ -91,7 +91,7 @@ Device Trees and Vport Objects:
91 Here's what to expect in the device tree : 91 Here's what to expect in the device tree :
92 The typical Physical Port's Scsi_Host: 92 The typical Physical Port's Scsi_Host:
93 /sys/devices/.../host17/ 93 /sys/devices/.../host17/
94 and it has the typical decendent tree: 94 and it has the typical descendant tree:
95 /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0: 95 /sys/devices/.../host17/rport-17:0-0/target17:0:0/17:0:0:0:
96 and then the vport is created on the Physical Port: 96 and then the vport is created on the Physical Port:
97 /sys/devices/.../host17/vport-17:0-0 97 /sys/devices/.../host17/vport-17:0-0
@@ -192,7 +192,7 @@ Vport States:
192 independent of the adapter's link state. 192 independent of the adapter's link state.
193 - Instantiation of the vport on the FC link via ELS traffic, etc. 193 - Instantiation of the vport on the FC link via ELS traffic, etc.
194 This is equivalent to a "link up" and successfull link initialization. 194 This is equivalent to a "link up" and successfull link initialization.
195 Futher information can be found in the interfaces section below for 195 Further information can be found in the interfaces section below for
196 Vport Creation. 196 Vport Creation.
197 197
198 Once a vport has been instantiated with the kernel/LLDD, a vport state 198 Once a vport has been instantiated with the kernel/LLDD, a vport state
@@ -436,6 +436,42 @@ Other:
436 was updated to remove all vports for the fc_host as well. 436 was updated to remove all vports for the fc_host as well.
437 437
438 438
439Transport supplied functions
440----------------------------
441
442The following functions are supplied by the FC-transport for use by LLDs.
443
444 fc_vport_create - create a vport
445 fc_vport_terminate - detach and remove a vport
446
447Details:
448
449/**
450 * fc_vport_create - Admin App or LLDD requests creation of a vport
451 * @shost: scsi host the virtual port is connected to.
452 * @ids: The world wide names, FC4 port roles, etc for
453 * the virtual port.
454 *
455 * Notes:
456 * This routine assumes no locks are held on entry.
457 */
458struct fc_vport *
459fc_vport_create(struct Scsi_Host *shost, struct fc_vport_identifiers *ids)
460
461/**
462 * fc_vport_terminate - Admin App or LLDD requests termination of a vport
463 * @vport: fc_vport to be terminated
464 *
465 * Calls the LLDD vport_delete() function, then deallocates and removes
466 * the vport from the shost and object tree.
467 *
468 * Notes:
469 * This routine assumes no locks are held on entry.
470 */
471int
472fc_vport_terminate(struct fc_vport *vport)
473
474
439Credits 475Credits
440======= 476=======
441The following people have contributed to this document: 477The following people have contributed to this document:
diff --git a/Documentation/serial/driver b/Documentation/serial/driver
index 88ad615dd338..77ba0afbe4db 100644
--- a/Documentation/serial/driver
+++ b/Documentation/serial/driver
@@ -186,6 +186,17 @@ hardware.
186 Locking: port_sem taken. 186 Locking: port_sem taken.
187 Interrupts: caller dependent. 187 Interrupts: caller dependent.
188 188
189 flush_buffer(port)
190 Flush any write buffers, reset any DMA state and stop any
191 ongoing DMA transfers.
192
193 This will be called whenever the port->info->xmit circular
194 buffer is cleared.
195
196 Locking: port->lock taken.
197 Interrupts: locally disabled.
198 This call must not sleep
199
189 set_termios(port,termios,oldtermios) 200 set_termios(port,termios,oldtermios)
190 Change the port parameters, including word length, parity, stop 201 Change the port parameters, including word length, parity, stop
191 bits. Update read_status_mask and ignore_status_mask to indicate 202 bits. Update read_status_mask and ignore_status_mask to indicate
diff --git a/Documentation/sh/clk.txt b/Documentation/sh/clk.txt
index 9aef710e9a4b..114b595cfa97 100644
--- a/Documentation/sh/clk.txt
+++ b/Documentation/sh/clk.txt
@@ -12,7 +12,7 @@ means no changes to adjanced clock
12Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, 12Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method,
13if it is present in ops structure. The method should set the clock rate and adjust 13if it is present in ops structure. The method should set the clock rate and adjust
14all needed clocks according to the passed algo_id. 14all needed clocks according to the passed algo_id.
15Exact values for algo_id are machine-dependend. For the sh7722, the following 15Exact values for algo_id are machine-dependent. For the sh7722, the following
16values are defined: 16values are defined:
17 17
18 NO_CHANGE = 0, 18 NO_CHANGE = 0,
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 0bbee38acd26..e0e54a27fc10 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -746,15 +746,20 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
746 Module snd-hda-intel 746 Module snd-hda-intel
747 -------------------- 747 --------------------
748 748
749 Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8), 749 Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10,
750 ATI SB450, SB600, RS600, 750 PCH, SCH),
751 ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620,
752 RV630, RV635, RV670, RV770,
751 VIA VT8251/VT8237A, 753 VIA VT8251/VT8237A,
752 SIS966, ULI M5461 754 SIS966, ULI M5461
753 755
754 [Multiple options for each card instance] 756 [Multiple options for each card instance]
755 model - force the model name 757 model - force the model name
756 position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size) 758 position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF)
757 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) 759 probe_mask - Bitmask to probe codecs (default = -1, meaning all slots)
760 bdl_pos_adj - Specifies the DMA IRQ timing delay in samples.
761 Passing -1 will make the driver to choose the appropriate
762 value based on the controller chip.
758 763
759 [Single (global) options] 764 [Single (global) options]
760 single_cmd - Use single immediate commands to communicate with 765 single_cmd - Use single immediate commands to communicate with
@@ -804,6 +809,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
804 ALC260 809 ALC260
805 hp HP machines 810 hp HP machines
806 hp-3013 HP machines (3013-variant) 811 hp-3013 HP machines (3013-variant)
812 hp-dc7600 HP DC7600
807 fujitsu Fujitsu S7020 813 fujitsu Fujitsu S7020
808 acer Acer TravelMate 814 acer Acer TravelMate
809 will Will laptops (PB V7900) 815 will Will laptops (PB V7900)
@@ -825,8 +831,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
825 hippo Hippo (ATI) with jack detection, Sony UX-90s 831 hippo Hippo (ATI) with jack detection, Sony UX-90s
826 hippo_1 Hippo (Benq) with jack detection 832 hippo_1 Hippo (Benq) with jack detection
827 sony-assamd Sony ASSAMD 833 sony-assamd Sony ASSAMD
834 toshiba-s06 Toshiba S06
835 toshiba-rx1 Toshiba RX1
828 ultra Samsung Q1 Ultra Vista model 836 ultra Samsung Q1 Ultra Vista model
829 lenovo-3000 Lenovo 3000 y410 837 lenovo-3000 Lenovo 3000 y410
838 nec NEC Versa S9100
830 basic fixed pin assignment w/o SPDIF 839 basic fixed pin assignment w/o SPDIF
831 auto auto-config reading BIOS (default) 840 auto auto-config reading BIOS (default)
832 841
@@ -835,6 +844,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
835 3stack 3-stack model 844 3stack 3-stack model
836 toshiba Toshiba A205 845 toshiba Toshiba A205
837 acer Acer laptops 846 acer Acer laptops
847 acer-aspire Acer Aspire One
838 dell Dell OEM laptops (Vostro 1200) 848 dell Dell OEM laptops (Vostro 1200)
839 zepto Zepto laptops 849 zepto Zepto laptops
840 test for testing/debugging purpose, almost all controls can 850 test for testing/debugging purpose, almost all controls can
@@ -844,8 +854,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
844 854
845 ALC269 855 ALC269
846 basic Basic preset 856 basic Basic preset
857 quanta Quanta FL1
858 eeepc-p703 ASUS Eeepc P703 P900A
859 eeepc-p901 ASUS Eeepc P901 S101
847 860
848 ALC662 861 ALC662/663
849 3stack-dig 3-stack (2-channel) with SPDIF 862 3stack-dig 3-stack (2-channel) with SPDIF
850 3stack-6ch 3-stack (6-channel) 863 3stack-6ch 3-stack (6-channel)
851 3stack-6ch-dig 3-stack (6-channel) with SPDIF 864 3stack-6ch-dig 3-stack (6-channel) with SPDIF
@@ -853,6 +866,17 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
853 lenovo-101e Lenovo laptop 866 lenovo-101e Lenovo laptop
854 eeepc-p701 ASUS Eeepc P701 867 eeepc-p701 ASUS Eeepc P701
855 eeepc-ep20 ASUS Eeepc EP20 868 eeepc-ep20 ASUS Eeepc EP20
869 ecs ECS/Foxconn mobo
870 m51va ASUS M51VA
871 g71v ASUS G71V
872 h13 ASUS H13
873 g50v ASUS G50V
874 asus-mode1 ASUS
875 asus-mode2 ASUS
876 asus-mode3 ASUS
877 asus-mode4 ASUS
878 asus-mode5 ASUS
879 asus-mode6 ASUS
856 auto auto-config reading BIOS (default) 880 auto auto-config reading BIOS (default)
857 881
858 ALC882/885 882 ALC882/885
@@ -884,12 +908,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
884 lenovo-101e Lenovo 101E 908 lenovo-101e Lenovo 101E
885 lenovo-nb0763 Lenovo NB0763 909 lenovo-nb0763 Lenovo NB0763
886 lenovo-ms7195-dig Lenovo MS7195 910 lenovo-ms7195-dig Lenovo MS7195
911 lenovo-sky Lenovo Sky
887 haier-w66 Haier W66 912 haier-w66 Haier W66
888 3stack-hp HP machines with 3stack (Lucknow, Samba boards) 913 3stack-hp HP machines with 3stack (Lucknow, Samba boards)
889 6stack-dell Dell machines with 6stack (Inspiron 530) 914 6stack-dell Dell machines with 6stack (Inspiron 530)
890 mitac Mitac 8252D 915 mitac Mitac 8252D
891 clevo-m720 Clevo M720 laptop series 916 clevo-m720 Clevo M720 laptop series
892 fujitsu-pi2515 Fujitsu AMILO Pi2515 917 fujitsu-pi2515 Fujitsu AMILO Pi2515
918 3stack-6ch-intel Intel DG33* boards
893 auto auto-config reading BIOS (default) 919 auto auto-config reading BIOS (default)
894 920
895 ALC861/660 921 ALC861/660
@@ -922,7 +948,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
922 allout 5-jack in back, 2-jack in front, SPDIF out 948 allout 5-jack in back, 2-jack in front, SPDIF out
923 auto auto-config reading BIOS (default) 949 auto auto-config reading BIOS (default)
924 950
925 AD1882 951 AD1882 / AD1882A
926 3stack 3-stack mode (default) 952 3stack 3-stack mode (default)
927 6stack 6-stack mode 953 6stack 6-stack mode
928 954
@@ -1017,6 +1043,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1017 intel-mac-v3 Intel Mac Type 3 1043 intel-mac-v3 Intel Mac Type 3
1018 intel-mac-v4 Intel Mac Type 4 1044 intel-mac-v4 Intel Mac Type 4
1019 intel-mac-v5 Intel Mac Type 5 1045 intel-mac-v5 Intel Mac Type 5
1046 intel-mac-auto Intel Mac (detect type according to subsystem id)
1020 macmini Intel Mac Mini (equivalent with type 3) 1047 macmini Intel Mac Mini (equivalent with type 3)
1021 macbook Intel Mac Book (eq. type 5) 1048 macbook Intel Mac Book (eq. type 5)
1022 macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) 1049 macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3)
@@ -1071,7 +1098,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1071 register value without FIFO size correction as the current 1098 register value without FIFO size correction as the current
1072 DMA pointer. position_fix=2 will make the driver to use 1099 DMA pointer. position_fix=2 will make the driver to use
1073 the position buffer instead of reading SD_LPIB register. 1100 the position buffer instead of reading SD_LPIB register.
1074 (Usually SD_LPLIB register is more accurate than the 1101 (Usually SD_LPIB register is more accurate than the
1075 position buffer.) 1102 position buffer.)
1076 1103
1077 NB: If you get many "azx_get_response timeout" messages at 1104 NB: If you get many "azx_get_response timeout" messages at
@@ -1091,7 +1118,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1091 This occurs when the access to non-existing or non-working codec slot 1118 This occurs when the access to non-existing or non-working codec slot
1092 (likely a modem one) causes a stall of the communication via HD-audio 1119 (likely a modem one) causes a stall of the communication via HD-audio
1093 bus. You can see which codec slots are probed by enabling 1120 bus. You can see which codec slots are probed by enabling
1094 CONFIG_SND_DEBUG_DETECT, or simply from the file name of the codec 1121 CONFIG_SND_DEBUG_VERBOSE, or simply from the file name of the codec
1095 proc files. Then limit the slots to probe by probe_mask option. 1122 proc files. Then limit the slots to probe by probe_mask option.
1096 For example, probe_mask=1 means to probe only the first slot, and 1123 For example, probe_mask=1 means to probe only the first slot, and
1097 probe_mask=4 means only the third slot. 1124 probe_mask=4 means only the third slot.
@@ -1136,8 +1163,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1136 1163
1137 This module supports autoprobe and multiple cards. 1164 This module supports autoprobe and multiple cards.
1138 1165
1139 Power management is _not_ supported.
1140
1141 Module snd-ice1712 1166 Module snd-ice1712
1142 ------------------ 1167 ------------------
1143 1168
@@ -1160,6 +1185,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1160 * Event Electronics, EZ8 1185 * Event Electronics, EZ8
1161 * Digigram VX442 1186 * Digigram VX442
1162 * Lionstracs, Mediastaton 1187 * Lionstracs, Mediastaton
1188 * Terrasoniq TS 88
1163 1189
1164 model - Use the given board model, one of the following: 1190 model - Use the given board model, one of the following:
1165 delta1010, dio2496, delta66, delta44, audiophile, delta410, 1191 delta1010, dio2496, delta66, delta44, audiophile, delta410,
@@ -1194,7 +1220,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1194 * TerraTec Phase 22 1220 * TerraTec Phase 22
1195 * TerraTec Phase 28 1221 * TerraTec Phase 28
1196 * AudioTrak Prodigy 7.1 1222 * AudioTrak Prodigy 7.1
1197 * AudioTrak Prodigy 7.1LT 1223 * AudioTrak Prodigy 7.1 LT
1224 * AudioTrak Prodigy 7.1 XT
1225 * AudioTrak Prodigy 7.1 HIFI
1226 * AudioTrak Prodigy 7.1 HD2
1198 * AudioTrak Prodigy 192 1227 * AudioTrak Prodigy 192
1199 * Pontis MS300 1228 * Pontis MS300
1200 * Albatron K8X800 Pro II 1229 * Albatron K8X800 Pro II
@@ -1205,12 +1234,16 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1205 * Shuttle SN25P 1234 * Shuttle SN25P
1206 * Onkyo SE-90PCI 1235 * Onkyo SE-90PCI
1207 * Onkyo SE-200PCI 1236 * Onkyo SE-200PCI
1237 * ESI Juli@
1238 * Hercules Fortissimo IV
1239 * EGO-SYS WaveTerminal 192M
1208 1240
1209 model - Use the given board model, one of the following: 1241 model - Use the given board model, one of the following:
1210 revo51, revo71, amp2000, prodigy71, prodigy71lt, 1242 revo51, revo71, amp2000, prodigy71, prodigy71lt,
1211 prodigy192, aureon51, aureon71, universe, ap192, 1243 prodigy71xt, prodigy71hifi, prodigyhd2, prodigy192,
1212 k8x800, phase22, phase28, ms300, av710, se200pci, 1244 juli, aureon51, aureon71, universe, ap192, k8x800,
1213 se90pci 1245 phase22, phase28, ms300, av710, se200pci, se90pci,
1246 fortissimo4, sn25p, WT192M
1214 1247
1215 This module supports multiple cards and autoprobe. 1248 This module supports multiple cards and autoprobe.
1216 1249
@@ -1249,7 +1282,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1249 1282
1250 Module for AC'97 motherboards from Intel and compatibles. 1283 Module for AC'97 motherboards from Intel and compatibles.
1251 * Intel i810/810E, i815, i820, i830, i84x, MX440 1284 * Intel i810/810E, i815, i820, i830, i84x, MX440
1252 ICH5, ICH6, ICH7, ESB2 1285 ICH5, ICH6, ICH7, 6300ESB, ESB2
1253 * SiS 7012 (SiS 735) 1286 * SiS 7012 (SiS 735)
1254 * NVidia NForce, NForce2, NForce3, MCP04, CK804 1287 * NVidia NForce, NForce2, NForce3, MCP04, CK804
1255 CK8, CK8S, MCP501 1288 CK8, CK8S, MCP501
@@ -1620,8 +1653,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1620 1653
1621 This module supports autoprobe and multiple cards. 1654 This module supports autoprobe and multiple cards.
1622 1655
1623 Power management is _not_ supported.
1624
1625 Module snd-pcsp 1656 Module snd-pcsp
1626 ----------------- 1657 -----------------
1627 1658
@@ -1947,6 +1978,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1947 * CHIC True Sound 4Dwave 1978 * CHIC True Sound 4Dwave
1948 * Shark Predator4D-PCI 1979 * Shark Predator4D-PCI
1949 * Jaton SonicWave 4D 1980 * Jaton SonicWave 4D
1981 * SiS SI7018 PCI Audio
1982 * Hoontech SoundTrack Digital 4DWave NX
1950 1983
1951 pcm_channels - max channels (voices) reserved for PCM 1984 pcm_channels - max channels (voices) reserved for PCM
1952 wavetable_size - max wavetable size in kB (4-?kb) 1985 wavetable_size - max wavetable size in kB (4-?kb)
@@ -1962,12 +1995,25 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
1962 1995
1963 vid - Vendor ID for the device (optional) 1996 vid - Vendor ID for the device (optional)
1964 pid - Product ID for the device (optional) 1997 pid - Product ID for the device (optional)
1998 nrpacks - Max. number of packets per URB (default: 8)
1999 async_unlink - Use async unlink mode (default: yes)
1965 device_setup - Device specific magic number (optional) 2000 device_setup - Device specific magic number (optional)
1966 - Influence depends on the device 2001 - Influence depends on the device
1967 - Default: 0x0000 2002 - Default: 0x0000
2003 ignore_ctl_error - Ignore any USB-controller regarding mixer
2004 interface (default: no)
1968 2005
1969 This module supports multiple devices, autoprobe and hotplugging. 2006 This module supports multiple devices, autoprobe and hotplugging.
1970 2007
2008 NB: nrpacks parameter can be modified dynamically via sysfs.
2009 Don't put the value over 20. Changing via sysfs has no sanity
2010 check.
2011 NB: async_unlink=0 would cause Oops. It remains just for
2012 debugging purpose (if any).
2013 NB: ignore_ctl_error=1 may help when you get an error at accessing
2014 the mixer element such as URB error -22. This happens on some
2015 buggy USB device or the controller.
2016
1971 Module snd-usb-caiaq 2017 Module snd-usb-caiaq
1972 -------------------- 2018 --------------------
1973 2019
@@ -2073,13 +2119,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
2073 Module snd-virtuoso 2119 Module snd-virtuoso
2074 ------------------- 2120 -------------------
2075 2121
2076 Module for sound cards based on the Asus AV200 chip, i.e., 2122 Module for sound cards based on the Asus AV100/AV200 chips,
2077 Xonar D2 and Xonar D2X. 2123 i.e., Xonar D1, DX, D2, D2X and HDAV1.3 (Deluxe).
2078 2124
2079 This module supports autoprobe and multiple cards. 2125 This module supports autoprobe and multiple cards.
2080 2126
2081 Power management is _not_ supported.
2082
2083 Module snd-vx222 2127 Module snd-vx222
2084 ---------------- 2128 ----------------
2085 2129
@@ -2267,6 +2311,10 @@ case above again, the first two slots are already reserved. If any
2267other driver (e.g. snd-usb-audio) is loaded before snd-interwave or 2311other driver (e.g. snd-usb-audio) is loaded before snd-interwave or
2268snd-ens1371, it will be assigned to the third or later slot. 2312snd-ens1371, it will be assigned to the third or later slot.
2269 2313
2314When a module name is given with '!', the slot will be given for any
2315modules but that name. For example, "slots=!snd-pcsp" will reserve
2316the first slot for any modules but snd-pcsp.
2317
2270 2318
2271ALSA PCM devices to OSS devices mapping 2319ALSA PCM devices to OSS devices mapping
2272======================================= 2320=======================================
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index 2ad5e6306c44..a4c53d8961e1 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -236,15 +236,15 @@ The parameter can be given:
236 alias snd-card-1 snd-usb-audio 236 alias snd-card-1 snd-usb-audio
237 options snd-usb-audio index=1 device_setup=0x09 237 options snd-usb-audio index=1 device_setup=0x09
238 238
239CAUTION when initializaing the device 239CAUTION when initializing the device
240------------------------------------- 240-------------------------------------
241 241
242 * Correct initialization on the device requires that device_setup is given to 242 * Correct initialization on the device requires that device_setup is given to
243 the module BEFORE the device is turned on. So, if you use the "manual probing" 243 the module BEFORE the device is turned on. So, if you use the "manual probing"
244 method described above, take care to power-on the device AFTER this initialization. 244 method described above, take care to power-on the device AFTER this initialization.
245 245
246 * Failing to respect this will lead in a misconfiguration of the device. In this case 246 * Failing to respect this will lead to a misconfiguration of the device. In this case
247 turn off the device, unproble the snd-usb-audio module, then probe it again with 247 turn off the device, unprobe the snd-usb-audio module, then probe it again with
248 correct device_setup parameter and then (and only then) turn on the device again. 248 correct device_setup parameter and then (and only then) turn on the device again.
249 249
250 * If you've correctly initialized the device in a valid mode and then want to switch 250 * If you've correctly initialized the device in a valid mode and then want to switch
@@ -388,9 +388,9 @@ There are 2 main potential issues when using Jackd with the device:
388 388
389Jack supports big endian devices only in recent versions (thanks to 389Jack supports big endian devices only in recent versions (thanks to
390Andreas Steinmetz for his first big-endian patch). I can't remember 390Andreas Steinmetz for his first big-endian patch). I can't remember
391extacly when this support was released into jackd, let's just say that 391exactly when this support was released into jackd, let's just say that
392with jackd version 0.103.0 it's almost ok (just a small bug is affecting 392with jackd version 0.103.0 it's almost ok (just a small bug is affecting
39316bits Big-Endian devices, but since you've read carefully the above 39316bits Big-Endian devices, but since you've read carefully the above
394paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices 394paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices
395are now Little Endians ;-) ). 395are now Little Endians ;-) ).
396 396
diff --git a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
index c4d2e3507af9..9d644f7e241e 100644
--- a/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
+++ b/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
@@ -42,7 +42,7 @@
42 <sect1><title>Device Components</title> 42 <sect1><title>Device Components</title>
43!Esound/core/device.c 43!Esound/core/device.c
44 </sect1> 44 </sect1>
45 <sect1><title>KMOD and Device File Entries</title> 45 <sect1><title>Module requests and Device File Entries</title>
46!Esound/core/sound.c 46!Esound/core/sound.c
47 </sect1> 47 </sect1>
48 <sect1><title>Memory Management Helpers</title> 48 <sect1><title>Memory Management Helpers</title>
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index b03df4d4795c..b54cb5048dfa 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -6127,52 +6127,66 @@ struct _snd_pcm_runtime {
6127 6127
6128 <para> 6128 <para>
6129 <function>snd_printdd()</function> is compiled in only when 6129 <function>snd_printdd()</function> is compiled in only when
6130 <constant>CONFIG_SND_DEBUG_DETECT</constant> is set. Please note 6130 <constant>CONFIG_SND_DEBUG_VERBOSE</constant> is set. Please note
6131 that <constant>DEBUG_DETECT</constant> is not set as default 6131 that <constant>CONFIG_SND_DEBUG_VERBOSE</constant> is not set as default
6132 even if you configure the alsa-driver with 6132 even if you configure the alsa-driver with
6133 <option>--with-debug=full</option> option. You need to give 6133 <option>--with-debug=full</option> option. You need to give
6134 explicitly <option>--with-debug=detect</option> option instead. 6134 explicitly <option>--with-debug=detect</option> option instead.
6135 </para> 6135 </para>
6136 </section> 6136 </section>
6137 6137
6138 <section id="useful-functions-snd-assert"> 6138 <section id="useful-functions-snd-bug">
6139 <title><function>snd_assert()</function></title> 6139 <title><function>snd_BUG()</function></title>
6140 <para> 6140 <para>
6141 <function>snd_assert()</function> macro is similar with the 6141 It shows the <computeroutput>BUG?</computeroutput> message and
6142 normal <function>assert()</function> macro. For example, 6142 stack trace as well as <function>snd_BUG_ON</function> at the point.
6143 It's useful to show that a fatal error happens there.
6144 </para>
6145 <para>
6146 When no debug flag is set, this macro is ignored.
6147 </para>
6148 </section>
6149
6150 <section id="useful-functions-snd-bug-on">
6151 <title><function>snd_BUG_ON()</function></title>
6152 <para>
6153 <function>snd_BUG_ON()</function> macro is similar with
6154 <function>WARN_ON()</function> macro. For example,
6143 6155
6144 <informalexample> 6156 <informalexample>
6145 <programlisting> 6157 <programlisting>
6146<![CDATA[ 6158<![CDATA[
6147 snd_assert(pointer != NULL, return -EINVAL); 6159 snd_BUG_ON(!pointer);
6148]]> 6160]]>
6149 </programlisting> 6161 </programlisting>
6150 </informalexample> 6162 </informalexample>
6151 </para>
6152 6163
6153 <para> 6164 or it can be used as the condition,
6154 The first argument is the expression to evaluate, and the 6165 <informalexample>
6155 second argument is the action if it fails. When 6166 <programlisting>
6156 <constant>CONFIG_SND_DEBUG</constant>, is set, it will show an 6167<![CDATA[
6157 error message such as <computeroutput>BUG? (xxx)</computeroutput> 6168 if (snd_BUG_ON(non_zero_is_bug))
6158 together with stack trace. 6169 return -EINVAL;
6159 </para> 6170]]>
6160 <para> 6171 </programlisting>
6161 When no debug flag is set, this macro is ignored. 6172 </informalexample>
6162 </para>
6163 </section>
6164 6173
6165 <section id="useful-functions-snd-bug">
6166 <title><function>snd_BUG()</function></title>
6167 <para>
6168 It shows the <computeroutput>BUG?</computeroutput> message and
6169 stack trace as well as <function>snd_assert</function> at the point.
6170 It's useful to show that a fatal error happens there.
6171 </para> 6174 </para>
6175
6172 <para> 6176 <para>
6173 When no debug flag is set, this macro is ignored. 6177 The macro takes an conditional expression to evaluate.
6178 When <constant>CONFIG_SND_DEBUG</constant>, is set, the
6179 expression is actually evaluated. If it's non-zero, it shows
6180 the warning message such as
6181 <computeroutput>BUG? (xxx)</computeroutput>
6182 normally followed by stack trace. It returns the evaluated
6183 value.
6184 When no <constant>CONFIG_SND_DEBUG</constant> is set, this
6185 macro always returns zero.
6174 </para> 6186 </para>
6187
6175 </section> 6188 </section>
6189
6176 </chapter> 6190 </chapter>
6177 6191
6178 6192
diff --git a/Documentation/sound/alsa/hda_codec.txt b/Documentation/sound/alsa/hda_codec.txt
index 8e1b02526698..34e87ec1379c 100644
--- a/Documentation/sound/alsa/hda_codec.txt
+++ b/Documentation/sound/alsa/hda_codec.txt
@@ -67,7 +67,7 @@ CONFIG_SND_HDA_POWER_SAVE kconfig. It's called when the codec needs
67to power up or may power down. The controller should check the all 67to power up or may power down. The controller should check the all
68belonging codecs on the bus whether they are actually powered off 68belonging codecs on the bus whether they are actually powered off
69(check codec->power_on), and optionally the driver may power down the 69(check codec->power_on), and optionally the driver may power down the
70contoller side, too. 70controller side, too.
71 71
72The bus instance is created via snd_hda_bus_new(). You need to pass 72The bus instance is created via snd_hda_bus_new(). You need to pass
73the card instance, the template, and the pointer to store the 73the card instance, the template, and the pointer to store the
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/alsa/soc/dapm.txt
index c784a18b94dc..46f9684d0b29 100644
--- a/Documentation/sound/alsa/soc/dapm.txt
+++ b/Documentation/sound/alsa/soc/dapm.txt
@@ -68,7 +68,7 @@ Audio DAPM widgets fall into a number of types:-
68(Widgets are defined in include/sound/soc-dapm.h) 68(Widgets are defined in include/sound/soc-dapm.h)
69 69
70Widgets are usually added in the codec driver and the machine driver. There are 70Widgets are usually added in the codec driver and the machine driver. There are
71convience macros defined in soc-dapm.h that can be used to quickly build a 71convenience macros defined in soc-dapm.h that can be used to quickly build a
72list of widgets of the codecs and machines DAPM widgets. 72list of widgets of the codecs and machines DAPM widgets.
73 73
74Most widgets have a name, register, shift and invert. Some widgets have extra 74Most widgets have a name, register, shift and invert. Some widgets have extra
@@ -135,11 +135,7 @@ when the Mic is inserted:-
135 135
136static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) 136static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event)
137{ 137{
138 if(SND_SOC_DAPM_EVENT_ON(event)) 138 gpio_set_value(SPITZ_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event));
139 set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_MIC_BIAS);
140 else
141 reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_MIC_BIAS);
142
143 return 0; 139 return 0;
144} 140}
145 141
@@ -269,11 +265,7 @@ powered only when the spk is in use.
269/* turn speaker amplifier on/off depending on use */ 265/* turn speaker amplifier on/off depending on use */
270static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) 266static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event)
271{ 267{
272 if (SND_SOC_DAPM_EVENT_ON(event)) 268 gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event));
273 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON);
274 else
275 reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_APM_ON);
276
277 return 0; 269 return 0;
278} 270}
279 271
diff --git a/Documentation/sparse.txt b/Documentation/sparse.txt
index 1a3bdc27d95e..42f43fa59f24 100644
--- a/Documentation/sparse.txt
+++ b/Documentation/sparse.txt
@@ -73,10 +73,10 @@ recompiled, or use "make C=2" to run sparse on the files whether they need to
73be recompiled or not. The latter is a fast way to check the whole tree if you 73be recompiled or not. The latter is a fast way to check the whole tree if you
74have already built it. 74have already built it.
75 75
76The optional make variable CHECKFLAGS can be used to pass arguments to sparse. 76The optional make variable CF can be used to pass arguments to sparse. The
77The build system passes -Wbitwise to sparse automatically. To perform 77build system passes -Wbitwise to sparse automatically. To perform endianness
78endianness checks, you may define __CHECK_ENDIAN__: 78checks, you may define __CHECK_ENDIAN__:
79 79
80 make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" 80 make C=2 CF="-D__CHECK_ENDIAN__"
81 81
82These checks are disabled by default as they generate a host of warnings. 82These checks are disabled by default as they generate a host of warnings.
diff --git a/Documentation/specialix.txt b/Documentation/specialix.txt
index 4a4b428ce8f6..6eb6f3a3331c 100644
--- a/Documentation/specialix.txt
+++ b/Documentation/specialix.txt
@@ -270,8 +270,8 @@ The pinout of the connectors on the IO8+ is:
270Hardware handshaking issues. 270Hardware handshaking issues.
271============================ 271============================
272 272
273The driver can be compiled in two different ways. The default 273The driver can be told to operate in two different ways. The default
274("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when 274behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when
275hardware handshaking is off. It behaves as the RTS hardware 275hardware handshaking is off. It behaves as the RTS hardware
276handshaking signal when hardware handshaking is selected. 276handshaking signal when hardware handshaking is selected.
277 277
@@ -280,7 +280,7 @@ cable will either be compatible with hardware handshaking or with
280software handshaking. So switching on the fly is not really an 280software handshaking. So switching on the fly is not really an
281option. 281option.
282 282
283I actually prefer to use the "Specialix DTR/RTS pin is RTS" option. 283I actually prefer to use the "specialix.sx_rtscts=1" option.
284This makes the DTR/RTS pin always an RTS pin, and ioctls to 284This makes the DTR/RTS pin always an RTS pin, and ioctls to
285change DTR are always ignored. I have a cable that is configured 285change DTR are always ignored. I have a cable that is configured
286for this. 286for this.
@@ -379,7 +379,5 @@ it doesn't fit in your computer, bring back the card.
379 You have to WRITE to the address register to even 379 You have to WRITE to the address register to even
380 read-probe a CD186x register. Disable autodetection? 380 read-probe a CD186x register. Disable autodetection?
381 -- Specialix: any suggestions? 381 -- Specialix: any suggestions?
382 - Arbitrary baud rates are not implemented yet.
383 If you need this, bug me about it.
384 382
385 383
diff --git a/Documentation/spi/Makefile b/Documentation/spi/Makefile
new file mode 100644
index 000000000000..a5b03c88beae
--- /dev/null
+++ b/Documentation/spi/Makefile
@@ -0,0 +1,11 @@
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 := spidev_test spidev_fdx
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
9
10HOSTCFLAGS_spidev_test.o += -I$(objtree)/usr/include
11HOSTCFLAGS_spidev_fdx.o += -I$(objtree)/usr/include
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
index f3853cc37bde..bbe8dee681a5 100644
--- a/Documentation/spi/pxa2xx
+++ b/Documentation/spi/pxa2xx
@@ -19,7 +19,7 @@ Declaring PXA2xx Master Controllers
19----------------------------------- 19-----------------------------------
20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a 20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
21"platform device". The master configuration is passed to the driver via a table 21"platform device". The master configuration is passed to the driver via a table
22found in include/asm-arm/arch-pxa/pxa2xx_spi.h: 22found in arch/arm/mach-pxa/include/mach/pxa2xx_spi.h:
23 23
24struct pxa2xx_spi_master { 24struct pxa2xx_spi_master {
25 enum pxa_ssp_type ssp_type; 25 enum pxa_ssp_type ssp_type;
@@ -94,7 +94,7 @@ using the "spi_board_info" structure found in "linux/spi/spi.h". See
94 94
95Each slave device attached to the PXA must provide slave specific configuration 95Each slave device attached to the PXA must provide slave specific configuration
96information via the structure "pxa2xx_spi_chip" found in 96information via the structure "pxa2xx_spi_chip" found in
97"include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver 97"arch/arm/mach-pxa/include/mach/pxa2xx_spi.h". The pxa2xx_spi master controller driver
98will uses the configuration whenever the driver communicates with the slave 98will uses the configuration whenever the driver communicates with the slave
99device. 99device.
100 100
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index 6d5f18143c50..8bae2f018d34 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -210,7 +210,7 @@ board should normally be set up and registered.
210 210
211So for example arch/.../mach-*/board-*.c files might have code like: 211So for example arch/.../mach-*/board-*.c files might have code like:
212 212
213 #include <asm/arch/spi.h> /* for mysoc_spi_data */ 213 #include <mach/spi.h> /* for mysoc_spi_data */
214 214
215 /* if your mach-* infrastructure doesn't support kernels that can 215 /* if your mach-* infrastructure doesn't support kernels that can
216 * run on multiple boards, pdata wouldn't benefit from "__init". 216 * run on multiple boards, pdata wouldn't benefit from "__init".
@@ -227,7 +227,7 @@ So for example arch/.../mach-*/board-*.c files might have code like:
227 227
228And SOC-specific utility code might look something like: 228And SOC-specific utility code might look something like:
229 229
230 #include <asm/arch/spi.h> 230 #include <mach/spi.h>
231 231
232 static struct platform_device spi2 = { ... }; 232 static struct platform_device spi2 = { ... };
233 233
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 276a7e637822..e1ff0d920a5c 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -351,9 +351,10 @@ kernel. This value defaults to SHMMAX.
351 351
352softlockup_thresh: 352softlockup_thresh:
353 353
354This value can be used to lower the softlockup tolerance 354This value can be used to lower the softlockup tolerance threshold. The
355threshold. The default threshold is 10s. If a cpu is locked up 355default threshold is 60 seconds. If a cpu is locked up for 60 seconds,
356for 10s, the kernel complains. Valid values are 1-60s. 356the kernel complains. Valid values are 1-60 seconds. Setting this
357tunable to zero will disable the softlockup detection altogether.
357 358
358============================================================== 359==============================================================
359 360
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index 8a4863c4edd4..d79eeda7a699 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -116,7 +116,7 @@ of kilobytes free. The VM uses this number to compute a pages_min
116value for each lowmem zone in the system. Each lowmem zone gets 116value for each lowmem zone in the system. Each lowmem zone gets
117a number of reserved free pages based proportionally on its size. 117a number of reserved free pages based proportionally on its size.
118 118
119Some minimal ammount of memory is needed to satisfy PF_MEMALLOC 119Some minimal amount of memory is needed to satisfy PF_MEMALLOC
120allocations; if you set this to lower than 1024KB, your system will 120allocations; if you set this to lower than 1024KB, your system will
121become subtly broken, and prone to deadlock under high loads. 121become subtly broken, and prone to deadlock under high loads.
122 122
diff --git a/Documentation/sysfs-rules.txt b/Documentation/sysfs-rules.txt
index 80ef562160bb..6049a2a84dda 100644
--- a/Documentation/sysfs-rules.txt
+++ b/Documentation/sysfs-rules.txt
@@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs
3The kernel-exported sysfs exports internal kernel implementation details 3The kernel-exported sysfs exports internal kernel implementation details
4and depends on internal kernel structures and layout. It is agreed upon 4and depends on internal kernel structures and layout. It is agreed upon
5by the kernel developers that the Linux kernel does not provide a stable 5by the kernel developers that the Linux kernel does not provide a stable
6internal API. As sysfs is a direct export of kernel internal 6internal API. Therefore, there are aspects of the sysfs interface that
7structures, the sysfs interface cannot provide a stable interface either; 7may not be stable across kernel releases.
8it may always change along with internal kernel changes.
9 8
10To minimize the risk of breaking users of sysfs, which are in most cases 9To minimize the risk of breaking users of sysfs, which are in most cases
11low-level userspace applications, with a new kernel release, the users 10low-level userspace applications, with a new kernel release, the users
diff --git a/Documentation/telephony/ixj.txt b/Documentation/telephony/ixj.txt
index 621024fd3a18..44d124005bad 100644
--- a/Documentation/telephony/ixj.txt
+++ b/Documentation/telephony/ixj.txt
@@ -305,21 +305,14 @@ driver, like this:
305 305
306which will result in the needed drivers getting loaded automatically. 306which will result in the needed drivers getting loaded automatically.
307 307
308 g. if you are planning on using kerneld to automatically load the 308 g. if you are planning on having the kernel automatically request
309module for you, then you need to edit /etc/conf.modules and add the 309the module for you, then you need to edit /etc/conf.modules and add the
310following lines: 310following lines:
311 311
312 options ixj dspio=0x340 xio=0x330 ixjdebug=0 312 options ixj dspio=0x340 xio=0x330 ixjdebug=0
313 313
314If you do this, then when you execute an application that uses the 314If you do this, then when you execute an application that uses the
315module kerneld will load the module for you. Note that to do this, 315module the kernel will request that it is loaded.
316you need to have your kernel set to support kerneld. You can check
317for this by looking at /usr/src/linux/.config and you should see this:
318
319 # Loadable module support
320 #
321 <snip>
322 CONFIG_KMOD=y
323 316
324 h. if you want non-root users to be able to read and write to the 317 h. if you want non-root users to be able to read and write to the
325ixj devices (this is a good idea!) you should do the following: 318ixj devices (this is a good idea!) you should do the following:
diff --git a/Documentation/timers/highres.txt b/Documentation/timers/highres.txt
index a73ecf5b4bdb..21332233cef1 100644
--- a/Documentation/timers/highres.txt
+++ b/Documentation/timers/highres.txt
@@ -125,7 +125,7 @@ increase of flexibility and the avoidance of duplicated code across
125architectures justifies the slight increase of the binary size. 125architectures justifies the slight increase of the binary size.
126 126
127The conversion of an architecture has no functional impact, but allows to 127The conversion of an architecture has no functional impact, but allows to
128utilize the high resolution and dynamic tick functionalites without any change 128utilize the high resolution and dynamic tick functionalities without any change
129to the clock event device and timer interrupt code. After the conversion the 129to the clock event device and timer interrupt code. After the conversion the
130enabling of high resolution timers and dynamic ticks is simply provided by 130enabling of high resolution timers and dynamic ticks is simply provided by
131adding the kernel/time/Kconfig file to the architecture specific Kconfig and 131adding the kernel/time/Kconfig file to the architecture specific Kconfig and
diff --git a/Documentation/tracers/mmiotrace.txt b/Documentation/tracers/mmiotrace.txt
new file mode 100644
index 000000000000..a4afb560a45b
--- /dev/null
+++ b/Documentation/tracers/mmiotrace.txt
@@ -0,0 +1,164 @@
1 In-kernel memory-mapped I/O tracing
2
3
4Home page and links to optional user space tools:
5
6 http://nouveau.freedesktop.org/wiki/MmioTrace
7
8MMIO tracing was originally developed by Intel around 2003 for their Fault
9Injection Test Harness. In Dec 2006 - Jan 2007, using the code from Intel,
10Jeff Muizelaar created a tool for tracing MMIO accesses with the Nouveau
11project in mind. Since then many people have contributed.
12
13Mmiotrace was built for reverse engineering any memory-mapped IO device with
14the Nouveau project as the first real user. Only x86 and x86_64 architectures
15are supported.
16
17Out-of-tree mmiotrace was originally modified for mainline inclusion and
18ftrace framework by Pekka Paalanen <pq@iki.fi>.
19
20
21Preparation
22-----------
23
24Mmiotrace feature is compiled in by the CONFIG_MMIOTRACE option. Tracing is
25disabled by default, so it is safe to have this set to yes. SMP systems are
26supported, but tracing is unreliable and may miss events if more than one CPU
27is on-line, therefore mmiotrace takes all but one CPU off-line during run-time
28activation. You can re-enable CPUs by hand, but you have been warned, there
29is no way to automatically detect if you are losing events due to CPUs racing.
30
31
32Usage Quick Reference
33---------------------
34
35$ mount -t debugfs debugfs /debug
36$ echo mmiotrace > /debug/tracing/current_tracer
37$ cat /debug/tracing/trace_pipe > mydump.txt &
38Start X or whatever.
39$ echo "X is up" > /debug/tracing/marker
40$ echo none > /debug/tracing/current_tracer
41Check for lost events.
42
43
44Usage
45-----
46
47Make sure debugfs is mounted to /debug. If not, (requires root privileges)
48$ mount -t debugfs debugfs /debug
49
50Check that the driver you are about to trace is not loaded.
51
52Activate mmiotrace (requires root privileges):
53$ echo mmiotrace > /debug/tracing/current_tracer
54
55Start storing the trace:
56$ cat /debug/tracing/trace_pipe > mydump.txt &
57The 'cat' process should stay running (sleeping) in the background.
58
59Load the driver you want to trace and use it. Mmiotrace will only catch MMIO
60accesses to areas that are ioremapped while mmiotrace is active.
61
62[Unimplemented feature:]
63During tracing you can place comments (markers) into the trace by
64$ echo "X is up" > /debug/tracing/marker
65This makes it easier to see which part of the (huge) trace corresponds to
66which action. It is recommended to place descriptive markers about what you
67do.
68
69Shut down mmiotrace (requires root privileges):
70$ echo none > /debug/tracing/current_tracer
71The 'cat' process exits. If it does not, kill it by issuing 'fg' command and
72pressing ctrl+c.
73
74Check that mmiotrace did not lose events due to a buffer filling up. Either
75$ grep -i lost mydump.txt
76which tells you exactly how many events were lost, or use
77$ dmesg
78to view your kernel log and look for "mmiotrace has lost events" warning. If
79events were lost, the trace is incomplete. You should enlarge the buffers and
80try again. Buffers are enlarged by first seeing how large the current buffers
81are:
82$ cat /debug/tracing/trace_entries
83gives you a number. Approximately double this number and write it back, for
84instance:
85$ echo 128000 > /debug/tracing/trace_entries
86Then start again from the top.
87
88If you are doing a trace for a driver project, e.g. Nouveau, you should also
89do the following before sending your results:
90$ lspci -vvv > lspci.txt
91$ dmesg > dmesg.txt
92$ tar zcf pciid-nick-mmiotrace.tar.gz mydump.txt lspci.txt dmesg.txt
93and then send the .tar.gz file. The trace compresses considerably. Replace
94"pciid" and "nick" with the PCI ID or model name of your piece of hardware
95under investigation and your nick name.
96
97
98How Mmiotrace Works
99-------------------
100
101Access to hardware IO-memory is gained by mapping addresses from PCI bus by
102calling one of the ioremap_*() functions. Mmiotrace is hooked into the
103__ioremap() function and gets called whenever a mapping is created. Mapping is
104an event that is recorded into the trace log. Note, that ISA range mappings
105are not caught, since the mapping always exists and is returned directly.
106
107MMIO accesses are recorded via page faults. Just before __ioremap() returns,
108the mapped pages are marked as not present. Any access to the pages causes a
109fault. The page fault handler calls mmiotrace to handle the fault. Mmiotrace
110marks the page present, sets TF flag to achieve single stepping and exits the
111fault handler. The instruction that faulted is executed and debug trap is
112entered. Here mmiotrace again marks the page as not present. The instruction
113is decoded to get the type of operation (read/write), data width and the value
114read or written. These are stored to the trace log.
115
116Setting the page present in the page fault handler has a race condition on SMP
117machines. During the single stepping other CPUs may run freely on that page
118and events can be missed without a notice. Re-enabling other CPUs during
119tracing is discouraged.
120
121
122Trace Log Format
123----------------
124
125The raw log is text and easily filtered with e.g. grep and awk. One record is
126one line in the log. A record starts with a keyword, followed by keyword
127dependant arguments. Arguments are separated by a space, or continue until the
128end of line. The format for version 20070824 is as follows:
129
130Explanation Keyword Space separated arguments
131---------------------------------------------------------------------------
132
133read event R width, timestamp, map id, physical, value, PC, PID
134write event W width, timestamp, map id, physical, value, PC, PID
135ioremap event MAP timestamp, map id, physical, virtual, length, PC, PID
136iounmap event UNMAP timestamp, map id, PC, PID
137marker MARK timestamp, text
138version VERSION the string "20070824"
139info for reader LSPCI one line from lspci -v
140PCI address map PCIDEV space separated /proc/bus/pci/devices data
141unk. opcode UNKNOWN timestamp, map id, physical, data, PC, PID
142
143Timestamp is in seconds with decimals. Physical is a PCI bus address, virtual
144is a kernel virtual address. Width is the data width in bytes and value is the
145data value. Map id is an arbitrary id number identifying the mapping that was
146used in an operation. PC is the program counter and PID is process id. PC is
147zero if it is not recorded. PID is always zero as tracing MMIO accesses
148originating in user space memory is not yet supported.
149
150For instance, the following awk filter will pass all 32-bit writes that target
151physical addresses in the range [0xfb73ce40, 0xfb800000[
152
153$ awk '/W 4 / { adr=strtonum($5); if (adr >= 0xfb73ce40 &&
154adr < 0xfb800000) print; }'
155
156
157Tools for Developers
158--------------------
159
160The user space tools include utilities for:
161- replacing numeric addresses and values with hardware register names
162- replaying MMIO logs, i.e., re-executing the recorded writes
163
164
diff --git a/Documentation/unaligned-memory-access.txt b/Documentation/unaligned-memory-access.txt
index b0472ac5226a..f866c72291bf 100644
--- a/Documentation/unaligned-memory-access.txt
+++ b/Documentation/unaligned-memory-access.txt
@@ -218,9 +218,35 @@ If use of such macros is not convenient, another option is to use memcpy(),
218where the source or destination (or both) are of type u8* or unsigned char*. 218where the source or destination (or both) are of type u8* or unsigned char*.
219Due to the byte-wise nature of this operation, unaligned accesses are avoided. 219Due to the byte-wise nature of this operation, unaligned accesses are avoided.
220 220
221
222Alignment vs. Networking
223========================
224
225On architectures that require aligned loads, networking requires that the IP
226header is aligned on a four-byte boundary to optimise the IP stack. For
227regular ethernet hardware, the constant NET_IP_ALIGN is used. On most
228architectures this constant has the value 2 because the normal ethernet
229header is 14 bytes long, so in order to get proper alignment one needs to
230DMA to an address which can be expressed as 4*n + 2. One notable exception
231here is powerpc which defines NET_IP_ALIGN to 0 because DMA to unaligned
232addresses can be very expensive and dwarf the cost of unaligned loads.
233
234For some ethernet hardware that cannot DMA to unaligned addresses like
2354*n+2 or non-ethernet hardware, this can be a problem, and it is then
236required to copy the incoming frame into an aligned buffer. Because this is
237unnecessary on architectures that can do unaligned accesses, the code can be
238made dependent on CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS like so:
239
240#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
241 skb = original skb
242#else
243 skb = copy skb
244#endif
245
221-- 246--
222Author: Daniel Drake <dsd@gentoo.org> 247Authors: Daniel Drake <dsd@gentoo.org>,
248 Johannes Berg <johannes@sipsolutions.net>
223With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt, 249With help from: Alan Cox, Avuton Olrich, Heikki Orsila, Jan Engelhardt,
224Johannes Berg, Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, 250Kyle McMartin, Kyle Moffett, Randy Dunlap, Robert Hancock, Uli Kunitz,
225Uli Kunitz, Vadim Lobanov 251Vadim Lobanov
226 252
diff --git a/Documentation/usb/anchors.txt b/Documentation/usb/anchors.txt
index 7304bcf5a306..5e6b64c20d25 100644
--- a/Documentation/usb/anchors.txt
+++ b/Documentation/usb/anchors.txt
@@ -42,9 +42,21 @@ This function kills all URBs associated with an anchor. The URBs
42are called in the reverse temporal order they were submitted. 42are called in the reverse temporal order they were submitted.
43This way no data can be reordered. 43This way no data can be reordered.
44 44
45usb_unlink_anchored_urbs()
46--------------------------
47
48This function unlinks all URBs associated with an anchor. The URBs
49are processed in the reverse temporal order they were submitted.
50This is similar to usb_kill_anchored_urbs(), but it will not sleep.
51Therefore no guarantee is made that the URBs have been unlinked when
52the call returns. They may be unlinked later but will be unlinked in
53finite time.
54
45usb_wait_anchor_empty_timeout() 55usb_wait_anchor_empty_timeout()
46------------------------------- 56-------------------------------
47 57
48This function waits for all URBs associated with an anchor to finish 58This function waits for all URBs associated with an anchor to finish
49or a timeout, whichever comes first. Its return value will tell you 59or a timeout, whichever comes first. Its return value will tell you
50whether the timeout was reached. 60whether the timeout was reached.
61
62
diff --git a/Documentation/usb/auerswald.txt b/Documentation/usb/auerswald.txt
deleted file mode 100644
index 7ee4d8f69116..000000000000
--- a/Documentation/usb/auerswald.txt
+++ /dev/null
@@ -1,30 +0,0 @@
1 Auerswald USB kernel driver
2 ===========================
3
4What is it? What can I do with it?
5==================================
6The auerswald USB kernel driver connects your linux 2.4.x
7system to the auerswald usb-enabled devices.
8
9There are two types of auerswald usb devices:
10a) small PBX systems (ISDN)
11b) COMfort system telephones (ISDN)
12
13The driver installation creates the devices
14/dev/usb/auer0..15. These devices carry a vendor-
15specific protocol. You may run all auerswald java
16software on it. The java software needs a native
17library "libAuerUsbJNINative.so" installed on
18your system. This library is available from
19auerswald and shipped as part of the java software.
20
21You may create the devices with:
22 mknod -m 666 /dev/usb/auer0 c 180 112
23 ...
24 mknod -m 666 /dev/usb/auer15 c 180 127
25
26Future plans
27============
28- Connection to ISDN4LINUX (the hisax interface)
29
30The maintainer of this driver is wolfgang@iksw-muees.de
diff --git a/Documentation/usb/authorization.txt b/Documentation/usb/authorization.txt
index 2af400609498..381b22ee7834 100644
--- a/Documentation/usb/authorization.txt
+++ b/Documentation/usb/authorization.txt
@@ -8,7 +8,7 @@ not) in a system. This feature will allow you to implement a lock-down
8of USB devices, fully controlled by user space. 8of USB devices, fully controlled by user space.
9 9
10As of now, when a USB device is connected it is configured and 10As of now, when a USB device is connected it is configured and
11it's interfaces inmediately made available to the users. With this 11its interfaces are immediately made available to the users. With this
12modification, only if root authorizes the device to be configured will 12modification, only if root authorizes the device to be configured will
13then it be possible to use it. 13then it be possible to use it.
14 14
diff --git a/Documentation/usb/gadget_serial.txt b/Documentation/usb/gadget_serial.txt
index 815f5c2301ff..9b22bd14c348 100644
--- a/Documentation/usb/gadget_serial.txt
+++ b/Documentation/usb/gadget_serial.txt
@@ -1,6 +1,7 @@
1 1
2 Linux Gadget Serial Driver v2.0 2 Linux Gadget Serial Driver v2.0
3 11/20/2004 3 11/20/2004
4 (updated 8-May-2008 for v2.3)
4 5
5 6
6License and Disclaimer 7License and Disclaimer
@@ -31,7 +32,7 @@ Prerequisites
31------------- 32-------------
32Versions of the gadget serial driver are available for the 33Versions of the gadget serial driver are available for the
332.4 Linux kernels, but this document assumes you are using 342.4 Linux kernels, but this document assumes you are using
34version 2.0 or later of the gadget serial driver in a 2.6 35version 2.3 or later of the gadget serial driver in a 2.6
35Linux kernel. 36Linux kernel.
36 37
37This document assumes that you are familiar with Linux and 38This document assumes that you are familiar with Linux and
@@ -40,6 +41,12 @@ standard utilities, use minicom and HyperTerminal, and work with
40USB and serial devices. It also assumes you configure the Linux 41USB and serial devices. It also assumes you configure the Linux
41gadget and usb drivers as modules. 42gadget and usb drivers as modules.
42 43
44With version 2.3 of the driver, major and minor device nodes are
45no longer statically defined. Your Linux based system should mount
46sysfs in /sys, and use "mdev" (in Busybox) or "udev" to make the
47/dev nodes matching the sysfs /sys/class/tty files.
48
49
43 50
44Overview 51Overview
45-------- 52--------
@@ -104,15 +111,8 @@ driver. All this are listed under "USB Gadget Support" when
104configuring the kernel. Then rebuild and install the kernel or 111configuring the kernel. Then rebuild and install the kernel or
105modules. 112modules.
106 113
107The gadget serial driver uses major number 127, for now. So you
108will need to create a device node for it, like this:
109
110 mknod /dev/ttygserial c 127 0
111
112You only need to do this once.
113
114Then you must load the gadget serial driver. To load it as an 114Then you must load the gadget serial driver. To load it as an
115ACM device, do this: 115ACM device (recommended for interoperability), do this:
116 116
117 modprobe g_serial use_acm=1 117 modprobe g_serial use_acm=1
118 118
@@ -125,6 +125,23 @@ controller driver. This must be done each time you reboot the gadget
125side Linux system. You can add this to the start up scripts, if 125side Linux system. You can add this to the start up scripts, if
126desired. 126desired.
127 127
128Your system should use mdev (from busybox) or udev to make the
129device nodes. After this gadget driver has been set up you should
130then see a /dev/ttyGS0 node:
131
132 # ls -l /dev/ttyGS0 | cat
133 crw-rw---- 1 root root 253, 0 May 8 14:10 /dev/ttyGS0
134 #
135
136Note that the major number (253, above) is system-specific. If
137you need to create /dev nodes by hand, the right numbers to use
138will be in the /sys/class/tty/ttyGS0/dev file.
139
140When you link this gadget driver early, perhaps even statically,
141you may want to set up an /etc/inittab entry to run "getty" on it.
142The /dev/ttyGS0 line should work like most any other serial port.
143
144
128If gadget serial is loaded as an ACM device you will want to use 145If gadget serial is loaded as an ACM device you will want to use
129either the Windows or Linux ACM driver on the host side. If gadget 146either the Windows or Linux ACM driver on the host side. If gadget
130serial is loaded as a bulk in/out device, you will want to use the 147serial is loaded as a bulk in/out device, you will want to use the
diff --git a/Documentation/usb/persist.txt b/Documentation/usb/persist.txt
index d56cb1a11550..074b159b77c2 100644
--- a/Documentation/usb/persist.txt
+++ b/Documentation/usb/persist.txt
@@ -81,8 +81,11 @@ re-enumeration shows that the device now attached to that port has the
81same descriptors as before, including the Vendor and Product IDs, then 81same descriptors as before, including the Vendor and Product IDs, then
82the kernel continues to use the same device structure. In effect, the 82the kernel continues to use the same device structure. In effect, the
83kernel treats the device as though it had merely been reset instead of 83kernel treats the device as though it had merely been reset instead of
84unplugged. The same thing happens if the host controller is in the 84unplugged.
85expected state but a USB device was unplugged and then replugged. 85
86The same thing happens if the host controller is in the expected state
87but a USB device was unplugged and then replugged, or if a USB device
88fails to carry out a normal resume.
86 89
87If no device is now attached to the port, or if the descriptors are 90If no device is now attached to the port, or if the descriptors are
88different from what the kernel remembers, then the treatment is what 91different from what the kernel remembers, then the treatment is what
diff --git a/Documentation/usb/power-management.txt b/Documentation/usb/power-management.txt
index b2fc4d4a9917..9d31140e3f5b 100644
--- a/Documentation/usb/power-management.txt
+++ b/Documentation/usb/power-management.txt
@@ -436,7 +436,12 @@ post_reset; the USB core guarantees that this is true of internal
436suspend/resume events as well. 436suspend/resume events as well.
437 437
438If a driver wants to block all suspend/resume calls during some 438If a driver wants to block all suspend/resume calls during some
439critical section, it can simply acquire udev->pm_mutex. 439critical section, it can simply acquire udev->pm_mutex. Note that
440calls to resume may be triggered indirectly. Block IO due to memory
441allocations can make the vm subsystem resume a device. Thus while
442holding this lock you must not allocate memory with GFP_KERNEL or
443GFP_NOFS.
444
440Alternatively, if the critical section might call some of the 445Alternatively, if the critical section might call some of the
441usb_autopm_* routines, the driver can avoid deadlock by doing: 446usb_autopm_* routines, the driver can avoid deadlock by doing:
442 447
diff --git a/Documentation/usb/uhci.txt b/Documentation/usb/uhci.txt
deleted file mode 100644
index 2f25952c86c6..000000000000
--- a/Documentation/usb/uhci.txt
+++ /dev/null
@@ -1,165 +0,0 @@
1Specification and Internals for the New UHCI Driver (Whitepaper...)
2
3 brought to you by
4
5 Georg Acher, acher@in.tum.de (executive slave) (base guitar)
6 Deti Fliegl, deti@fliegl.de (executive slave) (lead voice)
7 Thomas Sailer, sailer@ife.ee.ethz.ch (chief consultant) (cheer leader)
8
9 $Id: README.uhci,v 1.1 1999/12/14 14:03:02 fliegl Exp $
10
11This document and the new uhci sources can be found on
12 http://hotswap.in.tum.de/usb
13
141. General issues
15
161.1 Why a new UHCI driver, we already have one?!?
17
18Correct, but its internal structure got more and more mixed up by the (still
19ongoing) efforts to get isochronous transfers (ISO) to work.
20Since there is an increasing need for reliable ISO-transfers (especially
21for USB-audio needed by TS and for a DAB-USB-Receiver build by GA and DF),
22this state was a bit unsatisfying in our opinion, so we've decided (based
23on knowledge and experiences with the old UHCI driver) to start
24from scratch with a new approach, much simpler but at the same time more
25powerful.
26It is inspired by the way Win98/Win2000 handles USB requests via URBs,
27but it's definitely 100% free of MS-code and doesn't crash while
28unplugging an used ISO-device like Win98 ;-)
29Some code for HW setup and root hub management was taken from the
30original UHCI driver, but heavily modified to fit into the new code.
31The invention of the basic concept, and major coding were completed in two
32days (and nights) on the 16th and 17th of October 1999, now known as the
33great USB-October-Revolution started by GA, DF, and TS ;-)
34
35Since the concept is in no way UHCI dependent, we hope that it will also be
36transferred to the OHCI-driver, so both drivers share a common API.
37
381.2. Advantages and disadvantages
39
40+ All USB transfer types work now!
41+ Asynchronous operation
42+ Simple, but powerful interface (only two calls for start and cancel)
43+ Easy migration to the new API, simplified by a compatibility API
44+ Simple usage of ISO transfers
45+ Automatic linking of requests
46+ ISO transfers allow variable length for each frame and striping
47+ No CPU dependent and non-portable atomic memory access, no asm()-inlines
48+ Tested on x86 and Alpha
49
50- Rewriting for ISO transfers needed
51
521.3. Is there some compatibility to the old API?
53
54Yes, but only for control, bulk and interrupt transfers. We've implemented
55some wrapper calls for these transfer types. The usbcore works fine with
56these wrappers. For ISO there's no compatibility, because the old ISO-API
57and its semantics were unnecessary complicated in our opinion.
58
591.4. What's really working?
60
61As said above, CTRL and BULK already work fine even with the wrappers,
62so legacy code wouldn't notice the change.
63Regarding to Thomas, ISO transfers now run stable with USB audio.
64INT transfers (e.g. mouse driver) work fine, too.
65
661.5. Are there any bugs?
67
68No ;-)
69Hm...
70Well, of course this implementation needs extensive testing on all available
71hardware, but we believe that any fixes shouldn't harm the overall concept.
72
731.6. What should be done next?
74
75A large part of the request handling seems to be identical for UHCI and
76OHCI, so it would be a good idea to extract the common parts and have only
77the HW specific stuff in uhci.c. Furthermore, all other USB device drivers
78should need URBification, if they use isochronous or interrupt transfers.
79One thing missing in the current implementation (and the old UHCI driver)
80is fair queueing for BULK transfers. Since this would need (in principle)
81the alteration of already constructed TD chains (to switch from depth to
82breadth execution), another way has to be found. Maybe some simple
83heuristics work with the same effect.
84
85---------------------------------------------------------------------------
86
872. Internal structure and mechanisms
88
89To get quickly familiar with the internal structures, here's a short
90description how the new UHCI driver works. However, the ultimate source of
91truth is only uhci.c!
92
932.1. Descriptor structure (QHs and TDs)
94
95During initialization, the following skeleton is allocated in init_skel:
96
97 framespecific | common chain
98
99framelist[]
100[ 0 ]-----> TD --> TD -------\
101[ 1 ]-----> TD --> TD --------> TD ----> QH -------> QH -------> QH ---> NULL
102 ... TD --> TD -------/
103[1023]-----> TD --> TD ------/
104
105 ^^ ^^ ^^ ^^ ^^ ^^
106 1024 TDs for 7 TDs for 1 TD for Start of Start of End Chain
107 ISO INT (2-128ms) 1ms-INT CTRL Chain BULK Chain
108
109For each CTRL or BULK transfer a new QH is allocated and the containing data
110transfers are appended as (vertical) TDs. After building the whole QH with its
111dangling TDs, the QH is inserted before the BULK Chain QH (for CTRL) or
112before the End Chain QH (for BULK). Since only the QH->next pointers are
113affected, no atomic memory operation is required. The three QHs in the
114common chain are never equipped with TDs!
115
116For ISO or INT, the TD for each frame is simply inserted into the appropriate
117ISO/INT-TD-chain for the desired frame. The 7 skeleton INT-TDs are scattered
118among the 1024 frames similar to the old UHCI driver.
119
120For CTRL/BULK/ISO, the last TD in the transfer has the IOC-bit set. For INT,
121every TD (there is only one...) has the IOC-bit set.
122
123Besides the data for the UHCI controller (2 or 4 32bit words), the descriptors
124are double-linked through the .vertical and .horizontal elements in the
125SW data of the descriptor (using the double-linked list structures and
126operations), but SW-linking occurs only in closed domains, i.e. for each of
127the 1024 ISO-chains and the 8 INT-chains there is a closed cycle. This
128simplifies all insertions and unlinking operations and avoids costly
129bus_to_virt()-calls.
130
1312.2. URB structure and linking to QH/TDs
132
133During assembly of the QH and TDs of the requested action, these descriptors
134are stored in urb->urb_list, so the allocated QH/TD descriptors are bound to
135this URB.
136If the assembly was successful and the descriptors were added to the HW chain,
137the corresponding URB is inserted into a global URB list for this controller.
138This list stores all pending URBs.
139
1402.3. Interrupt processing
141
142Since UHCI provides no means to directly detect completed transactions, the
143following is done in each UHCI interrupt (uhci_interrupt()):
144
145For each URB in the pending queue (process_urb()), the ACTIVE-flag of the
146associated TDs are processed (depending on the transfer type
147process_{transfer|interrupt|iso}()). If the TDs are not active anymore,
148they indicate the completion of the transaction and the status is calculated.
149Inactive QH/TDs are removed from the HW chain (since the host controller
150already removed the TDs from the QH, no atomic access is needed) and
151eventually the URB is marked as completed (OK or errors) and removed from the
152pending queue. Then the next linked URB is submitted. After (or immediately
153before) that, the completion handler is called.
154
1552.4. Unlinking URBs
156
157First, all QH/TDs stored in the URB are unlinked from the HW chain.
158To ensure that the host controller really left a vertical TD chain, we
159wait for one frame. After that, the TDs are physically destroyed.
160
1612.5. URB linking and the consequences
162
163Since URBs can be linked and the corresponding submit_urb is called in
164the UHCI-interrupt, all work associated with URB/QH/TD assembly has to be
165interrupt save. This forces kmalloc to use GFP_ATOMIC in the interrupt.
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828
index aaae360312e4..aa05e5bb22fb 100644
--- a/Documentation/video4linux/CARDLIST.au0828
+++ b/Documentation/video4linux/CARDLIST.au0828
@@ -1,4 +1,6 @@
1 0 -> Unknown board (au0828) 1 0 -> Unknown board (au0828)
2 1 -> Hauppauge HVR950Q (au0828) [2040:7200] 2 1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008]
3 2 -> Hauppauge HVR850 (au0828) [2040:7240] 3 2 -> Hauppauge HVR850 (au0828) [2040:7240]
4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] 4 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
5 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281]
6 5 -> Hauppauge Woodbury (au0828) [2040:8200]
diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885
index 191194ea1e25..f0e613ba55b8 100644
--- a/Documentation/video4linux/CARDLIST.cx23885
+++ b/Documentation/video4linux/CARDLIST.cx23885
@@ -8,3 +8,4 @@
8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3] 8 7 -> Hauppauge WinTV-HVR1200 [0070:71d1,0070:71d3]
9 8 -> Hauppauge WinTV-HVR1700 [0070:8101] 9 8 -> Hauppauge WinTV-HVR1700 [0070:8101]
10 9 -> Hauppauge WinTV-HVR1400 [0070:8010] 10 9 -> Hauppauge WinTV-HVR1400 [0070:8010]
11 10 -> DViCO FusionHDTV7 Dual Express [18ac:d618]
diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
index 1d6a245c828f..53449cb99b17 100644
--- a/Documentation/video4linux/CARDLIST.em28xx
+++ b/Documentation/video4linux/CARDLIST.em28xx
@@ -1,17 +1,59 @@
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:2750,eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883] 2 1 -> Unknown EM2750/28xx video grabber (em2820/em2840) [eb1a:2820,eb1a:2821,eb1a:2860,eb1a:2861,eb1a:2870,eb1a:2881,eb1a:2883]
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]
6 5 -> MSI VOX USB 2.0 (em2820/em2840) 6 5 -> MSI VOX USB 2.0 (em2820/em2840)
7 6 -> Terratec Cinergy 200 USB (em2800) 7 6 -> Terratec Cinergy 200 USB (em2800)
8 7 -> Leadtek Winfast USB II (em2800) 8 7 -> Leadtek Winfast USB II (em2800) [0413:6023]
9 8 -> Kworld USB2800 (em2800) 9 8 -> Kworld USB2800 (em2800)
10 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a] 10 9 -> Pinnacle Dazzle DVC 90/DVC 100 (em2820/em2840) [2304:0207,2304:021a]
11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500,2040:6502] 11 10 -> Hauppauge WinTV HVR 900 (em2880) [2040:6500]
12 11 -> Terratec Hybrid XS (em2880) [0ccd:0042] 12 11 -> Terratec Hybrid XS (em2880) [0ccd:0042]
13 12 -> Kworld PVR TV 2800 RF (em2820/em2840) 13 12 -> Kworld PVR TV 2800 RF (em2820/em2840)
14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047] 14 13 -> Terratec Prodigy XS (em2880) [0ccd:0047]
15 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840) 15 14 -> Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
16 15 -> V-Gear PocketTV (em2800) 16 15 -> V-Gear PocketTV (em2800)
17 16 -> Hauppauge WinTV HVR 950 (em2880) [2040:6513,2040:6517,2040:651b,2040:651f] 17 16 -> Hauppauge WinTV HVR 950 (em2883) [2040:6513,2040:6517,2040:651b,2040:651f]
18 17 -> Pinnacle PCTV HD Pro Stick (em2880) [2304:0227]
19 18 -> Hauppauge WinTV HVR 900 (R2) (em2880) [2040:6502]
20 19 -> PointNix Intra-Oral Camera (em2860)
21 20 -> AMD ATI TV Wonder HD 600 (em2880) [0438:b002]
22 21 -> eMPIA Technology, Inc. GrabBeeX+ Video Encoder (em2800) [eb1a:2801]
23 22 -> Unknown EM2750/EM2751 webcam grabber (em2750) [eb1a:2750,eb1a:2751]
24 23 -> Huaqi DLCW-130 (em2750)
25 24 -> D-Link DUB-T210 TV Tuner (em2820/em2840) [2001:f112]
26 25 -> Gadmei UTV310 (em2820/em2840)
27 26 -> Hercules Smart TV USB 2.0 (em2820/em2840)
28 27 -> Pinnacle PCTV USB 2 (Philips FM1216ME) (em2820/em2840)
29 28 -> Leadtek Winfast USB II Deluxe (em2820/em2840)
30 29 -> Pinnacle Dazzle DVC 100 (em2820/em2840)
31 30 -> Videology 20K14XUSB USB2.0 (em2820/em2840)
32 31 -> Usbgear VD204v9 (em2821)
33 32 -> Supercomp USB 2.0 TV (em2821)
34 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0 (em2821)
35 34 -> Terratec Cinergy A Hybrid XS (em2860) [0ccd:004f]
36 35 -> Typhoon DVD Maker (em2860)
37 36 -> NetGMBH Cam (em2860)
38 37 -> Gadmei UTV330 (em2860)
39 38 -> Yakumo MovieMixer (em2861)
40 39 -> KWorld PVRTV 300U (em2861) [eb1a:e300]
41 40 -> Plextor ConvertX PX-TV100U (em2861) [093b:a005]
42 41 -> Kworld 350 U DVB-T (em2870) [eb1a:e350]
43 42 -> Kworld 355 U DVB-T (em2870) [eb1a:e355,eb1a:e357]
44 43 -> Terratec Cinergy T XS (em2870) [0ccd:0043]
45 44 -> Terratec Cinergy T XS (MT2060) (em2870)
46 45 -> Pinnacle PCTV DVB-T (em2870)
47 46 -> Compro, VideoMate U3 (em2870) [185b:2870]
48 47 -> KWorld DVB-T 305U (em2880) [eb1a:e305]
49 48 -> KWorld DVB-T 310U (em2880) [eb1a:e310]
50 49 -> MSI DigiVox A/D (em2880) [eb1a:e310]
51 50 -> MSI DigiVox A/D II (em2880) [eb1a:e320]
52 51 -> Terratec Hybrid XS Secam (em2880) [0ccd:004c]
53 52 -> DNT DA2 Hybrid (em2881)
54 53 -> Pinnacle Hybrid Pro (em2881)
55 54 -> Kworld VS-DVB-T 323UR (em2882) [eb1a:e323]
56 55 -> Terratec Hybrid XS (em2882) (em2882) [0ccd:005e]
57 56 -> Pinnacle Hybrid Pro (2) (em2882) [2304:0226]
58 57 -> Kworld PlusTV HD Hybrid 330 (em2883) [eb1a:a316]
59 58 -> Compro VideoMate ForYou/Stereo (em2820/em2840) [185b:2041]
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index 67937df1e974..39868af9cf9f 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -37,7 +37,7 @@
37 36 -> UPMOST PURPLE TV [12ab:0800] 37 36 -> UPMOST PURPLE TV [12ab:0800]
38 37 -> Items MuchTV Plus / IT-005 38 37 -> Items MuchTV Plus / IT-005
39 38 -> Terratec Cinergy 200 TV [153b:1152] 39 38 -> Terratec Cinergy 200 TV [153b:1152]
40 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212] 40 39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212,5169:1502]
41 40 -> Compro VideoMate TV PVR/FM [185b:c100] 41 40 -> Compro VideoMate TV PVR/FM [185b:c100]
42 41 -> Compro VideoMate TV Gold+ [185b:c100] 42 41 -> Compro VideoMate TV Gold+ [185b:c100]
43 42 -> Sabrent SBT-TVFM (saa7130) 43 42 -> Sabrent SBT-TVFM (saa7130)
@@ -128,7 +128,7 @@
128127 -> Beholder BeholdTV 507 FM/RDS / BeholdTV 509 FM [0000:5071,0000:507B,5ace:5070,5ace:5090] 128127 -> Beholder BeholdTV 507 FM/RDS / BeholdTV 509 FM [0000:5071,0000:507B,5ace:5070,5ace:5090]
129128 -> Beholder BeholdTV Columbus TVFM [0000:5201] 129128 -> Beholder BeholdTV Columbus TVFM [0000:5201]
130129 -> Beholder BeholdTV 607 / BeholdTV 609 [5ace:6070,5ace:6071,5ace:6072,5ace:6073,5ace:6090,5ace:6091,5ace:6092,5ace:6093] 130129 -> Beholder BeholdTV 607 / BeholdTV 609 [5ace:6070,5ace:6071,5ace:6072,5ace:6073,5ace:6090,5ace:6091,5ace:6092,5ace:6093]
131130 -> Beholder BeholdTV M6 / BeholdTV M6 Extra [5ace:6190,5ace:6193,5ace:6191] 131130 -> Beholder BeholdTV M6 [5ace:6190]
132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022] 132131 -> Twinhan Hybrid DTV-DVB 3056 PCI [1822:0022]
133132 -> Genius TVGO AM11MCE 133132 -> Genius TVGO AM11MCE
134133 -> NXP Snake DVB-S reference design 134133 -> NXP Snake DVB-S reference design
@@ -141,3 +141,7 @@
141140 -> Avermedia DVB-S Pro A700 [1461:a7a1] 141140 -> Avermedia DVB-S Pro A700 [1461:a7a1]
142141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2] 142141 -> Avermedia DVB-S Hybrid+FM A700 [1461:a7a2]
143142 -> Beholder BeholdTV H6 [5ace:6290] 143142 -> Beholder BeholdTV H6 [5ace:6290]
144143 -> Beholder BeholdTV M63 [5ace:6191]
145144 -> Beholder BeholdTV M6 Extra [5ace:6193]
146145 -> AVerMedia MiniPCI DVB-T Hybrid M103 [1461:f636]
147146 -> ASUSTeK P7131 Analog
diff --git a/Documentation/video4linux/Makefile b/Documentation/video4linux/Makefile
new file mode 100644
index 000000000000..1ed0e98d057d
--- /dev/null
+++ b/Documentation/video4linux/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 := v4lgrab
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/video4linux/cx18.txt b/Documentation/video4linux/cx18.txt
index 6842c262890f..914cb7e734a2 100644
--- a/Documentation/video4linux/cx18.txt
+++ b/Documentation/video4linux/cx18.txt
@@ -1,36 +1,30 @@
1Some notes regarding the cx18 driver for the Conexant CX23418 MPEG 1Some notes regarding the cx18 driver for the Conexant CX23418 MPEG
2encoder chip: 2encoder chip:
3 3
41) The only hardware currently supported is the Hauppauge HVR-1600 41) Currently supported are:
5 card and the Compro VideoMate H900 (note that this card only
6 supports analog input, it has no digital tuner!).
7 5
82) Some people have problems getting the i2c bus to work. Cause unknown. 6 - Hauppauge HVR-1600
9 The symptom is that the eeprom cannot be read and the card is 7 - Compro VideoMate H900
10 unusable. 8 - Yuan MPC718
9 - Conexant Raptor PAL/SECAM devkit
11 10
123) The audio from the analog tuner is mono only. Probably caused by 112) Some people have problems getting the i2c bus to work.
13 incorrect audio register information in the datasheet. We are 12 The symptom is that the eeprom cannot be read and the card is
14 waiting for updated information from Conexant. 13 unusable. This is probably fixed, but if you have problems
14 then post to the video4linux or ivtv-users mailinglist.
15 15
164) VBI (raw or sliced) has not yet been implemented. 163) VBI (raw or sliced) has not yet been implemented.
17 17
185) MPEG indexing is not yet implemented. 184) MPEG indexing is not yet implemented.
19 19
206) The driver is still a bit rough around the edges, this should 205) The driver is still a bit rough around the edges, this should
21 improve over time. 21 improve over time.
22 22
23 23
24Firmware: 24Firmware:
25 25
26The firmware needs to be extracted from the Windows Hauppauge HVR-1600 26You can obtain the firmware files here:
27driver, available here:
28
29http://hauppauge.lightpath.net/software/install_cd/hauppauge_cd_3.4d1.zip
30 27
31Unzip, then copy the following files to the firmware directory 28http://dl.ivtvdriver.org/ivtv/firmware/cx18-firmware.tar.gz
32and rename them as follows:
33 29
34Drivers/Driver18/hcw18apu.rom -> v4l-cx23418-apu.fw 30Untar and copy the .fw files to your firmware directory.
35Drivers/Driver18/hcw18enc.rom -> v4l-cx23418-cpu.fw
36Drivers/Driver18/hcw18mlC.rom -> v4l-cx23418-dig.fw
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt
new file mode 100644
index 000000000000..9a3e4d797fa8
--- /dev/null
+++ b/Documentation/video4linux/gspca.txt
@@ -0,0 +1,248 @@
1List of the webcams known by gspca.
2
3The modules are:
4 gspca_main main driver
5 gspca_xxxx subdriver module with xxxx as follows
6
7xxxx vend:prod
8----
9spca501 0000:0000 MystFromOri Unknow Camera
10spca501 040a:0002 Kodak DVC-325
11spca500 040a:0300 Kodak EZ200
12zc3xx 041e:041e Creative WebCam Live!
13spca500 041e:400a Creative PC-CAM 300
14sunplus 041e:400b Creative PC-CAM 600
15sunplus 041e:4012 PC-Cam350
16sunplus 041e:4013 Creative Pccam750
17zc3xx 041e:4017 Creative Webcam Mobile PD1090
18spca508 041e:4018 Creative Webcam Vista (PD1100)
19spca561 041e:401a Creative Webcam Vista (PD1100)
20zc3xx 041e:401c Creative NX
21spca505 041e:401d Creative Webcam NX ULTRA
22zc3xx 041e:401e Creative Nx Pro
23zc3xx 041e:401f Creative Webcam Notebook PD1171
24pac207 041e:4028 Creative Webcam Vista Plus
25zc3xx 041e:4029 Creative WebCam Vista Pro
26zc3xx 041e:4034 Creative Instant P0620
27zc3xx 041e:4035 Creative Instant P0620D
28zc3xx 041e:4036 Creative Live !
29zc3xx 041e:403a Creative Nx Pro 2
30spca561 041e:403b Creative Webcam Vista (VF0010)
31zc3xx 041e:4051 Creative Live!Cam Notebook Pro (VF0250)
32ov519 041e:4052 Creative Live! VISTA IM
33zc3xx 041e:4053 Creative Live!Cam Video IM
34ov519 041e:405f Creative Live! VISTA VF0330
35ov519 041e:4060 Creative Live! VISTA VF0350
36ov519 041e:4061 Creative Live! VISTA VF0400
37ov519 041e:4064 Creative Live! VISTA VF0420
38ov519 041e:4068 Creative Live! VISTA VF0470
39spca561 0458:7004 Genius VideoCAM Express V2
40sunplus 0458:7006 Genius Dsc 1.3 Smart
41zc3xx 0458:7007 Genius VideoCam V2
42zc3xx 0458:700c Genius VideoCam V3
43zc3xx 0458:700f Genius VideoCam Web V2
44sonixj 0458:7025 Genius Eye 311Q
45sonixj 045e:00f5 MicroSoft VX3000
46sonixj 045e:00f7 MicroSoft VX1000
47ov519 045e:028c Micro$oft xbox cam
48spca508 0461:0815 Micro Innovation IC200
49sunplus 0461:0821 Fujifilm MV-1
50zc3xx 0461:0a00 MicroInnovation WebCam320
51spca500 046d:0890 Logitech QuickCam traveler
52vc032x 046d:0892 Logitech Orbicam
53vc032x 046d:0896 Logitech Orbicam
54zc3xx 046d:08a0 Logitech QC IM
55zc3xx 046d:08a1 Logitech QC IM 0x08A1 +sound
56zc3xx 046d:08a2 Labtec Webcam Pro
57zc3xx 046d:08a3 Logitech QC Chat
58zc3xx 046d:08a6 Logitech QCim
59zc3xx 046d:08a7 Logitech QuickCam Image
60zc3xx 046d:08a9 Logitech Notebook Deluxe
61zc3xx 046d:08aa Labtec Webcam Notebook
62zc3xx 046d:08ac Logitech QuickCam Cool
63zc3xx 046d:08ad Logitech QCCommunicate STX
64zc3xx 046d:08ae Logitech QuickCam for Notebooks
65zc3xx 046d:08af Logitech QuickCam Cool
66zc3xx 046d:08b9 Logitech QC IM ???
67zc3xx 046d:08d7 Logitech QCam STX
68zc3xx 046d:08d9 Logitech QuickCam IM/Connect
69zc3xx 046d:08d8 Logitech Notebook Deluxe
70zc3xx 046d:08da Logitech QuickCam Messenger
71zc3xx 046d:08dd Logitech QuickCam for Notebooks
72spca500 046d:0900 Logitech Inc. ClickSmart 310
73spca500 046d:0901 Logitech Inc. ClickSmart 510
74sunplus 046d:0905 Logitech ClickSmart 820
75tv8532 046d:0920 QC Express
76tv8532 046d:0921 Labtec Webcam
77spca561 046d:0928 Logitech QC Express Etch2
78spca561 046d:0929 Labtec Webcam Elch2
79spca561 046d:092a Logitech QC for Notebook
80spca561 046d:092b Labtec Webcam Plus
81spca561 046d:092c Logitech QC chat Elch2
82spca561 046d:092d Logitech QC Elch2
83spca561 046d:092e Logitech QC Elch2
84spca561 046d:092f Logitech QC Elch2
85sunplus 046d:0960 Logitech ClickSmart 420
86sunplus 0471:0322 Philips DMVC1300K
87zc3xx 0471:0325 Philips SPC 200 NC
88zc3xx 0471:0326 Philips SPC 300 NC
89sonixj 0471:0327 Philips SPC 600 NC
90sonixj 0471:0328 Philips SPC 700 NC
91zc3xx 0471:032d Philips SPC 210 NC
92zc3xx 0471:032e Philips SPC 315 NC
93sonixj 0471:0330 Philips SPC 710 NC
94spca501 0497:c001 Smile International
95sunplus 04a5:3003 Benq DC 1300
96sunplus 04a5:3008 Benq DC 1500
97sunplus 04a5:300a Benq DC 3410
98spca500 04a5:300c Benq DC 1016
99sunplus 04f1:1001 JVC GC A50
100spca561 04fc:0561 Flexcam 100
101sunplus 04fc:500c Sunplus CA500C
102sunplus 04fc:504a Aiptek Mini PenCam 1.3
103sunplus 04fc:504b Maxell MaxPocket LE 1.3
104sunplus 04fc:5330 Digitrex 2110
105sunplus 04fc:5360 Sunplus Generic
106spca500 04fc:7333 PalmPixDC85
107sunplus 04fc:ffff Pure DigitalDakota
108spca501 0506:00df 3Com HomeConnect Lite
109sunplus 052b:1513 Megapix V4
110tv8532 0545:808b Veo Stingray
111tv8532 0545:8333 Veo Stingray
112sunplus 0546:3155 Polaroid PDC3070
113sunplus 0546:3191 Polaroid Ion 80
114sunplus 0546:3273 Polaroid PDC2030
115ov519 054c:0154 Sonny toy4
116ov519 054c:0155 Sonny toy5
117zc3xx 055f:c005 Mustek Wcam300A
118spca500 055f:c200 Mustek Gsmart 300
119sunplus 055f:c211 Kowa Bs888e Microcamera
120spca500 055f:c220 Gsmart Mini
121sunplus 055f:c230 Mustek Digicam 330K
122sunplus 055f:c232 Mustek MDC3500
123sunplus 055f:c360 Mustek DV4000 Mpeg4
124sunplus 055f:c420 Mustek gSmart Mini 2
125sunplus 055f:c430 Mustek Gsmart LCD 2
126sunplus 055f:c440 Mustek DV 3000
127sunplus 055f:c520 Mustek gSmart Mini 3
128sunplus 055f:c530 Mustek Gsmart LCD 3
129sunplus 055f:c540 Gsmart D30
130sunplus 055f:c630 Mustek MDC4000
131sunplus 055f:c650 Mustek MDC5500Z
132zc3xx 055f:d003 Mustek WCam300A
133zc3xx 055f:d004 Mustek WCam300 AN
134conex 0572:0041 Creative Notebook cx11646
135ov519 05a9:0519 OmniVision
136ov519 05a9:0530 OmniVision
137ov519 05a9:4519 OmniVision
138ov519 05a9:8519 OmniVision
139sunplus 05da:1018 Digital Dream Enigma 1.3
140stk014 05e1:0893 Syntek DV4000
141spca561 060b:a001 Maxell Compact Pc PM3
142zc3xx 0698:2003 CTX M730V built in
143spca500 06bd:0404 Agfa CL20
144spca500 06be:0800 Optimedia
145sunplus 06d6:0031 Trust 610 LCD PowerC@m Zoom
146spca506 06e1:a190 ADS Instant VCD
147spca508 0733:0110 ViewQuest VQ110
148spca508 0130:0130 Clone Digital Webcam 11043
149spca501 0733:0401 Intel Create and Share
150spca501 0733:0402 ViewQuest M318B
151spca505 0733:0430 Intel PC Camera Pro
152sunplus 0733:1311 Digital Dream Epsilon 1.3
153sunplus 0733:1314 Mercury 2.1MEG Deluxe Classic Cam
154sunplus 0733:2211 Jenoptik jdc 21 LCD
155sunplus 0733:2221 Mercury Digital Pro 3.1p
156sunplus 0733:3261 Concord 3045 spca536a
157sunplus 0733:3281 Cyberpix S550V
158spca506 0734:043b 3DeMon USB Capture aka
159spca500 084d:0003 D-Link DSC-350
160spca500 08ca:0103 Aiptek PocketDV
161sunplus 08ca:0104 Aiptek PocketDVII 1.3
162sunplus 08ca:0106 Aiptek Pocket DV3100+
163sunplus 08ca:2008 Aiptek Mini PenCam 2 M
164sunplus 08ca:2010 Aiptek PocketCam 3M
165sunplus 08ca:2016 Aiptek PocketCam 2 Mega
166sunplus 08ca:2018 Aiptek Pencam SD 2M
167sunplus 08ca:2020 Aiptek Slim 3000F
168sunplus 08ca:2022 Aiptek Slim 3200
169sunplus 08ca:2024 Aiptek DV3500 Mpeg4
170sunplus 08ca:2028 Aiptek PocketCam4M
171sunplus 08ca:2040 Aiptek PocketDV4100M
172sunplus 08ca:2042 Aiptek PocketDV5100
173sunplus 08ca:2050 Medion MD 41437
174sunplus 08ca:2060 Aiptek PocketDV5300
175tv8532 0923:010f ICM532 cams
176mars 093a:050f Mars-Semi Pc-Camera
177pac207 093a:2460 PAC207 Qtec Webcam 100
178pac207 093a:2463 Philips SPC 220 NC
179pac207 093a:2464 Labtec Webcam 1200
180pac207 093a:2468 PAC207
181pac207 093a:2470 Genius GF112
182pac207 093a:2471 Genius VideoCam ge111
183pac207 093a:2472 Genius VideoCam ge110
184pac7311 093a:2600 PAC7311 Typhoon
185pac7311 093a:2601 Philips SPC 610 NC
186pac7311 093a:2603 PAC7312
187pac7311 093a:2608 Trust WB-3300p
188pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
189pac7311 093a:260f SnakeCam
190pac7311 093a:2621 PAC731x
191pac7311 093a:2624 PAC7302
192pac7311 093a:2626 Labtec 2200
193pac7311 093a:262a Webcam 300k
194zc3xx 0ac8:0302 Z-star Vimicro zc0302
195vc032x 0ac8:0321 Vimicro generic vc0321
196vc032x 0ac8:0323 Vimicro Vc0323
197vc032x 0ac8:0328 A4Tech PK-130MG
198zc3xx 0ac8:301b Z-Star zc301b
199zc3xx 0ac8:303b Vimicro 0x303b
200zc3xx 0ac8:305b Z-star Vimicro zc0305b
201zc3xx 0ac8:307b Ldlc VC302+Ov7620
202vc032x 0ac8:c001 Sony embedded vimicro
203vc032x 0ac8:c002 Sony embedded vimicro
204spca508 0af9:0010 Hama USB Sightcam 100
205spca508 0af9:0011 Hama USB Sightcam 100
206sonixb 0c45:6001 Genius VideoCAM NB
207sonixb 0c45:6005 Microdia Sweex Mini Webcam
208sonixb 0c45:6007 Sonix sn9c101 + Tas5110D
209sonixb 0c45:6009 spcaCam@120
210sonixb 0c45:600d spcaCam@120
211sonixb 0c45:6011 Microdia PC Camera (SN9C102)
212sonixb 0c45:6019 Generic Sonix OV7630
213sonixb 0c45:6024 Generic Sonix Tas5130c
214sonixb 0c45:6025 Xcam Shanga
215sonixb 0c45:6028 Sonix Btc Pc380
216sonixb 0c45:6029 spcaCam@150
217sonixb 0c45:602c Generic Sonix OV7630
218sonixb 0c45:602d LIC-200 LG
219sonixb 0c45:602e Genius VideoCam Messenger
220sonixj 0c45:6040 Speed NVC 350K
221sonixj 0c45:607c Sonix sn9c102p Hv7131R
222sonixj 0c45:60c0 Sangha Sn535
223sonixj 0c45:60ec SN9C105+MO4000
224sonixj 0c45:60fb Surfer NoName
225sonixj 0c45:60fc LG-LIC300
226sonixj 0c45:6128 Microdia/Sonix SNP325
227sonixj 0c45:612a Avant Camera
228sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix
229sonixj 0c45:6130 Sonix Pccam
230sonixj 0c45:6138 Sn9c120 Mo4000
231sonixj 0c45:613b Surfer SN-206
232sonixj 0c45:613c Sonix Pccam168
233sonixj 0c45:6143 Sonix Pccam168
234sunplus 0d64:0303 Sunplus FashionCam DXG
235etoms 102c:6151 Qcam Sangha CIF
236etoms 102c:6251 Qcam xxxxxx VGA
237zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128
238spca561 10fd:7e50 FlyCam Usb 100
239zc3xx 10fd:8050 Typhoon Webshot II USB 300k
240spca501 1776:501c Arowana 300K CMOS Camera
241t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops
242vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC
243pac207 2001:f115 D-Link DSB-C120
244spca500 2899:012c Toptro Industrial
245spca508 8086:0110 Intel Easy PC Camera
246spca500 8086:0630 Intel Pocket PC Camera
247spca506 99fa:8988 Grandtec V.cap
248spca561 abcd:cdee Petcam
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt
index b26f5195af51..73de4050d637 100644
--- a/Documentation/video4linux/sn9c102.txt
+++ b/Documentation/video4linux/sn9c102.txt
@@ -157,7 +157,7 @@ Loading can be done as shown below:
157 157
158 [root@localhost home]# modprobe sn9c102 158 [root@localhost home]# modprobe sn9c102
159 159
160Note that the module is called "sn9c102" for historic reasons, althought it 160Note that the module is called "sn9c102" for historic reasons, although it
161does not just support the SN9C102. 161does not just support the SN9C102.
162 162
163At this point all the devices supported by the driver and connected to the USB 163At this point all the devices supported by the driver and connected to the USB
diff --git a/Documentation/video4linux/w9968cf.txt b/Documentation/video4linux/w9968cf.txt
index e0bba8393c77..05138e8aea07 100644
--- a/Documentation/video4linux/w9968cf.txt
+++ b/Documentation/video4linux/w9968cf.txt
@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
193 loads that module automatically. This action is performed as 193 loads that module automatically. This action is performed as
194 once soon as the 'w9968cf' module is loaded into memory. 194 once soon as the 'w9968cf' module is loaded into memory.
195Default: 1 195Default: 1
196Note: The kernel must be compiled with the CONFIG_KMOD option
197 enabled for the 'ovcamchip' module to be loaded and for
198 this parameter to be present.
199------------------------------------------------------------------------------- 196-------------------------------------------------------------------------------
200Name: simcams 197Name: simcams
201Type: int 198Type: int
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
new file mode 100644
index 000000000000..6f562f778b28
--- /dev/null
+++ b/Documentation/vm/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 := slabinfo
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 3102b81bef88..ea8714fcc3ad 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -77,7 +77,7 @@ memory that is preset in system at this time. System administrators may want
77to put this command in one of the local rc init files. This will enable the 77to put this command in one of the local rc init files. This will enable the
78kernel to request huge pages early in the boot process (when the possibility 78kernel to request huge pages early in the boot process (when the possibility
79of getting physical contiguous pages is still very high). In either 79of getting physical contiguous pages is still very high). In either
80case, adminstrators will want to verify the number of hugepages actually 80case, administrators will want to verify the number of hugepages actually
81allocated by checking the sysctl or meminfo. 81allocated by checking the sysctl or meminfo.
82 82
83/proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of 83/proc/sys/vm/nr_overcommit_hugepages indicates how large the pool of
@@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
95allowed on the system until one of the two sysctls are increased 95allowed on the system until one of the two sysctls are increased
96sufficiently, or the surplus huge pages go out of use and are freed. 96sufficiently, or the surplus huge pages go out of use and are freed.
97 97
98With support for multiple hugepage pools at run-time available, much of
99the hugepage userspace interface has been duplicated in sysfs. The above
100information applies to the default hugepage size (which will be
101controlled by the proc interfaces for backwards compatibility). The root
102hugepage control directory is
103
104 /sys/kernel/mm/hugepages
105
106For each hugepage size supported by the running kernel, a subdirectory
107will exist, of the form
108
109 hugepages-${size}kB
110
111Inside each of these directories, the same set of files will exist:
112
113 nr_hugepages
114 nr_overcommit_hugepages
115 free_hugepages
116 resv_hugepages
117 surplus_hugepages
118
119which function as described above for the default hugepage-sized case.
120
98If the user applications are going to request hugepages using mmap system 121If the user applications are going to request hugepages using mmap system
99call, then it is required that system administrator mount a file system of 122call, then it is required that system administrator mount a file system of
100type hugetlbfs: 123type hugetlbfs:
diff --git a/Documentation/vm/numa_memory_policy.txt b/Documentation/vm/numa_memory_policy.txt
index bad16d3f6a47..6aaaeb38730c 100644
--- a/Documentation/vm/numa_memory_policy.txt
+++ b/Documentation/vm/numa_memory_policy.txt
@@ -58,7 +58,7 @@ most general to most specific:
58 the policy at the time they were allocated. 58 the policy at the time they were allocated.
59 59
60 VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's 60 VMA Policy: A "VMA" or "Virtual Memory Area" refers to a range of a task's
61 virtual adddress space. A task may define a specific policy for a range 61 virtual address space. A task may define a specific policy for a range
62 of its virtual address space. See the MEMORY POLICIES APIS section, 62 of its virtual address space. See the MEMORY POLICIES APIS section,
63 below, for an overview of the mbind() system call used to set a VMA 63 below, for an overview of the mbind() system call used to set a VMA
64 policy. 64 policy.
@@ -353,7 +353,7 @@ follows:
353 353
354 Because of this extra reference counting, and because we must lookup 354 Because of this extra reference counting, and because we must lookup
355 shared policies in a tree structure under spinlock, shared policies are 355 shared policies in a tree structure under spinlock, shared policies are
356 more expensive to use in the page allocation path. This is expecially 356 more expensive to use in the page allocation path. This is especially
357 true for shared policies on shared memory regions shared by tasks running 357 true for shared policies on shared memory regions shared by tasks running
358 on different NUMA nodes. This extra overhead can be avoided by always 358 on different NUMA nodes. This extra overhead can be avoided by always
359 falling back to task or system default policy for shared memory regions, 359 falling back to task or system default policy for shared memory regions,
diff --git a/Documentation/vm/page_migration b/Documentation/vm/page_migration
index 99f89aa10169..d5fdfd34bbaf 100644
--- a/Documentation/vm/page_migration
+++ b/Documentation/vm/page_migration
@@ -18,10 +18,11 @@ migrate_pages function call takes two sets of nodes and moves pages of a
18process that are located on the from nodes to the destination nodes. 18process that are located on the from nodes to the destination nodes.
19Page migration functions are provided by the numactl package by Andi Kleen 19Page migration functions are provided by the numactl package by Andi Kleen
20(a version later than 0.9.3 is required. Get it from 20(a version later than 0.9.3 is required. Get it from
21ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which 21ftp://oss.sgi.com/www/projects/libnuma/download/). numactl provides libnuma
22provides an interface similar to other numa functionality for page migration. 22which provides an interface similar to other numa functionality for page
23cat /proc/<pid>/numa_maps allows an easy review of where the pages of 23migration. cat /proc/<pid>/numa_maps allows an easy review of where the
24a process are located. See also the numa_maps manpage in the numactl package. 24pages of a process are located. See also the numa_maps documentation in the
25proc(5) man page.
25 26
26Manual migration is useful if for example the scheduler has relocated 27Manual migration is useful if for example the scheduler has relocated
27a process to a processor on a distant node. A batch scheduler or an 28a process to a processor on a distant node. A batch scheduler or an
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index e4230ed16ee7..df3227605d59 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Slabinfo: Tool to get reports about slabs 2 * Slabinfo: Tool to get reports about slabs
3 * 3 *
4 * (C) 2007 sgi, Christoph Lameter <clameter@sgi.com> 4 * (C) 2007 sgi, Christoph Lameter
5 * 5 *
6 * Compile by: 6 * Compile by:
7 * 7 *
@@ -99,7 +99,7 @@ void fatal(const char *x, ...)
99 99
100void usage(void) 100void usage(void)
101{ 101{
102 printf("slabinfo 5/7/2007. (c) 2007 sgi. clameter@sgi.com\n\n" 102 printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n"
103 "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" 103 "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n"
104 "-a|--aliases Show aliases\n" 104 "-a|--aliases Show aliases\n"
105 "-A|--activity Most active slabs first\n" 105 "-A|--activity Most active slabs first\n"
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index 7c13f22a0c9e..bb1f5c6e28b3 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -266,4 +266,4 @@ of other objects.
266 266
267 slub_debug=FZ,dentry 267 slub_debug=FZ,dentry
268 268
269Christoph Lameter, <clameter@sgi.com>, May 30, 2007 269Christoph Lameter, May 30, 2007
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt
index 10c2e411cca8..991c26a6ef64 100644
--- a/Documentation/volatile-considered-harmful.txt
+++ b/Documentation/volatile-considered-harmful.txt
@@ -114,6 +114,6 @@ CREDITS
114 114
115Original impetus and research by Randy Dunlap 115Original impetus and research by Randy Dunlap
116Written by Jonathan Corbet 116Written by Jonathan Corbet
117Improvements via coments from Satyam Sharma, Johannes Stezenbach, Jesper 117Improvements via comments from Satyam Sharma, Johannes Stezenbach, Jesper
118 Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan 118 Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan
119 Richter. 119 Richter.
diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile
new file mode 100644
index 000000000000..40e5f46e4740
--- /dev/null
+++ b/Documentation/watchdog/src/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 := watchdog-simple watchdog-test
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/x86/00-INDEX b/Documentation/x86/00-INDEX
new file mode 100644
index 000000000000..dbe3377754af
--- /dev/null
+++ b/Documentation/x86/00-INDEX
@@ -0,0 +1,4 @@
100-INDEX
2 - this file
3mtrr.txt
4 - how to use x86 Memory Type Range Registers to increase performance
diff --git a/Documentation/i386/boot.txt b/Documentation/x86/boot.txt
index 95ad15c3b01f..83c0033ee9e0 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -1,17 +1,14 @@
1 THE LINUX/I386 BOOT PROTOCOL 1 THE LINUX/x86 BOOT PROTOCOL
2 ---------------------------- 2 ---------------------------
3 3
4 H. Peter Anvin <hpa@zytor.com> 4On the x86 platform, the Linux kernel uses a rather complicated boot
5 Last update 2007-05-23
6
7On the i386 platform, the Linux kernel uses a rather complicated boot
8convention. This has evolved partially due to historical aspects, as 5convention. This has evolved partially due to historical aspects, as
9well as the desire in the early days to have the kernel itself be a 6well as the desire in the early days to have the kernel itself be a
10bootable image, the complicated PC memory model and due to changed 7bootable image, the complicated PC memory model and due to changed
11expectations in the PC industry caused by the effective demise of 8expectations in the PC industry caused by the effective demise of
12real-mode DOS as a mainstream operating system. 9real-mode DOS as a mainstream operating system.
13 10
14Currently, the following versions of the Linux/i386 boot protocol exist. 11Currently, the following versions of the Linux/x86 boot protocol exist.
15 12
16Old kernels: zImage/Image support only. Some very early kernels 13Old kernels: zImage/Image support only. Some very early kernels
17 may not even support a command line. 14 may not even support a command line.
@@ -311,7 +308,7 @@ Protocol: 2.00+
311 308
312Field name: start_sys 309Field name: start_sys
313Type: read 310Type: read
314Offset/size: 0x20c/4 311Offset/size: 0x20c/2
315Protocol: 2.00+ 312Protocol: 2.00+
316 313
317 The load low segment (0x1000). Obsolete. 314 The load low segment (0x1000). Obsolete.
@@ -372,10 +369,17 @@ Protocol: 2.00+
372 - If 0, the protected-mode code is loaded at 0x10000. 369 - If 0, the protected-mode code is loaded at 0x10000.
373 - If 1, the protected-mode code is loaded at 0x100000. 370 - If 1, the protected-mode code is loaded at 0x100000.
374 371
372 Bit 5 (write): QUIET_FLAG
373 - If 0, print early messages.
374 - If 1, suppress early messages.
375 This requests to the kernel (decompressor and early
376 kernel) to not write early messages that require
377 accessing the display hardware directly.
378
375 Bit 6 (write): KEEP_SEGMENTS 379 Bit 6 (write): KEEP_SEGMENTS
376 Protocol: 2.07+ 380 Protocol: 2.07+
377 - if 0, reload the segment registers in the 32bit entry point. 381 - If 0, reload the segment registers in the 32bit entry point.
378 - if 1, do not reload the segment registers in the 32bit entry point. 382 - If 1, do not reload the segment registers in the 32bit entry point.
379 Assume that %cs %ds %ss %es are all set to flat segments with 383 Assume that %cs %ds %ss %es are all set to flat segments with
380 a base of 0 (or the equivalent for their environment). 384 a base of 0 (or the equivalent for their environment).
381 385
@@ -504,7 +508,7 @@ Protocol: 2.06+
504 maximum size was 255. 508 maximum size was 255.
505 509
506Field name: hardware_subarch 510Field name: hardware_subarch
507Type: write 511Type: write (optional, defaults to x86/PC)
508Offset/size: 0x23c/4 512Offset/size: 0x23c/4
509Protocol: 2.07+ 513Protocol: 2.07+
510 514
@@ -520,11 +524,13 @@ Protocol: 2.07+
520 0x00000002 Xen 524 0x00000002 Xen
521 525
522Field name: hardware_subarch_data 526Field name: hardware_subarch_data
523Type: write 527Type: write (subarch-dependent)
524Offset/size: 0x240/8 528Offset/size: 0x240/8
525Protocol: 2.07+ 529Protocol: 2.07+
526 530
527 A pointer to data that is specific to hardware subarch 531 A pointer to data that is specific to hardware subarch
532 This field is currently unused for the default x86/PC environment,
533 do not modify.
528 534
529Field name: payload_offset 535Field name: payload_offset
530Type: read 536Type: read
@@ -545,6 +551,34 @@ Protocol: 2.08+
545 551
546 The length of the payload. 552 The length of the payload.
547 553
554Field name: setup_data
555Type: write (special)
556Offset/size: 0x250/8
557Protocol: 2.09+
558
559 The 64-bit physical pointer to NULL terminated single linked list of
560 struct setup_data. This is used to define a more extensible boot
561 parameters passing mechanism. The definition of struct setup_data is
562 as follow:
563
564 struct setup_data {
565 u64 next;
566 u32 type;
567 u32 len;
568 u8 data[0];
569 };
570
571 Where, the next is a 64-bit physical pointer to the next node of
572 linked list, the next field of the last node is 0; the type is used
573 to identify the contents of data; the len is the length of data
574 field; the data holds the real payload.
575
576 This list may be modified at a number of points during the bootup
577 process. Therefore, when modifying this list one should always make
578 sure to consider the case where the linked list already contains
579 entries.
580
581
548**** THE IMAGE CHECKSUM 582**** THE IMAGE CHECKSUM
549 583
550From boot protocol version 2.08 onwards the CRC-32 is calculated over 584From boot protocol version 2.08 onwards the CRC-32 is calculated over
@@ -553,6 +587,7 @@ initial remainder of 0xffffffff. The checksum is appended to the
553file; therefore the CRC of the file up to the limit specified in the 587file; therefore the CRC of the file up to the limit specified in the
554syssize field of the header is always 0. 588syssize field of the header is always 0.
555 589
590
556**** THE KERNEL COMMAND LINE 591**** THE KERNEL COMMAND LINE
557 592
558The kernel command line has become an important way for the boot 593The kernel command line has become an important way for the boot
@@ -584,28 +619,6 @@ command line is entered using the following protocol:
584 covered by setup_move_size, so you may need to adjust this 619 covered by setup_move_size, so you may need to adjust this
585 field. 620 field.
586 621
587Field name: setup_data
588Type: write (obligatory)
589Offset/size: 0x250/8
590Protocol: 2.09+
591
592 The 64-bit physical pointer to NULL terminated single linked list of
593 struct setup_data. This is used to define a more extensible boot
594 parameters passing mechanism. The definition of struct setup_data is
595 as follow:
596
597 struct setup_data {
598 u64 next;
599 u32 type;
600 u32 len;
601 u8 data[0];
602 };
603
604 Where, the next is a 64-bit physical pointer to the next node of
605 linked list, the next field of the last node is 0; the type is used
606 to identify the contents of data; the len is the length of data
607 field; the data holds the real payload.
608
609 622
610**** MEMORY LAYOUT OF THE REAL-MODE CODE 623**** MEMORY LAYOUT OF THE REAL-MODE CODE
611 624
diff --git a/Documentation/i386/IO-APIC.txt b/Documentation/x86/i386/IO-APIC.txt
index 30b4c714fbe1..30b4c714fbe1 100644
--- a/Documentation/i386/IO-APIC.txt
+++ b/Documentation/x86/i386/IO-APIC.txt
diff --git a/Documentation/mtrr.txt b/Documentation/x86/mtrr.txt
index c39ac395970e..cc071dc333c2 100644
--- a/Documentation/mtrr.txt
+++ b/Documentation/x86/mtrr.txt
@@ -18,7 +18,7 @@ Richard Gooch
18 The AMD K6-2 (stepping 8 and above) and K6-3 processors have two 18 The AMD K6-2 (stepping 8 and above) and K6-3 processors have two
19 MTRRs. These are supported. The AMD Athlon family provide 8 Intel 19 MTRRs. These are supported. The AMD Athlon family provide 8 Intel
20 style MTRRs. 20 style MTRRs.
21 21
22 The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These 22 The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These
23 are supported. 23 are supported.
24 24
@@ -87,7 +87,7 @@ reg00: base=0x00000000 ( 0MB), size= 64MB: write-back, count=1
87reg01: base=0xfb000000 (4016MB), size= 16MB: write-combining, count=1 87reg01: base=0xfb000000 (4016MB), size= 16MB: write-combining, count=1
88reg02: base=0xfb000000 (4016MB), size= 4kB: uncachable, count=1 88reg02: base=0xfb000000 (4016MB), size= 4kB: uncachable, count=1
89 89
90Some cards (especially Voodoo Graphics boards) need this 4 kB area 90Some cards (especially Voodoo Graphics boards) need this 4 kB area
91excluded from the beginning of the region because it is used for 91excluded from the beginning of the region because it is used for
92registers. 92registers.
93 93
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index 17965f927c15..c93ff5f4c0dd 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -14,6 +14,10 @@ PAT allows for different types of memory attributes. The most commonly used
14ones that will be supported at this time are Write-back, Uncached, 14ones that will be supported at this time are Write-back, Uncached,
15Write-combined and Uncached Minus. 15Write-combined and Uncached Minus.
16 16
17
18PAT APIs
19--------
20
17There are many different APIs in the kernel that allows setting of memory 21There are many different APIs in the kernel that allows setting of memory
18attributes at the page level. In order to avoid aliasing, these interfaces 22attributes at the page level. In order to avoid aliasing, these interfaces
19should be used thoughtfully. Below is a table of interfaces available, 23should be used thoughtfully. Below is a table of interfaces available,
@@ -26,38 +30,38 @@ address range to avoid any aliasing.
26API | RAM | ACPI,... | Reserved/Holes | 30API | RAM | ACPI,... | Reserved/Holes |
27-----------------------|----------|------------|------------------| 31-----------------------|----------|------------|------------------|
28 | | | | 32 | | | |
29ioremap | -- | UC | UC | 33ioremap | -- | UC- | UC- |
30 | | | | 34 | | | |
31ioremap_cache | -- | WB | WB | 35ioremap_cache | -- | WB | WB |
32 | | | | 36 | | | |
33ioremap_nocache | -- | UC | UC | 37ioremap_nocache | -- | UC- | UC- |
34 | | | | 38 | | | |
35ioremap_wc | -- | -- | WC | 39ioremap_wc | -- | -- | WC |
36 | | | | 40 | | | |
37set_memory_uc | UC | -- | -- | 41set_memory_uc | UC- | -- | -- |
38 set_memory_wb | | | | 42 set_memory_wb | | | |
39 | | | | 43 | | | |
40set_memory_wc | WC | -- | -- | 44set_memory_wc | WC | -- | -- |
41 set_memory_wb | | | | 45 set_memory_wb | | | |
42 | | | | 46 | | | |
43pci sysfs resource | -- | -- | UC | 47pci sysfs resource | -- | -- | UC- |
44 | | | | 48 | | | |
45pci sysfs resource_wc | -- | -- | WC | 49pci sysfs resource_wc | -- | -- | WC |
46 is IORESOURCE_PREFETCH| | | | 50 is IORESOURCE_PREFETCH| | | |
47 | | | | 51 | | | |
48pci proc | -- | -- | UC | 52pci proc | -- | -- | UC- |
49 !PCIIOC_WRITE_COMBINE | | | | 53 !PCIIOC_WRITE_COMBINE | | | |
50 | | | | 54 | | | |
51pci proc | -- | -- | WC | 55pci proc | -- | -- | WC |
52 PCIIOC_WRITE_COMBINE | | | | 56 PCIIOC_WRITE_COMBINE | | | |
53 | | | | 57 | | | |
54/dev/mem | -- | UC | UC | 58/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
55 read-write | | | | 59 read-write | | | |
56 | | | | 60 | | | |
57/dev/mem | -- | UC | UC | 61/dev/mem | -- | UC- | UC- |
58 mmap SYNC flag | | | | 62 mmap SYNC flag | | | |
59 | | | | 63 | | | |
60/dev/mem | -- | WB/WC/UC | WB/WC/UC | 64/dev/mem | -- | WB/WC/UC- | WB/WC/UC- |
61 mmap !SYNC flag | |(from exist-| (from exist- | 65 mmap !SYNC flag | |(from exist-| (from exist- |
62 and | | ing alias)| ing alias) | 66 and | | ing alias)| ing alias) |
63 any alias to this area| | | | 67 any alias to this area| | | |
@@ -68,7 +72,7 @@ pci proc | -- | -- | WC |
68 and | | | | 72 and | | | |
69 MTRR says WB | | | | 73 MTRR says WB | | | |
70 | | | | 74 | | | |
71/dev/mem | -- | -- | UC_MINUS | 75/dev/mem | -- | -- | UC- |
72 mmap !SYNC flag | | | | 76 mmap !SYNC flag | | | |
73 no alias to this area | | | | 77 no alias to this area | | | |
74 and | | | | 78 and | | | |
@@ -98,3 +102,35 @@ types.
98 102
99Drivers should use set_memory_[uc|wc] to set access type for RAM ranges. 103Drivers should use set_memory_[uc|wc] to set access type for RAM ranges.
100 104
105
106PAT debugging
107-------------
108
109With CONFIG_DEBUG_FS enabled, PAT memtype list can be examined by
110
111# mount -t debugfs debugfs /sys/kernel/debug
112# cat /sys/kernel/debug/x86/pat_memtype_list
113PAT memtype list:
114uncached-minus @ 0x7fadf000-0x7fae0000
115uncached-minus @ 0x7fb19000-0x7fb1a000
116uncached-minus @ 0x7fb1a000-0x7fb1b000
117uncached-minus @ 0x7fb1b000-0x7fb1c000
118uncached-minus @ 0x7fb1c000-0x7fb1d000
119uncached-minus @ 0x7fb1d000-0x7fb1e000
120uncached-minus @ 0x7fb1e000-0x7fb25000
121uncached-minus @ 0x7fb25000-0x7fb26000
122uncached-minus @ 0x7fb26000-0x7fb27000
123uncached-minus @ 0x7fb27000-0x7fb28000
124uncached-minus @ 0x7fb28000-0x7fb2e000
125uncached-minus @ 0x7fb2e000-0x7fb2f000
126uncached-minus @ 0x7fb2f000-0x7fb30000
127uncached-minus @ 0x7fb31000-0x7fb32000
128uncached-minus @ 0x80000000-0x90000000
129
130This list shows physical address ranges and various PAT settings used to
131access those physical address ranges.
132
133Another, more verbose way of getting PAT related debug messages is with
134"debugpat" boot parameter. With this parameter, various debug messages are
135printed to dmesg log.
136
diff --git a/Documentation/i386/usb-legacy-support.txt b/Documentation/x86/usb-legacy-support.txt
index 1894cdfc69d9..1894cdfc69d9 100644
--- a/Documentation/i386/usb-legacy-support.txt
+++ b/Documentation/x86/usb-legacy-support.txt
diff --git a/Documentation/x86_64/00-INDEX b/Documentation/x86/x86_64/00-INDEX
index 92fc20ab5f0e..92fc20ab5f0e 100644
--- a/Documentation/x86_64/00-INDEX
+++ b/Documentation/x86/x86_64/00-INDEX
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86/x86_64/boot-options.txt
index b0c7b6c4abda..72ffb5373ec7 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86/x86_64/boot-options.txt
@@ -54,10 +54,6 @@ APICs
54 apicmaintimer. Useful when your PIT timer is totally 54 apicmaintimer. Useful when your PIT timer is totally
55 broken. 55 broken.
56 56
57 disable_8254_timer / enable_8254_timer
58 Enable interrupt 0 timer routing over the 8254 in addition to over
59 the IO-APIC. The kernel tries to set a sensible default.
60
61Early Console 57Early Console
62 58
63 syntax: earlyprintk=vga 59 syntax: earlyprintk=vga
diff --git a/Documentation/x86_64/cpu-hotplug-spec b/Documentation/x86/x86_64/cpu-hotplug-spec
index 3c23e0587db3..3c23e0587db3 100644
--- a/Documentation/x86_64/cpu-hotplug-spec
+++ b/Documentation/x86/x86_64/cpu-hotplug-spec
diff --git a/Documentation/x86_64/fake-numa-for-cpusets b/Documentation/x86/x86_64/fake-numa-for-cpusets
index d1a985c5b00a..d1a985c5b00a 100644
--- a/Documentation/x86_64/fake-numa-for-cpusets
+++ b/Documentation/x86/x86_64/fake-numa-for-cpusets
diff --git a/Documentation/x86_64/kernel-stacks b/Documentation/x86/x86_64/kernel-stacks
index 5ad65d51fb95..5ad65d51fb95 100644
--- a/Documentation/x86_64/kernel-stacks
+++ b/Documentation/x86/x86_64/kernel-stacks
diff --git a/Documentation/x86_64/machinecheck b/Documentation/x86/x86_64/machinecheck
index a05e58e7b159..a05e58e7b159 100644
--- a/Documentation/x86_64/machinecheck
+++ b/Documentation/x86/x86_64/machinecheck
diff --git a/Documentation/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
index b89b6d2bebfa..efce75097369 100644
--- a/Documentation/x86_64/mm.txt
+++ b/Documentation/x86/x86_64/mm.txt
@@ -11,9 +11,8 @@ ffffc10000000000 - ffffc1ffffffffff (=40 bits) hole
11ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space 11ffffc20000000000 - ffffe1ffffffffff (=45 bits) vmalloc/ioremap space
12ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB) 12ffffe20000000000 - ffffe2ffffffffff (=40 bits) virtual memory map (1TB)
13... unused hole ... 13... unused hole ...
14ffffffff80000000 - ffffffff82800000 (=40 MB) kernel text mapping, from phys 0 14ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0
15... unused hole ... 15ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
16ffffffff88000000 - fffffffffff00000 (=1919 MB) module mapping space
17 16
18The direct mapping covers all memory in the system up to the highest 17The direct mapping covers all memory in the system up to the highest
19memory address (this means in some cases it can also include PCI memory 18memory address (this means in some cases it can also include PCI memory
diff --git a/Documentation/x86_64/uefi.txt b/Documentation/x86/x86_64/uefi.txt
index 7d77120a5184..a5e2b4fdb170 100644
--- a/Documentation/x86_64/uefi.txt
+++ b/Documentation/x86/x86_64/uefi.txt
@@ -36,3 +36,7 @@ Mechanics:
36 services. 36 services.
37 noefi turn off all EFI runtime services 37 noefi turn off all EFI runtime services
38 reboot_type=k turn off EFI reboot runtime service 38 reboot_type=k turn off EFI reboot runtime service
39- If the EFI memory map has additional entries not in the E820 map,
40 you can include those entries in the kernels memory map of available
41 physical RAM by using the following kernel command line parameter.
42 add_efi_memmap include EFI memory map of available physical RAM
diff --git a/Documentation/i386/zero-page.txt b/Documentation/x86/zero-page.txt
index 169ad423a3d1..169ad423a3d1 100644
--- a/Documentation/i386/zero-page.txt
+++ b/Documentation/x86/zero-page.txt