diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-02-15 04:24:31 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-02-15 04:24:31 -0500 |
commit | 0a9d59a2461477bd9ed143c01af9df3f8f00fa81 (patch) | |
tree | df997d1cfb0786427a0df1fbd6f0640fa4248cf4 /Documentation | |
parent | a23ce6da9677d245aa0aadc99f4197030350ab54 (diff) | |
parent | 795abaf1e4e188c4171e3cd3dbb11a9fcacaf505 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ABI/stable/thermal-notification | 4 | ||||
-rw-r--r-- | Documentation/ABI/testing/sysfs-platform-at91 | 25 | ||||
-rw-r--r-- | Documentation/DocBook/80211.tmpl | 21 | ||||
-rw-r--r-- | Documentation/DocBook/device-drivers.tmpl | 4 | ||||
-rw-r--r-- | Documentation/DocBook/dvb/dvbapi.xml | 2 | ||||
-rw-r--r-- | Documentation/DocBook/media.tmpl | 4 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/dev-rds.xml | 6 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/v4l2.xml | 3 | ||||
-rw-r--r-- | Documentation/IPMI.txt | 27 | ||||
-rw-r--r-- | Documentation/acpi/apei/output_format.txt | 122 | ||||
-rw-r--r-- | Documentation/arm/Booting | 33 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-crypt.txt | 7 | ||||
-rw-r--r-- | Documentation/device-mapper/dm-raid.txt | 70 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/ata/fsl-sata.txt (renamed from Documentation/powerpc/dts-bindings/fsl/sata.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/eeprom.txt (renamed from Documentation/powerpc/dts-bindings/eeprom.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/gpio/8xxx_gpio.txt (renamed from Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio.txt (renamed from Documentation/powerpc/dts-bindings/gpio/gpio.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/gpio/led.txt (renamed from Documentation/powerpc/dts-bindings/gpio/led.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/i2c/fsl-i2c.txt (renamed from Documentation/powerpc/dts-bindings/fsl/i2c.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/marvell.txt (renamed from Documentation/powerpc/dts-bindings/marvell.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/mmc/fsl-esdhc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/esdhc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt (renamed from Documentation/powerpc/dts-bindings/mmc-spi-slot.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt (renamed from Documentation/powerpc/dts-bindings/fsl/upm-nand.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/mtd/mtd-physmap.txt (renamed from Documentation/powerpc/dts-bindings/mtd-physmap.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt (renamed from Documentation/powerpc/dts-bindings/fsl/can.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/net/can/sja1000.txt (renamed from Documentation/powerpc/dts-bindings/can/sja1000.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/net/fsl-tsec-phy.txt (renamed from Documentation/powerpc/dts-bindings/fsl/tsec.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/net/mdio-gpio.txt (renamed from Documentation/powerpc/dts-bindings/gpio/mdio.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/net/phy.txt (renamed from Documentation/powerpc/dts-bindings/phy.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/pci/83xx-512x-pci.txt (renamed from Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/4xx/cpm.txt (renamed from Documentation/powerpc/dts-bindings/4xx/cpm.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/4xx/emac.txt (renamed from Documentation/powerpc/dts-bindings/4xx/emac.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt (renamed from Documentation/powerpc/dts-bindings/4xx/ndfc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt (renamed from Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/4xx/reboot.txt (renamed from Documentation/powerpc/dts-bindings/4xx/reboot.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/board.txt (renamed from Documentation/powerpc/dts-bindings/fsl/board.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt (renamed from Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/diu.txt (renamed from Documentation/powerpc/dts-bindings/fsl/diu.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/dma.txt (renamed from Documentation/powerpc/dts-bindings/fsl/dma.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/ecm.txt (renamed from Documentation/powerpc/dts-bindings/ecm.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/gtm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/gtm.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/guts.txt (renamed from Documentation/powerpc/dts-bindings/fsl/guts.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/lbc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/lbc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/mcm.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mcm.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mpc5200.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/mpic.txt (renamed from Documentation/powerpc/dts-bindings/fsl/mpic.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt (renamed from Documentation/powerpc/dts-bindings/fsl/msi-pic.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/pmc.txt (renamed from Documentation/powerpc/dts-bindings/fsl/pmc.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/sec.txt (renamed from Documentation/powerpc/dts-bindings/fsl/sec.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/fsl/ssi.txt (renamed from Documentation/powerpc/dts-bindings/fsl/ssi.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt (renamed from Documentation/powerpc/dts-bindings/nintendo/gamecube.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/powerpc/nintendo/wii.txt (renamed from Documentation/powerpc/dts-bindings/nintendo/wii.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/spi/fsl-spi.txt (renamed from Documentation/powerpc/dts-bindings/fsl/spi.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/spi/spi-bus.txt (renamed from Documentation/powerpc/dts-bindings/spi-bus.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/fsl-usb.txt (renamed from Documentation/powerpc/dts-bindings/fsl/usb.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/usb/usb-ehci.txt (renamed from Documentation/powerpc/dts-bindings/usb-ehci.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/xilinx.txt (renamed from Documentation/powerpc/dts-bindings/xilinx.txt) | 0 | ||||
-rw-r--r-- | Documentation/devicetree/booting-without-of.txt (renamed from Documentation/powerpc/booting-without-of.txt) | 193 | ||||
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 35 | ||||
-rw-r--r-- | Documentation/filesystems/Locking | 9 | ||||
-rw-r--r-- | Documentation/filesystems/ntfs.txt | 2 | ||||
-rw-r--r-- | Documentation/filesystems/porting | 8 | ||||
-rw-r--r-- | Documentation/filesystems/proc.txt | 7 | ||||
-rw-r--r-- | Documentation/filesystems/vfs.txt | 47 | ||||
-rw-r--r-- | Documentation/gpio.txt | 2 | ||||
-rw-r--r-- | Documentation/hwmon/lm93 | 7 | ||||
-rw-r--r-- | Documentation/kernel-parameters.txt | 9 | ||||
-rw-r--r-- | Documentation/lguest/lguest.c | 73 | ||||
-rw-r--r-- | Documentation/lguest/lguest.txt | 5 | ||||
-rw-r--r-- | Documentation/networking/bonding.txt | 83 | ||||
-rw-r--r-- | Documentation/networking/ip-sysctl.txt | 2 | ||||
-rw-r--r-- | Documentation/scheduler/sched-stats.txt | 33 | ||||
-rw-r--r-- | Documentation/sound/alsa/HD-Audio-Models.txt | 1 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/codec.txt | 45 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/machine.txt | 38 | ||||
-rw-r--r-- | Documentation/sound/alsa/soc/platform.txt | 12 | ||||
-rwxr-xr-x | Documentation/target/tcm_mod_builder.py | 1094 | ||||
-rw-r--r-- | Documentation/target/tcm_mod_builder.txt | 145 | ||||
-rw-r--r-- | Documentation/thermal/sysfs-api.txt | 12 | ||||
-rw-r--r-- | Documentation/video4linux/v4l2-controls.txt | 12 | ||||
-rw-r--r-- | Documentation/vm/transhuge.txt | 298 |
96 files changed, 2258 insertions, 242 deletions
diff --git a/Documentation/ABI/stable/thermal-notification b/Documentation/ABI/stable/thermal-notification new file mode 100644 index 00000000000..9723e8b7aeb --- /dev/null +++ b/Documentation/ABI/stable/thermal-notification | |||
@@ -0,0 +1,4 @@ | |||
1 | What: A notification mechanism for thermal related events | ||
2 | Description: | ||
3 | This interface enables notification for thermal related events. | ||
4 | The notification is in the form of a netlink event. | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-at91 b/Documentation/ABI/testing/sysfs-platform-at91 new file mode 100644 index 00000000000..4cc6a865ae6 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-platform-at91 | |||
@@ -0,0 +1,25 @@ | |||
1 | What: /sys/devices/platform/at91_can/net/<iface>/mb0_id | ||
2 | Date: January 2011 | ||
3 | KernelVersion: 2.6.38 | ||
4 | Contact: Marc Kleine-Budde <kernel@pengutronix.de> | ||
5 | Description: | ||
6 | Value representing the can_id of mailbox 0. | ||
7 | |||
8 | Default: 0x7ff (standard frame) | ||
9 | |||
10 | Due to a chip bug (errata 50.2.6.3 & 50.3.5.3 in | ||
11 | "AT91SAM9263 Preliminary 6249H-ATARM-27-Jul-09") the | ||
12 | contents of mailbox 0 may be send under certain | ||
13 | conditions (even if disabled or in rx mode). | ||
14 | |||
15 | The workaround in the errata suggests not to use the | ||
16 | mailbox and load it with an unused identifier. | ||
17 | |||
18 | In order to use an extended can_id add the | ||
19 | CAN_EFF_FLAG (0x80000000U) to the can_id. Example: | ||
20 | |||
21 | - standard id 0x7ff: | ||
22 | echo 0x7ff > /sys/class/net/can0/mb0_id | ||
23 | |||
24 | - extended id 0x1fffffff: | ||
25 | echo 0x9fffffff > /sys/class/net/can0/mb0_id | ||
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl index 03641a08e27..8906648f962 100644 --- a/Documentation/DocBook/80211.tmpl +++ b/Documentation/DocBook/80211.tmpl | |||
@@ -268,10 +268,6 @@ | |||
268 | !Finclude/net/mac80211.h ieee80211_ops | 268 | !Finclude/net/mac80211.h ieee80211_ops |
269 | !Finclude/net/mac80211.h ieee80211_alloc_hw | 269 | !Finclude/net/mac80211.h ieee80211_alloc_hw |
270 | !Finclude/net/mac80211.h ieee80211_register_hw | 270 | !Finclude/net/mac80211.h ieee80211_register_hw |
271 | !Finclude/net/mac80211.h ieee80211_get_tx_led_name | ||
272 | !Finclude/net/mac80211.h ieee80211_get_rx_led_name | ||
273 | !Finclude/net/mac80211.h ieee80211_get_assoc_led_name | ||
274 | !Finclude/net/mac80211.h ieee80211_get_radio_led_name | ||
275 | !Finclude/net/mac80211.h ieee80211_unregister_hw | 271 | !Finclude/net/mac80211.h ieee80211_unregister_hw |
276 | !Finclude/net/mac80211.h ieee80211_free_hw | 272 | !Finclude/net/mac80211.h ieee80211_free_hw |
277 | </chapter> | 273 | </chapter> |
@@ -382,6 +378,23 @@ | |||
382 | </para> | 378 | </para> |
383 | </partintro> | 379 | </partintro> |
384 | 380 | ||
381 | <chapter id="led-support"> | ||
382 | <title>LED support</title> | ||
383 | <para> | ||
384 | Mac80211 supports various ways of blinking LEDs. Wherever possible, | ||
385 | device LEDs should be exposed as LED class devices and hooked up to | ||
386 | the appropriate trigger, which will then be triggered appropriately | ||
387 | by mac80211. | ||
388 | </para> | ||
389 | !Finclude/net/mac80211.h ieee80211_get_tx_led_name | ||
390 | !Finclude/net/mac80211.h ieee80211_get_rx_led_name | ||
391 | !Finclude/net/mac80211.h ieee80211_get_assoc_led_name | ||
392 | !Finclude/net/mac80211.h ieee80211_get_radio_led_name | ||
393 | !Finclude/net/mac80211.h ieee80211_tpt_blink | ||
394 | !Finclude/net/mac80211.h ieee80211_tpt_led_trigger_flags | ||
395 | !Finclude/net/mac80211.h ieee80211_create_tpt_led_trigger | ||
396 | </chapter> | ||
397 | |||
385 | <chapter id="hardware-crypto-offload"> | 398 | <chapter id="hardware-crypto-offload"> |
386 | <title>Hardware crypto acceleration</title> | 399 | <title>Hardware crypto acceleration</title> |
387 | !Pinclude/net/mac80211.h Hardware crypto acceleration | 400 | !Pinclude/net/mac80211.h Hardware crypto acceleration |
diff --git a/Documentation/DocBook/device-drivers.tmpl b/Documentation/DocBook/device-drivers.tmpl index 35447e08173..36f63d4a0a0 100644 --- a/Documentation/DocBook/device-drivers.tmpl +++ b/Documentation/DocBook/device-drivers.tmpl | |||
@@ -217,8 +217,8 @@ X!Isound/sound_firmware.c | |||
217 | <chapter id="uart16x50"> | 217 | <chapter id="uart16x50"> |
218 | <title>16x50 UART Driver</title> | 218 | <title>16x50 UART Driver</title> |
219 | !Iinclude/linux/serial_core.h | 219 | !Iinclude/linux/serial_core.h |
220 | !Edrivers/serial/serial_core.c | 220 | !Edrivers/tty/serial/serial_core.c |
221 | !Edrivers/serial/8250.c | 221 | !Edrivers/tty/serial/8250.c |
222 | </chapter> | 222 | </chapter> |
223 | 223 | ||
224 | <chapter id="fbdev"> | 224 | <chapter id="fbdev"> |
diff --git a/Documentation/DocBook/dvb/dvbapi.xml b/Documentation/DocBook/dvb/dvbapi.xml index e3a97fdd62a..ad8678d4891 100644 --- a/Documentation/DocBook/dvb/dvbapi.xml +++ b/Documentation/DocBook/dvb/dvbapi.xml | |||
@@ -28,7 +28,7 @@ | |||
28 | <holder>Convergence GmbH</holder> | 28 | <holder>Convergence GmbH</holder> |
29 | </copyright> | 29 | </copyright> |
30 | <copyright> | 30 | <copyright> |
31 | <year>2009-2010</year> | 31 | <year>2009-2011</year> |
32 | <holder>Mauro Carvalho Chehab</holder> | 32 | <holder>Mauro Carvalho Chehab</holder> |
33 | </copyright> | 33 | </copyright> |
34 | 34 | ||
diff --git a/Documentation/DocBook/media.tmpl b/Documentation/DocBook/media.tmpl index f11048d4053..a99088aae1a 100644 --- a/Documentation/DocBook/media.tmpl +++ b/Documentation/DocBook/media.tmpl | |||
@@ -28,7 +28,7 @@ | |||
28 | <title>LINUX MEDIA INFRASTRUCTURE API</title> | 28 | <title>LINUX MEDIA INFRASTRUCTURE API</title> |
29 | 29 | ||
30 | <copyright> | 30 | <copyright> |
31 | <year>2009-2010</year> | 31 | <year>2009-2011</year> |
32 | <holder>LinuxTV Developers</holder> | 32 | <holder>LinuxTV Developers</holder> |
33 | </copyright> | 33 | </copyright> |
34 | 34 | ||
@@ -86,7 +86,7 @@ Foundation. A copy of the license is included in the chapter entitled | |||
86 | </author> | 86 | </author> |
87 | </authorgroup> | 87 | </authorgroup> |
88 | <copyright> | 88 | <copyright> |
89 | <year>2009-2010</year> | 89 | <year>2009-2011</year> |
90 | <holder>Mauro Carvalho Chehab</holder> | 90 | <holder>Mauro Carvalho Chehab</holder> |
91 | </copyright> | 91 | </copyright> |
92 | 92 | ||
diff --git a/Documentation/DocBook/v4l/dev-rds.xml b/Documentation/DocBook/v4l/dev-rds.xml index 360d2737e64..2427f54397e 100644 --- a/Documentation/DocBook/v4l/dev-rds.xml +++ b/Documentation/DocBook/v4l/dev-rds.xml | |||
@@ -75,6 +75,7 @@ as follows:</para> | |||
75 | </section> | 75 | </section> |
76 | 76 | ||
77 | <section> | 77 | <section> |
78 | <title>RDS datastructures</title> | ||
78 | <table frame="none" pgwide="1" id="v4l2-rds-data"> | 79 | <table frame="none" pgwide="1" id="v4l2-rds-data"> |
79 | <title>struct | 80 | <title>struct |
80 | <structname>v4l2_rds_data</structname></title> | 81 | <structname>v4l2_rds_data</structname></title> |
@@ -129,10 +130,11 @@ as follows:</para> | |||
129 | 130 | ||
130 | <table frame="none" pgwide="1" id="v4l2-rds-block-codes"> | 131 | <table frame="none" pgwide="1" id="v4l2-rds-block-codes"> |
131 | <title>Block defines</title> | 132 | <title>Block defines</title> |
132 | <tgroup cols="3"> | 133 | <tgroup cols="4"> |
133 | <colspec colname="c1" colwidth="1*" /> | 134 | <colspec colname="c1" colwidth="1*" /> |
134 | <colspec colname="c2" colwidth="1*" /> | 135 | <colspec colname="c2" colwidth="1*" /> |
135 | <colspec colname="c3" colwidth="5*" /> | 136 | <colspec colname="c3" colwidth="1*" /> |
137 | <colspec colname="c4" colwidth="5*" /> | ||
136 | <tbody valign="top"> | 138 | <tbody valign="top"> |
137 | <row> | 139 | <row> |
138 | <entry>V4L2_RDS_BLOCK_MSK</entry> | 140 | <entry>V4L2_RDS_BLOCK_MSK</entry> |
diff --git a/Documentation/DocBook/v4l/v4l2.xml b/Documentation/DocBook/v4l/v4l2.xml index 839e93e875a..9288af96de3 100644 --- a/Documentation/DocBook/v4l/v4l2.xml +++ b/Documentation/DocBook/v4l/v4l2.xml | |||
@@ -100,6 +100,7 @@ Remote Controller chapter.</contrib> | |||
100 | <year>2008</year> | 100 | <year>2008</year> |
101 | <year>2009</year> | 101 | <year>2009</year> |
102 | <year>2010</year> | 102 | <year>2010</year> |
103 | <year>2011</year> | ||
103 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin | 104 | <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin |
104 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> | 105 | Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder> |
105 | </copyright> | 106 | </copyright> |
@@ -381,7 +382,7 @@ and discussions on the V4L mailing list.</revremark> | |||
381 | </partinfo> | 382 | </partinfo> |
382 | 383 | ||
383 | <title>Video for Linux Two API Specification</title> | 384 | <title>Video for Linux Two API Specification</title> |
384 | <subtitle>Revision 2.6.33</subtitle> | 385 | <subtitle>Revision 2.6.38</subtitle> |
385 | 386 | ||
386 | <chapter id="common"> | 387 | <chapter id="common"> |
387 | &sub-common; | 388 | &sub-common; |
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index 69dd29ed824..b2bea15137d 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt | |||
@@ -533,6 +533,33 @@ completion during sending a panic event. | |||
533 | Other Pieces | 533 | Other Pieces |
534 | ------------ | 534 | ------------ |
535 | 535 | ||
536 | Get the detailed info related with the IPMI device | ||
537 | -------------------------------------------------- | ||
538 | |||
539 | Some users need more detailed information about a device, like where | ||
540 | the address came from or the raw base device for the IPMI interface. | ||
541 | You can use the IPMI smi_watcher to catch the IPMI interfaces as they | ||
542 | come or go, and to grab the information, you can use the function | ||
543 | ipmi_get_smi_info(), which returns the following structure: | ||
544 | |||
545 | struct ipmi_smi_info { | ||
546 | enum ipmi_addr_src addr_src; | ||
547 | struct device *dev; | ||
548 | union { | ||
549 | struct { | ||
550 | void *acpi_handle; | ||
551 | } acpi_info; | ||
552 | } addr_info; | ||
553 | }; | ||
554 | |||
555 | Currently special info for only for SI_ACPI address sources is | ||
556 | returned. Others may be added as necessary. | ||
557 | |||
558 | Note that the dev pointer is included in the above structure, and | ||
559 | assuming ipmi_smi_get_info returns success, you must call put_device | ||
560 | on the dev pointer. | ||
561 | |||
562 | |||
536 | Watchdog | 563 | Watchdog |
537 | -------- | 564 | -------- |
538 | 565 | ||
diff --git a/Documentation/acpi/apei/output_format.txt b/Documentation/acpi/apei/output_format.txt new file mode 100644 index 00000000000..9146952c612 --- /dev/null +++ b/Documentation/acpi/apei/output_format.txt | |||
@@ -0,0 +1,122 @@ | |||
1 | APEI output format | ||
2 | ~~~~~~~~~~~~~~~~~~ | ||
3 | |||
4 | APEI uses printk as hardware error reporting interface, the output | ||
5 | format is as follow. | ||
6 | |||
7 | <error record> := | ||
8 | APEI generic hardware error status | ||
9 | severity: <integer>, <severity string> | ||
10 | section: <integer>, severity: <integer>, <severity string> | ||
11 | flags: <integer> | ||
12 | <section flags strings> | ||
13 | fru_id: <uuid string> | ||
14 | fru_text: <string> | ||
15 | section_type: <section type string> | ||
16 | <section data> | ||
17 | |||
18 | <severity string>* := recoverable | fatal | corrected | info | ||
19 | |||
20 | <section flags strings># := | ||
21 | [primary][, containment warning][, reset][, threshold exceeded]\ | ||
22 | [, resource not accessible][, latent error] | ||
23 | |||
24 | <section type string> := generic processor error | memory error | \ | ||
25 | PCIe error | unknown, <uuid string> | ||
26 | |||
27 | <section data> := | ||
28 | <generic processor section data> | <memory section data> | \ | ||
29 | <pcie section data> | <null> | ||
30 | |||
31 | <generic processor section data> := | ||
32 | [processor_type: <integer>, <proc type string>] | ||
33 | [processor_isa: <integer>, <proc isa string>] | ||
34 | [error_type: <integer> | ||
35 | <proc error type strings>] | ||
36 | [operation: <integer>, <proc operation string>] | ||
37 | [flags: <integer> | ||
38 | <proc flags strings>] | ||
39 | [level: <integer>] | ||
40 | [version_info: <integer>] | ||
41 | [processor_id: <integer>] | ||
42 | [target_address: <integer>] | ||
43 | [requestor_id: <integer>] | ||
44 | [responder_id: <integer>] | ||
45 | [IP: <integer>] | ||
46 | |||
47 | <proc type string>* := IA32/X64 | IA64 | ||
48 | |||
49 | <proc isa string>* := IA32 | IA64 | X64 | ||
50 | |||
51 | <processor error type strings># := | ||
52 | [cache error][, TLB error][, bus error][, micro-architectural error] | ||
53 | |||
54 | <proc operation string>* := unknown or generic | data read | data write | \ | ||
55 | instruction execution | ||
56 | |||
57 | <proc flags strings># := | ||
58 | [restartable][, precise IP][, overflow][, corrected] | ||
59 | |||
60 | <memory section data> := | ||
61 | [error_status: <integer>] | ||
62 | [physical_address: <integer>] | ||
63 | [physical_address_mask: <integer>] | ||
64 | [node: <integer>] | ||
65 | [card: <integer>] | ||
66 | [module: <integer>] | ||
67 | [bank: <integer>] | ||
68 | [device: <integer>] | ||
69 | [row: <integer>] | ||
70 | [column: <integer>] | ||
71 | [bit_position: <integer>] | ||
72 | [requestor_id: <integer>] | ||
73 | [responder_id: <integer>] | ||
74 | [target_id: <integer>] | ||
75 | [error_type: <integer>, <mem error type string>] | ||
76 | |||
77 | <mem error type string>* := | ||
78 | unknown | no error | single-bit ECC | multi-bit ECC | \ | ||
79 | single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \ | ||
80 | target abort | parity error | watchdog timeout | invalid address | \ | ||
81 | mirror Broken | memory sparing | scrub corrected error | \ | ||
82 | scrub uncorrected error | ||
83 | |||
84 | <pcie section data> := | ||
85 | [port_type: <integer>, <pcie port type string>] | ||
86 | [version: <integer>.<integer>] | ||
87 | [command: <integer>, status: <integer>] | ||
88 | [device_id: <integer>:<integer>:<integer>.<integer> | ||
89 | slot: <integer> | ||
90 | secondary_bus: <integer> | ||
91 | vendor_id: <integer>, device_id: <integer> | ||
92 | class_code: <integer>] | ||
93 | [serial number: <integer>, <integer>] | ||
94 | [bridge: secondary_status: <integer>, control: <integer>] | ||
95 | |||
96 | <pcie port type string>* := PCIe end point | legacy PCI end point | \ | ||
97 | unknown | unknown | root port | upstream switch port | \ | ||
98 | downstream switch port | PCIe to PCI/PCI-X bridge | \ | ||
99 | PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \ | ||
100 | root complex event collector | ||
101 | |||
102 | Where, [] designate corresponding content is optional | ||
103 | |||
104 | All <field string> description with * has the following format: | ||
105 | |||
106 | field: <integer>, <field string> | ||
107 | |||
108 | Where value of <integer> should be the position of "string" in <field | ||
109 | string> description. Otherwise, <field string> will be "unknown". | ||
110 | |||
111 | All <field strings> description with # has the following format: | ||
112 | |||
113 | field: <integer> | ||
114 | <field strings> | ||
115 | |||
116 | Where each string in <fields strings> corresponding to one set bit of | ||
117 | <integer>. The bit position is the position of "string" in <field | ||
118 | strings> description. | ||
119 | |||
120 | For more detailed explanation of every field, please refer to UEFI | ||
121 | specification version 2.3 or later, section Appendix N: Common | ||
122 | Platform Error Record. | ||
diff --git a/Documentation/arm/Booting b/Documentation/arm/Booting index 76850295af8..4e686a2ed91 100644 --- a/Documentation/arm/Booting +++ b/Documentation/arm/Booting | |||
@@ -65,13 +65,19 @@ looks at the connected hardware is beyond the scope of this document. | |||
65 | The boot loader must ultimately be able to provide a MACH_TYPE_xxx | 65 | The boot loader must ultimately be able to provide a MACH_TYPE_xxx |
66 | value to the kernel. (see linux/arch/arm/tools/mach-types). | 66 | value to the kernel. (see linux/arch/arm/tools/mach-types). |
67 | 67 | ||
68 | 68 | 4. Setup boot data | |
69 | 4. Setup the kernel tagged list | 69 | ------------------ |
70 | ------------------------------- | ||
71 | 70 | ||
72 | Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED | 71 | Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED |
73 | New boot loaders: MANDATORY | 72 | New boot loaders: MANDATORY |
74 | 73 | ||
74 | The boot loader must provide either a tagged list or a dtb image for | ||
75 | passing configuration data to the kernel. The physical address of the | ||
76 | boot data is passed to the kernel in register r2. | ||
77 | |||
78 | 4a. Setup the kernel tagged list | ||
79 | -------------------------------- | ||
80 | |||
75 | The boot loader must create and initialise the kernel tagged list. | 81 | The boot loader must create and initialise the kernel tagged list. |
76 | A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. | 82 | A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE. |
77 | The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE tag | 83 | The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE tag |
@@ -101,6 +107,24 @@ The tagged list must be placed in a region of memory where neither | |||
101 | the kernel decompressor nor initrd 'bootp' program will overwrite | 107 | the kernel decompressor nor initrd 'bootp' program will overwrite |
102 | it. The recommended placement is in the first 16KiB of RAM. | 108 | it. The recommended placement is in the first 16KiB of RAM. |
103 | 109 | ||
110 | 4b. Setup the device tree | ||
111 | ------------------------- | ||
112 | |||
113 | The boot loader must load a device tree image (dtb) into system ram | ||
114 | at a 64bit aligned address and initialize it with the boot data. The | ||
115 | dtb format is documented in Documentation/devicetree/booting-without-of.txt. | ||
116 | The kernel will look for the dtb magic value of 0xd00dfeed at the dtb | ||
117 | physical address to determine if a dtb has been passed instead of a | ||
118 | tagged list. | ||
119 | |||
120 | The boot loader must pass at a minimum the size and location of the | ||
121 | system memory, and the root filesystem location. The dtb must be | ||
122 | placed in a region of memory where the kernel decompressor will not | ||
123 | overwrite it. The recommended placement is in the first 16KiB of RAM | ||
124 | with the caveat that it may not be located at physical address 0 since | ||
125 | the kernel interprets a value of 0 in r2 to mean neither a tagged list | ||
126 | nor a dtb were passed. | ||
127 | |||
104 | 5. Calling the kernel image | 128 | 5. Calling the kernel image |
105 | --------------------------- | 129 | --------------------------- |
106 | 130 | ||
@@ -125,7 +149,8 @@ In either case, the following conditions must be met: | |||
125 | - CPU register settings | 149 | - CPU register settings |
126 | r0 = 0, | 150 | r0 = 0, |
127 | r1 = machine type number discovered in (3) above. | 151 | r1 = machine type number discovered in (3) above. |
128 | r2 = physical address of tagged list in system RAM. | 152 | r2 = physical address of tagged list in system RAM, or |
153 | physical address of device tree block (dtb) in system RAM | ||
129 | 154 | ||
130 | - CPU mode | 155 | - CPU mode |
131 | All forms of interrupts must be disabled (IRQs and FIQs) | 156 | All forms of interrupts must be disabled (IRQs and FIQs) |
diff --git a/Documentation/device-mapper/dm-crypt.txt b/Documentation/device-mapper/dm-crypt.txt index ddeb749c550..6b5c42dbbe8 100644 --- a/Documentation/device-mapper/dm-crypt.txt +++ b/Documentation/device-mapper/dm-crypt.txt | |||
@@ -8,7 +8,7 @@ Parameters: <cipher> <key> <iv_offset> <device path> <offset> | |||
8 | 8 | ||
9 | <cipher> | 9 | <cipher> |
10 | Encryption cipher and an optional IV generation mode. | 10 | Encryption cipher and an optional IV generation mode. |
11 | (In format cipher-chainmode-ivopts:ivmode). | 11 | (In format cipher[:keycount]-chainmode-ivopts:ivmode). |
12 | Examples: | 12 | Examples: |
13 | des | 13 | des |
14 | aes-cbc-essiv:sha256 | 14 | aes-cbc-essiv:sha256 |
@@ -20,6 +20,11 @@ Parameters: <cipher> <key> <iv_offset> <device path> <offset> | |||
20 | Key used for encryption. It is encoded as a hexadecimal number. | 20 | Key used for encryption. It is encoded as a hexadecimal number. |
21 | You can only use key sizes that are valid for the selected cipher. | 21 | You can only use key sizes that are valid for the selected cipher. |
22 | 22 | ||
23 | <keycount> | ||
24 | Multi-key compatibility mode. You can define <keycount> keys and | ||
25 | then sectors are encrypted according to their offsets (sector 0 uses key0; | ||
26 | sector 1 uses key1 etc.). <keycount> must be a power of two. | ||
27 | |||
23 | <iv_offset> | 28 | <iv_offset> |
24 | The IV offset is a sector count that is added to the sector number | 29 | The IV offset is a sector count that is added to the sector number |
25 | before creating the IV. | 30 | before creating the IV. |
diff --git a/Documentation/device-mapper/dm-raid.txt b/Documentation/device-mapper/dm-raid.txt new file mode 100644 index 00000000000..33b6b7071ac --- /dev/null +++ b/Documentation/device-mapper/dm-raid.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | Device-mapper RAID (dm-raid) is a bridge from DM to MD. It | ||
2 | provides a way to use device-mapper interfaces to access the MD RAID | ||
3 | drivers. | ||
4 | |||
5 | As with all device-mapper targets, the nominal public interfaces are the | ||
6 | constructor (CTR) tables and the status outputs (both STATUSTYPE_INFO | ||
7 | and STATUSTYPE_TABLE). The CTR table looks like the following: | ||
8 | |||
9 | 1: <s> <l> raid \ | ||
10 | 2: <raid_type> <#raid_params> <raid_params> \ | ||
11 | 3: <#raid_devs> <meta_dev1> <dev1> .. <meta_devN> <devN> | ||
12 | |||
13 | Line 1 contains the standard first three arguments to any device-mapper | ||
14 | target - the start, length, and target type fields. The target type in | ||
15 | this case is "raid". | ||
16 | |||
17 | Line 2 contains the arguments that define the particular raid | ||
18 | type/personality/level, the required arguments for that raid type, and | ||
19 | any optional arguments. Possible raid types include: raid4, raid5_la, | ||
20 | raid5_ls, raid5_rs, raid6_zr, raid6_nr, and raid6_nc. (raid1 is | ||
21 | planned for the future.) The list of required and optional parameters | ||
22 | is the same for all the current raid types. The required parameters are | ||
23 | positional, while the optional parameters are given as key/value pairs. | ||
24 | The possible parameters are as follows: | ||
25 | <chunk_size> Chunk size in sectors. | ||
26 | [[no]sync] Force/Prevent RAID initialization | ||
27 | [rebuild <idx>] Rebuild the drive indicated by the index | ||
28 | [daemon_sleep <ms>] Time between bitmap daemon work to clear bits | ||
29 | [min_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
30 | [max_recovery_rate <kB/sec/disk>] Throttle RAID initialization | ||
31 | [max_write_behind <sectors>] See '-write-behind=' (man mdadm) | ||
32 | [stripe_cache <sectors>] Stripe cache size for higher RAIDs | ||
33 | |||
34 | Line 3 contains the list of devices that compose the array in | ||
35 | metadata/data device pairs. If the metadata is stored separately, a '-' | ||
36 | is given for the metadata device position. If a drive has failed or is | ||
37 | missing at creation time, a '-' can be given for both the metadata and | ||
38 | data drives for a given position. | ||
39 | |||
40 | NB. Currently all metadata devices must be specified as '-'. | ||
41 | |||
42 | Examples: | ||
43 | # RAID4 - 4 data drives, 1 parity | ||
44 | # No metadata devices specified to hold superblock/bitmap info | ||
45 | # Chunk size of 1MiB | ||
46 | # (Lines separated for easy reading) | ||
47 | 0 1960893648 raid \ | ||
48 | raid4 1 2048 \ | ||
49 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | ||
50 | |||
51 | # RAID4 - 4 data drives, 1 parity (no metadata devices) | ||
52 | # Chunk size of 1MiB, force RAID initialization, | ||
53 | # min recovery rate at 20 kiB/sec/disk | ||
54 | 0 1960893648 raid \ | ||
55 | raid4 4 2048 min_recovery_rate 20 sync\ | ||
56 | 5 - 8:17 - 8:33 - 8:49 - 8:65 - 8:81 | ||
57 | |||
58 | Performing a 'dmsetup table' should display the CTR table used to | ||
59 | construct the mapping (with possible reordering of optional | ||
60 | parameters). | ||
61 | |||
62 | Performing a 'dmsetup status' will yield information on the state and | ||
63 | health of the array. The output is as follows: | ||
64 | 1: <s> <l> raid \ | ||
65 | 2: <raid_type> <#devices> <1 health char for each dev> <resync_ratio> | ||
66 | |||
67 | Line 1 is standard DM output. Line 2 is best shown by example: | ||
68 | 0 1960893648 raid raid4 5 AAAAA 2/490221568 | ||
69 | Here we can see the RAID type is raid4, there are 5 devices - all of | ||
70 | which are 'A'live, and the array is 2/490221568 complete with recovery. | ||
diff --git a/Documentation/powerpc/dts-bindings/fsl/sata.txt b/Documentation/devicetree/bindings/ata/fsl-sata.txt index b46bcf46c3d..b46bcf46c3d 100644 --- a/Documentation/powerpc/dts-bindings/fsl/sata.txt +++ b/Documentation/devicetree/bindings/ata/fsl-sata.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/eeprom.txt b/Documentation/devicetree/bindings/eeprom.txt index 4342c10de1b..4342c10de1b 100644 --- a/Documentation/powerpc/dts-bindings/eeprom.txt +++ b/Documentation/devicetree/bindings/eeprom.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt index b0019eb5330..b0019eb5330 100644 --- a/Documentation/powerpc/dts-bindings/fsl/8xxx_gpio.txt +++ b/Documentation/devicetree/bindings/gpio/8xxx_gpio.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index edaa84d288a..edaa84d288a 100644 --- a/Documentation/powerpc/dts-bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/gpio/led.txt b/Documentation/devicetree/bindings/gpio/led.txt index 064db928c3c..064db928c3c 100644 --- a/Documentation/powerpc/dts-bindings/gpio/led.txt +++ b/Documentation/devicetree/bindings/gpio/led.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/devicetree/bindings/i2c/fsl-i2c.txt index 1eacd6b20ed..1eacd6b20ed 100644 --- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt +++ b/Documentation/devicetree/bindings/i2c/fsl-i2c.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/marvell.txt b/Documentation/devicetree/bindings/marvell.txt index f1533d91953..f1533d91953 100644 --- a/Documentation/powerpc/dts-bindings/marvell.txt +++ b/Documentation/devicetree/bindings/marvell.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt index 64bcb8be973..64bcb8be973 100644 --- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt +++ b/Documentation/devicetree/bindings/mmc/fsl-esdhc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt index c39ac289195..c39ac289195 100644 --- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt +++ b/Documentation/devicetree/bindings/mmc/mmc-spi-slot.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt index a48b2cadc7f..a48b2cadc7f 100644 --- a/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt +++ b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/mtd-physmap.txt b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt index 80152cb567d..80152cb567d 100644 --- a/Documentation/powerpc/dts-bindings/mtd-physmap.txt +++ b/Documentation/devicetree/bindings/mtd/mtd-physmap.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/can.txt b/Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt index 2fa4fcd38fd..2fa4fcd38fd 100644 --- a/Documentation/powerpc/dts-bindings/fsl/can.txt +++ b/Documentation/devicetree/bindings/net/can/mpc5xxx-mscan.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/can/sja1000.txt b/Documentation/devicetree/bindings/net/can/sja1000.txt index d6d209ded93..d6d209ded93 100644 --- a/Documentation/powerpc/dts-bindings/can/sja1000.txt +++ b/Documentation/devicetree/bindings/net/can/sja1000.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/tsec.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt index edb7ae19e86..edb7ae19e86 100644 --- a/Documentation/powerpc/dts-bindings/fsl/tsec.txt +++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/gpio/mdio.txt b/Documentation/devicetree/bindings/net/mdio-gpio.txt index bc954952901..bc954952901 100644 --- a/Documentation/powerpc/dts-bindings/gpio/mdio.txt +++ b/Documentation/devicetree/bindings/net/mdio-gpio.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/phy.txt b/Documentation/devicetree/bindings/net/phy.txt index bb8c742eb8c..bb8c742eb8c 100644 --- a/Documentation/powerpc/dts-bindings/phy.txt +++ b/Documentation/devicetree/bindings/net/phy.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt b/Documentation/devicetree/bindings/pci/83xx-512x-pci.txt index 35a46536240..35a46536240 100644 --- a/Documentation/powerpc/dts-bindings/fsl/83xx-512x-pci.txt +++ b/Documentation/devicetree/bindings/pci/83xx-512x-pci.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/4xx/cpm.txt b/Documentation/devicetree/bindings/powerpc/4xx/cpm.txt index ee459806d35..ee459806d35 100644 --- a/Documentation/powerpc/dts-bindings/4xx/cpm.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/cpm.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/4xx/emac.txt b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt index 2161334a7ca..2161334a7ca 100644 --- a/Documentation/powerpc/dts-bindings/4xx/emac.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/emac.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/4xx/ndfc.txt b/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt index 869f0b5f16e..869f0b5f16e 100644 --- a/Documentation/powerpc/dts-bindings/4xx/ndfc.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt b/Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt index 515ebcf1b97..515ebcf1b97 100644 --- a/Documentation/powerpc/dts-bindings/4xx/ppc440spe-adma.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/ppc440spe-adma.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/4xx/reboot.txt b/Documentation/devicetree/bindings/powerpc/4xx/reboot.txt index d7217260589..d7217260589 100644 --- a/Documentation/powerpc/dts-bindings/4xx/reboot.txt +++ b/Documentation/devicetree/bindings/powerpc/4xx/reboot.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/board.txt b/Documentation/devicetree/bindings/powerpc/fsl/board.txt index 39e941515a3..39e941515a3 100644 --- a/Documentation/powerpc/dts-bindings/fsl/board.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/board.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt index 160c752484b..160c752484b 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt index 4c7d45eaf02..4c7d45eaf02 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/brg.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt index 87bc6048667..87bc6048667 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/i2c.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt index 8e3ee168161..8e3ee168161 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/pic.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt index 74bfda4bb82..74bfda4bb82 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/cpm/usb.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt index 349f79fd707..349f79fd707 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt index 0e426944658..0e426944658 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/network.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt index 4f8930263dd..4f8930263dd 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt index 249db3a15d1..249db3a15d1 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/firmware.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt index 60984260207..60984260207 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/par_io.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt index c5b43061db3..c5b43061db3 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/pincfg.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt index e47734bee3f..e47734bee3f 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/ucc.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt index 9ccd5f30405..9ccd5f30405 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe/usb.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt index 2ea76d9d137..2ea76d9d137 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/serial.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/diu.txt b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt index b66cb6d31d6..b66cb6d31d6 100644 --- a/Documentation/powerpc/dts-bindings/fsl/diu.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/diu.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/dma.txt b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt index 2a4b4bce611..2a4b4bce611 100644 --- a/Documentation/powerpc/dts-bindings/fsl/dma.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/dma.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/ecm.txt b/Documentation/devicetree/bindings/powerpc/fsl/ecm.txt index f514f29c67d..f514f29c67d 100644 --- a/Documentation/powerpc/dts-bindings/ecm.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/ecm.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/gtm.txt b/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt index 9a33efded4b..9a33efded4b 100644 --- a/Documentation/powerpc/dts-bindings/fsl/gtm.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/guts.txt b/Documentation/devicetree/bindings/powerpc/fsl/guts.txt index 9e7a2417dac..9e7a2417dac 100644 --- a/Documentation/powerpc/dts-bindings/fsl/guts.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/guts.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/lbc.txt b/Documentation/devicetree/bindings/powerpc/fsl/lbc.txt index 3300fec501c..3300fec501c 100644 --- a/Documentation/powerpc/dts-bindings/fsl/lbc.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/lbc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcm.txt b/Documentation/devicetree/bindings/powerpc/fsl/mcm.txt index 4ceda9b3b41..4ceda9b3b41 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mcm.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/mcm.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt b/Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt index 0f766333b6e..0f766333b6e 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/mcu-mpc8349emitx.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt index 8832e879891..8832e879891 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/mpc5121-psc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt index 4ccb2cd5df9..4ccb2cd5df9 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mpc5200.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/mpc5200.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/mpic.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt index 71e39cf3215..71e39cf3215 100644 --- a/Documentation/powerpc/dts-bindings/fsl/mpic.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/mpic.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt index bcc30bac683..bcc30bac683 100644 --- a/Documentation/powerpc/dts-bindings/fsl/msi-pic.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/pmc.txt b/Documentation/devicetree/bindings/powerpc/fsl/pmc.txt index 07256b7ffca..07256b7ffca 100644 --- a/Documentation/powerpc/dts-bindings/fsl/pmc.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/pmc.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/sec.txt b/Documentation/devicetree/bindings/powerpc/fsl/sec.txt index 2b6f2d45c45..2b6f2d45c45 100644 --- a/Documentation/powerpc/dts-bindings/fsl/sec.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/sec.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/ssi.txt b/Documentation/devicetree/bindings/powerpc/fsl/ssi.txt index 5ff76c9c57d..5ff76c9c57d 100644 --- a/Documentation/powerpc/dts-bindings/fsl/ssi.txt +++ b/Documentation/devicetree/bindings/powerpc/fsl/ssi.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt b/Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt index b558585b1aa..b558585b1aa 100644 --- a/Documentation/powerpc/dts-bindings/nintendo/gamecube.txt +++ b/Documentation/devicetree/bindings/powerpc/nintendo/gamecube.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/nintendo/wii.txt b/Documentation/devicetree/bindings/powerpc/nintendo/wii.txt index a7e155a023b..a7e155a023b 100644 --- a/Documentation/powerpc/dts-bindings/nintendo/wii.txt +++ b/Documentation/devicetree/bindings/powerpc/nintendo/wii.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt b/Documentation/devicetree/bindings/spi/fsl-spi.txt index 777abd7399d..777abd7399d 100644 --- a/Documentation/powerpc/dts-bindings/fsl/spi.txt +++ b/Documentation/devicetree/bindings/spi/fsl-spi.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index e782add2e45..e782add2e45 100644 --- a/Documentation/powerpc/dts-bindings/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/fsl/usb.txt b/Documentation/devicetree/bindings/usb/fsl-usb.txt index bd5723f0b67..bd5723f0b67 100644 --- a/Documentation/powerpc/dts-bindings/fsl/usb.txt +++ b/Documentation/devicetree/bindings/usb/fsl-usb.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt index fa18612f757..fa18612f757 100644 --- a/Documentation/powerpc/dts-bindings/usb-ehci.txt +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt | |||
diff --git a/Documentation/powerpc/dts-bindings/xilinx.txt b/Documentation/devicetree/bindings/xilinx.txt index 299d0923537..299d0923537 100644 --- a/Documentation/powerpc/dts-bindings/xilinx.txt +++ b/Documentation/devicetree/bindings/xilinx.txt | |||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt index 7400d7555dc..9381a148102 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/devicetree/booting-without-of.txt | |||
@@ -13,7 +13,7 @@ Table of Contents | |||
13 | 13 | ||
14 | I - Introduction | 14 | I - Introduction |
15 | 1) Entry point for arch/powerpc | 15 | 1) Entry point for arch/powerpc |
16 | 2) Board support | 16 | 2) Entry point for arch/arm |
17 | 17 | ||
18 | II - The DT block format | 18 | II - The DT block format |
19 | 1) Header | 19 | 1) Header |
@@ -41,13 +41,6 @@ Table of Contents | |||
41 | VI - System-on-a-chip devices and nodes | 41 | VI - System-on-a-chip devices and nodes |
42 | 1) Defining child nodes of an SOC | 42 | 1) Defining child nodes of an SOC |
43 | 2) Representing devices without a current OF specification | 43 | 2) Representing devices without a current OF specification |
44 | a) PHY nodes | ||
45 | b) Interrupt controllers | ||
46 | c) 4xx/Axon EMAC ethernet nodes | ||
47 | d) Xilinx IP cores | ||
48 | e) USB EHCI controllers | ||
49 | f) MDIO on GPIOs | ||
50 | g) SPI busses | ||
51 | 44 | ||
52 | VII - Specifying interrupt information for devices | 45 | VII - Specifying interrupt information for devices |
53 | 1) interrupts property | 46 | 1) interrupts property |
@@ -123,7 +116,7 @@ Revision Information | |||
123 | I - Introduction | 116 | I - Introduction |
124 | ================ | 117 | ================ |
125 | 118 | ||
126 | During the recent development of the Linux/ppc64 kernel, and more | 119 | During the development of the Linux/ppc64 kernel, and more |
127 | specifically, the addition of new platform types outside of the old | 120 | specifically, the addition of new platform types outside of the old |
128 | IBM pSeries/iSeries pair, it was decided to enforce some strict rules | 121 | IBM pSeries/iSeries pair, it was decided to enforce some strict rules |
129 | regarding the kernel entry and bootloader <-> kernel interfaces, in | 122 | regarding the kernel entry and bootloader <-> kernel interfaces, in |
@@ -146,7 +139,7 @@ section III, but, for example, the kernel does not require you to | |||
146 | create a node for every PCI device in the system. It is a requirement | 139 | create a node for every PCI device in the system. It is a requirement |
147 | to have a node for PCI host bridges in order to provide interrupt | 140 | to have a node for PCI host bridges in order to provide interrupt |
148 | routing informations and memory/IO ranges, among others. It is also | 141 | routing informations and memory/IO ranges, among others. It is also |
149 | recommended to define nodes for on chip devices and other busses that | 142 | recommended to define nodes for on chip devices and other buses that |
150 | don't specifically fit in an existing OF specification. This creates a | 143 | don't specifically fit in an existing OF specification. This creates a |
151 | great flexibility in the way the kernel can then probe those and match | 144 | great flexibility in the way the kernel can then probe those and match |
152 | drivers to device, without having to hard code all sorts of tables. It | 145 | drivers to device, without having to hard code all sorts of tables. It |
@@ -158,7 +151,7 @@ it with special cases. | |||
158 | 1) Entry point for arch/powerpc | 151 | 1) Entry point for arch/powerpc |
159 | ------------------------------- | 152 | ------------------------------- |
160 | 153 | ||
161 | There is one and one single entry point to the kernel, at the start | 154 | There is one single entry point to the kernel, at the start |
162 | of the kernel image. That entry point supports two calling | 155 | of the kernel image. That entry point supports two calling |
163 | conventions: | 156 | conventions: |
164 | 157 | ||
@@ -210,12 +203,6 @@ it with special cases. | |||
210 | with all CPUs. The way to do that with method b) will be | 203 | with all CPUs. The way to do that with method b) will be |
211 | described in a later revision of this document. | 204 | described in a later revision of this document. |
212 | 205 | ||
213 | |||
214 | 2) Board support | ||
215 | ---------------- | ||
216 | |||
217 | 64-bit kernels: | ||
218 | |||
219 | Board supports (platforms) are not exclusive config options. An | 206 | Board supports (platforms) are not exclusive config options. An |
220 | arbitrary set of board supports can be built in a single kernel | 207 | arbitrary set of board supports can be built in a single kernel |
221 | image. The kernel will "know" what set of functions to use for a | 208 | image. The kernel will "know" what set of functions to use for a |
@@ -234,47 +221,49 @@ it with special cases. | |||
234 | containing the various callbacks that the generic code will | 221 | containing the various callbacks that the generic code will |
235 | use to get to your platform specific code | 222 | use to get to your platform specific code |
236 | 223 | ||
237 | c) Add a reference to your "ppc_md" structure in the | 224 | A kernel image may support multiple platforms, but only if the |
238 | "machines" table in arch/powerpc/kernel/setup_64.c if you are | ||
239 | a 64-bit platform. | ||
240 | |||
241 | d) request and get assigned a platform number (see PLATFORM_* | ||
242 | constants in arch/powerpc/include/asm/processor.h | ||
243 | |||
244 | 32-bit embedded kernels: | ||
245 | |||
246 | Currently, board support is essentially an exclusive config option. | ||
247 | The kernel is configured for a single platform. Part of the reason | ||
248 | for this is to keep kernels on embedded systems small and efficient; | ||
249 | part of this is due to the fact the code is already that way. In the | ||
250 | future, a kernel may support multiple platforms, but only if the | ||
251 | platforms feature the same core architecture. A single kernel build | 225 | platforms feature the same core architecture. A single kernel build |
252 | cannot support both configurations with Book E and configurations | 226 | cannot support both configurations with Book E and configurations |
253 | with classic Powerpc architectures. | 227 | with classic Powerpc architectures. |
254 | 228 | ||
255 | 32-bit embedded platforms that are moved into arch/powerpc using a | 229 | 2) Entry point for arch/arm |
256 | flattened device tree should adopt the merged tree practice of | 230 | --------------------------- |
257 | setting ppc_md up dynamically, even though the kernel is currently | 231 | |
258 | built with support for only a single platform at a time. This allows | 232 | There is one single entry point to the kernel, at the start |
259 | unification of the setup code, and will make it easier to go to a | 233 | of the kernel image. That entry point supports two calling |
260 | multiple-platform-support model in the future. | 234 | conventions. A summary of the interface is described here. A full |
235 | description of the boot requirements is documented in | ||
236 | Documentation/arm/Booting | ||
237 | |||
238 | a) ATAGS interface. Minimal information is passed from firmware | ||
239 | to the kernel with a tagged list of predefined parameters. | ||
240 | |||
241 | r0 : 0 | ||
242 | |||
243 | r1 : Machine type number | ||
261 | 244 | ||
262 | NOTE: I believe the above will be true once Ben's done with the merge | 245 | r2 : Physical address of tagged list in system RAM |
263 | of the boot sequences.... someone speak up if this is wrong! | ||
264 | 246 | ||
265 | To add a 32-bit embedded platform support, follow the instructions | 247 | b) Entry with a flattened device-tree block. Firmware loads the |
266 | for 64-bit platforms above, with the exception that the Kconfig | 248 | physical address of the flattened device tree block (dtb) into r2, |
267 | option should be set up such that the kernel builds exclusively for | 249 | r1 is not used, but it is considered good practise to use a valid |
268 | the platform selected. The processor type for the platform should | 250 | machine number as described in Documentation/arm/Booting. |
269 | enable another config option to select the specific board | ||
270 | supported. | ||
271 | 251 | ||
272 | NOTE: If Ben doesn't merge the setup files, may need to change this to | 252 | r0 : 0 |
273 | point to setup_32.c | ||
274 | 253 | ||
254 | r1 : Valid machine type number. When using a device tree, | ||
255 | a single machine type number will often be assigned to | ||
256 | represent a class or family of SoCs. | ||
275 | 257 | ||
276 | I will describe later the boot process and various callbacks that | 258 | r2 : physical pointer to the device-tree block |
277 | your platform should implement. | 259 | (defined in chapter II) in RAM. Device tree can be located |
260 | anywhere in system RAM, but it should be aligned on a 32 bit | ||
261 | boundary. | ||
262 | |||
263 | The kernel will differentiate between ATAGS and device tree booting by | ||
264 | reading the memory pointed to by r1 and looking for either the flattened | ||
265 | device tree block magic value (0xd00dfeed) or the ATAG_CORE value at | ||
266 | offset 0x4 from r2 (0x54410001). | ||
278 | 267 | ||
279 | 268 | ||
280 | II - The DT block format | 269 | II - The DT block format |
@@ -300,8 +289,8 @@ the block to RAM before passing it to the kernel. | |||
300 | 1) Header | 289 | 1) Header |
301 | --------- | 290 | --------- |
302 | 291 | ||
303 | The kernel is entered with r3 pointing to an area of memory that is | 292 | The kernel is passed the physical address pointing to an area of memory |
304 | roughly described in arch/powerpc/include/asm/prom.h by the structure | 293 | that is roughly described in include/linux/of_fdt.h by the structure |
305 | boot_param_header: | 294 | boot_param_header: |
306 | 295 | ||
307 | struct boot_param_header { | 296 | struct boot_param_header { |
@@ -339,7 +328,7 @@ struct boot_param_header { | |||
339 | All values in this header are in big endian format, the various | 328 | All values in this header are in big endian format, the various |
340 | fields in this header are defined more precisely below. All | 329 | fields in this header are defined more precisely below. All |
341 | "offset" values are in bytes from the start of the header; that is | 330 | "offset" values are in bytes from the start of the header; that is |
342 | from the value of r3. | 331 | from the physical base address of the device tree block. |
343 | 332 | ||
344 | - magic | 333 | - magic |
345 | 334 | ||
@@ -437,7 +426,7 @@ struct boot_param_header { | |||
437 | 426 | ||
438 | 427 | ||
439 | ------------------------------ | 428 | ------------------------------ |
440 | r3 -> | struct boot_param_header | | 429 | base -> | struct boot_param_header | |
441 | ------------------------------ | 430 | ------------------------------ |
442 | | (alignment gap) (*) | | 431 | | (alignment gap) (*) | |
443 | ------------------------------ | 432 | ------------------------------ |
@@ -457,7 +446,7 @@ struct boot_param_header { | |||
457 | -----> ------------------------------ | 446 | -----> ------------------------------ |
458 | | | 447 | | |
459 | | | 448 | | |
460 | --- (r3 + totalsize) | 449 | --- (base + totalsize) |
461 | 450 | ||
462 | (*) The alignment gaps are not necessarily present; their presence | 451 | (*) The alignment gaps are not necessarily present; their presence |
463 | and size are dependent on the various alignment requirements of | 452 | and size are dependent on the various alignment requirements of |
@@ -500,7 +489,7 @@ the device-tree structure. It is typically used to represent "path" in | |||
500 | the device-tree. More details about the actual format of these will be | 489 | the device-tree. More details about the actual format of these will be |
501 | below. | 490 | below. |
502 | 491 | ||
503 | The kernel powerpc generic code does not make any formal use of the | 492 | The kernel generic code does not make any formal use of the |
504 | unit address (though some board support code may do) so the only real | 493 | unit address (though some board support code may do) so the only real |
505 | requirement here for the unit address is to ensure uniqueness of | 494 | requirement here for the unit address is to ensure uniqueness of |
506 | the node unit name at a given level of the tree. Nodes with no notion | 495 | the node unit name at a given level of the tree. Nodes with no notion |
@@ -518,20 +507,21 @@ path to the root node is "/". | |||
518 | 507 | ||
519 | Every node which actually represents an actual device (that is, a node | 508 | Every node which actually represents an actual device (that is, a node |
520 | which isn't only a virtual "container" for more nodes, like "/cpus" | 509 | which isn't only a virtual "container" for more nodes, like "/cpus" |
521 | is) is also required to have a "device_type" property indicating the | 510 | is) is also required to have a "compatible" property indicating the |
522 | type of node . | 511 | specific hardware and an optional list of devices it is fully |
512 | backwards compatible with. | ||
523 | 513 | ||
524 | Finally, every node that can be referenced from a property in another | 514 | Finally, every node that can be referenced from a property in another |
525 | node is required to have a "linux,phandle" property. Real open | 515 | node is required to have either a "phandle" or a "linux,phandle" |
526 | firmware implementations provide a unique "phandle" value for every | 516 | property. Real Open Firmware implementations provide a unique |
527 | node that the "prom_init()" trampoline code turns into | 517 | "phandle" value for every node that the "prom_init()" trampoline code |
528 | "linux,phandle" properties. However, this is made optional if the | 518 | turns into "linux,phandle" properties. However, this is made optional |
529 | flattened device tree is used directly. An example of a node | 519 | if the flattened device tree is used directly. An example of a node |
530 | referencing another node via "phandle" is when laying out the | 520 | referencing another node via "phandle" is when laying out the |
531 | interrupt tree which will be described in a further version of this | 521 | interrupt tree which will be described in a further version of this |
532 | document. | 522 | document. |
533 | 523 | ||
534 | This "linux, phandle" property is a 32-bit value that uniquely | 524 | The "phandle" property is a 32-bit value that uniquely |
535 | identifies a node. You are free to use whatever values or system of | 525 | identifies a node. You are free to use whatever values or system of |
536 | values, internal pointers, or whatever to generate these, the only | 526 | values, internal pointers, or whatever to generate these, the only |
537 | requirement is that every node for which you provide that property has | 527 | requirement is that every node for which you provide that property has |
@@ -694,7 +684,7 @@ made of 3 cells, the bottom two containing the actual address itself | |||
694 | while the top cell contains address space indication, flags, and pci | 684 | while the top cell contains address space indication, flags, and pci |
695 | bus & device numbers. | 685 | bus & device numbers. |
696 | 686 | ||
697 | For busses that support dynamic allocation, it's the accepted practice | 687 | For buses that support dynamic allocation, it's the accepted practice |
698 | to then not provide the address in "reg" (keep it 0) though while | 688 | to then not provide the address in "reg" (keep it 0) though while |
699 | providing a flag indicating the address is dynamically allocated, and | 689 | providing a flag indicating the address is dynamically allocated, and |
700 | then, to provide a separate "assigned-addresses" property that | 690 | then, to provide a separate "assigned-addresses" property that |
@@ -711,7 +701,7 @@ prom_parse.c file of the recent kernels for your bus type. | |||
711 | The "reg" property only defines addresses and sizes (if #size-cells is | 701 | The "reg" property only defines addresses and sizes (if #size-cells is |
712 | non-0) within a given bus. In order to translate addresses upward | 702 | non-0) within a given bus. In order to translate addresses upward |
713 | (that is into parent bus addresses, and possibly into CPU physical | 703 | (that is into parent bus addresses, and possibly into CPU physical |
714 | addresses), all busses must contain a "ranges" property. If the | 704 | addresses), all buses must contain a "ranges" property. If the |
715 | "ranges" property is missing at a given level, it's assumed that | 705 | "ranges" property is missing at a given level, it's assumed that |
716 | translation isn't possible, i.e., the registers are not visible on the | 706 | translation isn't possible, i.e., the registers are not visible on the |
717 | parent bus. The format of the "ranges" property for a bus is a list | 707 | parent bus. The format of the "ranges" property for a bus is a list |
@@ -727,9 +717,9 @@ example, for a PCI host controller, that would be a CPU address. For a | |||
727 | PCI<->ISA bridge, that would be a PCI address. It defines the base | 717 | PCI<->ISA bridge, that would be a PCI address. It defines the base |
728 | address in the parent bus where the beginning of that range is mapped. | 718 | address in the parent bus where the beginning of that range is mapped. |
729 | 719 | ||
730 | For a new 64-bit powerpc board, I recommend either the 2/2 format or | 720 | For new 64-bit board support, I recommend either the 2/2 format or |
731 | Apple's 2/1 format which is slightly more compact since sizes usually | 721 | Apple's 2/1 format which is slightly more compact since sizes usually |
732 | fit in a single 32-bit word. New 32-bit powerpc boards should use a | 722 | fit in a single 32-bit word. New 32-bit board support should use a |
733 | 1/1 format, unless the processor supports physical addresses greater | 723 | 1/1 format, unless the processor supports physical addresses greater |
734 | than 32-bits, in which case a 2/1 format is recommended. | 724 | than 32-bits, in which case a 2/1 format is recommended. |
735 | 725 | ||
@@ -754,7 +744,7 @@ of their actual names. | |||
754 | While earlier users of Open Firmware like OldWorld macintoshes tended | 744 | While earlier users of Open Firmware like OldWorld macintoshes tended |
755 | to use the actual device name for the "name" property, it's nowadays | 745 | to use the actual device name for the "name" property, it's nowadays |
756 | considered a good practice to use a name that is closer to the device | 746 | considered a good practice to use a name that is closer to the device |
757 | class (often equal to device_type). For example, nowadays, ethernet | 747 | class (often equal to device_type). For example, nowadays, Ethernet |
758 | controllers are named "ethernet", an additional "model" property | 748 | controllers are named "ethernet", an additional "model" property |
759 | defining precisely the chip type/model, and "compatible" property | 749 | defining precisely the chip type/model, and "compatible" property |
760 | defining the family in case a single driver can driver more than one | 750 | defining the family in case a single driver can driver more than one |
@@ -772,7 +762,7 @@ is present). | |||
772 | 4) Note about node and property names and character set | 762 | 4) Note about node and property names and character set |
773 | ------------------------------------------------------- | 763 | ------------------------------------------------------- |
774 | 764 | ||
775 | While open firmware provides more flexible usage of 8859-1, this | 765 | While Open Firmware provides more flexible usage of 8859-1, this |
776 | specification enforces more strict rules. Nodes and properties should | 766 | specification enforces more strict rules. Nodes and properties should |
777 | be comprised only of ASCII characters 'a' to 'z', '0' to | 767 | be comprised only of ASCII characters 'a' to 'z', '0' to |
778 | '9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally | 768 | '9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally |
@@ -792,7 +782,7 @@ address which can extend beyond that limit. | |||
792 | -------------------------------- | 782 | -------------------------------- |
793 | These are all that are currently required. However, it is strongly | 783 | These are all that are currently required. However, it is strongly |
794 | recommended that you expose PCI host bridges as documented in the | 784 | recommended that you expose PCI host bridges as documented in the |
795 | PCI binding to open firmware, and your interrupt tree as documented | 785 | PCI binding to Open Firmware, and your interrupt tree as documented |
796 | in OF interrupt tree specification. | 786 | in OF interrupt tree specification. |
797 | 787 | ||
798 | a) The root node | 788 | a) The root node |
@@ -802,20 +792,12 @@ address which can extend beyond that limit. | |||
802 | - model : this is your board name/model | 792 | - model : this is your board name/model |
803 | - #address-cells : address representation for "root" devices | 793 | - #address-cells : address representation for "root" devices |
804 | - #size-cells: the size representation for "root" devices | 794 | - #size-cells: the size representation for "root" devices |
805 | - device_type : This property shouldn't be necessary. However, if | ||
806 | you decide to create a device_type for your root node, make sure it | ||
807 | is _not_ "chrp" unless your platform is a pSeries or PAPR compliant | ||
808 | one for 64-bit, or a CHRP-type machine for 32-bit as this will | ||
809 | matched by the kernel this way. | ||
810 | |||
811 | Additionally, some recommended properties are: | ||
812 | |||
813 | - compatible : the board "family" generally finds its way here, | 795 | - compatible : the board "family" generally finds its way here, |
814 | for example, if you have 2 board models with a similar layout, | 796 | for example, if you have 2 board models with a similar layout, |
815 | that typically get driven by the same platform code in the | 797 | that typically get driven by the same platform code in the |
816 | kernel, you would use a different "model" property but put a | 798 | kernel, you would specify the exact board model in the |
817 | value in "compatible". The kernel doesn't directly use that | 799 | compatible property followed by an entry that represents the SoC |
818 | value but it is generally useful. | 800 | model. |
819 | 801 | ||
820 | The root node is also generally where you add additional properties | 802 | The root node is also generally where you add additional properties |
821 | specific to your board like the serial number if any, that sort of | 803 | specific to your board like the serial number if any, that sort of |
@@ -841,8 +823,11 @@ address which can extend beyond that limit. | |||
841 | 823 | ||
842 | So under /cpus, you are supposed to create a node for every CPU on | 824 | So under /cpus, you are supposed to create a node for every CPU on |
843 | the machine. There is no specific restriction on the name of the | 825 | the machine. There is no specific restriction on the name of the |
844 | CPU, though It's common practice to call it PowerPC,<name>. For | 826 | CPU, though it's common to call it <architecture>,<core>. For |
845 | example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX. | 827 | example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX. |
828 | However, the Generic Names convention suggests that it would be | ||
829 | better to simply use 'cpu' for each cpu node and use the compatible | ||
830 | property to identify the specific cpu core. | ||
846 | 831 | ||
847 | Required properties: | 832 | Required properties: |
848 | 833 | ||
@@ -923,7 +908,7 @@ compatibility. | |||
923 | 908 | ||
924 | e) The /chosen node | 909 | e) The /chosen node |
925 | 910 | ||
926 | This node is a bit "special". Normally, that's where open firmware | 911 | This node is a bit "special". Normally, that's where Open Firmware |
927 | puts some variable environment information, like the arguments, or | 912 | puts some variable environment information, like the arguments, or |
928 | the default input/output devices. | 913 | the default input/output devices. |
929 | 914 | ||
@@ -940,11 +925,7 @@ compatibility. | |||
940 | console device if any. Typically, if you have serial devices on | 925 | console device if any. Typically, if you have serial devices on |
941 | your board, you may want to put the full path to the one set as | 926 | your board, you may want to put the full path to the one set as |
942 | the default console in the firmware here, for the kernel to pick | 927 | the default console in the firmware here, for the kernel to pick |
943 | it up as its own default console. If you look at the function | 928 | it up as its own default console. |
944 | set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see | ||
945 | that the kernel tries to find out the default console and has | ||
946 | knowledge of various types like 8250 serial ports. You may want | ||
947 | to extend this function to add your own. | ||
948 | 929 | ||
949 | Note that u-boot creates and fills in the chosen node for platforms | 930 | Note that u-boot creates and fills in the chosen node for platforms |
950 | that use it. | 931 | that use it. |
@@ -955,23 +936,23 @@ compatibility. | |||
955 | 936 | ||
956 | f) the /soc<SOCname> node | 937 | f) the /soc<SOCname> node |
957 | 938 | ||
958 | This node is used to represent a system-on-a-chip (SOC) and must be | 939 | This node is used to represent a system-on-a-chip (SoC) and must be |
959 | present if the processor is a SOC. The top-level soc node contains | 940 | present if the processor is a SoC. The top-level soc node contains |
960 | information that is global to all devices on the SOC. The node name | 941 | information that is global to all devices on the SoC. The node name |
961 | should contain a unit address for the SOC, which is the base address | 942 | should contain a unit address for the SoC, which is the base address |
962 | of the memory-mapped register set for the SOC. The name of an soc | 943 | of the memory-mapped register set for the SoC. The name of an SoC |
963 | node should start with "soc", and the remainder of the name should | 944 | node should start with "soc", and the remainder of the name should |
964 | represent the part number for the soc. For example, the MPC8540's | 945 | represent the part number for the soc. For example, the MPC8540's |
965 | soc node would be called "soc8540". | 946 | soc node would be called "soc8540". |
966 | 947 | ||
967 | Required properties: | 948 | Required properties: |
968 | 949 | ||
969 | - device_type : Should be "soc" | ||
970 | - ranges : Should be defined as specified in 1) to describe the | 950 | - ranges : Should be defined as specified in 1) to describe the |
971 | translation of SOC addresses for memory mapped SOC registers. | 951 | translation of SoC addresses for memory mapped SoC registers. |
972 | - bus-frequency: Contains the bus frequency for the SOC node. | 952 | - bus-frequency: Contains the bus frequency for the SoC node. |
973 | Typically, the value of this field is filled in by the boot | 953 | Typically, the value of this field is filled in by the boot |
974 | loader. | 954 | loader. |
955 | - compatible : Exact model of the SoC | ||
975 | 956 | ||
976 | 957 | ||
977 | Recommended properties: | 958 | Recommended properties: |
@@ -1155,12 +1136,13 @@ while all this has been defined and implemented. | |||
1155 | 1136 | ||
1156 | - An example of code for iterating nodes & retrieving properties | 1137 | - An example of code for iterating nodes & retrieving properties |
1157 | directly from the flattened tree format can be found in the kernel | 1138 | directly from the flattened tree format can be found in the kernel |
1158 | file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function, | 1139 | file drivers/of/fdt.c. Look at the of_scan_flat_dt() function, |
1159 | its usage in early_init_devtree(), and the corresponding various | 1140 | its usage in early_init_devtree(), and the corresponding various |
1160 | early_init_dt_scan_*() callbacks. That code can be re-used in a | 1141 | early_init_dt_scan_*() callbacks. That code can be re-used in a |
1161 | GPL bootloader, and as the author of that code, I would be happy | 1142 | GPL bootloader, and as the author of that code, I would be happy |
1162 | to discuss possible free licensing to any vendor who wishes to | 1143 | to discuss possible free licensing to any vendor who wishes to |
1163 | integrate all or part of this code into a non-GPL bootloader. | 1144 | integrate all or part of this code into a non-GPL bootloader. |
1145 | (reference needed; who is 'I' here? ---gcl Jan 31, 2011) | ||
1164 | 1146 | ||
1165 | 1147 | ||
1166 | 1148 | ||
@@ -1203,18 +1185,19 @@ MPC8540. | |||
1203 | 2) Representing devices without a current OF specification | 1185 | 2) Representing devices without a current OF specification |
1204 | ---------------------------------------------------------- | 1186 | ---------------------------------------------------------- |
1205 | 1187 | ||
1206 | Currently, there are many devices on SOCs that do not have a standard | 1188 | Currently, there are many devices on SoCs that do not have a standard |
1207 | representation pre-defined as part of the open firmware | 1189 | representation defined as part of the Open Firmware specifications, |
1208 | specifications, mainly because the boards that contain these SOCs are | 1190 | mainly because the boards that contain these SoCs are not currently |
1209 | not currently booted using open firmware. This section contains | 1191 | booted using Open Firmware. Binding documentation for new devices |
1210 | descriptions for the SOC devices for which new nodes have been | 1192 | should be added to the Documentation/devicetree/bindings directory. |
1211 | defined; this list will expand as more and more SOC-containing | 1193 | That directory will expand as device tree support is added to more and |
1212 | platforms are moved over to use the flattened-device-tree model. | 1194 | more SoCs. |
1195 | |||
1213 | 1196 | ||
1214 | VII - Specifying interrupt information for devices | 1197 | VII - Specifying interrupt information for devices |
1215 | =================================================== | 1198 | =================================================== |
1216 | 1199 | ||
1217 | The device tree represents the busses and devices of a hardware | 1200 | The device tree represents the buses and devices of a hardware |
1218 | system in a form similar to the physical bus topology of the | 1201 | system in a form similar to the physical bus topology of the |
1219 | hardware. | 1202 | hardware. |
1220 | 1203 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 6cbbd20534c..b3f35e5f9c9 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -248,6 +248,17 @@ Who: Zhang Rui <rui.zhang@intel.com> | |||
248 | 248 | ||
249 | --------------------------- | 249 | --------------------------- |
250 | 250 | ||
251 | What: CONFIG_ACPI_PROCFS_POWER | ||
252 | When: 2.6.39 | ||
253 | Why: sysfs I/F for ACPI power devices, including AC and Battery, | ||
254 | has been working in upstream kenrel since 2.6.24, Sep 2007. | ||
255 | In 2.6.37, we make the sysfs I/F always built in and this option | ||
256 | disabled by default. | ||
257 | Remove this option and the ACPI power procfs interface in 2.6.39. | ||
258 | Who: Zhang Rui <rui.zhang@intel.com> | ||
259 | |||
260 | --------------------------- | ||
261 | |||
251 | What: /proc/acpi/button | 262 | What: /proc/acpi/button |
252 | When: August 2007 | 263 | When: August 2007 |
253 | Why: /proc/acpi/button has been replaced by events to the input layer | 264 | Why: /proc/acpi/button has been replaced by events to the input layer |
@@ -346,14 +357,6 @@ Who: Dave Jones <davej@redhat.com>, Matthew Garrett <mjg@redhat.com> | |||
346 | 357 | ||
347 | ----------------------------- | 358 | ----------------------------- |
348 | 359 | ||
349 | What: __do_IRQ all in one fits nothing interrupt handler | ||
350 | When: 2.6.32 | ||
351 | Why: __do_IRQ was kept for easy migration to the type flow handlers. | ||
352 | More than two years of migration time is enough. | ||
353 | Who: Thomas Gleixner <tglx@linutronix.de> | ||
354 | |||
355 | ----------------------------- | ||
356 | |||
357 | What: fakephp and associated sysfs files in /sys/bus/pci/slots/ | 360 | What: fakephp and associated sysfs files in /sys/bus/pci/slots/ |
358 | When: 2011 | 361 | When: 2011 |
359 | Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to | 362 | Why: In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to |
@@ -600,3 +603,19 @@ Why: The adm9240, w83792d and w83793 hardware monitoring drivers have | |||
600 | Who: Jean Delvare <khali@linux-fr.org> | 603 | Who: Jean Delvare <khali@linux-fr.org> |
601 | 604 | ||
602 | ---------------------------- | 605 | ---------------------------- |
606 | |||
607 | What: noswapaccount kernel command line parameter | ||
608 | When: 2.6.40 | ||
609 | Why: The original implementation of memsw feature enabled by | ||
610 | CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount | ||
611 | kernel parameter (introduced in 2.6.29-rc1). Later on, this decision | ||
612 | turned out to be not ideal because we cannot have the feature compiled | ||
613 | in and disabled by default and let only interested to enable it | ||
614 | (e.g. general distribution kernels might need it). Therefore we have | ||
615 | added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides | ||
616 | the both possibilities. If we remove noswapaccount we will have | ||
617 | less command line parameters with the same functionality and we | ||
618 | can also cleanup the parameter handling a bit (). | ||
619 | Who: Michal Hocko <mhocko@suse.cz> | ||
620 | |||
621 | ---------------------------- | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 977d8919cc6..4471a416c27 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -19,6 +19,8 @@ prototypes: | |||
19 | void (*d_release)(struct dentry *); | 19 | void (*d_release)(struct dentry *); |
20 | void (*d_iput)(struct dentry *, struct inode *); | 20 | void (*d_iput)(struct dentry *, struct inode *); |
21 | char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen); | 21 | char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen); |
22 | struct vfsmount *(*d_automount)(struct path *path); | ||
23 | int (*d_manage)(struct dentry *, bool); | ||
22 | 24 | ||
23 | locking rules: | 25 | locking rules: |
24 | rename_lock ->d_lock may block rcu-walk | 26 | rename_lock ->d_lock may block rcu-walk |
@@ -29,6 +31,8 @@ d_delete: no yes no no | |||
29 | d_release: no no yes no | 31 | d_release: no no yes no |
30 | d_iput: no no yes no | 32 | d_iput: no no yes no |
31 | d_dname: no no no no | 33 | d_dname: no no no no |
34 | d_automount: no no yes no | ||
35 | d_manage: no no yes (ref-walk) maybe | ||
32 | 36 | ||
33 | --------------------------- inode_operations --------------------------- | 37 | --------------------------- inode_operations --------------------------- |
34 | prototypes: | 38 | prototypes: |
@@ -56,7 +60,6 @@ ata *); | |||
56 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 60 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
57 | int (*removexattr) (struct dentry *, const char *); | 61 | int (*removexattr) (struct dentry *, const char *); |
58 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 62 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
59 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, loff_t len); | ||
60 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); | 63 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); |
61 | 64 | ||
62 | locking rules: | 65 | locking rules: |
@@ -84,7 +87,6 @@ getxattr: no | |||
84 | listxattr: no | 87 | listxattr: no |
85 | removexattr: yes | 88 | removexattr: yes |
86 | truncate_range: yes | 89 | truncate_range: yes |
87 | fallocate: no | ||
88 | fiemap: no | 90 | fiemap: no |
89 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on | 91 | Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on |
90 | victim. | 92 | victim. |
@@ -343,7 +345,6 @@ prototypes: | |||
343 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 345 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
344 | void (*fl_release_private)(struct file_lock *); | 346 | void (*fl_release_private)(struct file_lock *); |
345 | void (*fl_break)(struct file_lock *); /* break_lease callback */ | 347 | void (*fl_break)(struct file_lock *); /* break_lease callback */ |
346 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | ||
347 | int (*fl_change)(struct file_lock **, int); | 348 | int (*fl_change)(struct file_lock **, int); |
348 | 349 | ||
349 | locking rules: | 350 | locking rules: |
@@ -353,7 +354,6 @@ fl_notify: yes no | |||
353 | fl_grant: no no | 354 | fl_grant: no no |
354 | fl_release_private: maybe no | 355 | fl_release_private: maybe no |
355 | fl_break: yes no | 356 | fl_break: yes no |
356 | fl_mylease: yes no | ||
357 | fl_change yes no | 357 | fl_change yes no |
358 | 358 | ||
359 | --------------------------- buffer_head ----------------------------------- | 359 | --------------------------- buffer_head ----------------------------------- |
@@ -435,6 +435,7 @@ prototypes: | |||
435 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, | 435 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, |
436 | size_t, unsigned int); | 436 | size_t, unsigned int); |
437 | int (*setlease)(struct file *, long, struct file_lock **); | 437 | int (*setlease)(struct file *, long, struct file_lock **); |
438 | long (*fallocate)(struct file *, int, loff_t, loff_t); | ||
438 | }; | 439 | }; |
439 | 440 | ||
440 | locking rules: | 441 | locking rules: |
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt index 6ef8cf3bc9a..933bc66ccff 100644 --- a/Documentation/filesystems/ntfs.txt +++ b/Documentation/filesystems/ntfs.txt | |||
@@ -460,6 +460,8 @@ Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. | |||
460 | 2.1.30: | 460 | 2.1.30: |
461 | - Fix writev() (it kept writing the first segment over and over again | 461 | - Fix writev() (it kept writing the first segment over and over again |
462 | instead of moving onto subsequent segments). | 462 | instead of moving onto subsequent segments). |
463 | - Fix crash in ntfs_mft_record_alloc() when mapping the new extent mft | ||
464 | record failed. | ||
463 | 2.1.29: | 465 | 2.1.29: |
464 | - Fix a deadlock when mounting read-write. | 466 | - Fix a deadlock when mounting read-write. |
465 | 2.1.28: | 467 | 2.1.28: |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 266d2059b9b..dfbcd1b00b0 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -365,8 +365,8 @@ must be done in the RCU callback. | |||
365 | [recommended] | 365 | [recommended] |
366 | vfs now tries to do path walking in "rcu-walk mode", which avoids | 366 | vfs now tries to do path walking in "rcu-walk mode", which avoids |
367 | atomic operations and scalability hazards on dentries and inodes (see | 367 | atomic operations and scalability hazards on dentries and inodes (see |
368 | Documentation/filesystems/path-walk.txt). d_hash and d_compare changes (above) | 368 | Documentation/filesystems/path-lookup.txt). d_hash and d_compare changes |
369 | are examples of the changes required to support this. For more complex | 369 | (above) are examples of the changes required to support this. For more complex |
370 | filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so | 370 | filesystem callbacks, the vfs drops out of rcu-walk mode before the fs call, so |
371 | no changes are required to the filesystem. However, this is costly and loses | 371 | no changes are required to the filesystem. However, this is costly and loses |
372 | the benefits of rcu-walk mode. We will begin to add filesystem callbacks that | 372 | the benefits of rcu-walk mode. We will begin to add filesystem callbacks that |
@@ -383,8 +383,8 @@ Documentation/filesystems/vfs.txt for more details. | |||
383 | 383 | ||
384 | permission and check_acl are inode permission checks that are called | 384 | permission and check_acl are inode permission checks that are called |
385 | on many or all directory inodes on the way down a path walk (to check for | 385 | on many or all directory inodes on the way down a path walk (to check for |
386 | exec permission). These must now be rcu-walk aware (flags & IPERM_RCU). See | 386 | exec permission). These must now be rcu-walk aware (flags & IPERM_FLAG_RCU). |
387 | Documentation/filesystems/vfs.txt for more details. | 387 | See Documentation/filesystems/vfs.txt for more details. |
388 | 388 | ||
389 | -- | 389 | -- |
390 | [mandatory] | 390 | [mandatory] |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 9471225212c..23cae6548d3 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -375,6 +375,7 @@ Anonymous: 0 kB | |||
375 | Swap: 0 kB | 375 | Swap: 0 kB |
376 | KernelPageSize: 4 kB | 376 | KernelPageSize: 4 kB |
377 | MMUPageSize: 4 kB | 377 | MMUPageSize: 4 kB |
378 | Locked: 374 kB | ||
378 | 379 | ||
379 | The first of these lines shows the same information as is displayed for the | 380 | The first of these lines shows the same information as is displayed for the |
380 | mapping in /proc/PID/maps. The remaining lines show the size of the mapping | 381 | mapping in /proc/PID/maps. The remaining lines show the size of the mapping |
@@ -670,6 +671,8 @@ varies by architecture and compile options. The following is from a | |||
670 | 671 | ||
671 | > cat /proc/meminfo | 672 | > cat /proc/meminfo |
672 | 673 | ||
674 | The "Locked" indicates whether the mapping is locked in memory or not. | ||
675 | |||
673 | 676 | ||
674 | MemTotal: 16344972 kB | 677 | MemTotal: 16344972 kB |
675 | MemFree: 13634064 kB | 678 | MemFree: 13634064 kB |
@@ -1320,6 +1323,10 @@ scaled linearly with /proc/<pid>/oom_score_adj. | |||
1320 | Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the | 1323 | Writing to /proc/<pid>/oom_score_adj or /proc/<pid>/oom_adj will change the |
1321 | other with its scaled value. | 1324 | other with its scaled value. |
1322 | 1325 | ||
1326 | The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last | ||
1327 | value set by a CAP_SYS_RESOURCE process. To reduce the value any lower | ||
1328 | requires CAP_SYS_RESOURCE. | ||
1329 | |||
1323 | NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see | 1330 | NOTICE: /proc/<pid>/oom_adj is deprecated and will be removed, please see |
1324 | Documentation/feature-removal-schedule.txt. | 1331 | Documentation/feature-removal-schedule.txt. |
1325 | 1332 | ||
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index fbb324e2bd4..94cf97b901d 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -415,8 +415,8 @@ otherwise noted. | |||
415 | permission: called by the VFS to check for access rights on a POSIX-like | 415 | permission: called by the VFS to check for access rights on a POSIX-like |
416 | filesystem. | 416 | filesystem. |
417 | 417 | ||
418 | May be called in rcu-walk mode (flags & IPERM_RCU). If in rcu-walk | 418 | May be called in rcu-walk mode (flags & IPERM_FLAG_RCU). If in rcu-walk |
419 | mode, the filesystem must check the permission without blocking or | 419 | mode, the filesystem must check the permission without blocking or |
420 | storing to the inode. | 420 | storing to the inode. |
421 | 421 | ||
422 | If a situation is encountered that rcu-walk cannot handle, return | 422 | If a situation is encountered that rcu-walk cannot handle, return |
@@ -864,6 +864,8 @@ struct dentry_operations { | |||
864 | void (*d_release)(struct dentry *); | 864 | void (*d_release)(struct dentry *); |
865 | void (*d_iput)(struct dentry *, struct inode *); | 865 | void (*d_iput)(struct dentry *, struct inode *); |
866 | char *(*d_dname)(struct dentry *, char *, int); | 866 | char *(*d_dname)(struct dentry *, char *, int); |
867 | struct vfsmount *(*d_automount)(struct path *); | ||
868 | int (*d_manage)(struct dentry *, bool, bool); | ||
867 | }; | 869 | }; |
868 | 870 | ||
869 | d_revalidate: called when the VFS needs to revalidate a dentry. This | 871 | d_revalidate: called when the VFS needs to revalidate a dentry. This |
@@ -930,6 +932,47 @@ struct dentry_operations { | |||
930 | at the end of the buffer, and returns a pointer to the first char. | 932 | at the end of the buffer, and returns a pointer to the first char. |
931 | dynamic_dname() helper function is provided to take care of this. | 933 | dynamic_dname() helper function is provided to take care of this. |
932 | 934 | ||
935 | d_automount: called when an automount dentry is to be traversed (optional). | ||
936 | This should create a new VFS mount record and return the record to the | ||
937 | caller. The caller is supplied with a path parameter giving the | ||
938 | automount directory to describe the automount target and the parent | ||
939 | VFS mount record to provide inheritable mount parameters. NULL should | ||
940 | be returned if someone else managed to make the automount first. If | ||
941 | the vfsmount creation failed, then an error code should be returned. | ||
942 | If -EISDIR is returned, then the directory will be treated as an | ||
943 | ordinary directory and returned to pathwalk to continue walking. | ||
944 | |||
945 | If a vfsmount is returned, the caller will attempt to mount it on the | ||
946 | mountpoint and will remove the vfsmount from its expiration list in | ||
947 | the case of failure. The vfsmount should be returned with 2 refs on | ||
948 | it to prevent automatic expiration - the caller will clean up the | ||
949 | additional ref. | ||
950 | |||
951 | This function is only used if DCACHE_NEED_AUTOMOUNT is set on the | ||
952 | dentry. This is set by __d_instantiate() if S_AUTOMOUNT is set on the | ||
953 | inode being added. | ||
954 | |||
955 | d_manage: called to allow the filesystem to manage the transition from a | ||
956 | dentry (optional). This allows autofs, for example, to hold up clients | ||
957 | waiting to explore behind a 'mountpoint' whilst letting the daemon go | ||
958 | past and construct the subtree there. 0 should be returned to let the | ||
959 | calling process continue. -EISDIR can be returned to tell pathwalk to | ||
960 | use this directory as an ordinary directory and to ignore anything | ||
961 | mounted on it and not to check the automount flag. Any other error | ||
962 | code will abort pathwalk completely. | ||
963 | |||
964 | If the 'mounting_here' parameter is true, then namespace_sem is being | ||
965 | held by the caller and the function should not initiate any mounts or | ||
966 | unmounts that it will then wait for. | ||
967 | |||
968 | If the 'rcu_walk' parameter is true, then the caller is doing a | ||
969 | pathwalk in RCU-walk mode. Sleeping is not permitted in this mode, | ||
970 | and the caller can be asked to leave it and call again by returing | ||
971 | -ECHILD. | ||
972 | |||
973 | This function is only used if DCACHE_MANAGE_TRANSIT is set on the | ||
974 | dentry being transited from. | ||
975 | |||
933 | Example : | 976 | Example : |
934 | 977 | ||
935 | static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen) | 978 | static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen) |
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index a492d92bb09..792faa3c06c 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -135,7 +135,7 @@ setting up a platform_device using the GPIO, is mark its direction: | |||
135 | int gpio_direction_input(unsigned gpio); | 135 | int gpio_direction_input(unsigned gpio); |
136 | int gpio_direction_output(unsigned gpio, int value); | 136 | int gpio_direction_output(unsigned gpio, int value); |
137 | 137 | ||
138 | The return value is zero for success, else a negative errno. It must | 138 | The return value is zero for success, else a negative errno. It should |
139 | be checked, since the get/set calls don't have error returns and since | 139 | be checked, since the get/set calls don't have error returns and since |
140 | misconfiguration is possible. You should normally issue these calls from | 140 | misconfiguration is possible. You should normally issue these calls from |
141 | a task context. However, for spinlock-safe GPIOs it's OK to use them | 141 | a task context. However, for spinlock-safe GPIOs it's OK to use them |
diff --git a/Documentation/hwmon/lm93 b/Documentation/hwmon/lm93 index 7a10616d0b4..f3b2ad2ceb0 100644 --- a/Documentation/hwmon/lm93 +++ b/Documentation/hwmon/lm93 | |||
@@ -6,6 +6,10 @@ Supported chips: | |||
6 | Prefix 'lm93' | 6 | Prefix 'lm93' |
7 | Addresses scanned: I2C 0x2c-0x2e | 7 | Addresses scanned: I2C 0x2c-0x2e |
8 | Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf | 8 | Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf |
9 | * National Semiconductor LM94 | ||
10 | Prefix 'lm94' | ||
11 | Addresses scanned: I2C 0x2c-0x2e | ||
12 | Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf | ||
9 | 13 | ||
10 | Authors: | 14 | Authors: |
11 | Mark M. Hoffman <mhoffman@lightlink.com> | 15 | Mark M. Hoffman <mhoffman@lightlink.com> |
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features | |||
56 | for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual | 60 | for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual |
57 | processor Xeon class motherboard with a minimum of external components. | 61 | processor Xeon class motherboard with a minimum of external components. |
58 | 62 | ||
63 | LM94 is also supported in LM93 compatible mode. Extra sensors and features of | ||
64 | LM94 are not supported. | ||
65 | |||
59 | 66 | ||
60 | User Interface | 67 | User Interface |
61 | -------------- | 68 | -------------- |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 55fe7599bc8..89835a4766a 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -43,11 +43,11 @@ parameter is applicable: | |||
43 | AVR32 AVR32 architecture is enabled. | 43 | AVR32 AVR32 architecture is enabled. |
44 | AX25 Appropriate AX.25 support is enabled. | 44 | AX25 Appropriate AX.25 support is enabled. |
45 | BLACKFIN Blackfin architecture is enabled. | 45 | BLACKFIN Blackfin architecture is enabled. |
46 | DRM Direct Rendering Management support is enabled. | ||
47 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | ||
46 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 48 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
47 | EFI EFI Partitioning (GPT) is enabled | 49 | EFI EFI Partitioning (GPT) is enabled |
48 | EIDE EIDE/ATAPI support is enabled. | 50 | EIDE EIDE/ATAPI support is enabled. |
49 | DRM Direct Rendering Management support is enabled. | ||
50 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | ||
51 | FB The frame buffer device is enabled. | 51 | FB The frame buffer device is enabled. |
52 | GCOV GCOV profiling is enabled. | 52 | GCOV GCOV profiling is enabled. |
53 | HW Appropriate hardware is enabled. | 53 | HW Appropriate hardware is enabled. |
@@ -199,11 +199,6 @@ and is between 256 and 4096 characters. It is defined in the file | |||
199 | unusable. The "log_buf_len" parameter may be useful | 199 | unusable. The "log_buf_len" parameter may be useful |
200 | if you need to capture more output. | 200 | if you need to capture more output. |
201 | 201 | ||
202 | acpi_display_output= [HW,ACPI] | ||
203 | acpi_display_output=vendor | ||
204 | acpi_display_output=video | ||
205 | See above. | ||
206 | |||
207 | acpi_irq_balance [HW,ACPI] | 202 | acpi_irq_balance [HW,ACPI] |
208 | ACPI will balance active IRQs | 203 | ACPI will balance active IRQs |
209 | default in APIC mode | 204 | default in APIC mode |
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index dc73bc54cc4..d9da7e14853 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -39,6 +39,9 @@ | |||
39 | #include <limits.h> | 39 | #include <limits.h> |
40 | #include <stddef.h> | 40 | #include <stddef.h> |
41 | #include <signal.h> | 41 | #include <signal.h> |
42 | #include <pwd.h> | ||
43 | #include <grp.h> | ||
44 | |||
42 | #include <linux/virtio_config.h> | 45 | #include <linux/virtio_config.h> |
43 | #include <linux/virtio_net.h> | 46 | #include <linux/virtio_net.h> |
44 | #include <linux/virtio_blk.h> | 47 | #include <linux/virtio_blk.h> |
@@ -298,20 +301,27 @@ static void *map_zeroed_pages(unsigned int num) | |||
298 | 301 | ||
299 | /* | 302 | /* |
300 | * We use a private mapping (ie. if we write to the page, it will be | 303 | * We use a private mapping (ie. if we write to the page, it will be |
301 | * copied). | 304 | * copied). We allocate an extra two pages PROT_NONE to act as guard |
305 | * pages against read/write attempts that exceed allocated space. | ||
302 | */ | 306 | */ |
303 | addr = mmap(NULL, getpagesize() * num, | 307 | addr = mmap(NULL, getpagesize() * (num+2), |
304 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); | 308 | PROT_NONE, MAP_PRIVATE, fd, 0); |
309 | |||
305 | if (addr == MAP_FAILED) | 310 | if (addr == MAP_FAILED) |
306 | err(1, "Mmapping %u pages of /dev/zero", num); | 311 | err(1, "Mmapping %u pages of /dev/zero", num); |
307 | 312 | ||
313 | if (mprotect(addr + getpagesize(), getpagesize() * num, | ||
314 | PROT_READ|PROT_WRITE) == -1) | ||
315 | err(1, "mprotect rw %u pages failed", num); | ||
316 | |||
308 | /* | 317 | /* |
309 | * One neat mmap feature is that you can close the fd, and it | 318 | * One neat mmap feature is that you can close the fd, and it |
310 | * stays mapped. | 319 | * stays mapped. |
311 | */ | 320 | */ |
312 | close(fd); | 321 | close(fd); |
313 | 322 | ||
314 | return addr; | 323 | /* Return address after PROT_NONE page */ |
324 | return addr + getpagesize(); | ||
315 | } | 325 | } |
316 | 326 | ||
317 | /* Get some more pages for a device. */ | 327 | /* Get some more pages for a device. */ |
@@ -343,7 +353,7 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len) | |||
343 | * done to it. This allows us to share untouched memory between | 353 | * done to it. This allows us to share untouched memory between |
344 | * Guests. | 354 | * Guests. |
345 | */ | 355 | */ |
346 | if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC, | 356 | if (mmap(addr, len, PROT_READ|PROT_WRITE, |
347 | MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) | 357 | MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED) |
348 | return; | 358 | return; |
349 | 359 | ||
@@ -573,10 +583,10 @@ static void *_check_pointer(unsigned long addr, unsigned int size, | |||
573 | unsigned int line) | 583 | unsigned int line) |
574 | { | 584 | { |
575 | /* | 585 | /* |
576 | * We have to separately check addr and addr+size, because size could | 586 | * Check if the requested address and size exceeds the allocated memory, |
577 | * be huge and addr + size might wrap around. | 587 | * or addr + size wraps around. |
578 | */ | 588 | */ |
579 | if (addr >= guest_limit || addr + size >= guest_limit) | 589 | if ((addr + size) > guest_limit || (addr + size) < addr) |
580 | errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); | 590 | errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr); |
581 | /* | 591 | /* |
582 | * We return a pointer for the caller's convenience, now we know it's | 592 | * We return a pointer for the caller's convenience, now we know it's |
@@ -1872,6 +1882,8 @@ static struct option opts[] = { | |||
1872 | { "block", 1, NULL, 'b' }, | 1882 | { "block", 1, NULL, 'b' }, |
1873 | { "rng", 0, NULL, 'r' }, | 1883 | { "rng", 0, NULL, 'r' }, |
1874 | { "initrd", 1, NULL, 'i' }, | 1884 | { "initrd", 1, NULL, 'i' }, |
1885 | { "username", 1, NULL, 'u' }, | ||
1886 | { "chroot", 1, NULL, 'c' }, | ||
1875 | { NULL }, | 1887 | { NULL }, |
1876 | }; | 1888 | }; |
1877 | static void usage(void) | 1889 | static void usage(void) |
@@ -1894,6 +1906,12 @@ int main(int argc, char *argv[]) | |||
1894 | /* If they specify an initrd file to load. */ | 1906 | /* If they specify an initrd file to load. */ |
1895 | const char *initrd_name = NULL; | 1907 | const char *initrd_name = NULL; |
1896 | 1908 | ||
1909 | /* Password structure for initgroups/setres[gu]id */ | ||
1910 | struct passwd *user_details = NULL; | ||
1911 | |||
1912 | /* Directory to chroot to */ | ||
1913 | char *chroot_path = NULL; | ||
1914 | |||
1897 | /* Save the args: we "reboot" by execing ourselves again. */ | 1915 | /* Save the args: we "reboot" by execing ourselves again. */ |
1898 | main_args = argv; | 1916 | main_args = argv; |
1899 | 1917 | ||
@@ -1950,6 +1968,14 @@ int main(int argc, char *argv[]) | |||
1950 | case 'i': | 1968 | case 'i': |
1951 | initrd_name = optarg; | 1969 | initrd_name = optarg; |
1952 | break; | 1970 | break; |
1971 | case 'u': | ||
1972 | user_details = getpwnam(optarg); | ||
1973 | if (!user_details) | ||
1974 | err(1, "getpwnam failed, incorrect username?"); | ||
1975 | break; | ||
1976 | case 'c': | ||
1977 | chroot_path = optarg; | ||
1978 | break; | ||
1953 | default: | 1979 | default: |
1954 | warnx("Unknown argument %s", argv[optind]); | 1980 | warnx("Unknown argument %s", argv[optind]); |
1955 | usage(); | 1981 | usage(); |
@@ -2021,6 +2047,37 @@ int main(int argc, char *argv[]) | |||
2021 | /* If we exit via err(), this kills all the threads, restores tty. */ | 2047 | /* If we exit via err(), this kills all the threads, restores tty. */ |
2022 | atexit(cleanup_devices); | 2048 | atexit(cleanup_devices); |
2023 | 2049 | ||
2050 | /* If requested, chroot to a directory */ | ||
2051 | if (chroot_path) { | ||
2052 | if (chroot(chroot_path) != 0) | ||
2053 | err(1, "chroot(\"%s\") failed", chroot_path); | ||
2054 | |||
2055 | if (chdir("/") != 0) | ||
2056 | err(1, "chdir(\"/\") failed"); | ||
2057 | |||
2058 | verbose("chroot done\n"); | ||
2059 | } | ||
2060 | |||
2061 | /* If requested, drop privileges */ | ||
2062 | if (user_details) { | ||
2063 | uid_t u; | ||
2064 | gid_t g; | ||
2065 | |||
2066 | u = user_details->pw_uid; | ||
2067 | g = user_details->pw_gid; | ||
2068 | |||
2069 | if (initgroups(user_details->pw_name, g) != 0) | ||
2070 | err(1, "initgroups failed"); | ||
2071 | |||
2072 | if (setresgid(g, g, g) != 0) | ||
2073 | err(1, "setresgid failed"); | ||
2074 | |||
2075 | if (setresuid(u, u, u) != 0) | ||
2076 | err(1, "setresuid failed"); | ||
2077 | |||
2078 | verbose("Dropping privileges completed\n"); | ||
2079 | } | ||
2080 | |||
2024 | /* Finally, run the Guest. This doesn't return. */ | 2081 | /* Finally, run the Guest. This doesn't return. */ |
2025 | run_guest(); | 2082 | run_guest(); |
2026 | } | 2083 | } |
diff --git a/Documentation/lguest/lguest.txt b/Documentation/lguest/lguest.txt index 6ccaf8e1a00..dad99978a6a 100644 --- a/Documentation/lguest/lguest.txt +++ b/Documentation/lguest/lguest.txt | |||
@@ -117,6 +117,11 @@ Running Lguest: | |||
117 | 117 | ||
118 | for general information on how to get bridging to work. | 118 | for general information on how to get bridging to work. |
119 | 119 | ||
120 | - Random number generation. Using the --rng option will provide a | ||
121 | /dev/hwrng in the guest that will read from the host's /dev/random. | ||
122 | Use this option in conjunction with rng-tools (see ../hw_random.txt) | ||
123 | to provide entropy to the guest kernel's /dev/random. | ||
124 | |||
120 | There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest | 125 | There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest |
121 | 126 | ||
122 | Good luck! | 127 | Good luck! |
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 5dc638791d9..25d2f4141d2 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -49,7 +49,8 @@ Table of Contents | |||
49 | 3.3 Configuring Bonding Manually with Ifenslave | 49 | 3.3 Configuring Bonding Manually with Ifenslave |
50 | 3.3.1 Configuring Multiple Bonds Manually | 50 | 3.3.1 Configuring Multiple Bonds Manually |
51 | 3.4 Configuring Bonding Manually via Sysfs | 51 | 3.4 Configuring Bonding Manually via Sysfs |
52 | 3.5 Overriding Configuration for Special Cases | 52 | 3.5 Configuration with Interfaces Support |
53 | 3.6 Overriding Configuration for Special Cases | ||
53 | 54 | ||
54 | 4. Querying Bonding Configuration | 55 | 4. Querying Bonding Configuration |
55 | 4.1 Bonding Configuration | 56 | 4.1 Bonding Configuration |
@@ -161,8 +162,8 @@ onwards) do not have /usr/include/linux symbolically linked to the | |||
161 | default kernel source include directory. | 162 | default kernel source include directory. |
162 | 163 | ||
163 | SECOND IMPORTANT NOTE: | 164 | SECOND IMPORTANT NOTE: |
164 | If you plan to configure bonding using sysfs, you do not need | 165 | If you plan to configure bonding using sysfs or using the |
165 | to use ifenslave. | 166 | /etc/network/interfaces file, you do not need to use ifenslave. |
166 | 167 | ||
167 | 2. Bonding Driver Options | 168 | 2. Bonding Driver Options |
168 | ========================= | 169 | ========================= |
@@ -779,22 +780,26 @@ resend_igmp | |||
779 | 780 | ||
780 | You can configure bonding using either your distro's network | 781 | You can configure bonding using either your distro's network |
781 | initialization scripts, or manually using either ifenslave or the | 782 | initialization scripts, or manually using either ifenslave or the |
782 | sysfs interface. Distros generally use one of two packages for the | 783 | sysfs interface. Distros generally use one of three packages for the |
783 | network initialization scripts: initscripts or sysconfig. Recent | 784 | network initialization scripts: initscripts, sysconfig or interfaces. |
784 | versions of these packages have support for bonding, while older | 785 | Recent versions of these packages have support for bonding, while older |
785 | versions do not. | 786 | versions do not. |
786 | 787 | ||
787 | We will first describe the options for configuring bonding for | 788 | We will first describe the options for configuring bonding for |
788 | distros using versions of initscripts and sysconfig with full or | 789 | distros using versions of initscripts, sysconfig and interfaces with full |
789 | partial support for bonding, then provide information on enabling | 790 | or partial support for bonding, then provide information on enabling |
790 | bonding without support from the network initialization scripts (i.e., | 791 | bonding without support from the network initialization scripts (i.e., |
791 | older versions of initscripts or sysconfig). | 792 | older versions of initscripts or sysconfig). |
792 | 793 | ||
793 | If you're unsure whether your distro uses sysconfig or | 794 | If you're unsure whether your distro uses sysconfig, |
794 | initscripts, or don't know if it's new enough, have no fear. | 795 | initscripts or interfaces, or don't know if it's new enough, have no fear. |
795 | Determining this is fairly straightforward. | 796 | Determining this is fairly straightforward. |
796 | 797 | ||
797 | First, issue the command: | 798 | First, look for a file called interfaces in /etc/network directory. |
799 | If this file is present in your system, then your system use interfaces. See | ||
800 | Configuration with Interfaces Support. | ||
801 | |||
802 | Else, issue the command: | ||
798 | 803 | ||
799 | $ rpm -qf /sbin/ifup | 804 | $ rpm -qf /sbin/ifup |
800 | 805 | ||
@@ -1327,8 +1332,62 @@ echo 2000 > /sys/class/net/bond1/bonding/arp_interval | |||
1327 | echo +eth2 > /sys/class/net/bond1/bonding/slaves | 1332 | echo +eth2 > /sys/class/net/bond1/bonding/slaves |
1328 | echo +eth3 > /sys/class/net/bond1/bonding/slaves | 1333 | echo +eth3 > /sys/class/net/bond1/bonding/slaves |
1329 | 1334 | ||
1330 | 3.5 Overriding Configuration for Special Cases | 1335 | 3.5 Configuration with Interfaces Support |
1336 | ----------------------------------------- | ||
1337 | |||
1338 | This section applies to distros which use /etc/network/interfaces file | ||
1339 | to describe network interface configuration, most notably Debian and it's | ||
1340 | derivatives. | ||
1341 | |||
1342 | The ifup and ifdown commands on Debian don't support bonding out of | ||
1343 | the box. The ifenslave-2.6 package should be installed to provide bonding | ||
1344 | support. Once installed, this package will provide bond-* options to be used | ||
1345 | into /etc/network/interfaces. | ||
1346 | |||
1347 | Note that ifenslave-2.6 package will load the bonding module and use | ||
1348 | the ifenslave command when appropriate. | ||
1349 | |||
1350 | Example Configurations | ||
1351 | ---------------------- | ||
1352 | |||
1353 | In /etc/network/interfaces, the following stanza will configure bond0, in | ||
1354 | active-backup mode, with eth0 and eth1 as slaves. | ||
1355 | |||
1356 | auto bond0 | ||
1357 | iface bond0 inet dhcp | ||
1358 | bond-slaves eth0 eth1 | ||
1359 | bond-mode active-backup | ||
1360 | bond-miimon 100 | ||
1361 | bond-primary eth0 eth1 | ||
1362 | |||
1363 | If the above configuration doesn't work, you might have a system using | ||
1364 | upstart for system startup. This is most notably true for recent | ||
1365 | Ubuntu versions. The following stanza in /etc/network/interfaces will | ||
1366 | produce the same result on those systems. | ||
1367 | |||
1368 | auto bond0 | ||
1369 | iface bond0 inet dhcp | ||
1370 | bond-slaves none | ||
1371 | bond-mode active-backup | ||
1372 | bond-miimon 100 | ||
1373 | |||
1374 | auto eth0 | ||
1375 | iface eth0 inet manual | ||
1376 | bond-master bond0 | ||
1377 | bond-primary eth0 eth1 | ||
1378 | |||
1379 | auto eth1 | ||
1380 | iface eth1 inet manual | ||
1381 | bond-master bond0 | ||
1382 | bond-primary eth0 eth1 | ||
1383 | |||
1384 | For a full list of bond-* supported options in /etc/network/interfaces and some | ||
1385 | more advanced examples tailored to you particular distros, see the files in | ||
1386 | /usr/share/doc/ifenslave-2.6. | ||
1387 | |||
1388 | 3.6 Overriding Configuration for Special Cases | ||
1331 | ---------------------------------------------- | 1389 | ---------------------------------------------- |
1390 | |||
1332 | When using the bonding driver, the physical port which transmits a frame is | 1391 | When using the bonding driver, the physical port which transmits a frame is |
1333 | typically selected by the bonding driver, and is not relevant to the user or | 1392 | typically selected by the bonding driver, and is not relevant to the user or |
1334 | system administrator. The output port is simply selected using the policies of | 1393 | system administrator. The output port is simply selected using the policies of |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index d99940dcfc4..ac3b4a726a1 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -187,7 +187,7 @@ tcp_cookie_size - INTEGER | |||
187 | tcp_dsack - BOOLEAN | 187 | tcp_dsack - BOOLEAN |
188 | Allows TCP to send "duplicate" SACKs. | 188 | Allows TCP to send "duplicate" SACKs. |
189 | 189 | ||
190 | tcp_ecn - BOOLEAN | 190 | tcp_ecn - INTEGER |
191 | Enable Explicit Congestion Notification (ECN) in TCP. ECN is only | 191 | Enable Explicit Congestion Notification (ECN) in TCP. ECN is only |
192 | used when both ends of the TCP flow support it. It is useful to | 192 | used when both ends of the TCP flow support it. It is useful to |
193 | avoid losses due to congestion (when the bottleneck router supports | 193 | avoid losses due to congestion (when the bottleneck router supports |
diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt index 01e69404ee5..1cd5d51bc76 100644 --- a/Documentation/scheduler/sched-stats.txt +++ b/Documentation/scheduler/sched-stats.txt | |||
@@ -1,3 +1,7 @@ | |||
1 | Version 15 of schedstats dropped counters for some sched_yield: | ||
2 | yld_exp_empty, yld_act_empty and yld_both_empty. Otherwise, it is | ||
3 | identical to version 14. | ||
4 | |||
1 | Version 14 of schedstats includes support for sched_domains, which hit the | 5 | Version 14 of schedstats includes support for sched_domains, which hit the |
2 | mainline kernel in 2.6.20 although it is identical to the stats from version | 6 | mainline kernel in 2.6.20 although it is identical to the stats from version |
3 | 12 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel | 7 | 12 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel |
@@ -28,32 +32,25 @@ to write their own scripts, the fields are described here. | |||
28 | 32 | ||
29 | CPU statistics | 33 | CPU statistics |
30 | -------------- | 34 | -------------- |
31 | cpu<N> 1 2 3 4 5 6 7 8 9 10 11 12 | 35 | cpu<N> 1 2 3 4 5 6 7 8 9 |
32 | |||
33 | NOTE: In the sched_yield() statistics, the active queue is considered empty | ||
34 | if it has only one process in it, since obviously the process calling | ||
35 | sched_yield() is that process. | ||
36 | 36 | ||
37 | First four fields are sched_yield() statistics: | 37 | First field is a sched_yield() statistic: |
38 | 1) # of times both the active and the expired queue were empty | 38 | 1) # of times sched_yield() was called |
39 | 2) # of times just the active queue was empty | ||
40 | 3) # of times just the expired queue was empty | ||
41 | 4) # of times sched_yield() was called | ||
42 | 39 | ||
43 | Next three are schedule() statistics: | 40 | Next three are schedule() statistics: |
44 | 5) # of times we switched to the expired queue and reused it | 41 | 2) # of times we switched to the expired queue and reused it |
45 | 6) # of times schedule() was called | 42 | 3) # of times schedule() was called |
46 | 7) # of times schedule() left the processor idle | 43 | 4) # of times schedule() left the processor idle |
47 | 44 | ||
48 | Next two are try_to_wake_up() statistics: | 45 | Next two are try_to_wake_up() statistics: |
49 | 8) # of times try_to_wake_up() was called | 46 | 5) # of times try_to_wake_up() was called |
50 | 9) # of times try_to_wake_up() was called to wake up the local cpu | 47 | 6) # of times try_to_wake_up() was called to wake up the local cpu |
51 | 48 | ||
52 | Next three are statistics describing scheduling latency: | 49 | Next three are statistics describing scheduling latency: |
53 | 10) sum of all time spent running by tasks on this processor (in jiffies) | 50 | 7) sum of all time spent running by tasks on this processor (in jiffies) |
54 | 11) sum of all time spent waiting to run by tasks on this processor (in | 51 | 8) sum of all time spent waiting to run by tasks on this processor (in |
55 | jiffies) | 52 | jiffies) |
56 | 12) # of timeslices run on this cpu | 53 | 9) # of timeslices run on this cpu |
57 | 54 | ||
58 | 55 | ||
59 | Domain statistics | 56 | Domain statistics |
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 16ae4300c74..0caf77e59be 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -296,6 +296,7 @@ Conexant 5066 | |||
296 | ============= | 296 | ============= |
297 | laptop Basic Laptop config (default) | 297 | laptop Basic Laptop config (default) |
298 | hp-laptop HP laptops, e g G60 | 298 | hp-laptop HP laptops, e g G60 |
299 | asus Asus K52JU, Lenovo G560 | ||
299 | dell-laptop Dell laptops | 300 | dell-laptop Dell laptops |
300 | dell-vostro Dell Vostro | 301 | dell-vostro Dell Vostro |
301 | olpc-xo-1_5 OLPC XO 1.5 | 302 | olpc-xo-1_5 OLPC XO 1.5 |
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt index 37ba3a72cb7..bce23a4a787 100644 --- a/Documentation/sound/alsa/soc/codec.txt +++ b/Documentation/sound/alsa/soc/codec.txt | |||
@@ -27,42 +27,38 @@ ASoC Codec driver breakdown | |||
27 | 27 | ||
28 | 1 - Codec DAI and PCM configuration | 28 | 1 - Codec DAI and PCM configuration |
29 | ----------------------------------- | 29 | ----------------------------------- |
30 | Each codec driver must have a struct snd_soc_codec_dai to define its DAI and | 30 | Each codec driver must have a struct snd_soc_dai_driver to define its DAI and |
31 | PCM capabilities and operations. This struct is exported so that it can be | 31 | PCM capabilities and operations. This struct is exported so that it can be |
32 | registered with the core by your machine driver. | 32 | registered with the core by your machine driver. |
33 | 33 | ||
34 | e.g. | 34 | e.g. |
35 | 35 | ||
36 | struct snd_soc_codec_dai wm8731_dai = { | 36 | static struct snd_soc_dai_ops wm8731_dai_ops = { |
37 | .name = "WM8731", | 37 | .prepare = wm8731_pcm_prepare, |
38 | /* playback capabilities */ | 38 | .hw_params = wm8731_hw_params, |
39 | .shutdown = wm8731_shutdown, | ||
40 | .digital_mute = wm8731_mute, | ||
41 | .set_sysclk = wm8731_set_dai_sysclk, | ||
42 | .set_fmt = wm8731_set_dai_fmt, | ||
43 | }; | ||
44 | |||
45 | struct snd_soc_dai_driver wm8731_dai = { | ||
46 | .name = "wm8731-hifi", | ||
39 | .playback = { | 47 | .playback = { |
40 | .stream_name = "Playback", | 48 | .stream_name = "Playback", |
41 | .channels_min = 1, | 49 | .channels_min = 1, |
42 | .channels_max = 2, | 50 | .channels_max = 2, |
43 | .rates = WM8731_RATES, | 51 | .rates = WM8731_RATES, |
44 | .formats = WM8731_FORMATS,}, | 52 | .formats = WM8731_FORMATS,}, |
45 | /* capture capabilities */ | ||
46 | .capture = { | 53 | .capture = { |
47 | .stream_name = "Capture", | 54 | .stream_name = "Capture", |
48 | .channels_min = 1, | 55 | .channels_min = 1, |
49 | .channels_max = 2, | 56 | .channels_max = 2, |
50 | .rates = WM8731_RATES, | 57 | .rates = WM8731_RATES, |
51 | .formats = WM8731_FORMATS,}, | 58 | .formats = WM8731_FORMATS,}, |
52 | /* pcm operations - see section 4 below */ | 59 | .ops = &wm8731_dai_ops, |
53 | .ops = { | 60 | .symmetric_rates = 1, |
54 | .prepare = wm8731_pcm_prepare, | ||
55 | .hw_params = wm8731_hw_params, | ||
56 | .shutdown = wm8731_shutdown, | ||
57 | }, | ||
58 | /* DAI operations - see DAI.txt */ | ||
59 | .dai_ops = { | ||
60 | .digital_mute = wm8731_mute, | ||
61 | .set_sysclk = wm8731_set_dai_sysclk, | ||
62 | .set_fmt = wm8731_set_dai_fmt, | ||
63 | } | ||
64 | }; | 61 | }; |
65 | EXPORT_SYMBOL_GPL(wm8731_dai); | ||
66 | 62 | ||
67 | 63 | ||
68 | 2 - Codec control IO | 64 | 2 - Codec control IO |
@@ -186,13 +182,14 @@ when the mute is applied or freed. | |||
186 | 182 | ||
187 | i.e. | 183 | i.e. |
188 | 184 | ||
189 | static int wm8974_mute(struct snd_soc_codec *codec, | 185 | static int wm8974_mute(struct snd_soc_dai *dai, int mute) |
190 | struct snd_soc_codec_dai *dai, int mute) | ||
191 | { | 186 | { |
192 | u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; | 187 | struct snd_soc_codec *codec = dai->codec; |
193 | if(mute) | 188 | u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; |
194 | wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); | 189 | |
190 | if (mute) | ||
191 | snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40); | ||
195 | else | 192 | else |
196 | wm8974_write(codec, WM8974_DAC, mute_reg); | 193 | snd_soc_write(codec, WM8974_DAC, mute_reg); |
197 | return 0; | 194 | return 0; |
198 | } | 195 | } |
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index 2524c75557d..3e2ec9cbf39 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt | |||
@@ -12,6 +12,8 @@ the following struct:- | |||
12 | struct snd_soc_card { | 12 | struct snd_soc_card { |
13 | char *name; | 13 | char *name; |
14 | 14 | ||
15 | ... | ||
16 | |||
15 | int (*probe)(struct platform_device *pdev); | 17 | int (*probe)(struct platform_device *pdev); |
16 | int (*remove)(struct platform_device *pdev); | 18 | int (*remove)(struct platform_device *pdev); |
17 | 19 | ||
@@ -22,12 +24,13 @@ struct snd_soc_card { | |||
22 | int (*resume_pre)(struct platform_device *pdev); | 24 | int (*resume_pre)(struct platform_device *pdev); |
23 | int (*resume_post)(struct platform_device *pdev); | 25 | int (*resume_post)(struct platform_device *pdev); |
24 | 26 | ||
25 | /* machine stream operations */ | 27 | ... |
26 | struct snd_soc_ops *ops; | ||
27 | 28 | ||
28 | /* CPU <--> Codec DAI links */ | 29 | /* CPU <--> Codec DAI links */ |
29 | struct snd_soc_dai_link *dai_link; | 30 | struct snd_soc_dai_link *dai_link; |
30 | int num_links; | 31 | int num_links; |
32 | |||
33 | ... | ||
31 | }; | 34 | }; |
32 | 35 | ||
33 | probe()/remove() | 36 | probe()/remove() |
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs | |||
42 | and DMA is suspended and resumed. Optional. | 45 | and DMA is suspended and resumed. Optional. |
43 | 46 | ||
44 | 47 | ||
45 | Machine operations | ||
46 | ------------------ | ||
47 | The machine specific audio operations can be set here. Again this is optional. | ||
48 | |||
49 | |||
50 | Machine DAI Configuration | 48 | Machine DAI Configuration |
51 | ------------------------- | 49 | ------------------------- |
52 | The machine DAI configuration glues all the codec and CPU DAIs together. It can | 50 | The machine DAI configuration glues all the codec and CPU DAIs together. It can |
@@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | |||
61 | static struct snd_soc_dai_link corgi_dai = { | 59 | static struct snd_soc_dai_link corgi_dai = { |
62 | .name = "WM8731", | 60 | .name = "WM8731", |
63 | .stream_name = "WM8731", | 61 | .stream_name = "WM8731", |
64 | .cpu_dai = &pxa_i2s_dai, | 62 | .cpu_dai_name = "pxa-is2-dai", |
65 | .codec_dai = &wm8731_dai, | 63 | .codec_dai_name = "wm8731-hifi", |
64 | .platform_name = "pxa-pcm-audio", | ||
65 | .codec_name = "wm8713-codec.0-001a", | ||
66 | .init = corgi_wm8731_init, | 66 | .init = corgi_wm8731_init, |
67 | .ops = &corgi_ops, | 67 | .ops = &corgi_ops, |
68 | }; | 68 | }; |
@@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = { | |||
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | Machine Audio Subsystem | ||
81 | ----------------------- | ||
82 | |||
83 | The machine soc device glues the platform, machine and codec driver together. | ||
84 | Private data can also be set here. e.g. | ||
85 | |||
86 | /* corgi audio private data */ | ||
87 | static struct wm8731_setup_data corgi_wm8731_setup = { | ||
88 | .i2c_address = 0x1b, | ||
89 | }; | ||
90 | |||
91 | /* corgi audio subsystem */ | ||
92 | static struct snd_soc_device corgi_snd_devdata = { | ||
93 | .machine = &snd_soc_corgi, | ||
94 | .platform = &pxa2xx_soc_platform, | ||
95 | .codec_dev = &soc_codec_dev_wm8731, | ||
96 | .codec_data = &corgi_wm8731_setup, | ||
97 | }; | ||
98 | |||
99 | |||
100 | Machine Power Map | 80 | Machine Power Map |
101 | ----------------- | 81 | ----------------- |
102 | 82 | ||
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt index 06d835987c6..d57efad37e0 100644 --- a/Documentation/sound/alsa/soc/platform.txt +++ b/Documentation/sound/alsa/soc/platform.txt | |||
@@ -20,9 +20,10 @@ struct snd_soc_ops { | |||
20 | int (*trigger)(struct snd_pcm_substream *, int); | 20 | int (*trigger)(struct snd_pcm_substream *, int); |
21 | }; | 21 | }; |
22 | 22 | ||
23 | The platform driver exports its DMA functionality via struct snd_soc_platform:- | 23 | The platform driver exports its DMA functionality via struct |
24 | snd_soc_platform_driver:- | ||
24 | 25 | ||
25 | struct snd_soc_platform { | 26 | struct snd_soc_platform_driver { |
26 | char *name; | 27 | char *name; |
27 | 28 | ||
28 | int (*probe)(struct platform_device *pdev); | 29 | int (*probe)(struct platform_device *pdev); |
@@ -34,6 +35,13 @@ struct snd_soc_platform { | |||
34 | int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); | 35 | int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); |
35 | void (*pcm_free)(struct snd_pcm *); | 36 | void (*pcm_free)(struct snd_pcm *); |
36 | 37 | ||
38 | /* | ||
39 | * For platform caused delay reporting. | ||
40 | * Optional. | ||
41 | */ | ||
42 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
43 | struct snd_soc_dai *); | ||
44 | |||
37 | /* platform stream ops */ | 45 | /* platform stream ops */ |
38 | struct snd_pcm_ops *pcm_ops; | 46 | struct snd_pcm_ops *pcm_ops; |
39 | }; | 47 | }; |
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py new file mode 100755 index 00000000000..dbeb8a0d717 --- /dev/null +++ b/Documentation/target/tcm_mod_builder.py | |||
@@ -0,0 +1,1094 @@ | |||
1 | #!/usr/bin/python | ||
2 | # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD | ||
3 | # | ||
4 | # Copyright (c) 2010 Rising Tide Systems | ||
5 | # Copyright (c) 2010 Linux-iSCSI.org | ||
6 | # | ||
7 | # Author: nab@kernel.org | ||
8 | # | ||
9 | import os, sys | ||
10 | import subprocess as sub | ||
11 | import string | ||
12 | import re | ||
13 | import optparse | ||
14 | |||
15 | tcm_dir = "" | ||
16 | |||
17 | fabric_ops = [] | ||
18 | fabric_mod_dir = "" | ||
19 | fabric_mod_port = "" | ||
20 | fabric_mod_init_port = "" | ||
21 | |||
22 | def tcm_mod_err(msg): | ||
23 | print msg | ||
24 | sys.exit(1) | ||
25 | |||
26 | def tcm_mod_create_module_subdir(fabric_mod_dir_var): | ||
27 | |||
28 | if os.path.isdir(fabric_mod_dir_var) == True: | ||
29 | return 1 | ||
30 | |||
31 | print "Creating fabric_mod_dir: " + fabric_mod_dir_var | ||
32 | ret = os.mkdir(fabric_mod_dir_var) | ||
33 | if ret: | ||
34 | tcm_mod_err("Unable to mkdir " + fabric_mod_dir_var) | ||
35 | |||
36 | return | ||
37 | |||
38 | def tcm_mod_build_FC_include(fabric_mod_dir_var, fabric_mod_name): | ||
39 | global fabric_mod_port | ||
40 | global fabric_mod_init_port | ||
41 | buf = "" | ||
42 | |||
43 | f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h" | ||
44 | print "Writing file: " + f | ||
45 | |||
46 | p = open(f, 'w'); | ||
47 | if not p: | ||
48 | tcm_mod_err("Unable to open file: " + f) | ||
49 | |||
50 | buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" | ||
51 | buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" | ||
52 | buf += "\n" | ||
53 | buf += "struct " + fabric_mod_name + "_nacl {\n" | ||
54 | buf += " /* Binary World Wide unique Port Name for FC Initiator Nport */\n" | ||
55 | buf += " u64 nport_wwpn;\n" | ||
56 | buf += " /* ASCII formatted WWPN for FC Initiator Nport */\n" | ||
57 | buf += " char nport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
58 | buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n" | ||
59 | buf += " struct se_node_acl se_node_acl;\n" | ||
60 | buf += "};\n" | ||
61 | buf += "\n" | ||
62 | buf += "struct " + fabric_mod_name + "_tpg {\n" | ||
63 | buf += " /* FC lport target portal group tag for TCM */\n" | ||
64 | buf += " u16 lport_tpgt;\n" | ||
65 | buf += " /* Pointer back to " + fabric_mod_name + "_lport */\n" | ||
66 | buf += " struct " + fabric_mod_name + "_lport *lport;\n" | ||
67 | buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" | ||
68 | buf += " struct se_portal_group se_tpg;\n" | ||
69 | buf += "};\n" | ||
70 | buf += "\n" | ||
71 | buf += "struct " + fabric_mod_name + "_lport {\n" | ||
72 | buf += " /* SCSI protocol the lport is providing */\n" | ||
73 | buf += " u8 lport_proto_id;\n" | ||
74 | buf += " /* Binary World Wide unique Port Name for FC Target Lport */\n" | ||
75 | buf += " u64 lport_wwpn;\n" | ||
76 | buf += " /* ASCII formatted WWPN for FC Target Lport */\n" | ||
77 | buf += " char lport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
78 | buf += " /* Returned by " + fabric_mod_name + "_make_lport() */\n" | ||
79 | buf += " struct se_wwn lport_wwn;\n" | ||
80 | buf += "};\n" | ||
81 | |||
82 | ret = p.write(buf) | ||
83 | if ret: | ||
84 | tcm_mod_err("Unable to write f: " + f) | ||
85 | |||
86 | p.close() | ||
87 | |||
88 | fabric_mod_port = "lport" | ||
89 | fabric_mod_init_port = "nport" | ||
90 | |||
91 | return | ||
92 | |||
93 | def tcm_mod_build_SAS_include(fabric_mod_dir_var, fabric_mod_name): | ||
94 | global fabric_mod_port | ||
95 | global fabric_mod_init_port | ||
96 | buf = "" | ||
97 | |||
98 | f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h" | ||
99 | print "Writing file: " + f | ||
100 | |||
101 | p = open(f, 'w'); | ||
102 | if not p: | ||
103 | tcm_mod_err("Unable to open file: " + f) | ||
104 | |||
105 | buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" | ||
106 | buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" | ||
107 | buf += "\n" | ||
108 | buf += "struct " + fabric_mod_name + "_nacl {\n" | ||
109 | buf += " /* Binary World Wide unique Port Name for SAS Initiator port */\n" | ||
110 | buf += " u64 iport_wwpn;\n" | ||
111 | buf += " /* ASCII formatted WWPN for Sas Initiator port */\n" | ||
112 | buf += " char iport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
113 | buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n" | ||
114 | buf += " struct se_node_acl se_node_acl;\n" | ||
115 | buf += "};\n\n" | ||
116 | buf += "struct " + fabric_mod_name + "_tpg {\n" | ||
117 | buf += " /* SAS port target portal group tag for TCM */\n" | ||
118 | buf += " u16 tport_tpgt;\n" | ||
119 | buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n" | ||
120 | buf += " struct " + fabric_mod_name + "_tport *tport;\n" | ||
121 | buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" | ||
122 | buf += " struct se_portal_group se_tpg;\n" | ||
123 | buf += "};\n\n" | ||
124 | buf += "struct " + fabric_mod_name + "_tport {\n" | ||
125 | buf += " /* SCSI protocol the tport is providing */\n" | ||
126 | buf += " u8 tport_proto_id;\n" | ||
127 | buf += " /* Binary World Wide unique Port Name for SAS Target port */\n" | ||
128 | buf += " u64 tport_wwpn;\n" | ||
129 | buf += " /* ASCII formatted WWPN for SAS Target port */\n" | ||
130 | buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
131 | buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n" | ||
132 | buf += " struct se_wwn tport_wwn;\n" | ||
133 | buf += "};\n" | ||
134 | |||
135 | ret = p.write(buf) | ||
136 | if ret: | ||
137 | tcm_mod_err("Unable to write f: " + f) | ||
138 | |||
139 | p.close() | ||
140 | |||
141 | fabric_mod_port = "tport" | ||
142 | fabric_mod_init_port = "iport" | ||
143 | |||
144 | return | ||
145 | |||
146 | def tcm_mod_build_iSCSI_include(fabric_mod_dir_var, fabric_mod_name): | ||
147 | global fabric_mod_port | ||
148 | global fabric_mod_init_port | ||
149 | buf = "" | ||
150 | |||
151 | f = fabric_mod_dir_var + "/" + fabric_mod_name + "_base.h" | ||
152 | print "Writing file: " + f | ||
153 | |||
154 | p = open(f, 'w'); | ||
155 | if not p: | ||
156 | tcm_mod_err("Unable to open file: " + f) | ||
157 | |||
158 | buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" | ||
159 | buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" | ||
160 | buf += "\n" | ||
161 | buf += "struct " + fabric_mod_name + "_nacl {\n" | ||
162 | buf += " /* ASCII formatted InitiatorName */\n" | ||
163 | buf += " char iport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
164 | buf += " /* Returned by " + fabric_mod_name + "_make_nodeacl() */\n" | ||
165 | buf += " struct se_node_acl se_node_acl;\n" | ||
166 | buf += "};\n\n" | ||
167 | buf += "struct " + fabric_mod_name + "_tpg {\n" | ||
168 | buf += " /* iSCSI target portal group tag for TCM */\n" | ||
169 | buf += " u16 tport_tpgt;\n" | ||
170 | buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n" | ||
171 | buf += " struct " + fabric_mod_name + "_tport *tport;\n" | ||
172 | buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" | ||
173 | buf += " struct se_portal_group se_tpg;\n" | ||
174 | buf += "};\n\n" | ||
175 | buf += "struct " + fabric_mod_name + "_tport {\n" | ||
176 | buf += " /* SCSI protocol the tport is providing */\n" | ||
177 | buf += " u8 tport_proto_id;\n" | ||
178 | buf += " /* ASCII formatted TargetName for IQN */\n" | ||
179 | buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" | ||
180 | buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n" | ||
181 | buf += " struct se_wwn tport_wwn;\n" | ||
182 | buf += "};\n" | ||
183 | |||
184 | ret = p.write(buf) | ||
185 | if ret: | ||
186 | tcm_mod_err("Unable to write f: " + f) | ||
187 | |||
188 | p.close() | ||
189 | |||
190 | fabric_mod_port = "tport" | ||
191 | fabric_mod_init_port = "iport" | ||
192 | |||
193 | return | ||
194 | |||
195 | def tcm_mod_build_base_includes(proto_ident, fabric_mod_dir_val, fabric_mod_name): | ||
196 | |||
197 | if proto_ident == "FC": | ||
198 | tcm_mod_build_FC_include(fabric_mod_dir_val, fabric_mod_name) | ||
199 | elif proto_ident == "SAS": | ||
200 | tcm_mod_build_SAS_include(fabric_mod_dir_val, fabric_mod_name) | ||
201 | elif proto_ident == "iSCSI": | ||
202 | tcm_mod_build_iSCSI_include(fabric_mod_dir_val, fabric_mod_name) | ||
203 | else: | ||
204 | print "Unsupported proto_ident: " + proto_ident | ||
205 | sys.exit(1) | ||
206 | |||
207 | return | ||
208 | |||
209 | def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | ||
210 | buf = "" | ||
211 | |||
212 | f = fabric_mod_dir_var + "/" + fabric_mod_name + "_configfs.c" | ||
213 | print "Writing file: " + f | ||
214 | |||
215 | p = open(f, 'w'); | ||
216 | if not p: | ||
217 | tcm_mod_err("Unable to open file: " + f) | ||
218 | |||
219 | buf = "#include <linux/module.h>\n" | ||
220 | buf += "#include <linux/moduleparam.h>\n" | ||
221 | buf += "#include <linux/version.h>\n" | ||
222 | buf += "#include <generated/utsrelease.h>\n" | ||
223 | buf += "#include <linux/utsname.h>\n" | ||
224 | buf += "#include <linux/init.h>\n" | ||
225 | buf += "#include <linux/slab.h>\n" | ||
226 | buf += "#include <linux/kthread.h>\n" | ||
227 | buf += "#include <linux/types.h>\n" | ||
228 | buf += "#include <linux/string.h>\n" | ||
229 | buf += "#include <linux/configfs.h>\n" | ||
230 | buf += "#include <linux/ctype.h>\n" | ||
231 | buf += "#include <asm/unaligned.h>\n\n" | ||
232 | buf += "#include <target/target_core_base.h>\n" | ||
233 | buf += "#include <target/target_core_transport.h>\n" | ||
234 | buf += "#include <target/target_core_fabric_ops.h>\n" | ||
235 | buf += "#include <target/target_core_fabric_configfs.h>\n" | ||
236 | buf += "#include <target/target_core_fabric_lib.h>\n" | ||
237 | buf += "#include <target/target_core_device.h>\n" | ||
238 | buf += "#include <target/target_core_tpg.h>\n" | ||
239 | buf += "#include <target/target_core_configfs.h>\n" | ||
240 | buf += "#include <target/target_core_base.h>\n" | ||
241 | buf += "#include <target/configfs_macros.h>\n\n" | ||
242 | buf += "#include <" + fabric_mod_name + "_base.h>\n" | ||
243 | buf += "#include <" + fabric_mod_name + "_fabric.h>\n\n" | ||
244 | |||
245 | buf += "/* Local pointer to allocated TCM configfs fabric module */\n" | ||
246 | buf += "struct target_fabric_configfs *" + fabric_mod_name + "_fabric_configfs;\n\n" | ||
247 | |||
248 | buf += "static struct se_node_acl *" + fabric_mod_name + "_make_nodeacl(\n" | ||
249 | buf += " struct se_portal_group *se_tpg,\n" | ||
250 | buf += " struct config_group *group,\n" | ||
251 | buf += " const char *name)\n" | ||
252 | buf += "{\n" | ||
253 | buf += " struct se_node_acl *se_nacl, *se_nacl_new;\n" | ||
254 | buf += " struct " + fabric_mod_name + "_nacl *nacl;\n" | ||
255 | |||
256 | if proto_ident == "FC" or proto_ident == "SAS": | ||
257 | buf += " u64 wwpn = 0;\n" | ||
258 | |||
259 | buf += " u32 nexus_depth;\n\n" | ||
260 | buf += " /* " + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n" | ||
261 | buf += " return ERR_PTR(-EINVAL); */\n" | ||
262 | buf += " se_nacl_new = " + fabric_mod_name + "_alloc_fabric_acl(se_tpg);\n" | ||
263 | buf += " if (!(se_nacl_new))\n" | ||
264 | buf += " return ERR_PTR(-ENOMEM);\n" | ||
265 | buf += "//#warning FIXME: Hardcoded nexus depth in " + fabric_mod_name + "_make_nodeacl()\n" | ||
266 | buf += " nexus_depth = 1;\n" | ||
267 | buf += " /*\n" | ||
268 | buf += " * se_nacl_new may be released by core_tpg_add_initiator_node_acl()\n" | ||
269 | buf += " * when converting a NodeACL from demo mode -> explict\n" | ||
270 | buf += " */\n" | ||
271 | buf += " se_nacl = core_tpg_add_initiator_node_acl(se_tpg, se_nacl_new,\n" | ||
272 | buf += " name, nexus_depth);\n" | ||
273 | buf += " if (IS_ERR(se_nacl)) {\n" | ||
274 | buf += " " + fabric_mod_name + "_release_fabric_acl(se_tpg, se_nacl_new);\n" | ||
275 | buf += " return se_nacl;\n" | ||
276 | buf += " }\n" | ||
277 | buf += " /*\n" | ||
278 | buf += " * Locate our struct " + fabric_mod_name + "_nacl and set the FC Nport WWPN\n" | ||
279 | buf += " */\n" | ||
280 | buf += " nacl = container_of(se_nacl, struct " + fabric_mod_name + "_nacl, se_node_acl);\n" | ||
281 | |||
282 | if proto_ident == "FC" or proto_ident == "SAS": | ||
283 | buf += " nacl->" + fabric_mod_init_port + "_wwpn = wwpn;\n" | ||
284 | |||
285 | buf += " /* " + fabric_mod_name + "_format_wwn(&nacl->" + fabric_mod_init_port + "_name[0], " + fabric_mod_name.upper() + "_NAMELEN, wwpn); */\n\n" | ||
286 | buf += " return se_nacl;\n" | ||
287 | buf += "}\n\n" | ||
288 | buf += "static void " + fabric_mod_name + "_drop_nodeacl(struct se_node_acl *se_acl)\n" | ||
289 | buf += "{\n" | ||
290 | buf += " struct " + fabric_mod_name + "_nacl *nacl = container_of(se_acl,\n" | ||
291 | buf += " struct " + fabric_mod_name + "_nacl, se_node_acl);\n" | ||
292 | buf += " kfree(nacl);\n" | ||
293 | buf += "}\n\n" | ||
294 | |||
295 | buf += "static struct se_portal_group *" + fabric_mod_name + "_make_tpg(\n" | ||
296 | buf += " struct se_wwn *wwn,\n" | ||
297 | buf += " struct config_group *group,\n" | ||
298 | buf += " const char *name)\n" | ||
299 | buf += "{\n" | ||
300 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + "*" + fabric_mod_port + " = container_of(wwn,\n" | ||
301 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n\n" | ||
302 | buf += " struct " + fabric_mod_name + "_tpg *tpg;\n" | ||
303 | buf += " unsigned long tpgt;\n" | ||
304 | buf += " int ret;\n\n" | ||
305 | buf += " if (strstr(name, \"tpgt_\") != name)\n" | ||
306 | buf += " return ERR_PTR(-EINVAL);\n" | ||
307 | buf += " if (strict_strtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n" | ||
308 | buf += " return ERR_PTR(-EINVAL);\n\n" | ||
309 | buf += " tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n" | ||
310 | buf += " if (!(tpg)) {\n" | ||
311 | buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_tpg\");\n" | ||
312 | buf += " return ERR_PTR(-ENOMEM);\n" | ||
313 | buf += " }\n" | ||
314 | buf += " tpg->" + fabric_mod_port + " = " + fabric_mod_port + ";\n" | ||
315 | buf += " tpg->" + fabric_mod_port + "_tpgt = tpgt;\n\n" | ||
316 | buf += " ret = core_tpg_register(&" + fabric_mod_name + "_fabric_configfs->tf_ops, wwn,\n" | ||
317 | buf += " &tpg->se_tpg, (void *)tpg,\n" | ||
318 | buf += " TRANSPORT_TPG_TYPE_NORMAL);\n" | ||
319 | buf += " if (ret < 0) {\n" | ||
320 | buf += " kfree(tpg);\n" | ||
321 | buf += " return NULL;\n" | ||
322 | buf += " }\n" | ||
323 | buf += " return &tpg->se_tpg;\n" | ||
324 | buf += "}\n\n" | ||
325 | buf += "static void " + fabric_mod_name + "_drop_tpg(struct se_portal_group *se_tpg)\n" | ||
326 | buf += "{\n" | ||
327 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
328 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n\n" | ||
329 | buf += " core_tpg_deregister(se_tpg);\n" | ||
330 | buf += " kfree(tpg);\n" | ||
331 | buf += "}\n\n" | ||
332 | |||
333 | buf += "static struct se_wwn *" + fabric_mod_name + "_make_" + fabric_mod_port + "(\n" | ||
334 | buf += " struct target_fabric_configfs *tf,\n" | ||
335 | buf += " struct config_group *group,\n" | ||
336 | buf += " const char *name)\n" | ||
337 | buf += "{\n" | ||
338 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + ";\n" | ||
339 | |||
340 | if proto_ident == "FC" or proto_ident == "SAS": | ||
341 | buf += " u64 wwpn = 0;\n\n" | ||
342 | |||
343 | buf += " /* if (" + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n" | ||
344 | buf += " return ERR_PTR(-EINVAL); */\n\n" | ||
345 | buf += " " + fabric_mod_port + " = kzalloc(sizeof(struct " + fabric_mod_name + "_" + fabric_mod_port + "), GFP_KERNEL);\n" | ||
346 | buf += " if (!(" + fabric_mod_port + ")) {\n" | ||
347 | buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_" + fabric_mod_port + "\");\n" | ||
348 | buf += " return ERR_PTR(-ENOMEM);\n" | ||
349 | buf += " }\n" | ||
350 | |||
351 | if proto_ident == "FC" or proto_ident == "SAS": | ||
352 | buf += " " + fabric_mod_port + "->" + fabric_mod_port + "_wwpn = wwpn;\n" | ||
353 | |||
354 | buf += " /* " + fabric_mod_name + "_format_wwn(&" + fabric_mod_port + "->" + fabric_mod_port + "_name[0], " + fabric_mod_name.upper() + "__NAMELEN, wwpn); */\n\n" | ||
355 | buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_wwn;\n" | ||
356 | buf += "}\n\n" | ||
357 | buf += "static void " + fabric_mod_name + "_drop_" + fabric_mod_port + "(struct se_wwn *wwn)\n" | ||
358 | buf += "{\n" | ||
359 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = container_of(wwn,\n" | ||
360 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n" | ||
361 | buf += " kfree(" + fabric_mod_port + ");\n" | ||
362 | buf += "}\n\n" | ||
363 | buf += "static ssize_t " + fabric_mod_name + "_wwn_show_attr_version(\n" | ||
364 | buf += " struct target_fabric_configfs *tf,\n" | ||
365 | buf += " char *page)\n" | ||
366 | buf += "{\n" | ||
367 | buf += " return sprintf(page, \"" + fabric_mod_name.upper() + " fabric module %s on %s/%s\"\n" | ||
368 | buf += " \"on \"UTS_RELEASE\"\\n\", " + fabric_mod_name.upper() + "_VERSION, utsname()->sysname,\n" | ||
369 | buf += " utsname()->machine);\n" | ||
370 | buf += "}\n\n" | ||
371 | buf += "TF_WWN_ATTR_RO(" + fabric_mod_name + ", version);\n\n" | ||
372 | buf += "static struct configfs_attribute *" + fabric_mod_name + "_wwn_attrs[] = {\n" | ||
373 | buf += " &" + fabric_mod_name + "_wwn_version.attr,\n" | ||
374 | buf += " NULL,\n" | ||
375 | buf += "};\n\n" | ||
376 | |||
377 | buf += "static struct target_core_fabric_ops " + fabric_mod_name + "_ops = {\n" | ||
378 | buf += " .get_fabric_name = " + fabric_mod_name + "_get_fabric_name,\n" | ||
379 | buf += " .get_fabric_proto_ident = " + fabric_mod_name + "_get_fabric_proto_ident,\n" | ||
380 | buf += " .tpg_get_wwn = " + fabric_mod_name + "_get_fabric_wwn,\n" | ||
381 | buf += " .tpg_get_tag = " + fabric_mod_name + "_get_tag,\n" | ||
382 | buf += " .tpg_get_default_depth = " + fabric_mod_name + "_get_default_depth,\n" | ||
383 | buf += " .tpg_get_pr_transport_id = " + fabric_mod_name + "_get_pr_transport_id,\n" | ||
384 | buf += " .tpg_get_pr_transport_id_len = " + fabric_mod_name + "_get_pr_transport_id_len,\n" | ||
385 | buf += " .tpg_parse_pr_out_transport_id = " + fabric_mod_name + "_parse_pr_out_transport_id,\n" | ||
386 | buf += " .tpg_check_demo_mode = " + fabric_mod_name + "_check_false,\n" | ||
387 | buf += " .tpg_check_demo_mode_cache = " + fabric_mod_name + "_check_true,\n" | ||
388 | buf += " .tpg_check_demo_mode_write_protect = " + fabric_mod_name + "_check_true,\n" | ||
389 | buf += " .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n" | ||
390 | buf += " .tpg_alloc_fabric_acl = " + fabric_mod_name + "_alloc_fabric_acl,\n" | ||
391 | buf += " .tpg_release_fabric_acl = " + fabric_mod_name + "_release_fabric_acl,\n" | ||
392 | buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n" | ||
393 | buf += " .release_cmd_to_pool = " + fabric_mod_name + "_release_cmd,\n" | ||
394 | buf += " .release_cmd_direct = " + fabric_mod_name + "_release_cmd,\n" | ||
395 | buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n" | ||
396 | buf += " .close_session = " + fabric_mod_name + "_close_session,\n" | ||
397 | buf += " .stop_session = " + fabric_mod_name + "_stop_session,\n" | ||
398 | buf += " .fall_back_to_erl0 = " + fabric_mod_name + "_reset_nexus,\n" | ||
399 | buf += " .sess_logged_in = " + fabric_mod_name + "_sess_logged_in,\n" | ||
400 | buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n" | ||
401 | buf += " .sess_get_initiator_sid = NULL,\n" | ||
402 | buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" | ||
403 | buf += " .write_pending_status = " + fabric_mod_name + "_write_pending_status,\n" | ||
404 | buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n" | ||
405 | buf += " .get_task_tag = " + fabric_mod_name + "_get_task_tag,\n" | ||
406 | buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n" | ||
407 | buf += " .new_cmd_failure = " + fabric_mod_name + "_new_cmd_failure,\n" | ||
408 | buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" | ||
409 | buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" | ||
410 | buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n" | ||
411 | buf += " .get_fabric_sense_len = " + fabric_mod_name + "_get_fabric_sense_len,\n" | ||
412 | buf += " .set_fabric_sense_len = " + fabric_mod_name + "_set_fabric_sense_len,\n" | ||
413 | buf += " .is_state_remove = " + fabric_mod_name + "_is_state_remove,\n" | ||
414 | buf += " .pack_lun = " + fabric_mod_name + "_pack_lun,\n" | ||
415 | buf += " /*\n" | ||
416 | buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n" | ||
417 | buf += " */\n" | ||
418 | buf += " .fabric_make_wwn = " + fabric_mod_name + "_make_" + fabric_mod_port + ",\n" | ||
419 | buf += " .fabric_drop_wwn = " + fabric_mod_name + "_drop_" + fabric_mod_port + ",\n" | ||
420 | buf += " .fabric_make_tpg = " + fabric_mod_name + "_make_tpg,\n" | ||
421 | buf += " .fabric_drop_tpg = " + fabric_mod_name + "_drop_tpg,\n" | ||
422 | buf += " .fabric_post_link = NULL,\n" | ||
423 | buf += " .fabric_pre_unlink = NULL,\n" | ||
424 | buf += " .fabric_make_np = NULL,\n" | ||
425 | buf += " .fabric_drop_np = NULL,\n" | ||
426 | buf += " .fabric_make_nodeacl = " + fabric_mod_name + "_make_nodeacl,\n" | ||
427 | buf += " .fabric_drop_nodeacl = " + fabric_mod_name + "_drop_nodeacl,\n" | ||
428 | buf += "};\n\n" | ||
429 | |||
430 | buf += "static int " + fabric_mod_name + "_register_configfs(void)\n" | ||
431 | buf += "{\n" | ||
432 | buf += " struct target_fabric_configfs *fabric;\n" | ||
433 | buf += " int ret;\n\n" | ||
434 | buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + " fabric module %s on %s/%s\"\n" | ||
435 | buf += " \" on \"UTS_RELEASE\"\\n\"," + fabric_mod_name.upper() + "_VERSION, utsname()->sysname,\n" | ||
436 | buf += " utsname()->machine);\n" | ||
437 | buf += " /*\n" | ||
438 | buf += " * Register the top level struct config_item_type with TCM core\n" | ||
439 | buf += " */\n" | ||
440 | buf += " fabric = target_fabric_configfs_init(THIS_MODULE, \"" + fabric_mod_name[4:] + "\");\n" | ||
441 | buf += " if (!(fabric)) {\n" | ||
442 | buf += " printk(KERN_ERR \"target_fabric_configfs_init() failed\\n\");\n" | ||
443 | buf += " return -ENOMEM;\n" | ||
444 | buf += " }\n" | ||
445 | buf += " /*\n" | ||
446 | buf += " * Setup fabric->tf_ops from our local " + fabric_mod_name + "_ops\n" | ||
447 | buf += " */\n" | ||
448 | buf += " fabric->tf_ops = " + fabric_mod_name + "_ops;\n" | ||
449 | buf += " /*\n" | ||
450 | buf += " * Setup default attribute lists for various fabric->tf_cit_tmpl\n" | ||
451 | buf += " */\n" | ||
452 | buf += " TF_CIT_TMPL(fabric)->tfc_wwn_cit.ct_attrs = " + fabric_mod_name + "_wwn_attrs;\n" | ||
453 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_base_cit.ct_attrs = NULL;\n" | ||
454 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_attrib_cit.ct_attrs = NULL;\n" | ||
455 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_param_cit.ct_attrs = NULL;\n" | ||
456 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_np_base_cit.ct_attrs = NULL;\n" | ||
457 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_base_cit.ct_attrs = NULL;\n" | ||
458 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_attrib_cit.ct_attrs = NULL;\n" | ||
459 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_auth_cit.ct_attrs = NULL;\n" | ||
460 | buf += " TF_CIT_TMPL(fabric)->tfc_tpg_nacl_param_cit.ct_attrs = NULL;\n" | ||
461 | buf += " /*\n" | ||
462 | buf += " * Register the fabric for use within TCM\n" | ||
463 | buf += " */\n" | ||
464 | buf += " ret = target_fabric_configfs_register(fabric);\n" | ||
465 | buf += " if (ret < 0) {\n" | ||
466 | buf += " printk(KERN_ERR \"target_fabric_configfs_register() failed\"\n" | ||
467 | buf += " \" for " + fabric_mod_name.upper() + "\\n\");\n" | ||
468 | buf += " return ret;\n" | ||
469 | buf += " }\n" | ||
470 | buf += " /*\n" | ||
471 | buf += " * Setup our local pointer to *fabric\n" | ||
472 | buf += " */\n" | ||
473 | buf += " " + fabric_mod_name + "_fabric_configfs = fabric;\n" | ||
474 | buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Set fabric -> " + fabric_mod_name + "_fabric_configfs\\n\");\n" | ||
475 | buf += " return 0;\n" | ||
476 | buf += "};\n\n" | ||
477 | buf += "static void " + fabric_mod_name + "_deregister_configfs(void)\n" | ||
478 | buf += "{\n" | ||
479 | buf += " if (!(" + fabric_mod_name + "_fabric_configfs))\n" | ||
480 | buf += " return;\n\n" | ||
481 | buf += " target_fabric_configfs_deregister(" + fabric_mod_name + "_fabric_configfs);\n" | ||
482 | buf += " " + fabric_mod_name + "_fabric_configfs = NULL;\n" | ||
483 | buf += " printk(KERN_INFO \"" + fabric_mod_name.upper() + "[0] - Cleared " + fabric_mod_name + "_fabric_configfs\\n\");\n" | ||
484 | buf += "};\n\n" | ||
485 | |||
486 | buf += "static int __init " + fabric_mod_name + "_init(void)\n" | ||
487 | buf += "{\n" | ||
488 | buf += " int ret;\n\n" | ||
489 | buf += " ret = " + fabric_mod_name + "_register_configfs();\n" | ||
490 | buf += " if (ret < 0)\n" | ||
491 | buf += " return ret;\n\n" | ||
492 | buf += " return 0;\n" | ||
493 | buf += "};\n\n" | ||
494 | buf += "static void " + fabric_mod_name + "_exit(void)\n" | ||
495 | buf += "{\n" | ||
496 | buf += " " + fabric_mod_name + "_deregister_configfs();\n" | ||
497 | buf += "};\n\n" | ||
498 | |||
499 | buf += "#ifdef MODULE\n" | ||
500 | buf += "MODULE_DESCRIPTION(\"" + fabric_mod_name.upper() + " series fabric driver\");\n" | ||
501 | buf += "MODULE_LICENSE(\"GPL\");\n" | ||
502 | buf += "module_init(" + fabric_mod_name + "_init);\n" | ||
503 | buf += "module_exit(" + fabric_mod_name + "_exit);\n" | ||
504 | buf += "#endif\n" | ||
505 | |||
506 | ret = p.write(buf) | ||
507 | if ret: | ||
508 | tcm_mod_err("Unable to write f: " + f) | ||
509 | |||
510 | p.close() | ||
511 | |||
512 | return | ||
513 | |||
514 | def tcm_mod_scan_fabric_ops(tcm_dir): | ||
515 | |||
516 | fabric_ops_api = tcm_dir + "include/target/target_core_fabric_ops.h" | ||
517 | |||
518 | print "Using tcm_mod_scan_fabric_ops: " + fabric_ops_api | ||
519 | process_fo = 0; | ||
520 | |||
521 | p = open(fabric_ops_api, 'r') | ||
522 | |||
523 | line = p.readline() | ||
524 | while line: | ||
525 | if process_fo == 0 and re.search('struct target_core_fabric_ops {', line): | ||
526 | line = p.readline() | ||
527 | continue | ||
528 | |||
529 | if process_fo == 0: | ||
530 | process_fo = 1; | ||
531 | line = p.readline() | ||
532 | # Search for function pointer | ||
533 | if not re.search('\(\*', line): | ||
534 | continue | ||
535 | |||
536 | fabric_ops.append(line.rstrip()) | ||
537 | continue | ||
538 | |||
539 | line = p.readline() | ||
540 | # Search for function pointer | ||
541 | if not re.search('\(\*', line): | ||
542 | continue | ||
543 | |||
544 | fabric_ops.append(line.rstrip()) | ||
545 | |||
546 | p.close() | ||
547 | return | ||
548 | |||
549 | def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | ||
550 | buf = "" | ||
551 | bufi = "" | ||
552 | |||
553 | f = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.c" | ||
554 | print "Writing file: " + f | ||
555 | |||
556 | p = open(f, 'w') | ||
557 | if not p: | ||
558 | tcm_mod_err("Unable to open file: " + f) | ||
559 | |||
560 | fi = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.h" | ||
561 | print "Writing file: " + fi | ||
562 | |||
563 | pi = open(fi, 'w') | ||
564 | if not pi: | ||
565 | tcm_mod_err("Unable to open file: " + fi) | ||
566 | |||
567 | buf = "#include <linux/slab.h>\n" | ||
568 | buf += "#include <linux/kthread.h>\n" | ||
569 | buf += "#include <linux/types.h>\n" | ||
570 | buf += "#include <linux/list.h>\n" | ||
571 | buf += "#include <linux/types.h>\n" | ||
572 | buf += "#include <linux/string.h>\n" | ||
573 | buf += "#include <linux/ctype.h>\n" | ||
574 | buf += "#include <asm/unaligned.h>\n" | ||
575 | buf += "#include <scsi/scsi.h>\n" | ||
576 | buf += "#include <scsi/scsi_host.h>\n" | ||
577 | buf += "#include <scsi/scsi_device.h>\n" | ||
578 | buf += "#include <scsi/scsi_cmnd.h>\n" | ||
579 | buf += "#include <scsi/libfc.h>\n\n" | ||
580 | buf += "#include <target/target_core_base.h>\n" | ||
581 | buf += "#include <target/target_core_transport.h>\n" | ||
582 | buf += "#include <target/target_core_fabric_ops.h>\n" | ||
583 | buf += "#include <target/target_core_fabric_lib.h>\n" | ||
584 | buf += "#include <target/target_core_device.h>\n" | ||
585 | buf += "#include <target/target_core_tpg.h>\n" | ||
586 | buf += "#include <target/target_core_configfs.h>\n" | ||
587 | buf += "#include <" + fabric_mod_name + "_base.h>\n" | ||
588 | buf += "#include <" + fabric_mod_name + "_fabric.h>\n\n" | ||
589 | |||
590 | buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n" | ||
591 | buf += "{\n" | ||
592 | buf += " return 1;\n" | ||
593 | buf += "}\n\n" | ||
594 | bufi += "int " + fabric_mod_name + "_check_true(struct se_portal_group *);\n" | ||
595 | |||
596 | buf += "int " + fabric_mod_name + "_check_false(struct se_portal_group *se_tpg)\n" | ||
597 | buf += "{\n" | ||
598 | buf += " return 0;\n" | ||
599 | buf += "}\n\n" | ||
600 | bufi += "int " + fabric_mod_name + "_check_false(struct se_portal_group *);\n" | ||
601 | |||
602 | total_fabric_ops = len(fabric_ops) | ||
603 | i = 0 | ||
604 | |||
605 | while i < total_fabric_ops: | ||
606 | fo = fabric_ops[i] | ||
607 | i += 1 | ||
608 | # print "fabric_ops: " + fo | ||
609 | |||
610 | if re.search('get_fabric_name', fo): | ||
611 | buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n" | ||
612 | buf += "{\n" | ||
613 | buf += " return \"" + fabric_mod_name[4:] + "\";\n" | ||
614 | buf += "}\n\n" | ||
615 | bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n" | ||
616 | continue | ||
617 | |||
618 | if re.search('get_fabric_proto_ident', fo): | ||
619 | buf += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *se_tpg)\n" | ||
620 | buf += "{\n" | ||
621 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
622 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
623 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n" | ||
624 | buf += " u8 proto_id;\n\n" | ||
625 | buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n" | ||
626 | if proto_ident == "FC": | ||
627 | buf += " case SCSI_PROTOCOL_FCP:\n" | ||
628 | buf += " default:\n" | ||
629 | buf += " proto_id = fc_get_fabric_proto_ident(se_tpg);\n" | ||
630 | buf += " break;\n" | ||
631 | elif proto_ident == "SAS": | ||
632 | buf += " case SCSI_PROTOCOL_SAS:\n" | ||
633 | buf += " default:\n" | ||
634 | buf += " proto_id = sas_get_fabric_proto_ident(se_tpg);\n" | ||
635 | buf += " break;\n" | ||
636 | elif proto_ident == "iSCSI": | ||
637 | buf += " case SCSI_PROTOCOL_ISCSI:\n" | ||
638 | buf += " default:\n" | ||
639 | buf += " proto_id = iscsi_get_fabric_proto_ident(se_tpg);\n" | ||
640 | buf += " break;\n" | ||
641 | |||
642 | buf += " }\n\n" | ||
643 | buf += " return proto_id;\n" | ||
644 | buf += "}\n\n" | ||
645 | bufi += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *);\n" | ||
646 | |||
647 | if re.search('get_wwn', fo): | ||
648 | buf += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *se_tpg)\n" | ||
649 | buf += "{\n" | ||
650 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
651 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
652 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n\n" | ||
653 | buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_name[0];\n" | ||
654 | buf += "}\n\n" | ||
655 | bufi += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *);\n" | ||
656 | |||
657 | if re.search('get_tag', fo): | ||
658 | buf += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *se_tpg)\n" | ||
659 | buf += "{\n" | ||
660 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
661 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
662 | buf += " return tpg->" + fabric_mod_port + "_tpgt;\n" | ||
663 | buf += "}\n\n" | ||
664 | bufi += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *);\n" | ||
665 | |||
666 | if re.search('get_default_depth', fo): | ||
667 | buf += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *se_tpg)\n" | ||
668 | buf += "{\n" | ||
669 | buf += " return 1;\n" | ||
670 | buf += "}\n\n" | ||
671 | bufi += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *);\n" | ||
672 | |||
673 | if re.search('get_pr_transport_id\)\(', fo): | ||
674 | buf += "u32 " + fabric_mod_name + "_get_pr_transport_id(\n" | ||
675 | buf += " struct se_portal_group *se_tpg,\n" | ||
676 | buf += " struct se_node_acl *se_nacl,\n" | ||
677 | buf += " struct t10_pr_registration *pr_reg,\n" | ||
678 | buf += " int *format_code,\n" | ||
679 | buf += " unsigned char *buf)\n" | ||
680 | buf += "{\n" | ||
681 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
682 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
683 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n" | ||
684 | buf += " int ret = 0;\n\n" | ||
685 | buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n" | ||
686 | if proto_ident == "FC": | ||
687 | buf += " case SCSI_PROTOCOL_FCP:\n" | ||
688 | buf += " default:\n" | ||
689 | buf += " ret = fc_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n" | ||
690 | buf += " format_code, buf);\n" | ||
691 | buf += " break;\n" | ||
692 | elif proto_ident == "SAS": | ||
693 | buf += " case SCSI_PROTOCOL_SAS:\n" | ||
694 | buf += " default:\n" | ||
695 | buf += " ret = sas_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n" | ||
696 | buf += " format_code, buf);\n" | ||
697 | buf += " break;\n" | ||
698 | elif proto_ident == "iSCSI": | ||
699 | buf += " case SCSI_PROTOCOL_ISCSI:\n" | ||
700 | buf += " default:\n" | ||
701 | buf += " ret = iscsi_get_pr_transport_id(se_tpg, se_nacl, pr_reg,\n" | ||
702 | buf += " format_code, buf);\n" | ||
703 | buf += " break;\n" | ||
704 | |||
705 | buf += " }\n\n" | ||
706 | buf += " return ret;\n" | ||
707 | buf += "}\n\n" | ||
708 | bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id(struct se_portal_group *,\n" | ||
709 | bufi += " struct se_node_acl *, struct t10_pr_registration *,\n" | ||
710 | bufi += " int *, unsigned char *);\n" | ||
711 | |||
712 | if re.search('get_pr_transport_id_len\)\(', fo): | ||
713 | buf += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(\n" | ||
714 | buf += " struct se_portal_group *se_tpg,\n" | ||
715 | buf += " struct se_node_acl *se_nacl,\n" | ||
716 | buf += " struct t10_pr_registration *pr_reg,\n" | ||
717 | buf += " int *format_code)\n" | ||
718 | buf += "{\n" | ||
719 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
720 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
721 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n" | ||
722 | buf += " int ret = 0;\n\n" | ||
723 | buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n" | ||
724 | if proto_ident == "FC": | ||
725 | buf += " case SCSI_PROTOCOL_FCP:\n" | ||
726 | buf += " default:\n" | ||
727 | buf += " ret = fc_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n" | ||
728 | buf += " format_code);\n" | ||
729 | buf += " break;\n" | ||
730 | elif proto_ident == "SAS": | ||
731 | buf += " case SCSI_PROTOCOL_SAS:\n" | ||
732 | buf += " default:\n" | ||
733 | buf += " ret = sas_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n" | ||
734 | buf += " format_code);\n" | ||
735 | buf += " break;\n" | ||
736 | elif proto_ident == "iSCSI": | ||
737 | buf += " case SCSI_PROTOCOL_ISCSI:\n" | ||
738 | buf += " default:\n" | ||
739 | buf += " ret = iscsi_get_pr_transport_id_len(se_tpg, se_nacl, pr_reg,\n" | ||
740 | buf += " format_code);\n" | ||
741 | buf += " break;\n" | ||
742 | |||
743 | |||
744 | buf += " }\n\n" | ||
745 | buf += " return ret;\n" | ||
746 | buf += "}\n\n" | ||
747 | bufi += "u32 " + fabric_mod_name + "_get_pr_transport_id_len(struct se_portal_group *,\n" | ||
748 | bufi += " struct se_node_acl *, struct t10_pr_registration *,\n" | ||
749 | bufi += " int *);\n" | ||
750 | |||
751 | if re.search('parse_pr_out_transport_id\)\(', fo): | ||
752 | buf += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(\n" | ||
753 | buf += " struct se_portal_group *se_tpg,\n" | ||
754 | buf += " const char *buf,\n" | ||
755 | buf += " u32 *out_tid_len,\n" | ||
756 | buf += " char **port_nexus_ptr)\n" | ||
757 | buf += "{\n" | ||
758 | buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" | ||
759 | buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" | ||
760 | buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n" | ||
761 | buf += " char *tid = NULL;\n\n" | ||
762 | buf += " switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n" | ||
763 | if proto_ident == "FC": | ||
764 | buf += " case SCSI_PROTOCOL_FCP:\n" | ||
765 | buf += " default:\n" | ||
766 | buf += " tid = fc_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n" | ||
767 | buf += " port_nexus_ptr);\n" | ||
768 | elif proto_ident == "SAS": | ||
769 | buf += " case SCSI_PROTOCOL_SAS:\n" | ||
770 | buf += " default:\n" | ||
771 | buf += " tid = sas_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n" | ||
772 | buf += " port_nexus_ptr);\n" | ||
773 | elif proto_ident == "iSCSI": | ||
774 | buf += " case SCSI_PROTOCOL_ISCSI:\n" | ||
775 | buf += " default:\n" | ||
776 | buf += " tid = iscsi_parse_pr_out_transport_id(se_tpg, buf, out_tid_len,\n" | ||
777 | buf += " port_nexus_ptr);\n" | ||
778 | |||
779 | buf += " }\n\n" | ||
780 | buf += " return tid;\n" | ||
781 | buf += "}\n\n" | ||
782 | bufi += "char *" + fabric_mod_name + "_parse_pr_out_transport_id(struct se_portal_group *,\n" | ||
783 | bufi += " const char *, u32 *, char **);\n" | ||
784 | |||
785 | if re.search('alloc_fabric_acl\)\(', fo): | ||
786 | buf += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *se_tpg)\n" | ||
787 | buf += "{\n" | ||
788 | buf += " struct " + fabric_mod_name + "_nacl *nacl;\n\n" | ||
789 | buf += " nacl = kzalloc(sizeof(struct " + fabric_mod_name + "_nacl), GFP_KERNEL);\n" | ||
790 | buf += " if (!(nacl)) {\n" | ||
791 | buf += " printk(KERN_ERR \"Unable to alocate struct " + fabric_mod_name + "_nacl\\n\");\n" | ||
792 | buf += " return NULL;\n" | ||
793 | buf += " }\n\n" | ||
794 | buf += " return &nacl->se_node_acl;\n" | ||
795 | buf += "}\n\n" | ||
796 | bufi += "struct se_node_acl *" + fabric_mod_name + "_alloc_fabric_acl(struct se_portal_group *);\n" | ||
797 | |||
798 | if re.search('release_fabric_acl\)\(', fo): | ||
799 | buf += "void " + fabric_mod_name + "_release_fabric_acl(\n" | ||
800 | buf += " struct se_portal_group *se_tpg,\n" | ||
801 | buf += " struct se_node_acl *se_nacl)\n" | ||
802 | buf += "{\n" | ||
803 | buf += " struct " + fabric_mod_name + "_nacl *nacl = container_of(se_nacl,\n" | ||
804 | buf += " struct " + fabric_mod_name + "_nacl, se_node_acl);\n" | ||
805 | buf += " kfree(nacl);\n" | ||
806 | buf += "}\n\n" | ||
807 | bufi += "void " + fabric_mod_name + "_release_fabric_acl(struct se_portal_group *,\n" | ||
808 | bufi += " struct se_node_acl *);\n" | ||
809 | |||
810 | if re.search('tpg_get_inst_index\)\(', fo): | ||
811 | buf += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *se_tpg)\n" | ||
812 | buf += "{\n" | ||
813 | buf += " return 1;\n" | ||
814 | buf += "}\n\n" | ||
815 | bufi += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *);\n" | ||
816 | |||
817 | if re.search('release_cmd_to_pool', fo): | ||
818 | buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n" | ||
819 | buf += "{\n" | ||
820 | buf += " return;\n" | ||
821 | buf += "}\n\n" | ||
822 | bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n" | ||
823 | |||
824 | if re.search('shutdown_session\)\(', fo): | ||
825 | buf += "int " + fabric_mod_name + "_shutdown_session(struct se_session *se_sess)\n" | ||
826 | buf += "{\n" | ||
827 | buf += " return 0;\n" | ||
828 | buf += "}\n\n" | ||
829 | bufi += "int " + fabric_mod_name + "_shutdown_session(struct se_session *);\n" | ||
830 | |||
831 | if re.search('close_session\)\(', fo): | ||
832 | buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n" | ||
833 | buf += "{\n" | ||
834 | buf += " return;\n" | ||
835 | buf += "}\n\n" | ||
836 | bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n" | ||
837 | |||
838 | if re.search('stop_session\)\(', fo): | ||
839 | buf += "void " + fabric_mod_name + "_stop_session(struct se_session *se_sess, int sess_sleep , int conn_sleep)\n" | ||
840 | buf += "{\n" | ||
841 | buf += " return;\n" | ||
842 | buf += "}\n\n" | ||
843 | bufi += "void " + fabric_mod_name + "_stop_session(struct se_session *, int, int);\n" | ||
844 | |||
845 | if re.search('fall_back_to_erl0\)\(', fo): | ||
846 | buf += "void " + fabric_mod_name + "_reset_nexus(struct se_session *se_sess)\n" | ||
847 | buf += "{\n" | ||
848 | buf += " return;\n" | ||
849 | buf += "}\n\n" | ||
850 | bufi += "void " + fabric_mod_name + "_reset_nexus(struct se_session *);\n" | ||
851 | |||
852 | if re.search('sess_logged_in\)\(', fo): | ||
853 | buf += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *se_sess)\n" | ||
854 | buf += "{\n" | ||
855 | buf += " return 0;\n" | ||
856 | buf += "}\n\n" | ||
857 | bufi += "int " + fabric_mod_name + "_sess_logged_in(struct se_session *);\n" | ||
858 | |||
859 | if re.search('sess_get_index\)\(', fo): | ||
860 | buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n" | ||
861 | buf += "{\n" | ||
862 | buf += " return 0;\n" | ||
863 | buf += "}\n\n" | ||
864 | bufi += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *);\n" | ||
865 | |||
866 | if re.search('write_pending\)\(', fo): | ||
867 | buf += "int " + fabric_mod_name + "_write_pending(struct se_cmd *se_cmd)\n" | ||
868 | buf += "{\n" | ||
869 | buf += " return 0;\n" | ||
870 | buf += "}\n\n" | ||
871 | bufi += "int " + fabric_mod_name + "_write_pending(struct se_cmd *);\n" | ||
872 | |||
873 | if re.search('write_pending_status\)\(', fo): | ||
874 | buf += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *se_cmd)\n" | ||
875 | buf += "{\n" | ||
876 | buf += " return 0;\n" | ||
877 | buf += "}\n\n" | ||
878 | bufi += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *);\n" | ||
879 | |||
880 | if re.search('set_default_node_attributes\)\(', fo): | ||
881 | buf += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *nacl)\n" | ||
882 | buf += "{\n" | ||
883 | buf += " return;\n" | ||
884 | buf += "}\n\n" | ||
885 | bufi += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *);\n" | ||
886 | |||
887 | if re.search('get_task_tag\)\(', fo): | ||
888 | buf += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *se_cmd)\n" | ||
889 | buf += "{\n" | ||
890 | buf += " return 0;\n" | ||
891 | buf += "}\n\n" | ||
892 | bufi += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *);\n" | ||
893 | |||
894 | if re.search('get_cmd_state\)\(', fo): | ||
895 | buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n" | ||
896 | buf += "{\n" | ||
897 | buf += " return 0;\n" | ||
898 | buf += "}\n\n" | ||
899 | bufi += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *);\n" | ||
900 | |||
901 | if re.search('new_cmd_failure\)\(', fo): | ||
902 | buf += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *se_cmd)\n" | ||
903 | buf += "{\n" | ||
904 | buf += " return;\n" | ||
905 | buf += "}\n\n" | ||
906 | bufi += "void " + fabric_mod_name + "_new_cmd_failure(struct se_cmd *);\n" | ||
907 | |||
908 | if re.search('queue_data_in\)\(', fo): | ||
909 | buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n" | ||
910 | buf += "{\n" | ||
911 | buf += " return 0;\n" | ||
912 | buf += "}\n\n" | ||
913 | bufi += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *);\n" | ||
914 | |||
915 | if re.search('queue_status\)\(', fo): | ||
916 | buf += "int " + fabric_mod_name + "_queue_status(struct se_cmd *se_cmd)\n" | ||
917 | buf += "{\n" | ||
918 | buf += " return 0;\n" | ||
919 | buf += "}\n\n" | ||
920 | bufi += "int " + fabric_mod_name + "_queue_status(struct se_cmd *);\n" | ||
921 | |||
922 | if re.search('queue_tm_rsp\)\(', fo): | ||
923 | buf += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n" | ||
924 | buf += "{\n" | ||
925 | buf += " return 0;\n" | ||
926 | buf += "}\n\n" | ||
927 | bufi += "int " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *);\n" | ||
928 | |||
929 | if re.search('get_fabric_sense_len\)\(', fo): | ||
930 | buf += "u16 " + fabric_mod_name + "_get_fabric_sense_len(void)\n" | ||
931 | buf += "{\n" | ||
932 | buf += " return 0;\n" | ||
933 | buf += "}\n\n" | ||
934 | bufi += "u16 " + fabric_mod_name + "_get_fabric_sense_len(void);\n" | ||
935 | |||
936 | if re.search('set_fabric_sense_len\)\(', fo): | ||
937 | buf += "u16 " + fabric_mod_name + "_set_fabric_sense_len(struct se_cmd *se_cmd, u32 sense_length)\n" | ||
938 | buf += "{\n" | ||
939 | buf += " return 0;\n" | ||
940 | buf += "}\n\n" | ||
941 | bufi += "u16 " + fabric_mod_name + "_set_fabric_sense_len(struct se_cmd *, u32);\n" | ||
942 | |||
943 | if re.search('is_state_remove\)\(', fo): | ||
944 | buf += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *se_cmd)\n" | ||
945 | buf += "{\n" | ||
946 | buf += " return 0;\n" | ||
947 | buf += "}\n\n" | ||
948 | bufi += "int " + fabric_mod_name + "_is_state_remove(struct se_cmd *);\n" | ||
949 | |||
950 | if re.search('pack_lun\)\(', fo): | ||
951 | buf += "u64 " + fabric_mod_name + "_pack_lun(unsigned int lun)\n" | ||
952 | buf += "{\n" | ||
953 | buf += " WARN_ON(lun >= 256);\n" | ||
954 | buf += " /* Caller wants this byte-swapped */\n" | ||
955 | buf += " return cpu_to_le64((lun & 0xff) << 8);\n" | ||
956 | buf += "}\n\n" | ||
957 | bufi += "u64 " + fabric_mod_name + "_pack_lun(unsigned int);\n" | ||
958 | |||
959 | |||
960 | ret = p.write(buf) | ||
961 | if ret: | ||
962 | tcm_mod_err("Unable to write f: " + f) | ||
963 | |||
964 | p.close() | ||
965 | |||
966 | ret = pi.write(bufi) | ||
967 | if ret: | ||
968 | tcm_mod_err("Unable to write fi: " + fi) | ||
969 | |||
970 | pi.close() | ||
971 | return | ||
972 | |||
973 | def tcm_mod_build_kbuild(fabric_mod_dir_var, fabric_mod_name): | ||
974 | |||
975 | buf = "" | ||
976 | f = fabric_mod_dir_var + "/Kbuild" | ||
977 | print "Writing file: " + f | ||
978 | |||
979 | p = open(f, 'w') | ||
980 | if not p: | ||
981 | tcm_mod_err("Unable to open file: " + f) | ||
982 | |||
983 | buf = "EXTRA_CFLAGS += -I$(srctree)/drivers/target/ -I$(srctree)/include/ -I$(srctree)/drivers/scsi/ -I$(srctree)/include/scsi/ -I$(srctree)/drivers/target/" + fabric_mod_name + "\n\n" | ||
984 | buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n" | ||
985 | buf += " " + fabric_mod_name + "_configfs.o\n" | ||
986 | buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n" | ||
987 | |||
988 | ret = p.write(buf) | ||
989 | if ret: | ||
990 | tcm_mod_err("Unable to write f: " + f) | ||
991 | |||
992 | p.close() | ||
993 | return | ||
994 | |||
995 | def tcm_mod_build_kconfig(fabric_mod_dir_var, fabric_mod_name): | ||
996 | |||
997 | buf = "" | ||
998 | f = fabric_mod_dir_var + "/Kconfig" | ||
999 | print "Writing file: " + f | ||
1000 | |||
1001 | p = open(f, 'w') | ||
1002 | if not p: | ||
1003 | tcm_mod_err("Unable to open file: " + f) | ||
1004 | |||
1005 | buf = "config " + fabric_mod_name.upper() + "\n" | ||
1006 | buf += " tristate \"" + fabric_mod_name.upper() + " fabric module\"\n" | ||
1007 | buf += " depends on TARGET_CORE && CONFIGFS_FS\n" | ||
1008 | buf += " default n\n" | ||
1009 | buf += " ---help---\n" | ||
1010 | buf += " Say Y here to enable the " + fabric_mod_name.upper() + " fabric module\n" | ||
1011 | |||
1012 | ret = p.write(buf) | ||
1013 | if ret: | ||
1014 | tcm_mod_err("Unable to write f: " + f) | ||
1015 | |||
1016 | p.close() | ||
1017 | return | ||
1018 | |||
1019 | def tcm_mod_add_kbuild(tcm_dir, fabric_mod_name): | ||
1020 | buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n" | ||
1021 | kbuild = tcm_dir + "/drivers/target/Kbuild" | ||
1022 | |||
1023 | f = open(kbuild, 'a') | ||
1024 | f.write(buf) | ||
1025 | f.close() | ||
1026 | return | ||
1027 | |||
1028 | def tcm_mod_add_kconfig(tcm_dir, fabric_mod_name): | ||
1029 | buf = "source \"drivers/target/" + fabric_mod_name.lower() + "/Kconfig\"\n" | ||
1030 | kconfig = tcm_dir + "/drivers/target/Kconfig" | ||
1031 | |||
1032 | f = open(kconfig, 'a') | ||
1033 | f.write(buf) | ||
1034 | f.close() | ||
1035 | return | ||
1036 | |||
1037 | def main(modname, proto_ident): | ||
1038 | # proto_ident = "FC" | ||
1039 | # proto_ident = "SAS" | ||
1040 | # proto_ident = "iSCSI" | ||
1041 | |||
1042 | tcm_dir = os.getcwd(); | ||
1043 | tcm_dir += "/../../" | ||
1044 | print "tcm_dir: " + tcm_dir | ||
1045 | fabric_mod_name = modname | ||
1046 | fabric_mod_dir = tcm_dir + "drivers/target/" + fabric_mod_name | ||
1047 | print "Set fabric_mod_name: " + fabric_mod_name | ||
1048 | print "Set fabric_mod_dir: " + fabric_mod_dir | ||
1049 | print "Using proto_ident: " + proto_ident | ||
1050 | |||
1051 | if proto_ident != "FC" and proto_ident != "SAS" and proto_ident != "iSCSI": | ||
1052 | print "Unsupported proto_ident: " + proto_ident | ||
1053 | sys.exit(1) | ||
1054 | |||
1055 | ret = tcm_mod_create_module_subdir(fabric_mod_dir) | ||
1056 | if ret: | ||
1057 | print "tcm_mod_create_module_subdir() failed because module already exists!" | ||
1058 | sys.exit(1) | ||
1059 | |||
1060 | tcm_mod_build_base_includes(proto_ident, fabric_mod_dir, fabric_mod_name) | ||
1061 | tcm_mod_scan_fabric_ops(tcm_dir) | ||
1062 | tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir, fabric_mod_name) | ||
1063 | tcm_mod_build_configfs(proto_ident, fabric_mod_dir, fabric_mod_name) | ||
1064 | tcm_mod_build_kbuild(fabric_mod_dir, fabric_mod_name) | ||
1065 | tcm_mod_build_kconfig(fabric_mod_dir, fabric_mod_name) | ||
1066 | |||
1067 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kbuild..? [yes,no]: ") | ||
1068 | if input == "yes" or input == "y": | ||
1069 | tcm_mod_add_kbuild(tcm_dir, fabric_mod_name) | ||
1070 | |||
1071 | input = raw_input("Would you like to add " + fabric_mod_name + "to drivers/target/Kconfig..? [yes,no]: ") | ||
1072 | if input == "yes" or input == "y": | ||
1073 | tcm_mod_add_kconfig(tcm_dir, fabric_mod_name) | ||
1074 | |||
1075 | return | ||
1076 | |||
1077 | parser = optparse.OptionParser() | ||
1078 | parser.add_option('-m', '--modulename', help='Module name', dest='modname', | ||
1079 | action='store', nargs=1, type='string') | ||
1080 | parser.add_option('-p', '--protoident', help='Protocol Ident', dest='protoident', | ||
1081 | action='store', nargs=1, type='string') | ||
1082 | |||
1083 | (opts, args) = parser.parse_args() | ||
1084 | |||
1085 | mandatories = ['modname', 'protoident'] | ||
1086 | for m in mandatories: | ||
1087 | if not opts.__dict__[m]: | ||
1088 | print "mandatory option is missing\n" | ||
1089 | parser.print_help() | ||
1090 | exit(-1) | ||
1091 | |||
1092 | if __name__ == "__main__": | ||
1093 | |||
1094 | main(str(opts.modname), opts.protoident) | ||
diff --git a/Documentation/target/tcm_mod_builder.txt b/Documentation/target/tcm_mod_builder.txt new file mode 100644 index 00000000000..84533d8e747 --- /dev/null +++ b/Documentation/target/tcm_mod_builder.txt | |||
@@ -0,0 +1,145 @@ | |||
1 | >>>>>>>>>> The TCM v4 fabric module script generator <<<<<<<<<< | ||
2 | |||
3 | Greetings all, | ||
4 | |||
5 | This document is intended to be a mini-HOWTO for using the tcm_mod_builder.py | ||
6 | script to generate a brand new functional TCM v4 fabric .ko module of your very own, | ||
7 | that once built can be immediately be loaded to start access the new TCM/ConfigFS | ||
8 | fabric skeleton, by simply using: | ||
9 | |||
10 | modprobe $TCM_NEW_MOD | ||
11 | mkdir -p /sys/kernel/config/target/$TCM_NEW_MOD | ||
12 | |||
13 | This script will create a new drivers/target/$TCM_NEW_MOD/, and will do the following | ||
14 | |||
15 | *) Generate new API callers for drivers/target/target_core_fabric_configs.c logic | ||
16 | ->make_nodeacl(), ->drop_nodeacl(), ->make_tpg(), ->drop_tpg() | ||
17 | ->make_wwn(), ->drop_wwn(). These are created into $TCM_NEW_MOD/$TCM_NEW_MOD_configfs.c | ||
18 | *) Generate basic infrastructure for loading/unloading LKMs and TCM/ConfigFS fabric module | ||
19 | using a skeleton struct target_core_fabric_ops API template. | ||
20 | *) Based on user defined T10 Proto_Ident for the new fabric module being built, | ||
21 | the TransportID / Initiator and Target WWPN related handlers for | ||
22 | SPC-3 persistent reservation are automatically generated in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.c | ||
23 | using drivers/target/target_core_fabric_lib.c logic. | ||
24 | *) NOP API calls for all other Data I/O path and fabric dependent attribute logic | ||
25 | in $TCM_NEW_MOD/$TCM_NEW_MOD_fabric.c | ||
26 | |||
27 | tcm_mod_builder.py depends upon the mandatory '-p $PROTO_IDENT' and '-m | ||
28 | $FABRIC_MOD_name' parameters, and actually running the script looks like: | ||
29 | |||
30 | target:/mnt/sdb/lio-core-2.6.git/Documentation/target# python tcm_mod_builder.py -p iSCSI -m tcm_nab5000 | ||
31 | tcm_dir: /mnt/sdb/lio-core-2.6.git/Documentation/target/../../ | ||
32 | Set fabric_mod_name: tcm_nab5000 | ||
33 | Set fabric_mod_dir: | ||
34 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000 | ||
35 | Using proto_ident: iSCSI | ||
36 | Creating fabric_mod_dir: | ||
37 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000 | ||
38 | Writing file: | ||
39 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_base.h | ||
40 | Using tcm_mod_scan_fabric_ops: | ||
41 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../include/target/target_core_fabric_ops.h | ||
42 | Writing file: | ||
43 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.c | ||
44 | Writing file: | ||
45 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_fabric.h | ||
46 | Writing file: | ||
47 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/tcm_nab5000_configfs.c | ||
48 | Writing file: | ||
49 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kbuild | ||
50 | Writing file: | ||
51 | /mnt/sdb/lio-core-2.6.git/Documentation/target/../../drivers/target/tcm_nab5000/Kconfig | ||
52 | Would you like to add tcm_nab5000to drivers/target/Kbuild..? [yes,no]: yes | ||
53 | Would you like to add tcm_nab5000to drivers/target/Kconfig..? [yes,no]: yes | ||
54 | |||
55 | At the end of tcm_mod_builder.py. the script will ask to add the following | ||
56 | line to drivers/target/Kbuild: | ||
57 | |||
58 | obj-$(CONFIG_TCM_NAB5000) += tcm_nab5000/ | ||
59 | |||
60 | and the same for drivers/target/Kconfig: | ||
61 | |||
62 | source "drivers/target/tcm_nab5000/Kconfig" | ||
63 | |||
64 | *) Run 'make menuconfig' and select the new CONFIG_TCM_NAB5000 item: | ||
65 | |||
66 | <M> TCM_NAB5000 fabric module | ||
67 | |||
68 | *) Build using 'make modules', once completed you will have: | ||
69 | |||
70 | target:/mnt/sdb/lio-core-2.6.git# ls -la drivers/target/tcm_nab5000/ | ||
71 | total 1348 | ||
72 | drwxr-xr-x 2 root root 4096 2010-10-05 03:23 . | ||
73 | drwxr-xr-x 9 root root 4096 2010-10-05 03:22 .. | ||
74 | -rw-r--r-- 1 root root 282 2010-10-05 03:22 Kbuild | ||
75 | -rw-r--r-- 1 root root 171 2010-10-05 03:22 Kconfig | ||
76 | -rw-r--r-- 1 root root 49 2010-10-05 03:23 modules.order | ||
77 | -rw-r--r-- 1 root root 738 2010-10-05 03:22 tcm_nab5000_base.h | ||
78 | -rw-r--r-- 1 root root 9096 2010-10-05 03:22 tcm_nab5000_configfs.c | ||
79 | -rw-r--r-- 1 root root 191200 2010-10-05 03:23 tcm_nab5000_configfs.o | ||
80 | -rw-r--r-- 1 root root 40504 2010-10-05 03:23 .tcm_nab5000_configfs.o.cmd | ||
81 | -rw-r--r-- 1 root root 5414 2010-10-05 03:22 tcm_nab5000_fabric.c | ||
82 | -rw-r--r-- 1 root root 2016 2010-10-05 03:22 tcm_nab5000_fabric.h | ||
83 | -rw-r--r-- 1 root root 190932 2010-10-05 03:23 tcm_nab5000_fabric.o | ||
84 | -rw-r--r-- 1 root root 40713 2010-10-05 03:23 .tcm_nab5000_fabric.o.cmd | ||
85 | -rw-r--r-- 1 root root 401861 2010-10-05 03:23 tcm_nab5000.ko | ||
86 | -rw-r--r-- 1 root root 265 2010-10-05 03:23 .tcm_nab5000.ko.cmd | ||
87 | -rw-r--r-- 1 root root 459 2010-10-05 03:23 tcm_nab5000.mod.c | ||
88 | -rw-r--r-- 1 root root 23896 2010-10-05 03:23 tcm_nab5000.mod.o | ||
89 | -rw-r--r-- 1 root root 22655 2010-10-05 03:23 .tcm_nab5000.mod.o.cmd | ||
90 | -rw-r--r-- 1 root root 379022 2010-10-05 03:23 tcm_nab5000.o | ||
91 | -rw-r--r-- 1 root root 211 2010-10-05 03:23 .tcm_nab5000.o.cmd | ||
92 | |||
93 | *) Load the new module, create a lun_0 configfs group, and add new TCM Core | ||
94 | IBLOCK backstore symlink to port: | ||
95 | |||
96 | target:/mnt/sdb/lio-core-2.6.git# insmod drivers/target/tcm_nab5000.ko | ||
97 | target:/mnt/sdb/lio-core-2.6.git# mkdir -p /sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0 | ||
98 | target:/mnt/sdb/lio-core-2.6.git# cd /sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0/ | ||
99 | target:/sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0# ln -s /sys/kernel/config/target/core/iblock_0/lvm_test0 nab5000_port | ||
100 | |||
101 | target:/sys/kernel/config/target/nab5000/iqn.foo/tpgt_1/lun/lun_0# cd - | ||
102 | target:/mnt/sdb/lio-core-2.6.git# tree /sys/kernel/config/target/nab5000/ | ||
103 | /sys/kernel/config/target/nab5000/ | ||
104 | |-- discovery_auth | ||
105 | |-- iqn.foo | ||
106 | | `-- tpgt_1 | ||
107 | | |-- acls | ||
108 | | |-- attrib | ||
109 | | |-- lun | ||
110 | | | `-- lun_0 | ||
111 | | | |-- alua_tg_pt_gp | ||
112 | | | |-- alua_tg_pt_offline | ||
113 | | | |-- alua_tg_pt_status | ||
114 | | | |-- alua_tg_pt_write_md | ||
115 | | | `-- nab5000_port -> ../../../../../../target/core/iblock_0/lvm_test0 | ||
116 | | |-- np | ||
117 | | `-- param | ||
118 | `-- version | ||
119 | |||
120 | target:/mnt/sdb/lio-core-2.6.git# lsmod | ||
121 | Module Size Used by | ||
122 | tcm_nab5000 3935 4 | ||
123 | iscsi_target_mod 193211 0 | ||
124 | target_core_stgt 8090 0 | ||
125 | target_core_pscsi 11122 1 | ||
126 | target_core_file 9172 2 | ||
127 | target_core_iblock 9280 1 | ||
128 | target_core_mod 228575 31 | ||
129 | tcm_nab5000,iscsi_target_mod,target_core_stgt,target_core_pscsi,target_core_file,target_core_iblock | ||
130 | libfc 73681 0 | ||
131 | scsi_debug 56265 0 | ||
132 | scsi_tgt 8666 1 target_core_stgt | ||
133 | configfs 20644 2 target_core_mod | ||
134 | |||
135 | ---------------------------------------------------------------------- | ||
136 | |||
137 | Future TODO items: | ||
138 | |||
139 | *) Add more T10 proto_idents | ||
140 | *) Make tcm_mod_dump_fabric_ops() smarter and generate function pointer | ||
141 | defs directly from include/target/target_core_fabric_ops.h:struct target_core_fabric_ops | ||
142 | structure members. | ||
143 | |||
144 | October 5th, 2010 | ||
145 | Nicholas A. Bellinger <nab@linux-iscsi.org> | ||
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index cb3d15bc1ae..b61e46f449a 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
@@ -278,3 +278,15 @@ method, the sys I/F structure will be built like this: | |||
278 | |---name: acpitz | 278 | |---name: acpitz |
279 | |---temp1_input: 37000 | 279 | |---temp1_input: 37000 |
280 | |---temp1_crit: 100000 | 280 | |---temp1_crit: 100000 |
281 | |||
282 | 4. Event Notification | ||
283 | |||
284 | The framework includes a simple notification mechanism, in the form of a | ||
285 | netlink event. Netlink socket initialization is done during the _init_ | ||
286 | of the framework. Drivers which intend to use the notification mechanism | ||
287 | just need to call generate_netlink_event() with two arguments viz | ||
288 | (originator, event). Typically the originator will be an integer assigned | ||
289 | to a thermal_zone_device when it registers itself with the framework. The | ||
290 | event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL, | ||
291 | THERMAL_DEV_FAULT}. Notification can be sent when the current temperature | ||
292 | crosses any of the configured thresholds. | ||
diff --git a/Documentation/video4linux/v4l2-controls.txt b/Documentation/video4linux/v4l2-controls.txt index 8773778d23f..881e7f44491 100644 --- a/Documentation/video4linux/v4l2-controls.txt +++ b/Documentation/video4linux/v4l2-controls.txt | |||
@@ -285,6 +285,9 @@ implement g_volatile_ctrl like this: | |||
285 | The 'new value' union is not used in g_volatile_ctrl. In general controls | 285 | The 'new value' union is not used in g_volatile_ctrl. In general controls |
286 | that need to implement g_volatile_ctrl are read-only controls. | 286 | that need to implement g_volatile_ctrl are read-only controls. |
287 | 287 | ||
288 | Note that if one or more controls in a control cluster are marked as volatile, | ||
289 | then all the controls in the cluster are seen as volatile. | ||
290 | |||
288 | To mark a control as volatile you have to set the is_volatile flag: | 291 | To mark a control as volatile you have to set the is_volatile flag: |
289 | 292 | ||
290 | ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); | 293 | ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...); |
@@ -462,6 +465,15 @@ pointer to the v4l2_ctrl_ops struct that is used for that cluster. | |||
462 | Obviously, all controls in the cluster array must be initialized to either | 465 | Obviously, all controls in the cluster array must be initialized to either |
463 | a valid control or to NULL. | 466 | a valid control or to NULL. |
464 | 467 | ||
468 | In rare cases you might want to know which controls of a cluster actually | ||
469 | were set explicitly by the user. For this you can check the 'is_new' flag of | ||
470 | each control. For example, in the case of a volume/mute cluster the 'is_new' | ||
471 | flag of the mute control would be set if the user called VIDIOC_S_CTRL for | ||
472 | mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume | ||
473 | controls, then the 'is_new' flag would be 1 for both controls. | ||
474 | |||
475 | The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup(). | ||
476 | |||
465 | 477 | ||
466 | VIDIOC_LOG_STATUS Support | 478 | VIDIOC_LOG_STATUS Support |
467 | ========================= | 479 | ========================= |
diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt new file mode 100644 index 00000000000..0924aaca330 --- /dev/null +++ b/Documentation/vm/transhuge.txt | |||
@@ -0,0 +1,298 @@ | |||
1 | = Transparent Hugepage Support = | ||
2 | |||
3 | == Objective == | ||
4 | |||
5 | Performance critical computing applications dealing with large memory | ||
6 | working sets are already running on top of libhugetlbfs and in turn | ||
7 | hugetlbfs. Transparent Hugepage Support is an alternative means of | ||
8 | using huge pages for the backing of virtual memory with huge pages | ||
9 | that supports the automatic promotion and demotion of page sizes and | ||
10 | without the shortcomings of hugetlbfs. | ||
11 | |||
12 | Currently it only works for anonymous memory mappings but in the | ||
13 | future it can expand over the pagecache layer starting with tmpfs. | ||
14 | |||
15 | The reason applications are running faster is because of two | ||
16 | factors. The first factor is almost completely irrelevant and it's not | ||
17 | of significant interest because it'll also have the downside of | ||
18 | requiring larger clear-page copy-page in page faults which is a | ||
19 | potentially negative effect. The first factor consists in taking a | ||
20 | single page fault for each 2M virtual region touched by userland (so | ||
21 | reducing the enter/exit kernel frequency by a 512 times factor). This | ||
22 | only matters the first time the memory is accessed for the lifetime of | ||
23 | a memory mapping. The second long lasting and much more important | ||
24 | factor will affect all subsequent accesses to the memory for the whole | ||
25 | runtime of the application. The second factor consist of two | ||
26 | components: 1) the TLB miss will run faster (especially with | ||
27 | virtualization using nested pagetables but almost always also on bare | ||
28 | metal without virtualization) and 2) a single TLB entry will be | ||
29 | mapping a much larger amount of virtual memory in turn reducing the | ||
30 | number of TLB misses. With virtualization and nested pagetables the | ||
31 | TLB can be mapped of larger size only if both KVM and the Linux guest | ||
32 | are using hugepages but a significant speedup already happens if only | ||
33 | one of the two is using hugepages just because of the fact the TLB | ||
34 | miss is going to run faster. | ||
35 | |||
36 | == Design == | ||
37 | |||
38 | - "graceful fallback": mm components which don't have transparent | ||
39 | hugepage knowledge fall back to breaking a transparent hugepage and | ||
40 | working on the regular pages and their respective regular pmd/pte | ||
41 | mappings | ||
42 | |||
43 | - if a hugepage allocation fails because of memory fragmentation, | ||
44 | regular pages should be gracefully allocated instead and mixed in | ||
45 | the same vma without any failure or significant delay and without | ||
46 | userland noticing | ||
47 | |||
48 | - if some task quits and more hugepages become available (either | ||
49 | immediately in the buddy or through the VM), guest physical memory | ||
50 | backed by regular pages should be relocated on hugepages | ||
51 | automatically (with khugepaged) | ||
52 | |||
53 | - it doesn't require memory reservation and in turn it uses hugepages | ||
54 | whenever possible (the only possible reservation here is kernelcore= | ||
55 | to avoid unmovable pages to fragment all the memory but such a tweak | ||
56 | is not specific to transparent hugepage support and it's a generic | ||
57 | feature that applies to all dynamic high order allocations in the | ||
58 | kernel) | ||
59 | |||
60 | - this initial support only offers the feature in the anonymous memory | ||
61 | regions but it'd be ideal to move it to tmpfs and the pagecache | ||
62 | later | ||
63 | |||
64 | Transparent Hugepage Support maximizes the usefulness of free memory | ||
65 | if compared to the reservation approach of hugetlbfs by allowing all | ||
66 | unused memory to be used as cache or other movable (or even unmovable | ||
67 | entities). It doesn't require reservation to prevent hugepage | ||
68 | allocation failures to be noticeable from userland. It allows paging | ||
69 | and all other advanced VM features to be available on the | ||
70 | hugepages. It requires no modifications for applications to take | ||
71 | advantage of it. | ||
72 | |||
73 | Applications however can be further optimized to take advantage of | ||
74 | this feature, like for example they've been optimized before to avoid | ||
75 | a flood of mmap system calls for every malloc(4k). Optimizing userland | ||
76 | is by far not mandatory and khugepaged already can take care of long | ||
77 | lived page allocations even for hugepage unaware applications that | ||
78 | deals with large amounts of memory. | ||
79 | |||
80 | In certain cases when hugepages are enabled system wide, application | ||
81 | may end up allocating more memory resources. An application may mmap a | ||
82 | large region but only touch 1 byte of it, in that case a 2M page might | ||
83 | be allocated instead of a 4k page for no good. This is why it's | ||
84 | possible to disable hugepages system-wide and to only have them inside | ||
85 | MADV_HUGEPAGE madvise regions. | ||
86 | |||
87 | Embedded systems should enable hugepages only inside madvise regions | ||
88 | to eliminate any risk of wasting any precious byte of memory and to | ||
89 | only run faster. | ||
90 | |||
91 | Applications that gets a lot of benefit from hugepages and that don't | ||
92 | risk to lose memory by using hugepages, should use | ||
93 | madvise(MADV_HUGEPAGE) on their critical mmapped regions. | ||
94 | |||
95 | == sysfs == | ||
96 | |||
97 | Transparent Hugepage Support can be entirely disabled (mostly for | ||
98 | debugging purposes) or only enabled inside MADV_HUGEPAGE regions (to | ||
99 | avoid the risk of consuming more memory resources) or enabled system | ||
100 | wide. This can be achieved with one of: | ||
101 | |||
102 | echo always >/sys/kernel/mm/transparent_hugepage/enabled | ||
103 | echo madvise >/sys/kernel/mm/transparent_hugepage/enabled | ||
104 | echo never >/sys/kernel/mm/transparent_hugepage/enabled | ||
105 | |||
106 | It's also possible to limit defrag efforts in the VM to generate | ||
107 | hugepages in case they're not immediately free to madvise regions or | ||
108 | to never try to defrag memory and simply fallback to regular pages | ||
109 | unless hugepages are immediately available. Clearly if we spend CPU | ||
110 | time to defrag memory, we would expect to gain even more by the fact | ||
111 | we use hugepages later instead of regular pages. This isn't always | ||
112 | guaranteed, but it may be more likely in case the allocation is for a | ||
113 | MADV_HUGEPAGE region. | ||
114 | |||
115 | echo always >/sys/kernel/mm/transparent_hugepage/defrag | ||
116 | echo madvise >/sys/kernel/mm/transparent_hugepage/defrag | ||
117 | echo never >/sys/kernel/mm/transparent_hugepage/defrag | ||
118 | |||
119 | khugepaged will be automatically started when | ||
120 | transparent_hugepage/enabled is set to "always" or "madvise, and it'll | ||
121 | be automatically shutdown if it's set to "never". | ||
122 | |||
123 | khugepaged runs usually at low frequency so while one may not want to | ||
124 | invoke defrag algorithms synchronously during the page faults, it | ||
125 | should be worth invoking defrag at least in khugepaged. However it's | ||
126 | also possible to disable defrag in khugepaged: | ||
127 | |||
128 | echo yes >/sys/kernel/mm/transparent_hugepage/khugepaged/defrag | ||
129 | echo no >/sys/kernel/mm/transparent_hugepage/khugepaged/defrag | ||
130 | |||
131 | You can also control how many pages khugepaged should scan at each | ||
132 | pass: | ||
133 | |||
134 | /sys/kernel/mm/transparent_hugepage/khugepaged/pages_to_scan | ||
135 | |||
136 | and how many milliseconds to wait in khugepaged between each pass (you | ||
137 | can set this to 0 to run khugepaged at 100% utilization of one core): | ||
138 | |||
139 | /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs | ||
140 | |||
141 | and how many milliseconds to wait in khugepaged if there's an hugepage | ||
142 | allocation failure to throttle the next allocation attempt. | ||
143 | |||
144 | /sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs | ||
145 | |||
146 | The khugepaged progress can be seen in the number of pages collapsed: | ||
147 | |||
148 | /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed | ||
149 | |||
150 | for each pass: | ||
151 | |||
152 | /sys/kernel/mm/transparent_hugepage/khugepaged/full_scans | ||
153 | |||
154 | == Boot parameter == | ||
155 | |||
156 | You can change the sysfs boot time defaults of Transparent Hugepage | ||
157 | Support by passing the parameter "transparent_hugepage=always" or | ||
158 | "transparent_hugepage=madvise" or "transparent_hugepage=never" | ||
159 | (without "") to the kernel command line. | ||
160 | |||
161 | == Need of application restart == | ||
162 | |||
163 | The transparent_hugepage/enabled values only affect future | ||
164 | behavior. So to make them effective you need to restart any | ||
165 | application that could have been using hugepages. This also applies to | ||
166 | the regions registered in khugepaged. | ||
167 | |||
168 | == get_user_pages and follow_page == | ||
169 | |||
170 | get_user_pages and follow_page if run on a hugepage, will return the | ||
171 | head or tail pages as usual (exactly as they would do on | ||
172 | hugetlbfs). Most gup users will only care about the actual physical | ||
173 | address of the page and its temporary pinning to release after the I/O | ||
174 | is complete, so they won't ever notice the fact the page is huge. But | ||
175 | if any driver is going to mangle over the page structure of the tail | ||
176 | page (like for checking page->mapping or other bits that are relevant | ||
177 | for the head page and not the tail page), it should be updated to jump | ||
178 | to check head page instead (while serializing properly against | ||
179 | split_huge_page() to avoid the head and tail pages to disappear from | ||
180 | under it, see the futex code to see an example of that, hugetlbfs also | ||
181 | needed special handling in futex code for similar reasons). | ||
182 | |||
183 | NOTE: these aren't new constraints to the GUP API, and they match the | ||
184 | same constrains that applies to hugetlbfs too, so any driver capable | ||
185 | of handling GUP on hugetlbfs will also work fine on transparent | ||
186 | hugepage backed mappings. | ||
187 | |||
188 | In case you can't handle compound pages if they're returned by | ||
189 | follow_page, the FOLL_SPLIT bit can be specified as parameter to | ||
190 | follow_page, so that it will split the hugepages before returning | ||
191 | them. Migration for example passes FOLL_SPLIT as parameter to | ||
192 | follow_page because it's not hugepage aware and in fact it can't work | ||
193 | at all on hugetlbfs (but it instead works fine on transparent | ||
194 | hugepages thanks to FOLL_SPLIT). migration simply can't deal with | ||
195 | hugepages being returned (as it's not only checking the pfn of the | ||
196 | page and pinning it during the copy but it pretends to migrate the | ||
197 | memory in regular page sizes and with regular pte/pmd mappings). | ||
198 | |||
199 | == Optimizing the applications == | ||
200 | |||
201 | To be guaranteed that the kernel will map a 2M page immediately in any | ||
202 | memory region, the mmap region has to be hugepage naturally | ||
203 | aligned. posix_memalign() can provide that guarantee. | ||
204 | |||
205 | == Hugetlbfs == | ||
206 | |||
207 | You can use hugetlbfs on a kernel that has transparent hugepage | ||
208 | support enabled just fine as always. No difference can be noted in | ||
209 | hugetlbfs other than there will be less overall fragmentation. All | ||
210 | usual features belonging to hugetlbfs are preserved and | ||
211 | unaffected. libhugetlbfs will also work fine as usual. | ||
212 | |||
213 | == Graceful fallback == | ||
214 | |||
215 | Code walking pagetables but unware about huge pmds can simply call | ||
216 | split_huge_page_pmd(mm, pmd) where the pmd is the one returned by | ||
217 | pmd_offset. It's trivial to make the code transparent hugepage aware | ||
218 | by just grepping for "pmd_offset" and adding split_huge_page_pmd where | ||
219 | missing after pmd_offset returns the pmd. Thanks to the graceful | ||
220 | fallback design, with a one liner change, you can avoid to write | ||
221 | hundred if not thousand of lines of complex code to make your code | ||
222 | hugepage aware. | ||
223 | |||
224 | If you're not walking pagetables but you run into a physical hugepage | ||
225 | but you can't handle it natively in your code, you can split it by | ||
226 | calling split_huge_page(page). This is what the Linux VM does before | ||
227 | it tries to swapout the hugepage for example. | ||
228 | |||
229 | Example to make mremap.c transparent hugepage aware with a one liner | ||
230 | change: | ||
231 | |||
232 | diff --git a/mm/mremap.c b/mm/mremap.c | ||
233 | --- a/mm/mremap.c | ||
234 | +++ b/mm/mremap.c | ||
235 | @@ -41,6 +41,7 @@ static pmd_t *get_old_pmd(struct mm_stru | ||
236 | return NULL; | ||
237 | |||
238 | pmd = pmd_offset(pud, addr); | ||
239 | + split_huge_page_pmd(mm, pmd); | ||
240 | if (pmd_none_or_clear_bad(pmd)) | ||
241 | return NULL; | ||
242 | |||
243 | == Locking in hugepage aware code == | ||
244 | |||
245 | We want as much code as possible hugepage aware, as calling | ||
246 | split_huge_page() or split_huge_page_pmd() has a cost. | ||
247 | |||
248 | To make pagetable walks huge pmd aware, all you need to do is to call | ||
249 | pmd_trans_huge() on the pmd returned by pmd_offset. You must hold the | ||
250 | mmap_sem in read (or write) mode to be sure an huge pmd cannot be | ||
251 | created from under you by khugepaged (khugepaged collapse_huge_page | ||
252 | takes the mmap_sem in write mode in addition to the anon_vma lock). If | ||
253 | pmd_trans_huge returns false, you just fallback in the old code | ||
254 | paths. If instead pmd_trans_huge returns true, you have to take the | ||
255 | mm->page_table_lock and re-run pmd_trans_huge. Taking the | ||
256 | page_table_lock will prevent the huge pmd to be converted into a | ||
257 | regular pmd from under you (split_huge_page can run in parallel to the | ||
258 | pagetable walk). If the second pmd_trans_huge returns false, you | ||
259 | should just drop the page_table_lock and fallback to the old code as | ||
260 | before. Otherwise you should run pmd_trans_splitting on the pmd. In | ||
261 | case pmd_trans_splitting returns true, it means split_huge_page is | ||
262 | already in the middle of splitting the page. So if pmd_trans_splitting | ||
263 | returns true it's enough to drop the page_table_lock and call | ||
264 | wait_split_huge_page and then fallback the old code paths. You are | ||
265 | guaranteed by the time wait_split_huge_page returns, the pmd isn't | ||
266 | huge anymore. If pmd_trans_splitting returns false, you can proceed to | ||
267 | process the huge pmd and the hugepage natively. Once finished you can | ||
268 | drop the page_table_lock. | ||
269 | |||
270 | == compound_lock, get_user_pages and put_page == | ||
271 | |||
272 | split_huge_page internally has to distribute the refcounts in the head | ||
273 | page to the tail pages before clearing all PG_head/tail bits from the | ||
274 | page structures. It can do that easily for refcounts taken by huge pmd | ||
275 | mappings. But the GUI API as created by hugetlbfs (that returns head | ||
276 | and tail pages if running get_user_pages on an address backed by any | ||
277 | hugepage), requires the refcount to be accounted on the tail pages and | ||
278 | not only in the head pages, if we want to be able to run | ||
279 | split_huge_page while there are gup pins established on any tail | ||
280 | page. Failure to be able to run split_huge_page if there's any gup pin | ||
281 | on any tail page, would mean having to split all hugepages upfront in | ||
282 | get_user_pages which is unacceptable as too many gup users are | ||
283 | performance critical and they must work natively on hugepages like | ||
284 | they work natively on hugetlbfs already (hugetlbfs is simpler because | ||
285 | hugetlbfs pages cannot be splitted so there wouldn't be requirement of | ||
286 | accounting the pins on the tail pages for hugetlbfs). If we wouldn't | ||
287 | account the gup refcounts on the tail pages during gup, we won't know | ||
288 | anymore which tail page is pinned by gup and which is not while we run | ||
289 | split_huge_page. But we still have to add the gup pin to the head page | ||
290 | too, to know when we can free the compound page in case it's never | ||
291 | splitted during its lifetime. That requires changing not just | ||
292 | get_page, but put_page as well so that when put_page runs on a tail | ||
293 | page (and only on a tail page) it will find its respective head page, | ||
294 | and then it will decrease the head page refcount in addition to the | ||
295 | tail page refcount. To obtain a head page reliably and to decrease its | ||
296 | refcount without race conditions, put_page has to serialize against | ||
297 | __split_huge_page_refcount using a special per-page lock called | ||
298 | compound_lock. | ||